@theokit/sdk 4.22.0 → 4.24.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.
- package/dist/auth/index.cjs +29 -5
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.js +29 -5
- package/dist/auth/index.js.map +1 -1
- package/dist/compaction.cjs +31 -0
- package/dist/compaction.cjs.map +1 -1
- package/dist/compaction.d.cts +79 -0
- package/dist/compaction.d.ts +79 -0
- package/dist/compaction.js +28 -1
- package/dist/compaction.js.map +1 -1
- package/dist/{cron-Bhdyjl0B.d.ts → cron-B_NkE_VM.d.ts} +15 -1
- package/dist/{cron-M2Xz7lq2.d.cts → cron-x3muPNgg.d.cts} +15 -1
- package/dist/cron.cjs +467 -337
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +467 -337
- package/dist/cron.js.map +1 -1
- package/dist/{errors-gE8612p9.d.cts → errors-BdL-buYn.d.cts} +1 -1
- package/dist/{errors-CG2RpeW-.d.ts → errors-DHZtSNnj.d.ts} +1 -1
- package/dist/errors.d.cts +2 -2
- package/dist/eval.cjs +467 -337
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +467 -337
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +640 -508
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -12
- package/dist/index.d.ts +21 -12
- package/dist/index.js +640 -508
- package/dist/index.js.map +1 -1
- package/dist/internal/auth/credential-store.d.ts +20 -3
- package/dist/internal/global-singleton.d.ts +13 -0
- package/dist/internal/llm/openai-messages.d.ts +2 -0
- package/dist/internal/local-agent/mcp-pool.d.ts +41 -0
- package/dist/internal/local-agent/real-local-run.d.ts +2 -0
- package/dist/internal/persistence/index.cjs +3 -1
- package/dist/internal/persistence/index.cjs.map +1 -1
- package/dist/internal/persistence/index.js +3 -1
- package/dist/internal/persistence/index.js.map +1 -1
- package/dist/internal/providers/registry.d.ts +1 -0
- package/dist/internal/runtime/lifecycle/context-budget-event.d.ts +25 -0
- package/dist/internal/runtime/lifecycle/goal-marker.d.ts +13 -0
- package/dist/internal/runtime/lifecycle/run-until.d.ts +0 -1
- package/dist/internal/session/agent-session.d.ts +1 -1
- package/dist/internal/session/session-cache.d.ts +20 -0
- package/dist/models.cjs +22 -20
- package/dist/models.cjs.map +1 -1
- package/dist/models.js +22 -20
- package/dist/models.js.map +1 -1
- package/dist/persistence.cjs +3 -1
- package/dist/persistence.cjs.map +1 -1
- package/dist/persistence.js +3 -1
- package/dist/persistence.js.map +1 -1
- package/dist/provider-catalog.json +144 -469
- package/dist/{run-DFM1H2jW.d.cts → run-OJbGyweZ.d.cts} +20 -1
- package/dist/{run-DFM1H2jW.d.ts → run-OJbGyweZ.d.ts} +20 -1
- package/dist/types/agent.d.ts +14 -0
- package/dist/types/run-events.d.ts +20 -1
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.js.map +1 -1
- package/package.json +2 -2
- package/dist/goal-loop.d.ts +0 -35
package/dist/models.js
CHANGED
|
@@ -6,6 +6,14 @@ import { createHash, randomBytes } from 'crypto';
|
|
|
6
6
|
import { homedir } from 'os';
|
|
7
7
|
|
|
8
8
|
// src/internal/providers/catalog-loader.ts
|
|
9
|
+
|
|
10
|
+
// src/internal/global-singleton.ts
|
|
11
|
+
function globalSingleton(key, create) {
|
|
12
|
+
const g = globalThis;
|
|
13
|
+
const sym = Symbol.for(key);
|
|
14
|
+
if (g[sym] === void 0) g[sym] = create();
|
|
15
|
+
return g[sym];
|
|
16
|
+
}
|
|
9
17
|
var MODALITIES = ["text", "audio", "image", "video", "pdf"];
|
|
10
18
|
var costSchema = z.object({
|
|
11
19
|
/** USD per 1M tokens (models.dev convention). */
|
|
@@ -41,12 +49,6 @@ var catalogModelSchema = z.object({
|
|
|
41
49
|
}).loose();
|
|
42
50
|
|
|
43
51
|
// src/internal/providers/registry.ts
|
|
44
|
-
function globalSingleton(key, create) {
|
|
45
|
-
const g = globalThis;
|
|
46
|
-
const sym = Symbol.for(key);
|
|
47
|
-
if (g[sym] === void 0) g[sym] = create();
|
|
48
|
-
return g[sym];
|
|
49
|
-
}
|
|
50
52
|
var REGISTRY = globalSingleton(
|
|
51
53
|
"theokit-sdk.providers.registry",
|
|
52
54
|
() => /* @__PURE__ */ new Map()
|
|
@@ -76,21 +78,15 @@ function getProviderProfile(name) {
|
|
|
76
78
|
|
|
77
79
|
// src/internal/providers/catalog-loader.ts
|
|
78
80
|
var __dirname_resolved = dirname(fileURLToPath(import.meta.url));
|
|
79
|
-
|
|
80
|
-
const g = globalThis;
|
|
81
|
-
const sym = Symbol.for(key);
|
|
82
|
-
if (g[sym] === void 0) g[sym] = create();
|
|
83
|
-
return g[sym];
|
|
84
|
-
}
|
|
85
|
-
var modelInfoIndex = globalSingleton2(
|
|
81
|
+
var modelInfoIndex = globalSingleton(
|
|
86
82
|
"theokit-sdk.providers.model-info-index",
|
|
87
83
|
() => /* @__PURE__ */ new Map()
|
|
88
84
|
);
|
|
89
|
-
var patchedModelKeys =
|
|
85
|
+
var patchedModelKeys = globalSingleton(
|
|
90
86
|
"theokit-sdk.providers.model-info-patched",
|
|
91
87
|
() => /* @__PURE__ */ new Set()
|
|
92
88
|
);
|
|
93
|
-
var indexState =
|
|
89
|
+
var indexState = globalSingleton("theokit-sdk.providers.model-info-loaded", () => ({
|
|
94
90
|
loaded: false
|
|
95
91
|
}));
|
|
96
92
|
function getCatalogModelInfo(key) {
|
|
@@ -296,6 +292,12 @@ var TheokitAgentError = class extends Error {
|
|
|
296
292
|
if (options.metadata !== void 0) this.metadata = options.metadata;
|
|
297
293
|
}
|
|
298
294
|
};
|
|
295
|
+
var AuthenticationError = class extends TheokitAgentError {
|
|
296
|
+
name = "AuthenticationError";
|
|
297
|
+
constructor(message, options = {}) {
|
|
298
|
+
super(message, { ...options, isRetryable: false });
|
|
299
|
+
}
|
|
300
|
+
};
|
|
299
301
|
var ConfigurationError = class extends TheokitAgentError {
|
|
300
302
|
name = "ConfigurationError";
|
|
301
303
|
constructor(message, options = {}) {
|
|
@@ -536,11 +538,11 @@ function credentialHome(config, env = {}) {
|
|
|
536
538
|
function authFilePath(config, env = {}) {
|
|
537
539
|
return join(credentialHome(config, env), config.fileName);
|
|
538
540
|
}
|
|
539
|
-
var CredentialError = class extends
|
|
540
|
-
constructor
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
541
|
+
var CredentialError = class extends AuthenticationError {
|
|
542
|
+
// Field, not an assignment in the constructor: `AuthenticationError.name` is `override readonly`
|
|
543
|
+
// (`errors.ts:174`), so `this.name = …` does not compile. Caught by `tsc`, not by vitest — the
|
|
544
|
+
// suite was green with the broken assignment because the transpiler strips the type.
|
|
545
|
+
name = "CredentialError";
|
|
544
546
|
};
|
|
545
547
|
var apiFileSchema = z.object({
|
|
546
548
|
type: z.literal("api").optional(),
|