@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.15.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix(providers): M47 adversarial-review fixes on the dynamic-loader trust gate — (F1) `Agent.resume` now runs provider-plugin discovery (a fresh process resuming a persisted agent whose model targets a plugin provider no longer fails resolution); (F2) `Theokit.models.list({provider})` local path runs discovery too (sync surfaces stay builtins-only, documented); (F3) the discovery idempotence flag moved to `globalThis` (`Symbol.for`) matching the registry's M44 B1 pattern — no duplicate discovery per bundle entry; (F4/F7) the NOT-trusted WARN now says "then restart the process" and documents the comma-separated env format; (F5) non-string entries in a valid trust-file array WARN instead of being silently discarded.
|
|
8
|
+
|
|
3
9
|
## 4.15.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cron.cjs
CHANGED
|
@@ -7148,7 +7148,7 @@ var SkillsManager = class {
|
|
|
7148
7148
|
}
|
|
7149
7149
|
async refresh() {
|
|
7150
7150
|
const skillsRoot = this.skillsDir ?? path.join(this.cwd, ".theokit", "skills");
|
|
7151
|
-
const
|
|
7151
|
+
const discovered = await discoverSkills(skillsRoot, {
|
|
7152
7152
|
onInvalidSkill: (info) => {
|
|
7153
7153
|
process.stderr.write(
|
|
7154
7154
|
`[theokit-sdk] skill ${info.name} skipped (${info.code}): ${info.message}
|
|
@@ -7156,13 +7156,13 @@ var SkillsManager = class {
|
|
|
7156
7156
|
);
|
|
7157
7157
|
}
|
|
7158
7158
|
});
|
|
7159
|
-
this.skills = this.mergeInline(
|
|
7159
|
+
this.skills = this.mergeInline(discovered);
|
|
7160
7160
|
}
|
|
7161
7161
|
/** M22 — merge inline skills over discovered ones; inline wins on a name conflict. */
|
|
7162
|
-
mergeInline(
|
|
7163
|
-
if (this.inline === void 0 || this.inline.length === 0) return
|
|
7162
|
+
mergeInline(discovered) {
|
|
7163
|
+
if (this.inline === void 0 || this.inline.length === 0) return discovered;
|
|
7164
7164
|
const inlineNames = new Set(this.inline.map((s) => s.name));
|
|
7165
|
-
return [...
|
|
7165
|
+
return [...discovered.filter((s) => !inlineNames.has(s.name)), ...this.inline];
|
|
7166
7166
|
}
|
|
7167
7167
|
list() {
|
|
7168
7168
|
return Promise.resolve(this.skills);
|
|
@@ -8720,7 +8720,7 @@ var FileContextManager = class {
|
|
|
8720
8720
|
const legacy = await loadSources(config, this.cwd);
|
|
8721
8721
|
const maxBytesPerFile = this.settings.maxBytesPerFile ?? DEFAULT_MAX_BYTES_PER_FILE;
|
|
8722
8722
|
const maxBytesTotal = this.settings.maxBytesTotal ?? DEFAULT_MAX_BYTES_TOTAL;
|
|
8723
|
-
const
|
|
8723
|
+
const discovered = await runDiscovery({
|
|
8724
8724
|
cwd: this.cwd,
|
|
8725
8725
|
maxBytesPerFile,
|
|
8726
8726
|
touchedFiles
|
|
@@ -8733,7 +8733,7 @@ var FileContextManager = class {
|
|
|
8733
8733
|
// matches DEFAULT_DISCOVERY_SPECS theokit-context
|
|
8734
8734
|
truncated: false
|
|
8735
8735
|
}));
|
|
8736
|
-
const { kept } = applyAggregateCap([...
|
|
8736
|
+
const { kept } = applyAggregateCap([...discovered, ...legacyAsAggregator], maxBytesTotal);
|
|
8737
8737
|
const loadedSources = kept.map((s) => ({
|
|
8738
8738
|
name: s.id,
|
|
8739
8739
|
path: s.source,
|
|
@@ -12036,7 +12036,15 @@ function registerBuiltins() {
|
|
|
12036
12036
|
registerProvider(CEREBRAS);
|
|
12037
12037
|
registerCatalogProviders();
|
|
12038
12038
|
}
|
|
12039
|
-
|
|
12039
|
+
function globalSingleton3(key, create) {
|
|
12040
|
+
const g = globalThis;
|
|
12041
|
+
const sym = Symbol.for(key);
|
|
12042
|
+
if (g[sym] === void 0) g[sym] = create();
|
|
12043
|
+
return g[sym];
|
|
12044
|
+
}
|
|
12045
|
+
var discoveryState = globalSingleton3("theokit-sdk.providers.discovered", () => ({
|
|
12046
|
+
done: false
|
|
12047
|
+
}));
|
|
12040
12048
|
function pluginsRoot() {
|
|
12041
12049
|
return path.join(os.homedir(), ".theokit", "plugins", "model-providers");
|
|
12042
12050
|
}
|
|
@@ -12050,8 +12058,16 @@ function loadTrustedNames() {
|
|
|
12050
12058
|
try {
|
|
12051
12059
|
const parsed = JSON.parse(fs.readFileSync(path, "utf-8"));
|
|
12052
12060
|
if (Array.isArray(parsed)) {
|
|
12061
|
+
let discarded = 0;
|
|
12053
12062
|
for (const name of parsed) {
|
|
12054
12063
|
if (typeof name === "string" && name.length > 0) trusted.add(name);
|
|
12064
|
+
else discarded += 1;
|
|
12065
|
+
}
|
|
12066
|
+
if (discarded > 0) {
|
|
12067
|
+
process.stderr.write(
|
|
12068
|
+
`[theokit-sdk] WARN: ${path} contains ${discarded} non-string entr${discarded === 1 ? "y" : "ies"} \u2014 discarded (entries must be plugin-name strings)
|
|
12069
|
+
`
|
|
12070
|
+
);
|
|
12055
12071
|
}
|
|
12056
12072
|
} else {
|
|
12057
12073
|
process.stderr.write(
|
|
@@ -12073,8 +12089,8 @@ function loadTrustedNames() {
|
|
|
12073
12089
|
return trusted;
|
|
12074
12090
|
}
|
|
12075
12091
|
async function discoverProviderPlugins() {
|
|
12076
|
-
if (
|
|
12077
|
-
|
|
12092
|
+
if (discoveryState.done) return;
|
|
12093
|
+
discoveryState.done = true;
|
|
12078
12094
|
const root = pluginsRoot();
|
|
12079
12095
|
if (!fs.existsSync(root)) return;
|
|
12080
12096
|
let entries;
|
|
@@ -12087,7 +12103,7 @@ async function discoverProviderPlugins() {
|
|
|
12087
12103
|
for (const entry of entries) {
|
|
12088
12104
|
if (!trusted.has(entry)) {
|
|
12089
12105
|
process.stderr.write(
|
|
12090
|
-
`[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.
|
|
12106
|
+
`[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.
|
|
12091
12107
|
`
|
|
12092
12108
|
);
|
|
12093
12109
|
continue;
|
|
@@ -18665,6 +18681,7 @@ function resolveAgentPersistenceCwd(options) {
|
|
|
18665
18681
|
return process.cwd();
|
|
18666
18682
|
}
|
|
18667
18683
|
async function rehydrateExistingAgent(agentId, existing, options) {
|
|
18684
|
+
await discoverProviderPlugins();
|
|
18668
18685
|
await validateRehydratedAgent(agentId, existing);
|
|
18669
18686
|
const mergedLocal = options.local !== void 0 && existing.options.local !== void 0 ? { ...existing.options.local, ...options.local } : options.local ?? existing.options.local;
|
|
18670
18687
|
const mergedOptions = {
|