@theokit/sdk 4.58.0 → 4.60.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 +41 -0
- package/dist/{agent-MIYY7TXV.cjs → agent-26RMDG4U.cjs} +8 -7
- package/dist/{agent-MIYY7TXV.cjs.map → agent-26RMDG4U.cjs.map} +1 -1
- package/dist/{agent-6WM4QOWS.js → agent-6ABK2DPG.js} +7 -6
- package/dist/{agent-6WM4QOWS.js.map → agent-6ABK2DPG.js.map} +1 -1
- package/dist/{chunk-N47KLTKD.cjs → chunk-23GPJGRR.cjs} +45 -28
- package/dist/chunk-23GPJGRR.cjs.map +1 -0
- package/dist/{chunk-QIRDQZYL.cjs → chunk-3HDTP4ZO.cjs} +4 -4
- package/dist/{chunk-QIRDQZYL.cjs.map → chunk-3HDTP4ZO.cjs.map} +1 -1
- 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-CF5OMCZG.js → chunk-76XTUTKY.js} +34 -17
- package/dist/chunk-76XTUTKY.js.map +1 -0
- package/dist/{chunk-WLZ7XRWH.js → chunk-7OXXYBHD.js} +7 -179
- package/dist/chunk-7OXXYBHD.js.map +1 -0
- package/dist/{chunk-5QOIQJ5J.js → chunk-E5MWNLRX.js} +3 -3
- package/dist/{chunk-5QOIQJ5J.js.map → chunk-E5MWNLRX.js.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-JVERBPRD.js +191 -0
- package/dist/chunk-JVERBPRD.js.map +1 -0
- package/dist/chunk-NY25NBZB.cjs +203 -0
- package/dist/chunk-NY25NBZB.cjs.map +1 -0
- package/dist/{chunk-27AXGJMV.cjs → chunk-Y2KJ7MYO.cjs} +14 -194
- package/dist/chunk-Y2KJ7MYO.cjs.map +1 -0
- package/dist/cron.cjs +7 -6
- package/dist/cron.js +6 -5
- package/dist/eval.cjs +6 -5
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +5 -4
- package/dist/eval.js.map +1 -1
- package/dist/{index-manager-WYESAVTX.js → index-manager-KP2JAXKN.js} +4 -3
- package/dist/{index-manager-WYESAVTX.js.map → index-manager-KP2JAXKN.js.map} +1 -1
- package/dist/{index-manager-J2QIDI6I.cjs → index-manager-YUORPS4G.cjs} +5 -4
- package/dist/{index-manager-J2QIDI6I.cjs.map → index-manager-YUORPS4G.cjs.map} +1 -1
- package/dist/index.cjs +35 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -11
- package/dist/index.js.map +1 -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 +46 -5
- package/dist/internal/memory/storage/memory-file.d.cts +54 -0
- 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/transcript-store.d.cts +1 -0
- package/dist/internal/memory/storage/wiki-loader.d.cts +2 -0
- package/dist/internal/persistence/session-dir.d.cts +15 -0
- package/dist/internal/persistence/session-dir.d.ts +15 -0
- package/dist/internal/runtime/memory/memory-store.d.ts +2 -2
- package/dist/workflow.cjs +9 -9
- package/dist/workflow.js +1 -1
- package/docs/error-codes.md +1 -1
- package/docs/harness-capability-map.md +15 -1
- package/package.json +11 -1
- package/dist/chunk-27AXGJMV.cjs.map +0 -1
- package/dist/chunk-CF5OMCZG.js.map +0 -1
- package/dist/chunk-N47KLTKD.cjs.map +0 -1
- package/dist/chunk-WLZ7XRWH.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -5,19 +5,20 @@ var chunkOBA6YK2R_cjs = require('./chunk-OBA6YK2R.cjs');
|
|
|
5
5
|
var chunkGWC3HADL_cjs = require('./chunk-GWC3HADL.cjs');
|
|
6
6
|
var chunkP6A3M6VD_cjs = require('./chunk-P6A3M6VD.cjs');
|
|
7
7
|
require('./chunk-QDED6YO6.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunk6SBW4QR2_cjs = require('./chunk-6SBW4QR2.cjs');
|
|
9
9
|
require('./chunk-XWL6O3SW.cjs');
|
|
10
10
|
require('./chunk-VTYY7XL5.cjs');
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var chunk3HDTP4ZO_cjs = require('./chunk-3HDTP4ZO.cjs');
|
|
12
|
+
var chunk23GPJGRR_cjs = require('./chunk-23GPJGRR.cjs');
|
|
13
|
+
var chunkNGESVVJN_cjs = require('./chunk-NGESVVJN.cjs');
|
|
13
14
|
require('./chunk-KKK3FZ4A.cjs');
|
|
14
|
-
|
|
15
|
+
require('./chunk-BUUUWQMB.cjs');
|
|
16
|
+
var chunkY2KJ7MYO_cjs = require('./chunk-Y2KJ7MYO.cjs');
|
|
15
17
|
require('./chunk-P6H23T43.cjs');
|
|
16
18
|
require('./chunk-BV2MWEMV.cjs');
|
|
17
|
-
var chunkNGESVVJN_cjs = require('./chunk-NGESVVJN.cjs');
|
|
18
|
-
require('./chunk-BUUUWQMB.cjs');
|
|
19
19
|
require('./chunk-EI2Q7SJ5.cjs');
|
|
20
20
|
require('./chunk-GHX4P3V2.cjs');
|
|
21
|
+
var chunkNY25NBZB_cjs = require('./chunk-NY25NBZB.cjs');
|
|
21
22
|
require('./chunk-QI7WE46I.cjs');
|
|
22
23
|
var chunk43GFJ5SD_cjs = require('./chunk-43GFJ5SD.cjs');
|
|
23
24
|
require('./chunk-F3YZMOAU.cjs');
|
|
@@ -70,8 +71,8 @@ var fs = require('fs');
|
|
|
70
71
|
// src/agent-factory.ts
|
|
71
72
|
function createAgentFactory(common) {
|
|
72
73
|
return {
|
|
73
|
-
forSession: (agentId, overrides) =>
|
|
74
|
-
getOrCreate: (agentId, overrides) =>
|
|
74
|
+
forSession: (agentId, overrides) => chunk23GPJGRR_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
|
|
75
|
+
getOrCreate: (agentId, overrides) => chunk23GPJGRR_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
78
|
function mergeAgentOptions(common, overrides, agentId) {
|
|
@@ -1019,7 +1020,7 @@ function foldLayers(entries, accumulatingKeys = []) {
|
|
|
1019
1020
|
return combined;
|
|
1020
1021
|
}
|
|
1021
1022
|
function diaryPath(cwd) {
|
|
1022
|
-
return path.join(
|
|
1023
|
+
return path.join(chunkNY25NBZB_cjs.memoryDir(cwd), "dream-diary.md");
|
|
1023
1024
|
}
|
|
1024
1025
|
function renderDiaryEntry(entry) {
|
|
1025
1026
|
const stamp = new Date(entry.timestampMs).toISOString();
|
|
@@ -1166,7 +1167,7 @@ async function runInner(options) {
|
|
|
1166
1167
|
const now = options.now ?? Date.now;
|
|
1167
1168
|
const timestampMs = now();
|
|
1168
1169
|
try {
|
|
1169
|
-
const facts = await
|
|
1170
|
+
const facts = await chunkNY25NBZB_cjs.readFactsFromMarkdown(options.cwd);
|
|
1170
1171
|
if (facts.length === 0) {
|
|
1171
1172
|
return emptyResult("skipped");
|
|
1172
1173
|
}
|
|
@@ -1200,7 +1201,7 @@ async function runInner(options) {
|
|
|
1200
1201
|
}
|
|
1201
1202
|
async function writeConsolidatedNotes(cwd, clusters, timestampMs) {
|
|
1202
1203
|
if (clusters.length === 0) return 0;
|
|
1203
|
-
const notesDir = path.join(
|
|
1204
|
+
const notesDir = path.join(chunkNY25NBZB_cjs.memoryDir(cwd), "notes");
|
|
1204
1205
|
await promises.mkdir(notesDir, { recursive: true });
|
|
1205
1206
|
const isoSlug = new Date(timestampMs).toISOString().replace(/[^\dT]/g, "-");
|
|
1206
1207
|
const file = path.join(notesDir, `dreamed-${isoSlug}.md`);
|
|
@@ -1266,8 +1267,8 @@ var Memory = {
|
|
|
1266
1267
|
openArgs.embedding = await resolveEmbedding(opts.embedding, peer.MEMORY_EMBEDDING_ADAPTERS);
|
|
1267
1268
|
return await peer.IndexManager.open(openArgs);
|
|
1268
1269
|
}
|
|
1269
|
-
const { IndexManager } = await import('./index-manager-
|
|
1270
|
-
openArgs.embedding = await resolveEmbedding(opts.embedding,
|
|
1270
|
+
const { IndexManager } = await import('./index-manager-YUORPS4G.cjs');
|
|
1271
|
+
openArgs.embedding = await resolveEmbedding(opts.embedding, chunk23GPJGRR_cjs.MEMORY_EMBEDDING_ADAPTERS);
|
|
1271
1272
|
return await IndexManager.open(openArgs);
|
|
1272
1273
|
},
|
|
1273
1274
|
/**
|
|
@@ -1278,7 +1279,7 @@ var Memory = {
|
|
|
1278
1279
|
*/
|
|
1279
1280
|
async runDreamingSweep(opts) {
|
|
1280
1281
|
const peer = await tryLoadSdkMemoryPeer();
|
|
1281
|
-
const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS :
|
|
1282
|
+
const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunk23GPJGRR_cjs.MEMORY_EMBEDDING_ADAPTERS;
|
|
1282
1283
|
const sweepArgs = await buildDreamingSweepArgs(opts, catalog);
|
|
1283
1284
|
const result = peer !== null ? (
|
|
1284
1285
|
// biome-ignore lint/suspicious/noExplicitAny: peer is dynamically loaded — structural compat ensured by sdk-memory
|
|
@@ -1344,9 +1345,9 @@ function extractRawId(id, expectedAdapterId) {
|
|
|
1344
1345
|
return id.slice(prefix.length);
|
|
1345
1346
|
}
|
|
1346
1347
|
async function readAllSqliteFacts(cwd) {
|
|
1347
|
-
const dbPath =
|
|
1348
|
+
const dbPath = chunkY2KJ7MYO_cjs.defaultIndexPath(cwd);
|
|
1348
1349
|
if (!fs.existsSync(dbPath)) return [];
|
|
1349
|
-
const db = await
|
|
1350
|
+
const db = await chunkY2KJ7MYO_cjs.openMemoryDb({ filePath: dbPath });
|
|
1350
1351
|
try {
|
|
1351
1352
|
const stmt = db.prepare("SELECT id, path, source, start_line, end_line, text FROM chunks");
|
|
1352
1353
|
const rows = stmt.all();
|
|
@@ -1365,7 +1366,7 @@ function nfcEqual(a, b) {
|
|
|
1365
1366
|
}
|
|
1366
1367
|
async function migrateSqliteToLance(opts) {
|
|
1367
1368
|
const cwd = opts.cwd;
|
|
1368
|
-
const finalPath =
|
|
1369
|
+
const finalPath = chunkY2KJ7MYO_cjs.lanceStoragePath(cwd);
|
|
1369
1370
|
const newPath = path.join(cwd, ".theokit", "memory", "lance-new");
|
|
1370
1371
|
const rawLog = opts.logger ?? ((m) => console.log(m));
|
|
1371
1372
|
const log = (m) => rawLog(chunkJTB5Q42C_cjs.redactSecrets(m));
|
|
@@ -1409,7 +1410,7 @@ async function migrateSqliteToLance(opts) {
|
|
|
1409
1410
|
};
|
|
1410
1411
|
fs.mkdirSync(newPath, { recursive: true });
|
|
1411
1412
|
log(`Writing Lance index to ${newPath} ...`);
|
|
1412
|
-
const lance = await
|
|
1413
|
+
const lance = await chunkY2KJ7MYO_cjs.LanceIndex.open({
|
|
1413
1414
|
cwd,
|
|
1414
1415
|
embedding: placeholderEmbedding,
|
|
1415
1416
|
storagePath: newPath
|
|
@@ -1840,7 +1841,7 @@ function isBuiltAgent(m) {
|
|
|
1840
1841
|
return typeof m.send === "function";
|
|
1841
1842
|
}
|
|
1842
1843
|
async function materialize(def, index) {
|
|
1843
|
-
const { Agent: Agent2 } = await import('./agent-
|
|
1844
|
+
const { Agent: Agent2 } = await import('./agent-26RMDG4U.cjs');
|
|
1844
1845
|
return Agent2.create({
|
|
1845
1846
|
// `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
|
|
1846
1847
|
// here means "declare nothing and let the default apply" — forwarding the literal would create
|
|
@@ -1872,13 +1873,13 @@ function createSquad(options) {
|
|
|
1872
1873
|
};
|
|
1873
1874
|
}
|
|
1874
1875
|
async function buildPipeline(agents, nome) {
|
|
1875
|
-
let builder =
|
|
1876
|
+
let builder = chunk6SBW4QR2_cjs.Workflow.create({ name: nome ?? "squad" });
|
|
1876
1877
|
for (let i = 0; i < agents.length; i++) {
|
|
1877
1878
|
const member = agents[i];
|
|
1878
1879
|
if (member === void 0) continue;
|
|
1879
1880
|
const agent = isBuiltAgent(member) ? member : await materialize(member, i);
|
|
1880
1881
|
const opts = i > 0 ? { origin: { kind: "peer", from: `agent-${i - 1}` } } : void 0;
|
|
1881
|
-
builder = builder.then(
|
|
1882
|
+
builder = builder.then(chunk6SBW4QR2_cjs.agentStep(`agent-${i}`, agent, (prev) => String(prev), opts));
|
|
1882
1883
|
}
|
|
1883
1884
|
return builder.commit();
|
|
1884
1885
|
}
|
|
@@ -1982,7 +1983,7 @@ var FIXTURE_USER = {
|
|
|
1982
1983
|
};
|
|
1983
1984
|
var FIXTURE_MODELS = [
|
|
1984
1985
|
{
|
|
1985
|
-
id:
|
|
1986
|
+
id: chunk23GPJGRR_cjs.DEFAULT_AGENTIC_MODEL_ID,
|
|
1986
1987
|
name: "Gemini 2.0 Flash",
|
|
1987
1988
|
displayName: "Gemini 2.0 Flash",
|
|
1988
1989
|
parameters: [
|
|
@@ -2185,7 +2186,7 @@ var Theokit = class {
|
|
|
2185
2186
|
envVars: p.envVars
|
|
2186
2187
|
}));
|
|
2187
2188
|
},
|
|
2188
|
-
embeddingAdapters: () => Object.entries(
|
|
2189
|
+
embeddingAdapters: () => Object.entries(chunk23GPJGRR_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
|
|
2189
2190
|
id,
|
|
2190
2191
|
transport: adapter.transport,
|
|
2191
2192
|
defaultModel: adapter.defaultModel
|
|
@@ -2392,47 +2393,47 @@ Object.defineProperty(exports, "GenerateObjectError", {
|
|
|
2392
2393
|
});
|
|
2393
2394
|
Object.defineProperty(exports, "Workflow", {
|
|
2394
2395
|
enumerable: true,
|
|
2395
|
-
get: function () { return
|
|
2396
|
+
get: function () { return chunk6SBW4QR2_cjs.Workflow; }
|
|
2396
2397
|
});
|
|
2397
2398
|
Object.defineProperty(exports, "agentStep", {
|
|
2398
2399
|
enumerable: true,
|
|
2399
|
-
get: function () { return
|
|
2400
|
+
get: function () { return chunk6SBW4QR2_cjs.agentStep; }
|
|
2400
2401
|
});
|
|
2401
2402
|
Object.defineProperty(exports, "fn", {
|
|
2402
2403
|
enumerable: true,
|
|
2403
|
-
get: function () { return
|
|
2404
|
+
get: function () { return chunk6SBW4QR2_cjs.fn; }
|
|
2404
2405
|
});
|
|
2405
2406
|
Object.defineProperty(exports, "Cron", {
|
|
2406
2407
|
enumerable: true,
|
|
2407
|
-
get: function () { return
|
|
2408
|
+
get: function () { return chunk3HDTP4ZO_cjs.Cron; }
|
|
2408
2409
|
});
|
|
2409
2410
|
Object.defineProperty(exports, "Agent", {
|
|
2410
2411
|
enumerable: true,
|
|
2411
|
-
get: function () { return
|
|
2412
|
+
get: function () { return chunk23GPJGRR_cjs.Agent; }
|
|
2412
2413
|
});
|
|
2413
2414
|
Object.defineProperty(exports, "AgentBuilder", {
|
|
2414
2415
|
enumerable: true,
|
|
2415
|
-
get: function () { return
|
|
2416
|
+
get: function () { return chunk23GPJGRR_cjs.AgentBuilder; }
|
|
2416
2417
|
});
|
|
2417
2418
|
Object.defineProperty(exports, "Tool", {
|
|
2418
2419
|
enumerable: true,
|
|
2419
|
-
get: function () { return
|
|
2420
|
+
get: function () { return chunk23GPJGRR_cjs.Tool; }
|
|
2420
2421
|
});
|
|
2421
2422
|
Object.defineProperty(exports, "ToolError", {
|
|
2422
2423
|
enumerable: true,
|
|
2423
|
-
get: function () { return
|
|
2424
|
+
get: function () { return chunk23GPJGRR_cjs.ToolError; }
|
|
2424
2425
|
});
|
|
2425
2426
|
Object.defineProperty(exports, "UsageAccumulator", {
|
|
2426
2427
|
enumerable: true,
|
|
2427
|
-
get: function () { return
|
|
2428
|
+
get: function () { return chunk23GPJGRR_cjs.UsageAccumulator; }
|
|
2428
2429
|
});
|
|
2429
2430
|
Object.defineProperty(exports, "computeCost", {
|
|
2430
2431
|
enumerable: true,
|
|
2431
|
-
get: function () { return
|
|
2432
|
+
get: function () { return chunk23GPJGRR_cjs.computeCost; }
|
|
2432
2433
|
});
|
|
2433
2434
|
Object.defineProperty(exports, "getPricingEntry", {
|
|
2434
2435
|
enumerable: true,
|
|
2435
|
-
get: function () { return
|
|
2436
|
+
get: function () { return chunk23GPJGRR_cjs.getPricingEntry; }
|
|
2436
2437
|
});
|
|
2437
2438
|
Object.defineProperty(exports, "emitRunEvent", {
|
|
2438
2439
|
enumerable: true,
|