@agent-native/core 0.84.20 → 0.84.22

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.
Files changed (193) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +16 -0
  3. package/corpus/core/package.json +1 -1
  4. package/corpus/core/src/a2a/caller-auth.ts +37 -8
  5. package/corpus/core/src/a2a/client.ts +178 -67
  6. package/corpus/core/src/agent/production-agent.ts +19 -3
  7. package/corpus/core/src/agent/types.ts +1 -1
  8. package/corpus/core/src/cli/pr-visual-recap-workflow.ts +1 -1
  9. package/corpus/core/src/cli/recap.ts +43 -34
  10. package/corpus/core/src/client/AssistantChat.tsx +27 -4
  11. package/corpus/core/src/client/PoweredByBadge.tsx +70 -17
  12. package/corpus/core/src/client/agent-chat-adapter.ts +5 -1
  13. package/corpus/core/src/client/guided-questions.tsx +11 -6
  14. package/corpus/core/src/client/i18n.tsx +10 -5
  15. package/corpus/core/src/client/sse-event-processor.ts +147 -5
  16. package/corpus/core/src/client/tool-display.ts +8 -0
  17. package/corpus/core/src/file-upload/builder.ts +40 -14
  18. package/corpus/core/src/file-upload/types.ts +3 -0
  19. package/corpus/core/src/integrations/a2a-continuation-processor.ts +49 -24
  20. package/corpus/core/src/mcp/builtin-tools.ts +3 -0
  21. package/corpus/core/src/mcp/org-directory.ts +66 -20
  22. package/corpus/core/src/notifications/channels.ts +235 -38
  23. package/corpus/core/src/scripts/call-agent.ts +7 -2
  24. package/corpus/core/src/server/analytics.ts +32 -6
  25. package/corpus/core/src/server/ssr-handler.ts +31 -12
  26. package/corpus/templates/analytics/AGENTS.md +21 -0
  27. package/corpus/templates/analytics/README.md +35 -0
  28. package/corpus/templates/analytics/actions/delete-analytics-alert-rule.ts +23 -0
  29. package/corpus/templates/analytics/actions/list-analytics-alert-rules.ts +20 -0
  30. package/corpus/templates/analytics/actions/run-analytics-alerts.ts +23 -0
  31. package/corpus/templates/analytics/actions/save-analytics-alert-rule.ts +69 -0
  32. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +161 -12
  33. package/corpus/templates/analytics/changelog/2026-07-01-analytics-can-alert-when-first-party-events-spike.md +6 -0
  34. package/corpus/templates/analytics/changelog/2026-07-01-session-replays-load-large-production-recordings-from-scoped.md +6 -0
  35. package/corpus/templates/analytics/changelog/2026-07-01-session-replays-play-back-in-production-instead-of-showing.md +6 -0
  36. package/corpus/templates/analytics/netlify.toml +3 -0
  37. package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +109 -0
  38. package/corpus/templates/analytics/server/db/schema.ts +55 -0
  39. package/corpus/templates/analytics/server/handlers/session-replay.ts +5 -2
  40. package/corpus/templates/analytics/server/jobs/analytics-alerts.ts +71 -0
  41. package/corpus/templates/analytics/server/lib/analytics-alerts.ts +734 -0
  42. package/corpus/templates/analytics/server/lib/session-replay.ts +10 -3
  43. package/corpus/templates/analytics/server/plugins/analytics-alert-jobs.ts +54 -0
  44. package/corpus/templates/analytics/server/plugins/db.ts +100 -0
  45. package/corpus/templates/analytics/server/routes/api/analytics-alerts/run.post.ts +60 -0
  46. package/corpus/templates/assets/README.md +30 -8
  47. package/corpus/templates/brain/README.md +20 -552
  48. package/corpus/templates/calendar/README.md +22 -28
  49. package/corpus/templates/calendar/app/pages/BookingPage.tsx +14 -8
  50. package/corpus/templates/calendar/changelog/2026-07-01-meeting-invite-pages-have-cleaner-branding-a-black-dark-mo.md +6 -0
  51. package/corpus/templates/chat/README.md +32 -0
  52. package/corpus/templates/clips/README.md +37 -0
  53. package/corpus/templates/clips/actions/create-recording.ts +7 -2
  54. package/corpus/templates/clips/actions/finalize-recording.ts +11 -0
  55. package/corpus/templates/clips/actions/get-recording-player-data.ts +4 -2
  56. package/corpus/templates/clips/actions/import-loom-recording.ts +1 -0
  57. package/corpus/templates/clips/actions/lib/loom-video.ts +16 -0
  58. package/corpus/templates/clips/app/components/library/library-grid.tsx +18 -7
  59. package/corpus/templates/clips/app/components/library/recording-card.tsx +42 -5
  60. package/corpus/templates/clips/app/components/player/scrubber.tsx +2 -2
  61. package/corpus/templates/clips/app/components/recorder/countdown-overlay.tsx +4 -3
  62. package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +39 -12
  63. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +106 -2
  64. package/corpus/templates/clips/app/components/recorder/recording-toolbar.tsx +1 -22
  65. package/corpus/templates/clips/app/routes/record.tsx +48 -8
  66. package/corpus/templates/clips/changelog/2026-07-01-clip-uploads-and-loom-imports-finish-sooner-by-skipping-the-.md +6 -0
  67. package/corpus/templates/clips/changelog/2026-07-01-clip-uploads-and-playback-recover-more-reliably-from-storage.md +6 -0
  68. package/corpus/templates/clips/changelog/2026-07-01-desktop-recording-avoids-unsupported-browser-tab-capture.md +6 -0
  69. package/corpus/templates/clips/changelog/2026-07-01-embedded-player-progress-is-easier-to-see-on-dark-videos.md +6 -0
  70. package/corpus/templates/clips/changelog/2026-07-01-loom-imports-show-clear-guidance-when-loom-does-not-provide-a-downloadable-video.md +6 -0
  71. package/corpus/templates/clips/changelog/2026-07-01-move-to-folder-now-opens-folder-choices-directly-instead-of.md +6 -0
  72. package/corpus/templates/clips/changelog/2026-07-01-preserve-in-flight-streaming-uploads-when-the-streaming-kill.md +6 -0
  73. package/corpus/templates/clips/changelog/2026-07-01-recording-controls-are-cleaner-and-the-countdown-uses-shadow.md +6 -0
  74. package/corpus/templates/clips/changelog/2026-07-01-recordings-now-recover-when-final-upload-status-gets-lost.md +6 -0
  75. package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
  76. package/corpus/templates/clips/chrome-extension/src/finalize-recovery.ts +7 -224
  77. package/corpus/templates/clips/chrome-extension/src/offscreen.ts +64 -6
  78. package/corpus/templates/clips/desktop/src/lib/recorder.ts +87 -5
  79. package/corpus/templates/clips/server/lib/streaming-upload-mode.ts +7 -0
  80. package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +51 -1
  81. package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/status.get.ts +4 -1
  82. package/corpus/templates/clips/server/routes/api/video/[recordingId].get.ts +96 -1
  83. package/corpus/templates/clips/shared/finalize-recovery.ts +242 -0
  84. package/corpus/templates/content/AGENTS.md +7 -3
  85. package/corpus/templates/content/README.md +22 -34
  86. package/corpus/templates/content/actions/list-trashed-content-databases.ts +4 -0
  87. package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +58 -6
  88. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +257 -24
  89. package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +41 -15
  90. package/corpus/templates/content/app/i18n/zh-TW.ts +25 -7
  91. package/corpus/templates/content/app/i18n-data.ts +278 -40
  92. package/corpus/templates/content/changelog/2026-06-30-database-once-again-creates-an-inline-database-in-the-curren.md +6 -0
  93. package/corpus/templates/content/shared/api.ts +1 -0
  94. package/corpus/templates/design/AGENTS.md +7 -6
  95. package/corpus/templates/design/README.md +33 -0
  96. package/corpus/templates/design/actions/delete-file.ts +86 -10
  97. package/corpus/templates/design/actions/get-design-snapshot.ts +13 -0
  98. package/corpus/templates/design/actions/present-design-variants.ts +11 -13
  99. package/corpus/templates/design/app/hooks/use-question-flow.ts +2 -2
  100. package/corpus/templates/design/app/pages/DesignEditor.tsx +2 -2
  101. package/corpus/templates/design/changelog/2026-07-01-design-recovers-sooner-when-an-agent-gets-stuck-preparing-a-.md +6 -0
  102. package/corpus/templates/dispatch/README.md +34 -0
  103. package/corpus/templates/forms/README.md +34 -0
  104. package/corpus/templates/macros/README.md +28 -0
  105. package/corpus/templates/mail/README.md +35 -0
  106. package/corpus/templates/plan/README.md +30 -118
  107. package/corpus/templates/plan/app/global.css +1 -1
  108. package/corpus/templates/slides/README.md +34 -0
  109. package/corpus/templates/videos/README.md +22 -201
  110. package/dist/a2a/caller-auth.d.ts +1 -0
  111. package/dist/a2a/caller-auth.d.ts.map +1 -1
  112. package/dist/a2a/caller-auth.js +34 -8
  113. package/dist/a2a/caller-auth.js.map +1 -1
  114. package/dist/a2a/client.d.ts +4 -0
  115. package/dist/a2a/client.d.ts.map +1 -1
  116. package/dist/a2a/client.js +148 -58
  117. package/dist/a2a/client.js.map +1 -1
  118. package/dist/agent/production-agent.d.ts.map +1 -1
  119. package/dist/agent/production-agent.js +19 -4
  120. package/dist/agent/production-agent.js.map +1 -1
  121. package/dist/agent/types.d.ts +1 -0
  122. package/dist/agent/types.d.ts.map +1 -1
  123. package/dist/agent/types.js.map +1 -1
  124. package/dist/cli/pr-visual-recap-workflow.d.ts +1 -1
  125. package/dist/cli/pr-visual-recap-workflow.d.ts.map +1 -1
  126. package/dist/cli/pr-visual-recap-workflow.js +1 -1
  127. package/dist/cli/pr-visual-recap-workflow.js.map +1 -1
  128. package/dist/cli/recap.d.ts +3 -3
  129. package/dist/cli/recap.d.ts.map +1 -1
  130. package/dist/cli/recap.js +41 -34
  131. package/dist/cli/recap.js.map +1 -1
  132. package/dist/client/AssistantChat.d.ts.map +1 -1
  133. package/dist/client/AssistantChat.js +28 -4
  134. package/dist/client/AssistantChat.js.map +1 -1
  135. package/dist/client/PoweredByBadge.d.ts +9 -3
  136. package/dist/client/PoweredByBadge.d.ts.map +1 -1
  137. package/dist/client/PoweredByBadge.js +47 -15
  138. package/dist/client/PoweredByBadge.js.map +1 -1
  139. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  140. package/dist/client/agent-chat-adapter.js +5 -1
  141. package/dist/client/agent-chat-adapter.js.map +1 -1
  142. package/dist/client/guided-questions.d.ts.map +1 -1
  143. package/dist/client/guided-questions.js +10 -6
  144. package/dist/client/guided-questions.js.map +1 -1
  145. package/dist/client/i18n.d.ts +1 -1
  146. package/dist/client/i18n.d.ts.map +1 -1
  147. package/dist/client/i18n.js +6 -2
  148. package/dist/client/i18n.js.map +1 -1
  149. package/dist/client/sse-event-processor.d.ts +2 -0
  150. package/dist/client/sse-event-processor.d.ts.map +1 -1
  151. package/dist/client/sse-event-processor.js +121 -5
  152. package/dist/client/sse-event-processor.js.map +1 -1
  153. package/dist/client/tool-display.d.ts.map +1 -1
  154. package/dist/client/tool-display.js +8 -0
  155. package/dist/client/tool-display.js.map +1 -1
  156. package/dist/collab/awareness.d.ts +2 -2
  157. package/dist/collab/awareness.d.ts.map +1 -1
  158. package/dist/collab/routes.d.ts +1 -1
  159. package/dist/file-upload/builder.d.ts.map +1 -1
  160. package/dist/file-upload/builder.js +26 -8
  161. package/dist/file-upload/builder.js.map +1 -1
  162. package/dist/file-upload/types.d.ts +5 -1
  163. package/dist/file-upload/types.d.ts.map +1 -1
  164. package/dist/file-upload/types.js.map +1 -1
  165. package/dist/integrations/a2a-continuation-processor.js +43 -18
  166. package/dist/integrations/a2a-continuation-processor.js.map +1 -1
  167. package/dist/mcp/builtin-tools.d.ts.map +1 -1
  168. package/dist/mcp/builtin-tools.js +3 -0
  169. package/dist/mcp/builtin-tools.js.map +1 -1
  170. package/dist/mcp/org-directory.d.ts.map +1 -1
  171. package/dist/mcp/org-directory.js +58 -20
  172. package/dist/mcp/org-directory.js.map +1 -1
  173. package/dist/notifications/channels.d.ts +10 -0
  174. package/dist/notifications/channels.d.ts.map +1 -1
  175. package/dist/notifications/channels.js +172 -20
  176. package/dist/notifications/channels.js.map +1 -1
  177. package/dist/notifications/routes.d.ts +3 -3
  178. package/dist/observability/routes.d.ts +5 -5
  179. package/dist/progress/routes.d.ts +1 -1
  180. package/dist/resources/handlers.d.ts +1 -1
  181. package/dist/scripts/call-agent.d.ts.map +1 -1
  182. package/dist/scripts/call-agent.js +2 -2
  183. package/dist/scripts/call-agent.js.map +1 -1
  184. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  185. package/dist/server/analytics.d.ts +16 -0
  186. package/dist/server/analytics.d.ts.map +1 -1
  187. package/dist/server/analytics.js +30 -7
  188. package/dist/server/analytics.js.map +1 -1
  189. package/dist/server/ssr-handler.d.ts.map +1 -1
  190. package/dist/server/ssr-handler.js +28 -12
  191. package/dist/server/ssr-handler.js.map +1 -1
  192. package/dist/server/transcribe-voice.d.ts +1 -1
  193. package/package.json +1 -1
@@ -5,9 +5,72 @@ import { z } from "zod";
5
5
 
6
6
  import { getDb, schema } from "../server/db/index.js";
7
7
 
8
+ function isRecord(value: unknown): value is Record<string, unknown> {
9
+ return Boolean(value && typeof value === "object" && !Array.isArray(value));
10
+ }
11
+
12
+ function parseDesignData(value: unknown): Record<string, unknown> {
13
+ if (typeof value !== "string" || !value.trim()) return {};
14
+ try {
15
+ const parsed = JSON.parse(value);
16
+ return isRecord(parsed) ? parsed : {};
17
+ } catch {
18
+ return {};
19
+ }
20
+ }
21
+
22
+ function pruneKeyedRecord(
23
+ value: unknown,
24
+ fileId: string,
25
+ ): Record<string, unknown> | undefined {
26
+ if (!isRecord(value)) return undefined;
27
+ const next = { ...value };
28
+ delete next[fileId];
29
+ return next;
30
+ }
31
+
32
+ function variantScreenMatchesFile(screen: unknown, fileId: string): boolean {
33
+ if (typeof screen === "string") return screen === fileId;
34
+ return isRecord(screen) && screen.id === fileId;
35
+ }
36
+
37
+ function pruneDesignVariantSets(
38
+ value: unknown,
39
+ fileId: string,
40
+ ): Record<string, unknown> | undefined {
41
+ if (!isRecord(value)) return undefined;
42
+ const next: Record<string, unknown> = {};
43
+ for (const [key, rawSet] of Object.entries(value)) {
44
+ if (!isRecord(rawSet) || !Array.isArray(rawSet.screens)) {
45
+ next[key] = rawSet;
46
+ continue;
47
+ }
48
+ const screens = rawSet.screens.filter(
49
+ (screen) => !variantScreenMatchesFile(screen, fileId),
50
+ );
51
+ if (screens.length <= 1) continue;
52
+ next[key] = { ...rawSet, screens };
53
+ }
54
+ return next;
55
+ }
56
+
57
+ function pruneDeletedFileMetadata(
58
+ data: Record<string, unknown>,
59
+ fileId: string,
60
+ ): Record<string, unknown> {
61
+ return {
62
+ ...data,
63
+ canvasFrames: pruneKeyedRecord(data.canvasFrames, fileId) ?? {},
64
+ screenMetadata: pruneKeyedRecord(data.screenMetadata, fileId) ?? {},
65
+ localhostScreens: pruneKeyedRecord(data.localhostScreens, fileId) ?? {},
66
+ designVariantSets:
67
+ pruneDesignVariantSets(data.designVariantSets, fileId) ?? {},
68
+ };
69
+ }
70
+
8
71
  export default defineAction({
9
72
  description:
10
- "Delete a file from a design project. Validates ownership via the parent design's access.",
73
+ "Delete a file from a design project. Idempotent: if the file is already gone, returns deleted=false so cleanup retries can continue. Validates ownership via the parent design's access when the file exists.",
11
74
  schema: z.object({
12
75
  id: z.string().describe("File ID to delete"),
13
76
  }),
@@ -33,21 +96,34 @@ export default defineAction({
33
96
  )
34
97
  .limit(1);
35
98
 
36
- if (!file) {
37
- throw new Error(`File not found: ${id}`);
38
- }
99
+ if (!file) return { id, deleted: false, alreadyMissing: true };
39
100
 
40
101
  await assertAccess("design", file.designId, "editor");
41
102
 
42
103
  const now = new Date().toISOString();
43
104
 
44
- await db.delete(schema.designFiles).where(eq(schema.designFiles.id, id));
105
+ await db.transaction(async (tx) => {
106
+ const [currentDesign] = await tx
107
+ .select({ data: schema.designs.data })
108
+ .from(schema.designs)
109
+ .where(eq(schema.designs.id, file.designId))
110
+ .limit(1);
111
+ const nextData = pruneDeletedFileMetadata(
112
+ parseDesignData(currentDesign?.data),
113
+ id,
114
+ );
115
+
116
+ await tx.delete(schema.designFiles).where(eq(schema.designFiles.id, id));
45
117
 
46
- // Update the parent design's updatedAt timestamp
47
- await db
48
- .update(schema.designs)
49
- .set({ updatedAt: now })
50
- .where(eq(schema.designs.id, file.designId));
118
+ // Update the parent design's board metadata and updatedAt timestamp.
119
+ await tx
120
+ .update(schema.designs)
121
+ .set({
122
+ data: JSON.stringify({ ...nextData, updatedAt: now }),
123
+ updatedAt: now,
124
+ })
125
+ .where(eq(schema.designs.id, file.designId));
126
+ });
51
127
 
52
128
  return { id, deleted: true };
53
129
  },
@@ -87,6 +87,7 @@ export default defineAction({
87
87
  err.statusCode = 409;
88
88
  throw err;
89
89
  }
90
+ const boundedFile = requestedFileId || requestedFilename ? files[0] : null;
90
91
 
91
92
  return {
92
93
  designId,
@@ -108,6 +109,18 @@ export default defineAction({
108
109
  appliedTweaks: snapshot.appliedTweaks,
109
110
  resolvedCssVars: snapshot.resolvedCssVars,
110
111
  deepLink: designDeepLink(designId),
112
+ ...(boundedFile
113
+ ? {
114
+ editTarget: {
115
+ designId,
116
+ fileId: boundedFile.id,
117
+ filename: boundedFile.filename,
118
+ },
119
+ nextRequiredAction:
120
+ `Call edit-design exactly once with designId ${designId} and fileId ${boundedFile.id} (${boundedFile.filename}). ` +
121
+ "Do not call delete-file or get-design-snapshot again unless edit-design fails with a concrete missing context error.",
122
+ }
123
+ : {}),
111
124
  };
112
125
  },
113
126
  link: ({ result }) => {
@@ -40,20 +40,18 @@ const FALLBACK_INSTRUCTIONS =
40
40
  "The generated directions have been saved as normal screens on the Design " +
41
41
  "overview board. The chat shows one button per screen. Ask the user to pick " +
42
42
  "a screen by name if the inline buttons are not available; after they pick, " +
43
- "delete the other variant screens, call get-design-snapshot with fileId for " +
44
- "the kept screen, then call edit-design on that same fileId in a bounded pass. " +
43
+ "delete each other variant screen at most once, call get-design-snapshot with fileId for " +
44
+ "the kept screen once, then call edit-design on that same fileId in a bounded pass. " +
45
45
  'Use mode "replace-file" when expanding the representative placeholder. ' +
46
46
  "Do not call generate-design after a variant pick.";
47
47
 
48
48
  const VARIANT_PICK_SUBMIT_MESSAGE =
49
- "Use this design direction. Delete the other variant screens, call " +
50
- "get-design-snapshot with the selected option's fileId (or filename if " +
51
- "needed) for the kept file, then call edit-design with that same fileId in " +
52
- 'a bounded single-file pass. Use mode "replace-file" when replacing the ' +
53
- "representative placeholder with the full chosen direction, or search/replace " +
54
- "for smaller refinements. Do not call generate-design after a variant pick, " +
55
- "do not create index.html, and do not resend a huge payload. Stop after the " +
56
- "first successful edit-design save.";
49
+ "Use this design direction. Keep the selected screen, clean up each other " +
50
+ "variant screen at most once, read only the kept screen, then update that " +
51
+ "same screen in one bounded pass. If a cleanup action reports a screen was " +
52
+ "already missing, continue. Use the exact file ids and tool instructions in " +
53
+ "the selected answer below. Do not repeat cleanup/read cycles, do not create " +
54
+ "a new index.html, and stop after the first successful screen update.";
57
55
 
58
56
  const variantSchema = z.object({
59
57
  id: z.string().min(1).describe("Stable variant id, e.g. 'minimal-focus'"),
@@ -609,8 +607,8 @@ export default defineAction({
609
607
  label: screen.label || optionName(index),
610
608
  value:
611
609
  `Keep "${screen.label}" (${screen.filename}, file id ${screen.id}) ` +
612
- `from variant set ${variantSetId}. Delete the other variant screens: ${otherScreens}. ` +
613
- `Then call get-design-snapshot with designId ${designId} and fileId ${screen.id} (filename ${screen.filename}), then call edit-design with fileId ${screen.id} on that same kept file in a bounded single-file pass. Use mode "replace-file" when replacing the representative placeholder with the full chosen direction, or search/replace for smaller refinements. Do not call generate-design after this variant pick, do not create index.html, and do not resend a huge payload. Stop after the first successful edit-design save.`,
610
+ `from variant set ${variantSetId}. Delete each other variant screen at most once: ${otherScreens}. If delete-file says a screen is already missing, continue. ` +
611
+ `Then call get-design-snapshot exactly once with designId ${designId} and fileId ${screen.id} (filename ${screen.filename}), then call edit-design with fileId ${screen.id} on that same kept file in a bounded single-file pass. Use mode "replace-file" when replacing the representative placeholder with the full chosen direction, or search/replace for smaller refinements. Do not call generate-design after this variant pick, do not repeat delete/snapshot cycles, do not create index.html, and do not resend a huge payload. Stop after the first successful edit-design save.`,
614
612
  };
615
613
  }),
616
614
  },
@@ -628,7 +626,7 @@ export default defineAction({
628
626
  embed: true,
629
627
  fallbackInstructions: FALLBACK_INSTRUCTIONS,
630
628
  nextRequiredAction:
631
- 'Wait for the user to pick a screen in chat. Then delete the unchosen variant screens with delete-file, call get-design-snapshot with fileId for the chosen screen, and call edit-design with that same fileId in a bounded pass. Use mode "replace-file" when expanding the placeholder into the full chosen direction. Do not call generate-design after a variant pick. Stop after the first successful edit-design save.',
629
+ 'Wait for the user to pick a screen in chat. Then delete each unchosen variant screen with delete-file at most once, call get-design-snapshot exactly once with fileId for the chosen screen, and call edit-design with that same fileId in a bounded pass. Use mode "replace-file" when expanding the placeholder into the full chosen direction. Do not repeat delete/snapshot cycles. Do not call generate-design after a variant pick. Stop after the first successful edit-design save.',
632
630
  };
633
631
  },
634
632
  link: ({ result }) => {
@@ -41,7 +41,7 @@ export function useQuestionFlow(
41
41
  formattedAnswers,
42
42
  "",
43
43
  designId
44
- ? 'Now continue the design. Honor any answer about variations: if the user asked to explore options, call present-design-variants with 2-5 concise directions using label, description, accentColor, and feature bullets; omit large content HTML when needed because the action can render compact representative screens - wait for their chat pick, delete the unchosen variant screens, call get-design-snapshot with fileId for the kept screen, then call edit-design on that same fileId in a bounded pass. Use mode "replace-file" when expanding the representative placeholder into the full chosen direction. Do not call generate-design after a variant pick. Stop after the first successful edit-design save. Otherwise call generate-design with one complete, renderable index.html first. Do not ask another question unless a required decision is still genuinely missing.'
44
+ ? 'Now continue the design. Honor any answer about variations: if the user asked to explore options, call present-design-variants with 2-5 concise directions using label, description, accentColor, and feature bullets; omit large content HTML when needed because the action can render compact representative screens - wait for their chat pick, delete each unchosen variant screen at most once, call get-design-snapshot exactly once with fileId for the kept screen, then call edit-design exactly once on that same fileId in a bounded pass. Use mode "replace-file" when expanding the representative placeholder into the full chosen direction. Do not repeat delete/snapshot cycles. Do not call generate-design after a variant pick. Stop after the first successful edit-design save. Otherwise call generate-design with one complete, renderable index.html first. Do not ask another question unless a required decision is still genuinely missing.'
45
45
  : "Now continue the design. Honor any answer about variations: use variants only if requested; otherwise generate one polished direction.",
46
46
  ]
47
47
  .filter(Boolean)
@@ -79,7 +79,7 @@ export function useQuestionFlow(
79
79
  formattedAnswers,
80
80
  "",
81
81
  designId
82
- ? 'Now continue the design. Honor any answer about variations: if the user asked to explore options, call present-design-variants with 2-5 concise directions using label, description, accentColor, and feature bullets; omit large content HTML when needed because the action can render compact representative screens - wait for their chat pick, delete the unchosen variant screens, call get-design-snapshot with fileId for the kept screen, then call edit-design on that same fileId in a bounded pass. Use mode "replace-file" when expanding the representative placeholder into the full chosen direction. Do not call generate-design after a variant pick. Stop after the first successful edit-design save. Otherwise call generate-design with one complete, renderable index.html first. Do not ask another question unless a required decision is still genuinely missing.'
82
+ ? 'Now continue the design. Honor any answer about variations: if the user asked to explore options, call present-design-variants with 2-5 concise directions using label, description, accentColor, and feature bullets; omit large content HTML when needed because the action can render compact representative screens - wait for their chat pick, delete each unchosen variant screen at most once, call get-design-snapshot exactly once with fileId for the kept screen, then call edit-design exactly once on that same fileId in a bounded pass. Use mode "replace-file" when expanding the representative placeholder into the full chosen direction. Do not repeat delete/snapshot cycles. Do not call generate-design after a variant pick. Stop after the first successful edit-design save. Otherwise call generate-design with one complete, renderable index.html first. Do not ask another question unless a required decision is still genuinely missing.'
83
83
  : "Now continue the design. Honor any answer about variations: use variants only if requested; otherwise generate one polished direction.",
84
84
  ]
85
85
  .filter(Boolean)
@@ -1573,7 +1573,7 @@ function designVariantGenerationDirectives(
1573
1573
  ...designSystemGenerationDirectives(designSystemId),
1574
1574
  "The user's prompt already asks to explore multiple directions, so DO NOT call `show-design-questions` first and DO NOT call `generate-design` first.",
1575
1575
  "Call `present-design-variants` with 2-5 concise directions (3 when unspecified). Prefer label, description, accentColor, and feature bullets; omit large content HTML when needed because the action can render compact representative screens.",
1576
- 'Wait for the user\'s chat pick, delete the unchosen variant screens, call `get-design-snapshot` with `fileId` for the kept screen, then call `edit-design` on that same `fileId` in a bounded pass. Use `mode: "replace-file"` when expanding the representative placeholder into the full chosen direction. Do not call `generate-design` after a variant pick. Stop after the first successful `edit-design` save.',
1576
+ 'Wait for the user\'s chat pick, delete each unchosen variant screen at most once, call `get-design-snapshot` exactly once with `fileId` for the kept screen, then call `edit-design` exactly once on that same `fileId` in a bounded pass. Use `mode: "replace-file"` when expanding the representative placeholder into the full chosen direction. Do not repeat delete/snapshot cycles. Do not call `generate-design` after a variant pick. Stop after the first successful `edit-design` save.',
1577
1577
  ];
1578
1578
  }
1579
1579
 
@@ -1584,7 +1584,7 @@ function designGenerationDirectives(
1584
1584
  return [
1585
1585
  `Use the \`generate-design --designId="${designId}"\` action with exactly one complete, renderable \`index.html\` file first. The design already exists - DO NOT call create-design.`,
1586
1586
  ...designSystemGenerationDirectives(designSystemId),
1587
- 'If the user asked to explore variations, call `present-design-variants` with 2-5 concise directions. Prefer label, description, accentColor, and feature bullets; omit large content HTML when needed because the action can render compact representative screens. Wait for their chat pick, delete the unchosen variant screens, call `get-design-snapshot` with `fileId` for the kept screen, then call `edit-design` on that same `fileId` in a bounded pass. Use `mode: "replace-file"` when expanding the representative placeholder into the full chosen direction. Do not call `generate-design` after a variant pick. Stop after the first successful `edit-design` save. Otherwise generate one polished first direction.',
1587
+ 'If the user asked to explore variations, call `present-design-variants` with 2-5 concise directions. Prefer label, description, accentColor, and feature bullets; omit large content HTML when needed because the action can render compact representative screens. Wait for their chat pick, delete each unchosen variant screen at most once, call `get-design-snapshot` exactly once with `fileId` for the kept screen, then call `edit-design` exactly once on that same `fileId` in a bounded pass. Use `mode: "replace-file"` when expanding the representative placeholder into the full chosen direction. Do not repeat delete/snapshot cycles. Do not call `generate-design` after a variant pick. Stop after the first successful `edit-design` save. Otherwise generate one polished first direction.',
1588
1588
  "Keep the first pass bounded enough to finish quickly: one self-contained Alpine.js + Tailwind CDN HTML document, polished but concise. Add 3-6 tweaks only when they naturally fit the design.",
1589
1589
  "After generate-design succeeds, stop and summarize what was created.",
1590
1590
  ];
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-07-01
4
+ ---
5
+
6
+ Design recovers sooner when an agent gets stuck preparing a large design edit.
@@ -0,0 +1,34 @@
1
+ # Dispatch
2
+
3
+ The agent-native workspace control plane — a central Slack/Telegram inbox, a
4
+ secrets vault, scheduled jobs, approvals, and an orchestrator agent that delegates
5
+ work to the right specialist app over A2A.
6
+
7
+ **Live app: [dispatch.agent-native.com](https://dispatch.agent-native.com)**
8
+
9
+ Where other templates are domain apps (Mail, Calendar, Analytics, Brain),
10
+ Dispatch is the app you run _alongside_ them to coordinate everything. It routes
11
+ messages, holds shared credentials, runs cross-app jobs, and gates sensitive
12
+ actions behind approvals.
13
+
14
+ ## Features
15
+
16
+ - Central inbox for Slack DMs, Telegram, email, and A2A requests from other agents.
17
+ - Orchestrator agent that triages and delegates domain work over A2A.
18
+ - Secrets vault with per-app grants and an audit trail.
19
+ - Workspace resources: shared skills, guardrails, agent profiles, and MCP servers.
20
+ - Cross-app scheduled/recurring jobs.
21
+ - Approval queue for destructive or external actions.
22
+
23
+ ## Develop locally
24
+
25
+ Scaffold your own copy and run it:
26
+
27
+ ```bash
28
+ npx @agent-native/core@latest create my-dispatch --standalone --template dispatch
29
+ cd my-dispatch
30
+ pnpm install
31
+ pnpm dev
32
+ ```
33
+
34
+ Full docs: [agent-native.com/docs/template-dispatch](https://agent-native.com/docs/template-dispatch).
@@ -0,0 +1,34 @@
1
+ # Forms
2
+
3
+ An open-source, agent-native alternative to Typeform and Google Forms. Describe
4
+ the form you want, refine it in the visual editor, and publish a public form that
5
+ stores submissions in your own SQL database.
6
+
7
+ **Live app: [forms.agent-native.com](https://forms.agent-native.com)**
8
+
9
+ Build forms conversationally or by hand — the agent updates the schema and the
10
+ preview updates from SQL-backed state. Route new submissions wherever you need
11
+ them.
12
+
13
+ ## Features
14
+
15
+ - Build and edit forms conversationally, with a live preview.
16
+ - Visual builder for labels, validation, options, and field order.
17
+ - Shipped field types: text, email, number, long text, select, multi-select,
18
+ checkbox, radio, date, rating, and scale.
19
+ - Submissions stored in SQL with a per-response detail view and dashboard.
20
+ - Route submissions to webhooks, Slack, Discord, or Google Sheets.
21
+ - Publish public form URLs with a thank-you message.
22
+
23
+ ## Develop locally
24
+
25
+ Scaffold your own copy and run it:
26
+
27
+ ```bash
28
+ npx @agent-native/core@latest create my-forms --standalone --template forms
29
+ cd my-forms
30
+ pnpm install
31
+ pnpm dev
32
+ ```
33
+
34
+ Full docs: [agent-native.com/docs/template-forms](https://agent-native.com/docs/template-forms).
@@ -0,0 +1,28 @@
1
+ # Macros
2
+
3
+ An agent-native, voice-driven calorie and macro tracker — an open-source take on
4
+ MyFitnessPal-style logging. Speak or type what you ate and the agent logs the
5
+ food, estimates calories and macros, and keeps your daily stats up to date.
6
+
7
+ > **Internal/experimental template.** Macros is not shown in the public template
8
+ > pickers. It exists as a reference app and demo.
9
+
10
+ **Live app: [macros.agent-native.com](https://macros.agent-native.com)**
11
+
12
+ ## Features
13
+
14
+ - Log foods and meals by voice or text through the agent.
15
+ - Automatic calorie and macro estimation.
16
+ - Voice corrections and quick edits.
17
+ - Daily and historical stats.
18
+
19
+ ## Develop locally
20
+
21
+ Scaffold your own copy and run it:
22
+
23
+ ```bash
24
+ npx @agent-native/core@latest create my-macros --standalone --template macros
25
+ cd my-macros
26
+ pnpm install
27
+ pnpm dev
28
+ ```
@@ -0,0 +1,35 @@
1
+ # Mail
2
+
3
+ An open-source, agent-native alternative to Superhuman. An agent-powered,
4
+ keyboard-first email client for Gmail — the agent can read, draft, send, and
5
+ organize email for you, and the codebase is yours to own.
6
+
7
+ **Live app: [mail.agent-native.com](https://mail.agent-native.com)**
8
+
9
+ Connect one or more Gmail accounts and drive a fast, keyboard-first inbox
10
+ yourself, or ask the agent to do anything you can. The agent always knows which
11
+ view you're in and which thread is open, so "archive this" just works.
12
+
13
+ ## Features
14
+
15
+ - Keyboard-first triage (`J`/`K` to move, `E` to archive, `R` to reply, `C` to compose).
16
+ - Multiple Gmail accounts in one inbox.
17
+ - Ask the agent to summarize, draft, reply, archive, or bulk-clean your inbox.
18
+ - Natural-language auto-triage rules (label, archive, mark read, star, trash).
19
+ - Open and click tracking on emails you send.
20
+ - Search across every connected inbox with one query.
21
+ - Queue drafts for review from teammates or Slack.
22
+
23
+ ## Develop locally
24
+
25
+ Scaffold your own copy and run it:
26
+
27
+ ```bash
28
+ npx @agent-native/core@latest create my-mail --standalone --template mail
29
+ cd my-mail
30
+ pnpm install
31
+ pnpm dev
32
+ ```
33
+
34
+ Connecting Gmail in dev needs a Google OAuth client — see the docs for setup.
35
+ Full docs: [agent-native.com/docs/template-mail](https://agent-native.com/docs/template-mail).
@@ -1,133 +1,45 @@
1
- # Agent-Native Plan
1
+ # Plan
2
2
 
3
- Agent-Native Plan is structured visual plan mode for coding agents. It turns a
4
- normal Markdown/Codex/Claude Code plan into a visual review surface with
5
- editable rich blocks, diagrams, wireframes, prototype options, annotated code
6
- walkthroughs and file trees, code previews, annotations, share links, feedback,
7
- and HTML export.
3
+ Structured visual plan mode for coding agents. Plan turns an ordinary
4
+ Codex / Claude Code / Markdown plan into a reviewable document diagrams,
5
+ wireframes, prototype options, annotated code walkthroughs, file trees, comments,
6
+ share links, and HTML export.
8
7
 
9
- ## Install
8
+ **Live app: [plan.agent-native.com](https://plan.agent-native.com)**
10
9
 
11
- Use the Agent-Native CLI. This is the recommended setup because it installs the
12
- Plan skill instructions, registers the hosted Plan MCP connector, and runs the
13
- client-specific auth/setup flow in one step:
10
+ ## Install (recommended)
11
+
12
+ Most people install Plan as a skill, not a scaffolded app. One CLI command adds
13
+ the `/visual-plan` and `/visual-recap` skills plus the hosted Plan connector to
14
+ your coding agent:
14
15
 
15
16
  ```sh
16
17
  npx @agent-native/core@latest skills add visual-plan
17
18
  ```
18
19
 
19
- You do not need to wire the MCP server separately.
20
-
21
- Supported aliases include:
22
-
23
- - `npx @agent-native/core@latest skills add visual-plan`
24
- - `npx @agent-native/core@latest skills add visual-recap`
25
-
26
- Restart or reload the host if the tools are not visible immediately.
27
-
28
- ## Use
29
-
30
- It comes down to two commands: `/visual-plan` to plan before the agent builds,
31
- and `/visual-recap` to review a change after it lands.
32
-
33
- Type `/visual-plan` when you want a fresh plan before the agent builds, or when
34
- you already have a Codex, Claude Code, Markdown, or pasted plan and want the
35
- agent to preserve it while adding a richer visual review surface.
36
-
37
- Type `/visual-recap` when you want a high-level visual code-review recap from a
38
- PR, commit, branch, or git diff. A recap is an aid for review, not a replacement
39
- for reading the actual diff.
40
-
41
- Command behavior:
42
-
43
- - `/visual-plan` creates a new rich visual plan with docs-level detail, diagrams,
44
- detailed wireframes/mockups when UI is involved, functional prototypes when
45
- the interaction feel matters, tradeoffs, open questions, annotated code
46
- walkthroughs and file trees for code work, code previews, and feedback prompts.
47
- When an existing plan is provided, it builds from that plan instead of starting
48
- over.
49
- - `/visual-recap` creates a reverse plan from code that already changed:
50
- file-tree, diff, data-model, API, and columns blocks that let a
51
- reviewer scan the shape of a PR before reading line-by-line.
52
-
53
- ## Normal Planning Flow
54
-
55
- `/visual-plan` remains the main planning command. Agents should use their normal
56
- planning flow first: inspect the codebase, gather context, ask clarifying
57
- questions through the host's native ask-user-question tools when needed, then
58
- create the visual plan.
59
-
60
- The document should stay close to the Markdown plan a coding agent would
61
- normally produce. Diagrams, wireframes, mockups, and annotations are additive
62
- review aids.
63
-
64
- Plans should be visual by default:
20
+ Then use `/visual-plan` to plan before the agent builds, and `/visual-recap` to
21
+ review a change after it lands. Reviewers you share with edit as a guest and sign
22
+ in only to save or share.
65
23
 
66
- - diagrams for architecture, data flow, dependencies, and state machines
67
- - detailed wireframes and quick mockups for UI work, including layout regions,
68
- controls, states, empty/loading/error paths, and copy placeholders
69
- - tabs for multiple diagrams, wireframes, mockups, and design options so rich
70
- plans do not become long stacks of visuals
71
- - prototype options when interaction or design direction is uncertain
72
- - annotated code walkthroughs and file trees for code work: files,
73
- symbols/components/functions, planned changes, concise code snippets, and
74
- explicit editor-open affordances
75
- - plannotator-style comments, corrections, and annotations
76
- - review prompts for options, open questions, risky assumptions, and choices
77
- - README-like details when helpful: commands, MCP/link fallback, tool behavior,
78
- data shape, scope, and what is deferred
24
+ ## Features
79
25
 
80
- Review recaps use the same plan surface, but their center of gravity is
81
- before/after review. Use `columns` as the generic side-by-side layout primitive
82
- for structured before/after comparisons, and use split `diff` blocks for literal
83
- code hunks. Use prose beside `data-model` or `api-endpoint` blocks when the
84
- important change is semantic API or schema compatibility.
26
+ - Rich, editable plan blocks: diagrams, wireframes, prototypes, and annotations.
27
+ - Annotated code walkthroughs and file trees for code work.
28
+ - Reviewer comments, feedback, and private share links.
29
+ - `/visual-recap` reverse-plans a PR, commit, branch, or diff for review.
30
+ - MDX source sync so plans can be committed to a repo.
31
+ - Optional PR Visual Recap GitHub Action.
85
32
 
86
- ## Review Loop
33
+ ## Develop locally
87
34
 
88
- 1. The agent creates a plan and opens the MCP app inline or as a browser link.
89
- 2. The user reacts to visuals instead of reading a wall of Markdown.
90
- 3. The user annotates, corrects, chooses options, or asks for a clearer visual.
91
- 4. The agent reads structured feedback before editing and updates the plan or
92
- implementation.
93
- 5. The user can keep the plan local or sign in to share a private review link.
35
+ Forking the template is the secondary path, for self-hosting or customizing the
36
+ Plan app itself:
94
37
 
95
- Local development can use the framework's auto-created dev account. Hosted
96
- persistence, private sharing, reviewer links, and team feedback use account
97
- login, with Google sign-in available when OAuth env vars are configured.
98
-
99
- ## Hosted App
100
-
101
- The hosted MCP app is expected at:
102
-
103
- - App: `https://plan.agent-native.com`
104
- - MCP: `https://plan.agent-native.com/_agent-native/mcp`
105
-
106
- The local template remains useful for development and self-hosting.
107
-
108
- ## PR Visual Recaps
109
-
110
- When you install Plans interactively, the CLI asks whether you also want the PR
111
- Visual Recap GitHub Action. You can add it explicitly at any time:
112
-
113
- ```sh
114
- npx @agent-native/core@latest skills add visual-plan --with-github-action
115
- ```
116
-
117
- That writes `.github/workflows/pr-visual-recap.yml`. Then run the setup helper to
118
- configure GitHub Actions secrets/variables where possible and print any missing
119
- manual steps:
120
-
121
- ```sh
122
- npx @agent-native/core@latest recap setup
123
- npx @agent-native/core@latest recap doctor
38
+ ```bash
39
+ npx @agent-native/core@latest create my-plan --standalone --template plan
40
+ cd my-plan
41
+ pnpm install
42
+ pnpm dev
124
43
  ```
125
44
 
126
- The hosted default needs `PLAN_RECAP_TOKEN` plus `ANTHROPIC_API_KEY` for the
127
- default Claude backend. `PLAN_RECAP_APP_URL` is only needed when self-hosting the
128
- Plan app, and Codex users can set `VISUAL_RECAP_AGENT=codex` with
129
- `OPENAI_API_KEY`.
130
-
131
- The workflow should treat recap generation as informational only: it can show a
132
- non-required `Visual Recap` check while it runs and update a sticky PR comment
133
- with the recap link, but reviewers still own the real diff review.
45
+ Full docs: [agent-native.com/docs/template-plan](https://agent-native.com/docs/template-plan).
@@ -156,7 +156,7 @@
156
156
  }
157
157
 
158
158
  .plan-content-surface[data-recap-screenshot-theme] .plan-document-shell {
159
- padding: 10px;
159
+ padding: 0;
160
160
  }
161
161
 
162
162
  .plan-content-surface[data-recap-screenshot-theme] .plan-document-body {
@@ -0,0 +1,34 @@
1
+ # Slides
2
+
3
+ An open-source, agent-native alternative to Google Slides, Pitch, and PowerPoint.
4
+ Generate full decks from a prompt, edit slides visually, and present full-screen.
5
+
6
+ **Live app: [slides.agent-native.com](https://slides.agent-native.com)**
7
+
8
+ Ask the agent for "a 10-slide pitch deck for a coffee subscription service" and
9
+ watch it stream in slide-by-slide, then refine it visually or by prompt. Anything
10
+ you can do in the editor, the agent can do too.
11
+
12
+ ## Features
13
+
14
+ - Generate full presentation decks from a prompt.
15
+ - Edit slides visually with a bubble menu and slash-menu blocks.
16
+ - AI image generation, stock photo search, and company logo lookup.
17
+ - Present full-screen with keyboard navigation and speaker notes.
18
+ - Real-time collaboration, comments, and public read-only share links.
19
+ - Import from PDF, PPTX, DOCX, Google Docs, or a URL; export to PPTX, Google
20
+ Slides, or HTML.
21
+ - Design systems and per-deck version history.
22
+
23
+ ## Develop locally
24
+
25
+ Scaffold your own copy and run it:
26
+
27
+ ```bash
28
+ npx @agent-native/core@latest create my-slides --standalone --template slides
29
+ cd my-slides
30
+ pnpm install
31
+ pnpm dev
32
+ ```
33
+
34
+ Full docs: [agent-native.com/docs/template-slides](https://agent-native.com/docs/template-slides).