@theokit/sdk 4.51.1 → 4.52.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/{agent-2KSLHB6B.cjs → agent-C66BEJGO.cjs} +7 -6
  3. package/dist/{agent-2KSLHB6B.cjs.map → agent-C66BEJGO.cjs.map} +1 -1
  4. package/dist/{agent-QWNWBCQZ.js → agent-HYQGJTIN.js} +6 -5
  5. package/dist/{agent-QWNWBCQZ.js.map → agent-HYQGJTIN.js.map} +1 -1
  6. package/dist/auth/index.cjs +5 -0
  7. package/dist/auth/index.cjs.map +1 -1
  8. package/dist/auth/index.js +1 -0
  9. package/dist/auth/index.js.map +1 -1
  10. package/dist/{chunk-2S7IB4O3.cjs → chunk-2CD5XUAG.cjs} +5 -5
  11. package/dist/{chunk-2S7IB4O3.cjs.map → chunk-2CD5XUAG.cjs.map} +1 -1
  12. package/dist/{chunk-BVT6LFQ3.js → chunk-DU7PBCAM.js} +3 -3
  13. package/dist/{chunk-BVT6LFQ3.js.map → chunk-DU7PBCAM.js.map} +1 -1
  14. package/dist/{chunk-XI4L45SS.cjs → chunk-LLK2RS6I.cjs} +43 -43
  15. package/dist/{chunk-XI4L45SS.cjs.map → chunk-LLK2RS6I.cjs.map} +1 -1
  16. package/dist/{chunk-DRRSUUI5.js → chunk-SPZZSAHV.js} +3 -3
  17. package/dist/{chunk-DRRSUUI5.js.map → chunk-SPZZSAHV.js.map} +1 -1
  18. package/dist/chunk-U3PAW4PL.js +22 -0
  19. package/dist/chunk-U3PAW4PL.js.map +1 -0
  20. package/dist/chunk-WVDH34LK.cjs +24 -0
  21. package/dist/chunk-WVDH34LK.cjs.map +1 -0
  22. package/dist/{chunk-3BKWFISQ.cjs → chunk-YARJG3GV.cjs} +3 -3
  23. package/dist/{chunk-3BKWFISQ.cjs.map → chunk-YARJG3GV.cjs.map} +1 -1
  24. package/dist/{chunk-QVIUICFM.js → chunk-YBB66SZZ.js} +6 -14
  25. package/dist/chunk-YBB66SZZ.js.map +1 -0
  26. package/dist/{chunk-6CSIUJ5W.js → chunk-ZFARZBOX.js} +6 -6
  27. package/dist/{chunk-6CSIUJ5W.js.map → chunk-ZFARZBOX.js.map} +1 -1
  28. package/dist/{chunk-N6NUMXAJ.cjs → chunk-ZNEYQ56O.cjs} +8 -16
  29. package/dist/chunk-ZNEYQ56O.cjs.map +1 -0
  30. package/dist/{compact-session-AAFICMPQ.cjs → compact-session-AXKDB6FC.cjs} +12 -11
  31. package/dist/{compact-session-AAFICMPQ.cjs.map → compact-session-AXKDB6FC.cjs.map} +1 -1
  32. package/dist/{compact-session-LR73ESZX.js → compact-session-DUAUEFRR.js} +4 -3
  33. package/dist/{compact-session-LR73ESZX.js.map → compact-session-DUAUEFRR.js.map} +1 -1
  34. package/dist/cron.cjs +6 -5
  35. package/dist/cron.js +5 -4
  36. package/dist/eval.cjs +5 -4
  37. package/dist/eval.cjs.map +1 -1
  38. package/dist/eval.js +4 -3
  39. package/dist/eval.js.map +1 -1
  40. package/dist/index.cjs +28 -27
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.js +7 -6
  43. package/dist/index.js.map +1 -1
  44. package/dist/{inject-session-6ZAFN7F7.js → inject-session-RBGOGACE.js} +3 -3
  45. package/dist/{inject-session-6ZAFN7F7.js.map → inject-session-RBGOGACE.js.map} +1 -1
  46. package/dist/{inject-session-KOGUD6KM.cjs → inject-session-TASLP5FA.cjs} +4 -4
  47. package/dist/{inject-session-KOGUD6KM.cjs.map → inject-session-TASLP5FA.cjs.map} +1 -1
  48. package/dist/internal/auth/api-key-prefix.d.ts +17 -0
  49. package/package.json +1 -1
  50. package/dist/chunk-N6NUMXAJ.cjs.map +0 -1
  51. package/dist/chunk-QVIUICFM.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -8,14 +8,14 @@ require('./chunk-EUBGGYPH.cjs');
8
8
  var chunkZ5U2JGEK_cjs = require('./chunk-Z5U2JGEK.cjs');
9
9
  require('./chunk-FBZMSLDC.cjs');
10
10
  require('./chunk-PNVDQL5Y.cjs');
11
- var chunk2S7IB4O3_cjs = require('./chunk-2S7IB4O3.cjs');
12
- var chunkXI4L45SS_cjs = require('./chunk-XI4L45SS.cjs');
13
- require('./chunk-3BKWFISQ.cjs');
11
+ var chunk2CD5XUAG_cjs = require('./chunk-2CD5XUAG.cjs');
12
+ var chunkLLK2RS6I_cjs = require('./chunk-LLK2RS6I.cjs');
13
+ require('./chunk-YARJG3GV.cjs');
14
14
  require('./chunk-BV2MWEMV.cjs');
15
15
  var chunk6DCTL32L_cjs = require('./chunk-6DCTL32L.cjs');
16
16
  require('./chunk-BUUUWQMB.cjs');
17
17
  require('./chunk-OI6RHLGC.cjs');
18
- var chunkN6NUMXAJ_cjs = require('./chunk-N6NUMXAJ.cjs');
18
+ var chunkZNEYQ56O_cjs = require('./chunk-ZNEYQ56O.cjs');
19
19
  require('./chunk-4JBHSLQO.cjs');
20
20
  require('./chunk-RAACTJ7C.cjs');
21
21
  require('./chunk-3R4ZCQAZ.cjs');
@@ -29,6 +29,7 @@ require('./chunk-E3OCRJU6.cjs');
29
29
  require('./chunk-2RW7K6FN.cjs');
30
30
  require('./chunk-MUUQ2WFJ.cjs');
31
31
  require('./chunk-6JSIEDKL.cjs');
32
+ require('./chunk-WVDH34LK.cjs');
32
33
  require('./chunk-B4YA6BRS.cjs');
33
34
  require('./chunk-NINIJCHU.cjs');
34
35
  require('./chunk-L5YO6PWL.cjs');
@@ -64,8 +65,8 @@ var fs = require('fs');
64
65
  // src/agent-factory.ts
65
66
  function createAgentFactory(common) {
66
67
  return {
67
- forSession: (agentId, overrides) => chunkXI4L45SS_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
68
- getOrCreate: (agentId, overrides) => chunkXI4L45SS_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
68
+ forSession: (agentId, overrides) => chunkLLK2RS6I_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
69
+ getOrCreate: (agentId, overrides) => chunkLLK2RS6I_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
69
70
  };
70
71
  }
71
72
  function mergeAgentOptions(common, overrides, agentId) {
@@ -1261,7 +1262,7 @@ var Memory = {
1261
1262
  return await peer.IndexManager.open(openArgs);
1262
1263
  }
1263
1264
  const { IndexManager } = await import('./index-manager-HGGL4DD5.cjs');
1264
- openArgs.embedding = await resolveEmbedding(opts.embedding, chunkXI4L45SS_cjs.MEMORY_EMBEDDING_ADAPTERS);
1265
+ openArgs.embedding = await resolveEmbedding(opts.embedding, chunkLLK2RS6I_cjs.MEMORY_EMBEDDING_ADAPTERS);
1265
1266
  return await IndexManager.open(openArgs);
1266
1267
  },
1267
1268
  /**
@@ -1272,7 +1273,7 @@ var Memory = {
1272
1273
  */
1273
1274
  async runDreamingSweep(opts) {
1274
1275
  const peer = await tryLoadSdkMemoryPeer();
1275
- const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunkXI4L45SS_cjs.MEMORY_EMBEDDING_ADAPTERS;
1276
+ const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunkLLK2RS6I_cjs.MEMORY_EMBEDDING_ADAPTERS;
1276
1277
  const sweepArgs = await buildDreamingSweepArgs(opts, catalog);
1277
1278
  const result = peer !== null ? (
1278
1279
  // biome-ignore lint/suspicious/noExplicitAny: peer is dynamically loaded — structural compat ensured by sdk-memory
@@ -1836,7 +1837,7 @@ function isBuiltAgent(m) {
1836
1837
  return typeof m.send === "function";
1837
1838
  }
1838
1839
  async function materialize(def, index) {
1839
- const { Agent: Agent2 } = await import('./agent-2KSLHB6B.cjs');
1840
+ const { Agent: Agent2 } = await import('./agent-C66BEJGO.cjs');
1840
1841
  return Agent2.create({
1841
1842
  // `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
1842
1843
  // here means "declare nothing and let the default apply" — forwarding the literal would create
@@ -1978,7 +1979,7 @@ var FIXTURE_USER = {
1978
1979
  };
1979
1980
  var FIXTURE_MODELS = [
1980
1981
  {
1981
- id: chunkXI4L45SS_cjs.DEFAULT_AGENTIC_MODEL_ID,
1982
+ id: chunkLLK2RS6I_cjs.DEFAULT_AGENTIC_MODEL_ID,
1982
1983
  name: "Gemini 2.0 Flash",
1983
1984
  displayName: "Gemini 2.0 Flash",
1984
1985
  parameters: [
@@ -2054,7 +2055,7 @@ async function listLocalModelsViaOpenAiCompat(baseUrl) {
2054
2055
  try {
2055
2056
  response = await fetch(url, { method: "GET" });
2056
2057
  } catch (fetchErr) {
2057
- const mapped = chunkN6NUMXAJ_cjs.mapOllamaTransportError({
2058
+ const mapped = chunkZNEYQ56O_cjs.mapOllamaTransportError({
2058
2059
  providerId: "ollama",
2059
2060
  cause: fetchErr,
2060
2061
  endpoint: "/v1/models"
@@ -2066,8 +2067,8 @@ async function listLocalModelsViaOpenAiCompat(baseUrl) {
2066
2067
  );
2067
2068
  }
2068
2069
  if (!response.ok) {
2069
- const body = await chunkN6NUMXAJ_cjs.readErrorResponseBody(response);
2070
- const mapped = chunkN6NUMXAJ_cjs.mapOllamaHttpError({
2070
+ const body = await chunkZNEYQ56O_cjs.readErrorResponseBody(response);
2071
+ const mapped = chunkZNEYQ56O_cjs.mapOllamaHttpError({
2071
2072
  providerId: "ollama",
2072
2073
  status: response.status,
2073
2074
  body,
@@ -2181,7 +2182,7 @@ var Theokit = class {
2181
2182
  envVars: p.envVars
2182
2183
  }));
2183
2184
  },
2184
- embeddingAdapters: () => Object.entries(chunkXI4L45SS_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
2185
+ embeddingAdapters: () => Object.entries(chunkLLK2RS6I_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
2185
2186
  id,
2186
2187
  transport: adapter.transport,
2187
2188
  defaultModel: adapter.defaultModel
@@ -2199,7 +2200,7 @@ var Theokit = class {
2199
2200
  };
2200
2201
  async function maybeListLocalModels(providerName) {
2201
2202
  chunkT6ZCG5AP_cjs.registerBuiltins();
2202
- await chunkN6NUMXAJ_cjs.discoverProviderPlugins();
2203
+ await chunkZNEYQ56O_cjs.discoverProviderPlugins();
2203
2204
  const profile = chunkT6ZCG5AP_cjs.getProviderProfile(providerName);
2204
2205
  if (profile === void 0) return void 0;
2205
2206
  if (profile.authType !== "none") return void 0;
@@ -2213,17 +2214,17 @@ function resolveLocalProviderBaseUrl(providerName, fallback) {
2213
2214
  return fallback;
2214
2215
  }
2215
2216
  async function executeCatalogRequest(request) {
2216
- const apiKey = chunkXI4L45SS_cjs.resolveApiKey(request.apiKey);
2217
+ const apiKey = chunkLLK2RS6I_cjs.resolveApiKey(request.apiKey);
2217
2218
  if (apiKey === void 0) {
2218
2219
  throw new chunk2YGIBOUH_cjs.AuthenticationError("Missing API key", { code: "missing_api_key" });
2219
2220
  }
2220
- if (chunkN6NUMXAJ_cjs.shouldUseFixtureMode(apiKey)) {
2221
+ if (chunkZNEYQ56O_cjs.shouldUseFixtureMode(apiKey)) {
2221
2222
  return request.fixture;
2222
2223
  }
2223
- if (!chunkN6NUMXAJ_cjs.isFixtureApiKey(apiKey) && process.env.THEOKIT_API_BASE_URL === void 0) {
2224
+ if (!chunkZNEYQ56O_cjs.isFixtureApiKey(apiKey) && process.env.THEOKIT_API_BASE_URL === void 0) {
2224
2225
  throw new chunk2YGIBOUH_cjs.AuthenticationError("Invalid API key", { code: "authentication_error" });
2225
2226
  }
2226
- return chunkN6NUMXAJ_cjs.httpRequest(request.path, { apiKey });
2227
+ return chunkZNEYQ56O_cjs.httpRequest(request.path, { apiKey });
2227
2228
  }
2228
2229
 
2229
2230
  // src/tool-blast-radius.ts
@@ -2388,35 +2389,35 @@ Object.defineProperty(exports, "GenerateObjectError", {
2388
2389
  });
2389
2390
  Object.defineProperty(exports, "Cron", {
2390
2391
  enumerable: true,
2391
- get: function () { return chunk2S7IB4O3_cjs.Cron; }
2392
+ get: function () { return chunk2CD5XUAG_cjs.Cron; }
2392
2393
  });
2393
2394
  Object.defineProperty(exports, "Agent", {
2394
2395
  enumerable: true,
2395
- get: function () { return chunkXI4L45SS_cjs.Agent; }
2396
+ get: function () { return chunkLLK2RS6I_cjs.Agent; }
2396
2397
  });
2397
2398
  Object.defineProperty(exports, "AgentBuilder", {
2398
2399
  enumerable: true,
2399
- get: function () { return chunkXI4L45SS_cjs.AgentBuilder; }
2400
+ get: function () { return chunkLLK2RS6I_cjs.AgentBuilder; }
2400
2401
  });
2401
2402
  Object.defineProperty(exports, "Tool", {
2402
2403
  enumerable: true,
2403
- get: function () { return chunkXI4L45SS_cjs.Tool; }
2404
+ get: function () { return chunkLLK2RS6I_cjs.Tool; }
2404
2405
  });
2405
2406
  Object.defineProperty(exports, "ToolError", {
2406
2407
  enumerable: true,
2407
- get: function () { return chunkXI4L45SS_cjs.ToolError; }
2408
+ get: function () { return chunkLLK2RS6I_cjs.ToolError; }
2408
2409
  });
2409
2410
  Object.defineProperty(exports, "UsageAccumulator", {
2410
2411
  enumerable: true,
2411
- get: function () { return chunkXI4L45SS_cjs.UsageAccumulator; }
2412
+ get: function () { return chunkLLK2RS6I_cjs.UsageAccumulator; }
2412
2413
  });
2413
2414
  Object.defineProperty(exports, "computeCost", {
2414
2415
  enumerable: true,
2415
- get: function () { return chunkXI4L45SS_cjs.computeCost; }
2416
+ get: function () { return chunkLLK2RS6I_cjs.computeCost; }
2416
2417
  });
2417
2418
  Object.defineProperty(exports, "getPricingEntry", {
2418
2419
  enumerable: true,
2419
- get: function () { return chunkXI4L45SS_cjs.getPricingEntry; }
2420
+ get: function () { return chunkLLK2RS6I_cjs.getPricingEntry; }
2420
2421
  });
2421
2422
  Object.defineProperty(exports, "emitRunEvent", {
2422
2423
  enumerable: true,