@agent-native/core 0.155.0 → 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/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/clips/app/components/player/share-dialog.tsx +102 -59
- package/corpus/templates/clips/app/routes/r.$recordingId.tsx +15 -1
- package/corpus/templates/clips/app/routes/share.$shareId.tsx +16 -2
- 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 +100 -8
- package/dist/agent/types.d.ts +9 -0
- package/dist/client/AgentPanel.js +12 -9
- package/dist/client/AssistantChat.d.ts +15 -1
- package/dist/client/AssistantChat.js +110 -43
- package/dist/client/MultiTabAssistantChat.js +44 -27
- 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/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/observability/ThumbsFeedback.js +10 -8
- 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/routes.d.ts +1 -1
- package/dist/index.d.ts +1 -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 +2 -0
- package/dist/localization/default-messages.js +2 -0
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +5 -5
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- 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-engine-api-key-route.d.ts +1 -1
- 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/index.d.ts +1 -1
- package/dist/server/request-context.d.ts +7 -0
- package/dist/server/request-context.js +15 -0
- package/docs/content/agent-surfaces.mdx +30 -0
- package/package.json +2 -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
|
+
}
|
|
@@ -427,6 +427,7 @@ declare const messages: {
|
|
|
427
427
|
workspace: string;
|
|
428
428
|
newChat: string;
|
|
429
429
|
newTerminal: string;
|
|
430
|
+
loadingTerminal: string;
|
|
430
431
|
panelOptions: string;
|
|
431
432
|
collapseSidebar: string;
|
|
432
433
|
widenChat: string;
|
|
@@ -680,6 +681,7 @@ declare const messages: {
|
|
|
680
681
|
shareLink: string;
|
|
681
682
|
addPeopleByEmail: string;
|
|
682
683
|
notifyPeople: string;
|
|
684
|
+
message: string;
|
|
683
685
|
addMessage: string;
|
|
684
686
|
hideMessage: string;
|
|
685
687
|
messagePlaceholder: string;
|
|
@@ -433,6 +433,7 @@ const messages = {
|
|
|
433
433
|
workspace: "Resources",
|
|
434
434
|
newChat: "New chat",
|
|
435
435
|
newTerminal: "New terminal",
|
|
436
|
+
loadingTerminal: "Loading terminal...",
|
|
436
437
|
panelOptions: "Agent panel options",
|
|
437
438
|
collapseSidebar: "Collapse sidebar",
|
|
438
439
|
widenChat: "Widen chat",
|
|
@@ -686,6 +687,7 @@ const messages = {
|
|
|
686
687
|
shareLink: "Share link",
|
|
687
688
|
addPeopleByEmail: "Add people by email",
|
|
688
689
|
notifyPeople: "Notify people",
|
|
690
|
+
message: "Message",
|
|
689
691
|
addMessage: "Add a message",
|
|
690
692
|
hideMessage: "Hide message",
|
|
691
693
|
messagePlaceholder: "Add a short note (optional)",
|
|
@@ -41,27 +41,27 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
41
41
|
thumbsUpRate: number;
|
|
42
42
|
avgEvalScore: number;
|
|
43
43
|
} | {
|
|
44
|
+
error?: undefined;
|
|
45
|
+
ok?: undefined;
|
|
44
46
|
summary: import("./types.js").TraceSummary;
|
|
45
47
|
spans: import("./types.js").TraceSpan[];
|
|
46
48
|
id?: undefined;
|
|
49
|
+
} | {
|
|
47
50
|
error?: undefined;
|
|
48
51
|
ok?: undefined;
|
|
49
|
-
} | {
|
|
50
52
|
summary?: undefined;
|
|
51
53
|
spans?: undefined;
|
|
52
54
|
id: string;
|
|
53
|
-
error?: undefined;
|
|
54
|
-
ok?: undefined;
|
|
55
55
|
} | {
|
|
56
|
+
ok?: undefined;
|
|
56
57
|
summary?: undefined;
|
|
57
58
|
spans?: undefined;
|
|
58
59
|
id?: undefined;
|
|
59
60
|
error: any;
|
|
60
|
-
ok?: undefined;
|
|
61
61
|
} | {
|
|
62
|
+
error?: undefined;
|
|
62
63
|
summary?: undefined;
|
|
63
64
|
spans?: undefined;
|
|
64
65
|
id?: undefined;
|
|
65
66
|
ok: boolean;
|
|
66
|
-
error?: undefined;
|
|
67
67
|
}>>;
|
|
@@ -48,8 +48,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
|
|
|
48
48
|
}>;
|
|
49
49
|
/** DELETE /_agent-native/resources/:id — delete a resource */
|
|
50
50
|
export declare function handleDeleteResource(event: any): Promise<{
|
|
51
|
-
error: string;
|
|
52
51
|
ok?: undefined;
|
|
52
|
+
error: string;
|
|
53
53
|
} | {
|
|
54
54
|
error?: undefined;
|
|
55
55
|
ok: boolean;
|
package/dist/secrets/routes.d.ts
CHANGED
|
@@ -34,37 +34,37 @@ export declare function createListSecretsHandler(): import("h3").EventHandlerWit
|
|
|
34
34
|
/** POST /_agent-native/secrets/:key — write a secret. */
|
|
35
35
|
export declare function createWriteSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
36
36
|
error: string;
|
|
37
|
-
status?: undefined;
|
|
38
37
|
ok?: undefined;
|
|
38
|
+
status?: undefined;
|
|
39
39
|
} | {
|
|
40
|
+
error?: undefined;
|
|
40
41
|
ok: boolean;
|
|
41
42
|
status: string;
|
|
42
|
-
error?: undefined;
|
|
43
43
|
} | {
|
|
44
|
+
ok?: undefined;
|
|
44
45
|
error: string;
|
|
45
46
|
removed?: undefined;
|
|
46
|
-
ok?: 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
|
|
54
54
|
* or the current stored value without changing anything.
|
|
55
55
|
*/
|
|
56
56
|
export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
57
|
+
ok?: undefined;
|
|
57
58
|
error: string;
|
|
58
59
|
note?: undefined;
|
|
59
|
-
ok?: 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,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`)
|