@theokit/sdk 4.41.0 → 4.41.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.
package/dist/cron.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkY33IGXCJ_cjs = require('./chunk-Y33IGXCJ.cjs');
4
- require('./chunk-F5DSDDBY.cjs');
3
+ var chunkGTLH2NI2_cjs = require('./chunk-GTLH2NI2.cjs');
4
+ require('./chunk-RPL3POFZ.cjs');
5
5
  require('./chunk-BV2MWEMV.cjs');
6
6
  require('./chunk-KCQUYQ3V.cjs');
7
7
  require('./chunk-BUUUWQMB.cjs');
@@ -50,7 +50,7 @@ require('./chunk-ZHPET3LZ.cjs');
50
50
 
51
51
  Object.defineProperty(exports, "Cron", {
52
52
  enumerable: true,
53
- get: function () { return chunkY33IGXCJ_cjs.Cron; }
53
+ get: function () { return chunkGTLH2NI2_cjs.Cron; }
54
54
  });
55
55
  //# sourceMappingURL=cron.cjs.map
56
56
  //# sourceMappingURL=cron.cjs.map
package/dist/cron.js CHANGED
@@ -1,5 +1,5 @@
1
- export { Cron } from './chunk-BHWHE453.js';
2
- import './chunk-DCKIS53K.js';
1
+ export { Cron } from './chunk-AUMSEL33.js';
2
+ import './chunk-DHLVOLUX.js';
3
3
  import './chunk-2SFBB54R.js';
4
4
  import './chunk-GNMPCZNN.js';
5
5
  import './chunk-K2BQQ445.js';
package/dist/eval.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkR3CKCRK3_cjs = require('./chunk-R3CKCRK3.cjs');
4
- var chunkF5DSDDBY_cjs = require('./chunk-F5DSDDBY.cjs');
4
+ var chunkRPL3POFZ_cjs = require('./chunk-RPL3POFZ.cjs');
5
5
  require('./chunk-BV2MWEMV.cjs');
6
6
  require('./chunk-KCQUYQ3V.cjs');
7
7
  var chunkBUUUWQMB_cjs = require('./chunk-BUUUWQMB.cjs');
@@ -773,7 +773,7 @@ function makeDefaultEmbedder(opts) {
773
773
  let runtime;
774
774
  return (texts) => {
775
775
  if (runtime === void 0) {
776
- runtime = chunkF5DSDDBY_cjs.openRouterMemoryEmbeddingProviderAdapter.create(embedderCreateOptions(opts));
776
+ runtime = chunkRPL3POFZ_cjs.openRouterMemoryEmbeddingProviderAdapter.create(embedderCreateOptions(opts));
777
777
  }
778
778
  return runtime.then((rt) => rt.embed(texts));
779
779
  };
package/dist/eval.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { shellEscapePosix, LocalSandbox } from './chunk-DEZ75ET5.js';
2
- import { openRouterMemoryEmbeddingProviderAdapter } from './chunk-DCKIS53K.js';
2
+ import { openRouterMemoryEmbeddingProviderAdapter } from './chunk-DHLVOLUX.js';
3
3
  import './chunk-2SFBB54R.js';
4
4
  import './chunk-GNMPCZNN.js';
5
5
  import { getTracer } from './chunk-K2BQQ445.js';
package/dist/index.cjs CHANGED
@@ -8,8 +8,8 @@ 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 chunkGTLH2NI2_cjs = require('./chunk-GTLH2NI2.cjs');
12
+ var chunkRPL3POFZ_cjs = require('./chunk-RPL3POFZ.cjs');
13
13
  require('./chunk-BV2MWEMV.cjs');
14
14
  var chunkKCQUYQ3V_cjs = require('./chunk-KCQUYQ3V.cjs');
15
15
  require('./chunk-BUUUWQMB.cjs');
@@ -62,8 +62,8 @@ var fs = require('fs');
62
62
  // src/agent-factory.ts
63
63
  function createAgentFactory(common) {
64
64
  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))
65
+ forSession: (agentId, overrides) => chunkRPL3POFZ_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
66
+ getOrCreate: (agentId, overrides) => chunkRPL3POFZ_cjs.Agent.getOrCreate(agentId, mergeAgentOptions(common, overrides, agentId))
67
67
  };
68
68
  }
69
69
  function mergeAgentOptions(common, overrides, agentId) {
@@ -1167,7 +1167,7 @@ var Memory = {
1167
1167
  return await peer.IndexManager.open(openArgs);
1168
1168
  }
1169
1169
  const { IndexManager } = await import('./index-manager-YFFEPISE.cjs');
1170
- openArgs.embedding = await resolveEmbedding(opts.embedding, chunkF5DSDDBY_cjs.MEMORY_EMBEDDING_ADAPTERS);
1170
+ openArgs.embedding = await resolveEmbedding(opts.embedding, chunkRPL3POFZ_cjs.MEMORY_EMBEDDING_ADAPTERS);
1171
1171
  return await IndexManager.open(openArgs);
1172
1172
  },
1173
1173
  /**
@@ -1178,7 +1178,7 @@ var Memory = {
1178
1178
  */
1179
1179
  async runDreamingSweep(opts) {
1180
1180
  const peer = await tryLoadSdkMemoryPeer();
1181
- const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunkF5DSDDBY_cjs.MEMORY_EMBEDDING_ADAPTERS;
1181
+ const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunkRPL3POFZ_cjs.MEMORY_EMBEDDING_ADAPTERS;
1182
1182
  const sweepArgs = await buildDreamingSweepArgs(opts, catalog);
1183
1183
  const result = peer !== null ? (
1184
1184
  // biome-ignore lint/suspicious/noExplicitAny: peer is dynamically loaded — structural compat ensured by sdk-memory
@@ -1600,7 +1600,7 @@ function isBuiltAgent(m) {
1600
1600
  return typeof m.send === "function";
1601
1601
  }
1602
1602
  async function materialize(def, index) {
1603
- const { Agent: Agent2 } = await import('./agent-6C2ODKFU.cjs');
1603
+ const { Agent: Agent2 } = await import('./agent-JDJEBJHU.cjs');
1604
1604
  return Agent2.create({
1605
1605
  // `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
1606
1606
  // here means "declare nothing and let the default apply" — forwarding the literal would create
@@ -1742,7 +1742,7 @@ var FIXTURE_USER = {
1742
1742
  };
1743
1743
  var FIXTURE_MODELS = [
1744
1744
  {
1745
- id: chunkF5DSDDBY_cjs.DEFAULT_AGENTIC_MODEL_ID,
1745
+ id: chunkRPL3POFZ_cjs.DEFAULT_AGENTIC_MODEL_ID,
1746
1746
  name: "Gemini 2.0 Flash",
1747
1747
  displayName: "Gemini 2.0 Flash",
1748
1748
  parameters: [
@@ -1945,7 +1945,7 @@ var Theokit = class {
1945
1945
  envVars: p.envVars
1946
1946
  }));
1947
1947
  },
1948
- embeddingAdapters: () => Object.entries(chunkF5DSDDBY_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
1948
+ embeddingAdapters: () => Object.entries(chunkRPL3POFZ_cjs.MEMORY_EMBEDDING_ADAPTERS).map(([id, adapter]) => ({
1949
1949
  id,
1950
1950
  transport: adapter.transport,
1951
1951
  defaultModel: adapter.defaultModel
@@ -1977,7 +1977,7 @@ function resolveLocalProviderBaseUrl(providerName, fallback) {
1977
1977
  return fallback;
1978
1978
  }
1979
1979
  async function executeCatalogRequest(request) {
1980
- const apiKey = chunkF5DSDDBY_cjs.resolveApiKey(request.apiKey);
1980
+ const apiKey = chunkRPL3POFZ_cjs.resolveApiKey(request.apiKey);
1981
1981
  if (apiKey === void 0) {
1982
1982
  throw new chunkYULF6FPB_cjs.AuthenticationError("Missing API key", { code: "missing_api_key" });
1983
1983
  }
@@ -2103,35 +2103,35 @@ Object.defineProperty(exports, "GenerateObjectError", {
2103
2103
  });
2104
2104
  Object.defineProperty(exports, "Cron", {
2105
2105
  enumerable: true,
2106
- get: function () { return chunkY33IGXCJ_cjs.Cron; }
2106
+ get: function () { return chunkGTLH2NI2_cjs.Cron; }
2107
2107
  });
2108
2108
  Object.defineProperty(exports, "Agent", {
2109
2109
  enumerable: true,
2110
- get: function () { return chunkF5DSDDBY_cjs.Agent; }
2110
+ get: function () { return chunkRPL3POFZ_cjs.Agent; }
2111
2111
  });
2112
2112
  Object.defineProperty(exports, "AgentBuilder", {
2113
2113
  enumerable: true,
2114
- get: function () { return chunkF5DSDDBY_cjs.AgentBuilder; }
2114
+ get: function () { return chunkRPL3POFZ_cjs.AgentBuilder; }
2115
2115
  });
2116
2116
  Object.defineProperty(exports, "Tool", {
2117
2117
  enumerable: true,
2118
- get: function () { return chunkF5DSDDBY_cjs.Tool; }
2118
+ get: function () { return chunkRPL3POFZ_cjs.Tool; }
2119
2119
  });
2120
2120
  Object.defineProperty(exports, "ToolError", {
2121
2121
  enumerable: true,
2122
- get: function () { return chunkF5DSDDBY_cjs.ToolError; }
2122
+ get: function () { return chunkRPL3POFZ_cjs.ToolError; }
2123
2123
  });
2124
2124
  Object.defineProperty(exports, "UsageAccumulator", {
2125
2125
  enumerable: true,
2126
- get: function () { return chunkF5DSDDBY_cjs.UsageAccumulator; }
2126
+ get: function () { return chunkRPL3POFZ_cjs.UsageAccumulator; }
2127
2127
  });
2128
2128
  Object.defineProperty(exports, "computeCost", {
2129
2129
  enumerable: true,
2130
- get: function () { return chunkF5DSDDBY_cjs.computeCost; }
2130
+ get: function () { return chunkRPL3POFZ_cjs.computeCost; }
2131
2131
  });
2132
2132
  Object.defineProperty(exports, "getPricingEntry", {
2133
2133
  enumerable: true,
2134
- get: function () { return chunkF5DSDDBY_cjs.getPricingEntry; }
2134
+ get: function () { return chunkRPL3POFZ_cjs.getPricingEntry; }
2135
2135
  });
2136
2136
  Object.defineProperty(exports, "emitRunEvent", {
2137
2137
  enumerable: true,
package/dist/index.js CHANGED
@@ -6,9 +6,9 @@ import './chunk-O3IZ7JEL.js';
6
6
  import { Workflow, agentStep } from './chunk-EON4YTR6.js';
7
7
  import './chunk-HK4HRLWE.js';
8
8
  import './chunk-CAH3G4IS.js';
9
- export { Cron } from './chunk-BHWHE453.js';
10
- import { MEMORY_EMBEDDING_ADAPTERS, resolveApiKey, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-DCKIS53K.js';
11
- export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-DCKIS53K.js';
9
+ export { Cron } from './chunk-AUMSEL33.js';
10
+ import { MEMORY_EMBEDDING_ADAPTERS, resolveApiKey, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-DHLVOLUX.js';
11
+ export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-DHLVOLUX.js';
12
12
  import './chunk-2SFBB54R.js';
13
13
  import { configure, submit, list, get, cancel, subscribe } from './chunk-GNMPCZNN.js';
14
14
  export { emitRunEvent } from './chunk-GNMPCZNN.js';
@@ -1603,7 +1603,7 @@ function isBuiltAgent(m) {
1603
1603
  return typeof m.send === "function";
1604
1604
  }
1605
1605
  async function materialize(def, index) {
1606
- const { Agent: Agent2 } = await import('./agent-35MGOZVH.js');
1606
+ const { Agent: Agent2 } = await import('./agent-LVKAYADR.js');
1607
1607
  return Agent2.create({
1608
1608
  // `AgentDefinition.model` admits the sentinel `'inherit'`, which is not a model id. Inheriting
1609
1609
  // here means "declare nothing and let the default apply" — forwarding the literal would create
@@ -24,4 +24,13 @@ export interface DiscoveryRunnerOptions {
24
24
  readonly touchedFiles?: ReadonlyArray<string>;
25
25
  /** When true, skip `theokit-context` spec — caller already handles the legacy path. */
26
26
  readonly skipLegacyTheokitContext?: boolean;
27
+ /**
28
+ * The root an `@import` may not escape. Defaults to `gitRoot ?? cwd` — the same value
29
+ * this runner already uses to keep absolute paths out of `<source name="">`.
30
+ *
31
+ * Present so an embedder with a trust boundary narrower than the repository can declare
32
+ * it. Absent, the repository IS the boundary, which is the honest default for a document
33
+ * discovered by walking the repository.
34
+ */
35
+ readonly importRoot?: string;
27
36
  }
@@ -21,4 +21,21 @@ export interface ResolveImportsOptions {
21
21
  readonly depth: number;
22
22
  /** Per-import file cap (EC-D). Forwarded to loadPlainMarkdown. */
23
23
  readonly maxBytesPerFile: number;
24
+ /**
25
+ * The directory an import may not escape. When set, a target resolving outside it is
26
+ * refused and replaced with a placeholder.
27
+ *
28
+ * The file carrying the import is REPOSITORY-CONTROLLED — `CLAUDE.md` and `GEMINI.md`
29
+ * are the two default specs with `followImports: true`, and both are found by
30
+ * `git-root-walk` inside the tree the agent was pointed at. Without a root, a cloned
31
+ * repository could name `@~/.ssh/id_rsa` or any absolute path and have its contents
32
+ * inlined into the system prompt, and from there sent to the model provider. The
33
+ * traversal guard that already existed (`isSafePattern`) guards the discovery PATTERN,
34
+ * not the import TARGET, so it never saw this.
35
+ *
36
+ * OPTIONAL, so a caller outside the discovery path keeps the previous behaviour rather
37
+ * than breaking on an upgrade. `runDiscovery` always supplies `gitRoot ?? cwd` — the
38
+ * same value it already uses to keep absolute paths out of `<source name="">`.
39
+ */
40
+ readonly projectRoot?: string;
24
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theokit/sdk",
3
- "version": "4.41.0",
3
+ "version": "4.41.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/usetheodev/theokit-sdk#readme",