@theokit/sdk 4.51.1 → 4.52.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 +44 -0
- package/dist/{agent-QWNWBCQZ.js → agent-RDHK6MVT.js} +6 -5
- package/dist/{agent-QWNWBCQZ.js.map → agent-RDHK6MVT.js.map} +1 -1
- package/dist/{agent-2KSLHB6B.cjs → agent-U2R2R5JP.cjs} +7 -6
- package/dist/{agent-2KSLHB6B.cjs.map → agent-U2R2R5JP.cjs.map} +1 -1
- package/dist/auth/index.cjs +5 -0
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.d.cts +15 -0
- package/dist/auth/index.d.ts +15 -0
- package/dist/auth/index.js +1 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/{chunk-DRRSUUI5.js → chunk-42PLABFU.js} +3 -3
- package/dist/{chunk-DRRSUUI5.js.map → chunk-42PLABFU.js.map} +1 -1
- package/dist/{chunk-XI4L45SS.cjs → chunk-6GS7JI64.cjs} +43 -43
- package/dist/{chunk-XI4L45SS.cjs.map → chunk-6GS7JI64.cjs.map} +1 -1
- package/dist/{chunk-3BKWFISQ.cjs → chunk-CY7MIMI4.cjs} +3 -3
- package/dist/{chunk-3BKWFISQ.cjs.map → chunk-CY7MIMI4.cjs.map} +1 -1
- package/dist/chunk-FRITRLZQ.cjs +24 -0
- package/dist/chunk-FRITRLZQ.cjs.map +1 -0
- package/dist/{chunk-BVT6LFQ3.js → chunk-GNPI5IWZ.js} +3 -3
- package/dist/{chunk-BVT6LFQ3.js.map → chunk-GNPI5IWZ.js.map} +1 -1
- package/dist/{chunk-6CSIUJ5W.js → chunk-KELIQH7K.js} +6 -6
- package/dist/{chunk-6CSIUJ5W.js.map → chunk-KELIQH7K.js.map} +1 -1
- package/dist/{chunk-QVIUICFM.js → chunk-M5EK7N6R.js} +6 -14
- package/dist/chunk-M5EK7N6R.js.map +1 -0
- package/dist/chunk-NAF4L3T6.js +22 -0
- package/dist/chunk-NAF4L3T6.js.map +1 -0
- package/dist/{chunk-N6NUMXAJ.cjs → chunk-WLESQ3ZQ.cjs} +8 -16
- package/dist/chunk-WLESQ3ZQ.cjs.map +1 -0
- package/dist/{chunk-2S7IB4O3.cjs → chunk-ZNEE4WWQ.cjs} +5 -5
- package/dist/{chunk-2S7IB4O3.cjs.map → chunk-ZNEE4WWQ.cjs.map} +1 -1
- package/dist/{compact-session-AAFICMPQ.cjs → compact-session-FBVWO6B3.cjs} +12 -11
- package/dist/{compact-session-AAFICMPQ.cjs.map → compact-session-FBVWO6B3.cjs.map} +1 -1
- package/dist/{compact-session-LR73ESZX.js → compact-session-XLXC2CZN.js} +4 -3
- package/dist/{compact-session-LR73ESZX.js.map → compact-session-XLXC2CZN.js.map} +1 -1
- package/dist/cron.cjs +6 -5
- package/dist/cron.js +5 -4
- package/dist/eval.cjs +5 -4
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +4 -3
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +28 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/{inject-session-KOGUD6KM.cjs → inject-session-UBAQ7I3G.cjs} +4 -4
- package/dist/{inject-session-KOGUD6KM.cjs.map → inject-session-UBAQ7I3G.cjs.map} +1 -1
- package/dist/{inject-session-6ZAFN7F7.js → inject-session-UEH5MAKU.js} +3 -3
- package/dist/{inject-session-6ZAFN7F7.js.map → inject-session-UEH5MAKU.js.map} +1 -1
- package/dist/internal/auth/api-key-prefix.d.ts +23 -0
- package/package.json +1 -1
- package/dist/chunk-N6NUMXAJ.cjs.map +0 -1
- 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
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
11
|
+
var chunkZNEE4WWQ_cjs = require('./chunk-ZNEE4WWQ.cjs');
|
|
12
|
+
var chunk6GS7JI64_cjs = require('./chunk-6GS7JI64.cjs');
|
|
13
|
+
require('./chunk-CY7MIMI4.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
|
|
18
|
+
var chunkWLESQ3ZQ_cjs = require('./chunk-WLESQ3ZQ.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-FRITRLZQ.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) =>
|
|
68
|
-
getOrCreate: (agentId, overrides) =>
|
|
68
|
+
forSession: (agentId, overrides) => chunk6GS7JI64_cjs.Agent.create(mergeAgentOptions(common, overrides, agentId)),
|
|
69
|
+
getOrCreate: (agentId, overrides) => chunk6GS7JI64_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,
|
|
1265
|
+
openArgs.embedding = await resolveEmbedding(opts.embedding, chunk6GS7JI64_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 :
|
|
1276
|
+
const catalog = peer !== null ? peer.MEMORY_EMBEDDING_ADAPTERS : chunk6GS7JI64_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-
|
|
1840
|
+
const { Agent: Agent2 } = await import('./agent-U2R2R5JP.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:
|
|
1982
|
+
id: chunk6GS7JI64_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 =
|
|
2058
|
+
const mapped = chunkWLESQ3ZQ_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
|
|
2070
|
-
const mapped =
|
|
2070
|
+
const body = await chunkWLESQ3ZQ_cjs.readErrorResponseBody(response);
|
|
2071
|
+
const mapped = chunkWLESQ3ZQ_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(
|
|
2185
|
+
embeddingAdapters: () => Object.entries(chunk6GS7JI64_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
|
|
2203
|
+
await chunkWLESQ3ZQ_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 =
|
|
2217
|
+
const apiKey = chunk6GS7JI64_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 (
|
|
2221
|
+
if (chunkWLESQ3ZQ_cjs.shouldUseFixtureMode(apiKey)) {
|
|
2221
2222
|
return request.fixture;
|
|
2222
2223
|
}
|
|
2223
|
-
if (!
|
|
2224
|
+
if (!chunkWLESQ3ZQ_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
|
|
2227
|
+
return chunkWLESQ3ZQ_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
|
|
2392
|
+
get: function () { return chunkZNEE4WWQ_cjs.Cron; }
|
|
2392
2393
|
});
|
|
2393
2394
|
Object.defineProperty(exports, "Agent", {
|
|
2394
2395
|
enumerable: true,
|
|
2395
|
-
get: function () { return
|
|
2396
|
+
get: function () { return chunk6GS7JI64_cjs.Agent; }
|
|
2396
2397
|
});
|
|
2397
2398
|
Object.defineProperty(exports, "AgentBuilder", {
|
|
2398
2399
|
enumerable: true,
|
|
2399
|
-
get: function () { return
|
|
2400
|
+
get: function () { return chunk6GS7JI64_cjs.AgentBuilder; }
|
|
2400
2401
|
});
|
|
2401
2402
|
Object.defineProperty(exports, "Tool", {
|
|
2402
2403
|
enumerable: true,
|
|
2403
|
-
get: function () { return
|
|
2404
|
+
get: function () { return chunk6GS7JI64_cjs.Tool; }
|
|
2404
2405
|
});
|
|
2405
2406
|
Object.defineProperty(exports, "ToolError", {
|
|
2406
2407
|
enumerable: true,
|
|
2407
|
-
get: function () { return
|
|
2408
|
+
get: function () { return chunk6GS7JI64_cjs.ToolError; }
|
|
2408
2409
|
});
|
|
2409
2410
|
Object.defineProperty(exports, "UsageAccumulator", {
|
|
2410
2411
|
enumerable: true,
|
|
2411
|
-
get: function () { return
|
|
2412
|
+
get: function () { return chunk6GS7JI64_cjs.UsageAccumulator; }
|
|
2412
2413
|
});
|
|
2413
2414
|
Object.defineProperty(exports, "computeCost", {
|
|
2414
2415
|
enumerable: true,
|
|
2415
|
-
get: function () { return
|
|
2416
|
+
get: function () { return chunk6GS7JI64_cjs.computeCost; }
|
|
2416
2417
|
});
|
|
2417
2418
|
Object.defineProperty(exports, "getPricingEntry", {
|
|
2418
2419
|
enumerable: true,
|
|
2419
|
-
get: function () { return
|
|
2420
|
+
get: function () { return chunk6GS7JI64_cjs.getPricingEntry; }
|
|
2420
2421
|
});
|
|
2421
2422
|
Object.defineProperty(exports, "emitRunEvent", {
|
|
2422
2423
|
enumerable: true,
|