@theokit/sdk 4.15.1 → 4.15.2
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 +6 -0
- package/dist/cron.cjs +28 -11
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.js +28 -11
- package/dist/cron.js.map +1 -1
- package/dist/eval.cjs +28 -11
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +28 -11
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +29 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +29 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9723,7 +9723,7 @@ var SkillsManager = class {
|
|
|
9723
9723
|
}
|
|
9724
9724
|
async refresh() {
|
|
9725
9725
|
const skillsRoot = this.skillsDir ?? join(this.cwd, ".theokit", "skills");
|
|
9726
|
-
const
|
|
9726
|
+
const discovered = await discoverSkills(skillsRoot, {
|
|
9727
9727
|
onInvalidSkill: (info) => {
|
|
9728
9728
|
process.stderr.write(
|
|
9729
9729
|
`[theokit-sdk] skill ${info.name} skipped (${info.code}): ${info.message}
|
|
@@ -9731,13 +9731,13 @@ var SkillsManager = class {
|
|
|
9731
9731
|
);
|
|
9732
9732
|
}
|
|
9733
9733
|
});
|
|
9734
|
-
this.skills = this.mergeInline(
|
|
9734
|
+
this.skills = this.mergeInline(discovered);
|
|
9735
9735
|
}
|
|
9736
9736
|
/** M22 — merge inline skills over discovered ones; inline wins on a name conflict. */
|
|
9737
|
-
mergeInline(
|
|
9738
|
-
if (this.inline === void 0 || this.inline.length === 0) return
|
|
9737
|
+
mergeInline(discovered) {
|
|
9738
|
+
if (this.inline === void 0 || this.inline.length === 0) return discovered;
|
|
9739
9739
|
const inlineNames = new Set(this.inline.map((s) => s.name));
|
|
9740
|
-
return [...
|
|
9740
|
+
return [...discovered.filter((s) => !inlineNames.has(s.name)), ...this.inline];
|
|
9741
9741
|
}
|
|
9742
9742
|
list() {
|
|
9743
9743
|
return Promise.resolve(this.skills);
|
|
@@ -11298,7 +11298,7 @@ var FileContextManager = class {
|
|
|
11298
11298
|
const legacy = await loadSources(config, this.cwd);
|
|
11299
11299
|
const maxBytesPerFile = this.settings.maxBytesPerFile ?? DEFAULT_MAX_BYTES_PER_FILE;
|
|
11300
11300
|
const maxBytesTotal = this.settings.maxBytesTotal ?? DEFAULT_MAX_BYTES_TOTAL;
|
|
11301
|
-
const
|
|
11301
|
+
const discovered = await runDiscovery({
|
|
11302
11302
|
cwd: this.cwd,
|
|
11303
11303
|
maxBytesPerFile,
|
|
11304
11304
|
touchedFiles
|
|
@@ -11311,7 +11311,7 @@ var FileContextManager = class {
|
|
|
11311
11311
|
// matches DEFAULT_DISCOVERY_SPECS theokit-context
|
|
11312
11312
|
truncated: false
|
|
11313
11313
|
}));
|
|
11314
|
-
const { kept } = applyAggregateCap([...
|
|
11314
|
+
const { kept } = applyAggregateCap([...discovered, ...legacyAsAggregator], maxBytesTotal);
|
|
11315
11315
|
const loadedSources = kept.map((s) => ({
|
|
11316
11316
|
name: s.id,
|
|
11317
11317
|
path: s.source,
|
|
@@ -14632,7 +14632,15 @@ function registerBuiltins() {
|
|
|
14632
14632
|
registerProvider(CEREBRAS);
|
|
14633
14633
|
registerCatalogProviders();
|
|
14634
14634
|
}
|
|
14635
|
-
|
|
14635
|
+
function globalSingleton3(key2, create) {
|
|
14636
|
+
const g = globalThis;
|
|
14637
|
+
const sym = Symbol.for(key2);
|
|
14638
|
+
if (g[sym] === void 0) g[sym] = create();
|
|
14639
|
+
return g[sym];
|
|
14640
|
+
}
|
|
14641
|
+
var discoveryState = globalSingleton3("theokit-sdk.providers.discovered", () => ({
|
|
14642
|
+
done: false
|
|
14643
|
+
}));
|
|
14636
14644
|
function pluginsRoot() {
|
|
14637
14645
|
return join(homedir(), ".theokit", "plugins", "model-providers");
|
|
14638
14646
|
}
|
|
@@ -14646,8 +14654,16 @@ function loadTrustedNames() {
|
|
|
14646
14654
|
try {
|
|
14647
14655
|
const parsed = JSON.parse(readFileSync(path, "utf-8"));
|
|
14648
14656
|
if (Array.isArray(parsed)) {
|
|
14657
|
+
let discarded = 0;
|
|
14649
14658
|
for (const name of parsed) {
|
|
14650
14659
|
if (typeof name === "string" && name.length > 0) trusted.add(name);
|
|
14660
|
+
else discarded += 1;
|
|
14661
|
+
}
|
|
14662
|
+
if (discarded > 0) {
|
|
14663
|
+
process.stderr.write(
|
|
14664
|
+
`[theokit-sdk] WARN: ${path} contains ${discarded} non-string entr${discarded === 1 ? "y" : "ies"} \u2014 discarded (entries must be plugin-name strings)
|
|
14665
|
+
`
|
|
14666
|
+
);
|
|
14651
14667
|
}
|
|
14652
14668
|
} else {
|
|
14653
14669
|
process.stderr.write(
|
|
@@ -14669,8 +14685,8 @@ function loadTrustedNames() {
|
|
|
14669
14685
|
return trusted;
|
|
14670
14686
|
}
|
|
14671
14687
|
async function discoverProviderPlugins() {
|
|
14672
|
-
if (
|
|
14673
|
-
|
|
14688
|
+
if (discoveryState.done) return;
|
|
14689
|
+
discoveryState.done = true;
|
|
14674
14690
|
const root = pluginsRoot();
|
|
14675
14691
|
if (!existsSync(root)) return;
|
|
14676
14692
|
let entries;
|
|
@@ -14683,7 +14699,7 @@ async function discoverProviderPlugins() {
|
|
|
14683
14699
|
for (const entry of entries) {
|
|
14684
14700
|
if (!trusted.has(entry)) {
|
|
14685
14701
|
process.stderr.write(
|
|
14686
|
-
`[theokit-sdk] WARN: provider plugin "${entry}" is present but NOT trusted \u2014 skipped. To trust it, add "${entry}" to ${trustFilePath()} (JSON array) or THEOKIT_TRUSTED_PROVIDERS.
|
|
14702
|
+
`[theokit-sdk] WARN: provider plugin "${entry}" is present but NOT trusted \u2014 skipped. To trust it, add "${entry}" to ${trustFilePath()} (JSON array of names) or THEOKIT_TRUSTED_PROVIDERS (comma-separated), then restart the process.
|
|
14687
14703
|
`
|
|
14688
14704
|
);
|
|
14689
14705
|
continue;
|
|
@@ -20315,6 +20331,7 @@ function resolveAgentPersistenceCwd(options) {
|
|
|
20315
20331
|
return process.cwd();
|
|
20316
20332
|
}
|
|
20317
20333
|
async function rehydrateExistingAgent(agentId, existing, options) {
|
|
20334
|
+
await discoverProviderPlugins();
|
|
20318
20335
|
await validateRehydratedAgent(agentId, existing);
|
|
20319
20336
|
const mergedLocal = options.local !== void 0 && existing.options.local !== void 0 ? { ...existing.options.local, ...options.local } : options.local ?? existing.options.local;
|
|
20320
20337
|
const mergedOptions = {
|
|
@@ -23393,6 +23410,7 @@ var Theokit = class {
|
|
|
23393
23410
|
};
|
|
23394
23411
|
async function maybeListLocalModels(providerName) {
|
|
23395
23412
|
registerBuiltins();
|
|
23413
|
+
await discoverProviderPlugins();
|
|
23396
23414
|
const profile = getProviderProfile(providerName);
|
|
23397
23415
|
if (profile === void 0) return void 0;
|
|
23398
23416
|
if (profile.authType !== "none") return void 0;
|