@theokit/sdk 4.54.0 → 4.55.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/CHANGELOG.md +96 -0
- package/dist/{agent-CIUgz7cN.d.cts → agent-D3Xr_-6Z.d.cts} +61 -6
- package/dist/{agent-DSec-E0c.d.ts → agent-DIu6FooJ.d.ts} +61 -6
- package/dist/{agent-VGD5WL4N.js → agent-HDEVVUBS.js} +7 -7
- package/dist/{agent-VGD5WL4N.js.map → agent-HDEVVUBS.js.map} +1 -1
- package/dist/{agent-NOEGF4GI.cjs → agent-R2HOJFZJ.cjs} +8 -8
- package/dist/{agent-NOEGF4GI.cjs.map → agent-R2HOJFZJ.cjs.map} +1 -1
- package/dist/{chunk-SSQZA3DZ.js → chunk-2BDH744Z.js} +3 -3
- package/dist/{chunk-SSQZA3DZ.js.map → chunk-2BDH744Z.js.map} +1 -1
- package/dist/chunk-6HTXPPHK.cjs +18 -0
- package/dist/{chunk-3KGLRRFC.cjs.map → chunk-6HTXPPHK.cjs.map} +1 -1
- package/dist/{chunk-UFAO4T7Z.cjs → chunk-F5WMX4EA.cjs} +114 -73
- package/dist/chunk-F5WMX4EA.cjs.map +1 -0
- package/dist/{chunk-UNDROG5N.cjs → chunk-HLPSLDGL.cjs} +94 -26
- package/dist/chunk-HLPSLDGL.cjs.map +1 -0
- package/dist/{chunk-TPTZA6NI.js → chunk-I5BE5M5L.js} +68 -27
- package/dist/chunk-I5BE5M5L.js.map +1 -0
- package/dist/{chunk-TTHBHAJI.cjs → chunk-ITSSOVOB.cjs} +4 -4
- package/dist/{chunk-TTHBHAJI.cjs.map → chunk-ITSSOVOB.cjs.map} +1 -1
- package/dist/{chunk-AGSBJD2L.js → chunk-IVNNSANC.js} +3 -3
- package/dist/{chunk-AGSBJD2L.js.map → chunk-IVNNSANC.js.map} +1 -1
- package/dist/{chunk-VDEWG5TV.js → chunk-MVAPK2BX.js} +77 -9
- package/dist/chunk-MVAPK2BX.js.map +1 -0
- package/dist/{chunk-RM7Y65IG.cjs → chunk-NIRE5CNO.cjs} +10 -3
- package/dist/{chunk-FXEUP75G.js.map → chunk-NIRE5CNO.cjs.map} +1 -1
- package/dist/{chunk-DUIF54UP.js → chunk-OHBIUXKM.js} +3 -3
- package/dist/{chunk-DUIF54UP.js.map → chunk-OHBIUXKM.js.map} +1 -1
- package/dist/{chunk-FXEUP75G.js → chunk-Q4CMI2LP.js} +9 -2
- package/dist/chunk-Q4CMI2LP.js.map +1 -0
- package/dist/{chunk-5BJV5UPY.cjs → chunk-V2UUGUY4.cjs} +3 -3
- package/dist/{chunk-5BJV5UPY.cjs.map → chunk-V2UUGUY4.cjs.map} +1 -1
- package/dist/{compact-session-K5LXTBPJ.js → compact-session-FUJDVF7B.js} +4 -4
- package/dist/{compact-session-K5LXTBPJ.js.map → compact-session-FUJDVF7B.js.map} +1 -1
- package/dist/{compact-session-YCT6JMBX.cjs → compact-session-LEWF554G.cjs} +12 -12
- package/dist/{compact-session-YCT6JMBX.cjs.map → compact-session-LEWF554G.cjs.map} +1 -1
- package/dist/{cron-DxxeQ-sK.d.cts → cron-BcWmzWzT.d.cts} +1 -1
- package/dist/{cron-CRwy2JBF.d.ts → cron-De6hzWCF.d.ts} +1 -1
- package/dist/cron.cjs +7 -7
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +6 -6
- package/dist/eval.cjs +6 -6
- package/dist/eval.js +5 -5
- package/dist/index.cjs +36 -36
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +8 -8
- package/dist/{inject-session-DDR6X6PC.js → inject-session-BJMJH5BX.js} +3 -3
- package/dist/{inject-session-DDR6X6PC.js.map → inject-session-BJMJH5BX.js.map} +1 -1
- package/dist/{inject-session-XLO3KTBM.cjs → inject-session-WQGGMCQY.cjs} +4 -4
- package/dist/{inject-session-XLO3KTBM.cjs.map → inject-session-WQGGMCQY.cjs.map} +1 -1
- package/dist/internal/llm/prompt-cache-key.d.ts +1 -0
- package/dist/internal/llm/responses.d.ts +67 -1
- package/dist/internal/llm/types.d.ts +15 -0
- package/dist/internal/local-agent/real-local-run-tools.d.ts +17 -6
- package/dist/models.cjs +9 -9
- package/dist/models.js +1 -1
- package/dist/providers.cjs +4 -4
- package/dist/providers.js +2 -2
- package/dist/subagents-loader.d.cts +1 -1
- package/dist/subagents-loader.d.ts +1 -1
- package/dist/types/agent.d.ts +47 -5
- package/dist/types/provider-profile.d.ts +13 -0
- package/docs/error-codes.md +19 -19
- package/docs/harness-capability-map.md +2 -1
- package/package.json +1 -1
- package/dist/chunk-3KGLRRFC.cjs +0 -18
- package/dist/chunk-RM7Y65IG.cjs.map +0 -1
- package/dist/chunk-TPTZA6NI.js.map +0 -1
- package/dist/chunk-UFAO4T7Z.cjs.map +0 -1
- package/dist/chunk-UNDROG5N.cjs.map +0 -1
- package/dist/chunk-VDEWG5TV.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkV2UUGUY4_cjs = require('./chunk-V2UUGUY4.cjs');
|
|
4
4
|
var chunk5UOVYM3P_cjs = require('./chunk-5UOVYM3P.cjs');
|
|
5
5
|
var chunk53CBTBWO_cjs = require('./chunk-53CBTBWO.cjs');
|
|
6
6
|
var chunkBV2MWEMV_cjs = require('./chunk-BV2MWEMV.cjs');
|
|
7
7
|
var chunkNGESVVJN_cjs = require('./chunk-NGESVVJN.cjs');
|
|
8
8
|
var chunkEI2Q7SJ5_cjs = require('./chunk-EI2Q7SJ5.cjs');
|
|
9
9
|
var chunkYPJ5NH5N_cjs = require('./chunk-YPJ5NH5N.cjs');
|
|
10
|
-
var
|
|
10
|
+
var chunkHLPSLDGL_cjs = require('./chunk-HLPSLDGL.cjs');
|
|
11
11
|
var chunk2ZPEDVLM_cjs = require('./chunk-2ZPEDVLM.cjs');
|
|
12
12
|
var chunkQ47R5E2X_cjs = require('./chunk-Q47R5E2X.cjs');
|
|
13
13
|
var chunkU2AC6JUP_cjs = require('./chunk-U2AC6JUP.cjs');
|
|
@@ -28,8 +28,8 @@ var chunkHJBMA5MB_cjs = require('./chunk-HJBMA5MB.cjs');
|
|
|
28
28
|
var chunkIWBGCBR6_cjs = require('./chunk-IWBGCBR6.cjs');
|
|
29
29
|
var chunkXSX2UU6Y_cjs = require('./chunk-XSX2UU6Y.cjs');
|
|
30
30
|
var chunk3EE6LVWT_cjs = require('./chunk-3EE6LVWT.cjs');
|
|
31
|
-
var
|
|
32
|
-
var
|
|
31
|
+
var chunk6HTXPPHK_cjs = require('./chunk-6HTXPPHK.cjs');
|
|
32
|
+
var chunkNIRE5CNO_cjs = require('./chunk-NIRE5CNO.cjs');
|
|
33
33
|
var chunkK3FW2XZD_cjs = require('./chunk-K3FW2XZD.cjs');
|
|
34
34
|
var chunkJTB5Q42C_cjs = require('./chunk-JTB5Q42C.cjs');
|
|
35
35
|
var chunkNUKRL3I6_cjs = require('./chunk-NUKRL3I6.cjs');
|
|
@@ -1607,7 +1607,7 @@ function createRealCloudRun(options) {
|
|
|
1607
1607
|
conversation: []
|
|
1608
1608
|
};
|
|
1609
1609
|
const apiKey = chunkJTB5Q42C_cjs.resolveApiKey(options.agentOptions.apiKey);
|
|
1610
|
-
const baseUrl =
|
|
1610
|
+
const baseUrl = chunkHLPSLDGL_cjs.getConfiguredBaseUrl();
|
|
1611
1611
|
const handle = new RealCloudRun(
|
|
1612
1612
|
{
|
|
1613
1613
|
id,
|
|
@@ -1690,7 +1690,7 @@ var RealCloudRun = class extends FixtureRunBase {
|
|
|
1690
1690
|
async consumeStream(response) {
|
|
1691
1691
|
let finalStatus = "finished";
|
|
1692
1692
|
let finalText = "";
|
|
1693
|
-
for await (const record of
|
|
1693
|
+
for await (const record of chunkHLPSLDGL_cjs.parseSseStream(response.body, this.controller.signal)) {
|
|
1694
1694
|
const parsed = safeParse(record.data);
|
|
1695
1695
|
if (parsed === void 0) continue;
|
|
1696
1696
|
const update = this.applyRecord(record.event, parsed);
|
|
@@ -1836,7 +1836,7 @@ var CloudAgent = class {
|
|
|
1836
1836
|
*/
|
|
1837
1837
|
isFixtureMode() {
|
|
1838
1838
|
const apiKey = chunkJTB5Q42C_cjs.resolveApiKey(this.options.apiKey);
|
|
1839
|
-
return
|
|
1839
|
+
return chunkHLPSLDGL_cjs.isFixtureApiKey(apiKey) && chunkHLPSLDGL_cjs.getConfiguredBaseUrl() === void 0;
|
|
1840
1840
|
}
|
|
1841
1841
|
// SE9 — integrated structured output; delegates to the shared helper.
|
|
1842
1842
|
generate(message, options) {
|
|
@@ -1888,7 +1888,7 @@ var CloudAgent = class {
|
|
|
1888
1888
|
const userText = typeof message === "string" ? message : message.text;
|
|
1889
1889
|
const systemPrompt = await this.resolveSystemPromptForSend(userText, options);
|
|
1890
1890
|
const apiKey = chunkJTB5Q42C_cjs.resolveApiKey(this.options.apiKey);
|
|
1891
|
-
const useRealRuntime = apiKey !== void 0 && !
|
|
1891
|
+
const useRealRuntime = apiKey !== void 0 && !chunkHLPSLDGL_cjs.isFixtureApiKey(apiKey) && chunkHLPSLDGL_cjs.getConfiguredBaseUrl() !== void 0;
|
|
1892
1892
|
return useRealRuntime ? createRealCloudRun({
|
|
1893
1893
|
agentId: this.agentId,
|
|
1894
1894
|
model: this.model ?? { id: DEFAULT_AGENTIC_MODEL_ID },
|
|
@@ -2697,11 +2697,14 @@ function buildContextBudgetEvent(model, resolved) {
|
|
|
2697
2697
|
}
|
|
2698
2698
|
|
|
2699
2699
|
// src/internal/runtime/lifecycle/post-run-lifecycle.ts
|
|
2700
|
+
function sessionTranscriptAllowed(memory) {
|
|
2701
|
+
return memory?.enabled !== false;
|
|
2702
|
+
}
|
|
2700
2703
|
function resolveWindowForRun(model, contextWindow) {
|
|
2701
2704
|
const override = contextWindow !== void 0 && contextWindow > 0 ? contextWindow : void 0;
|
|
2702
2705
|
return chunkXSX2UU6Y_cjs.resolveEffectiveContextWindow({
|
|
2703
2706
|
...override !== void 0 ? { override } : {},
|
|
2704
|
-
catalog:
|
|
2707
|
+
catalog: chunkNIRE5CNO_cjs.getCatalogModelInfo(model)?.limit?.context,
|
|
2705
2708
|
margin: chunkXSX2UU6Y_cjs.CONTEXT_WINDOW_MARGIN,
|
|
2706
2709
|
floor: chunkXSX2UU6Y_cjs.CONTEXT_WINDOW_FLOOR
|
|
2707
2710
|
});
|
|
@@ -2727,7 +2730,7 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2727
2730
|
try {
|
|
2728
2731
|
const partial = await safeConversation(run);
|
|
2729
2732
|
if (partial !== void 0) {
|
|
2730
|
-
|
|
2733
|
+
chunkV2UUGUY4_cjs.persistTurnToTranscript(sessionStore, { cwd: workspaceCwd, agentId, model }, agentId, {
|
|
2731
2734
|
userText,
|
|
2732
2735
|
conversation: partial
|
|
2733
2736
|
});
|
|
@@ -2737,11 +2740,11 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2737
2740
|
chunkNUKRL3I6_cjs.diag(`[theokit-sdk] partial transcript write failed (${agentId}): ${msg}
|
|
2738
2741
|
`);
|
|
2739
2742
|
}
|
|
2740
|
-
await
|
|
2743
|
+
await chunkV2UUGUY4_cjs.flushSessionWrites();
|
|
2741
2744
|
return;
|
|
2742
2745
|
}
|
|
2743
2746
|
if (result.result !== void 0) {
|
|
2744
|
-
|
|
2747
|
+
chunkV2UUGUY4_cjs.appendSessionMessage(agentId, { role: "assistant", text: result.result });
|
|
2745
2748
|
}
|
|
2746
2749
|
const conversation = await safeConversation(run);
|
|
2747
2750
|
const resolvedWindow = resolveWindowForRun(model, contextWindow);
|
|
@@ -2752,7 +2755,7 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2752
2755
|
}
|
|
2753
2756
|
const lastRequestUsage = result.usage?.requests?.at(-1)?.totalTokens;
|
|
2754
2757
|
const usageForTrigger = lastRequestUsage ?? result.usage?.totalTokens;
|
|
2755
|
-
|
|
2758
|
+
chunkV2UUGUY4_cjs.persistTurnToTranscript(
|
|
2756
2759
|
sessionStore,
|
|
2757
2760
|
{ cwd: workspaceCwd, agentId, model },
|
|
2758
2761
|
agentId,
|
|
@@ -2764,7 +2767,7 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2764
2767
|
// The EFFECTIVE window (after override, clamp and margin) — not the declared one. Swapping for
|
|
2765
2768
|
// `contextWindow` here would budget against a number the clamp already rejected.
|
|
2766
2769
|
contextWindow: effectiveWindow,
|
|
2767
|
-
summarize:
|
|
2770
|
+
summarize: chunkHLPSLDGL_cjs.buildDefaultSummarizer({
|
|
2768
2771
|
agentModel: model,
|
|
2769
2772
|
...inputs.apiKey !== void 0 ? { apiKey: inputs.apiKey } : {}
|
|
2770
2773
|
})
|
|
@@ -2772,7 +2775,7 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2772
2775
|
},
|
|
2773
2776
|
onRunEvent !== void 0 ? () => chunkNGESVVJN_cjs.emitRunEvent(onRunEvent, { type: "compact_boundary", trigger: "auto" }) : void 0
|
|
2774
2777
|
);
|
|
2775
|
-
if (result.status === "finished" && result.result !== void 0) {
|
|
2778
|
+
if (result.status === "finished" && result.result !== void 0 && sessionTranscriptAllowed(inputs.memory)) {
|
|
2776
2779
|
const summaryArgs = {
|
|
2777
2780
|
cwd: workspaceCwd,
|
|
2778
2781
|
runId: result.id,
|
|
@@ -2806,7 +2809,7 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2806
2809
|
agentId,
|
|
2807
2810
|
runId: result.id
|
|
2808
2811
|
});
|
|
2809
|
-
await
|
|
2812
|
+
await chunkV2UUGUY4_cjs.flushSessionWrites();
|
|
2810
2813
|
}
|
|
2811
2814
|
async function safeConversation(run) {
|
|
2812
2815
|
try {
|
|
@@ -3292,11 +3295,17 @@ function validateSubagents(agents2) {
|
|
|
3292
3295
|
}
|
|
3293
3296
|
}
|
|
3294
3297
|
var TOOL_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/;
|
|
3295
|
-
var
|
|
3296
|
-
|
|
3298
|
+
var BUILTIN_TOOL_NAMES = ["shell", "memory_search", "memory_get"];
|
|
3299
|
+
var RESERVED_TOOL_NAMES = new Set(BUILTIN_TOOL_NAMES);
|
|
3300
|
+
function reservedNamesFor(withheld) {
|
|
3301
|
+
if (withheld === void 0 || withheld.length === 0) return RESERVED_TOOL_NAMES;
|
|
3302
|
+
return new Set(BUILTIN_TOOL_NAMES.filter((name) => !withheld.includes(name)));
|
|
3303
|
+
}
|
|
3304
|
+
function validateToolCatalog(tools, withheldBuiltins) {
|
|
3305
|
+
const reserved = reservedNamesFor(withheldBuiltins);
|
|
3297
3306
|
const seen = /* @__PURE__ */ new Set();
|
|
3298
3307
|
for (const tool of tools) {
|
|
3299
|
-
validateSingleTool(tool);
|
|
3308
|
+
validateSingleTool(tool, reserved);
|
|
3300
3309
|
if (seen.has(tool.name)) {
|
|
3301
3310
|
throw new chunkK3FW2XZD_cjs.ConfigurationError(`Duplicate custom tool name "${tool.name}"`, {
|
|
3302
3311
|
code: "duplicate_tool_name"
|
|
@@ -3314,10 +3323,10 @@ function validateCustomTools(options) {
|
|
|
3314
3323
|
{ code: "cloud_custom_tools_rejected" }
|
|
3315
3324
|
);
|
|
3316
3325
|
}
|
|
3317
|
-
validateToolCatalog(tools);
|
|
3326
|
+
validateToolCatalog(tools, options.withheldBuiltinTools);
|
|
3318
3327
|
}
|
|
3319
|
-
function validateSingleTool(tool) {
|
|
3320
|
-
validateToolName(tool);
|
|
3328
|
+
function validateSingleTool(tool, reserved) {
|
|
3329
|
+
validateToolName(tool, reserved);
|
|
3321
3330
|
validateToolDescription(tool);
|
|
3322
3331
|
validateToolSchema(tool);
|
|
3323
3332
|
if (typeof tool.handler !== "function") {
|
|
@@ -3326,7 +3335,7 @@ function validateSingleTool(tool) {
|
|
|
3326
3335
|
});
|
|
3327
3336
|
}
|
|
3328
3337
|
}
|
|
3329
|
-
function validateToolName(tool) {
|
|
3338
|
+
function validateToolName(tool, reserved) {
|
|
3330
3339
|
if (typeof tool.name !== "string" || tool.name.length === 0) {
|
|
3331
3340
|
throw new chunkK3FW2XZD_cjs.ConfigurationError("Custom tool requires a non-empty name", {
|
|
3332
3341
|
code: "tool_missing_name"
|
|
@@ -3338,7 +3347,7 @@ function validateToolName(tool) {
|
|
|
3338
3347
|
{ code: "tool_invalid_name" }
|
|
3339
3348
|
);
|
|
3340
3349
|
}
|
|
3341
|
-
if (
|
|
3350
|
+
if (reserved.has(tool.name) || tool.name.startsWith("mcp_")) {
|
|
3342
3351
|
throw new chunkK3FW2XZD_cjs.ConfigurationError(
|
|
3343
3352
|
`Custom tool name "${tool.name}" collides with a reserved SDK tool name`,
|
|
3344
3353
|
{ code: "tool_reserved_name" }
|
|
@@ -3393,7 +3402,7 @@ var HISTOGRAM_NAMES = {
|
|
|
3393
3402
|
};
|
|
3394
3403
|
function safeRequire(moduleName) {
|
|
3395
3404
|
try {
|
|
3396
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
3405
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-F5WMX4EA.cjs', document.baseURI).href)));
|
|
3397
3406
|
return r(moduleName);
|
|
3398
3407
|
} catch {
|
|
3399
3408
|
return void 0;
|
|
@@ -3621,7 +3630,7 @@ var cachedOtel;
|
|
|
3621
3630
|
function loadOtel() {
|
|
3622
3631
|
if (cachedOtel === void 0) {
|
|
3623
3632
|
try {
|
|
3624
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
3633
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-F5WMX4EA.cjs', document.baseURI).href)));
|
|
3625
3634
|
const mod = r("@opentelemetry/api");
|
|
3626
3635
|
cachedOtel = mod;
|
|
3627
3636
|
} catch {
|
|
@@ -4851,8 +4860,10 @@ async function initLoopContext(inputs) {
|
|
|
4851
4860
|
memoryProviderHandle = void 0;
|
|
4852
4861
|
}
|
|
4853
4862
|
}
|
|
4854
|
-
const
|
|
4863
|
+
const withheld = new Set(inputs.withheldBuiltinTools ?? []);
|
|
4864
|
+
const tools = await collectTools(inputs.mcp, withheld, inputs.runEventSink);
|
|
4855
4865
|
for (const memTool of inputs.memoryTools ?? []) {
|
|
4866
|
+
if (withheld.has(memTool.name)) continue;
|
|
4856
4867
|
tools.push({
|
|
4857
4868
|
name: memTool.name,
|
|
4858
4869
|
description: memTool.description,
|
|
@@ -4878,6 +4889,7 @@ async function initLoopContext(inputs) {
|
|
|
4878
4889
|
providerTools = [];
|
|
4879
4890
|
}
|
|
4880
4891
|
for (const providerTool of providerTools) {
|
|
4892
|
+
if (withheld.has(providerTool.name)) continue;
|
|
4881
4893
|
tools.push({
|
|
4882
4894
|
name: providerTool.name,
|
|
4883
4895
|
description: providerTool.description,
|
|
@@ -4953,8 +4965,9 @@ async function safeListTools(client, serverName, sink) {
|
|
|
4953
4965
|
return [];
|
|
4954
4966
|
}
|
|
4955
4967
|
}
|
|
4956
|
-
|
|
4957
|
-
|
|
4968
|
+
function shellToolDescriptor(withheld) {
|
|
4969
|
+
if (withheld.has("shell")) return [];
|
|
4970
|
+
return [
|
|
4958
4971
|
{
|
|
4959
4972
|
name: "shell",
|
|
4960
4973
|
description: "Run a shell command in the workspace and return stdout/stderr.",
|
|
@@ -4966,6 +4979,9 @@ async function collectTools(mcp, sink) {
|
|
|
4966
4979
|
origin: "shell"
|
|
4967
4980
|
}
|
|
4968
4981
|
];
|
|
4982
|
+
}
|
|
4983
|
+
async function collectTools(mcp, withheld, sink) {
|
|
4984
|
+
const tools = shellToolDescriptor(withheld);
|
|
4969
4985
|
for (const [serverName, client] of mcp.entries()) {
|
|
4970
4986
|
const mcpTools = await safeListTools(client, serverName, sink);
|
|
4971
4987
|
for (const tool of mcpTools) {
|
|
@@ -4984,6 +5000,13 @@ async function collectTools(mcp, sink) {
|
|
|
4984
5000
|
function sanitize(name) {
|
|
4985
5001
|
return name.replace(/[^a-zA-Z0-9-]+/g, "_").replace(/^[_-]+|[_-]+$/g, "");
|
|
4986
5002
|
}
|
|
5003
|
+
var KEY_PREFIX = "theokit-";
|
|
5004
|
+
var KEY_HEX_LENGTH = 32;
|
|
5005
|
+
function derivePromptCacheKey(sessionId) {
|
|
5006
|
+
if (sessionId === void 0 || sessionId.trim().length === 0) return void 0;
|
|
5007
|
+
const digest = crypto.createHash("sha256").update(sessionId, "utf8").digest("hex");
|
|
5008
|
+
return `${KEY_PREFIX}${digest.slice(0, KEY_HEX_LENGTH)}`;
|
|
5009
|
+
}
|
|
4987
5010
|
|
|
4988
5011
|
// src/internal/tool-dispatch/strip-think.ts
|
|
4989
5012
|
var THINK_PATTERN = /<think>[\s\S]*?<\/think>\s*/g;
|
|
@@ -5055,6 +5078,16 @@ async function streamLlmTurn(inputs, ctx) {
|
|
|
5055
5078
|
// Step-cap force-close: forward the per-run tool gate (`"none"` on a ceiling round forces a
|
|
5056
5079
|
// text close even though tools are advertised). Absent ⇒ provider default (auto).
|
|
5057
5080
|
...inputs.toolChoice !== void 0 ? { toolChoice: inputs.toolChoice } : {},
|
|
5081
|
+
// usetheokit/theokit-sdk#383 — the prompt-cache key, derived HERE and from `inputs.agentId`
|
|
5082
|
+
// because this is the one place that sees the session identity on every round. `agentId` is
|
|
5083
|
+
// the run's session identity (`Agent.getOrCreate(sessionId)`), so the derived key is identical
|
|
5084
|
+
// on round 1 and round 12 of a turn, identical on turn 2 of the same session, and different
|
|
5085
|
+
// for a different session. Deriving it per round from a stable input is what makes it a cache
|
|
5086
|
+
// key; minting one anywhere that runs more than once per session would not be.
|
|
5087
|
+
...(() => {
|
|
5088
|
+
const key = derivePromptCacheKey(inputs.agentId);
|
|
5089
|
+
return key !== void 0 ? { promptCacheKey: key } : {};
|
|
5090
|
+
})(),
|
|
5058
5091
|
messages: ctx.messages,
|
|
5059
5092
|
tools: ctx.tools.map(toLlmTool)
|
|
5060
5093
|
},
|
|
@@ -5839,7 +5872,7 @@ function applyToolResultGuard(parts, opts) {
|
|
|
5839
5872
|
(p) => (
|
|
5840
5873
|
// SE7 — guard the TEXT of a tool result (string or the text blocks of a
|
|
5841
5874
|
// structured content); image blocks pass through untouched.
|
|
5842
|
-
p.type === "tool_result" ? { ...p, content:
|
|
5875
|
+
p.type === "tool_result" ? { ...p, content: chunkHLPSLDGL_cjs.renderToolResultContentText(p.content, (t) => guardText(t, opts)) } : p
|
|
5843
5876
|
)
|
|
5844
5877
|
);
|
|
5845
5878
|
}
|
|
@@ -6034,7 +6067,7 @@ function catalogCostFallback(provider, cleanedModel) {
|
|
|
6034
6067
|
const candidates = [`${provider}/${cleanedModel}`, cleanedModel];
|
|
6035
6068
|
if (stripped !== cleanedModel) candidates.push(`${provider}/${stripped}`, stripped);
|
|
6036
6069
|
for (const key of candidates) {
|
|
6037
|
-
const info =
|
|
6070
|
+
const info = chunkNIRE5CNO_cjs.getCatalogModelInfo(key);
|
|
6038
6071
|
const cost = info?.cost;
|
|
6039
6072
|
if (cost === void 0) continue;
|
|
6040
6073
|
const [prov, ...modelParts] = key.split("/");
|
|
@@ -6046,7 +6079,7 @@ function catalogCostFallback(provider, cleanedModel) {
|
|
|
6046
6079
|
...cost.cache_read !== void 0 ? { cacheReadCostPerMillion: cost.cache_read } : {},
|
|
6047
6080
|
...cost.cache_write !== void 0 ? { cacheWriteCostPerMillion: cost.cache_write } : {},
|
|
6048
6081
|
// M44 M5 fix — honest provenance: a key patched by the LIVE models-dev source is not "vendored".
|
|
6049
|
-
pricingVersion:
|
|
6082
|
+
pricingVersion: chunkNIRE5CNO_cjs.isPatchedModelKey(key) ? "catalog-models-dev" : "catalog-vendored"
|
|
6050
6083
|
};
|
|
6051
6084
|
}
|
|
6052
6085
|
return void 0;
|
|
@@ -6505,12 +6538,12 @@ var FallbackLlmClient = class {
|
|
|
6505
6538
|
let lastError;
|
|
6506
6539
|
for (const client of this.clients) {
|
|
6507
6540
|
if (signal.aborted) throw abortError(signal);
|
|
6508
|
-
const attempt = await
|
|
6541
|
+
const attempt = await chunkHLPSLDGL_cjs.tryFirstEvent(client, request, signal, true);
|
|
6509
6542
|
if (attempt.kind === "handshake_error") {
|
|
6510
6543
|
lastError = attempt.error;
|
|
6511
6544
|
continue;
|
|
6512
6545
|
}
|
|
6513
|
-
return yield*
|
|
6546
|
+
return yield* chunkHLPSLDGL_cjs.relayStream(attempt.generator, attempt.firstResult);
|
|
6514
6547
|
}
|
|
6515
6548
|
if (lastError !== void 0) throw lastError;
|
|
6516
6549
|
throw new chunkK3FW2XZD_cjs.NetworkError("FallbackLlmClient has no providers configured", {
|
|
@@ -6891,7 +6924,7 @@ function resolveMcpCwd(configCwd) {
|
|
|
6891
6924
|
function registerPluginProviderProfiles(entries) {
|
|
6892
6925
|
let registered2 = 0;
|
|
6893
6926
|
for (const entry of entries) {
|
|
6894
|
-
|
|
6927
|
+
chunkNIRE5CNO_cjs.registerProvider(entry.profile);
|
|
6895
6928
|
registered2 += 1;
|
|
6896
6929
|
}
|
|
6897
6930
|
return registered2;
|
|
@@ -7025,14 +7058,20 @@ function resolveInheritedCredentials(agentOptions) {
|
|
|
7025
7058
|
...parentSandbox !== void 0 ? { sandbox: parentSandbox } : {}
|
|
7026
7059
|
};
|
|
7027
7060
|
}
|
|
7028
|
-
function
|
|
7061
|
+
function withheldBuiltinsInput(agentOptions) {
|
|
7062
|
+
const withheld = agentOptions.withheldBuiltinTools;
|
|
7063
|
+
if (withheld === void 0 || withheld.length === 0) return {};
|
|
7064
|
+
return { withheldBuiltinTools: withheld };
|
|
7065
|
+
}
|
|
7066
|
+
function buildRunToolCatalogInput(agentOptions, sendOptions, pluginManager, personalityToolWhitelist, agentId, personalityName, subagents, effectiveModel) {
|
|
7067
|
+
const builtins = withheldBuiltinsInput(agentOptions);
|
|
7029
7068
|
const baseTools = sendOptions?.tools ?? agentOptions.tools ?? [];
|
|
7030
7069
|
const agentsForTools = subagents !== void 0 && Object.keys(subagents).length > 0 ? subagents : agentOptions.agents;
|
|
7031
7070
|
const subagentTools = declarativeSubagentTools(agentsForTools, baseTools);
|
|
7032
7071
|
const pluginTools = pluginManager?.aggregated.tools ?? [];
|
|
7033
7072
|
const reasoningTools = reasoningActive(agentOptions.reasoning, effectiveModel) ? [createThinkTool()] : [];
|
|
7034
7073
|
if (baseTools.length === 0 && subagentTools.length === 0 && pluginTools.length === 0 && reasoningTools.length === 0) {
|
|
7035
|
-
return
|
|
7074
|
+
return builtins;
|
|
7036
7075
|
}
|
|
7037
7076
|
const allTools = [...baseTools, ...subagentTools, ...pluginTools, ...reasoningTools];
|
|
7038
7077
|
const merged = allTools.map((tool) => ({
|
|
@@ -7045,8 +7084,8 @@ function buildCustomToolsInput(agentOptions, sendOptions, pluginManager, persona
|
|
|
7045
7084
|
agentId,
|
|
7046
7085
|
personalityName
|
|
7047
7086
|
});
|
|
7048
|
-
if (customTools.length === 0 && personalityToolWhitelist === void 0) return
|
|
7049
|
-
return { customTools };
|
|
7087
|
+
if (customTools.length === 0 && personalityToolWhitelist === void 0) return builtins;
|
|
7088
|
+
return { customTools, ...builtins };
|
|
7050
7089
|
}
|
|
7051
7090
|
|
|
7052
7091
|
// src/internal/local-agent/real-local-run.ts
|
|
@@ -7080,7 +7119,7 @@ function createRealLocalRun(options) {
|
|
|
7080
7119
|
}
|
|
7081
7120
|
var pluginProvidersAnnounced = false;
|
|
7082
7121
|
function resolveRunProvider(options) {
|
|
7083
|
-
|
|
7122
|
+
chunkNIRE5CNO_cjs.registerBuiltins();
|
|
7084
7123
|
const profiles = options.pluginManager?.aggregated.providerProfiles ?? [];
|
|
7085
7124
|
const registered2 = registerPluginProviderProfiles(profiles);
|
|
7086
7125
|
if (registered2 > 0 && !pluginProvidersAnnounced) {
|
|
@@ -7090,16 +7129,16 @@ function resolveRunProvider(options) {
|
|
|
7090
7129
|
`);
|
|
7091
7130
|
}
|
|
7092
7131
|
const parsedModel = chunk3EE6LVWT_cjs.parseModelId(options.model?.id);
|
|
7093
|
-
const modelInferredProvider = parsedModel.provider !== void 0 &&
|
|
7094
|
-
const keyInferredProvider =
|
|
7095
|
-
const primary = options.agentOptions.providers?.routes?.[0]?.provider ?? keyInferredProvider ?? modelInferredProvider ??
|
|
7096
|
-
|
|
7132
|
+
const modelInferredProvider = parsedModel.provider !== void 0 && chunkNIRE5CNO_cjs.getProviderProfile(parsedModel.provider) !== void 0 ? parsedModel.provider : void 0;
|
|
7133
|
+
const keyInferredProvider = chunkHLPSLDGL_cjs.inferProviderFromApiKey(options.agentOptions.apiKey);
|
|
7134
|
+
const primary = options.agentOptions.providers?.routes?.[0]?.provider ?? keyInferredProvider ?? modelInferredProvider ?? chunkHLPSLDGL_cjs.detectPrimaryProvider();
|
|
7135
|
+
chunkHLPSLDGL_cjs.warnProviderPrecedenceOnce(modelInferredProvider, primary);
|
|
7097
7136
|
const effectiveModelId = modelInferredProvider !== void 0 && modelInferredProvider === primary ? parsedModel.name : options.model?.id ?? "claude-sonnet-4-6";
|
|
7098
7137
|
return { primary, effectiveModelId };
|
|
7099
7138
|
}
|
|
7100
7139
|
function mergeExplicitApiKey(pools, primary, apiKey) {
|
|
7101
7140
|
if (apiKey === void 0 || apiKey.length === 0) return pools;
|
|
7102
|
-
if (
|
|
7141
|
+
if (chunkHLPSLDGL_cjs.isFixtureApiKey(apiKey) || apiKey === LOCAL_RUNTIME_MOCK_KEY) return pools;
|
|
7103
7142
|
const existing = pools?.[primary];
|
|
7104
7143
|
if (existing !== void 0 && existing.length > 0) return pools;
|
|
7105
7144
|
return { ...pools ?? {}, [primary]: [apiKey] };
|
|
@@ -7123,7 +7162,7 @@ function buildLoopInputs(options, runId, userText, userImages) {
|
|
|
7123
7162
|
const extractToolCallsFromContent = options.agentOptions.providers?.routes?.[0]?.extractToolCallsFromContent;
|
|
7124
7163
|
const rateLimitSink = options.sendOptions.onRunEvent;
|
|
7125
7164
|
const modelBaseUrl = options.model?.url;
|
|
7126
|
-
const chain =
|
|
7165
|
+
const chain = chunkHLPSLDGL_cjs.resolveProviderChain({
|
|
7127
7166
|
primary,
|
|
7128
7167
|
...modelBaseUrl !== void 0 ? { baseUrl: modelBaseUrl } : {},
|
|
7129
7168
|
...fallback !== void 0 ? { fallback } : {},
|
|
@@ -7162,7 +7201,7 @@ function buildLoopInputs(options, runId, userText, userImages) {
|
|
|
7162
7201
|
} : {},
|
|
7163
7202
|
...options.priorMessages !== void 0 ? { priorMessages: options.priorMessages } : {},
|
|
7164
7203
|
...options.memoryTools !== void 0 && options.memoryTools.length > 0 ? { memoryTools: options.memoryTools } : {},
|
|
7165
|
-
...
|
|
7204
|
+
...buildRunToolCatalogInput(
|
|
7166
7205
|
options.agentOptions,
|
|
7167
7206
|
options.sendOptions,
|
|
7168
7207
|
options.pluginManager,
|
|
@@ -7406,7 +7445,7 @@ function buildRealRunOptions(args) {
|
|
|
7406
7445
|
};
|
|
7407
7446
|
}
|
|
7408
7447
|
async function createFixtureRunHelper(args) {
|
|
7409
|
-
const sessionMessages =
|
|
7448
|
+
const sessionMessages = chunkV2UUGUY4_cjs.getSessionMessages(args.inputs.agentId);
|
|
7410
7449
|
const projectMcpServers = args.inputs.settingSourcesIncludeProject ? await readProjectMcpServers(args.inputs.workspaceCwd) : {};
|
|
7411
7450
|
return createLocalRun({
|
|
7412
7451
|
agentId: args.inputs.agentId,
|
|
@@ -7425,7 +7464,7 @@ async function createFixtureRunHelper(args) {
|
|
|
7425
7464
|
}
|
|
7426
7465
|
async function dispatchLocalRun(args) {
|
|
7427
7466
|
const apiKey = chunkJTB5Q42C_cjs.resolveApiKey(args.inputs.options.apiKey);
|
|
7428
|
-
if (
|
|
7467
|
+
if (chunkHLPSLDGL_cjs.shouldUseRealLocalRuntime(apiKey)) {
|
|
7429
7468
|
return createRealLocalRun(
|
|
7430
7469
|
buildRealRunOptions({
|
|
7431
7470
|
inputs: args.inputs,
|
|
@@ -7681,10 +7720,10 @@ async function disposeLocalAgentSession(agent) {
|
|
|
7681
7720
|
agent.lifecycleAbortController.abort();
|
|
7682
7721
|
await chunkZF2LDKQQ_cjs.withCwdMutex(`agent-send:${agent.agentId}`, () => Promise.resolve());
|
|
7683
7722
|
disposeSessionMcpClients(agent.agentId);
|
|
7684
|
-
await
|
|
7723
|
+
await chunkV2UUGUY4_cjs.flushSessionWrites();
|
|
7685
7724
|
await flushRegistrySaves(agent.workspaceCwd);
|
|
7686
7725
|
await disposeSessionStore(agent.sessionStore);
|
|
7687
|
-
|
|
7726
|
+
chunkV2UUGUY4_cjs.discardSession(agent.workspaceCwd, agent.agentId);
|
|
7688
7727
|
}
|
|
7689
7728
|
async function reloadLocalAgent(agent) {
|
|
7690
7729
|
if (agent.context !== void 0) await agent.context.refresh();
|
|
@@ -8458,7 +8497,7 @@ var LocalAgentMemory = class {
|
|
|
8458
8497
|
async runActiveMemoryIfEnabled(userText, priorMessages, telemetry) {
|
|
8459
8498
|
const cfg = this.options.memory?.activeRecall;
|
|
8460
8499
|
if (cfg?.enabled !== true || this.index === void 0) return void 0;
|
|
8461
|
-
if (this.breaker === void 0) this.breaker = new
|
|
8500
|
+
if (this.breaker === void 0) this.breaker = new chunkHLPSLDGL_cjs.CircuitBreaker();
|
|
8462
8501
|
if (this.cache === void 0) this.cache = new ActiveMemoryCache();
|
|
8463
8502
|
const result = await runActiveMemory({
|
|
8464
8503
|
userText,
|
|
@@ -8871,8 +8910,8 @@ async function localAgentUsePersonality(args) {
|
|
|
8871
8910
|
registry,
|
|
8872
8911
|
store: args.personalityStore,
|
|
8873
8912
|
invalidateCache: (reason) => args.invalidateCache(reason),
|
|
8874
|
-
appendSessionMessage: (msg) =>
|
|
8875
|
-
clearSession: () =>
|
|
8913
|
+
appendSessionMessage: (msg) => chunkV2UUGUY4_cjs.appendSessionMessage(args.agentId, msg),
|
|
8914
|
+
clearSession: () => chunkV2UUGUY4_cjs.clearSession(args.agentId),
|
|
8876
8915
|
opts: args.opts ?? {}
|
|
8877
8916
|
})
|
|
8878
8917
|
);
|
|
@@ -9241,7 +9280,7 @@ async function executeSendLocked(inputs, message, options) {
|
|
|
9241
9280
|
if (inputs.options.onBeforeSend !== void 0) {
|
|
9242
9281
|
await inputs.options.onBeforeSend({
|
|
9243
9282
|
conversationId: inputs.agentId,
|
|
9244
|
-
previousMessageCount:
|
|
9283
|
+
previousMessageCount: chunkV2UUGUY4_cjs.getSessionMessages(inputs.agentId).length
|
|
9245
9284
|
});
|
|
9246
9285
|
}
|
|
9247
9286
|
await inputs.runPreHook(userText);
|
|
@@ -9253,8 +9292,8 @@ async function executeSendLocked(inputs, message, options) {
|
|
|
9253
9292
|
userText,
|
|
9254
9293
|
sendOptions: options
|
|
9255
9294
|
});
|
|
9256
|
-
const priorMessages = [...
|
|
9257
|
-
|
|
9295
|
+
const priorMessages = [...chunkV2UUGUY4_cjs.getSessionMessages(inputs.agentId)];
|
|
9296
|
+
chunkV2UUGUY4_cjs.appendSessionMessage(inputs.agentId, { role: "user", text: userText });
|
|
9258
9297
|
await persistMemoryFactIfWritePrompt(inputs.workspaceCwd, inputs.options.memory, userText);
|
|
9259
9298
|
const memoryFacts = await readMemoryForSend(inputs.workspaceCwd, inputs.options.memory);
|
|
9260
9299
|
const portPathActive = shouldUsePortMemoryPath();
|
|
@@ -9467,7 +9506,7 @@ var LocalAgent = class {
|
|
|
9467
9506
|
);
|
|
9468
9507
|
await acquireLeaseIfPossible(this.sessionStore, this.agentId);
|
|
9469
9508
|
try {
|
|
9470
|
-
await
|
|
9509
|
+
await chunkV2UUGUY4_cjs.hydrateSession(this.agentId, { store: this.sessionStore, cwd: this.workspaceCwd });
|
|
9471
9510
|
await this.personalityStore.hydrate(this.agentId);
|
|
9472
9511
|
} catch (err) {
|
|
9473
9512
|
await releaseLeaseIfPossible(this.sessionStore, this.agentId);
|
|
@@ -9489,7 +9528,7 @@ var LocalAgent = class {
|
|
|
9489
9528
|
}
|
|
9490
9529
|
async send(message, options = {}) {
|
|
9491
9530
|
if (options.tools !== void 0 && options.tools.length > 0) {
|
|
9492
|
-
validateToolCatalog(options.tools);
|
|
9531
|
+
validateToolCatalog(options.tools, this.options.withheldBuiltinTools);
|
|
9493
9532
|
}
|
|
9494
9533
|
const sendSpan = this._telemetry.startSpan(SPAN_NAMES.AGENT_SEND, {
|
|
9495
9534
|
agentId: this.agentId,
|
|
@@ -9547,6 +9586,8 @@ var LocalAgent = class {
|
|
|
9547
9586
|
...options.onRunEvent !== void 0 ? { onRunEvent: options.onRunEvent } : {},
|
|
9548
9587
|
hooksExecutor: this.hooksExecutor,
|
|
9549
9588
|
memoryGlue: this.memoryGlue,
|
|
9589
|
+
// usetheokit/theokit-sdk#382 — the transcript write reads this and nothing else.
|
|
9590
|
+
memory: this.options.memory,
|
|
9550
9591
|
...postRunProvider !== void 0 ? { memoryProvider: postRunProvider } : {}
|
|
9551
9592
|
});
|
|
9552
9593
|
} finally {
|
|
@@ -9793,15 +9834,15 @@ async function maybeInjectHandoffTools(options) {
|
|
|
9793
9834
|
};
|
|
9794
9835
|
}
|
|
9795
9836
|
function keyWillFlowToProvider(apiKey, provider) {
|
|
9796
|
-
if (
|
|
9797
|
-
if (
|
|
9837
|
+
if (chunkHLPSLDGL_cjs.isFixtureApiKey(apiKey)) return false;
|
|
9838
|
+
if (chunkHLPSLDGL_cjs.getConfiguredBaseUrl() !== void 0) return false;
|
|
9798
9839
|
if (provider === void 0) return false;
|
|
9799
|
-
const profile =
|
|
9840
|
+
const profile = chunk6HTXPPHK_cjs.getProviderProfile(provider);
|
|
9800
9841
|
if (profile === void 0) return false;
|
|
9801
9842
|
return profile.authType !== "none";
|
|
9802
9843
|
}
|
|
9803
9844
|
function missingApiKeyMessage() {
|
|
9804
|
-
const present =
|
|
9845
|
+
const present = chunkHLPSLDGL_cjs.presentProviderCredentialEnvVars();
|
|
9805
9846
|
const base = `Missing API key \u2014 set ${chunkJTB5Q42C_cjs.API_KEY_ENV_VAR}, or pass \`apiKey\` to Agent.create()`;
|
|
9806
9847
|
if (present.length === 0) return `${base}.`;
|
|
9807
9848
|
return `${base}. ${present.join(" and ")} ${present.length === 1 ? "is" : "are"} set, but a provider credential is not read from the environment automatically \u2014 pass it explicitly, e.g. \`Agent.create({ apiKey: process.env.${present[0]}, ... })\`.`;
|
|
@@ -9838,11 +9879,11 @@ async function createCloudAgent(options) {
|
|
|
9838
9879
|
if (shape.malformed) {
|
|
9839
9880
|
throw new chunkK3FW2XZD_cjs.AuthenticationError(shape.message, { code: "malformed_api_key" });
|
|
9840
9881
|
}
|
|
9841
|
-
const baseUrl =
|
|
9882
|
+
const baseUrl = chunkHLPSLDGL_cjs.getConfiguredBaseUrl();
|
|
9842
9883
|
if (baseUrl === void 0) {
|
|
9843
9884
|
return new CloudAgent(options);
|
|
9844
9885
|
}
|
|
9845
|
-
const response = await
|
|
9886
|
+
const response = await chunkHLPSLDGL_cjs.httpRequest("/v1/agents", {
|
|
9846
9887
|
apiKey,
|
|
9847
9888
|
method: "POST",
|
|
9848
9889
|
body: {
|
|
@@ -9867,7 +9908,7 @@ function resolveAgentPersistenceCwd(options) {
|
|
|
9867
9908
|
return process.cwd();
|
|
9868
9909
|
}
|
|
9869
9910
|
async function rehydrateExistingAgent(agentId, existing, options) {
|
|
9870
|
-
await
|
|
9911
|
+
await chunkHLPSLDGL_cjs.discoverProviderPlugins();
|
|
9871
9912
|
await validateRehydratedAgent(agentId, existing);
|
|
9872
9913
|
const mergedLocal = options.local !== void 0 && existing.options.local !== void 0 ? { ...existing.options.local, ...options.local } : options.local ?? existing.options.local;
|
|
9873
9914
|
const mergedOptions = {
|
|
@@ -10011,7 +10052,7 @@ var Agent = class _Agent {
|
|
|
10011
10052
|
pluginCount: enabledPluginNames(options.plugins).length
|
|
10012
10053
|
});
|
|
10013
10054
|
try {
|
|
10014
|
-
await
|
|
10055
|
+
await chunkHLPSLDGL_cjs.discoverProviderPlugins();
|
|
10015
10056
|
const agent = await runCreateUnderSpan(options, span);
|
|
10016
10057
|
return agent;
|
|
10017
10058
|
} catch (err) {
|
|
@@ -10318,9 +10359,9 @@ var Agent = class _Agent {
|
|
|
10318
10359
|
`No local agent "${agentId}" registered \u2014 compact targets local sessions.`
|
|
10319
10360
|
);
|
|
10320
10361
|
}
|
|
10321
|
-
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-
|
|
10362
|
+
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-LEWF554G.cjs');
|
|
10322
10363
|
const { cwd, model, store } = await openLocalStore(reg);
|
|
10323
|
-
return
|
|
10364
|
+
return chunkV2UUGUY4_cjs.enqueueSessionWrite(
|
|
10324
10365
|
cwd,
|
|
10325
10366
|
agentId,
|
|
10326
10367
|
() => compactSessionTranscript({
|
|
@@ -10354,7 +10395,7 @@ var Agent = class _Agent {
|
|
|
10354
10395
|
`No local agent "${agentId}" registered \u2014 injectSessionTurn targets local sessions.`
|
|
10355
10396
|
);
|
|
10356
10397
|
}
|
|
10357
|
-
const { injectSessionTurn } = await import('./inject-session-
|
|
10398
|
+
const { injectSessionTurn } = await import('./inject-session-WQGGMCQY.cjs');
|
|
10358
10399
|
const { cwd, model, store } = await openLocalStore(reg);
|
|
10359
10400
|
await injectSessionTurn({
|
|
10360
10401
|
store,
|
|
@@ -10429,7 +10470,7 @@ var Agent = class _Agent {
|
|
|
10429
10470
|
//
|
|
10430
10471
|
// Honest limit, stated because the alternative is an implied claim: `tools` is still the
|
|
10431
10472
|
// DECLARED catalog. Plugin tools and the reasoning `think` tool are assembled per run by
|
|
10432
|
-
// `
|
|
10473
|
+
// `buildRunToolCatalogInput`, so they are not knowable from the registry alone. Documented on
|
|
10433
10474
|
// `AgentDescription.tools`.
|
|
10434
10475
|
tools: (agent.options.tools ?? []).map((tool) => ({
|
|
10435
10476
|
name: tool.name,
|
|
@@ -10499,5 +10540,5 @@ exports.computeCost = computeCost;
|
|
|
10499
10540
|
exports.generateCronId = generateCronId;
|
|
10500
10541
|
exports.getPricingEntry = getPricingEntry;
|
|
10501
10542
|
exports.openRouterMemoryEmbeddingProviderAdapter = openRouterMemoryEmbeddingProviderAdapter;
|
|
10502
|
-
//# sourceMappingURL=chunk-
|
|
10503
|
-
//# sourceMappingURL=chunk-
|
|
10543
|
+
//# sourceMappingURL=chunk-F5WMX4EA.cjs.map
|
|
10544
|
+
//# sourceMappingURL=chunk-F5WMX4EA.cjs.map
|