@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,32 @@
|
|
|
1
|
+
export declare const STARTER_APP_NAME = "builder-agent-native-starter";
|
|
2
|
+
export declare const CHAT_TEMPLATE = "chat";
|
|
3
|
+
type PackageJson = Record<string, unknown>;
|
|
4
|
+
export declare function findAgentNativeRoot(startDir?: string): string;
|
|
5
|
+
export declare function generateStandaloneChatManifest(repoRoot?: string): {
|
|
6
|
+
packageJson: PackageJson;
|
|
7
|
+
pnpmWorkspaceYaml: string | null;
|
|
8
|
+
};
|
|
9
|
+
export declare function mergeStarterManifest(starterPackageJson: PackageJson, canonicalPackageJson: PackageJson): PackageJson;
|
|
10
|
+
export declare function workspaceFileSyncChanged(existingWorkspace: string | null, canonicalWorkspace: string | null): boolean;
|
|
11
|
+
export declare function applyWorkspaceFileSync(targetPath: string, canonicalWorkspace: string | null): void;
|
|
12
|
+
export type SyncStarterManifestResult = {
|
|
13
|
+
changed: boolean;
|
|
14
|
+
packageJson: PackageJson;
|
|
15
|
+
pnpmWorkspaceYaml: string | null;
|
|
16
|
+
};
|
|
17
|
+
export declare function syncStarterManifestFiles(options: {
|
|
18
|
+
starterPackageJsonPath: string;
|
|
19
|
+
starterPnpmWorkspacePath?: string;
|
|
20
|
+
repoRoot?: string;
|
|
21
|
+
write?: boolean;
|
|
22
|
+
}): SyncStarterManifestResult;
|
|
23
|
+
export declare function parseSyncStarterManifestArgs(argv: string[]): {
|
|
24
|
+
command: "merge" | "generate";
|
|
25
|
+
starterPackageJsonPath?: string;
|
|
26
|
+
starterPnpmWorkspacePath?: string;
|
|
27
|
+
write: boolean;
|
|
28
|
+
repoRoot?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare function runSyncStarterManifestCli(argv: string[]): number;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=sync-builder-starter-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-builder-starter-manifest.d.ts","sourceRoot":"","sources":["../../src/cli/sync-builder-starter-manifest.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB,iCAAiC,CAAC;AAC/D,eAAO,MAAM,aAAa,SAAS,CAAC;AAEpC,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3C,wBAAgB,mBAAmB,CAAC,QAAQ,SAAgB,GAAG,MAAM,CAmBpE;AAED,wBAAgB,8BAA8B,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG;IACjE,WAAW,EAAE,WAAW,CAAC;IACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAwBA;AAED,wBAAgB,oBAAoB,CAClC,kBAAkB,EAAE,WAAW,EAC/B,oBAAoB,EAAE,WAAW,GAChC,WAAW,CA4Bb;AAED,wBAAgB,wBAAwB,CACtC,iBAAiB,EAAE,MAAM,GAAG,IAAI,EAChC,kBAAkB,EAAE,MAAM,GAAG,IAAI,GAChC,OAAO,CAKT;AAED,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,EAClB,kBAAkB,EAAE,MAAM,GAAG,IAAI,GAChC,IAAI,CAQN;AAMD,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;IACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,sBAAsB,EAAE,MAAM,CAAC;IAC/B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,yBAAyB,CA6C5B;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG;IAC5D,OAAO,EAAE,OAAO,GAAG,UAAU,CAAC;IAC9B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CA0CA;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAmChE"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { _postProcessStandalone } from "./create.js";
|
|
6
|
+
export const STARTER_APP_NAME = "builder-agent-native-starter";
|
|
7
|
+
export const CHAT_TEMPLATE = "chat";
|
|
8
|
+
export function findAgentNativeRoot(startDir = process.cwd()) {
|
|
9
|
+
let dir = path.resolve(startDir);
|
|
10
|
+
for (let i = 0; i < 12; i++) {
|
|
11
|
+
const chatPackageJson = path.join(dir, "templates", CHAT_TEMPLATE, "package.json");
|
|
12
|
+
if (fs.existsSync(chatPackageJson)) {
|
|
13
|
+
return dir;
|
|
14
|
+
}
|
|
15
|
+
const parent = path.dirname(dir);
|
|
16
|
+
if (parent === dir)
|
|
17
|
+
break;
|
|
18
|
+
dir = parent;
|
|
19
|
+
}
|
|
20
|
+
throw new Error("Could not find agent-native repo root (expected templates/chat/package.json).");
|
|
21
|
+
}
|
|
22
|
+
export function generateStandaloneChatManifest(repoRoot) {
|
|
23
|
+
const root = repoRoot ?? findAgentNativeRoot();
|
|
24
|
+
const chatTemplateDir = path.join(root, "templates", CHAT_TEMPLATE);
|
|
25
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "an-builder-starter-sync-"));
|
|
26
|
+
try {
|
|
27
|
+
fs.cpSync(chatTemplateDir, tempDir, { recursive: true });
|
|
28
|
+
_postProcessStandalone(STARTER_APP_NAME, tempDir, CHAT_TEMPLATE);
|
|
29
|
+
const packageJson = JSON.parse(fs.readFileSync(path.join(tempDir, "package.json"), "utf-8"));
|
|
30
|
+
const workspacePath = path.join(tempDir, "pnpm-workspace.yaml");
|
|
31
|
+
const pnpmWorkspaceYaml = fs.existsSync(workspacePath)
|
|
32
|
+
? fs.readFileSync(workspacePath, "utf-8")
|
|
33
|
+
: null;
|
|
34
|
+
return { packageJson, pnpmWorkspaceYaml };
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function mergeStarterManifest(starterPackageJson, canonicalPackageJson) {
|
|
41
|
+
const merged = structuredClone(canonicalPackageJson);
|
|
42
|
+
merged.name = starterPackageJson.name ?? STARTER_APP_NAME;
|
|
43
|
+
if (typeof starterPackageJson.displayName === "string") {
|
|
44
|
+
merged.displayName = starterPackageJson.displayName;
|
|
45
|
+
}
|
|
46
|
+
if (typeof starterPackageJson.description === "string") {
|
|
47
|
+
merged.description = starterPackageJson.description;
|
|
48
|
+
}
|
|
49
|
+
if (starterPackageJson.private !== undefined) {
|
|
50
|
+
merged.private = starterPackageJson.private;
|
|
51
|
+
}
|
|
52
|
+
const starterDeps = starterPackageJson.dependencies ??
|
|
53
|
+
{};
|
|
54
|
+
const canonicalDeps = canonicalPackageJson.dependencies ??
|
|
55
|
+
{};
|
|
56
|
+
merged.dependencies = {
|
|
57
|
+
...canonicalDeps,
|
|
58
|
+
...(starterDeps["@agent-native/core"]
|
|
59
|
+
? { "@agent-native/core": starterDeps["@agent-native/core"] }
|
|
60
|
+
: {}),
|
|
61
|
+
};
|
|
62
|
+
return merged;
|
|
63
|
+
}
|
|
64
|
+
export function workspaceFileSyncChanged(existingWorkspace, canonicalWorkspace) {
|
|
65
|
+
if (canonicalWorkspace === null) {
|
|
66
|
+
return existingWorkspace !== null;
|
|
67
|
+
}
|
|
68
|
+
return existingWorkspace !== canonicalWorkspace;
|
|
69
|
+
}
|
|
70
|
+
export function applyWorkspaceFileSync(targetPath, canonicalWorkspace) {
|
|
71
|
+
if (canonicalWorkspace === null) {
|
|
72
|
+
if (fs.existsSync(targetPath)) {
|
|
73
|
+
fs.unlinkSync(targetPath);
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
fs.writeFileSync(targetPath, canonicalWorkspace);
|
|
78
|
+
}
|
|
79
|
+
function stableJson(value) {
|
|
80
|
+
return `${JSON.stringify(value, null, 2)}\n`;
|
|
81
|
+
}
|
|
82
|
+
export function syncStarterManifestFiles(options) {
|
|
83
|
+
const { packageJson: canonical, pnpmWorkspaceYaml } = generateStandaloneChatManifest(options.repoRoot);
|
|
84
|
+
const starterPackageJson = JSON.parse(fs.readFileSync(options.starterPackageJsonPath, "utf-8"));
|
|
85
|
+
const mergedPackageJson = mergeStarterManifest(starterPackageJson, canonical);
|
|
86
|
+
let workspaceChanged = false;
|
|
87
|
+
const existingWorkspace = options.starterPnpmWorkspacePath &&
|
|
88
|
+
fs.existsSync(options.starterPnpmWorkspacePath)
|
|
89
|
+
? fs.readFileSync(options.starterPnpmWorkspacePath, "utf-8")
|
|
90
|
+
: null;
|
|
91
|
+
workspaceChanged = workspaceFileSyncChanged(existingWorkspace, pnpmWorkspaceYaml);
|
|
92
|
+
const packageChanged = stableJson(starterPackageJson) !== stableJson(mergedPackageJson);
|
|
93
|
+
const changed = packageChanged || workspaceChanged;
|
|
94
|
+
if (options.write && changed) {
|
|
95
|
+
if (packageChanged) {
|
|
96
|
+
fs.writeFileSync(options.starterPackageJsonPath, stableJson(mergedPackageJson));
|
|
97
|
+
}
|
|
98
|
+
if (workspaceChanged && options.starterPnpmWorkspacePath) {
|
|
99
|
+
applyWorkspaceFileSync(options.starterPnpmWorkspacePath, pnpmWorkspaceYaml);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
changed,
|
|
104
|
+
packageJson: mergedPackageJson,
|
|
105
|
+
pnpmWorkspaceYaml,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export function parseSyncStarterManifestArgs(argv) {
|
|
109
|
+
const [commandRaw, ...rest] = argv;
|
|
110
|
+
const command = commandRaw === "generate" ? "generate" : "merge";
|
|
111
|
+
let starterPackageJsonPath;
|
|
112
|
+
let starterPnpmWorkspacePath;
|
|
113
|
+
let write = false;
|
|
114
|
+
let repoRoot;
|
|
115
|
+
for (let i = 0; i < rest.length; i++) {
|
|
116
|
+
const arg = rest[i];
|
|
117
|
+
if (arg === "--write") {
|
|
118
|
+
write = true;
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
if (arg === "--starter-package-json") {
|
|
122
|
+
starterPackageJsonPath = rest[++i];
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (arg === "--starter-pnpm-workspace") {
|
|
126
|
+
starterPnpmWorkspacePath = rest[++i];
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
if (arg === "--repo-root") {
|
|
130
|
+
repoRoot = rest[++i];
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
throw new Error(`Unknown argument: ${arg}`);
|
|
134
|
+
}
|
|
135
|
+
if (command === "merge" && !starterPackageJsonPath) {
|
|
136
|
+
throw new Error("merge requires --starter-package-json <path> [--starter-pnpm-workspace <path>] [--write] [--repo-root <path>]");
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
command,
|
|
140
|
+
starterPackageJsonPath,
|
|
141
|
+
starterPnpmWorkspacePath,
|
|
142
|
+
write,
|
|
143
|
+
repoRoot,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export function runSyncStarterManifestCli(argv) {
|
|
147
|
+
const args = parseSyncStarterManifestArgs(argv);
|
|
148
|
+
if (args.command === "generate") {
|
|
149
|
+
const { packageJson, pnpmWorkspaceYaml } = generateStandaloneChatManifest(args.repoRoot);
|
|
150
|
+
process.stdout.write(stableJson(packageJson));
|
|
151
|
+
if (pnpmWorkspaceYaml) {
|
|
152
|
+
process.stdout.write("\n--- pnpm-workspace.yaml ---\n");
|
|
153
|
+
process.stdout.write(pnpmWorkspaceYaml);
|
|
154
|
+
}
|
|
155
|
+
return 0;
|
|
156
|
+
}
|
|
157
|
+
const result = syncStarterManifestFiles({
|
|
158
|
+
starterPackageJsonPath: args.starterPackageJsonPath,
|
|
159
|
+
starterPnpmWorkspacePath: args.starterPnpmWorkspacePath,
|
|
160
|
+
repoRoot: args.repoRoot,
|
|
161
|
+
write: args.write,
|
|
162
|
+
});
|
|
163
|
+
if (result.changed) {
|
|
164
|
+
console.log(args.write
|
|
165
|
+
? "Updated builder-agent-native-starter manifest from templates/chat."
|
|
166
|
+
: "builder-agent-native-starter manifest is out of date with templates/chat.");
|
|
167
|
+
return args.write ? 0 : 1;
|
|
168
|
+
}
|
|
169
|
+
console.log("builder-agent-native-starter manifest already matches templates/chat.");
|
|
170
|
+
return 0;
|
|
171
|
+
}
|
|
172
|
+
const isDirectRun = process.argv[1] &&
|
|
173
|
+
path.resolve(process.argv[1]) ===
|
|
174
|
+
path.resolve(fileURLToPath(import.meta.url));
|
|
175
|
+
if (isDirectRun) {
|
|
176
|
+
const exitCode = runSyncStarterManifestCli(process.argv.slice(2));
|
|
177
|
+
process.exit(exitCode);
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=sync-builder-starter-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-builder-starter-manifest.js","source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,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjD,IAAI,WAAW,EAAE,CAAC;IAChB,MAAM,QAAQ,GAAG,yBAAyB,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAClE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { _postProcessStandalone } from \"./create.js\";\n\nexport const STARTER_APP_NAME = \"builder-agent-native-starter\";\nexport const CHAT_TEMPLATE = \"chat\";\n\ntype PackageJson = Record<string, unknown>;\n\nexport function findAgentNativeRoot(startDir = process.cwd()): string {\n let dir = path.resolve(startDir);\n for (let i = 0; i < 12; i++) {\n const chatPackageJson = path.join(\n dir,\n \"templates\",\n CHAT_TEMPLATE,\n \"package.json\",\n );\n if (fs.existsSync(chatPackageJson)) {\n return dir;\n }\n const parent = path.dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n throw new Error(\n \"Could not find agent-native repo root (expected templates/chat/package.json).\",\n );\n}\n\nexport function generateStandaloneChatManifest(repoRoot?: string): {\n packageJson: PackageJson;\n pnpmWorkspaceYaml: string | null;\n} {\n const root = repoRoot ?? findAgentNativeRoot();\n const chatTemplateDir = path.join(root, \"templates\", CHAT_TEMPLATE);\n const tempDir = fs.mkdtempSync(\n path.join(os.tmpdir(), \"an-builder-starter-sync-\"),\n );\n\n try {\n fs.cpSync(chatTemplateDir, tempDir, { recursive: true });\n _postProcessStandalone(STARTER_APP_NAME, tempDir, CHAT_TEMPLATE);\n\n const packageJson = JSON.parse(\n fs.readFileSync(path.join(tempDir, \"package.json\"), \"utf-8\"),\n ) as PackageJson;\n\n const workspacePath = path.join(tempDir, \"pnpm-workspace.yaml\");\n const pnpmWorkspaceYaml = fs.existsSync(workspacePath)\n ? fs.readFileSync(workspacePath, \"utf-8\")\n : null;\n\n return { packageJson, pnpmWorkspaceYaml };\n } finally {\n fs.rmSync(tempDir, { recursive: true, force: true });\n }\n}\n\nexport function mergeStarterManifest(\n starterPackageJson: PackageJson,\n canonicalPackageJson: PackageJson,\n): PackageJson {\n const merged = structuredClone(canonicalPackageJson) as PackageJson;\n\n merged.name = starterPackageJson.name ?? STARTER_APP_NAME;\n if (typeof starterPackageJson.displayName === \"string\") {\n merged.displayName = starterPackageJson.displayName;\n }\n if (typeof starterPackageJson.description === \"string\") {\n merged.description = starterPackageJson.description;\n }\n if (starterPackageJson.private !== undefined) {\n merged.private = starterPackageJson.private;\n }\n\n const starterDeps =\n (starterPackageJson.dependencies as Record<string, string> | undefined) ??\n {};\n const canonicalDeps =\n (canonicalPackageJson.dependencies as Record<string, string> | undefined) ??\n {};\n merged.dependencies = {\n ...canonicalDeps,\n ...(starterDeps[\"@agent-native/core\"]\n ? { \"@agent-native/core\": starterDeps[\"@agent-native/core\"] }\n : {}),\n };\n\n return merged;\n}\n\nexport function workspaceFileSyncChanged(\n existingWorkspace: string | null,\n canonicalWorkspace: string | null,\n): boolean {\n if (canonicalWorkspace === null) {\n return existingWorkspace !== null;\n }\n return existingWorkspace !== canonicalWorkspace;\n}\n\nexport function applyWorkspaceFileSync(\n targetPath: string,\n canonicalWorkspace: string | null,\n): void {\n if (canonicalWorkspace === null) {\n if (fs.existsSync(targetPath)) {\n fs.unlinkSync(targetPath);\n }\n return;\n }\n fs.writeFileSync(targetPath, canonicalWorkspace);\n}\n\nfunction stableJson(value: unknown): string {\n return `${JSON.stringify(value, null, 2)}\\n`;\n}\n\nexport type SyncStarterManifestResult = {\n changed: boolean;\n packageJson: PackageJson;\n pnpmWorkspaceYaml: string | null;\n};\n\nexport function syncStarterManifestFiles(options: {\n starterPackageJsonPath: string;\n starterPnpmWorkspacePath?: string;\n repoRoot?: string;\n write?: boolean;\n}): SyncStarterManifestResult {\n const { packageJson: canonical, pnpmWorkspaceYaml } =\n generateStandaloneChatManifest(options.repoRoot);\n\n const starterPackageJson = JSON.parse(\n fs.readFileSync(options.starterPackageJsonPath, \"utf-8\"),\n ) as PackageJson;\n const mergedPackageJson = mergeStarterManifest(starterPackageJson, canonical);\n\n let workspaceChanged = false;\n const existingWorkspace =\n options.starterPnpmWorkspacePath &&\n fs.existsSync(options.starterPnpmWorkspacePath)\n ? fs.readFileSync(options.starterPnpmWorkspacePath, \"utf-8\")\n : null;\n\n workspaceChanged = workspaceFileSyncChanged(\n existingWorkspace,\n pnpmWorkspaceYaml,\n );\n\n const packageChanged =\n stableJson(starterPackageJson) !== stableJson(mergedPackageJson);\n const changed = packageChanged || workspaceChanged;\n\n if (options.write && changed) {\n if (packageChanged) {\n fs.writeFileSync(\n options.starterPackageJsonPath,\n stableJson(mergedPackageJson),\n );\n }\n if (workspaceChanged && options.starterPnpmWorkspacePath) {\n applyWorkspaceFileSync(\n options.starterPnpmWorkspacePath,\n pnpmWorkspaceYaml,\n );\n }\n }\n\n return {\n changed,\n packageJson: mergedPackageJson,\n pnpmWorkspaceYaml,\n };\n}\n\nexport function parseSyncStarterManifestArgs(argv: string[]): {\n command: \"merge\" | \"generate\";\n starterPackageJsonPath?: string;\n starterPnpmWorkspacePath?: string;\n write: boolean;\n repoRoot?: string;\n} {\n const [commandRaw, ...rest] = argv;\n const command = commandRaw === \"generate\" ? \"generate\" : \"merge\";\n let starterPackageJsonPath: string | undefined;\n let starterPnpmWorkspacePath: string | undefined;\n let write = false;\n let repoRoot: string | undefined;\n\n for (let i = 0; i < rest.length; i++) {\n const arg = rest[i];\n if (arg === \"--write\") {\n write = true;\n continue;\n }\n if (arg === \"--starter-package-json\") {\n starterPackageJsonPath = rest[++i];\n continue;\n }\n if (arg === \"--starter-pnpm-workspace\") {\n starterPnpmWorkspacePath = rest[++i];\n continue;\n }\n if (arg === \"--repo-root\") {\n repoRoot = rest[++i];\n continue;\n }\n throw new Error(`Unknown argument: ${arg}`);\n }\n\n if (command === \"merge\" && !starterPackageJsonPath) {\n throw new Error(\n \"merge requires --starter-package-json <path> [--starter-pnpm-workspace <path>] [--write] [--repo-root <path>]\",\n );\n }\n\n return {\n command,\n starterPackageJsonPath,\n starterPnpmWorkspacePath,\n write,\n repoRoot,\n };\n}\n\nexport function runSyncStarterManifestCli(argv: string[]): number {\n const args = parseSyncStarterManifestArgs(argv);\n\n if (args.command === \"generate\") {\n const { packageJson, pnpmWorkspaceYaml } = generateStandaloneChatManifest(\n args.repoRoot,\n );\n process.stdout.write(stableJson(packageJson));\n if (pnpmWorkspaceYaml) {\n process.stdout.write(\"\\n--- pnpm-workspace.yaml ---\\n\");\n process.stdout.write(pnpmWorkspaceYaml);\n }\n return 0;\n }\n\n const result = syncStarterManifestFiles({\n starterPackageJsonPath: args.starterPackageJsonPath!,\n starterPnpmWorkspacePath: args.starterPnpmWorkspacePath,\n repoRoot: args.repoRoot,\n write: args.write,\n });\n\n if (result.changed) {\n console.log(\n args.write\n ? \"Updated builder-agent-native-starter manifest from templates/chat.\"\n : \"builder-agent-native-starter manifest is out of date with templates/chat.\",\n );\n return args.write ? 0 : 1;\n }\n\n console.log(\n \"builder-agent-native-starter manifest already matches templates/chat.\",\n );\n return 0;\n}\n\nconst isDirectRun =\n process.argv[1] &&\n path.resolve(process.argv[1]) ===\n path.resolve(fileURLToPath(import.meta.url));\n\nif (isDirectRun) {\n const exitCode = runSyncStarterManifestCli(process.argv.slice(2));\n process.exit(exitCode);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentPanel.d.ts","sourceRoot":"","sources":["../../src/client/AgentPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KASN,MAAM,OAAO,CAAC;AA6Cf,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"AgentPanel.d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=> import("./onboarding/SetupButton.js").then((m) => ({
|
|
76
76
|
default: m.SetupButton,
|
|
77
77
|
})));
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
|
|
78
|
+
// The setup/onboarding checklist that used to appear above chat is disabled
|
|
79
|
+
// for every app — setup (AI engine, image/video gen, asset storage, email,
|
|
80
|
+
// GitHub, etc.) is surfaced in better places (the settings panel and the
|
|
81
|
+
// per-feature setup affordances). Keep this off; do not re-enable globally.
|
|
82
|
+
const SHOW_ONBOARDING = false;
|
|
81
83
|
const CLI_STORAGE_KEY = "agent-native-cli-command";
|
|
82
84
|
const CLI_DEFAULT = "claude";
|
|
83
85
|
const EXEC_MODE_KEY = "agent-native-exec-mode";
|