@rubytech/create-maxy-code 0.1.461 → 0.1.462

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 (148) 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 +22 -11
  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/outlook-guide.md +11 -4
  56. package/payload/platform/plugins/docs/references/plugins-guide.md +8 -6
  57. package/payload/platform/plugins/email/lib/mcp-spawn-tee/index.js +19 -19
  58. package/payload/platform/plugins/filesystem/lib/mcp-spawn-tee/index.js +19 -19
  59. package/payload/platform/plugins/graph-viewer/lib/mcp-spawn-tee/index.js +19 -19
  60. package/payload/platform/plugins/memory/PLUGIN.md +1 -1
  61. package/payload/platform/plugins/memory/lib/mcp-spawn-tee/index.js +19 -19
  62. package/payload/platform/plugins/memory/mcp/dist/lib/log-ingest.js +2 -2
  63. package/payload/platform/plugins/memory/mcp/dist/lib/log-ingest.js.map +1 -1
  64. package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
  65. package/payload/platform/plugins/outlook/PLUGIN.md +2 -2
  66. package/payload/platform/plugins/outlook/lib/mcp-spawn-tee/index.js +19 -19
  67. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.d.ts +2 -0
  68. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.d.ts.map +1 -0
  69. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.js +238 -0
  70. package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.js.map +1 -0
  71. package/payload/platform/plugins/outlook/mcp/dist/index.js +9 -5
  72. package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
  73. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts +58 -9
  74. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts.map +1 -1
  75. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js +113 -19
  76. package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js.map +1 -1
  77. package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +5 -2
  78. package/payload/platform/plugins/quickbooks/lib/mcp-spawn-tee/index.js +19 -19
  79. package/payload/platform/plugins/replicate/lib/mcp-spawn-tee/index.js +19 -19
  80. package/payload/platform/plugins/scheduling/lib/mcp-spawn-tee/index.js +19 -19
  81. package/payload/platform/plugins/storage-broker/PLUGIN.md +9 -1
  82. package/payload/platform/plugins/storage-broker/lib/mcp-spawn-tee/index.js +19 -19
  83. package/payload/platform/plugins/storage-broker/mcp/dist/confine-path.d.ts.map +1 -1
  84. package/payload/platform/plugins/storage-broker/mcp/dist/confine-path.js +16 -5
  85. package/payload/platform/plugins/storage-broker/mcp/dist/confine-path.js.map +1 -1
  86. package/payload/platform/plugins/storage-broker/mcp/dist/index.js +49 -0
  87. package/payload/platform/plugins/storage-broker/mcp/dist/index.js.map +1 -1
  88. package/payload/platform/plugins/telegram/lib/mcp-spawn-tee/index.js +19 -19
  89. package/payload/platform/plugins/url-get/lib/mcp-spawn-tee/index.js +19 -19
  90. package/payload/platform/plugins/voice-mirror/lib/mcp-spawn-tee/index.js +19 -19
  91. package/payload/platform/plugins/web-designer/PLUGIN.md +1 -1
  92. package/payload/platform/plugins/web-designer/commands/website.md +6 -0
  93. package/payload/platform/plugins/web-designer/skills/web-design/references/deploy.md +12 -0
  94. package/payload/platform/plugins/whatsapp/lib/mcp-spawn-tee/index.js +19 -19
  95. package/payload/platform/plugins/work/lib/mcp-spawn-tee/index.js +19 -19
  96. package/payload/platform/plugins/workflows/lib/mcp-spawn-tee/index.js +19 -19
  97. package/payload/platform/scripts/__tests__/logs-rotate.test.sh +24 -20
  98. package/payload/platform/scripts/logs-read.sh +31 -0
  99. package/payload/platform/scripts/logs-rotate.sh +21 -18
  100. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
  101. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +2 -0
  102. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
  103. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  104. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +37 -0
  105. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  106. package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts +5 -3
  107. package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts.map +1 -1
  108. package/payload/platform/services/claude-session-manager/dist/rc-daemon.js.map +1 -1
  109. package/payload/server/{chunk-JXWFVE5X.js → chunk-BBSPFN45.js} +65 -0
  110. package/payload/server/public/assets/{AdminLoginScreens-BFbpkEUS.js → AdminLoginScreens-Bed8SDxY.js} +1 -1
  111. package/payload/server/public/assets/{AdminShell-CdOGObaZ.js → AdminShell-BLh9O6dn.js} +1 -1
  112. package/payload/server/public/assets/{Checkbox-RFD_F0c0.js → Checkbox-BC_KSbpS.js} +1 -1
  113. package/payload/server/public/assets/{admin-CYGdL-1O.js → admin-DfWgJVI3.js} +1 -1
  114. package/payload/server/public/assets/{browser-DVfa_plj.js → browser-C0vkv-hH.js} +1 -1
  115. package/payload/server/public/assets/{calendar-JC_Dxa4n.js → calendar-_pfHw0Hp.js} +1 -1
  116. package/payload/server/public/assets/chat-CufidiBQ.js +1 -0
  117. package/payload/server/public/assets/chevron-left-BnpVBu51.js +1 -0
  118. package/payload/server/public/assets/data-CR-fbPWr.js +1 -0
  119. package/payload/server/public/assets/{graph-hBUrRSkr.js → graph-BZiudUGr.js} +1 -1
  120. package/payload/server/public/assets/{graph-labels-CHh6zs8t.js → graph-labels-BzmmJwCR.js} +1 -1
  121. package/payload/server/public/assets/{maximize-2-DjxE4rm9.js → maximize-2-Bhdsv0U-.js} +1 -1
  122. package/payload/server/public/assets/{operator-BqU9SQuu.js → operator-Cj0B_usT.js} +1 -1
  123. package/payload/server/public/assets/page-84Fdwiu_.js +32 -0
  124. package/payload/server/public/assets/{page-DiQhU6lD.js → page-8AB3jUa_.js} +1 -1
  125. package/payload/server/public/assets/{public-Cu_eALgY.js → public-BkNW9e9T.js} +1 -1
  126. package/payload/server/public/assets/{rotate-ccw-F9DsSTSJ.js → rotate-ccw-D_5cETGt.js} +1 -1
  127. package/payload/server/public/assets/{tasks-CE-D0f50.js → tasks-EyKLXINi.js} +1 -1
  128. package/payload/server/public/assets/{time-entry-format-D2rsWhov.js → time-entry-format-DAwmmR3i.js} +1 -1
  129. package/payload/server/public/assets/{useCopyFeedback-QxOmoobV.js → useCopyFeedback-rOWd_lzl.js} +1 -1
  130. package/payload/server/public/assets/{useSelectionMode-RIzNqFjV.js → useSelectionMode-DDmLmPph.js} +1 -1
  131. package/payload/server/public/assets/{useSubAccountSwitcher-BW_fK1Nt.css → useSubAccountSwitcher-pu0jjLCz.css} +1 -1
  132. package/payload/server/public/assets/{useVoiceRecorder-WrWurSYI.js → useVoiceRecorder-azG8zSUI.js} +1 -1
  133. package/payload/server/public/browser.html +5 -5
  134. package/payload/server/public/calendar.html +6 -6
  135. package/payload/server/public/chat.html +12 -12
  136. package/payload/server/public/data.html +10 -10
  137. package/payload/server/public/graph.html +11 -11
  138. package/payload/server/public/index.html +13 -13
  139. package/payload/server/public/operator.html +14 -14
  140. package/payload/server/public/public.html +12 -12
  141. package/payload/server/public/tasks.html +5 -5
  142. package/payload/server/server.js +526 -174
  143. package/payload/server/{src-4F37OHLK.js → src-YLGAZY36.js} +5 -1
  144. package/payload/server/public/assets/chat-Yf8Nkop8.js +0 -1
  145. package/payload/server/public/assets/chevron-left-CAiAUBxO.js +0 -1
  146. package/payload/server/public/assets/data-hqdYXaEn.js +0 -1
  147. package/payload/server/public/assets/page-B4c4_4HP.js +0 -32
  148. /package/payload/server/public/assets/{useSubAccountSwitcher-wo_qGW-I.js → useSubAccountSwitcher-CU-lOxTd.js} +0 -0
@@ -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) {
@@ -4,7 +4,7 @@
4
4
  // `server.log` via the loopback `/api/admin/log-ingest` route. Without this,
5
5
  // the memory MCP is two-haystack, one-direction observable: success paths
6
6
  // emit nothing, and failure paths only reach
7
- // `~/.<brand>/logs/mcp-memory-stderr-<date>.log` as free-form strings the
7
+ // `~/.<brand>/logs/mcp-memory-<sessionId>.log` as free-form strings the
8
8
  // operator cannot grep by enumerated cause.
9
9
  //
10
10
  // Line shape, success:
@@ -40,7 +40,7 @@ export async function emitWriteEvent(ev) {
40
40
  const port = process.env.PLATFORM_PORT;
41
41
  // If PLATFORM_PORT is unset, the MCP wasn't spawned by the session
42
42
  // manager (e.g. direct CLI invocation). Write the event to stderr so
43
- // the line still lands somewhere — mcp-memory-stderr-<date>.log catches it.
43
+ // the line still lands somewhere — mcp-memory-<sessionId>.log catches it.
44
44
  if (!port) {
45
45
  process.stderr.write(`[${TAG}] ${line}\n`);
46
46
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"log-ingest.js","sourceRoot":"","sources":["../../src/lib/log-ingest.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,0EAA0E;AAC1E,6CAA6C;AAC7C,0EAA0E;AAC1E,4CAA4C;AAC5C,EAAE;AACF,uBAAuB;AACvB,gHAAgH;AAChH,uBAAuB;AACvB,oIAAoI;AACpI,EAAE;AACF,yEAAyE;AACzE,0EAA0E;AAC1E,4EAA4E;AAC5E,sEAAsE;AACtE,gBAAgB;AAEhB,MAAM,GAAG,GAAG,YAAY,CAAC;AACzB,MAAM,aAAa,GAAG,WAAW,CAAC;AAClC,MAAM,aAAa,GAAG,uBAAuB,CAAC;AAC9C,MAAM,UAAU,GAAG,GAAG,CAAC;AAuCvB,kEAAkE;AAClE,MAAM,UAAU,oBAAoB,CAAC,EAAc;IACjD,MAAM,IAAI,GAAG,EAAE,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C,IAAI,IAAI,CAAC,MAAM,IAAI,UAAU;QAAE,OAAO,IAAI,CAAC;IAC3C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;AAC7C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "outlook",
3
- "description": "Microsoft 365 / Outlook.com via Microsoft Graph. Mail is read (list, search, full-body), reply, delete, and compose (draft, draft-edit, send); contacts are read-only; calendar is read + control. Per-account OAuth device-code flow; no client secret. One account can hold several mailboxes at once; every operational tool takes an optional mailbox selector (email or graphUserId) and refuses ambiguously when two or more are attached and none is named. Tools — outlook-account-register / outlook-account-register-poll: device-code register (start + poll); outlook-mail-list / outlook-mail-search: inbox triage (~255-char preview) with a date window (list) or KQL from:/subject: filters (search) and a nextCursor for paging beyond the newest page; outlook-mail-fetch-body: full body of one message by id; outlook-mail-attachment: list any message's attachments (received or draft), or download one file attachment's bytes to the account uploads folder; outlook-mail-reply: in-thread reply (replyAll, cc/bcc, attachments); outlook-mail-delete: move to Deleted Items (recoverable); outlook-mail-otp-extract: poll for a one-time code; outlook-mail-send / outlook-draft / outlook-draft-edit / outlook-draft-send: compose, edit, and send, all with attachments; outlook-calendar-list / outlook-calendar-event: read calendar; outlook-calendar-create / outlook-calendar-update / outlook-calendar-cancel / outlook-calendar-respond / outlook-calendar-freebusy: control calendar; outlook-contacts-list: contacts; outlook-mailbox-info: auth state + folder count for one mailbox; outlook-mailbox-list: every connected mailbox.",
3
+ "description": "Microsoft 365 / Outlook.com via Microsoft Graph. Mail is read (list, search, full-body), reply, delete, and compose (draft, draft-edit, send); contacts are read-only; calendar is read + control. Per-account OAuth device-code flow; no client secret. One account can hold several mailboxes at once; every operational tool takes an optional mailbox selector (email or graphUserId) and refuses ambiguously when two or more are attached and none is named. Tools — outlook-account-register / outlook-account-register-poll: device-code register (start + poll); outlook-mail-list / outlook-mail-search: inbox triage (~255-char preview) with a date window (list) or KQL from:/subject: filters (search) and a nextCursor for paging beyond the newest page; outlook-mail-fetch-body: full body of one message by id; outlook-mail-attachment: list any message's attachments (received or draft), or download one file attachment's bytes to the account uploads folder; outlook-mail-reply: in-thread reply (replyAll, cc/bcc, attachments); outlook-mail-delete: move to Deleted Items (recoverable); outlook-mail-otp-extract: poll for a one-time code; outlook-mail-send / outlook-draft / outlook-draft-edit / outlook-draft-send: compose, edit, and send, all with attachments — outlook-draft takes an optional replyToMessageId to draft a threaded reply, unsent, under the original conversation; outlook-calendar-list / outlook-calendar-event: read calendar; outlook-calendar-create / outlook-calendar-update / outlook-calendar-cancel / outlook-calendar-respond / outlook-calendar-freebusy: control calendar; outlook-contacts-list: contacts; outlook-mailbox-info: auth state + folder count for one mailbox; outlook-mailbox-list: every connected mailbox.",
4
4
  "version": "0.1.0",
5
5
  "author": {
6
6
  "name": "Rubytech LLC"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: outlook
3
- description: Microsoft 365 / Outlook.com via Microsoft Graph. Mail is read (list, search, full-body), reply, delete, and compose (draft, draft-edit, send); contacts are read-only; calendar is read + control. Per-account OAuth device-code flow; no client secret. One account can hold several mailboxes at once; every operational tool takes an optional mailbox selector (email or graphUserId) and refuses ambiguously when two or more are attached and none is named. Tools — outlook-account-register / outlook-account-register-poll: device-code register (start + poll); outlook-mail-list / outlook-mail-search: inbox triage (~255-char preview) with a date window (list) or KQL from:/subject: filters (search) and a nextCursor for paging beyond the newest page; outlook-mail-fetch-body: full body of one message by id; outlook-mail-attachment: list any message's attachments (received or draft), or download one file attachment's bytes to the account uploads folder; outlook-mail-reply: in-thread reply (replyAll, cc/bcc, attachments); outlook-mail-delete: move to Deleted Items (recoverable); outlook-mail-otp-extract: poll for a one-time code; outlook-mail-send / outlook-draft / outlook-draft-edit / outlook-draft-send: compose, edit, and send, all with attachments; outlook-calendar-list / outlook-calendar-event: read calendar; outlook-calendar-create / outlook-calendar-update / outlook-calendar-cancel / outlook-calendar-respond / outlook-calendar-freebusy: control calendar; outlook-contacts-list: contacts; outlook-mailbox-info: auth state + folder count for one mailbox; outlook-mailbox-list: every connected mailbox.
3
+ description: Microsoft 365 / Outlook.com via Microsoft Graph. Mail is read (list, search, full-body), reply, delete, and compose (draft, draft-edit, send); contacts are read-only; calendar is read + control. Per-account OAuth device-code flow; no client secret. One account can hold several mailboxes at once; every operational tool takes an optional mailbox selector (email or graphUserId) and refuses ambiguously when two or more are attached and none is named. Tools — outlook-account-register / outlook-account-register-poll: device-code register (start + poll); outlook-mail-list / outlook-mail-search: inbox triage (~255-char preview) with a date window (list) or KQL from:/subject: filters (search) and a nextCursor for paging beyond the newest page; outlook-mail-fetch-body: full body of one message by id; outlook-mail-attachment: list any message's attachments (received or draft), or download one file attachment's bytes to the account uploads folder; outlook-mail-reply: in-thread reply (replyAll, cc/bcc, attachments); outlook-mail-delete: move to Deleted Items (recoverable); outlook-mail-otp-extract: poll for a one-time code; outlook-mail-send / outlook-draft / outlook-draft-edit / outlook-draft-send: compose, edit, and send, all with attachments — outlook-draft takes an optional replyToMessageId to draft a threaded reply, unsent, under the original conversation; outlook-calendar-list / outlook-calendar-event: read calendar; outlook-calendar-create / outlook-calendar-update / outlook-calendar-cancel / outlook-calendar-respond / outlook-calendar-freebusy: control calendar; outlook-contacts-list: contacts; outlook-mailbox-info: auth state + folder count for one mailbox; outlook-mailbox-list: every connected mailbox.
4
4
  tools:
5
5
  - name: outlook-account-register
6
6
  publicAllowlist: false
@@ -100,7 +100,7 @@ Microsoft Graph access for Outlook.com / Microsoft 365 mailboxes. Mail is read (
100
100
  - **Mail (attachments):** `outlook-mail-attachment` lists or downloads any message's attachments — received or draft. Called with `messageId` alone it LISTS them (`id`, `name`, `contentType`, `size`, `isInline`, and a `kind` of `file`/`item`/`reference`) via `GET /me/messages/{id}/attachments` with `$select` (no bytes); a draft is a message in the same collection, so passing a draftId lists what that draft carries, and the returned `name`/`id` is the handle `outlook-draft-edit`'s `removeAttachments` takes. Called with `messageId`+`attachmentId` it DOWNLOADS one file attachment: the bytes are written to `{accountDir}/uploads/outlook/<messageHash>/<bytesHash>-<name>` at `0o600` and the saved absolute path is returned, ready for the Read tool, `SendUserFile`, or an `outlook-mail-reply` attachment. Only file attachments download — `item` (embedded message/event) and `reference` (cloud-drive link) kinds are refused, as are empty payloads and anything over the 25 MB cap; in each case nothing is written. Requires `Mail.Read`.
101
101
  - **Mail (reply / delete):** `outlook-mail-reply` replies in-thread (native `conversationId` threading) with `replyAll`, added cc/bcc, and account-scoped file attachments (up to 25 MB per file — files over Graph's ~3 MB inline limit stream through a chunked upload session); the body is prepended above the quoted original. `outlook-mail-delete` moves messages to Deleted Items (recoverable — never hard-deletes). Both require `Mail.ReadWrite` (reply also needs `Mail.Send`).
102
102
  - **Mail (OTP):** `outlook-mail-otp-extract` polls the inbox for a one-time verification code from a named sender, reading full bodies to extract it — used during service authentication.
103
- - **Mail (send / draft):** `outlook-mail-send` sends a new message — via `POST /me/sendMail` with no attachments, or composed as a draft, attached, and sent when `attachments` is present (`/me/sendMail` carries attachments inline and cannot fit a large file); `outlook-draft` creates a draft, attaches any files, and returns its id; `outlook-draft-edit` updates an existing draft in place (Graph drafts are mutable) and edits its attachments — `attachments` adds files, `removeAttachments` takes them off by name or attachment id, and both together replace a file in one call; `outlook-draft-send` sends an existing draft by id. Recipients are to/cc/bcc arrays; body is HTML or plain text via `isHtml`; `attachments` are file paths inside the account directory, capped at 25 MB per file and validated before any Graph write. Success asserted on Graph 202. Requires `Mail.Send` + `Mail.ReadWrite`; a mailbox on the old read-only consent returns an actionable "re-register to grant send" signal.
103
+ - **Mail (send / draft):** `outlook-mail-send` sends a new message — via `POST /me/sendMail` with no attachments, or composed as a draft, attached, and sent when `attachments` is present (`/me/sendMail` carries attachments inline and cannot fit a large file); `outlook-draft` creates a draft, attaches any files, and returns its id — either a new message (`to` + `subject` required) or, with `replyToMessageId`, a threaded reply created via `POST /me/messages/{id}/createReply` that lands under the original conversation (the only way to draft a reply without sending it; `outlook-mail-reply` threads but always sends). On the threaded path Graph sets the recipients and `RE:` subject from the original and composes the body above its own quote — the same email `outlook-mail-reply` sends — so that path is plain text only and `to`, `subject`, and `isHtml: true` are refused rather than silently dropped; `replyAll` and `cc`/`bcc` work as on reply. `outlook-draft-edit` updates an existing draft in place (Graph drafts are mutable) and edits its attachments — `attachments` adds files, `removeAttachments` takes them off by name or attachment id, and both together replace a file in one call; `outlook-draft-send` sends an existing draft by id. Recipients are to/cc/bcc arrays; body is HTML or plain text via `isHtml`; `attachments` are file paths inside the account directory, capped at 25 MB per file and validated before any Graph write. Success asserted on Graph 202. Requires `Mail.Send` + `Mail.ReadWrite`; a mailbox on the old read-only consent returns an actionable "re-register to grant send" signal.
104
104
  - **Calendar (read + control):** `outlook-calendar-list` and `outlook-calendar-event` read events; `outlook-calendar-create` books an event; `outlook-calendar-update` reschedules or edits one; `outlook-calendar-cancel` cancels a meeting (notifying attendees when the account organises it) or deletes a personal appointment; `outlook-calendar-respond` accepts, declines, or tentatively accepts an invite; `outlook-calendar-freebusy` reports availability for one or more addresses over a window. Writes require the `Calendars.ReadWrite` consent; a mailbox on stale read-only consent returns a distinct signal naming the scope and `outlook-account-register`.
105
105
  - **Contacts (read-only):** `outlook-contacts-list` returns contacts.
106
106
  - **Health:** `outlook-mailbox-info` reports auth state, refresh-window status, and top-level folder count for one mailbox (name it with `mailbox` when several are attached). `outlook-mailbox-list` lists every attached mailbox with its email, scopes, and token health, reading local stores only, never the network. It reports an `addressable` count and a per-mailbox `status` (`ok` / `blank-email` / `refresh-expired` / `unreadable`) so an authenticated, addressable mailbox is distinguishable from one that is merely present: a bare `count` of 1 is not "connected" unless that mailbox is `status:ok`. Use these to answer "did mailbox X auth?" without grepping logs.
@@ -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) {
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=draft-threaded.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-threaded.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/draft-threaded.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,238 @@
1
+ import test from "node:test";
2
+ import assert from "node:assert/strict";
3
+ import { mkdtempSync } from "node:fs";
4
+ import { tmpdir } from "node:os";
5
+ import { join } from "node:path";
6
+ import { TokenStore } from "../auth/token-store.js";
7
+ import { runDraft } from "../tools/draft.js";
8
+ function configWithToken(accountId) {
9
+ const dir = mkdtempSync(join(tmpdir(), "outlook-draft-"));
10
+ const tokenStore = new TokenStore(accountId, dir);
11
+ tokenStore.store("access-token", "refresh-token", 3600, { scopes: ["Mail.ReadWrite"] });
12
+ return { clientId: "test-client", tenantId: "common", accountId, tokenStore };
13
+ }
14
+ function mockGraph(status, bodyObj) {
15
+ const calls = [];
16
+ const original = globalThis.fetch;
17
+ globalThis.fetch = (async (input, init) => {
18
+ const req = input instanceof Request ? input : null;
19
+ const url = req ? req.url : typeof input === "string" ? input : input.toString();
20
+ if (!url.includes("graph.microsoft.com"))
21
+ return original(input, init);
22
+ let body = null;
23
+ if (req)
24
+ body = await req.clone().text().catch(() => null);
25
+ else if (typeof init?.body === "string")
26
+ body = init.body;
27
+ calls.push({ url, method: req?.method ?? init?.method ?? "GET", body });
28
+ const payload = bodyObj === null ? null : JSON.stringify(bodyObj);
29
+ const headers = bodyObj === null ? undefined : { "content-type": "application/json" };
30
+ return new Response(payload, { status, headers });
31
+ });
32
+ return {
33
+ restore: () => {
34
+ globalThis.fetch = original;
35
+ },
36
+ calls,
37
+ };
38
+ }
39
+ const REPLY_DRAFT = {
40
+ id: "DRAFT1",
41
+ conversationId: "CONV1",
42
+ toRecipients: [{ emailAddress: { address: "matt@leadpro247.com" } }],
43
+ ccRecipients: [{ emailAddress: { address: "orig-cc@corp.com" } }],
44
+ };
45
+ const NEW_DRAFT = { id: "DRAFT2" };
46
+ // ---------------------------------------------------------------------------
47
+ // Threaded path
48
+ // ---------------------------------------------------------------------------
49
+ test("threaded: replyToMessageId → createReply with the body as comment, draft carries the parent conversationId", async () => {
50
+ const mock = mockGraph(201, REPLY_DRAFT);
51
+ try {
52
+ const r = await runDraft(configWithToken("acct-t1"), {
53
+ body: "Cheers Matt, reg number is wrong.",
54
+ replyToMessageId: "M1",
55
+ });
56
+ assert.equal(r.draftId, "DRAFT1");
57
+ assert.equal(r.conversationId, "CONV1");
58
+ assert.equal(r.threaded, true);
59
+ assert.equal(mock.calls.length, 1, "createReply only — no send");
60
+ assert.match(mock.calls[0].url, /\/me\/messages\/M1\/createReply$/);
61
+ assert.match(mock.calls[0].body ?? "", /"comment":"Cheers Matt, reg number is wrong\."/);
62
+ }
63
+ finally {
64
+ mock.restore();
65
+ }
66
+ });
67
+ test("threaded: never sends — no /send call is issued", async () => {
68
+ const mock = mockGraph(201, REPLY_DRAFT);
69
+ try {
70
+ await runDraft(configWithToken("acct-t2"), { body: "Draft only", replyToMessageId: "M1" });
71
+ assert.ok(!mock.calls.some((c) => /\/send$/.test(c.url)), "a draft tool must never send");
72
+ }
73
+ finally {
74
+ mock.restore();
75
+ }
76
+ });
77
+ test("threaded: replyAll → createReplyAll", async () => {
78
+ const mock = mockGraph(201, REPLY_DRAFT);
79
+ try {
80
+ const r = await runDraft(configWithToken("acct-t3"), {
81
+ body: "All",
82
+ replyToMessageId: "M2",
83
+ replyAll: true,
84
+ });
85
+ assert.equal(r.threaded, true);
86
+ assert.match(mock.calls[0].url, /\/me\/messages\/M2\/createReplyAll$/);
87
+ }
88
+ finally {
89
+ mock.restore();
90
+ }
91
+ });
92
+ test("threaded: cc/bcc → PATCH merges added cc with the draft's existing cc", async () => {
93
+ const mock = mockGraph(201, REPLY_DRAFT);
94
+ try {
95
+ await runDraft(configWithToken("acct-t4"), {
96
+ body: "With copies",
97
+ replyToMessageId: "M3",
98
+ cc: ["new-cc@corp.com"],
99
+ bcc: ["hidden@corp.com"],
100
+ });
101
+ const patch = mock.calls.find((c) => c.method === "PATCH");
102
+ assert.ok(patch, "a PATCH updated the draft");
103
+ assert.match(patch.url, /\/me\/messages\/DRAFT1$/);
104
+ assert.match(patch.body ?? "", /orig-cc@corp\.com/);
105
+ assert.match(patch.body ?? "", /new-cc@corp\.com/);
106
+ assert.match(patch.body ?? "", /hidden@corp\.com/);
107
+ }
108
+ finally {
109
+ mock.restore();
110
+ }
111
+ });
112
+ test("threaded: no cc/bcc → no PATCH", async () => {
113
+ const mock = mockGraph(201, REPLY_DRAFT);
114
+ try {
115
+ await runDraft(configWithToken("acct-t5"), { body: "Plain", replyToMessageId: "M4" });
116
+ assert.ok(!mock.calls.some((c) => c.method === "PATCH"), "nothing to patch");
117
+ }
118
+ finally {
119
+ mock.restore();
120
+ }
121
+ });
122
+ // ---------------------------------------------------------------------------
123
+ // Refusals — refuse, never ignore. Each must refuse BEFORE any Graph write.
124
+ // ---------------------------------------------------------------------------
125
+ test("threaded refusal: `to` is refused, and nothing is written to Graph", async () => {
126
+ const mock = mockGraph(201, REPLY_DRAFT);
127
+ try {
128
+ await assert.rejects(runDraft(configWithToken("acct-r1"), {
129
+ body: "x",
130
+ replyToMessageId: "M1",
131
+ to: ["someone@corp.com"],
132
+ }), /to/i);
133
+ assert.equal(mock.calls.length, 0, "refused before any Graph write");
134
+ }
135
+ finally {
136
+ mock.restore();
137
+ }
138
+ });
139
+ test("threaded refusal: `subject` is refused, and nothing is written to Graph", async () => {
140
+ const mock = mockGraph(201, REPLY_DRAFT);
141
+ try {
142
+ await assert.rejects(runDraft(configWithToken("acct-r2"), {
143
+ body: "x",
144
+ replyToMessageId: "M1",
145
+ subject: "RE: Signature",
146
+ }), /subject/i);
147
+ assert.equal(mock.calls.length, 0, "refused before any Graph write");
148
+ }
149
+ finally {
150
+ mock.restore();
151
+ }
152
+ });
153
+ test("threaded refusal: `isHtml: true` is refused, and nothing is written to Graph", async () => {
154
+ const mock = mockGraph(201, REPLY_DRAFT);
155
+ try {
156
+ await assert.rejects(runDraft(configWithToken("acct-r3"), {
157
+ body: "<b>x</b>",
158
+ replyToMessageId: "M1",
159
+ isHtml: true,
160
+ }), /isHtml|plain text/i);
161
+ assert.equal(mock.calls.length, 0, "refused before any Graph write");
162
+ }
163
+ finally {
164
+ mock.restore();
165
+ }
166
+ });
167
+ test("threaded: `isHtml: false` is not a refusal — it agrees with the path", async () => {
168
+ const mock = mockGraph(201, REPLY_DRAFT);
169
+ try {
170
+ const r = await runDraft(configWithToken("acct-r4"), {
171
+ body: "x",
172
+ replyToMessageId: "M1",
173
+ isHtml: false,
174
+ });
175
+ assert.equal(r.threaded, true);
176
+ }
177
+ finally {
178
+ mock.restore();
179
+ }
180
+ });
181
+ // ---------------------------------------------------------------------------
182
+ // Standalone path — unchanged
183
+ // ---------------------------------------------------------------------------
184
+ test("standalone: no replyToMessageId → POST /me/messages, not threaded", async () => {
185
+ const mock = mockGraph(201, NEW_DRAFT);
186
+ try {
187
+ const r = await runDraft(configWithToken("acct-s1"), {
188
+ to: ["matt@leadpro247.com"],
189
+ subject: "Signature",
190
+ body: "New message",
191
+ });
192
+ assert.equal(r.draftId, "DRAFT2");
193
+ assert.equal(r.conversationId, null);
194
+ assert.equal(r.threaded, false);
195
+ assert.equal(mock.calls.length, 1);
196
+ assert.match(mock.calls[0].url, /\/me\/messages$/);
197
+ assert.match(mock.calls[0].body ?? "", /"subject":"Signature"/);
198
+ }
199
+ finally {
200
+ mock.restore();
201
+ }
202
+ });
203
+ test("standalone: isHtml is still honoured", async () => {
204
+ const mock = mockGraph(201, NEW_DRAFT);
205
+ try {
206
+ await runDraft(configWithToken("acct-s2"), {
207
+ to: ["matt@leadpro247.com"],
208
+ subject: "S",
209
+ body: "<b>hi</b>",
210
+ isHtml: true,
211
+ });
212
+ assert.match(mock.calls[0].body ?? "", /"contentType":"HTML"/);
213
+ }
214
+ finally {
215
+ mock.restore();
216
+ }
217
+ });
218
+ test("standalone: `to` is still required", async () => {
219
+ const mock = mockGraph(201, NEW_DRAFT);
220
+ try {
221
+ await assert.rejects(runDraft(configWithToken("acct-s3"), { subject: "S", body: "b" }), /to/i);
222
+ assert.equal(mock.calls.length, 0);
223
+ }
224
+ finally {
225
+ mock.restore();
226
+ }
227
+ });
228
+ test("standalone: `subject` is still required", async () => {
229
+ const mock = mockGraph(201, NEW_DRAFT);
230
+ try {
231
+ await assert.rejects(runDraft(configWithToken("acct-s4"), { to: ["a@corp.com"], body: "b" }), /subject/i);
232
+ assert.equal(mock.calls.length, 0);
233
+ }
234
+ finally {
235
+ mock.restore();
236
+ }
237
+ });
238
+ //# sourceMappingURL=draft-threaded.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-threaded.test.js","sourceRoot":"","sources":["../../src/__tests__/draft-threaded.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,SAAS,eAAe,CAAC,SAAiB;IACxC,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAC1D,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAClD,UAAU,CAAC,KAAK,CAAC,cAAc,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;IACxF,OAAO,EAAE,QAAQ,EAAE,aAAa,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AE,CAAC,CAAC,CAAC;IACrC,CAAC;YAAS,CAAC;QACT,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -488,20 +488,24 @@ lifelineTool(server, "outlook-mail-send", "Send a message via Microsoft Graph. R
488
488
  return fail(`outlook-mail-send failed: ${err.message}`);
489
489
  }
490
490
  });
491
- lifelineTool(server, "outlook-draft", "Create a draft message in the Drafts folder via Microsoft Graph POST /me/messages. Same body model as outlook-mail-send (to/cc/bcc arrays, subject, body, isHtml). attachments is an array of file paths inside the account directory (up to 25 MB per file); the files are attached to the draft before its id is returned, so the draft is ready to send as-is. Returns the created draft's id for a later outlook-draft-send. Does not send. Requires the Mail.ReadWrite scope.", {
492
- to: z.array(z.string().min(3)).min(1),
491
+ lifelineTool(server, "outlook-draft", "Create a draft in the Drafts folder via Microsoft Graph. Does not send — pass the returned id to outlook-draft-send. Requires the Mail.ReadWrite scope. TWO PATHS. (1) New message (replyToMessageId omitted): POST /me/messages, requires to and subject, same body model as outlook-mail-send (to/cc/bcc arrays, subject, body, isHtml), and the draft threads under nothing. (2) Threaded reply (replyToMessageId set to the id of the message being replied to): POST /me/messages/{id}/createReply, so the draft lands under that message's conversation and the operator's mail client shows it in-thread — this is the only way to draft a reply without sending it. Graph sets the recipients and the RE: subject from the original and composes the body, quoting the original beneath your text, which produces the same email outlook-mail-reply would send. That path is PLAIN TEXT ONLY, so to, subject, and isHtml:true are REFUSED when replyToMessageId is set rather than silently dropped; pass replyAll to include everyone on the original, and cc/bcc to add recipients. attachments (both paths) is an array of file paths inside the account directory, up to 25 MB per file, attached before the id is returned; paths are validated before anything is written, so a bad path creates no draft.", {
492
+ to: z.array(z.string().min(3)).min(1).optional(),
493
493
  cc: z.array(z.string()).optional(),
494
494
  bcc: z.array(z.string()).optional(),
495
- subject: z.string(),
495
+ subject: z.string().optional(),
496
496
  body: z.string(),
497
497
  isHtml: z.boolean().optional(),
498
498
  attachments: z.array(z.string()).optional(),
499
+ replyToMessageId: z.string().min(1).optional(),
500
+ replyAll: z.boolean().optional(),
499
501
  mailbox: mailboxArg,
500
- }, async ({ to, cc, bcc, subject, body, isHtml, attachments, mailbox }) => {
502
+ }, async ({ to, cc, bcc, subject, body, isHtml, attachments, replyToMessageId, replyAll, mailbox }) => {
501
503
  if (!ACCOUNT_ID)
502
504
  return refuseNoAccount("outlook-draft");
503
505
  try {
504
- const result = await runDraft(getConfig(mailbox), { to, cc, bcc, subject, body, isHtml, attachments });
506
+ const result = await runDraft(getConfig(mailbox), {
507
+ to, cc, bcc, subject, body, isHtml, attachments, replyToMessageId, replyAll,
508
+ });
505
509
  return ok(result);
506
510
  }
507
511
  catch (err) {