@agent-native/core 0.84.0 → 0.84.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +13 -0
  3. package/corpus/core/docs/content/evals.mdx +34 -12
  4. package/corpus/core/docs/content/locales/ar-SA/evals.mdx +7 -0
  5. package/corpus/core/docs/content/locales/de-DE/evals.mdx +8 -0
  6. package/corpus/core/docs/content/locales/es-ES/evals.mdx +8 -0
  7. package/corpus/core/docs/content/locales/fr-FR/evals.mdx +8 -0
  8. package/corpus/core/docs/content/locales/hi-IN/evals.mdx +8 -0
  9. package/corpus/core/docs/content/locales/ja-JP/evals.mdx +7 -0
  10. package/corpus/core/docs/content/locales/ko-KR/evals.mdx +7 -0
  11. package/corpus/core/docs/content/locales/pt-BR/evals.mdx +8 -0
  12. package/corpus/core/docs/content/locales/zh-CN/evals.mdx +7 -0
  13. package/corpus/core/docs/content/locales/zh-TW/evals.mdx +7 -0
  14. package/corpus/core/docs/design/durable-agent-runs.md +34 -35
  15. package/corpus/core/package.json +1 -1
  16. package/corpus/core/src/agent/engine/builder-engine.ts +81 -9
  17. package/corpus/core/src/agent/run-manager.ts +8 -7
  18. package/corpus/core/src/cli/design-connect.ts +175 -0
  19. package/corpus/core/src/cli/skills.ts +5 -7
  20. package/corpus/core/src/client/AgentPanel.tsx +8 -0
  21. package/corpus/core/src/client/MultiTabAssistantChat.tsx +4 -1
  22. package/corpus/core/src/client/agent-chat-adapter.ts +45 -15
  23. package/corpus/core/src/client/sse-event-processor.ts +31 -4
  24. package/corpus/core/src/eval/define-eval.ts +4 -1
  25. package/corpus/core/src/eval/report.ts +23 -8
  26. package/corpus/core/src/eval/runner.ts +41 -6
  27. package/corpus/core/src/eval/types.ts +11 -0
  28. package/corpus/core/src/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +15 -17
  29. package/corpus/templates/content/AGENTS.md +9 -2
  30. package/corpus/templates/content/actions/_database-row-batch.ts +230 -0
  31. package/corpus/templates/content/actions/_database-utils.ts +17 -9
  32. package/corpus/templates/content/actions/_notion-action-utils.ts +26 -0
  33. package/corpus/templates/content/actions/connect-notion-status.ts +13 -4
  34. package/corpus/templates/content/actions/create-and-link-notion-page.ts +23 -0
  35. package/corpus/templates/content/actions/delete-database-items.ts +55 -0
  36. package/corpus/templates/content/actions/delete-document.ts +4 -4
  37. package/corpus/templates/content/actions/disconnect-notion.ts +16 -0
  38. package/corpus/templates/content/actions/duplicate-database-item.ts +1 -1
  39. package/corpus/templates/content/actions/duplicate-database-items.ts +191 -0
  40. package/corpus/templates/content/actions/link-notion-page.ts +10 -7
  41. package/corpus/templates/content/actions/list-notion-links.ts +3 -4
  42. package/corpus/templates/content/actions/pull-notion-page.ts +7 -9
  43. package/corpus/templates/content/actions/push-notion-page.ts +7 -9
  44. package/corpus/templates/content/actions/refresh-notion-sync-status.ts +24 -0
  45. package/corpus/templates/content/actions/resolve-notion-sync-conflict.ts +23 -0
  46. package/corpus/templates/content/actions/search-notion-pages.ts +67 -0
  47. package/corpus/templates/content/actions/unlink-notion-page.ts +23 -0
  48. package/corpus/templates/content/app/components/editor/DocumentDatabase.tsx +27 -34
  49. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +16 -13
  50. package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +10 -10
  51. package/corpus/templates/content/app/components/editor/NotionConflictBanner.tsx +1 -1
  52. package/corpus/templates/content/app/components/editor/NotionSyncBar.tsx +18 -9
  53. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +27 -34
  54. package/corpus/templates/content/app/components/editor/database/navigation-state.ts +10 -4
  55. package/corpus/templates/content/app/components/sidebar/NotionButton.tsx +32 -17
  56. package/corpus/templates/content/app/hooks/use-content-database.ts +35 -0
  57. package/corpus/templates/content/app/hooks/use-notion.ts +108 -99
  58. package/corpus/templates/content/package.json +3 -0
  59. package/corpus/templates/content/parity/README.md +69 -0
  60. package/corpus/templates/content/parity/eval-scenarios.ts +118 -0
  61. package/corpus/templates/content/parity/exceptions.allowlist.ts +17 -0
  62. package/corpus/templates/content/parity/matrix.md +28 -0
  63. package/corpus/templates/content/parity/matrix.ts +606 -0
  64. package/corpus/templates/content/parity/matrix.types.ts +42 -0
  65. package/corpus/templates/content/parity/parity-evals.eval.ts +4 -0
  66. package/corpus/templates/content/parity/render-matrix.ts +90 -0
  67. package/corpus/templates/content/parity/scenario-to-eval.ts +57 -0
  68. package/corpus/templates/content/shared/api.ts +11 -0
  69. package/corpus/templates/design/actions/apply-motion-edit.ts +50 -18
  70. package/corpus/templates/design/actions/get-motion-timeline.ts +4 -14
  71. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +156 -12
  72. package/corpus/templates/design/app/components/design/MotionDock.tsx +2 -3
  73. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +217 -75
  74. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +39 -39
  75. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +558 -37
  76. package/corpus/templates/design/app/components/design/bridge/hit-test.bridge.ts +75 -3
  77. package/corpus/templates/design/app/components/design/types.ts +13 -0
  78. package/corpus/templates/design/app/components/layout/Layout.tsx +1 -0
  79. package/corpus/templates/design/app/i18n/zh-TW.ts +17 -0
  80. package/corpus/templates/design/app/i18n-data.ts +245 -0
  81. package/corpus/templates/design/app/pages/DesignEditor.tsx +762 -153
  82. package/corpus/templates/design/changelog/2026-06-30-copying-or-dragging-screen-elements-onto-the-infinite-canvas.md +6 -0
  83. package/corpus/templates/design/changelog/2026-06-30-design-questions-now-use-tighter-editor-typography-and-contr.md +6 -0
  84. package/corpus/templates/design/changelog/2026-06-30-element-drags-can-be-cancelled-with-escape-before-they-commi.md +6 -0
  85. package/corpus/templates/design/changelog/2026-06-30-pending-visual-style-edits-now-warn-before-you-leave-the-edi.md +6 -0
  86. package/corpus/templates/design/changelog/2026-06-30-visual-style-drags-stay-live-while-pending-edits-can-be-appl.md +6 -0
  87. package/corpus/templates/design/changelog/2026-07-01-design-chat-no-longer-shows-a-redundant-context-tab-above-the-composer.md +6 -0
  88. package/corpus/templates/design/changelog/2026-07-01-motion-track-creation-no-longer-fails-in-local-editors.md +6 -0
  89. package/corpus/templates/design/server/plugins/db.ts +10 -0
  90. package/dist/agent/engine/builder-engine.d.ts.map +1 -1
  91. package/dist/agent/engine/builder-engine.js +61 -10
  92. package/dist/agent/engine/builder-engine.js.map +1 -1
  93. package/dist/agent/run-manager.d.ts +8 -7
  94. package/dist/agent/run-manager.d.ts.map +1 -1
  95. package/dist/agent/run-manager.js +8 -7
  96. package/dist/agent/run-manager.js.map +1 -1
  97. package/dist/cli/design-connect.d.ts +2 -0
  98. package/dist/cli/design-connect.d.ts.map +1 -1
  99. package/dist/cli/design-connect.js +140 -0
  100. package/dist/cli/design-connect.js.map +1 -1
  101. package/dist/cli/skills.d.ts.map +1 -1
  102. package/dist/cli/skills.js +5 -7
  103. package/dist/cli/skills.js.map +1 -1
  104. package/dist/client/AgentPanel.d.ts +5 -1
  105. package/dist/client/AgentPanel.d.ts.map +1 -1
  106. package/dist/client/AgentPanel.js +4 -4
  107. package/dist/client/AgentPanel.js.map +1 -1
  108. package/dist/client/MultiTabAssistantChat.d.ts +3 -1
  109. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  110. package/dist/client/MultiTabAssistantChat.js +2 -2
  111. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  112. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  113. package/dist/client/agent-chat-adapter.js +37 -14
  114. package/dist/client/agent-chat-adapter.js.map +1 -1
  115. package/dist/client/sse-event-processor.d.ts +14 -1
  116. package/dist/client/sse-event-processor.d.ts.map +1 -1
  117. package/dist/client/sse-event-processor.js +21 -5
  118. package/dist/client/sse-event-processor.js.map +1 -1
  119. package/dist/collab/routes.d.ts +1 -1
  120. package/dist/eval/define-eval.d.ts.map +1 -1
  121. package/dist/eval/define-eval.js +2 -1
  122. package/dist/eval/define-eval.js.map +1 -1
  123. package/dist/eval/report.d.ts.map +1 -1
  124. package/dist/eval/report.js +19 -4
  125. package/dist/eval/report.js.map +1 -1
  126. package/dist/eval/runner.d.ts.map +1 -1
  127. package/dist/eval/runner.js +38 -6
  128. package/dist/eval/runner.js.map +1 -1
  129. package/dist/eval/types.d.ts +11 -0
  130. package/dist/eval/types.d.ts.map +1 -1
  131. package/dist/eval/types.js.map +1 -1
  132. package/dist/file-upload/actions/upload-image.d.ts +2 -2
  133. package/dist/observability/routes.d.ts +2 -2
  134. package/dist/progress/routes.d.ts +1 -1
  135. package/dist/resources/handlers.d.ts +3 -3
  136. package/dist/server/transcribe-voice.d.ts +1 -1
  137. package/dist/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +15 -17
  138. package/docs/content/evals.mdx +34 -12
  139. package/docs/content/locales/ar-SA/evals.mdx +7 -0
  140. package/docs/content/locales/de-DE/evals.mdx +8 -0
  141. package/docs/content/locales/es-ES/evals.mdx +8 -0
  142. package/docs/content/locales/fr-FR/evals.mdx +8 -0
  143. package/docs/content/locales/hi-IN/evals.mdx +8 -0
  144. package/docs/content/locales/ja-JP/evals.mdx +7 -0
  145. package/docs/content/locales/ko-KR/evals.mdx +7 -0
  146. package/docs/content/locales/pt-BR/evals.mdx +8 -0
  147. package/docs/content/locales/zh-CN/evals.mdx +7 -0
  148. package/docs/content/locales/zh-TW/evals.mdx +7 -0
  149. package/docs/design/durable-agent-runs.md +34 -35
  150. package/package.json +1 -1
  151. package/src/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +15 -17
  152. package/corpus/templates/content/server/routes/api/notion/disconnect.post.ts +0 -12
@@ -229,6 +229,13 @@ agent-native eval --threshold 0.8 # override every eval's pass threshold (0..
229
229
  | `1` | 至少有一項評估得分低於閾值,或者套件出錯。 |
230
230
  | `2` | 錯誤的參數(例如 `--threshold` 位於 `[0, 1]` 之外)。 |
231
231
 
232
+ ### 跳過受控評估 {#skipping}
233
+
234
+ 當某個評估套件只應在手動、夜間或具備密鑰的環境中執行時,請使用
235
+ `skipReason`。被跳過的評估不會執行代理或 scorer,不會讓套件失敗,並會
236
+ 在 JSON 輸出中顯示 `status: "skipped"` 和 `skipReason`。廉價的確定性覆
237
+ 蓋應保留在普通 PR CI 中。
238
+
232
239
  ### 作為 CI 部署門 {#ci}
233
240
 
234
241
  將其新增到部署之前執行的管道:
@@ -83,10 +83,11 @@ terminate with an untruthful "done" state.
83
83
  not buy more time — it just converts a graceful hand-off into a hard kill. The
84
84
  walls, in order:
85
85
 
86
- 1. **Builder model gateway hard cap — ~45s.**
87
- `MAX_BUILDER_GATEWAY_TIMEOUT_MS = 45_000` in
88
- `packages/core/src/agent/engine/builder-engine.ts`. A single model call is
89
- killed at the gateway after 45s. **Not raisable** by the framework.
86
+ 1. **Builder model gateway foreground cap — ~45s.**
87
+ Hosted foreground calls keep a 45s cap in
88
+ `packages/core/src/agent/engine/builder-engine.ts`. Local/non-hosted and
89
+ proven background-function calls use the longer background-style cap because
90
+ they are not constrained by the synchronous function wall.
90
91
  2. **Serverless function kill — ~60–65s.** The hosting function is terminated
91
92
  shortly after; the heartbeat then reaps the run row as `stale_run`.
92
93
 
@@ -366,8 +367,8 @@ The whole `auto_continue` / 40s soft-timeout dance exists to stay under the
366
367
  **serverless function wall** (~60–65s synchronous on Netlify), not under any
367
368
  model limit. Evidence:
368
369
 
369
- - `builder-engine.ts:62` `MAX_LOCAL_BUILDER_GATEWAY_TIMEOUT_MS = 180_000`
370
- (3 min) is allowed locally; the run loop has no inherent reason to stop at 40s.
370
+ - `builder-engine.ts` allows the long background gateway cap in local/non-hosted
371
+ runs; the run loop has no inherent reason to stop at 40s.
371
372
  - `run-manager.ts:58,68` `DEFAULT_HOSTED_RUN_SOFT_TIMEOUT_MS` /
372
373
  `HOSTED_SOFT_TIMEOUT_CEILING_MS = 40_000` are pinned just under the function
373
374
  wall, and `templates/brain/netlify.toml` sets `[functions."*"] timeout = 75`.
@@ -379,10 +380,9 @@ function there is no ~60s wall, so:
379
380
 
380
381
  - The agent loop can run for minutes in a single invocation with **few or no
381
382
  `auto_continue` continuations**.
382
- - The per-model-call gateway cap (`MAX_BUILDER_GATEWAY_TIMEOUT_MS = 45_000`,
383
- `builder-engine.ts:60`) still applies per call — see
384
- [Per-model-call gateway cap](#per-model-call-gateway-cap) but the _run_ is no
385
- longer chopped into 40s chunks.
383
+ - The foreground hosted per-model-call gateway cap still applies per call — see
384
+ [Per-model-call gateway cap](#per-model-call-gateway-cap)but the _run_ is
385
+ no longer chopped into 40s chunks.
386
386
 
387
387
  This is exactly the Layer 1 worker with a concrete long-lived host: Netlify is
388
388
  the durable worker, reached through the existing self-dispatch primitive — the
@@ -527,29 +527,27 @@ Minimal client change, because the reconnect machinery already exists:
527
527
 
528
528
  ## Per-model-call gateway cap
529
529
 
530
- Even in a 15-min function, a _single_ model call is still capped by the Builder
531
- gateway: `MAX_BUILDER_GATEWAY_TIMEOUT_MS = 45_000` (`builder-engine.ts:60`),
532
- resolved by `getBuilderGatewayTimeoutMs()` (`:770`) /
533
- `resolveMaxBuilderGatewayTimeoutMs()` (`:758`). Locally the cap is already
534
- `180_000` (`:62`) when the gateway base URL is localhost.
530
+ Builder gateway calls now use a runtime-aware cap. Hosted foreground calls keep
531
+ the 45s cap so the synchronous function can still checkpoint before its hard
532
+ wall. Local/non-hosted runs use a longer local cap, and proven Netlify
533
+ background-function runs may use a background cap below the 15-minute function
534
+ wall. The run-manager's 13-minute background soft-timeout should fire before
535
+ the gateway cap in normal durable background operation.
535
536
 
536
537
  Options, in scope-order:
537
538
 
538
- 1. **In scope / safe now:** keep the 45s per-call cap. A 15-min function makes
539
- _many_ 45s calls; the cap bounds one call, not the run. This alone delivers
540
- the goal (long multi-step runs finish) with **zero gateway changes**.
541
- 2. **Flag, out of scope until confirmed:** raise the per-call cap toward 180s in
542
- the background context. `getBuilderGatewayTimeoutMs()` already honors
543
- `AGENT_NATIVE_BUILDER_GATEWAY_TIMEOUT_MS`, but it is hard-clamped to
544
- `resolveMaxBuilderGatewayTimeoutMs()` = 45s for non-localhost gateways. Raising
545
- it requires the **hosted Builder gateway to actually allow >45s upstream** —
546
- unverified, and not the framework's call. Until confirmed, do not raise it.
547
- 3. **Escape hatch:** a direct Anthropic engine (no Builder gateway) has no 45s
548
- cap, so a single very long call could use it. Out of scope for this change;
549
- note it as the lever if a single model call truly needs >45s.
550
-
551
- **Recommendation:** ship with option 1. The win is removing the _run-level_
552
- ceiling; the per-call cap is orthogonal and rarely the binding constraint.
539
+ 1. **Foreground hosted:** keep the 45s cap. The synchronous function wall is the
540
+ constraint, and a larger cap would turn graceful checkpointing into a hard
541
+ platform kill.
542
+ 2. **Local/non-hosted:** allow longer calls by default. Local development should
543
+ not inherit a serverless wall it does not have.
544
+ 3. **Durable background:** allow longer calls only when the runtime proves it is
545
+ inside the emitted background function. Keep the cap below 15 minutes and
546
+ above the 13-minute run soft-timeout so background checkpointing still owns
547
+ logical-turn continuation.
548
+
549
+ **Recommendation:** preserve this split. Do not raise the foreground cap; use
550
+ durable background for long-running tool-input generation.
553
551
 
554
552
  ## Idempotency / dedup
555
553
 
@@ -626,7 +624,8 @@ only): foreground handler inserts the run row, dispatches, returns the SSE
626
624
  stream from `subscribeToRun`. The background `_process-run` claims the run and
627
625
  calls the same `startRun` + `runAgentLoop` the inline path uses, with
628
626
  `softTimeoutMs ≈ 13min` (new `backgroundFunction` option in
629
- `resolveRunSoftTimeoutMs`). Per-call gateway cap stays at 45s (option 1).
627
+ `resolveRunSoftTimeoutMs`). Builder gateway calls use the background cap only
628
+ when the worker proves it is inside the emitted background function.
630
629
  **Done when:** a long multi-step turn that thrashes today completes in one
631
630
  background invocation with zero `auto_continue`, events streaming to the client
632
631
  via the SQL-poll path, terminal `done` persisted.
@@ -645,10 +644,10 @@ dispatches, and background→background `auto_continue` chaining for the rare
645
644
  > 13-min turn (mirror `agent-teams.ts:1886`). Internal checkpointing (Option A)
646
645
  > for monotonic progress across any continuation.
647
646
 
648
- **Slice 4 (optional, separate decision) raise the per-call gateway cap.**
649
- Only after confirming the hosted Builder gateway accepts >45s upstream; wire
650
- `AGENT_NATIVE_BUILDER_GATEWAY_TIMEOUT_MS` through with a background-context max.
651
- Out of scope until that confirmation exists.
647
+ **Slice 4 — foreground remains capped.**
648
+ Do not raise the hosted foreground per-call gateway cap. Any future tuning
649
+ should stay in the local/background timeout regime unless the synchronous
650
+ platform wall changes.
652
651
 
653
652
  ## Open risks / unknowns
654
653
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.84.0",
3
+ "version": "0.84.2",
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": {
@@ -2,9 +2,9 @@
2
2
  name: reliable-mutations
3
3
  description: >-
4
4
  How the agent must perform writes so they actually persist under the hosted
5
- ~40s run budget. Use whenever you create, update, delete, or batch-write app
6
- data — especially "do this for many items" loops, or any task where the user
7
- expects N things to end up saved.
5
+ foreground run budget and long-running background handoffs. Use whenever you
6
+ create, update, delete, or batch-write app data — especially "do this for many
7
+ items" loops, or any task where the user expects N things to end up saved.
8
8
  ---
9
9
 
10
10
  # Reliable Mutations
@@ -18,15 +18,12 @@ tool ✓ alone.
18
18
 
19
19
  ## Why
20
20
 
21
- Hosted agent runs have a ~40s soft budget (it exists to hand off cleanly under
22
- the upstream gateway/function walls it is correct and is not raisable; see the
23
- durable-agent-runs design doc). When you loop many sequential writes inside one
24
- turn, the budget can cut you off mid-loop. The run resumes in a new chunk, but
25
- the resume often re-does earlier steps instead of advancing, so the loop churns
26
- and the *saved* result ends up partial — or empty — even though each individual
27
- tool call appeared to succeed. The user gets told "done" while the data says
28
- otherwise. One atomic call commits or fails as a unit; verification turns a
29
- hopeful ✓ into a fact.
21
+ Hosted foreground agent runs have a short soft budget so they can hand off
22
+ cleanly under synchronous serverless walls. Durable background runs get a much
23
+ longer budget, but they still should not rely on loops of many small writes:
24
+ continuations can retry the same intent and leave partial state if each item is
25
+ committed separately. One atomic call commits or fails as a unit; verification
26
+ turns a hopeful into a fact.
30
27
 
31
28
  ## How
32
29
 
@@ -34,11 +31,12 @@ hopeful ✓ into a fact.
34
31
  many, set all, bulk update), pass the full batch in one call so it commits
35
32
  atomically. Check the action surface for a batch/plural form before reaching
36
33
  for a loop.
37
- 2. **Do not loop many small writes under the run budget.** A sequence of N
38
- per-item writes in one turn will race the ~40s cutoff and can leave partial
39
- or no state. If no batch action exists, that is a gap in the action layer —
40
- add or extend an action that accepts the batch (see the `actions` skill)
41
- rather than papering over it with a loop.
34
+ 2. **Do not loop many small writes under any run budget.** A sequence of N
35
+ per-item writes can still leave partial or no state when a foreground run
36
+ hands off, a background run continues, or an upstream provider fails. If no
37
+ batch action exists, that is a gap in the action layer add or extend an
38
+ action that accepts the batch (see the `actions` skill) rather than papering
39
+ over it with a loop.
42
40
  3. **Verify the end state after writing.** Re-read the data (a list/read action,
43
41
  a count query) and confirm the result matches intent — the right number of
44
42
  rows, the expected ids/fields. Do this before you tell the user it worked.
@@ -1,12 +0,0 @@
1
- import { defineEventHandler } from "h3";
2
-
3
- import {
4
- disconnectNotionForOwner,
5
- getDocumentOwnerEmail,
6
- } from "../../../lib/notion.js";
7
-
8
- export default defineEventHandler(async (event) => {
9
- const owner = await getDocumentOwnerEmail(event);
10
- const deleted = await disconnectNotionForOwner(owner);
11
- return { success: true, deleted };
12
- });