@agent-native/core 0.154.5 → 0.157.0
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/templates/analytics/.agents/skills/account-health/SKILL.md +76 -0
- package/corpus/templates/analytics/.agents/skills/bigquery/SKILL.md +3 -0
- package/corpus/templates/analytics/.agents/skills/cross-source-analysis/SKILL.md +2 -1
- package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +6 -5
- package/corpus/templates/analytics/AGENTS.md +3 -0
- package/corpus/templates/analytics/actions/account-deep-dive.ts +3 -2
- package/corpus/templates/analytics/actions/bigquery.ts +1 -1
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +4 -1
- package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +1 -0
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyCombobox.tsx +12 -4
- package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyValueCombobox.tsx +5 -2
- package/corpus/templates/analytics/app/pages/adhoc/explorer/property-label.ts +32 -0
- package/corpus/templates/analytics/changelog/2026-08-13-account-health-readouts-verify-customer-scope-and-contract-metrics.md +7 -0
- package/corpus/templates/analytics/server/jobs/analytics-bigquery-backfill.ts +43 -17
- package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +17 -0
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +4 -0
- package/corpus/templates/assets/app/components/asset/AssetPreviewDialog.tsx +3 -1
- package/corpus/templates/assets/app/i18n-data.ts +21 -1
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +17 -13
- package/corpus/templates/calendar/AGENTS.md +2 -0
- package/corpus/templates/calendar/DEVELOPING.md +4 -4
- package/corpus/templates/calendar/actions/get-settings.ts +4 -11
- package/corpus/templates/calendar/actions/update-availability.ts +15 -4
- package/corpus/templates/calendar/actions/update-settings.ts +15 -4
- package/corpus/templates/calendar/app/components/booking/DatePicker.tsx +9 -3
- package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +21 -19
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +9 -6
- package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +25 -3
- package/corpus/templates/calendar/app/components/calendar/InlineEventPickers.tsx +10 -3
- package/corpus/templates/calendar/app/components/calendar/MonthView.tsx +9 -9
- package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +11 -3
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +10 -4
- package/corpus/templates/calendar/app/i18n-data.ts +30 -0
- package/corpus/templates/calendar/app/lib/availability-schedule.ts +53 -0
- package/corpus/templates/calendar/app/lib/event-form-utils.ts +5 -0
- package/corpus/templates/calendar/app/pages/AvailabilitySettings.tsx +90 -28
- package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +135 -61
- package/corpus/templates/calendar/app/pages/BookingPage.tsx +2 -0
- package/corpus/templates/calendar/app/pages/CalendarView.tsx +30 -15
- package/corpus/templates/calendar/app/pages/Settings.tsx +60 -1
- package/corpus/templates/calendar/changelog/2026-08-13-find-a-time-now-closes-from-a-clear-header-action.md +6 -0
- package/corpus/templates/calendar/server/handlers/bookings.ts +2 -1
- package/corpus/templates/calendar/server/handlers/settings.ts +12 -16
- package/corpus/templates/calendar/shared/api.ts +1 -0
- package/corpus/templates/calendar/shared/availability-schedule.ts +64 -0
- package/corpus/templates/calendar/shared/calendar-week.ts +21 -0
- package/corpus/templates/calendar/shared/settings.ts +44 -0
- package/corpus/templates/clips/AGENTS.md +2 -0
- package/corpus/templates/clips/actions/add-comment.ts +5 -2
- package/corpus/templates/clips/actions/finalize-recording.ts +31 -1
- package/corpus/templates/clips/actions/get-recording-player-data.ts +9 -0
- package/corpus/templates/clips/actions/lib/ensure-seekable-video.ts +21 -1
- package/corpus/templates/clips/actions/reply-to-comment.ts +5 -2
- package/corpus/templates/clips/actions/update-comment.ts +9 -2
- package/corpus/templates/clips/app/components/library/search-bar.tsx +26 -13
- package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +135 -3
- package/corpus/templates/clips/app/components/player/comments-panel.tsx +5 -99
- package/corpus/templates/clips/app/components/player/playback-comment-overlay.tsx +7 -3
- package/corpus/templates/clips/app/components/player/share-dialog.tsx +102 -59
- package/corpus/templates/clips/app/components/player/video-player.tsx +84 -24
- package/corpus/templates/clips/app/components/workspace/notifications-list.tsx +11 -3
- package/corpus/templates/clips/app/i18n/en-US.ts +12 -0
- package/corpus/templates/clips/app/lib/public-meeting.ts +11 -3
- package/corpus/templates/clips/app/lib/search-focus.ts +15 -0
- package/corpus/templates/clips/app/root.tsx +2 -1
- package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +94 -26
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +24 -7
- package/corpus/templates/clips/app/routes/embed.$shareId.tsx +8 -4
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +29 -8
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +24 -6
- package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +72 -26
- package/corpus/templates/clips/changelog/2026-08-13-inline-markdown-comments.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-13-private-meeting-agent-links.md +6 -0
- package/corpus/templates/clips/desktop/src/app.tsx +116 -19
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +13 -29
- package/corpus/templates/clips/desktop/src/lib/recording-request.ts +39 -0
- package/corpus/templates/clips/desktop/src/lib/settings-navigation.ts +11 -0
- package/corpus/templates/clips/desktop/src/lib/whisper-model-picker.ts +7 -0
- package/corpus/templates/clips/desktop/src/styles.css +117 -0
- package/corpus/templates/clips/server/db/index.ts +10 -0
- package/corpus/templates/clips/server/db/schema.ts +1 -0
- package/corpus/templates/clips/server/lib/recordings.ts +3 -1
- package/corpus/templates/clips/server/lib/seekable-media-state.ts +90 -0
- package/corpus/templates/clips/server/plugins/db.ts +5 -0
- package/corpus/templates/clips/server/routes/api/public-meeting.get.ts +37 -4
- package/corpus/templates/clips/server/routes/api/public-recording.get.ts +16 -5
- package/corpus/templates/clips/shared/clips-ai-prefs.ts +3 -0
- package/corpus/templates/clips/shared/meeting-agent-access.ts +5 -0
- package/corpus/templates/content/actions/add-comment.ts +2 -1
- package/corpus/templates/content/actions/update-comment.ts +1 -1
- package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +24 -15
- package/corpus/templates/design/actions/generate-design.ts +10 -7
- package/corpus/templates/design/actions/present-design-variants.ts +35 -6
- package/corpus/templates/design/actions/run-design-audit.ts +33 -0
- package/corpus/templates/design/changelog/2026-08-13-the-design-audit-now-catches-a-screen-that-renders-behind-an.md +6 -0
- package/corpus/templates/design/shared/design-review.ts +1 -0
- package/corpus/templates/design/shared/html-integrity.ts +66 -0
- package/corpus/templates/dispatch/.env.example +5 -0
- package/corpus/templates/dispatch/AGENTS.md +24 -19
- package/corpus/templates/dispatch/app/i18n-data.ts +20 -0
- package/corpus/templates/dispatch/server/lib/identity-sso.ts +21 -90
- package/corpus/templates/dispatch/server/plugins/identity-sso.ts +3 -12
- package/corpus/templates/dispatch/shared/feature-flags.ts +4 -0
- package/corpus/templates/factory/AGENTS.md +5 -1
- package/corpus/templates/factory/README.md +23 -0
- package/corpus/templates/factory/actions/view-screen.ts +17 -0
- package/corpus/templates/factory/app/components/factory/FactoryAgentsView.tsx +239 -0
- package/corpus/templates/factory/app/components/factory/FactoryCanvas.tsx +2 -0
- package/corpus/templates/factory/app/components/factory/FactoryInspector.tsx +130 -7
- package/corpus/templates/factory/app/i18n/en-US.ts +20 -0
- package/corpus/templates/factory/app/routes/factory.tsx +41 -0
- package/corpus/templates/factory/package.json +1 -0
- package/corpus/templates/factory/server/factory-graph/contracts.ts +2 -0
- package/corpus/templates/factory/server/plugins/agent-chat.ts +9 -0
- package/corpus/templates/factory/server/plugins/dispatch-db.ts +1 -0
- package/corpus/templates/factory/server/plugins/setup-dispatch.ts +3 -0
- package/corpus/templates/mail/app/lib/native-mcp-exclusions.ts +3 -0
- package/corpus/templates/mail/vite.config.ts +7 -0
- package/corpus/templates/plan/actions/reply-to-plan-comment.ts +7 -2
- package/corpus/templates/plan/actions/resolve-plan-comment.ts +2 -2
- package/corpus/templates/plan/actions/update-visual-plan.ts +1 -1
- package/corpus/templates/plan/app/pages/PlansPage.tsx +29 -20
- package/corpus/templates/slides/actions/add-slide-comment.ts +1 -1
- package/corpus/templates/slides/actions/update-slide-comment.ts +1 -1
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +9 -6
- package/corpus/templates/slides/app/components/editor/AddSlidePopover.tsx +98 -29
- package/corpus/templates/slides/app/components/editor/EditorActionCluster.tsx +45 -91
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +94 -2
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +17 -29
- package/corpus/templates/slides/app/components/editor/SlideContextToolbar.tsx +1 -1
- package/corpus/templates/slides/app/context/DeckContext.tsx +42 -2
- package/corpus/templates/slides/app/global.css +7 -40
- package/corpus/templates/slides/app/i18n/en-US.ts +4 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +130 -45
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/production-agent.d.ts +30 -0
- package/dist/agent/production-agent.js +105 -9
- package/dist/agent/thread-data-builder.js +17 -1
- package/dist/agent/types.d.ts +9 -0
- package/dist/cli/skills-content/help.js +6 -4
- package/dist/cli/skills.js +17 -2
- package/dist/cli/workspacify.d.ts +5 -0
- package/dist/cli/workspacify.js +65 -8
- package/dist/client/AgentPanel.d.ts +5 -0
- package/dist/client/AgentPanel.js +32 -13
- package/dist/client/AssistantChat.d.ts +36 -1
- package/dist/client/AssistantChat.js +175 -110
- package/dist/client/MultiTabAssistantChat.js +44 -27
- package/dist/client/active-run-state.d.ts +14 -1
- package/dist/client/active-run-state.js +0 -0
- package/dist/client/agent-chat-adapter.js +107 -5
- package/dist/client/analytics.js +9 -2
- package/dist/client/chat/markdown-renderer.js +4 -2
- package/dist/client/chat/message-components.d.ts +2 -2
- package/dist/client/chat/message-components.js +69 -35
- package/dist/client/chat/run-recovery.d.ts +4 -1
- package/dist/client/chat/run-recovery.js +62 -30
- package/dist/client/chat/tool-call-display.d.ts +12 -3
- package/dist/client/chat/tool-call-display.js +79 -40
- package/dist/client/chat/widgets/DataChartRenderer.js +3 -1
- package/dist/client/chat/widgets/DataChartWidget.js +8 -2
- package/dist/client/chat/widgets/DataInsightsWidget.js +3 -1
- package/dist/client/chat/widgets/DataTableWidget.js +23 -9
- package/dist/client/chat/widgets/builtin-tool-renderers.js +3 -1
- package/dist/client/chat-first/apps-rail.js +9 -4
- package/dist/client/chat-first/primary-nav.d.ts +2 -1
- package/dist/client/chat-first/primary-nav.js +3 -3
- package/dist/client/chat-first/types.d.ts +5 -1
- package/dist/client/components/ui/message-scroller.d.ts +1 -1
- package/dist/client/components/ui/message-scroller.js +7 -3
- package/dist/client/composer/runtime-adapters.js +3 -2
- package/dist/client/context-xray/ContextMeter.js +5 -1
- package/dist/client/context-xray/ContextXRayPanel.js +5 -5
- package/dist/client/error-format.d.ts +4 -0
- package/dist/client/error-format.js +93 -5
- package/dist/client/i18n.js +83 -17
- package/dist/client/markdown/InlineMarkdown.d.ts +23 -0
- package/dist/client/markdown/InlineMarkdown.js +65 -0
- package/dist/client/markdown/index.d.ts +1 -0
- package/dist/client/markdown/index.js +1 -0
- package/dist/client/observability/ThumbsFeedback.js +10 -8
- package/dist/client/review/ReviewThreadPanel.js +2 -1
- package/dist/client/run-stream-ownership.d.ts +39 -0
- package/dist/client/run-stream-ownership.js +65 -0
- package/dist/client/sharing/ShareButton.js +160 -54
- package/dist/coding-tools/run-code.js +2 -1
- package/dist/coding-tools/sandbox/background.d.ts +1 -0
- package/dist/coding-tools/sandbox/background.js +8 -1
- package/dist/coding-tools/sandbox/executions-store.d.ts +2 -0
- package/dist/coding-tools/sandbox/executions-store.js +41 -3
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/feature-flags/index.d.ts +1 -1
- package/dist/feature-flags/index.js +1 -1
- package/dist/feature-flags/store.d.ts +10 -0
- package/dist/feature-flags/store.js +112 -1
- package/dist/guards/no-env-credentials.js +4 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/integrations/adapters/slack.js +5 -1
- package/dist/localization/core-messages/ar-SA.d.ts +3 -0
- package/dist/localization/core-messages/ar-SA.js +541 -0
- package/dist/localization/core-messages/de-DE.d.ts +3 -0
- package/dist/localization/core-messages/de-DE.js +513 -0
- package/dist/localization/core-messages/en-US.d.ts +513 -0
- package/dist/localization/core-messages/en-US.js +513 -0
- package/dist/localization/core-messages/es-ES.d.ts +3 -0
- package/dist/localization/core-messages/es-ES.js +520 -0
- package/dist/localization/core-messages/fr-FR.d.ts +3 -0
- package/dist/localization/core-messages/fr-FR.js +520 -0
- package/dist/localization/core-messages/hi-IN.d.ts +3 -0
- package/dist/localization/core-messages/hi-IN.js +513 -0
- package/dist/localization/core-messages/ja-JP.d.ts +3 -0
- package/dist/localization/core-messages/ja-JP.js +506 -0
- package/dist/localization/core-messages/ko-KR.d.ts +3 -0
- package/dist/localization/core-messages/ko-KR.js +506 -0
- package/dist/localization/core-messages/pt-BR.d.ts +3 -0
- package/dist/localization/core-messages/pt-BR.js +520 -0
- package/dist/localization/core-messages/zh-CN.d.ts +3 -0
- package/dist/localization/core-messages/zh-CN.js +506 -0
- package/dist/localization/core-messages/zh-TW.d.ts +3 -0
- package/dist/localization/core-messages/zh-TW.js +506 -0
- package/dist/localization/core-messages.d.ts +524 -0
- package/dist/localization/core-messages.js +124 -0
- package/dist/localization/default-messages.d.ts +3 -0
- package/dist/localization/default-messages.js +3 -0
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +2 -2
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +11 -11
- package/dist/provider-api/actions/provider-api.d.ts +15 -15
- package/dist/resources/agents.js +40 -5
- package/dist/resources/metadata.d.ts +10 -0
- package/dist/resources/metadata.js +7 -3
- package/dist/review/actions/create-review-comment.js +1 -1
- package/dist/review/actions/reply-review-comment.js +1 -1
- package/dist/review/actions/resolve-review-thread.js +1 -1
- package/dist/secrets/routes.d.ts +6 -6
- package/dist/server/action-routes.js +32 -6
- package/dist/server/agent-chat/plugin-options.d.ts +7 -2
- package/dist/server/agent-chat-plugin.d.ts +10 -0
- package/dist/server/agent-chat-plugin.js +144 -41
- package/dist/server/agent-discovery.js +14 -3
- package/dist/server/agent-run-context.d.ts +7 -1
- package/dist/server/agent-run-context.js +9 -2
- package/dist/server/agent-teams-run-queue.d.ts +3 -0
- package/dist/server/agent-teams.js +38 -9
- package/dist/server/core-routes-plugin.js +1 -1
- package/dist/server/identity-sso-migrations.d.ts +7 -0
- package/dist/server/identity-sso-migrations.js +36 -0
- package/dist/server/identity-sso-store.d.ts +3 -2
- package/dist/server/identity-sso-store.js +8 -3
- package/dist/server/index.d.ts +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/release-migrations.js +4 -0
- package/dist/server/request-context.d.ts +7 -0
- package/dist/server/request-context.js +15 -0
- package/dist/tracking/providers.js +13 -3
- package/dist/workspace-files/tool.js +1 -1
- package/docs/content/agent-surfaces.mdx +30 -0
- package/package.json +3 -2
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import englishMessages from "./core-messages/en-US.js";
|
|
2
|
+
export const englishAgentChatMessages = englishMessages;
|
|
3
|
+
const legacyAgentChatAliases = [
|
|
4
|
+
["agentPanel.addOwnKeys", "composer.addOwnKeys"],
|
|
5
|
+
["agentPanel.builderModelCredits", "composer.builderModelCredits"],
|
|
6
|
+
["agentPanel.builderOrOwnKeys", "setup.builderOrOwnKeys"],
|
|
7
|
+
["agentPanel.chat", "shell.chat"],
|
|
8
|
+
["agentPanel.closeTab", "tabs.closeTab"],
|
|
9
|
+
["agentPanel.configureProviderKeys", "composer.configureProviderKeys"],
|
|
10
|
+
["agentPanel.connectAi", "setup.connectAi"],
|
|
11
|
+
["agentPanel.connectBuilderIo", "composer.connectBuilder"],
|
|
12
|
+
["agentPanel.connectingBuilder", "composer.connectingBuilder"],
|
|
13
|
+
["agentPanel.loadingTerminal", "shell.loadingTerminal"],
|
|
14
|
+
["agentPanel.newChat", "tabs.newChat"],
|
|
15
|
+
["agentPanel.toggleAgent", "shell.toggleAgent"],
|
|
16
|
+
["agentPanel.voiceMode", "voiceMode"],
|
|
17
|
+
["contextXray", "contextXray"],
|
|
18
|
+
];
|
|
19
|
+
function getNestedMessage(messages, path) {
|
|
20
|
+
let value = messages;
|
|
21
|
+
for (const part of path.split(".")) {
|
|
22
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
value = value[part];
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
function setNestedMessage(messages, path, value) {
|
|
30
|
+
const parts = path.split(".");
|
|
31
|
+
let cursor = messages;
|
|
32
|
+
for (const part of parts.slice(0, -1)) {
|
|
33
|
+
const nested = cursor[part];
|
|
34
|
+
if (!nested || typeof nested !== "object" || Array.isArray(nested)) {
|
|
35
|
+
cursor[part] = {};
|
|
36
|
+
}
|
|
37
|
+
cursor = cursor[part];
|
|
38
|
+
}
|
|
39
|
+
cursor[parts.at(-1)] = value;
|
|
40
|
+
}
|
|
41
|
+
function cloneMessages(messages) {
|
|
42
|
+
const cloned = {};
|
|
43
|
+
for (const [key, value] of Object.entries(messages)) {
|
|
44
|
+
cloned[key] =
|
|
45
|
+
value && typeof value === "object" && !Array.isArray(value)
|
|
46
|
+
? cloneMessages(value)
|
|
47
|
+
: value;
|
|
48
|
+
}
|
|
49
|
+
return cloned;
|
|
50
|
+
}
|
|
51
|
+
function mergeLegacyMessageValue(legacyValue, modernValue) {
|
|
52
|
+
if (modernValue === undefined)
|
|
53
|
+
return legacyValue;
|
|
54
|
+
if (legacyValue &&
|
|
55
|
+
modernValue &&
|
|
56
|
+
typeof legacyValue === "object" &&
|
|
57
|
+
typeof modernValue === "object" &&
|
|
58
|
+
!Array.isArray(legacyValue) &&
|
|
59
|
+
!Array.isArray(modernValue)) {
|
|
60
|
+
const merged = { ...legacyValue };
|
|
61
|
+
for (const [key, value] of Object.entries(modernValue)) {
|
|
62
|
+
merged[key] = mergeLegacyMessageValue(merged[key], value);
|
|
63
|
+
}
|
|
64
|
+
return merged;
|
|
65
|
+
}
|
|
66
|
+
return modernValue;
|
|
67
|
+
}
|
|
68
|
+
export function normalizeCoreMessageOverrides(messages) {
|
|
69
|
+
const normalized = cloneMessages(messages);
|
|
70
|
+
for (const [legacyPath, agentChatPath] of legacyAgentChatAliases) {
|
|
71
|
+
const legacyValue = getNestedMessage(normalized, legacyPath);
|
|
72
|
+
const modernPath = `agentChat.${agentChatPath}`;
|
|
73
|
+
if (legacyValue !== undefined) {
|
|
74
|
+
setNestedMessage(normalized, modernPath, mergeLegacyMessageValue(legacyValue, getNestedMessage(normalized, modernPath)));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return normalized;
|
|
78
|
+
}
|
|
79
|
+
function nestAgentChatMessages(flatMessages) {
|
|
80
|
+
const agentChat = {};
|
|
81
|
+
for (const [flatKey, message] of Object.entries(flatMessages)) {
|
|
82
|
+
const parts = flatKey.split(".");
|
|
83
|
+
let cursor = agentChat;
|
|
84
|
+
for (const part of parts.slice(0, -1)) {
|
|
85
|
+
const nested = cursor[part];
|
|
86
|
+
if (!nested || typeof nested !== "object" || Array.isArray(nested)) {
|
|
87
|
+
cursor[part] = {};
|
|
88
|
+
}
|
|
89
|
+
cursor = cursor[part];
|
|
90
|
+
}
|
|
91
|
+
cursor[parts.at(-1)] = message;
|
|
92
|
+
}
|
|
93
|
+
const messages = { agentChat };
|
|
94
|
+
for (const [legacyPath, agentChatPath] of legacyAgentChatAliases) {
|
|
95
|
+
const value = getNestedMessage(agentChat, agentChatPath);
|
|
96
|
+
if (value !== undefined)
|
|
97
|
+
setNestedMessage(messages, legacyPath, value);
|
|
98
|
+
}
|
|
99
|
+
return messages;
|
|
100
|
+
}
|
|
101
|
+
const coreMessageLoaders = {
|
|
102
|
+
"en-US": async () => ({ default: englishAgentChatMessages }),
|
|
103
|
+
"zh-CN": () => import("./core-messages/zh-CN.js"),
|
|
104
|
+
"zh-TW": () => import("./core-messages/zh-TW.js"),
|
|
105
|
+
"es-ES": () => import("./core-messages/es-ES.js"),
|
|
106
|
+
"fr-FR": () => import("./core-messages/fr-FR.js"),
|
|
107
|
+
"de-DE": () => import("./core-messages/de-DE.js"),
|
|
108
|
+
"ja-JP": () => import("./core-messages/ja-JP.js"),
|
|
109
|
+
"ko-KR": () => import("./core-messages/ko-KR.js"),
|
|
110
|
+
"pt-BR": () => import("./core-messages/pt-BR.js"),
|
|
111
|
+
"hi-IN": () => import("./core-messages/hi-IN.js"),
|
|
112
|
+
"ar-SA": () => import("./core-messages/ar-SA.js"),
|
|
113
|
+
};
|
|
114
|
+
export async function loadAgentChatMessagesForLocale(locale) {
|
|
115
|
+
return (await coreMessageLoaders[locale]()).default;
|
|
116
|
+
}
|
|
117
|
+
export async function loadCoreMessagesForLocale(locale) {
|
|
118
|
+
return nestAgentChatMessages(await loadAgentChatMessagesForLocale(locale));
|
|
119
|
+
}
|
|
120
|
+
const englishCoreMessages = nestAgentChatMessages(englishAgentChatMessages);
|
|
121
|
+
// Only English is eager. Non-English Core catalogs load with the app catalog.
|
|
122
|
+
export function coreMessagesForLocale(locale) {
|
|
123
|
+
return locale === "en-US" ? englishCoreMessages : {};
|
|
124
|
+
}
|
|
@@ -315,6 +315,7 @@ declare const messages: {
|
|
|
315
315
|
openApp: string;
|
|
316
316
|
notDispatchOrWorkspaceApp: string;
|
|
317
317
|
agentsDescription: string;
|
|
318
|
+
simpleAgentsDescription: string;
|
|
318
319
|
mcpAccessUpdated: string;
|
|
319
320
|
selectAppForMcp: string;
|
|
320
321
|
mcpUrlCopied: string;
|
|
@@ -426,6 +427,7 @@ declare const messages: {
|
|
|
426
427
|
workspace: string;
|
|
427
428
|
newChat: string;
|
|
428
429
|
newTerminal: string;
|
|
430
|
+
loadingTerminal: string;
|
|
429
431
|
panelOptions: string;
|
|
430
432
|
collapseSidebar: string;
|
|
431
433
|
widenChat: string;
|
|
@@ -679,6 +681,7 @@ declare const messages: {
|
|
|
679
681
|
shareLink: string;
|
|
680
682
|
addPeopleByEmail: string;
|
|
681
683
|
notifyPeople: string;
|
|
684
|
+
message: string;
|
|
682
685
|
addMessage: string;
|
|
683
686
|
hideMessage: string;
|
|
684
687
|
messagePlaceholder: string;
|
|
@@ -321,6 +321,7 @@ const messages = {
|
|
|
321
321
|
openApp: "Open app",
|
|
322
322
|
notDispatchOrWorkspaceApp: " a Dispatch tab or a workspace app in this workspace.",
|
|
323
323
|
agentsDescription: "Dispatch can delegate to the built-in app suite over A2A by default. Add extra agents here only if you want to route work to apps outside that built-in set.",
|
|
324
|
+
simpleAgentsDescription: "Create reusable agents in minutes, or import a setup you already made in Claude or another agent tool.",
|
|
324
325
|
mcpAccessUpdated: "Agent integration access updated",
|
|
325
326
|
selectAppForMcp: "Select at least one app, or expose all apps.",
|
|
326
327
|
mcpUrlCopied: "Agent integration URL copied",
|
|
@@ -432,6 +433,7 @@ const messages = {
|
|
|
432
433
|
workspace: "Resources",
|
|
433
434
|
newChat: "New chat",
|
|
434
435
|
newTerminal: "New terminal",
|
|
436
|
+
loadingTerminal: "Loading terminal...",
|
|
435
437
|
panelOptions: "Agent panel options",
|
|
436
438
|
collapseSidebar: "Collapse sidebar",
|
|
437
439
|
widenChat: "Widen chat",
|
|
@@ -685,6 +687,7 @@ const messages = {
|
|
|
685
687
|
shareLink: "Share link",
|
|
686
688
|
addPeopleByEmail: "Add people by email",
|
|
687
689
|
notifyPeople: "Notify people",
|
|
690
|
+
message: "Message",
|
|
688
691
|
addMessage: "Add a message",
|
|
689
692
|
hideMessage: "Hide message",
|
|
690
693
|
messagePlaceholder: "Add a short note (optional)",
|
|
@@ -41,14 +41,14 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
41
41
|
thumbsUpRate: number;
|
|
42
42
|
avgEvalScore: number;
|
|
43
43
|
} | {
|
|
44
|
-
ok?: undefined;
|
|
45
44
|
error?: undefined;
|
|
45
|
+
ok?: undefined;
|
|
46
46
|
summary: import("./types.js").TraceSummary;
|
|
47
47
|
spans: import("./types.js").TraceSpan[];
|
|
48
48
|
id?: undefined;
|
|
49
49
|
} | {
|
|
50
|
-
ok?: undefined;
|
|
51
50
|
error?: undefined;
|
|
51
|
+
ok?: undefined;
|
|
52
52
|
summary?: undefined;
|
|
53
53
|
spans?: undefined;
|
|
54
54
|
id: string;
|
|
@@ -75,9 +75,11 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
75
75
|
user: "user";
|
|
76
76
|
}>>;
|
|
77
77
|
}, z.core.$strip>>, {
|
|
78
|
-
deleted?: undefined;
|
|
79
78
|
id?: undefined;
|
|
80
79
|
provider?: undefined;
|
|
80
|
+
deleted?: undefined;
|
|
81
|
+
found?: undefined;
|
|
82
|
+
message?: undefined;
|
|
81
83
|
providers: {
|
|
82
84
|
id: string;
|
|
83
85
|
label: string;
|
|
@@ -88,46 +90,44 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
88
90
|
updatedAt: number;
|
|
89
91
|
}[];
|
|
90
92
|
count: number;
|
|
91
|
-
found?: undefined;
|
|
92
93
|
registered?: undefined;
|
|
93
94
|
label?: undefined;
|
|
94
|
-
message?: undefined;
|
|
95
95
|
} | {
|
|
96
|
-
deleted?: undefined;
|
|
97
96
|
id?: undefined;
|
|
97
|
+
deleted?: undefined;
|
|
98
|
+
message?: undefined;
|
|
98
99
|
providers?: undefined;
|
|
99
100
|
count?: undefined;
|
|
100
101
|
found: boolean;
|
|
101
102
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
102
103
|
registered?: undefined;
|
|
103
104
|
label?: undefined;
|
|
104
|
-
message?: undefined;
|
|
105
105
|
} | {
|
|
106
|
-
deleted?: undefined;
|
|
107
106
|
provider?: undefined;
|
|
107
|
+
deleted?: undefined;
|
|
108
|
+
message?: undefined;
|
|
108
109
|
providers?: undefined;
|
|
109
110
|
count?: undefined;
|
|
110
111
|
found: boolean;
|
|
111
112
|
id: string;
|
|
112
113
|
registered?: undefined;
|
|
113
114
|
label?: undefined;
|
|
114
|
-
message?: undefined;
|
|
115
115
|
} | {
|
|
116
116
|
provider?: undefined;
|
|
117
|
+
found?: undefined;
|
|
118
|
+
message?: undefined;
|
|
117
119
|
providers?: undefined;
|
|
118
120
|
count?: undefined;
|
|
119
|
-
found?: undefined;
|
|
120
121
|
deleted: boolean;
|
|
121
122
|
id: string;
|
|
122
123
|
registered?: undefined;
|
|
123
124
|
label?: undefined;
|
|
124
|
-
message?: undefined;
|
|
125
125
|
} | {
|
|
126
|
-
deleted?: undefined;
|
|
127
126
|
provider?: undefined;
|
|
127
|
+
deleted?: undefined;
|
|
128
|
+
found?: undefined;
|
|
128
129
|
providers?: undefined;
|
|
129
130
|
count?: undefined;
|
|
130
|
-
found?: undefined;
|
|
131
131
|
registered: boolean;
|
|
132
132
|
id: string;
|
|
133
133
|
label: string;
|
|
@@ -311,9 +311,8 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
311
311
|
notes?: string | undefined;
|
|
312
312
|
scope?: "org" | "user" | undefined;
|
|
313
313
|
}, {
|
|
314
|
-
message?: undefined;
|
|
315
314
|
id?: undefined;
|
|
316
|
-
|
|
315
|
+
found?: undefined;
|
|
317
316
|
providers: {
|
|
318
317
|
id: string;
|
|
319
318
|
label: string;
|
|
@@ -325,45 +324,46 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
325
324
|
}[];
|
|
326
325
|
count: number;
|
|
327
326
|
provider?: undefined;
|
|
328
|
-
|
|
327
|
+
deleted?: undefined;
|
|
329
328
|
registered?: undefined;
|
|
330
329
|
label?: undefined;
|
|
331
|
-
} | {
|
|
332
330
|
message?: undefined;
|
|
333
|
-
|
|
331
|
+
} | {
|
|
334
332
|
id?: undefined;
|
|
335
|
-
deleted?: undefined;
|
|
336
333
|
providers?: undefined;
|
|
334
|
+
count?: undefined;
|
|
337
335
|
found: boolean;
|
|
338
336
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
337
|
+
deleted?: undefined;
|
|
339
338
|
registered?: undefined;
|
|
340
339
|
label?: undefined;
|
|
341
|
-
} | {
|
|
342
340
|
message?: undefined;
|
|
343
|
-
|
|
344
|
-
deleted?: undefined;
|
|
341
|
+
} | {
|
|
345
342
|
providers?: undefined;
|
|
343
|
+
count?: undefined;
|
|
346
344
|
provider?: undefined;
|
|
347
345
|
found: boolean;
|
|
348
346
|
id: string;
|
|
347
|
+
deleted?: undefined;
|
|
349
348
|
registered?: undefined;
|
|
350
349
|
label?: undefined;
|
|
351
|
-
} | {
|
|
352
350
|
message?: undefined;
|
|
353
|
-
|
|
351
|
+
} | {
|
|
352
|
+
found?: undefined;
|
|
354
353
|
providers?: undefined;
|
|
354
|
+
count?: undefined;
|
|
355
355
|
provider?: undefined;
|
|
356
|
-
found?: undefined;
|
|
357
356
|
deleted: boolean;
|
|
358
357
|
id: string;
|
|
359
358
|
registered?: undefined;
|
|
360
359
|
label?: undefined;
|
|
360
|
+
message?: undefined;
|
|
361
361
|
} | {
|
|
362
|
-
|
|
363
|
-
deleted?: undefined;
|
|
362
|
+
found?: undefined;
|
|
364
363
|
providers?: undefined;
|
|
364
|
+
count?: undefined;
|
|
365
365
|
provider?: undefined;
|
|
366
|
-
|
|
366
|
+
deleted?: undefined;
|
|
367
367
|
registered: boolean;
|
|
368
368
|
id: string;
|
|
369
369
|
label: string;
|
package/dist/resources/agents.js
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
|
-
import { parseCustomAgentProfile, } from "./metadata.js";
|
|
1
|
+
import { getResourceKind, parseCustomAgentProfile, } from "./metadata.js";
|
|
2
2
|
import { resourceGet, resourceGetByPath, resourceListAccessible, SHARED_OWNER, } from "./store.js";
|
|
3
|
+
function metadataFields(metadata) {
|
|
4
|
+
if (!metadata)
|
|
5
|
+
return {};
|
|
6
|
+
try {
|
|
7
|
+
const parsed = JSON.parse(metadata);
|
|
8
|
+
return parsed && typeof parsed === "object" && !Array.isArray(parsed)
|
|
9
|
+
? parsed
|
|
10
|
+
: null;
|
|
11
|
+
// coercion-ok: malformed resource metadata is absent, not a valid profile field
|
|
12
|
+
}
|
|
13
|
+
catch (_error) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
async function enrichAgentProfile(owner, profile, accessibleResources) {
|
|
18
|
+
const root = profile.path.replace(/\.md$/i, "");
|
|
19
|
+
const resources = accessibleResources ?? (await resourceListAccessible(owner, `${root}/`));
|
|
20
|
+
const workspace = resources.map((resource) => {
|
|
21
|
+
const metadata = metadataFields(resource.metadata) ?? {};
|
|
22
|
+
return {
|
|
23
|
+
path: resource.path,
|
|
24
|
+
kind: getResourceKind(resource.path),
|
|
25
|
+
name: typeof metadata.name === "string" ? metadata.name : undefined,
|
|
26
|
+
description: typeof metadata.description === "string"
|
|
27
|
+
? metadata.description
|
|
28
|
+
: undefined,
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
return { ...profile, workspace: { root, resources: workspace } };
|
|
32
|
+
}
|
|
3
33
|
export async function listAccessibleCustomAgents(owner) {
|
|
4
34
|
const resources = await resourceListAccessible(owner, "agents/");
|
|
5
35
|
const profiles = await Promise.all(resources
|
|
@@ -8,9 +38,14 @@ export async function listAccessibleCustomAgents(owner) {
|
|
|
8
38
|
const full = await resourceGet(resource.id);
|
|
9
39
|
if (!full)
|
|
10
40
|
return null;
|
|
11
|
-
|
|
41
|
+
const profile = parseCustomAgentProfile(full.content, resource.path);
|
|
42
|
+
return profile;
|
|
43
|
+
}));
|
|
44
|
+
const validProfiles = profiles.filter((profile) => !!profile);
|
|
45
|
+
return Promise.all(validProfiles.map((profile) => {
|
|
46
|
+
const root = `${profile.path.replace(/\.md$/i, "")}/`;
|
|
47
|
+
return enrichAgentProfile(owner, profile, resources.filter((resource) => resource.path.startsWith(root)));
|
|
12
48
|
}));
|
|
13
|
-
return profiles.filter((profile) => !!profile);
|
|
14
49
|
}
|
|
15
50
|
export async function findAccessibleCustomAgent(owner, identifier) {
|
|
16
51
|
const trimmed = identifier.trim();
|
|
@@ -26,13 +61,13 @@ export async function findAccessibleCustomAgent(owner, identifier) {
|
|
|
26
61
|
if (personal) {
|
|
27
62
|
const profile = parseCustomAgentProfile(personal.content, personal.path);
|
|
28
63
|
if (profile)
|
|
29
|
-
return profile;
|
|
64
|
+
return enrichAgentProfile(owner, profile);
|
|
30
65
|
}
|
|
31
66
|
const shared = await resourceGetByPath(SHARED_OWNER, path);
|
|
32
67
|
if (shared) {
|
|
33
68
|
const profile = parseCustomAgentProfile(shared.content, shared.path);
|
|
34
69
|
if (profile)
|
|
35
|
-
return profile;
|
|
70
|
+
return enrichAgentProfile(owner, profile);
|
|
36
71
|
}
|
|
37
72
|
}
|
|
38
73
|
const lower = trimmed.toLowerCase();
|
|
@@ -11,6 +11,12 @@ export interface SkillMetadata {
|
|
|
11
11
|
name: string;
|
|
12
12
|
description?: string;
|
|
13
13
|
}
|
|
14
|
+
export interface AgentWorkspaceResource {
|
|
15
|
+
path: string;
|
|
16
|
+
kind: ResourceKind;
|
|
17
|
+
name?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
}
|
|
14
20
|
export interface CustomAgentProfile {
|
|
15
21
|
id: string;
|
|
16
22
|
path: string;
|
|
@@ -21,6 +27,10 @@ export interface CustomAgentProfile {
|
|
|
21
27
|
color?: string;
|
|
22
28
|
delegateDefault?: boolean;
|
|
23
29
|
instructions: string;
|
|
30
|
+
workspace?: {
|
|
31
|
+
root: string;
|
|
32
|
+
resources: AgentWorkspaceResource[];
|
|
33
|
+
};
|
|
24
34
|
}
|
|
25
35
|
export interface RemoteAgentManifest {
|
|
26
36
|
id: string;
|
|
@@ -81,15 +81,19 @@ export function frontmatterFieldsToObject(frontmatter) {
|
|
|
81
81
|
return Object.fromEntries(frontmatter?.fields.map((f) => [f.key, f.value]) ?? []);
|
|
82
82
|
}
|
|
83
83
|
export function isSkillPath(path) {
|
|
84
|
-
|
|
84
|
+
const prefix = path.startsWith("skills/")
|
|
85
|
+
? "skills/"
|
|
86
|
+
: path.match(/^agents\/[^/]+\/skills\//)?.[0];
|
|
87
|
+
if (!prefix || !path.endsWith(".md"))
|
|
85
88
|
return false;
|
|
86
|
-
const relative = path.
|
|
89
|
+
const relative = path.slice(prefix.length);
|
|
87
90
|
return (relative.endsWith("/SKILL.md") ||
|
|
88
91
|
(relative.endsWith(".md") && !relative.includes("/")));
|
|
89
92
|
}
|
|
90
93
|
export function getSkillNameFromPath(path) {
|
|
91
94
|
const relative = path
|
|
92
95
|
.replace(/^\.agents\/skills\//, "")
|
|
96
|
+
.replace(/^agents\/[^/]+\/skills\//, "")
|
|
93
97
|
.replace(/^skills\//, "");
|
|
94
98
|
if (relative.endsWith("/SKILL.md")) {
|
|
95
99
|
return (relative
|
|
@@ -103,7 +107,7 @@ export function isJobPath(path) {
|
|
|
103
107
|
return path.startsWith("jobs/") && path.endsWith(".md");
|
|
104
108
|
}
|
|
105
109
|
export function isCustomAgentPath(path) {
|
|
106
|
-
return
|
|
110
|
+
return /^agents\/[^/]+\.md$/.test(path);
|
|
107
111
|
}
|
|
108
112
|
export function isRemoteAgentPath(path) {
|
|
109
113
|
return (path.endsWith(".json") &&
|
|
@@ -32,7 +32,7 @@ const schema = z.object({
|
|
|
32
32
|
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
33
33
|
});
|
|
34
34
|
export default defineAction({
|
|
35
|
-
description: "Create an inline comment, annotation, or review thread for a resource.",
|
|
35
|
+
description: "Create an inline comment, annotation, or review thread for a resource. Body text supports inline Markdown without headings.",
|
|
36
36
|
schema,
|
|
37
37
|
run: async (args, ctx) => {
|
|
38
38
|
const actionCtx = ctx;
|
|
@@ -21,7 +21,7 @@ const schema = z.object({
|
|
|
21
21
|
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
22
22
|
});
|
|
23
23
|
export default defineAction({
|
|
24
|
-
description: "Reply to an existing review comment thread.",
|
|
24
|
+
description: "Reply to an existing review comment thread with inline Markdown text without headings.",
|
|
25
25
|
schema,
|
|
26
26
|
run: async (args, ctx) => {
|
|
27
27
|
const actionCtx = ctx;
|
|
@@ -10,7 +10,7 @@ const schema = z.object({
|
|
|
10
10
|
resolutionNote: z.string().trim().min(1).max(2_000).optional(),
|
|
11
11
|
});
|
|
12
12
|
export default defineAction({
|
|
13
|
-
description: "Resolve an inline comment or review thread.",
|
|
13
|
+
description: "Resolve an inline comment or review thread. An optional resolution note supports inline Markdown without headings.",
|
|
14
14
|
schema,
|
|
15
15
|
run: async (args, ctx) => {
|
|
16
16
|
const actionCtx = ctx;
|
package/dist/secrets/routes.d.ts
CHANGED
|
@@ -37,17 +37,17 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
|
|
|
37
37
|
ok?: undefined;
|
|
38
38
|
status?: undefined;
|
|
39
39
|
} | {
|
|
40
|
+
error?: undefined;
|
|
40
41
|
ok: boolean;
|
|
41
42
|
status: string;
|
|
42
|
-
error?: undefined;
|
|
43
43
|
} | {
|
|
44
44
|
ok?: undefined;
|
|
45
45
|
error: string;
|
|
46
46
|
removed?: undefined;
|
|
47
47
|
} | {
|
|
48
|
+
error?: undefined;
|
|
48
49
|
ok: boolean;
|
|
49
50
|
removed: boolean;
|
|
50
|
-
error?: undefined;
|
|
51
51
|
}>>;
|
|
52
52
|
/**
|
|
53
53
|
* POST /_agent-native/secrets/:key/test — validate an optional candidate value
|
|
@@ -58,13 +58,13 @@ export declare function createTestSecretHandler(): import("h3").EventHandlerWith
|
|
|
58
58
|
error: string;
|
|
59
59
|
note?: undefined;
|
|
60
60
|
} | {
|
|
61
|
+
error?: undefined;
|
|
61
62
|
ok: boolean;
|
|
62
63
|
note?: undefined;
|
|
63
|
-
error?: undefined;
|
|
64
64
|
} | {
|
|
65
|
+
error?: undefined;
|
|
65
66
|
ok: boolean;
|
|
66
67
|
note: string;
|
|
67
|
-
error?: undefined;
|
|
68
68
|
} | {
|
|
69
69
|
note?: undefined;
|
|
70
70
|
ok: boolean;
|
|
@@ -95,11 +95,11 @@ export interface AdHocSecretPayload {
|
|
|
95
95
|
export declare function createAdHocSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<AdHocSecretPayload[] | {
|
|
96
96
|
error: string;
|
|
97
97
|
} | {
|
|
98
|
+
error?: undefined;
|
|
98
99
|
ok: boolean;
|
|
99
100
|
key: string;
|
|
100
|
-
error?: undefined;
|
|
101
101
|
} | {
|
|
102
|
+
error?: undefined;
|
|
102
103
|
ok: boolean;
|
|
103
104
|
removed: boolean;
|
|
104
|
-
error?: undefined;
|
|
105
105
|
}>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createError, defineEventHandler, setResponseStatus, setResponseHeader, getMethod, getQuery, getHeader, getRequestURL, } from "h3";
|
|
2
2
|
import { verifyA2ATokenWithClaims } from "../a2a-claims.js";
|
|
3
3
|
import { isActionContractError, isAgentActionStopError } from "../action.js";
|
|
4
|
+
import { isTransientDatabaseError } from "../db/client.js";
|
|
4
5
|
import { declaresFeatureFlagDelegation } from "../feature-flags/a2a-action-route.js";
|
|
5
6
|
import { resolveOrgByDomain, resolveOrgIdForEmail } from "../org/context.js";
|
|
6
7
|
import { readBody } from "../server/h3-helpers.js";
|
|
@@ -177,6 +178,34 @@ function normalizeOrgId(value) {
|
|
|
177
178
|
? value.trim()
|
|
178
179
|
: undefined;
|
|
179
180
|
}
|
|
181
|
+
function isFirstBootMissingOrgTableError(error) {
|
|
182
|
+
if (!(error instanceof Error))
|
|
183
|
+
return false;
|
|
184
|
+
return (/no such table:?\s*["'`]?org_members["'`]?/i.test(error.message) ||
|
|
185
|
+
/relation\s+["'`]?org_members["'`]?\s+does not exist/i.test(error.message));
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* The user's stored active org, for a request whose own org resolution came
|
|
189
|
+
* back empty. An empty `orgId` is not "this user has no org": it silently
|
|
190
|
+
* narrows every scoped read to rows with a null `org_id`, so a session minted
|
|
191
|
+
* before org selection — or one whose membership read failed — stops seeing
|
|
192
|
+
* the user's own org-scoped dashboards, credentials, and resources. This
|
|
193
|
+
* honors an explicit Personal selection by returning undefined, so it can
|
|
194
|
+
* never promote a user into an org they left. A transient database failure is
|
|
195
|
+
* not an answer and propagates.
|
|
196
|
+
*/
|
|
197
|
+
async function storedActiveOrgId(email) {
|
|
198
|
+
try {
|
|
199
|
+
return normalizeOrgId(await resolveOrgIdForEmail(email));
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
if (isTransientDatabaseError(error) ||
|
|
203
|
+
!isFirstBootMissingOrgTableError(error)) {
|
|
204
|
+
throw error;
|
|
205
|
+
}
|
|
206
|
+
return undefined;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
180
209
|
function isAuthResolutionFailure(error) {
|
|
181
210
|
if (!error || typeof error !== "object")
|
|
182
211
|
return false;
|
|
@@ -344,18 +373,15 @@ export function mountActionRoutes(nitroApp, actions, options) {
|
|
|
344
373
|
if (resolvedCaller) {
|
|
345
374
|
orgId = normalizeOrgId(resolvedCaller.orgId);
|
|
346
375
|
if (!orgId && resolvedCaller.owner && !resolvedCaller.anonymous) {
|
|
347
|
-
|
|
348
|
-
orgId = normalizeOrgId(await resolveOrgIdForEmail(resolvedCaller.owner));
|
|
349
|
-
}
|
|
350
|
-
catch {
|
|
351
|
-
// Org tables may not exist yet on first boot.
|
|
352
|
-
}
|
|
376
|
+
orgId = await storedActiveOrgId(resolvedCaller.owner);
|
|
353
377
|
}
|
|
354
378
|
}
|
|
355
379
|
else {
|
|
356
380
|
orgId = options?.resolveOrgId
|
|
357
381
|
? ((await options.resolveOrgId(event)) ?? undefined)
|
|
358
382
|
: undefined;
|
|
383
|
+
if (!orgId && userEmail)
|
|
384
|
+
orgId = await storedActiveOrgId(userEmail);
|
|
359
385
|
}
|
|
360
386
|
const timezone = readTimezoneHeader(event);
|
|
361
387
|
const browserSessionId = readBrowserSessionIdHeader(event);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ActionEntry } from "../../agent/production-agent.js";
|
|
2
|
-
import type { AgentLoopFinalResponseGuard } from "../../agent/production-agent.js";
|
|
1
|
+
import type { ActionEntry, AgentLoopFinalResponseGuard, ProductionAgentOptions } from "../../agent/production-agent.js";
|
|
3
2
|
import type { AgentChatAttachment, AgentChatReference, MentionProvider } from "../../agent/types.js";
|
|
4
3
|
import type { FrameworkToolsConfig } from "../../framework-tools.js";
|
|
5
4
|
import type { ExternalAgentPolicy } from "../../mcp/external-agent-policy.js";
|
|
@@ -164,6 +163,12 @@ export interface AgentChatPluginOptions {
|
|
|
164
163
|
displayMessage?: string;
|
|
165
164
|
attachments?: AgentChatAttachment[];
|
|
166
165
|
}>;
|
|
166
|
+
/**
|
|
167
|
+
* Resolve the exact native action surface for each interactive chat request.
|
|
168
|
+
* Omitted names are not sent to the model and are not discoverable through
|
|
169
|
+
* tool-search. When configured, every allowed action is loaded directly.
|
|
170
|
+
*/
|
|
171
|
+
resolveActionSurface?: ProductionAgentOptions["resolveActionSurface"];
|
|
167
172
|
/**
|
|
168
173
|
* Use ONLY the template's `systemPrompt` and the actions list — skip the
|
|
169
174
|
* framework prompt wrapper, resource loading (AGENTS.md/LEARNINGS.md/
|
|
@@ -46,6 +46,16 @@ export declare function createSerializedA2ATaskStatusWriter(taskId: string, writ
|
|
|
46
46
|
};
|
|
47
47
|
export declare function resolveA2ARecoverableArtifactSecret(orgId?: string | null | undefined): Promise<string | undefined>;
|
|
48
48
|
export declare function buildLeanRunPolicyPrompt(codeEditingSurfaceRestriction: string, prodCodeExecPromptNote: string): string;
|
|
49
|
+
export declare function filterPromptActionsToSurface(actions: Record<string, ActionEntry>, allowedActionNames?: readonly string[]): Record<string, ActionEntry>;
|
|
50
|
+
/** Keep late-bound sandbox and data-program bridges on the current request's
|
|
51
|
+
* authorized registry instead of the plugin's process-wide action catalog. */
|
|
52
|
+
export declare function filterRuntimeActionsToSurface(actions: Record<string, ActionEntry>): Record<string, ActionEntry>;
|
|
53
|
+
/** Remove framework guidance for tools that the request surface does not
|
|
54
|
+
* expose. The default framework prompt is line-oriented, so dropping the
|
|
55
|
+
* affected instruction keeps unrelated behavioral guidance intact without
|
|
56
|
+
* teaching the model names it cannot call. */
|
|
57
|
+
export declare function filterFrameworkPromptToSurface(prompt: string, actions: Record<string, ActionEntry>, allowedActionNames?: readonly string[]): string;
|
|
58
|
+
export declare function resolveProductionCodeExecutionForActionSurface(mode: "off" | "sandboxed" | "trusted", hasRequestScopedSurface: boolean): "off" | "sandboxed" | "trusted";
|
|
49
59
|
/**
|
|
50
60
|
* Abort reasons that mean a human asked to stop, so `/runs/:id/abort` escalates
|
|
51
61
|
* to a turn-wide abort. Watchdog reasons (`no_progress`, `auto_stuck_retry`)
|