@theokit/sdk 4.31.1 → 4.32.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 (75) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{agent-CbZPGFfM.d.cts → agent-DGv1-d81.d.cts} +51 -1
  3. package/dist/{agent-BKNJIOEY.cjs → agent-ES57DGAT.cjs} +8 -8
  4. package/dist/{agent-BKNJIOEY.cjs.map → agent-ES57DGAT.cjs.map} +1 -1
  5. package/dist/{agent-HW7OY2W3.js → agent-FBFPSBTX.js} +7 -7
  6. package/dist/{agent-HW7OY2W3.js.map → agent-FBFPSBTX.js.map} +1 -1
  7. package/dist/{agent-BJbGi8-R.d.ts → agent-SmxntivO.d.ts} +51 -1
  8. package/dist/{chunk-SJLOIZ4Z.js → chunk-334WDVFZ.js} +4 -4
  9. package/dist/{chunk-SJLOIZ4Z.js.map → chunk-334WDVFZ.js.map} +1 -1
  10. package/dist/{chunk-NZCFLEHO.cjs → chunk-CVSNCUBU.cjs} +7 -7
  11. package/dist/{chunk-NZCFLEHO.cjs.map → chunk-CVSNCUBU.cjs.map} +1 -1
  12. package/dist/{chunk-U2FO3MRG.cjs → chunk-DQSILMWU.cjs} +2 -2
  13. package/dist/chunk-DQSILMWU.cjs.map +1 -0
  14. package/dist/{chunk-RPKTXBPK.js → chunk-EIPSZ4GA.js} +3 -3
  15. package/dist/{chunk-RPKTXBPK.js.map → chunk-EIPSZ4GA.js.map} +1 -1
  16. package/dist/{chunk-WYPHQ7NM.js → chunk-HBTEK5LK.js} +3 -3
  17. package/dist/{chunk-WYPHQ7NM.js.map → chunk-HBTEK5LK.js.map} +1 -1
  18. package/dist/{chunk-IOOSAZZH.cjs → chunk-HCXDDR6P.cjs} +5 -5
  19. package/dist/{chunk-IOOSAZZH.cjs.map → chunk-HCXDDR6P.cjs.map} +1 -1
  20. package/dist/{chunk-E2YEDATX.cjs → chunk-I4QDIQ45.cjs} +6 -6
  21. package/dist/{chunk-E2YEDATX.cjs.map → chunk-I4QDIQ45.cjs.map} +1 -1
  22. package/dist/{chunk-S6F3FKFR.cjs → chunk-JPG7NMNH.cjs} +53 -43
  23. package/dist/chunk-JPG7NMNH.cjs.map +1 -0
  24. package/dist/{chunk-CCRWSZ2F.js → chunk-NI4PAMJQ.js} +23 -13
  25. package/dist/chunk-NI4PAMJQ.js.map +1 -0
  26. package/dist/{chunk-GQBXBHZ2.cjs → chunk-OQX2DG36.cjs} +5 -5
  27. package/dist/{chunk-GQBXBHZ2.cjs.map → chunk-OQX2DG36.cjs.map} +1 -1
  28. package/dist/{chunk-XDNGF5BY.js → chunk-SQVQH4EK.js} +3 -3
  29. package/dist/{chunk-XDNGF5BY.js.map → chunk-SQVQH4EK.js.map} +1 -1
  30. package/dist/{chunk-VGUOUAM2.js → chunk-WPBTPSKQ.js} +2 -2
  31. package/dist/chunk-WPBTPSKQ.js.map +1 -0
  32. package/dist/{compact-session-42BK7RE3.cjs → compact-session-OKXLKJIS.cjs} +12 -12
  33. package/dist/{compact-session-42BK7RE3.cjs.map → compact-session-OKXLKJIS.cjs.map} +1 -1
  34. package/dist/{compact-session-QMBOCFVQ.js → compact-session-UHGMWPMW.js} +4 -4
  35. package/dist/{compact-session-QMBOCFVQ.js.map → compact-session-UHGMWPMW.js.map} +1 -1
  36. package/dist/{cron-BwojPwEs.d.cts → cron-BiK_aNJI.d.cts} +1 -1
  37. package/dist/{cron-BU9qD5B6.d.ts → cron-Dx7B-3WB.d.ts} +1 -1
  38. package/dist/cron.cjs +7 -7
  39. package/dist/cron.d.cts +2 -2
  40. package/dist/cron.d.ts +2 -2
  41. package/dist/cron.js +6 -6
  42. package/dist/eval.cjs +6 -6
  43. package/dist/eval.js +5 -5
  44. package/dist/fs-session-store-2J5JOXC2.js +8 -0
  45. package/dist/{fs-session-store-T7YPW5A4.js.map → fs-session-store-2J5JOXC2.js.map} +1 -1
  46. package/dist/fs-session-store-DNAJ6RQG.cjs +17 -0
  47. package/dist/{fs-session-store-IIP7ZBYE.cjs.map → fs-session-store-DNAJ6RQG.cjs.map} +1 -1
  48. package/dist/index.cjs +49 -29
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.cts +19 -4
  51. package/dist/index.d.ts +19 -4
  52. package/dist/index.js +29 -9
  53. package/dist/index.js.map +1 -1
  54. package/dist/{inject-session-6ZMCA2NE.cjs → inject-session-24FJ65LP.cjs} +6 -6
  55. package/dist/{inject-session-6ZMCA2NE.cjs.map → inject-session-24FJ65LP.cjs.map} +1 -1
  56. package/dist/{inject-session-YA3GQE4G.js → inject-session-JXQO33T3.js} +4 -4
  57. package/dist/{inject-session-YA3GQE4G.js.map → inject-session-JXQO33T3.js.map} +1 -1
  58. package/dist/persistence.cjs +4 -4
  59. package/dist/persistence.d.cts +1 -0
  60. package/dist/persistence.d.ts +1 -0
  61. package/dist/persistence.js +1 -1
  62. package/dist/{session-transcript-T4SB66I7.cjs → session-transcript-F5OXXO6G.cjs} +13 -13
  63. package/dist/{session-transcript-T4SB66I7.cjs.map → session-transcript-F5OXXO6G.cjs.map} +1 -1
  64. package/dist/{session-transcript-5VZUWEJ5.js → session-transcript-QS6CXHHD.js} +3 -3
  65. package/dist/{session-transcript-5VZUWEJ5.js.map → session-transcript-QS6CXHHD.js.map} +1 -1
  66. package/dist/subagents-loader.d.cts +1 -1
  67. package/dist/subagents-loader.d.ts +1 -1
  68. package/dist/types/session-record.d.ts +51 -1
  69. package/package.json +1 -1
  70. package/dist/chunk-CCRWSZ2F.js.map +0 -1
  71. package/dist/chunk-S6F3FKFR.cjs.map +0 -1
  72. package/dist/chunk-U2FO3MRG.cjs.map +0 -1
  73. package/dist/chunk-VGUOUAM2.js.map +0 -1
  74. package/dist/fs-session-store-IIP7ZBYE.cjs +0 -17
  75. package/dist/fs-session-store-T7YPW5A4.js +0 -8
@@ -1,16 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunkE2YEDATX_cjs = require('./chunk-E2YEDATX.cjs');
3
+ var chunkI4QDIQ45_cjs = require('./chunk-I4QDIQ45.cjs');
4
4
  var chunkIT3PWBW4_cjs = require('./chunk-IT3PWBW4.cjs');
5
- var chunkU2FO3MRG_cjs = require('./chunk-U2FO3MRG.cjs');
5
+ var chunkDQSILMWU_cjs = require('./chunk-DQSILMWU.cjs');
6
6
  require('./chunk-TIZ4TS5V.cjs');
7
7
  require('./chunk-BEURCLDV.cjs');
8
8
 
9
9
  // src/internal/session/inject-session.ts
10
10
  async function injectSessionTurn(opts) {
11
- await chunkE2YEDATX_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
11
+ await chunkI4QDIQ45_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
12
12
  const prior = await opts.store.readRecords(opts.loc.agentId);
13
- const transcript = chunkU2FO3MRG_cjs.SessionTranscript.fromRecords(prior, {
13
+ const transcript = chunkDQSILMWU_cjs.SessionTranscript.fromRecords(prior, {
14
14
  cwd: opts.loc.cwd,
15
15
  sessionId: opts.sessionId,
16
16
  model: opts.loc.model ?? "unknown"
@@ -23,5 +23,5 @@ async function injectSessionTurn(opts) {
23
23
  }
24
24
 
25
25
  exports.injectSessionTurn = injectSessionTurn;
26
- //# sourceMappingURL=inject-session-6ZMCA2NE.cjs.map
27
- //# sourceMappingURL=inject-session-6ZMCA2NE.cjs.map
26
+ //# sourceMappingURL=inject-session-24FJ65LP.cjs.map
27
+ //# sourceMappingURL=inject-session-24FJ65LP.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-6ZMCA2NE.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-24FJ65LP.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,6 +1,6 @@
1
- import { enqueueSessionWrite } from './chunk-SJLOIZ4Z.js';
1
+ import { enqueueSessionWrite } from './chunk-334WDVFZ.js';
2
2
  import { invalidateSessionCache } from './chunk-EEZ7CFMM.js';
3
- import { SessionTranscript } from './chunk-VGUOUAM2.js';
3
+ import { SessionTranscript } from './chunk-WPBTPSKQ.js';
4
4
  import './chunk-S2BBRVQX.js';
5
5
  import './chunk-JTFYYKDT.js';
6
6
 
@@ -21,5 +21,5 @@ async function injectSessionTurn(opts) {
21
21
  }
22
22
 
23
23
  export { injectSessionTurn };
24
- //# sourceMappingURL=inject-session-YA3GQE4G.js.map
25
- //# sourceMappingURL=inject-session-YA3GQE4G.js.map
24
+ //# sourceMappingURL=inject-session-JXQO33T3.js.map
25
+ //# sourceMappingURL=inject-session-JXQO33T3.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-YA3GQE4G.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-JXQO33T3.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"]}
@@ -4,7 +4,7 @@ var chunkPNVDQL5Y_cjs = require('./chunk-PNVDQL5Y.cjs');
4
4
  var chunkCJVMDRQB_cjs = require('./chunk-CJVMDRQB.cjs');
5
5
  var chunkJD74LN7R_cjs = require('./chunk-JD74LN7R.cjs');
6
6
  var chunkYLQQX5W2_cjs = require('./chunk-YLQQX5W2.cjs');
7
- var chunkU2FO3MRG_cjs = require('./chunk-U2FO3MRG.cjs');
7
+ var chunkDQSILMWU_cjs = require('./chunk-DQSILMWU.cjs');
8
8
  var chunkTIZ4TS5V_cjs = require('./chunk-TIZ4TS5V.cjs');
9
9
  var chunkA44COQJJ_cjs = require('./chunk-A44COQJJ.cjs');
10
10
  require('./chunk-BEURCLDV.cjs');
@@ -155,15 +155,15 @@ Object.defineProperty(exports, "withCwdMutex", {
155
155
  });
156
156
  Object.defineProperty(exports, "encodeProjectDir", {
157
157
  enumerable: true,
158
- get: function () { return chunkU2FO3MRG_cjs.encodeProjectDir; }
158
+ get: function () { return chunkDQSILMWU_cjs.encodeProjectDir; }
159
159
  });
160
160
  Object.defineProperty(exports, "transcriptPath", {
161
161
  enumerable: true,
162
- get: function () { return chunkU2FO3MRG_cjs.transcriptPath; }
162
+ get: function () { return chunkDQSILMWU_cjs.transcriptPath; }
163
163
  });
164
164
  Object.defineProperty(exports, "transcriptRoot", {
165
165
  enumerable: true,
166
- get: function () { return chunkU2FO3MRG_cjs.transcriptRoot; }
166
+ get: function () { return chunkDQSILMWU_cjs.transcriptRoot; }
167
167
  });
168
168
  Object.defineProperty(exports, "atomicWriteJson", {
169
169
  enumerable: true,
@@ -22,6 +22,7 @@ export { sanitizeFts5Query } from "./internal/persistence/fts5-sanitize.js";
22
22
  export { appendJsonl, JsonlParseError, loadJsonl, readJsonlIds, } from "./internal/persistence/jsonl.js";
23
23
  export { PersistenceSchema } from "./internal/persistence/persistence-schema.js";
24
24
  export { encodeProjectDir, transcriptPath, transcriptRoot, } from "./internal/persistence/session-transcript.js";
25
+ export type { TranscriptBlock, TranscriptMessage } from "./types/session-record.js";
25
26
  export { acquireSessionWriter, SessionBusyError, type SessionWriterLease, } from "./internal/persistence/session-writer.js";
26
27
  export type { OpenSqliteResilientOptions, ResilientSqliteDb, } from "./internal/persistence/sqlite-open.js";
27
28
  export { isCorruptionError, openSqliteResilient } from "./internal/persistence/sqlite-open.js";
@@ -22,6 +22,7 @@ export { sanitizeFts5Query } from "./internal/persistence/fts5-sanitize.js";
22
22
  export { appendJsonl, JsonlParseError, loadJsonl, readJsonlIds, } from "./internal/persistence/jsonl.js";
23
23
  export { PersistenceSchema } from "./internal/persistence/persistence-schema.js";
24
24
  export { encodeProjectDir, transcriptPath, transcriptRoot, } from "./internal/persistence/session-transcript.js";
25
+ export type { TranscriptBlock, TranscriptMessage } from "./types/session-record.js";
25
26
  export { acquireSessionWriter, SessionBusyError, type SessionWriterLease, } from "./internal/persistence/session-writer.js";
26
27
  export type { OpenSqliteResilientOptions, ResilientSqliteDb, } from "./internal/persistence/sqlite-open.js";
27
28
  export { isCorruptionError, openSqliteResilient } from "./internal/persistence/sqlite-open.js";
@@ -2,7 +2,7 @@ export { PersistenceSchema } from './chunk-CAH3G4IS.js';
2
2
  export { JsonlParseError, appendJsonl, loadJsonl, readJsonlIds, withFileLock } from './chunk-UAYYNWYJ.js';
3
3
  export { applyWalWithFallback, isCorruptionError, openSqliteResilient, sanitizeFts5Query } from './chunk-77FOZCOT.js';
4
4
  export { withCwdMutex } from './chunk-2XLKLVVR.js';
5
- export { encodeProjectDir, transcriptPath, transcriptRoot } from './chunk-VGUOUAM2.js';
5
+ export { encodeProjectDir, transcriptPath, transcriptRoot } from './chunk-WPBTPSKQ.js';
6
6
  export { atomicWriteJson, atomicWriteText, replaceFileAtomic } from './chunk-S2BBRVQX.js';
7
7
  import { TheokitAgentError } from './chunk-WLKFWQSJ.js';
8
8
  import './chunk-JTFYYKDT.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkU2FO3MRG_cjs = require('./chunk-U2FO3MRG.cjs');
3
+ var chunkDQSILMWU_cjs = require('./chunk-DQSILMWU.cjs');
4
4
  require('./chunk-TIZ4TS5V.cjs');
5
5
  require('./chunk-BEURCLDV.cjs');
6
6
 
@@ -8,43 +8,43 @@ require('./chunk-BEURCLDV.cjs');
8
8
 
9
9
  Object.defineProperty(exports, "SessionTranscript", {
10
10
  enumerable: true,
11
- get: function () { return chunkU2FO3MRG_cjs.SessionTranscript; }
11
+ get: function () { return chunkDQSILMWU_cjs.SessionTranscript; }
12
12
  });
13
13
  Object.defineProperty(exports, "defaultBaseDir", {
14
14
  enumerable: true,
15
- get: function () { return chunkU2FO3MRG_cjs.defaultBaseDir; }
15
+ get: function () { return chunkDQSILMWU_cjs.defaultBaseDir; }
16
16
  });
17
17
  Object.defineProperty(exports, "encodeProjectDir", {
18
18
  enumerable: true,
19
- get: function () { return chunkU2FO3MRG_cjs.encodeProjectDir; }
19
+ get: function () { return chunkDQSILMWU_cjs.encodeProjectDir; }
20
20
  });
21
21
  Object.defineProperty(exports, "expandTilde", {
22
22
  enumerable: true,
23
- get: function () { return chunkU2FO3MRG_cjs.expandTilde; }
23
+ get: function () { return chunkDQSILMWU_cjs.expandTilde; }
24
24
  });
25
25
  Object.defineProperty(exports, "readTranscript", {
26
26
  enumerable: true,
27
- get: function () { return chunkU2FO3MRG_cjs.readTranscript; }
27
+ get: function () { return chunkDQSILMWU_cjs.readTranscript; }
28
28
  });
29
29
  Object.defineProperty(exports, "reconstructMessages", {
30
30
  enumerable: true,
31
- get: function () { return chunkU2FO3MRG_cjs.reconstructMessages; }
31
+ get: function () { return chunkDQSILMWU_cjs.reconstructMessages; }
32
32
  });
33
33
  Object.defineProperty(exports, "safeSessionId", {
34
34
  enumerable: true,
35
- get: function () { return chunkU2FO3MRG_cjs.safeSessionId; }
35
+ get: function () { return chunkDQSILMWU_cjs.safeSessionId; }
36
36
  });
37
37
  Object.defineProperty(exports, "transcriptPath", {
38
38
  enumerable: true,
39
- get: function () { return chunkU2FO3MRG_cjs.transcriptPath; }
39
+ get: function () { return chunkDQSILMWU_cjs.transcriptPath; }
40
40
  });
41
41
  Object.defineProperty(exports, "transcriptRoot", {
42
42
  enumerable: true,
43
- get: function () { return chunkU2FO3MRG_cjs.transcriptRoot; }
43
+ get: function () { return chunkDQSILMWU_cjs.transcriptRoot; }
44
44
  });
45
45
  Object.defineProperty(exports, "writeTranscript", {
46
46
  enumerable: true,
47
- get: function () { return chunkU2FO3MRG_cjs.writeTranscript; }
47
+ get: function () { return chunkDQSILMWU_cjs.writeTranscript; }
48
48
  });
49
- //# sourceMappingURL=session-transcript-T4SB66I7.cjs.map
50
- //# sourceMappingURL=session-transcript-T4SB66I7.cjs.map
49
+ //# sourceMappingURL=session-transcript-F5OXXO6G.cjs.map
50
+ //# sourceMappingURL=session-transcript-F5OXXO6G.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"session-transcript-T4SB66I7.cjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"session-transcript-F5OXXO6G.cjs"}
@@ -1,5 +1,5 @@
1
- export { SessionTranscript, defaultBaseDir, encodeProjectDir, expandTilde, readTranscript, reconstructMessages, safeSessionId, transcriptPath, transcriptRoot, writeTranscript } from './chunk-VGUOUAM2.js';
1
+ export { SessionTranscript, defaultBaseDir, encodeProjectDir, expandTilde, readTranscript, reconstructMessages, safeSessionId, transcriptPath, transcriptRoot, writeTranscript } from './chunk-WPBTPSKQ.js';
2
2
  import './chunk-S2BBRVQX.js';
3
3
  import './chunk-JTFYYKDT.js';
4
- //# sourceMappingURL=session-transcript-5VZUWEJ5.js.map
5
- //# sourceMappingURL=session-transcript-5VZUWEJ5.js.map
4
+ //# sourceMappingURL=session-transcript-QS6CXHHD.js.map
5
+ //# sourceMappingURL=session-transcript-QS6CXHHD.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"session-transcript-5VZUWEJ5.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"session-transcript-QS6CXHHD.js"}
@@ -1,4 +1,4 @@
1
- import { a as AgentDefinition } from './agent-CbZPGFfM.cjs';
1
+ import { a as AgentDefinition } from './agent-DGv1-d81.cjs';
2
2
  import './run-CwEJtLPE.cjs';
3
3
  import 'zod';
4
4
 
@@ -1,4 +1,4 @@
1
- import { a as AgentDefinition } from './agent-BJbGi8-R.js';
1
+ import { a as AgentDefinition } from './agent-SmxntivO.js';
2
2
  import './run-CwEJtLPE.js';
3
3
  import 'zod';
4
4
 
@@ -13,6 +13,49 @@
13
13
  * @public
14
14
  */
15
15
  /** One transcript record (one JSONL line). `message` absent on `system` (compact_boundary) records. */
16
+ /** Um bloco de conteúdo dentro de {@link TranscriptMessage}. */
17
+ export type TranscriptBlock = {
18
+ type: "text";
19
+ text: string;
20
+ } | {
21
+ type: "thinking";
22
+ thinking?: string;
23
+ signature?: string;
24
+ } | {
25
+ type: "tool_use";
26
+ id: string;
27
+ name: string;
28
+ input: unknown;
29
+ } | {
30
+ type: "tool_result";
31
+ tool_use_id: string;
32
+ content: unknown;
33
+ is_error?: boolean;
34
+ };
35
+ /**
36
+ * O corpo de mensagem de um {@link SessionRecord}.
37
+ *
38
+ * **NÃO se chama `SessionMessage`** — esse nome já existe em `internal/session/session-types.ts` com
39
+ * a forma `{role, text}`, incompatível com esta. Repropor um nome exportado com forma nova é
40
+ * precisamente a quebra silenciosa que o M91 custou dois patches para desfazer.
41
+ *
42
+ * O parse do disco continua **tolerante** (`readTranscript` pula linha malformada): o que muda aqui
43
+ * é o **tipo**, não a leniência — registros gravados por versões anteriores continuam legíveis.
44
+ *
45
+ * @public
46
+ */
47
+ export interface TranscriptMessage {
48
+ role: "user" | "assistant";
49
+ content: TranscriptBlock[];
50
+ /**
51
+ * Os três campos abaixo aparecem **só** no registro de assistant, e vêm do escritor
52
+ * (`SessionTranscript.appendAssistant`). Declarados opcionais porque o registro de user não os
53
+ * tem — medido no próprio escritor, não presumido.
54
+ */
55
+ id?: string;
56
+ type?: "message";
57
+ model?: string;
58
+ }
16
59
  export interface SessionRecord {
17
60
  type: "user" | "assistant" | "system";
18
61
  uuid: string;
@@ -28,5 +71,12 @@ export interface SessionRecord {
28
71
  preTokens: number;
29
72
  trigger: string;
30
73
  };
31
- message?: Record<string, unknown>;
74
+ /**
75
+ * O corpo da mensagem, na forma que o escritor de transcript de fato grava.
76
+ *
77
+ * M94 — era `Record<string, unknown>`, e o consumidor recuperava o tipo com cast a cada leitura.
78
+ * A forma **sempre foi fixa** (`SessionTranscript.appendToolResults` / `#push` a produzem); só não
79
+ * estava declarada. Segue opcional porque registros de sistema não carregam mensagem.
80
+ */
81
+ message?: TranscriptMessage;
32
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theokit/sdk",
3
- "version": "4.31.1",
3
+ "version": "4.32.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/usetheodev/theokit-sdk#readme",