@theokit/sdk 4.60.0 → 4.62.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 +108 -0
- package/dist/{agent-6ABK2DPG.js → agent-NVBFTY5H.js} +7 -7
- package/dist/{agent-6ABK2DPG.js.map → agent-NVBFTY5H.js.map} +1 -1
- package/dist/{agent-26RMDG4U.cjs → agent-VYPUO4UB.cjs} +8 -8
- package/dist/{agent-26RMDG4U.cjs.map → agent-VYPUO4UB.cjs.map} +1 -1
- package/dist/{chunk-KKK3FZ4A.cjs → chunk-2DG7KW4L.cjs} +3 -3
- package/dist/{chunk-KKK3FZ4A.cjs.map → chunk-2DG7KW4L.cjs.map} +1 -1
- package/dist/chunk-2UCFUSPW.cjs +468 -0
- package/dist/chunk-2UCFUSPW.cjs.map +1 -0
- package/dist/{chunk-Y2KJ7MYO.cjs → chunk-6OBIWHDR.cjs} +14 -14
- package/dist/{chunk-Y2KJ7MYO.cjs.map → chunk-6OBIWHDR.cjs.map} +1 -1
- package/dist/{chunk-23GPJGRR.cjs → chunk-AH6WD7JR.cjs} +250 -63
- package/dist/chunk-AH6WD7JR.cjs.map +1 -0
- package/dist/{chunk-3HDTP4ZO.cjs → chunk-CWHTMNNK.cjs} +4 -4
- package/dist/{chunk-3HDTP4ZO.cjs.map → chunk-CWHTMNNK.cjs.map} +1 -1
- package/dist/{chunk-E5MWNLRX.js → chunk-IBYRA5PM.js} +3 -3
- package/dist/{chunk-E5MWNLRX.js.map → chunk-IBYRA5PM.js.map} +1 -1
- package/dist/{chunk-43GFJ5SD.cjs → chunk-P5LCASTC.cjs} +19 -4
- package/dist/chunk-P5LCASTC.cjs.map +1 -0
- package/dist/{chunk-7OXXYBHD.js → chunk-QEKI3YKI.js} +3 -3
- package/dist/{chunk-7OXXYBHD.js.map → chunk-QEKI3YKI.js.map} +1 -1
- package/dist/{chunk-76XTUTKY.js → chunk-SKOCYA55.js} +200 -13
- package/dist/chunk-SKOCYA55.js.map +1 -0
- package/dist/chunk-WCLDJSMY.js +456 -0
- package/dist/chunk-WCLDJSMY.js.map +1 -0
- package/dist/{chunk-WG7R5W6R.js → chunk-YEXA3PGR.js} +3 -3
- package/dist/{chunk-WG7R5W6R.js.map → chunk-YEXA3PGR.js.map} +1 -1
- package/dist/{chunk-IACR5LEM.js → chunk-YXGAW7BB.js} +17 -2
- package/dist/chunk-YXGAW7BB.js.map +1 -0
- package/dist/{compact-session-YHFQIXV5.cjs → compact-session-GJXJD73F.cjs} +11 -11
- package/dist/{compact-session-YHFQIXV5.cjs.map → compact-session-GJXJD73F.cjs.map} +1 -1
- package/dist/{compact-session-QGDNP45U.js → compact-session-TSMQOIHO.js} +3 -3
- package/dist/{compact-session-QGDNP45U.js.map → compact-session-TSMQOIHO.js.map} +1 -1
- package/dist/cron.cjs +7 -7
- package/dist/cron.js +6 -6
- package/dist/eval.cjs +6 -6
- package/dist/eval.js +5 -5
- package/dist/{index-manager-KP2JAXKN.js → index-manager-AHAYJ33H.js} +4 -4
- package/dist/{index-manager-KP2JAXKN.js.map → index-manager-AHAYJ33H.js.map} +1 -1
- package/dist/{index-manager-YUORPS4G.cjs → index-manager-RHPFVFSC.cjs} +5 -5
- package/dist/{index-manager-YUORPS4G.cjs.map → index-manager-RHPFVFSC.cjs.map} +1 -1
- package/dist/index.cjs +69 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -9
- package/dist/index.js.map +1 -1
- package/dist/{inject-session-MLCJMYDG.cjs → inject-session-PPSO2IDD.cjs} +4 -4
- package/dist/{inject-session-MLCJMYDG.cjs.map → inject-session-PPSO2IDD.cjs.map} +1 -1
- package/dist/{inject-session-RBQZ45UM.js → inject-session-ZCQUB3IT.js} +3 -3
- package/dist/{inject-session-RBQZ45UM.js.map → inject-session-ZCQUB3IT.js.map} +1 -1
- package/dist/internal/memory/dreaming/phases.d.ts +21 -1
- package/dist/internal/memory/storage/index.cjs +10 -10
- package/dist/internal/memory/storage/index.js +1 -1
- package/dist/internal/memory/storage/memory-file.d.cts +41 -5
- package/dist/internal/memory/storage/memory-file.d.ts +41 -5
- package/dist/internal/memory/storage/threat-scan.d.cts +62 -0
- package/dist/internal/memory/storage/threat-scan.d.ts +62 -0
- package/dist/internal/memory/types.d.ts +28 -0
- package/dist/internal/runtime/memory/select-facts.d.ts +63 -0
- package/dist/internal/runtime/system-prompt/sources/memory-provider.d.ts +6 -1
- package/docs/error-codes.md +3 -2
- package/docs/harness-capability-map.md +9 -7
- package/docs/memory-decisions.md +207 -0
- package/package.json +1 -1
- package/dist/chunk-23GPJGRR.cjs.map +0 -1
- package/dist/chunk-43GFJ5SD.cjs.map +0 -1
- package/dist/chunk-76XTUTKY.js.map +0 -1
- package/dist/chunk-IACR5LEM.js.map +0 -1
- package/dist/chunk-JVERBPRD.js +0 -191
- package/dist/chunk-JVERBPRD.js.map +0 -1
- package/dist/chunk-NY25NBZB.cjs +0 -203
- package/dist/chunk-NY25NBZB.cjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -7,21 +7,21 @@ import { Workflow, agentStep } from './chunk-FUL2I7G5.js';
|
|
|
7
7
|
export { Workflow, agentStep, fn } from './chunk-FUL2I7G5.js';
|
|
8
8
|
import './chunk-AQLGBKNT.js';
|
|
9
9
|
import './chunk-HY66GLM6.js';
|
|
10
|
-
export { Cron } from './chunk-
|
|
11
|
-
import { MEMORY_EMBEDDING_ADAPTERS, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-
|
|
12
|
-
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-
|
|
10
|
+
export { Cron } from './chunk-IBYRA5PM.js';
|
|
11
|
+
import { MEMORY_EMBEDDING_ADAPTERS, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-SKOCYA55.js';
|
|
12
|
+
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-SKOCYA55.js';
|
|
13
13
|
import { configure, submit, list, get, cancel, subscribe } from './chunk-SUKXXLWD.js';
|
|
14
14
|
export { emitRunEvent } from './chunk-SUKXXLWD.js';
|
|
15
|
-
import './chunk-
|
|
15
|
+
import './chunk-YEXA3PGR.js';
|
|
16
16
|
import './chunk-K2BQQ445.js';
|
|
17
|
-
import { lanceStoragePath, LanceIndex, defaultIndexPath, openMemoryDb } from './chunk-
|
|
17
|
+
import { lanceStoragePath, LanceIndex, defaultIndexPath, openMemoryDb } from './chunk-QEKI3YKI.js';
|
|
18
18
|
import './chunk-MZ2FGBLZ.js';
|
|
19
19
|
import './chunk-2SFBB54R.js';
|
|
20
20
|
import './chunk-XN7NOENA.js';
|
|
21
21
|
import './chunk-H73MEMQB.js';
|
|
22
|
-
import { readFactsFromMarkdown, memoryDir } from './chunk-
|
|
22
|
+
import { readFactsFromMarkdown, memoryDir } from './chunk-WCLDJSMY.js';
|
|
23
23
|
import './chunk-YJDH3CKG.js';
|
|
24
|
-
import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-
|
|
24
|
+
import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-YXGAW7BB.js';
|
|
25
25
|
import './chunk-3E77SX4H.js';
|
|
26
26
|
import './chunk-WTMU7J4U.js';
|
|
27
27
|
import './chunk-5JLFFPCH.js';
|
|
@@ -1068,7 +1068,40 @@ function entryHash(entry) {
|
|
|
1068
1068
|
// src/internal/memory/dreaming/phases.ts
|
|
1069
1069
|
var DEFAULT_DEDUP_THRESHOLD = 0.95;
|
|
1070
1070
|
var DEFAULT_CLUSTER_THRESHOLD = 0.75;
|
|
1071
|
+
var CONSOLIDATABLE_KINDS = /* @__PURE__ */ new Set(["project", "session"]);
|
|
1072
|
+
var ATOMIC_KINDS = /* @__PURE__ */ new Set(["user", "feedback", "reference"]);
|
|
1073
|
+
function dedupPolicy(fact) {
|
|
1074
|
+
if (fact.kind === void 0) return "exact";
|
|
1075
|
+
if (ATOMIC_KINDS.has(fact.kind)) return "never";
|
|
1076
|
+
return CONSOLIDATABLE_KINDS.has(fact.kind) ? "similar" : "never";
|
|
1077
|
+
}
|
|
1078
|
+
function normalizeForExactMatch(text) {
|
|
1079
|
+
return text.trim().toLowerCase().replace(/\s+/g, " ").replace(/[.!?]+$/, "");
|
|
1080
|
+
}
|
|
1071
1081
|
async function lightPhase(facts, embedding, threshold = DEFAULT_DEDUP_THRESHOLD) {
|
|
1082
|
+
if (facts.length <= 1) return { kept: [...facts], duplicatesRemoved: 0 };
|
|
1083
|
+
const never = facts.filter((f) => dedupPolicy(f) === "never");
|
|
1084
|
+
const exact = facts.filter((f) => dedupPolicy(f) === "exact");
|
|
1085
|
+
const similar = facts.filter((f) => dedupPolicy(f) === "similar");
|
|
1086
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1087
|
+
const exactKept = [];
|
|
1088
|
+
let removed = 0;
|
|
1089
|
+
for (const f of exact) {
|
|
1090
|
+
const key = normalizeForExactMatch(f.text);
|
|
1091
|
+
if (seen.has(key)) {
|
|
1092
|
+
removed += 1;
|
|
1093
|
+
continue;
|
|
1094
|
+
}
|
|
1095
|
+
seen.add(key);
|
|
1096
|
+
exactKept.push(f);
|
|
1097
|
+
}
|
|
1098
|
+
const sim = similar.length > 1 ? await dedupCandidates(similar, embedding, threshold) : { kept: [...similar], duplicatesRemoved: 0 };
|
|
1099
|
+
return {
|
|
1100
|
+
kept: [...never, ...exactKept, ...sim.kept],
|
|
1101
|
+
duplicatesRemoved: removed + sim.duplicatesRemoved
|
|
1102
|
+
};
|
|
1103
|
+
}
|
|
1104
|
+
async function dedupCandidates(facts, embedding, threshold) {
|
|
1072
1105
|
if (facts.length <= 1) return { kept: [...facts], duplicatesRemoved: 0 };
|
|
1073
1106
|
const vectors = await embedding.embed(facts.map((f) => f.text));
|
|
1074
1107
|
const keptIdx = [];
|
|
@@ -1271,7 +1304,7 @@ var Memory = {
|
|
|
1271
1304
|
openArgs.embedding = await resolveEmbedding(opts.embedding, peer.MEMORY_EMBEDDING_ADAPTERS);
|
|
1272
1305
|
return await peer.IndexManager.open(openArgs);
|
|
1273
1306
|
}
|
|
1274
|
-
const { IndexManager } = await import('./index-manager-
|
|
1307
|
+
const { IndexManager } = await import('./index-manager-AHAYJ33H.js');
|
|
1275
1308
|
openArgs.embedding = await resolveEmbedding(opts.embedding, MEMORY_EMBEDDING_ADAPTERS);
|
|
1276
1309
|
return await IndexManager.open(openArgs);
|
|
1277
1310
|
},
|
|
@@ -1845,7 +1878,7 @@ function isBuiltAgent(m) {
|
|
|
1845
1878
|
return typeof m.send === "function";
|
|
1846
1879
|
}
|
|
1847
1880
|
async function materialize(def, index) {
|
|
1848
|
-
const { Agent: Agent2 } = await import('./agent-
|
|
1881
|
+
const { Agent: Agent2 } = await import('./agent-NVBFTY5H.js');
|
|
1849
1882
|
return Agent2.create({
|
|
1850
1883
|
// `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
|
|
1851
1884
|
// here means "declare nothing and let the default apply" — forwarding the literal would create
|