@agent-native/core 0.7.4 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -5
- package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
- package/dist/agent/engine/anthropic-engine.js +8 -4
- package/dist/agent/engine/anthropic-engine.js.map +1 -1
- package/dist/agent/engine/types.d.ts +1 -1
- package/dist/agent/engine/types.d.ts.map +1 -1
- package/dist/agent/production-agent.d.ts +7 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +153 -118
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts +4 -0
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +46 -25
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.d.ts +12 -3
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +25 -4
- package/dist/agent/run-store.js.map +1 -1
- package/dist/chat-threads/store.d.ts +13 -0
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +66 -10
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +8 -1
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/index.js +8 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/info.d.ts +2 -0
- package/dist/cli/info.d.ts.map +1 -0
- package/dist/cli/info.js +103 -0
- package/dist/cli/info.js.map +1 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +249 -85
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +12 -1
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +3 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +46 -2
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/VoiceButton.d.ts +21 -0
- package/dist/client/composer/VoiceButton.d.ts.map +1 -0
- package/dist/client/composer/VoiceButton.js +51 -0
- package/dist/client/composer/VoiceButton.js.map +1 -0
- package/dist/client/composer/useVoiceDictation.d.ts +38 -0
- package/dist/client/composer/useVoiceDictation.d.ts.map +1 -0
- package/dist/client/composer/useVoiceDictation.js +398 -0
- package/dist/client/composer/useVoiceDictation.js.map +1 -0
- package/dist/client/onboarding/OnboardingPanel.js +2 -2
- package/dist/client/onboarding/OnboardingPanel.js.map +1 -1
- package/dist/client/org/OrgSwitcher.d.ts +5 -4
- package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
- package/dist/client/org/OrgSwitcher.js +90 -24
- package/dist/client/org/OrgSwitcher.js.map +1 -1
- package/dist/client/resources/McpServerDetail.d.ts +15 -0
- package/dist/client/resources/McpServerDetail.d.ts.map +1 -0
- package/dist/client/resources/McpServerDetail.js +65 -0
- package/dist/client/resources/McpServerDetail.js.map +1 -0
- package/dist/client/resources/ResourceEditor.js +1 -1
- package/dist/client/resources/ResourceEditor.js.map +1 -1
- package/dist/client/resources/ResourceTree.d.ts +6 -1
- package/dist/client/resources/ResourceTree.d.ts.map +1 -1
- package/dist/client/resources/ResourceTree.js +18 -7
- package/dist/client/resources/ResourceTree.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +191 -20
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/client/resources/use-mcp-servers.d.ts +68 -0
- package/dist/client/resources/use-mcp-servers.d.ts.map +1 -0
- package/dist/client/resources/use-mcp-servers.js +83 -0
- package/dist/client/resources/use-mcp-servers.js.map +1 -0
- package/dist/client/resources/use-resources.d.ts +39 -1
- package/dist/client/resources/use-resources.d.ts.map +1 -1
- package/dist/client/resources/use-resources.js +102 -0
- package/dist/client/resources/use-resources.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +3 -2
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/VoiceTranscriptionSection.d.ts +14 -0
- package/dist/client/settings/VoiceTranscriptionSection.d.ts.map +1 -0
- package/dist/client/settings/VoiceTranscriptionSection.js +111 -0
- package/dist/client/settings/VoiceTranscriptionSection.js.map +1 -0
- package/dist/client/sharing/ShareButton.d.ts +6 -4
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +299 -34
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/sharing/ShareDialog.d.ts +22 -4
- package/dist/client/sharing/ShareDialog.d.ts.map +1 -1
- package/dist/client/sharing/ShareDialog.js +170 -148
- package/dist/client/sharing/ShareDialog.js.map +1 -1
- package/dist/client/sharing/VisibilityBadge.d.ts.map +1 -1
- package/dist/client/sharing/VisibilityBadge.js +1 -2
- package/dist/client/sharing/VisibilityBadge.js.map +1 -1
- package/dist/client/use-action.d.ts.map +1 -1
- package/dist/client/use-action.js +20 -1
- package/dist/client/use-action.js.map +1 -1
- package/dist/db/migrations.d.ts +18 -3
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +25 -3
- package/dist/db/migrations.js.map +1 -1
- package/dist/deploy/workspace-core.js +2 -2
- package/dist/mcp-client/config.d.ts +20 -1
- package/dist/mcp-client/config.d.ts.map +1 -1
- package/dist/mcp-client/config.js +28 -11
- package/dist/mcp-client/config.js.map +1 -1
- package/dist/mcp-client/hub-client.d.ts +38 -0
- package/dist/mcp-client/hub-client.d.ts.map +1 -0
- package/dist/mcp-client/hub-client.js +147 -0
- package/dist/mcp-client/hub-client.js.map +1 -0
- package/dist/mcp-client/hub-routes.d.ts +42 -0
- package/dist/mcp-client/hub-routes.d.ts.map +1 -0
- package/dist/mcp-client/hub-routes.js +114 -0
- package/dist/mcp-client/hub-routes.js.map +1 -0
- package/dist/mcp-client/index.d.ts +15 -0
- package/dist/mcp-client/index.d.ts.map +1 -1
- package/dist/mcp-client/index.js +35 -0
- package/dist/mcp-client/index.js.map +1 -1
- package/dist/mcp-client/manager.d.ts +54 -8
- package/dist/mcp-client/manager.d.ts.map +1 -1
- package/dist/mcp-client/manager.js +276 -59
- package/dist/mcp-client/manager.js.map +1 -1
- package/dist/mcp-client/remote-store.d.ts +102 -0
- package/dist/mcp-client/remote-store.d.ts.map +1 -0
- package/dist/mcp-client/remote-store.js +200 -0
- package/dist/mcp-client/remote-store.js.map +1 -0
- package/dist/mcp-client/routes.d.ts +55 -0
- package/dist/mcp-client/routes.d.ts.map +1 -0
- package/dist/mcp-client/routes.js +384 -0
- package/dist/mcp-client/routes.js.map +1 -0
- package/dist/mcp-client/visibility.d.ts +16 -0
- package/dist/mcp-client/visibility.d.ts.map +1 -0
- package/dist/mcp-client/visibility.js +45 -0
- package/dist/mcp-client/visibility.js.map +1 -0
- package/dist/org/context.js +2 -2
- package/dist/org/context.js.map +1 -1
- package/dist/org/handlers.js +2 -2
- package/dist/org/handlers.js.map +1 -1
- package/dist/resources/handlers.d.ts.map +1 -1
- package/dist/resources/handlers.js +30 -0
- package/dist/resources/handlers.js.map +1 -1
- package/dist/secrets/register-framework-secrets.d.ts +13 -0
- package/dist/secrets/register-framework-secrets.d.ts.map +1 -0
- package/dist/secrets/register-framework-secrets.js +59 -0
- package/dist/secrets/register-framework-secrets.js.map +1 -0
- package/dist/secrets/register.d.ts.map +1 -1
- package/dist/secrets/register.js +8 -1
- package/dist/secrets/register.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +22 -2
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +16 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +237 -70
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/app-url.d.ts.map +1 -1
- package/dist/server/app-url.js +11 -3
- package/dist/server/app-url.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +50 -0
- package/dist/server/auth.js.map +1 -1
- package/dist/server/better-auth-instance.d.ts.map +1 -1
- package/dist/server/better-auth-instance.js +99 -4
- package/dist/server/better-auth-instance.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +44 -0
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/create-server.d.ts.map +1 -1
- package/dist/server/create-server.js +6 -0
- package/dist/server/create-server.js.map +1 -1
- package/dist/server/date-utils.d.ts +15 -0
- package/dist/server/date-utils.d.ts.map +1 -0
- package/dist/server/date-utils.js +41 -0
- package/dist/server/date-utils.js.map +1 -0
- package/dist/server/index.d.ts +2 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +2 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/onboarding-html.d.ts +3 -0
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +13 -3
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/server/request-context.d.ts +9 -0
- package/dist/server/request-context.d.ts.map +1 -1
- package/dist/server/request-context.js +10 -0
- package/dist/server/request-context.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +26 -0
- package/dist/server/transcribe-voice.d.ts.map +1 -0
- package/dist/server/transcribe-voice.js +143 -0
- package/dist/server/transcribe-voice.js.map +1 -0
- package/dist/styles/agent-native.css +111 -0
- package/dist/tailwind.preset.d.ts +2 -2
- package/dist/tailwind.preset.d.ts.map +1 -1
- package/dist/tailwind.preset.js +27 -7
- package/dist/tailwind.preset.js.map +1 -1
- package/dist/templates/default/app/global.css +65 -68
- package/dist/templates/default/components.json +1 -1
- package/dist/templates/default/package.json +2 -4
- package/dist/templates/default/vite.config.ts +3 -0
- package/dist/templates/workspace-core/package.json +1 -4
- package/dist/templates/workspace-core/src/index.ts +1 -1
- package/dist/templates/workspace-core/styles/tokens.css +22 -0
- package/dist/templates/workspace-core/tsconfig.json +1 -1
- package/dist/vite/client.d.ts +6 -0
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +18 -1
- package/dist/vite/client.js.map +1 -1
- package/docs/content/actions.md +169 -74
- package/docs/content/agent-teams.md +139 -0
- package/docs/content/cloneable-saas.md +98 -0
- package/docs/content/creating-templates.md +9 -11
- package/docs/content/deployment.md +2 -9
- package/docs/content/drop-in-agent.md +200 -0
- package/docs/content/enterprise-workspace.md +22 -10
- package/docs/content/getting-started.md +34 -19
- package/docs/content/integrations.md +3 -3
- package/docs/content/key-concepts.md +50 -23
- package/docs/content/mcp-clients.md +71 -0
- package/docs/content/pure-agent-apps.md +69 -0
- package/docs/content/recurring-jobs.md +123 -0
- package/docs/content/skills-guide.md +8 -0
- package/docs/content/template-analytics.md +190 -0
- package/docs/content/template-calendar.md +151 -0
- package/docs/content/template-clips.md +55 -0
- package/docs/content/template-content.md +141 -0
- package/docs/content/template-dispatch.md +58 -0
- package/docs/content/template-forms.md +51 -0
- package/docs/content/template-mail.md +169 -0
- package/docs/content/template-slides.md +218 -0
- package/docs/content/template-starter.md +68 -0
- package/docs/content/template-video.md +162 -0
- package/docs/content/voice-input.md +59 -0
- package/docs/content/what-is-agent-native.md +142 -45
- package/docs/content/workspace-management.md +1 -0
- package/docs/content/{resources.md → workspace.md} +94 -42
- package/package.json +9 -16
- package/src/templates/default/app/global.css +65 -68
- package/src/templates/default/components.json +1 -1
- package/src/templates/default/package.json +2 -4
- package/src/templates/default/vite.config.ts +3 -0
- package/src/templates/workspace-core/package.json +1 -4
- package/src/templates/workspace-core/src/index.ts +1 -1
- package/src/templates/workspace-core/styles/tokens.css +22 -0
- package/src/templates/workspace-core/tsconfig.json +1 -1
- package/dist/templates/default/postcss.config.js +0 -6
- package/dist/templates/default/tailwind.config.ts +0 -7
- package/dist/templates/workspace-core/tailwind.preset.ts +0 -34
- package/src/templates/default/postcss.config.js +0 -6
- package/src/templates/default/tailwind.config.ts +0 -7
- package/src/templates/workspace-core/tailwind.preset.ts +0 -34
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Content Template"
|
|
3
|
+
description: "A Notion-style document editor with an AI agent that can read, write, organize, and publish your pages."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Content Template
|
|
7
|
+
|
|
8
|
+
A hierarchical document editor in the style of Notion or Google Docs. The AI agent has full parity with the UI — it can create pages, edit selections, reorganize the tree, and sync with Notion, all while seeing exactly what you see.
|
|
9
|
+
|
|
10
|
+
## Overview {#overview}
|
|
11
|
+
|
|
12
|
+
The Content template is a rich-text document workspace with a sidebar tree, a Tiptap-based editor, and an agent panel. Pages live in a nested tree, content is stored as markdown in SQL, and the agent uses the same actions the UI calls for every operation.
|
|
13
|
+
|
|
14
|
+
Everything lives in one database (SQLite, Postgres, Turso — anything Drizzle supports) and the agent sees your current view, so you can say "rewrite this paragraph" or "add a sub-page for Q4 planning" and it knows what you mean without you pasting anything.
|
|
15
|
+
|
|
16
|
+
## Quick start {#quick-start}
|
|
17
|
+
|
|
18
|
+
Scaffold a new workspace with the Content template:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx @agent-native/core create my-workspace --template content
|
|
22
|
+
cd my-workspace
|
|
23
|
+
pnpm install
|
|
24
|
+
pnpm dev
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Open `http://localhost:8080` and create your first page. The agent panel is on the right — try asking it to "create a page called Onboarding and add three sub-pages under it".
|
|
28
|
+
|
|
29
|
+
Live demo: https://content.agent-native.com
|
|
30
|
+
|
|
31
|
+
## Key features {#key-features}
|
|
32
|
+
|
|
33
|
+
### Hierarchical pages
|
|
34
|
+
|
|
35
|
+
Documents nest infinitely via a `parent_id` column. The sidebar renders a draggable tree; children move with their parents and ordering uses an integer `position` field. See `app/components/sidebar/DocumentSidebar.tsx` and `app/components/sidebar/DocumentTreeItem.tsx`.
|
|
36
|
+
|
|
37
|
+
### Rich-text editor
|
|
38
|
+
|
|
39
|
+
The editor is built on Tiptap with a custom extension set. It supports headings, lists, tables, code blocks with syntax highlighting, images, and links. Implementation lives in `app/components/editor/DocumentEditor.tsx` and `app/components/editor/VisualEditor.tsx`, with custom nodes under `app/components/editor/extensions/` (`CodeBlockNode.tsx`, `ImageNode.ts`, `DragHandle.tsx`, `NotionExtensions.tsx`).
|
|
40
|
+
|
|
41
|
+
Interactive surfaces include:
|
|
42
|
+
|
|
43
|
+
- `BubbleToolbar.tsx` — formatting toolbar that appears over a selection
|
|
44
|
+
- `SlashCommandMenu.tsx` — slash-command inserter for blocks
|
|
45
|
+
- `LinkHoverPreview.tsx` — hover previews for inline links
|
|
46
|
+
- `TableHoverControls.tsx` — add/remove table rows and columns
|
|
47
|
+
- `EmojiPicker.tsx` — emoji picker for page icons
|
|
48
|
+
|
|
49
|
+
### Collaborative editing
|
|
50
|
+
|
|
51
|
+
Content is edited through Yjs CRDT so multiple users and the agent can type into the same document at once without clobbering each other. The agent's `edit-document` action writes through the same pipeline as a human keystroke, so changes appear live in every open editor. See the `real-time-collab` skill for the sync model.
|
|
52
|
+
|
|
53
|
+
### Search
|
|
54
|
+
|
|
55
|
+
Full-text search across titles and markdown content, powered by `actions/search-documents.ts`. The sidebar exposes a search box; the agent uses the same action via `pnpm action search-documents --query "..."`.
|
|
56
|
+
|
|
57
|
+
### Favorites and icons
|
|
58
|
+
|
|
59
|
+
Each document can be favorited (`is_favorite`) and given an emoji `icon`. The index route auto-opens your first favorite on load — see `app/routes/_app._index.tsx`.
|
|
60
|
+
|
|
61
|
+
### Notion sync
|
|
62
|
+
|
|
63
|
+
Documents can be linked to a Notion page and synced in either direction:
|
|
64
|
+
|
|
65
|
+
- `connect-notion-status` — check whether a Notion integration is connected
|
|
66
|
+
- `link-notion-page` — link a local doc to a Notion page
|
|
67
|
+
- `pull-notion-page` — overwrite local content from Notion
|
|
68
|
+
- `push-notion-page` — overwrite Notion content from local
|
|
69
|
+
- `list-notion-links` — list all linked documents
|
|
70
|
+
- `sync-notion-comments` — bidirectionally sync comment threads
|
|
71
|
+
|
|
72
|
+
Sync state is tracked in the `document_sync_links` table (last synced time, conflict flag, last error). Markdown-to-Notion block conversion lives in `shared/notion-markdown.ts`. Conflict and status UI is in `app/components/editor/NotionConflictBanner.tsx` and `NotionSyncBar.tsx`. See the `notion-integration` skill for the full flow.
|
|
73
|
+
|
|
74
|
+
### Comments
|
|
75
|
+
|
|
76
|
+
Threaded comments on documents with quoted-text anchors, replies, and resolve state. Backed by the `document_comments` table and `app/components/editor/CommentsSidebar.tsx`. Actions: `list-comments`, `add-comment`. Notion comments can sync both ways via `sync-notion-comments`.
|
|
77
|
+
|
|
78
|
+
### Version history
|
|
79
|
+
|
|
80
|
+
Every significant update snapshots a row in the `document_versions` table. The UI surfaces these in `app/components/editor/VersionHistoryPanel.tsx`.
|
|
81
|
+
|
|
82
|
+
### Sharing and visibility
|
|
83
|
+
|
|
84
|
+
Documents are private by default. You can change visibility to `org` or `public`, or grant per-user and per-org roles (`viewer`, `editor`, `admin`). The framework's auto-mounted sharing actions work out of the box:
|
|
85
|
+
|
|
86
|
+
- `share-resource --resourceType document --resourceId <id> --principalType user --principalId <email> --role editor`
|
|
87
|
+
- `unshare-resource` / `list-resource-shares` / `set-resource-visibility`
|
|
88
|
+
|
|
89
|
+
See the `sharing` skill.
|
|
90
|
+
|
|
91
|
+
### Teams
|
|
92
|
+
|
|
93
|
+
A dedicated team page at `/team` (see `app/routes/_app.team.tsx`) uses the framework's `TeamPage` component for creating orgs and managing members.
|
|
94
|
+
|
|
95
|
+
## Working with the agent {#working-with-the-agent}
|
|
96
|
+
|
|
97
|
+
Because the agent sees your current screen, most prompts don't need you to reference a document explicitly. When you have a page open, "this" means that page.
|
|
98
|
+
|
|
99
|
+
Example prompts:
|
|
100
|
+
|
|
101
|
+
- "Rewrite this paragraph to be more concise."
|
|
102
|
+
- "Add a section about pricing with three bullet points."
|
|
103
|
+
- "Create a page called Q4 Planning with sub-pages for Goals, Metrics, and Risks."
|
|
104
|
+
- "Summarize this doc into a TL;DR at the top."
|
|
105
|
+
- "Find all my meeting notes from last week."
|
|
106
|
+
- "Change the tone of this page to be more formal."
|
|
107
|
+
- "Pull the latest from Notion."
|
|
108
|
+
- "Share this doc with hbikna@gmail.com as an editor."
|
|
109
|
+
- "Move this page under Onboarding."
|
|
110
|
+
|
|
111
|
+
For small edits, the agent uses `edit-document --find ... --replace ...` so only the changed text flows through Yjs — you'll see the diff applied in place rather than the whole page re-render. For bigger rewrites it uses `update-document --content ...`.
|
|
112
|
+
|
|
113
|
+
If you select text and press Cmd+I (or focus the agent panel), the selection travels with your next message as context, so "make this punchier" operates on exactly what you highlighted.
|
|
114
|
+
|
|
115
|
+
## Data model {#data-model}
|
|
116
|
+
|
|
117
|
+
Four core tables, all defined in `server/db/schema.ts`:
|
|
118
|
+
|
|
119
|
+
- **`documents`** — the page tree. Columns: `id`, `parent_id`, `title`, `content` (markdown), `icon`, `position`, `is_favorite`, `visibility`, `owner_email`, `org_id`, `created_at`, `updated_at`.
|
|
120
|
+
- **`document_versions`** — full snapshots of title and content for version history.
|
|
121
|
+
- **`document_comments`** — threaded comments with `thread_id`, `parent_id`, `quoted_text`, `resolved`, and an optional `notion_comment_id` for bidirectional Notion sync.
|
|
122
|
+
- **`document_sync_links`** — one row per Notion-linked document tracking remote page ID, last sync times, conflict state, and errors.
|
|
123
|
+
- **`document_shares`** — per-user and per-org grants created via `createSharesTable`.
|
|
124
|
+
|
|
125
|
+
Content is stored as markdown. The editor converts to and from the Tiptap JSON model in memory; the SQL row is always markdown so actions, search, and Notion sync can operate on a single canonical format.
|
|
126
|
+
|
|
127
|
+
All ownable tables include `owner_email` and `org_id` via `ownableColumns()`, so a local-mode workspace (`local@localhost`) can be upgraded to a real account without losing history.
|
|
128
|
+
|
|
129
|
+
## Customizing it {#customizing-it}
|
|
130
|
+
|
|
131
|
+
The four places to look when changing behavior:
|
|
132
|
+
|
|
133
|
+
- **`actions/`** — every operation the agent or UI can perform. Add a new file like `actions/publish-to-wordpress.ts` using `defineAction` and both sides get it for free. Key existing actions: `create-document.ts`, `edit-document.ts`, `update-document.ts`, `delete-document.ts`, `list-documents.ts`, `search-documents.ts`, `get-document.ts`, `pull-notion-page.ts`, `push-notion-page.ts`, `add-comment.ts`, `view-screen.ts`, `navigate.ts`.
|
|
134
|
+
- **`app/routes/`** — the page surface. `_app.tsx` is the pathless layout that keeps the sidebar and agent panel mounted; `_app._index.tsx` is the landing view; `_app.page.$id.tsx` is the editor route; `_app.team.tsx` is the team settings page.
|
|
135
|
+
- **`app/components/editor/`** — the Tiptap editor. Add a new node type under `extensions/` and register it in `DocumentEditor.tsx`. The bubble toolbar, slash menu, and hover previews are all component files you can edit.
|
|
136
|
+
- **`.agents/skills/`** — guidance the agent reads before acting. If you add a new capability (say, a CMS publishing pipeline), drop a `SKILL.md` in a new skill folder so the agent uses it correctly. Existing skills: `document-editing`, `notion-integration`, `real-time-sync`, `delegate-to-agent`, `storing-data`, `self-modifying-code`, `security`, `frontend-design`, `create-skill`, `capture-learnings`.
|
|
137
|
+
- **`AGENTS.md`** — the top-level agent guide with the action cheatsheet and common-tasks table. Update it whenever you add a major feature so the agent discovers it without exploring.
|
|
138
|
+
- **`server/db/schema.ts`** — data model. Add a column or table here, run `pnpm db:push`, and it's available to every action.
|
|
139
|
+
- **`shared/notion-markdown.ts`** — markdown-to-Notion-blocks conversion. Extend this if you add new block types that need to round-trip through Notion.
|
|
140
|
+
|
|
141
|
+
The agent can make all of these changes itself — ask it to "add a tags column to documents and expose it in the sidebar" and it will update the schema, migrate, wire the UI, and write the action.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Dispatch Template"
|
|
3
|
+
description: "Dispatch is the workspace control plane — central inbox, cross-app orchestration, secrets vault, Slack/Telegram integration, and scheduled jobs."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Dispatch
|
|
7
|
+
|
|
8
|
+
Dispatch is the **workspace control plane**. Where other templates are domain apps (Mail, Calendar, Analytics), Dispatch is the app you run _alongside_ them to coordinate everything: a central inbox, a secrets vault, scheduled jobs, Slack/Telegram integration, and an orchestrator agent that delegates domain work to the right specialist app over [A2A](/docs/a2a-protocol).
|
|
9
|
+
|
|
10
|
+
If you're running an [enterprise workspace](/docs/enterprise-workspace) with many apps, Dispatch is the glue.
|
|
11
|
+
|
|
12
|
+
## What it does {#what-it-does}
|
|
13
|
+
|
|
14
|
+
- **Central inbox.** Slack DMs, Telegram messages, email notifications, A2A requests from other agents — all land in one place. The Dispatch agent triages and either handles them itself or delegates.
|
|
15
|
+
- **Orchestrator, not specialist.** Dispatch does _not_ try to be the email app or the analytics app. When someone asks "summarize last week's signups," Dispatch calls the analytics agent over A2A and returns the answer. When someone asks "draft a reply to Alice," Dispatch calls the mail agent.
|
|
16
|
+
- **Secrets vault.** A central store for API keys, OAuth tokens, and shared credentials. Apps in the workspace resolve secrets from Dispatch instead of duplicating them in every `.env`. Requests + approvals for sensitive access.
|
|
17
|
+
- **Integrations catalog.** One page showing every third-party integration — Slack, Telegram, SendGrid, Apollo, etc. — with a "configured / not configured / pending approval" status per app.
|
|
18
|
+
- **Scheduled jobs hub.** Cross-app [recurring jobs](/docs/recurring-jobs) live here: "every weekday at 7, pull yesterday's key metrics from analytics and draft a morning summary email."
|
|
19
|
+
- **Approval flow.** Destructive or external actions (sending money, shipping an outbound email, posting to Slack at scale) can require an admin OK before they fire. Dispatch owns the queue.
|
|
20
|
+
|
|
21
|
+
## When to use it {#when-to-use}
|
|
22
|
+
|
|
23
|
+
Use Dispatch when:
|
|
24
|
+
|
|
25
|
+
- You have **two or more** agent-native apps in a workspace and want one place to coordinate between them.
|
|
26
|
+
- You need **centralized secrets** with per-app grants and an audit trail.
|
|
27
|
+
- You want a **messaging hub** that routes Slack or Telegram into the right domain agent.
|
|
28
|
+
- You want **scheduled jobs** that pull data from several apps.
|
|
29
|
+
|
|
30
|
+
Skip it for a single-app scaffold — use the [Starter template](/docs/template-starter) or any of the domain templates directly.
|
|
31
|
+
|
|
32
|
+
## Architecture at a glance {#architecture}
|
|
33
|
+
|
|
34
|
+
- **Orchestrator agent.** The chat is set up as a router: it reads `AGENTS.md`, `LEARNINGS.md`, and routes to specialist sub-agents or remote A2A agents.
|
|
35
|
+
- **Remote agent registry.** A2A manifests live in `remote-agents/*.json` — one per app. Dispatch calls them using the `call-agent` action.
|
|
36
|
+
- **Vault schema.** Drizzle tables for secrets, grants, requests, approvals, and audit logs. See `server/db/schema.ts` in the template.
|
|
37
|
+
- **Slack / Telegram plugins.** Server plugins that register webhooks and forward incoming messages to the orchestrator agent.
|
|
38
|
+
- **MCP hub mode.** Dispatch can act as the workspace's [MCP hub](/docs/mcp-clients#hub) so every other app in the workspace pulls the same org-scope MCP server list.
|
|
39
|
+
|
|
40
|
+
## Scaffolding {#scaffolding}
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pnpm dlx @agent-native/core create my-platform
|
|
44
|
+
# pick "Dispatch" in the multi-select picker, plus whichever domain apps you want
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Dispatch is usually scaffolded into a workspace alongside the apps it coordinates. For a workspace, Dispatch's shared auth, database, and brand are inherited from the workspace core — see [Enterprise Workspace](/docs/enterprise-workspace).
|
|
48
|
+
|
|
49
|
+
## Customize it {#customize}
|
|
50
|
+
|
|
51
|
+
Dispatch is a full cloneable SaaS like any other template — see [Cloneable SaaS](/docs/cloneable-saas). Ask the agent to "add a new integration for Datadog" or "route Slack DMs from channel X to the issues agent" and it'll edit the routing config, add the webhook handler, and wire it up.
|
|
52
|
+
|
|
53
|
+
## What's next
|
|
54
|
+
|
|
55
|
+
- [**Enterprise Workspace**](/docs/enterprise-workspace) — running Dispatch alongside multiple apps
|
|
56
|
+
- [**A2A Protocol**](/docs/a2a-protocol) — how Dispatch delegates to specialist agents
|
|
57
|
+
- [**MCP Clients — Hub Mode**](/docs/mcp-clients#hub) — sharing MCP servers across the workspace
|
|
58
|
+
- [**Recurring Jobs**](/docs/recurring-jobs) — scheduled tasks Dispatch runs
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Forms Template"
|
|
3
|
+
description: "Agent-native form builder — create, edit, and analyze forms through natural language, with a live preview and click-to-edit GUI."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Forms
|
|
7
|
+
|
|
8
|
+
Forms is an agent-native form builder with a simple premise: everything the GUI can do, the agent can do, and vice versa. You can drag fields around in the editor, or you can type "add a 'how did you hear about us' dropdown with five options and make it required" — same result, same underlying data.
|
|
9
|
+
|
|
10
|
+
Think Typeform, but the form builder _is_ the agent.
|
|
11
|
+
|
|
12
|
+
## What it does {#what-it-does}
|
|
13
|
+
|
|
14
|
+
- **Build forms conversationally.** "Create a contact form," "add a NPS score question," "make the email field required." The agent updates the schema; the preview updates live.
|
|
15
|
+
- **Click-to-edit fine-tuning.** Every field in the preview is editable in place — label, placeholder, validation, conditional logic — with the usual GUI controls.
|
|
16
|
+
- **Field types** out of the box: short text, long text, email, phone, URL, number, date, single-select, multi-select, rating, file upload, section header, conditional branch.
|
|
17
|
+
- **Responses dashboard.** Per-response view + an aggregate dashboard the agent can pivot on request: "show me signups from the last 30 days grouped by source."
|
|
18
|
+
- **Agent-driven analysis.** Ask the agent to cluster free-text responses, extract sentiments, or draft a reply to everyone who scored the NPS below 7.
|
|
19
|
+
- **Publishing.** Public share link with embed snippet, branded thank-you page, webhook on submit.
|
|
20
|
+
|
|
21
|
+
## Why it's interesting {#why}
|
|
22
|
+
|
|
23
|
+
Forms is a clear example of the [ladder](/docs/what-is-agent-native#the-ladder) rung 3 payoff. The hard part of a form builder isn't the editor UI — it's everything around it: schema evolution, response analytics, conditional logic, publishing, notifications, integrations. Most of that is just prompting the agent, because every capability is an action the agent can call.
|
|
24
|
+
|
|
25
|
+
## Scaffolding {#scaffolding}
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm dlx @agent-native/core create my-forms --template forms --standalone
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For a workspace with forms alongside other apps:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm dlx @agent-native/core create my-platform # pick Forms + other templates
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Customize it {#customize}
|
|
38
|
+
|
|
39
|
+
Ask the agent:
|
|
40
|
+
|
|
41
|
+
- "Add a new 'signature' field type that captures a drawn signature." It adds the schema entry, renders the component, handles storage.
|
|
42
|
+
- "When someone submits a form, post the response to our #signups Slack channel." It wires the webhook.
|
|
43
|
+
- "Add per-form access control — some are public, some require a login." It updates the publishing flow.
|
|
44
|
+
|
|
45
|
+
See [Cloneable SaaS](/docs/cloneable-saas) for the full clone → customize → deploy flow.
|
|
46
|
+
|
|
47
|
+
## What's next
|
|
48
|
+
|
|
49
|
+
- [**Cloneable SaaS**](/docs/cloneable-saas) — the clone-and-own model
|
|
50
|
+
- [**Actions**](/docs/actions) — the action system powering the builder
|
|
51
|
+
- [**Real-Time Sync**](/docs/real-time-collaboration) — how the preview stays in sync with agent edits
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Mail Template"
|
|
3
|
+
description: "An agent-native email client. A Gmail and Superhuman alternative you own."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mail Template
|
|
7
|
+
|
|
8
|
+
Mail is an agent-native email client built on `@agent-native/core`. It reads from your real Gmail when you connect a Google account, and works as a local mailbox when you don't — with an AI agent that can triage, search, draft, and send on your behalf.
|
|
9
|
+
|
|
10
|
+
## Overview {#overview}
|
|
11
|
+
|
|
12
|
+
Mail is a drop-in replacement for Gmail and Superhuman. The UI is keyboard-first: a thread list on the left, the open thread in the middle, and a compose panel that opens as tabs on the right. The agent sits alongside in the sidebar and has the same powers the UI has — read, search, archive, label, star, draft, and send — via actions in `templates/mail/actions/`.
|
|
13
|
+
|
|
14
|
+
Use it if you want:
|
|
15
|
+
|
|
16
|
+
- An email client where an AI agent can actually work on your mail, not just suggest.
|
|
17
|
+
- Superhuman-style keyboard shortcuts without the subscription.
|
|
18
|
+
- Multi-account Gmail support (personal + work in one inbox).
|
|
19
|
+
- Your own codebase. Fork it, change anything, own the data.
|
|
20
|
+
|
|
21
|
+
The agent always knows which view, thread, and message you're looking at because the UI writes that state into SQL (`application_state`) where the agent can read it.
|
|
22
|
+
|
|
23
|
+
## Quick start {#quick-start}
|
|
24
|
+
|
|
25
|
+
Create a new workspace with the Mail template:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx @agent-native/core create my-mail --standalone --template mail
|
|
29
|
+
cd my-mail
|
|
30
|
+
pnpm install
|
|
31
|
+
pnpm dev
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Or add Mail to an existing agent-native workspace:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
agent-native add-app
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Live demo: [mail.agent-native.com](https://mail.agent-native.com)
|
|
41
|
+
|
|
42
|
+
On first run, connect a Google account from Settings to sync real Gmail. Without a Google account, the app runs against an empty local email store (useful for screenshots or demos).
|
|
43
|
+
|
|
44
|
+
## Key features {#key-features}
|
|
45
|
+
|
|
46
|
+
### Gmail sync (multi-account)
|
|
47
|
+
|
|
48
|
+
Connect one or many Google accounts via OAuth. List and search actions query all connected inboxes by default; results carry an `accountEmail` field so you can tell which inbox each thread came from. Scope to a single account with `--account=user@example.com`. OAuth tokens are stored via `@agent-native/core/oauth-tokens` under the `"google"` provider.
|
|
49
|
+
|
|
50
|
+
### Keyboard-first navigation
|
|
51
|
+
|
|
52
|
+
The app is designed to run without a mouse. `J`/`K` move between threads, `E` archives, `R` replies, `C` composes, `/` focuses search, and `G` begins a "go to" chord (`G I` for Inbox, `G S` for Starred, etc.). See the [full list below](#keyboard-shortcuts).
|
|
53
|
+
|
|
54
|
+
### Multiple compose drafts
|
|
55
|
+
|
|
56
|
+
The compose panel supports multiple draft tabs at once. Each draft is stored as an `application_state` entry at `compose-{id}` and syncs live between the agent and the UI. The agent can create a new draft with `manage-draft --action=create`, edit your in-progress draft with `--action=update`, or close tabs with `--action=delete`. Drafts use markdown in the body field; the TipTap editor renders it as rich text and converts to HTML on send.
|
|
57
|
+
|
|
58
|
+
### AI triage via automations
|
|
59
|
+
|
|
60
|
+
Mail supports automation rules that run against new inbox email using AI. A rule has a natural-language condition (for example, `"from a newsletter"` or `"subject contains invoice"`) and a list of actions (`label`, `archive`, `mark_read`, `star`, `trash`). Manage them via `pnpm action manage-automations --action=create|list|update|delete|enable|disable`, or through the Settings page. Rules fire automatically and can be triggered manually with `pnpm action trigger-automations`.
|
|
61
|
+
|
|
62
|
+
### Send tracking
|
|
63
|
+
|
|
64
|
+
Sent messages get open-pixel and link-click tracking injected automatically. Settings live under `mail-settings.tracking` with `tracking.opens` and `tracking.clicks` (both default `true`). Only links in the new portion of a reply or forward are rewritten — quoted content is left alone. Pull stats for any sent message with `pnpm action get-tracking --id=<message-id>`, or from `GET /api/emails/:id/tracking`. Open and click events are stored in the `email_tracking` and `email_link_tracking` tables.
|
|
65
|
+
|
|
66
|
+
### Search
|
|
67
|
+
|
|
68
|
+
`pnpm action search-emails --q=<term>` searches across all views and all connected accounts. The UI search bar maps to the same action. Both `search-emails` and `list-emails` take `--compact` for shorter output and `--fields=from,subject,date` to limit returned fields.
|
|
69
|
+
|
|
70
|
+
### Bulk operations and export
|
|
71
|
+
|
|
72
|
+
- `pnpm action bulk-archive --older-than=30` archives everything older than N days.
|
|
73
|
+
- `pnpm action export-emails --view=inbox --output=file.json` dumps a view to JSON.
|
|
74
|
+
- Archive, trash, mark-read, and star all accept comma-separated IDs (`--id=id1,id2,id3`) for bulk changes.
|
|
75
|
+
|
|
76
|
+
### Inline thread previews in agent chat
|
|
77
|
+
|
|
78
|
+
When the agent answers a question about a specific thread, it can embed a live preview of the thread directly in the chat message via an `embed` code fence. The preview is a sandboxed iframe that shows the full conversation without leaving the chat, with an "Open in app" button that navigates the main window to that thread.
|
|
79
|
+
|
|
80
|
+
## Working with the agent {#working-with-the-agent}
|
|
81
|
+
|
|
82
|
+
The agent reads `application_state.navigation` on every turn, so it already knows which view you're in, which thread is open, and which message is focused — you don't have to tell it. You can just say things like:
|
|
83
|
+
|
|
84
|
+
- "Summarize my unread emails."
|
|
85
|
+
- "Find the latest thread from Alice about the budget."
|
|
86
|
+
- "Draft a reply that politely declines."
|
|
87
|
+
- "Archive all Netlify bot emails older than a week."
|
|
88
|
+
- "Open my starred emails."
|
|
89
|
+
- "Make this draft more formal."
|
|
90
|
+
- "Did they open my email?"
|
|
91
|
+
|
|
92
|
+
How the agent sees your context:
|
|
93
|
+
|
|
94
|
+
- **Current view and thread** — the UI writes `navigation` (view, threadId, focusedEmailId, search, label) whenever you navigate. The agent reads it via `readAppState("navigation")` or `pnpm action view-screen`.
|
|
95
|
+
- **Open draft** — if you're composing a reply and ask "help me word this", the agent reads the matching `compose-{id}` entry to see your current subject and body, then writes an updated draft back. The UI picks up the edit live.
|
|
96
|
+
- **Thread history** — for context mid-reply, the agent fetches the full thread with `pnpm action get-thread --id=<threadId>`.
|
|
97
|
+
|
|
98
|
+
How the agent takes action:
|
|
99
|
+
|
|
100
|
+
- **Mail operations** — archive, trash, star, mark read, send, draft — all run as `pnpm action <name>` scripts under `templates/mail/actions/`.
|
|
101
|
+
- **Navigation** — to open a thread or switch views for you, the agent writes `application_state.navigate`, which the UI consumes and deletes. The `pnpm action navigate` script wraps this.
|
|
102
|
+
- **Refresh** — after any change, the agent runs `pnpm action refresh-list` so the UI refetches.
|
|
103
|
+
|
|
104
|
+
## Keyboard shortcuts {#keyboard-shortcuts}
|
|
105
|
+
|
|
106
|
+
| Key | Action |
|
|
107
|
+
| --------- | --------------------------- |
|
|
108
|
+
| `J` | Next email |
|
|
109
|
+
| `K` | Previous email |
|
|
110
|
+
| `Up/Down` | Same as J/K |
|
|
111
|
+
| `Enter` | Open focused email |
|
|
112
|
+
| `E` | Archive email or thread |
|
|
113
|
+
| `D` | Trash email or thread |
|
|
114
|
+
| `S` | Star or unstar |
|
|
115
|
+
| `R` | Reply |
|
|
116
|
+
| `U` | Toggle read/unread |
|
|
117
|
+
| `C` | Compose new email |
|
|
118
|
+
| `/` | Focus search bar |
|
|
119
|
+
| `Cmd+K` | Open command palette |
|
|
120
|
+
| `G I` | Go to Inbox |
|
|
121
|
+
| `G S` | Go to Starred |
|
|
122
|
+
| `G T` | Go to Sent |
|
|
123
|
+
| `G D` | Go to Drafts |
|
|
124
|
+
| `G A` | Go to Archive |
|
|
125
|
+
| `Esc` | Close thread / clear search |
|
|
126
|
+
|
|
127
|
+
## Data model {#data-model}
|
|
128
|
+
|
|
129
|
+
When a Google account is connected, email lives in Gmail — the app is a view on top. When no account is connected, emails live in the SQL settings store under `getSetting("local-emails")` (empty by default).
|
|
130
|
+
|
|
131
|
+
| Store / Table | What it holds |
|
|
132
|
+
| ----------------------------- | -------------------------------------------------------------- |
|
|
133
|
+
| `getSetting("local-emails")` | Local email fallback when no Google account is connected |
|
|
134
|
+
| `getSetting("labels")` | System and user labels, with unread counts |
|
|
135
|
+
| `getSetting("mail-settings")` | User profile, tracking preferences, signature, aliases |
|
|
136
|
+
| `getSetting("aliases")` | Email aliases |
|
|
137
|
+
| `email_tracking` table | Open-pixel events for sent messages |
|
|
138
|
+
| `email_link_tracking` table | Link-click events for sent messages |
|
|
139
|
+
| `application_state` table | `navigation`, `navigate`, `compose-{id}` entries (ephemeral) |
|
|
140
|
+
| `oauth_tokens` table | Google OAuth tokens (provider `"google"`, one row per account) |
|
|
141
|
+
|
|
142
|
+
Emails flowing through the API have the shape `{ id, threadId, from, to, cc, subject, snippet, body, date, isRead, isStarred, isArchived, isTrashed, labelIds, accountEmail, attachments }`.
|
|
143
|
+
|
|
144
|
+
Routes in the UI:
|
|
145
|
+
|
|
146
|
+
- `/_index.tsx` — redirects to the default inbox view.
|
|
147
|
+
- `/$view.tsx` — a list view (`inbox`, `starred`, `sent`, `drafts`, `archive`, `trash`, etc.).
|
|
148
|
+
- `/$view.$threadId.tsx` — a list view with a specific thread open.
|
|
149
|
+
- `/email` — the embedded thread preview used in agent chat.
|
|
150
|
+
- `/settings` — account connections, tracking, automations.
|
|
151
|
+
- `/team` — team members and shared resources.
|
|
152
|
+
|
|
153
|
+
## Customizing it {#customizing-it}
|
|
154
|
+
|
|
155
|
+
Mail is yours to change. Everything important lives in a handful of places — start there.
|
|
156
|
+
|
|
157
|
+
**Adding an agent capability.** Add a new file under `templates/mail/actions/` using `defineAction`. Your action becomes both a CLI command (`pnpm action <name>`) and an HTTP endpoint (`/_agent-native/actions/<name>`). Look at `templates/mail/actions/star-email.ts` for a short example or `templates/mail/actions/manage-automations.ts` for one with multiple sub-actions. See the [actions](/docs/actions) docs for the full pattern.
|
|
158
|
+
|
|
159
|
+
**Changing the UI.** Routes are in `templates/mail/app/routes/` and components in `templates/mail/app/components/email/` and `templates/mail/app/components/layout/`. The app uses shadcn/ui primitives from `app/components/ui/` and Tabler Icons — stick to those.
|
|
160
|
+
|
|
161
|
+
**Changing how the agent behaves.** Agent guidance lives in `templates/mail/AGENTS.md` and the skills in `templates/mail/.agents/skills/` (`email-drafts`, `real-time-sync`, `security`, `self-modifying-code`, and others). Agent behavior is changed by editing markdown — not code.
|
|
162
|
+
|
|
163
|
+
**Changing data or settings.** Schemas for the tracking tables and related structures are in `templates/mail/server/db/`. Settings reads and writes go through `readSetting` / `writeSetting` from `@agent-native/core/settings`. Application state (navigation, drafts, one-shot commands) uses `readAppState` / `writeAppState` from `@agent-native/core/application-state`.
|
|
164
|
+
|
|
165
|
+
**Adding a new automation action type.** Extend the action schema in `templates/mail/actions/manage-automations.ts` and the executor in `templates/mail/actions/trigger-automations.ts`.
|
|
166
|
+
|
|
167
|
+
**Changing keyboard shortcuts.** Keybind handlers live in `templates/mail/app/components/email/` — search for `useHotkeys` or `addEventListener("keydown"` to find where each key is wired.
|
|
168
|
+
|
|
169
|
+
Ask the agent to make any of these changes for you. The agent can edit its own source — see [Self-Modifying Code](/docs/key-concepts#agent-modifies-code).
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Slides Template"
|
|
3
|
+
description: "Agent-native presentation editor — generate decks from a prompt, edit visually, and present in full-screen."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Slides Template
|
|
7
|
+
|
|
8
|
+
An open-source, agent-native presentation editor built on `@agent-native/core`. It replaces Google Slides, Pitch, and PowerPoint with a deck you can author in three ways at once — by talking to the agent, by clicking the canvas, or by editing HTML.
|
|
9
|
+
|
|
10
|
+
## Overview {#overview}
|
|
11
|
+
|
|
12
|
+
The Slides template is a full presentation studio:
|
|
13
|
+
|
|
14
|
+
- Generate complete decks from a prompt, one slide at a time.
|
|
15
|
+
- Edit slides visually or drop into raw HTML for full control.
|
|
16
|
+
- Generate images with Gemini, search stock photos, and look up company logos.
|
|
17
|
+
- Present full-screen with keyboard navigation and speaker notes.
|
|
18
|
+
- Comment, share, and collaborate in real time over Yjs.
|
|
19
|
+
|
|
20
|
+
Every operation the UI does — creating a deck, adding a slide, swapping an image — is exposed as an action the agent can call too. The agent and UI always stay in sync because they read and write the same SQL database.
|
|
21
|
+
|
|
22
|
+
## Quick start {#quick-start}
|
|
23
|
+
|
|
24
|
+
Create a new Slides app from the CLI:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx @agent-native/core create my-slides --template slides
|
|
28
|
+
cd my-slides
|
|
29
|
+
pnpm dev
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or try the hosted demo at [slides.agent-native.com](https://slides.agent-native.com).
|
|
33
|
+
|
|
34
|
+
Once running, open the app, click "New deck", and ask the agent in the sidebar: "Generate a 10-slide pitch deck for a coffee subscription service."
|
|
35
|
+
|
|
36
|
+
## Key features {#key-features}
|
|
37
|
+
|
|
38
|
+
### Prompt-to-deck generation
|
|
39
|
+
|
|
40
|
+
Ask the agent for a deck and it builds one slide at a time. Slides stream into the editor live as each one is generated — the agent fires parallel `add-slide` calls so you see the deck assemble in seconds.
|
|
41
|
+
|
|
42
|
+
Under the hood, this is powered by the `add-slide` and `create-deck` actions in `templates/slides/actions/`.
|
|
43
|
+
|
|
44
|
+
### Eight slide layouts
|
|
45
|
+
|
|
46
|
+
Built-in layouts: title, section divider, content with bullets, two-column, image, statement or quote, full-bleed, and blank. Each layout is a pure HTML template with inline styles — the agent picks the right one based on slide purpose. Templates live inside `templates/slides/AGENTS.md` so the agent can reference them without exploring the codebase.
|
|
47
|
+
|
|
48
|
+
### Visual and code editing
|
|
49
|
+
|
|
50
|
+
- Double-click any text to edit inline.
|
|
51
|
+
- Click a block to open the bubble menu for styles, alignment, and layout.
|
|
52
|
+
- Switch to the code editor (`app/components/editor/CodeEditor.tsx`) to edit raw slide HTML.
|
|
53
|
+
- Use the slash menu (`SlideSlashMenu.tsx`) to insert blocks by typing `/`.
|
|
54
|
+
|
|
55
|
+
### AI image generation
|
|
56
|
+
|
|
57
|
+
Generate images with Gemini directly from the editor or via the agent. Each request returns multiple variations so you can pick the one that fits. Style reference images keep results visually consistent.
|
|
58
|
+
|
|
59
|
+
Actions: `generate-image`, `edit-image`, `image-search`, `logo-lookup`. UI panels: `ImageGenPanel.tsx`, `ImageSearchPanel.tsx`, `LogoSearchPanel.tsx`.
|
|
60
|
+
|
|
61
|
+
### Logo and stock image search
|
|
62
|
+
|
|
63
|
+
- `logo-lookup --domain acme.com` fetches a company logo via Logo.dev or Brandfetch.
|
|
64
|
+
- `image-search --query "mountain landscape"` searches Google Images for stock photos.
|
|
65
|
+
|
|
66
|
+
### Comments and threads
|
|
67
|
+
|
|
68
|
+
Leave comments on specific slides, quote selected text, and reply in threads. Stored in the `slide_comments` table. Actions: `add-slide-comment`, `list-slide-comments`.
|
|
69
|
+
|
|
70
|
+
### Drag and drop reordering
|
|
71
|
+
|
|
72
|
+
Reorder slides in the sidebar, duplicate, or delete with hover controls. The sidebar lives in `app/components/editor/EditorSidebar.tsx`.
|
|
73
|
+
|
|
74
|
+
### Presentation mode
|
|
75
|
+
|
|
76
|
+
Full-screen presentation at `/deck/:id/present` with keyboard navigation (arrow keys, space, escape), auto-hiding controls, and speaker notes. See `app/routes/deck.$id_.present.tsx` and `app/components/presentation/PresentationView.tsx`.
|
|
77
|
+
|
|
78
|
+
### Share links
|
|
79
|
+
|
|
80
|
+
Generate a public read-only URL for a deck so reviewers can view without an account. The share page is `app/routes/share.$token.tsx`. Fine-grained sharing (viewer, editor, admin roles, per-user or org-wide) is also available via the framework's `share-resource` action.
|
|
81
|
+
|
|
82
|
+
### Real-time collaboration
|
|
83
|
+
|
|
84
|
+
Multiple people can edit the same deck simultaneously. Text edits sync through Yjs CRDT so there are no conflicts, and the agent sees and edits the same live document via the `update-slide --find/--replace` action.
|
|
85
|
+
|
|
86
|
+
### Undo and redo
|
|
87
|
+
|
|
88
|
+
Cmd+Z and Cmd+Shift+Z work across the whole deck, with a labeled history panel (`HistoryPanel.tsx`) you can scrub through.
|
|
89
|
+
|
|
90
|
+
### Extract from PDF
|
|
91
|
+
|
|
92
|
+
Turn a PDF into a starter deck. The `extract-pdf` action parses the file and hands the content to the agent for layout.
|
|
93
|
+
|
|
94
|
+
## Working with the agent {#working-with-the-agent}
|
|
95
|
+
|
|
96
|
+
The agent chat lives in the sidebar. It can create decks, edit individual slides, generate images, search logos, and navigate the UI — all using the same actions you'd run from the CLI.
|
|
97
|
+
|
|
98
|
+
### Example prompts
|
|
99
|
+
|
|
100
|
+
- "Generate a 10-slide pitch deck for a coffee subscription service, audience is investors."
|
|
101
|
+
- "Add a pricing slide after slide 3."
|
|
102
|
+
- "Make the title on this slide bigger and change the accent color to green."
|
|
103
|
+
- "Generate a hero image for the current slide — dark, minimal, cinematic."
|
|
104
|
+
- "Find the logo for stripe.com and add it to slide 2."
|
|
105
|
+
- "Replace the word 'customers' with 'members' everywhere in this deck."
|
|
106
|
+
- "Summarize this PDF as a 6-slide deck." (attach the PDF)
|
|
107
|
+
|
|
108
|
+
### What the agent sees
|
|
109
|
+
|
|
110
|
+
When a deck is open, the agent automatically sees:
|
|
111
|
+
|
|
112
|
+
- The current `deckId` and `slideIndex`.
|
|
113
|
+
- The full list of slides in the open deck.
|
|
114
|
+
- The HTML content of the currently selected slide.
|
|
115
|
+
|
|
116
|
+
This is injected into every message as a `current-screen` block, so the agent never has to guess what "this slide" means. The data comes from the `navigation` application-state key, which the UI writes on every navigation. See `templates/slides/actions/view-screen.ts`.
|
|
117
|
+
|
|
118
|
+
### Selecting text for focused edits
|
|
119
|
+
|
|
120
|
+
Select text on a slide and hit Cmd+I to focus the agent with that selection pre-loaded. The agent will act only on what you selected.
|
|
121
|
+
|
|
122
|
+
### Inline slide previews in chat
|
|
123
|
+
|
|
124
|
+
The agent can embed a live slide preview directly in a chat reply using the framework's embed fence. It renders a chromeless iframe via `app/routes/slide.tsx` so you can see the result without leaving the conversation.
|
|
125
|
+
|
|
126
|
+
## Data model {#data-model}
|
|
127
|
+
|
|
128
|
+
All deck data lives in SQL via Drizzle ORM. Schema: `templates/slides/server/db/schema.ts`.
|
|
129
|
+
|
|
130
|
+
### decks
|
|
131
|
+
|
|
132
|
+
| Column | Type | Notes |
|
|
133
|
+
| ------------ | ---- | --------------------------------------------------------- |
|
|
134
|
+
| `id` | text | Primary key, e.g. `deck-1712345-abc` |
|
|
135
|
+
| `title` | text | Deck title |
|
|
136
|
+
| `data` | text | JSON blob: `{ title, slides: [{ id, content, layout }] }` |
|
|
137
|
+
| `created_at` | text | Timestamp |
|
|
138
|
+
| `updated_at` | text | Timestamp |
|
|
139
|
+
|
|
140
|
+
Each deck also carries the standard `ownableColumns` (owner, visibility, share token) so it slots into the framework's sharing model.
|
|
141
|
+
|
|
142
|
+
### slide_comments
|
|
143
|
+
|
|
144
|
+
| Column | Notes |
|
|
145
|
+
| ----------------------------- | -------------------------------------- |
|
|
146
|
+
| `id` | Primary key |
|
|
147
|
+
| `deck_id` | Parent deck |
|
|
148
|
+
| `slide_id` | Slide the comment lives on |
|
|
149
|
+
| `thread_id`, `parent_id` | Threading |
|
|
150
|
+
| `content`, `quoted_text` | Comment body and optional text excerpt |
|
|
151
|
+
| `author_email`, `author_name` | Author |
|
|
152
|
+
| `resolved` | Boolean flag |
|
|
153
|
+
|
|
154
|
+
### deck_shares
|
|
155
|
+
|
|
156
|
+
Framework-provided shares table (created via `createSharesTable`) that maps principals (users or orgs) to roles (viewer, editor, admin) per deck.
|
|
157
|
+
|
|
158
|
+
### Slide structure
|
|
159
|
+
|
|
160
|
+
Each slide inside `decks.data` is:
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"id": "slide-1",
|
|
165
|
+
"layout": "title",
|
|
166
|
+
"content": "<div class=\"fmd-slide\" style=\"...\">...</div>"
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
`content` is raw HTML — the renderer (`app/components/deck/SlideRenderer.tsx`) provides the black background and fixed aspect ratio, and the HTML provides everything inside. Rich embedding is supported too: Excalidraw diagrams via `ExcalidrawSlide.tsx` and Mermaid charts via `MermaidRenderer.tsx`.
|
|
171
|
+
|
|
172
|
+
## Customizing it {#customizing-it}
|
|
173
|
+
|
|
174
|
+
The Slides template is fully forkable. Key places to look when extending it:
|
|
175
|
+
|
|
176
|
+
### Actions — `templates/slides/actions/`
|
|
177
|
+
|
|
178
|
+
Every agent-callable operation lives here as a TypeScript file. A few you'll touch often:
|
|
179
|
+
|
|
180
|
+
- `create-deck.ts` — new deck from scratch or bulk replace.
|
|
181
|
+
- `add-slide.ts` — append one slide; prefer this for streaming generation.
|
|
182
|
+
- `update-slide.ts` — surgical find/replace or full content swap.
|
|
183
|
+
- `view-screen.ts` — snapshot of what the user sees.
|
|
184
|
+
- `generate-image.ts`, `edit-image.ts`, `image-search.ts`, `logo-lookup.ts` — image tooling.
|
|
185
|
+
- `extract-pdf.ts` — PDF ingestion.
|
|
186
|
+
|
|
187
|
+
Every action is auto-mounted at `POST /_agent-native/actions/:name` and callable from the CLI as `pnpm action <name>`. Add a new file here to give the agent a new capability.
|
|
188
|
+
|
|
189
|
+
### Routes — `templates/slides/app/routes/`
|
|
190
|
+
|
|
191
|
+
- `_index.tsx` — deck list.
|
|
192
|
+
- `deck.$id.tsx` — the editor.
|
|
193
|
+
- `deck.$id_.present.tsx` — presentation mode.
|
|
194
|
+
- `share.$token.tsx` — public read-only share page.
|
|
195
|
+
- `slide.tsx` — single-slide embed used in chat previews.
|
|
196
|
+
- `settings.tsx` — template settings.
|
|
197
|
+
- `team.tsx` — org and team management.
|
|
198
|
+
|
|
199
|
+
### Editor components — `templates/slides/app/components/editor/`
|
|
200
|
+
|
|
201
|
+
Most UI customization happens here: `SlideEditor.tsx`, `EditorToolbar.tsx`, `EditorSidebar.tsx`, bubble menus, slash menu, and the panels for image generation, search, and history.
|
|
202
|
+
|
|
203
|
+
### Skills — `templates/slides/.agents/skills/`
|
|
204
|
+
|
|
205
|
+
Agent skills that explain patterns when the agent needs to modify code:
|
|
206
|
+
|
|
207
|
+
- `create-deck/` — how to create a new deck with slides.
|
|
208
|
+
- `slide-editing/` — how to edit individual slides.
|
|
209
|
+
- `deck-management/` — how decks are stored and accessed.
|
|
210
|
+
- `slide-images/` — image generation and search workflow.
|
|
211
|
+
|
|
212
|
+
### AGENTS.md
|
|
213
|
+
|
|
214
|
+
`templates/slides/AGENTS.md` is the single source of truth the agent reads on every conversation. It contains the full action list, every slide HTML template, the navigation state contract, and rules for delegating to sub-agents. Update this file whenever you add an action or a new slide layout pattern.
|
|
215
|
+
|
|
216
|
+
### API routes
|
|
217
|
+
|
|
218
|
+
For cases where actions aren't the right fit (file uploads, streaming), the template exposes a small set of REST endpoints: `GET/POST /api/decks`, `GET/PUT/DELETE /api/decks/:id`. See `templates/slides/server/routes/api/`.
|