@agent-native/core 0.198.7-nightly-20260930213124 → 0.198.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/production-agent.js +11 -3
- package/dist/automation/index.d.ts +1 -1
- package/dist/cli/create.js +16 -0
- package/dist/cli/skills-content/design-visual-edit-skill.d.ts +1 -1
- package/dist/cli/skills-content/design-visual-edit-skill.js +8 -7
- package/dist/client/use-agent-engine-configured.js +5 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +3 -3
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +8 -8
- package/dist/progress/routes.d.ts +1 -1
- package/dist/secrets/routes.d.ts +4 -4
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-engine-default-model-route.d.ts +2 -2
- package/dist/server/agent-engine-ollama-models-route.d.ts +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/templates/chat/CHANGELOG.md +6 -0
- package/dist/templates/chat/changelog/2026-09-30-compact-composer-context-menus.md +6 -0
- package/dist/templates/workspace-root/package.json +1 -0
- package/package.json +4 -4
- package/src/templates/chat/CHANGELOG.md +6 -0
- package/src/templates/chat/changelog/2026-09-30-compact-composer-context-menus.md +6 -0
- package/src/templates/workspace-root/package.json +1 -0
|
@@ -2612,8 +2612,16 @@ export function normalizeToolErrorForBreaker(error) {
|
|
|
2612
2612
|
.replace(/\s+/g, " ")
|
|
2613
2613
|
.trim());
|
|
2614
2614
|
}
|
|
2615
|
-
function rateLimitRecoveryHint(message) {
|
|
2616
|
-
|
|
2615
|
+
function rateLimitRecoveryHint(message, error) {
|
|
2616
|
+
const statusCode = typeof error === "object" && error !== null && "statusCode" in error
|
|
2617
|
+
? error.statusCode
|
|
2618
|
+
: undefined;
|
|
2619
|
+
const errorCode = typeof error === "object" && error !== null && "errorCode" in error
|
|
2620
|
+
? error.errorCode
|
|
2621
|
+
: undefined;
|
|
2622
|
+
if (statusCode !== 429 &&
|
|
2623
|
+
!/\b(?:429|rate[-\s]?limit|rate limited|quota exceeded|too many requests|calls limit exceeded)\b/i.test(message) &&
|
|
2624
|
+
!(typeof errorCode === "string" && /rate[-_]?limit|quota/i.test(errorCode))) {
|
|
2617
2625
|
return "";
|
|
2618
2626
|
}
|
|
2619
2627
|
return "\n\nProvider rate-limit guidance: stop retrying this provider in this turn. Report the rate limit as a coverage gap, include any evidence already gathered, and ask the user to retry after the provider quota resets if full coverage is required.";
|
|
@@ -4995,7 +5003,7 @@ export async function runAgentLoop(opts) {
|
|
|
4995
5003
|
const errorCode = isActionContractError(err) && err.errorCode !== "action_failed"
|
|
4996
5004
|
? ` (errorCode: ${err.errorCode})`
|
|
4997
5005
|
: "";
|
|
4998
|
-
result = `Error running ${toolCall.name}: ${message}${errorCode}${rateLimitRecoveryHint(message)}`;
|
|
5006
|
+
result = `Error running ${toolCall.name}: ${message}${errorCode}${rateLimitRecoveryHint(message, err)}`;
|
|
4999
5007
|
}
|
|
5000
5008
|
isError = true;
|
|
5001
5009
|
}
|
|
@@ -139,8 +139,8 @@ export declare function createAutomationCallbackHandler(runtime: AutomationRunti
|
|
|
139
139
|
duplicate?: undefined;
|
|
140
140
|
eventId?: undefined;
|
|
141
141
|
} | {
|
|
142
|
+
error?: undefined;
|
|
142
143
|
accepted: boolean;
|
|
143
144
|
duplicate: boolean;
|
|
144
145
|
eventId: string;
|
|
145
|
-
error?: undefined;
|
|
146
146
|
}>;
|
package/dist/cli/create.js
CHANGED
|
@@ -15,6 +15,7 @@ const REPO = "BuilderIO/agent-native";
|
|
|
15
15
|
const TEMPLATES_DIR = "templates";
|
|
16
16
|
const PGLITE_DEPENDENCY_VERSION = "^0.5.8";
|
|
17
17
|
const POSTGRES_DEPENDENCY_VERSION = "^3.4.9";
|
|
18
|
+
const DRIZZLE_DEPENDENCY_VERSION = "^0.45.3";
|
|
18
19
|
const STANDALONE_EXACT_DEPENDENCY_OVERRIDES = {
|
|
19
20
|
"@react-router/dev": "8.1.0",
|
|
20
21
|
"@react-router/fs-routes": "8.1.0",
|
|
@@ -807,6 +808,7 @@ async function scaffoldOneAppIntoWorkspace(workspace, appName, templateName, cla
|
|
|
807
808
|
const workspaceOverrides = prepareWorkspaceOverrides(workspace.workspaceRoot);
|
|
808
809
|
await scaffoldRequiredPackages([templateName], workspace.workspaceRoot);
|
|
809
810
|
applyLocalWorkspaceOverrides(workspace.workspaceRoot, workspaceOverrides);
|
|
811
|
+
ensureWorkspaceDrizzleDependency(workspace.workspaceRoot);
|
|
810
812
|
s.stop(`Scaffolded apps/${appName}.`);
|
|
811
813
|
}
|
|
812
814
|
catch (err) {
|
|
@@ -1411,6 +1413,19 @@ function resolvePublishedWorkspaceSpecifier(packageName, workspaceSpecifier) {
|
|
|
1411
1413
|
return "*";
|
|
1412
1414
|
}
|
|
1413
1415
|
}
|
|
1416
|
+
function ensureWorkspaceDrizzleDependency(workspaceRoot) {
|
|
1417
|
+
const packageJsonPath = path.join(workspaceRoot, "package.json");
|
|
1418
|
+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
1419
|
+
if (!pkg || typeof pkg !== "object" || Array.isArray(pkg)) {
|
|
1420
|
+
throw new Error(`${packageJsonPath} must contain a JSON object`);
|
|
1421
|
+
}
|
|
1422
|
+
pkg.dependencies ??= {};
|
|
1423
|
+
if (typeof pkg.dependencies !== "object" || Array.isArray(pkg.dependencies)) {
|
|
1424
|
+
throw new Error(`${packageJsonPath} has an invalid dependencies object`);
|
|
1425
|
+
}
|
|
1426
|
+
pkg.dependencies["drizzle-orm"] ??= DRIZZLE_DEPENDENCY_VERSION;
|
|
1427
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
1428
|
+
}
|
|
1414
1429
|
async function scaffoldRequiredPackages(templateNames, workspaceRoot) {
|
|
1415
1430
|
const needed = new Set();
|
|
1416
1431
|
for (const t of templateNames) {
|
|
@@ -1624,6 +1639,7 @@ function postProcessStandalone(name, targetDir, templateName, resolution) {
|
|
|
1624
1639
|
}
|
|
1625
1640
|
pkg.dependencies = pkg.dependencies ?? {};
|
|
1626
1641
|
pkg.dependencies["@electric-sql/pglite"] ??= PGLITE_DEPENDENCY_VERSION;
|
|
1642
|
+
pkg.dependencies["drizzle-orm"] ??= DRIZZLE_DEPENDENCY_VERSION;
|
|
1627
1643
|
pkg.dependencies.postgres ??= POSTGRES_DEPENDENCY_VERSION;
|
|
1628
1644
|
ensureReactRouterBuildDependencies(pkg);
|
|
1629
1645
|
hasNodePty = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const DESIGN_VISUAL_EDIT_SKILL_MD = "---\nname: visual-edit\ndescription: >-\n Open and collaboratively edit a running local app in Design, with shared\n fallback previews and source handoff. Use when the user asks to inspect,\n share, or edit a real local app in Design.\nmetadata:\n visibility: exported\n---\n\n# Visual Edit\n\nUse `/visual-edit` when the user wants to inspect or edit a real local app\nvisually instead of generating standalone Alpine HTML. The source of truth is\nthe running localhost app plus its route URLs. Design shows those routes as\niframe-backed screens on the infinite canvas.\n\nThe editor is hosted at `https://design.agent-native.com`. Never start local\nDesign; only the target app and bridge run locally.\n\nSee the [Visual Edit guide](https://github.com/BuilderIO/agent-native/blob/main/skills/visual-edit/README.md)\nfor a worked onboarding-flow example.\n\n## Fast local startup\n\n- Do not install this skill into the target app or start a local Design server.\n The skill belongs to the coding host; Design is always the hosted app above.\n- If you need to start an Agent-Native framework app yourself, use\n `AUTH_DISABLED=1` with its normal dev command. This is local-only and gives\n the visual editor the framework's dev identity without a user login.\n- If an agent-owned local server redirects a requested screen to `/sign-in`,\n restart that server with `AUTH_DISABLED=1` and probe the route again before\n opening Design. Never present a sign-in page as the requested screen.\n- Before calling `open-visual-edit`, verify the target URL responds. Start an\n agent-owned dev server with its normal command when it is down, and wait for\n the requested routes to respond before opening Design. Never leave a dead\n localhost URL in the canvas.\n- Preserve a server you did not start; use its existing authenticated browser\n session or explain that the target app, rather than Design, requires login.\n- When the user gives explicit paths, skip route inventory and place those\n paths directly. Discover routes only when paths were not supplied.\n\n## Installation\n\n`npx @agent-native/core@latest skills add visual-edit` installs the skill and\nhosted Design MCP connector. `npx skills@latest add BuilderIO/agent-native\n--skill visual-edit` installs instructions only; page-capable WebMCP hosts need\nno connector installation.\n\n## Put Design Beside The Chat\n\nPrefer the interactive MCP App from `open-visual-edit`: it keeps Design beside\nchat and routes **Apply design updates** through the host's MCP Apps bridge. The\nhost may ask the user to confirm the current conversation. Otherwise,\n`openUrl` is a credential-free, read-only fallback; never claim it is editable.\n\n- Inline-browser hosts should open `https://design.agent-native.com/visual-edit`\n and call its `open-visual-edit` WebMCP tool. It works signed in or out; the\n one-time capability is not a Design account session. A page-capable browser\n controller is enough, so Claude-in-Chrome, Claude Code browser tools, the\n ChatGPT Chrome/browser extension, Puppeteer or Playwright MCP, CDP, and\n similar JavaScript-capable controllers do not need the hosted MCP connector.\n- VS Code uses its Design webview/deep link. Without page WebMCP, use the hosted\n Design MCP connector and its normal OAuth/device authorization. Never replace\n either path with a local Design server.\n\nInside Design, use **Show/Hide UI** from the `Cmd K` menu or press Figma's\n`Shift \\` shortcut to toggle all editing chrome so only the canvas remains.\n\n## Browser WebMCP (Default Without Connector)\n\nWithout a connected Design MCP, use a visible browser tab with a main-world\nJavaScript evaluator. Prefer the host's inline browser; use external Chrome\nonly when requested or unavailable. Open\n`https://design.agent-native.com/visual-edit`, keep it visible while tools\nregister, and read the title before work. Never enter, copy, or request\npasswords, cookies, tokens, or codes. Signed-out loopback visual-edit works;\nother pages that block tools behind sign-in still require a signed-in tab.\nIf the browser exposes CDP permissions, grant `local-network-access` to\n`https://design.agent-native.com` before calling page tools; otherwise use the\npage's Connect button and let the browser's permission prompt complete.\n\nUse a native browser-session WebMCP bridge when the host provides one: list\nonce with `list-browser-session-webmcp-tools` and run with\n`run-browser-session-webmcp-tool`, or use the `list-host-webmcp-tools` and\n`run-host-webmcp-tool` pair. Preserve the exact discovered name, origin, and\nargs. Otherwise use the page-world API. Agent-Native pages expose this helper:\n\nExample assumes signed-in or existing bridge; fresh signed-out loopback must add\nthe locally held `bridgeToken` described below.\n\n```js\nconst an = window.__agentNativeWebMcp;\nconst status = await an.ready({ waitMs: 20_000 });\nif (status.state !== \"ready\") throw new Error(status.error ?? status.state);\nconst tools = await an.tools(\"visual-edit\");\nif (!tools.some((tool) => tool.name === \"open-visual-edit\")) {\n throw new Error(\"open-visual-edit is not registered yet\");\n}\nconst result = await an.call(\"open-visual-edit\", {\n devServerUrl: \"http://localhost:5173\",\n paths: [\"/\"],\n navigate: true,\n}, { waitMs: 2_000 });\nif (result.state === \"pending\") {\n // On the next evaluation, read the still-running call without replaying it.\n an.result(result.id);\n}\n```\n\nIf the helper is absent, use standard WebMCP directly. `document.modelContext`\nis canonical; `navigator.modelContext` is deprecated:\n\n```js\nconst ctx = document.modelContext;\nconst tool = (await ctx.getTools()).find((candidate) => candidate.name === NAME);\nif (!tool) throw new Error(`WebMCP tool not found: ${NAME}`);\nconst codex = typeof ctx.codexExecuteTool === \"function\" ||\n typeof ctx.codexGetTools === \"function\";\nconst result = await ctx.executeTool(tool, codex ? ARGS : JSON.stringify(ARGS));\n```\n\nThe helper handles live discovery, partial registries, and pending calls. If a\ncall returns `state: \"pending\"`, read `an.result(id)` on the next evaluation;\nnever replay a write. For Claude Code or Cowork, `javascript_tool` runs this\npage-world code with top-level `await`; for Codex open the page with\n`cua.createBrowserTab(\"iab\", url, { visible: true })`, then use CDP\n`Runtime.evaluate` with `awaitPromise: true`; Puppeteer and Playwright MCP can\nuse their page evaluator. Playwright isolated worlds cannot see\n`document.modelContext`. Keep evaluator output small, batch dependent calls,\nand do not navigate inside a batch.\n\nTool descriptors are page-local. Do not copy them into the host, hand-build\nauthenticated HTTP requests, or replace named tools with clicks, typing, DOM\nautomation, or screenshots. UI automation remains appropriate for canvas work\nwithout a named tool or when requested. If both bridges are unavailable after\none discovery and one independent evaluator check, use hosted MCP/CLI before\nchanging state.\n\nFor a fresh signed-out loopback connection, generate the bridge token locally,\nstart the durable bridge with it, and pass that same token once as the page\ntool's `bridgeToken`; the page never returns it. Reuse a matching running\nbridge without the token. Account-backed or private Design work requires a\nsigned-in session or the authenticated Design MCP connector. After canvas edits,\ncall `an.call(\"get-visual-edit-prompt\", {}, { waitMs: 2_000 })` and apply the\nreturned handoff. The page tool may show an approval dialog; let the user\napprove it and never bypass that consent.\n\n## Core Model\n\n- Each screen is a URL-backed iframe, not copied HTML.\n- Each screen keeps URL metadata: `connectionId`, `routeId`, `path`,\n `url`, `bridgeUrl`, title, and viewport size.\n- The owner edits through the local bridge. Shared\n `/visual-edit/:designId?share=1` links render a sanitized inert snapshot,\n refreshed on route or DOM changes; guests never reach the owner's localhost.\n Guest edits stay pending until an owner or editor applies them to source.\n- Authorized viewers and commenters on private designs can edit the shared\n Visual Edit canvas and submit pending changes without writing design files.\n The owner or editor applies those source changes.\n- **The `/visual-edit` skill needs no Design account sign-in.**\n `open-visual-edit` mints a five-minute, single-use capability for the exact\n `/visual-edit/:designId` local-editor route. The MCP host redeems it outside\n model-visible text, then opens the existing editor with localhost edit access.\n A public `/visual-edit/:designId` route enables browser-only DOM editing of\n public localhost snapshots; handoffs stay pending until applied. The owner\n sees **Apply edits** when a recipient has pending changes.\n This capability is not an account session: `/_agent-native/session` remains\n signed out, and account-backed save/share/generate actions remain denied.\n- Hosted MCP highlights `get-visual-edit-pending`; pass the visual-edit\n design ID for a tab-free handoff. It returns a revision; after applying,\n call `acknowledge-visual-edit-pending` with that revision, then pull again.\n `empty` means no edits; `session-ended` means edits were lost;\n `unknown` means the marker was unreadable, not proof of no change.\n- Browser hosts can use page-local `get-visual-edit-prompt`.\n- The `open-visual-edit` action is owned by Design. From another app, use the\n hosted MCP server at `https://design.agent-native.com/mcp` or the page's\n WebMCP helper, not `pnpm action` in the target app. The page path works\n signed out only for loopback apps in public mode, using a short-lived\n capability-scoped principal; hosted MCP uses its normal OAuth identity.\n- Ordinary public links stay read-only. Public `/visual-edit/:designId` and\n authorized private shares allow DOM-only edits, never source writes. Guest\n Interact is blocked; snapshots strip active content and owner-local resources,\n and persisted writes stay role-gated. Loopback is not a trust boundary because\n tunnels can proxy remote callers.\n- The live editor is same-origin through the local bridge proxy. This boots\n CSR apps and root-relative assets, but it is still a localhost editing proxy:\n app-origin cookies, WebSockets/HMR, SSE, and non-GET app API calls may need a\n future dev-server/plugin integration for perfect parity with the app's own\n origin.\n- The canvas is the editing view; Interact runs the normal URL with rails and a\n device bar. Interact preserves navigation, scrolling, links, and controls;\n the canvas pans/zooms and suppresses native frame interaction.\n- While a localhost screen has pending live visual edits, do not switch back to\n Interact until the user either applies the edits to source or explicitly\n aborts/discards the preview.\n- Alt-drag duplicates a localhost frame and its URL metadata. Change the copy's\n path/query for another state; preserve the order of named or numbered flows.\n Shorthand like `localhost:1234/onboarding/1` means\n `http://localhost:1234/onboarding/1`.\n\n## Useful Canvas Sets\n\nUse a focused batch of 3-7 frames by default: one ordered frame per requested\nroute/query state, repeat routes at requested desktop/tablet/mobile viewports,\nand include URL-addressable empty, loading, error, modal-open, or selected-item\nstates. Keep the Screens section readable so Layers remains useful while\nediting. Do not expand beyond 7 frames unless the user explicitly asks for an\nexhaustive audit or a complete route inventory.\n\nDo not expand every discovered route or every viewport unless the user asks for\nan exhaustive audit. Preserve the user's labels and sequence so the canvas\nreads like the workflow they described.\n\n## Select And Reprompt\n\nWhen a chat message begins with `[Reprompt selection]`, the selected subtree is\na hard write boundary. The only mutation path is `propose-node-rewrite` with\nthe exact `repromptId`, target, and `baseVersionHash` captured in\n`design-reprompt-pending:<designId>:<fileId>`. Never use `apply-visual-edit`,\n`apply-source-edit`, `write-source`, `write-local-file`, `edit-design`, or any\nother content-writing action for that request. Clarifying questions are allowed,\nbut a requested change must remain a proposal.\n\nProduce one variant by default. Produce two or three only when the instruction\nasks for options. A retry includes `priorProposalId`; keep the same target and\nbase version, incorporate the feedback, and call `propose-node-rewrite` again.\nThe UI previews the returned subtree without persisting it.\n\nUse `resolve-node-rewrite` for the accept/reject lifecycle. Accept applies the\nchosen variant as one version-checked inline/Yjs content transaction so one\nundo restores the prior structure; reject clears the proposal without changing\ncontent. For conversational resolution such as \"apply the second one,\" call\n`view-screen`, read the active `design.reprompt.proposal`, and pass its\n`proposalId` plus the zero-based `variantIndex` to `resolve-node-rewrite`.\n\n## Review Quality\n\nTreat the running app as truth, preserving its component language, tokens, route\nstate, and content. Compare visual edits before/after at requested viewports and\ncheck meaningful URL, hover, focus, scroll, and modal states.\n\n## Account And Sharing Model\n\n- The capability permits live iframe inspection, session-local edits, undo/redo,\n **Apply design updates**, and **Copy prompt**. These hand bounded source\n instructions to the coding agent; they do not persist account-owned Design data.\n- Public `/design/:id` links stay read-only without a signed-in owner/editor\n session. Never use the local capability to upgrade that ordinary sharing\n surface.\n- Prefer links returned by Design actions or `/_agent-native/open` deep links;\n never surface `_session=` tokens or hand-build capability URLs.\n- Do not attempt account-backed write actions with the browser capability. The\n trusted local `open-visual-edit` CLI call may register its bridge, create or\n reuse its workspace-owned local design, and place screens without an account.\n Direct source-file action writes, generation, saving into an account, and\n sharing still require an authenticated action caller. If a signed-out visitor\n wants those durable account operations, send them through the framework\n sign-in return flow first.\n\n## Required Local Bridge\n\nThe live-edit bridge is unlocked by a shared secret (the \"bridge token\") that\nmust match on two sides: the local bridge process, and the user's connection row\nin Design (which the browser reads to authorize `/live-edit-bridge`,\n`/read-file`, `/write-file`). Get them to match by letting the\n`open-visual-edit` action mint the token, then starting the\nbridge with it. This is the only ordering that works for the remote-MCP flow -\nthe bridge cannot push its own token to the server without a CLI auth token, so\nthe server mints instead and the bridge adopts.\nThe `connectionId` (usually `localhost_...`) only identifies the row; never\npass it as `bridgeToken`.\n\nFor a fresh signed-out browser flow, generate the token locally, keep it in the\nhost process, and pass it once as the page tool's optional `bridgeToken`; the\npage never returns it:\n\n```bash\nBRIDGE_TOKEN=\"$(node -e 'process.stdout.write(require(\"node:crypto\").randomBytes(32).toString(\"hex\"))')\"\nAGENT_NATIVE_BRIDGE_TOKEN=\"$BRIDGE_TOKEN\" npx @agent-native/core@latest design connect --url http://localhost:5173 --root . --daemon\n```\n\nReuse an existing matching connection without `bridgeToken`; hosted MCP can\nmint the token when page WebMCP is unavailable.\n\nFrom the target app repo, make sure its dev server is running, then:\n\n**1. Discover routes without starting a durable bridge** (one-shot, exits):\n\n```bash\nnpx @agent-native/core@latest design connect --url http://localhost:5173 --root . --json\n```\n\nThis prints the manifest (routes + capabilities). Parse it to build\n`routeManifest` for the next step. (Skip this if the user already gave explicit\npaths/URLs to place.)\n\nInside the agent-native monorepo itself, use the workspace CLI instead of\n`npx` \u2014 `npx` installs the last published `@agent-native/core`, which will not\ncontain local changes and costs a slow install on every call:\n\n```bash\npnpm dev:cli design connect --url http://localhost:5173 --root templates/<app> --json\n```\n\n**2. For the hosted MCP path, call `open-visual-edit`** (see Action Flow below)\nwith NO `bridgeToken`.\nThe server mints one, stores it on the user's connection row, copies it into the\nplaced screens' metadata, and returns it to you as `bridgeToken`. Capture it.\n\n**3. Start the persistent bridge adopting that token** (single line; prefer the\nenv var so the secret does not appear in `ps`):\n\n```bash\nAGENT_NATIVE_BRIDGE_TOKEN=\"<bridgeToken from step 2>\" npx @agent-native/core@latest design connect --url http://localhost:5173 --root . --daemon\n```\n\n(Equivalently, pass `--bridge-token <token>`.) This starts a detached bridge on\n`http://127.0.0.1:7331`, adopts the server-minted token \u2014 so bridge and row\nagree and live-edit authorizes with no self-registration \u2014 and stays alive after\nthe command exits.\n\nFor a manual health/manifest check on the running bridge:\n\n```bash\ncurl http://127.0.0.1:7331/health\n```\n\n`/health` needs no token. The full manifest at `/manifest.json` is\npreview-token protected, so an unauthenticated `curl` of it returns\n`{\"ok\":false,\"error\":\"invalid or missing preview token\"}` \u2014 that response means\nthe bridge is up, not that it is broken.\n\nOnly use `--json` for the step-1 route probe. Never use `--json`, `--once`,\nor `--dry-run` for the durable step-3 bridge: they print the manifest and exit,\nso Design falls back to a non-editable live iframe.\n\nThe bridge listens on a single fixed port (7331) and refuses to start for a\nsecond, different app. It is detached with no log file, so if `--daemon` reports\na timeout, check for a stale process (`lsof -ti:7331`) before retrying.\n\nIf local Design uses PGlite, never invoke the in-process CLI against that server:\nboth open the same directory and the second owner is rejected. For a signed-out\nlocal test, start Design with `AUTH_DISABLED=1`, open `/visual-edit`, and call\nthe server-action `open-visual-edit` through `window.__agentNativeWebMcp` after\nit registers. This keeps one PGlite owner; `get-visual-edit-prompt` is only the\npost-edit handoff. With auth enabled, sign in to hosted Design MCP or use shared\nPostgres before using the CLI action.\n\n## Action Flow\n\nWhen a browser is available, reuse the local bridge and call the Design page's\n`open-visual-edit` WebMCP tool. For a fresh signed-out connection, pass the\nlocally held `bridgeToken`; it reads its preview manifest and challenge proof,\nthen sends both for validation. Hosted Design never fetches `127.0.0.1`. If the\npage has no WebMCP, use the connected Design MCP server or its normal hosted\nMCP fallback.\n\nFrom another app, call the connected Design MCP tool\n`mcp__agent-native-design__open-visual-edit` with the JSON arguments below. It\nregisters or refreshes the localhost bridge,\nmints and stores the bridge token, creates or reuses a Design project, places\nURL-backed screens, stores visual-edit context, and navigates to overview mode\nin one call. Never run `pnpm action` from the target app's checkout: its local\nregistry does not contain Design actions.\n\nCall it before starting the durable bridge: it does not contact the bridge, so\nthe server can mint `bridgeToken` for the bridge to adopt. Omit that input.\n\n```json\n{\n \"title\": \"Docs homepage visual edit\",\n \"devServerUrl\": \"http://localhost:5173\",\n \"bridgeUrl\": \"http://127.0.0.1:7331\",\n \"rootPath\": \"/absolute/path/to/app\",\n \"routeManifest\": { \"...\": \"from /manifest.json\" },\n \"paths\": [\"/\", \"/pricing\", \"/checkout?step=payment\"]\n}\n```\n\nThe action returns `designId`, `connectionId`, `bridgeToken`, `screens`,\n`urlPath`, and credential-free `openUrl`. MCP App metadata carries the\nhidden one-time launcher. Keep the ids for follow-ups\nand pass the token to `design connect`; reusing the connection reuses its token.\n\n### Desktop and mobile side by side\n\nPass `viewports` to place every requested route once per viewport. Frames lay\nout as a grid: one row per route, one column per viewport. Presets are\n`desktop` (1280x900), `laptop` (1440x900), `tablet` (834x1112), and `mobile`\n(390x844); an explicit `{ \"label\": \"...\", \"width\": N, \"height\": N }` also works.\n\n```json\n{\n \"title\": \"Tasks responsive visual edit\",\n \"devServerUrl\": \"http://localhost:5173\",\n \"bridgeUrl\": \"http://127.0.0.1:7331\",\n \"rootPath\": \"/absolute/path/to/app\",\n \"paths\": [\"/tasks\", \"/inbox\"],\n \"viewports\": [\"desktop\", \"mobile\"]\n}\n```\n\nPrefer this over two separate calls with `defaultWidth`/`defaultHeight`: it\nkeeps each route's viewports aligned in a row and titles them\n`Tasks \u2014 Desktop` / `Tasks \u2014 Mobile` so the canvas reads clearly. `viewports`\noverrides `defaultWidth`/`defaultHeight`. With no `routes`/`paths`, it expands\nevery route in the localhost manifest, which is usually far more frames than\nthe user wants \u2014 name the paths.\n\n### Managing screens and breakpoints manually\n\nSelect a screen and use the right-rail **Screen** section to switch between\nStatic HTML and URL-backed modes, edit its route/path, choose a localhost\nconnection, add another URL screen, or remove the selected screen. URL mode\nkeeps the iframe live; switching to Static stores a sanitized snapshot of the\ncurrent frame, including its current client state when the page can provide it.\nThe same operations are available to a page-capable agent through\n`add-localhost-screens`, `update-screen-source`, `add-breakpoint`, and\n`remove-breakpoint`.\n\n### Adding more page frames later\n\nCall `open-visual-edit` again with the same `designId` and `connectionId` and\nonly the new paths. Existing frames for the same route and viewport are\nrefreshed in place rather than duplicated, and a frame the user has dragged or\nresized keeps its position unless you explicitly pass `x`/`y`/`width`/`height`.\n\n```json\n{\n \"designId\": \"<existing-design-id>\",\n \"connectionId\": \"<existing-connection-id>\",\n \"devServerUrl\": \"http://localhost:5173\",\n \"paths\": [\"/settings\", \"/team\"],\n \"startY\": 2200\n}\n```\n\nDo NOT add `defaultWidth`/`defaultHeight` just to restate the default size:\nsupplying either one marks the viewport as explicitly requested, which\noverwrites frame sizes the user has already adjusted on the canvas.\n\nFor a numbered flow the user describes in chat, keep the labels and order:\n\n```json\n{\n \"designId\": \"<existing-design-id>\",\n \"connectionId\": \"<existing-connection-id>\",\n \"devServerUrl\": \"http://localhost:1234\",\n \"routes\": [\n { \"url\": \"localhost:1234/onboarding/1\", \"title\": \"Screen 1\" },\n { \"url\": \"localhost:1234/onboarding/2\", \"title\": \"Screen 2\" },\n { \"url\": \"localhost:1234/onboarding/3\", \"title\": \"Screen 3\" }\n ]\n}\n```\n\nIf no `routes` or `paths` are supplied, `open-visual-edit` uses every route\nfrom the localhost manifest.\n\nFallback only when `open-visual-edit` is unavailable and hosted Design MCP is\nauthorized:\n\n1. Register or refresh the bridge with `connect-localhost`, passing the\n `/manifest.json` result as `routeManifest` and `capabilities`.\n2. Create or reuse a Design project with `create-design`.\n3. Place URL-backed screens with `add-localhost-screens`.\n4. Navigate to overview mode with `navigate`.\n\nThe fallback still targets `https://design.agent-native.com`; only the app and\nbridge URLs are localhost. Never run `pnpm action` from `templates/design`.\n\n## Open The Design Surface\n\n- Use the `link`, `deepLink`, or MCP App embed returned by Design actions so the\n user sees the canvas. Prefer the MCP App; its host launcher carries the\n one-time capability. The credential-free `openUrl` is read-only fallback.\n- Never return or open a hand-built `/design/:id?_session=...` URL.\n- If the user is working in VS Code, the Agent-Native extension can open the\n same URL via\n `vscode://builder.agent-native/open?url=<encoded-design-url>`. Its\n `Agent-Native: Open Design Canvas` command also starts the local bridge and\n opens hosted Design in the VS Code side panel.\n- Once `open-visual-edit` returns the expected `screenCount`, hand back the\n link and stop. Do not open it yourself in a browser-automation tool to\n screenshot or poll until it renders \u2014 a cold dev server can take 10-30s\n regardless of who's watching, and that wait adds nothing the response didn't\n already confirm. Reach for browser automation only if the user later reports\n the canvas is broken.\n\n## Applying Visual Edits Back To Source\n\nWith Design closed, call hosted Design MCP's highlighted\n`get-visual-edit-pending` for the design ID; it returns the handoff and\nrevision. Verify the applied source, acknowledge that revision, then pull again.\nIf MCP is unavailable, read the local bridge:\n\n```bash\nnpx @agent-native/core@latest design pending --root . --design-id <design-id-from-visual-edit-url>\n```\n\nPass the ID after `visual-edit` in the Design URL; the CLI prints that\ndesign's prompt (`null` when empty).\n\nCanvas edits on a localhost screen never write source directly. They stay\npending until the canvas shows **Apply design updates** (local) or **Apply edits**\n(shared). An MCP App sends its prompt through the host or local Design agent;\notherwise use **Copy prompt to your agent**.\n\nChatGPT and Claude Code should pull, apply, acknowledge, and pull again.\nBrowser WebMCP hosts can call `get-visual-edit-prompt`. Never acknowledge\nbefore applying the source change.\n\n- Style, text, and drag/drop edits collect into one pending batch for a single\n apply.\n- After the write lands, the target app's own dev-server HMR refreshes the\n frames \u2014 no manual reload. If frames do not refresh, the write did not land;\n say so rather than assuming.\n- The separate disk-icon \"Apply to source\" button is the deterministic\n whole-file HTML/CSS writer. It is intentionally disabled for compiled\n `.jsx`/`.tsx` routes \u2014 those must go through the agent path above.\n\n## Editing URLs\n\nKeep localhost screens as URL files plus `screenMetadata[fileId]`. Do not\nreplace them with copied `srcdoc` HTML unless the user explicitly asks for a\nfrozen snapshot. To change a state, rerun `open-visual-edit` with the new\npath/query, use the Screen settings section, call `update-screen-source`, or\nduplicate the screen and update the copy's URL metadata.\n\n## Local Files in the Code Tab\n\nOnce a connection is registered, the design editor's Code panel (left rail \u2192\nCode, or `navigate --view editor --designId <id> --leftPanel code`) shows a\nlocal-files workspace root for that connection next to the design's own files.\nTreat that root like VS Code opened at the connected project directory: file\ntree, search, open/edit, and save are backed by the real local files. It lists\nthe connected app's text/code files through the bridge\n(`list-local-files` / `read-local-file`); build output, `node_modules`,\n`.git`, and secret-looking paths (`.env*`, key files) are always excluded.\n\n- Browsing and reading need only editor access on the design plus the running\n bridge.\n- Saving goes through `write-local-file`: the first save opens the\n write-consent dialog (an 8-hour, folder-scoped grant) and retries\n automatically once granted. Only text/code files are writable; secret paths\n are always blocked.\n- If the agent calls `write-local-file` directly (not through a UI save) and it\n fails with \"no write-consent grant\", call `request-localhost-write-consent`.\n It opens the write-consent dialog in the editor, or reports `alreadyGranted`\n if one already exists. Granting is human-only \u2014\n `grant-localhost-write-consent` is hidden from agents, so you cannot approve\n it yourself. Tell the user to click \"Allow writes\", then retry\n `write-local-file` once. Do not keep retrying blindly: the write stays\n blocked until the user approves.\n- Saves are conflict-checked against the file's on-disk version \u2014 a file that\n changed since it was read fails with a version conflict instead of being\n overwritten.\n\n## React Source Writeback\n\n- Use compiler/debug provenance (project-relative file, line, column,\n component, and runtime multiplicity) to locate React/TSX source. Treat it as\n evidence, not as permission for a generic AST structural transform.\n- Read `positionPrecision` on every anchor before you trust `line`/`column`.\n `authored` means those are the real JSX coordinates. `transformed` means they\n are the dev server's own output coordinates \u2014 React 19 removed `_debugSource`\n and exposes only an owner stack, so this is the normal case on a Vite/Next\n dev server, and the line will not match the file. `unknown` means no tier was\n reported. On anything but `authored`, use the file and component to find the\n element by its JSX shape and re-derive the line from the file you read; never\n edit at the reported line.\n- A single-instance leaf text edit, literal `className`/`class` edit, or flat\n literal `style={{ ... }}` property may use `apply-visual-edit` with a\n `local-file` source and a complete `target.sourceAnchor`. Forward the\n anchor's `positionPrecision` with it \u2014 the action refuses a `transformed`\n anchor with `status: \"needsAgent\"` instead of seeking to a line that means\n something else in the authored file. Preview first (omit `persist`), inspect\n `proposedDiff`, then call with `persist: true`.\n- Reparenting, grouping/ungrouping, wrappers, dynamic expressions, repeated\n `.map()` instances, shared components, breakpoint-scoped edits, and\n cross-file changes go through the coding agent with complete subject/target\n anchors and their runtime relationship. `apply-visual-edit` refuses these\n with `status: \"needsAgent\"` rather than guessing.\n- Before each write, read the file and pass its exact `versionHash` to\n `write-local-file` with `requireExpectedVersionHash: true`; on conflict,\n re-read and re-plan. Keep the optimistic preview until HMR/runtime confirms\n the result. Human write consent remains mandatory and agents cannot grant it.\n\n## Verification\n\nFor a plain \"open this app\" request, `open-visual-edit`'s own response is\nthe verification \u2014 see Open The Design Surface. Reach for the checks below\nonly to diagnose an actual report, or to confirm an applied edit landed:\n\n- `list-localhost-connections` returns the expected connection and routes.\n- The Design editor opens in overview mode.\n- Every requested screen renders the intended localhost URL, showing real app\n content rather than an endless loading spinner.\n- The screen iframe carries a `src`, not a `srcdoc`. A localhost screen with a\n `srcdoc` is a bug, not a slow load \u2014 check it in the browser devtools before\n reporting the canvas as working.\n- Alt-dragging a screen copies the URL-backed frame, not an inline HTML clone.\n- A query/path edit changes only the target screen's URL metadata and iframe.\n- `get-visual-edit-pending` is the tab-free handoff; acknowledge its revision\n after applying. `get-visual-edit-prompt` is the browser equivalent.\n- The Code tab shows a local-files root for the connection and opens its files.\n";
|
|
1
|
+
export declare const DESIGN_VISUAL_EDIT_SKILL_MD = "---\nname: visual-edit\ndescription: >-\n Open and collaboratively edit a running local app in Design, with shared\n fallback previews and source handoff. Use when the user asks to inspect,\n share, or edit a real local app in Design.\nmetadata:\n visibility: exported\n---\n\n# Visual Edit\n\nUse `/visual-edit` when the user wants to inspect or edit a real local app\nvisually instead of generating standalone Alpine HTML. The source of truth is\nthe running localhost app plus its route URLs. Design shows those routes as\niframe-backed screens on the infinite canvas.\n\nThe editor is hosted at `https://design.agent-native.com`. Never start local\nDesign; only the target app and bridge run locally.\n\nSee the [Visual Edit guide](https://github.com/BuilderIO/agent-native/blob/main/skills/visual-edit/README.md)\nfor a worked onboarding-flow example.\n\n## Fast local startup\n\n- Do not install this skill into the target app or start a local Design server.\n The skill belongs to the coding host; Design is always the hosted app above.\n- If you need to start an Agent-Native framework app yourself, use\n `AUTH_DISABLED=1` with its normal dev command. This is local-only and gives\n the visual editor the framework's dev identity without a user login.\n- If an agent-owned local server redirects a requested screen to `/sign-in`,\n restart that server with `AUTH_DISABLED=1` and probe the route again before\n opening Design. Never present a sign-in page as the requested screen.\n- Before calling `open-visual-edit`, verify the target URL responds. Start an\n agent-owned dev server with its normal command when it is down, and wait for\n the requested routes to respond before opening Design. Never leave a dead\n localhost URL in the canvas.\n- Preserve a server you did not start; use its existing authenticated browser\n session or explain that the target app, rather than Design, requires login.\n- When the user gives explicit paths, skip route inventory and place those\n paths directly. Discover routes only when paths were not supplied.\n\n## Installation\n\n`npx @agent-native/core@latest skills add visual-edit` installs the skill and\nhosted Design MCP connector. `npx skills@latest add BuilderIO/agent-native\n--skill visual-edit` installs instructions only; page-capable WebMCP hosts need\nno connector installation.\n\n## Put Design Beside The Chat\n\nPrefer the MCP App from `open-visual-edit`: it keeps Design beside\nchat. Use **Copy prompt** to hand the visual edits to the coding agent; the host\nmay request conversation confirmation. Otherwise,\n`openUrl` is a credential-free, read-only fallback; never claim it is editable.\n\n- Inline-browser hosts should open `https://design.agent-native.com/visual-edit`\n and call its `open-visual-edit` WebMCP tool. It works signed in or out; the\n one-time capability is not a Design account session. A page-capable browser\n controller is enough, so Claude-in-Chrome, Claude Code browser tools, the\n ChatGPT Chrome/browser extension, Puppeteer or Playwright MCP, CDP, and\n similar JavaScript-capable controllers do not need the hosted MCP connector.\n- VS Code uses its Design webview/deep link. Without page WebMCP, use the hosted\n Design MCP connector and its normal OAuth/device authorization. Never replace\n either path with a local Design server.\n\nInside Design, use **Show/Hide UI** from the `Cmd K` menu or press Figma's\n`Shift \\` shortcut to toggle all editing chrome so only the canvas remains.\n\n## Browser WebMCP (Default Without Connector)\n\nWithout a connected Design MCP, use a visible browser tab with a main-world\nJavaScript evaluator. Prefer the host's inline browser; use external Chrome\nonly when requested or unavailable. Open\n`https://design.agent-native.com/visual-edit`, keep it visible while tools\nregister, and read the title before work. Never enter, copy, or request\npasswords, cookies, tokens, or codes. Signed-out loopback visual-edit works;\nother pages that block tools behind sign-in still require a signed-in tab.\nIf the browser exposes CDP permissions, grant `local-network-access` to\n`https://design.agent-native.com` before calling page tools; otherwise use the\npage's Connect button and let the browser's permission prompt complete.\n\nUse a native browser-session WebMCP bridge when the host provides one: list\nonce with `list-browser-session-webmcp-tools` and run with\n`run-browser-session-webmcp-tool`, or use the `list-host-webmcp-tools` and\n`run-host-webmcp-tool` pair. Preserve the exact discovered name, origin, and\nargs. Otherwise use the page-world API. Agent-Native pages expose this helper:\n\nExample assumes signed-in or existing bridge; fresh signed-out loopback must add\nthe locally held `bridgeToken` described below.\n\n```js\nconst an = window.__agentNativeWebMcp;\nconst status = await an.ready({ waitMs: 20_000 });\nif (status.state !== \"ready\") throw new Error(status.error ?? status.state);\nconst tools = await an.tools(\"visual-edit\");\nif (!tools.some((tool) => tool.name === \"open-visual-edit\")) {\n throw new Error(\"open-visual-edit is not registered yet\");\n}\nconst result = await an.call(\"open-visual-edit\", {\n devServerUrl: \"http://localhost:5173\",\n paths: [\"/\"],\n navigate: true,\n}, { waitMs: 2_000 });\nif (result.state === \"pending\") {\n // On the next evaluation, read the still-running call without replaying it.\n an.result(result.id);\n}\n```\n\nIf the helper is absent, use standard WebMCP directly. `document.modelContext`\nis canonical; `navigator.modelContext` is deprecated:\n\n```js\nconst ctx = document.modelContext;\nconst tool = (await ctx.getTools()).find((candidate) => candidate.name === NAME);\nif (!tool) throw new Error(`WebMCP tool not found: ${NAME}`);\nconst codex = typeof ctx.codexExecuteTool === \"function\" ||\n typeof ctx.codexGetTools === \"function\";\nconst result = await ctx.executeTool(tool, codex ? ARGS : JSON.stringify(ARGS));\n```\n\nThe helper handles live discovery, partial registries, and pending calls. If a\ncall returns `state: \"pending\"`, read `an.result(id)` on the next evaluation;\nnever replay a write. For Claude Code or Cowork, `javascript_tool` runs this\npage-world code with top-level `await`; for Codex open the page with\n`cua.createBrowserTab(\"iab\", url, { visible: true })`, then use CDP\n`Runtime.evaluate` with `awaitPromise: true`; Puppeteer and Playwright MCP can\nuse their page evaluator. Playwright isolated worlds cannot see\n`document.modelContext`. Keep evaluator output small, batch dependent calls,\nand do not navigate inside a batch.\n\nTool descriptors are page-local. Do not copy them into the host, hand-build\nauthenticated HTTP requests, or replace named tools with clicks, typing, DOM\nautomation, or screenshots. UI automation remains appropriate for canvas work\nwithout a named tool or when requested. If both bridges are unavailable after\none discovery and one independent evaluator check, use hosted MCP/CLI before\nchanging state.\n\nFor a fresh signed-out loopback connection, generate the bridge token locally,\nstart the durable bridge with it, and pass that same token once as the page\ntool's `bridgeToken`; the page never returns it. Reuse a matching running\nbridge without the token. Account-backed or private Design work requires a\nsigned-in session or the authenticated Design MCP connector. After canvas edits,\ncall `an.call(\"get-visual-edit-prompt\", {}, { waitMs: 2_000 })` and apply the\nreturned handoff. The page tool may show an approval dialog; let the user\napprove it and never bypass that consent.\n\n## Core Model\n\n- Each screen is a URL-backed iframe, not copied HTML.\n- Each screen keeps URL metadata: `connectionId`, `routeId`, `path`,\n `url`, `bridgeUrl`, title, and viewport size.\n- The owner edits through the local bridge. Shared\n `/visual-edit/:designId?share=1` links render a sanitized inert snapshot,\n refreshed on route or DOM changes; guests never reach the owner's localhost.\n Guest edits stay pending until an owner or editor applies them to source.\n- Authorized viewers and commenters on private designs can edit the shared\n Visual Edit canvas and submit pending changes without writing design files.\n The owner or editor applies those source changes.\n- **The `/visual-edit` skill needs no Design account sign-in.**\n `open-visual-edit` mints a five-minute, single-use capability for the exact\n `/visual-edit/:designId` local-editor route. The MCP host redeems it outside\n model-visible text, then opens the existing editor with localhost edit access.\n A public `/visual-edit/:designId` route enables browser-only DOM editing of\n public localhost snapshots; handoffs stay pending until applied. The owner\n sees **Apply edits** when a recipient has pending changes.\n This capability is not an account session: `/_agent-native/session` remains\n signed out, and account-backed save/share/generate actions remain denied.\n- Hosted MCP highlights `get-visual-edit-pending`; pass the visual-edit\n design ID for a tab-free handoff. It returns a revision; after applying,\n call `acknowledge-visual-edit-pending` with that revision, then pull again.\n `empty` means no edits; `session-ended` means edits were lost;\n `unknown` means the marker was unreadable, not proof of no change.\n- Browser hosts can use page-local `get-visual-edit-prompt`.\n- The `open-visual-edit` action is owned by Design. From another app, use the\n hosted MCP server at `https://design.agent-native.com/mcp` or the page's\n WebMCP helper, not `pnpm action` in the target app. The page path works\n signed out only for loopback apps in public mode, using a short-lived\n capability-scoped principal; hosted MCP uses its normal OAuth identity.\n- Ordinary public links stay read-only. Public `/visual-edit/:designId` and\n authorized private shares allow DOM-only edits, never source writes. Guest\n Interact is blocked; snapshots strip active content and owner-local resources,\n and persisted writes stay role-gated. Loopback is not a trust boundary because\n tunnels can proxy remote callers.\n- The live editor is same-origin through the local bridge proxy. This boots\n CSR apps and root-relative assets, but it is still a localhost editing proxy:\n app-origin cookies, WebSockets/HMR, SSE, and non-GET app API calls may need a\n future dev-server/plugin integration for perfect parity with the app's own\n origin.\n- The canvas is the editing view; Interact runs the normal URL with rails and a\n device bar. Interact preserves navigation, scrolling, links, and controls;\n the canvas pans/zooms and suppresses native frame interaction.\n- While a localhost screen has pending live visual edits, do not switch back to\n Interact until the user either applies the edits to source or explicitly\n aborts/discards the preview.\n- Alt-drag duplicates a localhost frame and its URL metadata. Change the copy's\n path/query for another state; preserve the order of named or numbered flows.\n Shorthand like `localhost:1234/onboarding/1` means\n `http://localhost:1234/onboarding/1`.\n\n## Useful Canvas Sets\n\nUse a focused batch of 3-7 frames by default: one ordered frame per requested\nroute/query state, repeat routes at requested desktop/tablet/mobile viewports,\nand include URL-addressable empty, loading, error, modal-open, or selected-item\nstates. Keep the Screens section readable so Layers remains useful while\nediting. Do not expand beyond 7 frames unless the user explicitly asks for an\nexhaustive audit or a complete route inventory.\n\nDo not expand every discovered route or every viewport unless the user asks for\nan exhaustive audit. Preserve the user's labels and sequence so the canvas\nreads like the workflow they described.\n\n## Select And Reprompt\n\nWhen a chat message begins with `[Reprompt selection]`, the selected subtree is\na hard write boundary. The only mutation path is `propose-node-rewrite` with\nthe exact `repromptId`, target, and `baseVersionHash` captured in\n`design-reprompt-pending:<designId>:<fileId>`. Never use `apply-visual-edit`,\n`apply-source-edit`, `write-source`, `write-local-file`, `edit-design`, or any\nother content-writing action for that request. Clarifying questions are allowed,\nbut a requested change must remain a proposal.\n\nProduce one variant by default. Produce two or three only when the instruction\nasks for options. A retry includes `priorProposalId`; keep the same target and\nbase version, incorporate the feedback, and call `propose-node-rewrite` again.\nThe UI previews the returned subtree without persisting it.\n\nUse `resolve-node-rewrite` for the accept/reject lifecycle. Accept applies the\nchosen variant as one version-checked inline/Yjs content transaction so one\nundo restores the prior structure; reject clears the proposal without changing\ncontent. For conversational resolution such as \"apply the second one,\" call\n`view-screen`, read the active `design.reprompt.proposal`, and pass its\n`proposalId` plus the zero-based `variantIndex` to `resolve-node-rewrite`.\n\n## Review Quality\n\nTreat the running app as truth, preserving its component language, tokens, route\nstate, and content. Compare visual edits before/after at requested viewports and\ncheck meaningful URL, hover, focus, scroll, and modal states.\n\n## Account And Sharing Model\n\n- The capability permits live iframe inspection, session-local edits, undo/redo,\n and **Copy prompt**. The copied instructions go to the coding agent; they do\n not persist account-owned Design data.\n- Public `/design/:id` links stay read-only without a signed-in owner/editor\n session. Never use the local capability to upgrade that ordinary sharing\n surface.\n- Prefer links returned by Design actions or `/_agent-native/open` deep links;\n never surface `_session=` tokens or hand-build capability URLs.\n- Do not attempt account-backed write actions with the browser capability. The\n trusted local `open-visual-edit` CLI call may register its bridge, create or\n reuse its workspace-owned local design, and place screens without an account.\n Direct source-file action writes, generation, saving into an account, and\n sharing still require an authenticated action caller. If a signed-out visitor\n wants those durable account operations, send them through the framework\n sign-in return flow first.\n\n## Required Local Bridge\n\nThe live-edit bridge is unlocked by a shared secret (the \"bridge token\") that\nmust match on two sides: the local bridge process, and the user's connection row\nin Design (which the browser reads to authorize `/live-edit-bridge`,\n`/read-file`, `/write-file`). Get them to match by letting the\n`open-visual-edit` action mint the token, then starting the\nbridge with it. This is the only ordering that works for the remote-MCP flow -\nthe bridge cannot push its own token to the server without a CLI auth token, so\nthe server mints instead and the bridge adopts.\nThe `connectionId` (usually `localhost_...`) only identifies the row; never\npass it as `bridgeToken`.\n\nFor a fresh signed-out browser flow, generate the token locally, keep it in the\nhost process, and pass it once as the page tool's optional `bridgeToken`; the\npage never returns it:\n\n```bash\nBRIDGE_TOKEN=\"$(node -e 'process.stdout.write(require(\"node:crypto\").randomBytes(32).toString(\"hex\"))')\"\nAGENT_NATIVE_BRIDGE_TOKEN=\"$BRIDGE_TOKEN\" npx @agent-native/core@latest design connect --url http://localhost:5173 --root . --daemon\n```\n\nReuse an existing matching connection without `bridgeToken`; hosted MCP can\nmint the token when page WebMCP is unavailable.\n\nFrom the target app repo, make sure its dev server is running, then:\n\n**1. Discover routes without starting a durable bridge** (one-shot, exits):\n\n```bash\nnpx @agent-native/core@latest design connect --url http://localhost:5173 --root . --json\n```\n\nThis prints the manifest (routes + capabilities). Parse it to build\n`routeManifest` for the next step. (Skip this if the user already gave explicit\npaths/URLs to place.)\n\nInside the agent-native monorepo itself, use the workspace CLI instead of\n`npx` \u2014 `npx` installs the last published `@agent-native/core`, which will not\ncontain local changes and costs a slow install on every call:\n\n```bash\npnpm dev:cli design connect --url http://localhost:5173 --root templates/<app> --json\n```\n\n**2. For the hosted MCP path, call `open-visual-edit`** (see Action Flow below)\nwith NO `bridgeToken`.\nThe server mints one, stores it on the user's connection row, copies it into the\nplaced screens' metadata, and returns it to you as `bridgeToken`. Capture it.\n\n**3. Start the persistent bridge adopting that token** (single line; prefer the\nenv var so the secret does not appear in `ps`):\n\n```bash\nAGENT_NATIVE_BRIDGE_TOKEN=\"<bridgeToken from step 2>\" npx @agent-native/core@latest design connect --url http://localhost:5173 --root . --daemon\n```\n\n(Equivalently, pass `--bridge-token <token>`.) This starts a detached bridge on\n`http://127.0.0.1:7331`, adopts the server-minted token \u2014 so bridge and row\nagree and live-edit authorizes with no self-registration \u2014 and stays alive after\nthe command exits.\n\nFor a manual health/manifest check on the running bridge:\n\n```bash\ncurl http://127.0.0.1:7331/health\n```\n\n`/health` needs no token. The full manifest at `/manifest.json` is\npreview-token protected, so an unauthenticated `curl` of it returns\n`{\"ok\":false,\"error\":\"invalid or missing preview token\"}` \u2014 that response means\nthe bridge is up, not that it is broken.\n\nOnly use `--json` for the step-1 route probe. Never use `--json`, `--once`,\nor `--dry-run` for the durable step-3 bridge: they print the manifest and exit,\nso Design falls back to a non-editable live iframe.\n\nThe bridge listens on a single fixed port (7331) and refuses to start for a\nsecond, different app. It is detached with no log file, so if `--daemon` reports\na timeout, check for a stale process (`lsof -ti:7331`) before retrying.\n\nIf local Design uses PGlite, never invoke the in-process CLI against that server:\nboth open the same directory and the second owner is rejected. For a signed-out\nlocal test, start Design with `AUTH_DISABLED=1`, open `/visual-edit`, and call\nthe server-action `open-visual-edit` through `window.__agentNativeWebMcp` after\nit registers. This keeps one PGlite owner; `get-visual-edit-prompt` is only the\npost-edit handoff. With auth enabled, sign in to hosted Design MCP or use shared\nPostgres before using the CLI action.\n\n## Action Flow\n\nWhen a browser is available, reuse the local bridge and call the Design page's\n`open-visual-edit` WebMCP tool. For a fresh signed-out connection, pass the\nlocally held `bridgeToken`; it reads its preview manifest and challenge proof,\nthen sends both for validation. Hosted Design never fetches `127.0.0.1`. If the\npage has no WebMCP, use the connected Design MCP server or its normal hosted\nMCP fallback.\n\nFrom another app, call the connected Design MCP tool\n`mcp__agent-native-design__open-visual-edit` with the JSON arguments below. It\nregisters or refreshes the localhost bridge,\nmints and stores the bridge token, creates or reuses a Design project, places\nURL-backed screens, stores visual-edit context, and navigates to overview mode\nin one call. Never run `pnpm action` from the target app's checkout: its local\nregistry does not contain Design actions.\n\nCall it before starting the durable bridge: it does not contact the bridge, so\nthe server can mint `bridgeToken` for the bridge to adopt. Omit that input.\n\n```json\n{\n \"title\": \"Docs homepage visual edit\",\n \"devServerUrl\": \"http://localhost:5173\",\n \"bridgeUrl\": \"http://127.0.0.1:7331\",\n \"rootPath\": \"/absolute/path/to/app\",\n \"routeManifest\": { \"...\": \"from /manifest.json\" },\n \"paths\": [\"/\", \"/pricing\", \"/checkout?step=payment\"]\n}\n```\n\nThe action returns `designId`, `connectionId`, `bridgeToken`, `screens`,\n`urlPath`, and credential-free `openUrl`. MCP App metadata carries the\nhidden one-time launcher. Keep the ids for follow-ups\nand pass the token to `design connect`; reusing the connection reuses its token.\n\n### Desktop and mobile side by side\n\nPass `viewports` to place every requested route once per viewport. Frames lay\nout as a grid: one row per route, one column per viewport. Presets are\n`desktop` (1280x900), `laptop` (1440x900), `tablet` (834x1112), and `mobile`\n(390x844); an explicit `{ \"label\": \"...\", \"width\": N, \"height\": N }` also works.\n\n```json\n{\n \"title\": \"Tasks responsive visual edit\",\n \"devServerUrl\": \"http://localhost:5173\",\n \"bridgeUrl\": \"http://127.0.0.1:7331\",\n \"rootPath\": \"/absolute/path/to/app\",\n \"paths\": [\"/tasks\", \"/inbox\"],\n \"viewports\": [\"desktop\", \"mobile\"]\n}\n```\n\nPrefer this over two separate calls with `defaultWidth`/`defaultHeight`: it\nkeeps each route's viewports aligned in a row and titles them\n`Tasks \u2014 Desktop` / `Tasks \u2014 Mobile` so the canvas reads clearly. `viewports`\noverrides `defaultWidth`/`defaultHeight`. With no `routes`/`paths`, it expands\nevery route in the localhost manifest, which is usually far more frames than\nthe user wants \u2014 name the paths.\n\n### Managing screens and breakpoints manually\n\nSelect a screen and use the right-rail **Screen** section to switch between\nStatic HTML and URL-backed modes, edit its route/path, choose a localhost\nconnection, add another URL screen, or remove the selected screen. URL mode\nkeeps the iframe live; switching to Static stores a sanitized snapshot of the\ncurrent frame, including its current client state when the page can provide it.\nThe same operations are available to a page-capable agent through\n`add-localhost-screens`, `update-screen-source`, `add-breakpoint`, and\n`remove-breakpoint`.\n\n### Adding more page frames later\n\nCall `open-visual-edit` again with the same `designId` and `connectionId` and\nonly the new paths. Existing frames for the same route and viewport are\nrefreshed in place rather than duplicated, and a frame the user has dragged or\nresized keeps its position unless you explicitly pass `x`/`y`/`width`/`height`.\n\n```json\n{\n \"designId\": \"<existing-design-id>\",\n \"connectionId\": \"<existing-connection-id>\",\n \"devServerUrl\": \"http://localhost:5173\",\n \"paths\": [\"/settings\", \"/team\"],\n \"startY\": 2200\n}\n```\n\nDo NOT add `defaultWidth`/`defaultHeight` just to restate the default size:\nsupplying either one marks the viewport as explicitly requested, which\noverwrites frame sizes the user has already adjusted on the canvas.\n\nFor a numbered flow the user describes in chat, keep the labels and order:\n\n```json\n{\n \"designId\": \"<existing-design-id>\",\n \"connectionId\": \"<existing-connection-id>\",\n \"devServerUrl\": \"http://localhost:1234\",\n \"routes\": [\n { \"url\": \"localhost:1234/onboarding/1\", \"title\": \"Screen 1\" },\n { \"url\": \"localhost:1234/onboarding/2\", \"title\": \"Screen 2\" },\n { \"url\": \"localhost:1234/onboarding/3\", \"title\": \"Screen 3\" }\n ]\n}\n```\n\nIf no `routes` or `paths` are supplied, `open-visual-edit` uses every route\nfrom the localhost manifest.\n\nFallback only when `open-visual-edit` is unavailable and hosted Design MCP is\nauthorized:\n\n1. Register or refresh the bridge with `connect-localhost`, passing the\n `/manifest.json` result as `routeManifest` and `capabilities`.\n2. Create or reuse a Design project with `create-design`.\n3. Place URL-backed screens with `add-localhost-screens`.\n4. Navigate to overview mode with `navigate`.\n\nThe fallback still targets `https://design.agent-native.com`; only the app and\nbridge URLs are localhost. Never run `pnpm action` from `templates/design`.\n\n## Open The Design Surface\n\n- Use the `link`, `deepLink`, or MCP App embed returned by Design actions so the\n user sees the canvas. Prefer the MCP App; its host launcher carries the\n one-time capability. The credential-free `openUrl` is read-only fallback.\n- Never return or open a hand-built `/design/:id?_session=...` URL.\n- If the user is working in VS Code, the Agent-Native extension can open the\n same URL via\n `vscode://builder.agent-native/open?url=<encoded-design-url>`. Its\n `Agent-Native: Open Design Canvas` command also starts the local bridge and\n opens hosted Design in the VS Code side panel.\n- Once `open-visual-edit` returns the expected `screenCount`, hand back the\n link and stop. Do not open it yourself in a browser-automation tool to\n screenshot or poll until it renders \u2014 a cold dev server can take 10-30s\n regardless of who's watching, and that wait adds nothing the response didn't\n already confirm. Reach for browser automation only if the user later reports\n the canvas is broken.\n\n## Applying Visual Edits Back To Source\n\nWith Design closed, call hosted Design MCP's highlighted\n`get-visual-edit-pending` for the design ID; it returns the handoff and\nrevision. Verify the applied source, acknowledge that revision, then pull again.\nIf MCP is unavailable, read the local bridge:\n\n```bash\nnpx @agent-native/core@latest design pending --root . --design-id <design-id-from-visual-edit-url>\n```\n\nPass the ID after `visual-edit` in the Design URL; the CLI prints that\ndesign's prompt (`null` when empty).\n\nCanvas edits on a localhost screen never write source directly. They stay\npending until the coding agent pulls them with `get-visual-edit-pending` or the\ncopied prompt, then writes them to source. There is no separate canvas Apply\nbutton. An MCP App sends its prompt through the host or local Design agent;\notherwise use **Copy prompt to your agent**.\n\nChatGPT and Claude Code should pull, apply, acknowledge, and pull again.\nBrowser WebMCP hosts can call `get-visual-edit-prompt`. Never acknowledge\nbefore applying the source change.\n\n- Style, text, and drag/drop edits collect into one pending batch for a single\n apply.\n- After the write lands, the target app's own dev-server HMR refreshes the\n frames \u2014 no manual reload. If frames do not refresh, the write did not land;\n say so rather than assuming.\n- The separate disk-icon \"Apply to source\" button is the deterministic\n whole-file HTML/CSS writer. It is intentionally disabled for compiled\n `.jsx`/`.tsx` routes \u2014 those must go through the agent path above.\n\n## Editing URLs\n\nKeep localhost screens as URL files plus `screenMetadata[fileId]`. Do not\nreplace them with copied `srcdoc` HTML unless the user explicitly asks for a\nfrozen snapshot. To change a state, rerun `open-visual-edit` with the new\npath/query, use the Screen settings section, call `update-screen-source`, or\nduplicate the screen and update the copy's URL metadata.\n\n## Local Files in the Code Tab\n\nOnce a connection is registered, the design editor's Code panel (left rail \u2192\nCode, or `navigate --view editor --designId <id> --leftPanel code`) shows a\nlocal-files workspace root for that connection next to the design's own files.\nTreat that root like VS Code opened at the connected project directory: file\ntree, search, open/edit, and save are backed by the real local files. It lists\nthe connected app's text/code files through the bridge\n(`list-local-files` / `read-local-file`); build output, `node_modules`,\n`.git`, and secret-looking paths (`.env*`, key files) are always excluded.\n\n- Browsing and reading need only editor access on the design plus the running\n bridge.\n- Saving goes through `write-local-file`: the first save opens the\n write-consent dialog (an 8-hour, folder-scoped grant) and retries\n automatically once granted. Only text/code files are writable; secret paths\n are always blocked.\n- If the agent calls `write-local-file` directly (not through a UI save) and it\n fails with \"no write-consent grant\", call `request-localhost-write-consent`.\n It opens the write-consent dialog in the editor, or reports `alreadyGranted`\n if one already exists. Granting is human-only \u2014\n `grant-localhost-write-consent` is hidden from agents, so you cannot approve\n it yourself. Tell the user to click \"Allow writes\", then retry\n `write-local-file` once. Do not keep retrying blindly: the write stays\n blocked until the user approves.\n- Saves are conflict-checked against the file's on-disk version \u2014 a file that\n changed since it was read fails with a version conflict instead of being\n overwritten.\n\n## React Source Writeback\n\n- Use compiler/debug provenance (project-relative file, line, column,\n component, and runtime multiplicity) to locate React/TSX source. Treat it as\n evidence, not as permission for a generic AST structural transform.\n- Read `positionPrecision` on every anchor before you trust `line`/`column`.\n `authored` means those are the real JSX coordinates. `transformed` means they\n are the dev server's own output coordinates \u2014 React 19 removed `_debugSource`\n and exposes only an owner stack, so this is the normal case on a Vite/Next\n dev server, and the line will not match the file. `unknown` means no tier was\n reported. On anything but `authored`, use the file and component to find the\n element by its JSX shape and re-derive the line from the file you read; never\n edit at the reported line.\n- A single-instance leaf text edit, literal `className`/`class` edit, or flat\n literal `style={{ ... }}` property may use `apply-visual-edit` with a\n `local-file` source and a complete `target.sourceAnchor`. Forward the\n anchor's `positionPrecision` with it \u2014 the action refuses a `transformed`\n anchor with `status: \"needsAgent\"` instead of seeking to a line that means\n something else in the authored file. Preview first (omit `persist`), inspect\n `proposedDiff`, then call with `persist: true`.\n- Reparenting, grouping/ungrouping, wrappers, dynamic expressions, repeated\n `.map()` instances, shared components, breakpoint-scoped edits, and\n cross-file changes go through the coding agent with complete subject/target\n anchors and their runtime relationship. `apply-visual-edit` refuses these\n with `status: \"needsAgent\"` rather than guessing.\n- Before each write, read the file and pass its exact `versionHash` to\n `write-local-file` with `requireExpectedVersionHash: true`; on conflict,\n re-read and re-plan. Keep the optimistic preview until HMR/runtime confirms\n the result. Human write consent remains mandatory and agents cannot grant it.\n\n## Verification\n\nFor a plain \"open this app\" request, `open-visual-edit`'s own response is\nthe verification \u2014 see Open The Design Surface. Reach for the checks below\nonly to diagnose an actual report, or to confirm an applied edit landed:\n\n- `list-localhost-connections` returns the expected connection and routes.\n- The Design editor opens in overview mode.\n- Every requested screen renders the intended localhost URL, showing real app\n content rather than an endless loading spinner.\n- The screen iframe carries a `src`, not a `srcdoc`. A localhost screen with a\n `srcdoc` is a bug, not a slow load \u2014 check it in the browser devtools before\n reporting the canvas as working.\n- Alt-dragging a screen copies the URL-backed frame, not an inline HTML clone.\n- A query/path edit changes only the target screen's URL metadata and iframe.\n- `get-visual-edit-pending` is the tab-free handoff; acknowledge its revision\n after applying. `get-visual-edit-prompt` is the browser equivalent.\n- The Code tab shows a local-files root for the connection and opens its files.\n";
|
|
@@ -49,9 +49,9 @@ no connector installation.
|
|
|
49
49
|
|
|
50
50
|
## Put Design Beside The Chat
|
|
51
51
|
|
|
52
|
-
Prefer the
|
|
53
|
-
chat
|
|
54
|
-
|
|
52
|
+
Prefer the MCP App from \`open-visual-edit\`: it keeps Design beside
|
|
53
|
+
chat. Use **Copy prompt** to hand the visual edits to the coding agent; the host
|
|
54
|
+
may request conversation confirmation. Otherwise,
|
|
55
55
|
\`openUrl\` is a credential-free, read-only fallback; never claim it is editable.
|
|
56
56
|
|
|
57
57
|
- Inline-browser hosts should open \`https://design.agent-native.com/visual-edit\`
|
|
@@ -243,8 +243,8 @@ check meaningful URL, hover, focus, scroll, and modal states.
|
|
|
243
243
|
## Account And Sharing Model
|
|
244
244
|
|
|
245
245
|
- The capability permits live iframe inspection, session-local edits, undo/redo,
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
and **Copy prompt**. The copied instructions go to the coding agent; they do
|
|
247
|
+
not persist account-owned Design data.
|
|
248
248
|
- Public \`/design/:id\` links stay read-only without a signed-in owner/editor
|
|
249
249
|
session. Never use the local capability to upgrade that ordinary sharing
|
|
250
250
|
surface.
|
|
@@ -503,8 +503,9 @@ Pass the ID after \`visual-edit\` in the Design URL; the CLI prints that
|
|
|
503
503
|
design's prompt (\`null\` when empty).
|
|
504
504
|
|
|
505
505
|
Canvas edits on a localhost screen never write source directly. They stay
|
|
506
|
-
pending until the
|
|
507
|
-
|
|
506
|
+
pending until the coding agent pulls them with \`get-visual-edit-pending\` or the
|
|
507
|
+
copied prompt, then writes them to source. There is no separate canvas Apply
|
|
508
|
+
button. An MCP App sends its prompt through the host or local Design agent;
|
|
508
509
|
otherwise use **Copy prompt to your agent**.
|
|
509
510
|
|
|
510
511
|
ChatGPT and Claude Code should pull, apply, acknowledge, and pull again.
|
|
@@ -130,7 +130,11 @@ export function useAgentEngineConfigured(enabled = true, options) {
|
|
|
130
130
|
return check(options);
|
|
131
131
|
};
|
|
132
132
|
const onConfiguredChanged = () => {
|
|
133
|
-
|
|
133
|
+
// Read after the shared client-status cache invalidates in its listener.
|
|
134
|
+
queueMicrotask(() => {
|
|
135
|
+
if (!cancelled)
|
|
136
|
+
checkNow();
|
|
137
|
+
});
|
|
134
138
|
};
|
|
135
139
|
const onMissing = (event) => {
|
|
136
140
|
if (!missingKeyEventMatchesScope(event, options))
|
|
@@ -38,19 +38,19 @@ export declare const postAwareness: import("h3").EventHandlerWithFetch<import("h
|
|
|
38
38
|
error: string;
|
|
39
39
|
states?: undefined;
|
|
40
40
|
} | {
|
|
41
|
+
error?: undefined;
|
|
41
42
|
states: {
|
|
42
43
|
clientId: number;
|
|
43
44
|
state: string;
|
|
44
45
|
}[];
|
|
45
|
-
error?: undefined;
|
|
46
46
|
}>>;
|
|
47
47
|
export declare const getActiveUsers: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
48
48
|
error: string;
|
|
49
49
|
users?: undefined;
|
|
50
50
|
} | {
|
|
51
|
+
error?: undefined;
|
|
51
52
|
users: {
|
|
52
53
|
clientId: number;
|
|
53
54
|
lastSeen: number;
|
|
54
55
|
}[];
|
|
55
|
-
error?: undefined;
|
|
56
56
|
}>>;
|
package/dist/collab/routes.d.ts
CHANGED
|
@@ -8,16 +8,16 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
|
|
|
8
8
|
state: string;
|
|
9
9
|
}>>;
|
|
10
10
|
export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
11
|
-
ok?: undefined;
|
|
12
11
|
error: string;
|
|
12
|
+
ok?: undefined;
|
|
13
13
|
} | {
|
|
14
14
|
error?: undefined;
|
|
15
15
|
ok: boolean;
|
|
16
16
|
}>>;
|
|
17
17
|
export declare const postCollabText: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
18
18
|
ok?: undefined;
|
|
19
|
-
text?: undefined;
|
|
20
19
|
error: string;
|
|
20
|
+
text?: undefined;
|
|
21
21
|
} | {
|
|
22
22
|
error?: undefined;
|
|
23
23
|
ok: boolean;
|
|
@@ -35,20 +35,20 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
35
35
|
} | {
|
|
36
36
|
error: string;
|
|
37
37
|
url?: undefined;
|
|
38
|
+
id?: undefined;
|
|
38
39
|
provider?: undefined;
|
|
39
40
|
configured?: undefined;
|
|
40
|
-
id?: undefined;
|
|
41
41
|
} | {
|
|
42
42
|
url: string;
|
|
43
43
|
id: string;
|
|
44
44
|
provider: string;
|
|
45
|
-
configured?: undefined;
|
|
46
45
|
error?: undefined;
|
|
46
|
+
configured?: undefined;
|
|
47
47
|
} | {
|
|
48
48
|
url?: undefined;
|
|
49
|
+
id?: undefined;
|
|
49
50
|
provider?: undefined;
|
|
50
51
|
error: string;
|
|
51
52
|
configured: boolean;
|
|
52
|
-
id?: undefined;
|
|
53
53
|
}>;
|
|
54
54
|
export default _default;
|
|
@@ -27,38 +27,38 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
27
27
|
thumbsUpRate: number;
|
|
28
28
|
avgEvalScore: number;
|
|
29
29
|
} | {
|
|
30
|
+
id?: undefined;
|
|
31
|
+
ok?: undefined;
|
|
30
32
|
error: string;
|
|
31
33
|
message: string;
|
|
32
34
|
summary?: undefined;
|
|
33
35
|
spans?: undefined;
|
|
34
|
-
id?: undefined;
|
|
35
|
-
ok?: undefined;
|
|
36
36
|
} | {
|
|
37
|
+
id?: undefined;
|
|
37
38
|
error?: undefined;
|
|
39
|
+
ok?: undefined;
|
|
38
40
|
message?: undefined;
|
|
39
41
|
summary: import("./types.js").TraceSummary;
|
|
40
42
|
spans: import("./types.js").TraceSpan[];
|
|
41
|
-
id?: undefined;
|
|
42
|
-
ok?: undefined;
|
|
43
43
|
} | {
|
|
44
44
|
error?: undefined;
|
|
45
|
+
ok?: undefined;
|
|
45
46
|
message?: undefined;
|
|
46
47
|
summary?: undefined;
|
|
47
48
|
spans?: undefined;
|
|
48
49
|
id: string;
|
|
49
|
-
ok?: undefined;
|
|
50
50
|
} | {
|
|
51
|
+
id?: undefined;
|
|
52
|
+
ok?: undefined;
|
|
51
53
|
message?: undefined;
|
|
52
54
|
summary?: undefined;
|
|
53
55
|
spans?: undefined;
|
|
54
|
-
id?: undefined;
|
|
55
56
|
error: any;
|
|
56
|
-
ok?: undefined;
|
|
57
57
|
} | {
|
|
58
|
+
id?: undefined;
|
|
58
59
|
error?: undefined;
|
|
59
60
|
message?: undefined;
|
|
60
61
|
summary?: undefined;
|
|
61
62
|
spans?: undefined;
|
|
62
|
-
id?: undefined;
|
|
63
63
|
ok: boolean;
|
|
64
64
|
}>>;
|
package/dist/secrets/routes.d.ts
CHANGED
|
@@ -55,31 +55,31 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
|
|
|
55
55
|
} | {
|
|
56
56
|
error: string;
|
|
57
57
|
errorCode?: undefined;
|
|
58
|
-
ok?: undefined;
|
|
59
58
|
status?: undefined;
|
|
59
|
+
ok?: undefined;
|
|
60
60
|
} | {
|
|
61
61
|
error: string;
|
|
62
62
|
errorCode: string;
|
|
63
|
-
ok?: undefined;
|
|
64
63
|
status?: undefined;
|
|
64
|
+
ok?: undefined;
|
|
65
65
|
} | {
|
|
66
66
|
errorCode?: undefined;
|
|
67
67
|
ok: boolean;
|
|
68
68
|
status: string;
|
|
69
69
|
error?: undefined;
|
|
70
70
|
} | {
|
|
71
|
-
ok?: undefined;
|
|
72
71
|
error: string;
|
|
73
72
|
removed?: undefined;
|
|
73
|
+
ok?: undefined;
|
|
74
74
|
} | {
|
|
75
75
|
ok: boolean;
|
|
76
76
|
removed: boolean;
|
|
77
77
|
error?: undefined;
|
|
78
78
|
}>>;
|
|
79
79
|
export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
80
|
-
ok?: undefined;
|
|
81
80
|
error: string;
|
|
82
81
|
note?: undefined;
|
|
82
|
+
ok?: undefined;
|
|
83
83
|
} | {
|
|
84
84
|
ok: boolean;
|
|
85
85
|
note?: undefined;
|
|
@@ -8,17 +8,17 @@ export declare const AGENT_ENGINE_API_KEY_ACTION_NAME = "agent-engine-api-key";
|
|
|
8
8
|
* resolveEngine's credential detection.
|
|
9
9
|
*/
|
|
10
10
|
export declare function createAgentEngineDisconnectHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
11
|
-
ok?: undefined;
|
|
12
11
|
error: string;
|
|
13
12
|
scope?: undefined;
|
|
13
|
+
ok?: undefined;
|
|
14
14
|
} | {
|
|
15
15
|
ok: boolean;
|
|
16
16
|
error: any;
|
|
17
17
|
scope?: undefined;
|
|
18
18
|
} | {
|
|
19
|
-
error?: undefined;
|
|
20
19
|
ok: boolean;
|
|
21
20
|
scope: "org" | "user";
|
|
21
|
+
error?: undefined;
|
|
22
22
|
}>>;
|
|
23
23
|
export interface DefaultModelSelectionRequest {
|
|
24
24
|
engine: string;
|
|
@@ -54,8 +54,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
|
|
|
54
54
|
expiresAt?: undefined;
|
|
55
55
|
ttlSeconds?: undefined;
|
|
56
56
|
} | {
|
|
57
|
+
error?: undefined;
|
|
57
58
|
token: string;
|
|
58
59
|
expiresAt: string;
|
|
59
60
|
ttlSeconds: number;
|
|
60
|
-
error?: undefined;
|
|
61
61
|
}>>;
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable user-facing changes to this app are documented here.
|
|
4
4
|
|
|
5
|
+
## 2026-09-30
|
|
6
|
+
|
|
7
|
+
### Improved
|
|
8
|
+
|
|
9
|
+
- Chat uses a compact + menu with context submenus, keeps task, automation, and skill actions at the root, and omits Generate Image.
|
|
10
|
+
|
|
5
11
|
## 2026-09-27
|
|
6
12
|
|
|
7
13
|
### Fixed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.198.7
|
|
3
|
+
"version": "0.198.7",
|
|
4
4
|
"description": "The agentic application framework for building autonomous agents with intuitive UIs",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -662,8 +662,8 @@
|
|
|
662
662
|
"yaml": "^2.9.0",
|
|
663
663
|
"yjs": "^13.6.33",
|
|
664
664
|
"zod": "^4.3.6",
|
|
665
|
-
"@agent-native/agentkit": "^0.198.7
|
|
666
|
-
"@agent-native/recap-cli": "^0.5.
|
|
665
|
+
"@agent-native/agentkit": "^0.198.7",
|
|
666
|
+
"@agent-native/recap-cli": "^0.5.57"
|
|
667
667
|
},
|
|
668
668
|
"devDependencies": {
|
|
669
669
|
"@ai-sdk/anthropic": "^3.0.71",
|
|
@@ -734,7 +734,7 @@
|
|
|
734
734
|
"xlsx": "^0.18.5"
|
|
735
735
|
},
|
|
736
736
|
"peerDependencies": {
|
|
737
|
-
"@agent-native/core-corpus": "0.
|
|
737
|
+
"@agent-native/core-corpus": ">=0.196.0",
|
|
738
738
|
"@ai-sdk/anthropic": ">=3",
|
|
739
739
|
"@ai-sdk/cohere": ">=3",
|
|
740
740
|
"@ai-sdk/google": ">=3",
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable user-facing changes to this app are documented here.
|
|
4
4
|
|
|
5
|
+
## 2026-09-30
|
|
6
|
+
|
|
7
|
+
### Improved
|
|
8
|
+
|
|
9
|
+
- Chat uses a compact + menu with context submenus, keeps task, automation, and skill actions at the root, and omits Generate Image.
|
|
10
|
+
|
|
5
11
|
## 2026-09-27
|
|
6
12
|
|
|
7
13
|
### Fixed
|