diff --git a/docs/capabilities/activity.yaml b/docs/capabilities/activity.yaml new file mode 100644 index 00000000..f7cf450e --- /dev/null +++ b/docs/capabilities/activity.yaml @@ -0,0 +1,23 @@ +activity: + title: Activity timeline + promise: > + The Activity page lists what changed, newest first, by you or an agent ("via + ChatGPT"), with filters by area. Its MCP tab shows agent tool calls with a summary + of clients and top tools. + entry: [app/src/routes/activity.tsx, app/src/server/mcp/activity-tools.ts] + implementation: + - app/src/server/events/action-events.ts + - app/src/server/events/event-scope.ts + - app/src/components/activity/ActivityEventRow.tsx + - app/src/components/activity/ActivityTimeline.tsx + - app/src/components/activity/ActivityToolbar.tsx + - app/src/components/activity/McpActivityPanel.tsx + - app/src/components/activity/activity-format.ts + - app/src/components/activity/useActivityFilters.ts + - app/src/server/activity/activity-store.ts + - app/src/server/activity/mcp-activity-store.ts + - app/src/services/activity/activity.actions.ts + - app/src/services/activity/activity.queries.ts + - app/src/services/activity/activity.service.ts + - app/src/services/activity/activity.types.ts + tests: [app/src/components/activity/activity-format.test.ts, app/src/server/mcp/activity-tools.test.ts] diff --git a/docs/capabilities/admin.yaml b/docs/capabilities/admin.yaml new file mode 100644 index 00000000..9a55010a --- /dev/null +++ b/docs/capabilities/admin.yaml @@ -0,0 +1,21 @@ +admin: + title: Admin tools + promise: > + The Admin page runs one-off data migrations with a dry run first and shows their + progress, and lists connected agents. + +admin-migrations: + parent: admin + title: Data migrations + promise: > + Move inline images out of note bodies into stored files, and convert notes to + block storage, without losing text. Each run shows what it would change first. + entry: [app/src/routes/admin/index.tsx, app/src/routes/admin/migrations.tsx] + implementation: + - app/src/components/admin/BlockMigrationPanel.tsx + - app/src/services/admin/block-migration.actions.ts + - app/src/services/admin/inline-image-migration.actions.ts + - app/src/services/admin/inline-image-migration.queries.ts + - app/src/services/admin/inline-image-migration.types.ts + - app/src/server/lib/inline-image-migration.ts + tests: [app/src/server/notes/block-migration.test.ts] diff --git a/docs/capabilities/agent-inbox.yaml b/docs/capabilities/agent-inbox.yaml new file mode 100644 index 00000000..b9b07c43 --- /dev/null +++ b/docs/capabilities/agent-inbox.yaml @@ -0,0 +1,14 @@ +agent-inbox: + parent: annotations + title: Agent inbox + promise: > + The Inbox lists the requests you left for agents and what they did, grouped by what + needs you. The sidebar shows how many items wait for you. + docs: [app/docs/agent-inbox.md] + entry: [app/src/routes/inbox.tsx] + implementation: + - app/src/components/inbox/InboxBadge.tsx + - app/src/components/inbox/InboxView.tsx + - app/src/components/inbox/NeedsYouItem.tsx + - app/src/components/inbox/inbox-format.ts + tests: [app/src/server/annotations/user-inbox.db.test.ts] diff --git a/docs/capabilities/ai.yaml b/docs/capabilities/ai.yaml new file mode 100644 index 00000000..79c0d09d --- /dev/null +++ b/docs/capabilities/ai.yaml @@ -0,0 +1,65 @@ +ai: + title: In-app AI + promise: > + Talk to an AI assistant about your notes and run saved prompts on a note or a selection. + Every run is recorded so you can see what was sent, what came back and what it cost. + entry: [app/src/components/ai/LLMSidebarHost.tsx] + implementation: + - app/src/server/lib/ai.ts + - app/src/components/ai/LLMSidebar.tsx + - app/src/components/ai/LLMSidebarBus.ts + - app/src/components/ModelSelect.tsx + - app/src/services/ai/ai-auth.ts + - app/src/services/ai/ai-chat.actions.ts + - app/src/services/ai/ai-chat.queries.ts + - app/src/services/ai/ai-models.queries.ts + tests: [app/src/server/lib/ai.test.ts, app/tests/e2e/route-hydration-smoke.spec.ts] + +ai-prompts: + parent: ai + title: Write and version prompts + promise: > + Create a prompt, edit it, and keep earlier versions. A prompt designer interviews you and drafts the prompt text. + The prompt list shows how often each prompt ran and failed. + entry: + - app/src/routes/ai/prompts/[id].tsx + implementation: + - app/src/components/ai-dashboard/PromptDialogs.tsx + - app/src/components/ai-dashboard/PromptsTable.tsx + - app/src/services/ai/ai-prompt-designer.actions.ts + - app/src/services/prompts/prompts.actions.ts + - app/src/services/prompts/prompts.queries.ts + tests: + - path: app/src/components/ai-dashboard/ai-dashboard-model.test.ts + only: [statsByPrompt] + +ai-prompt-runs: + parent: ai + title: Run a prompt on a note + promise: > + Run a prompt on a whole note or a selected passage with a chosen model. + The result is saved as a run you can open later. + entry: + - app/src/routes/ai/runs/[id].tsx + implementation: + - app/src/services/ai/ai-run-prompt.actions.ts + - app/src/services/ai/ai-runs.queries.ts + - app/src/components/ai-dashboard/RunStatusIcon.tsx + tests: + - path: app/src/components/ai-dashboard/ai-dashboard-model.test.ts + only: [previewText] + +ai-dashboard: + parent: ai + title: AI dashboard + promise: > + See recent runs and paid model calls in one place. + Filter runs by status and search by task, model or error text. + entry: [app/src/routes/ai/index.tsx] + implementation: + - app/src/components/ai-dashboard/PaidCallsTable.tsx + - app/src/components/ai-dashboard/RunsTable.tsx + - app/src/components/ai-dashboard/ai-dashboard-model.ts + tests: + - path: app/src/components/ai-dashboard/ai-dashboard-model.test.ts + only: [runMatchesQuery] diff --git a/docs/capabilities/annotations.yaml b/docs/capabilities/annotations.yaml new file mode 100644 index 00000000..34ac569d --- /dev/null +++ b/docs/capabilities/annotations.yaml @@ -0,0 +1,96 @@ +annotations: + title: Annotations + promise: > + Comment on a passage of a note, ask an assistant a question there, and review the edits it + proposes before they touch the note. + docs: [app/docs/agent-inbox.md] + +annotation-notes: + parent: annotations + title: Annotate a passage + promise: > + Select text and add an annotation of a chosen type. Annotations sit in a rail beside the note at + the passage they belong to, with a legend by type, and stay attached when the note changes. + entry: [app/src/components/annotations/AnnotationRail.tsx] + implementation: + - app/src/components/annotations/AnnotationComposer.tsx + - app/src/components/annotations/AnnotationEntry.tsx + - app/src/components/annotations/AnnotationEntryMenu.tsx + - app/src/components/annotations/AnnotationLayer.tsx + - app/src/components/annotations/AnnotationLegend.tsx + - app/src/components/annotations/RailChrome.tsx + - app/src/components/annotations/annotation-context.ts + - app/src/components/annotations/railLayout.ts + - app/src/components/editor/annotations/annotationPlugin.ts + - app/src/components/editor/annotations/blockText.ts + - app/src/components/editor/annotations/passage.ts + - app/src/lib/annotations/anchor.ts + - app/src/lib/annotations/block-hash.ts + - app/src/lib/annotations/types.ts + - app/src/server/annotations/annotations.ts + - app/src/server/annotations/errors.ts + - app/src/services/annotations/annotations.actions.ts + - app/src/services/annotations/annotations.queries.ts + tests: + - app/src/components/annotations/railLayout.test.ts + - app/src/components/editor/annotations/annotationPlugin.test.ts + - app/src/server/annotations/annotations.db.test.ts + +annotation-types: + parent: annotations + title: Annotation types + promise: > + Define your own annotation types, each with a name and color, and edit or remove them from the + types dialog. + entry: [app/src/components/annotations/AnnotationTypesDialog.tsx] + implementation: + - app/src/server/annotations/annotation-types.ts + tests: + - app/src/server/annotations/annotations.db.test.ts + +annotation-requests: + parent: annotations + title: Ask an assistant from a note + promise: > + Turn an annotation into a request to an assistant, follow its reply in a thread, and see open + requests in your inbox. An assistant claims a request, answers it, and your inbox shows the + answer. + entry: [app/src/components/annotations/RequestThread.tsx] + implementation: + - app/src/components/annotations/NoteToAiButton.tsx + - app/src/components/annotations/TaskRequests.tsx + - app/src/lib/annotations/inbox-types.ts + - app/src/server/annotations/agent-inbox.ts + - app/src/server/annotations/requests.ts + - app/src/server/annotations/user-inbox.ts + tests: + - app/src/server/annotations/requests.db.test.ts + - app/src/server/annotations/user-inbox.db.test.ts + +edit-proposals: + parent: annotations + title: Review proposed edits + promise: > + An assistant can propose changes to a block. The proposal shows over the note, and you accept or + reject it. Nothing changes the note body until you accept. + entry: [app/src/components/annotations/ProposalLayer.tsx] + implementation: + - app/src/components/editor/proposals/proposalPlugin.ts + - app/src/components/editor/proposals/proposalStyles.ts + - app/src/components/editor/proposals/proposalTransaction.ts + - app/src/server/annotations/proposals.ts + - app/src/server/annotations/switch.ts + tests: + - app/src/components/editor/proposals/proposalTransaction.test.ts + - app/src/server/annotations/proposals.db.test.ts + +annotation-agent-tools: + parent: annotations + title: Assistants answer annotations + promise: > + A connected assistant can list open requests, claim and answer them, and propose block edits. These + tools never write a note body directly. + entry: [app/src/server/mcp/annotations-tools.ts] + tests: + - app/src/server/annotations/requests.db.test.ts + - app/src/server/annotations/proposals.db.test.ts diff --git a/docs/capabilities/app-shell.yaml b/docs/capabilities/app-shell.yaml new file mode 100644 index 00000000..551a1e80 --- /dev/null +++ b/docs/capabilities/app-shell.yaml @@ -0,0 +1,98 @@ +app-shell: + title: App shell + promise: > + Every page sits in one shell: a sidebar with the main sections and recent notes, + a command palette, sign-in, and clear pages for errors and missing routes. + entry: [app/src/app.tsx, app/src/routes/index.tsx] + tests: [app/tests/e2e/homepage.spec.ts, app/tests/e2e/route-hydration-smoke.spec.ts] + +sidebar-navigation: + parent: app-shell + title: Sidebar and recent notes + promise: > + The sidebar links to each section and lists the notes you opened recently, + newest first. It collapses on desktop and becomes an app bar on phones. + entry: [app/src/components/sidebar/AppSidebarLayout.tsx] + implementation: + - app/src/components/sidebar/AppSidebarActions.tsx + - app/src/components/sidebar/AppSidebarCanvasMenu.tsx + - app/src/components/sidebar/AppSidebarClient.tsx + - app/src/components/sidebar/AppSidebarContent.tsx + - app/src/components/sidebar/AppSidebarDesktop.tsx + - app/src/components/sidebar/AppSidebarFooter.tsx + - app/src/components/sidebar/AppSidebarMobile.tsx + - app/src/components/sidebar/AppSidebarNav.tsx + - app/src/components/sidebar/AppSidebarRecent.tsx + - app/src/components/sidebar/RecentRow.tsx + - app/src/components/sidebar/RouteProgressBar.tsx + - app/src/components/sidebar/SidebarNavLink.tsx + - app/src/components/sidebar/mobile-app-bar.ts + - app/src/components/sidebar/nav-items.ts + - app/src/components/sidebar/sidebar-collapse-cookie.ts + - app/src/components/sidebar/useMobileBarTitleOnScroll.ts + - app/src/services/recents/recents.merge.ts + - app/src/services/recents/recents.queries.ts + - app/src/services/recents/recents.types.ts + tests: [app/src/services/recents/recents.merge.test.ts, app/tests/e2e/new-note-mobile.spec.ts] + +command-palette: + parent: app-shell + title: Command palette + promise: > + Cmd-K finds a note by title or path and runs app commands. Enter opens the best + match, even before results arrive; with no match, a second Enter makes a new note. + entry: [app/src/components/CommandKMenu.tsx] + implementation: + - app/src/components/command-palette/PalettePathChips.tsx + - app/src/components/command-palette/PaletteRows.tsx + - app/src/components/command-palette/PaletteSortMenu.tsx + - app/src/components/command-palette/palette-commands.ts + - app/src/components/command-palette/palette-search.queries.ts + - app/src/components/command-search.ts + tests: + - app/tests/e2e/command-palette.spec.ts + - app/src/components/command-palette/palette-commands.test.ts + - app/src/components/command-search.test.ts + +sign-in: + parent: app-shell + title: Sign in + promise: Sign in with a magic link. Pages and server calls need a signed-in user. + entry: [app/src/routes/login.tsx] + implementation: + - app/src/server/magic-auth.ts + - app/src/services/auth/magic-auth.actions.ts + - app/src/services/auth/magic-auth.queries.ts + - app/src/services/auth/magic-login.ts + tests: [app/tests/e2e/auth-helper.spec.ts] + +error-pages: + parent: app-shell + title: Error and not-found pages + promise: > + An unknown route shows a not-found page, and an uncaught error shows an overlay + with the message instead of a blank page. + entry: ["app/src/routes/[...404].tsx"] + implementation: + - app/src/components/errors/GlobalErrorOverlay.tsx + - app/src/components/errors/NotFoundPage.tsx + tests: [app/tests/e2e/no-page-flash.spec.ts] + +background-jobs: + parent: app-shell + title: Background jobs and live updates + promise: > + Long work (embeddings, transcripts, agent runs) runs as a job; open tabs get its + progress and other live updates over one socket. + implementation: + - app/src/server/jobs-db.ts + - app/src/server/broadcast-bus.ts + - app/src/ws/jobs.ts + - app/src/lib/socket-client.ts + - app/src/lib/job-socket-client.ts + - app/src/lib/job-socket-messages.ts + - app/src/services/jobs/jobs.queries.ts + tests: + - app/src/server/jobs-db.test.ts + - app/src/server/broadcast-bus.test.ts + - app/src/lib/socket-client.test.ts diff --git a/docs/capabilities/archive.yaml b/docs/capabilities/archive.yaml new file mode 100644 index 00000000..cbe1cfba --- /dev/null +++ b/docs/capabilities/archive.yaml @@ -0,0 +1,122 @@ +archive: + title: Web archive + promise: > + Pages you save from the browser are kept with their snapshots, grouped and annotated with notes. + Agents can read the archive and add notes to a page. + +archive-capture: + parent: archive + title: Save pages from the browser + promise: > + The browser extension saves a whole page or a selected passage into the archive. + A page saved twice under the same address joins the existing entry, and the extension is downloadable from the app. + entry: + - app/src/routes/api/archive/bulk-capture.ts + - app/src/routes/api/archive/targeted-capture.ts + implementation: + - extension/content-targeted.js + - extension/background.js + - extension/popup.js + - extension/api-client.js + - extension/screenshot.js + - app/src/routes/api/archive/extension-package.ts + - app/src/routes/api/archive/groups.ts + - app/src/routes/api/archive/items/[id].ts + - app/src/routes/api/archive/items/index.ts + - app/src/routes/api/archive/lookup.ts + - app/src/server/lib/archive/auth.ts + - app/src/server/lib/archive/html-storage.ts + - app/src/server/lib/archive/types.ts + - app/src/server/lib/archive/url.ts + - app/src/services/archive/archive.ingest.ts + tests: [app/src/server/lib/archive/url.test.ts] + +archive-list: + parent: archive + title: Find a saved page + promise: > + List saved pages with filters by group, host and capture date, and search with matches highlighted. + entry: + - app/src/routes/archive/index.tsx + - app/src/components/archive/list/ArchiveList.tsx + implementation: + - app/src/components/archive/ArchiveFavicon.tsx + - app/src/components/archive/ArchiveThumb.tsx + - app/src/components/archive/list/ArchiveListRow.tsx + - app/src/components/archive/list/ArchiveListToolbar.tsx + - app/src/components/archive/list/HighlightMatch.tsx + - app/src/components/archive/list/archive-list-filters.ts + - app/src/components/archive/list/highlight-tokens.ts + - app/src/services/archive/archive.queries.ts + - app/src/services/archive/archive.service.ts + - app/src/services/archive/archive.types.ts + tests: [app/src/components/archive/list/highlight-tokens.test.ts] + +archive-detail: + parent: archive + title: Read and annotate a saved page + promise: > + Open a page to see its snapshots, edit its title and group, and keep your own notes and images on it. + Escape cancels a title edit and restores the saved title. + entry: [app/src/components/archive/ArchiveDetailDrawer.tsx] + implementation: + - app/src/components/archive/detail/ArchiveNoteComposer.tsx + - app/src/components/archive/detail/ArchiveNoteItem.tsx + - app/src/components/archive/detail/ArchiveSnapshotList.tsx + - path: app/src/services/archive/archive.actions.ts + only: + - updateArchivedPage + - deleteArchivedPage + - createArchivedPageNote + - updateArchivedPageNote + - deleteArchivedPageNote + - addArchivedPageNoteImage + - updateArchivedPageNoteImage + - deleteArchivedPageNoteImage + tests: [app/tests/e2e/archive-title-cancel.spec.ts] + +archive-canvas: + parent: archive + title: Arrange pages on a canvas + promise: > + Lay out a group's pages as cards on a canvas, with free notes, a summary or image view per card, and a saved layout. + A group switcher and breadcrumb move between groups. + entry: + - app/src/routes/archive/canvas.tsx + - app/src/routes/archive/groups/[group]/canvas.tsx + implementation: + - app/src/components/archive/ArchiveCanvasCard.tsx + - app/src/components/archive/ArchiveCanvasFreeformCard.tsx + - app/src/components/archive/ArchiveGroupCanvas.tsx + - app/src/components/archive/ArchiveGroupSwitcher.tsx + - app/src/components/archive/canvas/ArchiveCanvasBreadcrumb.tsx + - app/src/components/archive/canvas/ArchiveGroupTile.tsx + - app/src/services/archive/archive-canvas.ts + - path: app/src/services/archive/archive.actions.ts + only: + - updateArchivedPageCanvasState + - saveArchiveGroupCanvasLayout + - createArchiveCanvasNode + - updateArchiveCanvasNode + - updateArchiveCanvasNodeState + - deleteArchiveCanvasNode + tests: [app/src/services/archive/archive-canvas.test.ts] + +archive-agent: + parent: archive + title: Archive for agents + promise: > + Agents can find saved pages, load one with its notes, check whether a URL was saved, and add a note. + A note an agent adds shows on the open page. Agents cannot capture, edit or delete pages. + entry: [app/src/server/mcp/archive-tools.ts] + implementation: [app/src/server/archive/archive-store.ts] + tests: [app/tests/e2e/archive-agent-sync.spec.ts] + +archive-admin: + parent: archive + title: Archive storage admin + promise: > + An admin page lists every stored snapshot with its size and the total. + entry: [app/src/routes/admin/archive.tsx] + implementation: [app/src/routes/admin/archive/index.tsx] + tests: [app/tests/e2e/route-hydration-smoke.spec.ts] diff --git a/docs/capabilities/cleanup.yaml b/docs/capabilities/cleanup.yaml new file mode 100644 index 00000000..455f137d --- /dev/null +++ b/docs/capabilities/cleanup.yaml @@ -0,0 +1,131 @@ +cleanup: + title: Note cleanup + promise: > + Suggest what to do with notes that have stopped earning their place. + Every suggestion waits for a click; nothing changes on its own. + docs: [app/docs/note-cleanup.md] + +cleanup-assessment: + parent: cleanup + title: Assess each note + promise: > + Notes are assessed in the background, after boot, every six hours and shortly after an edit. + Each stale note lands in one bucket (distill, post-event, make task, revisit link, delete or keep) and a note you wrote yourself is kept. + entry: [app/src/server/cleanup/assessment-sweep.ts] + implementation: + - app/src/server/cleanup/assess.ts + - app/src/server/cleanup/buckets.ts + - app/src/server/cleanup/decide.ts + - app/src/server/cleanup/heuristic.ts + - app/src/server/cleanup/note-state.ts + - app/src/server/cleanup/questions.ts + - app/src/server/cleanup/signals.ts + - app/src/server/cleanup/status.ts + - app/src/components/cleanup/CleanupRunStatus.tsx + - app/src/components/cleanup/cleanup-buckets.ts + tests: + - app/src/server/cleanup/buckets.test.ts + - app/src/server/cleanup/decide.test.ts + - app/src/server/cleanup/note-state.test.ts + - app/src/server/cleanup/paid-calls.test.ts + +cleanup-queue: + parent: cleanup + title: Work through the queue + promise: > + Suggestions appear in a queue by bucket, strongest first, with a daily stack that alternates buckets. + Keep, snooze and keyboard shortcuts move you to the next note. + entry: + - app/src/routes/cleanup.tsx + - app/src/components/cleanup/CleanupWorkspace.tsx + - app/src/components/cleanup/CleanupRail.tsx + implementation: + - app/src/server/cleanup/daily.ts + - app/src/server/cleanup/queue.ts + - app/src/components/cleanup/CleanupActionBar.tsx + - app/src/components/cleanup/CleanupChip.tsx + - app/src/components/cleanup/CleanupDetail.tsx + - app/src/components/cleanup/CleanupModeToggle.tsx + - app/src/components/cleanup/CleanupQueueList.tsx + - app/src/components/cleanup/CleanupSkeletons.tsx + - app/src/components/cleanup/DailyStack.tsx + - app/src/components/cleanup/PanelSection.tsx + - app/src/components/cleanup/cleanup-format.ts + - app/src/components/cleanup/useCleanupKeys.ts + - app/src/components/cleanup/useOnDemand.ts + - path: app/src/services/cleanup/cleanup.actions.ts + only: [keepNoteAction, snoozeNoteAction] + - app/src/services/cleanup/cleanup.queries.ts + tests: [app/src/server/cleanup/daily.test.ts] + +cleanup-distill: + parent: cleanup + title: Distill a copied answer + promise: > + A pasted chat answer or generated note is cut down to its reusable bullets and code. + You review the draft, then it replaces or joins the note and the original is archived. + entry: [app/src/components/cleanup/DistillPanel.tsx] + implementation: + - app/src/server/cleanup/distill.ts + - app/src/components/cleanup/DistillReview.tsx + - app/src/components/cleanup/DraftPreview.tsx + - path: app/src/services/cleanup/cleanup.actions.ts + only: [applyDistillAction] + tests: [app/src/server/cleanup/distill.test.ts] + +cleanup-regroup: + parent: cleanup + title: Combine or move related notes + promise: > + Notes that say the same thing are offered as a group to combine, and unfiled notes get a suggested destination. + Combining writes one note that names every source. + entry: [app/src/components/cleanup/CombinePanel.tsx] + implementation: + - app/src/server/cleanup/combine.ts + - app/src/server/cleanup/regroup-queue.ts + - app/src/server/cleanup/regroup.ts + - app/src/components/cleanup/CombineMembers.tsx + - app/src/components/cleanup/DestinationPicker.tsx + - app/src/components/cleanup/MovePanel.tsx + - path: app/src/services/cleanup/cleanup.actions.ts + only: [applyCombineAction, applyMoveAction] + tests: [app/src/server/cleanup/regroup.test.ts] + +cleanup-make-task: + parent: cleanup + title: Turn a note into a task + promise: > + A short to-do note becomes a task, using its unchecked boxes or short bullets as the task lines. + entry: [app/src/components/cleanup/MakeTaskPanel.tsx] + implementation: + - app/src/server/cleanup/make-task.ts + - path: app/src/services/cleanup/cleanup.actions.ts + only: [makeTaskAction] + tests: [app/src/server/cleanup/make-task.test.ts] + +cleanup-saved-links: + parent: cleanup + title: Revisit saved links + promise: > + A note that is only a link is checked once to see whether the page loads. + A dead link goes to delete, other links go to revisit, and you can ask for a summary of the page. + entry: [app/src/components/cleanup/RevisitLinkPanel.tsx] + implementation: + - app/src/server/cleanup/link-check.ts + - app/src/server/cleanup/link-expand.ts + - path: app/src/services/cleanup/cleanup.actions.ts + only: [addLinkSummaryAction, remindLinkAction] + tests: [app/src/server/cleanup/link-check.test.ts] + +cleanup-archive-note: + parent: cleanup + title: Archive or delete a note, with undo + promise: > + Every action archives the source note instead of deleting it, and you can undo it. + Results carry a source line that names the notes they came from. + entry: [app/src/components/cleanup/ArchiveOnlyPanel.tsx] + implementation: + - app/src/server/cleanup/apply.ts + - path: app/src/services/cleanup/cleanup.actions.ts + only: [archiveOnlyAction, undoArchiveOnlyAction] + tests: [app/src/server/cleanup/apply.test.ts] diff --git a/docs/capabilities/collections.yaml b/docs/capabilities/collections.yaml new file mode 100644 index 00000000..b5745633 --- /dev/null +++ b/docs/capabilities/collections.yaml @@ -0,0 +1,271 @@ +collections: + title: Collections + promise: Organize ordinary notes into collections with typed properties. + docs: [app/docs/collections.md] + +collection-pages: + parent: collections + title: Create and manage collections + promise: > + The Collections page lists every collection. A collection page lets you rename it, + delete it, and change its properties and views. + entry: + - app/src/routes/collections/index.tsx + - app/src/routes/collections/[id].tsx + implementation: + - app/src/components/collections/CollectionsIndex.tsx + - app/src/components/collections/CollectionPage.tsx + - app/src/components/collections/CollectionTitle.tsx + - app/src/components/collections/CollectionContext.tsx + - app/src/server/collections/collection-store.ts + - app/src/services/collections/collections.actions.ts + - app/src/services/collections/collections.queries.ts + - app/src/services/collections/collections.server.ts + tests: + - path: app/src/server/mcp/collections-tools.db.test.ts + only: ["builds a collection, adds rows with plain-text values, and queries them"] + +collection-views: + parent: collections + title: Views as table, board, gallery or calendar + promise: > + Each collection has saved view tabs that show the same notes as a table, board, gallery or calendar. + The table edits cells in place, moves with the keyboard, selects rows for bulk actions, and stays smooth with thousands of rows. + entry: [app/src/components/collections/table/CollectionTable.tsx] + implementation: + - app/src/components/collections/CollectionViewHost.tsx + - app/src/components/collections/views/ViewTabs.tsx + - app/src/components/collections/views/CompactViewSwitcher.tsx + - app/src/components/collections/views/CollectionToolbar.tsx + - app/src/components/collections/views/ViewOptions.tsx + - app/src/components/collections/views/ViewSettings.tsx + - app/src/components/collections/views/PropertiesMenu.tsx + - app/src/components/collections/views/SaveState.tsx + - app/src/components/collections/views/useOverflowTabs.ts + - app/src/components/collections/views/view-meta.ts + - app/src/components/collections/views/toolbar-styles.ts + - app/src/components/collections/table/BulkBar.tsx + - app/src/components/collections/table/EmptyRows.tsx + - app/src/components/collections/table/TableActions.tsx + - app/src/components/collections/table/TableHeaderCell.tsx + - app/src/components/collections/table/TableHeaderRow.tsx + - app/src/components/collections/table/TableRow.tsx + - app/src/components/collections/table/TitleCell.tsx + - app/src/components/collections/table/table-styles.ts + - app/src/components/collections/table/useColumns.ts + - app/src/components/collections/table/useGridKeys.ts + - app/src/components/collections/table/useRowSelection.ts + - app/src/components/collections/table/useScrollerFit.ts + - app/src/components/collections/table/useTouchTaps.ts + - app/src/components/collections/table/useWindowedRows.ts + - app/src/components/collections/touch.ts + - app/src/components/collections/touchRead.ts + - app/src/components/collections/popover-styles.ts + - app/src/components/collections/LazyPopover.tsx + tests: + - path: app/src/lib/collections/query.test.ts + only: [applyView] + +collection-filters-sorts: + parent: collections + title: Filter, sort and search rows + promise: > + A view can filter rows with AND/OR conditions, sort by several properties, and search across all values. + Empty values sort last, and "Today" filters follow the viewer's time zone. + entry: [app/src/components/collections/views/FilterEditor.tsx] + implementation: + - app/src/components/collections/views/SortEditor.tsx + - app/src/components/collections/views/ToolbarSearch.tsx + - app/src/lib/collections/query.ts + - app/src/lib/collections/timezone.ts + tests: + - path: app/src/lib/collections/query.test.ts + only: [filters, sorting, applyView] + +collection-footer-summaries: + parent: collections + title: Summarize a column in the table footer + promise: The table footer counts or summarizes each column, such as a sum or an average of a number property. + entry: [app/src/components/collections/table/TableFooterRow.tsx] + implementation: + - app/src/components/collections/table/FooterCell.tsx + - app/src/lib/collections/aggregate.ts + tests: + - path: app/src/lib/collections/query.test.ts + only: [aggregate] + +collection-property-values: + parent: collections + title: Typed property values + promise: > + Properties hold text, numbers, selects, statuses, multi-selects, dates, checkboxes and ratings. + A bad value is refused, and clearing a value is always allowed. + entry: [app/src/components/collections/values/ValueCell.tsx] + implementation: + - app/src/components/collections/values/DateEditor.tsx + - app/src/components/collections/values/FieldError.tsx + - app/src/components/collections/values/InlineEditor.tsx + - app/src/components/collections/values/OptionChip.tsx + - app/src/components/collections/values/OptionPicker.tsx + - app/src/components/collections/values/RatingStars.tsx + - app/src/components/collections/values/ValueDisplay.tsx + - app/src/components/collections/values/valueKinds.ts + - app/src/components/collections/PropertyList.tsx + - app/src/components/collections/PropertyKindIcon.tsx + - app/src/lib/collections/values.ts + - app/src/lib/collections/types.ts + - app/src/lib/collections/colors.ts + tests: + - path: app/src/lib/collections/values.test.ts + only: [validateValue, formatValueText, parseLooseText, isEmptyValue, parseNumberDraft] + +collection-property-schema: + parent: collections + title: Add and change properties + promise: > + A collection's properties can be added from presets, renamed, hidden, reordered and given select options. + Changing a property's type converts existing values and says which ones could not convert. + entry: [app/src/components/collections/menu/AddPropertyMenu.tsx] + implementation: + - app/src/components/collections/menu/ChangeKindMenu.tsx + - app/src/components/collections/menu/MenuList.tsx + - app/src/components/collections/menu/OptionsEditor.tsx + - app/src/components/collections/menu/PropertyMenu.tsx + - app/src/components/collections/menu/propertyPresets.ts + tests: + - path: app/src/lib/collections/values.test.ts + only: [coerceValue] + +collection-optimistic-edits: + parent: collections + title: Edits appear instantly + promise: > + Cell edits, moves and new rows show at once and save in the background. + If a save fails, only that edit is undone and newer edits to the same cell stay. + entry: [app/src/components/collections/store/createCollectionStore.ts] + implementation: + - app/src/lib/collections/optimistic.ts + tests: + - app/src/lib/collections/optimistic.test.ts + +collection-manual-order: + parent: collections + title: Manual row order + promise: Rows can be dragged into a custom order that holds after a reload, even after many inserts at the same spot. + implementation: + - app/src/lib/collections/rank.ts + tests: + - app/src/lib/collections/rank.test.ts + +board-columns: + parent: collections + title: Group notes on a board + promise: > + Group notes by a select or status property, in option order. + Empty values and deleted options go in the No value column. + entry: [app/src/components/collections/board/CollectionBoard.tsx] + implementation: + - path: app/src/lib/collections/group.ts + only: [canGroupBy, groupRows, rankForDrop] + - app/src/components/collections/board/CardFields.tsx + - app/src/components/collections/board/CardMenu.tsx + - app/src/components/collections/drag/startPointerDrag.ts + tests: + - path: app/src/lib/collections/group.test.ts + only: [groupRows, rankForDrop] + +calendar-dates: + parent: collections + title: Arrange notes on a calendar + promise: > + Show date ranges across the days they occupy. + Moving a range keeps its duration and time of day. + entry: [app/src/components/collections/calendar/CollectionCalendar.tsx] + implementation: + - path: app/src/lib/collections/group.ts + only: [monthGrid, layoutWeek, moveDate, shiftMonth, daysBetween] + - app/src/components/collections/calendar/CalendarAgenda.tsx + - app/src/components/collections/calendar/DateMenu.tsx + - app/src/components/collections/calendar/MonthGrid.tsx + - app/src/components/collections/calendar/UndatedTray.tsx + - app/src/components/collections/calendar/agenda.ts + tests: + - path: app/src/lib/collections/group.test.ts + only: [calendar] + +collection-gallery-list: + parent: collections + title: Gallery cards and list view + promise: > + The gallery shows each note as a card with its cover image and a text preview. + The list view shows the short properties of each note and keeps the view's property order. + entry: [app/src/components/collections/gallery/CollectionGallery.tsx] + implementation: + - app/src/components/collections/list/CollectionList.tsx + - app/src/components/collections/list/ListHeader.tsx + - app/src/components/collections/list/ListModeToggle.tsx + - app/src/components/collections/list/ListRow.tsx + - app/src/components/collections/list/TableOrList.tsx + - app/src/components/collections/list/listFields.ts + - app/src/components/collections/list/useListMode.ts + - app/src/services/collections/note-summary.ts + tests: + - app/src/components/collections/list/listFields.test.ts + - app/src/services/collections/note-summary.test.ts + +collection-row-peek: + parent: collections + title: Open a row in a side panel + promise: > + Opening a row shows its note in a side panel with its properties, and you can step to the previous or next row. + Closing the panel saves first, and asks what to do when the save cannot finish. + entry: [app/src/components/collections/RowPeekPanel.tsx] + implementation: + - app/src/components/collections/detail/RecordNav.tsx + - app/src/components/collections/detail/RecordPreview.tsx + - app/src/components/collections/detail/useRecordGestures.ts + - app/src/components/collections/detail/useRecordPosition.ts + tests: + - app/tests/e2e/collection-peek-guard.spec.ts + +collection-membership: + parent: collections + title: Move notes in and out of collections + promise: > + Add notes to a collection by searching, or from a note's menu. Matching meta keys fill the properties. + Moving a note to another collection keeps values that match by name and lists the ones it drops. + entry: [app/src/components/collections/membership/AddNotesDialog.tsx] + implementation: + - app/src/components/collections/membership/CollectionActions.tsx + - app/src/components/collections/membership/NoteCollectionMenu.tsx + - app/src/components/collections/membership/docCollectionVersion.ts + - app/src/components/collections/DocCollectionHeader.tsx + - app/src/services/collections/collections.membership.ts + - app/src/lib/collections/mapping.ts + tests: + - app/src/lib/collections/mapping.test.ts + +collection-embed: + parent: collections + title: Embed a collection view in a note + promise: A note can show a live view of a collection inside its text, chosen from a picker. + entry: [app/src/components/collections/embed/EmbedPicker.tsx] + implementation: + - app/src/components/collections/embed/CollectionEmbed.tsx + tests: + - app/src/lib/note-content/collection-view.test.ts + - app/src/server/lib/markdown.collection-embed.test.ts + +collections-agent: + parent: collections + title: Collections through the connector + promise: > + An AI agent can list, create and query collections, add properties, rows and views, and set values with plain text and names. + It can remove a note from a collection but cannot delete one. + entry: [app/src/server/mcp/collections-tools.ts] + implementation: + - app/src/server/mcp/collections-agent.ts + - app/src/services/collections/collection-text.ts + tests: + - app/src/server/mcp/collections-tools.db.test.ts + - app/src/services/collections/collection-text.test.ts diff --git a/docs/capabilities/events.yaml b/docs/capabilities/events.yaml new file mode 100644 index 00000000..abea10b8 --- /dev/null +++ b/docs/capabilities/events.yaml @@ -0,0 +1,165 @@ +events: + title: Events + promise: > + Keep things that happen on a date, such as meetups, shows and classes, as notes with dated shows, a place and a decision on each. + entry: [app/src/routes/events/index.tsx] + implementation: + - app/src/server/calendar/event-store.ts + - app/src/server/calendar/event-columns.ts + - app/src/server/calendar/event-views.ts + - app/src/services/events/events.actions.ts + - app/src/services/events/events.queries.ts + - app/src/lib/events/types.ts + - app/src/lib/events/schemas.ts + - app/src/lib/events/view-types.ts + tests: + - app/src/server/mcp/event-tools.test.ts + +event-shows: + parent: events + title: Dates, shows and repeats on a note + promise: > + A note can carry one or more dated shows, each with its own time, status and decision. + A repeat rule such as every 2nd Tuesday expands into shows that keep their local start time through daylight saving. + entry: [app/src/components/events/note/NoteEventSection.tsx] + implementation: + - app/src/components/events/note/AddEventDates.tsx + - app/src/components/events/note/CommitField.tsx + - app/src/components/events/note/DecisionSelect.tsx + - app/src/components/events/note/EventDetailsForm.tsx + - app/src/components/events/note/EventSummaryRow.tsx + - app/src/components/events/note/NoteEventContext.tsx + - app/src/components/events/note/RepeatDialog.tsx + - app/src/components/events/note/RepeatRuleFields.tsx + - app/src/components/events/note/ShowEditorDialog.tsx + - app/src/components/events/note/ShowFields.tsx + - app/src/components/events/note/ShowRow.tsx + - app/src/components/events/note/ShowsList.tsx + - app/src/components/events/note/repeat-draft.ts + - app/src/components/events/note/show-draft.ts + - app/src/components/events/views/ShowStatusBadge.tsx + - app/src/lib/events/recurrence.ts + - app/src/lib/events/time.ts + - app/src/lib/events/format.ts + tests: + - app/src/lib/events/recurrence.test.ts + +event-decisions: + parent: events + title: Decide on each event + promise: > + Mark an event or a single show as interested, tentative, booked, skipped or rejected, and filter lists by decision. + entry: [app/src/components/events/views/DecisionChip.tsx] + implementation: + - app/src/components/events/views/DecisionFilterMenu.tsx + - app/src/components/events/views/EventsFilterBar.tsx + - app/src/components/events/views/useEventsFilters.ts + - app/src/lib/events/filters.ts + tests: + - path: app/src/lib/events/filters.test.ts + only: ["events filters"] + +events-calendar-upcoming: + parent: events + title: Upcoming list and month calendar + promise: > + The Events page lists upcoming shows grouped by day, and a month calendar shows them on their dates. + Filters narrow both by decision, kind and text, and are kept in the page address. + entry: [app/src/routes/events/calendar.tsx] + implementation: + - app/src/routes/events/index.tsx + - app/src/components/events/EventsTabs.tsx + - app/src/components/events/views/CalendarMonthGrid.tsx + - app/src/components/events/views/EventsCalendar.tsx + - app/src/components/events/views/EventsEmptyState.tsx + - app/src/components/events/views/EventsPageShell.tsx + - app/src/components/events/views/ShowsRefresh.ts + - app/src/components/events/views/UpcomingList.tsx + - app/src/components/events/views/UpcomingRow.tsx + - app/src/components/events/views/refetchableShows.ts + - app/src/lib/events/grouping.ts + - app/src/services/events/events-views.queries.ts + tests: + - path: app/src/lib/events/filters.test.ts + only: ["events grouping"] + +events-places-map: + parent: events + title: Places and map + promise: > + Events can use saved places with an address. A new address is looked up on the map automatically, and the map page shows upcoming events as pins beside a list. + entry: + - app/src/routes/events/places.tsx + - app/src/routes/events/map.tsx + implementation: + - app/src/components/events/map/EventsMapView.tsx + - app/src/components/events/map/LeafletMap.tsx + - app/src/components/events/map/MapSideList.tsx + - app/src/components/events/map/mapPoints.ts + - app/src/components/events/places/PlaceDialog.tsx + - app/src/components/events/places/PlaceField.tsx + - app/src/components/events/places/PlaceRow.tsx + - app/src/components/events/places/PlacesView.tsx + - app/src/components/events/places/placeForm.ts + - app/src/components/events/note/PlaceCreateForm.tsx + - app/src/components/events/note/PlacePicker.tsx + - app/src/server/calendar/geocode.ts + - app/src/server/calendar/place-store.ts + tests: + - app/src/server/calendar/geocode.test.ts + +event-feeds: + parent: events + title: Calendar feeds + promise: > + A feed publishes chosen events, by collection, view and decision with manual includes and excludes, as a subscribe link that calendar apps can read. + Cancelled and tentative shows are marked, and times with no start are published as all-day. + entry: + - app/src/routes/events/feeds.tsx + - app/src/routes/cal/[token].ts + implementation: + - app/src/components/events/feeds/DecisionChecks.tsx + - app/src/components/events/feeds/EventFeedToggles.tsx + - app/src/components/events/feeds/FeedCard.tsx + - app/src/components/events/feeds/FeedEventPicker.tsx + - app/src/components/events/feeds/FeedHeader.tsx + - app/src/components/events/feeds/FeedManualEntries.tsx + - app/src/components/events/feeds/FeedPreviewList.tsx + - app/src/components/events/feeds/FeedRuleEditor.tsx + - app/src/components/events/feeds/FeedSection.tsx + - app/src/components/events/feeds/FeedSubscribeUrl.tsx + - app/src/components/events/feeds/FeedsManager.tsx + - app/src/components/events/feeds/NewFeedForm.tsx + - app/src/components/events/feeds/describeRule.ts + - app/src/components/events/feeds/feedsRefresh.tsx + - app/src/server/calendar/feed-rules.ts + - app/src/server/calendar/feed-store.ts + - app/src/lib/events/ics.ts + - app/src/lib/events/feed-schemas.ts + - app/src/services/events/feeds.actions.ts + - app/src/services/events/feeds.queries.ts + tests: + - app/src/lib/events/ics.test.ts + +event-duplicates: + parent: events + title: Spot duplicate events + promise: > + Before an event is saved, likely copies are found by the same link, a similar title or a shared date, so the same event is not added twice. + implementation: + - app/src/lib/events/dedupe.ts + tests: + - app/src/lib/events/dedupe.test.ts + +events-agent: + parent: events + title: Events through the connector + promise: > + An AI agent can search, read, create and update events, shows, decisions and places, and is refused when the event looks like a duplicate. + Writes need write permission, and feed links are never shown to it. + entry: [app/src/server/mcp/event-tools.ts] + implementation: + - app/src/server/mcp/event-read-ops.ts + - app/src/server/mcp/event-write-ops.ts + tests: + - app/src/server/mcp/event-tools.test.ts diff --git a/docs/capabilities/map.yaml b/docs/capabilities/map.yaml new file mode 100644 index 00000000..0fdc5d6b --- /dev/null +++ b/docs/capabilities/map.yaml @@ -0,0 +1,191 @@ +visual-map: + title: Visual map of notes + promise: > + Every note is placed on a 2D map so notes about similar things sit close together. + You browse the map as a canvas, and the same similarity powers search by meaning. + +map-canvas: + parent: visual-map + title: Browse notes on the canvas + promise: > + Pan and zoom a canvas of dots, one per note, and open a note in a side panel. + A popover lists the nearest notes to the one you are reading. + entry: + - app/src/routes/canvas.tsx + - app/src/routes/visual.tsx + implementation: + - app/src/components/NearbyNodesPopover.tsx + - app/src/components/visual/CanvasDotLayer.tsx + - app/src/components/visual/CanvasZoomControls.tsx + - app/src/components/visual/VisualCanvas.tsx + - app/src/components/visual/canvas-perf.ts + - app/src/components/visual/canvas-view.ts + - app/src/components/visual/layers/CanvasBrushRect.tsx + - app/src/components/visual/layers/CanvasNoteMarkers.tsx + - app/src/components/visual/useCanvasKeyboard.ts + - app/src/components/visual/useCrossFade.ts + - app/src/components/visual/useSettledView.ts + - app/src/components/visual/labels/settled-view.ts + - app/src/layout/umap-normalize.ts + - app/src/services/umap.service.ts + tests: [app/tests/e2e/canvas-note-panel.spec.ts] + +map-canvas-search: + parent: visual-map + title: Search the canvas + promise: > + Type in the canvas search box to highlight matching notes and see how many match. + entry: [app/src/components/visual/ControlPanel.tsx] + implementation: [app/src/components/visual/canvas-search.ts] + tests: [app/src/components/visual/canvas-search.test.ts] + +map-note-labels: + parent: visual-map + title: Note labels + promise: > + Recently edited notes in view get a title label, and more labels appear as you zoom in. + Labels never overlap and keep their place across small zoom changes. + entry: [app/src/components/visual/layers/NoteLabelLayer.tsx] + implementation: + - app/src/components/visual/labels/label-geometry.ts + - app/src/components/visual/labels/note-label-layout.ts + - app/src/components/visual/labels/note-label-order.ts + - app/src/components/visual/labels/test-fixtures.ts + - app/src/components/visual/layers/NoteLabel.tsx + - app/src/components/visual/useCanvasNoteLabels.ts + - app/src/components/visual/useFrozenHoveredNoteLabel.ts + tests: + - app/src/components/visual/labels/label-geometry.test.ts + - app/src/components/visual/labels/note-labels.test.ts + +map-regions-on-canvas: + parent: visual-map + title: Named regions on the canvas + promise: > + Clusters of notes are outlined as regions with a title, and the biggest regions are labeled first. + More region labels show as you zoom in, without overlap. + entry: [app/src/components/visual/layers/RegionShapeLayer.tsx] + implementation: + - app/src/components/visual/layers/RegionLabel.tsx + - app/src/components/visual/layers/RegionLabelLayer.tsx + - app/src/components/visual/labels/region-label-order.ts + - app/src/components/visual/labels/region-label-plan.ts + - app/src/components/visual/regions/region-colors.ts + - app/src/components/visual/regions/region-shape.ts + - app/src/components/visual/layers/region-interaction.ts + - app/src/components/visual/useCanvasRegionLabels.ts + - app/src/components/visual/useCanvasRegionShapes.ts + tests: + - app/src/components/visual/regions/region-shape.test.ts + - app/src/components/visual/labels/region-labels.test.ts + +map-side-rail: + parent: visual-map + title: Region and note list beside the canvas + promise: > + A side rail lists regions and the notes inside them, sortable, so you can jump to one on the canvas. + entry: [app/src/components/visual/CanvasSideRail.tsx] + implementation: + - app/src/components/visual/CanvasRailDocRow.tsx + - app/src/components/visual/CanvasRegionList.tsx + - app/src/components/visual/CanvasRegionRow.tsx + - app/src/components/visual/CanvasRegionSortToggle.tsx + - app/src/components/visual/canvas-region-list.ts + tests: [app/src/components/visual/canvas-region-list.test.ts] + +map-embeddings: + parent: visual-map + title: Note embeddings + promise: > + Notes are turned into embeddings, vectors that capture meaning, a few seconds after an edit and by a periodic sweep. + An embedding run page shows the model and settings, and a failed embedding call never loses the vectors a note already has. + entry: + - app/src/routes/embeddings/index.tsx + - app/src/routes/embeddings/[id].tsx + implementation: + - app/src/services/embeddings/embeddings.actions.ts + - app/src/services/embeddings/embeddings.queries.ts + - app/src/services/embeddings/embeddings.server.ts + - app/src/services/embeddings/embeddings.utils.ts + tests: + - app/src/services/embeddings/embeddings.server.test.ts + - app/src/services/embeddings/embeddings.utils.test.ts + +map-umap-runs: + parent: visual-map + title: Build and refresh the map + promise: > + Create a map run from an embedding run, with advanced settings, and see its points and progress. + New notes are placed on the existing map without a full rebuild, and a deleted run is reported. + entry: + - app/src/routes/umap/index.tsx + - app/src/routes/umap/[id]/index.tsx + implementation: + - app/scripts/setup-umap-local.mjs + - app/scripts/umap_model.py + - app/src/features/umap/UmapCreateToolbar.tsx + - app/src/features/umap/UmapJobStatusCard.tsx + - app/src/features/umap/UmapParamsCard.tsx + - app/src/features/umap/UmapRunCanvasCard.tsx + - app/src/features/umap/UmapRunMetadataCard.tsx + - app/src/features/umap/UmapRunParamsCard.tsx + - app/src/features/umap/UmapRunsTable.tsx + - app/src/features/umap/UmapWorkflowCard.tsx + - app/src/features/umap/detail-types.ts + - app/src/features/umap/format.ts + - app/src/features/umap/types.ts + - app/src/features/umap/useUmapCanvas.ts + - app/src/server/lib/umap/python-umap.ts + - app/src/services/umap/umap.actions.ts + - app/src/services/umap/umap.projection.ts + - app/src/services/umap/umap.queries.ts + - app/src/services/umap/umap.server.ts + - app/src/services/umap/umap.vectors.ts + - app/src/types/umap-js.d.ts + tests: + - app/src/services/umap/umap.projection.test.ts + - app/src/services/umap/umap.server.test.ts + - path: app/tests/e2e/umap-run-refresh.spec.ts + only: ["UMAP run page"] + +map-regions-detect: + parent: visual-map + title: Find and name regions + promise: > + Regions are found in each map run and named with a short AI-written title. + A region keeps its id and title across rebuilds when its notes barely change, and an old region link follows a merge. + entry: + - app/src/routes/umap/[id]/groups/[groupId].tsx + implementation: + - app/src/features/umap/UmapRunRegionsCard.tsx + - app/src/features/umap/region-types.ts + - app/src/services/umap/umap.regions.ts + - app/src/services/umap/umap.region-matching.ts + tests: [app/src/services/umap/umap.region-matching.test.ts] + +map-retrain: + parent: visual-map + title: Retrain the map as notes grow + promise: > + The map is retrained once enough new notes arrive, and the new layout is aligned to the old one so the canvas does not jump. + entry: [app/src/services/umap/umap.retrain-trigger.ts] + implementation: + - app/src/services/umap/umap.alignment.ts + - app/src/services/umap/umap.retrain.ts + tests: + - app/src/services/umap/umap.alignment.test.ts + - app/src/services/umap/umap.retrain-trigger.test.ts + +map-semantic-search: + parent: visual-map + title: Search by meaning + promise: > + Agent search finds notes by meaning as well as by words, and a note found both ways ranks above one found either way. + Without an OpenAI key it falls back to keywords. + entry: [app/src/server/mcp/semantic.ts] + implementation: + - app/src/server/mcp/rank-fusion.ts + - app/src/server/mcp/search-groups.ts + tests: + - app/src/server/mcp/rank-fusion.test.ts + - app/src/server/mcp/semantic.test.ts diff --git a/docs/capabilities/mcp-connector.yaml b/docs/capabilities/mcp-connector.yaml new file mode 100644 index 00000000..8ec29c5e --- /dev/null +++ b/docs/capabilities/mcp-connector.yaml @@ -0,0 +1,57 @@ +mcp-connector: + title: Agent connector (MCP) + promise: > + A connected agent such as ChatGPT or Claude can do nearly everything the user can + in the app, through one MCP endpoint. Reads need the read scope and writes need the + write scope; deleting stays with the user. + docs: [app/docs/mcp-connector.md, app/docs/mcp-parity.md] + entry: [app/src/routes/mcp.ts] + implementation: + - app/src/server/mcp/handler.ts + - app/src/server/mcp/tools.ts + - app/src/server/mcp/tool-registry.ts + - app/src/server/mcp/shared.ts + - app/src/server/mcp/config.ts + tests: [app/src/server/mcp/handler.test.ts] + +mcp-oauth: + parent: mcp-connector + title: Connect an agent with OAuth + promise: > + An agent registers and asks for access; you approve it on a consent page, and you + can see and revoke each connection later. + entry: [app/src/routes/oauth/authorize.tsx, app/src/routes/oauth/register.ts, app/src/routes/oauth/token.ts] + implementation: + - app/src/server/oauth/access.ts + - app/src/server/oauth/authorize.ts + - app/src/server/oauth/clients.ts + - app/src/server/oauth/crypto.ts + - app/src/server/oauth/metadata.ts + - app/src/server/oauth/route-helpers.ts + - app/src/server/oauth/token.ts + - app/src/components/oauth/OAuthConnectionsList.tsx + - app/src/components/oauth/OAuthConsentCard.tsx + - app/src/services/oauth/oauth-connections.ts + - app/src/services/oauth/oauth-consent.ts + - app/src/routes/admin/connections.tsx + tests: [app/src/server/oauth/oauth.test.ts] + +mcp-call-log: + parent: mcp-connector + title: Every agent call is recorded + promise: > + Each tool call is logged with the client, the arguments, the time it took and how + it ended, and the writes it caused carry the same request id. + implementation: [app/src/server/mcp/call-log.ts] + tests: [app/src/server/mcp/call-log.test.ts] + +mcp-feedback: + parent: mcp-connector + title: Agent feedback on the tools + promise: > + An agent can leave feedback about a tool that did not do what it needed, and the + app turns that feedback into feature notes. + implementation: + - app/src/server/mcp/feedback-tools.ts + - app/src/server/features/synthesizeFromFeedback.ts + tests: [app/src/server/mcp/feedback-tools.db.test.ts] diff --git a/docs/capabilities/note-audio.yaml b/docs/capabilities/note-audio.yaml new file mode 100644 index 00000000..0c720403 --- /dev/null +++ b/docs/capabilities/note-audio.yaml @@ -0,0 +1,90 @@ +note-audio: + title: Note audio + promise: > + Record or drop audio into a note, play it back, and get a transcript that connected assistants can + also read. + docs: [app/docs/note-audio.md] + +audio-record: + parent: note-audio + title: Record into a note + promise: > + Record from the note or the app bar's voice note button. Recording shows a live level meter, + keeps the screen awake and uploads in chunks as you talk, so a long recording survives a dropped + connection. + entry: + - app/src/components/doc-audio/RecordAudioButton.tsx + - app/src/components/doc-audio/useStartVoiceNote.ts + implementation: + - app/src/components/doc-audio/LevelBars.tsx + - app/src/components/doc-audio/LiveRecordingRow.tsx + - app/src/components/doc-audio/RecordingDot.tsx + - app/src/components/doc-audio/RecordingIndicator.tsx + - app/src/features/audio-recorder/chunk-uploader.ts + - app/src/features/audio-recorder/level-meter.ts + - app/src/features/audio-recorder/recorder-store.ts + - app/src/features/audio-recorder/useAudioRecorder.ts + - app/src/features/audio-recorder/wake-lock.ts + - app/src/routes/api/doc-audio/[id]/chunks.ts + - app/src/server/notes/doc-audio-chunks.ts + tests: + - path: app/tests/e2e/doc-audio.spec.ts + only: + - records audio into a note, plays it back, and renames it + - the app bar starts a new voice note + +audio-import: + parent: note-audio + title: Drop voice memos into a note + promise: > + Dropping audio files on a note turns them into recordings and shows each upload's progress. Other + files become attachment cards. A recording can be moved to another note. + entry: [app/src/components/doc-audio/useDocAudioDrop.ts] + implementation: + - app/src/components/doc-audio/DocAudioUploadRow.tsx + - app/src/components/doc-audio/MoveRecordingDialog.tsx + - app/src/components/doc-audio/uploadDocAudio.ts + - app/src/server/notes/doc-audio-encode.ts + - app/src/server/notes/doc-audio-import.ts + tests: + - path: app/tests/e2e/doc-audio.spec.ts + only: + - 'dropped voice memos become recordings; other files become cards' + +audio-playback: + parent: note-audio + title: Play and manage recordings + promise: > + A note lists its recordings in an audio strip. Play one, rename it or delete it. + entry: [app/src/components/doc-audio/DocAudioStrip.tsx] + implementation: + - app/src/components/doc-audio/DocAudioRow.tsx + - app/src/routes/api/doc-audio/[id]/index.ts + - app/src/routes/api/doc-audio/index.ts + - app/src/server/notes/doc-audio-storage.ts + - app/src/services/doc-audio/doc-audio.actions.ts + - app/src/services/doc-audio/doc-audio.queries.ts + tests: + - app/src/server/notes/doc-audio-storage.test.ts + - path: app/tests/e2e/doc-audio.spec.ts + only: + - records audio into a note, plays it back, and renames it + +audio-transcript: + parent: note-audio + title: Transcripts + promise: > + Each recording is transcribed automatically. The note shows the transcript with timestamps, + grouped into sections with a status line while it runs, and the tasks found in it. Assistants + read the cleaned transcript and the raw timed text. + entry: [app/src/components/doc-audio/DocAudioTranscript.tsx] + implementation: + - app/src/components/doc-audio/DocAudioTasks.tsx + - app/src/components/doc-audio/TranscriptSections.tsx + - app/src/components/doc-audio/TranscriptStatusLine.tsx + - app/src/server/mcp/note-recordings.ts + - app/src/server/notes/doc-audio-transcribe.ts + - app/src/services/doc-audio/doc-audio.shared.ts + tests: + - app/src/server/notes/doc-audio-transcribe.test.ts + - app/src/services/doc-audio/doc-audio.shared.test.ts diff --git a/docs/capabilities/notes.yaml b/docs/capabilities/notes.yaml new file mode 100644 index 00000000..06be806e --- /dev/null +++ b/docs/capabilities/notes.yaml @@ -0,0 +1,523 @@ +notes: + title: Notes + promise: > + Write and read notes in a block editor. Notes keep their text safe, show up in the notes list, and + are reachable by connected assistants. + entry: + - app/src/routes/docs/[id].tsx + implementation: + - app/src/services/docs.queries.ts + - app/src/services/docs.service.ts + - app/src/services/docs.resources.ts + tests: + - app/src/services/docs.queries.test.ts + - app/tests/e2e/homepage.spec.ts + +note-editor: + parent: notes + title: Edit a note in the editor + promise: > + Type in a rich editor with a toolbar, slash commands, emoji, code blocks with line numbers, tables + and keyboard shortcuts. On a phone the toolbar docks above the keyboard. AI prompts can rewrite a + selection and show the result before it lands. + entry: [app/src/components/DocumentEditor.tsx] + implementation: + - app/src/components/TiptapEditor.tsx + - app/src/components/editor/core/applyRemoteContent.ts + - app/src/components/editor/core/blockAnchor.ts + - app/src/components/editor/core/blockLinks.ts + - app/src/components/editor/core/createEditor.ts + - app/src/components/editor/core/exec.ts + - app/src/components/editor/core/insertContentOrText.ts + - app/src/components/editor/core/promptRegistry.ts + - app/src/components/editor/core/selection.ts + - app/src/components/editor/code-block/LineNumberedCodeView.tsx + - app/src/components/editor/code-block/codeBlockUtils.ts + - app/src/components/editor/code-block/renderCodeLines.ts + - app/src/components/editor/extensions/CustomCodeBlock.tsx + - app/src/components/editor/extensions/CustomTableCell.tsx + - app/src/components/editor/extensions/CustomTableHeader.tsx + - app/src/components/editor/extensions/CustomTableRow.tsx + - app/src/components/editor/extensions/DeferredFocusEvents.ts + - app/src/components/editor/extensions/ListItemReorderShortcuts.ts + - app/src/components/editor/extensions/NoteEmoji.ts + - app/src/components/editor/extensions/SelectionMarkShortcuts.ts + - app/src/components/editor/extensions/SlashCommands.ts + - app/src/components/editor/extensions/emojiSuggestion.ts + - app/src/components/editor/extensions/index.ts + - app/src/components/editor/extensions/slashItems.ts + - app/src/components/editor/extensions/suggestionMenu.ts + - app/src/components/editor/nodeviews/NodeViewContent.tsx + - app/src/components/editor/nodeviews/NodeViewWrapper.tsx + - app/src/components/editor/nodeviews/createSolidNodeViewRenderer.tsx + - app/src/components/editor/nodeviews/index.ts + - app/src/components/editor/nodeviews/useSolidNodeView.tsx + - app/src/components/editor/toolbar/Control.tsx + - app/src/components/editor/toolbar/LinkControl.tsx + - app/src/components/editor/toolbar/PhoneKeyboardToolbar.tsx + - app/src/components/editor/toolbar/Toggle.tsx + - app/src/components/editor/toolbar/ToolbarContents.tsx + - app/src/components/editor/toolbar/shortcuts.ts + - app/src/components/editor/toolbar/toolbarConfig.ts + - app/src/components/editor/ui/AIPromptsMenu.tsx + - app/src/components/editor/ui/AiPromptModal.tsx + - app/src/components/editor/ui/AiResultEditorModal.tsx + - app/src/components/editor/ui/AiResultModal.tsx + - app/src/components/editor/ui/PromptDesignerModal.tsx + - app/src/components/editor/ui/PromptsManagerModal.tsx + - app/src/components/editor/ui/Separator.tsx + - app/src/services/prompts/prompts.actions.ts + - app/src/services/prompts/prompts.queries.ts + tests: + - app/src/components/editor/core/createEditor.test.ts + - app/src/components/editor/extensions/slashItems.test.ts + - app/tests/e2e/new-note-mobile.spec.ts + +note-paste: + parent: note-editor + title: Paste text, markdown and tables + promise: > + Pasting markdown asks whether to keep it as formatted blocks or as plain text. Pasting CSV or + spreadsheet text offers to turn it into a table. + implementation: + - app/src/components/editor/csv/csvUtils.ts + - app/src/components/editor/extensions/CsvPaste.ts + - app/src/components/editor/extensions/MarkdownPaste.ts + - app/src/components/editor/ui/CsvPrompt.tsx + - app/src/components/editor/ui/MarkdownPrompt.tsx + - app/src/components/editor/ui/usePasteChoicePrompt.tsx + tests: + - app/src/components/editor/csv/csvUtils.test.ts + - app/src/components/editor/extensions/CsvPaste.test.ts + +note-title: + parent: notes + title: Name a note + promise: > + A note's title is edited in place at the top. A new note takes its title from the first heading + you type, and Escape restores the title you started with. A failed title save keeps your draft so + you can retry. + entry: [app/src/components/doc-header/DocTitleField.tsx] + implementation: + - app/src/components/InPlaceEditableText.tsx + - app/src/components/TitleEditPopover.tsx + - app/src/components/doc-header/leading-heading.ts + - app/src/components/new-note-title.ts + tests: + - app/src/components/doc-header/leading-heading.test.ts + - app/src/components/new-note-title.test.ts + - app/tests/e2e/archive-title-cancel.spec.ts + - app/tests/e2e/inline-title-failed-save.spec.ts + - app/tests/e2e/note-title-hydration.spec.ts + +note-create: + parent: notes + title: Create a note + promise: > + New note opens an empty editor from the sidebar, the app bar or a link, with a path you can set + before the first save. It works on a phone too. + entry: [app/src/routes/docs/new.tsx] + implementation: + - app/src/components/NewNoteModal.tsx + - app/src/server/notes/create-note.ts + tests: + - app/tests/e2e/new-note-mobile.spec.ts + - app/tests/e2e/path-editor-modal.spec.ts + +note-view: + parent: notes + title: Read a note + promise: > + A note opens with its header, actions menu, side panel and a summary of recent activity. Delete + sits in the actions menu, not in the header. Hovering a note link previews its target. + entry: [app/src/components/DocumentViewer.tsx] + implementation: + - app/src/components/DocActivitySummaryPopover.tsx + - app/src/components/DocumentSidePanel.tsx + - app/src/components/ReadOnlyDocumentContent.tsx + - app/src/components/doc-header/DocActionsMenu.tsx + - app/src/components/doc-header/DocHeaderBar.tsx + - app/src/components/doc-header/DocPanelActions.tsx + - app/src/components/doc-header/relative-time.ts + - app/src/components/docs/DocHoverPreviewLink.tsx + - app/src/components/docs/DocPreviewSummary.tsx + tests: + - app/tests/e2e/route-hydration-smoke.spec.ts + - app/tests/e2e/note-title-hydration.spec.ts + +note-properties: + parent: notes + title: Note properties and path + promise: > + Give a note a path and key-value properties, with suggestions from the keys and values already in + use. A late save never replaces a note you switched to or a newer draft. + entry: [app/src/components/DocPropertiesCompactEditors.tsx] + implementation: + - app/src/components/MetaKeyValueEditor.tsx + - app/src/components/MetaKeySuggestions.tsx + - app/src/components/MetaValueSuggestions.tsx + - app/src/components/doc-properties/meta-draft.ts + - app/src/components/doc-properties/path-draft.ts + - app/src/server/notes/note-meta.ts + tests: + - app/src/components/doc-properties/meta-draft.test.ts + - app/tests/e2e/path-editor-late-save.spec.ts + +note-links: + parent: notes + title: Link notes and see backlinks + promise: > + Type a note name to link to it. Links keep the target's current title, follow a block that moved + and follow an archived note to where its content went. A note lists the notes that link to it. + entry: [app/src/components/docs/BacklinksSection.tsx] + implementation: + - app/src/components/editor/extensions/NoteLinkSuggestion.ts + - app/src/lib/note-content/note-link.ts + - app/src/server/notes/note-index.ts + - app/src/server/notes/note-links.ts + - app/src/services/note-links.queries.ts + tests: + - app/src/lib/note-content/project.test.ts + +note-tags: + parent: notes + title: Tags + promise: > + Type a tag in a note and it becomes a real tag that survives a reload. The Tags page lists every + tag by use, and a tag's page lists the blocks that carry it, grouped by note. + entry: + - app/src/routes/tags/index.tsx + - app/src/routes/tags/[tag].tsx + implementation: + - app/src/components/editor/extensions/TagSuggestion.ts + - app/src/components/ui/tags-input.tsx + - app/src/lib/note-content/tag.ts + - app/src/server/notes/note-views.ts + - app/src/services/note-views.queries.ts + - app/src/theme/recipes/tags-input.ts + tests: + - app/tests/e2e/typed-tags.spec.ts + +note-toc: + parent: notes + title: Table of contents + promise: > + A note's headings form a contents outline beside the text that follows your place and jumps to a + heading on click. On a phone it opens as a sheet. + entry: [app/src/components/TableOfContents.tsx] + implementation: + - app/src/components/toc/TocFlyout.tsx + - app/src/components/toc/TocMobileSheet.tsx + - app/src/components/toc/TocOutline.tsx + - app/src/components/toc/TocRail.tsx + - app/src/components/toc/constants.ts + - app/src/components/toc/headings.ts + - app/src/components/toc/layout.ts + - app/src/components/toc/markers.ts + - app/src/components/toc/outline-styles.ts + - app/src/components/toc/range.ts + - app/src/components/toc/types.ts + - app/src/components/toc/useTocController.ts + - app/src/components/toc/utils.ts + tests: + - app/src/components/toc/range.test.ts + - path: app/tests/e2e/new-note-mobile.spec.ts + only: + - contents sheet replaces the rail and jumps to a heading + +note-save-safety: + parent: notes + title: Typing is never lost + promise: > + Typing in a note saves it. A failed save retries by itself, keeps your text and survives a reload, + and a late acknowledgement never marks newer text as saved. A lost session keeps the draft and + saves when you sign in again. Leaving with unsaved text asks first. + entry: [app/src/components/doc-header/DocSaveStatus.tsx] + implementation: + - app/src/server/notes/note-store.ts + - app/src/server/notes/note-write.ts + - app/src/services/docs.actions.ts + tests: + - app/src/server/notes/note-store.test.ts + - app/tests/e2e/note-safety-gaps.spec.ts + - app/tests/e2e/note-session-recovery.spec.ts + - app/tests/e2e/note-text-safety.spec.ts + - app/tests/e2e/canvas-note-panel.spec.ts + +note-history: + parent: notes + title: Version history + promise: > + Every overwrite keeps the previous text as a version. Open the versions list from the header to + see them and restore one. + entry: [app/src/components/doc-header/DocVersionsPopover.tsx] + implementation: + - app/src/server/notes/note-revisions.ts + - app/src/services/doc-revisions.ts + tests: + - app/src/services/doc-revisions.test.ts + - app/src/server/mcp/notes-write.test.ts + +note-live-updates: + parent: notes + title: Live updates of an open note + promise: > + A note open in a tab takes an edit made elsewhere, by another tab or an agent. If you are typing, + both edits are merged instead of dropped, and your own saves do not echo back. A note created + elsewhere appears in the list. + docs: [app/docs/live-note-updates.md] + entry: [app/src/features/live-sync/NoteLiveSyncProvider.tsx] + implementation: + - app/src/features/live-sync/forget-query.ts + - app/src/features/live-sync/note-live-keys.ts + - app/src/features/live-sync/refresh-batcher.ts + - app/src/features/live-sync/remote-note-change.ts + - app/src/features/live-sync/useLiveNoteResource.ts + - app/src/features/live-sync/useRemoteNoteChanges.ts + - app/src/lib/note-content/merge.ts + - app/src/lib/note-events.ts + - app/src/server/note-change-extension.ts + - app/src/server/note-events.ts + tests: + - app/src/features/live-sync/refresh-batcher.test.ts + - app/src/features/live-sync/remote-note-change.test.ts + - app/src/lib/note-content/merge.test.ts + - app/src/server/note-change-extension.test.ts + - app/src/server/note-events.test.ts + - app/tests/e2e/live-note-updates.spec.ts + +note-archive: + parent: notes + title: Archived notes + promise: > + Archiving hides a note from lists and search but keeps it openable. After the retention window the + note is deleted and leaves a tombstone, so old links still say where the content went. + entry: [app/src/routes/docs/archived.tsx] + implementation: + - app/src/components/note-archive/ArchivedNoteBanner.tsx + - app/src/components/note-archive/ArchivedNotesView.tsx + - app/src/components/note-archive/NoteTombstoneNotice.tsx + - app/src/components/note-archive/archive-format.ts + - app/src/server/notes/archive-window.ts + - app/src/server/notes/note-archive.ts + - app/src/services/note-archive/note-archive.actions.ts + - app/src/services/note-archive/note-archive.queries.ts + tests: + - app/src/components/note-archive/archive-format.test.ts + - app/src/server/notes/note-archive.test.ts + +note-content-model: + parent: notes + title: Notes as blocks, markdown in and out + promise: > + A note is stored as blocks, each with a stable id, and converts to and from markdown and HTML + without losing content. Notes written before blocks existed are converted in batches, with a + report of any loss. + implementation: + - app/src/lib/markdown-utils.ts + - app/src/lib/note-content/block-ids.ts + - app/src/lib/note-content/block-ops.ts + - app/src/lib/note-content/convert.ts + - app/src/lib/note-content/ids.ts + - app/src/lib/note-content/markdown.ts + - app/src/lib/note-content/note-markdown.ts + - app/src/lib/note-content/project.ts + - app/src/lib/note-content/schema.ts + - app/src/lib/note-content/types.ts + - app/src/server/lib/markdown.ts + - app/src/server/notes/block-migration.ts + - app/src/server/notes/imported-markdown-corpus.ts + tests: + - app/src/lib/note-content/block-ops.test.ts + - app/src/lib/note-content/convert.test.ts + - app/src/lib/note-content/note-markdown.test.ts + - app/src/lib/note-content/project.test.ts + - app/src/server/lib/markdown.test.ts + - app/src/server/notes/block-migration-workload.test.ts + - app/src/server/notes/block-migration.test.ts + +note-inline-tasks: + parent: notes + title: Tasks inside a note + promise: > + A task written in a note shows as a checkbox row and also lives in the Inbox task list. Ticking it + in either place updates both, and renaming it in Tasks survives edits to other blocks. + implementation: + - app/src/components/editor/extensions/TaskRefView.tsx + - app/src/lib/note-content/task-ref.ts + - app/src/server/mcp/note-write-tasks.ts + - app/src/server/notes/inline-tasks.ts + tests: + - app/src/server/mcp/note-write-tasks.test.ts + - path: app/src/server/mcp/notes-write.test.ts + only: + - keeps a task renamed in Tasks when it edits another block + +note-collection-embed: + parent: notes + title: Embed a collection in a note + promise: > + A note can embed a collection view that shows its rows inline, in the editor and in exported + markdown. + implementation: + - app/src/components/editor/extensions/CollectionViewNode.tsx + - app/src/lib/note-content/collection-view.ts + tests: + - app/src/lib/note-content/collection-view.test.ts + - app/src/server/lib/markdown.collection-embed.test.ts + +note-images: + parent: notes + title: Images in notes + promise: > + Paste or drop an image into a note and it uploads, shows a placeholder meanwhile, and opens large + on click. Markdown with relative image paths can be scanned and its images imported. + docs: [app/docs/note-images.md] + entry: [app/src/components/editor/extensions/CustomImage.tsx] + implementation: + - app/src/components/editor/extensions/ImagePaste.ts + - app/src/components/editor/images/imagePasteState.ts + - app/src/components/editor/images/prepareImage.ts + - app/src/components/editor/images/transferImages.ts + - app/src/components/editor/images/uploadImage.ts + - app/src/components/editor/images/uploadPlaceholder.ts + - app/src/components/editor/ui/ImageLoadFallback.tsx + - app/src/components/editor/ui/ImagePreviewModal.tsx + - app/src/components/editor/ui/imagePreviewService.tsx + - app/src/features/docs-index/data/docs.actions.scan-relative-images.ts + - app/src/features/docs-index/data/docs.scan-relative-images.helpers.ts + - app/src/routes/api/doc-images/[name].ts + - app/src/routes/api/doc-images/index.ts + - app/src/server/mcp/note-images.ts + - app/src/services/doc-images/doc-images.shared.ts + tests: + - app/src/components/editor/extensions/ImagePaste.test.ts + - app/src/components/editor/images/transferImages.test.ts + - app/src/routes/api/doc-images/index.test.ts + - app/src/server/mcp/note-images.test.ts + +note-files: + parent: notes + title: File attachments + promise: > + Drop a file into a note and it becomes an attachment card that survives a reload and downloads by + name. + docs: [app/docs/note-files.md] + entry: [app/src/components/editor/extensions/FileAttachmentNode.tsx] + implementation: + - app/src/server/lib/doc-file-store.ts + - app/src/components/editor/extensions/FilePaste.ts + - app/src/components/editor/files/FileKindIcon.tsx + - app/src/components/editor/files/filePasteState.ts + - app/src/components/editor/files/uploadFile.ts + - app/src/lib/note-content/file-attachment.ts + - app/src/routes/api/doc-files/[hash]/[name].ts + - app/src/routes/api/doc-files/index.ts + - app/src/server/mcp/note-files-tools.ts + - app/src/server/mcp/note-files.ts + - app/src/services/doc-files/doc-files.shared.ts + tests: + - app/src/server/lib/doc-file-store.test.ts + - app/src/lib/note-content/file-attachment.test.ts + - app/src/routes/api/doc-files/index.test.ts + - app/src/server/mcp/note-files-tools.test.ts + - app/src/server/mcp/note-files.test.ts + - app/tests/e2e/note-files.spec.ts + +notes-index: + parent: notes + title: Browse the notes list + promise: > + The notes page lists notes by recent edit with filter facets for paths, tags and properties. + Active filters show as removable tokens, results load in pages, and the list works by keyboard. + Select several notes to set properties or paths in bulk. + entry: [app/src/features/docs-index/components/DocsIndexPage.tsx] + implementation: + - app/src/features/docs-index/components/ActionsMenu.tsx + - app/src/features/docs-index/components/ActiveFilterTokens.tsx + - app/src/features/docs-index/components/BulkMetaModal.tsx + - app/src/features/docs-index/components/BulkPathModal.tsx + - app/src/features/docs-index/components/CollectionRowsToggle.tsx + - app/src/features/docs-index/components/DocRow.tsx + - app/src/features/docs-index/components/DocsIndexHeader.tsx + - app/src/features/docs-index/components/DocsToolbar.tsx + - app/src/features/docs-index/components/FacetList.tsx + - app/src/features/docs-index/components/FacetRail.tsx + - app/src/features/docs-index/components/ListEmptyState.tsx + - app/src/features/docs-index/components/LoadMoreButton.tsx + - app/src/features/docs-index/components/ResultsSection.tsx + - app/src/features/docs-index/components/SelectionBar.tsx + - app/src/features/docs-index/components/facet-labels.ts + - app/src/features/docs-index/data/docs-cleanup.ts + - app/src/features/docs-index/data/docs.actions.path-round.ts + - app/src/features/docs-index/data/docs.actions.ts + - app/src/features/docs-index/data/docs.facets.ts + - app/src/features/docs-index/data/docs.queries.list.ts + - app/src/features/docs-index/data/docs.queries.shared.ts + - app/src/features/docs-index/data/docs.queries.sources.ts + - app/src/features/docs-index/data/docs.service.ts + - app/src/features/docs-index/data/docs.types.ts + - app/src/features/docs-index/hooks/useAbortableFetch.ts + - app/src/features/docs-index/hooks/useAskDialog.tsx + - app/src/features/docs-index/hooks/useDebouncedSignal.ts + - app/src/features/docs-index/hooks/useDocsIndexBulkActions.ts + - app/src/features/docs-index/hooks/useDocsIndexUrlSync.ts + - app/src/features/docs-index/hooks/useDocsListKeyboard.ts + - app/src/features/docs-index/hooks/useDocsPages.ts + - app/src/features/docs-index/state/docsQuery.ts + - app/src/features/docs-index/utils/collection-rows-cookie.ts + - app/src/features/docs-index/utils/doc-preview.ts + - app/src/features/docs-index/utils/grouping.ts + - app/src/features/docs-index/utils/highlight.tsx + - app/src/features/docs-index/utils/meta.ts + - app/src/features/docs-index/utils/snippet.ts + - app/src/features/docs-index/utils/time.ts + tests: + - app/src/features/docs-index/data/docs.actions.test.ts + - app/src/features/docs-index/data/docs.facets.test.ts + - app/src/features/docs-index/data/docs.queries.shared.test.ts + - app/src/features/docs-index/hooks/useDocsIndexBulkActions.test.ts + - app/src/features/docs-index/utils/grouping.test.ts + - app/src/features/docs-index/utils/time.test.ts + - app/tests/e2e/homepage.spec.ts + +notes-search: + parent: notes + title: Search notes + promise: > + Typing in the notes search box finds notes by words and by meaning, highlights the match and shows + a snippet. In the command palette, Enter opens the best match, even before all results arrive. + New and edited notes become searchable on their own. + entry: [app/src/features/docs-index/components/SearchInput.tsx] + implementation: + - app/src/features/docs-index/data/docs.queries.search.ts + - app/src/features/docs-index/hooks/useServerSearch.ts + - app/src/features/docs-index/utils/fuzzy.ts + - app/src/server/notes/embedding-refresh.ts + - app/src/server/notes/search-text.ts + tests: + - app/src/features/docs-index/data/docs.queries.search.test.ts + - app/src/features/docs-index/hooks/useServerSearch.test.ts + - app/src/server/notes/embedding-refresh.test.ts + - app/tests/e2e/command-palette.spec.ts + +notes-agent-tools: + parent: notes + title: Assistants read and write notes + promise: > + A connected assistant can search, list and read notes, create them, append to them, edit one block + or replace the text, and restore a version. Assistant edits show up in the open note live and + keep a revision. + docs: [app/docs/mcp-connector.md] + entry: [app/src/server/mcp/notes-tools.ts] + implementation: + - app/src/server/mcp/note-content.ts + - app/src/server/mcp/notes-context-tools.ts + - app/src/server/mcp/notes-read.ts + - app/src/server/mcp/notes-write.ts + - app/src/server/mcp/paths.ts + tests: + - app/src/server/mcp/note-content.test.ts + - app/src/server/mcp/notes-write.db.test.ts + - app/src/server/mcp/notes-write.test.ts + - app/src/server/mcp/paths.test.ts diff --git a/docs/capabilities/paths.yaml b/docs/capabilities/paths.yaml new file mode 100644 index 00000000..41687970 --- /dev/null +++ b/docs/capabilities/paths.yaml @@ -0,0 +1,55 @@ +note-paths: + title: Browse notes by path + promise: > + Notes live at dotted paths such as work.plans. Open /path to browse a tree of paths + with counts, find a path by typing, and see the notes filed there, sorted by recency + or title. + entry: + - app/src/routes/path/index.tsx + - app/src/routes/path/[...segments].tsx + - app/src/routes/paths.tsx + - app/src/features/path-view/components/PathBrowserShell.tsx + implementation: + - app/src/features/path-view/utils/path-tree.ts + - app/src/features/path-view/hooks/usePathTreeFocus.ts + - app/src/features/path-view/hooks/usePathHoverCard.ts + - app/src/features/path-view/utils/path-notes.ts + - app/src/features/path-view/hooks/usePathKeyboard.ts + - app/src/features/path-view/hooks/usePathNotePreviews.ts + - app/src/features/path-view/hooks/usePathViewParams.ts + - app/src/features/path-view/hooks/usePathTree.ts + - app/src/features/path-view/components/PathTreeRail.tsx + - app/src/features/path-view/components/PathNoteList.tsx + - app/src/features/path-view/components/PathNoteToolbar.tsx + - app/src/features/path-view/components/PathTreeRailNode.tsx + - app/src/features/path-view/components/PathHoverCard.tsx + - app/src/features/path-view/components/PathSubpathGrid.tsx + - app/src/features/path-view/components/PathRecentList.tsx + - app/src/features/path-view/components/PathQuickCreate.tsx + - app/src/features/path-view/components/PathNoteRow.tsx + - app/src/features/path-view/components/PathHeader.tsx + - app/src/features/path-view/components/PathIndexView.tsx + - app/src/features/path-view/components/PathTreePopover.tsx + - app/src/features/path-view/components/PathDetailView.tsx + - app/src/features/path-view/components/PathNoteListSkeleton.tsx + - app/src/features/path-view/components/PathEmptyState.tsx + - app/src/components/path/PathPillLink.tsx + - app/src/components/path/PathHeadingLink.tsx + tests: + - app/src/features/path-view/utils/path-tree.test.ts + - app/src/features/path-view/utils/path-notes.test.ts + +path-editor: + parent: note-paths + title: Choose a note's path + promise: > + Type or pick a path while writing a note. Typed segments are kept, and a late save + never overwrites a note you switched to or a newer draft. + entry: + - app/src/components/PathEditor.tsx + implementation: + - app/src/components/PathRelatedNotesPopover.tsx + tests: + - app/tests/e2e/path-editor-late-save.spec.ts + - app/tests/e2e/path-editor-modal.spec.ts + diff --git a/docs/capabilities/pathways.yaml b/docs/capabilities/pathways.yaml new file mode 100644 index 00000000..6f2ca736 --- /dev/null +++ b/docs/capabilities/pathways.yaml @@ -0,0 +1,156 @@ +pathways: + title: Pathways + promise: > + Turn a goal or a task into a map of options and next steps, at /pathways. Compare + routes on a graph, pick a way forward, and keep the map as the plan changes. + docs: [app/docs/pathways-agent.md] + entry: + - app/src/routes/pathways/index.tsx + - app/src/routes/pathways/[id].tsx + - app/src/components/pathways/PathwaysIndex.tsx + - app/src/components/pathways/PathwayPage.tsx + implementation: + - app/src/components/pathways/PathwayPanel.tsx + - app/src/components/pathways/PathwayCard.tsx + - app/src/components/pathways/OverviewPanel.tsx + - app/src/components/pathways/styles.ts + - app/src/components/pathways/Markdown.tsx + - app/src/components/pathways/ActionButton.tsx + - app/src/services/pathways/pathways.queries.ts + - app/src/lib/pathways/types.ts + tests: + - app/src/server/pathways/pathway-start.db.test.ts + +pathway-start: + parent: pathways + title: Start a map from a task or note + promise: > + Start a map from a task or a note. A task is mapped once and links back to it, and a + note's text goes into Goals and vibes. + implementation: + - app/src/server/pathways/pathway-start.ts + tests: + - app/src/server/pathways/pathway-start.db.test.ts + +pathway-graph: + parent: pathways + title: See the map + promise: > + The map lays options out as lanes of cards joined by edges, with a hover peek and a + side panel for details. Cards reached from two first choices share a lane. Routes are + worked out in the background so panning stays smooth. + entry: + - app/src/components/pathways/PathwayGraph.tsx + implementation: + - app/src/components/pathways/layout.ts + - app/src/components/pathways/graph-styles.ts + - app/src/components/pathways/card-fit.ts + - app/src/components/pathways/textfit.ts + - app/src/components/pathways/EdgeList.tsx + - app/src/components/pathways/useRoutes.ts + - app/src/components/pathways/route.worker.ts + - app/src/components/pathways/engine/routing-engine.js + - app/src/components/pathways/engine/routing-engine.d.ts + tests: + - app/src/components/pathways/layout.test.ts + +pathway-done-cards: + parent: pathways + title: Hide finished steps + promise: > + Mark a card done and the map hides it but keeps the path whole, joining its earlier + cards to its later ones. A dropped card still cuts the path. Show the done cards + again, faded, on request. + implementation: + - app/src/lib/pathways/frontier.ts + tests: + - app/src/lib/pathways/frontier.test.ts + +pathway-card-editing: + parent: pathways + title: Edit cards and links + promise: > + Open a card to edit its title, notes and status, add options after it, link cards, + merge duplicates, or remove a card with its links. The root card can never be removed. + entry: + - app/src/components/pathways/NodePanel.tsx + implementation: + - app/src/components/pathways/pathway-state.ts + - app/src/lib/pathways/graph-ops.ts + - app/src/components/pathways/ChangeToast.tsx + - app/src/components/pathways/AutoText.tsx + tests: + - app/src/lib/pathways/graph-ops.test.ts + +pathway-history: + parent: pathways + title: Undo map changes + promise: > + Every change to a map is saved as a revision and can be undone in order. Two edits + made at the same moment both survive. + implementation: + - app/src/server/pathways/pathway-store.ts + tests: + - app/src/server/pathways/pathway-store.db.test.ts + +pathway-agent: + parent: pathways + title: Ask the map agent + promise: > + Ask an AI agent to build a first map, extend a card, regenerate the map, update it + from what happened, or turn research findings into new cards. It edits the map in + place, and you can undo. + entry: + - app/src/components/pathways/MapAgentMenu.tsx + implementation: + - app/src/server/pathways/agent.ts + - app/src/server/pathways/agent-input.ts + - app/src/server/pathways/agent-prompts.ts + - app/src/services/pathways/pathways.actions.ts + - app/src/components/pathways/ActivityPanel.tsx + - app/src/components/pathways/ResearchSection.tsx + - app/scripts/pathways-eval.ts + tests: + - app/src/lib/pathways/graph-ops.test.ts + +pathway-split: + parent: pathways + title: Spin a card out as its own map + promise: > + Make a card the question of a new map. The new map keeps only what follows from that + card. + implementation: + - app/src/lib/pathways/split.ts + tests: + - app/src/lib/pathways/split.test.ts + +pathway-plan: + parent: pathways + title: Next steps and task export + promise: > + Keep a list of next steps for the chosen route. A fresh plan keeps steps you have + finished or exported. Send a step to a task list, and its status stays in step with + the task. + entry: + - app/src/components/pathways/NextSteps.tsx + implementation: + - app/src/lib/pathways/plan.ts + - app/src/server/pathways/pathway-tasks.ts + - app/src/components/pathways/ExportPicker.tsx + - app/src/components/pathways/GoalsSection.tsx + tests: + - app/src/lib/pathways/plan.test.ts + - app/src/server/pathways/pathway-tasks.db.test.ts + +pathway-agent-tools: + parent: pathways + title: Agents can read and edit maps + promise: > + An outside agent can list and read maps, create one from a task, edit cards, set the + plan, report research findings and undo. Edits are saved with undo like the agent in + the app. + entry: + - app/src/server/mcp/pathways-tools.ts + tests: + - app/src/server/mcp/pathways-tools.db.test.ts + diff --git a/docs/capabilities/people.yaml b/docs/capabilities/people.yaml new file mode 100644 index 00000000..6bfff247 --- /dev/null +++ b/docs/capabilities/people.yaml @@ -0,0 +1,204 @@ +people: + title: People + promise: > + A private memory of the people you know, at /people, kept apart from notes. Search and + filter a directory of everyone, open a person, and see when you last spoke. + docs: [app/docs/people.md] + entry: + - app/src/routes/people/index.tsx + - app/src/routes/people/[id].tsx + - app/src/components/people/PeopleShell.tsx + - app/src/components/people/PeopleTabs.tsx + implementation: + - app/src/server/people/person-store.ts + - app/src/server/people/recency.ts + - app/src/server/people/errors.ts + - app/src/components/people/PeopleDirectory.tsx + - app/src/components/people/PeopleFilters.tsx + - app/src/components/people/PersonRow.tsx + - app/src/components/people/PersonPicker.tsx + - app/src/components/people/SearchPicker.tsx + - app/src/components/people/PersonPreview.tsx + - app/src/services/people/people.actions.ts + - app/src/services/people/people.queries.ts + - app/src/lib/people/types.ts + - app/src/lib/people/schemas.ts + - app/src/lib/people/dates.ts + - app/src/lib/people/contacts.ts + - app/scripts/people-seed.ts + tests: + - app/src/server/people/people.db.test.ts + - app/src/lib/people/contacts.test.ts + +person-profile: + parent: people + title: Open a person's profile + promise: > + Open a person to see their contact details, custom fields, remembered facts, linked + notes, and the history of changes to their profile. Edit any of it, or archive the + person to keep their history without showing them in the directory. + entry: + - app/src/components/people/PersonProfileView.tsx + implementation: + - app/src/server/people/profile-store.ts + - app/src/components/people/ProfileDialog.tsx + - app/src/components/people/ProfileHistory.tsx + - app/src/components/people/ContactsSection.tsx + - app/src/components/people/CustomFieldsSection.tsx + - app/src/components/people/LinkedNotesSection.tsx + - app/src/components/people/AffiliationsSection.tsx + - app/src/components/people/profile-section.tsx + tests: + - app/src/server/people/profiles.db.test.ts + +people-capture: + parent: people + title: Record what you remember + promise: > + Log a conversation with one or more people, or save a short fact about someone. Only a + conversation changes when you last spoke to a person. A fact, or a person who was only + discussed, does not. + entry: + - app/src/components/people/CaptureDialog.tsx + implementation: + - app/src/server/people/memory-store.ts + - app/src/components/people/InteractionDialog.tsx + - app/src/components/people/FactItem.tsx + - app/src/components/people/FollowupRow.tsx + - app/src/components/people/capture-state.ts + - app/src/components/people/PeopleCaptureHost.tsx + tests: + - app/src/server/people/people.db.test.ts + +people-career: + parent: people + title: Career history and overlaps + promise: > + A profile leads with the jobs a person has held, newest first and grouped by employer, + with dates only as precise as the source. Shows who else worked at the same place at + the same time, and says plainly when the dates are too vague to tell. + entry: + - app/src/components/people/ExperienceSection.tsx + implementation: + - app/src/server/people/affiliation-store.ts + - app/src/lib/people/career-periods.ts + - app/src/components/people/ExperienceRole.tsx + - app/src/components/people/RoleForm.tsx + - app/src/components/people/role-draft.ts + - app/src/components/people/CompanyTimeline.tsx + - app/src/components/people/company-timeline-model.ts + - app/src/components/people/TimelineBar.tsx + - app/src/components/people/OverlapRow.tsx + tests: + - app/src/lib/people/career-periods.test.ts + - app/src/components/people/company-timeline-model.test.ts + - app/src/server/people/profiles.db.test.ts + +people-organizations: + parent: people + title: Companies and organizations + promise: > + Browse the organizations people belong to, with an icon and website, and open one to + see everyone who has a role there. + entry: + - app/src/routes/people/organizations/index.tsx + - app/src/routes/people/organizations/[id].tsx + implementation: + - app/src/server/people/organization-store.ts + - app/src/server/people/org-icon.ts + - app/src/components/people/OrganizationView.tsx + - app/src/components/people/OrganizationsList.tsx + - app/src/components/people/OrganizationDialog.tsx + - app/src/components/people/OrgHoverLink.tsx + - app/src/components/people/OrgMark.tsx + tests: + - app/src/server/people/org-icon.test.ts + +people-network: + parent: people + title: Relationships and introduction paths + promise: > + Record how two people are connected, such as manager or friend, and see the network as + a graph. Ask for the shortest chain of people between you and someone else. A shared + employer shows only as a lead, never as a connection. + entry: + - app/src/routes/people/network.tsx + - app/src/components/people/NetworkView.tsx + implementation: + - app/src/server/people/relationship-store.ts + - app/src/lib/people/relationships.ts + - app/src/lib/people/network-layout.ts + - app/src/components/people/NetworkGraph.tsx + - app/src/components/people/RelationshipsSection.tsx + tests: + - app/src/server/people/network.db.test.ts + +people-reconnect: + parent: people + title: Reconnect reminders + promise: > + Turn on a reminder cadence for a person, and they show up in a Reconnect list when it + is time to get in touch. Snooze or dismiss a suggestion. People with no recorded + contact are not called overdue. + entry: + - app/src/routes/people/reconnect.tsx + - app/src/components/people/ReconnectView.tsx + implementation: + - app/src/server/people/reconnect-store.ts + - app/src/components/people/ReconnectSection.tsx + tests: + - app/src/server/people/reconnect.db.test.ts + +people-import: + parent: people + title: Import people from a file + promise: > + Upload a CSV, such as a LinkedIn connections export, map its columns, preview the + rows, and apply. Importing the same file again adds no duplicates and keeps what you + edited. A career collection imports the same way, with its jobs. + entry: + - app/src/routes/people/import.tsx + - app/src/components/people/PeopleImportView.tsx + implementation: + - app/src/server/people/import-store.ts + - app/src/server/people/career-import-store.ts + - app/src/lib/people/csv.ts + - app/src/lib/people/import-mapping.ts + - app/src/lib/people/career-import.ts + - app/src/components/people/ImportRows.tsx + tests: + - app/src/server/people/import.db.test.ts + - app/src/lib/people/csv.test.ts + +people-duplicates: + parent: people + title: Find and merge duplicates + promise: > + See people who may be the same person and merge them. The kept profile gets the + other's facts, encounters, relationships and reminders. + entry: + - app/src/routes/people/duplicates.tsx + - app/src/components/people/DuplicatesView.tsx + implementation: + - app/src/server/people/merge-store.ts + - app/src/components/people/MergeDialog.tsx + - app/src/components/people/DuplicatesSection.tsx + tests: + - app/src/server/people/import.db.test.ts + - app/src/server/people/network.db.test.ts + +people-agent-tools: + parent: people + title: Agents can read and update People + promise: > + An outside agent can search people, read profiles, log conversations, facts and + follow-ups, and import careers. A name that matches several people returns the + candidates and writes nothing. Agents can archive but not delete, and never merge or + send anything. + entry: + - app/src/server/mcp/people-tools.ts + implementation: + - app/src/server/mcp/people-format.ts + tests: + - app/src/server/mcp/people-tools.db.test.ts + diff --git a/docs/capabilities/research.yaml b/docs/capabilities/research.yaml new file mode 100644 index 00000000..489edffa --- /dev/null +++ b/docs/capabilities/research.yaml @@ -0,0 +1,188 @@ +research: + title: Research threads + promise: > + Collect a question's cards, findings, options and tasks on one board per topic, at + /research. Agents fill topics and you read, comment and edit them. + docs: [app/docs/research-threads.md] + entry: + - app/src/routes/research/index.tsx + - app/src/routes/research/[slug].tsx + - app/src/components/research/ResearchTopicIndex.tsx + - app/src/components/research/ResearchTopicPage.tsx + implementation: + - app/src/components/research/TopicTitle.tsx + - app/src/components/research/TopicViewTabs.tsx + - app/src/components/research/EmptyTopic.tsx + - app/src/components/research/createTopicData.ts + - app/src/components/research/cardTypeMeta.tsx + - app/src/components/research/detail/detailStyles.ts + - app/src/services/research/research.queries.ts + - app/src/services/research/research.store.ts + - app/src/services/research/research.types.ts + - app/src/services/research/research.kinds.ts + - app/src/services/research/research.activity.ts + - app/scripts/research-seed.mjs + tests: + - app/tests/e2e/research-board.spec.ts + +research-board: + parent: research + title: Board of streams + promise: > + See a topic as columns, one per stream, with options, blockers and nested answers. + Switch to a compact density or an Options table that shows the same options. + entry: + - app/src/components/research/board/TopicBoard.tsx + implementation: + - app/src/components/research/board/BoardColumn.tsx + - app/src/components/research/board/BoardCardRow.tsx + - app/src/components/research/board/OptionsTable.tsx + - app/src/components/research/board/BoardContext.ts + - app/src/components/research/board/board-model.ts + - app/src/components/research/CardBody.tsx + - app/src/components/research/TopicBatchList.tsx + tests: + - app/src/components/research/board/board-model.test.ts + - app/tests/e2e/research-board.spec.ts + +research-map: + parent: research + title: Map of the topic + promise: > + Open a topic as a map of titles and counts, folded into branches, then read the text + in the side reader. Move by keyboard, step through search matches, and get a folding + tree on a phone. + entry: + - app/src/components/research/map/TopicMap.tsx + implementation: + - app/src/components/research/map/MapHeaderTree.tsx + - app/src/components/research/map/MapCanvas.tsx + - app/src/components/research/map/map-model.ts + - app/src/components/research/map/MapToolbar.tsx + - app/src/components/research/map/MapNodeView.tsx + - app/src/components/research/map/createMapState.ts + - app/src/components/research/map/createMapView.ts + - app/src/components/research/map/map-layout.ts + - app/src/components/research/map/mapNodeStyles.ts + - app/src/components/research/map/MapHoverCard.tsx + - app/src/components/research/map/createMapFocus.ts + - app/src/components/research/map/MapLinks.tsx + - app/src/components/research/map/map-keys.ts + - app/src/components/research/map/MapCountLine.tsx + tests: + - app/src/components/research/map/map-layout.test.ts + - app/tests/e2e/research-map.spec.ts + +research-reader: + parent: research + title: Read and outline cards + promise: > + Open a card in a reader beside the board that resizes, goes full width, and steps + through a stream. An outline view lists the same cards as a tree. + entry: + - app/src/components/research/inspector/TopicInspector.tsx + implementation: + - app/src/components/research/inspector/TopicContents.tsx + - app/src/components/research/inspector/contents.ts + - app/src/components/research/inspector/ReaderNav.tsx + - app/src/components/research/inspector/createReaderWidth.ts + - app/src/components/research/inspector/ReaderResizeHandle.tsx + - app/src/components/research/TopicOutline.tsx + - app/src/components/research/layout/sections.ts + - app/src/components/research/detail/CardDetailPanel.tsx + - app/src/components/research/detail/StreamDetailPanel.tsx + - app/src/components/research/detail/CardLinkList.tsx + tests: + - app/src/components/research/inspector/contents.test.ts + - app/tests/e2e/research-board.spec.ts + +research-editing: + parent: research + title: Edit, undo and remove cards + promise: > + Edit a card's text, gist, kind or stream, move it, or remove it with what came from + it. Every change is a batch that can be undone and redone, and undo is refused when a + later edit built on it. Rename or archive a topic. + entry: + - app/src/components/research/detail/CardEditForm.tsx + implementation: + - app/src/services/research/research.edits.ts + - app/src/services/research/research.actions.ts + tests: + - app/src/services/research/research.edits.db.test.ts + - app/tests/e2e/research-editing.spec.ts + +research-comments: + parent: research + title: Comments for the agent + promise: > + Leave a comment on a card as a note for the agent's next pass. The agent lists open + comments and marks them resolved. + entry: + - app/src/components/research/detail/CommentThread.tsx + implementation: + - app/src/services/research/research.comments.ts + tests: + - app/tests/e2e/research-board.spec.ts + +research-ingest: + parent: research + title: Agents add cards to a topic + promise: > + An agent posts a tree of cards with summaries, and it lands all at once or not at all. + Posting the same batch twice changes nothing, and every problem in a bad payload is + reported together. + entry: + - app/src/routes/api/research/topics.ts + - app/src/routes/api/research/topics/[topic].ts + - app/src/routes/api/research/topics/[topic]/ingest.ts + implementation: + - app/src/services/research/research.ingest.ts + - app/src/services/research/research.plan.ts + - app/src/services/research/research.payload.ts + - app/src/server/lib/research/auth.ts + tests: + - app/src/services/research/research.ingest.db.test.ts + - app/src/services/research/research.plan.test.ts + - app/src/server/lib/research/auth.test.ts + +research-setup: + parent: research + title: Declare streams and kinds + promise: > + Give a topic its own streams, card kinds with fields, and a topic answer. Dropping a + kind that cards use is refused, and the frame can be undone. + implementation: + - app/src/services/research/research.setup.ts + tests: + - app/src/services/research/research.setup.db.test.ts + +research-structure: + parent: research + title: Streams, relations and warnings + promise: > + Cards fall into the stream they came from, answers and blockers attach to the right + question, and a write returns warnings for untidy topics such as cards in no stream. + implementation: + - app/src/services/research/research.streams.ts + - app/src/services/research/research.relations.ts + - app/src/services/research/research.graph.ts + tests: + - app/src/services/research/research.streams.test.ts + +research-agent-tools: + parent: research + title: Agents can read and edit topics + promise: > + An outside agent can list, create and read topics and cards, add cards, change states, + edit, remove, undo and redo batches, and resolve comments. It needs write permission + to change anything. + entry: + - app/src/server/mcp/research-tools.ts + - app/src/server/mcp/research-tools-edit.ts + implementation: + - app/src/server/mcp/research-format.ts + - app/src/server/mcp/research-shared.ts + tests: + - app/src/server/mcp/research-tools.test.ts + diff --git a/docs/capabilities/sharing.yaml b/docs/capabilities/sharing.yaml new file mode 100644 index 00000000..c13a1cd9 --- /dev/null +++ b/docs/capabilities/sharing.yaml @@ -0,0 +1,56 @@ +sharing: + title: Sharing + promise: > + Publish a note at a public link that anyone can read without signing in, and cancel the link when + you want it private again. + docs: [app/docs/share-links.md] + +share-link: + parent: sharing + title: Create and cancel a share link + promise: > + From a note's share panel, create a public link, choose a custom slug, copy it, open it, or cancel + it. A note has one link at a time. A result that arrives late for a note you left never lands on + the note you are in now. + entry: [app/src/components/DocSharePanel.tsx] + implementation: + - app/src/components/share/ShareCopyLinkButton.tsx + - app/src/services/doc-shares.actions.ts + - app/src/services/doc-shares.service.ts + - app/src/services/doc-shares.shared.ts + tests: + - app/src/services/doc-shares.shared.test.ts + - app/tests/e2e/late-note-share-responses.spec.ts + +share-public-page: + parent: sharing + title: Read a shared note + promise: > + A share link opens the note as a clean reading page with no editor, showing the title, date, + reading time and an outline of its headings. A cancelled or unknown link says the note is not + found, and the page exposes no private properties. + entry: + - app/src/routes/share/[slug].tsx + implementation: + - app/src/components/share/ShareNotFound.tsx + - app/src/components/share/ShareOutlineRail.tsx + - app/src/components/share/SharedDocArticle.tsx + - app/src/components/share/share-reading-styles.ts + - app/src/components/share/share-reading.ts + - app/src/services/doc-shares.queries.ts + tests: + - app/src/components/share/share-reading.test.ts + - app/src/services/doc-shares.queries.test.ts + +share-preview: + parent: sharing + title: Link previews + promise: > + Pasting a share link into chat or social apps shows the note's title and a generated preview image. + entry: + - app/src/routes/share-og/[slug].ts + implementation: + - app/src/components/share/SharedDocHead.tsx + - app/src/server/share-og.ts + tests: + - app/src/services/doc-shares.queries.test.ts diff --git a/docs/capabilities/tasks.yaml b/docs/capabilities/tasks.yaml new file mode 100644 index 00000000..9da0853e --- /dev/null +++ b/docs/capabilities/tasks.yaml @@ -0,0 +1,100 @@ +tasks: + title: Tasks + promise: Keep nested task lists, add tasks fast, and let an AI agent work on the same lists. + +task-lists: + parent: tasks + title: Task lists + promise: > + Tasks live in named lists. You can create, rename and delete lists, switch between them, and see how many tasks are open, done and overdue. + entry: [app/src/routes/tasks.tsx] + implementation: + - app/src/services/tasks/inline-tasks.actions.ts + - app/src/services/tasks/tasks.actions.ts + - app/src/services/tasks/tasks.queries.ts + - app/src/services/tasks/tasks.service.ts + - app/src/services/tasks/tasks.types.ts + - app/src/components/tasks/TaskListsWorkspace.tsx + - app/src/components/tasks/TaskListPanel.tsx + - app/src/components/tasks/TaskListSelector.tsx + - app/src/components/tasks/TaskListHeader.tsx + - app/src/components/tasks/TaskListNameInput.tsx + - app/src/components/tasks/TaskListRowMenu.tsx + - app/src/components/tasks/TaskEmptyState.tsx + - app/src/components/tasks/createTaskData.ts + - app/src/server/tasks/task-store.ts + tests: + - path: app/tests/e2e/task-lists.spec.ts + only: ["task lists"] + - app/src/server/mcp/tasks-tools.db.test.ts + +task-tree-editing: + parent: tasks + title: Nested tasks edited in place + promise: > + Tasks nest under other tasks. You edit a title inline, move a task up, down or into a parent with the keyboard or a swipe, and open a task in a sheet for notes and subtasks. + A done parent with open children still counts as open. + entry: [app/src/components/tasks/TaskRow.tsx] + implementation: + - app/src/components/tasks/createTaskActions.ts + - app/src/components/tasks/TaskTree.tsx + - app/src/components/tasks/TaskTreeContext.tsx + - app/src/components/tasks/TaskDraftRow.tsx + - app/src/components/tasks/TaskRowMenu.tsx + - app/src/components/tasks/TaskRowMeta.tsx + - app/src/components/tasks/TaskRowSwipeBack.tsx + - app/src/components/tasks/TaskStatusIcon.tsx + - app/src/components/tasks/TaskShortcutsPopover.tsx + - app/src/components/tasks/TaskMarkdownPreview.tsx + - app/src/components/tasks/createRowSwipe.ts + - app/src/components/tasks/taskRowKeys.ts + - app/src/components/tasks/taskTouch.ts + - app/src/components/tasks/taskTreeOps.ts + - app/src/components/tasks/TaskEditorDialog.tsx + - app/src/components/tasks/TaskSheet.tsx + - app/src/components/tasks/TaskSheetButtons.tsx + - app/src/components/tasks/TaskSheetLists.tsx + - app/src/components/tasks/TaskSheetMain.tsx + - app/src/components/tasks/TaskSheetSubtask.tsx + tests: + - app/src/components/tasks/taskTreeOps.test.ts + - path: app/tests/e2e/task-lists.spec.ts + only: ["task lists"] + +task-quick-add: + parent: tasks + title: Quick add with tokens + promise: > + Typing a task title can set tags, a due date and a duration in the same line, such as a weekday, a date or 1h30. + Unknown @words and email addresses stay in the title. + entry: [app/src/components/tasks/TaskQuickAdd.tsx] + implementation: + - app/src/components/tasks/TaskQuickTokens.tsx + - app/src/components/tasks/taskTitle.ts + tests: + - path: app/src/components/tasks/taskTitle.test.ts + only: [parseTaskInput] + +task-due-dates: + parent: tasks + title: Due dates and filters + promise: > + Each task shows when it is due in plain words, overdue ones stand out, and you can filter to what is overdue or due today. + Finished tasks are never overdue. + entry: [app/src/components/tasks/TaskDueFilters.tsx] + implementation: + - app/src/components/tasks/taskFormat.ts + tests: + - path: app/src/components/tasks/taskTitle.test.ts + only: [matchesDueFilter, formatDue, formatDuration, summarizeTasks] + +tasks-agent-sync: + parent: tasks + title: Tasks through the connector + promise: > + An AI agent can list, create, update, move and query tasks and lists, and what it does shows up in the open Tasks page without a reload. + It can also update a task line inside an ordinary note. + entry: [app/src/server/mcp/tasks-tools.ts] + tests: + - app/tests/e2e/task-agent-sync.spec.ts + - app/src/server/mcp/tasks-tools.db.test.ts diff --git a/docs/capabilities/time-blocks.yaml b/docs/capabilities/time-blocks.yaml new file mode 100644 index 00000000..9187398c --- /dev/null +++ b/docs/capabilities/time-blocks.yaml @@ -0,0 +1,74 @@ +time-blocks: + title: Time blocks + promise: Plan each week by laying blocks of time on a calendar, next to values you track for each day. + +time-blocks-week-grid: + parent: time-blocks + title: Weekly calendar + promise: > + A week of day columns with an hour gutter shows each block at its time and length. + Overlapping blocks share the width of the day, and settings choose which hours and days are shown. + entry: + - app/src/routes/time-blocks.tsx + - app/src/components/time-blocks/WeeklyTimeBlocksCalendar.tsx + implementation: + - app/src/components/time-blocks/DayHeaderRow.tsx + - app/src/components/time-blocks/TimeGutter.tsx + - app/src/components/time-blocks/BlockFace.tsx + - app/src/components/time-blocks/TimeBlockCard.tsx + - app/src/components/time-blocks/TimeBlocksToolbar.tsx + - app/src/components/time-blocks/CalendarSettingsPopover.tsx + - app/src/components/time-blocks/useCalendarSettings.ts + - app/src/components/time-blocks/compact-day.ts + - app/src/components/time-blocks/date-utils.ts + - app/src/components/time-blocks/overlap.ts + - app/src/components/time-blocks/weekly-geometry.ts + tests: + - app/src/components/time-blocks/overlap.test.ts + - app/src/components/time-blocks/weekly-geometry.test.ts + - app/tests/e2e/time-blocks-layout.spec.ts + +time-block-editing: + parent: time-blocks + title: Create and edit blocks + promise: > + Drag on the calendar to create a block, drag it to move it and drag its edge to resize it. + A dialog edits the title, time, color and linked note, and a block's note shows its backlink. + entry: [app/src/components/time-blocks/TimeBlockEditorDialog.tsx] + implementation: + - app/src/components/time-blocks/useBlockDrag.ts + - app/src/components/time-blocks/DraftBlock.tsx + - app/src/components/time-blocks/BlockQuickPopover.tsx + - app/src/components/time-blocks/useTimeBlockMutations.ts + - app/src/components/time-blocks/useNestedDialogGuard.ts + - app/src/components/time-blocks/HueSwatches.tsx + - app/src/components/time-blocks/time-block-colors.ts + - app/src/components/time-blocks/NoteLinkField.tsx + - app/src/components/time-blocks/TimeBlockBacklinks.tsx + - app/src/components/time-blocks/TimeBlocksListDialog.tsx + tests: + - app/tests/e2e/time-blocks-interactions.spec.ts + - app/src/components/time-blocks/time-block-colors.test.ts + +time-block-day-values: + parent: time-blocks + title: Values for each day + promise: Record a value for a day, such as hours of sleep, and see a summary of those values across days. + entry: [app/src/components/time-blocks/TimeBlockMetadataSummaryDialog.tsx] + tests: + - app/tests/e2e/time-blocks-agent-sync.spec.ts + +time-blocks-agent-sync: + parent: time-blocks + title: Time blocks through the connector + promise: > + An AI agent can read the week, create and move blocks, and set a day's value, and its changes show up on the open calendar without a reload. + entry: [app/src/server/mcp/time-blocks-tools.ts] + implementation: + - app/src/server/time-blocks/time-block-store.ts + - app/src/services/time-blocks/time-blocks.actions.ts + - app/src/services/time-blocks/time-blocks.queries.ts + - app/src/services/time-blocks/time-blocks.service.ts + - app/src/services/time-blocks/time-blocks.types.ts + tests: + - app/tests/e2e/time-blocks-agent-sync.spec.ts