@agent-native/core 0.232.0 → 0.233.0-nightly-20261124004026

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 (119) hide show
  1. package/dist/a2a/handlers.js +60 -1
  2. package/dist/a2a/server.js +9 -0
  3. package/dist/action-call-classification.d.ts +9 -0
  4. package/dist/action-call-classification.js +18 -0
  5. package/dist/action-conformance.d.ts +81 -0
  6. package/dist/action-conformance.js +392 -0
  7. package/dist/action.d.ts +18 -0
  8. package/dist/action.js +68 -5
  9. package/dist/agent/execution-fence.d.ts +3 -1
  10. package/dist/agent/execution-fence.js +13 -2
  11. package/dist/agent/production-agent.d.ts +3 -0
  12. package/dist/agent/production-agent.js +301 -145
  13. package/dist/agent/run-store.js +11 -0
  14. package/dist/agent/thread-data-builder.d.ts +2 -0
  15. package/dist/agent/thread-data-builder.js +5 -1
  16. package/dist/app-config/schema.d.ts +24 -1
  17. package/dist/application-state/handlers.d.ts +1 -1
  18. package/dist/application-state/navigate-write-guard.d.ts +4 -1
  19. package/dist/application-state/navigate-write-guard.js +15 -1
  20. package/dist/cli/design-connect.js +5 -1
  21. package/dist/cli/matched-check.d.ts +1 -0
  22. package/dist/cli/matched-check.js +76 -0
  23. package/dist/client/agent-chat/index.d.ts +1 -1
  24. package/dist/client/agent-chat/index.js +1 -1
  25. package/dist/client/analytics/index.d.ts +1 -1
  26. package/dist/client/analytics.d.ts +13 -1
  27. package/dist/client/analytics.js +5 -2
  28. package/dist/client/application-state.d.ts +11 -0
  29. package/dist/client/application-state.js +219 -23
  30. package/dist/client/chat/agentkit-agent-native.js +52 -11
  31. package/dist/client/chat/agentkit-protocol.js +23 -2
  32. package/dist/client/chat-first-state.d.ts +6 -0
  33. package/dist/client/chat-first-state.js +36 -1
  34. package/dist/client/feature-flags/use-feature-flag.js +14 -6
  35. package/dist/client/navigation/index.d.ts +2 -0
  36. package/dist/client/navigation/index.js +2 -0
  37. package/dist/client/route-state.js +60 -18
  38. package/dist/client/screen-settled.d.ts +71 -1
  39. package/dist/client/screen-settled.js +221 -3
  40. package/dist/client/sse-event-processor.d.ts +1 -0
  41. package/dist/client/sse-event-processor.js +89 -10
  42. package/dist/client/theme.d.ts +6 -0
  43. package/dist/client/theme.js +7 -1
  44. package/dist/client/use-action.js +32 -10
  45. package/dist/client/use-session.js +36 -18
  46. package/dist/collab/struct-routes.d.ts +1 -1
  47. package/dist/db/client.js +2 -2
  48. package/dist/db/errors.d.ts +2 -0
  49. package/dist/db/errors.js +38 -6
  50. package/dist/feature-flags/actions/get-feature-flags.js +9 -2
  51. package/dist/file-upload/actions/upload-image.d.ts +2 -2
  52. package/dist/framework-package-versions.json +8 -8
  53. package/dist/ingestion/index.d.ts +1 -0
  54. package/dist/ingestion/index.js +1 -0
  55. package/dist/ingestion/matched-capture.d.ts +173 -0
  56. package/dist/ingestion/matched-capture.js +574 -0
  57. package/dist/ingestion/pptx.d.ts +1 -0
  58. package/dist/ingestion/pptx.js +4 -2
  59. package/dist/labs/store.d.ts +3 -1
  60. package/dist/labs/store.js +8 -4
  61. package/dist/manifest/index.d.ts +142 -3
  62. package/dist/manifest/index.js +249 -19
  63. package/dist/mcp/build-server.d.ts +2 -0
  64. package/dist/mcp/build-server.js +8 -1
  65. package/dist/mcp/server.js +3 -1
  66. package/dist/notifications/routes.d.ts +3 -3
  67. package/dist/observability/metrics.d.ts +2 -0
  68. package/dist/observability/metrics.js +7 -0
  69. package/dist/org/index.d.ts +1 -1
  70. package/dist/provider-api/actions/custom-provider-registration.d.ts +10 -10
  71. package/dist/provider-api/actions/provider-api.d.ts +14 -14
  72. package/dist/server/action-routes.js +9 -0
  73. package/dist/server/agent-chat/prompt-resources.js +107 -83
  74. package/dist/server/agent-run-context.d.ts +3 -0
  75. package/dist/server/agent-run-context.js +7 -0
  76. package/dist/server/builder-oauth.d.ts +1 -0
  77. package/dist/server/builder-oauth.js +40 -2
  78. package/dist/server/filesystem-action-entry.js +5 -0
  79. package/dist/server/first-touch-route.d.ts +2 -2
  80. package/dist/server/index.d.ts +2 -2
  81. package/dist/server/index.js +2 -2
  82. package/dist/server/open-route.js +10 -4
  83. package/dist/server/poll.d.ts +3 -0
  84. package/dist/server/poll.js +74 -14
  85. package/dist/server/request-context.d.ts +16 -6
  86. package/dist/server/request-context.js +4 -0
  87. package/dist/server/transcribe-voice.d.ts +1 -1
  88. package/dist/shared/analytics-events.d.ts +7 -0
  89. package/dist/shared/viewport-mode.d.ts +2 -0
  90. package/dist/shared/viewport-mode.js +9 -0
  91. package/dist/templates/chat/.agents/skills/actions/SKILL.md +1 -0
  92. package/dist/templates/chat/.agents/skills/build-an-app/SKILL.md +38 -17
  93. package/dist/templates/chat/.agents/skills/shadcn-ui/SKILL.md +3 -2
  94. package/dist/templates/default/.agents/skills/actions/SKILL.md +1 -0
  95. package/dist/templates/default/.agents/skills/build-an-app/SKILL.md +38 -17
  96. package/dist/templates/default/.agents/skills/shadcn-ui/SKILL.md +3 -2
  97. package/dist/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +3 -2
  98. package/dist/templates/headless/.agents/skills/actions/SKILL.md +1 -0
  99. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +1 -0
  100. package/dist/templates/workspace-core/.agents/skills/build-an-app/SKILL.md +38 -17
  101. package/dist/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +3 -2
  102. package/dist/testing.d.ts +1 -0
  103. package/dist/testing.js +1 -0
  104. package/dist/tracking/action-lifecycle.d.ts +2 -0
  105. package/dist/tracking/action-lifecycle.js +16 -5
  106. package/docs/content/actions-defining.mdx +7 -0
  107. package/docs/content/custom-design-system.mdx +4 -2
  108. package/package.json +3 -3
  109. package/src/templates/chat/.agents/skills/actions/SKILL.md +1 -0
  110. package/src/templates/chat/.agents/skills/build-an-app/SKILL.md +38 -17
  111. package/src/templates/chat/.agents/skills/shadcn-ui/SKILL.md +3 -2
  112. package/src/templates/default/.agents/skills/actions/SKILL.md +1 -0
  113. package/src/templates/default/.agents/skills/build-an-app/SKILL.md +38 -17
  114. package/src/templates/default/.agents/skills/shadcn-ui/SKILL.md +3 -2
  115. package/src/templates/factory/.agents/skills/review-latest-feedback/SKILL.md +3 -2
  116. package/src/templates/headless/.agents/skills/actions/SKILL.md +1 -0
  117. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +1 -0
  118. package/src/templates/workspace-core/.agents/skills/build-an-app/SKILL.md +38 -17
  119. package/src/templates/workspace-core/.agents/skills/shadcn-ui/SKILL.md +3 -2
@@ -25,17 +25,23 @@ order and decisions; use the edit-point reference for the scaffold you have.
25
25
 
26
26
  ## 1. Orient
27
27
 
28
- Read `AGENTS.md`, `DESIGN.md` if present, and `app-quality-bar`. Inspect the
29
- closest existing screen or action and the files you will edit. Use the bundled docs/source commands in
28
+ Read `AGENTS.md`, `DESIGN.md` if present, `product-judgment`, and `app-quality-bar`.
29
+ Run `product-judgment` Step 0 before writing code: grep `packages/core` and
30
+ `@agent-native/toolkit/craft` (plus `agent-native-toolkit` kits) so you reuse
31
+ existing primitives instead of rebuilding state boundaries, shortcut managers,
32
+ destructive dialogs, or optimistic hooks. Inspect the closest existing screen or
33
+ action and the files you will edit. Use the bundled docs/source commands in
30
34
  `AGENTS.md` only to answer a concrete API question; do not web-research
31
35
  framework APIs.
32
36
 
33
37
  ## 2. Decide
34
38
 
35
- Choose one or two interaction patterns. Write or update `DESIGN.md` as the
36
- single required design contract, with the chosen and rejected UX options.
37
- Register `app.manifest.ts` with real screens, entities, `viewPolicy`, and
38
- `suggestableCapabilities`. Choose these six things before writing code:
39
+ Run `product-judgment` Steps 1–2 before writing code: choose one or two
40
+ interaction patterns, write or update `DESIGN.md` as the single required design
41
+ contract with the 6-Axis Judgment Card and 3-Option Decision Block (chosen and
42
+ rejected UX options), and register `app.manifest.ts` with real screens,
43
+ entities, `viewPolicy`, and `suggestableCapabilities`. Choose these six things
44
+ before writing code:
39
45
 
40
46
  1. **Slice**: the one workflow that proves the app. For a booking app: create a
41
47
  booking, reject an overlap, cancel, weekly grid per room. Name what you are
@@ -119,16 +125,26 @@ The access table, the concurrency pattern, and the security rules are in
119
125
  - Load and write data with `useActionQuery` and `useActionMutation` from
120
126
  `@agent-native/core/client/hooks`. No `fetch`, and no `/api/*` routes for app
121
127
  data. Those routes are only for uploads, webhooks, OAuth callbacks, and streaming.
122
- - While data loads, show a `Skeleton` in the shape of the final layout, not a
123
- spinner or "Loading…".
124
- - Writes should feel instant. In `onMutate`, update `["action", "<name>", params]`
125
- with `setQueryData`; in `onError`, roll back and show
126
- `toast.error(actionErrorMessage(error) ?? "<fallback>")`.
128
+ - Use `@agent-native/toolkit/craft` primitives by default:
129
+ - `ResourceStateBoundary` for every async surface (requires a layout-matched
130
+ `skeleton`, an actionable `empty` CTA, and an `error` retry path — never a
131
+ spinner, bare `"Loading…"`, or dead-end `"Could not load"` screen).
132
+ - `useOptimisticAction` (or `onMutate` + `setQueryData` with `onError`
133
+ rollback and `toast.error(actionErrorMessage(error) ?? "<fallback>")`) so
134
+ writes acknowledge in `<100ms` and show a pending state within `<400ms`.
135
+ - `SafeDestructiveAction` for destructive verbs: instant optimistic action +
136
+ undo affordance when reversible, accessible `AlertDialog` confirmation when
137
+ irreversible — never `window.confirm`, `alert`, or `prompt`.
138
+ - `useCommandRegistry` for portable `Mod` (`Cmd`/`Ctrl`) shortcuts, `j`/`k`,
139
+ `Esc`, and `?` shortcut help that automatically ignore editable inputs.
140
+ - Style with semantic tokens from `@agent-native/toolkit/styles.css` (which
141
+ bundles `craft-tokens.css`: `--success`/`--warning`/`--info`, `--surface-0..3`,
142
+ `--density-*`, `--dur-instant`/`--dur-fast`/`--dur-panel`, `tabular-nums`, and
143
+ `640px` chat-companion `@container` utilities).
127
144
  - Import controls from `@/components/ui/*`. When one is missing (dialog,
128
145
  select, skeleton, alert-dialog), add a one-line re-export like `button.tsx`:
129
146
  `export * from "@agent-native/toolkit/ui/dialog";`.
130
- - Use Tabler icons only. Confirm with `AlertDialog`; never use `window.confirm`,
131
- `alert`, or `prompt`.
147
+ - Use Tabler icons only.
132
148
  - Don't add a page title that repeats the nav item, a subtitle under a title,
133
149
  or a stats strip. The data is the page. For visual direction, see `frontend-design`.
134
150
  - Follow the app's existing localization pattern for user-facing copy.
@@ -175,10 +191,13 @@ made from a stale view. See `real-time-sync`.
175
191
  message; read back the saved state through the matching list/get action.
176
192
  The CLI prints the failure message, not its structured `errorCode`, so also
177
193
  verify any code-specific behavior in the action contract or browser.
178
- 4. Apply the canonical 12-row rubric and automatic fails linked from
179
- `app-quality-bar`. Give the screenshots, rubric, and brief to a blind
180
- reviewer and use the lower score per row. Fix and recapture until the
181
- review passes.
194
+ 4. Run the `$0` static craft audit (`pnpm tsx scripts/guard-craft-slop.ts <app-dir>`)
195
+ and review the 5 Human-Team Lenses from `product-judgment` before capturing
196
+ screenshots. Then apply the canonical 12-row visual rubric and capture loop
197
+ from `skills/turn-into-app/references/review-loop.md` and
198
+ `app-quality-bar/visual-review.md`. Give the screenshots, rubric, and brief to
199
+ a blind reviewer and use the lower score per row. Fix and recapture until the
200
+ review passes (mean >= 4.0, every row >= 3, zero automatic fails).
182
201
  5. Run the 60-second automated Playwright walkthrough from `app-quality-bar`.
183
202
  Cover empty, populated, split pane at 520 px or narrower, and error
184
203
  recovery. Click every navigation item, create and edit, reload and verify
@@ -197,6 +216,8 @@ check you didn't run.
197
216
 
198
217
  ## Related
199
218
 
219
+ - `product-judgment`: 5-step pre-flight (primitive inventory, 6-Axis Judgment
220
+ Card, 3-Option Decision Block, 5 Human-Team Lenses, and escalation boundary).
200
221
  - `adding-a-feature`: the feature checklist for each later feature in this app.
201
222
  - `frontend-design`, `actions`, `sharing`, `real-time-sync`, and `security`:
202
223
  go deeper on one area when the references aren't enough.
@@ -52,8 +52,9 @@ presentation seam.
52
52
 
53
53
  Use the app's existing field components and validation pattern. Associate
54
54
  errors with their inputs and expose invalid state to assistive technology.
55
- Icon-only actions need an accessible name and a usable focus target. Use the
56
- icon package already installed by the app.
55
+ Icon-only actions need an accessible name and a usable focus target. Use Tabler
56
+ Icons (`@tabler/icons-react`) for UI icons, except in Design, which uses Radix
57
+ Icons (`@radix-ui/react-icons`).
57
58
 
58
59
  Do not recreate menus, popovers, dialogs, or confirmations with absolute
59
60
  positioning and custom click-outside handlers. Never use browser `alert`,