@agent-native/core 0.203.0 → 0.203.1-nightly-20261007154213
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/dist/action.d.ts +34 -0
- package/dist/agent/clip-text.d.ts +4 -0
- package/dist/agent/clip-text.js +17 -0
- package/dist/agent/follow-up-suggestions.d.ts +16 -2
- package/dist/agent/follow-up-suggestions.js +69 -1
- package/dist/agent/production-agent.d.ts +20 -2
- package/dist/agent/production-agent.js +322 -132
- package/dist/agent/provider-model-selection.d.ts +21 -2
- package/dist/agent/provider-model-selection.js +19 -2
- package/dist/agent/run-loop-with-resume.js +2 -16
- package/dist/agent/tool-search.d.ts +31 -1
- package/dist/agent/tool-search.js +196 -15
- package/dist/agent/write-receipts.d.ts +27 -0
- package/dist/agent/write-receipts.js +181 -0
- package/dist/automation/index.d.ts +1 -1
- package/dist/collab/routes.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/jobs/actions/manage-recurring-job.d.ts +1 -1
- package/dist/observability/routes.d.ts +10 -10
- package/dist/observability/trace-error.d.ts +5 -3
- package/dist/observability/trace-error.js +29 -4
- package/dist/observability/traces.js +6 -0
- package/dist/org/handlers.d.ts +2 -2
- package/dist/provider-api/actions/provider-api.d.ts +2 -2
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +5 -5
- package/dist/server/action-routes.js +3 -0
- package/dist/server/agent-chat/prompt-resources.d.ts +13 -0
- package/dist/server/agent-chat/prompt-resources.js +21 -12
- package/dist/server/agent-chat-plugin.js +25 -9
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-engine-default-model-route.d.ts +2 -2
- package/dist/server/agent-engine-ollama-models-route.d.ts +2 -2
- package/dist/server/embed-route.js +2 -1
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +3 -3
- package/dist/server/realtime-voice.js +2 -4
- package/dist/shared/embed-auth.d.ts +1 -0
- package/dist/shared/embed-auth.js +1 -0
- package/dist/sharing/actions/list-resource-shares.d.ts +1 -1
- package/dist/templates/chat/.agents/skills/actions/SKILL.md +25 -0
- package/dist/templates/default/.agents/skills/actions/SKILL.md +25 -0
- package/dist/templates/headless/.agents/skills/actions/SKILL.md +25 -0
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +25 -0
- package/dist/triggers/actions/manage-automation.d.ts +7 -7
- package/package.json +3 -3
- package/src/templates/chat/.agents/skills/actions/SKILL.md +25 -0
- package/src/templates/default/.agents/skills/actions/SKILL.md +25 -0
- package/src/templates/headless/.agents/skills/actions/SKILL.md +25 -0
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +25 -0
|
@@ -11,9 +11,9 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
11
11
|
enabled?: undefined;
|
|
12
12
|
nextRun?: undefined;
|
|
13
13
|
} | {
|
|
14
|
+
deleted?: undefined;
|
|
14
15
|
name: string;
|
|
15
16
|
enabled: boolean;
|
|
16
17
|
nextRun: string;
|
|
17
|
-
deleted?: undefined;
|
|
18
18
|
}>;
|
|
19
19
|
export default _default;
|
|
@@ -27,38 +27,38 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
27
27
|
thumbsUpRate: number;
|
|
28
28
|
avgEvalScore: number;
|
|
29
29
|
} | {
|
|
30
|
+
id?: undefined;
|
|
31
|
+
ok?: undefined;
|
|
30
32
|
error: string;
|
|
31
33
|
message: string;
|
|
32
34
|
summary?: undefined;
|
|
33
35
|
spans?: undefined;
|
|
36
|
+
} | {
|
|
34
37
|
id?: undefined;
|
|
35
38
|
ok?: undefined;
|
|
36
|
-
|
|
39
|
+
error?: undefined;
|
|
37
40
|
message?: undefined;
|
|
38
41
|
summary: import("./types.js").TraceSummary;
|
|
39
42
|
spans: import("./types.js").TraceSpan[];
|
|
40
|
-
id?: undefined;
|
|
41
|
-
error?: undefined;
|
|
42
|
-
ok?: undefined;
|
|
43
43
|
} | {
|
|
44
|
+
ok?: undefined;
|
|
45
|
+
error?: undefined;
|
|
44
46
|
message?: undefined;
|
|
45
47
|
summary?: undefined;
|
|
46
48
|
spans?: undefined;
|
|
47
49
|
id: string;
|
|
48
|
-
error?: undefined;
|
|
49
|
-
ok?: undefined;
|
|
50
50
|
} | {
|
|
51
|
+
id?: undefined;
|
|
52
|
+
ok?: undefined;
|
|
51
53
|
message?: undefined;
|
|
52
54
|
summary?: undefined;
|
|
53
55
|
spans?: undefined;
|
|
54
|
-
id?: undefined;
|
|
55
56
|
error: any;
|
|
56
|
-
ok?: undefined;
|
|
57
57
|
} | {
|
|
58
|
+
id?: undefined;
|
|
59
|
+
error?: undefined;
|
|
58
60
|
message?: undefined;
|
|
59
61
|
summary?: undefined;
|
|
60
62
|
spans?: undefined;
|
|
61
|
-
id?: undefined;
|
|
62
|
-
error?: undefined;
|
|
63
63
|
ok: boolean;
|
|
64
64
|
}>>;
|
|
@@ -15,8 +15,10 @@ export declare function sanitizeToolErrorMessage(value: string): string;
|
|
|
15
15
|
* captureToolResults off: the first non-blank line, bounded. It is stored
|
|
16
16
|
* without the owner opting in, so beyond credentials (a quoted secret can span
|
|
17
17
|
* lines, so redact the whole text first) it also drops the emails and opaque
|
|
18
|
-
* ids a failing tool echoes back.
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* ids a failing tool echoes back. The `Error running <tool>: ` prefix is
|
|
19
|
+
* dropped so signatures group by cause, and a JSON `{ error, message }` result
|
|
20
|
+
* is summarized as `error: message` rather than its opening brace. Never
|
|
21
|
+
* empty — an empty `error_message` reads as "no reason was captured", which is
|
|
22
|
+
* a different fact from "the tool gave no text".
|
|
21
23
|
*/
|
|
22
24
|
export declare function toolErrorSignature(value: unknown): string;
|
|
@@ -58,19 +58,44 @@ const EMAIL_PATTERN = /[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+/g;
|
|
|
58
58
|
// 16+ characters of an id alphabet with a digit in them: Google file ids, Gmail
|
|
59
59
|
// message ids, ObjectIds, session ids. Plain identifiers have no digit.
|
|
60
60
|
const OPAQUE_ID_PATTERN = /\b(?=[A-Za-z0-9_-]*\d)[A-Za-z0-9_-]{16,}\b/g;
|
|
61
|
+
const TOOL_ERROR_PREFIX_PATTERN = /^Error running [^\s:]+:\s*/;
|
|
61
62
|
/**
|
|
62
63
|
* The part of a tool failure that is always recorded, even with
|
|
63
64
|
* captureToolResults off: the first non-blank line, bounded. It is stored
|
|
64
65
|
* without the owner opting in, so beyond credentials (a quoted secret can span
|
|
65
66
|
* lines, so redact the whole text first) it also drops the emails and opaque
|
|
66
|
-
* ids a failing tool echoes back.
|
|
67
|
-
*
|
|
68
|
-
*
|
|
67
|
+
* ids a failing tool echoes back. The `Error running <tool>: ` prefix is
|
|
68
|
+
* dropped so signatures group by cause, and a JSON `{ error, message }` result
|
|
69
|
+
* is summarized as `error: message` rather than its opening brace. Never
|
|
70
|
+
* empty — an empty `error_message` reads as "no reason was captured", which is
|
|
71
|
+
* a different fact from "the tool gave no text".
|
|
69
72
|
*/
|
|
70
73
|
export function toolErrorSignature(value) {
|
|
71
|
-
const
|
|
74
|
+
const text = (typeof value === "string" ? value : "")
|
|
75
|
+
.trim()
|
|
76
|
+
.replace(TOOL_ERROR_PREFIX_PATTERN, "");
|
|
77
|
+
const redacted = redactToolErrorMessage(jsonErrorSummary(text) ?? text)
|
|
72
78
|
.replace(EMAIL_PATTERN, "[email]")
|
|
73
79
|
.replace(OPAQUE_ID_PATTERN, "[id]");
|
|
74
80
|
const firstLine = redacted.split(/\r?\n/).find((line) => line.trim());
|
|
75
81
|
return boundToolErrorMessage(firstLine?.trim() || "Tool failed with no error text");
|
|
76
82
|
}
|
|
83
|
+
/** `error: message` for a JSON `{ error, message }` result; `undefined` when the text is not one. */
|
|
84
|
+
function jsonErrorSummary(text) {
|
|
85
|
+
if (!text.startsWith("{"))
|
|
86
|
+
return undefined;
|
|
87
|
+
let parsed;
|
|
88
|
+
try {
|
|
89
|
+
parsed = JSON.parse(text);
|
|
90
|
+
// coercion-ok: unparseable text is not a JSON error result; the caller still records its first line
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
const { error, message } = (parsed ?? {});
|
|
96
|
+
if (typeof error !== "string" || !error.trim())
|
|
97
|
+
return undefined;
|
|
98
|
+
return typeof message === "string" && message.trim()
|
|
99
|
+
? `${error}: ${message}`
|
|
100
|
+
: error;
|
|
101
|
+
}
|
|
@@ -1230,6 +1230,10 @@ export async function instrumentAgentLoop(opts) {
|
|
|
1230
1230
|
run_id: runId,
|
|
1231
1231
|
thread_id: threadId,
|
|
1232
1232
|
llm_calls: llmCallCount || undefined,
|
|
1233
|
+
follow_up_ms: usage?.followUpMs,
|
|
1234
|
+
follow_up_input_tokens: usage?.followUpInputTokens,
|
|
1235
|
+
receipt_unverified_count: usage?.receiptUnverifiedCount,
|
|
1236
|
+
receipt_changed_false_count: usage?.receiptChangedFalseCount,
|
|
1233
1237
|
tool_calls: toolCallCount,
|
|
1234
1238
|
successful_tools: successfulTools,
|
|
1235
1239
|
failed_tools: failedTools,
|
|
@@ -1413,6 +1417,8 @@ export async function instrumentAgentLoop(opts) {
|
|
|
1413
1417
|
errorMessage: redactCapturedError(errorMessage),
|
|
1414
1418
|
attributes: {
|
|
1415
1419
|
"agent.llm_calls": llmCallCount,
|
|
1420
|
+
"agent.follow_up_ms": usage?.followUpMs,
|
|
1421
|
+
"agent.follow_up_input_tokens": usage?.followUpInputTokens,
|
|
1416
1422
|
"agent.tool_calls": toolCallCount,
|
|
1417
1423
|
"agent.successful_tools": successfulTools,
|
|
1418
1424
|
"agent.failed_tools": failedTools,
|
package/dist/org/handlers.d.ts
CHANGED
|
@@ -71,10 +71,10 @@ export declare const setWorkspaceAppDefaultVisibilityHandler: import("h3").Event
|
|
|
71
71
|
visibility: WorkspaceAppDefaultVisibility;
|
|
72
72
|
}>>;
|
|
73
73
|
export declare const createOrgHandler: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
74
|
-
name?: undefined;
|
|
75
74
|
success: boolean;
|
|
76
|
-
role?: undefined;
|
|
77
75
|
id?: undefined;
|
|
76
|
+
name?: undefined;
|
|
77
|
+
role?: undefined;
|
|
78
78
|
} | {
|
|
79
79
|
success?: undefined;
|
|
80
80
|
id: string;
|
|
@@ -311,6 +311,7 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
311
311
|
notes?: string | undefined;
|
|
312
312
|
scope?: "org" | "user" | undefined;
|
|
313
313
|
}, {
|
|
314
|
+
id?: undefined;
|
|
314
315
|
deleted?: undefined;
|
|
315
316
|
found?: undefined;
|
|
316
317
|
providers: {
|
|
@@ -325,17 +326,16 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
325
326
|
count: number;
|
|
326
327
|
provider?: undefined;
|
|
327
328
|
registered?: undefined;
|
|
328
|
-
id?: undefined;
|
|
329
329
|
label?: undefined;
|
|
330
330
|
message?: undefined;
|
|
331
331
|
} | {
|
|
332
|
+
id?: undefined;
|
|
332
333
|
deleted?: undefined;
|
|
333
334
|
count?: undefined;
|
|
334
335
|
providers?: undefined;
|
|
335
336
|
found: boolean;
|
|
336
337
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
337
338
|
registered?: undefined;
|
|
338
|
-
id?: undefined;
|
|
339
339
|
label?: undefined;
|
|
340
340
|
message?: undefined;
|
|
341
341
|
} | {
|
|
@@ -39,8 +39,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
|
|
|
39
39
|
error: string;
|
|
40
40
|
}>;
|
|
41
41
|
export declare function handleDeleteResource(event: any): Promise<{
|
|
42
|
-
error: string;
|
|
43
42
|
ok?: undefined;
|
|
43
|
+
error: string;
|
|
44
44
|
} | {
|
|
45
45
|
error?: undefined;
|
|
46
46
|
ok: boolean;
|
package/dist/secrets/routes.d.ts
CHANGED
|
@@ -58,20 +58,20 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
|
|
|
58
58
|
error: string;
|
|
59
59
|
errorCode?: undefined;
|
|
60
60
|
retryable?: undefined;
|
|
61
|
-
status?: undefined;
|
|
62
61
|
ok?: undefined;
|
|
62
|
+
status?: undefined;
|
|
63
63
|
} | {
|
|
64
64
|
error: string;
|
|
65
65
|
errorCode: string;
|
|
66
66
|
retryable?: undefined;
|
|
67
|
-
status?: undefined;
|
|
68
67
|
ok?: undefined;
|
|
68
|
+
status?: undefined;
|
|
69
69
|
} | {
|
|
70
70
|
error: string;
|
|
71
71
|
errorCode: string;
|
|
72
72
|
retryable: boolean;
|
|
73
|
-
status?: undefined;
|
|
74
73
|
ok?: undefined;
|
|
74
|
+
status?: undefined;
|
|
75
75
|
} | {
|
|
76
76
|
errorCode?: undefined;
|
|
77
77
|
retryable?: undefined;
|
|
@@ -79,18 +79,18 @@ export declare function createWriteSecretHandler(): import("h3").EventHandlerWit
|
|
|
79
79
|
status: string;
|
|
80
80
|
error?: undefined;
|
|
81
81
|
} | {
|
|
82
|
+
ok?: undefined;
|
|
82
83
|
error: string;
|
|
83
84
|
removed?: undefined;
|
|
84
|
-
ok?: undefined;
|
|
85
85
|
} | {
|
|
86
86
|
ok: boolean;
|
|
87
87
|
removed: boolean;
|
|
88
88
|
error?: undefined;
|
|
89
89
|
}>>;
|
|
90
90
|
export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
91
|
+
ok?: undefined;
|
|
91
92
|
error: string;
|
|
92
93
|
note?: undefined;
|
|
93
|
-
ok?: undefined;
|
|
94
94
|
} | {
|
|
95
95
|
ok: boolean;
|
|
96
96
|
note?: undefined;
|
|
@@ -750,6 +750,9 @@ function mountActionRoutesInternal(nitroApp, actions, options) {
|
|
|
750
750
|
appId: options?.appId,
|
|
751
751
|
caller,
|
|
752
752
|
requestHeaders: event.headers,
|
|
753
|
+
...(directoryWidgetReadAllowed
|
|
754
|
+
? { mcpDirectoryWidgetReadOnly: true }
|
|
755
|
+
: {}),
|
|
753
756
|
...(event.req?.signal ? { signal: event.req.signal } : {}),
|
|
754
757
|
actionName: name,
|
|
755
758
|
...(resolvedCaller?.delegationJti
|
|
@@ -39,6 +39,15 @@ export interface PromptResourceManifestSection {
|
|
|
39
39
|
sourceRef?: ContextManifestSourceRef;
|
|
40
40
|
}
|
|
41
41
|
export declare function promptResourceManifestSections(prompt: string): PromptResourceManifestSection[];
|
|
42
|
+
/** The compact prompt's skills index. `skillReadTool` is the tool the request
|
|
43
|
+
* registry actually has for reading a skill; with none, the index is dropped
|
|
44
|
+
* because it would send the model to a tool it cannot call. */
|
|
45
|
+
export declare function buildCompactSkillsSummary(skills: ReadonlyArray<{
|
|
46
|
+
meta: {
|
|
47
|
+
name: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
};
|
|
50
|
+
}>, skillReadTool: string | null): string | null;
|
|
42
51
|
/** @internal exported for unit tests only */
|
|
43
52
|
export declare function promptResourceBlock(input: {
|
|
44
53
|
name: string;
|
|
@@ -104,4 +113,8 @@ export declare function preloadJevContextForPrompt(options: {
|
|
|
104
113
|
*/
|
|
105
114
|
export declare function loadResourcesForPrompt(owner: string, compact?: boolean, selfAppId?: string, orgId?: string | null, opts?: {
|
|
106
115
|
disabledFrameworkGroups?: ReadonlySet<FrameworkToolGroup>;
|
|
116
|
+
/** The tool the compact skills summary sends the model to for skill text,
|
|
117
|
+
* or `null` when the request registry has none. Omitted means
|
|
118
|
+
* `docs-search`, the framework default. */
|
|
119
|
+
skillReadTool?: string | null;
|
|
107
120
|
}): Promise<string>;
|
|
@@ -275,6 +275,24 @@ function ensureSentence(value) {
|
|
|
275
275
|
return "";
|
|
276
276
|
return /[.!?]$/.test(trimmed) ? trimmed : `${trimmed}.`;
|
|
277
277
|
}
|
|
278
|
+
/** The compact prompt's skills index. `skillReadTool` is the tool the request
|
|
279
|
+
* registry actually has for reading a skill; with none, the index is dropped
|
|
280
|
+
* because it would send the model to a tool it cannot call. */
|
|
281
|
+
export function buildCompactSkillsSummary(skills, skillReadTool) {
|
|
282
|
+
if (skills.length === 0 || !skillReadTool)
|
|
283
|
+
return null;
|
|
284
|
+
const listedSkills = skills.slice(0, PROMPT_SKILL_SUMMARY_LIMIT);
|
|
285
|
+
const lines = listedSkills.map((s) => {
|
|
286
|
+
const description = s.meta.description?.trim()
|
|
287
|
+
? ` - ${ensureSentence(compactPromptLine(s.meta.description, PROMPT_SUMMARY_DESCRIPTION_MAX_CHARS))}`
|
|
288
|
+
: "";
|
|
289
|
+
return `- \`${s.meta.name}\`${description} Read with \`${skillReadTool} --slug "${skillDocsSlug(s.meta.name)}"\` before starting a task it applies to; reuse that page for subsequent steps in this turn.`;
|
|
290
|
+
});
|
|
291
|
+
if (skills.length > listedSkills.length) {
|
|
292
|
+
lines.push(`- ...${skills.length - listedSkills.length} more codebase skills. Use \`${skillReadTool} --query "<topic>"\` to discover the relevant one.`);
|
|
293
|
+
}
|
|
294
|
+
return `<skills-summary>\nCodebase skills bundled from \`.agents/skills/\` (or legacy \`.agent/skills/\`) are available as ${skillReadTool} pages. Do not use MCP resource reads for these skills. Read each relevant page once per turn and reuse it; do not repeat an equivalent ${skillReadTool} lookup unless the page or question is different.\n\n${lines.join("\n")}\n</skills-summary>`;
|
|
295
|
+
}
|
|
278
296
|
function escapeXmlAttribute(value) {
|
|
279
297
|
return value.replace(/&/g, "&").replace(/"/g, """);
|
|
280
298
|
}
|
|
@@ -1119,6 +1137,7 @@ export async function preloadJevContextForPrompt(options) {
|
|
|
1119
1137
|
*/
|
|
1120
1138
|
export async function loadResourcesForPrompt(owner, compact = false, selfAppId, orgId = getRequestOrgId() ?? null, opts) {
|
|
1121
1139
|
await ensurePersonalDefaults(owner);
|
|
1140
|
+
const skillReadTool = opts?.skillReadTool === undefined ? "docs-search" : opts.skillReadTool;
|
|
1122
1141
|
const sections = [];
|
|
1123
1142
|
const addSection = (content, governance = "inherited") => {
|
|
1124
1143
|
if (content?.trim())
|
|
@@ -1163,18 +1182,8 @@ export async function loadResourcesForPrompt(owner, compact = false, selfAppId,
|
|
|
1163
1182
|
const skillsBlock = generateSkillsPromptBlock(bundle, runtimeSkills);
|
|
1164
1183
|
addSection(skillsBlock);
|
|
1165
1184
|
}
|
|
1166
|
-
else
|
|
1167
|
-
|
|
1168
|
-
const lines = listedSkills.map((s) => {
|
|
1169
|
-
const description = s.meta.description?.trim()
|
|
1170
|
-
? ` - ${ensureSentence(compactPromptLine(s.meta.description, PROMPT_SUMMARY_DESCRIPTION_MAX_CHARS))}`
|
|
1171
|
-
: "";
|
|
1172
|
-
return `- \`${s.meta.name}\`${description} Read with \`docs-search --slug "${skillDocsSlug(s.meta.name)}"\` before starting a task it applies to; reuse that page for subsequent steps in this turn.`;
|
|
1173
|
-
});
|
|
1174
|
-
if (runtimeSkills.length > listedSkills.length) {
|
|
1175
|
-
lines.push(`- ...${runtimeSkills.length - listedSkills.length} more codebase skills. Use \`docs-search --query "<topic>"\` to discover the relevant one.`);
|
|
1176
|
-
}
|
|
1177
|
-
addSection(`<skills-summary>\nCodebase skills bundled from \`.agents/skills/\` (or legacy \`.agent/skills/\`) are available as docs-search pages. Do not use MCP resource reads for these skills. Read each relevant page once per turn and reuse it; do not repeat an equivalent docs-search lookup unless the page or question is different.\n\n${lines.join("\n")}\n</skills-summary>`);
|
|
1185
|
+
else {
|
|
1186
|
+
addSection(buildCompactSkillsSummary(runtimeSkills, skillReadTool));
|
|
1178
1187
|
}
|
|
1179
1188
|
const workspaceOwner = workspaceResourceOwner(orgId);
|
|
1180
1189
|
const workspaceAgents = await loadAgentsResourceForPrompt(workspaceOwner, "workspace", promptResourceMaxChars, orgId);
|
|
@@ -405,8 +405,13 @@ async function resolveResourceOrgId(event, resolveOrgId) {
|
|
|
405
405
|
const resolved = resolveOrgId ? await resolveOrgId(event) : undefined;
|
|
406
406
|
return resolved === undefined ? getRequestOrgId() : resolved;
|
|
407
407
|
}
|
|
408
|
+
// Lean runs never receive the compact framework prompt, so the batching rule
|
|
409
|
+
// it carries has to ride the run policy instead.
|
|
410
|
+
const LEAN_PARALLEL_READS_NOTE = "\n\nWhen several independent reads are needed, emit them in the same step.";
|
|
408
411
|
export function buildLeanRunPolicyPrompt(codeEditingSurfaceRestriction, prodCodeExecPromptNote) {
|
|
409
|
-
return
|
|
412
|
+
return (LEAN_PARALLEL_READS_NOTE +
|
|
413
|
+
codeEditingSurfaceRestriction +
|
|
414
|
+
prodCodeExecPromptNote);
|
|
410
415
|
}
|
|
411
416
|
export function filterPromptActionsToSurface(actions, allowedActionNames) {
|
|
412
417
|
if (!allowedActionNames)
|
|
@@ -851,6 +856,16 @@ export function createAgentChatPlugin(options) {
|
|
|
851
856
|
const docsScripts = frameworkTools.isEnabled("docs")
|
|
852
857
|
? await createDocsScriptEntries()
|
|
853
858
|
: {};
|
|
859
|
+
// The compact prompt sends the model to `docs-search` for skill text, so
|
|
860
|
+
// it is the one docs tool the lean registry keeps (`framework-search`
|
|
861
|
+
// stays out of the first request). Every registry carries it through
|
|
862
|
+
// `docsScripts` or `skillReadScripts`, which is why one resolved name
|
|
863
|
+
// serves every prompt site.
|
|
864
|
+
const docsSearchEntry = docsScripts["docs-search"];
|
|
865
|
+
const skillReadScripts = docsSearchEntry
|
|
866
|
+
? { "docs-search": docsSearchEntry }
|
|
867
|
+
: {};
|
|
868
|
+
const skillReadTool = docsSearchEntry ? "docs-search" : null;
|
|
854
869
|
const databaseToolsMode = normalizeDatabaseToolsMode(frameworkTools.database);
|
|
855
870
|
const databaseToolsEnabled = databaseToolsMode !== "off";
|
|
856
871
|
const databaseWriteToolsEnabled = databaseToolsMode === "write";
|
|
@@ -1843,7 +1858,7 @@ export function createAgentChatPlugin(options) {
|
|
|
1843
1858
|
const devActive = isDevMode();
|
|
1844
1859
|
// Build the same system prompt the interactive agent uses
|
|
1845
1860
|
const owner = userEmail;
|
|
1846
|
-
const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId, undefined, { disabledFrameworkGroups });
|
|
1861
|
+
const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId, undefined, { disabledFrameworkGroups, skillReadTool });
|
|
1847
1862
|
const schemaBlock = lazyContext
|
|
1848
1863
|
? ""
|
|
1849
1864
|
: await buildSchemaBlock(owner, databaseToolsMode);
|
|
@@ -2468,7 +2483,7 @@ export function createAgentChatPlugin(options) {
|
|
|
2468
2483
|
// catalog on its very first request, undermining the compact MCP
|
|
2469
2484
|
// catalog this surface is supposed to keep external callers on.
|
|
2470
2485
|
const mcpToolSurface = createA2AEngineToolSurface(actionsToEngineTools(mcpActions), effectiveInitialToolNames);
|
|
2471
|
-
const resources = await loadResourcesForPrompt(SHARED_OWNER, lazyContext, options?.appId, undefined, { disabledFrameworkGroups });
|
|
2486
|
+
const resources = await loadResourcesForPrompt(SHARED_OWNER, lazyContext, options?.appId, undefined, { disabledFrameworkGroups, skillReadTool });
|
|
2472
2487
|
const schemaBlock = lazyContext
|
|
2473
2488
|
? ""
|
|
2474
2489
|
: await buildSchemaBlock(SHARED_OWNER, databaseToolsMode);
|
|
@@ -3109,6 +3124,7 @@ export function createAgentChatPlugin(options) {
|
|
|
3109
3124
|
const leanActionEntries = {
|
|
3110
3125
|
...templateScripts,
|
|
3111
3126
|
...resourceScripts,
|
|
3127
|
+
...skillReadScripts,
|
|
3112
3128
|
...workspaceFileActions,
|
|
3113
3129
|
...refreshScreenTool,
|
|
3114
3130
|
...urlTools,
|
|
@@ -3454,7 +3470,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
3454
3470
|
// so everything after it can change without a cache write.
|
|
3455
3471
|
if (leanPrompt) {
|
|
3456
3472
|
const leanRunPolicyPrompt = buildLeanRunPolicyPrompt(codeEditingSurfaceRestriction, `${requestProdCodeExecPromptNote}${hostedHarnessPromptNote ? `\n\n${hostedHarnessPromptNote}` : ""}`);
|
|
3457
|
-
const resources = await loadResourcesForPrompt(owner, true, options?.appId, undefined, { disabledFrameworkGroups });
|
|
3473
|
+
const resources = await loadResourcesForPrompt(owner, true, options?.appId, undefined, { disabledFrameworkGroups, skillReadTool });
|
|
3458
3474
|
await emitContextXraySystemSections(event, {
|
|
3459
3475
|
frameworkPrompt: requestLeanPrompt.slice(0, Math.max(0, requestLeanPrompt.length - requestLeanActionsPrompt.length)),
|
|
3460
3476
|
actionsPrompt: requestLeanActionsPrompt,
|
|
@@ -3474,7 +3490,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
3474
3490
|
runtimeContext,
|
|
3475
3491
|
}));
|
|
3476
3492
|
}
|
|
3477
|
-
const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId, undefined, { disabledFrameworkGroups });
|
|
3493
|
+
const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId, undefined, { disabledFrameworkGroups, skillReadTool });
|
|
3478
3494
|
// In lazy context mode, skip embedding the full schema. When database
|
|
3479
3495
|
// tools are enabled the agent can call `db-schema` on demand.
|
|
3480
3496
|
const schemaBlock = lazyContext
|
|
@@ -3756,7 +3772,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
3756
3772
|
// cached prompt prefix as possible. See the prod handler above
|
|
3757
3773
|
// for the same pattern.
|
|
3758
3774
|
if (leanPrompt) {
|
|
3759
|
-
const resources = await loadResourcesForPrompt(owner, true, options?.appId, undefined, { disabledFrameworkGroups });
|
|
3775
|
+
const resources = await loadResourcesForPrompt(owner, true, options?.appId, undefined, { disabledFrameworkGroups, skillReadTool });
|
|
3760
3776
|
await emitContextXraySystemSections(event, {
|
|
3761
3777
|
frameworkPrompt: requestLeanPrompt.slice(0, Math.max(0, requestLeanPrompt.length - requestLeanActionsPrompt.length)),
|
|
3762
3778
|
actionsPrompt: requestLeanActionsPrompt,
|
|
@@ -3773,7 +3789,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
3773
3789
|
runtimeContext,
|
|
3774
3790
|
}));
|
|
3775
3791
|
}
|
|
3776
|
-
const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId, undefined, { disabledFrameworkGroups });
|
|
3792
|
+
const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId, undefined, { disabledFrameworkGroups, skillReadTool });
|
|
3777
3793
|
const schemaBlock = lazyContext || !databaseToolsEnabled
|
|
3778
3794
|
? ""
|
|
3779
3795
|
: await buildSchemaBlock(owner, databaseToolsMode);
|
|
@@ -6261,7 +6277,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
6261
6277
|
const schedulerDeps = {
|
|
6262
6278
|
getActions: getBackgroundActionEntries,
|
|
6263
6279
|
getSystemPrompt: async (owner) => {
|
|
6264
|
-
const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId, undefined, { disabledFrameworkGroups });
|
|
6280
|
+
const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId, undefined, { disabledFrameworkGroups, skillReadTool });
|
|
6265
6281
|
const schemaBlock = lazyContext
|
|
6266
6282
|
? ""
|
|
6267
6283
|
: await buildSchemaBlock(owner, databaseToolsMode);
|
|
@@ -6671,7 +6687,7 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
6671
6687
|
await initTriggerDispatcher({
|
|
6672
6688
|
getActions: getBackgroundActionEntries,
|
|
6673
6689
|
getSystemPrompt: async (owner) => {
|
|
6674
|
-
const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId, undefined, { disabledFrameworkGroups });
|
|
6690
|
+
const resources = await loadResourcesForPrompt(owner, lazyContext, options?.appId, undefined, { disabledFrameworkGroups, skillReadTool });
|
|
6675
6691
|
const schemaBlock = lazyContext
|
|
6676
6692
|
? ""
|
|
6677
6693
|
: await buildSchemaBlock(owner, databaseToolsMode);
|
|
@@ -66,12 +66,12 @@ export declare function createAgentEngineApiKeyHandler(): import("h3").EventHand
|
|
|
66
66
|
code: any;
|
|
67
67
|
} | {
|
|
68
68
|
errorCode?: undefined;
|
|
69
|
+
error?: undefined;
|
|
69
70
|
code?: undefined;
|
|
70
71
|
ok: boolean;
|
|
71
72
|
key: string;
|
|
72
73
|
baseUrlKey?: string;
|
|
73
74
|
scope: AgentEngineApiKeyScope;
|
|
74
75
|
defaultModel?: import("./agent-engine-default-model-route.js").SavedKeyDefaultModelOutcome;
|
|
75
|
-
error?: undefined;
|
|
76
76
|
}>>;
|
|
77
77
|
export {};
|
|
@@ -9,16 +9,16 @@ export declare const AGENT_ENGINE_API_KEY_ACTION_NAME = "agent-engine-api-key";
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function createAgentEngineDisconnectHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
11
11
|
error: string;
|
|
12
|
-
scope?: undefined;
|
|
13
12
|
ok?: undefined;
|
|
13
|
+
scope?: undefined;
|
|
14
14
|
} | {
|
|
15
15
|
ok: boolean;
|
|
16
16
|
error: any;
|
|
17
17
|
scope?: undefined;
|
|
18
18
|
} | {
|
|
19
|
+
error?: undefined;
|
|
19
20
|
ok: boolean;
|
|
20
21
|
scope: "org" | "user";
|
|
21
|
-
error?: undefined;
|
|
22
22
|
}>>;
|
|
23
23
|
export interface DefaultModelSelectionRequest {
|
|
24
24
|
engine: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare function createAgentEngineOllamaModelsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
2
2
|
error: string;
|
|
3
|
-
models?: undefined;
|
|
4
3
|
ok?: undefined;
|
|
4
|
+
models?: undefined;
|
|
5
5
|
} | {
|
|
6
|
+
error?: undefined;
|
|
6
7
|
ok: boolean;
|
|
7
8
|
models: string[];
|
|
8
|
-
error?: undefined;
|
|
9
9
|
}>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineEventHandler, getHeader, getMethod, getQuery, setResponseHeader, } from "h3";
|
|
2
2
|
import { withCollapsedAgentSidebarParam } from "../shared/agent-sidebar-url.js";
|
|
3
|
-
import { EMBED_MODE_QUERY_PARAM, EMBED_START_PATH, EMBED_TOKEN_QUERY_PARAM, MCP_APP_CHAT_BRIDGE_QUERY_PARAM, } from "../shared/embed-auth.js";
|
|
3
|
+
import { EMBED_MODE_QUERY_PARAM, EMBED_START_PATH, EMBED_TOKEN_QUERY_PARAM, MCP_APP_CHAT_BRIDGE_QUERY_PARAM, MCP_DIRECTORY_WIDGET_QUERY_PARAM, } from "../shared/embed-auth.js";
|
|
4
4
|
import { isMcpEmbedTransplantOrigin, MCP_EMBED_CORS_ALLOW_HEADERS, } from "../shared/mcp-embed-headers.js";
|
|
5
5
|
import { getConfiguredAppBasePath } from "./app-base-path.js";
|
|
6
6
|
import { readCorsAllowedOrigins } from "./cors-origins.js";
|
|
@@ -21,6 +21,7 @@ function appendEmbedParams(target, token, chatBridgeActive = false) {
|
|
|
21
21
|
if (chatBridgeActive) {
|
|
22
22
|
url.searchParams.set(MCP_APP_CHAT_BRIDGE_QUERY_PARAM, "1");
|
|
23
23
|
}
|
|
24
|
+
url.searchParams.delete(MCP_DIRECTORY_WIDGET_QUERY_PARAM);
|
|
24
25
|
return `${url.pathname}${url.search}${url.hash}`;
|
|
25
26
|
}
|
|
26
27
|
function redirectWithStagedCookies(event, location, status = 302) {
|
package/dist/server/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export { verifyCaptcha, type CaptchaVerifyResult } from "./captcha.js";
|
|
|
24
24
|
export { getLocaleInitScript, parseAcceptLanguage, resolveLocaleFromRequest, type LocaleInitScriptOptions, type ResolveLocaleFromRequestOptions, type ResolvedRequestLocale, } from "../localization/server.js";
|
|
25
25
|
export { createProductionAgentHandler, type ActionEntry, type ScriptEntry, type ProductionAgentOptions, type AgentActionSurface, type DefaultAgentActionSurface, type AgentActionSurfaceResolution, type AgentActionSurfaceDetails, type ActionTool, type ScriptTool, type AgentMessage, type AgentChatRequest, type AgentChatEvent, type AgentChatAttachment, type AgentChatReference, type MentionProvider, type MentionItemMedia, type MentionProviderItem, type AgentLoopFinalResponseGuard, type AgentLoopFinalResponseGuardContext, type AgentLoopFinalResponseGuardResult, type AgentLoopToolCallSummary, type AgentLoopToolResultSummary, } from "../agent/index.js";
|
|
26
26
|
export type { AgentActionScope } from "../agent/types.js";
|
|
27
|
-
export { actionsToEngineTools, executeAgentToolCall, getJevContextCredentials, getOwnerActiveApiKey, getOwnerApiKeyForEngine, getOwnerJevApiKey, resolveOwnerEngineApiKey, runAgentLoop, type AgentToolCallExecutionResult, type ExecuteAgentToolCallOptions, type JevContextCredentials, type ResolvedOwnerApiKey, } from "../agent/production-agent.js";
|
|
27
|
+
export { actionsToEngineTools, executeAgentToolCall, filterInitialEngineTools, getJevContextCredentials, getOwnerActiveApiKey, getOwnerApiKeyForEngine, getOwnerJevApiKey, resolveOwnerEngineApiKey, runAgentLoop, type AgentToolCallExecutionResult, type ExecuteAgentToolCallOptions, type JevContextCredentials, type ResolvedOwnerApiKey, } from "../agent/production-agent.js";
|
|
28
28
|
export { isJevEnabled, requestJevThroughBuilder, type JevResponse, } from "../agent/jev-tool-prefetch.js";
|
|
29
29
|
export { getRunStatus, getRunTurnRef } from "../agent/run-store.js";
|
|
30
30
|
export { getActiveRunForThreadAsync } from "../agent/run-manager.js";
|
|
@@ -48,7 +48,7 @@ export { createContextXrayPlugin, defaultContextXrayPlugin, } from "../agent/con
|
|
|
48
48
|
export { createObservationalMemoryPlugin, defaultObservationalMemoryPlugin, } from "../agent/observational-memory/plugin.js";
|
|
49
49
|
export { createGoogleAuthPlugin, type GoogleAuthPluginOptions, } from "./google-auth-plugin.js";
|
|
50
50
|
export type { GoogleAuthMode } from "./google-auth-mode.js";
|
|
51
|
-
export { createAgentChatPlugin, defaultAgentChatPlugin, type AgentChatPluginOptions, } from "./agent-chat-plugin.js";
|
|
51
|
+
export { createAgentChatPlugin, defaultAgentChatPlugin, loadResourcesForPrompt, type AgentChatPluginOptions, } from "./agent-chat-plugin.js";
|
|
52
52
|
export { refreshMcpManagerForPrincipal } from "./agent-chat/mcp-glue.js";
|
|
53
53
|
export { AGENT_CHAT_STREAM_PATH, AGENT_CHAT_STREAM_TOKEN_SUFFIX, AGENT_CHAT_STREAM_TOKEN_TTL_SECONDS, createAgentChatStreamToken, isAgentChatStreamingRuntime, readAgentChatStreamBearerToken, verifyAgentChatStreamToken, type AgentChatStreamPrincipal, } from "./agent-chat-stream.js";
|
|
54
54
|
export type { AgentChatMcpIcon, AgentChatMcpOptions, } from "./agent-chat/mcp-options.js";
|
|
@@ -77,7 +77,7 @@ export { extractBearerToken as extractInternalBearerToken, verifyInternalToken,
|
|
|
77
77
|
export { autoDiscoverActions, autoDiscoverScripts, loadActionsFromStaticRegistry, mergeCoreSharingActions, registerPackageActions, } from "./action-discovery.js";
|
|
78
78
|
export { attachToolSearch, createToolSearchEntry, searchToolRegistry, TOOL_SEARCH_ACTION_NAME, } from "../agent/tool-search.js";
|
|
79
79
|
export { filterFrameworkToolGroups, frameworkGroupEnabled, resolveFrameworkTools, FRAMEWORK_TOOL_GROUPS, type FrameworkToolGroup, type FrameworkToolsConfig, type FrameworkToolsOption, type ResolvedFrameworkTools, } from "../framework-tools.js";
|
|
80
|
-
export { registerPromptContextProvider, type PromptContextProvider, type PromptContextProviderContext, type PromptContextProviderContribution, } from "./agent-chat/prompt-resources.js";
|
|
80
|
+
export { buildCompactSkillsSummary, registerPromptContextProvider, type PromptContextProvider, type PromptContextProviderContext, type PromptContextProviderContribution, } from "./agent-chat/prompt-resources.js";
|
|
81
81
|
export { mountActionRoutes, type MountActionRoutesOptions, type ActionRouteAuthAdapter, type ActionRouteResolvedCaller, } from "./action-routes.js";
|
|
82
82
|
export { AGENT_RUN_OWNER_CONTEXT_KEY, seedAgentRunOwnerContext, type AgentRunOwnerContext, } from "./agent-run-context.js";
|
|
83
83
|
export { runWithRequestContext, hasRequestContext, hasRequestBoundary, getRequestContext, getRequestUserEmail, getRequestUserName, getRequestOrgId, getAmbientUserEmail, getAmbientOrgId, getRequestTimezone, getRequestRunContext, getCredentialContext, isIntegrationCallerRequest, type RequestContext, type RequestRunContext, } from "./request-context.js";
|
package/dist/server/index.js
CHANGED
|
@@ -23,7 +23,7 @@ export { assertCurrentRequestUserIsOrgAdmin, currentRequestUserIsOrgAdmin, } fro
|
|
|
23
23
|
export { verifyCaptcha } from "./captcha.js";
|
|
24
24
|
export { getLocaleInitScript, parseAcceptLanguage, resolveLocaleFromRequest, } from "../localization/server.js";
|
|
25
25
|
export { createProductionAgentHandler, } from "../agent/index.js";
|
|
26
|
-
export { actionsToEngineTools, executeAgentToolCall, getJevContextCredentials, getOwnerActiveApiKey, getOwnerApiKeyForEngine, getOwnerJevApiKey, resolveOwnerEngineApiKey, runAgentLoop, } from "../agent/production-agent.js";
|
|
26
|
+
export { actionsToEngineTools, executeAgentToolCall, filterInitialEngineTools, getJevContextCredentials, getOwnerActiveApiKey, getOwnerApiKeyForEngine, getOwnerJevApiKey, resolveOwnerEngineApiKey, runAgentLoop, } from "../agent/production-agent.js";
|
|
27
27
|
export { isJevEnabled, requestJevThroughBuilder, } from "../agent/jev-tool-prefetch.js";
|
|
28
28
|
export { getRunStatus, getRunTurnRef } from "../agent/run-store.js";
|
|
29
29
|
export { getActiveRunForThreadAsync } from "../agent/run-manager.js";
|
|
@@ -46,7 +46,7 @@ export { createExperimentsPlugin } from "../experiments/server.js";
|
|
|
46
46
|
export { createContextXrayPlugin, defaultContextXrayPlugin, } from "../agent/context-xray/plugin.js";
|
|
47
47
|
export { createObservationalMemoryPlugin, defaultObservationalMemoryPlugin, } from "../agent/observational-memory/plugin.js";
|
|
48
48
|
export { createGoogleAuthPlugin, } from "./google-auth-plugin.js";
|
|
49
|
-
export { createAgentChatPlugin, defaultAgentChatPlugin, } from "./agent-chat-plugin.js";
|
|
49
|
+
export { createAgentChatPlugin, defaultAgentChatPlugin, loadResourcesForPrompt, } from "./agent-chat-plugin.js";
|
|
50
50
|
export { refreshMcpManagerForPrincipal } from "./agent-chat/mcp-glue.js";
|
|
51
51
|
export { AGENT_CHAT_STREAM_PATH, AGENT_CHAT_STREAM_TOKEN_SUFFIX, AGENT_CHAT_STREAM_TOKEN_TTL_SECONDS, createAgentChatStreamToken, isAgentChatStreamingRuntime, readAgentChatStreamBearerToken, verifyAgentChatStreamToken, } from "./agent-chat-stream.js";
|
|
52
52
|
export { configureAgentNativeEmbeddedEnvironment, createAgentNativeEmbeddedAuthOptions, createAgentNativeEmbeddedPlugin, mountAgentNativeEmbedded, normalizeAgentNativeEmbeddedSession, } from "./embedded.js";
|
|
@@ -72,7 +72,7 @@ export { extractBearerToken as extractInternalBearerToken, verifyInternalToken,
|
|
|
72
72
|
export { autoDiscoverActions, autoDiscoverScripts, loadActionsFromStaticRegistry, mergeCoreSharingActions, registerPackageActions, } from "./action-discovery.js";
|
|
73
73
|
export { attachToolSearch, createToolSearchEntry, searchToolRegistry, TOOL_SEARCH_ACTION_NAME, } from "../agent/tool-search.js";
|
|
74
74
|
export { filterFrameworkToolGroups, frameworkGroupEnabled, resolveFrameworkTools, FRAMEWORK_TOOL_GROUPS, } from "../framework-tools.js";
|
|
75
|
-
export { registerPromptContextProvider, } from "./agent-chat/prompt-resources.js";
|
|
75
|
+
export { buildCompactSkillsSummary, registerPromptContextProvider, } from "./agent-chat/prompt-resources.js";
|
|
76
76
|
export { mountActionRoutes, } from "./action-routes.js";
|
|
77
77
|
export { AGENT_RUN_OWNER_CONTEXT_KEY, seedAgentRunOwnerContext, } from "./agent-run-context.js";
|
|
78
78
|
export { runWithRequestContext, hasRequestContext, hasRequestBoundary, getRequestContext, getRequestUserEmail, getRequestUserName, getRequestOrgId, getAmbientUserEmail, getAmbientOrgId, getRequestTimezone, getRequestRunContext, getCredentialContext, isIntegrationCallerRequest, } from "./request-context.js";
|
|
@@ -2,7 +2,7 @@ import { defineEventHandler, getHeader, getMethod, readRawBody, setResponseHeade
|
|
|
2
2
|
import { getBuilderGatewayRequestHeaders } from "../agent/engine/builder-gateway-headers.js";
|
|
3
3
|
import { actionsToEngineTools, } from "../agent/production-agent.js";
|
|
4
4
|
import { redactSensitiveFields, sanitizeToolErrorText, sanitizeToolErrorValue, } from "../agent/tool-error-redaction.js";
|
|
5
|
-
import { TOOL_SEARCH_ACTION_NAME } from "../agent/tool-search.js";
|
|
5
|
+
import { isTargetedToolSearch, TOOL_SEARCH_ACTION_NAME, } from "../agent/tool-search.js";
|
|
6
6
|
import { parseAcceptLanguage } from "../localization/server.js";
|
|
7
7
|
import { getSession } from "./auth.js";
|
|
8
8
|
import { gatewayLaneUnavailableMessage, getBuilderGatewayBaseUrl, resolveBuilderGatewayAuth, resolveSecret, } from "./credential-provider.js";
|
|
@@ -275,11 +275,9 @@ function parseSuccessfulToolSearchNames(output) {
|
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
function grantDiscoveredRealtimeTools(input) {
|
|
278
|
-
const query = input.request.args.query;
|
|
279
278
|
if (input.request.name !== TOOL_SEARCH_ACTION_NAME ||
|
|
280
279
|
input.result.status !== "completed" ||
|
|
281
|
-
|
|
282
|
-
!query.trim()) {
|
|
280
|
+
!isTargetedToolSearch(input.request.args)) {
|
|
283
281
|
return [];
|
|
284
282
|
}
|
|
285
283
|
const candidates = parseSuccessfulToolSearchNames(input.result.output)
|
|
@@ -3,6 +3,7 @@ export declare const EMBED_TOKEN_QUERY_PARAM = "__an_embed_token";
|
|
|
3
3
|
export declare const EMBED_TARGET_QUERY_PARAM = "__an_embed_target";
|
|
4
4
|
export declare const EMBED_MODE_QUERY_PARAM = "embedded";
|
|
5
5
|
export declare const MCP_APP_CHAT_BRIDGE_QUERY_PARAM = "__an_mcp_chat_bridge";
|
|
6
|
+
export declare const MCP_DIRECTORY_WIDGET_QUERY_PARAM = "__an_mcp_directory_widget";
|
|
6
7
|
export declare const EMBED_SESSION_COOKIE = "an_embed_session";
|
|
7
8
|
export declare const EMBED_TARGET_HEADER = "x-agent-native-embed-target";
|
|
8
9
|
export declare const MCP_DIRECTORY_WIDGET_READ_CAPABILITY_PREFIX = "capability:mcp-directory-widget-read:";
|
|
@@ -3,6 +3,7 @@ export const EMBED_TOKEN_QUERY_PARAM = "__an_embed_token";
|
|
|
3
3
|
export const EMBED_TARGET_QUERY_PARAM = "__an_embed_target";
|
|
4
4
|
export const EMBED_MODE_QUERY_PARAM = "embedded";
|
|
5
5
|
export const MCP_APP_CHAT_BRIDGE_QUERY_PARAM = "__an_mcp_chat_bridge";
|
|
6
|
+
export const MCP_DIRECTORY_WIDGET_QUERY_PARAM = "__an_mcp_directory_widget";
|
|
6
7
|
export const EMBED_SESSION_COOKIE = "an_embed_session";
|
|
7
8
|
export const EMBED_TARGET_HEADER = "x-agent-native-embed-target";
|
|
8
9
|
export const MCP_DIRECTORY_WIDGET_READ_CAPABILITY_PREFIX = "capability:mcp-directory-widget-read:";
|
|
@@ -2,6 +2,7 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
2
2
|
resourceType: string;
|
|
3
3
|
resourceId: string;
|
|
4
4
|
}, {
|
|
5
|
+
role?: undefined;
|
|
5
6
|
ownerEmail: any;
|
|
6
7
|
visibility: any;
|
|
7
8
|
shares: any[];
|
|
@@ -11,7 +12,6 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
11
12
|
supportsGroupShares?: boolean;
|
|
12
13
|
};
|
|
13
14
|
orgId?: undefined;
|
|
14
|
-
role?: undefined;
|
|
15
15
|
agentReadable?: undefined;
|
|
16
16
|
} | {
|
|
17
17
|
ownerEmail: string;
|