@agent-native/core 0.120.0 → 0.120.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.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +16 -0
- package/corpus/core/docs/content/extensions.mdx +23 -4
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/production-agent.ts +4 -0
- package/corpus/core/src/agent/run-manager.ts +36 -10
- package/corpus/core/src/agent/types.ts +2 -0
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +45 -0
- package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +16 -3
- package/corpus/core/src/client/settings/ExtensionsSettingsContent.tsx +24 -0
- package/corpus/core/src/client/settings/SettingsPanel.tsx +10 -0
- package/corpus/core/src/client/use-chat-models.ts +45 -0
- package/corpus/core/src/deploy/build.ts +3 -0
- package/corpus/core/src/server/analytics.ts +164 -20
- package/corpus/core/src/server/auth.ts +17 -13
- package/corpus/core/src/server/better-auth-instance.ts +13 -1
- package/corpus/core/src/templates/chat/app/components/layout/Sidebar.tsx +35 -6
- package/corpus/core/src/templates/chat/app/routes/extensions._index.tsx +2 -2
- package/corpus/core/src/templates/chat/netlify.toml +1 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +16 -0
- package/corpus/core/src/vite/client.ts +6 -0
- package/corpus/templates/analytics/.agents/skills/adhoc-analysis/SKILL.md +27 -43
- package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +19 -8
- package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +2 -2
- package/corpus/templates/analytics/AGENTS.md +20 -8
- package/corpus/templates/analytics/actions/get-explorer-dashboard.ts +3 -0
- package/corpus/templates/analytics/actions/list-dashboard-usage-stats.ts +140 -46
- package/corpus/templates/analytics/actions/migrate-analytics-artifacts.ts +48 -0
- package/corpus/templates/analytics/actions/save-analysis.ts +2 -3
- package/corpus/templates/analytics/actions/view-screen.ts +1 -1
- package/corpus/templates/analytics/app/components/dashboard/DashboardMetadata.tsx +77 -0
- package/corpus/templates/analytics/app/components/dashboard/DashboardPanelSkeleton.tsx +7 -1
- package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +1 -0
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +103 -502
- package/corpus/templates/analytics/app/global.css +30 -0
- package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +2 -2
- package/corpus/templates/analytics/app/i18n-data.ts +80 -0
- package/corpus/templates/analytics/app/pages/Agents.tsx +49 -2
- package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +54 -11
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +3 -53
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +23 -25
- package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +2 -2
- package/corpus/templates/analytics/app/routes/analyses._index.tsx +3 -2
- package/corpus/templates/analytics/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/analytics/changelog/2026-07-23-analytics-now-groups-saved-analyses-and-embedded-extensions-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-23-dashboard-menus-show-who-created-and-last-updated-each-dashb.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-23-dashboard-usage-now-loads-reliably-for-organizations-with-ma.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-23-long-dashboard-building-requests-now-continue-without-stoppi.md +6 -0
- package/corpus/templates/analytics/netlify.toml +4 -0
- package/corpus/templates/analytics/server/db/schema.ts +4 -0
- package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +0 -1
- package/corpus/templates/analytics/server/lib/agent-readable-resource-context.ts +1 -0
- package/corpus/templates/analytics/server/lib/migrate-analytics-artifacts.ts +1062 -0
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +6 -52
- package/corpus/templates/analytics/server/plugins/core-routes.ts +1 -1
- package/corpus/templates/analytics/server/plugins/db.ts +10 -0
- package/corpus/templates/assets/actions/generate-image-batch.ts +36 -1
- package/corpus/templates/assets/actions/generate-image.ts +28 -1
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +47 -9
- package/corpus/templates/assets/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/assets/changelog/2026-07-23-assets-image-generation-now-recovers-after-a-completed-tool-.md +6 -0
- package/corpus/templates/assets/changelog/2026-07-23-new-chat-aligns-with-sidebar-controls.md +6 -0
- package/corpus/templates/assets/netlify.toml +1 -0
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +38 -8
- package/corpus/templates/brain/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/brain/netlify.toml +1 -0
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +43 -5
- package/corpus/templates/calendar/app/routes/_app.extensions._index.tsx +2 -16
- package/corpus/templates/calendar/netlify.toml +1 -0
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +35 -6
- package/corpus/templates/chat/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/chat/netlify.toml +1 -0
- package/corpus/templates/clips/app/components/library/library-layout.tsx +52 -6
- package/corpus/templates/clips/app/routes/_app.extensions._index.tsx +2 -16
- package/corpus/templates/clips/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-23-meeting-recording-meters-and-dismissed-prompts.md +6 -0
- package/corpus/templates/clips/desktop/src/hooks/useMicMeter.ts +1 -1
- package/corpus/templates/clips/desktop/src/lib/meeting-notification-dismissal.ts +2 -0
- package/corpus/templates/clips/desktop/src/lib/voice-dictation.ts +1 -3
- package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +86 -0
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +24 -0
- package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +5 -69
- package/corpus/templates/clips/desktop/src/styles.css +35 -3
- package/corpus/templates/clips/desktop/src-tauri/src/adhoc_meetings_watcher.rs +13 -44
- package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +119 -17
- package/corpus/templates/clips/netlify.toml +1 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +3 -7
- package/corpus/templates/content/app/routes/_app.extensions._index.tsx +2 -2
- package/corpus/templates/content/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
- package/corpus/templates/content/netlify.toml +1 -0
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +55 -17
- package/corpus/templates/design/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/design/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
- package/corpus/templates/design/netlify.toml +1 -0
- package/corpus/templates/dispatch/app/dispatch-extensions.tsx +1 -1
- package/corpus/templates/dispatch/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
- package/corpus/templates/dispatch/netlify.toml +1 -0
- package/corpus/templates/forms/.agents/skills/form-publishing/SKILL.md +9 -3
- package/corpus/templates/forms/AGENTS.md +11 -1
- package/corpus/templates/forms/README.md +24 -1
- package/corpus/templates/forms/actions/update-form.ts +12 -5
- package/corpus/templates/forms/app/components/builder/FieldPropertiesPanel.tsx +199 -1
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +41 -45
- package/corpus/templates/forms/app/i18n/en-US.ts +13 -1
- package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +35 -4
- package/corpus/templates/forms/app/pages/FormFillPage.tsx +7 -16
- package/corpus/templates/forms/app/routes/_app.extensions._index.tsx +2 -2
- package/corpus/templates/forms/changelog/2026-07-23-agent-settings-are-clearly-labeled-manage-agent-in-the-sideb.md +6 -0
- package/corpus/templates/forms/changelog/2026-07-23-forms-can-branch-into-follow-up-questions-and-route-response.md +6 -0
- package/corpus/templates/forms/netlify.toml +1 -0
- package/corpus/templates/forms/server/handlers/submissions.ts +22 -31
- package/corpus/templates/forms/server/lib/integrations.ts +11 -2
- package/corpus/templates/forms/server/lib/public-form-ssr.ts +26 -5
- package/corpus/templates/forms/server/lib/validate-fields.ts +48 -11
- package/corpus/templates/forms/server/plugins/agent-chat.ts +1 -0
- package/corpus/templates/forms/shared/conditional.ts +67 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +36 -5
- package/corpus/templates/macros/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/macros/netlify.toml +1 -0
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +0 -9
- package/corpus/templates/mail/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/mail/netlify.toml +1 -0
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +38 -5
- package/corpus/templates/plan/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/plan/netlify.toml +1 -0
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +47 -4
- package/corpus/templates/slides/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/slides/netlify.toml +1 -0
- package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +37 -6
- package/corpus/templates/tasks/app/routes/extensions._index.tsx +2 -2
- package/corpus/templates/tasks/app/routes/settings.tsx +31 -0
- package/corpus/templates/tasks/netlify.toml +1 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +4 -0
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts +9 -0
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +25 -10
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/types.d.ts +2 -2
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +35 -0
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.d.ts +5 -1
- package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
- package/dist/client/extensions/ExtensionsListPage.js +5 -3
- package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
- package/dist/client/settings/ExtensionsSettingsContent.d.ts +2 -0
- package/dist/client/settings/ExtensionsSettingsContent.d.ts.map +1 -0
- package/dist/client/settings/ExtensionsSettingsContent.js +10 -0
- package/dist/client/settings/ExtensionsSettingsContent.js.map +1 -0
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +10 -1
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/use-chat-models.d.ts +1 -0
- package/dist/client/use-chat-models.d.ts.map +1 -1
- package/dist/client/use-chat-models.js +33 -0
- package/dist/client/use-chat-models.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/deploy/build.js +1 -0
- package/dist/deploy/build.js.map +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/provider-api/actions/custom-provider-registration.d.ts +4 -4
- package/dist/provider-api/actions/provider-api.d.ts +2 -2
- package/dist/server/analytics.d.ts +17 -4
- package/dist/server/analytics.d.ts.map +1 -1
- package/dist/server/analytics.js +122 -17
- package/dist/server/analytics.js.map +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +5 -4
- package/dist/server/auth.js.map +1 -1
- package/dist/server/better-auth-instance.d.ts +8 -0
- package/dist/server/better-auth-instance.d.ts.map +1 -1
- package/dist/server/better-auth-instance.js +10 -1
- package/dist/server/better-auth-instance.js.map +1 -1
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +35 -6
- package/dist/templates/chat/app/routes/extensions._index.tsx +2 -2
- package/dist/templates/chat/netlify.toml +1 -0
- package/dist/templates/workspace-core/.agents/skills/extensions/SKILL.md +16 -0
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +2 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/extensions.mdx +23 -4
- package/package.json +1 -1
- package/src/agent/production-agent.ts +4 -0
- package/src/agent/run-manager.ts +36 -10
- package/src/agent/types.ts +2 -0
- package/src/client/MultiTabAssistantChat.tsx +45 -0
- package/src/client/extensions/ExtensionsListPage.tsx +16 -3
- package/src/client/settings/ExtensionsSettingsContent.tsx +24 -0
- package/src/client/settings/SettingsPanel.tsx +10 -0
- package/src/client/use-chat-models.ts +45 -0
- package/src/deploy/build.ts +3 -0
- package/src/server/analytics.ts +164 -20
- package/src/server/auth.ts +17 -13
- package/src/server/better-auth-instance.ts +13 -1
- package/src/templates/chat/app/components/layout/Sidebar.tsx +35 -6
- package/src/templates/chat/app/routes/extensions._index.tsx +2 -2
- package/src/templates/chat/netlify.toml +1 -0
- package/src/templates/workspace-core/.agents/skills/extensions/SKILL.md +16 -0
- package/src/vite/client.ts +6 -0
- package/corpus/templates/analytics/app/components/layout/NewAnalysisDialog.tsx +0 -165
- package/corpus/templates/analytics/app/pages/analyses/AnalysesList.tsx +0 -175
package/corpus/README.md
CHANGED
package/corpus/core/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @agent-native/core
|
|
2
2
|
|
|
3
|
+
## 0.120.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b00c38d: Emit the continuation handoff event after completion callbacks install server-driven continuations.
|
|
8
|
+
- b00c38d: Keep generated chat template Settings and Manage agent links in the sidebar footer.
|
|
9
|
+
- b00c38d: Move extension management into the shared Settings tabs and support embedded extension lists.
|
|
10
|
+
- b00c38d: Preserve the full continuation reason when durable agent runs hand off to the next chunk.
|
|
11
|
+
|
|
12
|
+
## 0.120.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 5477352: Keep Dispatch's overview composer, full-page chat, and side chat on the same selected model.
|
|
17
|
+
- 5477352: Inject the configured Google Analytics tag into framework-owned login and signup pages.
|
|
18
|
+
|
|
3
19
|
## 0.120.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -223,7 +223,7 @@ Pattern across all of these: extensions are about **the moment** the user is in
|
|
|
223
223
|
|
|
224
224
|
The simple path:
|
|
225
225
|
|
|
226
|
-
1. **
|
|
226
|
+
1. Open **Settings → Extensions** (or just ask in chat), then click **New Extension**.
|
|
227
227
|
2. **Describe what you want in one sentence.** "A sticky-note pad for the contact I'm emailing." "A KPI box for trials started this week."
|
|
228
228
|
3. **The agent writes it and it appears in your Extensions list, ready to use.**
|
|
229
229
|
|
|
@@ -617,9 +617,23 @@ Extensions are private to the user who created them by default. To share:
|
|
|
617
617
|
|
|
618
618
|
Shared extensions have their own URLs and plug into the same share dialog as documents, decks, and dashboards. Slot installs are always personal — sharing an extension means others _can_ install it; it doesn't auto-pin it to their UI.
|
|
619
619
|
|
|
620
|
-
##
|
|
620
|
+
## Should I use an extension or edit the app code? {#vs-app-code}
|
|
621
621
|
|
|
622
|
-
The framework lets the agent edit the app's source code directly — components,
|
|
622
|
+
The framework lets the agent edit the app's source code directly — components,
|
|
623
|
+
routes, styles, and business logic. Use this question when either path could
|
|
624
|
+
solve the request:
|
|
625
|
+
|
|
626
|
+
- **Start with an extension** for a self-contained, relatively one-off widget:
|
|
627
|
+
a custom visualization or interaction, a dashboard tile, a standalone
|
|
628
|
+
utility, or an add-on in an existing slot. It is fast, requires no source
|
|
629
|
+
change, build, or deploy, and can be private or shared.
|
|
630
|
+
- **Use app code** for a core feature of the template, a change to native UI,
|
|
631
|
+
layout, routes, or business logic, or anything that should be reused broadly
|
|
632
|
+
across dashboards or users. If the host has no suitable slot or the request
|
|
633
|
+
needs a new slot, use code.
|
|
634
|
+
- **Promote repeated extensions.** If people keep rebuilding the same
|
|
635
|
+
extension, or maintaining copies in many places would be worse than one
|
|
636
|
+
shared implementation, move it into app code as a reusable native feature.
|
|
623
637
|
|
|
624
638
|
| | Extension | App code edit |
|
|
625
639
|
| --------------------- | ------------------------------------------------- | ------------------------------------ |
|
|
@@ -630,7 +644,12 @@ The framework lets the agent edit the app's source code directly — components,
|
|
|
630
644
|
| **Scope** | One user (or shared with org) | The entire product, every user |
|
|
631
645
|
| **Best for** | Personal widgets, custom KPIs, per-team utilities | Core features that ship to all users |
|
|
632
646
|
|
|
633
|
-
Rule of thumb: **if
|
|
647
|
+
Rule of thumb: **if an extension can solve the problem, generally start there.**
|
|
648
|
+
Use code when the extension boundary does not fit or when broad reuse and
|
|
649
|
+
product-wide availability justify a native implementation. For example, a
|
|
650
|
+
one-off custom visualization on a dashboard is a good extension; a new pie,
|
|
651
|
+
multi-bar, or line chart type that should be available across dashboards
|
|
652
|
+
belongs in the template code.
|
|
634
653
|
|
|
635
654
|
If what you actually need is a cached, refreshable data source for an existing chart or table — not a new interactive widget — see [Data Programs](/docs/data-programs) instead; it shares this page's sandbox and security posture but has no UI of its own.
|
|
636
655
|
|
package/corpus/core/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.120.
|
|
3
|
+
"version": "0.120.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": {
|
|
@@ -6401,6 +6401,10 @@ export async function chainServerDrivenContinuation(opts: {
|
|
|
6401
6401
|
terminalEvent: run.events.at(-1)?.event,
|
|
6402
6402
|
})
|
|
6403
6403
|
.catch(() => {});
|
|
6404
|
+
run.continuationTerminalEvent = {
|
|
6405
|
+
type: "auto_continue",
|
|
6406
|
+
reason: continuationReason,
|
|
6407
|
+
};
|
|
6404
6408
|
} catch (chainErr) {
|
|
6405
6409
|
// Chain dispatch failed — fail loud so the held row goes terminal
|
|
6406
6410
|
// instead of spinning. The reaper would also catch it, but this is
|
|
@@ -41,6 +41,16 @@ export interface ActiveRun {
|
|
|
41
41
|
subscribers: Set<(event: RunEvent) => void>;
|
|
42
42
|
abort: AbortController;
|
|
43
43
|
abortReason?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Terminal event to emit when a server-driven continuation has been handed
|
|
46
|
+
* off successfully. The continuation runs outside this process, so the
|
|
47
|
+
* normal loop-level auto_continue event is not sent through this run's
|
|
48
|
+
* `send` callback.
|
|
49
|
+
*/
|
|
50
|
+
continuationTerminalEvent?: Extract<
|
|
51
|
+
AgentChatEvent,
|
|
52
|
+
{ type: "auto_continue" }
|
|
53
|
+
>;
|
|
44
54
|
startedAt: number;
|
|
45
55
|
}
|
|
46
56
|
|
|
@@ -954,7 +964,17 @@ export function startRun(
|
|
|
954
964
|
// /runs/active check while we wait for SQL writes to land.
|
|
955
965
|
let completionError: unknown = null;
|
|
956
966
|
let terminalPersistenceError: unknown = null;
|
|
957
|
-
const
|
|
967
|
+
const resolveTerminalEventForCompletion = () => {
|
|
968
|
+
const continuationTerminalEvent = run.continuationTerminalEvent
|
|
969
|
+
? {
|
|
970
|
+
seq: run.events.length,
|
|
971
|
+
event: run.continuationTerminalEvent,
|
|
972
|
+
}
|
|
973
|
+
: null;
|
|
974
|
+
return continuationTerminalEvent ?? pendingTerminalEvent;
|
|
975
|
+
};
|
|
976
|
+
let terminalEventForCompletion = resolveTerminalEventForCompletion();
|
|
977
|
+
let terminalEvent = terminalEventForCompletion?.event ?? null;
|
|
958
978
|
if (
|
|
959
979
|
onComplete &&
|
|
960
980
|
!(run.status === "aborted" && run.abortReason === "no_progress")
|
|
@@ -966,12 +986,12 @@ export function startRun(
|
|
|
966
986
|
? "errored"
|
|
967
987
|
: run.status;
|
|
968
988
|
const completionRun: ActiveRun =
|
|
969
|
-
|
|
989
|
+
terminalEventForCompletion || completionStatus !== run.status
|
|
970
990
|
? {
|
|
971
991
|
...run,
|
|
972
992
|
status: completionStatus,
|
|
973
|
-
events:
|
|
974
|
-
? [...run.events,
|
|
993
|
+
events: terminalEventForCompletion
|
|
994
|
+
? [...run.events, terminalEventForCompletion]
|
|
975
995
|
: run.events,
|
|
976
996
|
}
|
|
977
997
|
: run;
|
|
@@ -986,6 +1006,12 @@ export function startRun(
|
|
|
986
1006
|
}
|
|
987
1007
|
}
|
|
988
1008
|
|
|
1009
|
+
// Server-driven continuation is installed by onComplete after the
|
|
1010
|
+
// successor has been dispatched. Resolve the terminal event again so
|
|
1011
|
+
// this chunk emits auto_continue instead of a misleading done event.
|
|
1012
|
+
terminalEventForCompletion = resolveTerminalEventForCompletion();
|
|
1013
|
+
terminalEvent = terminalEventForCompletion?.event ?? null;
|
|
1014
|
+
|
|
989
1015
|
// 2. Compute final status. If the completion callback threw, we'd
|
|
990
1016
|
// rather mark the run errored than claim success with incomplete
|
|
991
1017
|
// thread_data.
|
|
@@ -1022,18 +1048,18 @@ export function startRun(
|
|
|
1022
1048
|
// re-stamp the seq at emit time (max-seq+1) just below.
|
|
1023
1049
|
const terminalEvent: AgentChatEvent =
|
|
1024
1050
|
finalStatus === "completed"
|
|
1025
|
-
? (
|
|
1026
|
-
:
|
|
1027
|
-
|
|
1028
|
-
?
|
|
1029
|
-
:
|
|
1051
|
+
? (terminalEventForCompletion?.event ?? { type: "done" })
|
|
1052
|
+
: terminalEventForCompletion?.event.type === "error" ||
|
|
1053
|
+
terminalEventForCompletion?.event.type === "missing_api_key"
|
|
1054
|
+
? terminalEventForCompletion.event
|
|
1055
|
+
: terminalEventForCompletion?.event.type === "auto_continue"
|
|
1030
1056
|
? // The run was checkpointed at a soft-timeout/loop boundary and
|
|
1031
1057
|
// is recoverable: the partial turn is in agent_run_events and
|
|
1032
1058
|
// the continuation run will re-attempt the thread_data save.
|
|
1033
1059
|
// Even though the completion save failed (finalStatus stays
|
|
1034
1060
|
// "errored" for SQL/diagnostics), re-emit the auto_continue so
|
|
1035
1061
|
// the client resumes instead of seeing a dead chat.
|
|
1036
|
-
|
|
1062
|
+
terminalEventForCompletion.event
|
|
1037
1063
|
: {
|
|
1038
1064
|
type: "error",
|
|
1039
1065
|
error: completionError
|
|
@@ -167,6 +167,7 @@ export interface AgentChatRequest {
|
|
|
167
167
|
continuationReason?:
|
|
168
168
|
| "run_timeout"
|
|
169
169
|
| "loop_limit"
|
|
170
|
+
| "max_tokens"
|
|
170
171
|
| "no_progress"
|
|
171
172
|
| "stream_ended"
|
|
172
173
|
| "gateway_timeout"
|
|
@@ -371,6 +372,7 @@ export type AgentChatEvent =
|
|
|
371
372
|
reason:
|
|
372
373
|
| "run_timeout"
|
|
373
374
|
| "loop_limit"
|
|
375
|
+
| "max_tokens"
|
|
374
376
|
| "no_progress"
|
|
375
377
|
| "stream_ended"
|
|
376
378
|
| "gateway_timeout"
|
|
@@ -56,6 +56,7 @@ import { isTrustedFrameMessage } from "./frame.js";
|
|
|
56
56
|
import { RunStuckBanner } from "./RunStuckBanner.js";
|
|
57
57
|
import { callAction } from "./use-action.js";
|
|
58
58
|
import { useChangeVersion } from "./use-change-version.js";
|
|
59
|
+
import { CHAT_MODEL_SELECTION_CHANGED_EVENT } from "./use-chat-models.js";
|
|
59
60
|
import {
|
|
60
61
|
useChatThreads,
|
|
61
62
|
type ChatThreadScope,
|
|
@@ -138,6 +139,13 @@ function writeStoredModelSelection(key: string, selection: ModelSelection) {
|
|
|
138
139
|
if (typeof window === "undefined") return;
|
|
139
140
|
try {
|
|
140
141
|
window.localStorage.setItem(key, JSON.stringify(selection));
|
|
142
|
+
queueMicrotask(() => {
|
|
143
|
+
window.dispatchEvent(
|
|
144
|
+
new CustomEvent(CHAT_MODEL_SELECTION_CHANGED_EVENT, {
|
|
145
|
+
detail: { key },
|
|
146
|
+
}),
|
|
147
|
+
);
|
|
148
|
+
});
|
|
141
149
|
} catch {}
|
|
142
150
|
}
|
|
143
151
|
|
|
@@ -954,6 +962,43 @@ export function MultiTabAssistantChat({
|
|
|
954
962
|
const bumpModelSelectionVersion = useCallback(() => {
|
|
955
963
|
setModelSelectionVersion((version) => version + 1);
|
|
956
964
|
}, []);
|
|
965
|
+
|
|
966
|
+
useEffect(() => {
|
|
967
|
+
if (typeof window === "undefined") return;
|
|
968
|
+
|
|
969
|
+
const syncPersistedSelection = (event?: Event) => {
|
|
970
|
+
const detail = (event as CustomEvent<{ key?: string }> | undefined)
|
|
971
|
+
?.detail;
|
|
972
|
+
if (detail?.key && detail.key !== modelSelectionKey) return;
|
|
973
|
+
|
|
974
|
+
const next = readStoredModelSelection(modelSelectionKey);
|
|
975
|
+
if (!next) return;
|
|
976
|
+
|
|
977
|
+
const activeThreadId = activeThreadIdRef.current;
|
|
978
|
+
if (activeThreadId) {
|
|
979
|
+
threadModelRef.current.set(activeThreadId, next);
|
|
980
|
+
}
|
|
981
|
+
setPersistedModelSelection(next);
|
|
982
|
+
bumpModelSelectionVersion();
|
|
983
|
+
};
|
|
984
|
+
const handleStorage = (event: StorageEvent) => {
|
|
985
|
+
if (event.key === modelSelectionKey) syncPersistedSelection();
|
|
986
|
+
};
|
|
987
|
+
|
|
988
|
+
window.addEventListener(
|
|
989
|
+
CHAT_MODEL_SELECTION_CHANGED_EVENT,
|
|
990
|
+
syncPersistedSelection,
|
|
991
|
+
);
|
|
992
|
+
window.addEventListener("storage", handleStorage);
|
|
993
|
+
return () => {
|
|
994
|
+
window.removeEventListener(
|
|
995
|
+
CHAT_MODEL_SELECTION_CHANGED_EVENT,
|
|
996
|
+
syncPersistedSelection,
|
|
997
|
+
);
|
|
998
|
+
window.removeEventListener("storage", handleStorage);
|
|
999
|
+
};
|
|
1000
|
+
}, [bumpModelSelectionVersion, modelSelectionKey]);
|
|
1001
|
+
|
|
957
1002
|
const postMessageSubmissionsDisabled = props.composerDisabled === true;
|
|
958
1003
|
|
|
959
1004
|
const setContextInTab = useCallback(
|
|
@@ -99,7 +99,14 @@ function CreateToolInput({ className }: { className?: string }) {
|
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
export
|
|
102
|
+
export interface ExtensionsListPageProps {
|
|
103
|
+
/** Skip the standalone extensions navigation state when embedded in Settings. */
|
|
104
|
+
embedded?: boolean;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function ExtensionsListPage({
|
|
108
|
+
embedded = false,
|
|
109
|
+
}: ExtensionsListPageProps = {}) {
|
|
103
110
|
const t = useT();
|
|
104
111
|
const [showCreate, setShowCreate] = useState(false);
|
|
105
112
|
const [confirmDeleteId, setConfirmDeleteId] = useState<string | null>(null);
|
|
@@ -111,12 +118,13 @@ export function ExtensionsListPage() {
|
|
|
111
118
|
);
|
|
112
119
|
|
|
113
120
|
useEffect(() => {
|
|
121
|
+
if (embedded) return;
|
|
114
122
|
fetch(agentNativePath("/_agent-native/application-state/navigation"), {
|
|
115
123
|
method: "PUT",
|
|
116
124
|
headers: { "Content-Type": "application/json" },
|
|
117
125
|
body: JSON.stringify({ view: "extensions" }),
|
|
118
126
|
}).catch(() => {});
|
|
119
|
-
}, []);
|
|
127
|
+
}, [embedded]);
|
|
120
128
|
|
|
121
129
|
useEffect(() => {
|
|
122
130
|
if (typeof window === "undefined") return;
|
|
@@ -189,7 +197,12 @@ export function ExtensionsListPage() {
|
|
|
189
197
|
};
|
|
190
198
|
|
|
191
199
|
return (
|
|
192
|
-
<div
|
|
200
|
+
<div
|
|
201
|
+
className={cn(
|
|
202
|
+
"flex w-full flex-col",
|
|
203
|
+
embedded ? "min-h-[28rem]" : "h-full",
|
|
204
|
+
)}
|
|
205
|
+
>
|
|
193
206
|
<header className="flex h-12 items-center justify-between border-b px-4 shrink-0">
|
|
194
207
|
<div className="flex items-center gap-2">
|
|
195
208
|
<h1 className="text-sm font-semibold">{t("extensions.title")}</h1>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IconLoader2 } from "@tabler/icons-react";
|
|
2
|
+
import { lazy, Suspense } from "react";
|
|
3
|
+
|
|
4
|
+
const ExtensionsListPage = lazy(() =>
|
|
5
|
+
import("../extensions/ExtensionsListPage.js").then((module) => ({
|
|
6
|
+
default: module.ExtensionsListPage,
|
|
7
|
+
})),
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
export function ExtensionsSettingsContent() {
|
|
11
|
+
return (
|
|
12
|
+
<div className="mx-auto w-full max-w-5xl overflow-hidden rounded-lg border border-border bg-background">
|
|
13
|
+
<Suspense
|
|
14
|
+
fallback={
|
|
15
|
+
<div className="flex min-h-[28rem] items-center justify-center text-muted-foreground">
|
|
16
|
+
<IconLoader2 className="size-5 animate-spin" aria-label="Loading" />
|
|
17
|
+
</div>
|
|
18
|
+
}
|
|
19
|
+
>
|
|
20
|
+
<ExtensionsListPage embedded />
|
|
21
|
+
</Suspense>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
IconGauge,
|
|
30
30
|
IconApps,
|
|
31
31
|
IconUsersGroup,
|
|
32
|
+
IconTool,
|
|
32
33
|
} from "@tabler/icons-react";
|
|
33
34
|
import React, {
|
|
34
35
|
Suspense,
|
|
@@ -67,6 +68,7 @@ import {
|
|
|
67
68
|
import { AgentsSection } from "./AgentsSection.js";
|
|
68
69
|
import { AutomationsSection } from "./AutomationsSection.js";
|
|
69
70
|
import { DemoModeSection } from "./DemoModeSection.js";
|
|
71
|
+
import { ExtensionsSettingsContent } from "./ExtensionsSettingsContent.js";
|
|
70
72
|
import { SecretsSection } from "./SecretsSection.js";
|
|
71
73
|
import {
|
|
72
74
|
SettingsSection,
|
|
@@ -3037,6 +3039,14 @@ export function useAgentSettingsTabs(): SettingsTabItem[] {
|
|
|
3037
3039
|
/>
|
|
3038
3040
|
),
|
|
3039
3041
|
},
|
|
3042
|
+
{
|
|
3043
|
+
id: "extensions",
|
|
3044
|
+
label: "Extensions",
|
|
3045
|
+
icon: IconTool,
|
|
3046
|
+
group: "workspace",
|
|
3047
|
+
keywords: "extensions widgets mini apps tools sandboxed apps",
|
|
3048
|
+
content: <ExtensionsSettingsContent />,
|
|
3049
|
+
},
|
|
3040
3050
|
];
|
|
3041
3051
|
}, [baseProps]);
|
|
3042
3052
|
}
|
|
@@ -42,6 +42,8 @@ interface Options {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
const DEFAULT_STORAGE_KEY = "agent-native:chat-models:selection";
|
|
45
|
+
export const CHAT_MODEL_SELECTION_CHANGED_EVENT =
|
|
46
|
+
"agent-native:chat-model-selection-changed";
|
|
45
47
|
|
|
46
48
|
interface PersistedSelection {
|
|
47
49
|
model?: string;
|
|
@@ -63,6 +65,13 @@ function writePersisted(key: string | null, value: PersistedSelection) {
|
|
|
63
65
|
if (!key || typeof window === "undefined") return;
|
|
64
66
|
try {
|
|
65
67
|
window.localStorage.setItem(key, JSON.stringify(value));
|
|
68
|
+
queueMicrotask(() => {
|
|
69
|
+
window.dispatchEvent(
|
|
70
|
+
new CustomEvent(CHAT_MODEL_SELECTION_CHANGED_EVENT, {
|
|
71
|
+
detail: { key },
|
|
72
|
+
}),
|
|
73
|
+
);
|
|
74
|
+
});
|
|
66
75
|
} catch {}
|
|
67
76
|
}
|
|
68
77
|
|
|
@@ -110,6 +119,42 @@ export function useChatModels({
|
|
|
110
119
|
};
|
|
111
120
|
}, [selectedEffort, selectedEngine, selectedModel]);
|
|
112
121
|
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
if (!storageKey || typeof window === "undefined") return;
|
|
124
|
+
|
|
125
|
+
const syncPersistedSelection = (event?: Event) => {
|
|
126
|
+
const detail = (event as CustomEvent<{ key?: string }> | undefined)
|
|
127
|
+
?.detail;
|
|
128
|
+
if (detail?.key && detail.key !== storageKey) return;
|
|
129
|
+
|
|
130
|
+
const next = readPersisted(storageKey);
|
|
131
|
+
if (!next.model) return;
|
|
132
|
+
|
|
133
|
+
hasExplicitSelectionRef.current = true;
|
|
134
|
+
setSelectedModel(next.model);
|
|
135
|
+
setSelectedEngine(next.engine ?? "");
|
|
136
|
+
setSelectedEffort(
|
|
137
|
+
resolveReasoningEffortSelection(next.model, next.effort),
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
const handleStorage = (event: StorageEvent) => {
|
|
141
|
+
if (event.key === storageKey) syncPersistedSelection();
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
window.addEventListener(
|
|
145
|
+
CHAT_MODEL_SELECTION_CHANGED_EVENT,
|
|
146
|
+
syncPersistedSelection,
|
|
147
|
+
);
|
|
148
|
+
window.addEventListener("storage", handleStorage);
|
|
149
|
+
return () => {
|
|
150
|
+
window.removeEventListener(
|
|
151
|
+
CHAT_MODEL_SELECTION_CHANGED_EVENT,
|
|
152
|
+
syncPersistedSelection,
|
|
153
|
+
);
|
|
154
|
+
window.removeEventListener("storage", handleStorage);
|
|
155
|
+
};
|
|
156
|
+
}, [storageKey]);
|
|
157
|
+
|
|
113
158
|
const onModelChange = useCallback(
|
|
114
159
|
(model: string, engine: string) => {
|
|
115
160
|
hasExplicitSelectionRef.current = true;
|
|
@@ -3708,6 +3708,9 @@ export default bundle;
|
|
|
3708
3708
|
"process.env.AGENT_NATIVE_BUILD_GA_MEASUREMENT_ID": JSON.stringify(
|
|
3709
3709
|
process.env.GA_MEASUREMENT_ID?.trim() || "",
|
|
3710
3710
|
),
|
|
3711
|
+
"process.env.AGENT_NATIVE_BUILD_GTM_CONTAINER_ID": JSON.stringify(
|
|
3712
|
+
process.env.GTM_CONTAINER_ID?.trim() || "",
|
|
3713
|
+
),
|
|
3711
3714
|
"process.env.AGENT_NATIVE_BUILD_DEPLOY_CONTEXT": JSON.stringify(
|
|
3712
3715
|
process.env.CONTEXT?.trim() || "",
|
|
3713
3716
|
),
|