@theokit/sdk 4.16.5 → 4.16.7
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 +12 -0
- package/dist/cron.cjs +15 -4
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.js +15 -4
- package/dist/cron.js.map +1 -1
- package/dist/eval.cjs +15 -4
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +15 -4
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +15 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/session/compact-session.d.ts +19 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.16.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix(session): a model-prefix profile only wins the summarizer route when its credential is actually RESOLVABLE (oauth/none own their auth; api_key needs one of the profile's env vars set) — an `openai` prefix with only OPENROUTER_API_KEY in the environment now falls through to env detection instead of failing with "No provider client".
|
|
8
|
+
|
|
9
|
+
## 4.16.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- fix(session): the summarizer route precedence now mirrors the run's M4 rule EXACTLY (extracted as the pure, unit-tested `resolveSummarizerRoute`): explicit key's provider > model-prefix profile (oauth builtin / M45 fleet) > env detection. The 4.16.5 ordering put the prefix profile first, so an sk-or- key + `openai/…` model 401'd against the OpenAI platform (found live).
|
|
14
|
+
|
|
3
15
|
## 4.16.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cron.cjs
CHANGED
|
@@ -5999,6 +5999,7 @@ __export(compact_session_exports, {
|
|
|
5999
5999
|
buildDefaultSummarizer: () => buildDefaultSummarizer,
|
|
6000
6000
|
compactSessionTranscript: () => compactSessionTranscript,
|
|
6001
6001
|
isCompactSummary: () => isCompactSummary,
|
|
6002
|
+
resolveSummarizerRoute: () => resolveSummarizerRoute,
|
|
6002
6003
|
shouldAutoCompact: () => shouldAutoCompact
|
|
6003
6004
|
});
|
|
6004
6005
|
function isCompactSummary(content) {
|
|
@@ -6055,15 +6056,25 @@ ${summaryBody}`;
|
|
|
6055
6056
|
const postTokens = estimateTokens([...preserved, summary].join("\n"));
|
|
6056
6057
|
return { preTokens, postTokens };
|
|
6057
6058
|
}
|
|
6059
|
+
function resolveSummarizerRoute(opts) {
|
|
6060
|
+
const provider = opts.keyProvider ?? (opts.prefixHasProfile && opts.modelPrefix !== void 0 ? opts.modelPrefix : opts.envProvider);
|
|
6061
|
+
return { provider, fullSlug: provider !== opts.modelPrefix };
|
|
6062
|
+
}
|
|
6058
6063
|
function buildDefaultSummarizer(opts) {
|
|
6059
6064
|
return async (messages) => {
|
|
6060
|
-
const keyProvider = inferProviderFromApiKey(opts.apiKey);
|
|
6061
|
-
const modelPrefix = opts.agentModel.includes("/") ? opts.agentModel.slice(0, opts.agentModel.indexOf("/")) : void 0;
|
|
6062
6065
|
registerBuiltins();
|
|
6066
|
+
const modelPrefix = opts.agentModel.includes("/") ? opts.agentModel.slice(0, opts.agentModel.indexOf("/")) : void 0;
|
|
6063
6067
|
const prefixProfile = modelPrefix !== void 0 ? getProviderProfile(modelPrefix) : void 0;
|
|
6064
|
-
const
|
|
6068
|
+
const prefixUsable = prefixProfile !== void 0 && (prefixProfile.authType !== "api_key" || prefixProfile.envVars.some((v) => (process.env[v] ?? "").length > 0));
|
|
6069
|
+
const route = resolveSummarizerRoute({
|
|
6070
|
+
keyProvider: inferProviderFromApiKey(opts.apiKey),
|
|
6071
|
+
modelPrefix,
|
|
6072
|
+
prefixHasProfile: prefixUsable,
|
|
6073
|
+
envProvider: detectPrimaryProvider()
|
|
6074
|
+
});
|
|
6075
|
+
const provider = route.provider;
|
|
6065
6076
|
let model;
|
|
6066
|
-
if (
|
|
6077
|
+
if (route.fullSlug) {
|
|
6067
6078
|
model = opts.agentModel;
|
|
6068
6079
|
} else {
|
|
6069
6080
|
try {
|