@theokit/sdk 5.6.0 → 5.7.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 (109) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/{agent-G6g-uwcB.d.ts → agent-Bqzdhkqr.d.ts} +1 -1
  3. package/dist/{agent-82d_DrCL.d.cts → agent-Dya5SmhY.d.cts} +1 -1
  4. package/dist/{agent-JJZM2VIK.js → agent-EQ5HKTWV.js} +11 -10
  5. package/dist/{agent-JJZM2VIK.js.map → agent-EQ5HKTWV.js.map} +1 -1
  6. package/dist/{agent-47NS6ZVL.cjs → agent-KA63WDQH.cjs} +12 -11
  7. package/dist/{agent-47NS6ZVL.cjs.map → agent-KA63WDQH.cjs.map} +1 -1
  8. package/dist/agent.d.ts +11 -0
  9. package/dist/{chunk-VUHXC74Q.cjs → chunk-33A27NFX.cjs} +15 -15
  10. package/dist/{chunk-VUHXC74Q.cjs.map → chunk-33A27NFX.cjs.map} +1 -1
  11. package/dist/{chunk-HUDNLFY4.js → chunk-3VXQEQE4.js} +13 -4
  12. package/dist/chunk-3VXQEQE4.js.map +1 -0
  13. package/dist/{chunk-DZG77WU7.cjs → chunk-3XSWF5AP.cjs} +3 -3
  14. package/dist/{chunk-DZG77WU7.cjs.map → chunk-3XSWF5AP.cjs.map} +1 -1
  15. package/dist/{chunk-FPIY5CLV.js → chunk-6JG2RFGK.js} +3 -3
  16. package/dist/{chunk-FPIY5CLV.js.map → chunk-6JG2RFGK.js.map} +1 -1
  17. package/dist/{chunk-N2KAIZ5D.js → chunk-7C3HWGCW.js} +3 -19
  18. package/dist/chunk-7C3HWGCW.js.map +1 -0
  19. package/dist/{chunk-LD6HASA5.cjs → chunk-7KBNBPFK.cjs} +12 -2
  20. package/dist/chunk-7KBNBPFK.cjs.map +1 -0
  21. package/dist/{chunk-GCHZMH42.cjs → chunk-A575WPBL.cjs} +88 -84
  22. package/dist/chunk-A575WPBL.cjs.map +1 -0
  23. package/dist/{chunk-5NELQ6LB.js → chunk-A6PDYH55.js} +12 -3
  24. package/dist/chunk-A6PDYH55.js.map +1 -0
  25. package/dist/{chunk-2QKV4CGK.js → chunk-CZWN4C6A.js} +3 -3
  26. package/dist/{chunk-2QKV4CGK.js.map → chunk-CZWN4C6A.js.map} +1 -1
  27. package/dist/chunk-DQNI52VV.js +20 -0
  28. package/dist/chunk-DQNI52VV.js.map +1 -0
  29. package/dist/{chunk-52FDUJSV.cjs → chunk-E6QXZZKE.cjs} +8 -8
  30. package/dist/{chunk-52FDUJSV.cjs.map → chunk-E6QXZZKE.cjs.map} +1 -1
  31. package/dist/{chunk-EIOMN5VA.cjs → chunk-EFETPSJZ.cjs} +17 -8
  32. package/dist/chunk-EFETPSJZ.cjs.map +1 -0
  33. package/dist/{chunk-HG4UN4MN.cjs → chunk-ER5BOIYD.cjs} +4 -4
  34. package/dist/{chunk-HG4UN4MN.cjs.map → chunk-ER5BOIYD.cjs.map} +1 -1
  35. package/dist/{chunk-2UXQASTX.js → chunk-FUUSIT2T.js} +16 -12
  36. package/dist/chunk-FUUSIT2T.js.map +1 -0
  37. package/dist/{chunk-7IZKTQ5G.cjs → chunk-GK3UG7YQ.cjs} +2 -21
  38. package/dist/chunk-GK3UG7YQ.cjs.map +1 -0
  39. package/dist/{chunk-GFFBXSQT.cjs → chunk-HNAYCTX4.cjs} +5 -5
  40. package/dist/{chunk-GFFBXSQT.cjs.map → chunk-HNAYCTX4.cjs.map} +1 -1
  41. package/dist/{chunk-KZSKIUXZ.js → chunk-N7VAE6DZ.js} +31 -3
  42. package/dist/chunk-N7VAE6DZ.js.map +1 -0
  43. package/dist/{chunk-7MMTZBTT.js → chunk-P5S3WCSZ.js} +3 -3
  44. package/dist/{chunk-7MMTZBTT.js.map → chunk-P5S3WCSZ.js.map} +1 -1
  45. package/dist/{chunk-BZ3YMAMP.js → chunk-R3LBRQAN.js} +3 -3
  46. package/dist/{chunk-BZ3YMAMP.js.map → chunk-R3LBRQAN.js.map} +1 -1
  47. package/dist/{chunk-STGSMJMJ.js → chunk-YRLI5DVC.js} +3 -3
  48. package/dist/{chunk-STGSMJMJ.js.map → chunk-YRLI5DVC.js.map} +1 -1
  49. package/dist/chunk-YYN6BB7R.cjs +24 -0
  50. package/dist/chunk-YYN6BB7R.cjs.map +1 -0
  51. package/dist/{chunk-C4ZQPWXJ.cjs → chunk-ZLMU5EU3.cjs} +33 -4
  52. package/dist/chunk-ZLMU5EU3.cjs.map +1 -0
  53. package/dist/{compact-session-7FMYJXQ7.cjs → compact-session-75KD2FCM.cjs} +15 -11
  54. package/dist/{compact-session-7FMYJXQ7.cjs.map → compact-session-75KD2FCM.cjs.map} +1 -1
  55. package/dist/{compact-session-YSEK7NQF.js → compact-session-QT6RJOKO.js} +3 -3
  56. package/dist/{compact-session-YSEK7NQF.js.map → compact-session-QT6RJOKO.js.map} +1 -1
  57. package/dist/context/index.cjs +11 -7
  58. package/dist/context/index.cjs.map +1 -1
  59. package/dist/context/index.js +7 -3
  60. package/dist/context/index.js.map +1 -1
  61. package/dist/{context-HR4KMXMA.cjs → context-7RP5JXGM.cjs} +7 -6
  62. package/dist/{context-HR4KMXMA.cjs.map → context-7RP5JXGM.cjs.map} +1 -1
  63. package/dist/context-OJIIXJCV.js +7 -0
  64. package/dist/{context-J5BJ3LBS.js.map → context-OJIIXJCV.js.map} +1 -1
  65. package/dist/{cron-DWv69ZSD.d.cts → cron-BwxDUscv.d.cts} +1 -1
  66. package/dist/{cron-GynWtAax.d.ts → cron-D8uB1Xh5.d.ts} +1 -1
  67. package/dist/cron.cjs +11 -10
  68. package/dist/cron.d.cts +2 -2
  69. package/dist/cron.d.ts +2 -2
  70. package/dist/cron.js +10 -9
  71. package/dist/eval.cjs +10 -9
  72. package/dist/eval.cjs.map +1 -1
  73. package/dist/eval.js +9 -8
  74. package/dist/eval.js.map +1 -1
  75. package/dist/{index-manager-BBHDKMQS.cjs → index-manager-W7RHSL6G.cjs} +6 -6
  76. package/dist/{index-manager-BBHDKMQS.cjs.map → index-manager-W7RHSL6G.cjs.map} +1 -1
  77. package/dist/{index-manager-27WLNQEE.js → index-manager-Z4XMRVWQ.js} +5 -5
  78. package/dist/{index-manager-27WLNQEE.js.map → index-manager-Z4XMRVWQ.js.map} +1 -1
  79. package/dist/index.cjs +42 -41
  80. package/dist/index.cjs.map +1 -1
  81. package/dist/index.d.cts +32 -3
  82. package/dist/index.d.ts +32 -3
  83. package/dist/index.js +14 -13
  84. package/dist/index.js.map +1 -1
  85. package/dist/{inject-session-PC73TMP2.cjs → inject-session-L6MIIELT.cjs} +4 -4
  86. package/dist/{inject-session-PC73TMP2.cjs.map → inject-session-L6MIIELT.cjs.map} +1 -1
  87. package/dist/{inject-session-J4LBWAPH.js → inject-session-XWWN4DAA.js} +3 -3
  88. package/dist/{inject-session-J4LBWAPH.js.map → inject-session-XWWN4DAA.js.map} +1 -1
  89. package/dist/internal/memory/storage/index.cjs +32 -32
  90. package/dist/internal/memory/storage/index.js +3 -3
  91. package/dist/internal/runtime/context/context-discovery.d.ts +27 -0
  92. package/dist/internal/session/compact-session.d.ts +36 -0
  93. package/dist/project.cjs +3 -3
  94. package/dist/project.js +1 -1
  95. package/dist/subagents-loader.d.cts +1 -1
  96. package/dist/subagents-loader.d.ts +1 -1
  97. package/dist/types/agent.d.ts +1 -1
  98. package/package.json +1 -1
  99. package/dist/chunk-2UXQASTX.js.map +0 -1
  100. package/dist/chunk-5NELQ6LB.js.map +0 -1
  101. package/dist/chunk-7IZKTQ5G.cjs.map +0 -1
  102. package/dist/chunk-C4ZQPWXJ.cjs.map +0 -1
  103. package/dist/chunk-EIOMN5VA.cjs.map +0 -1
  104. package/dist/chunk-GCHZMH42.cjs.map +0 -1
  105. package/dist/chunk-HUDNLFY4.js.map +0 -1
  106. package/dist/chunk-KZSKIUXZ.js.map +0 -1
  107. package/dist/chunk-LD6HASA5.cjs.map +0 -1
  108. package/dist/chunk-N2KAIZ5D.js.map +0 -1
  109. package/dist/context-J5BJ3LBS.js +0 -6
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkDZG77WU7_cjs = require('./chunk-DZG77WU7.cjs');
3
+ var chunk3XSWF5AP_cjs = require('./chunk-3XSWF5AP.cjs');
4
4
  var chunkYJNYDJ2T_cjs = require('./chunk-YJNYDJ2T.cjs');
5
5
  require('./chunk-YIFFF23U.cjs');
6
6
  var chunkGZV6AVRL_cjs = require('./chunk-GZV6AVRL.cjs');
@@ -10,7 +10,7 @@ require('./chunk-6LHQPOMI.cjs');
10
10
 
11
11
  // src/internal/session/inject-session.ts
12
12
  async function injectSessionTurn(opts) {
13
- await chunkDZG77WU7_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
13
+ await chunk3XSWF5AP_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
14
14
  const prior = await opts.store.readRecords(opts.loc.agentId);
15
15
  const transcript = chunkGZV6AVRL_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-PC73TMP2.cjs.map
29
- //# sourceMappingURL=inject-session-PC73TMP2.cjs.map
28
+ //# sourceMappingURL=inject-session-L6MIIELT.cjs.map
29
+ //# sourceMappingURL=inject-session-L6MIIELT.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-PC73TMP2.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-L6MIIELT.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-2QKV4CGK.js';
1
+ import { enqueueSessionWrite } from './chunk-CZWN4C6A.js';
2
2
  import { invalidateSessionCache } from './chunk-2XC6KDJM.js';
3
3
  import './chunk-2WXHA33T.js';
4
4
  import { SessionTranscript } from './chunk-JOFVLOFY.js';
@@ -23,5 +23,5 @@ async function injectSessionTurn(opts) {
23
23
  }
24
24
 
25
25
  export { injectSessionTurn };
26
- //# sourceMappingURL=inject-session-J4LBWAPH.js.map
27
- //# sourceMappingURL=inject-session-J4LBWAPH.js.map
26
+ //# sourceMappingURL=inject-session-XWWN4DAA.js.map
27
+ //# sourceMappingURL=inject-session-XWWN4DAA.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-J4LBWAPH.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-XWWN4DAA.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,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var chunk52FDUJSV_cjs = require('../../../chunk-52FDUJSV.cjs');
3
+ var chunkE6QXZZKE_cjs = require('../../../chunk-E6QXZZKE.cjs');
4
4
  var chunkTMKTSYDS_cjs = require('../../../chunk-TMKTSYDS.cjs');
5
- var chunkGFFBXSQT_cjs = require('../../../chunk-GFFBXSQT.cjs');
5
+ var chunkHNAYCTX4_cjs = require('../../../chunk-HNAYCTX4.cjs');
6
6
  require('../../../chunk-KRD3GQAA.cjs');
7
7
  require('../../../chunk-MUUQ2WFJ.cjs');
8
- require('../../../chunk-LD6HASA5.cjs');
8
+ require('../../../chunk-7KBNBPFK.cjs');
9
9
  require('../../../chunk-7A6535RA.cjs');
10
10
  require('../../../chunk-SA6K24NB.cjs');
11
11
  require('../../../chunk-GZV6AVRL.cjs');
@@ -19,23 +19,23 @@ require('../../../chunk-6LHQPOMI.cjs');
19
19
 
20
20
  Object.defineProperty(exports, "appendDiaryEntry", {
21
21
  enumerable: true,
22
- get: function () { return chunk52FDUJSV_cjs.appendDiaryEntry; }
22
+ get: function () { return chunkE6QXZZKE_cjs.appendDiaryEntry; }
23
23
  });
24
24
  Object.defineProperty(exports, "diaryPath", {
25
25
  enumerable: true,
26
- get: function () { return chunk52FDUJSV_cjs.diaryPath; }
26
+ get: function () { return chunkE6QXZZKE_cjs.diaryPath; }
27
27
  });
28
28
  Object.defineProperty(exports, "entryHash", {
29
29
  enumerable: true,
30
- get: function () { return chunk52FDUJSV_cjs.entryHash; }
30
+ get: function () { return chunkE6QXZZKE_cjs.entryHash; }
31
31
  });
32
32
  Object.defineProperty(exports, "readAllSqliteFacts", {
33
33
  enumerable: true,
34
- get: function () { return chunk52FDUJSV_cjs.readAllSqliteFacts; }
34
+ get: function () { return chunkE6QXZZKE_cjs.readAllSqliteFacts; }
35
35
  });
36
36
  Object.defineProperty(exports, "renderDiaryEntry", {
37
37
  enumerable: true,
38
- get: function () { return chunk52FDUJSV_cjs.renderDiaryEntry; }
38
+ get: function () { return chunkE6QXZZKE_cjs.renderDiaryEntry; }
39
39
  });
40
40
  Object.defineProperty(exports, "persistActiveMemoryTranscript", {
41
41
  enumerable: true,
@@ -43,99 +43,99 @@ Object.defineProperty(exports, "persistActiveMemoryTranscript", {
43
43
  });
44
44
  Object.defineProperty(exports, "MEMORY_INDEX_MAX_BYTES", {
45
45
  enumerable: true,
46
- get: function () { return chunkGFFBXSQT_cjs.MEMORY_INDEX_MAX_BYTES; }
46
+ get: function () { return chunkHNAYCTX4_cjs.MEMORY_INDEX_MAX_BYTES; }
47
47
  });
48
48
  Object.defineProperty(exports, "MEMORY_INDEX_MAX_LINES", {
49
49
  enumerable: true,
50
- get: function () { return chunkGFFBXSQT_cjs.MEMORY_INDEX_MAX_LINES; }
50
+ get: function () { return chunkHNAYCTX4_cjs.MEMORY_INDEX_MAX_LINES; }
51
51
  });
52
52
  Object.defineProperty(exports, "appendFact", {
53
53
  enumerable: true,
54
- get: function () { return chunkGFFBXSQT_cjs.appendFact; }
54
+ get: function () { return chunkHNAYCTX4_cjs.appendFact; }
55
55
  });
56
56
  Object.defineProperty(exports, "appendFactToMarkdown", {
57
57
  enumerable: true,
58
- get: function () { return chunkGFFBXSQT_cjs.appendFactToMarkdown; }
58
+ get: function () { return chunkHNAYCTX4_cjs.appendFactToMarkdown; }
59
59
  });
60
60
  Object.defineProperty(exports, "asMemoryRoot", {
61
61
  enumerable: true,
62
- get: function () { return chunkGFFBXSQT_cjs.asMemoryRoot; }
62
+ get: function () { return chunkHNAYCTX4_cjs.asMemoryRoot; }
63
63
  });
64
64
  Object.defineProperty(exports, "claudeProjectMemoryDir", {
65
65
  enumerable: true,
66
- get: function () { return chunkGFFBXSQT_cjs.claudeProjectMemoryDir; }
66
+ get: function () { return chunkHNAYCTX4_cjs.claudeProjectMemoryDir; }
67
67
  });
68
68
  Object.defineProperty(exports, "collectMarkdownFiles", {
69
69
  enumerable: true,
70
- get: function () { return chunkGFFBXSQT_cjs.collectMarkdownFiles; }
70
+ get: function () { return chunkHNAYCTX4_cjs.collectMarkdownFiles; }
71
71
  });
72
72
  Object.defineProperty(exports, "defaultIndexPath", {
73
73
  enumerable: true,
74
- get: function () { return chunkGFFBXSQT_cjs.defaultIndexPath; }
74
+ get: function () { return chunkHNAYCTX4_cjs.defaultIndexPath; }
75
75
  });
76
76
  Object.defineProperty(exports, "discoverSessionFiles", {
77
77
  enumerable: true,
78
- get: function () { return chunkGFFBXSQT_cjs.discoverSessionFiles; }
78
+ get: function () { return chunkHNAYCTX4_cjs.discoverSessionFiles; }
79
79
  });
80
80
  Object.defineProperty(exports, "discoverWikiFiles", {
81
81
  enumerable: true,
82
- get: function () { return chunkGFFBXSQT_cjs.discoverWikiFiles; }
82
+ get: function () { return chunkHNAYCTX4_cjs.discoverWikiFiles; }
83
83
  });
84
84
  Object.defineProperty(exports, "indexBudgetWarning", {
85
85
  enumerable: true,
86
- get: function () { return chunkGFFBXSQT_cjs.indexBudgetWarning; }
86
+ get: function () { return chunkHNAYCTX4_cjs.indexBudgetWarning; }
87
87
  });
88
88
  Object.defineProperty(exports, "lanceStoragePath", {
89
89
  enumerable: true,
90
- get: function () { return chunkGFFBXSQT_cjs.lanceStoragePath; }
90
+ get: function () { return chunkHNAYCTX4_cjs.lanceStoragePath; }
91
91
  });
92
92
  Object.defineProperty(exports, "memoryIndexRoot", {
93
93
  enumerable: true,
94
- get: function () { return chunkGFFBXSQT_cjs.memoryIndexRoot; }
94
+ get: function () { return chunkHNAYCTX4_cjs.memoryIndexRoot; }
95
95
  });
96
96
  Object.defineProperty(exports, "memoryMdPath", {
97
97
  enumerable: true,
98
- get: function () { return chunkGFFBXSQT_cjs.memoryMdPath; }
98
+ get: function () { return chunkHNAYCTX4_cjs.memoryMdPath; }
99
99
  });
100
100
  Object.defineProperty(exports, "memoryReadRoots", {
101
101
  enumerable: true,
102
- get: function () { return chunkGFFBXSQT_cjs.memoryReadRoots; }
102
+ get: function () { return chunkHNAYCTX4_cjs.memoryReadRoots; }
103
103
  });
104
104
  Object.defineProperty(exports, "notesDir", {
105
105
  enumerable: true,
106
- get: function () { return chunkGFFBXSQT_cjs.notesDir; }
106
+ get: function () { return chunkHNAYCTX4_cjs.notesDir; }
107
107
  });
108
108
  Object.defineProperty(exports, "projectMemoryDir", {
109
109
  enumerable: true,
110
- get: function () { return chunkGFFBXSQT_cjs.projectMemoryDir; }
110
+ get: function () { return chunkHNAYCTX4_cjs.projectMemoryDir; }
111
111
  });
112
112
  Object.defineProperty(exports, "readFacts", {
113
113
  enumerable: true,
114
- get: function () { return chunkGFFBXSQT_cjs.readFacts; }
114
+ get: function () { return chunkHNAYCTX4_cjs.readFacts; }
115
115
  });
116
116
  Object.defineProperty(exports, "readFactsFromMarkdown", {
117
117
  enumerable: true,
118
- get: function () { return chunkGFFBXSQT_cjs.readFactsFromMarkdown; }
118
+ get: function () { return chunkHNAYCTX4_cjs.readFactsFromMarkdown; }
119
119
  });
120
120
  Object.defineProperty(exports, "resolveMemoryRoot", {
121
121
  enumerable: true,
122
- get: function () { return chunkGFFBXSQT_cjs.resolveMemoryRoot; }
122
+ get: function () { return chunkHNAYCTX4_cjs.resolveMemoryRoot; }
123
123
  });
124
124
  Object.defineProperty(exports, "sessionSummaryPath", {
125
125
  enumerable: true,
126
- get: function () { return chunkGFFBXSQT_cjs.sessionSummaryPath; }
126
+ get: function () { return chunkHNAYCTX4_cjs.sessionSummaryPath; }
127
127
  });
128
128
  Object.defineProperty(exports, "sessionsDir", {
129
129
  enumerable: true,
130
- get: function () { return chunkGFFBXSQT_cjs.sessionsDir; }
130
+ get: function () { return chunkHNAYCTX4_cjs.sessionsDir; }
131
131
  });
132
132
  Object.defineProperty(exports, "wikiDir", {
133
133
  enumerable: true,
134
- get: function () { return chunkGFFBXSQT_cjs.wikiDir; }
134
+ get: function () { return chunkHNAYCTX4_cjs.wikiDir; }
135
135
  });
136
136
  Object.defineProperty(exports, "writeSessionSummary", {
137
137
  enumerable: true,
138
- get: function () { return chunkGFFBXSQT_cjs.writeSessionSummary; }
138
+ get: function () { return chunkHNAYCTX4_cjs.writeSessionSummary; }
139
139
  });
140
140
  //# sourceMappingURL=index.cjs.map
141
141
  //# sourceMappingURL=index.cjs.map
@@ -1,9 +1,9 @@
1
- export { appendDiaryEntry, diaryPath, entryHash, readAllSqliteFacts, renderDiaryEntry } from '../../../chunk-STGSMJMJ.js';
1
+ export { appendDiaryEntry, diaryPath, entryHash, readAllSqliteFacts, renderDiaryEntry } from '../../../chunk-YRLI5DVC.js';
2
2
  export { persistActiveMemoryTranscript } from '../../../chunk-OR6XIWLB.js';
3
- export { MEMORY_INDEX_MAX_BYTES, MEMORY_INDEX_MAX_LINES, appendFact, appendFactToMarkdown, asMemoryRoot, claudeProjectMemoryDir, collectMarkdownFiles, defaultIndexPath, discoverSessionFiles, discoverWikiFiles, indexBudgetWarning, lanceStoragePath, memoryIndexRoot, memoryMdPath, memoryReadRoots, notesDir, projectMemoryDir, readFacts, readFactsFromMarkdown, resolveMemoryRoot, sessionSummaryPath, sessionsDir, wikiDir, writeSessionSummary } from '../../../chunk-BZ3YMAMP.js';
3
+ export { MEMORY_INDEX_MAX_BYTES, MEMORY_INDEX_MAX_LINES, appendFact, appendFactToMarkdown, asMemoryRoot, claudeProjectMemoryDir, collectMarkdownFiles, defaultIndexPath, discoverSessionFiles, discoverWikiFiles, indexBudgetWarning, lanceStoragePath, memoryIndexRoot, memoryMdPath, memoryReadRoots, notesDir, projectMemoryDir, readFacts, readFactsFromMarkdown, resolveMemoryRoot, sessionSummaryPath, sessionsDir, wikiDir, writeSessionSummary } from '../../../chunk-R3LBRQAN.js';
4
4
  import '../../../chunk-KVNWIAO4.js';
5
5
  import '../../../chunk-FD2UT76F.js';
6
- import '../../../chunk-5NELQ6LB.js';
6
+ import '../../../chunk-A6PDYH55.js';
7
7
  import '../../../chunk-EH6XD3FY.js';
8
8
  import '../../../chunk-UKMBRMGT.js';
9
9
  import '../../../chunk-JOFVLOFY.js';
@@ -96,6 +96,33 @@ export interface DiscoverySpec {
96
96
  */
97
97
  readonly dialect?: string;
98
98
  }
99
+ /**
100
+ * The mirror of {@link admittedSpecs}: the specs a declaration did NOT admit.
101
+ *
102
+ * It exists because `runDiscovery`'s own docblock admits the gap it closes — *"a shorter result
103
+ * than expected means 'nothing qualified', and this function will not tell you which of those it
104
+ * was"*. After B-081 gates the four repo-root instruction files, a consumer who declares nothing
105
+ * goes from receiving four files to receiving none, and that has to be legible.
106
+ *
107
+ * Returned as a VALUE rather than only logged, because a log line cannot be asserted by a
108
+ * consumer's test, and this repository does not ship controls that cannot be observed. The loud
109
+ * half is the `warnOnce` the caller emits from this list.
110
+ *
111
+ * Each entry carries the grant that WOULD admit it — being told you lost something, without being
112
+ * told what would bring it back, is a diagnosis with no remedy.
113
+ *
114
+ * `undefined` declaredKinds means "no gate configured", which admits everything and therefore
115
+ * withholds nothing. That is NOT the same as `[]`, which is a real declaration of no foreign
116
+ * dialect and withholds every gated spec — the distinction `declaredCompatKinds` already carries,
117
+ * preserved here rather than re-decided.
118
+ *
119
+ * @public — re-exported from `@theokit/sdk/context`, and therefore under semver.
120
+ */
121
+ export declare function withheldSpecs(specs: ReadonlyArray<DiscoverySpec>, declaredKinds: ReadonlyArray<string> | undefined): ReadonlyArray<{
122
+ readonly id: string;
123
+ readonly pattern: string;
124
+ readonly grant: string;
125
+ }>;
99
126
  /**
100
127
  * The context files theokit looks for out of the box, in the order they are concatenated.
101
128
  *
@@ -30,6 +30,31 @@ export interface CompactResult {
30
30
  }
31
31
  /** Is this message a summary produced by a PRIOR compaction? (filtered from verbatim preservation). */
32
32
  export declare function isCompactSummary(content: string): boolean;
33
+ /**
34
+ * What a pre-compaction handler is told, and what it is given to bail out with.
35
+ *
36
+ * `trigger` is READ from the compaction that is happening, never inferred from the call site: the
37
+ * inference would be right today and silently wrong the first time a third caller appears.
38
+ *
39
+ * @public
40
+ */
41
+ export interface PreCompactContext {
42
+ /** The messages about to be summarised — what the handler gets a last look at. */
43
+ readonly messages: readonly CompressibleMessage[];
44
+ /** `manual` when a person asked, `auto` when a usage threshold did. */
45
+ readonly trigger: "manual" | "auto";
46
+ /** Aborted when the bound fires, so a long handler can stop rather than be merely ignored. */
47
+ readonly signal: AbortSignal;
48
+ }
49
+ /** @public */
50
+ export type PreCompactHandler = (ctx: PreCompactContext) => void | Promise<void>;
51
+ /**
52
+ * The bound, in milliseconds, when the caller does not choose one.
53
+ *
54
+ * Same value as `@theokit/agents`' `withPreCompaction`, because B-082's requirement is the same
55
+ * contract as B-002 and not a second one.
56
+ */
57
+ export declare const DEFAULT_PRE_COMPACT_TIMEOUT_MS = 30000;
33
58
  /**
34
59
  * Compact one session transcript: summarize the reconstructed history, then append (append-only)
35
60
  * a `compact_boundary` + the replacement chain (recent user messages verbatim + marker'd summary).
@@ -42,6 +67,17 @@ export declare function compactSessionTranscript(opts: {
42
67
  sessionId: string;
43
68
  trigger: "manual" | "auto";
44
69
  summarize: (messages: readonly CompressibleMessage[]) => Promise<string>;
70
+ /**
71
+ * Work to run before the transcript is rewritten, on the path the caller actually took.
72
+ *
73
+ * Absent, nothing is entered and the path is byte-identical to before B-082 — asserted by a test
74
+ * rather than left as an inference.
75
+ */
76
+ onPreCompact?: PreCompactHandler;
77
+ /** Where a handler's failure or timeout is reported. Compaction proceeds either way. */
78
+ onPreCompactError?: (error: unknown) => void;
79
+ /** Overrides {@link DEFAULT_PRE_COMPACT_TIMEOUT_MS}. */
80
+ preCompactTimeoutMs?: number;
45
81
  }): Promise<CompactResult>;
46
82
  /**
47
83
  * M50 review F6 (fixed by the probe) — the summarizer's provider route, PURE and unit-tested.
package/dist/project.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkLD6HASA5_cjs = require('./chunk-LD6HASA5.cjs');
3
+ var chunk7KBNBPFK_cjs = require('./chunk-7KBNBPFK.cjs');
4
4
  var chunkJLRLCBJ4_cjs = require('./chunk-JLRLCBJ4.cjs');
5
5
  var chunkJ7J7J2GN_cjs = require('./chunk-J7J7J2GN.cjs');
6
6
  require('./chunk-6LHQPOMI.cjs');
@@ -11,7 +11,7 @@ var DEFAULT_FILENAME = "THEO.md";
11
11
  async function readProjectInstructions(cwd, options) {
12
12
  const filename = options?.filename ?? DEFAULT_FILENAME;
13
13
  const scope = options?.scope ?? "nearest";
14
- const paths = chunkLD6HASA5_cjs.walkUpForFile(cwd, filename, options?.stopDir);
14
+ const paths = chunk7KBNBPFK_cjs.walkUpForFile(cwd, filename, options?.stopDir);
15
15
  const files = [];
16
16
  for (const path of paths) {
17
17
  try {
@@ -30,7 +30,7 @@ function reduceContent(files, scope) {
30
30
  }
31
31
  async function writeProjectInstructions(cwd, content, options) {
32
32
  const filename = options?.filename ?? DEFAULT_FILENAME;
33
- if (!chunkLD6HASA5_cjs.isSafePattern(filename)) {
33
+ if (!chunk7KBNBPFK_cjs.isSafePattern(filename)) {
34
34
  throw new chunkJ7J7J2GN_cjs.ConfigurationError(
35
35
  `writeProjectInstructions: unsafe filename ${JSON.stringify(filename)} (no path traversal, separators, or absolute paths)`,
36
36
  { code: "unsafe_filename" }
package/dist/project.js CHANGED
@@ -1,4 +1,4 @@
1
- import { walkUpForFile, isSafePattern } from './chunk-5NELQ6LB.js';
1
+ import { walkUpForFile, isSafePattern } from './chunk-A6PDYH55.js';
2
2
  import { replaceFileAtomic } from './chunk-3JHIFQ4I.js';
3
3
  import { ConfigurationError } from './chunk-ALUN2B4W.js';
4
4
  import './chunk-CZJ6Q7CW.js';
@@ -1,4 +1,4 @@
1
- import { a as AgentDefinition } from './agent-82d_DrCL.cjs';
1
+ import { a as AgentDefinition } from './agent-Dya5SmhY.cjs';
2
2
  import './sdk-agent-BOiKqOgL.cjs';
3
3
  import './run-CTAdRU3U.cjs';
4
4
  import 'zod';
@@ -1,4 +1,4 @@
1
- import { a as AgentDefinition } from './agent-G6g-uwcB.js';
1
+ import { a as AgentDefinition } from './agent-Bqzdhkqr.js';
2
2
  import './sdk-agent-D4a_BR_6.js';
3
3
  import './run-CTAdRU3U.js';
4
4
  import 'zod';
@@ -31,7 +31,7 @@ export type SettingSource = "project" | "user" | "team" | "mdm" | "plugins" | "a
31
31
  *
32
32
  * @public
33
33
  */
34
- export type CompatSource = "claude-code" | "theokit" | CompatSourceAdapter;
34
+ export type CompatSource = "claude-code" | "theokit" | "agents" | "gemini" | "cursor" | CompatSourceAdapter;
35
35
  /**
36
36
  * A surface a foreign configuration source may be admitted to.
37
37
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theokit/sdk",
3
- "version": "5.6.0",
3
+ "version": "5.7.0",
4
4
  "description": "TypeScript SDK for the Theo agent harness — same surface, local or cloud.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/usetheokit/theokit-sdk#readme",