@theokit/sdk 5.0.1 → 5.1.0

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 (98) hide show
  1. package/CHANGELOG.md +267 -0
  2. package/dist/a2a/index.cjs +3 -3
  3. package/dist/a2a/index.js +1 -1
  4. package/dist/a2a/subagent.d.cts +22 -3
  5. package/dist/a2a/subagent.d.ts +22 -3
  6. package/dist/{agent-TKJBWGGQ.cjs → agent-ARLOD4JX.cjs} +9 -9
  7. package/dist/{agent-TKJBWGGQ.cjs.map → agent-ARLOD4JX.cjs.map} +1 -1
  8. package/dist/{agent-UGYIYC3R.js → agent-N6WJ54ML.js} +8 -8
  9. package/dist/{agent-UGYIYC3R.js.map → agent-N6WJ54ML.js.map} +1 -1
  10. package/dist/{chunk-CC7EYKBJ.cjs → chunk-67SBTGMA.cjs} +4 -4
  11. package/dist/{chunk-CC7EYKBJ.cjs.map → chunk-67SBTGMA.cjs.map} +1 -1
  12. package/dist/{chunk-D7WAROJR.js → chunk-AW6F6HZR.js} +3 -3
  13. package/dist/{chunk-D7WAROJR.js.map → chunk-AW6F6HZR.js.map} +1 -1
  14. package/dist/{chunk-6WAKKTBO.js → chunk-CFE6QF2Q.js} +19 -3
  15. package/dist/chunk-CFE6QF2Q.js.map +1 -0
  16. package/dist/{chunk-CQLVA4CO.cjs → chunk-D3CCY3A2.cjs} +60 -53
  17. package/dist/chunk-D3CCY3A2.cjs.map +1 -0
  18. package/dist/{chunk-UFPUHJWS.js → chunk-IUMAQURF.js} +7 -2
  19. package/dist/chunk-IUMAQURF.js.map +1 -0
  20. package/dist/{chunk-LTLPBGHC.cjs → chunk-KGANQYP7.cjs} +5 -5
  21. package/dist/{chunk-LTLPBGHC.cjs.map → chunk-KGANQYP7.cjs.map} +1 -1
  22. package/dist/{chunk-XDANGA2C.js → chunk-LX7SEXOQ.js} +6 -3
  23. package/dist/chunk-LX7SEXOQ.js.map +1 -0
  24. package/dist/{chunk-QME6FDFG.cjs → chunk-NQTD6QOW.cjs} +19 -3
  25. package/dist/chunk-NQTD6QOW.cjs.map +1 -0
  26. package/dist/{chunk-DLRP7BI6.cjs → chunk-NYQ3IS7K.cjs} +3 -3
  27. package/dist/chunk-NYQ3IS7K.cjs.map +1 -0
  28. package/dist/{chunk-7RHC7HMS.js → chunk-OQRGVTQF.js} +3 -3
  29. package/dist/{chunk-7RHC7HMS.js.map → chunk-OQRGVTQF.js.map} +1 -1
  30. package/dist/{chunk-SVWMQCXF.js → chunk-OYD3U3LY.js} +19 -12
  31. package/dist/chunk-OYD3U3LY.js.map +1 -0
  32. package/dist/{chunk-UGRS7ZA7.cjs → chunk-QATRS7JD.cjs} +6 -2
  33. package/dist/chunk-QATRS7JD.cjs.map +1 -0
  34. package/dist/{chunk-DRL7URI4.cjs → chunk-QDM3OHUT.cjs} +7 -2
  35. package/dist/chunk-QDM3OHUT.cjs.map +1 -0
  36. package/dist/{chunk-5AXMNUCY.cjs → chunk-QYLZQ43D.cjs} +5 -5
  37. package/dist/{chunk-5AXMNUCY.cjs.map → chunk-QYLZQ43D.cjs.map} +1 -1
  38. package/dist/{chunk-GUKPXDGJ.js → chunk-WMWEI3NS.js} +3 -3
  39. package/dist/chunk-WMWEI3NS.js.map +1 -0
  40. package/dist/{chunk-YEL3SP6X.js → chunk-XU6MLSC6.js} +3 -3
  41. package/dist/{chunk-YEL3SP6X.js.map → chunk-XU6MLSC6.js.map} +1 -1
  42. package/dist/{context-XQJIGZMR.cjs → context-4QOEWRDF.cjs} +7 -7
  43. package/dist/{context-XQJIGZMR.cjs.map → context-4QOEWRDF.cjs.map} +1 -1
  44. package/dist/context-Z3CFTT3H.js +6 -0
  45. package/dist/{context-FM6UZPTL.js.map → context-Z3CFTT3H.js.map} +1 -1
  46. package/dist/cron.cjs +8 -8
  47. package/dist/cron.js +7 -7
  48. package/dist/eval.cjs +22 -7
  49. package/dist/eval.cjs.map +1 -1
  50. package/dist/eval.js +21 -6
  51. package/dist/eval.js.map +1 -1
  52. package/dist/index.cjs +26 -26
  53. package/dist/index.js +11 -11
  54. package/dist/internal/concurrency/subagent-credentials.d.ts +45 -0
  55. package/dist/internal/persistence/index.cjs +4 -4
  56. package/dist/internal/persistence/index.js +1 -1
  57. package/dist/internal/runtime/registry/agent-registry-store.d.ts +1 -0
  58. package/dist/internal/runtime/skills/discover-skills.d.ts +35 -0
  59. package/dist/judge-call-46M2E5FA.cjs +22 -0
  60. package/dist/{judge-call-I3P4D5QR.cjs.map → judge-call-46M2E5FA.cjs.map} +1 -1
  61. package/dist/judge-call-FGUNNWEI.js +5 -0
  62. package/dist/{judge-call-6MVARKU2.js.map → judge-call-FGUNNWEI.js.map} +1 -1
  63. package/dist/persistence.cjs +8 -0
  64. package/dist/persistence.d.cts +1 -1
  65. package/dist/persistence.d.ts +1 -1
  66. package/dist/persistence.js +1 -1
  67. package/dist/skills.cjs +7 -3
  68. package/dist/skills.d.cts +1 -1
  69. package/dist/skills.d.ts +1 -1
  70. package/dist/skills.js +1 -1
  71. package/dist/subagents-loader-DOBTTICM.js +7 -0
  72. package/dist/{subagents-loader-7ES7PJNM.js.map → subagents-loader-DOBTTICM.js.map} +1 -1
  73. package/dist/subagents-loader-GEHYCMEX.cjs +16 -0
  74. package/dist/{subagents-loader-OMOH6ERO.cjs.map → subagents-loader-GEHYCMEX.cjs.map} +1 -1
  75. package/dist/subagents-loader.cjs +3 -3
  76. package/dist/subagents-loader.cjs.map +1 -1
  77. package/dist/subagents-loader.d.cts +34 -1
  78. package/dist/subagents-loader.d.ts +34 -1
  79. package/dist/subagents-loader.js +3 -3
  80. package/dist/subagents-loader.js.map +1 -1
  81. package/docs/error-codes.md +2 -2
  82. package/docs/harness-capability-map.md +5 -1
  83. package/package.json +1 -1
  84. package/dist/chunk-6WAKKTBO.js.map +0 -1
  85. package/dist/chunk-CQLVA4CO.cjs.map +0 -1
  86. package/dist/chunk-DLRP7BI6.cjs.map +0 -1
  87. package/dist/chunk-DRL7URI4.cjs.map +0 -1
  88. package/dist/chunk-GUKPXDGJ.js.map +0 -1
  89. package/dist/chunk-QME6FDFG.cjs.map +0 -1
  90. package/dist/chunk-SVWMQCXF.js.map +0 -1
  91. package/dist/chunk-UFPUHJWS.js.map +0 -1
  92. package/dist/chunk-UGRS7ZA7.cjs.map +0 -1
  93. package/dist/chunk-XDANGA2C.js.map +0 -1
  94. package/dist/context-FM6UZPTL.js +0 -6
  95. package/dist/judge-call-6MVARKU2.js +0 -5
  96. package/dist/judge-call-I3P4D5QR.cjs +0 -22
  97. package/dist/subagents-loader-7ES7PJNM.js +0 -7
  98. package/dist/subagents-loader-OMOH6ERO.cjs +0 -16
@@ -3,7 +3,7 @@
3
3
  var chunkKVSAY6NZ_cjs = require('./chunk-KVSAY6NZ.cjs');
4
4
  var chunkY2KYR2ED_cjs = require('./chunk-Y2KYR2ED.cjs');
5
5
  var chunkZ2JFX372_cjs = require('./chunk-Z2JFX372.cjs');
6
- var chunkLTLPBGHC_cjs = require('./chunk-LTLPBGHC.cjs');
6
+ var chunkKGANQYP7_cjs = require('./chunk-KGANQYP7.cjs');
7
7
  var chunkBV2MWEMV_cjs = require('./chunk-BV2MWEMV.cjs');
8
8
  var chunkD6POWE7E_cjs = require('./chunk-D6POWE7E.cjs');
9
9
  var chunkTMKTSYDS_cjs = require('./chunk-TMKTSYDS.cjs');
@@ -15,9 +15,9 @@ var chunkIU5N5224_cjs = require('./chunk-IU5N5224.cjs');
15
15
  var chunkRQMCOFAI_cjs = require('./chunk-RQMCOFAI.cjs');
16
16
  var chunkAA27GEYS_cjs = require('./chunk-AA27GEYS.cjs');
17
17
  var chunkYSTXFWQE_cjs = require('./chunk-YSTXFWQE.cjs');
18
- var chunkQME6FDFG_cjs = require('./chunk-QME6FDFG.cjs');
18
+ var chunkNQTD6QOW_cjs = require('./chunk-NQTD6QOW.cjs');
19
19
  var chunkNINIJCHU_cjs = require('./chunk-NINIJCHU.cjs');
20
- var chunkUGRS7ZA7_cjs = require('./chunk-UGRS7ZA7.cjs');
20
+ var chunkQATRS7JD_cjs = require('./chunk-QATRS7JD.cjs');
21
21
  var chunkIJ7M6GOG_cjs = require('./chunk-IJ7M6GOG.cjs');
22
22
  var chunk7A6535RA_cjs = require('./chunk-7A6535RA.cjs');
23
23
  var chunkSA6K24NB_cjs = require('./chunk-SA6K24NB.cjs');
@@ -26,8 +26,8 @@ var chunkGZV6AVRL_cjs = require('./chunk-GZV6AVRL.cjs');
26
26
  var chunkBJUJT5ED_cjs = require('./chunk-BJUJT5ED.cjs');
27
27
  var chunkZF2LDKQQ_cjs = require('./chunk-ZF2LDKQQ.cjs');
28
28
  var chunkJLRLCBJ4_cjs = require('./chunk-JLRLCBJ4.cjs');
29
- var chunk5AXMNUCY_cjs = require('./chunk-5AXMNUCY.cjs');
30
- var chunkDLRP7BI6_cjs = require('./chunk-DLRP7BI6.cjs');
29
+ var chunkQYLZQ43D_cjs = require('./chunk-QYLZQ43D.cjs');
30
+ var chunkNYQ3IS7K_cjs = require('./chunk-NYQ3IS7K.cjs');
31
31
  var chunkHW7SEELD_cjs = require('./chunk-HW7SEELD.cjs');
32
32
  var chunkATT276RD_cjs = require('./chunk-ATT276RD.cjs');
33
33
  var chunk3EE6LVWT_cjs = require('./chunk-3EE6LVWT.cjs');
@@ -311,6 +311,7 @@ function serializeLocal(local) {
311
311
  const out = {};
312
312
  if (typeof local.cwd === "string") out.cwd = local.cwd;
313
313
  if (Array.isArray(local.settingSources)) out.settingSources = [...local.settingSources];
314
+ if (Array.isArray(local.compatSources)) out.compatSources = [...local.compatSources];
314
315
  if (local.sandboxOptions !== void 0) {
315
316
  out.sandboxOptions = { enabled: local.sandboxOptions.enabled === true };
316
317
  }
@@ -382,7 +383,7 @@ function serializeAgents(agents2) {
382
383
  return out;
383
384
  }
384
385
  function registryPath(cwd) {
385
- return path.join(chunkDLRP7BI6_cjs.theokitConfigRoot(cwd), REGISTRY_RELATIVE_SUFFIX);
386
+ return path.join(chunkNYQ3IS7K_cjs.theokitConfigRoot(cwd), REGISTRY_RELATIVE_SUFFIX);
386
387
  }
387
388
  async function loadRegistry(cwd) {
388
389
  void chunkJLRLCBJ4_cjs.sweepStaleAtomicTemps(registryPath(cwd)).catch(() => void 0);
@@ -2121,14 +2122,14 @@ async function readState(filePath) {
2121
2122
  try {
2122
2123
  parsed = JSON.parse(raw);
2123
2124
  } catch {
2124
- chunkLTLPBGHC_cjs.warnOnce(
2125
+ chunkKGANQYP7_cjs.warnOnce(
2125
2126
  "personality-store-json-parse",
2126
2127
  "[theokit-sdk] personality.json is malformed; treating as empty"
2127
2128
  );
2128
2129
  return emptyState();
2129
2130
  }
2130
2131
  if (!isStateV1(parsed)) {
2131
- chunkLTLPBGHC_cjs.warnOnce(
2132
+ chunkKGANQYP7_cjs.warnOnce(
2132
2133
  "personality-store-bad-version",
2133
2134
  `[theokit-sdk] personality.json has unknown version; treating as empty (file kept untouched)`
2134
2135
  );
@@ -2159,7 +2160,7 @@ var PersonalityStore = class {
2159
2160
  try {
2160
2161
  await this.#persist(agentId, slug);
2161
2162
  } catch (err) {
2162
- chunkLTLPBGHC_cjs.warnOnce(
2163
+ chunkKGANQYP7_cjs.warnOnce(
2163
2164
  `personality-store-persist-failure-${agentId}`,
2164
2165
  `[theokit-sdk] personality persist failed for ${chunk6LHQPOMI_cjs.redactSecrets(agentId)}: ${chunk6LHQPOMI_cjs.redactSecrets(
2165
2166
  err.message
@@ -2176,7 +2177,7 @@ var PersonalityStore = class {
2176
2177
  try {
2177
2178
  state = await readState(filePath);
2178
2179
  } catch (err) {
2179
- chunkLTLPBGHC_cjs.warnOnce(
2180
+ chunkKGANQYP7_cjs.warnOnce(
2180
2181
  `personality-store-hydrate-failure-${agentId}`,
2181
2182
  `[theokit-sdk] personality hydrate failed for ${chunk6LHQPOMI_cjs.redactSecrets(agentId)}: ${chunk6LHQPOMI_cjs.redactSecrets(
2182
2183
  err.message
@@ -2205,7 +2206,7 @@ var PersonalityStore = class {
2205
2206
  });
2206
2207
  }
2207
2208
  #filePath() {
2208
- return path.join(chunkDLRP7BI6_cjs.getTheokitHome(this.#cwd), FILE_NAME);
2209
+ return path.join(chunkNYQ3IS7K_cjs.getTheokitHome(this.#cwd), FILE_NAME);
2209
2210
  }
2210
2211
  };
2211
2212
 
@@ -2522,7 +2523,7 @@ function removeAll(arr, toRemove) {
2522
2523
  }
2523
2524
  }
2524
2525
  function readCompatConfigFile(cwd) {
2525
- const path$1 = path.join(chunkDLRP7BI6_cjs.theokitConfigRoot(cwd), "config.json");
2526
+ const path$1 = path.join(chunkNYQ3IS7K_cjs.theokitConfigRoot(cwd), "config.json");
2526
2527
  if (!fs.existsSync(path$1)) return [];
2527
2528
  let raw;
2528
2529
  try {
@@ -2614,7 +2615,7 @@ var HooksExecutor = class {
2614
2615
  this.config = {};
2615
2616
  return;
2616
2617
  }
2617
- this.config = await chunkLTLPBGHC_cjs.loadHookConfig(this.cwd, this.compatSources);
2618
+ this.config = await chunkKGANQYP7_cjs.loadHookConfig(this.cwd, this.compatSources);
2618
2619
  }
2619
2620
  /** Fire every hook registered for `event` and aggregate the decisions. */
2620
2621
  async run(payload) {
@@ -2667,7 +2668,7 @@ var HooksExecutor = class {
2667
2668
  if (result.exitCode !== 0) {
2668
2669
  const stderr = result.stderr.trim();
2669
2670
  const base = stderr.length > 0 ? stderr : `Hook exited with code ${result.exitCode}`;
2670
- const missing = chunkDLRP7BI6_cjs.undefinedVariablesIn(command.command, env);
2671
+ const missing = chunkNYQ3IS7K_cjs.undefinedVariablesIn(command.command, env);
2671
2672
  if (missing.length === 0) return { decision: "deny", reason: base };
2672
2673
  return {
2673
2674
  decision: "deny",
@@ -2679,7 +2680,7 @@ var HooksExecutor = class {
2679
2680
  };
2680
2681
  function runtimeEnvFor(sourcePath, cwd) {
2681
2682
  if (sourcePath === void 0) return {};
2682
- return chunkDLRP7BI6_cjs.adapterForConfigPath(sourcePath)?.runtimeEnv(cwd) ?? {};
2683
+ return chunkNYQ3IS7K_cjs.adapterForConfigPath(sourcePath)?.runtimeEnv(cwd) ?? {};
2683
2684
  }
2684
2685
  function parseDecisionFromStdout(stdout) {
2685
2686
  const trimmed = stdout.trim();
@@ -2852,15 +2853,15 @@ var SkillsManager = class {
2852
2853
  }
2853
2854
  async refresh() {
2854
2855
  const roots = this.skillsDir === void 0 ? [
2855
- ...chunkDLRP7BI6_cjs.projectConfigRoots(this.cwd, this.compatSources, "skills").map(
2856
+ ...chunkNYQ3IS7K_cjs.projectConfigRoots(this.cwd, this.compatSources, "skills").map(
2856
2857
  (root) => path.join(root, "skills")
2857
2858
  ),
2858
- ...(await chunk5AXMNUCY_cjs.pluginBundleDirs(this.cwd, this.compatSources)).map((b) => path.join(b, "skills"))
2859
+ ...(await chunkQYLZQ43D_cjs.pluginBundleDirs(this.cwd, this.compatSources)).map((b) => path.join(b, "skills"))
2859
2860
  ] : [this.skillsDir];
2860
2861
  const discovered = [];
2861
2862
  const seen = /* @__PURE__ */ new Set();
2862
2863
  for (const root of roots) {
2863
- for (const skill of await chunkUGRS7ZA7_cjs.discoverSkills(root, {
2864
+ for (const skill of await chunkQATRS7JD_cjs.discoverSkills(root, {
2864
2865
  onInvalidSkill: (info) => {
2865
2866
  chunk6LHQPOMI_cjs.diag(`[theokit-sdk] skill ${info.name} skipped (${info.code}): ${info.message}
2866
2867
  `);
@@ -2891,7 +2892,7 @@ var SkillsManager = class {
2891
2892
  async get(name) {
2892
2893
  const skill = this.skills.find((s) => s.name === name);
2893
2894
  if (skill === void 0) return void 0;
2894
- const instructions = typeof skill.instructions === "string" ? skill.instructions : chunkUGRS7ZA7_cjs.stripSkillFrontmatter(await promises.readFile(skill.source, "utf8"));
2895
+ const instructions = typeof skill.instructions === "string" ? skill.instructions : chunkQATRS7JD_cjs.stripSkillFrontmatter(await promises.readFile(skill.source, "utf8"));
2895
2896
  const references = skill.references;
2896
2897
  return {
2897
2898
  name: skill.name,
@@ -3070,7 +3071,7 @@ var ActiveMemoryPromptProvider = class {
3070
3071
  if (ctx.activeMemorySummary === void 0 || ctx.activeMemorySummary.length === 0) {
3071
3072
  return Promise.resolve(void 0);
3072
3073
  }
3073
- const body = chunkUGRS7ZA7_cjs.escapeBlockBody(ctx.activeMemorySummary);
3074
+ const body = chunkQATRS7JD_cjs.escapeBlockBody(ctx.activeMemorySummary);
3074
3075
  return Promise.resolve(`<active-memory>
3075
3076
  ${body}
3076
3077
  </active-memory>`);
@@ -3123,7 +3124,7 @@ function formatSource(name, tokens) {
3123
3124
  if (tokens.length === 0) {
3124
3125
  return ` <source name="${escapeAttribute(name)}" />`;
3125
3126
  }
3126
- const body = chunkUGRS7ZA7_cjs.escapeBlockBody(tokens.join(" "));
3127
+ const body = chunkQATRS7JD_cjs.escapeBlockBody(tokens.join(" "));
3127
3128
  return ` <source name="${escapeAttribute(name)}">
3128
3129
  ${body}
3129
3130
  </source>`;
@@ -3147,7 +3148,7 @@ var MemoryPromptProvider = class {
3147
3148
  if (ctx.memory.length === 0) return Promise.resolve(void 0);
3148
3149
  const lines = ctx.memory.map((fact) => {
3149
3150
  const tag = fact.observations === 1 ? "[unconfirmed] " : "";
3150
- return ` - ${tag}${chunkUGRS7ZA7_cjs.escapeBlockBody(fact.text)}`;
3151
+ return ` - ${tag}${chunkQATRS7JD_cjs.escapeBlockBody(fact.text)}`;
3151
3152
  });
3152
3153
  return Promise.resolve(`${MEMORY_GUIDANCE}
3153
3154
  <memory>
@@ -3171,7 +3172,7 @@ var SkillsPromptProvider = class {
3171
3172
  priority = 20;
3172
3173
  contribute(ctx) {
3173
3174
  if (ctx.skillsAutoInject === false) return Promise.resolve(void 0);
3174
- return Promise.resolve(chunkUGRS7ZA7_cjs.buildSkillsBlock(ctx.skills));
3175
+ return Promise.resolve(chunkQATRS7JD_cjs.buildSkillsBlock(ctx.skills));
3175
3176
  }
3176
3177
  };
3177
3178
 
@@ -3439,7 +3440,7 @@ var HISTOGRAM_NAMES = {
3439
3440
  };
3440
3441
  function safeRequire(moduleName) {
3441
3442
  try {
3442
- const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-CQLVA4CO.cjs', document.baseURI).href)));
3443
+ const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-D3CCY3A2.cjs', document.baseURI).href)));
3443
3444
  return r(moduleName);
3444
3445
  } catch {
3445
3446
  return void 0;
@@ -3682,7 +3683,7 @@ var cachedOtel;
3682
3683
  function loadOtel() {
3683
3684
  if (cachedOtel === void 0) {
3684
3685
  try {
3685
- const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-CQLVA4CO.cjs', document.baseURI).href)));
3686
+ const r = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-D3CCY3A2.cjs', document.baseURI).href)));
3686
3687
  const mod = r("@opentelemetry/api");
3687
3688
  cachedOtel = mod;
3688
3689
  } catch {
@@ -4136,8 +4137,8 @@ var FileContextManager = class {
4136
4137
  }
4137
4138
  };
4138
4139
  async function loadContextConfig(cwd) {
4139
- const mdDir = path.join(chunkDLRP7BI6_cjs.theokitConfigRoot(cwd), "context");
4140
- const jsonPath = path.join(chunkDLRP7BI6_cjs.theokitConfigRoot(cwd), "context.json");
4140
+ const mdDir = path.join(chunkNYQ3IS7K_cjs.theokitConfigRoot(cwd), "context");
4141
+ const jsonPath = path.join(chunkNYQ3IS7K_cjs.theokitConfigRoot(cwd), "context.json");
4141
4142
  const mdEntities = await loadMarkdownEntities({
4142
4143
  dir: mdDir,
4143
4144
  schema: ContextSourceFrontmatterSchema,
@@ -4146,7 +4147,7 @@ async function loadContextConfig(cwd) {
4146
4147
  });
4147
4148
  if (mdEntities.length > 0) {
4148
4149
  if (fs.existsSync(jsonPath)) {
4149
- chunkLTLPBGHC_cjs.warnOnce(
4150
+ chunkKGANQYP7_cjs.warnOnce(
4150
4151
  "context-both-present",
4151
4152
  "[theokit-sdk] both .theokit/context/ and .theokit/context.json detected \u2014 using markdown; remove context.json"
4152
4153
  );
@@ -4156,7 +4157,7 @@ async function loadContextConfig(cwd) {
4156
4157
  };
4157
4158
  }
4158
4159
  if (!fs.existsSync(jsonPath)) return { sources: [] };
4159
- chunkLTLPBGHC_cjs.warnOnce(
4160
+ chunkKGANQYP7_cjs.warnOnce(
4160
4161
  "context-json-deprecated",
4161
4162
  // Names no command: `theokit-migrate-config` was unpublished with the `bin` entry, and a warning
4162
4163
  // that tells you to run something the package does not ship is worse than one that tells you
@@ -4297,7 +4298,7 @@ var PluginsManager = class {
4297
4298
  }
4298
4299
  async refresh() {
4299
4300
  this.plugins = [];
4300
- for (const pluginsRoot of chunkDLRP7BI6_cjs.pluginBundleRoots(this.cwd, this.compatSources)) {
4301
+ for (const pluginsRoot of chunkNYQ3IS7K_cjs.pluginBundleRoots(this.cwd, this.compatSources)) {
4301
4302
  await this.refreshRoot(pluginsRoot);
4302
4303
  }
4303
4304
  }
@@ -4319,13 +4320,13 @@ var PluginsManager = class {
4319
4320
  const jsonPath = path.join(pluginsRoot, folderName, "plugin.json");
4320
4321
  const metadata = fs.existsSync(mdPath) ? await loadPluginManifestFromMarkdown(this.cwd, pluginsRoot, folderName) : await loadPluginManifestFromJson(this.cwd, jsonPath, folderName);
4321
4322
  if (fs.existsSync(mdPath) && fs.existsSync(jsonPath)) {
4322
- chunkLTLPBGHC_cjs.warnOnce(
4323
+ chunkKGANQYP7_cjs.warnOnce(
4323
4324
  `plugin-${folderName}-both`,
4324
4325
  `[theokit-sdk] both ${folderName}/PLUGIN.md and ${folderName}/plugin.json detected \u2014 using markdown; remove plugin.json`
4325
4326
  );
4326
4327
  }
4327
4328
  if (!fs.existsSync(mdPath) && fs.existsSync(jsonPath)) {
4328
- chunkLTLPBGHC_cjs.warnOnce(
4329
+ chunkKGANQYP7_cjs.warnOnce(
4329
4330
  "plugin-json-deprecated",
4330
4331
  // Same reason as the context.json warning: the CLI it used to name is no longer published.
4331
4332
  "[theokit-sdk] plugin.json manifests are deprecated; replace each with a PLUGIN.md"
@@ -5565,7 +5566,7 @@ function stripThinkBlocks(content) {
5565
5566
  function resolveSystemPromptWithMemoryAdditions(systemPrompt, additions) {
5566
5567
  if (additions === void 0 || additions.length === 0) return systemPrompt;
5567
5568
  const block = `<active-memory>
5568
- ${chunkUGRS7ZA7_cjs.escapeBlockBody(additions)}
5569
+ ${chunkQATRS7JD_cjs.escapeBlockBody(additions)}
5569
5570
  </active-memory>`;
5570
5571
  if (systemPrompt === void 0 || systemPrompt.length === 0) return block;
5571
5572
  return `${block}
@@ -7209,7 +7210,7 @@ function applyPersonalityFilter(exposedTools, whitelist, opts) {
7209
7210
  if (exposedSet.has(name)) continue;
7210
7211
  const hint = suggestClosest(name, exposedSet);
7211
7212
  const message = hint !== void 0 ? `[theokit-sdk] personality "${opts?.personalityName ?? "?"}" references unknown tool "${name}"; did you mean "${hint}"?` : `[theokit-sdk] personality "${opts?.personalityName ?? "?"}" references unknown tool "${name}" (not exposed)`;
7212
- chunkLTLPBGHC_cjs.warnOnce(
7213
+ chunkKGANQYP7_cjs.warnOnce(
7213
7214
  `personality-tool-missing|${opts?.agentId ?? "?"}|${opts?.personalityName ?? "?"}|${name}`,
7214
7215
  message
7215
7216
  );
@@ -7251,16 +7252,22 @@ function levenshtein(a, b) {
7251
7252
  // src/internal/local-agent/real-local-run-tools.ts
7252
7253
  function declarativeSubagentTools(agents2, parentTools) {
7253
7254
  if (agents2 === void 0 || Object.keys(agents2).length === 0) return [];
7254
- return chunkQME6FDFG_cjs.subAgentToolsFromDefinitions(agents2, parentTools);
7255
+ return chunkNQTD6QOW_cjs.subAgentToolsFromDefinitions(agents2, parentTools);
7255
7256
  }
7256
7257
  function resolveInheritedCredentials(agentOptions) {
7257
7258
  const parentPlugins = Array.isArray(agentOptions.plugins) ? agentOptions.plugins : void 0;
7258
7259
  const parentSandbox = agentOptions.local?.sandboxOptions?.enabled;
7260
+ const parentSettingSources = agentOptions.local?.settingSources;
7261
+ const parentCompatSources = agentOptions.local?.compatSources;
7262
+ const parentWithheld = agentOptions.withheldBuiltinTools;
7259
7263
  return {
7260
7264
  ...agentOptions.apiKey !== void 0 ? { apiKey: agentOptions.apiKey } : {},
7261
7265
  ...typeof agentOptions.model === "object" ? { model: agentOptions.model } : {},
7262
7266
  ...parentPlugins !== void 0 ? { plugins: parentPlugins } : {},
7263
- ...parentSandbox !== void 0 ? { sandbox: parentSandbox } : {}
7267
+ ...parentSandbox !== void 0 ? { sandbox: parentSandbox } : {},
7268
+ ...parentSettingSources !== void 0 ? { settingSources: parentSettingSources } : {},
7269
+ ...parentCompatSources !== void 0 ? { compatSources: parentCompatSources } : {},
7270
+ ...parentWithheld !== void 0 ? { withheldBuiltinTools: parentWithheld } : {}
7264
7271
  };
7265
7272
  }
7266
7273
  function withheldBuiltinsInput(agentOptions) {
@@ -7517,7 +7524,7 @@ var RealLocalRun = class extends FixtureRunBase {
7517
7524
  };
7518
7525
  try {
7519
7526
  const runLoop = () => inputs.activeTools !== void 0 ? chunkIJ7M6GOG_cjs.withToolWhitelist(new Set(inputs.activeTools), () => runAgentLoop(inputs)) : runAgentLoop(inputs);
7520
- const output = await chunkQME6FDFG_cjs.withInheritedSubAgentCredentials(this.inheritedCredentials, runLoop);
7527
+ const output = await chunkNQTD6QOW_cjs.withInheritedSubAgentCredentials(this.inheritedCredentials, runLoop);
7521
7528
  this.applyAgentLoopOutput(output);
7522
7529
  this.transitionTo(output.finalStatus);
7523
7530
  } catch (cause) {
@@ -7652,7 +7659,7 @@ async function dispatchLocalRun(args) {
7652
7659
  });
7653
7660
  }
7654
7661
  async function readProjectMcpServers(cwd) {
7655
- const path$1 = path.join(chunkDLRP7BI6_cjs.theokitConfigRoot(cwd), "mcp.json");
7662
+ const path$1 = path.join(chunkNYQ3IS7K_cjs.theokitConfigRoot(cwd), "mcp.json");
7656
7663
  try {
7657
7664
  const raw = await promises.readFile(path$1, "utf8");
7658
7665
  const parsed = JSON.parse(raw);
@@ -7894,7 +7901,7 @@ async function reloadLocalAgent(agent) {
7894
7901
  if (agent.context !== void 0) await agent.context.refresh();
7895
7902
  if (agent.skillsManager !== void 0) await agent.skillsManager.refresh();
7896
7903
  if (agent.pluginsManager !== void 0) await agent.pluginsManager.refresh();
7897
- return await chunk5AXMNUCY_cjs.loadSubagents(
7904
+ return await chunkQYLZQ43D_cjs.loadSubagents(
7898
7905
  agent.workspaceCwd,
7899
7906
  agent.settingSourcesIncludeProject,
7900
7907
  agent.options.agents
@@ -8928,7 +8935,7 @@ var PersonalityRegistry = class _PersonalityRegistry {
8928
8935
  * @internal
8929
8936
  */
8930
8937
  static async load(cwd) {
8931
- const projectDir = path.join(chunkDLRP7BI6_cjs.theokitConfigRoot(cwd), PERSONALITIES_SUFFIX);
8938
+ const projectDir = path.join(chunkNYQ3IS7K_cjs.theokitConfigRoot(cwd), PERSONALITIES_SUFFIX);
8932
8939
  const userDir = path.join(os.homedir(), USER_SUBDIR);
8933
8940
  const [userEntities, projectEntities] = await Promise.all([
8934
8941
  loadMarkdownEntities({
@@ -8980,7 +8987,7 @@ function addEntity(byName, entity, origin, collisionMap) {
8980
8987
  );
8981
8988
  }
8982
8989
  if (origin === "project" && collisionMap?.has(fm.name)) {
8983
- chunkLTLPBGHC_cjs.warnOnce(
8990
+ chunkKGANQYP7_cjs.warnOnce(
8984
8991
  `personality-collision-${fm.name}`,
8985
8992
  `[theokit-sdk] personality "${fm.name}" overridden by project preset`
8986
8993
  );
@@ -9030,14 +9037,14 @@ async function performPersonalitySwitch(args) {
9030
9037
 
9031
9038
  // src/internal/local-agent/local-agent-personality-extensions.ts
9032
9039
  function resolveActivePersonalityPreset(args) {
9033
- const forkCtx = chunkLTLPBGHC_cjs.currentPersonalityContext();
9040
+ const forkCtx = chunkKGANQYP7_cjs.currentPersonalityContext();
9034
9041
  const slug = forkCtx !== void 0 ? forkCtx.slug : args.personalityStore.active(args.agentId);
9035
9042
  if (slug === void 0) return void 0;
9036
9043
  return args.personalityRegistry?.get(slug);
9037
9044
  }
9038
9045
  async function ensurePersonalityRegistryIfNeeded(args) {
9039
9046
  if (args.personalityRegistry !== void 0) return args.personalityRegistry;
9040
- const forkSlug = chunkLTLPBGHC_cjs.currentPersonalityContext()?.slug;
9047
+ const forkSlug = chunkKGANQYP7_cjs.currentPersonalityContext()?.slug;
9041
9048
  const ownSlug = args.personalityStore.active(args.agentId);
9042
9049
  if (forkSlug === void 0 && ownSlug === void 0) return void 0;
9043
9050
  return await PersonalityRegistry.load(args.workspaceCwd);
@@ -9050,8 +9057,8 @@ function applyPersonalityOverlay(preset, base) {
9050
9057
  ${preset.systemPrompt}`;
9051
9058
  }
9052
9059
  async function localAgentUsePersonality(agent, name, opts) {
9053
- if (chunkLTLPBGHC_cjs.currentPersonalityContext() !== void 0) {
9054
- chunkLTLPBGHC_cjs.warnPersonalitySwitchInsideFork(agent.agentId);
9060
+ if (chunkKGANQYP7_cjs.currentPersonalityContext() !== void 0) {
9061
+ chunkKGANQYP7_cjs.warnPersonalitySwitchInsideFork(agent.agentId);
9055
9062
  return null;
9056
9063
  }
9057
9064
  if (agent.personalityRegistry === void 0) {
@@ -9079,7 +9086,7 @@ function localAgentRunUntil(agent, goal, options) {
9079
9086
  async function* wrap() {
9080
9087
  const { runUntilImpl } = await import('./run-until-DG2KXWB2.cjs');
9081
9088
  const buildDeps = async () => {
9082
- const { judgeCallImpl } = await import('./judge-call-I3P4D5QR.cjs');
9089
+ const { judgeCallImpl } = await import('./judge-call-46M2E5FA.cjs');
9083
9090
  const { getAgentFacade } = await import('./agent-factory-registry-UU46BUMU.cjs');
9084
9091
  const create = getAgentFacade().create;
9085
9092
  return {
@@ -9112,7 +9119,7 @@ async function* localAgentStreamToCompletion(agent, message, options) {
9112
9119
  async function localAgentFork(parent, options) {
9113
9120
  const { forkAgentImpl } = await import('./fork-agent-WAEQI2DL.cjs');
9114
9121
  const { getAgentFacade } = await import('./agent-factory-registry-UU46BUMU.cjs');
9115
- const { withPersonalityContext } = await import('./context-XQJIGZMR.cjs');
9122
+ const { withPersonalityContext } = await import('./context-4QOEWRDF.cjs');
9116
9123
  const create = getAgentFacade().create;
9117
9124
  return withPersonalityContext(
9118
9125
  { slug: parent.personalitySlugSnapshot, isFork: true },
@@ -9686,7 +9693,7 @@ async function executeSendLocked(inputs, message, options) {
9686
9693
  function buildCompletionCheckDeps() {
9687
9694
  return {
9688
9695
  judge: async (ctx, opts) => {
9689
- const { judgeCallImpl } = await import('./judge-call-I3P4D5QR.cjs');
9696
+ const { judgeCallImpl } = await import('./judge-call-46M2E5FA.cjs');
9690
9697
  const { getAgentFacade } = await import('./agent-factory-registry-UU46BUMU.cjs');
9691
9698
  return judgeCallImpl(ctx, opts, { create: getAgentFacade().create });
9692
9699
  }
@@ -9904,7 +9911,7 @@ var LocalAgent = class {
9904
9911
  if (sub.plugins !== void 0) this.plugins = sub.plugins;
9905
9912
  reportUnknownLocalOptions(options.local);
9906
9913
  const compatSources = resolveCompatSources(options, this.workspaceCwd);
9907
- chunkDLRP7BI6_cjs.reportUndeclaredSources(this.workspaceCwd, compatSources);
9914
+ chunkNYQ3IS7K_cjs.reportUndeclaredSources(this.workspaceCwd, compatSources);
9908
9915
  this.hooksExecutor = new HooksExecutor(this.workspaceCwd, compatSources);
9909
9916
  this.defaultMemoryProviderForLoop = createLocalAgentMemoryProvider({
9910
9917
  agentOptions: options,
@@ -9932,7 +9939,7 @@ var LocalAgent = class {
9932
9939
  if (this.pluginsManager !== void 0) await this.pluginsManager.initialize();
9933
9940
  const codePlugins = chunkBV2MWEMV_cjs.extractCodePlugins(this.options.plugins);
9934
9941
  await this.pluginManagerCode.initialize(codePlugins);
9935
- this.resolvedSubagents = await chunk5AXMNUCY_cjs.loadSubagents(
9942
+ this.resolvedSubagents = await chunkQYLZQ43D_cjs.loadSubagents(
9936
9943
  this.workspaceCwd,
9937
9944
  this.settingSourcesIncludeProject,
9938
9945
  this.options.agents,
@@ -10885,7 +10892,7 @@ var Agent = class _Agent {
10885
10892
  */
10886
10893
  static async describe(agentId) {
10887
10894
  const agent = await getRegisteredAgentOrThrow(agentId);
10888
- const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-OMOH6ERO.cjs');
10895
+ const { loadSubagents: loadSubagents2 } = await import('./subagents-loader-GEHYCMEX.cjs');
10889
10896
  const settingSources = agent.options.local?.settingSources;
10890
10897
  const subagents = await loadSubagents2(
10891
10898
  agent.cwd ?? process.cwd(),
@@ -10984,5 +10991,5 @@ exports.generateCronId = generateCronId;
10984
10991
  exports.getPricingEntry = getPricingEntry;
10985
10992
  exports.openRouterMemoryEmbeddingProviderAdapter = openRouterMemoryEmbeddingProviderAdapter;
10986
10993
  exports.resolveSessionDir = resolveSessionDir;
10987
- //# sourceMappingURL=chunk-CQLVA4CO.cjs.map
10988
- //# sourceMappingURL=chunk-CQLVA4CO.cjs.map
10994
+ //# sourceMappingURL=chunk-D3CCY3A2.cjs.map
10995
+ //# sourceMappingURL=chunk-D3CCY3A2.cjs.map