@theokit/sdk 5.10.0 → 5.11.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 +59 -0
- package/dist/{agent-TLRURB7W.cjs → agent-5DOR5T3E.cjs} +7 -6
- package/dist/{agent-TLRURB7W.cjs.map → agent-5DOR5T3E.cjs.map} +1 -1
- package/dist/{agent-XTLAVVYC.js → agent-GWKRARAL.js} +6 -5
- package/dist/{agent-XTLAVVYC.js.map → agent-GWKRARAL.js.map} +1 -1
- package/dist/{chunk-RTE2DD4S.js → chunk-4PHSVR2R.js} +50 -32
- package/dist/chunk-4PHSVR2R.js.map +1 -0
- package/dist/{chunk-PCLRIQPX.cjs → chunk-5H2GJXGC.cjs} +4 -4
- package/dist/{chunk-PCLRIQPX.cjs.map → chunk-5H2GJXGC.cjs.map} +1 -1
- package/dist/{chunk-CVEQ5366.cjs → chunk-5OHB5HJF.cjs} +90 -72
- package/dist/chunk-5OHB5HJF.cjs.map +1 -0
- package/dist/{chunk-EVH3OUMY.js → chunk-74OA5DIM.js} +189 -43
- package/dist/chunk-74OA5DIM.js.map +1 -0
- package/dist/{chunk-EXI7EHDN.js → chunk-7Y23B7XX.js} +3 -3
- package/dist/{chunk-EXI7EHDN.js.map → chunk-7Y23B7XX.js.map} +1 -1
- package/dist/{chunk-QY3CIMUV.cjs → chunk-BZKF7TXX.cjs} +192 -44
- package/dist/chunk-BZKF7TXX.cjs.map +1 -0
- package/dist/chunk-LZJXEPEQ.js +58 -0
- package/dist/chunk-LZJXEPEQ.js.map +1 -0
- package/dist/{chunk-FR6COQXZ.cjs → chunk-N7ZIPW2N.cjs} +3 -3
- package/dist/{chunk-FR6COQXZ.cjs.map → chunk-N7ZIPW2N.cjs.map} +1 -1
- package/dist/chunk-NWS2CS3Y.cjs +61 -0
- package/dist/chunk-NWS2CS3Y.cjs.map +1 -0
- package/dist/{chunk-523O5UYB.js → chunk-Z5BAFHPU.js} +3 -3
- package/dist/{chunk-523O5UYB.js.map → chunk-Z5BAFHPU.js.map} +1 -1
- package/dist/{compact-session-4QHBBGEY.cjs → compact-session-2AETONOS.cjs} +12 -12
- package/dist/{compact-session-4QHBBGEY.cjs.map → compact-session-2AETONOS.cjs.map} +1 -1
- package/dist/{compact-session-PVAWTKKL.js → compact-session-F2UDGZCN.js} +3 -3
- package/dist/{compact-session-PVAWTKKL.js.map → compact-session-F2UDGZCN.js.map} +1 -1
- package/dist/cron.cjs +6 -5
- package/dist/cron.js +5 -4
- package/dist/eval.cjs +5 -4
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +4 -3
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +38 -128
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -104
- package/dist/index.js.map +1 -1
- package/dist/{inject-session-O24XGRR6.js → inject-session-E5UDFVLI.js} +3 -3
- package/dist/{inject-session-O24XGRR6.js.map → inject-session-E5UDFVLI.js.map} +1 -1
- package/dist/{inject-session-OMLFL2V3.cjs → inject-session-W4UKACYJ.cjs} +4 -4
- package/dist/{inject-session-OMLFL2V3.cjs.map → inject-session-W4UKACYJ.cjs.map} +1 -1
- package/dist/internal/budget/normalize-usage.d.ts +81 -0
- package/dist/internal/llm/anthropic-shared.d.ts +6 -0
- package/dist/internal/llm/openai.d.ts +3 -5
- package/dist/internal/llm/openrouter-system.d.ts +1 -0
- package/dist/internal/llm/types.d.ts +10 -5
- package/dist/models.cjs +5 -50
- package/dist/models.cjs.map +1 -1
- package/dist/models.js +3 -51
- package/dist/models.js.map +1 -1
- package/docs/error-codes.md +3 -2
- package/package.json +1 -1
- package/dist/chunk-CVEQ5366.cjs.map +0 -1
- package/dist/chunk-EVH3OUMY.js.map +0 -1
- package/dist/chunk-QY3CIMUV.cjs.map +0 -1
- package/dist/chunk-RTE2DD4S.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#734](https://github.com/usetheokit/theokit-sdk/pull/734) [`1f04344`](https://github.com/usetheokit/theokit-sdk/commit/1f0434491b706f7ea97f53d998fc33b300af1c33) Thanks [@usetheodev](https://github.com/usetheodev)! - Prompt caching now turns on for Anthropic models, and the cache counters they report reach the
|
|
8
|
+
turn's usage.
|
|
9
|
+
|
|
10
|
+
For a model id that starts with `anthropic/` or `claude` (after an optional `openrouter/`,
|
|
11
|
+
`vertex/` or `bedrock/` prefix),
|
|
12
|
+
the agent loop sends the system prompt as text blocks: the configured prompt first, marked with
|
|
13
|
+
`cache_control: { type: "ephemeral" }`, then the `<active-memory>` block when memory adds one. The
|
|
14
|
+
Anthropic client sends the blocks as they are, and the OpenRouter client sends them as `content`
|
|
15
|
+
parts of the `system` message, with `cache_control` on the cacheable part. Every other provider
|
|
16
|
+
still receives one string. Bedrock ids (`anthropic.claude-…`) are not matched,
|
|
17
|
+
and their bodies do not change. Vertex Anthropic ids (`vertex/anthropic/claude-…`) are matched
|
|
18
|
+
and get the same blocks; no live Vertex response was measured for this change.
|
|
19
|
+
|
|
20
|
+
Things a caller can observe:
|
|
21
|
+
|
|
22
|
+
- **Billing.** Anthropic charges cache writes at 1.25 times the input price and cache reads at 0.1
|
|
23
|
+
times. A run with a single turn whose system prompt is above the model's caching minimum pays
|
|
24
|
+
the write premium and never reads the prefix back.
|
|
25
|
+
- **Order.** For these models the memory block now comes after the configured prompt instead of
|
|
26
|
+
before it. On a client that joins the blocks into one string, the text is the same and the order
|
|
27
|
+
is reversed.
|
|
28
|
+
- **What still misses the cache.** The cached prefix is the whole assembled prompt, so `<memory>`
|
|
29
|
+
facts, resolved skills or context that change between turns change block 1 and miss.
|
|
30
|
+
- **Counters.** The Anthropic streaming client reads `cache_read_input_tokens` and
|
|
31
|
+
`cache_creation_input_tokens` from `message_start`, where Anthropic reports them; a value in
|
|
32
|
+
`message_delta` still wins when it is above zero, and a zero there leaves the `message_start`
|
|
33
|
+
value in place. The non-streaming parser shared by the Bedrock and Vertex Anthropic clients now
|
|
34
|
+
returns both counters too.
|
|
35
|
+
- **Cost on the chat-completions client.** `prompt_tokens` there already includes the cached
|
|
36
|
+
slice, and the client used to report it whole as `inputTokens` beside `cacheReadTokens`, so the
|
|
37
|
+
estimated cost charged every cached token twice (about 8 times too high on a cached
|
|
38
|
+
OpenRouter Anthropic turn). `inputTokens` is now the uncached portion, as on the Anthropic
|
|
39
|
+
client, and `prompt_tokens_details.cache_write_tokens` is read into `cacheWriteTokens`. A
|
|
40
|
+
native OpenAI chat-completions run with a cache hit reports a lower `inputTokens` and a lower
|
|
41
|
+
cost than before. When a usage object carries both the nested `prompt_tokens_details` counts and the
|
|
42
|
+
Anthropic-style top-level ones, the nested count wins and a top-level count fills a nested
|
|
43
|
+
zero, the rule `normalizeUsage` already applied; the stream client used to let the top-level
|
|
44
|
+
field win.
|
|
45
|
+
- **Budget trackers.** A `BudgetTracker`'s `input` event now carries the whole prompt:
|
|
46
|
+
`inputTokens` plus `cacheReadTokens` and `cacheWriteTokens`. On the chat-completions client this
|
|
47
|
+
keeps the count a tracker saw before `inputTokens` became the uncached portion. On the Anthropic
|
|
48
|
+
clients, which always reported the uncached portion, a cached turn now counts its cached tokens
|
|
49
|
+
against `maxTokens`, and `createUsdBudgetTracker` prices them at the input rate, so a cost cap
|
|
50
|
+
trips earlier than the provider's bill would.
|
|
51
|
+
- **Input tokens on the Anthropic stream.** `input_tokens` is read from `message_start` too, so a
|
|
52
|
+
stream whose `message_delta` carries only `output_tokens` reports its uncached input instead of
|
|
53
|
+
none. A value above zero in `message_delta` still replaces it; a `null` or a zero there leaves
|
|
54
|
+
the `message_start` count.
|
|
55
|
+
- **Malformed Anthropic frames.** A `content_block_start`, `content_block_delta` or
|
|
56
|
+
`message_delta` frame that is not valid JSON now fails the turn with a retryable `NetworkError`
|
|
57
|
+
(`code: "stream_malformed_frame"`) instead of being skipped, which finished the turn with text
|
|
58
|
+
or tool input missing. Any other malformed frame is still skipped and reported on the
|
|
59
|
+
diagnostics channel. The error message and the diagnostic line name the event and the frame's
|
|
60
|
+
length, never its body, which can hold model output or tool input.
|
|
61
|
+
|
|
3
62
|
## 5.10.0
|
|
4
63
|
|
|
5
64
|
### Minor Changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk5OHB5HJF_cjs = require('./chunk-5OHB5HJF.cjs');
|
|
4
4
|
require('./chunk-J6GXS5A2.cjs');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-N7ZIPW2N.cjs');
|
|
6
6
|
require('./chunk-BUUUWQMB.cjs');
|
|
7
7
|
require('./chunk-L3C6CCBG.cjs');
|
|
8
8
|
require('./chunk-KIKKTW5O.cjs');
|
|
@@ -12,7 +12,7 @@ require('./chunk-GHX4P3V2.cjs');
|
|
|
12
12
|
require('./chunk-TMKTSYDS.cjs');
|
|
13
13
|
require('./chunk-ZD66GFH5.cjs');
|
|
14
14
|
require('./chunk-NQVWSSX2.cjs');
|
|
15
|
-
require('./chunk-
|
|
15
|
+
require('./chunk-BZKF7TXX.cjs');
|
|
16
16
|
require('./chunk-CQYBJOB2.cjs');
|
|
17
17
|
require('./chunk-YJNYDJ2T.cjs');
|
|
18
18
|
require('./chunk-WPO3VCY4.cjs');
|
|
@@ -49,6 +49,7 @@ require('./chunk-C7GKRGKN.cjs');
|
|
|
49
49
|
require('./chunk-TY56BKSK.cjs');
|
|
50
50
|
require('./chunk-MPR2ISL2.cjs');
|
|
51
51
|
require('./chunk-J5623RIV.cjs');
|
|
52
|
+
require('./chunk-NWS2CS3Y.cjs');
|
|
52
53
|
require('./chunk-3EE6LVWT.cjs');
|
|
53
54
|
require('./chunk-SGC7LSHF.cjs');
|
|
54
55
|
require('./chunk-HU666T3Q.cjs');
|
|
@@ -64,7 +65,7 @@ require('./chunk-6LHQPOMI.cjs');
|
|
|
64
65
|
|
|
65
66
|
Object.defineProperty(exports, "Agent", {
|
|
66
67
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunk5OHB5HJF_cjs.Agent; }
|
|
68
69
|
});
|
|
69
|
-
//# sourceMappingURL=agent-
|
|
70
|
-
//# sourceMappingURL=agent-
|
|
70
|
+
//# sourceMappingURL=agent-5DOR5T3E.cjs.map
|
|
71
|
+
//# sourceMappingURL=agent-5DOR5T3E.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-5DOR5T3E.cjs"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { Agent } from './chunk-
|
|
1
|
+
export { Agent } from './chunk-4PHSVR2R.js';
|
|
2
2
|
import './chunk-XKMVJ443.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-7Y23B7XX.js';
|
|
4
4
|
import './chunk-K2BQQ445.js';
|
|
5
5
|
import './chunk-DPY2M74T.js';
|
|
6
6
|
import './chunk-ZHWKT2NI.js';
|
|
@@ -10,7 +10,7 @@ import './chunk-H73MEMQB.js';
|
|
|
10
10
|
import './chunk-OR6XIWLB.js';
|
|
11
11
|
import './chunk-X3LOJJMO.js';
|
|
12
12
|
import './chunk-IZDDSLL2.js';
|
|
13
|
-
import './chunk-
|
|
13
|
+
import './chunk-74OA5DIM.js';
|
|
14
14
|
import './chunk-SUVCHX4L.js';
|
|
15
15
|
import './chunk-2XC6KDJM.js';
|
|
16
16
|
import './chunk-TE6XVTOA.js';
|
|
@@ -47,6 +47,7 @@ import './chunk-ZDYDBXSD.js';
|
|
|
47
47
|
import './chunk-X7EUUHXU.js';
|
|
48
48
|
import './chunk-MQGSOKR3.js';
|
|
49
49
|
import './chunk-GMRFAX4I.js';
|
|
50
|
+
import './chunk-LZJXEPEQ.js';
|
|
50
51
|
import './chunk-R7WIIPUR.js';
|
|
51
52
|
import './chunk-I2ORT6QD.js';
|
|
52
53
|
import './chunk-SVCPJRUB.js';
|
|
@@ -57,5 +58,5 @@ import './chunk-H3CVJSFC.js';
|
|
|
57
58
|
import './chunk-Q7GYMXVC.js';
|
|
58
59
|
import './chunk-B5MHRQJZ.js';
|
|
59
60
|
import './chunk-CZJ6Q7CW.js';
|
|
60
|
-
//# sourceMappingURL=agent-
|
|
61
|
-
//# sourceMappingURL=agent-
|
|
61
|
+
//# sourceMappingURL=agent-GWKRARAL.js.map
|
|
62
|
+
//# sourceMappingURL=agent-GWKRARAL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"agent-GWKRARAL.js"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { submit, emitRunEvent } from './chunk-XKMVJ443.js';
|
|
2
|
-
import { enqueueSessionWrite, hydrateSession, persistTurnToTranscript, flushSessionWrites, appendSessionMessage, getSessionMessages, discardSession, clearSession } from './chunk-
|
|
2
|
+
import { enqueueSessionWrite, hydrateSession, persistTurnToTranscript, flushSessionWrites, appendSessionMessage, getSessionMessages, discardSession, clearSession } from './chunk-7Y23B7XX.js';
|
|
3
3
|
import { IndexManager } from './chunk-DPY2M74T.js';
|
|
4
4
|
import { currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-ZHWKT2NI.js';
|
|
5
5
|
import { extractCodePlugins } from './chunk-2SFBB54R.js';
|
|
@@ -7,7 +7,7 @@ import { createOpenAiCompatibleRuntime } from './chunk-HI3W37FY.js';
|
|
|
7
7
|
import { persistActiveMemoryTranscript } from './chunk-OR6XIWLB.js';
|
|
8
8
|
import { resolveMaxFacts, writeSessionSummary, resolveMemoryRoot, MEMORY_KINDS, appendFact, readFacts, legacyMemoryJsonPath, memoryMdPath, appendFactToMarkdown } from './chunk-X3LOJJMO.js';
|
|
9
9
|
import { FsSessionStore } from './chunk-IZDDSLL2.js';
|
|
10
|
-
import { discoverProviderPlugins, validateApiKeyShape, getConfiguredBaseUrl, httpRequest, isFixtureApiKey, presentProviderCredentialEnvVars, buildDefaultSummarizer, shouldUseRealLocalRuntime, parseSseStream, CircuitBreaker, resolveRunProvider, mergeExplicitApiKey, resolveProviderChain, abortError, tryFirstEvent, relayStream, renderToolResultContentText } from './chunk-
|
|
10
|
+
import { discoverProviderPlugins, validateApiKeyShape, getConfiguredBaseUrl, httpRequest, isFixtureApiKey, presentProviderCredentialEnvVars, buildDefaultSummarizer, shouldUseRealLocalRuntime, parseSseStream, CircuitBreaker, resolveRunProvider, mergeExplicitApiKey, resolveProviderChain, abortError, tryFirstEvent, relayStream, renderToolResultContentText } from './chunk-74OA5DIM.js';
|
|
11
11
|
import { resolveChildEnv } from './chunk-HKCKOAIO.js';
|
|
12
12
|
import { DEFAULT_MAX_BYTES_PER_FILE, runDiscovery, truncateWithMarker } from './chunk-7QJYKVP6.js';
|
|
13
13
|
import { warnFailureOnce, loadHookConfig, warnOnce } from './chunk-OPAKPEPG.js';
|
|
@@ -29,6 +29,7 @@ import { loadSubagents, pluginBundleDirs } from './chunk-ZDYDBXSD.js';
|
|
|
29
29
|
import { reportUndeclaredSources, theokitConfigRoot, undefinedVariablesIn, getTheokitHome, adapterForConfigPath, adaptersForSurface, projectConfigRoots, pluginBundleRoots } from './chunk-X7EUUHXU.js';
|
|
30
30
|
import { readWorkspaceDir, parseSimpleYaml } from './chunk-MQGSOKR3.js';
|
|
31
31
|
import { resolveEffectiveContextWindow, CONTEXT_WINDOW_FLOOR, CONTEXT_WINDOW_MARGIN } from './chunk-GMRFAX4I.js';
|
|
32
|
+
import { isAnthropicFamilyModel } from './chunk-LZJXEPEQ.js';
|
|
32
33
|
import { parseModelId } from './chunk-R7WIIPUR.js';
|
|
33
34
|
import { getProviderProfile } from './chunk-I2ORT6QD.js';
|
|
34
35
|
import { getCatalogModelInfo, isPatchedModelKey } from './chunk-SVCPJRUB.js';
|
|
@@ -5804,14 +5805,27 @@ function stripThinkBlocks(content) {
|
|
|
5804
5805
|
// src/internal/agent-loop/loop-llm-stream.ts
|
|
5805
5806
|
function resolveSystemPromptWithMemoryAdditions(systemPrompt, additions) {
|
|
5806
5807
|
if (additions === void 0 || additions.length === 0) return systemPrompt;
|
|
5807
|
-
const block =
|
|
5808
|
-
${escapeBlockBody(additions)}
|
|
5809
|
-
</active-memory>`;
|
|
5808
|
+
const block = activeMemoryBlock(additions);
|
|
5810
5809
|
if (systemPrompt === void 0 || systemPrompt.length === 0) return block;
|
|
5811
5810
|
return `${block}
|
|
5812
5811
|
|
|
5813
5812
|
${systemPrompt}`;
|
|
5814
5813
|
}
|
|
5814
|
+
function activeMemoryBlock(additions) {
|
|
5815
|
+
return `<active-memory>
|
|
5816
|
+
${escapeBlockBody(additions)}
|
|
5817
|
+
</active-memory>`;
|
|
5818
|
+
}
|
|
5819
|
+
function buildLoopSystem(systemPrompt, additions, modelId) {
|
|
5820
|
+
if (!isAnthropicFamilyModel(modelId) || systemPrompt === void 0 || systemPrompt.length === 0) {
|
|
5821
|
+
return resolveSystemPromptWithMemoryAdditions(systemPrompt, additions);
|
|
5822
|
+
}
|
|
5823
|
+
const blocks = [{ text: systemPrompt, cacheable: true }];
|
|
5824
|
+
if (additions !== void 0 && additions.length > 0) {
|
|
5825
|
+
blocks.push({ text: activeMemoryBlock(additions) });
|
|
5826
|
+
}
|
|
5827
|
+
return blocks;
|
|
5828
|
+
}
|
|
5815
5829
|
function toLlmTool(tool) {
|
|
5816
5830
|
return { name: tool.name, description: tool.description, inputSchema: tool.inputSchema };
|
|
5817
5831
|
}
|
|
@@ -5850,9 +5864,10 @@ async function streamLlmTurn(inputs, ctx) {
|
|
|
5850
5864
|
{
|
|
5851
5865
|
model: inputs.model.id ?? "auto",
|
|
5852
5866
|
...(() => {
|
|
5853
|
-
const effective =
|
|
5867
|
+
const effective = buildLoopSystem(
|
|
5854
5868
|
inputs.systemPrompt,
|
|
5855
|
-
ctx.memorySystemPromptAdditions
|
|
5869
|
+
ctx.memorySystemPromptAdditions,
|
|
5870
|
+
inputs.model.id
|
|
5856
5871
|
);
|
|
5857
5872
|
return effective !== void 0 ? { system: effective } : {};
|
|
5858
5873
|
})(),
|
|
@@ -6839,29 +6854,32 @@ async function runIteration(inputs, ctx) {
|
|
|
6839
6854
|
const llmOutput = await streamLlmTurn(inputs, ctx);
|
|
6840
6855
|
await inputs.pluginManager?.runPostLlmCallHooks(hookCtx);
|
|
6841
6856
|
accumulateUsage(ctx.usage, llmOutput);
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6857
|
+
trackTurnUsage(inputs, llmOutput);
|
|
6858
|
+
return continueOrTerminate(inputs, ctx, llmOutput);
|
|
6859
|
+
}
|
|
6860
|
+
function trackTurnUsage(inputs, llmOutput) {
|
|
6861
|
+
const tracker = inputs.budgetTracker;
|
|
6862
|
+
if (tracker === void 0) return;
|
|
6863
|
+
const modelId = inputs.model.id ?? "auto";
|
|
6864
|
+
const inputT = (llmOutput.inputTokens ?? 0) + (llmOutput.cacheReadTokens ?? 0) + (llmOutput.cacheWriteTokens ?? 0);
|
|
6865
|
+
const outputT = llmOutput.outputTokens ?? 0;
|
|
6866
|
+
try {
|
|
6867
|
+
if (inputT > 0) {
|
|
6868
|
+
tracker.track({
|
|
6869
|
+
tokens: inputT,
|
|
6870
|
+
model: modelId,
|
|
6871
|
+
type: "input"
|
|
6872
|
+
});
|
|
6873
|
+
}
|
|
6874
|
+
if (outputT > 0) {
|
|
6875
|
+
tracker.track({
|
|
6876
|
+
tokens: outputT,
|
|
6877
|
+
model: modelId,
|
|
6878
|
+
type: "output"
|
|
6879
|
+
});
|
|
6862
6880
|
}
|
|
6881
|
+
} catch {
|
|
6863
6882
|
}
|
|
6864
|
-
return continueOrTerminate(inputs, ctx, llmOutput);
|
|
6865
6883
|
}
|
|
6866
6884
|
async function transformLlmOutputText(inputs, text, ctx) {
|
|
6867
6885
|
return inputs.pluginManager !== void 0 ? inputs.pluginManager.runTransformLlmOutputHooks(text, ctx) : text;
|
|
@@ -11066,7 +11084,7 @@ var Agent = class _Agent {
|
|
|
11066
11084
|
*/
|
|
11067
11085
|
static async compact(agentId, options = {}) {
|
|
11068
11086
|
const reg = await requireLocalAgent(agentId, "compact");
|
|
11069
|
-
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-
|
|
11087
|
+
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-F2UDGZCN.js');
|
|
11070
11088
|
const { cwd, model, store } = await openLocalStore(reg);
|
|
11071
11089
|
return enqueueSessionWrite(
|
|
11072
11090
|
cwd,
|
|
@@ -11096,7 +11114,7 @@ var Agent = class _Agent {
|
|
|
11096
11114
|
*/
|
|
11097
11115
|
static async injectSessionTurn(agentId, turn) {
|
|
11098
11116
|
const reg = await requireLocalAgent(agentId, "injectSessionTurn");
|
|
11099
|
-
const { injectSessionTurn } = await import('./inject-session-
|
|
11117
|
+
const { injectSessionTurn } = await import('./inject-session-E5UDFVLI.js');
|
|
11100
11118
|
const { cwd, model, store } = await openLocalStore(reg);
|
|
11101
11119
|
await injectSessionTurn({
|
|
11102
11120
|
store,
|
|
@@ -11254,5 +11272,5 @@ async function openLocalStore(reg) {
|
|
|
11254
11272
|
}
|
|
11255
11273
|
|
|
11256
11274
|
export { Agent, AgentBuilder, DEFAULT_AGENTIC_MODEL_ID, MEMORY_EMBEDDING_ADAPTERS, Tool, ToolError, UsageAccumulator, computeCost, generateCronId, getPricingEntry, managedSettingsPathFor, openRouterMemoryEmbeddingProviderAdapter, readManagedSettings, resolveSessionDir };
|
|
11257
|
-
//# sourceMappingURL=chunk-
|
|
11258
|
-
//# sourceMappingURL=chunk-
|
|
11275
|
+
//# sourceMappingURL=chunk-4PHSVR2R.js.map
|
|
11276
|
+
//# sourceMappingURL=chunk-4PHSVR2R.js.map
|