@agent-native/core 0.188.0 → 0.189.0-nightly-20260925200527

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 (53) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/content/actions/list-document-versions.ts +102 -2
  3. package/corpus/templates/content/actions/restore-document-version.ts +50 -2
  4. package/corpus/templates/content/app/components/layout/Layout.tsx +6 -1
  5. package/corpus/templates/content/changelog/2026-09-25-chat-messages-can-be-reverted-to-their-autosaved-version-inc.md +6 -0
  6. package/corpus/templates/content/server/lib/document-history.ts +59 -8
  7. package/corpus/templates/content/server/lib/document-version-context.ts +5 -0
  8. package/corpus/templates/content/server/plugins/agent-chat.ts +164 -0
  9. package/corpus/templates/design/actions/list-design-versions.ts +3 -1
  10. package/corpus/templates/design/app/components/layout/Layout.tsx +17 -2
  11. package/corpus/templates/design/app/pages/design-editor/editor-state.ts +10 -3
  12. package/corpus/templates/design/changelog/2026-09-25-chat-messages-can-be-reverted-to-their-autosaved-version-inc.md +6 -0
  13. package/corpus/templates/design/server/lib/design-versions.ts +136 -20
  14. package/corpus/templates/design/server/plugins/agent-chat.ts +18 -2
  15. package/corpus/templates/slides/actions/list-deck-versions.ts +62 -10
  16. package/corpus/templates/slides/app/components/layout/Layout.tsx +10 -2
  17. package/corpus/templates/slides/changelog/2026-09-25-chat-messages-can-be-reverted-to-their-autosaved-version-inc.md +6 -0
  18. package/corpus/templates/slides/server/lib/deck-versions.ts +36 -1
  19. package/corpus/templates/slides/server/plugins/agent-chat.ts +26 -2
  20. package/dist/automation/index.d.ts +1 -1
  21. package/dist/client/AssistantChat.js +112 -35
  22. package/dist/client/chat/assistant-chat-history-version.d.ts +1 -0
  23. package/dist/client/chat/message-components.d.ts +8 -1
  24. package/dist/client/chat/message-components.js +52 -11
  25. package/dist/client/resources/mcp-integration-catalog.js +1 -1
  26. package/dist/client/resources/mcp-integration-logos.js +29 -30
  27. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  28. package/dist/localization/core-messages/ar-SA.js +2 -0
  29. package/dist/localization/core-messages/de-DE.js +2 -0
  30. package/dist/localization/core-messages/en-US.d.ts +2 -0
  31. package/dist/localization/core-messages/en-US.js +2 -0
  32. package/dist/localization/core-messages/es-ES.js +2 -0
  33. package/dist/localization/core-messages/fr-FR.js +2 -0
  34. package/dist/localization/core-messages/hi-IN.js +2 -0
  35. package/dist/localization/core-messages/ja-JP.js +2 -0
  36. package/dist/localization/core-messages/ko-KR.js +2 -0
  37. package/dist/localization/core-messages/pt-BR.js +2 -0
  38. package/dist/localization/core-messages/zh-CN.js +2 -0
  39. package/dist/localization/core-messages/zh-TW.js +2 -0
  40. package/dist/localization/core-messages.d.ts +2 -0
  41. package/dist/notifications/routes.d.ts +3 -3
  42. package/dist/observability/routes.d.ts +4 -4
  43. package/dist/org/handlers.d.ts +1 -1
  44. package/dist/resources/handlers.d.ts +1 -1
  45. package/dist/secrets/routes.d.ts +6 -6
  46. package/dist/server/agent-chat/plugin-options.d.ts +2 -0
  47. package/dist/server/agent-chat-plugin.d.ts +1 -0
  48. package/dist/server/agent-chat-plugin.js +26 -0
  49. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  50. package/dist/server/agent-engine-ollama-models-route.d.ts +1 -1
  51. package/dist/server/onboarding-html.js +28 -5
  52. package/docs/content/deployment.mdx +12 -1
  53. package/package.json +1 -1
@@ -482,10 +482,12 @@ const messages = {
482
482
  "message.regenerate": "重新生成响应",
483
483
  "message.restoreFailed": "恢复失败({{status}})。",
484
484
  "message.restoreQuestion": "恢复到此处?",
485
+ "message.revertQuestion": "还原到此处?此后所做的更改将会丢失。",
485
486
  "message.restoreRequestFailed": "恢复请求失败。",
486
487
  "message.threadNotFound": "此聊天线程已不可用。请开始新聊天;如果这是意外情况,也可以重试。",
487
488
  "message.restoring": "正在恢复...",
488
489
  "message.revertHere": "还原到此处",
490
+ "message.revertToBeginning": "还原到开头",
489
491
  "message.sentAt": "发送于 {{time}}",
490
492
  "contextMeter.ariaLabel": "上下文 {{percent}}%,共 {{totalTokens}}{{breakdown}}。打开上下文透视。",
491
493
  "contextMeter.breakdown": ":{{systemTokens}} 系统 + {{conversationTokens}} 对话",
@@ -482,10 +482,12 @@ const messages = {
482
482
  "message.regenerate": "重新產生回應",
483
483
  "message.restoreFailed": "還原失敗({{status}})。",
484
484
  "message.restoreQuestion": "要還原到這裡嗎?",
485
+ "message.revertQuestion": "要還原到這裡嗎?之後所做的變更將會遺失。",
485
486
  "message.restoreRequestFailed": "還原要求失敗。",
486
487
  "message.threadNotFound": "此聊天串已無法使用。請開始新的聊天;如果這是意外情況,也可以重試。",
487
488
  "message.restoring": "正在還原...",
488
489
  "message.revertHere": "還原到這裡",
490
+ "message.revertToBeginning": "還原到開頭",
489
491
  "message.sentAt": "傳送於 {{time}}",
490
492
  "contextMeter.ariaLabel": "上下文 {{percent}}%,共 {{totalTokens}}{{breakdown}}。開啟上下文透視。",
491
493
  "contextMeter.breakdown": ":{{systemTokens}} 系統 + {{conversationTokens}} 對話",
@@ -487,10 +487,12 @@ export declare const englishAgentChatMessages: {
487
487
  readonly "message.regenerate": "Regenerate response";
488
488
  readonly "message.restoreFailed": "Restore failed ({{status}}).";
489
489
  readonly "message.restoreQuestion": "Restore to here?";
490
+ readonly "message.revertQuestion": "Revert to this point? Changes made after this point will be lost.";
490
491
  readonly "message.restoreRequestFailed": "Restore request failed.";
491
492
  readonly "message.threadNotFound": "This chat thread is no longer available. Start a new chat or retry if this was unexpected.";
492
493
  readonly "message.restoring": "Restoring...";
493
494
  readonly "message.revertHere": "Revert to here";
495
+ readonly "message.revertToBeginning": "Revert to beginning";
494
496
  readonly "message.sentAt": "Sent {{time}}";
495
497
  readonly "contextMeter.ariaLabel": "Context {{percent}}%, {{totalTokens}}{{breakdown}}. Open Context X-Ray.";
496
498
  readonly "contextMeter.breakdown": " total: {{systemTokens}} system + {{conversationTokens}} conversation";
@@ -11,14 +11,14 @@
11
11
  * DELETE /_agent-native/notifications/:id — delete
12
12
  */
13
13
  export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
14
+ error?: undefined;
14
15
  count: number;
15
16
  updated?: undefined;
16
- error?: undefined;
17
17
  ok?: undefined;
18
18
  } | {
19
+ error?: undefined;
19
20
  count?: undefined;
20
21
  updated: number;
21
- error?: undefined;
22
22
  ok?: undefined;
23
23
  } | {
24
24
  count?: undefined;
@@ -26,8 +26,8 @@ export declare function createNotificationsHandler(): import("h3").EventHandlerW
26
26
  error: string;
27
27
  ok?: undefined;
28
28
  } | {
29
+ error?: undefined;
29
30
  count?: undefined;
30
31
  updated?: undefined;
31
- error?: undefined;
32
32
  ok: boolean;
33
33
  }>>;
@@ -41,9 +41,9 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
41
41
  thumbsUpRate: number;
42
42
  avgEvalScore: number;
43
43
  } | {
44
+ id?: undefined;
44
45
  summary: import("./types.js").TraceSummary;
45
46
  spans: import("./types.js").TraceSpan[];
46
- id?: undefined;
47
47
  error?: undefined;
48
48
  ok?: undefined;
49
49
  } | {
@@ -53,15 +53,15 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
53
53
  error?: undefined;
54
54
  ok?: undefined;
55
55
  } | {
56
+ id?: undefined;
56
57
  summary?: undefined;
57
58
  spans?: undefined;
58
- id?: undefined;
59
59
  error: any;
60
60
  ok?: undefined;
61
61
  } | {
62
+ id?: undefined;
62
63
  summary?: undefined;
63
64
  spans?: undefined;
64
- id?: undefined;
65
- error?: undefined;
66
65
  ok: boolean;
66
+ error?: undefined;
67
67
  }>>;
@@ -74,9 +74,9 @@ export declare const setWorkspaceAppDefaultVisibilityHandler: import("h3").Event
74
74
  /** POST /_agent-native/org — create a new organization */
75
75
  export declare const createOrgHandler: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
76
76
  success: boolean;
77
+ id?: undefined;
77
78
  name?: undefined;
78
79
  role?: undefined;
79
- id?: undefined;
80
80
  } | {
81
81
  success?: undefined;
82
82
  id: string;
@@ -48,8 +48,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
48
48
  }>;
49
49
  /** DELETE /_agent-native/resources/:id — delete a resource */
50
50
  export declare function handleDeleteResource(event: any): Promise<{
51
- ok?: undefined;
52
51
  error: string;
52
+ ok?: undefined;
53
53
  } | {
54
54
  error?: undefined;
55
55
  ok: boolean;
@@ -60,17 +60,17 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
60
60
  ok?: undefined;
61
61
  status?: undefined;
62
62
  } | {
63
- error?: undefined;
64
63
  ok: boolean;
65
64
  status: string;
65
+ error?: undefined;
66
66
  } | {
67
67
  ok?: undefined;
68
68
  error: string;
69
69
  removed?: undefined;
70
70
  } | {
71
- error?: undefined;
72
71
  ok: boolean;
73
72
  removed: boolean;
73
+ error?: undefined;
74
74
  }>>;
75
75
  /**
76
76
  * POST /_agent-native/secrets/:key/test — validate an optional candidate value
@@ -81,13 +81,13 @@ export declare function createTestSecretHandler(): import("h3").EventHandlerWith
81
81
  error: string;
82
82
  note?: undefined;
83
83
  } | {
84
- error?: undefined;
85
84
  ok: boolean;
86
85
  note?: undefined;
87
- } | {
88
86
  error?: undefined;
87
+ } | {
89
88
  ok: boolean;
90
89
  note: string;
90
+ error?: undefined;
91
91
  } | {
92
92
  note?: undefined;
93
93
  ok: boolean;
@@ -119,11 +119,11 @@ export interface AdHocSecretPayload {
119
119
  export declare function createAdHocSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<AdHocSecretPayload[] | {
120
120
  error: string;
121
121
  } | {
122
- error?: undefined;
123
122
  ok: boolean;
124
123
  key: string;
125
- } | {
126
124
  error?: undefined;
125
+ } | {
127
126
  ok: boolean;
128
127
  removed: boolean;
128
+ error?: undefined;
129
129
  }>>;
@@ -11,6 +11,8 @@ import type { AgentChatMcpIcon, AgentChatMcpOptions } from "./mcp-options.js";
11
11
  * startup and may register routes/hooks synchronously or asynchronously. */
12
12
  export type NitroPluginDef = (nitroApp: any) => void | Promise<void>;
13
13
  export interface AgentChatPluginOptions {
14
+ /** Best-effort app checkpoint taken before the first model generation. */
15
+ onAgentTurnStart?: (scope: AgentChatScope, run: Pick<ActiveRun, "threadId" | "runId">) => void | Promise<void>;
14
16
  /**
15
17
  * Best-effort app autosave hook. It runs after the chat thread has been
16
18
  * persisted and only when the run completed a side effect. Errors are
@@ -41,6 +41,7 @@ export { scheduledTriggerAvailability };
41
41
  export { shouldDisableRecurringJobsRuntime };
42
42
  export { finalizeClaimedAgentChatProcessRunFailure };
43
43
  export declare function runPostAgentTurnAutosave(callback: AgentChatPluginOptions["onAgentTurnComplete"] | undefined, scope: AgentChatScope | null | undefined, run: ActiveRun): Promise<void>;
44
+ export declare function runPreAgentTurnAutosave(callback: AgentChatPluginOptions["onAgentTurnStart"] | undefined, scope: AgentChatScope | null | undefined, run: Pick<ActiveRun, "threadId" | "runId">): Promise<void>;
44
45
  /**
45
46
  * The model this mount runs with, when the caller does not pass one per request.
46
47
  *
@@ -184,6 +184,30 @@ export async function runPostAgentTurnAutosave(callback, scope, run) {
184
184
  console.error("[agent-chat] post-agent-turn autosave failed:", error);
185
185
  }
186
186
  }
187
+ export async function runPreAgentTurnAutosave(callback, scope, run) {
188
+ if (!callback || !scope)
189
+ return;
190
+ try {
191
+ await callback(scope, run);
192
+ }
193
+ catch (error) {
194
+ captureError(error, {
195
+ route: "agent-chat",
196
+ aiTraceId: run.runId,
197
+ tags: {
198
+ source: "agent-chat",
199
+ failureClass: "pre-agent-turn-autosave",
200
+ },
201
+ extra: {
202
+ runId: run.runId,
203
+ threadId: run.threadId,
204
+ scopeType: scope.type,
205
+ scopeId: scope.id,
206
+ },
207
+ });
208
+ console.error("[agent-chat] pre-agent-turn autosave failed:", error);
209
+ }
210
+ }
187
211
  /**
188
212
  * The model this mount runs with, when the caller does not pass one per request.
189
213
  *
@@ -3266,6 +3290,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
3266
3290
  runCtx.threadId = threadId;
3267
3291
  runCtx.runId = runId;
3268
3292
  }
3293
+ await runPreAgentTurnAutosave(options?.onAgentTurnStart, runCtx?.chatScope, { threadId, runId });
3269
3294
  },
3270
3295
  onRunComplete: async (run, threadId) => {
3271
3296
  if (threadId)
@@ -3524,6 +3549,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
3524
3549
  runCtx.threadId = threadId;
3525
3550
  runCtx.runId = runId;
3526
3551
  }
3552
+ await runPreAgentTurnAutosave(options?.onAgentTurnStart, runCtx?.chatScope, { threadId, runId });
3527
3553
  },
3528
3554
  onRunComplete: async (run, threadId) => {
3529
3555
  if (threadId)
@@ -56,10 +56,10 @@ export declare function createAgentEngineApiKeyHandler(): import("h3").EventHand
56
56
  ok: boolean;
57
57
  error: string;
58
58
  } | {
59
- error?: undefined;
60
59
  ok: boolean;
61
60
  key: string;
62
61
  baseUrlKey?: string;
63
62
  scope: AgentEngineApiKeyScope;
63
+ error?: undefined;
64
64
  }>>;
65
65
  export {};
@@ -9,7 +9,7 @@ export declare function createAgentEngineOllamaModelsHandler(): import("h3").Eve
9
9
  error: string;
10
10
  models?: undefined;
11
11
  } | {
12
- error?: undefined;
13
12
  ok: boolean;
14
13
  models: string[];
14
+ error?: undefined;
15
15
  }>>;
@@ -2199,9 +2199,8 @@ ${marketingStyles}
2199
2199
  flex: none;
2200
2200
  width: 100%;
2201
2201
  min-height: auto;
2202
- padding: 2rem 1rem 5rem;
2202
+ padding: 1.5rem 1.25rem;
2203
2203
  border-inline-start: 0;
2204
- border-top: 1px solid color-mix(in srgb, CanvasText 10%, transparent);
2205
2204
  }
2206
2205
  .auth-marketing-home .auth-marketing-layout { min-height: auto; }
2207
2206
  .auth-marketing-home .auth-marketing-shell { display: block; }
@@ -2434,6 +2433,10 @@ ${marketingStyles}
2434
2433
  }
2435
2434
  }
2436
2435
  @media (max-width: 900px) {
2436
+ .auth-marketing-home {
2437
+ min-height: 100vh;
2438
+ min-height: 100svh;
2439
+ }
2437
2440
  .auth-marketing-home .auth-marketing-shell-with-top-right {
2438
2441
  flex-direction: column;
2439
2442
  }
@@ -2455,11 +2458,31 @@ ${marketingStyles}
2455
2458
  }
2456
2459
  .auth-marketing-home .form-panel {
2457
2460
  order: 1;
2458
- padding: 3rem 1rem 5rem;
2461
+ padding: max(1.5rem, env(safe-area-inset-top)) 1.25rem max(1.5rem, env(safe-area-inset-bottom));
2459
2462
  border-inline-start: 0;
2460
- border-top: 1px solid var(--auth-marketing-border);
2461
2463
  }
2462
- .auth-marketing-home .marketing-panel { order: 2; }
2464
+ .auth-marketing-home .marketing-panel { display: none; }
2465
+ .auth-marketing-home .card h1 {
2466
+ font-size: clamp(1.625rem, 6vw, 2rem);
2467
+ line-height: 1.15;
2468
+ margin-bottom: 0.5rem;
2469
+ }
2470
+ .auth-marketing-home .card .subtitle {
2471
+ margin-bottom: 1.5rem;
2472
+ font-size: 1rem;
2473
+ line-height: 1.4;
2474
+ }
2475
+ .auth-marketing-home .card .divider { margin: 1rem 0; }
2476
+ .auth-marketing-home .card .legal-note { margin-top: 1.5rem; }
2477
+ .auth-marketing-home .card input,
2478
+ .auth-marketing-home .card button {
2479
+ min-height: 2.75rem;
2480
+ }
2481
+ body.has-marketing .locale-trigger {
2482
+ min-width: 2.75rem;
2483
+ min-height: 2.75rem;
2484
+ }
2485
+ .auth-marketing-home .card input { font-size: 1rem; }
2463
2486
  }
2464
2487
  `;
2465
2488
  const authClientScriptPath = authClientAssetPath(appBasePath);
@@ -127,7 +127,18 @@ contract stay the same.
127
127
  </a>
128
128
  <a class="deployment-target" href="/docs/netlify">
129
129
  <span class="deployment-target-mark">
130
- <img src="/integration-logos/netlify.svg" alt="" />
130
+ <!-- i18n-copy-ignore: Netlify's light/dark logo pair is image markup; localized deployment pages have no logo grid. -->
131
+ <img
132
+ class="deployment-target-logo deployment-target-logo-light"
133
+ src="/integration-logos/netlify.svg"
134
+ alt=""
135
+ />
136
+ <img
137
+ class="deployment-target-logo deployment-target-logo-dark"
138
+ src="/integration-logos/netlify-darkmode.svg"
139
+ alt=""
140
+ aria-hidden="true"
141
+ />
131
142
  </span>
132
143
  <strong>Netlify</strong>
133
144
  </a>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.188.0",
3
+ "version": "0.189.0-nightly-20260925200527",
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": {