@agent-native/core 0.95.1 → 0.96.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 +2 -2
- package/corpus/core/CHANGELOG.md +25 -0
- package/corpus/core/package.json +3 -1
- package/corpus/core/src/a2a/client.ts +11 -1
- package/corpus/core/src/agent/production-agent.ts +87 -27
- package/corpus/core/src/agent/thread-data-builder.ts +7 -5
- package/corpus/core/src/chat-threads/store.ts +20 -1
- package/corpus/core/src/cli/code-agent-executor.ts +1 -0
- package/corpus/core/src/cli/code-agent-runs.ts +14 -0
- package/corpus/core/src/client/AgentPanel.tsx +32 -25
- package/corpus/core/src/client/AssistantChat.tsx +36 -20
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +141 -90
- package/corpus/core/src/client/chat/ChatHistoryList.tsx +404 -0
- package/corpus/core/src/client/chat/index.ts +6 -0
- package/corpus/core/src/client/chat/tool-call-display.tsx +37 -3
- package/corpus/core/src/client/code-agent-chat-adapter.ts +72 -4
- package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +52 -11
- package/corpus/core/src/client/composer/TiptapComposer.tsx +157 -20
- package/corpus/core/src/client/composer/VoiceButton.tsx +28 -0
- package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +5 -0
- package/corpus/core/src/client/conversation/code-agent-transcript.ts +4 -5
- package/corpus/core/src/client/guided-questions.tsx +2 -1
- package/corpus/core/src/client/index.ts +11 -0
- package/corpus/core/src/client/use-chat-threads.ts +10 -1
- package/corpus/core/src/client/voice-provider-status.ts +44 -0
- package/corpus/core/src/code-agents/transcript-normalizer.ts +76 -0
- package/corpus/core/src/deploy/build.ts +12 -11
- package/corpus/core/src/integrations/a2a-continuation-processor.ts +35 -5
- package/corpus/core/src/integrations/adapters/slack.ts +74 -21
- package/corpus/core/src/integrations/webhook-handler.ts +14 -0
- package/corpus/core/src/localization/default-messages.ts +6 -0
- package/corpus/core/src/observability/hosted-model-experiment.ts +118 -0
- package/corpus/core/src/observability/routes.ts +17 -0
- package/corpus/core/src/observability/store.ts +4 -1
- package/corpus/core/src/observability/traces.ts +41 -2
- package/corpus/core/src/scripts/agent-engines/list-agent-engines.ts +19 -1
- package/corpus/core/src/scripts/call-agent.ts +53 -3
- package/corpus/core/src/scripts/chat/search-chats.ts +11 -8
- package/corpus/core/src/secrets/register-framework-secrets.ts +1 -1
- package/corpus/core/src/server/agent-chat-plugin.ts +41 -6
- package/corpus/core/src/server/core-routes-plugin.ts +15 -0
- package/corpus/core/src/server/realtime-voice.ts +71 -24
- package/corpus/core/src/server/voice-providers-status.ts +4 -3
- package/corpus/core/src/shared/cache-control.ts +2 -8
- package/corpus/core/src/styles/agent-native.css +1 -0
- package/corpus/core/src/styles/chat-history-list.css +313 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +20 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +8 -4
- package/corpus/core/src/vite/client.ts +1 -0
- package/corpus/templates/analytics/AGENTS.md +7 -0
- package/corpus/templates/analytics/actions/bigquery.ts +26 -2
- package/corpus/templates/analytics/actions/data-source-status.ts +18 -0
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +5 -4
- package/corpus/templates/analytics/app/global.css +10 -0
- package/corpus/templates/analytics/app/pages/Ask.tsx +25 -2
- package/corpus/templates/analytics/changelog/2026-07-10-analytics-answers-simple-time-bounded-metrics-without-unnece.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-analytics-chat-reliably-uses-connected-data-sources-across-s.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-chat-threads-now-stay-clear-of-top-actions-and-fade-smoothly.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-context-chips-can-now-be-selected-and-removed-one-at-a-time-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-the-ask-composer-no-longer-carries-dashboard-or-panel-contex.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-10-the-ask-section-stays-highlighted-while-its-chat-history-is-.md +6 -0
- package/corpus/templates/analytics/server/lib/bigquery.ts +90 -14
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +82 -7
- package/dist/a2a/client.d.ts +7 -0
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +2 -1
- package/dist/a2a/client.js.map +1 -1
- package/dist/agent/production-agent.d.ts +6 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +63 -26
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/thread-data-builder.d.ts +1 -0
- package/dist/agent/thread-data-builder.d.ts.map +1 -1
- package/dist/agent/thread-data-builder.js +6 -5
- package/dist/agent/thread-data-builder.js.map +1 -1
- package/dist/chat-threads/store.d.ts +10 -0
- package/dist/chat-threads/store.d.ts.map +1 -1
- package/dist/chat-threads/store.js +6 -0
- package/dist/chat-threads/store.js.map +1 -1
- package/dist/cli/code-agent-executor.d.ts.map +1 -1
- package/dist/cli/code-agent-executor.js +1 -0
- package/dist/cli/code-agent-executor.js.map +1 -1
- package/dist/cli/code-agent-runs.d.ts +12 -0
- package/dist/cli/code-agent-runs.d.ts.map +1 -1
- package/dist/cli/code-agent-runs.js +1 -0
- package/dist/cli/code-agent-runs.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +3 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +11 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +7 -4
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +83 -10
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/chat/ChatHistoryList.d.ts +88 -0
- package/dist/client/chat/ChatHistoryList.d.ts.map +1 -0
- package/dist/client/chat/ChatHistoryList.js +83 -0
- package/dist/client/chat/ChatHistoryList.js.map +1 -0
- package/dist/client/chat/index.d.ts +1 -0
- package/dist/client/chat/index.d.ts.map +1 -1
- package/dist/client/chat/index.js +1 -0
- package/dist/client/chat/index.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +13 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +10 -2
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/code-agent-chat-adapter.d.ts +17 -1
- package/dist/client/code-agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/code-agent-chat-adapter.js +47 -3
- package/dist/client/code-agent-chat-adapter.js.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts +11 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.js +5 -3
- package/dist/client/composer/RealtimeVoiceMode.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +25 -2
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +96 -5
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/VoiceButton.d.ts.map +1 -1
- package/dist/client/composer/VoiceButton.js +21 -1
- package/dist/client/composer/VoiceButton.js.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.js +5 -0
- package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -1
- package/dist/client/conversation/code-agent-transcript.d.ts +2 -0
- package/dist/client/conversation/code-agent-transcript.d.ts.map +1 -1
- package/dist/client/conversation/code-agent-transcript.js +3 -5
- package/dist/client/conversation/code-agent-transcript.js.map +1 -1
- package/dist/client/guided-questions.d.ts.map +1 -1
- package/dist/client/guided-questions.js +2 -1
- package/dist/client/guided-questions.js.map +1 -1
- package/dist/client/index.d.ts +3 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +3 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +9 -1
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/client/voice-provider-status.d.ts +10 -0
- package/dist/client/voice-provider-status.d.ts.map +1 -0
- package/dist/client/voice-provider-status.js +32 -0
- package/dist/client/voice-provider-status.js.map +1 -0
- package/dist/code-agents/transcript-normalizer.d.ts +29 -0
- package/dist/code-agents/transcript-normalizer.d.ts.map +1 -1
- package/dist/code-agents/transcript-normalizer.js +55 -0
- package/dist/code-agents/transcript-normalizer.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +13 -11
- package/dist/deploy/build.js.map +1 -1
- package/dist/integrations/a2a-continuation-processor.d.ts.map +1 -1
- package/dist/integrations/a2a-continuation-processor.js +25 -5
- package/dist/integrations/a2a-continuation-processor.js.map +1 -1
- package/dist/integrations/adapters/slack.d.ts.map +1 -1
- package/dist/integrations/adapters/slack.js +55 -21
- package/dist/integrations/adapters/slack.js.map +1 -1
- package/dist/integrations/webhook-handler.d.ts.map +1 -1
- package/dist/integrations/webhook-handler.js +11 -0
- package/dist/integrations/webhook-handler.js.map +1 -1
- package/dist/localization/default-messages.d.ts +5 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +5 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/hosted-model-experiment.d.ts +39 -0
- package/dist/observability/hosted-model-experiment.d.ts.map +1 -0
- package/dist/observability/hosted-model-experiment.js +90 -0
- package/dist/observability/hosted-model-experiment.js.map +1 -0
- package/dist/observability/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts.map +1 -1
- package/dist/observability/routes.js +16 -0
- package/dist/observability/routes.js.map +1 -1
- package/dist/observability/store.d.ts.map +1 -1
- package/dist/observability/store.js +4 -1
- package/dist/observability/store.js.map +1 -1
- package/dist/observability/traces.d.ts +6 -0
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js +28 -2
- package/dist/observability/traces.js.map +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.d.ts.map +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.js +19 -1
- package/dist/scripts/agent-engines/list-agent-engines.js.map +1 -1
- package/dist/scripts/call-agent.d.ts.map +1 -1
- package/dist/scripts/call-agent.js +43 -3
- package/dist/scripts/call-agent.js.map +1 -1
- package/dist/scripts/chat/search-chats.d.ts +1 -1
- package/dist/scripts/chat/search-chats.d.ts.map +1 -1
- package/dist/scripts/chat/search-chats.js +11 -8
- package/dist/scripts/chat/search-chats.js.map +1 -1
- package/dist/secrets/register-framework-secrets.js +1 -1
- package/dist/secrets/register-framework-secrets.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +11 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +27 -6
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/core-routes-plugin.d.ts +3 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +13 -0
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/realtime-voice.d.ts.map +1 -1
- package/dist/server/realtime-voice.js +55 -21
- package/dist/server/realtime-voice.js.map +1 -1
- package/dist/server/voice-providers-status.d.ts.map +1 -1
- package/dist/server/voice-providers-status.js +2 -3
- package/dist/server/voice-providers-status.js.map +1 -1
- package/dist/shared/cache-control.d.ts +4 -6
- package/dist/shared/cache-control.d.ts.map +1 -1
- package/dist/shared/cache-control.js +2 -7
- package/dist/shared/cache-control.js.map +1 -1
- package/dist/styles/agent-native.css +1 -0
- package/dist/styles/chat-history-list.css +313 -0
- package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +20 -0
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +8 -4
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +1 -0
- package/dist/vite/client.js.map +1 -1
- package/package.json +3 -1
- package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +20 -0
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +8 -4
|
@@ -2657,7 +2657,10 @@ export async function runAgentLoop(opts) {
|
|
|
2657
2657
|
if (guard) {
|
|
2658
2658
|
const retryMessage = typeof guard === "string" ? guard : guard.retryMessage;
|
|
2659
2659
|
const fallbackMessage = typeof guard === "string" ? guard : guard.fallbackMessage;
|
|
2660
|
-
|
|
2660
|
+
const maxGuardRetries = typeof guard === "string"
|
|
2661
|
+
? 1
|
|
2662
|
+
: Math.max(0, Math.min(3, Math.trunc(guard.maxRetries ?? 1)));
|
|
2663
|
+
if (finalGuardRetries < maxGuardRetries) {
|
|
2661
2664
|
finalGuardRetries += 1;
|
|
2662
2665
|
send({ type: "clear" });
|
|
2663
2666
|
messages.push({
|
|
@@ -4684,25 +4687,69 @@ export function createProductionAgentHandler(options) {
|
|
|
4684
4687
|
// DIAGNOSTIC-ONLY: bracket stored-model resolution (getStoredModelForEngine
|
|
4685
4688
|
// settings read).
|
|
4686
4689
|
workerStep("model_start");
|
|
4687
|
-
const
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4690
|
+
const storedModel = requestModel == null && configuredModel == null
|
|
4691
|
+
? await getStoredModelForEngine(engine, { appId: options.appId })
|
|
4692
|
+
: undefined;
|
|
4693
|
+
const modelCandidate = requestModel ?? configuredModel ?? storedModel ?? engine.defaultModel;
|
|
4691
4694
|
// DIAGNOSTIC-ONLY: stored-model resolution finished.
|
|
4692
4695
|
workerStep("model_done");
|
|
4693
4696
|
const model = normalizeModelForEngine(engine, modelCandidate);
|
|
4697
|
+
let effectiveModel = model;
|
|
4698
|
+
let modelSelectionSource = requestModel != null
|
|
4699
|
+
? "request"
|
|
4700
|
+
: configuredModel != null
|
|
4701
|
+
? "configured"
|
|
4702
|
+
: storedModel != null
|
|
4703
|
+
? "stored"
|
|
4704
|
+
: "default";
|
|
4705
|
+
let experimentAssignments = [];
|
|
4706
|
+
// Database-backed experiments remain available to app operators. A
|
|
4707
|
+
// platform-wide hosted rollout is layered in only when no explicit or
|
|
4708
|
+
// persisted model selection exists, and only on the cross-provider Builder
|
|
4709
|
+
// engine. This preserves the model picker's user intent.
|
|
4710
|
+
try {
|
|
4711
|
+
if (ownerEmail) {
|
|
4712
|
+
const { resolveActiveExperimentConfig } = await import("../observability/experiments.js");
|
|
4713
|
+
const expConfig = await resolveActiveExperimentConfig(ownerEmail);
|
|
4714
|
+
if (expConfig) {
|
|
4715
|
+
experimentAssignments = [...expConfig.assignments];
|
|
4716
|
+
if (typeof expConfig.configs.model === "string") {
|
|
4717
|
+
effectiveModel = normalizeModelForEngine(engine, expConfig.configs.model);
|
|
4718
|
+
modelSelectionSource = "experiment";
|
|
4719
|
+
}
|
|
4720
|
+
}
|
|
4721
|
+
if (modelSelectionSource === "default") {
|
|
4722
|
+
const { resolveHostedDefaultModelExperiment } = await import("../observability/hosted-model-experiment.js");
|
|
4723
|
+
const hostedExperiment = resolveHostedDefaultModelExperiment({
|
|
4724
|
+
userId: ownerEmail,
|
|
4725
|
+
engineName: engine.name,
|
|
4726
|
+
isDefaultModelSelection: true,
|
|
4727
|
+
supportedModels: engine.supportedModels,
|
|
4728
|
+
});
|
|
4729
|
+
if (hostedExperiment) {
|
|
4730
|
+
effectiveModel = hostedExperiment.model;
|
|
4731
|
+
experimentAssignments.push(hostedExperiment.assignment);
|
|
4732
|
+
modelSelectionSource = "experiment";
|
|
4733
|
+
}
|
|
4734
|
+
}
|
|
4735
|
+
}
|
|
4736
|
+
}
|
|
4737
|
+
catch {
|
|
4738
|
+
// Experiments are best-effort. Model resolution must keep working if the
|
|
4739
|
+
// observability tables are unavailable during startup or migration.
|
|
4740
|
+
}
|
|
4694
4741
|
const reasoningEffort = resolveAgentRequestReasoningEffort({
|
|
4695
|
-
model,
|
|
4742
|
+
model: effectiveModel,
|
|
4696
4743
|
requestEffort,
|
|
4697
4744
|
configuredEffort: options.reasoningEffort,
|
|
4698
4745
|
});
|
|
4699
|
-
options.onEngineResolved?.(engine,
|
|
4746
|
+
options.onEngineResolved?.(engine, effectiveModel);
|
|
4700
4747
|
// One-line per-turn resolution log so it's obvious in dev which engine
|
|
4701
4748
|
// is actually handling the request. `requestEngine` is what the client
|
|
4702
4749
|
// sent from the model picker; `engine.name` is what resolveEngine picked.
|
|
4703
4750
|
// Divergence between them is the usual cause of "status says builder but
|
|
4704
4751
|
// no [builder-engine] log lines appear" confusion.
|
|
4705
|
-
console.log(`[agent-chat] resolved engine=${engine.name} model=${
|
|
4752
|
+
console.log(`[agent-chat] resolved engine=${engine.name} model=${effectiveModel} requestEngine=${requestEngine ?? "(none)"} modelSource=${modelSelectionSource}`);
|
|
4706
4753
|
if (!(await isResolvedEngineUsableForRequest(engine, {
|
|
4707
4754
|
apiKey: effectiveApiKey,
|
|
4708
4755
|
}))) {
|
|
@@ -5775,24 +5822,6 @@ export function createProductionAgentHandler(options) {
|
|
|
5775
5822
|
}
|
|
5776
5823
|
}
|
|
5777
5824
|
}
|
|
5778
|
-
// Apply experiment variant overrides (A/B testing)
|
|
5779
|
-
let effectiveModel = model;
|
|
5780
|
-
try {
|
|
5781
|
-
const { resolveActiveExperimentConfig } = await import("../observability/experiments.js");
|
|
5782
|
-
if (!ownerEmail) {
|
|
5783
|
-
// Without an authenticated owner we can't resolve user-scoped experiments.
|
|
5784
|
-
throw new Error("no authenticated user");
|
|
5785
|
-
}
|
|
5786
|
-
const expConfig = await resolveActiveExperimentConfig(ownerEmail);
|
|
5787
|
-
if (expConfig) {
|
|
5788
|
-
if (typeof expConfig.configs.model === "string") {
|
|
5789
|
-
effectiveModel = expConfig.configs.model;
|
|
5790
|
-
}
|
|
5791
|
-
}
|
|
5792
|
-
}
|
|
5793
|
-
catch {
|
|
5794
|
-
// Experiments module unavailable — use default model
|
|
5795
|
-
}
|
|
5796
5825
|
// TODO(processor-seam): thread `processors` from ProductionAgentOptions
|
|
5797
5826
|
// through to runAgentLoop here once the handler exposes a way to
|
|
5798
5827
|
// configure them (e.g. a `processors` field on ProductionAgentOptions
|
|
@@ -5876,6 +5905,14 @@ export function createProductionAgentHandler(options) {
|
|
|
5876
5905
|
threadId: threadId ?? null,
|
|
5877
5906
|
userId: ownerEmail,
|
|
5878
5907
|
config: obsConfig,
|
|
5908
|
+
metadata: {
|
|
5909
|
+
modelSelectionSource,
|
|
5910
|
+
...(experimentAssignments.length > 0
|
|
5911
|
+
? { experimentAssignments }
|
|
5912
|
+
: {}),
|
|
5913
|
+
},
|
|
5914
|
+
experimentAssignments,
|
|
5915
|
+
modelSelectionSource,
|
|
5879
5916
|
classifyError: () => {
|
|
5880
5917
|
if (agentLoopOpts.signal.aborted &&
|
|
5881
5918
|
agentLoopOpts.signal.reason === "run_timeout") {
|