@rubytech/create-maxy-code 0.1.461 → 0.1.463

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 (186) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/lib/graph-mcp/dist/index.d.ts +2 -1
  3. package/payload/platform/lib/graph-mcp/dist/index.d.ts.map +1 -1
  4. package/payload/platform/lib/graph-mcp/dist/index.js +14 -22
  5. package/payload/platform/lib/graph-mcp/dist/index.js.map +1 -1
  6. package/payload/platform/lib/graph-mcp/src/index.ts +15 -22
  7. package/payload/platform/lib/mcp-spawn-tee/dist/index.d.ts +8 -7
  8. package/payload/platform/lib/mcp-spawn-tee/dist/index.d.ts.map +1 -1
  9. package/payload/platform/lib/mcp-spawn-tee/dist/index.js +19 -19
  10. package/payload/platform/lib/mcp-spawn-tee/dist/index.js.map +1 -1
  11. package/payload/platform/lib/mcp-spawn-tee/src/__tests__/spawn-tee.test.ts +34 -5
  12. package/payload/platform/lib/mcp-spawn-tee/src/index.ts +22 -19
  13. package/payload/platform/lib/mcp-stderr-tee/dist/index.d.ts +35 -17
  14. package/payload/platform/lib/mcp-stderr-tee/dist/index.d.ts.map +1 -1
  15. package/payload/platform/lib/mcp-stderr-tee/dist/index.js +41 -48
  16. package/payload/platform/lib/mcp-stderr-tee/dist/index.js.map +1 -1
  17. package/payload/platform/lib/mcp-stderr-tee/src/index.ts +42 -51
  18. package/payload/platform/lib/storage-broker/dist/__tests__/audit.test.js +27 -0
  19. package/payload/platform/lib/storage-broker/dist/__tests__/audit.test.js.map +1 -1
  20. package/payload/platform/lib/storage-broker/dist/__tests__/cf-exec.test.js +49 -0
  21. package/payload/platform/lib/storage-broker/dist/__tests__/cf-exec.test.js.map +1 -1
  22. package/payload/platform/lib/storage-broker/dist/audit.d.ts +11 -0
  23. package/payload/platform/lib/storage-broker/dist/audit.d.ts.map +1 -1
  24. package/payload/platform/lib/storage-broker/dist/audit.js +16 -0
  25. package/payload/platform/lib/storage-broker/dist/audit.js.map +1 -1
  26. package/payload/platform/lib/storage-broker/dist/cf-exec.d.ts +18 -0
  27. package/payload/platform/lib/storage-broker/dist/cf-exec.d.ts.map +1 -1
  28. package/payload/platform/lib/storage-broker/dist/cf-exec.js +77 -0
  29. package/payload/platform/lib/storage-broker/dist/cf-exec.js.map +1 -1
  30. package/payload/platform/lib/storage-broker/dist/house-scoped-token.js +3 -0
  31. package/payload/platform/lib/storage-broker/dist/house-scoped-token.js.map +1 -1
  32. package/payload/platform/lib/storage-broker/dist/registry.d.ts +1 -1
  33. package/payload/platform/lib/storage-broker/dist/registry.d.ts.map +1 -1
  34. package/payload/platform/lib/storage-broker/dist/registry.js.map +1 -1
  35. package/payload/platform/lib/storage-broker/src/__tests__/audit.test.ts +32 -1
  36. package/payload/platform/lib/storage-broker/src/__tests__/cf-exec.test.ts +61 -0
  37. package/payload/platform/lib/storage-broker/src/audit.ts +45 -0
  38. package/payload/platform/lib/storage-broker/src/cf-exec.ts +91 -0
  39. package/payload/platform/lib/storage-broker/src/house-scoped-token.ts +3 -0
  40. package/payload/platform/lib/storage-broker/src/registry.ts +5 -1
  41. package/payload/platform/plugins/admin/lib/mcp-spawn-tee/index.js +19 -19
  42. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +23 -12
  43. package/payload/platform/plugins/aeo/lib/mcp-spawn-tee/index.js +19 -19
  44. package/payload/platform/plugins/browser/lib/mcp-spawn-tee/index.js +19 -19
  45. package/payload/platform/plugins/cloudflare/PLUGIN.md +1 -1
  46. package/payload/platform/plugins/cloudflare/mcp/dist/index.js +5 -5
  47. package/payload/platform/plugins/cloudflare/mcp/dist/index.js.map +1 -1
  48. package/payload/platform/plugins/cloudflare/references/hosting-sites.md +2 -0
  49. package/payload/platform/plugins/cloudflare/skills/calendar-site/SKILL.md +1 -1
  50. package/payload/platform/plugins/cloudflare/skills/site-deploy/SKILL.md +2 -0
  51. package/payload/platform/plugins/connector/lib/mcp-spawn-tee/index.js +19 -19
  52. package/payload/platform/plugins/contacts/lib/mcp-spawn-tee/index.js +19 -19
  53. package/payload/platform/plugins/docs/references/admin-session.md +3 -3
  54. package/payload/platform/plugins/docs/references/cloudflare.md +2 -0
  55. package/payload/platform/plugins/docs/references/internals.md +1 -1
  56. package/payload/platform/plugins/docs/references/outlook-guide.md +11 -4
  57. package/payload/platform/plugins/docs/references/plugins-guide.md +8 -6
  58. package/payload/platform/plugins/email/lib/mcp-spawn-tee/index.js +19 -19
  59. package/payload/platform/plugins/filesystem/lib/mcp-spawn-tee/index.js +19 -19
  60. package/payload/platform/plugins/graph-viewer/lib/mcp-spawn-tee/index.js +19 -19
  61. package/payload/platform/plugins/memory/PLUGIN.md +1 -1
  62. package/payload/platform/plugins/memory/lib/mcp-spawn-tee/index.js +19 -19
  63. package/payload/platform/plugins/memory/mcp/dist/lib/log-ingest.js +2 -2
  64. package/payload/platform/plugins/memory/mcp/dist/lib/log-ingest.js.map +1 -1
  65. package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
  66. package/payload/platform/plugins/outlook/PLUGIN.md +2 -2
  67. package/payload/platform/plugins/outlook/lib/mcp-spawn-tee/index.js +19 -19
  68. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.d.ts +2 -0
  69. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.d.ts.map +1 -0
  70. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.js +238 -0
  71. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.js.map +1 -0
  72. package/payload/platform/plugins/outlook/mcp/dist/index.js +9 -5
  73. package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
  74. package/payload/platform/plugins/outlook/mcp/dist/lib/message.d.ts +1 -6
  75. package/payload/platform/plugins/outlook/mcp/dist/lib/message.d.ts.map +1 -1
  76. package/payload/platform/plugins/outlook/mcp/dist/lib/message.js +9 -17
  77. package/payload/platform/plugins/outlook/mcp/dist/lib/message.js.map +1 -1
  78. package/payload/platform/plugins/outlook/mcp/dist/lib/recipients.d.ts +56 -0
  79. package/payload/platform/plugins/outlook/mcp/dist/lib/recipients.d.ts.map +1 -0
  80. package/payload/platform/plugins/outlook/mcp/dist/lib/recipients.js +40 -0
  81. package/payload/platform/plugins/outlook/mcp/dist/lib/recipients.js.map +1 -0
  82. package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.d.ts.map +1 -1
  83. package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.js +1 -3
  84. package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.js.map +1 -1
  85. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts +58 -9
  86. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts.map +1 -1
  87. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js +97 -18
  88. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js.map +1 -1
  89. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.d.ts.map +1 -1
  90. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.js +1 -3
  91. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.js.map +1 -1
  92. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-reply.d.ts.map +1 -1
  93. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-reply.js +3 -18
  94. package/payload/platform/plugins/outlook/mcp/dist/tools/mail-reply.js.map +1 -1
  95. package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +5 -2
  96. package/payload/platform/plugins/quickbooks/lib/mcp-spawn-tee/index.js +19 -19
  97. package/payload/platform/plugins/replicate/lib/mcp-spawn-tee/index.js +19 -19
  98. package/payload/platform/plugins/scheduling/lib/mcp-spawn-tee/index.js +19 -19
  99. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.js +6 -32
  100. package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.js.map +1 -1
  101. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.d.ts.map +1 -1
  102. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js +10 -30
  103. package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js.map +1 -1
  104. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-cancel.test.js +24 -21
  105. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-cancel.test.js.map +1 -1
  106. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.d.ts +27 -18
  107. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.d.ts.map +1 -1
  108. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.js +31 -27
  109. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.js.map +1 -1
  110. package/payload/platform/plugins/storage-broker/PLUGIN.md +9 -1
  111. package/payload/platform/plugins/storage-broker/lib/mcp-spawn-tee/index.js +19 -19
  112. package/payload/platform/plugins/storage-broker/mcp/dist/confine-path.d.ts.map +1 -1
  113. package/payload/platform/plugins/storage-broker/mcp/dist/confine-path.js +16 -5
  114. package/payload/platform/plugins/storage-broker/mcp/dist/confine-path.js.map +1 -1
  115. package/payload/platform/plugins/storage-broker/mcp/dist/index.js +49 -0
  116. package/payload/platform/plugins/storage-broker/mcp/dist/index.js.map +1 -1
  117. package/payload/platform/plugins/telegram/lib/mcp-spawn-tee/index.js +19 -19
  118. package/payload/platform/plugins/url-get/lib/mcp-spawn-tee/index.js +19 -19
  119. package/payload/platform/plugins/voice-mirror/lib/mcp-spawn-tee/index.js +19 -19
  120. package/payload/platform/plugins/web-designer/PLUGIN.md +1 -1
  121. package/payload/platform/plugins/web-designer/commands/website.md +6 -0
  122. package/payload/platform/plugins/web-designer/skills/web-design/references/deploy.md +12 -0
  123. package/payload/platform/plugins/whatsapp/lib/mcp-spawn-tee/index.js +19 -19
  124. package/payload/platform/plugins/work/lib/mcp-spawn-tee/index.js +19 -19
  125. package/payload/platform/plugins/workflows/lib/mcp-spawn-tee/index.js +19 -19
  126. package/payload/platform/scripts/__tests__/logs-rotate.test.sh +24 -20
  127. package/payload/platform/scripts/logs-read.sh +31 -0
  128. package/payload/platform/scripts/logs-rotate.sh +21 -18
  129. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
  130. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +2 -0
  131. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
  132. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  133. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +37 -0
  134. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  135. package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts +5 -3
  136. package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts.map +1 -1
  137. package/payload/platform/services/claude-session-manager/dist/rc-daemon.js.map +1 -1
  138. package/payload/platform/services/telegram-channel/dist/server.d.ts.map +1 -1
  139. package/payload/platform/services/telegram-channel/dist/server.js +0 -4
  140. package/payload/platform/services/telegram-channel/dist/server.js.map +1 -1
  141. package/payload/platform/services/webchat-channel/dist/server.d.ts.map +1 -1
  142. package/payload/platform/services/webchat-channel/dist/server.js +0 -4
  143. package/payload/platform/services/webchat-channel/dist/server.js.map +1 -1
  144. package/payload/platform/services/whatsapp-channel/dist/server.d.ts.map +1 -1
  145. package/payload/platform/services/whatsapp-channel/dist/server.js +0 -4
  146. package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
  147. package/payload/server/{chunk-JXWFVE5X.js → chunk-BBSPFN45.js} +65 -0
  148. package/payload/server/public/assets/{AdminLoginScreens-BFbpkEUS.js → AdminLoginScreens-Bed8SDxY.js} +1 -1
  149. package/payload/server/public/assets/{AdminShell-CdOGObaZ.js → AdminShell-BLh9O6dn.js} +1 -1
  150. package/payload/server/public/assets/{Checkbox-RFD_F0c0.js → Checkbox-BC_KSbpS.js} +1 -1
  151. package/payload/server/public/assets/{admin-CYGdL-1O.js → admin-DfWgJVI3.js} +1 -1
  152. package/payload/server/public/assets/{browser-DVfa_plj.js → browser-C0vkv-hH.js} +1 -1
  153. package/payload/server/public/assets/{calendar-JC_Dxa4n.js → calendar-_pfHw0Hp.js} +1 -1
  154. package/payload/server/public/assets/chat-DYT5H81o.js +1 -0
  155. package/payload/server/public/assets/chevron-left-BnpVBu51.js +1 -0
  156. package/payload/server/public/assets/data-CR-fbPWr.js +1 -0
  157. package/payload/server/public/assets/{graph-hBUrRSkr.js → graph-BZiudUGr.js} +1 -1
  158. package/payload/server/public/assets/{graph-labels-CHh6zs8t.js → graph-labels-BzmmJwCR.js} +1 -1
  159. package/payload/server/public/assets/{maximize-2-DjxE4rm9.js → maximize-2-Bhdsv0U-.js} +1 -1
  160. package/payload/server/public/assets/{operator-BqU9SQuu.js → operator-gm2eP4r6.js} +1 -1
  161. package/payload/server/public/assets/{page-DiQhU6lD.js → page-8AB3jUa_.js} +1 -1
  162. package/payload/server/public/assets/page-BoPorLg-.js +32 -0
  163. package/payload/server/public/assets/{public-Cu_eALgY.js → public-DqJk6qgW.js} +1 -1
  164. package/payload/server/public/assets/{rotate-ccw-F9DsSTSJ.js → rotate-ccw-D_5cETGt.js} +1 -1
  165. package/payload/server/public/assets/{tasks-CE-D0f50.js → tasks-EyKLXINi.js} +1 -1
  166. package/payload/server/public/assets/{time-entry-format-D2rsWhov.js → time-entry-format-DAwmmR3i.js} +1 -1
  167. package/payload/server/public/assets/{useCopyFeedback-QxOmoobV.js → useCopyFeedback-rOWd_lzl.js} +1 -1
  168. package/payload/server/public/assets/{useSelectionMode-RIzNqFjV.js → useSelectionMode-DDmLmPph.js} +1 -1
  169. package/payload/server/public/assets/{useSubAccountSwitcher-BW_fK1Nt.css → useSubAccountSwitcher-pu0jjLCz.css} +1 -1
  170. package/payload/server/public/assets/{useVoiceRecorder-WrWurSYI.js → useVoiceRecorder-azG8zSUI.js} +1 -1
  171. package/payload/server/public/browser.html +5 -5
  172. package/payload/server/public/calendar.html +6 -6
  173. package/payload/server/public/chat.html +12 -12
  174. package/payload/server/public/data.html +10 -10
  175. package/payload/server/public/graph.html +11 -11
  176. package/payload/server/public/index.html +13 -13
  177. package/payload/server/public/operator.html +14 -14
  178. package/payload/server/public/public.html +12 -12
  179. package/payload/server/public/tasks.html +5 -5
  180. package/payload/server/server.js +596 -235
  181. package/payload/server/{src-4F37OHLK.js → src-YLGAZY36.js} +5 -1
  182. package/payload/server/public/assets/chat-Yf8Nkop8.js +0 -1
  183. package/payload/server/public/assets/chevron-left-CAiAUBxO.js +0 -1
  184. package/payload/server/public/assets/data-hqdYXaEn.js +0 -1
  185. package/payload/server/public/assets/page-B4c4_4HP.js +0 -32
  186. /package/payload/server/public/assets/{useSubAccountSwitcher-wo_qGW-I.js → useSubAccountSwitcher-CU-lOxTd.js} +0 -0
@@ -2,32 +2,41 @@ export interface ScheduleCancelParams {
2
2
  accountId: string;
3
3
  eventId: string;
4
4
  note?: string;
5
- /** Task 1516 — the cancelling seat's real, platform-injected session id
6
- * (`process.env.SESSION_ID`), NOT an agent-supplied value. Used to decide
7
- * whether the cancellation came from the event's own scheduler-dispatched seat
8
- * (the self-cancel loop). Absent on a manual/operator cancel path. */
5
+ /** The cancelling turn's real, platform-injected session id
6
+ * (`process.env.SESSION_ID`), NOT an agent-supplied value. Accepted and
7
+ * currently unread: the self-cancel discriminator it fed is disarmed pending
8
+ * Task 1752, which needs the turn's dispatched eventId rather than a session
9
+ * id. Kept on the boundary so the caller does not churn. */
9
10
  callerSessionId?: string;
10
11
  }
11
12
  /**
12
- * Task 1516 / 1526 — the pure core of the self-cancel alarm. With per-firing
13
- * scheduled seats (Task 1526) the event's own firing seat is recorded on the node
14
- * as `lastDispatchSessionId` at dispatch time. `byOwnDispatch` is an exact match
15
- * of the cancelling seat's real (platform-injected) SESSION_ID to that stamp: the
16
- * autonomous self-cancel loop this alarm exists to catch.
13
+ * Task 1516 / 1746 — the pure core of the self-cancel alarm. `isAgentDispatch`
14
+ * still reports whether the cancelled event carries an agent dispatch.
17
15
  *
18
- * Before 1526 the guard recomputed the deterministic `adminSessionIdFor` seat, so
19
- * `byOwnDispatch=true` conflated the loop with an operator cancelling via that
20
- * same *shared* channel seat. Per-firing seats separate them: a scheduled firing
21
- * runs the salted seat, an operator's channel session runs the UNSALTED
22
- * `adminSessionIdFor` seat, so an operator cancel now correctly reads `false`.
23
- * `isAgentDispatch` still keys on the event carrying an agent dispatch. Never
24
- * throws.
16
+ * `byOwnDispatch` is DISARMED and always false, pending Task 1752.
17
+ *
18
+ * It used to compare the caller's SESSION_ID to a `lastDispatchSessionId` stamp
19
+ * (Task 1526), which discriminated only because a scheduled firing ran its own
20
+ * salted per-firing seat. Task 1746 removed that seat: it spawned a second
21
+ * session for the sender, whose channel server then attached under the sender's
22
+ * own hub key and swallowed their real messages, splitting one conversation
23
+ * across two sessions. With one session per sender, the dispatcher would stamp
24
+ * the sender's own session id and the operator cancels from that same session,
25
+ * so the comparison would be ALWAYS TRUE — stamping `cancelledByOwnDispatchAt`
26
+ * on every operator cancel and reporting each as an autonomous loop.
27
+ *
28
+ * An alarm that always fires is worse than one that never does, so it is
29
+ * disarmed rather than left lying. This under-counts: a real self-cancel loop is
30
+ * no longer detected. That is the safe direction — it never invents one — and it
31
+ * is deliberate, not an oversight. Task 1752 restores detection from the turn's
32
+ * own dispatched eventId, which needs a turn-boundary seam this file does not
33
+ * have. Never throws.
25
34
  */
26
35
  export declare function classifySelfCancel(params: {
27
- callerSessionId: string | undefined;
36
+ /** The event being cancelled. */
37
+ eventId: string;
28
38
  agentChannel: string | null;
29
39
  agentDestination: string | null;
30
- lastDispatchSessionId: string | null;
31
40
  }): {
32
41
  isAgentDispatch: boolean;
33
42
  byOwnDispatch: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"schedule-cancel.d.ts","sourceRoot":"","sources":["../../src/tools/schedule-cancel.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;2EAGuE;IACvE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC,GAAG;IAAE,eAAe,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAYvD;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiDhF"}
1
+ {"version":3,"file":"schedule-cancel.d.ts","sourceRoot":"","sources":["../../src/tools/schedule-cancel.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;iEAI6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,GAAG;IAAE,eAAe,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAMvD;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkDhF"}
@@ -1,33 +1,36 @@
1
1
  import { getSession } from "../lib/neo4j.js";
2
2
  /**
3
- * Task 1516 / 1526 — the pure core of the self-cancel alarm. With per-firing
4
- * scheduled seats (Task 1526) the event's own firing seat is recorded on the node
5
- * as `lastDispatchSessionId` at dispatch time. `byOwnDispatch` is an exact match
6
- * of the cancelling seat's real (platform-injected) SESSION_ID to that stamp: the
7
- * autonomous self-cancel loop this alarm exists to catch.
3
+ * Task 1516 / 1746 — the pure core of the self-cancel alarm. `isAgentDispatch`
4
+ * still reports whether the cancelled event carries an agent dispatch.
8
5
  *
9
- * Before 1526 the guard recomputed the deterministic `adminSessionIdFor` seat, so
10
- * `byOwnDispatch=true` conflated the loop with an operator cancelling via that
11
- * same *shared* channel seat. Per-firing seats separate them: a scheduled firing
12
- * runs the salted seat, an operator's channel session runs the UNSALTED
13
- * `adminSessionIdFor` seat, so an operator cancel now correctly reads `false`.
14
- * `isAgentDispatch` still keys on the event carrying an agent dispatch. Never
15
- * throws.
6
+ * `byOwnDispatch` is DISARMED and always false, pending Task 1752.
7
+ *
8
+ * It used to compare the caller's SESSION_ID to a `lastDispatchSessionId` stamp
9
+ * (Task 1526), which discriminated only because a scheduled firing ran its own
10
+ * salted per-firing seat. Task 1746 removed that seat: it spawned a second
11
+ * session for the sender, whose channel server then attached under the sender's
12
+ * own hub key and swallowed their real messages, splitting one conversation
13
+ * across two sessions. With one session per sender, the dispatcher would stamp
14
+ * the sender's own session id and the operator cancels from that same session,
15
+ * so the comparison would be ALWAYS TRUE — stamping `cancelledByOwnDispatchAt`
16
+ * on every operator cancel and reporting each as an autonomous loop.
17
+ *
18
+ * An alarm that always fires is worse than one that never does, so it is
19
+ * disarmed rather than left lying. This under-counts: a real self-cancel loop is
20
+ * no longer detected. That is the safe direction — it never invents one — and it
21
+ * is deliberate, not an oversight. Task 1752 restores detection from the turn's
22
+ * own dispatched eventId, which needs a turn-boundary seam this file does not
23
+ * have. Never throws.
16
24
  */
17
25
  export function classifySelfCancel(params) {
18
- const { callerSessionId, agentChannel, agentDestination, lastDispatchSessionId } = params;
26
+ const { agentChannel, agentDestination } = params;
19
27
  if (!agentChannel || !agentDestination) {
20
28
  return { isAgentDispatch: false, byOwnDispatch: false };
21
29
  }
22
- const byOwnDispatch = typeof callerSessionId === "string" &&
23
- callerSessionId.length > 0 &&
24
- typeof lastDispatchSessionId === "string" &&
25
- lastDispatchSessionId.length > 0 &&
26
- callerSessionId === lastDispatchSessionId;
27
- return { isAgentDispatch: true, byOwnDispatch };
30
+ return { isAgentDispatch: true, byOwnDispatch: false };
28
31
  }
29
32
  export async function scheduleCancel(params) {
30
- const { accountId, eventId, note, callerSessionId } = params;
33
+ const { accountId, eventId, note } = params;
31
34
  const now = new Date().toISOString();
32
35
  const noteEntry = note
33
36
  ? `\n[${now}] Cancelled: ${note}`
@@ -38,23 +41,24 @@ export async function scheduleCancel(params) {
38
41
  SET e.eventStatus = 'cancelled',
39
42
  e.updatedAt = $now,
40
43
  e.notes = COALESCE(e.notes, '') + $noteEntry
41
- RETURN e.agentChannel AS agentChannel, e.agentDestination AS agentDestination,
42
- e.lastDispatchSessionId AS lastDispatchSessionId`, { eventId, accountId, now, noteEntry });
44
+ RETURN e.agentChannel AS agentChannel, e.agentDestination AS agentDestination`, { eventId, accountId, now, noteEntry });
43
45
  if (result.records.length === 0) {
44
46
  throw new Error(`Event not found: ${eventId}`);
45
47
  }
46
48
  // Task 1516 — the self-cancel alarm. Only agent-dispatch automations can
47
- // self-cancel; a plain reminder cancel emits nothing. `byOwnDispatch=true`
48
- // means the cancelling seat IS this event's own scheduled seat (the loop).
49
+ // self-cancel; a plain reminder cancel emits nothing. Task 1746 — the
50
+ // byOwnDispatch discriminator is disarmed (always false) pending Task 1752,
51
+ // so the line below always reports false and the stamp below never runs. The
52
+ // line still fires, which keeps the cancel itself observable.
49
53
  const agentChannel = result.records[0].get("agentChannel");
50
54
  const agentDestination = result.records[0].get("agentDestination");
51
- const lastDispatchSessionId = result.records[0].get("lastDispatchSessionId");
52
- const cls = classifySelfCancel({ callerSessionId, agentChannel, agentDestination, lastDispatchSessionId });
55
+ const cls = classifySelfCancel({ eventId, agentChannel, agentDestination });
53
56
  if (cls.isAgentDispatch) {
54
57
  console.error(`[sched-guard] op=self-cancel event=${eventId.slice(0, 8)} byOwnDispatch=${cls.byOwnDispatch}`);
55
58
  // Stamp the fact on the node so the standing audit (which runs in the cron,
56
59
  // with no seat SESSION_ID) can count self-cancels deterministically without
57
- // a timing heuristic — it reads this stamp, not the note prose.
60
+ // a timing heuristic — it reads this stamp, not the note prose. Unreachable
61
+ // while byOwnDispatch is disarmed; retained for Task 1752, which re-arms it.
58
62
  if (cls.byOwnDispatch) {
59
63
  await neo4jSession.run(`MATCH (e:Event {eventId: $eventId, accountId: $accountId})
60
64
  SET e.cancelledByOwnDispatchAt = $now`, { eventId, accountId, now });
@@ -1 +1 @@
1
- {"version":3,"file":"schedule-cancel.js","sourceRoot":"","sources":["../../src/tools/schedule-cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAa7C;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAKlC;IACC,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;IAC1F,IAAI,CAAC,YAAY,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACvC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IAC1D,CAAC;IACD,MAAM,aAAa,GACjB,OAAO,eAAe,KAAK,QAAQ;QACnC,eAAe,CAAC,MAAM,GAAG,CAAC;QAC1B,OAAO,qBAAqB,KAAK,QAAQ;QACzC,qBAAqB,CAAC,MAAM,GAAG,CAAC;QAChC,eAAe,KAAK,qBAAqB,C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@@ -29,6 +29,12 @@ tools:
29
29
  - name: storage-r2-object-delete
30
30
  publicAllowlist: false
31
31
  adminAllowlist: true
32
+ - name: storage-pages-deploy
33
+ publicAllowlist: false
34
+ adminAllowlist: true
35
+ - name: storage-pages-adopt
36
+ publicAllowlist: false
37
+ adminAllowlist: true
32
38
  metadata: {"platform":{"embed":["admin"]}}
33
39
  mcp:
34
40
  command: node
@@ -60,8 +66,10 @@ The isolation boundary for per-account Cloudflare D1 and R2 on a multi-tenant in
60
66
  - `storage-r2-object-get` — download an object to a file in the caller's account directory. Objects over 100 MiB are rejected.
61
67
  - `storage-r2-object-put` — upload a file from the caller's account directory. Files over 100 MiB are rejected.
62
68
  - `storage-r2-object-delete` — delete an object from a bucket the caller owns.
69
+ - `storage-pages-deploy` — publish a folder under the caller's `sites/` to a Pages project the caller owns. House-run: the Pages credential never enters the caller's account.
70
+ - `storage-pages-adopt` — house admin only: record which account owns a Pages project. Ownership is never reassigned silently; adopting a project owned by someone else is refused.
63
71
 
64
- A request against a database or bucket the caller does not own returns an authorization error, not another account's data.
72
+ A request against a database, bucket, or Pages project the caller does not own returns an authorization error, not another account's data. A Pages project with no owner on record cannot be published by anyone until the house records it — the project-to-folder mapping is not derivable, so it is never guessed.
65
73
 
66
74
  ## Where the object tools do their file I/O, and why
67
75
 
@@ -13,14 +13,15 @@
13
13
  *
14
14
  * Claude Code CLI → shim (this file) = node running <real-entry> in-process
15
15
  * stdin/stdout : untouched (JSON-RPC channel)
16
- * stderr : process.stderr.write teed → per-date + per-session + passthrough
16
+ * stderr : process.stderr.write teed → raw sink + passthrough
17
17
  *
18
- * Destinations (Task 706) — unchanged:
19
- * - `${LOG_DIR}/mcp-<name>-stderr-<date>.log` per-date raw (back-compat;
20
- * the in-process mcp-stderr-tee and the [mcp-init-error] probe read it).
21
- * - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — per-session raw + lifecycle
22
- * lines. Authoritative sink. Absent when SESSION_ID is unset (enumeration
23
- * spawn)then the per-date file is the fallback.
18
+ * Destinations:
19
+ * - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — raw stderr + lifecycle lines.
20
+ * The sole raw sink. Task 1721 retired the per-date twin: its date was
21
+ * pinned at spawn, no reader ever parsed it, and mcp-stderr-tee wrote the
22
+ * same file, so every line landed twice.
23
+ * - `${LOG_DIR}/mcp-<name>-nosession.log` — the same, for a spawn with
24
+ * no SESSION_ID (enumeration). One fixed file per server.
24
25
  * - `server.log` via the loopback log-ingest route — best-effort mirror of
25
26
  * the [mcp-helper] lifecycle lines.
26
27
  *
@@ -49,13 +50,13 @@ const PLATFORM_PORT = process.env.PLATFORM_PORT;
49
50
  const ENTRY = process.argv[2];
50
51
  const SESSION_ID8 = SESSION_ID ? SESSION_ID.slice(0, 8) : "—";
51
52
  const spawnStamp = Date.now();
52
- // Per-session raw + lifecycle log (Task 706). Empty SESSION_ID (enumeration
53
- // spawn) undefined, and the per-date file is the fallback.
54
- const perSessionPath = LOG_DIR && SESSION_ID
55
- ? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-${SESSION_ID}.log`)
56
- : undefined;
57
- const perDatePath = LOG_DIR
58
- ? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-stderr-${new Date(spawnStamp).toISOString().slice(0, 10)}.log`)
53
+ // The one raw sink (Task 1721). A sessionless spawn (rc-daemon stamps
54
+ // SESSION_ID='' rc-daemon.ts:513 while still stamping LOG_DIR) shares one
55
+ // fixed file per server rather than a date-named one: the date was never read
56
+ // by any reader and named a process lifetime, not a day. Interleaved spawns in
57
+ // the nosession file are separated by the [mcp-helper] op=spawn pid= lines.
58
+ const rawSinkPath = LOG_DIR
59
+ ? (0, node_path_1.resolve)(LOG_DIR, SESSION_ID ? `mcp-${SERVER_NAME}-${SESSION_ID}.log` : `mcp-${SERVER_NAME}-nosession.log`)
59
60
  : undefined;
60
61
  // Rolling tail of entry stderr for op=exit. Capped so a chatty server cannot
61
62
  // grow the buffer without bound.
@@ -66,7 +67,7 @@ let exitEmitted = false;
66
67
  let exitSignal;
67
68
  // The real stderr writer, captured before the tee replaces it. Lifecycle lines
68
69
  // and stderr passthrough both go through this so they are never re-teed into
69
- // the per-date sink nor recursed back into the patched writer.
70
+ // the raw sink nor recursed back into the patched writer.
70
71
  const rawStderrWrite = process.stderr.write.bind(process.stderr);
71
72
  // LOG_DIR is created once, lazily, on the first successful append — not per
72
73
  // chunk. teeWrite runs on the server's own stderr hot path now, so a per-call
@@ -115,7 +116,7 @@ function postToServerLog(suffix, level) {
115
116
  // log-ingest route rejects newlines).
116
117
  function emitLifecycle(suffix, level) {
117
118
  const line = `[mcp-helper] ${suffix}\n`;
118
- appendSafe(perSessionPath, line);
119
+ appendSafe(rawSinkPath, line);
119
120
  try {
120
121
  rawStderrWrite(line);
121
122
  }
@@ -127,12 +128,11 @@ if (!ENTRY) {
127
128
  process.exit(2);
128
129
  }
129
130
  // Replace process.stderr.write with a tee: mirror every server stderr byte to
130
- // the per-date and per-session sinks, keep a rolling tail for op=exit, emit
131
+ // the raw sink, keep a rolling tail for op=exit, emit
131
132
  // op=boot on the first bytes, then pass the write through to the real stderr.
132
133
  const teeWrite = ((...args) => {
133
134
  const chunk = args[0];
134
- appendSafe(perDatePath, chunk); // per-date raw (back-compat)
135
- appendSafe(perSessionPath, chunk); // per-session raw (Task 706)
135
+ appendSafe(rawSinkPath, chunk); // raw sink (Task 1721)
136
136
  const text = typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
137
137
  stderrTail = (stderrTail + text).slice(-TAIL_CAP);
138
138
  if (!bootEmitted) {
@@ -1 +1 @@
1
- {"version":3,"file":"confine-path.d.ts","sourceRoot":"","sources":["../src/confine-path.ts"],"names":[],"mappings":"AAyCA;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CA4DzE"}
1
+ {"version":3,"file":"confine-path.d.ts","sourceRoot":"","sources":["../src/confine-path.ts"],"names":[],"mappings":"AAoDA;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CA4DzE"}
@@ -11,12 +11,23 @@
11
11
  *
12
12
  * This is a correctness guardrail, not a security boundary, and the difference
13
13
  * matters. Every account shares one unix user and the agent holds Bash, so it
14
- * can already read anything this process can (Task 1690). What actually
15
- * contains the blast radius is that the house-level broker route touches no
16
- * filesystem at all: file I/O stays here, in a process running at the agent's
17
- * own privilege, so it grants nothing the agent did not already have. Moving
18
- * this check server-side would not harden it — it would create the very
14
+ * can already read anything this process can (Task 1690). For the object routes,
15
+ * what contains the blast radius is that the house-level route touches no
16
+ * filesystem: file I/O stays here, in a process running at the agent's own
17
+ * privilege, so it grants nothing the agent did not already have. Moving THIS
18
+ * check server-side would not harden it — it would create the very
19
19
  * house-privileged arbitrary read/write it appears to prevent.
20
+ *
21
+ * Task 1728 narrows the "touches no filesystem at all" claim, which is no longer
22
+ * true of the route file as a whole: /pages/deploy resolves a directory
23
+ * house-side, because wrangler uploads a directory and somebody must name one.
24
+ * That is not a hole this module should try to close, and it does not reopen what
25
+ * this module guards. The published tree is composed from the platform-stamped
26
+ * caller header plus a single-segment site name — never a caller-supplied path —
27
+ * and, per the paragraph above, it grants the agent nothing it lacked: it could
28
+ * already read those bytes and hand them to the publisher itself. The rule that
29
+ * still holds without exception is the one this file exists for: no route
30
+ * resolves an agent-supplied PATH house-side. Object I/O stays client-side.
20
31
  */
21
32
  import { realpathSync, statSync } from "node:fs";
22
33
  import { basename, dirname, join, resolve } from "node:path";
@@ -1 +1 @@
1
- {"version":3,"file":"confine-path.js","sourceRoot":"","sources":["../src/confine-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,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AClB,CAAC"}
@@ -173,6 +173,55 @@ lifelineTool(server, "storage-r2-object-delete", "Delete an object from an R2 bu
173
173
  return textResult(`R2 object delete failed: ${err}`, true);
174
174
  return textResult(`Deleted ${bucket}/${key}.`);
175
175
  });
176
+ // ─── storage-pages-deploy ─────────────────────────────────────────────────
177
+ // Task 1728. Publishing is house-run: this account's secrets carry no Cloudflare
178
+ // master, so the site tree is named here and the house route holds the credential.
179
+ lifelineTool(server, "storage-pages-deploy", "Publish one of your account's site folders to its Cloudflare Pages project. The project must already be recorded to your account.", {
180
+ project: z.string().describe("Pages project name, e.g. glsmithandsons"),
181
+ site: z.string().describe("Folder name under your account's sites/ directory, e.g. gls"),
182
+ branch: z.string().optional().describe("Production branch; omit to let Pages choose"),
183
+ }, async ({ project, site, branch }) => {
184
+ const result = await callApi("storage-pages-deploy", "/api/storage/pages/deploy", "POST", { project, site, branch });
185
+ const err = errorOf(result);
186
+ if (err) {
187
+ // Name the remedy for the two denials an agent can actually act on, rather
188
+ // than echoing a bare slug it will misread as a platform fault.
189
+ if (err === "unregistered") {
190
+ return textResult(`Pages deploy failed: the project "${project}" has no owner on record, so nobody may publish it. Ask the house admin to record it to this account first.`, true);
191
+ }
192
+ if (err === "cross-account") {
193
+ return textResult(`Pages deploy failed: the project "${project}" belongs to another account.`, true);
194
+ }
195
+ if (err === "deploy-unverified") {
196
+ // The upload happened; the live check did not confirm it. Reporting this
197
+ // as success is the exact failure this tool exists to prevent, so it is
198
+ // an error result and the wording denies the agent the word "live".
199
+ const r = result;
200
+ return textResult(`Pages deploy uploaded ${project} but could not confirm it live: ${r.url ?? "the deployment url"} answered ${r.httpStatus ?? "nothing"}, not 200. Do not report this as published. Retry, and if it persists the deploy needs a look.`, true);
201
+ }
202
+ return textResult(`Pages deploy failed: ${err}`, true);
203
+ }
204
+ const url = result.url;
205
+ return textResult(url ? `Published ${project}. Live at ${url}` : "Published.");
206
+ });
207
+ // ─── storage-pages-adopt ──────────────────────────────────────────────────
208
+ // House-only; the route enforces it on the platform-stamped house-admin scope.
209
+ // The project-to-account mapping is not derivable (a folder named `gls` publishes
210
+ // to `glsmithandsons`), so it is recorded deliberately, never guessed.
211
+ lifelineTool(server, "storage-pages-adopt", "House admin only: record which account owns a Cloudflare Pages project, so that account can publish it.", {
212
+ project: z.string().describe("Pages project name, e.g. glsmithandsons"),
213
+ account: z.string().describe("Account id that owns the project"),
214
+ }, async ({ project, account }) => {
215
+ const result = await callApi("storage-pages-adopt", "/api/storage/pages/adopt", "POST", { project, account });
216
+ const err = errorOf(result);
217
+ if (err === "already-owned") {
218
+ const owner = result.owner;
219
+ return textResult(`Pages adopt failed: "${project}" already belongs to ${owner ?? "another account"}. Ownership is never reassigned silently; move it deliberately if that is wrong.`, true);
220
+ }
221
+ if (err)
222
+ return textResult(`Pages adopt failed: ${err}`, true);
223
+ return textResult(`Recorded: ${project} belongs to ${account}.`);
224
+ });
176
225
  async function main() {
177
226
  const transport = new StdioServerTransport();
178
227
  await server.connect(transport);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,aAAa,CAAC,gBAAgB,CAAC,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EA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AAG,MAAM,OAAO,CAAC,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAC9G,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B,IAAI,GAAG,KAAK,eAAe,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAI,MAA6B,CAAC,KAAK,CAAC;QACnD,OAAO,UAAU,CACf,wBAAwB,OAAO,wBAAwB,KAAK,IAAI,iBAAiB,kFAAkF,EACnK,IAAI,CACL,CAAC;IACJ,CAAC;IACD,IAAI,GAAG;QAAE,OAAO,UAAU,CAAC,uBAAuB,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC;IAC/D,OAAO,UAAU,CAAC,aAAa,OAAO,eAAe,OAAO,GAAG,CAAC,CAAC;AACnE,CAAC,CACF,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,+BAA+B,GAAG,EAAE,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -13,14 +13,15 @@
13
13
  *
14
14
  * Claude Code CLI → shim (this file) = node running <real-entry> in-process
15
15
  * stdin/stdout : untouched (JSON-RPC channel)
16
- * stderr : process.stderr.write teed → per-date + per-session + passthrough
16
+ * stderr : process.stderr.write teed → raw sink + passthrough
17
17
  *
18
- * Destinations (Task 706) — unchanged:
19
- * - `${LOG_DIR}/mcp-<name>-stderr-<date>.log` per-date raw (back-compat;
20
- * the in-process mcp-stderr-tee and the [mcp-init-error] probe read it).
21
- * - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — per-session raw + lifecycle
22
- * lines. Authoritative sink. Absent when SESSION_ID is unset (enumeration
23
- * spawn)then the per-date file is the fallback.
18
+ * Destinations:
19
+ * - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — raw stderr + lifecycle lines.
20
+ * The sole raw sink. Task 1721 retired the per-date twin: its date was
21
+ * pinned at spawn, no reader ever parsed it, and mcp-stderr-tee wrote the
22
+ * same file, so every line landed twice.
23
+ * - `${LOG_DIR}/mcp-<name>-nosession.log` — the same, for a spawn with
24
+ * no SESSION_ID (enumeration). One fixed file per server.
24
25
  * - `server.log` via the loopback log-ingest route — best-effort mirror of
25
26
  * the [mcp-helper] lifecycle lines.
26
27
  *
@@ -49,13 +50,13 @@ const PLATFORM_PORT = process.env.PLATFORM_PORT;
49
50
  const ENTRY = process.argv[2];
50
51
  const SESSION_ID8 = SESSION_ID ? SESSION_ID.slice(0, 8) : "—";
51
52
  const spawnStamp = Date.now();
52
- // Per-session raw + lifecycle log (Task 706). Empty SESSION_ID (enumeration
53
- // spawn) undefined, and the per-date file is the fallback.
54
- const perSessionPath = LOG_DIR && SESSION_ID
55
- ? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-${SESSION_ID}.log`)
56
- : undefined;
57
- const perDatePath = LOG_DIR
58
- ? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-stderr-${new Date(spawnStamp).toISOString().slice(0, 10)}.log`)
53
+ // The one raw sink (Task 1721). A sessionless spawn (rc-daemon stamps
54
+ // SESSION_ID='' rc-daemon.ts:513 while still stamping LOG_DIR) shares one
55
+ // fixed file per server rather than a date-named one: the date was never read
56
+ // by any reader and named a process lifetime, not a day. Interleaved spawns in
57
+ // the nosession file are separated by the [mcp-helper] op=spawn pid= lines.
58
+ const rawSinkPath = LOG_DIR
59
+ ? (0, node_path_1.resolve)(LOG_DIR, SESSION_ID ? `mcp-${SERVER_NAME}-${SESSION_ID}.log` : `mcp-${SERVER_NAME}-nosession.log`)
59
60
  : undefined;
60
61
  // Rolling tail of entry stderr for op=exit. Capped so a chatty server cannot
61
62
  // grow the buffer without bound.
@@ -66,7 +67,7 @@ let exitEmitted = false;
66
67
  let exitSignal;
67
68
  // The real stderr writer, captured before the tee replaces it. Lifecycle lines
68
69
  // and stderr passthrough both go through this so they are never re-teed into
69
- // the per-date sink nor recursed back into the patched writer.
70
+ // the raw sink nor recursed back into the patched writer.
70
71
  const rawStderrWrite = process.stderr.write.bind(process.stderr);
71
72
  // LOG_DIR is created once, lazily, on the first successful append — not per
72
73
  // chunk. teeWrite runs on the server's own stderr hot path now, so a per-call
@@ -115,7 +116,7 @@ function postToServerLog(suffix, level) {
115
116
  // log-ingest route rejects newlines).
116
117
  function emitLifecycle(suffix, level) {
117
118
  const line = `[mcp-helper] ${suffix}\n`;
118
- appendSafe(perSessionPath, line);
119
+ appendSafe(rawSinkPath, line);
119
120
  try {
120
121
  rawStderrWrite(line);
121
122
  }
@@ -127,12 +128,11 @@ if (!ENTRY) {
127
128
  process.exit(2);
128
129
  }
129
130
  // Replace process.stderr.write with a tee: mirror every server stderr byte to
130
- // the per-date and per-session sinks, keep a rolling tail for op=exit, emit
131
+ // the raw sink, keep a rolling tail for op=exit, emit
131
132
  // op=boot on the first bytes, then pass the write through to the real stderr.
132
133
  const teeWrite = ((...args) => {
133
134
  const chunk = args[0];
134
- appendSafe(perDatePath, chunk); // per-date raw (back-compat)
135
- appendSafe(perSessionPath, chunk); // per-session raw (Task 706)
135
+ appendSafe(rawSinkPath, chunk); // raw sink (Task 1721)
136
136
  const text = typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
137
137
  stderrTail = (stderrTail + text).slice(-TAIL_CAP);
138
138
  if (!bootEmitted) {
@@ -13,14 +13,15 @@
13
13
  *
14
14
  * Claude Code CLI → shim (this file) = node running <real-entry> in-process
15
15
  * stdin/stdout : untouched (JSON-RPC channel)
16
- * stderr : process.stderr.write teed → per-date + per-session + passthrough
16
+ * stderr : process.stderr.write teed → raw sink + passthrough
17
17
  *
18
- * Destinations (Task 706) — unchanged:
19
- * - `${LOG_DIR}/mcp-<name>-stderr-<date>.log` per-date raw (back-compat;
20
- * the in-process mcp-stderr-tee and the [mcp-init-error] probe read it).
21
- * - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — per-session raw + lifecycle
22
- * lines. Authoritative sink. Absent when SESSION_ID is unset (enumeration
23
- * spawn)then the per-date file is the fallback.
18
+ * Destinations:
19
+ * - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — raw stderr + lifecycle lines.
20
+ * The sole raw sink. Task 1721 retired the per-date twin: its date was
21
+ * pinned at spawn, no reader ever parsed it, and mcp-stderr-tee wrote the
22
+ * same file, so every line landed twice.
23
+ * - `${LOG_DIR}/mcp-<name>-nosession.log` — the same, for a spawn with
24
+ * no SESSION_ID (enumeration). One fixed file per server.
24
25
  * - `server.log` via the loopback log-ingest route — best-effort mirror of
25
26
  * the [mcp-helper] lifecycle lines.
26
27
  *
@@ -49,13 +50,13 @@ const PLATFORM_PORT = process.env.PLATFORM_PORT;
49
50
  const ENTRY = process.argv[2];
50
51
  const SESSION_ID8 = SESSION_ID ? SESSION_ID.slice(0, 8) : "—";
51
52
  const spawnStamp = Date.now();
52
- // Per-session raw + lifecycle log (Task 706). Empty SESSION_ID (enumeration
53
- // spawn) undefined, and the per-date file is the fallback.
54
- const perSessionPath = LOG_DIR && SESSION_ID
55
- ? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-${SESSION_ID}.log`)
56
- : undefined;
57
- const perDatePath = LOG_DIR
58
- ? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}-stderr-${new Date(spawnStamp).toISOString().slice(0, 10)}.log`)
53
+ // The one raw sink (Task 1721). A sessionless spawn (rc-daemon stamps
54
+ // SESSION_ID='' rc-daemon.ts:513 while still stamping LOG_DIR) shares one
55
+ // fixed file per server rather than a date-named one: the date was never read
56
+ // by any reader and named a process lifetime, not a day. Interleaved spawns in
57
+ // the nosession file are separated by the [mcp-helper] op=spawn pid= lines.
58
+ const rawSinkPath = LOG_DIR
59
+ ? (0, node_path_1.resolve)(LOG_DIR, SESSION_ID ? `mcp-${SERVER_NAME}-${SESSION_ID}.log` : `mcp-${SERVER_NAME}-nosession.log`)
59
60
  : undefined;
60
61
  // Rolling tail of entry stderr for op=exit. Capped so a chatty server cannot
61
62
  // grow the buffer without bound.
@@ -66,7 +67,7 @@ let exitEmitted = false;
66
67
  let exitSignal;
67
68
  // The real stderr writer, captured before the tee replaces it. Lifecycle lines
68
69
  // and stderr passthrough both go through this so they are never re-teed into
69
- // the per-date sink nor recursed back into the patched writer.
70
+ // the raw sink nor recursed back into the patched writer.
70
71
  const rawStderrWrite = process.stderr.write.bind(process.stderr);
71
72
  // LOG_DIR is created once, lazily, on the first successful append — not per
72
73
  // chunk. teeWrite runs on the server's own stderr hot path now, so a per-call
@@ -115,7 +116,7 @@ function postToServerLog(suffix, level) {
115
116
  // log-ingest route rejects newlines).
116
117
  function emitLifecycle(suffix, level) {
117
118
  const line = `[mcp-helper] ${suffix}\n`;
118
- appendSafe(perSessionPath, line);
119
+ appendSafe(rawSinkPath, line);
119
120
  try {
120
121
  rawStderrWrite(line);
121
122
  }
@@ -127,12 +128,11 @@ if (!ENTRY) {
127
128
  process.exit(2);
128
129
  }
129
130
  // Replace process.stderr.write with a tee: mirror every server stderr byte to
130
- // the per-date and per-session sinks, keep a rolling tail for op=exit, emit
131
+ // the raw sink, keep a rolling tail for op=exit, emit
131
132
  // op=boot on the first bytes, then pass the write through to the real stderr.
132
133
  const teeWrite = ((...args) => {
133
134
  const chunk = args[0];
134
- appendSafe(perDatePath, chunk); // per-date raw (back-compat)
135
- appendSafe(perSessionPath, chunk); // per-session raw (Task 706)
135
+ appendSafe(rawSinkPath, chunk); // raw sink (Task 1721)
136
136
  const text = typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
137
137
  stderrTail = (stderrTail + text).slice(-TAIL_CAP);
138
138
  if (!bootEmitted) {