@theokit/sdk 4.41.0 → 4.42.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 (58) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/{agent-6C2ODKFU.cjs → agent-HGDXQEQQ.cjs} +8 -7
  3. package/dist/{agent-6C2ODKFU.cjs.map → agent-HGDXQEQQ.cjs.map} +1 -1
  4. package/dist/{agent-35MGOZVH.js → agent-WUVYXIFX.js} +7 -6
  5. package/dist/{agent-35MGOZVH.js.map → agent-WUVYXIFX.js.map} +1 -1
  6. package/dist/chunk-22EMHGBO.cjs +351 -0
  7. package/dist/chunk-22EMHGBO.cjs.map +1 -0
  8. package/dist/{chunk-Y33IGXCJ.cjs → chunk-EYEZDADP.cjs} +5 -5
  9. package/dist/{chunk-Y33IGXCJ.cjs.map → chunk-EYEZDADP.cjs.map} +1 -1
  10. package/dist/{chunk-ZO2L5U6F.cjs → chunk-FAUKVJCC.cjs} +3 -3
  11. package/dist/{chunk-ZO2L5U6F.cjs.map → chunk-FAUKVJCC.cjs.map} +1 -1
  12. package/dist/{chunk-DCKIS53K.js → chunk-KO5V6L3E.js} +9 -319
  13. package/dist/chunk-KO5V6L3E.js.map +1 -0
  14. package/dist/{chunk-BHWHE453.js → chunk-MPD5EGJ6.js} +3 -3
  15. package/dist/{chunk-BHWHE453.js.map → chunk-MPD5EGJ6.js.map} +1 -1
  16. package/dist/chunk-Q2PPSHBS.js +344 -0
  17. package/dist/chunk-Q2PPSHBS.js.map +1 -0
  18. package/dist/{chunk-FMIKUGF2.cjs → chunk-QFFNMJAS.cjs} +5 -5
  19. package/dist/{chunk-FMIKUGF2.cjs.map → chunk-QFFNMJAS.cjs.map} +1 -1
  20. package/dist/{chunk-UTYCG4RB.js → chunk-TDDRPFO3.js} +3 -3
  21. package/dist/{chunk-UTYCG4RB.js.map → chunk-TDDRPFO3.js.map} +1 -1
  22. package/dist/{chunk-IMX5YODO.js → chunk-UJ7HK7BX.js} +3 -3
  23. package/dist/{chunk-IMX5YODO.js.map → chunk-UJ7HK7BX.js.map} +1 -1
  24. package/dist/{chunk-F5DSDDBY.cjs → chunk-YHQ3DG24.cjs} +48 -358
  25. package/dist/chunk-YHQ3DG24.cjs.map +1 -0
  26. package/dist/{compact-session-65XCKO6H.js → compact-session-GF2CBKXB.js} +4 -4
  27. package/dist/{compact-session-65XCKO6H.js.map → compact-session-GF2CBKXB.js.map} +1 -1
  28. package/dist/{compact-session-OU6SRPVJ.cjs → compact-session-UUCBTBCZ.cjs} +12 -12
  29. package/dist/{compact-session-OU6SRPVJ.cjs.map → compact-session-UUCBTBCZ.cjs.map} +1 -1
  30. package/dist/context/index.cjs +35 -0
  31. package/dist/context/index.cjs.map +1 -0
  32. package/dist/context/index.d.cts +78 -0
  33. package/dist/context/index.d.ts +78 -0
  34. package/dist/context/index.js +18 -0
  35. package/dist/context/index.js.map +1 -0
  36. package/dist/cron.cjs +7 -6
  37. package/dist/cron.js +6 -5
  38. package/dist/eval.cjs +6 -5
  39. package/dist/eval.cjs.map +1 -1
  40. package/dist/eval.js +5 -4
  41. package/dist/eval.js.map +1 -1
  42. package/dist/index.cjs +34 -33
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.js +9 -8
  45. package/dist/index.js.map +1 -1
  46. package/dist/{inject-session-DDC36KKP.cjs → inject-session-I3HK3AHB.cjs} +4 -4
  47. package/dist/{inject-session-DDC36KKP.cjs.map → inject-session-I3HK3AHB.cjs.map} +1 -1
  48. package/dist/{inject-session-UBM4KVSV.js → inject-session-NR64GB3T.js} +3 -3
  49. package/dist/{inject-session-UBM4KVSV.js.map → inject-session-NR64GB3T.js.map} +1 -1
  50. package/dist/internal/runtime/context/context-discovery-runner.d.ts +9 -0
  51. package/dist/internal/runtime/context/context-import-resolver.d.ts +17 -0
  52. package/dist/server/auth/index.d.cts +11 -207
  53. package/dist/server/auth/index.d.ts +11 -207
  54. package/dist/server/errors-envelope.d.cts +6 -12
  55. package/dist/server/errors-envelope.d.ts +6 -12
  56. package/package.json +11 -1
  57. package/dist/chunk-DCKIS53K.js.map +0 -1
  58. package/dist/chunk-F5DSDDBY.cjs.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,27 +1,28 @@
1
1
  'use strict';
2
2
 
3
+ var chunkOBA6YK2R_cjs = require('./chunk-OBA6YK2R.cjs');
3
4
  var chunkUJMEWGO6_cjs = require('./chunk-UJMEWGO6.cjs');
4
5
  var chunk57KX5WTP_cjs = require('./chunk-57KX5WTP.cjs');
5
- var chunkOBA6YK2R_cjs = require('./chunk-OBA6YK2R.cjs');
6
6
  var chunkGC44RATP_cjs = require('./chunk-GC44RATP.cjs');
7
7
  require('./chunk-WIGJGFH4.cjs');
8
8
  var chunkJO76RWCA_cjs = require('./chunk-JO76RWCA.cjs');
9
9
  require('./chunk-RBQYHEZD.cjs');
10
10
  require('./chunk-PNVDQL5Y.cjs');
11
- var chunkY33IGXCJ_cjs = require('./chunk-Y33IGXCJ.cjs');
12
- var chunkF5DSDDBY_cjs = require('./chunk-F5DSDDBY.cjs');
11
+ var chunkEYEZDADP_cjs = require('./chunk-EYEZDADP.cjs');
12
+ var chunkYHQ3DG24_cjs = require('./chunk-YHQ3DG24.cjs');
13
+ require('./chunk-FAUKVJCC.cjs');
13
14
  require('./chunk-BV2MWEMV.cjs');
14
15
  var chunkKCQUYQ3V_cjs = require('./chunk-KCQUYQ3V.cjs');
15
16
  require('./chunk-BUUUWQMB.cjs');
16
- require('./chunk-ZO2L5U6F.cjs');
17
17
  require('./chunk-NRA36JKG.cjs');
18
- var chunkFMIKUGF2_cjs = require('./chunk-FMIKUGF2.cjs');
19
- require('./chunk-HLNLYLNN.cjs');
18
+ var chunkQFFNMJAS_cjs = require('./chunk-QFFNMJAS.cjs');
20
19
  require('./chunk-4JBHSLQO.cjs');
20
+ require('./chunk-HLNLYLNN.cjs');
21
21
  require('./chunk-FZ4YMZA3.cjs');
22
22
  var chunkGH52NOCL_cjs = require('./chunk-GH52NOCL.cjs');
23
23
  require('./chunk-HECR7KF5.cjs');
24
24
  require('./chunk-BBZYXVLZ.cjs');
25
+ require('./chunk-22EMHGBO.cjs');
25
26
  require('./chunk-6X2HUT4A.cjs');
26
27
  require('./chunk-7PESI6YD.cjs');
27
28
  require('./chunk-S4Q5OMIK.cjs');
@@ -62,8 +63,8 @@ var fs = require('fs');
62
63
  // src/agent-factory.ts
63
64
  function createAgentFactory(common) {
64
65
  return {
65
- forSession: (agentId, overrides) => chunkF5DSDDBY_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
66
- getOrCreate: (agentId, overrides) => chunkF5DSDDBY_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
66
+ forSession: (agentId, overrides) => chunkYHQ3DG24_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
67
+ getOrCreate: (agentId, overrides) => chunkYHQ3DG24_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
67
68
  };
68
69
  }
69
70
  function mergeAgentOptions(common, overrides, agentId) {
@@ -1167,7 +1168,7 @@ var Memory = {
1167
1168
  return await peer.IndexManager.open(openArgs);
1168
1169
  }
1169
1170
  const { IndexManager } = await import('./index-manager-YFFEPISE.cjs');
1170
- openArgs.embedding = await resolveEmbedding(opts.embedding, chunkF5DSDDBY_cjs.MEMORY_EMBEDDING_ADAPTERS);
1171
+ openArgs.embedding = await resolveEmbedding(opts.embedding, chunkYHQ3DG24_cjs.MEMORY_EMBEDDING_ADAPTERS);
1171
1172
  return await IndexManager.open(openArgs);
1172
1173
  },
1173
1174
  /**
@@ -1178,7 +1179,7 @@ var Memory = {
1178
1179
  */
1179
1180
  async runDreamingSweep(opts) {
1180
1181
  const peer = await tryLoadSdkMemoryPeer();
1181
- const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunkF5DSDDBY_cjs.MEMORY_EMBEDDING_ADAPTERS;
1182
+ const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunkYHQ3DG24_cjs.MEMORY_EMBEDDING_ADAPTERS;
1182
1183
  const sweepArgs = await buildDreamingSweepArgs(opts, catalog);
1183
1184
  const result = peer !== null ? (
1184
1185
  // biome-ignore lint/suspicious/noExplicitAny: peer is dynamically loaded — structural compat ensured by sdk-memory
@@ -1600,7 +1601,7 @@ function isBuiltAgent(m) {
1600
1601
  return typeof m.send === "function";
1601
1602
  }
1602
1603
  async function materialize(def, index) {
1603
- const { Agent: Agent2 } = await import('./agent-6C2ODKFU.cjs');
1604
+ const { Agent: Agent2 } = await import('./agent-HGDXQEQQ.cjs');
1604
1605
  return Agent2.create({
1605
1606
  // `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
1606
1607
  // here means "declare nothing and let the default apply" — forwarding the literal would create
@@ -1742,7 +1743,7 @@ var FIXTURE_USER = {
1742
1743
  };
1743
1744
  var FIXTURE_MODELS = [
1744
1745
  {
1745
- id: chunkF5DSDDBY_cjs.DEFAULT_AGENTIC_MODEL_ID,
1746
+ id: chunkYHQ3DG24_cjs.DEFAULT_AGENTIC_MODEL_ID,
1746
1747
  name: "Gemini 2.0 Flash",
1747
1748
  displayName: "Gemini 2.0 Flash",
1748
1749
  parameters: [
@@ -1818,7 +1819,7 @@ async function listLocalModelsViaOpenAiCompat(baseUrl) {
1818
1819
  try {
1819
1820
  response = await fetch(url, { method: "GET" });
1820
1821
  } catch (fetchErr) {
1821
- const mapped = chunkFMIKUGF2_cjs.mapOllamaTransportError({
1822
+ const mapped = chunkQFFNMJAS_cjs.mapOllamaTransportError({
1822
1823
  providerId: "ollama",
1823
1824
  cause: fetchErr,
1824
1825
  endpoint: "/v1/models"
@@ -1830,8 +1831,8 @@ async function listLocalModelsViaOpenAiCompat(baseUrl) {
1830
1831
  );
1831
1832
  }
1832
1833
  if (!response.ok) {
1833
- const body = await chunkFMIKUGF2_cjs.readErrorResponseBody(response);
1834
- const mapped = chunkFMIKUGF2_cjs.mapOllamaHttpError({
1834
+ const body = await chunkQFFNMJAS_cjs.readErrorResponseBody(response);
1835
+ const mapped = chunkQFFNMJAS_cjs.mapOllamaHttpError({
1835
1836
  providerId: "ollama",
1836
1837
  status: response.status,
1837
1838
  body,
@@ -1945,7 +1946,7 @@ var Theokit = class {
1945
1946
  envVars: p.envVars
1946
1947
  }));
1947
1948
  },
1948
- embeddingAdapters: () => Object.entries(chunkF5DSDDBY_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
1949
+ embeddingAdapters: () => Object.entries(chunkYHQ3DG24_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
1949
1950
  id,
1950
1951
  transport: adapter.transport,
1951
1952
  defaultModel: adapter.defaultModel
@@ -1963,7 +1964,7 @@ var Theokit = class {
1963
1964
  };
1964
1965
  async function maybeListLocalModels(providerName) {
1965
1966
  chunkGLEKLAUW_cjs.registerBuiltins();
1966
- await chunkFMIKUGF2_cjs.discoverProviderPlugins();
1967
+ await chunkQFFNMJAS_cjs.discoverProviderPlugins();
1967
1968
  const profile = chunkGLEKLAUW_cjs.getProviderProfile(providerName);
1968
1969
  if (profile === void 0) return void 0;
1969
1970
  if (profile.authType !== "none") return void 0;
@@ -1977,17 +1978,17 @@ function resolveLocalProviderBaseUrl(providerName, fallback) {
1977
1978
  return fallback;
1978
1979
  }
1979
1980
  async function executeCatalogRequest(request) {
1980
- const apiKey = chunkF5DSDDBY_cjs.resolveApiKey(request.apiKey);
1981
+ const apiKey = chunkYHQ3DG24_cjs.resolveApiKey(request.apiKey);
1981
1982
  if (apiKey === void 0) {
1982
1983
  throw new chunkYULF6FPB_cjs.AuthenticationError("Missing API key", { code: "missing_api_key" });
1983
1984
  }
1984
- if (chunkFMIKUGF2_cjs.shouldUseFixtureMode(apiKey)) {
1985
+ if (chunkQFFNMJAS_cjs.shouldUseFixtureMode(apiKey)) {
1985
1986
  return request.fixture;
1986
1987
  }
1987
- if (!chunkFMIKUGF2_cjs.isFixtureApiKey(apiKey) && process.env.THEOKIT_API_BASE_URL === void 0) {
1988
+ if (!chunkQFFNMJAS_cjs.isFixtureApiKey(apiKey) && process.env.THEOKIT_API_BASE_URL === void 0) {
1988
1989
  throw new chunkYULF6FPB_cjs.AuthenticationError("Invalid API key", { code: "authentication_error" });
1989
1990
  }
1990
- return chunkFMIKUGF2_cjs.httpRequest(request.path, { apiKey });
1991
+ return chunkQFFNMJAS_cjs.httpRequest(request.path, { apiKey });
1991
1992
  }
1992
1993
 
1993
1994
  // src/trajectory-helpers.ts
@@ -2085,6 +2086,10 @@ function safeStringify(v) {
2085
2086
  }
2086
2087
  }
2087
2088
 
2089
+ Object.defineProperty(exports, "GOAL_CONTINUATION_MARKER", {
2090
+ enumerable: true,
2091
+ get: function () { return chunkOBA6YK2R_cjs.GOAL_CONTINUATION_MARKER; }
2092
+ });
2088
2093
  Object.defineProperty(exports, "JudgeCredentialError", {
2089
2094
  enumerable: true,
2090
2095
  get: function () { return chunkUJMEWGO6_cjs.JudgeCredentialError; }
@@ -2093,45 +2098,41 @@ Object.defineProperty(exports, "StreamObjectError", {
2093
2098
  enumerable: true,
2094
2099
  get: function () { return chunk57KX5WTP_cjs.StreamObjectError; }
2095
2100
  });
2096
- Object.defineProperty(exports, "GOAL_CONTINUATION_MARKER", {
2097
- enumerable: true,
2098
- get: function () { return chunkOBA6YK2R_cjs.GOAL_CONTINUATION_MARKER; }
2099
- });
2100
2101
  Object.defineProperty(exports, "GenerateObjectError", {
2101
2102
  enumerable: true,
2102
2103
  get: function () { return chunkGC44RATP_cjs.GenerateObjectError; }
2103
2104
  });
2104
2105
  Object.defineProperty(exports, "Cron", {
2105
2106
  enumerable: true,
2106
- get: function () { return chunkY33IGXCJ_cjs.Cron; }
2107
+ get: function () { return chunkEYEZDADP_cjs.Cron; }
2107
2108
  });
2108
2109
  Object.defineProperty(exports, "Agent", {
2109
2110
  enumerable: true,
2110
- get: function () { return chunkF5DSDDBY_cjs.Agent; }
2111
+ get: function () { return chunkYHQ3DG24_cjs.Agent; }
2111
2112
  });
2112
2113
  Object.defineProperty(exports, "AgentBuilder", {
2113
2114
  enumerable: true,
2114
- get: function () { return chunkF5DSDDBY_cjs.AgentBuilder; }
2115
+ get: function () { return chunkYHQ3DG24_cjs.AgentBuilder; }
2115
2116
  });
2116
2117
  Object.defineProperty(exports, "Tool", {
2117
2118
  enumerable: true,
2118
- get: function () { return chunkF5DSDDBY_cjs.Tool; }
2119
+ get: function () { return chunkYHQ3DG24_cjs.Tool; }
2119
2120
  });
2120
2121
  Object.defineProperty(exports, "ToolError", {
2121
2122
  enumerable: true,
2122
- get: function () { return chunkF5DSDDBY_cjs.ToolError; }
2123
+ get: function () { return chunkYHQ3DG24_cjs.ToolError; }
2123
2124
  });
2124
2125
  Object.defineProperty(exports, "UsageAccumulator", {
2125
2126
  enumerable: true,
2126
- get: function () { return chunkF5DSDDBY_cjs.UsageAccumulator; }
2127
+ get: function () { return chunkYHQ3DG24_cjs.UsageAccumulator; }
2127
2128
  });
2128
2129
  Object.defineProperty(exports, "computeCost", {
2129
2130
  enumerable: true,
2130
- get: function () { return chunkF5DSDDBY_cjs.computeCost; }
2131
+ get: function () { return chunkYHQ3DG24_cjs.computeCost; }
2131
2132
  });
2132
2133
  Object.defineProperty(exports, "getPricingEntry", {
2133
2134
  enumerable: true,
2134
- get: function () { return chunkF5DSDDBY_cjs.getPricingEntry; }
2135
+ get: function () { return chunkYHQ3DG24_cjs.getPricingEntry; }
2135
2136
  });
2136
2137
  Object.defineProperty(exports, "emitRunEvent", {
2137
2138
  enumerable: true,