@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.
Files changed (45) hide show
  1. package/dist/cron-Bhdyjl0B.d.ts +2582 -0
  2. package/dist/cron-M2Xz7lq2.d.cts +2582 -0
  3. package/dist/cron.cjs +19 -8
  4. package/dist/cron.cjs.map +1 -1
  5. package/dist/cron.d.cts +3 -0
  6. package/dist/cron.d.ts +3 -0
  7. package/dist/cron.js +19 -8
  8. package/dist/cron.js.map +1 -1
  9. package/dist/errors-CG2RpeW-.d.ts +516 -0
  10. package/dist/errors-gE8612p9.d.cts +516 -0
  11. package/dist/errors.d.cts +3 -0
  12. package/dist/eval.cjs +19 -8
  13. package/dist/eval.cjs.map +1 -1
  14. package/dist/eval.js +19 -8
  15. package/dist/eval.js.map +1 -1
  16. package/dist/filesystem/index.cjs +2 -1
  17. package/dist/filesystem/index.cjs.map +1 -1
  18. package/dist/filesystem/index.js +2 -1
  19. package/dist/filesystem/index.js.map +1 -1
  20. package/dist/goal-loop.d.ts +35 -0
  21. package/dist/index.cjs +139 -130
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +2309 -0
  24. package/dist/index.d.ts +2309 -0
  25. package/dist/index.js +139 -130
  26. package/dist/index.js.map +1 -1
  27. package/dist/internal/runtime/lifecycle/run-until.d.ts +1 -1
  28. package/dist/internal/security/index.cjs +2 -1
  29. package/dist/internal/security/index.cjs.map +1 -1
  30. package/dist/internal/security/index.js +2 -1
  31. package/dist/internal/security/index.js.map +1 -1
  32. package/dist/path-safety.cjs +2 -1
  33. package/dist/path-safety.cjs.map +1 -1
  34. package/dist/path-safety.js +2 -1
  35. package/dist/path-safety.js.map +1 -1
  36. package/dist/provider-catalog.json +1620 -0
  37. package/dist/run-DFM1H2jW.d.cts +1589 -0
  38. package/dist/run-DFM1H2jW.d.ts +1589 -0
  39. package/dist/skills.cjs +2 -1
  40. package/dist/skills.cjs.map +1 -1
  41. package/dist/skills.js +2 -1
  42. package/dist/skills.js.map +1 -1
  43. package/dist/workflow.cjs.map +1 -1
  44. package/dist/workflow.js.map +1 -1
  45. 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
- if (target !== baseResolved && !target.startsWith(baseResolved + sep)) {
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((p) => p !== null && typeof p === "object" && p.type === "text" && typeof p.text === "string").map((p) => p.text);
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(`[theokit-sdk] auto-compaction failed (left transcript untouched): ${msg}
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
- GOAL_CONTINUATION_MARKER = "[[theokit:goal-continuation]]";
6428
+ init_goal_loop();
6418
6429
  }
6419
6430
  });
6420
6431