@theokit/sdk 5.0.0-next.3 → 5.0.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 +978 -0
- package/dist/{agent-V6YLX3W6.cjs → agent-5BJF255U.cjs} +6 -6
- package/dist/{agent-V6YLX3W6.cjs.map → agent-5BJF255U.cjs.map} +1 -1
- package/dist/{agent-2KJ3IGRA.js → agent-HACVHN2V.js} +5 -5
- package/dist/{agent-2KJ3IGRA.js.map → agent-HACVHN2V.js.map} +1 -1
- package/dist/{chunk-CYKKYNOT.js → chunk-7SZAV6QG.js} +4 -4
- package/dist/chunk-7SZAV6QG.js.map +1 -0
- package/dist/{chunk-L4RPP6ZC.js → chunk-M3QNTHMV.js} +3 -3
- package/dist/{chunk-L4RPP6ZC.js.map → chunk-M3QNTHMV.js.map} +1 -1
- package/dist/{chunk-RXZSVNDG.cjs → chunk-NQTNSHSB.cjs} +7 -3
- package/dist/chunk-NQTNSHSB.cjs.map +1 -0
- package/dist/{chunk-GO5QW4YL.js → chunk-OXQSNOYV.js} +5 -5
- package/dist/{chunk-GO5QW4YL.js.map → chunk-OXQSNOYV.js.map} +1 -1
- package/dist/{chunk-J2SH3PNH.js → chunk-SADXXGWU.js} +6 -3
- package/dist/chunk-SADXXGWU.js.map +1 -0
- package/dist/{chunk-VNDJS6I3.cjs → chunk-VPK6PHIE.cjs} +8 -8
- package/dist/{chunk-VNDJS6I3.cjs.map → chunk-VPK6PHIE.cjs.map} +1 -1
- package/dist/{chunk-K6VDRJ6I.cjs → chunk-VVJ7FQAQ.cjs} +20 -19
- package/dist/{chunk-K6VDRJ6I.cjs.map → chunk-VVJ7FQAQ.cjs.map} +1 -1
- package/dist/{chunk-DX4RUWOK.js → chunk-WS5ULCL4.js} +3 -3
- package/dist/{chunk-DX4RUWOK.js.map → chunk-WS5ULCL4.js.map} +1 -1
- package/dist/{chunk-GJKMSGZ7.cjs → chunk-WWZO2TTK.cjs} +4 -4
- package/dist/{chunk-GJKMSGZ7.cjs.map → chunk-WWZO2TTK.cjs.map} +1 -1
- package/dist/{chunk-KBXADFBJ.cjs → chunk-Z2JFX372.cjs} +15 -15
- package/dist/chunk-Z2JFX372.cjs.map +1 -0
- package/dist/cron.cjs +5 -5
- package/dist/cron.js +4 -4
- package/dist/eval.cjs +4 -4
- package/dist/eval.js +3 -3
- package/dist/{index-manager-OL6HTYAO.cjs → index-manager-3UNPYH34.cjs} +5 -5
- package/dist/{index-manager-OL6HTYAO.cjs.map → index-manager-3UNPYH34.cjs.map} +1 -1
- package/dist/{index-manager-E56WW5RO.js → index-manager-W7FDMGEG.js} +4 -4
- package/dist/{index-manager-E56WW5RO.js.map → index-manager-W7FDMGEG.js.map} +1 -1
- package/dist/index.cjs +36 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -1
- package/dist/index.d.ts +42 -1
- package/dist/index.js +18 -11
- package/dist/index.js.map +1 -1
- package/dist/internal/memory/storage/index.cjs +34 -30
- package/dist/internal/memory/storage/index.d.cts +1 -1
- package/dist/internal/memory/storage/index.d.ts +1 -1
- package/dist/internal/memory/storage/index.js +2 -2
- package/dist/internal/memory/storage/memory-root.d.cts +17 -0
- package/dist/internal/memory/storage/memory-root.d.ts +17 -0
- package/docs/harness-capability-map.md +5 -1
- package/docs/memory-decisions.md +41 -20
- package/package.json +2 -2
- package/dist/chunk-CYKKYNOT.js.map +0 -1
- package/dist/chunk-J2SH3PNH.js.map +0 -1
- package/dist/chunk-KBXADFBJ.cjs.map +0 -1
- package/dist/chunk-RXZSVNDG.cjs.map +0 -1
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkKVSAY6NZ_cjs = require('./chunk-KVSAY6NZ.cjs');
|
|
4
4
|
var chunkY2KYR2ED_cjs = require('./chunk-Y2KYR2ED.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkZ2JFX372_cjs = require('./chunk-Z2JFX372.cjs');
|
|
6
6
|
var chunkH6YM3PV6_cjs = require('./chunk-H6YM3PV6.cjs');
|
|
7
7
|
var chunkBV2MWEMV_cjs = require('./chunk-BV2MWEMV.cjs');
|
|
8
8
|
var chunkD6POWE7E_cjs = require('./chunk-D6POWE7E.cjs');
|
|
9
9
|
var chunkTMKTSYDS_cjs = require('./chunk-TMKTSYDS.cjs');
|
|
10
|
-
var
|
|
10
|
+
var chunkNQTNSHSB_cjs = require('./chunk-NQTNSHSB.cjs');
|
|
11
11
|
var chunk7FDKWDA2_cjs = require('./chunk-7FDKWDA2.cjs');
|
|
12
12
|
var chunk2HPNT6HH_cjs = require('./chunk-2HPNT6HH.cjs');
|
|
13
13
|
var chunk2ZPEDVLM_cjs = require('./chunk-2ZPEDVLM.cjs');
|
|
@@ -817,7 +817,7 @@ async function readLegacyFacts(jsonPath) {
|
|
|
817
817
|
}
|
|
818
818
|
async function writeMigratedFacts(cwd, jsonPath, facts) {
|
|
819
819
|
try {
|
|
820
|
-
for (const fact of facts) await
|
|
820
|
+
for (const fact of facts) await chunkNQTNSHSB_cjs.appendFactToMarkdown(cwd, fact);
|
|
821
821
|
await promises.unlink(jsonPath).catch(() => void 0);
|
|
822
822
|
chunk6LHQPOMI_cjs.diag(`[theokit-sdk] migrated ${facts.length} fact(s) from ${jsonPath} to MEMORY.md
|
|
823
823
|
`);
|
|
@@ -834,11 +834,11 @@ async function migrateLegacyJson(cwd, config) {
|
|
|
834
834
|
const key = `${cwd}::${config.namespace ?? "default"}::${config.scope ?? "agent"}::${config.userId ?? "default"}`;
|
|
835
835
|
if (migrationRun.has(key)) return { migrated: false, factCount: 0, reason: "already-migrated" };
|
|
836
836
|
migrationRun.add(key);
|
|
837
|
-
const jsonPath =
|
|
837
|
+
const jsonPath = chunkNQTNSHSB_cjs.legacyMemoryJsonPath(cwd, config);
|
|
838
838
|
if (!await fileExists(jsonPath)) {
|
|
839
839
|
return { migrated: false, factCount: 0, reason: "no-legacy-json" };
|
|
840
840
|
}
|
|
841
|
-
if (await fileExists(
|
|
841
|
+
if (await fileExists(chunkNQTNSHSB_cjs.memoryMdPath(chunkNQTNSHSB_cjs.resolveMemoryRoot(cwd, config)))) {
|
|
842
842
|
chunk6LHQPOMI_cjs.diag(
|
|
843
843
|
`[theokit-sdk] memory migration skipped: both MEMORY.md and legacy JSON exist at ${jsonPath}; leaving both intact
|
|
844
844
|
`
|
|
@@ -867,19 +867,19 @@ function unstoredRememberWarning(message) {
|
|
|
867
867
|
if (isMemoryWritePrompt(message) && extractMemoryFact(message).length > 0) return void 0;
|
|
868
868
|
const trimmed = message.trim();
|
|
869
869
|
const quoted = trimmed.length > QUOTED_MESSAGE_MAX ? `${trimmed.slice(0, QUOTED_MESSAGE_MAX)}\u2026` : trimmed;
|
|
870
|
-
return `[theokit-sdk] NOTHING WAS STORED \u2014 this message does not match the memory capture pattern: ${JSON.stringify(quoted)}. Supported: "Remember: <fact>" or "Remember (${
|
|
870
|
+
return `[theokit-sdk] NOTHING WAS STORED \u2014 this message does not match the memory capture pattern: ${JSON.stringify(quoted)}. Supported: "Remember: <fact>" or "Remember (${chunkNQTNSHSB_cjs.MEMORY_KINDS.join("|")}): <fact>". It still reaches the session transcript, so a follow-up may answer from it \u2014 that is search over transcripts, not a durable memory.`;
|
|
871
871
|
}
|
|
872
872
|
function extractMemoryKind(message) {
|
|
873
873
|
const match = REMEMBER_PATTERN.exec(message);
|
|
874
874
|
const declared = match?.[1];
|
|
875
875
|
if (declared === void 0) return void 0;
|
|
876
876
|
const lowered = declared.toLowerCase();
|
|
877
|
-
return
|
|
877
|
+
return chunkNQTNSHSB_cjs.MEMORY_KINDS.includes(lowered) ? lowered : void 0;
|
|
878
878
|
}
|
|
879
879
|
async function readMemoryFacts(cwd, config) {
|
|
880
880
|
if (!config.enabled) return [];
|
|
881
881
|
await migrateLegacyJson(cwd, config);
|
|
882
|
-
return
|
|
882
|
+
return chunkNQTNSHSB_cjs.readFacts(cwd, config);
|
|
883
883
|
}
|
|
884
884
|
async function appendMemoryFact(cwd, config, fact) {
|
|
885
885
|
if (!config.enabled) return;
|
|
@@ -888,7 +888,7 @@ async function appendMemoryFact(cwd, config, fact) {
|
|
|
888
888
|
text: chunk6LHQPOMI_cjs.redactSecrets(fact.text),
|
|
889
889
|
...fact.kind === void 0 ? {} : { kind: fact.kind }
|
|
890
890
|
};
|
|
891
|
-
await
|
|
891
|
+
await chunkNQTNSHSB_cjs.appendFact(cwd, config, sanitized);
|
|
892
892
|
}
|
|
893
893
|
|
|
894
894
|
// src/internal/runtime/fixtures/fixture-scripts.ts
|
|
@@ -2788,7 +2788,7 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2788
2788
|
cwd: workspaceCwd,
|
|
2789
2789
|
// Resolved once, here, and handed to both writers. Recomputing it inside either one is how
|
|
2790
2790
|
// the summary ended up in a directory the indexer never scanned (#463).
|
|
2791
|
-
memoryRoot:
|
|
2791
|
+
memoryRoot: chunkNQTNSHSB_cjs.resolveMemoryRoot(workspaceCwd, inputs.memory),
|
|
2792
2792
|
runId: result.id,
|
|
2793
2793
|
agentId,
|
|
2794
2794
|
userText,
|
|
@@ -2800,7 +2800,7 @@ async function runPostRunLifecycle(inputs) {
|
|
|
2800
2800
|
if (memoryProvider?.recordSessionSummary !== void 0) {
|
|
2801
2801
|
await memoryProvider.recordSessionSummary(summaryArgs);
|
|
2802
2802
|
} else {
|
|
2803
|
-
await
|
|
2803
|
+
await chunkNQTNSHSB_cjs.writeSessionSummary(summaryArgs);
|
|
2804
2804
|
}
|
|
2805
2805
|
} catch (cause) {
|
|
2806
2806
|
const message = cause instanceof Error ? cause.message : String(cause);
|
|
@@ -3439,7 +3439,7 @@ var HISTOGRAM_NAMES = {
|
|
|
3439
3439
|
};
|
|
3440
3440
|
function safeRequire(moduleName) {
|
|
3441
3441
|
try {
|
|
3442
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
3442
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-VVJ7FQAQ.cjs', document.baseURI).href)));
|
|
3443
3443
|
return r(moduleName);
|
|
3444
3444
|
} catch {
|
|
3445
3445
|
return void 0;
|
|
@@ -3682,7 +3682,7 @@ var cachedOtel;
|
|
|
3682
3682
|
function loadOtel() {
|
|
3683
3683
|
if (cachedOtel === void 0) {
|
|
3684
3684
|
try {
|
|
3685
|
-
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-
|
|
3685
|
+
const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-VVJ7FQAQ.cjs', document.baseURI).href)));
|
|
3686
3686
|
const mod = r("@opentelemetry/api");
|
|
3687
3687
|
cachedOtel = mod;
|
|
3688
3688
|
} catch {
|
|
@@ -8140,7 +8140,7 @@ async function finalize(args, queryMode, result) {
|
|
|
8140
8140
|
};
|
|
8141
8141
|
args.cache?.set(args.userText, queryMode, result, tenantCtx);
|
|
8142
8142
|
if (args.persistTranscripts === true && args.cwd !== void 0) {
|
|
8143
|
-
await chunkTMKTSYDS_cjs.persistActiveMemoryTranscript(args.memoryRoot ??
|
|
8143
|
+
await chunkTMKTSYDS_cjs.persistActiveMemoryTranscript(args.memoryRoot ?? chunkNQTNSHSB_cjs.resolveMemoryRoot(args.cwd), {
|
|
8144
8144
|
runId: args.runId ?? `run-${Date.now()}`,
|
|
8145
8145
|
startedAtMs: Date.now() - result.durationMs,
|
|
8146
8146
|
userText: args.userText,
|
|
@@ -8731,7 +8731,7 @@ var LocalAgentMemory = class {
|
|
|
8731
8731
|
const openOpts = { cwd: this.workspaceCwd, memoryRoot };
|
|
8732
8732
|
if (embedding !== void 0) openOpts.embedding = embedding;
|
|
8733
8733
|
if (cfg?.backend !== void 0) openOpts.backend = cfg.backend;
|
|
8734
|
-
this.index = await
|
|
8734
|
+
this.index = await chunkZ2JFX372_cjs.IndexManager.open(openOpts);
|
|
8735
8735
|
await this.index.sync();
|
|
8736
8736
|
this.toolsCache = [
|
|
8737
8737
|
createMemorySearchTool({ index: this.index }),
|
|
@@ -8775,7 +8775,7 @@ var LocalAgentMemory = class {
|
|
|
8775
8775
|
* and the active-memory transcript writer. Three separate resolutions is how they drifted (#463).
|
|
8776
8776
|
*/
|
|
8777
8777
|
memoryRoot() {
|
|
8778
|
-
this.memoryRootCache ??=
|
|
8778
|
+
this.memoryRootCache ??= chunkNQTNSHSB_cjs.resolveMemoryRoot(this.workspaceCwd, this.options.memory);
|
|
8779
8779
|
return this.memoryRootCache;
|
|
8780
8780
|
}
|
|
8781
8781
|
buildActiveMemoryOptions(cfg) {
|
|
@@ -8890,7 +8890,7 @@ function createLocalAgentMemoryProvider(opts) {
|
|
|
8890
8890
|
return { facts: [], systemPromptAdditions: summary };
|
|
8891
8891
|
},
|
|
8892
8892
|
async recordSessionSummary(args) {
|
|
8893
|
-
await
|
|
8893
|
+
await chunkNQTNSHSB_cjs.writeSessionSummary(args);
|
|
8894
8894
|
},
|
|
8895
8895
|
async sync(handle) {
|
|
8896
8896
|
const state = handle[INTERNAL_LAM_KEY];
|
|
@@ -10983,5 +10983,6 @@ exports.computeCost = computeCost;
|
|
|
10983
10983
|
exports.generateCronId = generateCronId;
|
|
10984
10984
|
exports.getPricingEntry = getPricingEntry;
|
|
10985
10985
|
exports.openRouterMemoryEmbeddingProviderAdapter = openRouterMemoryEmbeddingProviderAdapter;
|
|
10986
|
-
|
|
10987
|
-
//# sourceMappingURL=chunk-
|
|
10986
|
+
exports.resolveSessionDir = resolveSessionDir;
|
|
10987
|
+
//# sourceMappingURL=chunk-VVJ7FQAQ.cjs.map
|
|
10988
|
+
//# sourceMappingURL=chunk-VVJ7FQAQ.cjs.map
|