@agent-native/core 0.70.0 → 0.70.2
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 +15 -15
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +67 -0
- package/corpus/core/docs/design/durable-agent-runs.md +217 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/action.ts +89 -0
- package/corpus/core/src/agent/model-config.ts +0 -2
- package/corpus/core/src/agent/run-loop-with-resume.ts +48 -0
- package/corpus/core/src/cli/skills.ts +2 -2
- package/corpus/core/src/cli/sync-builder-starter-manifest.ts +275 -0
- package/corpus/core/src/client/AgentPanel.tsx +5 -3
- package/corpus/core/src/client/AssistantChat.tsx +8 -0
- package/corpus/core/src/client/client-surface.ts +41 -0
- package/corpus/core/src/client/composer/TiptapComposer.tsx +123 -12
- package/corpus/core/src/client/feedback-context.ts +4 -0
- package/corpus/core/src/client/index.ts +1 -0
- package/corpus/core/src/client/sse-event-processor.ts +7 -1
- package/corpus/core/src/mcp/build-server.ts +57 -1
- package/corpus/core/src/mcp/embed-app.ts +86 -2
- package/corpus/core/src/mcp/oauth-route.ts +109 -13
- package/corpus/core/src/server/core-routes-plugin.ts +78 -0
- package/corpus/core/src/server/onboarding-html.ts +35 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +72 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +22 -0
- package/corpus/templates/analytics/AGENTS.md +8 -1
- package/corpus/templates/analytics/actions/install-dashboard-template.ts +97 -2
- package/corpus/templates/analytics/actions/update-dashboard.ts +36 -7
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +30 -3
- package/corpus/templates/analytics/app/components/layout/Header.tsx +0 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +2 -4
- package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +0 -3
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +32 -2
- package/corpus/templates/analytics/changelog/2026-06-23-long-dashboard-and-analysis-names-in-the-sidebar-now-truncat.md +6 -0
- package/corpus/templates/analytics/changelog/2026-06-23-open-any-dashboard-chart-full-screen-in-a-modal-from-the-pan.md +6 -0
- package/corpus/templates/assets/actions/generate-image.ts +24 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +2 -2
- package/corpus/templates/assets/app/global.css +17 -1
- package/corpus/templates/assets/app/routes/_index.tsx +94 -14
- package/corpus/templates/assets/changelog/2026-06-23-chat-dates-in-the-sidebar-no-longer-wrap-onto-two-lines.md +6 -0
- package/corpus/templates/assets/changelog/2026-06-23-clicking-image-video-or-refine-on-the-start-screen-now-drops.md +6 -0
- package/corpus/templates/assets/changelog/2026-06-23-pick-your-image-generation-model-right-from-the-chat-model-m.md +6 -0
- package/corpus/templates/clips/app/components/library/library-grid.tsx +1 -20
- package/corpus/templates/clips/app/components/recorder/countdown-overlay.tsx +72 -48
- package/corpus/templates/clips/app/lib/countdown-audio-cue.ts +35 -17
- package/corpus/templates/clips/changelog/2026-06-23-removed-select-button-from-library-hover-a-clip-to-select-it.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-shared-video-links-now-play-for-anyone-without-signing-in.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-skip-or-cancel-the-recording-countdown-with-buttons-beside-t.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-the-desktop-camera-bubble-now-looks-sharp-the-instant-it-ope.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-the-desktop-recording-widget-now-grows-downward-only-when-yo.md +6 -0
- package/corpus/templates/clips/changelog/2026-06-23-the-recording-start-sound-is-now-a-softer-more-modern-chime.md +6 -0
- package/corpus/templates/clips/chrome-extension/public/manifest.json +17 -8
- package/corpus/templates/clips/chrome-extension/src/background.ts +769 -180
- package/corpus/templates/clips/chrome-extension/src/content-script.ts +177 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +466 -329
- package/corpus/templates/clips/chrome-extension/src/overlay.css +377 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.html +12 -0
- package/corpus/templates/clips/chrome-extension/src/overlay.ts +330 -0
- package/corpus/templates/clips/chrome-extension/src/permission.html +227 -0
- package/corpus/templates/clips/chrome-extension/src/permission.ts +105 -0
- package/corpus/templates/clips/chrome-extension/src/popup.html +3 -0
- package/corpus/templates/clips/chrome-extension/src/popup.ts +50 -2
- package/corpus/templates/clips/chrome-extension/src/styles.css +50 -0
- package/corpus/templates/clips/chrome-extension/vite.config.ts +3 -0
- package/corpus/templates/clips/desktop/src/lib/audio-cue.ts +41 -24
- package/corpus/templates/clips/desktop/src/lib/bubble-webrtc.ts +119 -2
- package/corpus/templates/clips/desktop/src/overlays/countdown.tsx +21 -2
- package/corpus/templates/clips/desktop/src/styles.css +70 -2
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +73 -0
- package/corpus/templates/clips/server/routes/api/video/[recordingId].get.ts +34 -5
- package/corpus/templates/content/AGENTS.md +20 -3
- package/corpus/templates/content/actions/_database-utils.ts +15 -0
- package/corpus/templates/content/actions/_property-utils.ts +371 -4
- package/corpus/templates/content/actions/configure-document-property.ts +35 -1
- package/corpus/templates/content/actions/create-content-database.ts +5 -1
- package/corpus/templates/content/actions/delete-document-property.ts +52 -2
- package/corpus/templates/content/actions/duplicate-document-property.ts +34 -17
- package/corpus/templates/content/actions/reorder-document-property.ts +79 -0
- package/corpus/templates/content/actions/set-document-property.ts +39 -0
- package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +806 -0
- package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +226 -68
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +59 -30
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +25 -1
- package/corpus/templates/content/app/components/editor/blockFieldSaveController.ts +180 -0
- package/corpus/templates/content/app/components/editor/blockFieldSaveRegistry.ts +179 -0
- package/corpus/templates/content/app/components/editor/previewDocumentSaveController.ts +244 -0
- package/corpus/templates/content/app/components/editor/previewDocumentSaveRegistry.ts +132 -0
- package/corpus/templates/content/app/global.css +9 -0
- package/corpus/templates/content/app/hooks/use-document-properties.ts +21 -0
- package/corpus/templates/content/server/db/schema.ts +30 -0
- package/corpus/templates/content/server/plugins/db.ts +87 -0
- package/corpus/templates/content/shared/api.ts +7 -0
- package/corpus/templates/content/shared/properties.ts +109 -0
- package/corpus/templates/forms/.agents/skills/form-responses/SKILL.md +10 -0
- package/corpus/templates/forms/actions/export-responses.ts +6 -0
- package/corpus/templates/forms/actions/list-responses.ts +2 -0
- package/corpus/templates/forms/actions/response-insights.ts +2 -0
- package/corpus/templates/forms/app/pages/ResponsesPage.tsx +138 -1
- package/corpus/templates/forms/changelog/2026-06-23-response-tables-now-show-the-page-each-submission-came-from-.md +6 -0
- package/corpus/templates/forms/changelog/2026-06-23-response-tables-now-show-whether-feedback-came-from-the-web-.md +6 -0
- package/corpus/templates/forms/server/db/schema.ts +7 -0
- package/corpus/templates/forms/server/handlers/submissions.ts +19 -2
- package/corpus/templates/forms/server/lib/integrations.ts +76 -2
- package/corpus/templates/forms/server/plugins/db.ts +20 -0
- package/corpus/templates/forms/shared/types.ts +12 -0
- package/corpus/templates/plan/app/components/plan/wireframe/html-artboard.css +3 -1
- package/corpus/templates/plan/changelog/2026-06-23-large-diagrams-in-a-plan-now-scroll-within-their-block-inste.md +6 -0
- package/dist/action.js +87 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/engine/builder-engine.d.ts +1 -1
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/model-config.d.ts +2 -2
- package/dist/agent/model-config.d.ts.map +1 -1
- package/dist/agent/model-config.js +0 -2
- package/dist/agent/model-config.js.map +1 -1
- package/dist/agent/run-loop-with-resume.d.ts +13 -0
- package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
- package/dist/agent/run-loop-with-resume.js +44 -0
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/cli/skills.js +2 -2
- package/dist/cli/skills.js.map +1 -1
- package/dist/cli/sync-builder-starter-manifest.d.ts +32 -0
- package/dist/cli/sync-builder-starter-manifest.d.ts.map +1 -0
- package/dist/cli/sync-builder-starter-manifest.js +179 -0
- package/dist/cli/sync-builder-starter-manifest.js.map +1 -0
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +5 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +6 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +2 -2
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/client-surface.d.ts +17 -0
- package/dist/client/client-surface.d.ts.map +1 -0
- package/dist/client/client-surface.js +24 -0
- package/dist/client/client-surface.js.map +1 -0
- package/dist/client/composer/TiptapComposer.d.ts +26 -1
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +27 -5
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/feedback-context.d.ts +3 -0
- package/dist/client/feedback-context.d.ts.map +1 -1
- package/dist/client/feedback-context.js +2 -0
- package/dist/client/feedback-context.js.map +1 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +7 -1
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/mcp/build-server.d.ts +21 -0
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +43 -1
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/mcp/embed-app.d.ts.map +1 -1
- package/dist/mcp/embed-app.js +86 -2
- package/dist/mcp/embed-app.js.map +1 -1
- package/dist/mcp/oauth-route.d.ts.map +1 -1
- package/dist/mcp/oauth-route.js +95 -12
- package/dist/mcp/oauth-route.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +63 -0
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/onboarding-html.d.ts.map +1 -1
- package/dist/server/onboarding-html.js +35 -0
- package/dist/server/onboarding-html.js.map +1 -1
- package/dist/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +72 -0
- package/docs/design/durable-agent-runs.md +217 -0
- package/package.json +1 -1
- package/src/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +72 -0
- package/corpus/templates/analytics/app/pages/About.tsx +0 -108
- package/corpus/templates/analytics/app/routes/about.tsx +0 -9
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { defineAction } from "@agent-native/core";
|
|
2
|
+
import { writeAppState } from "@agent-native/core/application-state";
|
|
3
|
+
import { assertAccess } from "@agent-native/core/sharing";
|
|
4
|
+
import { and, asc, eq } from "drizzle-orm";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { getDb, schema } from "../server/db/index.js";
|
|
7
|
+
import {
|
|
8
|
+
listPropertiesForDocument,
|
|
9
|
+
resolvePropertyDatabaseForDocument,
|
|
10
|
+
} from "./_property-utils.js";
|
|
11
|
+
|
|
12
|
+
export default defineAction({
|
|
13
|
+
description:
|
|
14
|
+
"Reorder a property definition within its database by moving it before or after another property. Used for reordering Blocks fields on the page.",
|
|
15
|
+
schema: z.object({
|
|
16
|
+
documentId: z.string().describe("Document ID used to scope access"),
|
|
17
|
+
propertyId: z.string().describe("Property definition ID to move"),
|
|
18
|
+
targetPropertyId: z.string().describe("Property to position relative to"),
|
|
19
|
+
position: z
|
|
20
|
+
.enum(["before", "after"])
|
|
21
|
+
.default("before")
|
|
22
|
+
.describe("Place the moved property before or after the target"),
|
|
23
|
+
}),
|
|
24
|
+
run: async ({ documentId, propertyId, targetPropertyId, position }) => {
|
|
25
|
+
const access = await assertAccess("document", documentId, "editor");
|
|
26
|
+
const document = access.resource;
|
|
27
|
+
const db = getDb();
|
|
28
|
+
const database = await resolvePropertyDatabaseForDocument(document);
|
|
29
|
+
if (!database) throw new Error("Document is not part of a database.");
|
|
30
|
+
|
|
31
|
+
const definitions = await db
|
|
32
|
+
.select()
|
|
33
|
+
.from(schema.documentPropertyDefinitions)
|
|
34
|
+
.where(eq(schema.documentPropertyDefinitions.databaseId, database.id))
|
|
35
|
+
.orderBy(asc(schema.documentPropertyDefinitions.position));
|
|
36
|
+
|
|
37
|
+
const ids = definitions.map((definition) => definition.id);
|
|
38
|
+
if (!ids.includes(propertyId)) {
|
|
39
|
+
throw new Error(`Property "${propertyId}" not found`);
|
|
40
|
+
}
|
|
41
|
+
if (!ids.includes(targetPropertyId)) {
|
|
42
|
+
throw new Error(`Property "${targetPropertyId}" not found`);
|
|
43
|
+
}
|
|
44
|
+
if (propertyId === targetPropertyId) {
|
|
45
|
+
return {
|
|
46
|
+
documentId,
|
|
47
|
+
databaseId: database.id,
|
|
48
|
+
properties: await listPropertiesForDocument(document),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Rebuild the order with the moved property re-inserted relative to target.
|
|
53
|
+
const remaining = ids.filter((id) => id !== propertyId);
|
|
54
|
+
const targetIndex = remaining.indexOf(targetPropertyId);
|
|
55
|
+
const insertAt = position === "after" ? targetIndex + 1 : targetIndex;
|
|
56
|
+
remaining.splice(insertAt, 0, propertyId);
|
|
57
|
+
|
|
58
|
+
const now = new Date().toISOString();
|
|
59
|
+
for (let index = 0; index < remaining.length; index += 1) {
|
|
60
|
+
await db
|
|
61
|
+
.update(schema.documentPropertyDefinitions)
|
|
62
|
+
.set({ position: index, updatedAt: now })
|
|
63
|
+
.where(
|
|
64
|
+
and(
|
|
65
|
+
eq(schema.documentPropertyDefinitions.id, remaining[index]),
|
|
66
|
+
eq(schema.documentPropertyDefinitions.databaseId, database.id),
|
|
67
|
+
),
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
await writeAppState("refresh-signal", { ts: Date.now() });
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
documentId,
|
|
75
|
+
databaseId: database.id,
|
|
76
|
+
properties: await listPropertiesForDocument(document),
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
});
|
|
@@ -5,7 +5,11 @@ import { and, eq } from "drizzle-orm";
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { getDb, schema } from "../server/db/index.js";
|
|
7
7
|
import {
|
|
8
|
+
blocksStorageTarget,
|
|
9
|
+
isBlocksPropertyType,
|
|
8
10
|
isComputedPropertyType,
|
|
11
|
+
normalizePropertyValue,
|
|
12
|
+
parsePropertyOptions,
|
|
9
13
|
type DocumentPropertyType,
|
|
10
14
|
} from "../shared/properties.js";
|
|
11
15
|
import {
|
|
@@ -13,6 +17,8 @@ import {
|
|
|
13
17
|
nanoid,
|
|
14
18
|
normalizedValueJson,
|
|
15
19
|
resolvePropertyDatabaseForDocument,
|
|
20
|
+
writeBlockFieldContent,
|
|
21
|
+
writePrimaryBlocksContent,
|
|
16
22
|
} from "./_property-utils.js";
|
|
17
23
|
|
|
18
24
|
export default defineAction({
|
|
@@ -50,6 +56,39 @@ export default defineAction({
|
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
const now = new Date().toISOString();
|
|
59
|
+
|
|
60
|
+
// Blocks fields store rich-text content, not a property-values row. The
|
|
61
|
+
// primary "Content" field writes to the document body; additional Blocks
|
|
62
|
+
// fields write to their own independent store.
|
|
63
|
+
if (isBlocksPropertyType(type)) {
|
|
64
|
+
const normalized = normalizePropertyValue(type, value);
|
|
65
|
+
const content = typeof normalized === "string" ? normalized : "";
|
|
66
|
+
const target = blocksStorageTarget(
|
|
67
|
+
parsePropertyOptions(definition.optionsJson),
|
|
68
|
+
);
|
|
69
|
+
if (target === "document_body") {
|
|
70
|
+
await writePrimaryBlocksContent({ documentId, content, now });
|
|
71
|
+
} else {
|
|
72
|
+
await writeBlockFieldContent({
|
|
73
|
+
documentId,
|
|
74
|
+
propertyId,
|
|
75
|
+
ownerEmail: document.ownerEmail,
|
|
76
|
+
content,
|
|
77
|
+
now,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
await writeAppState("refresh-signal", { ts: Date.now() });
|
|
81
|
+
return {
|
|
82
|
+
documentId,
|
|
83
|
+
databaseId: database.id,
|
|
84
|
+
properties: await listPropertiesForDocument({
|
|
85
|
+
...document,
|
|
86
|
+
content: target === "document_body" ? content : document.content,
|
|
87
|
+
updatedAt: now,
|
|
88
|
+
}),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
53
92
|
const valueJson = normalizedValueJson(type, value);
|
|
54
93
|
const [existing] = await db
|
|
55
94
|
.select({ id: schema.documentPropertyValues.id })
|