@agent-native/core 0.95.0 → 0.95.1
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 +10 -0
- package/corpus/core/docs/content/locales/ar-SA/template-design.mdx +13 -0
- package/corpus/core/docs/content/locales/de-DE/template-design.mdx +18 -0
- package/corpus/core/docs/content/locales/es-ES/template-design.mdx +16 -0
- package/corpus/core/docs/content/locales/fr-FR/template-design.mdx +17 -0
- package/corpus/core/docs/content/locales/hi-IN/template-design.mdx +16 -0
- package/corpus/core/docs/content/locales/ja-JP/template-design.mdx +17 -0
- package/corpus/core/docs/content/locales/ko-KR/template-design.mdx +15 -0
- package/corpus/core/docs/content/locales/pt-BR/template-design.mdx +16 -0
- package/corpus/core/docs/content/locales/zh-CN/template-design.mdx +11 -0
- package/corpus/core/docs/content/locales/zh-TW/template-design.mdx +12 -0
- package/corpus/core/docs/content/template-design.mdx +16 -0
- package/corpus/core/package.json +2 -2
- package/corpus/core/src/agent/production-agent.ts +20 -0
- package/corpus/core/src/agent/thread-data-builder.ts +41 -17
- package/corpus/core/src/client/AssistantChat.tsx +250 -25
- package/corpus/core/src/client/chat/tool-call-display.tsx +1 -1
- package/corpus/core/src/client/chat/use-reconnect-reader-owner.ts +28 -0
- package/corpus/core/src/client/guided-questions.tsx +9 -1
- package/corpus/core/src/client/integrations/IntegrationsPanel.tsx +6 -7
- package/corpus/core/src/client/sse-event-processor.ts +90 -21
- package/corpus/core/src/connections/catalog.ts +2 -2
- package/corpus/core/src/deploy/build.ts +3 -0
- package/corpus/core/src/integrations/catalog.ts +2 -2
- package/corpus/core/src/server/auth.ts +1 -1
- package/corpus/core/src/server/credential-provider.ts +7 -3
- package/corpus/core/src/shared/cache-control.ts +10 -4
- package/corpus/templates/analytics/app/lib/data-sources.ts +5 -4
- package/corpus/templates/analytics/changelog/2026-07-10-slack-token-setup-marked-legacy.md +6 -0
- package/corpus/templates/analytics/server/lib/credential-keys.ts +6 -2
- package/corpus/templates/brain/changelog/2026-07-10-slack-backfill-token-marked-legacy.md +6 -0
- package/corpus/templates/brain/server/register-secrets.ts +2 -2
- package/corpus/templates/clips/app/components/library/library-layout.tsx +7 -1
- package/corpus/templates/clips/app/components/library/page-header.tsx +19 -3
- package/corpus/templates/clips/app/routes/_app.library._index.tsx +16 -12
- package/corpus/templates/clips/changelog/2026-07-10-new-recording-appears-once-when-the-library-sidebar-is-open.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-slack-token-fallback-guidance.md +6 -0
- package/corpus/templates/clips/server/register-secrets.ts +1 -1
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +0 -66
- package/corpus/templates/content/app/routes/_app.local-files.tsx +7 -47
- package/corpus/templates/content/changelog/2026-07-10-local-folders-now-wait-for-an-explicit-pull-before-content-r.md +6 -0
- package/corpus/templates/content/package.json +1 -1
- package/corpus/templates/design/actions/generate-design.ts +128 -31
- package/corpus/templates/design/actions/present-design-variants.ts +37 -9
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +9 -3
- package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +32 -10
- package/corpus/templates/design/app/components/design/QuestionFlow.tsx +2 -2
- package/corpus/templates/design/app/components/design/TweaksPanel.tsx +9 -1
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +7 -5
- package/corpus/templates/design/app/components/design/multi-screen/types.ts +3 -0
- package/corpus/templates/design/app/global.css +10 -0
- package/corpus/templates/design/app/hooks/use-question-flow.ts +9 -2
- package/corpus/templates/design/app/i18n/zh-TW.ts +1 -0
- package/corpus/templates/design/app/i18n-data.ts +21 -11
- package/corpus/templates/design/changelog/2026-07-10-editor-panels-are-easier-to-distinguish-and-design-intake-qu.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-interact-mode-now-stays-on-the-full-canvas-matches-edit-visu.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-new-web-designs-open-at-desktop-size-and-adapt-across-mobile.md +6 -0
- package/corpus/templates/design/changelog/2026-07-10-tweaks-now-link-to-full-documentation.md +6 -0
- package/corpus/templates/design/server/plugins/agent-chat.ts +2 -0
- package/corpus/templates/mail/app/i18n/ar-SA.ts +3 -3
- package/corpus/templates/mail/app/i18n/de-DE.ts +3 -3
- package/corpus/templates/mail/app/i18n/en-US.ts +4 -3
- package/corpus/templates/mail/app/i18n/es-ES.ts +3 -3
- package/corpus/templates/mail/app/i18n/fr-FR.ts +3 -3
- package/corpus/templates/mail/app/i18n/hi-IN.ts +3 -3
- package/corpus/templates/mail/app/i18n/ja-JP.ts +3 -3
- package/corpus/templates/mail/app/i18n/ko-KR.ts +3 -3
- package/corpus/templates/mail/app/i18n/pt-BR.ts +3 -3
- package/corpus/templates/mail/app/i18n/zh-CN.ts +3 -3
- package/corpus/templates/mail/app/i18n/zh-TW.ts +3 -3
- package/corpus/templates/mail/changelog/2026-07-10-slack-intake-marked-legacy.md +6 -0
- package/corpus/templates/mail/server/lib/env-config.ts +5 -4
- package/corpus/templates/plan/package.json +1 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +20 -0
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +36 -18
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +3 -1
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +200 -28
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/chat/tool-call-display.js +1 -1
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat/use-reconnect-reader-owner.d.ts +11 -0
- package/dist/client/chat/use-reconnect-reader-owner.d.ts.map +1 -0
- package/dist/client/chat/use-reconnect-reader-owner.js +21 -0
- package/dist/client/chat/use-reconnect-reader-owner.js.map +1 -0
- package/dist/client/guided-questions.d.ts.map +1 -1
- package/dist/client/guided-questions.js +5 -1
- package/dist/client/guided-questions.js.map +1 -1
- package/dist/client/integrations/IntegrationsPanel.d.ts.map +1 -1
- package/dist/client/integrations/IntegrationsPanel.js +5 -7
- package/dist/client/integrations/IntegrationsPanel.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +67 -20
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/connections/catalog.d.ts +2 -2
- package/dist/connections/catalog.js +2 -2
- package/dist/connections/catalog.js.map +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +3 -1
- package/dist/deploy/build.js.map +1 -1
- package/dist/integrations/catalog.js +2 -2
- package/dist/integrations/catalog.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/auth.js +1 -1
- package/dist/server/auth.js.map +1 -1
- package/dist/server/credential-provider.d.ts +5 -3
- package/dist/server/credential-provider.d.ts.map +1 -1
- package/dist/server/credential-provider.js +7 -3
- package/dist/server/credential-provider.js.map +1 -1
- package/dist/shared/cache-control.d.ts +8 -6
- package/dist/shared/cache-control.d.ts.map +1 -1
- package/dist/shared/cache-control.js +8 -3
- package/dist/shared/cache-control.js.map +1 -1
- package/docs/content/locales/ar-SA/template-design.mdx +13 -0
- package/docs/content/locales/de-DE/template-design.mdx +18 -0
- package/docs/content/locales/es-ES/template-design.mdx +16 -0
- package/docs/content/locales/fr-FR/template-design.mdx +17 -0
- package/docs/content/locales/hi-IN/template-design.mdx +16 -0
- package/docs/content/locales/ja-JP/template-design.mdx +17 -0
- package/docs/content/locales/ko-KR/template-design.mdx +15 -0
- package/docs/content/locales/pt-BR/template-design.mdx +16 -0
- package/docs/content/locales/zh-CN/template-design.mdx +11 -0
- package/docs/content/locales/zh-TW/template-design.mdx +12 -0
- package/docs/content/template-design.mdx +16 -0
- package/package.json +2 -2
|
@@ -61,13 +61,6 @@ function sseActionPreparationStallTimeoutMs(options) {
|
|
|
61
61
|
? SSE_DURABLE_ACTION_PREPARATION_STALL_TIMEOUT_MS
|
|
62
62
|
: SSE_ACTION_PREPARATION_STALL_TIMEOUT_MS;
|
|
63
63
|
}
|
|
64
|
-
function formatProgressBytes(bytes) {
|
|
65
|
-
if (bytes < 1024)
|
|
66
|
-
return `${bytes} B`;
|
|
67
|
-
if (bytes < 1024 * 1024)
|
|
68
|
-
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
69
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
70
|
-
}
|
|
71
64
|
function activityProgressBytes(ev) {
|
|
72
65
|
return typeof ev.progressBytes === "number" &&
|
|
73
66
|
Number.isFinite(ev.progressBytes) &&
|
|
@@ -103,7 +96,7 @@ function preparationActivityLabel(tool, progressBytes) {
|
|
|
103
96
|
if (progressBytes <= 0) {
|
|
104
97
|
return `Preparing ${action}...`;
|
|
105
98
|
}
|
|
106
|
-
return `Writing ${action}
|
|
99
|
+
return `Writing ${action}...`;
|
|
107
100
|
}
|
|
108
101
|
function visibleActivityLabel(ev, tool) {
|
|
109
102
|
const progressBytes = activityProgressBytes(ev);
|
|
@@ -117,14 +110,9 @@ function findPendingToolCallIndex(content, toolName, toolCallId) {
|
|
|
117
110
|
// calls can be in flight simultaneously, and name-only matching would
|
|
118
111
|
// attach a result to the wrong call.
|
|
119
112
|
if (toolCallId) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
part.toolCallId === toolCallId &&
|
|
124
|
-
part.result === undefined) {
|
|
125
|
-
return i;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
113
|
+
const exactIndex = findPendingToolCallIndexById(content, toolCallId);
|
|
114
|
+
if (exactIndex >= 0)
|
|
115
|
+
return exactIndex;
|
|
128
116
|
// Fall through to name-matching: the start event may have arrived before
|
|
129
117
|
// the server started emitting ids (e.g. older server build), so the
|
|
130
118
|
// stored toolCallId is the locally-generated "tc_N" value rather than the
|
|
@@ -140,6 +128,56 @@ function findPendingToolCallIndex(content, toolName, toolCallId) {
|
|
|
140
128
|
}
|
|
141
129
|
return -1;
|
|
142
130
|
}
|
|
131
|
+
function findPendingToolCallIndexById(content, toolCallId) {
|
|
132
|
+
for (let i = content.length - 1; i >= 0; i--) {
|
|
133
|
+
const part = content[i];
|
|
134
|
+
if (part.type === "tool-call" &&
|
|
135
|
+
part.toolCallId === toolCallId &&
|
|
136
|
+
part.result === undefined) {
|
|
137
|
+
return i;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return -1;
|
|
141
|
+
}
|
|
142
|
+
function findOldestPendingActivityToolCallIndex(content, toolName) {
|
|
143
|
+
for (let i = 0; i < content.length; i += 1) {
|
|
144
|
+
const part = content[i];
|
|
145
|
+
if (part.type === "tool-call" &&
|
|
146
|
+
part.toolName === toolName &&
|
|
147
|
+
part.activity === true &&
|
|
148
|
+
part.result === undefined) {
|
|
149
|
+
return i;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return -1;
|
|
153
|
+
}
|
|
154
|
+
function findPendingActivityToolCallIndex(content, toolName, toolCallId) {
|
|
155
|
+
if (!toolCallId) {
|
|
156
|
+
return findPendingToolCallIndex(content, toolName);
|
|
157
|
+
}
|
|
158
|
+
// Activity events emitted while the model is assembling tool input already
|
|
159
|
+
// carry the engine's stable call id. Match that id exactly so repeated
|
|
160
|
+
// progress for one call updates one placeholder while parallel same-name
|
|
161
|
+
// calls retain separate cards.
|
|
162
|
+
const exactIndex = findPendingToolCallIndexById(content, toolCallId);
|
|
163
|
+
if (exactIndex >= 0)
|
|
164
|
+
return exactIndex;
|
|
165
|
+
// Older activity events may omit the id before a later progress event adds
|
|
166
|
+
// it. Upgrade one unambiguous reader-local placeholder instead of painting a
|
|
167
|
+
// second card for the same logical call.
|
|
168
|
+
const readerLocalCandidates = [];
|
|
169
|
+
for (let i = 0; i < content.length; i += 1) {
|
|
170
|
+
const part = content[i];
|
|
171
|
+
if (part.type === "tool-call" &&
|
|
172
|
+
part.toolName === toolName &&
|
|
173
|
+
part.activity === true &&
|
|
174
|
+
part.result === undefined &&
|
|
175
|
+
/^tc_\d+$/.test(part.toolCallId)) {
|
|
176
|
+
readerLocalCandidates.push(i);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return readerLocalCandidates.length === 1 ? readerLocalCandidates[0] : -1;
|
|
180
|
+
}
|
|
143
181
|
function findCompletedToolCallIndex(content, toolCallId) {
|
|
144
182
|
if (!toolCallId)
|
|
145
183
|
return -1;
|
|
@@ -687,7 +725,13 @@ export function processEvent(ev, content, toolCallCounter, tabId, state) {
|
|
|
687
725
|
}
|
|
688
726
|
if (!tool)
|
|
689
727
|
return { action: "continue" };
|
|
690
|
-
const pendingToolCallIndex =
|
|
728
|
+
const pendingToolCallIndex = findPendingActivityToolCallIndex(content, tool, ev.id);
|
|
729
|
+
if (pendingToolCallIndex >= 0 && ev.id) {
|
|
730
|
+
const pending = content[pendingToolCallIndex];
|
|
731
|
+
if (pending?.type === "tool-call" && pending.toolCallId !== ev.id) {
|
|
732
|
+
content[pendingToolCallIndex] = { ...pending, toolCallId: ev.id };
|
|
733
|
+
}
|
|
734
|
+
}
|
|
691
735
|
if (pendingToolCallIndex === -1) {
|
|
692
736
|
// Only surface a placeholder spinner when this tool has no card yet. A
|
|
693
737
|
// trailing activity heartbeat that arrives after the matching tool_done
|
|
@@ -696,11 +740,12 @@ export function processEvent(ev, content, toolCallCounter, tabId, state) {
|
|
|
696
740
|
// flicker. The real card reappears on the next tool_start regardless.
|
|
697
741
|
const hasCompletedSameTool = content.some((part) => part.type === "tool-call" &&
|
|
698
742
|
part.toolName === tool &&
|
|
699
|
-
part.result !== undefined
|
|
743
|
+
part.result !== undefined &&
|
|
744
|
+
(!ev.id || part.toolCallId === ev.id));
|
|
700
745
|
if (!hasCompletedSameTool) {
|
|
701
746
|
content.push({
|
|
702
747
|
type: "tool-call",
|
|
703
|
-
toolCallId: `tc_${++toolCallCounter.value}`,
|
|
748
|
+
toolCallId: ev.id ?? `tc_${++toolCallCounter.value}`,
|
|
704
749
|
toolName: tool,
|
|
705
750
|
argsText: "",
|
|
706
751
|
args: {},
|
|
@@ -733,7 +778,9 @@ export function processEvent(ev, content, toolCallCounter, tabId, state) {
|
|
|
733
778
|
}
|
|
734
779
|
// Pass the server-assigned id so we upgrade the pending activity card
|
|
735
780
|
// using id-match when available (parallel same-name calls stay separate).
|
|
736
|
-
const pendingToolCallIndex =
|
|
781
|
+
const pendingToolCallIndex = ev.id
|
|
782
|
+
? findPendingActivityToolCallIndex(content, tool, ev.id)
|
|
783
|
+
: findOldestPendingActivityToolCallIndex(content, tool);
|
|
737
784
|
const pendingToolCall = pendingToolCallIndex >= 0 ? content[pendingToolCallIndex] : undefined;
|
|
738
785
|
const pendingIsActivityPlaceholder = pendingToolCall?.type === "tool-call" &&
|
|
739
786
|
pendingToolCall.activity === true &&
|