@agent-native/core 0.84.1 → 0.84.3
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/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +15 -0
- package/corpus/core/docs/design/durable-agent-runs.md +34 -35
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/engine/builder-engine.ts +81 -9
- package/corpus/core/src/agent/production-agent.ts +9 -2
- package/corpus/core/src/agent/run-loop-with-resume.ts +38 -8
- package/corpus/core/src/agent/run-manager.ts +8 -7
- package/corpus/core/src/agent/thread-data-builder.ts +6 -0
- package/corpus/core/src/cli/design-connect.ts +175 -0
- package/corpus/core/src/cli/skills.ts +5 -7
- package/corpus/core/src/client/AgentPanel.tsx +8 -0
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +4 -1
- package/corpus/core/src/client/agent-chat-adapter.ts +253 -24
- package/corpus/core/src/client/sharing/ShareButton.tsx +70 -21
- package/corpus/core/src/client/sse-event-processor.ts +46 -4
- package/corpus/core/src/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +15 -17
- package/corpus/templates/analytics/AGENTS.md +1 -1
- package/corpus/templates/design/actions/apply-motion-edit.ts +50 -18
- package/corpus/templates/design/actions/get-motion-timeline.ts +4 -14
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +156 -12
- package/corpus/templates/design/app/components/design/MotionDock.tsx +2 -3
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +217 -75
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +39 -39
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +558 -37
- package/corpus/templates/design/app/components/design/bridge/hit-test.bridge.ts +75 -3
- package/corpus/templates/design/app/components/design/types.ts +13 -0
- package/corpus/templates/design/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/design/app/i18n/zh-TW.ts +17 -0
- package/corpus/templates/design/app/i18n-data.ts +245 -0
- package/corpus/templates/design/app/pages/DesignEditor.tsx +890 -252
- package/corpus/templates/design/changelog/2026-06-30-agent-chat-now-reports-saved-design-generations-clearly-when.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-apply-styles-now-appears-only-for-localhost-visual-edit-scre.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-copying-or-dragging-screen-elements-onto-the-infinite-canvas.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-design-questions-now-use-tighter-editor-typography-and-contr.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-element-drags-can-be-cancelled-with-escape-before-they-commi.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-pending-visual-style-edits-now-warn-before-you-leave-the-edi.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-share-options-now-make-export-and-agent-handoff-easier-to-no.md +6 -0
- package/corpus/templates/design/changelog/2026-06-30-visual-style-drags-stay-live-while-pending-edits-can-be-appl.md +6 -0
- package/corpus/templates/design/changelog/2026-07-01-design-chat-no-longer-shows-a-redundant-context-tab-above-the-composer.md +6 -0
- package/corpus/templates/design/changelog/2026-07-01-motion-track-creation-no-longer-fails-in-local-editors.md +6 -0
- package/corpus/templates/design/changelog/2026-07-01-share-general-access-menu-stays-open-when-choosing-organization.md +6 -0
- package/corpus/templates/design/server/plugins/db.ts +10 -0
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/engine/builder-engine.js +61 -10
- package/dist/agent/engine/builder-engine.js.map +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +9 -2
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-loop-with-resume.d.ts +2 -2
- package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
- package/dist/agent/run-loop-with-resume.js +31 -8
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/agent/run-manager.d.ts +8 -7
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +8 -7
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts +2 -0
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +5 -0
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/cli/design-connect.d.ts +2 -0
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +140 -0
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +5 -7
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/AgentPanel.d.ts +5 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +4 -4
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts +3 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +2 -2
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +216 -22
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/sharing/ShareButton.d.ts +6 -0
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +25 -11
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts +18 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +34 -5
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/routes.d.ts +2 -2
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +7 -7
- package/dist/resources/handlers.d.ts +2 -2
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +15 -17
- package/docs/design/durable-agent-runs.md +34 -35
- package/package.json +1 -1
- package/src/templates/workspace-core/.agents/skills/reliable-mutations/SKILL.md +15 -17
|
@@ -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
|
-
|
|
6
|
-
data — especially "do this for many
|
|
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
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
|
38
|
-
per-item writes
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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.
|
|
@@ -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
|
|
87
|
-
|
|
88
|
-
`packages/core/src/agent/engine/builder-engine.ts`.
|
|
89
|
-
|
|
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
|
|
370
|
-
|
|
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
|
|
383
|
-
|
|
384
|
-
|
|
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
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
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. **
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
2. **
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
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`).
|
|
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
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
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.
|
|
3
|
+
"version": "0.84.3",
|
|
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
|
-
|
|
6
|
-
data — especially "do this for many
|
|
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
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
|
38
|
-
per-item writes
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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.
|