botmux 3.11.0 → 3.12.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 (165) hide show
  1. package/dist/.runtime-build-id +1 -1
  2. package/dist/adapters/backend/riff-backend.d.ts.map +1 -1
  3. package/dist/adapters/backend/riff-backend.js +11 -2
  4. package/dist/adapters/backend/riff-backend.js.map +1 -1
  5. package/dist/adapters/cli/coco.js +3 -3
  6. package/dist/adapters/cli/coco.js.map +1 -1
  7. package/dist/adapters/cli/codex.js +2 -2
  8. package/dist/adapters/cli/codex.js.map +1 -1
  9. package/dist/cli/dashboard-command.d.ts +23 -0
  10. package/dist/cli/dashboard-command.d.ts.map +1 -0
  11. package/dist/cli/dashboard-command.js +61 -0
  12. package/dist/cli/dashboard-command.js.map +1 -0
  13. package/dist/cli/dashboard-endpoint.d.ts +3 -3
  14. package/dist/cli/dashboard-endpoint.d.ts.map +1 -1
  15. package/dist/cli/dashboard-endpoint.js +1 -1
  16. package/dist/cli.d.ts.map +1 -1
  17. package/dist/cli.js +36 -22
  18. package/dist/cli.js.map +1 -1
  19. package/dist/codex-rpc-engine.d.ts +33 -3
  20. package/dist/codex-rpc-engine.d.ts.map +1 -1
  21. package/dist/codex-rpc-engine.js +182 -20
  22. package/dist/codex-rpc-engine.js.map +1 -1
  23. package/dist/codex-rpc-lifecycle.d.ts +42 -7
  24. package/dist/codex-rpc-lifecycle.d.ts.map +1 -1
  25. package/dist/codex-rpc-lifecycle.js +73 -7
  26. package/dist/codex-rpc-lifecycle.js.map +1 -1
  27. package/dist/config.d.ts +1 -1
  28. package/dist/config.js +1 -1
  29. package/dist/core/command-handler.d.ts +3 -2
  30. package/dist/core/command-handler.d.ts.map +1 -1
  31. package/dist/core/command-handler.js +3 -2
  32. package/dist/core/command-handler.js.map +1 -1
  33. package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
  34. package/dist/core/dashboard-ipc-server.js +15 -10
  35. package/dist/core/dashboard-ipc-server.js.map +1 -1
  36. package/dist/core/dispatch.d.ts +9 -10
  37. package/dist/core/dispatch.d.ts.map +1 -1
  38. package/dist/core/dispatch.js +17 -10
  39. package/dist/core/dispatch.js.map +1 -1
  40. package/dist/core/role-resolver.d.ts +5 -2
  41. package/dist/core/role-resolver.d.ts.map +1 -1
  42. package/dist/core/role-resolver.js +55 -23
  43. package/dist/core/role-resolver.js.map +1 -1
  44. package/dist/core/session-manager.d.ts +2 -0
  45. package/dist/core/session-manager.d.ts.map +1 -1
  46. package/dist/core/session-manager.js +20 -18
  47. package/dist/core/session-manager.js.map +1 -1
  48. package/dist/core/terminal-write-auth.d.ts +4 -4
  49. package/dist/core/terminal-write-auth.d.ts.map +1 -1
  50. package/dist/core/terminal-write-auth.js +18 -6
  51. package/dist/core/terminal-write-auth.js.map +1 -1
  52. package/dist/daemon.d.ts +1 -0
  53. package/dist/daemon.d.ts.map +1 -1
  54. package/dist/daemon.js +101 -12
  55. package/dist/daemon.js.map +1 -1
  56. package/dist/dashboard/auth.d.ts +21 -11
  57. package/dist/dashboard/auth.d.ts.map +1 -1
  58. package/dist/dashboard/auth.js +39 -25
  59. package/dist/dashboard/auth.js.map +1 -1
  60. package/dist/dashboard/bot-payload.d.ts +0 -1
  61. package/dist/dashboard/bot-payload.d.ts.map +1 -1
  62. package/dist/dashboard/bot-payload.js +0 -1
  63. package/dist/dashboard/bot-payload.js.map +1 -1
  64. package/dist/dashboard/dashboard-summary-endpoint.d.ts +39 -0
  65. package/dist/dashboard/dashboard-summary-endpoint.d.ts.map +1 -0
  66. package/dist/dashboard/dashboard-summary-endpoint.js +50 -0
  67. package/dist/dashboard/dashboard-summary-endpoint.js.map +1 -0
  68. package/dist/dashboard/dashboard-summary.d.ts +62 -0
  69. package/dist/dashboard/dashboard-summary.d.ts.map +1 -0
  70. package/dist/dashboard/dashboard-summary.js +106 -0
  71. package/dist/dashboard/dashboard-summary.js.map +1 -0
  72. package/dist/dashboard/web/feed-group-picker.d.ts +13 -0
  73. package/dist/dashboard/web/feed-group-picker.d.ts.map +1 -0
  74. package/dist/dashboard/web/feed-group-picker.js +45 -0
  75. package/dist/dashboard/web/feed-group-picker.js.map +1 -0
  76. package/dist/dashboard/web/groups-page.d.ts.map +1 -1
  77. package/dist/dashboard/web/groups-page.js +2 -5
  78. package/dist/dashboard/web/groups-page.js.map +1 -1
  79. package/dist/dashboard/web/i18n.d.ts.map +1 -1
  80. package/dist/dashboard/web/i18n.js +8 -14
  81. package/dist/dashboard/web/i18n.js.map +1 -1
  82. package/dist/dashboard/web/roles-page.d.ts.map +1 -1
  83. package/dist/dashboard/web/roles-page.js +36 -4
  84. package/dist/dashboard/web/roles-page.js.map +1 -1
  85. package/dist/dashboard/web/roles.d.ts +3 -1
  86. package/dist/dashboard/web/roles.d.ts.map +1 -1
  87. package/dist/dashboard/web/roles.js +10 -2
  88. package/dist/dashboard/web/roles.js.map +1 -1
  89. package/dist/dashboard/web/schedules-page.d.ts.map +1 -1
  90. package/dist/dashboard/web/schedules-page.js +8 -2
  91. package/dist/dashboard/web/schedules-page.js.map +1 -1
  92. package/dist/dashboard/web/sessions-page.d.ts.map +1 -1
  93. package/dist/dashboard/web/sessions-page.js +2 -2
  94. package/dist/dashboard/web/sessions-page.js.map +1 -1
  95. package/dist/dashboard-web/app.js +1 -1
  96. package/dist/dashboard-web/chunks/{bot-defaults-page-GED4FEMS.js → bot-defaults-page-USC6EZXP.js} +1 -1
  97. package/dist/dashboard-web/chunks/chunk-6ALR252E.js +1 -0
  98. package/dist/dashboard-web/chunks/{chunk-VBXJOJFH.js → chunk-A7VC4BXR.js} +1 -1
  99. package/dist/dashboard-web/chunks/{chunk-HK7NIBJG.js → chunk-KOPISPHN.js} +1 -1
  100. package/dist/dashboard-web/chunks/{chunk-6J5LS5AU.js → chunk-M6BHWQFO.js} +6 -6
  101. package/dist/dashboard-web/chunks/{chunk-KRHWZEXU.js → chunk-RXRJB5SO.js} +1 -1
  102. package/dist/dashboard-web/chunks/{connectors-page-EELM66G3.js → connectors-page-4Z76HWRH.js} +1 -1
  103. package/dist/dashboard-web/chunks/groups-page-C6NSDTIN.js +8 -0
  104. package/dist/dashboard-web/chunks/{insights-page-54UBPPOC.js → insights-page-UTOVYLLY.js} +1 -1
  105. package/dist/dashboard-web/chunks/{monitor-room-PORHVKRH.js → monitor-room-UKTJYTA2.js} +1 -1
  106. package/dist/dashboard-web/chunks/{monitoring-page-XGA7AXNL.js → monitoring-page-Q3CEZIVX.js} +1 -1
  107. package/dist/dashboard-web/chunks/{office-page-AO3AFG45.js → office-page-GYCZOOVJ.js} +1 -1
  108. package/dist/dashboard-web/chunks/{overview-page-F5BUTYR6.js → overview-page-W2VBJ6OH.js} +1 -1
  109. package/dist/dashboard-web/chunks/roles-page-U4SHER4K.js +1 -0
  110. package/dist/dashboard-web/chunks/schedules-page-TNPW3N3Q.js +1 -0
  111. package/dist/dashboard-web/chunks/{sessions-page-YFRPSTIL.js → sessions-page-YWWDDV57.js} +3 -3
  112. package/dist/dashboard-web/chunks/{settings-page-OJAZLZQT.js → settings-page-VKW5ZK5K.js} +1 -1
  113. package/dist/dashboard-web/chunks/{skills-page-EFZQPWV4.js → skills-page-ZCEDFGZZ.js} +1 -1
  114. package/dist/dashboard-web/chunks/{team-federation-page-ZJVAP7HW.js → team-federation-page-OMFGGBT2.js} +1 -1
  115. package/dist/dashboard-web/chunks/{v3-page-GYWTRGO2.js → v3-page-PLXWK4KO.js} +1 -1
  116. package/dist/dashboard-web/chunks/{whiteboards-page-MSDAG6P7.js → whiteboards-page-NJQOEO2P.js} +1 -1
  117. package/dist/dashboard-web/style.css +112 -0
  118. package/dist/dashboard.js +116 -31
  119. package/dist/dashboard.js.map +1 -1
  120. package/dist/desktop/main/ipc.js +1 -1
  121. package/dist/desktop/main/runtime-service.js +2 -2
  122. package/dist/desktop/main/runtime-service.js.map +1 -1
  123. package/dist/desktop/shared/types.d.ts +1 -1
  124. package/dist/i18n/en.d.ts.map +1 -1
  125. package/dist/i18n/en.js +3 -1
  126. package/dist/i18n/en.js.map +1 -1
  127. package/dist/i18n/zh.d.ts.map +1 -1
  128. package/dist/i18n/zh.js +3 -1
  129. package/dist/i18n/zh.js.map +1 -1
  130. package/dist/services/adopt-input-sequence.d.ts +52 -0
  131. package/dist/services/adopt-input-sequence.d.ts.map +1 -0
  132. package/dist/services/adopt-input-sequence.js +50 -0
  133. package/dist/services/adopt-input-sequence.js.map +1 -0
  134. package/dist/services/bridge-fallback-gate.d.ts.map +1 -1
  135. package/dist/services/bridge-fallback-gate.js +34 -11
  136. package/dist/services/bridge-fallback-gate.js.map +1 -1
  137. package/dist/services/codex-bridge-queue.d.ts +103 -7
  138. package/dist/services/codex-bridge-queue.d.ts.map +1 -1
  139. package/dist/services/codex-bridge-queue.js +291 -17
  140. package/dist/services/codex-bridge-queue.js.map +1 -1
  141. package/dist/services/codex-transcript.d.ts +4 -3
  142. package/dist/services/codex-transcript.d.ts.map +1 -1
  143. package/dist/services/codex-transcript.js.map +1 -1
  144. package/dist/services/structured-bridge-clis.d.ts +8 -1
  145. package/dist/services/structured-bridge-clis.d.ts.map +1 -1
  146. package/dist/services/structured-bridge-clis.js +13 -0
  147. package/dist/services/structured-bridge-clis.js.map +1 -1
  148. package/dist/services/submit-confirmation.d.ts +50 -0
  149. package/dist/services/submit-confirmation.d.ts.map +1 -1
  150. package/dist/services/submit-confirmation.js +82 -0
  151. package/dist/services/submit-confirmation.js.map +1 -1
  152. package/dist/utils/async-serial-queue.d.ts +9 -0
  153. package/dist/utils/async-serial-queue.d.ts.map +1 -0
  154. package/dist/utils/async-serial-queue.js +13 -0
  155. package/dist/utils/async-serial-queue.js.map +1 -0
  156. package/dist/utils/runtime-screen-status.d.ts +52 -0
  157. package/dist/utils/runtime-screen-status.d.ts.map +1 -0
  158. package/dist/utils/runtime-screen-status.js +60 -0
  159. package/dist/utils/runtime-screen-status.js.map +1 -0
  160. package/dist/worker.js +1642 -452
  161. package/dist/worker.js.map +1 -1
  162. package/package.json +1 -1
  163. package/dist/dashboard-web/chunks/groups-page-WKUV6E42.js +0 -8
  164. package/dist/dashboard-web/chunks/roles-page-M5GIASJU.js +0 -1
  165. package/dist/dashboard-web/chunks/schedules-page-O232WQRR.js +0 -1
@@ -11,6 +11,13 @@ export declare const STRUCTURED_BRIDGE_ALWAYS_CLI_IDS: readonly ["codex", "traex
11
11
  * driver-table follow-up, not this convergence PR. Matches the historical
12
12
  * worker-pool allowlist. */
13
13
  export declare const STRUCTURED_BRIDGE_ADOPT_CLI_IDS: readonly ["codex", "traex", "coco", "mtr", "pi", "grok", "cursor"];
14
+ /** Drivers whose transcript contract exposes every terminal edge needed for a
15
+ * strong started-turn status gate. Codex has final_answer plus explicit
16
+ * turn_aborted parsing. Other structured drivers still
17
+ * use the queue for attribution, but their interrupted/error shapes are not
18
+ * yet complete enough to let a started turn suppress screen-ready forever. */
19
+ export declare const STRUCTURED_BRIDGE_LIFECYCLE_BLOCKING_CLI_IDS: readonly ["codex"];
20
+ export declare function isStructuredBridgeLifecycleBlockingCli(cliId: string | undefined): boolean;
14
21
  /** Worker `codexBridgeFallbackActive` — cursor only when adoptMode. */
15
22
  export declare function isStructuredBridgeFallbackActive(cliId: string | undefined, adoptMode?: boolean): boolean;
16
23
  /** Daemon adopt path — forward transcript bind fields. */
@@ -24,6 +31,6 @@ export declare function isStructuredBridgeAdoptCli(cliId: string | undefined): b
24
31
  export declare const STRUCTURED_BRIDGE_ADOPT_IDLE_CLI_IDS: readonly ["codex", "traex", "coco", "mtr", "pi", "grok"];
25
32
  export declare function isStructuredBridgeAdoptIdleCli(cliId: string | undefined): boolean;
26
33
  /** Adopt input adapter: needs writeInput for local pane typing. */
27
- export declare const STRUCTURED_BRIDGE_ADOPT_INPUT_CLI_IDS: readonly ["codex", "traex", "pi", "grok", "mtr"];
34
+ export declare const STRUCTURED_BRIDGE_ADOPT_INPUT_CLI_IDS: readonly ["codex", "traex", "coco", "pi", "grok", "mtr"];
28
35
  export declare function isStructuredBridgeAdoptInputCli(cliId: string | undefined): boolean;
29
36
  //# sourceMappingURL=structured-bridge-clis.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"structured-bridge-clis.d.ts","sourceRoot":"","sources":["../../src/services/structured-bridge-clis.ts"],"names":[],"mappings":"AAiBA,6EAA6E;AAC7E,eAAO,MAAM,gCAAgC,oEAQR,CAAC;AAEtC;;;;;;;;;6BAS6B;AAC7B,eAAO,MAAM,+BAA+B,oEAQP,CAAC;AAKtC,uEAAuE;AACvE,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,CAAC,EAAE,OAAO,GAClB,OAAO,CAKT;AAED,0DAA0D;AAC1D,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE7E;AAED;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,0DAOZ,CAAC;AAItC,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEjF;AAED,mEAAmE;AACnE,eAAO,MAAM,qCAAqC,kDAMb,CAAC;AAItC,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAElF"}
1
+ {"version":3,"file":"structured-bridge-clis.d.ts","sourceRoot":"","sources":["../../src/services/structured-bridge-clis.ts"],"names":[],"mappings":"AAiBA,6EAA6E;AAC7E,eAAO,MAAM,gCAAgC,oEAQR,CAAC;AAEtC;;;;;;;;;6BAS6B;AAC7B,eAAO,MAAM,+BAA+B,oEAQP,CAAC;AAKtC;;;;+EAI+E;AAC/E,eAAO,MAAM,4CAA4C,oBAEpB,CAAC;AAItC,wBAAgB,sCAAsC,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEzF;AAED,uEAAuE;AACvE,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,SAAS,CAAC,EAAE,OAAO,GAClB,OAAO,CAKT;AAED,0DAA0D;AAC1D,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE7E;AAED;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,0DAOZ,CAAC;AAItC,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEjF;AAED,mEAAmE;AACnE,eAAO,MAAM,qCAAqC,0DAOb,CAAC;AAItC,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAElF"}
@@ -29,6 +29,18 @@ export const STRUCTURED_BRIDGE_ADOPT_CLI_IDS = [
29
29
  ];
30
30
  const ALWAYS_SET = new Set(STRUCTURED_BRIDGE_ALWAYS_CLI_IDS);
31
31
  const ADOPT_SET = new Set(STRUCTURED_BRIDGE_ADOPT_CLI_IDS);
32
+ /** Drivers whose transcript contract exposes every terminal edge needed for a
33
+ * strong started-turn status gate. Codex has final_answer plus explicit
34
+ * turn_aborted parsing. Other structured drivers still
35
+ * use the queue for attribution, but their interrupted/error shapes are not
36
+ * yet complete enough to let a started turn suppress screen-ready forever. */
37
+ export const STRUCTURED_BRIDGE_LIFECYCLE_BLOCKING_CLI_IDS = [
38
+ 'codex',
39
+ ];
40
+ const LIFECYCLE_BLOCKING_SET = new Set(STRUCTURED_BRIDGE_LIFECYCLE_BLOCKING_CLI_IDS);
41
+ export function isStructuredBridgeLifecycleBlockingCli(cliId) {
42
+ return !!cliId && LIFECYCLE_BLOCKING_SET.has(cliId);
43
+ }
32
44
  /** Worker `codexBridgeFallbackActive` — cursor only when adoptMode. */
33
45
  export function isStructuredBridgeFallbackActive(cliId, adoptMode) {
34
46
  if (!cliId)
@@ -65,6 +77,7 @@ export function isStructuredBridgeAdoptIdleCli(cliId) {
65
77
  export const STRUCTURED_BRIDGE_ADOPT_INPUT_CLI_IDS = [
66
78
  'codex',
67
79
  'traex',
80
+ 'coco',
68
81
  'pi',
69
82
  'grok',
70
83
  'mtr',
@@ -1 +1 @@
1
- {"version":3,"file":"structured-bridge-clis.js","sourceRoot":"","sources":["../../src/services/structured-bridge-clis.ts"],"names":[],"mappings":"AAiBA,6EAA6E;AAC7E,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,OAAO;IACP,OAAO;IACP,MAAM;IACN,QAAQ;IACR,KAAK;IACL,IAAI;IACJ,MAAM;CAC6B,CAAC;AAEtC;;;;;;;;;6BAS6B;AAC7B,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,OAAO;IACP,OAAO;IACP,MAAM;IACN,KAAK;IACL,IAAI;IACJ,MAAM;IACN,QAAQ;CAC2B,CAAC;AAEtC,MAAM,UAAU,GAAwB,IAAI,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAClF,MAAM,SAAS,GAAwB,IAAI,GAAG,CAAC,+BAA+B,CAAC,CAAC;AAEhF,uEAAuE;AACvE,MAAM,UAAU,gCAAgC,CAC9C,KAAyB,EACzB,SAAmB;IAEnB,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,KAAK,IAAI,CAAC;IAClD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,0BAA0B,CAAC,KAAyB;IAClE,OAAO,CAAC,CAAC,KAAK,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG;IAClD,OAAO;IACP,OAAO;IACP,MAAM;IACN,KAAK;IACL,IAAI;IACJ,MAAM;CAC6B,CAAC;AAEtC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,oCAAoC,CAAC,CAAC;AAE1F,MAAM,UAAU,8BAA8B,CAAC,KAAyB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uE;AACvE,MAAM,UAAU,gCAAgC,CAC9C,KAAyB,EACzB,SAAmB;IAEnB,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,IAAI,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,KAAK,KAAK,QAAQ;QAAE,OAAO,SAAS,KAAK,IAAI,CAAC;IAClD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,0BAA0B,CAAC,KAAyB;IAClE,OAAO,CAAC,CAAC,KAAK,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG;IAClD,OAAO;IACP,OAAO;IACP,MAAM;IACN,KAAK;IACL,IAAI;IACJ,MAAM;CAC6B,CAAC;AAEtC,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,oCAAoC,CAAC,CAAC;AAE1F,MAAM,UAAU,8BAA8B,CAAC,KAAyB;IACtE,OAAO,CAAC,CAAC,KAAK,IAAI,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED,mEAAmE;AACnE,MAAM,CAAC,MAAM,qCAAqC,GAAG;IACnD,OAAO;IACP,OAAO;IACP,MAAM;IACN,IAAI;IACJ,MAAM;IACN,KAAK;CAC8B,CAAC;AAEtC,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,qCAAqC,CAAC,CAAC;AAE5F,MAAM,UAAU,+BAA+B,CAAC,KAAyB;IACvE,OAAO,CAAC,CAAC,KAAK,IAAI,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { SubmitRecheckResult } from '../adapters/cli/types.js';
1
2
  export type SubmitActivityEvidence = 'pty-output' | 'structured-transcript' | 'botmux-send';
2
3
  export type SubmitConfirmationAction = {
3
4
  kind: 'notify-hard-failure';
@@ -19,4 +20,53 @@ export interface SubmitConfirmationDecisionInput {
19
20
  activityEvidence?: SubmitActivityEvidence;
20
21
  }
21
22
  export declare function decideSubmitConfirmationAction(input: SubmitConfirmationDecisionInput): SubmitConfirmationAction;
23
+ export interface StructuredSubmitLifecycleController {
24
+ hasPendingTurn(turnId: string, dispatchAttempt?: number): boolean;
25
+ confirmPendingTurn(turnId: string, confirmedAtMs?: number, dispatchAttempt?: number): boolean;
26
+ finishSubmitVerification(turnId: string, finishedAtMs?: number, dispatchAttempt?: number): boolean;
27
+ }
28
+ export interface DeferredSubmitConfirmationInput {
29
+ turnId?: string;
30
+ dispatchAttempt?: number;
31
+ /** True only when turnId names a CodexBridgeQueue mark. Claude fallback
32
+ * turns use BridgeTurnQueue IDs, so treating every bridge ID as a
33
+ * structured target would incorrectly discard every Claude recheck. */
34
+ structuredTarget?: boolean;
35
+ recheck?: () => SubmitRecheckResult | Promise<SubmitRecheckResult>;
36
+ usageLimitDetected: () => boolean;
37
+ activityEvidence: () => SubmitActivityEvidence | undefined;
38
+ /** Generation/backend fence owned by the worker. It is checked both before
39
+ * invoking the old recheck closure and after its await resolves. */
40
+ isCurrent?: () => boolean;
41
+ }
42
+ export interface CurrentDeferredSubmitConfirmationSettlement {
43
+ stale: false;
44
+ action: SubmitConfirmationAction;
45
+ cliSessionId?: string;
46
+ recheckError?: unknown;
47
+ lifecycle: 'confirmed' | 'verification-finished' | 'unchanged';
48
+ }
49
+ export interface StaleDeferredSubmitConfirmationSettlement {
50
+ stale: true;
51
+ staleReason: 'generation' | 'attempt';
52
+ lifecycle: 'unchanged';
53
+ }
54
+ export type DeferredSubmitConfirmationSettlement = CurrentDeferredSubmitConfirmationSettlement | StaleDeferredSubmitConfirmationSettlement;
55
+ export type StaleWriteContinuationDisposition = 'ambiguous-terminal' | 'ordinary-carryover';
56
+ /** Settle an await continuation whose CLI generation is no longer current.
57
+ * Ordinary inputs are already owned by InflightInputTracker's crash carryover:
58
+ * touching the process-global bridge queues or warning the user here could
59
+ * delete the replacement generation's same-ID mark or invite a duplicate
60
+ * manual retry. Durable inputs are not auto-replayed and therefore need their
61
+ * exact attempt terminal reconciled by the receiver. */
62
+ export declare function settleStaleWriteContinuation(identity: {
63
+ turnId?: string;
64
+ dispatchAttempt?: number;
65
+ }, errorCode: string, emitAmbiguous: (turnId: string, errorCode: string, dispatchAttempt: number) => void): StaleWriteContinuationDisposition;
66
+ /** Execute the deferred submit-recheck callback and settle the structured
67
+ * pre-start lifecycle atomically with its decision. Both an actual history
68
+ * recheck hit and weaker "CLI is active" evidence become a bounded confirmed
69
+ * lease. The latter must not merely clear verification: that would leave a
70
+ * bare, unstarted fingerprint which no expiry pruning can ever remove. */
71
+ export declare function settleDeferredSubmitConfirmation(controller: StructuredSubmitLifecycleController, input: DeferredSubmitConfirmationInput): Promise<DeferredSubmitConfirmationSettlement>;
22
72
  //# sourceMappingURL=submit-confirmation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"submit-confirmation.d.ts","sourceRoot":"","sources":["../../src/services/submit-confirmation.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG,uBAAuB,GAAG,aAAa,CAAC;AAE5F,MAAM,MAAM,wBAAwB,GAChC;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,sBAAsB,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,QAAQ,EAAE,sBAAsB,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AAE7B,MAAM,WAAW,+BAA+B;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CA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EAC/C,KAAK,EAAE,+BAA+B,GACrC,OAAO,CAAC,oCAAoC,CAAC,CAgE/C"}
@@ -9,4 +9,86 @@ export function decideSubmitConfirmationAction(input) {
9
9
  return { kind: 'suppress-active', evidence: input.activityEvidence };
10
10
  return { kind: 'notify-stuck' };
11
11
  }
12
+ /** Settle an await continuation whose CLI generation is no longer current.
13
+ * Ordinary inputs are already owned by InflightInputTracker's crash carryover:
14
+ * touching the process-global bridge queues or warning the user here could
15
+ * delete the replacement generation's same-ID mark or invite a duplicate
16
+ * manual retry. Durable inputs are not auto-replayed and therefore need their
17
+ * exact attempt terminal reconciled by the receiver. */
18
+ export function settleStaleWriteContinuation(identity, errorCode, emitAmbiguous) {
19
+ if (identity.turnId && identity.dispatchAttempt !== undefined) {
20
+ emitAmbiguous(identity.turnId, errorCode, identity.dispatchAttempt);
21
+ return 'ambiguous-terminal';
22
+ }
23
+ return 'ordinary-carryover';
24
+ }
25
+ /** Execute the deferred submit-recheck callback and settle the structured
26
+ * pre-start lifecycle atomically with its decision. Both an actual history
27
+ * recheck hit and weaker "CLI is active" evidence become a bounded confirmed
28
+ * lease. The latter must not merely clear verification: that would leave a
29
+ * bare, unstarted fingerprint which no expiry pruning can ever remove. */
30
+ export async function settleDeferredSubmitConfirmation(controller, input) {
31
+ const targetStillCurrent = () => {
32
+ if (input.isCurrent && !input.isCurrent()) {
33
+ return { stale: true, staleReason: 'generation', lifecycle: 'unchanged' };
34
+ }
35
+ if (input.structuredTarget
36
+ && input.turnId
37
+ && !controller.hasPendingTurn(input.turnId, input.dispatchAttempt)) {
38
+ return { stale: true, staleReason: 'attempt', lifecycle: 'unchanged' };
39
+ }
40
+ return undefined;
41
+ };
42
+ // A durable attempt can expire/restart during the 20s delay before this
43
+ // function is called. Never run its old adapter closure against a new CLI.
44
+ const staleBeforeRecheck = targetStillCurrent();
45
+ if (staleBeforeRecheck)
46
+ return staleBeforeRecheck;
47
+ let recheckSubmitted = false;
48
+ let cliSessionId;
49
+ let recheckError;
50
+ if (input.recheck) {
51
+ try {
52
+ const result = await input.recheck();
53
+ recheckSubmitted = typeof result === 'boolean' ? result : result.submitted === true;
54
+ cliSessionId = typeof result === 'object' && result && typeof result.cliSessionId === 'string'
55
+ ? result.cliSessionId
56
+ : undefined;
57
+ }
58
+ catch (err) {
59
+ recheckError = err;
60
+ }
61
+ }
62
+ // The old closure can itself await filesystem/CLI state. Re-check both the
63
+ // CLI generation and exact attempt before any lifecycle or caller effect.
64
+ const staleAfterRecheck = targetStillCurrent();
65
+ if (staleAfterRecheck)
66
+ return staleAfterRecheck;
67
+ const action = decideSubmitConfirmationAction({
68
+ recheckSubmitted,
69
+ usageLimitDetected: input.usageLimitDetected(),
70
+ activityEvidence: input.activityEvidence(),
71
+ });
72
+ let lifecycle = 'unchanged';
73
+ if (input.structuredTarget && input.turnId) {
74
+ if (action.kind === 'suppress-confirmed' || action.kind === 'suppress-active') {
75
+ if (controller.confirmPendingTurn(input.turnId, undefined, input.dispatchAttempt)) {
76
+ lifecycle = 'confirmed';
77
+ }
78
+ else if (controller.finishSubmitVerification(input.turnId, undefined, input.dispatchAttempt)) {
79
+ lifecycle = 'verification-finished';
80
+ }
81
+ }
82
+ else if (controller.finishSubmitVerification(input.turnId, undefined, input.dispatchAttempt)) {
83
+ lifecycle = 'verification-finished';
84
+ }
85
+ }
86
+ return {
87
+ stale: false,
88
+ action,
89
+ ...(cliSessionId ? { cliSessionId } : {}),
90
+ ...(recheckError !== undefined ? { recheckError } : {}),
91
+ lifecycle,
92
+ };
93
+ }
12
94
  //# sourceMappingURL=submit-confirmation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"submit-confirmation.js","sourceRoot":"","sources":["../../src/services/submit-confirmation.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,8BAA8B,CAAC,KAAsC;IACnF,IAAI,KAAK,CAAC,aAAa;QAAE,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,KAAK,CAAC,aAAa,EAAE,CAA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YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,SAAS;KACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /** Minimal per-worker promise-chain mutex. Each task begins only after the
2
+ * previous task settles; rejection never poisons the tail. Used for adopt
3
+ * writes where concurrent paste -> delay -> Enter/history verification would
4
+ * otherwise interleave in the same external CLI composer. */
5
+ export declare class AsyncSerialQueue {
6
+ private tail;
7
+ run<T>(task: () => Promise<T>): Promise<T>;
8
+ }
9
+ //# sourceMappingURL=async-serial-queue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async-serial-queue.d.ts","sourceRoot":"","sources":["../../src/utils/async-serial-queue.ts"],"names":[],"mappings":"AAAA;;;8DAG8D;AAC9D,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAoC;IAEhD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;CAK3C"}
@@ -0,0 +1,13 @@
1
+ /** Minimal per-worker promise-chain mutex. Each task begins only after the
2
+ * previous task settles; rejection never poisons the tail. Used for adopt
3
+ * writes where concurrent paste -> delay -> Enter/history verification would
4
+ * otherwise interleave in the same external CLI composer. */
5
+ export class AsyncSerialQueue {
6
+ tail = Promise.resolve();
7
+ run(task) {
8
+ const result = this.tail.then(task, task);
9
+ this.tail = result.then(() => undefined, () => undefined);
10
+ return result;
11
+ }
12
+ }
13
+ //# sourceMappingURL=async-serial-queue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"async-serial-queue.js","sourceRoot":"","sources":["../../src/utils/async-serial-queue.ts"],"names":[],"mappings":"AAAA;;;8DAG8D;AAC9D,MAAM,OAAO,gBAAgB;IACnB,IAAI,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;IAEhD,GAAG,CAAI,IAAsB;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC1D,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Project worker runtime facts into the status consumed by Lark cards and the
3
+ * Dashboard. A structured transcript lifecycle outranks screen readiness:
4
+ * prompt glyphs and PTY quiescence are UI hints, while a transcript-started
5
+ * turn without assistant_final is explicit evidence that work is still running;
6
+ * a verified submit also blocks during its bounded transcript-start hand-off.
7
+ */
8
+ export declare function projectRuntimeScreenStatus(state: {
9
+ promptReady: boolean;
10
+ analyzing: boolean;
11
+ structuredTurnBlocking: boolean;
12
+ }): 'idle' | 'working' | 'analyzing';
13
+ /** Await an asynchronous screen snapshot before reading runtime status. A
14
+ * periodic tick can spend measurable time in tmux/observe capture; projecting
15
+ * first lets a turn that starts during that await receive a late, stale idle
16
+ * update. Keeping the ordering in one helper makes the race deterministic in
17
+ * tests and forces callers to read lifecycle state at send time. */
18
+ export declare function snapshotWithLatestRuntimeStatus<T>(capture: () => Promise<T>, projectStatus: () => ReturnType<typeof projectRuntimeScreenStatus>): Promise<{
19
+ snapshot: T;
20
+ status: ReturnType<typeof projectRuntimeScreenStatus>;
21
+ }>;
22
+ /** Monotonic evidence for PTY chunks fed to readiness detection. Wall-clock
23
+ * milliseconds are not unique: two redraw chunks can land in the same ms,
24
+ * making timestamp equality falsely claim that no output followed a rejected
25
+ * ready signal. A generation changes for every observed chunk instead. */
26
+ export declare class PtyOutputGeneration {
27
+ private generation;
28
+ observe(): number;
29
+ snapshot(): number;
30
+ isCurrent(snapshot: number): boolean;
31
+ reset(): void;
32
+ }
33
+ /** Validate a callback captured for one CLI/backend generation. A restart can
34
+ * invalidate the generation before async teardown swaps out the backend
35
+ * object, so backend identity alone is not a sufficient fence. */
36
+ export declare function isCliBackendGenerationCurrent<T>(fence: {
37
+ generation: number;
38
+ backend: T;
39
+ }, current: {
40
+ generation: number;
41
+ backend: T;
42
+ restartInProgress: boolean;
43
+ }): boolean;
44
+ /** Enter a fresh CLI-write cycle synchronously, before the adapter is allowed
45
+ * to yield. This ordering matters for fast turns: transcript final can arrive
46
+ * while writeInput is still polling submit history, and IdleDetector must be
47
+ * re-armed before that final edge rather than reset after it. */
48
+ export declare function beginRuntimeWriteCycle(hooks: {
49
+ setPromptReady: (ready: boolean) => void;
50
+ resetIdleDetector: () => void;
51
+ }): void;
52
+ //# sourceMappingURL=runtime-screen-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-screen-status.d.ts","sourceRoot":"","sources":["../../src/utils/runtime-screen-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACjC,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,CAInC;AAED;;;;qEAIqE;AACrE,wBAAsB,+BAA+B,CAAC,CAAC,EACrD,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACzB,aAAa,EAAE,MAAM,UAAU,CAAC,OAAO,0BAA0B,CAAC,GACjE,OAAO,CAAC;IAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,MAAM,EAAE,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAA;CAAE,CAAC,CAGjF;AAED;;;2EAG2E;AAC3E,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,UAAU,CAAK;IAEvB,OAAO,IAAI,MAAM;IAKjB,QAAQ,IAAI,MAAM;IAIlB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIpC,KAAK,IAAI,IAAI;CAGd;AAED;;kEAEkE;AAClE,wBAAgB,6BAA6B,CAAC,CAAC,EAC7C,KAAK,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,CAAA;CAAE,EACzC,OAAO,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,CAAC,CAAC;IAAC,iBAAiB,EAAE,OAAO,CAAA;CAAE,GACtE,OAAO,CAIT;AAED;;;kEAGkE;AAClE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE;IAC5C,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,iBAAiB,EAAE,MAAM,IAAI,CAAC;CAC/B,GAAG,IAAI,CAGP"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Project worker runtime facts into the status consumed by Lark cards and the
3
+ * Dashboard. A structured transcript lifecycle outranks screen readiness:
4
+ * prompt glyphs and PTY quiescence are UI hints, while a transcript-started
5
+ * turn without assistant_final is explicit evidence that work is still running;
6
+ * a verified submit also blocks during its bounded transcript-start hand-off.
7
+ */
8
+ export function projectRuntimeScreenStatus(state) {
9
+ if (state.analyzing)
10
+ return 'analyzing';
11
+ if (state.structuredTurnBlocking)
12
+ return 'working';
13
+ return state.promptReady ? 'idle' : 'working';
14
+ }
15
+ /** Await an asynchronous screen snapshot before reading runtime status. A
16
+ * periodic tick can spend measurable time in tmux/observe capture; projecting
17
+ * first lets a turn that starts during that await receive a late, stale idle
18
+ * update. Keeping the ordering in one helper makes the race deterministic in
19
+ * tests and forces callers to read lifecycle state at send time. */
20
+ export async function snapshotWithLatestRuntimeStatus(capture, projectStatus) {
21
+ const snapshot = await capture();
22
+ return { snapshot, status: projectStatus() };
23
+ }
24
+ /** Monotonic evidence for PTY chunks fed to readiness detection. Wall-clock
25
+ * milliseconds are not unique: two redraw chunks can land in the same ms,
26
+ * making timestamp equality falsely claim that no output followed a rejected
27
+ * ready signal. A generation changes for every observed chunk instead. */
28
+ export class PtyOutputGeneration {
29
+ generation = 0;
30
+ observe() {
31
+ this.generation++;
32
+ return this.generation;
33
+ }
34
+ snapshot() {
35
+ return this.generation;
36
+ }
37
+ isCurrent(snapshot) {
38
+ return this.generation === snapshot;
39
+ }
40
+ reset() {
41
+ this.generation = 0;
42
+ }
43
+ }
44
+ /** Validate a callback captured for one CLI/backend generation. A restart can
45
+ * invalidate the generation before async teardown swaps out the backend
46
+ * object, so backend identity alone is not a sufficient fence. */
47
+ export function isCliBackendGenerationCurrent(fence, current) {
48
+ return fence.generation === current.generation
49
+ && fence.backend === current.backend
50
+ && !current.restartInProgress;
51
+ }
52
+ /** Enter a fresh CLI-write cycle synchronously, before the adapter is allowed
53
+ * to yield. This ordering matters for fast turns: transcript final can arrive
54
+ * while writeInput is still polling submit history, and IdleDetector must be
55
+ * re-armed before that final edge rather than reset after it. */
56
+ export function beginRuntimeWriteCycle(hooks) {
57
+ hooks.setPromptReady(false);
58
+ hooks.resetIdleDetector();
59
+ }
60
+ //# sourceMappingURL=runtime-screen-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-screen-status.js","sourceRoot":"","sources":["../../src/utils/runtime-screen-status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,KAI1C;IACC,IAAI,KAAK,CAAC,SAAS;QAAE,OAAO,WAAW,CAAC;IACxC,IAAI,KAAK,CAAC,sBAAsB;QAAE,OAAO,SAAS,CAAC;IACnD,OAAO,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAChD,CAAC;AAED;;;;qEAIqE;AACrE,MAAM,CAAC,KAAK,UAAU,+BAA+B,CACnD,OAAyB,EACzB,aAAkE;IAElE,MAAM,QAAQ,GAAG,MAAM,OAAO,EAAE,CAAC;IACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAA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