@agent-native/core 0.80.9 → 0.80.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +7 -0
  3. package/corpus/core/package.json +1 -1
  4. package/corpus/core/src/cli/design-connect.ts +28 -2
  5. package/corpus/core/src/cli/skills.ts +45 -24
  6. package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +717 -0
  7. package/corpus/templates/design/actions/add-breakpoint.ts +143 -0
  8. package/corpus/templates/design/actions/add-localhost-screens.ts +5 -0
  9. package/corpus/templates/design/actions/apply-a11y-fix.ts +317 -0
  10. package/corpus/templates/design/actions/apply-component-prop-edit.ts +433 -0
  11. package/corpus/templates/design/actions/apply-design-state.ts +200 -0
  12. package/corpus/templates/design/actions/apply-design-token-edit.ts +202 -0
  13. package/corpus/templates/design/actions/apply-motion-edit.ts +450 -0
  14. package/corpus/templates/design/actions/apply-shader-fill.ts +404 -0
  15. package/corpus/templates/design/actions/apply-visual-edit.ts +191 -5
  16. package/corpus/templates/design/actions/capture-design-state.ts +224 -0
  17. package/corpus/templates/design/actions/connect-builder-app.ts +162 -0
  18. package/corpus/templates/design/actions/create-component.ts +447 -0
  19. package/corpus/templates/design/actions/create-design-branch.ts +263 -0
  20. package/corpus/templates/design/actions/create-design-state.ts +162 -0
  21. package/corpus/templates/design/actions/delete-design-state.ts +55 -0
  22. package/corpus/templates/design/actions/deploy-design-preview.ts +275 -0
  23. package/corpus/templates/design/actions/get-component-details.ts +242 -0
  24. package/corpus/templates/design/actions/get-design-branch-diff.ts +362 -0
  25. package/corpus/templates/design/actions/get-design-review.ts +314 -0
  26. package/corpus/templates/design/actions/get-design-surface-index.ts +582 -0
  27. package/corpus/templates/design/actions/get-motion-timeline.ts +99 -0
  28. package/corpus/templates/design/actions/index-components.ts +258 -0
  29. package/corpus/templates/design/actions/index-design-tokens.ts +273 -0
  30. package/corpus/templates/design/actions/list-design-extensions.ts +309 -0
  31. package/corpus/templates/design/actions/list-design-source-capabilities.ts +153 -0
  32. package/corpus/templates/design/actions/list-design-states.ts +72 -0
  33. package/corpus/templates/design/actions/migrate-inline-design-to-app.ts +298 -0
  34. package/corpus/templates/design/actions/open-component-source.ts +237 -0
  35. package/corpus/templates/design/actions/preview-component-prop-edit.ts +254 -0
  36. package/corpus/templates/design/actions/preview-design-token-edit.ts +113 -0
  37. package/corpus/templates/design/actions/preview-shader-fill.ts +189 -0
  38. package/corpus/templates/design/actions/remove-breakpoint.ts +103 -0
  39. package/corpus/templates/design/actions/remove-motion-timeline.ts +196 -0
  40. package/corpus/templates/design/actions/run-design-audit.ts +421 -0
  41. package/corpus/templates/design/actions/run-design-extension-action.ts +284 -0
  42. package/corpus/templates/design/actions/set-active-breakpoint.ts +39 -0
  43. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +1414 -71
  44. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +632 -43
  45. package/corpus/templates/design/app/components/design/DrawOverlay.tsx +1 -1
  46. package/corpus/templates/design/app/components/design/EditPanel.tsx +1391 -52
  47. package/corpus/templates/design/app/components/design/LayersPanel.tsx +4 -3
  48. package/corpus/templates/design/app/components/design/LocalSourceEditBanner.tsx +157 -0
  49. package/corpus/templates/design/app/components/design/MotionDock.tsx +1062 -0
  50. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +1052 -98
  51. package/corpus/templates/design/app/components/design/ReviewPanel.tsx +759 -0
  52. package/corpus/templates/design/app/components/design/StatesPanel.tsx +579 -0
  53. package/corpus/templates/design/app/components/design/TokensPanel.tsx +573 -0
  54. package/corpus/templates/design/app/components/design/canvas-primitive-style.ts +241 -0
  55. package/corpus/templates/design/app/components/design/index.ts +16 -0
  56. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +15 -6
  57. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +66 -3
  58. package/corpus/templates/design/app/components/design/inspector/InspectorAiActions.tsx +145 -0
  59. package/corpus/templates/design/app/components/design/inspector/SHADER_INTEGRATION.md +42 -12
  60. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +1 -1
  61. package/corpus/templates/design/app/hooks/useAgentEditRequest.ts +131 -0
  62. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +3 -1
  63. package/corpus/templates/design/app/i18n/zh-TW.ts +31 -0
  64. package/corpus/templates/design/app/i18n-data.ts +269 -0
  65. package/corpus/templates/design/app/pages/DesignEditor.tsx +2478 -386
  66. package/corpus/templates/design/changelog/2026-06-29-added-a-review-panel-in-the-design-editor-s-inspector-with-a.md +6 -0
  67. package/corpus/templates/design/changelog/2026-06-29-copying-and-pasting-layers-no-longer-shows-success-notificat.md +6 -0
  68. package/corpus/templates/design/changelog/2026-06-29-device-presets-in-all-screens-view-resize-the-selected-previ.md +6 -0
  69. package/corpus/templates/design/changelog/2026-06-29-layer-and-canvas-drags-keep-the-layer-list-stable-while-chan.md +6 -0
  70. package/corpus/templates/design/changelog/2026-06-29-layer-moves-can-be-undone-and-redone-without-flashing-the-ca.md +6 -0
  71. package/corpus/templates/design/changelog/2026-06-29-screen-previews-use-a-single-blue-hover-border-in-all-screen.md +6 -0
  72. package/corpus/templates/design/changelog/2026-06-29-selected-containers-show-draggable-padding-and-gap-guides-on.md +6 -0
  73. package/corpus/templates/design/changelog/2026-06-29-the-design-editor-adds-a-studio-layer-with-tokens-respon.md +6 -0
  74. package/corpus/templates/design/changelog/2026-06-30-accessibility-findings-now-offer-a-one-click-fix.md +6 -0
  75. package/corpus/templates/design/changelog/2026-06-30-component-instances-now-have-editable-props-in-the-inspe.md +6 -0
  76. package/corpus/templates/design/changelog/2026-06-30-inspect-code-now-shows-the-elements-opening-tag-at-a-gla.md +6 -0
  77. package/corpus/templates/design/changelog/2026-06-30-shader-fill-presets-can-now-be-applied-to-an-element.md +6 -0
  78. package/corpus/templates/design/changelog/2026-06-30-the-motion-timeline-can-now-add-a-track-to-any-element-a.md +6 -0
  79. package/corpus/templates/design/changelog/2026-06-30-visual-editor-selection-layer-paint-and-drawing-controls-are-more-reliable.md +6 -0
  80. package/corpus/templates/design/e2e/helpers.ts +10 -4
  81. package/corpus/templates/design/server/db/schema.ts +123 -0
  82. package/corpus/templates/design/server/plugins/db.ts +90 -0
  83. package/corpus/templates/design/shared/builder-app.ts +297 -0
  84. package/corpus/templates/design/shared/capability-resolver.ts +123 -0
  85. package/corpus/templates/design/shared/capture-sanitize.ts +70 -0
  86. package/corpus/templates/design/shared/code-layer.ts +1016 -71
  87. package/corpus/templates/design/shared/component-model.ts +239 -0
  88. package/corpus/templates/design/shared/design-review.ts +275 -0
  89. package/corpus/templates/design/shared/design-source-capabilities.ts +286 -0
  90. package/corpus/templates/design/shared/design-state.ts +112 -0
  91. package/corpus/templates/design/shared/design-surface-index.ts +258 -0
  92. package/corpus/templates/design/shared/motion-compiler.ts +278 -0
  93. package/corpus/templates/design/shared/motion-timeline.ts +193 -0
  94. package/corpus/templates/design/shared/responsive-classes.ts +452 -0
  95. package/corpus/templates/design/shared/shader-fill.ts +323 -0
  96. package/corpus/templates/design/shared/source-mode.ts +245 -0
  97. package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +6 -2
  98. package/corpus/templates/plan/changelog/2026-06-29-plan-canvases-open-without-an-initial-pan-and-zoom-flicker.md +6 -0
  99. package/dist/cli/design-connect.d.ts.map +1 -1
  100. package/dist/cli/design-connect.js +28 -2
  101. package/dist/cli/design-connect.js.map +1 -1
  102. package/dist/cli/skills.d.ts.map +1 -1
  103. package/dist/cli/skills.js +37 -21
  104. package/dist/cli/skills.js.map +1 -1
  105. package/dist/collab/routes.d.ts +1 -1
  106. package/dist/file-upload/actions/upload-image.d.ts +2 -2
  107. package/dist/notifications/routes.d.ts +2 -2
  108. package/dist/observability/routes.d.ts +7 -7
  109. package/dist/resources/handlers.d.ts +2 -2
  110. package/dist/server/transcribe-voice.d.ts +1 -1
  111. package/package.json +1 -1
package/corpus/README.md CHANGED
@@ -28,4 +28,4 @@ rg -n "defineAction|useActionQuery" node_modules/@agent-native/core/corpus
28
28
  ## Generated Counts
29
29
 
30
30
  - core files: 2043
31
- - template files: 4649
31
+ - template files: 4719
@@ -1,5 +1,12 @@
1
1
  # @agent-native/core
2
2
 
3
+ ## 0.80.10
4
+
5
+ ### Patch Changes
6
+
7
+ - d26a679: Design connect: document the per-element provenance contract (`data-source-file` / `data-source-line` / `data-source-column` / `data-component-name`, plus `data-loc` shorthand) used to map a selected element back to its source location, and surface it in `design connect --help`. The `resolveNodeToFile` bridge capability now carries a reason string describing this contract.
8
+ - d26a679: Harden the app-backed skill installer for visual-plan feedback: built-in skill folders now stage writes before replacing existing installs, include first-time install command metadata, and make `skills update` point first-time users to `skills add` for setup and MCP registration.
9
+
3
10
  ## 0.80.9
4
11
 
5
12
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.80.9",
3
+ "version": "0.80.10",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -367,7 +367,14 @@ export async function prepareDesignConnectManifest(
367
367
  reason:
368
368
  operation === "writeFile"
369
369
  ? "The bridge advertises the contract before enabling local file writes."
370
- : undefined,
370
+ : operation === "resolveNodeToFile"
371
+ ? // resolveNodeToFile maps a runtime DOM node id (from the editor's
372
+ // 'select' payload) to { file, line, component } provenance. The
373
+ // bridge endpoint exists; per-element provenance data must be
374
+ // emitted by the connected app at build time — see the provenance
375
+ // note in the help text below.
376
+ "Requires the connected app to emit data-source-file / data-source-line / data-component-name attributes (e.g. via @vitejs/plugin-react jsxDEV or a Babel source plugin)."
377
+ : undefined,
371
378
  })),
372
379
  };
373
380
  }
@@ -442,7 +449,26 @@ Options:
442
449
  --route-manifest <path> Non-destructive route manifest output path
443
450
  --json Print the manifest JSON and exit
444
451
  --once Prepare/scaffold the manifest and exit
445
- --dry-run Print what would be exposed without writing files`);
452
+ --dry-run Print what would be exposed without writing files
453
+
454
+ Element provenance (resolveNodeToFile):
455
+ The design editor can map a selected DOM element back to its source file,
456
+ line, and React component name when the connected app emits provenance
457
+ attributes at build time. Add one of the following to your app's build:
458
+
459
+ • @vitejs/plugin-react with jsxDEV enabled (development mode default):
460
+ Sets data-source-file and data-source-line on each JSX element
461
+ automatically when using the Babel transform.
462
+
463
+ • A Babel source plugin (e.g. babel-plugin-react-source or a custom plugin):
464
+ Emits data-source-file="src/Button.tsx" data-source-line="12"
465
+ data-source-column="4" data-component-name="Button" on each element.
466
+
467
+ • data-loc="src/Button.tsx:12:4" shorthand attribute (Babel source convention):
468
+ The bridge parses this as { sourceFile, line, column } automatically.
469
+
470
+ Without these attributes the editor still works; provenance is simply absent.
471
+ Cross-origin localhost iframes cannot be read regardless of attributes (CSP).`);
446
472
  }
447
473
 
448
474
  export async function runDesign(argv: string[]) {
@@ -3073,6 +3073,7 @@ interface SkillInstallMetadata {
3073
3073
  contentHash: string;
3074
3074
  mcpUrl: string;
3075
3075
  installedAt: string;
3076
+ installCommand: string;
3076
3077
  updateCommand: string;
3077
3078
  planMode?: PlanInstallMode;
3078
3079
  }
@@ -3489,30 +3490,48 @@ function writeSkillFolder(
3489
3490
  bundle: SkillFolderBundle,
3490
3491
  installedAt = new Date().toISOString(),
3491
3492
  ): void {
3492
- fs.rmSync(dir, { recursive: true, force: true });
3493
- fs.mkdirSync(dir, { recursive: true });
3494
- for (const [rel, content] of Object.entries(bundle.files)) {
3495
- const target = path.join(dir, rel);
3496
- fs.mkdirSync(path.dirname(target), { recursive: true });
3497
- fs.writeFileSync(target, content, "utf-8");
3498
- }
3499
- const metadata: SkillInstallMetadata = {
3500
- schemaVersion: 1,
3501
- source: "agent-native",
3502
- appSkillId: bundle.appSkillId,
3503
- displayName: bundle.displayName,
3504
- skillName: bundle.skillName,
3505
- contentHash: bundle.contentHash,
3506
- mcpUrl: bundle.mcpUrl,
3507
- installedAt,
3508
- updateCommand: `npx @agent-native/core@latest skills update ${bundle.skillName}`,
3509
- ...(bundle.planMode ? { planMode: bundle.planMode } : {}),
3510
- };
3511
- fs.writeFileSync(
3512
- path.join(dir, AGENT_NATIVE_SKILL_METADATA_FILE),
3513
- `${JSON.stringify(metadata, null, 2)}\n`,
3514
- "utf-8",
3493
+ const parent = path.dirname(dir);
3494
+ const tempDir = path.join(
3495
+ parent,
3496
+ `.${path.basename(dir)}.${process.pid}.${Date.now()}.tmp`,
3515
3497
  );
3498
+ try {
3499
+ fs.rmSync(tempDir, { recursive: true, force: true });
3500
+ fs.mkdirSync(tempDir, { recursive: true });
3501
+ for (const [rel, content] of Object.entries(bundle.files)) {
3502
+ const target = path.join(tempDir, rel);
3503
+ fs.mkdirSync(path.dirname(target), { recursive: true });
3504
+ fs.writeFileSync(target, content, "utf-8");
3505
+ }
3506
+ const metadata: SkillInstallMetadata = {
3507
+ schemaVersion: 1,
3508
+ source: "agent-native",
3509
+ appSkillId: bundle.appSkillId,
3510
+ displayName: bundle.displayName,
3511
+ skillName: bundle.skillName,
3512
+ contentHash: bundle.contentHash,
3513
+ mcpUrl: bundle.mcpUrl,
3514
+ installedAt,
3515
+ installCommand: `npx @agent-native/core@latest skills add ${bundle.skillName}`,
3516
+ updateCommand: `npx @agent-native/core@latest skills update ${bundle.skillName}`,
3517
+ ...(bundle.planMode ? { planMode: bundle.planMode } : {}),
3518
+ };
3519
+ fs.writeFileSync(
3520
+ path.join(tempDir, AGENT_NATIVE_SKILL_METADATA_FILE),
3521
+ `${JSON.stringify(metadata, null, 2)}\n`,
3522
+ "utf-8",
3523
+ );
3524
+ fs.rmSync(dir, { recursive: true, force: true });
3525
+ fs.renameSync(tempDir, dir);
3526
+ } catch (error: any) {
3527
+ try {
3528
+ fs.rmSync(tempDir, { recursive: true, force: true });
3529
+ } catch {}
3530
+ throw new Error(
3531
+ `Cannot write Agent Native skill folder ${dir}: ${error?.message ?? error}`,
3532
+ { cause: error },
3533
+ );
3534
+ }
3516
3535
  }
3517
3536
 
3518
3537
  function isJsonRecord(value: unknown): value is Record<string, unknown> {
@@ -6228,7 +6247,9 @@ function runSkillsStatusOrUpdate(
6228
6247
  const target = parsed.target ? ` for ${parsed.target}` : "";
6229
6248
  const hint = isScaffoldGuidanceTarget(parsed.target)
6230
6249
  ? `Run this from a generated Agent Native app or workspace root.\n`
6231
- : `Run "npx @agent-native/core@latest skills add ${parsed.target ?? "visual-plan"}" to install one.\n`;
6250
+ : update
6251
+ ? `The update command only refreshes skill folders that already exist; it does not do first-time install, MCP registration, or auth. Run "npx @agent-native/core@latest skills add ${parsed.target ?? "visual-plan"}" for one-step setup.\n`
6252
+ : `Run "npx @agent-native/core@latest skills add ${parsed.target ?? "visual-plan"}" to install one.\n`;
6232
6253
  process.stdout.write(
6233
6254
  `No installed Agent Native skill copies found${target}.\n${hint}`,
6234
6255
  );