@theokit/sdk 4.57.0 → 4.58.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 +99 -0
- package/dist/{agent-ZIYCVEZL.js → agent-6WM4QOWS.js} +10 -9
- package/dist/{agent-ZIYCVEZL.js.map → agent-6WM4QOWS.js.map} +1 -1
- package/dist/{agent-2T2EJIP6.cjs → agent-MIYY7TXV.cjs} +11 -10
- package/dist/{agent-2T2EJIP6.cjs.map → agent-MIYY7TXV.cjs.map} +1 -1
- package/dist/{chunk-E7JHD6QJ.cjs → chunk-27AXGJMV.cjs} +25 -15
- package/dist/chunk-27AXGJMV.cjs.map +1 -0
- package/dist/{chunk-LEM2GOMI.js → chunk-5QOIQJ5J.js} +3 -3
- package/dist/{chunk-LEM2GOMI.js.map → chunk-5QOIQJ5J.js.map} +1 -1
- package/dist/{chunk-E3WZ6Y4H.cjs → chunk-7BG5UH3T.cjs} +8 -8
- package/dist/{chunk-E3WZ6Y4H.cjs.map → chunk-7BG5UH3T.cjs.map} +1 -1
- package/dist/chunk-AQO3NSRG.cjs +41 -0
- package/dist/chunk-AQO3NSRG.cjs.map +1 -0
- package/dist/{chunk-7TCRNXNK.js → chunk-CF5OMCZG.js} +40 -16
- package/dist/chunk-CF5OMCZG.js.map +1 -0
- package/dist/{chunk-U2AC6JUP.cjs → chunk-J2UROOIG.cjs} +2 -27
- package/dist/chunk-J2UROOIG.cjs.map +1 -0
- package/dist/{chunk-ZNW6V4Y6.cjs → chunk-LKFET5A3.cjs} +23 -2
- package/dist/chunk-LKFET5A3.cjs.map +1 -0
- package/dist/{chunk-YMA4S2WO.js → chunk-MZ2FGBLZ.js} +33 -11
- package/dist/chunk-MZ2FGBLZ.js.map +1 -0
- package/dist/{chunk-M2JWHKO6.cjs → chunk-N47KLTKD.cjs} +76 -52
- package/dist/chunk-N47KLTKD.cjs.map +1 -0
- package/dist/{chunk-53CBTBWO.cjs → chunk-P6H23T43.cjs} +33 -11
- package/dist/chunk-P6H23T43.cjs.map +1 -0
- package/dist/{chunk-X7O4255I.cjs → chunk-QIRDQZYL.cjs} +4 -4
- package/dist/{chunk-X7O4255I.cjs.map → chunk-QIRDQZYL.cjs.map} +1 -1
- package/dist/{chunk-7FHZ4VQX.js → chunk-SAVIWMZB.js} +3 -3
- package/dist/{chunk-7FHZ4VQX.js.map → chunk-SAVIWMZB.js.map} +1 -1
- package/dist/{chunk-UPRJR6IP.js → chunk-UCBJBJ27.js} +3 -25
- package/dist/chunk-UCBJBJ27.js.map +1 -0
- package/dist/chunk-UFLD2HEV.js +35 -0
- package/dist/chunk-UFLD2HEV.js.map +1 -0
- package/dist/{chunk-GTKFV7O5.js → chunk-WFC26L6Y.js} +23 -2
- package/dist/chunk-WFC26L6Y.js.map +1 -0
- package/dist/{chunk-G6EEYRDD.js → chunk-WLZ7XRWH.js} +24 -14
- package/dist/chunk-WLZ7XRWH.js.map +1 -0
- package/dist/{chunk-HJBMA5MB.cjs → chunk-WNTAPVU5.cjs} +47 -6
- package/dist/chunk-WNTAPVU5.cjs.map +1 -0
- package/dist/{chunk-2QKTVKH3.js → chunk-ZHPWGIUX.js} +48 -8
- package/dist/chunk-ZHPWGIUX.js.map +1 -0
- package/dist/context/index.cjs +7 -7
- package/dist/context/index.js +3 -3
- package/dist/{context-VMIE4BMD.cjs → context-LCKNH2XI.cjs} +7 -6
- package/dist/{context-VMIE4BMD.cjs.map → context-LCKNH2XI.cjs.map} +1 -1
- package/dist/context-MZSKGKYR.js +7 -0
- package/dist/{context-FDOON2DB.js.map → context-MZSKGKYR.js.map} +1 -1
- package/dist/cron.cjs +10 -9
- 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/{index-manager-AO4LJQZ4.cjs → index-manager-J2QIDI6I.cjs} +5 -4
- package/dist/{index-manager-AO4LJQZ4.cjs.map → index-manager-J2QIDI6I.cjs.map} +1 -1
- package/dist/{index-manager-QDPIYIGV.js → index-manager-WYESAVTX.js} +4 -3
- package/dist/{index-manager-QDPIYIGV.js.map → index-manager-WYESAVTX.js.map} +1 -1
- package/dist/index.cjs +32 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -13
- package/dist/index.js.map +1 -1
- package/dist/internal/memory/storage/markdown-store.d.ts +13 -0
- package/dist/internal/persistence/index.cjs +17 -16
- package/dist/internal/persistence/index.cjs.map +1 -1
- package/dist/internal/persistence/index.js +2 -1
- package/dist/internal/persistence/index.js.map +1 -1
- package/dist/internal/persistence/paths.d.cts +42 -0
- package/dist/internal/persistence/paths.d.ts +42 -0
- package/dist/internal/runtime/plugins/plugin-bundles.d.ts +19 -0
- package/dist/project.cjs +3 -3
- package/dist/project.js +1 -1
- package/dist/subagents-loader-6ATCDEKN.js +8 -0
- package/dist/{subagents-loader-J54ESLDV.js.map → subagents-loader-6ATCDEKN.js.map} +1 -1
- package/dist/subagents-loader-X5QKODCL.cjs +17 -0
- package/dist/{subagents-loader-AZIXJ7D3.cjs.map → subagents-loader-X5QKODCL.cjs.map} +1 -1
- package/dist/subagents-loader.cjs +3 -2
- package/dist/subagents-loader.cjs.map +1 -1
- package/dist/subagents-loader.js +2 -1
- package/dist/subagents-loader.js.map +1 -1
- package/docs/error-codes.md +15 -15
- package/package.json +1 -1
- package/dist/chunk-2QKTVKH3.js.map +0 -1
- package/dist/chunk-53CBTBWO.cjs.map +0 -1
- package/dist/chunk-7TCRNXNK.js.map +0 -1
- package/dist/chunk-E7JHD6QJ.cjs.map +0 -1
- package/dist/chunk-G6EEYRDD.js.map +0 -1
- package/dist/chunk-GTKFV7O5.js.map +0 -1
- package/dist/chunk-HJBMA5MB.cjs.map +0 -1
- package/dist/chunk-M2JWHKO6.cjs.map +0 -1
- package/dist/chunk-U2AC6JUP.cjs.map +0 -1
- package/dist/chunk-UPRJR6IP.js.map +0 -1
- package/dist/chunk-YMA4S2WO.js.map +0 -1
- package/dist/chunk-ZNW6V4Y6.cjs.map +0 -1
- package/dist/context-FDOON2DB.js +0 -6
- package/dist/subagents-loader-AZIXJ7D3.cjs +0 -16
- package/dist/subagents-loader-J54ESLDV.js +0 -7
package/dist/index.cjs
CHANGED
|
@@ -8,11 +8,11 @@ require('./chunk-QDED6YO6.cjs');
|
|
|
8
8
|
var chunkGNT35C5U_cjs = require('./chunk-GNT35C5U.cjs');
|
|
9
9
|
require('./chunk-XWL6O3SW.cjs');
|
|
10
10
|
require('./chunk-VTYY7XL5.cjs');
|
|
11
|
-
var
|
|
12
|
-
var
|
|
11
|
+
var chunkQIRDQZYL_cjs = require('./chunk-QIRDQZYL.cjs');
|
|
12
|
+
var chunkN47KLTKD_cjs = require('./chunk-N47KLTKD.cjs');
|
|
13
13
|
require('./chunk-KKK3FZ4A.cjs');
|
|
14
|
-
var
|
|
15
|
-
require('./chunk-
|
|
14
|
+
var chunk27AXGJMV_cjs = require('./chunk-27AXGJMV.cjs');
|
|
15
|
+
require('./chunk-P6H23T43.cjs');
|
|
16
16
|
require('./chunk-BV2MWEMV.cjs');
|
|
17
17
|
var chunkNGESVVJN_cjs = require('./chunk-NGESVVJN.cjs');
|
|
18
18
|
require('./chunk-BUUUWQMB.cjs');
|
|
@@ -25,9 +25,9 @@ require('./chunk-4OTIXDMU.cjs');
|
|
|
25
25
|
require('./chunk-DQKERTND.cjs');
|
|
26
26
|
require('./chunk-Z4BCLVTI.cjs');
|
|
27
27
|
require('./chunk-2ZPEDVLM.cjs');
|
|
28
|
-
require('./chunk-
|
|
28
|
+
require('./chunk-7BG5UH3T.cjs');
|
|
29
29
|
require('./chunk-KRD3GQAA.cjs');
|
|
30
|
-
require('./chunk-
|
|
30
|
+
require('./chunk-J2UROOIG.cjs');
|
|
31
31
|
require('./chunk-MUUQ2WFJ.cjs');
|
|
32
32
|
var chunkWJVHMTKB_cjs = require('./chunk-WJVHMTKB.cjs');
|
|
33
33
|
require('./chunk-6JSIEDKL.cjs');
|
|
@@ -35,7 +35,7 @@ require('./chunk-FRITRLZQ.cjs');
|
|
|
35
35
|
require('./chunk-4O5TGQBW.cjs');
|
|
36
36
|
require('./chunk-NINIJCHU.cjs');
|
|
37
37
|
require('./chunk-3YJNUKYN.cjs');
|
|
38
|
-
require('./chunk-
|
|
38
|
+
require('./chunk-LKFET5A3.cjs');
|
|
39
39
|
require('./chunk-VJ26EKGJ.cjs');
|
|
40
40
|
require('./chunk-R3UPQFKK.cjs');
|
|
41
41
|
require('./chunk-VKJ7V7EB.cjs');
|
|
@@ -48,7 +48,8 @@ require('./chunk-2ADR2GSO.cjs');
|
|
|
48
48
|
var chunkZF2LDKQQ_cjs = require('./chunk-ZF2LDKQQ.cjs');
|
|
49
49
|
var chunk2C72DXQF_cjs = require('./chunk-2C72DXQF.cjs');
|
|
50
50
|
var chunkI6TGFUCO_cjs = require('./chunk-I6TGFUCO.cjs');
|
|
51
|
-
require('./chunk-
|
|
51
|
+
require('./chunk-WNTAPVU5.cjs');
|
|
52
|
+
require('./chunk-AQO3NSRG.cjs');
|
|
52
53
|
require('./chunk-IWBGCBR6.cjs');
|
|
53
54
|
require('./chunk-XSX2UU6Y.cjs');
|
|
54
55
|
var chunk3EE6LVWT_cjs = require('./chunk-3EE6LVWT.cjs');
|
|
@@ -69,8 +70,8 @@ var fs = require('fs');
|
|
|
69
70
|
// src/agent-factory.ts
|
|
70
71
|
function createAgentFactory(common) {
|
|
71
72
|
return {
|
|
72
|
-
forSession: (agentId, overrides) =>
|
|
73
|
-
getOrCreate: (agentId, overrides) =>
|
|
73
|
+
forSession: (agentId, overrides) => chunkN47KLTKD_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
|
|
74
|
+
getOrCreate: (agentId, overrides) => chunkN47KLTKD_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
77
|
function mergeAgentOptions(common, overrides, agentId) {
|
|
@@ -1018,7 +1019,7 @@ function foldLayers(entries, accumulatingKeys = []) {
|
|
|
1018
1019
|
return combined;
|
|
1019
1020
|
}
|
|
1020
1021
|
function diaryPath(cwd) {
|
|
1021
|
-
return path.join(
|
|
1022
|
+
return path.join(chunk27AXGJMV_cjs.memoryDir(cwd), "dream-diary.md");
|
|
1022
1023
|
}
|
|
1023
1024
|
function renderDiaryEntry(entry) {
|
|
1024
1025
|
const stamp = new Date(entry.timestampMs).toISOString();
|
|
@@ -1165,7 +1166,7 @@ async function runInner(options) {
|
|
|
1165
1166
|
const now = options.now ?? Date.now;
|
|
1166
1167
|
const timestampMs = now();
|
|
1167
1168
|
try {
|
|
1168
|
-
const facts = await
|
|
1169
|
+
const facts = await chunk27AXGJMV_cjs.readFactsFromMarkdown(options.cwd);
|
|
1169
1170
|
if (facts.length === 0) {
|
|
1170
1171
|
return emptyResult("skipped");
|
|
1171
1172
|
}
|
|
@@ -1199,7 +1200,7 @@ async function runInner(options) {
|
|
|
1199
1200
|
}
|
|
1200
1201
|
async function writeConsolidatedNotes(cwd, clusters, timestampMs) {
|
|
1201
1202
|
if (clusters.length === 0) return 0;
|
|
1202
|
-
const notesDir = path.join(
|
|
1203
|
+
const notesDir = path.join(chunk27AXGJMV_cjs.memoryDir(cwd), "notes");
|
|
1203
1204
|
await promises.mkdir(notesDir, { recursive: true });
|
|
1204
1205
|
const isoSlug = new Date(timestampMs).toISOString().replace(/[^\dT]/g, "-");
|
|
1205
1206
|
const file = path.join(notesDir, `dreamed-${isoSlug}.md`);
|
|
@@ -1265,8 +1266,8 @@ var Memory = {
|
|
|
1265
1266
|
openArgs.embedding = await resolveEmbedding(opts.embedding, peer.MEMORY_EMBEDDING_ADAPTERS);
|
|
1266
1267
|
return await peer.IndexManager.open(openArgs);
|
|
1267
1268
|
}
|
|
1268
|
-
const { IndexManager } = await import('./index-manager-
|
|
1269
|
-
openArgs.embedding = await resolveEmbedding(opts.embedding,
|
|
1269
|
+
const { IndexManager } = await import('./index-manager-J2QIDI6I.cjs');
|
|
1270
|
+
openArgs.embedding = await resolveEmbedding(opts.embedding, chunkN47KLTKD_cjs.MEMORY_EMBEDDING_ADAPTERS);
|
|
1270
1271
|
return await IndexManager.open(openArgs);
|
|
1271
1272
|
},
|
|
1272
1273
|
/**
|
|
@@ -1277,7 +1278,7 @@ var Memory = {
|
|
|
1277
1278
|
*/
|
|
1278
1279
|
async runDreamingSweep(opts) {
|
|
1279
1280
|
const peer = await tryLoadSdkMemoryPeer();
|
|
1280
|
-
const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS :
|
|
1281
|
+
const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunkN47KLTKD_cjs.MEMORY_EMBEDDING_ADAPTERS;
|
|
1281
1282
|
const sweepArgs = await buildDreamingSweepArgs(opts, catalog);
|
|
1282
1283
|
const result = peer !== null ? (
|
|
1283
1284
|
// biome-ignore lint/suspicious/noExplicitAny: peer is dynamically loaded — structural compat ensured by sdk-memory
|
|
@@ -1343,9 +1344,9 @@ function extractRawId(id, expectedAdapterId) {
|
|
|
1343
1344
|
return id.slice(prefix.length);
|
|
1344
1345
|
}
|
|
1345
1346
|
async function readAllSqliteFacts(cwd) {
|
|
1346
|
-
const dbPath =
|
|
1347
|
+
const dbPath = chunk27AXGJMV_cjs.defaultIndexPath(cwd);
|
|
1347
1348
|
if (!fs.existsSync(dbPath)) return [];
|
|
1348
|
-
const db = await
|
|
1349
|
+
const db = await chunk27AXGJMV_cjs.openMemoryDb({ filePath: dbPath });
|
|
1349
1350
|
try {
|
|
1350
1351
|
const stmt = db.prepare("SELECT id, path, source, start_line, end_line, text FROM chunks");
|
|
1351
1352
|
const rows = stmt.all();
|
|
@@ -1364,7 +1365,7 @@ function nfcEqual(a, b) {
|
|
|
1364
1365
|
}
|
|
1365
1366
|
async function migrateSqliteToLance(opts) {
|
|
1366
1367
|
const cwd = opts.cwd;
|
|
1367
|
-
const finalPath =
|
|
1368
|
+
const finalPath = chunk27AXGJMV_cjs.lanceStoragePath(cwd);
|
|
1368
1369
|
const newPath = path.join(cwd, ".theokit", "memory", "lance-new");
|
|
1369
1370
|
const rawLog = opts.logger ?? ((m) => console.log(m));
|
|
1370
1371
|
const log = (m) => rawLog(chunkJTB5Q42C_cjs.redactSecrets(m));
|
|
@@ -1408,7 +1409,7 @@ async function migrateSqliteToLance(opts) {
|
|
|
1408
1409
|
};
|
|
1409
1410
|
fs.mkdirSync(newPath, { recursive: true });
|
|
1410
1411
|
log(`Writing Lance index to ${newPath} ...`);
|
|
1411
|
-
const lance = await
|
|
1412
|
+
const lance = await chunk27AXGJMV_cjs.LanceIndex.open({
|
|
1412
1413
|
cwd,
|
|
1413
1414
|
embedding: placeholderEmbedding,
|
|
1414
1415
|
storagePath: newPath
|
|
@@ -1595,8 +1596,6 @@ var SOVEREIGN_ENV_KEYS = [
|
|
|
1595
1596
|
"THEOKIT_HOME",
|
|
1596
1597
|
/** Locates the credential store explicitly, independently of `THEOKIT_HOME`. */
|
|
1597
1598
|
"THEOKIT_AUTH_HOME",
|
|
1598
|
-
/** Names the project config directory, so it decides which files are READ as configuration. */
|
|
1599
|
-
"THEOKIT_DIR_NAME",
|
|
1600
1599
|
/** A trust decision: which providers are honoured without further checks. */
|
|
1601
1600
|
"THEOKIT_TRUSTED_PROVIDERS",
|
|
1602
1601
|
/** Turning redaction off from a repository's `.env` would put secrets into logs. */
|
|
@@ -1841,7 +1840,7 @@ function isBuiltAgent(m) {
|
|
|
1841
1840
|
return typeof m.send === "function";
|
|
1842
1841
|
}
|
|
1843
1842
|
async function materialize(def, index) {
|
|
1844
|
-
const { Agent: Agent2 } = await import('./agent-
|
|
1843
|
+
const { Agent: Agent2 } = await import('./agent-MIYY7TXV.cjs');
|
|
1845
1844
|
return Agent2.create({
|
|
1846
1845
|
// `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
|
|
1847
1846
|
// here means "declare nothing and let the default apply" — forwarding the literal would create
|
|
@@ -1983,7 +1982,7 @@ var FIXTURE_USER = {
|
|
|
1983
1982
|
};
|
|
1984
1983
|
var FIXTURE_MODELS = [
|
|
1985
1984
|
{
|
|
1986
|
-
id:
|
|
1985
|
+
id: chunkN47KLTKD_cjs.DEFAULT_AGENTIC_MODEL_ID,
|
|
1987
1986
|
name: "Gemini 2.0 Flash",
|
|
1988
1987
|
displayName: "Gemini 2.0 Flash",
|
|
1989
1988
|
parameters: [
|
|
@@ -2186,7 +2185,7 @@ var Theokit = class {
|
|
|
2186
2185
|
envVars: p.envVars
|
|
2187
2186
|
}));
|
|
2188
2187
|
},
|
|
2189
|
-
embeddingAdapters: () => Object.entries(
|
|
2188
|
+
embeddingAdapters: () => Object.entries(chunkN47KLTKD_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
|
|
2190
2189
|
id,
|
|
2191
2190
|
transport: adapter.transport,
|
|
2192
2191
|
defaultModel: adapter.defaultModel
|
|
@@ -2405,35 +2404,35 @@ Object.defineProperty(exports, "fn", {
|
|
|
2405
2404
|
});
|
|
2406
2405
|
Object.defineProperty(exports, "Cron", {
|
|
2407
2406
|
enumerable: true,
|
|
2408
|
-
get: function () { return
|
|
2407
|
+
get: function () { return chunkQIRDQZYL_cjs.Cron; }
|
|
2409
2408
|
});
|
|
2410
2409
|
Object.defineProperty(exports, "Agent", {
|
|
2411
2410
|
enumerable: true,
|
|
2412
|
-
get: function () { return
|
|
2411
|
+
get: function () { return chunkN47KLTKD_cjs.Agent; }
|
|
2413
2412
|
});
|
|
2414
2413
|
Object.defineProperty(exports, "AgentBuilder", {
|
|
2415
2414
|
enumerable: true,
|
|
2416
|
-
get: function () { return
|
|
2415
|
+
get: function () { return chunkN47KLTKD_cjs.AgentBuilder; }
|
|
2417
2416
|
});
|
|
2418
2417
|
Object.defineProperty(exports, "Tool", {
|
|
2419
2418
|
enumerable: true,
|
|
2420
|
-
get: function () { return
|
|
2419
|
+
get: function () { return chunkN47KLTKD_cjs.Tool; }
|
|
2421
2420
|
});
|
|
2422
2421
|
Object.defineProperty(exports, "ToolError", {
|
|
2423
2422
|
enumerable: true,
|
|
2424
|
-
get: function () { return
|
|
2423
|
+
get: function () { return chunkN47KLTKD_cjs.ToolError; }
|
|
2425
2424
|
});
|
|
2426
2425
|
Object.defineProperty(exports, "UsageAccumulator", {
|
|
2427
2426
|
enumerable: true,
|
|
2428
|
-
get: function () { return
|
|
2427
|
+
get: function () { return chunkN47KLTKD_cjs.UsageAccumulator; }
|
|
2429
2428
|
});
|
|
2430
2429
|
Object.defineProperty(exports, "computeCost", {
|
|
2431
2430
|
enumerable: true,
|
|
2432
|
-
get: function () { return
|
|
2431
|
+
get: function () { return chunkN47KLTKD_cjs.computeCost; }
|
|
2433
2432
|
});
|
|
2434
2433
|
Object.defineProperty(exports, "getPricingEntry", {
|
|
2435
2434
|
enumerable: true,
|
|
2436
|
-
get: function () { return
|
|
2435
|
+
get: function () { return chunkN47KLTKD_cjs.getPricingEntry; }
|
|
2437
2436
|
});
|
|
2438
2437
|
Object.defineProperty(exports, "emitRunEvent", {
|
|
2439
2438
|
enumerable: true,
|