@theokit/sdk 5.12.1 → 5.14.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 (193) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/dist/{agent-Cn0sphpA.d.cts → agent-DExqjqYy.d.cts} +18 -3
  3. package/dist/{agent-CVzDy_Oj.d.ts → agent-Dfw3VsIX.d.ts} +18 -3
  4. package/dist/{agent-IG7BP6GN.js → agent-T34LCGQM.js} +11 -11
  5. package/dist/{agent-IG7BP6GN.js.map → agent-T34LCGQM.js.map} +1 -1
  6. package/dist/{agent-BVKIUP7F.cjs → agent-TL4K7BTG.cjs} +12 -12
  7. package/dist/{agent-BVKIUP7F.cjs.map → agent-TL4K7BTG.cjs.map} +1 -1
  8. package/dist/auth/index.cjs +17 -16
  9. package/dist/auth/index.cjs.map +1 -1
  10. package/dist/auth/index.js +5 -4
  11. package/dist/auth/index.js.map +1 -1
  12. package/dist/{chunk-NHOEXFZT.js → chunk-2HXTNVLM.js} +5 -2
  13. package/dist/chunk-2HXTNVLM.js.map +1 -0
  14. package/dist/{chunk-Q6WT5535.cjs → chunk-2WY2OFSC.cjs} +259 -79
  15. package/dist/chunk-2WY2OFSC.cjs.map +1 -0
  16. package/dist/{chunk-HN4IKB6X.cjs → chunk-2XWAYCFM.cjs} +15 -13
  17. package/dist/chunk-2XWAYCFM.cjs.map +1 -0
  18. package/dist/{chunk-3FSBE4PS.js → chunk-3GTN4HOO.js} +10 -6
  19. package/dist/chunk-3GTN4HOO.js.map +1 -0
  20. package/dist/{chunk-VVGFZQZC.js → chunk-3LMVJTNJ.js} +9 -5
  21. package/dist/chunk-3LMVJTNJ.js.map +1 -0
  22. package/dist/{chunk-4GUFNDZR.js → chunk-3ONIVO2I.js} +3 -3
  23. package/dist/{chunk-4GUFNDZR.js.map → chunk-3ONIVO2I.js.map} +1 -1
  24. package/dist/{chunk-7WARNHWW.cjs → chunk-3UMPP553.cjs} +5 -2
  25. package/dist/chunk-3UMPP553.cjs.map +1 -0
  26. package/dist/{chunk-NWWTYBD3.cjs → chunk-4KBI37F3.cjs} +5 -5
  27. package/dist/{chunk-NWWTYBD3.cjs.map → chunk-4KBI37F3.cjs.map} +1 -1
  28. package/dist/{chunk-S46WJTDL.cjs → chunk-4TEGFMSP.cjs} +6 -6
  29. package/dist/{chunk-S46WJTDL.cjs.map → chunk-4TEGFMSP.cjs.map} +1 -1
  30. package/dist/{chunk-QISSETTG.cjs → chunk-5645PMVU.cjs} +6 -4
  31. package/dist/chunk-5645PMVU.cjs.map +1 -0
  32. package/dist/{chunk-ZLFFDPXC.js → chunk-73IITAF7.js} +36 -14
  33. package/dist/chunk-73IITAF7.js.map +1 -0
  34. package/dist/{chunk-5A4UFBHW.cjs → chunk-A77UMVMD.cjs} +15 -11
  35. package/dist/chunk-A77UMVMD.cjs.map +1 -0
  36. package/dist/{chunk-IO4RI5ZJ.cjs → chunk-BZK5QL3N.cjs} +4 -4
  37. package/dist/{chunk-IO4RI5ZJ.cjs.map → chunk-BZK5QL3N.cjs.map} +1 -1
  38. package/dist/{chunk-5HSMH2ZZ.js → chunk-CJN5CEI3.js} +4 -4
  39. package/dist/{chunk-5HSMH2ZZ.js.map → chunk-CJN5CEI3.js.map} +1 -1
  40. package/dist/{chunk-XRPMZ7TO.js → chunk-CYWOJA6B.js} +6 -4
  41. package/dist/chunk-CYWOJA6B.js.map +1 -0
  42. package/dist/{chunk-AQW54OWQ.js → chunk-DFBWYETS.js} +5 -3
  43. package/dist/chunk-DFBWYETS.js.map +1 -0
  44. package/dist/{chunk-EPANMGH7.cjs → chunk-FLDHYF5C.cjs} +11 -2
  45. package/dist/chunk-FLDHYF5C.cjs.map +1 -0
  46. package/dist/{chunk-BJ7BPLQK.js → chunk-GARVAUCU.js} +209 -29
  47. package/dist/chunk-GARVAUCU.js.map +1 -0
  48. package/dist/{chunk-YOVZMN4P.cjs → chunk-LXG6VL6R.cjs} +3 -3
  49. package/dist/{chunk-YOVZMN4P.cjs.map → chunk-LXG6VL6R.cjs.map} +1 -1
  50. package/dist/{chunk-NJBJ3CUG.js → chunk-NAVUTK6X.js} +3 -3
  51. package/dist/{chunk-NJBJ3CUG.js.map → chunk-NAVUTK6X.js.map} +1 -1
  52. package/dist/{chunk-2SFLLOMN.js → chunk-NVQSBRG6.js} +3 -3
  53. package/dist/{chunk-2SFLLOMN.js.map → chunk-NVQSBRG6.js.map} +1 -1
  54. package/dist/{chunk-FEAWEBWN.cjs → chunk-PDOXYXWX.cjs} +6 -4
  55. package/dist/chunk-PDOXYXWX.cjs.map +1 -0
  56. package/dist/{chunk-MS3TQSXU.js → chunk-QD6B6W6I.js} +6 -4
  57. package/dist/chunk-QD6B6W6I.js.map +1 -0
  58. package/dist/{chunk-NBNRQN6T.js → chunk-QGDPMM3C.js} +11 -2
  59. package/dist/chunk-QGDPMM3C.js.map +1 -0
  60. package/dist/{chunk-ZWLFHSON.cjs → chunk-R35ZJAYT.cjs} +38 -15
  61. package/dist/chunk-R35ZJAYT.cjs.map +1 -0
  62. package/dist/{chunk-4YD2WI57.cjs → chunk-R427EOZE.cjs} +19 -15
  63. package/dist/chunk-R427EOZE.cjs.map +1 -0
  64. package/dist/chunk-R5UQL2R5.cjs +18 -0
  65. package/dist/{chunk-LO6LIUZ6.cjs.map → chunk-R5UQL2R5.cjs.map} +1 -1
  66. package/dist/{chunk-TLVI2OQK.cjs → chunk-SETHRLQS.cjs} +18 -2
  67. package/dist/chunk-SETHRLQS.cjs.map +1 -0
  68. package/dist/{chunk-LSWHDOCL.cjs → chunk-SNVYOX46.cjs} +88 -72
  69. package/dist/chunk-SNVYOX46.cjs.map +1 -0
  70. package/dist/{chunk-BO3PV3OP.js → chunk-TDED5XES.js} +18 -3
  71. package/dist/chunk-TDED5XES.js.map +1 -0
  72. package/dist/{chunk-NKQVLWDF.js → chunk-ULEK4OM4.js} +3 -3
  73. package/dist/{chunk-NKQVLWDF.js.map → chunk-ULEK4OM4.js.map} +1 -1
  74. package/dist/{chunk-XJ4C4NFX.js → chunk-ZOL3L4EH.js} +63 -49
  75. package/dist/chunk-ZOL3L4EH.js.map +1 -0
  76. package/dist/{compact-session-NM56BREJ.cjs → compact-session-D2MQDB6G.cjs} +15 -15
  77. package/dist/{compact-session-NM56BREJ.cjs.map → compact-session-D2MQDB6G.cjs.map} +1 -1
  78. package/dist/{compact-session-3U2JYTVG.js → compact-session-N2PPHQO6.js} +6 -6
  79. package/dist/{compact-session-3U2JYTVG.js.map → compact-session-N2PPHQO6.js.map} +1 -1
  80. package/dist/{cron-CHn-F0fC.d.ts → cron-BubDpFJG.d.ts} +2 -2
  81. package/dist/{cron-BWDYetbq.d.cts → cron-CK2v0VWA.d.cts} +2 -2
  82. package/dist/cron.cjs +11 -11
  83. package/dist/cron.d.cts +3 -3
  84. package/dist/cron.d.ts +3 -3
  85. package/dist/cron.js +10 -10
  86. package/dist/eval.cjs +15 -15
  87. package/dist/eval.js +10 -10
  88. package/dist/{executor-HKHT4CWS.cjs → executor-5QL5AXIZ.cjs} +18 -15
  89. package/dist/executor-5QL5AXIZ.cjs.map +1 -0
  90. package/dist/{executor-3D2UDJHW.js → executor-THUXNAFR.js} +6 -3
  91. package/dist/executor-THUXNAFR.js.map +1 -0
  92. package/dist/generate-object-A5F576IT.cjs +20 -0
  93. package/dist/{generate-object-XBWD2PU7.cjs.map → generate-object-A5F576IT.cjs.map} +1 -1
  94. package/dist/{generate-object-S7MNVF2V.js → generate-object-TBDOBBYW.js} +4 -4
  95. package/dist/{generate-object-S7MNVF2V.js.map → generate-object-TBDOBBYW.js.map} +1 -1
  96. package/dist/generate-object.d.ts +14 -1
  97. package/dist/index.cjs +81 -65
  98. package/dist/index.cjs.map +1 -1
  99. package/dist/index.d.cts +36 -7
  100. package/dist/index.d.ts +36 -7
  101. package/dist/index.js +44 -28
  102. package/dist/index.js.map +1 -1
  103. package/dist/{inject-session-JVTZNQF6.cjs → inject-session-3ICZIJ2N.cjs} +4 -4
  104. package/dist/{inject-session-JVTZNQF6.cjs.map → inject-session-3ICZIJ2N.cjs.map} +1 -1
  105. package/dist/{inject-session-THABTKJY.js → inject-session-J26SHHIO.js} +3 -3
  106. package/dist/{inject-session-THABTKJY.js.map → inject-session-J26SHHIO.js.map} +1 -1
  107. package/dist/internal/agent-loop/prune-tool-results.d.ts +37 -0
  108. package/dist/internal/auth/credential-store.d.ts +1 -1
  109. package/dist/internal/auth/types.d.ts +4 -0
  110. package/dist/internal/providers/discovery.d.ts +2 -2
  111. package/dist/internal/providers/trust-gate.d.ts +35 -0
  112. package/dist/internal/runtime/plugin-loader/manifest-entry-import.d.ts +17 -0
  113. package/dist/internal/runtime/plugin-loader/workspace-plugin-trust.d.ts +16 -0
  114. package/dist/internal/runtime/skills/binary-on-path.d.ts +1 -0
  115. package/dist/internal/runtime/skills/discover-skills.d.ts +2 -0
  116. package/dist/internal/structured-output-helpers.d.ts +5 -2
  117. package/dist/mcp-auth.cjs +2 -2
  118. package/dist/mcp-auth.js +1 -1
  119. package/dist/models.cjs +11 -11
  120. package/dist/models.js +4 -4
  121. package/dist/providers.cjs +6 -6
  122. package/dist/providers.js +4 -4
  123. package/dist/sandbox/bwrap.d.cts +10 -8
  124. package/dist/sandbox/bwrap.d.ts +10 -8
  125. package/dist/sandbox/deny-read.d.cts +24 -0
  126. package/dist/sandbox/deny-read.d.ts +24 -0
  127. package/dist/sandbox/index.cjs +114 -35
  128. package/dist/sandbox/index.cjs.map +1 -1
  129. package/dist/sandbox/index.d.cts +2 -1
  130. package/dist/sandbox/index.d.ts +2 -1
  131. package/dist/sandbox/index.js +96 -21
  132. package/dist/sandbox/index.js.map +1 -1
  133. package/dist/sandbox/linux-sandbox.d.cts +16 -1
  134. package/dist/sandbox/linux-sandbox.d.ts +16 -1
  135. package/dist/sandbox/local-sandbox.d.cts +3 -1
  136. package/dist/sandbox/local-sandbox.d.ts +3 -1
  137. package/dist/sandbox/seccomp-delivery.d.cts +3 -0
  138. package/dist/sandbox/seccomp-delivery.d.ts +3 -0
  139. package/dist/sandbox/shell-escape.d.cts +14 -2
  140. package/dist/sandbox/shell-escape.d.ts +14 -2
  141. package/dist/sandbox/types.d.cts +45 -0
  142. package/dist/sandbox/types.d.ts +45 -0
  143. package/dist/{sdk-agent-4-dXI2GS.d.cts → sdk-agent-DwzHcuxy.d.cts} +28 -3
  144. package/dist/{sdk-agent-CTOJlWA_.d.ts → sdk-agent-a3fW1xUK.d.ts} +28 -3
  145. package/dist/skills.cjs +4 -4
  146. package/dist/skills.js +1 -1
  147. package/dist/stream-object-AS4YYM4B.cjs +20 -0
  148. package/dist/{stream-object-TEEK3CAX.cjs.map → stream-object-AS4YYM4B.cjs.map} +1 -1
  149. package/dist/stream-object-EKM4WGTI.js +7 -0
  150. package/dist/{stream-object-R6SMYV4R.js.map → stream-object-EKM4WGTI.js.map} +1 -1
  151. package/dist/stream-object.d.ts +14 -1
  152. package/dist/subagents-loader.d.cts +2 -2
  153. package/dist/subagents-loader.d.ts +2 -2
  154. package/dist/types/agent.d.ts +14 -1
  155. package/dist/types/run.d.ts +27 -2
  156. package/dist/workflow-as-tool.d.ts +39 -5
  157. package/dist/workflow-errors.d.ts +16 -0
  158. package/dist/workflow.cjs +31 -23
  159. package/dist/workflow.d.cts +55 -5
  160. package/dist/workflow.d.ts +55 -5
  161. package/dist/workflow.js +2 -2
  162. package/docs/adr/mutation-testing-scope.md +56 -0
  163. package/docs/error-codes.md +23 -18
  164. package/docs/harness-capability-map.md +78 -4
  165. package/package.json +1 -1
  166. package/dist/chunk-3FSBE4PS.js.map +0 -1
  167. package/dist/chunk-4YD2WI57.cjs.map +0 -1
  168. package/dist/chunk-5A4UFBHW.cjs.map +0 -1
  169. package/dist/chunk-7WARNHWW.cjs.map +0 -1
  170. package/dist/chunk-AQW54OWQ.js.map +0 -1
  171. package/dist/chunk-BJ7BPLQK.js.map +0 -1
  172. package/dist/chunk-BO3PV3OP.js.map +0 -1
  173. package/dist/chunk-EPANMGH7.cjs.map +0 -1
  174. package/dist/chunk-FEAWEBWN.cjs.map +0 -1
  175. package/dist/chunk-HN4IKB6X.cjs.map +0 -1
  176. package/dist/chunk-LO6LIUZ6.cjs +0 -18
  177. package/dist/chunk-LSWHDOCL.cjs.map +0 -1
  178. package/dist/chunk-MS3TQSXU.js.map +0 -1
  179. package/dist/chunk-NBNRQN6T.js.map +0 -1
  180. package/dist/chunk-NHOEXFZT.js.map +0 -1
  181. package/dist/chunk-Q6WT5535.cjs.map +0 -1
  182. package/dist/chunk-QISSETTG.cjs.map +0 -1
  183. package/dist/chunk-TLVI2OQK.cjs.map +0 -1
  184. package/dist/chunk-VVGFZQZC.js.map +0 -1
  185. package/dist/chunk-XJ4C4NFX.js.map +0 -1
  186. package/dist/chunk-XRPMZ7TO.js.map +0 -1
  187. package/dist/chunk-ZLFFDPXC.js.map +0 -1
  188. package/dist/chunk-ZWLFHSON.cjs.map +0 -1
  189. package/dist/executor-3D2UDJHW.js.map +0 -1
  190. package/dist/executor-HKHT4CWS.cjs.map +0 -1
  191. package/dist/generate-object-XBWD2PU7.cjs +0 -20
  192. package/dist/stream-object-R6SMYV4R.js +0 -7
  193. package/dist/stream-object-TEEK3CAX.cjs +0 -20
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkYOVZMN4P_cjs = require('./chunk-YOVZMN4P.cjs');
3
+ var chunkLXG6VL6R_cjs = require('./chunk-LXG6VL6R.cjs');
4
4
  var chunkYJNYDJ2T_cjs = require('./chunk-YJNYDJ2T.cjs');
5
5
  require('./chunk-MSW7LB2V.cjs');
6
6
  var chunk3WKWBYPO_cjs = require('./chunk-3WKWBYPO.cjs');
@@ -10,7 +10,7 @@ require('./chunk-RNXXYF22.cjs');
10
10
 
11
11
  // src/internal/session/inject-session.ts
12
12
  async function injectSessionTurn(opts) {
13
- await chunkYOVZMN4P_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
13
+ await chunkLXG6VL6R_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
14
14
  const prior = await opts.store.readRecords(opts.loc.agentId);
15
15
  const transcript = chunk3WKWBYPO_cjs.SessionTranscript.fromRecords(prior, {
16
16
  cwd: opts.loc.cwd,
@@ -25,5 +25,5 @@ async function injectSessionTurn(opts) {
25
25
  }
26
26
 
27
27
  exports.injectSessionTurn = injectSessionTurn;
28
- //# sourceMappingURL=inject-session-JVTZNQF6.cjs.map
29
- //# sourceMappingURL=inject-session-JVTZNQF6.cjs.map
28
+ //# sourceMappingURL=inject-session-3ICZIJ2N.cjs.map
29
+ //# sourceMappingURL=inject-session-3ICZIJ2N.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-JVTZNQF6.cjs","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
1
+ {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-3ICZIJ2N.cjs","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { enqueueSessionWrite } from './chunk-4GUFNDZR.js';
1
+ import { enqueueSessionWrite } from './chunk-3ONIVO2I.js';
2
2
  import { invalidateSessionCache } from './chunk-2XC6KDJM.js';
3
3
  import './chunk-AGO5S5WD.js';
4
4
  import { SessionTranscript } from './chunk-XESYJ4JC.js';
@@ -23,5 +23,5 @@ async function injectSessionTurn(opts) {
23
23
  }
24
24
 
25
25
  export { injectSessionTurn };
26
- //# sourceMappingURL=inject-session-THABTKJY.js.map
27
- //# sourceMappingURL=inject-session-THABTKJY.js.map
26
+ //# sourceMappingURL=inject-session-J26SHHIO.js.map
27
+ //# sourceMappingURL=inject-session-J26SHHIO.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-THABTKJY.js","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
1
+ {"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-J26SHHIO.js","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * B-564 — opt-in pruning of aged tool results from the next LLM request.
3
+ *
4
+ * The loop resends every tool result of a run on every later call; with
5
+ * `SendOptions.pruneToolResults` set, results older than `olderThanRounds` tool rounds are
6
+ * replaced by a short stub in the REQUEST copy only. The transcript the loop keeps, persists and
7
+ * resumes from is never touched, so a pruned result can always be recovered (plan D1).
8
+ *
9
+ * Position among tool-result messages is the round distance: at call n the newest tool-result
10
+ * message is round n - 1. So no round counter is threaded through the loop. Text-only feedback
11
+ * messages the loop pushes between rounds carry no `tool_result` part and do not count.
12
+ *
13
+ * A pruned part keeps its `toolUseId` and `isError`: every `tool_use` must still have a paired
14
+ * `tool_result` on both wires, so the result is shortened, never removed.
15
+ */
16
+ import type { PruneToolResultsOptions } from "../../types/run.js";
17
+ import type { LlmMessage } from "../llm/types.js";
18
+ export type { PruneToolResultsOptions } from "../../types/run.js";
19
+ /**
20
+ * Build the messages for one LLM request with aged tool results replaced by a stub.
21
+ *
22
+ * Each new round stubs one more previously sent result, so on providers that cache message
23
+ * prefixes the cached prefix ends earlier; that cost was not measured.
24
+ *
25
+ * @param messages - The loop transcript. Never mutated.
26
+ * @param options - Absent means no pruning: the input array itself is returned, so the
27
+ * option-off request is byte-identical to the transcript.
28
+ * @returns A new array when `options` is set; untouched messages are the same objects.
29
+ */
30
+ export declare function pruneToolResultsForRequest(messages: LlmMessage[], options: PruneToolResultsOptions | undefined): LlmMessage[];
31
+ /**
32
+ * Fail fast on an option that cannot describe an age in rounds.
33
+ *
34
+ * @throws ConfigurationError with code `invalid_prune_tool_results` when `olderThanRounds` is
35
+ * not an integer of at least 1.
36
+ */
37
+ export declare function validatePruneToolResults(options: PruneToolResultsOptions | undefined): void;
@@ -69,7 +69,7 @@ export declare function readStoredOAuth(config: CredentialStoreConfig, env?: Rec
69
69
  * file in the same directory with `wx` (O_EXCL), fsync, close, chmod, then `rename` (atomic on POSIX) —
70
70
  * so a crash mid-write leaves whatever was there untouched, and a pre-planted symlink cannot capture the
71
71
  * key. The api variant persists the unchanged `{provider, api_key}` (back-compat, no `type` key); the
72
- * oauth variant persists `{type:'oauth', provider, access, refresh, expires, account_id?}`.
72
+ * oauth variant persists `{type:'oauth', provider, access, refresh, expires, account_id?, id_token?}`.
73
73
  */
74
74
  export declare function writeCredential(cred: {
75
75
  provider: string;
@@ -109,6 +109,8 @@ export interface StoredOAuthCredential {
109
109
  /** Epoch ms the access token expires. */
110
110
  expires: number;
111
111
  account_id?: string;
112
+ /** The provider's OpenID ID token, when its token endpoint returned one (#821). */
113
+ id_token?: string;
112
114
  }
113
115
  /**
114
116
  * Whatever the credential file turned out to hold — the two variants are discriminated by `type`.
@@ -137,6 +139,8 @@ export interface OAuthTokens {
137
139
  /** Epoch ms the access token expires. */
138
140
  expires: number;
139
141
  accountId?: string;
142
+ /** The OpenID ID token, when the token endpoint returned one (#821). */
143
+ idToken?: string;
140
144
  }
141
145
  /** Injected HTTP + clock effects — deterministic in tests, real in production. */
142
146
  export interface HttpDeps {
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * Scans `~/.theokit/plugins/model-providers/<name>/index.{js,mjs}` and
5
5
  * imports each as a Plugin. Plugins with `kind: "model-provider"` register
6
- * their profile. Errors per plugin are logged + skipped. Idempotent per
7
- * process.
6
+ * their profile. Errors per plugin are logged + skipped. Each plugin is
7
+ * imported at most once per process; the trust gate is read on every call.
8
8
  *
9
9
  * EC-9: dynamic `import()` in Node 22 needs `file://` URL for absolute
10
10
  * paths in ESM contexts. `pathToFileURL` handles both.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The trust gate for provider plugins loaded from disk (M47, B-686).
3
+ *
4
+ * Provider discovery (`discovery.ts`) reads this list of NAMES; it authorizes only
5
+ * `~/.theokit/plugins/model-providers/<name>/`, a folder in the operator's own home. Workspace
6
+ * manifest plugins never consult it: a cloned workspace chooses its folder names, so they are
7
+ * trusted by realpath in a record of their own (`runtime/plugin-loader/workspace-plugin-trust.ts`),
8
+ * which shares the fail-closed file reader below. Both are read on every call and never cached, so
9
+ * an entry the operator adds takes effect on the next `Agent.create` rather than after a restart.
10
+ *
11
+ * @internal
12
+ */
13
+ /** The explicit trust allowlist the human edits (M47). Fail-closed: missing/malformed ⇒ empty. */
14
+ export declare function trustFilePath(): string;
15
+ /**
16
+ * M47 — the trust gate for the dynamic-import surface. A plugin's entry executes arbitrary code
17
+ * at import time, so NOTHING is imported unless the human explicitly trusted the name: either in
18
+ * `~/.theokit/plugins/trusted-providers.json` (a JSON string array — the auditable primary, mirroring the
19
+ * approved-hooks posture) or the additive `THEOKIT_TRUSTED_PROVIDERS` env (comma-separated convenience).
20
+ * Fail-closed: a missing or malformed trust file trusts NOTHING (a malformed file WARNs).
21
+ */
22
+ export declare function readTrustedNames(): Set<string>;
23
+ /** What a trust file holds, as its fail-closed warnings name it. */
24
+ export interface TrustArrayShape {
25
+ /** What a malformed file leaves untrusted, e.g. "provider plugins". */
26
+ readonly subject: string;
27
+ /** What each entry must be, e.g. "plugin-name strings". */
28
+ readonly entries: string;
29
+ }
30
+ /**
31
+ * The non-empty strings in a JSON-array trust file. Fail-closed: a missing file is empty, and a
32
+ * malformed one (not JSON, not an array) is empty with a WARN; non-string entries are discarded
33
+ * with a WARN.
34
+ */
35
+ export declare function readTrustArray(path: string, shape: TrustArrayShape): string[];
@@ -0,0 +1,17 @@
1
+ /**
2
+ * B-686 — import the `entry` of each trusted workspace manifest plugin.
3
+ *
4
+ * `PluginsManager` lists a folder under `<cwd>/.theokit/plugins/<folder>/` whose `PLUGIN.md` names an
5
+ * `entry`; this step decides whether that code runs. The folder's realpath is checked against the
6
+ * workspace trust record (`workspace-plugin-trust.ts`) before any `import()`, never its name: a
7
+ * cloned workspace chooses its folder names, so a name in the provider trust list authorizes
8
+ * nothing here (review round 1, CWE-829). An untrusted folder's code is never evaluated, and it is
9
+ * diagnosed once per folder per process. A trusted entry whose import throws,
10
+ * or whose default export is not a general plugin, fails `Agent.create` with a typed error rather
11
+ * than being skipped: the operator trusted that code, so dropping it silently would hide a bug.
12
+ *
13
+ * @internal
14
+ */
15
+ import type { Plugin } from "../../plugins/types.js";
16
+ import type { ManifestEntryCandidate } from "./plugins-manager.js";
17
+ export declare function importTrustedManifestPlugins(candidates: ReadonlyArray<ManifestEntryCandidate>, trustedFolders: ReadonlySet<string>): Promise<Plugin[]>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * B-686 — the trust record for workspace manifest plugins.
3
+ *
4
+ * A folder under `<cwd>/.theokit/plugins/<folder>/` is code a cloned repository ships, and the
5
+ * repository chooses the folder's name. So the record is keyed on what the workspace cannot
6
+ * choose: the folder's absolute realpath, in `~/.theokit/plugins/trusted-workspace-plugins.json`
7
+ * (a JSON array). It is a record of its own: a name in the provider trust list
8
+ * (`providers/trust-gate.ts`) authorizes no workspace folder. Read on every call, never cached;
9
+ * fail-closed like the provider list, whose reader it shares.
10
+ *
11
+ * @internal
12
+ */
13
+ /** Beside the provider trust file, in `~/.theokit/plugins/`. */
14
+ export declare function workspaceTrustRecordPath(): string;
15
+ /** The folder realpaths the operator trusted; a relative entry is discarded with a WARN. */
16
+ export declare function readTrustedWorkspaceFolders(): Set<string>;
@@ -0,0 +1 @@
1
+ export {};
@@ -13,6 +13,8 @@ export interface Skill {
13
13
  source: string;
14
14
  category?: string;
15
15
  dependencies?: string[];
16
+ /** `requires-bins` — executables that must be on PATH for the model to be offered this skill. */
17
+ requiresBins?: string[];
16
18
  /** `disable-model-invocation: true` — the model is never told this skill exists. */
17
19
  disableModelInvocation?: boolean;
18
20
  /** `user-invocable: false` — carried for a host that has a picker; this SDK has no such surface. */
@@ -1,5 +1,5 @@
1
1
  import type { z as ZodNamespace, ZodType } from "zod";
2
- import type { AgentOptions, CustomTool, LocalOptions, ModelSelection } from "../types/agent.js";
2
+ import type { AgentOptions, BuiltinToolName, CustomTool, LocalOptions, MemorySettings, ModelSelection } from "../types/agent.js";
3
3
  import type { ProviderRoutingSettings } from "../types/providers.js";
4
4
  /**
5
5
  * Load Zod via createRequire (it's an optional peer dep). Throws a typed
@@ -15,7 +15,8 @@ export declare function requireZod(): typeof ZodNamespace;
15
15
  export declare function makeOutputTool(jsonSchema: Record<string, unknown>, onCapture: (input: unknown) => string | Promise<string> | undefined): CustomTool;
16
16
  /**
17
17
  * Assemble the AgentOptions for the transient agent. Shared shape:
18
- * model + local + tools[output] + systemPrompt + apiKey.
18
+ * model + local + tools[output] + systemPrompt + apiKey, plus the caller's withheld builtins
19
+ * and memory settings when supplied (B-678).
19
20
  */
20
21
  export declare function buildTransientAgentOptions(params: {
21
22
  model: string | ModelSelection;
@@ -24,6 +25,8 @@ export declare function buildTransientAgentOptions(params: {
24
25
  systemPrompt?: string;
25
26
  apiKey?: string;
26
27
  providers?: ProviderRoutingSettings;
28
+ withheldBuiltinTools?: readonly BuiltinToolName[];
29
+ memory?: MemorySettings;
27
30
  }): AgentOptions;
28
31
  /**
29
32
  * Best-effort extraction of token usage from a run result. Local runtimes
package/dist/mcp-auth.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkZOFRNNZD_cjs = require('./chunk-ZOFRNNZD.cjs');
4
- var chunkQISSETTG_cjs = require('./chunk-QISSETTG.cjs');
4
+ var chunk5645PMVU_cjs = require('./chunk-5645PMVU.cjs');
5
5
  var chunkCEGU5AVD_cjs = require('./chunk-CEGU5AVD.cjs');
6
6
  var chunkRNXXYF22_cjs = require('./chunk-RNXXYF22.cjs');
7
7
  var crypto = require('crypto');
@@ -92,7 +92,7 @@ async function getTokens(serverName) {
92
92
  }
93
93
  const filePath = storeFilePath();
94
94
  if (!fs.existsSync(filePath)) return void 0;
95
- chunkQISSETTG_cjs.assertSecureModes(path.dirname(filePath), filePath);
95
+ chunk5645PMVU_cjs.assertSecureModes(path.dirname(filePath), filePath);
96
96
  try {
97
97
  const all = JSON.parse(fs.readFileSync(filePath, "utf8"));
98
98
  return all[serverName];
package/dist/mcp-auth.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { atomicWriteJson } from './chunk-M4U24U6G.js';
2
- import { assertSecureModes } from './chunk-MS3TQSXU.js';
2
+ import { assertSecureModes } from './chunk-QD6B6W6I.js';
3
3
  import { ConfigurationError } from './chunk-TNFOU6SB.js';
4
4
  import { diag } from './chunk-3OY6H3I7.js';
5
5
  import { randomBytes, createHash } from 'crypto';
package/dist/models.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk7INPXUJI_cjs = require('./chunk-7INPXUJI.cjs');
4
- var chunkNWWTYBD3_cjs = require('./chunk-NWWTYBD3.cjs');
4
+ var chunk4KBI37F3_cjs = require('./chunk-4KBI37F3.cjs');
5
5
  var chunk3EE6LVWT_cjs = require('./chunk-3EE6LVWT.cjs');
6
- var chunkS46WJTDL_cjs = require('./chunk-S46WJTDL.cjs');
6
+ var chunk4TEGFMSP_cjs = require('./chunk-4TEGFMSP.cjs');
7
7
  require('./chunk-NVXXWAU7.cjs');
8
- require('./chunk-5A4UFBHW.cjs');
9
- require('./chunk-QISSETTG.cjs');
8
+ require('./chunk-A77UMVMD.cjs');
9
+ require('./chunk-5645PMVU.cjs');
10
10
  require('./chunk-IOFMRS6T.cjs');
11
11
  var chunkEHD25JBZ_cjs = require('./chunk-EHD25JBZ.cjs');
12
12
  require('./chunk-CEGU5AVD.cjs');
@@ -85,7 +85,7 @@ function catalogTargets() {
85
85
  if (_catalogTargets !== void 0) return _catalogTargets;
86
86
  _catalogTargets = /* @__PURE__ */ new Map();
87
87
  try {
88
- for (const entry of Object.values(chunkS46WJTDL_cjs.loadProviderCatalog())) {
88
+ for (const entry of Object.values(chunk4TEGFMSP_cjs.loadProviderCatalog())) {
89
89
  const keys = [entry.id, ...entry.aliases ?? []];
90
90
  for (const k of keys) {
91
91
  if (!_catalogTargets.has(k)) _catalogTargets.set(k, { keys });
@@ -99,7 +99,7 @@ function resolvePatchKeys(externalId) {
99
99
  const mapped = MODELS_DEV_ID_MAP[externalId] ?? externalId;
100
100
  const fromCatalog = catalogTargets().get(mapped);
101
101
  if (fromCatalog !== void 0) return fromCatalog.keys;
102
- const profile = chunkS46WJTDL_cjs.getProviderProfile(mapped);
102
+ const profile = chunk4TEGFMSP_cjs.getProviderProfile(mapped);
103
103
  if (profile !== void 0) return [profile.name, ...profile.aliases ?? []];
104
104
  return void 0;
105
105
  }
@@ -116,9 +116,9 @@ function patchIndexFromApiJson(raw) {
116
116
  continue;
117
117
  }
118
118
  for (const [modelId, rawModel] of Object.entries(models)) {
119
- const parsed = chunkS46WJTDL_cjs.catalogModelSchema.safeParse(rawModel);
119
+ const parsed = chunk4TEGFMSP_cjs.catalogModelSchema.safeParse(rawModel);
120
120
  if (!parsed.success) continue;
121
- for (const key of keys) chunkS46WJTDL_cjs.patchModelInfo(`${key}/${modelId}`, parsed.data);
121
+ for (const key of keys) chunk4TEGFMSP_cjs.patchModelInfo(`${key}/${modelId}`, parsed.data);
122
122
  patched++;
123
123
  }
124
124
  }
@@ -218,7 +218,7 @@ function persistAndPatch(path, body) {
218
218
  }
219
219
  }
220
220
  async function refreshModelCatalog(opts = {}) {
221
- chunkS46WJTDL_cjs.registerBuiltins();
221
+ chunk4TEGFMSP_cjs.registerBuiltins();
222
222
  if (fetchDisabledByEnv()) return { source: "skipped", models: 0 };
223
223
  const url = opts.url ?? process.env.THEOKIT_MODELS_URL ?? DEFAULT_URL;
224
224
  const path = cachePathFor(url);
@@ -232,12 +232,12 @@ async function refreshModelCatalog(opts = {}) {
232
232
  return persistAndPatch(path, body);
233
233
  }
234
234
  function getModelInfo(modelId) {
235
- return chunkS46WJTDL_cjs.getCatalogModelInfo(modelId);
235
+ return chunk4TEGFMSP_cjs.getCatalogModelInfo(modelId);
236
236
  }
237
237
 
238
238
  Object.defineProperty(exports, "resolveModelCapabilities", {
239
239
  enumerable: true,
240
- get: function () { return chunkNWWTYBD3_cjs.resolveModelCapabilities; }
240
+ get: function () { return chunk4KBI37F3_cjs.resolveModelCapabilities; }
241
241
  });
242
242
  Object.defineProperty(exports, "parseModelId", {
243
243
  enumerable: true,
package/dist/models.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { Retry } from './chunk-2S4HQCDF.js';
2
- export { resolveModelCapabilities } from './chunk-2SFLLOMN.js';
2
+ export { resolveModelCapabilities } from './chunk-NVQSBRG6.js';
3
3
  import { parseModelId } from './chunk-R7WIIPUR.js';
4
4
  export { parseModelId } from './chunk-R7WIIPUR.js';
5
- import { registerBuiltins, getCatalogModelInfo, catalogModelSchema, patchModelInfo, getProviderProfile, loadProviderCatalog } from './chunk-5HSMH2ZZ.js';
5
+ import { registerBuiltins, getCatalogModelInfo, catalogModelSchema, patchModelInfo, getProviderProfile, loadProviderCatalog } from './chunk-CJN5CEI3.js';
6
6
  import './chunk-AGACYRJ2.js';
7
- import './chunk-3FSBE4PS.js';
8
- import './chunk-MS3TQSXU.js';
7
+ import './chunk-3GTN4HOO.js';
8
+ import './chunk-QD6B6W6I.js';
9
9
  import './chunk-5IUDICRK.js';
10
10
  import { boundFetch } from './chunk-Q7GYMXVC.js';
11
11
  import './chunk-TNFOU6SB.js';
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var chunkLO6LIUZ6_cjs = require('./chunk-LO6LIUZ6.cjs');
4
- require('./chunk-S46WJTDL.cjs');
3
+ var chunkR5UQL2R5_cjs = require('./chunk-R5UQL2R5.cjs');
4
+ require('./chunk-4TEGFMSP.cjs');
5
5
  require('./chunk-NVXXWAU7.cjs');
6
- require('./chunk-5A4UFBHW.cjs');
7
- require('./chunk-QISSETTG.cjs');
6
+ require('./chunk-A77UMVMD.cjs');
7
+ require('./chunk-5645PMVU.cjs');
8
8
  require('./chunk-IOFMRS6T.cjs');
9
9
  require('./chunk-EHD25JBZ.cjs');
10
10
  require('./chunk-CEGU5AVD.cjs');
@@ -14,11 +14,11 @@ require('./chunk-RNXXYF22.cjs');
14
14
 
15
15
  Object.defineProperty(exports, "getProviderProfile", {
16
16
  enumerable: true,
17
- get: function () { return chunkLO6LIUZ6_cjs.getProviderProfile; }
17
+ get: function () { return chunkR5UQL2R5_cjs.getProviderProfile; }
18
18
  });
19
19
  Object.defineProperty(exports, "listProviders", {
20
20
  enumerable: true,
21
- get: function () { return chunkLO6LIUZ6_cjs.listProviders; }
21
+ get: function () { return chunkR5UQL2R5_cjs.listProviders; }
22
22
  });
23
23
  //# sourceMappingURL=providers.cjs.map
24
24
  //# sourceMappingURL=providers.cjs.map
package/dist/providers.js CHANGED
@@ -1,8 +1,8 @@
1
- export { getProviderProfile, listProviders } from './chunk-NKQVLWDF.js';
2
- import './chunk-5HSMH2ZZ.js';
1
+ export { getProviderProfile, listProviders } from './chunk-ULEK4OM4.js';
2
+ import './chunk-CJN5CEI3.js';
3
3
  import './chunk-AGACYRJ2.js';
4
- import './chunk-3FSBE4PS.js';
5
- import './chunk-MS3TQSXU.js';
4
+ import './chunk-3GTN4HOO.js';
5
+ import './chunk-QD6B6W6I.js';
6
6
  import './chunk-5IUDICRK.js';
7
7
  import './chunk-Q7GYMXVC.js';
8
8
  import './chunk-TNFOU6SB.js';
@@ -1,9 +1,10 @@
1
+ import type { BwrapDetection, SandboxMode } from "./types.js";
1
2
  /**
2
3
  * Codex's three canonical modes. Defined HERE because they are sandbox vocabulary, not consumer
3
4
  * configuration: `danger-full-access` means "do not wrap", and that is a decision belonging to the
4
5
  * confinement subsystem.
5
6
  */
6
- export type SandboxMode = "read-only" | "workspace-write" | "danger-full-access";
7
+ export type { SandboxMode } from "./types.js";
7
8
  /**
8
9
  * U-6 — the roots a mode may write to, answerable WITHOUT spawning anything.
9
10
  *
@@ -40,6 +41,13 @@ export interface BwrapArgvOptions {
40
41
  * sandboxed child. Omitted ⇒ inherit the parent env (backward-compatible; SDK scrub still applies).
41
42
  */
42
43
  env?: Record<string, string>;
44
+ /**
45
+ * Absolute paths the confined command must not read. Each is resolved through symlinks and masked
46
+ * after the writable binds: a directory becomes empty, a file reads as permission denied. A masked
47
+ * file still shows in the listing of its directory. Throws `TypeError` for a relative or missing
48
+ * path, one that contains the workspace, `/tmp` or `/`, and any list under `danger-full-access`.
49
+ */
50
+ denyReadPaths?: readonly string[];
43
51
  }
44
52
  /**
45
53
  * Pure argv builder. Returns the bwrap flags ending in `--` (caller appends `/bin/sh -c <cmd>`),
@@ -73,13 +81,7 @@ export interface BwrapProbes {
73
81
  * `try`/`catch` catches nothing; callers warn and fall back to an unconfined
74
82
  * `LocalSandbox`.
75
83
  */
76
- export type BwrapDetection = {
77
- ok: true;
78
- bin: string;
79
- } | {
80
- ok: false;
81
- reason: string;
82
- };
84
+ export type { BwrapDetection } from "./types.js";
83
85
  /** Honest detection — fail-closed on every probe; NEVER throws (callers WARN + fall back). */
84
86
  export declare function detectBwrap(probes?: BwrapProbes): BwrapDetection;
85
87
  /** How many real probes ran. TEST seam — the performance gate counts this. */
@@ -1,9 +1,10 @@
1
+ import type { BwrapDetection, SandboxMode } from "./types.js";
1
2
  /**
2
3
  * Codex's three canonical modes. Defined HERE because they are sandbox vocabulary, not consumer
3
4
  * configuration: `danger-full-access` means "do not wrap", and that is a decision belonging to the
4
5
  * confinement subsystem.
5
6
  */
6
- export type SandboxMode = "read-only" | "workspace-write" | "danger-full-access";
7
+ export type { SandboxMode } from "./types.js";
7
8
  /**
8
9
  * U-6 — the roots a mode may write to, answerable WITHOUT spawning anything.
9
10
  *
@@ -40,6 +41,13 @@ export interface BwrapArgvOptions {
40
41
  * sandboxed child. Omitted ⇒ inherit the parent env (backward-compatible; SDK scrub still applies).
41
42
  */
42
43
  env?: Record<string, string>;
44
+ /**
45
+ * Absolute paths the confined command must not read. Each is resolved through symlinks and masked
46
+ * after the writable binds: a directory becomes empty, a file reads as permission denied. A masked
47
+ * file still shows in the listing of its directory. Throws `TypeError` for a relative or missing
48
+ * path, one that contains the workspace, `/tmp` or `/`, and any list under `danger-full-access`.
49
+ */
50
+ denyReadPaths?: readonly string[];
43
51
  }
44
52
  /**
45
53
  * Pure argv builder. Returns the bwrap flags ending in `--` (caller appends `/bin/sh -c <cmd>`),
@@ -73,13 +81,7 @@ export interface BwrapProbes {
73
81
  * `try`/`catch` catches nothing; callers warn and fall back to an unconfined
74
82
  * `LocalSandbox`.
75
83
  */
76
- export type BwrapDetection = {
77
- ok: true;
78
- bin: string;
79
- } | {
80
- ok: false;
81
- reason: string;
82
- };
84
+ export type { BwrapDetection } from "./types.js";
83
85
  /** Honest detection — fail-closed on every probe; NEVER throws (callers WARN + fall back). */
84
86
  export declare function detectBwrap(probes?: BwrapProbes): BwrapDetection;
85
87
  /** How many real probes ran. TEST seam — the performance gate counts this. */
@@ -0,0 +1,24 @@
1
+ import type { BwrapDetection, SandboxMode } from "./types.js";
2
+ /**
3
+ * The bwrap flags that make each path in `paths` unreadable inside the sandbox: `--tmpfs` for a
4
+ * directory, `--ro-bind /dev/null` for a file. Callers place them after the writable binds so the
5
+ * mask wins over a path inside the workspace or `/tmp`.
6
+ *
7
+ * Every entry is resolved through symlinks first, so reading through a link is denied too, and
8
+ * duplicates collapse in list order. A masked file is still listed in its directory; only reading it
9
+ * fails.
10
+ *
11
+ * Throws `TypeError` (never skips) for a relative or missing entry, an entry that equals or contains
12
+ * the working directory, `/tmp` or `/`, and any non-empty list under `danger-full-access`, where no
13
+ * mask can be applied.
14
+ */
15
+ export declare function denyReadFlags(paths: readonly string[] | undefined, policy: {
16
+ mode: SandboxMode;
17
+ cwd: string;
18
+ }): string[];
19
+ /**
20
+ * Refuses a non-empty deny list that no confinement can honour, before a backend or a wrap exists:
21
+ * `danger-full-access` applies no sandbox (`TypeError`), and an undetected bubblewrap would fall back
22
+ * to an unconfined run, which is the leak the list exists to stop (`SandboxNotAvailableError`).
23
+ */
24
+ export declare function refuseUnhonourableDenyRead(paths: readonly string[] | undefined, mode: SandboxMode, detect: () => BwrapDetection): void;
@@ -0,0 +1,24 @@
1
+ import type { BwrapDetection, SandboxMode } from "./types.js";
2
+ /**
3
+ * The bwrap flags that make each path in `paths` unreadable inside the sandbox: `--tmpfs` for a
4
+ * directory, `--ro-bind /dev/null` for a file. Callers place them after the writable binds so the
5
+ * mask wins over a path inside the workspace or `/tmp`.
6
+ *
7
+ * Every entry is resolved through symlinks first, so reading through a link is denied too, and
8
+ * duplicates collapse in list order. A masked file is still listed in its directory; only reading it
9
+ * fails.
10
+ *
11
+ * Throws `TypeError` (never skips) for a relative or missing entry, an entry that equals or contains
12
+ * the working directory, `/tmp` or `/`, and any non-empty list under `danger-full-access`, where no
13
+ * mask can be applied.
14
+ */
15
+ export declare function denyReadFlags(paths: readonly string[] | undefined, policy: {
16
+ mode: SandboxMode;
17
+ cwd: string;
18
+ }): string[];
19
+ /**
20
+ * Refuses a non-empty deny list that no confinement can honour, before a backend or a wrap exists:
21
+ * `danger-full-access` applies no sandbox (`TypeError`), and an undetected bubblewrap would fall back
22
+ * to an unconfined run, which is the leak the list exists to stop (`SandboxNotAvailableError`).
23
+ */
24
+ export declare function refuseUnhonourableDenyRead(paths: readonly string[] | undefined, mode: SandboxMode, detect: () => BwrapDetection): void;