@theokit/sdk 4.19.1 → 4.19.3
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/cron-Bhdyjl0B.d.ts +2582 -0
- package/dist/cron-M2Xz7lq2.d.cts +2582 -0
- package/dist/cron.cjs +19 -8
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.d.cts +3 -0
- package/dist/cron.d.ts +3 -0
- package/dist/cron.js +19 -8
- package/dist/cron.js.map +1 -1
- package/dist/errors-CG2RpeW-.d.ts +516 -0
- package/dist/errors-gE8612p9.d.cts +516 -0
- package/dist/errors.d.cts +3 -0
- package/dist/eval.cjs +19 -8
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +19 -8
- package/dist/eval.js.map +1 -1
- package/dist/filesystem/index.cjs +2 -1
- package/dist/filesystem/index.cjs.map +1 -1
- package/dist/filesystem/index.js +2 -1
- package/dist/filesystem/index.js.map +1 -1
- package/dist/goal-loop.d.ts +35 -0
- package/dist/index.cjs +139 -130
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2309 -0
- package/dist/index.d.ts +2309 -0
- package/dist/index.js +139 -130
- package/dist/index.js.map +1 -1
- package/dist/internal/runtime/lifecycle/run-until.d.ts +1 -1
- package/dist/internal/security/index.cjs +2 -1
- package/dist/internal/security/index.cjs.map +1 -1
- package/dist/internal/security/index.js +2 -1
- package/dist/internal/security/index.js.map +1 -1
- package/dist/path-safety.cjs +2 -1
- package/dist/path-safety.cjs.map +1 -1
- package/dist/path-safety.js +2 -1
- package/dist/path-safety.js.map +1 -1
- package/dist/provider-catalog.json +1620 -0
- package/dist/run-DFM1H2jW.d.cts +1589 -0
- package/dist/run-DFM1H2jW.d.ts +1589 -0
- package/dist/skills.cjs +2 -1
- package/dist/skills.cjs.map +1 -1
- package/dist/skills.js +2 -1
- package/dist/skills.js.map +1 -1
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.js.map +1 -1
- package/package.json +13 -12
package/dist/eval.js
CHANGED
|
@@ -857,7 +857,8 @@ function safePathJoin(base, ...parts) {
|
|
|
857
857
|
}
|
|
858
858
|
const baseResolved = resolve(base);
|
|
859
859
|
const target = resolve(base, ...parts);
|
|
860
|
-
|
|
860
|
+
const prefix = baseResolved.endsWith(sep) ? baseResolved : baseResolved + sep;
|
|
861
|
+
if (target !== baseResolved && !target.startsWith(prefix)) {
|
|
861
862
|
throw new PathTraversalError(parts.join("/"), target);
|
|
862
863
|
}
|
|
863
864
|
return target;
|
|
@@ -6002,7 +6003,9 @@ function isCompactSummary(content) {
|
|
|
6002
6003
|
function plainText(content) {
|
|
6003
6004
|
if (typeof content === "string") return content;
|
|
6004
6005
|
if (!Array.isArray(content)) return void 0;
|
|
6005
|
-
const texts = content.filter(
|
|
6006
|
+
const texts = content.filter(
|
|
6007
|
+
(p) => p !== null && typeof p === "object" && p.type === "text" && typeof p.text === "string"
|
|
6008
|
+
).map((p) => p.text);
|
|
6006
6009
|
return texts.length > 0 ? texts.join("\n") : void 0;
|
|
6007
6010
|
}
|
|
6008
6011
|
async function compactSessionTranscript(opts) {
|
|
@@ -6123,8 +6126,10 @@ async function autoCompactIfNeeded(opts) {
|
|
|
6123
6126
|
return true;
|
|
6124
6127
|
} catch (cause) {
|
|
6125
6128
|
const msg = cause instanceof Error ? cause.message : String(cause);
|
|
6126
|
-
process.stderr.write(
|
|
6127
|
-
`)
|
|
6129
|
+
process.stderr.write(
|
|
6130
|
+
`[theokit-sdk] auto-compaction failed (left transcript untouched): ${msg}
|
|
6131
|
+
`
|
|
6132
|
+
);
|
|
6128
6133
|
return false;
|
|
6129
6134
|
}
|
|
6130
6135
|
}
|
|
@@ -6134,11 +6139,11 @@ var init_compact_session = __esm({
|
|
|
6134
6139
|
init_compaction();
|
|
6135
6140
|
init_router();
|
|
6136
6141
|
init_real_local_run_provider();
|
|
6142
|
+
init_session_transcript();
|
|
6137
6143
|
init_providers();
|
|
6138
6144
|
init_compression_model_registry();
|
|
6139
6145
|
init_compression_summarizer();
|
|
6140
6146
|
init_agent_session();
|
|
6141
|
-
init_session_transcript();
|
|
6142
6147
|
COMPACT_SUMMARY_MARKER = "[[theokit:compact-summary]]";
|
|
6143
6148
|
COMPACT_USER_MESSAGE_MAX_TOKENS = 2e4;
|
|
6144
6149
|
autoCompactAttempts = (() => {
|
|
@@ -6243,10 +6248,17 @@ var init_context = __esm({
|
|
|
6243
6248
|
}
|
|
6244
6249
|
});
|
|
6245
6250
|
|
|
6251
|
+
// src/goal-loop.ts
|
|
6252
|
+
var GOAL_CONTINUATION_MARKER;
|
|
6253
|
+
var init_goal_loop = __esm({
|
|
6254
|
+
"src/goal-loop.ts"() {
|
|
6255
|
+
GOAL_CONTINUATION_MARKER = "[[theokit:goal-continuation]]";
|
|
6256
|
+
}
|
|
6257
|
+
});
|
|
6258
|
+
|
|
6246
6259
|
// src/internal/runtime/lifecycle/run-until.ts
|
|
6247
6260
|
var run_until_exports = {};
|
|
6248
6261
|
__export(run_until_exports, {
|
|
6249
|
-
GOAL_CONTINUATION_MARKER: () => GOAL_CONTINUATION_MARKER,
|
|
6250
6262
|
composeContinuation: () => composeContinuation,
|
|
6251
6263
|
runUntilImpl: () => runUntilImpl
|
|
6252
6264
|
});
|
|
@@ -6411,10 +6423,9 @@ ${goal}
|
|
|
6411
6423
|
${lastResponse.slice(-1e3)}`
|
|
6412
6424
|
].join("\n");
|
|
6413
6425
|
}
|
|
6414
|
-
var GOAL_CONTINUATION_MARKER;
|
|
6415
6426
|
var init_run_until = __esm({
|
|
6416
6427
|
"src/internal/runtime/lifecycle/run-until.ts"() {
|
|
6417
|
-
|
|
6428
|
+
init_goal_loop();
|
|
6418
6429
|
}
|
|
6419
6430
|
});
|
|
6420
6431
|
|