@theokit/sdk 4.59.0 → 4.61.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 +55 -0
- package/dist/{agent-VHRX7XGW.cjs → agent-M53C3PAA.cjs} +10 -9
- package/dist/{agent-VHRX7XGW.cjs.map → agent-M53C3PAA.cjs.map} +1 -1
- package/dist/{agent-ST27RIJE.js → agent-P42GA6RM.js} +9 -8
- package/dist/{agent-ST27RIJE.js.map → agent-P42GA6RM.js.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-D5NWEOCO.js → chunk-532CSLYU.js} +3 -3
- package/dist/{chunk-D5NWEOCO.js.map → chunk-532CSLYU.js.map} +1 -1
- package/dist/{chunk-7GUIET73.cjs → chunk-5IT6DUOO.cjs} +4 -4
- package/dist/{chunk-7GUIET73.cjs.map → chunk-5IT6DUOO.cjs.map} +1 -1
- package/dist/{chunk-554J7UQH.cjs → chunk-6OBIWHDR.cjs} +14 -201
- package/dist/chunk-6OBIWHDR.cjs.map +1 -0
- package/dist/{chunk-GNT35C5U.cjs → chunk-6SBW4QR2.cjs} +2 -2
- package/dist/{chunk-GNT35C5U.cjs.map → chunk-6SBW4QR2.cjs.map} +1 -1
- package/dist/{chunk-XV4IZNV4.js → chunk-FUL2I7G5.js} +2 -2
- package/dist/{chunk-XV4IZNV4.js.map → chunk-FUL2I7G5.js.map} +1 -1
- package/dist/{chunk-7LOIUIQZ.js → chunk-GQZKDGZM.js} +168 -13
- package/dist/chunk-GQZKDGZM.js.map +1 -0
- package/dist/{chunk-43GFJ5SD.cjs → chunk-P5LCASTC.cjs} +19 -4
- package/dist/chunk-P5LCASTC.cjs.map +1 -0
- package/dist/{chunk-ZA255A62.js → chunk-QEKI3YKI.js} +7 -186
- package/dist/chunk-QEKI3YKI.js.map +1 -0
- package/dist/{chunk-SMUAG2DY.cjs → chunk-R7YIVL3K.cjs} +218 -63
- package/dist/chunk-R7YIVL3K.cjs.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 +9 -8
- package/dist/cron.js +8 -7
- package/dist/eval.cjs +8 -7
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +7 -6
- package/dist/eval.js.map +1 -1
- package/dist/{index-manager-A64I7KYV.js → index-manager-AHAYJ33H.js} +4 -3
- package/dist/{index-manager-A64I7KYV.js.map → index-manager-AHAYJ33H.js.map} +1 -1
- package/dist/{index-manager-A3XPHAWF.cjs → index-manager-RHPFVFSC.cjs} +5 -4
- package/dist/{index-manager-A3XPHAWF.cjs.map → index-manager-RHPFVFSC.cjs.map} +1 -1
- package/dist/index.cjs +77 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -12
- 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/chunk-markdown.d.cts +2 -0
- package/dist/internal/memory/storage/index.cjs +54 -0
- package/dist/internal/memory/storage/index.cjs.map +1 -0
- package/dist/internal/memory/storage/index.d.cts +18 -0
- package/dist/internal/memory/storage/index.d.ts +18 -0
- package/dist/internal/memory/storage/index.js +13 -0
- package/dist/internal/memory/storage/index.js.map +1 -0
- package/dist/internal/memory/storage/markdown-store.d.cts +77 -0
- package/dist/internal/memory/storage/markdown-store.d.ts +25 -1
- package/dist/internal/memory/storage/memory-file.d.cts +90 -0
- package/dist/internal/memory/storage/memory-file.d.ts +41 -5
- package/dist/internal/memory/storage/reader.d.cts +8 -0
- package/dist/internal/memory/storage/session-loader.d.cts +1 -0
- package/dist/internal/memory/storage/session-summary-writer.d.cts +2 -0
- 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/storage/transcript-store.d.cts +1 -0
- package/dist/internal/memory/storage/wiki-loader.d.cts +2 -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/dist/workflow.cjs +9 -9
- package/dist/workflow.js +1 -1
- package/docs/error-codes.md +3 -2
- package/docs/harness-capability-map.md +23 -7
- package/docs/memory-decisions.md +207 -0
- package/package.json +11 -1
- package/dist/chunk-43GFJ5SD.cjs.map +0 -1
- package/dist/chunk-554J7UQH.cjs.map +0 -1
- package/dist/chunk-7LOIUIQZ.js.map +0 -1
- package/dist/chunk-IACR5LEM.js.map +0 -1
- package/dist/chunk-SMUAG2DY.cjs.map +0 -1
- package/dist/chunk-ZA255A62.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -3,24 +3,25 @@ export { GOAL_CONTINUATION_MARKER } from './chunk-PY2RQOA7.js';
|
|
|
3
3
|
export { JudgeCredentialError } from './chunk-T73NA43R.js';
|
|
4
4
|
export { GenerateObjectError } from './chunk-QRSUA2CV.js';
|
|
5
5
|
import './chunk-AEOZTXVW.js';
|
|
6
|
-
import { Workflow, agentStep } from './chunk-
|
|
7
|
-
export { Workflow, agentStep, fn } from './chunk-
|
|
6
|
+
import { Workflow, agentStep } from './chunk-FUL2I7G5.js';
|
|
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-
|
|
13
|
-
import './chunk-WG7R5W6R.js';
|
|
14
|
-
import { lanceStoragePath, LanceIndex, readFactsFromMarkdown, defaultIndexPath, openMemoryDb, memoryDir } from './chunk-ZA255A62.js';
|
|
15
|
-
import './chunk-MZ2FGBLZ.js';
|
|
16
|
-
import './chunk-2SFBB54R.js';
|
|
10
|
+
export { Cron } from './chunk-532CSLYU.js';
|
|
11
|
+
import { MEMORY_EMBEDDING_ADAPTERS, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-GQZKDGZM.js';
|
|
12
|
+
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-GQZKDGZM.js';
|
|
17
13
|
import { configure, submit, list, get, cancel, subscribe } from './chunk-SUKXXLWD.js';
|
|
18
14
|
export { emitRunEvent } from './chunk-SUKXXLWD.js';
|
|
15
|
+
import './chunk-YEXA3PGR.js';
|
|
19
16
|
import './chunk-K2BQQ445.js';
|
|
17
|
+
import { lanceStoragePath, LanceIndex, defaultIndexPath, openMemoryDb } from './chunk-QEKI3YKI.js';
|
|
18
|
+
import './chunk-MZ2FGBLZ.js';
|
|
19
|
+
import './chunk-2SFBB54R.js';
|
|
20
20
|
import './chunk-XN7NOENA.js';
|
|
21
21
|
import './chunk-H73MEMQB.js';
|
|
22
|
+
import { readFactsFromMarkdown, memoryDir } from './chunk-WCLDJSMY.js';
|
|
22
23
|
import './chunk-YJDH3CKG.js';
|
|
23
|
-
import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-
|
|
24
|
+
import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-YXGAW7BB.js';
|
|
24
25
|
import './chunk-3E77SX4H.js';
|
|
25
26
|
import './chunk-WTMU7J4U.js';
|
|
26
27
|
import './chunk-5JLFFPCH.js';
|
|
@@ -1067,7 +1068,40 @@ function entryHash(entry) {
|
|
|
1067
1068
|
// src/internal/memory/dreaming/phases.ts
|
|
1068
1069
|
var DEFAULT_DEDUP_THRESHOLD = 0.95;
|
|
1069
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
|
+
}
|
|
1070
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) {
|
|
1071
1105
|
if (facts.length <= 1) return { kept: [...facts], duplicatesRemoved: 0 };
|
|
1072
1106
|
const vectors = await embedding.embed(facts.map((f) => f.text));
|
|
1073
1107
|
const keptIdx = [];
|
|
@@ -1270,7 +1304,7 @@ var Memory = {
|
|
|
1270
1304
|
openArgs.embedding = await resolveEmbedding(opts.embedding, peer.MEMORY_EMBEDDING_ADAPTERS);
|
|
1271
1305
|
return await peer.IndexManager.open(openArgs);
|
|
1272
1306
|
}
|
|
1273
|
-
const { IndexManager } = await import('./index-manager-
|
|
1307
|
+
const { IndexManager } = await import('./index-manager-AHAYJ33H.js');
|
|
1274
1308
|
openArgs.embedding = await resolveEmbedding(opts.embedding, MEMORY_EMBEDDING_ADAPTERS);
|
|
1275
1309
|
return await IndexManager.open(openArgs);
|
|
1276
1310
|
},
|
|
@@ -1844,7 +1878,7 @@ function isBuiltAgent(m) {
|
|
|
1844
1878
|
return typeof m.send === "function";
|
|
1845
1879
|
}
|
|
1846
1880
|
async function materialize(def, index) {
|
|
1847
|
-
const { Agent: Agent2 } = await import('./agent-
|
|
1881
|
+
const { Agent: Agent2 } = await import('./agent-P42GA6RM.js');
|
|
1848
1882
|
return Agent2.create({
|
|
1849
1883
|
// `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
|
|
1850
1884
|
// here means "declare nothing and let the default apply" — forwarding the literal would create
|