@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/CHANGELOG.md +26 -0
- package/dist/{agent-6C2ODKFU.cjs → agent-JDJEBJHU.cjs} +4 -4
- package/dist/{agent-6C2ODKFU.cjs.map → agent-JDJEBJHU.cjs.map} +1 -1
- package/dist/{agent-35MGOZVH.js → agent-LVKAYADR.js} +3 -3
- package/dist/{agent-35MGOZVH.js.map → agent-LVKAYADR.js.map} +1 -1
- package/dist/{chunk-BHWHE453.js → chunk-AUMSEL33.js} +3 -3
- package/dist/{chunk-BHWHE453.js.map → chunk-AUMSEL33.js.map} +1 -1
- package/dist/{chunk-DCKIS53K.js → chunk-DHLVOLUX.js} +27 -7
- package/dist/chunk-DHLVOLUX.js.map +1 -0
- package/dist/{chunk-Y33IGXCJ.cjs → chunk-GTLH2NI2.cjs} +5 -5
- package/dist/{chunk-Y33IGXCJ.cjs.map → chunk-GTLH2NI2.cjs.map} +1 -1
- package/dist/{chunk-F5DSDDBY.cjs → chunk-RPL3POFZ.cjs} +28 -8
- package/dist/chunk-RPL3POFZ.cjs.map +1 -0
- package/dist/cron.cjs +3 -3
- package/dist/cron.js +2 -2
- package/dist/eval.cjs +2 -2
- package/dist/eval.js +1 -1
- package/dist/index.cjs +18 -18
- package/dist/index.js +4 -4
- package/dist/internal/runtime/context/context-discovery-runner.d.ts +9 -0
- package/dist/internal/runtime/context/context-import-resolver.d.ts +17 -0
- package/package.json +1 -1
- package/dist/chunk-DCKIS53K.js.map +0 -1
- package/dist/chunk-F5DSDDBY.cjs.map +0 -1
package/dist/cron.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
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
|
|
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
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
|
|
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 =
|
|
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-
|
|
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
|
|
12
|
-
var
|
|
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) =>
|
|
66
|
-
getOrCreate: (agentId, overrides) =>
|
|
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,
|
|
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 :
|
|
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-
|
|
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:
|
|
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(
|
|
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 =
|
|
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
|
|
2106
|
+
get: function () { return chunkGTLH2NI2_cjs.Cron; }
|
|
2107
2107
|
});
|
|
2108
2108
|
Object.defineProperty(exports, "Agent", {
|
|
2109
2109
|
enumerable: true,
|
|
2110
|
-
get: function () { return
|
|
2110
|
+
get: function () { return chunkRPL3POFZ_cjs.Agent; }
|
|
2111
2111
|
});
|
|
2112
2112
|
Object.defineProperty(exports, "AgentBuilder", {
|
|
2113
2113
|
enumerable: true,
|
|
2114
|
-
get: function () { return
|
|
2114
|
+
get: function () { return chunkRPL3POFZ_cjs.AgentBuilder; }
|
|
2115
2115
|
});
|
|
2116
2116
|
Object.defineProperty(exports, "Tool", {
|
|
2117
2117
|
enumerable: true,
|
|
2118
|
-
get: function () { return
|
|
2118
|
+
get: function () { return chunkRPL3POFZ_cjs.Tool; }
|
|
2119
2119
|
});
|
|
2120
2120
|
Object.defineProperty(exports, "ToolError", {
|
|
2121
2121
|
enumerable: true,
|
|
2122
|
-
get: function () { return
|
|
2122
|
+
get: function () { return chunkRPL3POFZ_cjs.ToolError; }
|
|
2123
2123
|
});
|
|
2124
2124
|
Object.defineProperty(exports, "UsageAccumulator", {
|
|
2125
2125
|
enumerable: true,
|
|
2126
|
-
get: function () { return
|
|
2126
|
+
get: function () { return chunkRPL3POFZ_cjs.UsageAccumulator; }
|
|
2127
2127
|
});
|
|
2128
2128
|
Object.defineProperty(exports, "computeCost", {
|
|
2129
2129
|
enumerable: true,
|
|
2130
|
-
get: function () { return
|
|
2130
|
+
get: function () { return chunkRPL3POFZ_cjs.computeCost; }
|
|
2131
2131
|
});
|
|
2132
2132
|
Object.defineProperty(exports, "getPricingEntry", {
|
|
2133
2133
|
enumerable: true,
|
|
2134
|
-
get: function () { return
|
|
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-
|
|
10
|
-
import { MEMORY_EMBEDDING_ADAPTERS, resolveApiKey, DEFAULT_AGENTIC_MODEL_ID, Agent } from './chunk-
|
|
11
|
-
export { Agent, AgentBuilder, Tool, ToolError, UsageAccumulator, computeCost, getPricingEntry } from './chunk-
|
|
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-
|
|
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