@theokit/sdk 5.11.0 → 5.11.1

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.
Files changed (52) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/dist/{agent-GWKRARAL.js → agent-DFV52V6E.js} +7 -7
  3. package/dist/{agent-GWKRARAL.js.map → agent-DFV52V6E.js.map} +1 -1
  4. package/dist/{agent-5DOR5T3E.cjs → agent-OKP4LHG2.cjs} +8 -8
  5. package/dist/{agent-5DOR5T3E.cjs.map → agent-OKP4LHG2.cjs.map} +1 -1
  6. package/dist/{chunk-5OHB5HJF.cjs → chunk-35KBC4BX.cjs} +133 -93
  7. package/dist/chunk-35KBC4BX.cjs.map +1 -0
  8. package/dist/{chunk-N7ZIPW2N.cjs → chunk-3JANYJYS.cjs} +3 -3
  9. package/dist/{chunk-N7ZIPW2N.cjs.map → chunk-3JANYJYS.cjs.map} +1 -1
  10. package/dist/{chunk-Z5BAFHPU.js → chunk-6G4IRQUD.js} +3 -3
  11. package/dist/{chunk-Z5BAFHPU.js.map → chunk-6G4IRQUD.js.map} +1 -1
  12. package/dist/{chunk-74OA5DIM.js → chunk-BBJ77S62.js} +3 -3
  13. package/dist/{chunk-74OA5DIM.js.map → chunk-BBJ77S62.js.map} +1 -1
  14. package/dist/{chunk-5H2GJXGC.cjs → chunk-EQ5NCH2Y.cjs} +4 -4
  15. package/dist/{chunk-5H2GJXGC.cjs.map → chunk-EQ5NCH2Y.cjs.map} +1 -1
  16. package/dist/{chunk-TE6XVTOA.js → chunk-JLIRFWUG.js} +47 -17
  17. package/dist/chunk-JLIRFWUG.js.map +1 -0
  18. package/dist/{chunk-YEHQ3SIC.cjs → chunk-JV7JA7BM.cjs} +5 -5
  19. package/dist/{chunk-YEHQ3SIC.cjs.map → chunk-JV7JA7BM.cjs.map} +1 -1
  20. package/dist/{chunk-4PHSVR2R.js → chunk-MHIBYKWA.js} +83 -43
  21. package/dist/chunk-MHIBYKWA.js.map +1 -0
  22. package/dist/{chunk-WPO3VCY4.cjs → chunk-N7KS3TIR.cjs} +47 -17
  23. package/dist/chunk-N7KS3TIR.cjs.map +1 -0
  24. package/dist/{chunk-BZKF7TXX.cjs → chunk-P5N3Q2NH.cjs} +22 -22
  25. package/dist/{chunk-BZKF7TXX.cjs.map → chunk-P5N3Q2NH.cjs.map} +1 -1
  26. package/dist/{chunk-7Y23B7XX.js → chunk-Q34EBNYG.js} +3 -3
  27. package/dist/{chunk-7Y23B7XX.js.map → chunk-Q34EBNYG.js.map} +1 -1
  28. package/dist/{chunk-HI3W37FY.js → chunk-U27XHOEF.js} +3 -3
  29. package/dist/{chunk-HI3W37FY.js.map → chunk-U27XHOEF.js.map} +1 -1
  30. package/dist/{compact-session-F2UDGZCN.js → compact-session-4HAUP3HK.js} +4 -4
  31. package/dist/{compact-session-F2UDGZCN.js.map → compact-session-4HAUP3HK.js.map} +1 -1
  32. package/dist/{compact-session-2AETONOS.cjs → compact-session-Y56D3S57.cjs} +13 -13
  33. package/dist/{compact-session-2AETONOS.cjs.map → compact-session-Y56D3S57.cjs.map} +1 -1
  34. package/dist/cron.cjs +7 -7
  35. package/dist/cron.js +6 -6
  36. package/dist/eval.cjs +6 -6
  37. package/dist/eval.js +5 -5
  38. package/dist/index.cjs +33 -33
  39. package/dist/index.js +9 -9
  40. package/dist/{inject-session-E5UDFVLI.js → inject-session-LJX5JGV5.js} +3 -3
  41. package/dist/{inject-session-E5UDFVLI.js.map → inject-session-LJX5JGV5.js.map} +1 -1
  42. package/dist/{inject-session-W4UKACYJ.cjs → inject-session-R73PRM7B.cjs} +4 -4
  43. package/dist/{inject-session-W4UKACYJ.cjs.map → inject-session-R73PRM7B.cjs.map} +1 -1
  44. package/dist/internal/error-mappers/openai-compatible.d.ts +3 -1
  45. package/dist/internal/memory/adapters/index.cjs +3 -3
  46. package/dist/internal/memory/adapters/index.js +2 -2
  47. package/docs/error-codes.md +6 -3
  48. package/package.json +1 -1
  49. package/dist/chunk-4PHSVR2R.js.map +0 -1
  50. package/dist/chunk-5OHB5HJF.cjs.map +0 -1
  51. package/dist/chunk-TE6XVTOA.js.map +0 -1
  52. package/dist/chunk-WPO3VCY4.cjs.map +0 -1
package/dist/index.cjs CHANGED
@@ -9,23 +9,23 @@ require('./chunk-D5KXKBEN.cjs');
9
9
  var chunkMPQJE3G4_cjs = require('./chunk-MPQJE3G4.cjs');
10
10
  require('./chunk-6PB5AQCY.cjs');
11
11
  require('./chunk-VTYY7XL5.cjs');
12
- var chunk5H2GJXGC_cjs = require('./chunk-5H2GJXGC.cjs');
13
- var chunk5OHB5HJF_cjs = require('./chunk-5OHB5HJF.cjs');
12
+ var chunkEQ5NCH2Y_cjs = require('./chunk-EQ5NCH2Y.cjs');
13
+ var chunk35KBC4BX_cjs = require('./chunk-35KBC4BX.cjs');
14
14
  var chunkJ6GXS5A2_cjs = require('./chunk-J6GXS5A2.cjs');
15
- require('./chunk-N7ZIPW2N.cjs');
15
+ require('./chunk-3JANYJYS.cjs');
16
16
  require('./chunk-BUUUWQMB.cjs');
17
17
  require('./chunk-L3C6CCBG.cjs');
18
18
  require('./chunk-KIKKTW5O.cjs');
19
19
  require('./chunk-BV2MWEMV.cjs');
20
- require('./chunk-YEHQ3SIC.cjs');
20
+ require('./chunk-JV7JA7BM.cjs');
21
21
  require('./chunk-GHX4P3V2.cjs');
22
22
  require('./chunk-TMKTSYDS.cjs');
23
23
  var chunkZD66GFH5_cjs = require('./chunk-ZD66GFH5.cjs');
24
24
  var chunkNQVWSSX2_cjs = require('./chunk-NQVWSSX2.cjs');
25
- var chunkBZKF7TXX_cjs = require('./chunk-BZKF7TXX.cjs');
25
+ var chunkP5N3Q2NH_cjs = require('./chunk-P5N3Q2NH.cjs');
26
26
  require('./chunk-CQYBJOB2.cjs');
27
27
  require('./chunk-YJNYDJ2T.cjs');
28
- require('./chunk-WPO3VCY4.cjs');
28
+ require('./chunk-N7KS3TIR.cjs');
29
29
  require('./chunk-QOGNZMHD.cjs');
30
30
  var chunkZAM7BJXJ_cjs = require('./chunk-ZAM7BJXJ.cjs');
31
31
  require('./chunk-2ZPEDVLM.cjs');
@@ -79,8 +79,8 @@ var os = require('os');
79
79
  // src/agent-factory.ts
80
80
  function createAgentFactory(common) {
81
81
  return {
82
- forSession: (agentId, overrides) => chunk5OHB5HJF_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
83
- getOrCreate: (agentId, overrides) => chunk5OHB5HJF_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
82
+ forSession: (agentId, overrides) => chunk35KBC4BX_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
83
+ getOrCreate: (agentId, overrides) => chunk35KBC4BX_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
84
84
  };
85
85
  }
86
86
  function mergeAgentOptions(common, overrides, agentId) {
@@ -1284,7 +1284,7 @@ var Memory = {
1284
1284
  return await peer.IndexManager.open(openArgs);
1285
1285
  }
1286
1286
  const { IndexManager } = await import('./index-manager-YGXRFJMZ.cjs');
1287
- openArgs.embedding = await resolveEmbedding(opts.embedding, chunk5OHB5HJF_cjs.MEMORY_EMBEDDING_ADAPTERS);
1287
+ openArgs.embedding = await resolveEmbedding(opts.embedding, chunk35KBC4BX_cjs.MEMORY_EMBEDDING_ADAPTERS);
1288
1288
  return await IndexManager.open(openArgs);
1289
1289
  },
1290
1290
  /**
@@ -1295,7 +1295,7 @@ var Memory = {
1295
1295
  */
1296
1296
  async runDreamingSweep(opts) {
1297
1297
  const peer = await tryLoadSdkMemoryPeer();
1298
- const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunk5OHB5HJF_cjs.MEMORY_EMBEDDING_ADAPTERS;
1298
+ const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunk35KBC4BX_cjs.MEMORY_EMBEDDING_ADAPTERS;
1299
1299
  const sweepArgs = await buildDreamingSweepArgs(opts, catalog);
1300
1300
  const result = peer !== null ? (
1301
1301
  // biome-ignore lint/suspicious/noExplicitAny: peer is dynamically loaded — structural compat ensured by sdk-memory
@@ -1906,7 +1906,7 @@ function guardSessionDestruction(sessionId, live) {
1906
1906
  // src/session-messages.ts
1907
1907
  async function readSessionMessages2(options) {
1908
1908
  const cwd = options.cwd ?? process.cwd();
1909
- const baseDir = chunk5OHB5HJF_cjs.resolveSessionDir({ sessionDir: options.sessionDir });
1909
+ const baseDir = chunk35KBC4BX_cjs.resolveSessionDir({ sessionDir: options.sessionDir });
1910
1910
  return chunkZAM7BJXJ_cjs.readSessionMessages(new chunkNQVWSSX2_cjs.FsSessionStore({ baseDir, cwd }), options.sessionId);
1911
1911
  }
1912
1912
 
@@ -1923,7 +1923,7 @@ function isBuiltAgent(m) {
1923
1923
  return typeof m.send === "function";
1924
1924
  }
1925
1925
  async function materialize(def, index) {
1926
- const { Agent: Agent2 } = await import('./agent-5DOR5T3E.cjs');
1926
+ const { Agent: Agent2 } = await import('./agent-OKP4LHG2.cjs');
1927
1927
  return Agent2.create({
1928
1928
  // `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
1929
1929
  // here means "declare nothing and let the default apply" — forwarding the literal would create
@@ -2065,7 +2065,7 @@ var FIXTURE_USER = {
2065
2065
  };
2066
2066
  var FIXTURE_MODELS = [
2067
2067
  {
2068
- id: chunk5OHB5HJF_cjs.DEFAULT_AGENTIC_MODEL_ID,
2068
+ id: chunk35KBC4BX_cjs.DEFAULT_AGENTIC_MODEL_ID,
2069
2069
  name: "Gemini 2.0 Flash",
2070
2070
  displayName: "Gemini 2.0 Flash",
2071
2071
  parameters: [
@@ -2141,7 +2141,7 @@ async function listLocalModelsViaOpenAiCompat(baseUrl) {
2141
2141
  try {
2142
2142
  response = await fetch(url, { method: "GET" });
2143
2143
  } catch (fetchErr) {
2144
- const mapped = chunkBZKF7TXX_cjs.mapOllamaTransportError({
2144
+ const mapped = chunkP5N3Q2NH_cjs.mapOllamaTransportError({
2145
2145
  providerId: "ollama",
2146
2146
  cause: fetchErr,
2147
2147
  endpoint: "/v1/models"
@@ -2153,8 +2153,8 @@ async function listLocalModelsViaOpenAiCompat(baseUrl) {
2153
2153
  );
2154
2154
  }
2155
2155
  if (!response.ok) {
2156
- const body = await chunkBZKF7TXX_cjs.readErrorResponseBody(response);
2157
- const mapped = chunkBZKF7TXX_cjs.mapOllamaHttpError({
2156
+ const body = await chunkP5N3Q2NH_cjs.readErrorResponseBody(response);
2157
+ const mapped = chunkP5N3Q2NH_cjs.mapOllamaHttpError({
2158
2158
  providerId: "ollama",
2159
2159
  status: response.status,
2160
2160
  body,
@@ -2268,7 +2268,7 @@ var Theokit = class {
2268
2268
  envVars: p.envVars
2269
2269
  }));
2270
2270
  },
2271
- embeddingAdapters: () => Object.entries(chunk5OHB5HJF_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
2271
+ embeddingAdapters: () => Object.entries(chunk35KBC4BX_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
2272
2272
  id,
2273
2273
  transport: adapter.transport,
2274
2274
  defaultModel: adapter.defaultModel
@@ -2286,7 +2286,7 @@ var Theokit = class {
2286
2286
  };
2287
2287
  async function maybeListLocalModels(providerName) {
2288
2288
  chunkHU666T3Q_cjs.registerBuiltins();
2289
- await chunkBZKF7TXX_cjs.discoverProviderPlugins();
2289
+ await chunkP5N3Q2NH_cjs.discoverProviderPlugins();
2290
2290
  const profile = chunkHU666T3Q_cjs.getProviderProfile(providerName);
2291
2291
  if (profile === void 0) return void 0;
2292
2292
  if (profile.authType !== "none") return void 0;
@@ -2304,13 +2304,13 @@ async function executeCatalogRequest(request) {
2304
2304
  if (apiKey === void 0) {
2305
2305
  throw new chunkUNFBHV46_cjs.AuthenticationError("Missing API key", { code: "missing_api_key" });
2306
2306
  }
2307
- if (chunkBZKF7TXX_cjs.shouldUseFixtureMode(apiKey)) {
2307
+ if (chunkP5N3Q2NH_cjs.shouldUseFixtureMode(apiKey)) {
2308
2308
  return request.fixture;
2309
2309
  }
2310
- if (!chunkBZKF7TXX_cjs.isFixtureApiKey(apiKey) && process.env.THEOKIT_API_BASE_URL === void 0) {
2310
+ if (!chunkP5N3Q2NH_cjs.isFixtureApiKey(apiKey) && process.env.THEOKIT_API_BASE_URL === void 0) {
2311
2311
  throw new chunkUNFBHV46_cjs.AuthenticationError("Invalid API key", { code: "authentication_error" });
2312
2312
  }
2313
- return chunkBZKF7TXX_cjs.httpRequest(request.path, { apiKey });
2313
+ return chunkP5N3Q2NH_cjs.httpRequest(request.path, { apiKey });
2314
2314
  }
2315
2315
 
2316
2316
  // src/tool-blast-radius.ts
@@ -2487,43 +2487,43 @@ Object.defineProperty(exports, "fn", {
2487
2487
  });
2488
2488
  Object.defineProperty(exports, "Cron", {
2489
2489
  enumerable: true,
2490
- get: function () { return chunk5H2GJXGC_cjs.Cron; }
2490
+ get: function () { return chunkEQ5NCH2Y_cjs.Cron; }
2491
2491
  });
2492
2492
  Object.defineProperty(exports, "Agent", {
2493
2493
  enumerable: true,
2494
- get: function () { return chunk5OHB5HJF_cjs.Agent; }
2494
+ get: function () { return chunk35KBC4BX_cjs.Agent; }
2495
2495
  });
2496
2496
  Object.defineProperty(exports, "AgentBuilder", {
2497
2497
  enumerable: true,
2498
- get: function () { return chunk5OHB5HJF_cjs.AgentBuilder; }
2498
+ get: function () { return chunk35KBC4BX_cjs.AgentBuilder; }
2499
2499
  });
2500
2500
  Object.defineProperty(exports, "Tool", {
2501
2501
  enumerable: true,
2502
- get: function () { return chunk5OHB5HJF_cjs.Tool; }
2502
+ get: function () { return chunk35KBC4BX_cjs.Tool; }
2503
2503
  });
2504
2504
  Object.defineProperty(exports, "ToolError", {
2505
2505
  enumerable: true,
2506
- get: function () { return chunk5OHB5HJF_cjs.ToolError; }
2506
+ get: function () { return chunk35KBC4BX_cjs.ToolError; }
2507
2507
  });
2508
2508
  Object.defineProperty(exports, "UsageAccumulator", {
2509
2509
  enumerable: true,
2510
- get: function () { return chunk5OHB5HJF_cjs.UsageAccumulator; }
2510
+ get: function () { return chunk35KBC4BX_cjs.UsageAccumulator; }
2511
2511
  });
2512
2512
  Object.defineProperty(exports, "computeCost", {
2513
2513
  enumerable: true,
2514
- get: function () { return chunk5OHB5HJF_cjs.computeCost; }
2514
+ get: function () { return chunk35KBC4BX_cjs.computeCost; }
2515
2515
  });
2516
2516
  Object.defineProperty(exports, "getPricingEntry", {
2517
2517
  enumerable: true,
2518
- get: function () { return chunk5OHB5HJF_cjs.getPricingEntry; }
2518
+ get: function () { return chunk35KBC4BX_cjs.getPricingEntry; }
2519
2519
  });
2520
2520
  Object.defineProperty(exports, "managedSettingsPathFor", {
2521
2521
  enumerable: true,
2522
- get: function () { return chunk5OHB5HJF_cjs.managedSettingsPathFor; }
2522
+ get: function () { return chunk35KBC4BX_cjs.managedSettingsPathFor; }
2523
2523
  });
2524
2524
  Object.defineProperty(exports, "readManagedSettings", {
2525
2525
  enumerable: true,
2526
- get: function () { return chunk5OHB5HJF_cjs.readManagedSettings; }
2526
+ get: function () { return chunk35KBC4BX_cjs.readManagedSettings; }
2527
2527
  });
2528
2528
  Object.defineProperty(exports, "emitRunEvent", {
2529
2529
  enumerable: true,
@@ -2531,11 +2531,11 @@ Object.defineProperty(exports, "emitRunEvent", {
2531
2531
  });
2532
2532
  Object.defineProperty(exports, "inferApiMode", {
2533
2533
  enumerable: true,
2534
- get: function () { return chunkBZKF7TXX_cjs.inferApiMode; }
2534
+ get: function () { return chunkP5N3Q2NH_cjs.inferApiMode; }
2535
2535
  });
2536
2536
  Object.defineProperty(exports, "normalizeUsage", {
2537
2537
  enumerable: true,
2538
- get: function () { return chunkBZKF7TXX_cjs.normalizeUsage; }
2538
+ get: function () { return chunkP5N3Q2NH_cjs.normalizeUsage; }
2539
2539
  });
2540
2540
  Object.defineProperty(exports, "withCwdMutex", {
2541
2541
  enumerable: true,
package/dist/index.js CHANGED
@@ -8,26 +8,26 @@ import { Workflow, agentStep } from './chunk-MU7IAA7G.js';
8
8
  export { Workflow, agentStep, fn } from './chunk-MU7IAA7G.js';
9
9
  import './chunk-HV4V63CO.js';
10
10
  import './chunk-HY66GLM6.js';
11
- export { Cron } from './chunk-Z5BAFHPU.js';
12
- import { MEMORY_EMBEDDING_ADAPTERS, resolveSessionDir, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-4PHSVR2R.js';
13
- export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry, managedSettingsPathFor, readManagedSettings } from './chunk-4PHSVR2R.js';
11
+ export { Cron } from './chunk-6G4IRQUD.js';
12
+ import { MEMORY_EMBEDDING_ADAPTERS, resolveSessionDir, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-MHIBYKWA.js';
13
+ export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry, managedSettingsPathFor, readManagedSettings } from './chunk-MHIBYKWA.js';
14
14
  import { configure, submit, list, get, cancel, subscribe } from './chunk-XKMVJ443.js';
15
15
  export { emitRunEvent } from './chunk-XKMVJ443.js';
16
- import './chunk-7Y23B7XX.js';
16
+ import './chunk-Q34EBNYG.js';
17
17
  import './chunk-K2BQQ445.js';
18
18
  import './chunk-DPY2M74T.js';
19
19
  import './chunk-ZHWKT2NI.js';
20
20
  import './chunk-2SFBB54R.js';
21
- import './chunk-HI3W37FY.js';
21
+ import './chunk-U27XHOEF.js';
22
22
  import './chunk-H73MEMQB.js';
23
23
  import './chunk-OR6XIWLB.js';
24
24
  import { resolveMemoryRoot, readFactsFromMarkdown } from './chunk-X3LOJJMO.js';
25
25
  import { FsSessionStore } from './chunk-IZDDSLL2.js';
26
- import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-74OA5DIM.js';
27
- export { inferApiMode, normalizeUsage } from './chunk-74OA5DIM.js';
26
+ import { discoverProviderPlugins, shouldUseFixtureMode, isFixtureApiKey, httpRequest, mapOllamaTransportError, readErrorResponseBody, mapOllamaHttpError } from './chunk-BBJ77S62.js';
27
+ export { inferApiMode, normalizeUsage } from './chunk-BBJ77S62.js';
28
28
  import './chunk-SUVCHX4L.js';
29
29
  import './chunk-2XC6KDJM.js';
30
- import './chunk-TE6XVTOA.js';
30
+ import './chunk-JLIRFWUG.js';
31
31
  import './chunk-24MGQDK3.js';
32
32
  import { readSessionMessages } from './chunk-XERM7PDQ.js';
33
33
  import './chunk-HKCKOAIO.js';
@@ -1929,7 +1929,7 @@ function isBuiltAgent(m) {
1929
1929
  return typeof m.send === "function";
1930
1930
  }
1931
1931
  async function materialize(def, index) {
1932
- const { Agent: Agent2 } = await import('./agent-GWKRARAL.js');
1932
+ const { Agent: Agent2 } = await import('./agent-DFV52V6E.js');
1933
1933
  return Agent2.create({
1934
1934
  // `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
1935
1935
  // here means "declare nothing and let the default apply" — forwarding the literal would create
@@ -1,4 +1,4 @@
1
- import { enqueueSessionWrite } from './chunk-7Y23B7XX.js';
1
+ import { enqueueSessionWrite } from './chunk-Q34EBNYG.js';
2
2
  import { invalidateSessionCache } from './chunk-2XC6KDJM.js';
3
3
  import './chunk-XERM7PDQ.js';
4
4
  import { SessionTranscript } from './chunk-FTZTZBCU.js';
@@ -23,5 +23,5 @@ async function injectSessionTurn(opts) {
23
23
  }
24
24
 
25
25
  export { injectSessionTurn };
26
- //# sourceMappingURL=inject-session-E5UDFVLI.js.map
27
- //# sourceMappingURL=inject-session-E5UDFVLI.js.map
26
+ //# sourceMappingURL=inject-session-LJX5JGV5.js.map
27
+ //# sourceMappingURL=inject-session-LJX5JGV5.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-E5UDFVLI.js","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
1
+ {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-LJX5JGV5.js","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkN7ZIPW2N_cjs = require('./chunk-N7ZIPW2N.cjs');
3
+ var chunk3JANYJYS_cjs = require('./chunk-3JANYJYS.cjs');
4
4
  var chunkYJNYDJ2T_cjs = require('./chunk-YJNYDJ2T.cjs');
5
5
  require('./chunk-ZAM7BJXJ.cjs');
6
6
  var chunkZWACQM5U_cjs = require('./chunk-ZWACQM5U.cjs');
@@ -10,7 +10,7 @@ require('./chunk-6LHQPOMI.cjs');
10
10
 
11
11
  // src/internal/session/inject-session.ts
12
12
  async function injectSessionTurn(opts) {
13
- await chunkN7ZIPW2N_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
13
+ await chunk3JANYJYS_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
14
14
  const prior = await opts.store.readRecords(opts.loc.agentId);
15
15
  const transcript = chunkZWACQM5U_cjs.SessionTranscript.fromRecords(prior, {
16
16
  cwd: opts.loc.cwd,
@@ -25,5 +25,5 @@ async function injectSessionTurn(opts) {
25
25
  }
26
26
 
27
27
  exports.injectSessionTurn = injectSessionTurn;
28
- //# sourceMappingURL=inject-session-W4UKACYJ.cjs.map
29
- //# sourceMappingURL=inject-session-W4UKACYJ.cjs.map
28
+ //# sourceMappingURL=inject-session-R73PRM7B.cjs.map
29
+ //# sourceMappingURL=inject-session-R73PRM7B.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-W4UKACYJ.cjs","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
1
+ {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-R73PRM7B.cjs","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
@@ -6,7 +6,9 @@
6
6
  * `TheokitAgentError` subclasses with full `ErrorMetadata`.
7
7
  *
8
8
  * Body inspection: looks at `body.error.code` / `body.error.type` to detect
9
- * `context_too_long`, `content_filtered`, `model_unavailable` semantics.
9
+ * `context_too_long`, `content_filtered`, `model_unavailable` semantics, and at
10
+ * `body.error.message` for a 404 that says no endpoint serves the model
11
+ * (OpenRouter's numeric-code body for a retired model id).
10
12
  * Falls back to status-based mapping when body doesn't expose `.error`
11
13
  * (e.g., HTML server error page, DeepInfra's `{message: "..."}` shape).
12
14
  *
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkYEHQ3SIC_cjs = require('../../../chunk-YEHQ3SIC.cjs');
3
+ var chunkJV7JA7BM_cjs = require('../../../chunk-JV7JA7BM.cjs');
4
4
  var chunkGHX4P3V2_cjs = require('../../../chunk-GHX4P3V2.cjs');
5
- require('../../../chunk-WPO3VCY4.cjs');
5
+ require('../../../chunk-N7KS3TIR.cjs');
6
6
  require('../../../chunk-QOGNZMHD.cjs');
7
7
  require('../../../chunk-MUUQ2WFJ.cjs');
8
8
  require('../../../chunk-GM54F4FE.cjs');
@@ -17,7 +17,7 @@ require('../../../chunk-6LHQPOMI.cjs');
17
17
 
18
18
  Object.defineProperty(exports, "createOpenAiCompatibleRuntime", {
19
19
  enumerable: true,
20
- get: function () { return chunkYEHQ3SIC_cjs.createOpenAiCompatibleRuntime; }
20
+ get: function () { return chunkJV7JA7BM_cjs.createOpenAiCompatibleRuntime; }
21
21
  });
22
22
  Object.defineProperty(exports, "LruEmbeddingCache", {
23
23
  enumerable: true,
@@ -1,6 +1,6 @@
1
- export { createOpenAiCompatibleRuntime } from '../../../chunk-HI3W37FY.js';
1
+ export { createOpenAiCompatibleRuntime } from '../../../chunk-U27XHOEF.js';
2
2
  export { LruEmbeddingCache, globalEmbeddingCache } from '../../../chunk-H73MEMQB.js';
3
- import '../../../chunk-TE6XVTOA.js';
3
+ import '../../../chunk-JLIRFWUG.js';
4
4
  import '../../../chunk-24MGQDK3.js';
5
5
  import '../../../chunk-FD2UT76F.js';
6
6
  import '../../../chunk-5DD4NJN3.js';
@@ -6,7 +6,7 @@ Branch on `code`, never on the message: messages carry context (an id, a path, a
6
6
 
7
7
  **Transport codes vs the rest.** `ErrorCode` in `errors.ts` is the small canonical union a provider failure maps onto — the codes marked *transport* below. Everything else is raised by a specific subsystem at a specific place, and a `catch` that only handles the union will meet them anyway.
8
8
 
9
- 247 distinct code(s).
9
+ 250 distinct code(s).
10
10
 
11
11
  | Code | Kind | Raised by | Sites |
12
12
  |---|---|---|---|
@@ -47,11 +47,13 @@ Branch on `code`, never on the message: messages carry context (an id, a path, a
47
47
  | `cloud_stdio_cwd_rejected` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/validation/validate-agent-options.ts:123` |
48
48
  | `compression_failed` | domain | — | `packages/sdk/src/errors.ts:700` |
49
49
  | `compression_model_unresolved` | domain | — | `packages/sdk/src/internal/runtime/compression/compression-model-registry.ts:102` +1 |
50
+ | `content_filtered` | domain | — | `packages/sdk/src/internal/error-mappers/openai-compatible.ts:118` |
50
51
  | `context_config_shape` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/context/context-manager.ts:288` |
51
52
  | `context_frontmatter_invalid` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/context/context-frontmatter.ts:38` |
52
53
  | `context_json_invalid` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/context/context-manager.ts:282` |
53
54
  | `context_read_error` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/context/context-manager.ts:269` |
54
55
  | `context_sources_shape` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/context/context-manager.ts:309` |
56
+ | `context_too_long` | domain | — | `packages/sdk/src/internal/error-mappers/openai-compatible.ts:116` |
55
57
  | `credential_pool_ambiguous` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/validation/validate-agent-options.ts:70` +1 |
56
58
  | `credential_pool_empty` | domain | ConfigurationError | `packages/sdk/src/internal/llm/credential-pool.ts:91` |
57
59
  | `cron_ambiguous_target` | domain | ConfigurationError | `packages/sdk/src/cron.ts:215` |
@@ -98,7 +100,7 @@ Branch on `code`, never on the message: messages carry context (an id, a path, a
98
100
  | `invalid_filename_id` | domain | ConfigurationError | `packages/sdk/src/internal/security/path-guard.ts:486` |
99
101
  | `invalid_identifier` | domain | ConfigurationError | `packages/sdk/src/internal/security/path-guard.ts:434` +2 |
100
102
  | `invalid_input` | domain | MemoryAdapterError | `packages/memory-honcho/src/adapter.ts:98` +9 |
101
- | `invalid_max_iterations` | domain | ConfigurationError | `packages/sdk/src/internal/local-agent/real-local-run.ts:71` |
103
+ | `invalid_max_iterations` | domain | ConfigurationError | `packages/sdk/src/internal/local-agent/real-local-run.ts:73` |
102
104
  | `invalid_memory_backend` | domain | ConfigurationError | `packages/sdk/src/internal/memory/index-manager-dispatch.ts:24` +1 |
103
105
  | `invalid_memory_ceiling` | domain | ConfigurationError | `packages/sdk/src/internal/memory/storage/fact-ceiling.ts:23` +1 |
104
106
  | `invalid_memory_directory` | domain | ConfigurationError | `packages/sdk/src/internal/memory/storage/memory-root.ts:151` |
@@ -141,7 +143,7 @@ Branch on `code`, never on the message: messages carry context (an id, a path, a
141
143
  | `missing_credential` | domain | AuthenticationError | `packages/sdk/src/internal/providers/builtin/openai-chatgpt.ts:72` |
142
144
  | `missing_frontmatter` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/skills/skill-frontmatter.ts:88` |
143
145
  | `missing_model` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/validation/validate-agent-options.ts:37` |
144
- | `model_unavailable` | domain | buildErrorMetadata | `packages/sdk/src/internal/error-mappers/ollama.ts:75` +1 |
146
+ | `model_unavailable` | domain | buildErrorMetadata | `packages/sdk/src/internal/error-mappers/ollama.ts:75` +2 |
145
147
  | `network` | domain | MemoryAdapterError, buildErrorMetadata | `packages/memory-honcho/src/adapter.ts:258` +5 |
146
148
  | `network_error` | domain | NetworkError | `packages/sdk/src/internal/http.ts:99` |
147
149
  | `no_api_key` | domain | ConfigurationError | `packages/sdk-tools/src/web-search-brave.ts:50` |
@@ -177,6 +179,7 @@ Branch on `code`, never on the message: messages carry context (an id, a path, a
177
179
  | `plugin_missing_manifest` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/plugin-loader/plugins-manager.ts:176` +2 |
178
180
  | `programmatic_hooks_rejected` | domain | ConfigurationError | `packages/sdk/src/internal/runtime/validation/validate-agent-options.ts:99` |
179
181
  | `provider_unresolved` | domain | ConfigurationError | `packages/sdk/src/internal/llm/router.ts:99` +1 |
182
+ | `quota_exceeded` | domain | — | `packages/sdk/src/internal/error-mappers/openai-compatible.ts:127` |
180
183
  | `rate_limit` | domain | — | `packages/sdk/src/internal/error-mappers/vertex.ts:47` |
181
184
  | `rate_limited` | domain | MemoryAdapterError | `packages/memory-honcho/src/adapter.ts:244` +3 |
182
185
  | `redirect_blocked` | domain | — | `packages/sdk-tools/src/internal/network-guard.ts:38` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theokit/sdk",
3
- "version": "5.11.0",
3
+ "version": "5.11.1",
4
4
  "description": "TypeScript SDK for the Theo agent harness — same surface, local or cloud.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/usetheokit/theokit-sdk#readme",