@theokit/sdk 4.31.1 → 4.33.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 +28 -0
- package/dist/{agent-BKNJIOEY.cjs → agent-2STDGKNI.cjs} +11 -10
- package/dist/{agent-BKNJIOEY.cjs.map → agent-2STDGKNI.cjs.map} +1 -1
- package/dist/{agent-CbZPGFfM.d.cts → agent-DGv1-d81.d.cts} +51 -1
- package/dist/{agent-HW7OY2W3.js → agent-LFSVFAUI.js} +10 -9
- package/dist/{agent-HW7OY2W3.js.map → agent-LFSVFAUI.js.map} +1 -1
- package/dist/{agent-BJbGi8-R.d.ts → agent-SmxntivO.d.ts} +51 -1
- package/dist/{chunk-U2FO3MRG.cjs → chunk-2DYI7MIF.cjs} +2 -2
- package/dist/chunk-2DYI7MIF.cjs.map +1 -0
- package/dist/{chunk-OIYQBUW4.cjs → chunk-6M6A6WWW.cjs} +2 -2
- package/dist/{chunk-OIYQBUW4.cjs.map → chunk-6M6A6WWW.cjs.map} +1 -1
- package/dist/chunk-B3HUL2OQ.js +78 -0
- package/dist/chunk-B3HUL2OQ.js.map +1 -0
- package/dist/{chunk-E2YEDATX.cjs → chunk-E33A7YIR.cjs} +28 -6
- package/dist/chunk-E33A7YIR.cjs.map +1 -0
- package/dist/chunk-FER7UMIC.cjs +75 -0
- package/dist/chunk-FER7UMIC.cjs.map +1 -0
- package/dist/{chunk-NZCFLEHO.cjs → chunk-FTRNHGAD.cjs} +11 -11
- package/dist/{chunk-NZCFLEHO.cjs.map → chunk-FTRNHGAD.cjs.map} +1 -1
- package/dist/{chunk-EVADEGM7.cjs → chunk-FX2DAR5R.cjs} +7 -5
- package/dist/chunk-FX2DAR5R.cjs.map +1 -0
- package/dist/{chunk-WA3FO4R7.js → chunk-GBCQ5742.js} +7 -6
- package/dist/chunk-GBCQ5742.js.map +1 -0
- package/dist/{chunk-S6F3FKFR.cjs → chunk-HTO4C32Q.cjs} +67 -51
- package/dist/chunk-HTO4C32Q.cjs.map +1 -0
- package/dist/{chunk-XDNGF5BY.js → chunk-KT6SWUY6.js} +4 -4
- package/dist/{chunk-XDNGF5BY.js.map → chunk-KT6SWUY6.js.map} +1 -1
- package/dist/chunk-LDDUIXWS.cjs +81 -0
- package/dist/chunk-LDDUIXWS.cjs.map +1 -0
- package/dist/chunk-OMDRRHRF.js +73 -0
- package/dist/chunk-OMDRRHRF.js.map +1 -0
- package/dist/{chunk-GQBXBHZ2.cjs → chunk-PZ4Q5K7O.cjs} +5 -5
- package/dist/{chunk-GQBXBHZ2.cjs.map → chunk-PZ4Q5K7O.cjs.map} +1 -1
- package/dist/{chunk-VGUOUAM2.js → chunk-Q56IYTBZ.js} +2 -2
- package/dist/chunk-Q56IYTBZ.js.map +1 -0
- package/dist/{chunk-SJLOIZ4Z.js → chunk-SDYJESYZ.js} +27 -6
- package/dist/chunk-SDYJESYZ.js.map +1 -0
- package/dist/{chunk-CCRWSZ2F.js → chunk-TKE4RTYA.js} +31 -15
- package/dist/chunk-TKE4RTYA.js.map +1 -0
- package/dist/{chunk-WYPHQ7NM.js → chunk-WBGCDZDV.js} +3 -3
- package/dist/{chunk-WYPHQ7NM.js.map → chunk-WBGCDZDV.js.map} +1 -1
- package/dist/{chunk-DGRZNMTU.js → chunk-XV2RBL6D.js} +2 -2
- package/dist/{chunk-DGRZNMTU.js.map → chunk-XV2RBL6D.js.map} +1 -1
- package/dist/{compact-session-42BK7RE3.cjs → compact-session-24PK2G4M.cjs} +13 -13
- package/dist/{compact-session-42BK7RE3.cjs.map → compact-session-24PK2G4M.cjs.map} +1 -1
- package/dist/{compact-session-QMBOCFVQ.js → compact-session-J7VNCICZ.js} +5 -5
- package/dist/{compact-session-QMBOCFVQ.js.map → compact-session-J7VNCICZ.js.map} +1 -1
- package/dist/compaction.cjs +17 -13
- package/dist/compaction.d.cts +8 -0
- package/dist/compaction.d.ts +8 -0
- package/dist/compaction.js +1 -1
- package/dist/{cron-BwojPwEs.d.cts → cron-BiK_aNJI.d.cts} +1 -1
- package/dist/{cron-BU9qD5B6.d.ts → cron-Dx7B-3WB.d.ts} +1 -1
- package/dist/cron.cjs +10 -9
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +9 -8
- package/dist/eval.cjs +9 -8
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +8 -7
- package/dist/eval.js.map +1 -1
- package/dist/fs-session-store-MZ4GD2C6.js +10 -0
- package/dist/{fs-session-store-T7YPW5A4.js.map → fs-session-store-MZ4GD2C6.js.map} +1 -1
- package/dist/fs-session-store-YMBSJ5Y7.cjs +19 -0
- package/dist/{fs-session-store-IIP7ZBYE.cjs.map → fs-session-store-YMBSJ5Y7.cjs.map} +1 -1
- package/dist/index.cjs +52 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -4
- package/dist/index.d.ts +19 -4
- package/dist/index.js +32 -12
- package/dist/index.js.map +1 -1
- package/dist/{inject-session-6ZMCA2NE.cjs → inject-session-343WIDCM.cjs} +6 -6
- package/dist/{inject-session-6ZMCA2NE.cjs.map → inject-session-343WIDCM.cjs.map} +1 -1
- package/dist/{inject-session-YA3GQE4G.js → inject-session-RZEDWO53.js} +4 -4
- package/dist/{inject-session-YA3GQE4G.js.map → inject-session-RZEDWO53.js.map} +1 -1
- package/dist/internal/local-agent/local-agent.d.ts +93 -1
- package/dist/internal/persistence/fs-session-store.d.cts +16 -0
- package/dist/internal/persistence/fs-session-store.d.ts +16 -0
- package/dist/internal/persistence/index.cjs +7 -7
- package/dist/internal/persistence/index.js +1 -1
- package/dist/internal/persistence/paths.d.cts +11 -1
- package/dist/internal/persistence/paths.d.ts +11 -1
- package/dist/internal/persistence/session-writer.d.cts +8 -0
- package/dist/internal/persistence/session-writer.d.ts +8 -0
- package/dist/internal/session/agent-session.d.ts +22 -0
- package/dist/persistence.cjs +13 -39
- package/dist/persistence.cjs.map +1 -1
- package/dist/persistence.d.cts +1 -0
- package/dist/persistence.d.ts +1 -0
- package/dist/persistence.js +4 -36
- package/dist/persistence.js.map +1 -1
- package/dist/{session-transcript-5VZUWEJ5.js → session-transcript-F2ANTA2M.js} +3 -3
- package/dist/{session-transcript-5VZUWEJ5.js.map → session-transcript-F2ANTA2M.js.map} +1 -1
- package/dist/{session-transcript-T4SB66I7.cjs → session-transcript-JXFMPLOT.cjs} +13 -13
- package/dist/{session-transcript-T4SB66I7.cjs.map → session-transcript-JXFMPLOT.cjs.map} +1 -1
- package/dist/subagents-loader.d.cts +1 -1
- package/dist/subagents-loader.d.ts +1 -1
- package/dist/types/session-record.d.ts +51 -1
- package/package.json +1 -1
- package/dist/chunk-CCRWSZ2F.js.map +0 -1
- package/dist/chunk-E2YEDATX.cjs.map +0 -1
- package/dist/chunk-EVADEGM7.cjs.map +0 -1
- package/dist/chunk-IOOSAZZH.cjs +0 -30
- package/dist/chunk-IOOSAZZH.cjs.map +0 -1
- package/dist/chunk-RPKTXBPK.js +0 -28
- package/dist/chunk-RPKTXBPK.js.map +0 -1
- package/dist/chunk-S6F3FKFR.cjs.map +0 -1
- package/dist/chunk-SJLOIZ4Z.js.map +0 -1
- package/dist/chunk-U2FO3MRG.cjs.map +0 -1
- package/dist/chunk-VGUOUAM2.js.map +0 -1
- package/dist/chunk-WA3FO4R7.js.map +0 -1
- package/dist/fs-session-store-IIP7ZBYE.cjs +0 -17
- package/dist/fs-session-store-T7YPW5A4.js +0 -8
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { extractCodePlugins } from './chunk-2SFBB54R.js';
|
|
2
2
|
import { submit, emitRunEvent } from './chunk-HRA3CPGG.js';
|
|
3
|
-
import { enqueueSessionWrite, hydrateSession, flushSessionWrites, persistTurnToTranscript, appendSessionMessage, getSessionMessages, clearSession } from './chunk-
|
|
4
|
-
import { FsSessionStore } from './chunk-
|
|
5
|
-
import { discoverProviderPlugins, CircuitBreaker, buildDefaultSummarizer, parseSseStream, resolveProviderChain, inferProviderFromApiKey, detectPrimaryProvider, tryFirstEvent, relayStream, mapOpenAICompatibleError, renderToolResultContentText } from './chunk-
|
|
3
|
+
import { enqueueSessionWrite, hydrateSession, flushSessionWrites, descartarSessao, persistTurnToTranscript, appendSessionMessage, getSessionMessages, clearSession } from './chunk-SDYJESYZ.js';
|
|
4
|
+
import { FsSessionStore } from './chunk-OMDRRHRF.js';
|
|
5
|
+
import { discoverProviderPlugins, CircuitBreaker, buildDefaultSummarizer, parseSseStream, resolveProviderChain, inferProviderFromApiKey, detectPrimaryProvider, tryFirstEvent, relayStream, mapOpenAICompatibleError, renderToolResultContentText } from './chunk-KT6SWUY6.js';
|
|
6
6
|
import { IndexManager, writeSessionSummary, memoryDir, globalEmbeddingCache, appendFact, readFacts, legacyMemoryJsonPath, memoryMdPath, appendFactToMarkdown } from './chunk-XAUBQMQU.js';
|
|
7
7
|
import { loadHookConfig, warnOnce, currentPersonalityContext, warnPersonalitySwitchInsideFork } from './chunk-XIG2IE3L.js';
|
|
8
8
|
import { resolveChildEnv } from './chunk-7GFX45DD.js';
|
|
9
|
-
import { readVersionedJson, getTheokitHome, writeVersionedJson } from './chunk-
|
|
9
|
+
import { readVersionedJson, getTheokitHome, writeVersionedJson } from './chunk-XV2RBL6D.js';
|
|
10
10
|
import { sanitizeToolInput } from './chunk-U54XCYG3.js';
|
|
11
11
|
import { subAgentToolsFromDefinitions, inheritSubAgentCredentials } from './chunk-FV3YEMQ7.js';
|
|
12
12
|
import { setAgentFacade } from './chunk-6X6ID4MO.js';
|
|
@@ -15,11 +15,11 @@ import { withToolWhitelist, checkToolWhitelist } from './chunk-7AD3ZTZL.js';
|
|
|
15
15
|
import { mapWithConcurrency } from './chunk-V4XRLPEF.js';
|
|
16
16
|
import { withFileLock } from './chunk-UAYYNWYJ.js';
|
|
17
17
|
import { withCwdMutex } from './chunk-2XLKLVVR.js';
|
|
18
|
-
import { defaultBaseDir, expandTilde } from './chunk-
|
|
18
|
+
import { defaultBaseDir, expandTilde } from './chunk-Q56IYTBZ.js';
|
|
19
19
|
import { toJsonSchema } from './chunk-4VPXM6UU.js';
|
|
20
20
|
import { atomicWriteJson } from './chunk-S2BBRVQX.js';
|
|
21
21
|
import { loadSubagents } from './chunk-BNIFFFH3.js';
|
|
22
|
-
import { resolveEffectiveContextWindow, CONTEXT_WINDOW_FLOOR, CONTEXT_WINDOW_MARGIN } from './chunk-
|
|
22
|
+
import { resolveEffectiveContextWindow, CONTEXT_WINDOW_FLOOR, CONTEXT_WINDOW_MARGIN } from './chunk-GBCQ5742.js';
|
|
23
23
|
import { parseModelId } from './chunk-X2FR4OIT.js';
|
|
24
24
|
import { getCatalogModelInfo, registerBuiltins, getProviderProfile, registerProvider, isPatchedModelKey } from './chunk-KAP4GJHO.js';
|
|
25
25
|
import { escapeBlockBody, buildSkillsBlock, discoverSkills, stripSkillFrontmatter } from './chunk-5IB2UKSN.js';
|
|
@@ -9509,6 +9509,10 @@ function registerRunAsTask(run, agentId, taskOpt, userText) {
|
|
|
9509
9509
|
}
|
|
9510
9510
|
|
|
9511
9511
|
// src/internal/local-agent/local-agent.ts
|
|
9512
|
+
async function disposeSessionStore(store) {
|
|
9513
|
+
const d = store.dispose;
|
|
9514
|
+
if (typeof d === "function") await d.call(store);
|
|
9515
|
+
}
|
|
9512
9516
|
var LocalAgent = class {
|
|
9513
9517
|
agentId;
|
|
9514
9518
|
model;
|
|
@@ -9651,6 +9655,18 @@ var LocalAgent = class {
|
|
|
9651
9655
|
);
|
|
9652
9656
|
});
|
|
9653
9657
|
}
|
|
9658
|
+
/**
|
|
9659
|
+
* A janela de contexto declarada na seleção de modelo, no formato de spread condicional.
|
|
9660
|
+
*
|
|
9661
|
+
* M94 — sem isto, o `override` de `resolveEffectiveContextWindow` existia desde o M77 e nenhum
|
|
9662
|
+
* call site de produção o passava: um modelo de 400k sem entrada de catálogo era orçado contra o
|
|
9663
|
+
* piso de 128k. Método próprio porque o spread inline empurrava `runLockedSendCycle` para além do
|
|
9664
|
+
* teto de complexidade cognitiva do projeto.
|
|
9665
|
+
*/
|
|
9666
|
+
#janelaDeclarada() {
|
|
9667
|
+
const declarada = this.model?.contextWindow;
|
|
9668
|
+
return declarada !== void 0 ? { contextWindow: declarada } : {};
|
|
9669
|
+
}
|
|
9654
9670
|
async runLockedSendCycle(message, options, sendSpan, resolve, reject) {
|
|
9655
9671
|
const userText = typeof message === "string" ? message : message.text;
|
|
9656
9672
|
let run;
|
|
@@ -9678,9 +9694,7 @@ var LocalAgent = class {
|
|
|
9678
9694
|
workspaceCwd: this.workspaceCwd,
|
|
9679
9695
|
sessionStore: this.sessionStore,
|
|
9680
9696
|
model: this.model?.id ?? "unknown",
|
|
9681
|
-
|
|
9682
|
-
// existia desde o M77 e nenhum call site de produção o passava.
|
|
9683
|
-
...this.model?.contextWindow !== void 0 ? { contextWindow: this.model.contextWindow } : {},
|
|
9697
|
+
...this.#janelaDeclarada(),
|
|
9684
9698
|
// M50 — the auto-compaction summarizer resolves credentials like the run itself.
|
|
9685
9699
|
...this.options.apiKey !== void 0 ? { apiKey: this.options.apiKey } : {},
|
|
9686
9700
|
...options.onRunEvent !== void 0 ? { onRunEvent: options.onRunEvent } : {},
|
|
@@ -9805,6 +9819,8 @@ var LocalAgent = class {
|
|
|
9805
9819
|
disposeSessionMcpClients(this.agentId);
|
|
9806
9820
|
await flushSessionWrites();
|
|
9807
9821
|
await flushRegistrySaves(this.workspaceCwd);
|
|
9822
|
+
await disposeSessionStore(this.sessionStore);
|
|
9823
|
+
descartarSessao(this.workspaceCwd, this.agentId);
|
|
9808
9824
|
}
|
|
9809
9825
|
[Symbol.asyncDispose]() {
|
|
9810
9826
|
return this.dispose();
|
|
@@ -10408,7 +10424,7 @@ var Agent = class _Agent {
|
|
|
10408
10424
|
`No local agent "${agentId}" registered \u2014 compact targets local sessions.`
|
|
10409
10425
|
);
|
|
10410
10426
|
}
|
|
10411
|
-
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-
|
|
10427
|
+
const { compactSessionTranscript, buildDefaultSummarizer: buildDefaultSummarizer2 } = await import('./compact-session-J7VNCICZ.js');
|
|
10412
10428
|
const { cwd, model, store } = await abrirStoreLocal(reg);
|
|
10413
10429
|
return enqueueSessionWrite(
|
|
10414
10430
|
cwd,
|
|
@@ -10444,7 +10460,7 @@ var Agent = class _Agent {
|
|
|
10444
10460
|
`No local agent "${agentId}" registered \u2014 injectSessionTurn targets local sessions.`
|
|
10445
10461
|
);
|
|
10446
10462
|
}
|
|
10447
|
-
const { injectSessionTurn } = await import('./inject-session-
|
|
10463
|
+
const { injectSessionTurn } = await import('./inject-session-RZEDWO53.js');
|
|
10448
10464
|
const { cwd, model, store } = await abrirStoreLocal(reg);
|
|
10449
10465
|
await injectSessionTurn({
|
|
10450
10466
|
store,
|
|
@@ -10491,12 +10507,12 @@ async function abrirStoreLocal(reg) {
|
|
|
10491
10507
|
const cwd = reg.cwd ?? process.cwd();
|
|
10492
10508
|
const optModel = reg.options.model;
|
|
10493
10509
|
const model = reg.model?.id ?? (typeof optModel === "string" ? optModel : optModel?.id) ?? "unknown";
|
|
10494
|
-
const { FsSessionStore: FsSessionStore2 } = await import('./fs-session-store-
|
|
10495
|
-
const { defaultBaseDir: defaultBaseDir2, expandTilde: expandTilde2 } = await import('./session-transcript-
|
|
10510
|
+
const { FsSessionStore: FsSessionStore2 } = await import('./fs-session-store-MZ4GD2C6.js');
|
|
10511
|
+
const { defaultBaseDir: defaultBaseDir2, expandTilde: expandTilde2 } = await import('./session-transcript-F2ANTA2M.js');
|
|
10496
10512
|
const baseDir = reg.options.local?.baseDir !== void 0 ? expandTilde2(reg.options.local.baseDir) : defaultBaseDir2();
|
|
10497
10513
|
return { cwd, model, store: new FsSessionStore2({ baseDir, cwd }) };
|
|
10498
10514
|
}
|
|
10499
10515
|
|
|
10500
10516
|
export { Agent, AgentBuilder, DEFAULT_AGENTIC_MODEL_ID, MEMORY_EMBEDDING_ADAPTERS, Tool, ToolError, UsageAccumulator, computeCost, generateCronId, getPricingEntry, httpRequest, isFixtureApiKey, openRouterMemoryEmbeddingProviderAdapter, resolveApiKey, shouldUseFixtureMode };
|
|
10501
|
-
//# sourceMappingURL=chunk-
|
|
10502
|
-
//# sourceMappingURL=chunk-
|
|
10517
|
+
//# sourceMappingURL=chunk-TKE4RTYA.js.map
|
|
10518
|
+
//# sourceMappingURL=chunk-TKE4RTYA.js.map
|