@agent-native/core 0.70.0 → 0.70.1

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 (167) hide show
  1. package/README.md +15 -15
  2. package/corpus/README.md +2 -2
  3. package/corpus/core/CHANGELOG.md +61 -0
  4. package/corpus/core/docs/design/durable-agent-runs.md +217 -0
  5. package/corpus/core/package.json +1 -1
  6. package/corpus/core/src/action.ts +89 -0
  7. package/corpus/core/src/agent/model-config.ts +0 -2
  8. package/corpus/core/src/agent/run-loop-with-resume.ts +48 -0
  9. package/corpus/core/src/cli/skills.ts +2 -2
  10. package/corpus/core/src/client/AgentPanel.tsx +5 -3
  11. package/corpus/core/src/client/AssistantChat.tsx +8 -0
  12. package/corpus/core/src/client/client-surface.ts +41 -0
  13. package/corpus/core/src/client/composer/TiptapComposer.tsx +123 -12
  14. package/corpus/core/src/client/feedback-context.ts +4 -0
  15. package/corpus/core/src/client/index.ts +1 -0
  16. package/corpus/core/src/client/sse-event-processor.ts +7 -1
  17. package/corpus/core/src/mcp/build-server.ts +57 -1
  18. package/corpus/core/src/mcp/embed-app.ts +86 -2
  19. package/corpus/core/src/mcp/oauth-route.ts +109 -13
  20. package/corpus/core/src/server/core-routes-plugin.ts +78 -0
  21. package/corpus/core/src/server/onboarding-html.ts +35 -0
  22. package/corpus/core/src/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +72 -0
  23. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +22 -0
  24. package/corpus/templates/analytics/AGENTS.md +8 -1
  25. package/corpus/templates/analytics/actions/install-dashboard-template.ts +97 -2
  26. package/corpus/templates/analytics/actions/update-dashboard.ts +36 -7
  27. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +30 -3
  28. package/corpus/templates/analytics/app/components/layout/Header.tsx +0 -1
  29. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +2 -4
  30. package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +0 -3
  31. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +32 -2
  32. package/corpus/templates/analytics/changelog/2026-06-23-long-dashboard-and-analysis-names-in-the-sidebar-now-truncat.md +6 -0
  33. package/corpus/templates/analytics/changelog/2026-06-23-open-any-dashboard-chart-full-screen-in-a-modal-from-the-pan.md +6 -0
  34. package/corpus/templates/assets/actions/generate-image.ts +24 -0
  35. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +2 -2
  36. package/corpus/templates/assets/app/global.css +17 -1
  37. package/corpus/templates/assets/app/routes/_index.tsx +94 -14
  38. package/corpus/templates/assets/changelog/2026-06-23-chat-dates-in-the-sidebar-no-longer-wrap-onto-two-lines.md +6 -0
  39. package/corpus/templates/assets/changelog/2026-06-23-clicking-image-video-or-refine-on-the-start-screen-now-drops.md +6 -0
  40. package/corpus/templates/assets/changelog/2026-06-23-pick-your-image-generation-model-right-from-the-chat-model-m.md +6 -0
  41. package/corpus/templates/clips/app/components/library/library-grid.tsx +1 -20
  42. package/corpus/templates/clips/app/components/recorder/countdown-overlay.tsx +72 -48
  43. package/corpus/templates/clips/app/lib/countdown-audio-cue.ts +35 -17
  44. package/corpus/templates/clips/changelog/2026-06-23-removed-select-button-from-library-hover-a-clip-to-select-it.md +6 -0
  45. package/corpus/templates/clips/changelog/2026-06-23-shared-video-links-now-play-for-anyone-without-signing-in.md +6 -0
  46. package/corpus/templates/clips/changelog/2026-06-23-skip-or-cancel-the-recording-countdown-with-buttons-beside-t.md +6 -0
  47. package/corpus/templates/clips/changelog/2026-06-23-the-desktop-camera-bubble-now-looks-sharp-the-instant-it-ope.md +6 -0
  48. package/corpus/templates/clips/changelog/2026-06-23-the-desktop-recording-widget-now-grows-downward-only-when-yo.md +6 -0
  49. package/corpus/templates/clips/changelog/2026-06-23-the-recording-start-sound-is-now-a-softer-more-modern-chime.md +6 -0
  50. package/corpus/templates/clips/chrome-extension/public/manifest.json +17 -8
  51. package/corpus/templates/clips/chrome-extension/src/background.ts +769 -180
  52. package/corpus/templates/clips/chrome-extension/src/content-script.ts +177 -0
  53. package/corpus/templates/clips/chrome-extension/src/offscreen.ts +466 -329
  54. package/corpus/templates/clips/chrome-extension/src/overlay.css +377 -0
  55. package/corpus/templates/clips/chrome-extension/src/overlay.html +12 -0
  56. package/corpus/templates/clips/chrome-extension/src/overlay.ts +330 -0
  57. package/corpus/templates/clips/chrome-extension/src/permission.html +227 -0
  58. package/corpus/templates/clips/chrome-extension/src/permission.ts +105 -0
  59. package/corpus/templates/clips/chrome-extension/src/popup.html +3 -0
  60. package/corpus/templates/clips/chrome-extension/src/popup.ts +50 -2
  61. package/corpus/templates/clips/chrome-extension/src/styles.css +50 -0
  62. package/corpus/templates/clips/chrome-extension/vite.config.ts +3 -0
  63. package/corpus/templates/clips/desktop/src/lib/audio-cue.ts +41 -24
  64. package/corpus/templates/clips/desktop/src/lib/bubble-webrtc.ts +119 -2
  65. package/corpus/templates/clips/desktop/src/overlays/countdown.tsx +21 -2
  66. package/corpus/templates/clips/desktop/src/styles.css +70 -2
  67. package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +73 -0
  68. package/corpus/templates/clips/server/routes/api/video/[recordingId].get.ts +34 -5
  69. package/corpus/templates/content/AGENTS.md +20 -3
  70. package/corpus/templates/content/actions/_database-utils.ts +15 -0
  71. package/corpus/templates/content/actions/_property-utils.ts +371 -4
  72. package/corpus/templates/content/actions/configure-document-property.ts +35 -1
  73. package/corpus/templates/content/actions/create-content-database.ts +5 -1
  74. package/corpus/templates/content/actions/delete-document-property.ts +52 -2
  75. package/corpus/templates/content/actions/duplicate-document-property.ts +34 -17
  76. package/corpus/templates/content/actions/reorder-document-property.ts +79 -0
  77. package/corpus/templates/content/actions/set-document-property.ts +39 -0
  78. package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +806 -0
  79. package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +226 -68
  80. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +59 -30
  81. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +25 -1
  82. package/corpus/templates/content/app/components/editor/blockFieldSaveController.ts +180 -0
  83. package/corpus/templates/content/app/components/editor/blockFieldSaveRegistry.ts +179 -0
  84. package/corpus/templates/content/app/components/editor/previewDocumentSaveController.ts +244 -0
  85. package/corpus/templates/content/app/components/editor/previewDocumentSaveRegistry.ts +132 -0
  86. package/corpus/templates/content/app/global.css +9 -0
  87. package/corpus/templates/content/app/hooks/use-document-properties.ts +21 -0
  88. package/corpus/templates/content/server/db/schema.ts +30 -0
  89. package/corpus/templates/content/server/plugins/db.ts +87 -0
  90. package/corpus/templates/content/shared/api.ts +7 -0
  91. package/corpus/templates/content/shared/properties.ts +109 -0
  92. package/corpus/templates/forms/.agents/skills/form-responses/SKILL.md +10 -0
  93. package/corpus/templates/forms/actions/export-responses.ts +6 -0
  94. package/corpus/templates/forms/actions/list-responses.ts +2 -0
  95. package/corpus/templates/forms/actions/response-insights.ts +2 -0
  96. package/corpus/templates/forms/app/pages/ResponsesPage.tsx +138 -1
  97. package/corpus/templates/forms/changelog/2026-06-23-response-tables-now-show-the-page-each-submission-came-from-.md +6 -0
  98. package/corpus/templates/forms/changelog/2026-06-23-response-tables-now-show-whether-feedback-came-from-the-web-.md +6 -0
  99. package/corpus/templates/forms/server/db/schema.ts +7 -0
  100. package/corpus/templates/forms/server/handlers/submissions.ts +19 -2
  101. package/corpus/templates/forms/server/lib/integrations.ts +76 -2
  102. package/corpus/templates/forms/server/plugins/db.ts +20 -0
  103. package/corpus/templates/forms/shared/types.ts +12 -0
  104. package/corpus/templates/plan/app/components/plan/wireframe/html-artboard.css +3 -1
  105. package/corpus/templates/plan/changelog/2026-06-23-large-diagrams-in-a-plan-now-scroll-within-their-block-inste.md +6 -0
  106. package/dist/action.js +87 -0
  107. package/dist/action.js.map +1 -1
  108. package/dist/agent/engine/builder-engine.d.ts +1 -1
  109. package/dist/agent/engine/builder-engine.d.ts.map +1 -1
  110. package/dist/agent/model-config.d.ts +2 -2
  111. package/dist/agent/model-config.d.ts.map +1 -1
  112. package/dist/agent/model-config.js +0 -2
  113. package/dist/agent/model-config.js.map +1 -1
  114. package/dist/agent/run-loop-with-resume.d.ts +13 -0
  115. package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
  116. package/dist/agent/run-loop-with-resume.js +44 -0
  117. package/dist/agent/run-loop-with-resume.js.map +1 -1
  118. package/dist/cli/skills.js +2 -2
  119. package/dist/cli/skills.js.map +1 -1
  120. package/dist/client/AgentPanel.d.ts.map +1 -1
  121. package/dist/client/AgentPanel.js +5 -3
  122. package/dist/client/AgentPanel.js.map +1 -1
  123. package/dist/client/AssistantChat.d.ts +6 -1
  124. package/dist/client/AssistantChat.d.ts.map +1 -1
  125. package/dist/client/AssistantChat.js +2 -2
  126. package/dist/client/AssistantChat.js.map +1 -1
  127. package/dist/client/client-surface.d.ts +17 -0
  128. package/dist/client/client-surface.d.ts.map +1 -0
  129. package/dist/client/client-surface.js +24 -0
  130. package/dist/client/client-surface.js.map +1 -0
  131. package/dist/client/composer/TiptapComposer.d.ts +26 -1
  132. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  133. package/dist/client/composer/TiptapComposer.js +27 -5
  134. package/dist/client/composer/TiptapComposer.js.map +1 -1
  135. package/dist/client/feedback-context.d.ts +3 -0
  136. package/dist/client/feedback-context.d.ts.map +1 -1
  137. package/dist/client/feedback-context.js +2 -0
  138. package/dist/client/feedback-context.js.map +1 -1
  139. package/dist/client/index.d.ts +1 -0
  140. package/dist/client/index.d.ts.map +1 -1
  141. package/dist/client/index.js +1 -0
  142. package/dist/client/index.js.map +1 -1
  143. package/dist/client/sse-event-processor.d.ts.map +1 -1
  144. package/dist/client/sse-event-processor.js +7 -1
  145. package/dist/client/sse-event-processor.js.map +1 -1
  146. package/dist/mcp/build-server.d.ts +21 -0
  147. package/dist/mcp/build-server.d.ts.map +1 -1
  148. package/dist/mcp/build-server.js +43 -1
  149. package/dist/mcp/build-server.js.map +1 -1
  150. package/dist/mcp/embed-app.d.ts.map +1 -1
  151. package/dist/mcp/embed-app.js +86 -2
  152. package/dist/mcp/embed-app.js.map +1 -1
  153. package/dist/mcp/oauth-route.d.ts.map +1 -1
  154. package/dist/mcp/oauth-route.js +95 -12
  155. package/dist/mcp/oauth-route.js.map +1 -1
  156. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  157. package/dist/server/core-routes-plugin.js +63 -0
  158. package/dist/server/core-routes-plugin.js.map +1 -1
  159. package/dist/server/onboarding-html.d.ts.map +1 -1
  160. package/dist/server/onboarding-html.js +35 -0
  161. package/dist/server/onboarding-html.js.map +1 -1
  162. package/dist/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +72 -0
  163. package/docs/design/durable-agent-runs.md +217 -0
  164. package/package.json +1 -1
  165. package/src/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +72 -0
  166. package/corpus/templates/analytics/app/pages/About.tsx +0 -108
  167. package/corpus/templates/analytics/app/routes/about.tsx +0 -9
@@ -0,0 +1,177 @@
1
+ // Loom-style in-page overlay host. This content script is injected into every
2
+ // page (declared for <all_urls>) and is wrapped in an IIFE so it emits a single
3
+ // self-contained classic script with no module imports/exports and leaks no
4
+ // names into the shared global scope. Its only job is to mount/unmount the
5
+ // overlay iframes; all UI and control logic lives inside the extension-origin
6
+ // overlay pages (src/overlay.html). The background service worker is the source
7
+ // of truth for which "parts" are visible and pushes them here.
8
+
9
+ (function clipsOverlayHost() {
10
+ type OverlayPart = "bubble" | "countdown" | "toolbar" | "saving";
11
+
12
+ const CONTAINER_ID = "clips-recorder-overlay-root";
13
+ const ALL_PARTS: OverlayPart[] = ["bubble", "countdown", "toolbar", "saving"];
14
+ const flags = window as unknown as { __clipsOverlayHostReady?: boolean };
15
+
16
+ function requestState(): void {
17
+ try {
18
+ chrome.runtime.sendMessage(
19
+ { type: "CLIPS_CONTENT_HELLO" },
20
+ (response) => {
21
+ if (chrome.runtime.lastError) return;
22
+ const parts = (response as { parts?: unknown } | undefined)?.parts;
23
+ reconcile(Array.isArray(parts) ? (parts as OverlayPart[]) : []);
24
+ },
25
+ );
26
+ } catch {
27
+ /* worker asleep; will resync on next message */
28
+ }
29
+ }
30
+
31
+ // Only wake the service worker (via requestState) when a recording is actually
32
+ // active. When idle this script does nothing but keep its message listener
33
+ // registered, so a recording that starts later still reaches this tab via the
34
+ // background's MOUNT broadcast.
35
+ function syncIfRecording(): void {
36
+ try {
37
+ chrome.storage.local.get("clipsRecordingActive", (value) => {
38
+ if (chrome.runtime.lastError) return;
39
+ if (value && value.clipsRecordingActive) requestState();
40
+ });
41
+ } catch {
42
+ /* ignore */
43
+ }
44
+ }
45
+
46
+ function ensureContainer(): HTMLDivElement {
47
+ let container = document.getElementById(
48
+ CONTAINER_ID,
49
+ ) as HTMLDivElement | null;
50
+ if (container) return container;
51
+ container = document.createElement("div");
52
+ container.id = CONTAINER_ID;
53
+ Object.assign(container.style, {
54
+ position: "fixed",
55
+ inset: "0",
56
+ zIndex: "2147483646",
57
+ pointerEvents: "none",
58
+ border: "none",
59
+ margin: "0",
60
+ padding: "0",
61
+ });
62
+ (document.documentElement || document.body).appendChild(container);
63
+ return container;
64
+ }
65
+
66
+ function partFrameId(part: OverlayPart): string {
67
+ return `${CONTAINER_ID}-${part}`;
68
+ }
69
+
70
+ function styleFrame(frame: HTMLIFrameElement, part: OverlayPart): void {
71
+ Object.assign(frame.style, {
72
+ position: "absolute",
73
+ border: "none",
74
+ background: "transparent",
75
+ colorScheme: "normal",
76
+ pointerEvents: "auto",
77
+ });
78
+ frame.setAttribute("allowtransparency", "true");
79
+ if (part === "bubble") {
80
+ frame.allow = "camera; microphone";
81
+ Object.assign(frame.style, {
82
+ left: "24px",
83
+ bottom: "24px",
84
+ width: "148px",
85
+ height: "148px",
86
+ });
87
+ } else if (part === "toolbar") {
88
+ // Left-edge vertical pill (desktop layout). Height grows on hover via the
89
+ // resize message below.
90
+ Object.assign(frame.style, {
91
+ left: "16px",
92
+ top: "50%",
93
+ transform: "translateY(-50%)",
94
+ width: "68px",
95
+ height: "154px",
96
+ });
97
+ } else if (part === "saving") {
98
+ Object.assign(frame.style, {
99
+ left: "24px",
100
+ bottom: "24px",
101
+ width: "264px",
102
+ height: "96px",
103
+ });
104
+ } else {
105
+ Object.assign(frame.style, {
106
+ inset: "0",
107
+ width: "100%",
108
+ height: "100%",
109
+ });
110
+ }
111
+ }
112
+
113
+ function mountPart(container: HTMLDivElement, part: OverlayPart): void {
114
+ if (document.getElementById(partFrameId(part))) return;
115
+ const frame = document.createElement("iframe");
116
+ frame.id = partFrameId(part);
117
+ const url = new URL(chrome.runtime.getURL("src/overlay.html"));
118
+ url.searchParams.set("part", part);
119
+ if (part === "countdown") url.searchParams.set("seconds", "3");
120
+ frame.src = url.toString();
121
+ styleFrame(frame, part);
122
+ container.appendChild(frame);
123
+ }
124
+
125
+ function reconcile(parts: OverlayPart[]): void {
126
+ const wanted = new Set(parts.filter((p) => ALL_PARTS.includes(p)));
127
+ if (wanted.size === 0) {
128
+ document.getElementById(CONTAINER_ID)?.remove();
129
+ return;
130
+ }
131
+ const container = ensureContainer();
132
+ for (const part of ALL_PARTS) {
133
+ const existing = document.getElementById(partFrameId(part));
134
+ if (wanted.has(part)) {
135
+ if (!existing) mountPart(container, part);
136
+ } else if (existing) {
137
+ existing.remove();
138
+ }
139
+ }
140
+ }
141
+
142
+ // Guard against rare double-injection (SPA soft-reloads re-running the script).
143
+ if (flags.__clipsOverlayHostReady) {
144
+ syncIfRecording();
145
+ return;
146
+ }
147
+ flags.__clipsOverlayHostReady = true;
148
+
149
+ chrome.runtime.onMessage.addListener((message) => {
150
+ if (!message || typeof message !== "object") return;
151
+ const type = (message as { type?: unknown }).type;
152
+ if (type === "CLIPS_OVERLAY_MOUNT") {
153
+ const parts = (message as { parts?: unknown }).parts;
154
+ reconcile(Array.isArray(parts) ? (parts as OverlayPart[]) : []);
155
+ } else if (type === "CLIPS_OVERLAY_UNMOUNT") {
156
+ reconcile([]);
157
+ }
158
+ });
159
+
160
+ // The toolbar overlay asks to grow/shrink its own iframe on hover (it can't
161
+ // resize itself). Only trust messages from our own extension-origin frames.
162
+ window.addEventListener("message", (event) => {
163
+ const data = event.data as
164
+ | { source?: string; kind?: string; part?: string; height?: number }
165
+ | undefined;
166
+ if (!data || data.source !== "clips-overlay" || data.kind !== "resize") {
167
+ return;
168
+ }
169
+ if (event.origin !== chrome.runtime.getURL("").replace(/\/$/, "")) return;
170
+ const part = data.part === "toolbar" ? "toolbar" : null;
171
+ if (!part || typeof data.height !== "number") return;
172
+ const frame = document.getElementById(partFrameId(part));
173
+ if (frame) frame.style.height = `${Math.round(data.height)}px`;
174
+ });
175
+
176
+ syncIfRecording();
177
+ })();