@mindstone/mcp-server-microsoft-mail 0.4.2 → 0.4.3
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.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/resources/compose-email-template.d.ts +1 -1
- package/dist/resources/compose-email-template.js +9 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/graphClient.js +2 -2
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/index.d.ts +1 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/index.js +1 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/logger.d.ts +8 -0
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/logger.js +23 -2
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/tokenProvider.js +7 -7
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/utils/atomicCredentialWrite.d.ts +1 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/utils/atomicCredentialWrite.js +17 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/package.json +2 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/graphClient.d.ts.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/graphClient.js.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/index.d.ts.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/index.js.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/logger.d.ts.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/logger.js.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/timezoneMapping.d.ts.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/timezoneMapping.js.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/tokenProvider.d.ts.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/tokenProvider.js.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/types.d.ts.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/types.js.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/utils/atomicCredentialWrite.d.ts.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/utils/atomicCredentialWrite.js.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/utils/emfileRetry.d.ts.map +0 -1
- package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/utils/emfileRetry.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.4.3] - 2026-11-22
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Fix connection and sign-in logs showing your full email (now masked; error text and file paths may still show it), and draft Cancel saying 'Nothing sent' after your assistant sent the original
|
|
14
|
+
|
|
9
15
|
## [0.4.2] - 2026-11-21
|
|
10
16
|
|
|
11
17
|
### Changed
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Microsoft 365 Outlook Mail MCP server — list, search, read, send, reply, forwa
|
|
|
9
9
|
|
|
10
10
|
## Status
|
|
11
11
|
|
|
12
|
-
- **Version:** [0.4.
|
|
12
|
+
- **Version:** [0.4.3](./CHANGELOG.md) · [npm](https://www.npmjs.com/package/@mindstone/mcp-server-microsoft-mail)
|
|
13
13
|
- **Auth:** OAuth (host-orchestrated) ([`MS_CLIENT_ID`](./server.json))
|
|
14
14
|
- **Tools:** [22](./src/tools.ts) (messages, folders, drafts, attachments, threads, settings)
|
|
15
15
|
- **Surface:** cloud-api
|
|
@@ -13,5 +13,5 @@ export declare function buildComposeSend(draft: Record<string, unknown>): {
|
|
|
13
13
|
tool: string;
|
|
14
14
|
arguments: Record<string, unknown>;
|
|
15
15
|
};
|
|
16
|
-
export declare const COMPOSE_EMAIL_HTML = "\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>Compose Email</title>\n <style>\n :root {\n --bg: #ffffff;\n --panel: #ffffff;\n --border: #d9dde5;\n --text: #1f2937;\n --muted: #6b7280;\n --input-bg: #ffffff;\n --button-bg: #1f6feb;\n --button-text: #ffffff;\n --button-bg-hover: #1b63d3;\n --secondary-bg: #f3f4f6;\n --secondary-text: #1f2937;\n --secondary-border: #d1d5db;\n --error-bg: #fef2f2;\n --error-border: #fecaca;\n --error-text: #991b1b;\n --success-bg: #ecfdf5;\n --success-border: #bbf7d0;\n --success-text: #166534;\n --warning-bg: #fffbeb;\n --warning-border: #fde68a;\n --warning-text: #92400e;\n }\n\n @media (prefers-color-scheme: dark) {\n :root {\n --bg: #0f172a;\n --panel: #111827;\n --border: #334155;\n --text: #e5e7eb;\n --muted: #9ca3af;\n --input-bg: #0b1220;\n --button-bg: #3b82f6;\n --button-text: #eff6ff;\n --button-bg-hover: #2563eb;\n --secondary-bg: #1f2937;\n --secondary-text: #e5e7eb;\n --secondary-border: #374151;\n --error-bg: #2b1011;\n --error-border: #7f1d1d;\n --error-text: #fca5a5;\n --success-bg: #052e1b;\n --success-border: #166534;\n --success-text: #86efac;\n --warning-bg: #2a2106;\n --warning-border: #854d0e;\n --warning-text: #fcd34d;\n }\n }\n\n html[data-theme=\"light\"] {\n color-scheme: light;\n }\n\n html[data-theme=\"dark\"] {\n color-scheme: dark;\n --bg: #0f172a;\n --panel: #111827;\n --border: #334155;\n --text: #e5e7eb;\n --muted: #9ca3af;\n --input-bg: #0b1220;\n --button-bg: #3b82f6;\n --button-text: #eff6ff;\n --button-bg-hover: #2563eb;\n --secondary-bg: #1f2937;\n --secondary-text: #e5e7eb;\n --secondary-border: #374151;\n --error-bg: #2b1011;\n --error-border: #7f1d1d;\n --error-text: #fca5a5;\n --success-bg: #052e1b;\n --success-border: #166534;\n --success-text: #86efac;\n --warning-bg: #2a2106;\n --warning-border: #854d0e;\n --warning-text: #fcd34d;\n }\n\n * {\n box-sizing: border-box;\n }\n\n body {\n margin: 0;\n padding: 16px;\n background: var(--bg);\n color: var(--text);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n line-height: 1.4;\n }\n\n .wrapper {\n width: 100%;\n max-width: 720px;\n margin: 0 auto;\n }\n\n .card {\n background: var(--panel);\n border: 1px solid var(--border);\n border-radius: 12px;\n padding: 14px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .field {\n display: flex;\n flex-direction: column;\n gap: 6px;\n }\n\n .field label {\n font-size: 12px;\n font-weight: 600;\n color: var(--muted);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n }\n\n .from-value {\n color: var(--text);\n font-size: 14px;\n padding: 2px 0;\n word-break: break-word;\n }\n\n .from-helper {\n font-size: 12px;\n color: var(--muted);\n margin-top: 2px;\n }\n\n .input,\n .textarea {\n width: 100%;\n background: var(--input-bg);\n color: var(--text);\n border: 1px solid var(--border);\n border-radius: 8px;\n padding: 10px 12px;\n font-size: 14px;\n font-family: inherit;\n }\n\n .input:focus,\n .textarea:focus {\n outline: 2px solid rgba(59, 130, 246, 0.35);\n outline-offset: 1px;\n }\n\n .textarea {\n min-height: 180px;\n resize: vertical;\n white-space: pre-wrap;\n }\n\n .toggles {\n display: flex;\n gap: 12px;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .link-button {\n border: none;\n padding: 0;\n background: none;\n color: var(--muted);\n text-decoration: underline;\n font-size: 12px;\n cursor: pointer;\n }\n\n .link-button:hover {\n color: var(--text);\n }\n\n .actions {\n display: flex;\n justify-content: flex-end;\n gap: 10px;\n margin-top: 2px;\n flex-wrap: wrap;\n }\n\n .button {\n border-radius: 8px;\n border: 1px solid transparent;\n min-height: 36px;\n padding: 0 14px;\n font-size: 13px;\n font-weight: 600;\n font-family: inherit;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n transition: background 120ms ease, opacity 120ms ease, border-color 120ms ease;\n }\n\n .button:disabled {\n cursor: not-allowed;\n opacity: 0.75;\n }\n\n .button-primary {\n background: var(--button-bg);\n color: var(--button-text);\n }\n\n .button-primary:hover:enabled {\n background: var(--button-bg-hover);\n }\n\n .button-secondary {\n background: var(--secondary-bg);\n color: var(--secondary-text);\n border-color: var(--secondary-border);\n }\n\n .spinner {\n width: 14px;\n height: 14px;\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n display: inline-block;\n animation: spin 700ms linear infinite;\n }\n\n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n\n .status {\n border-radius: 8px;\n border: 1px solid transparent;\n padding: 8px 10px;\n font-size: 13px;\n }\n\n .error {\n background: var(--error-bg);\n border-color: var(--error-border);\n color: var(--error-text);\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 8px;\n flex-wrap: wrap;\n }\n\n .success {\n background: var(--success-bg);\n border-color: var(--success-border);\n color: var(--success-text);\n }\n\n .warning {\n background: var(--warning-bg);\n border-color: var(--warning-border);\n color: var(--warning-text);\n display: block;\n }\n\n .warning strong {\n display: block;\n margin-bottom: 2px;\n }\n\n .warning .warning-detail {\n opacity: 0.85;\n }\n\n .collapsed {\n border: 1px solid var(--border);\n border-radius: 10px;\n background: var(--panel);\n padding: 10px 12px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 8px;\n font-size: 13px;\n }\n\n .hidden {\n display: none !important;\n }\n\n .sent-header {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-wrap: wrap;\n }\n\n .sent-badge {\n display: inline-flex;\n align-items: center;\n background: var(--success-bg);\n color: var(--success-text);\n border: 1px solid var(--success-border);\n border-radius: 999px;\n padding: 2px 10px;\n font-size: 12px;\n font-weight: 600;\n }\n\n .sent-timestamp {\n color: var(--muted);\n font-size: 12px;\n }\n\n .sent-value {\n color: var(--text);\n font-size: 14px;\n word-break: break-word;\n }\n\n .sent-body {\n color: var(--text);\n font-size: 14px;\n white-space: pre-wrap;\n word-break: break-word;\n max-height: 260px;\n overflow: auto;\n border: 1px solid var(--border);\n border-radius: 8px;\n padding: 10px 12px;\n background: var(--input-bg);\n }\n </style>\n</head>\n<body>\n <div class=\"wrapper\">\n <div id=\"collapsedState\" class=\"collapsed hidden\">\n <span id=\"collapsedMessage\">Draft collapsed.</span>\n <button id=\"reopenButton\" type=\"button\" class=\"button button-secondary\">Reopen</button>\n </div>\n\n <form id=\"composeForm\" class=\"card\" novalidate aria-label=\"Compose email\">\n <div class=\"field from-field\">\n <label>From</label>\n <span id=\"fromValue\" class=\"from-value\"></span>\n <span id=\"fromHelper\" class=\"from-helper hidden\"></span>\n </div>\n\n <div class=\"field\">\n <label for=\"toInput\">To</label>\n <input id=\"toInput\" class=\"input\" type=\"text\" autocomplete=\"off\" placeholder=\"name@example.com, team@example.com\">\n </div>\n\n <div class=\"toggles\">\n <button id=\"toggleCcButton\" type=\"button\" class=\"link-button\" aria-expanded=\"false\" aria-controls=\"ccRow\">Add CC</button>\n <button id=\"toggleBccButton\" type=\"button\" class=\"link-button\" aria-expanded=\"false\" aria-controls=\"bccRow\">Add BCC</button>\n </div>\n\n <div id=\"ccRow\" class=\"field hidden\">\n <label for=\"ccInput\">CC</label>\n <input id=\"ccInput\" class=\"input\" type=\"text\" autocomplete=\"off\" placeholder=\"cc@example.com\">\n </div>\n\n <div id=\"bccRow\" class=\"field hidden\">\n <label for=\"bccInput\">BCC</label>\n <input id=\"bccInput\" class=\"input\" type=\"text\" autocomplete=\"off\" placeholder=\"bcc@example.com\">\n </div>\n\n <div class=\"field\">\n <label for=\"subjectInput\">Subject</label>\n <input id=\"subjectInput\" class=\"input\" type=\"text\" autocomplete=\"off\" placeholder=\"Email subject\">\n </div>\n\n <div class=\"field\">\n <label for=\"bodyInput\">Body</label>\n <textarea id=\"bodyInput\" class=\"textarea\" placeholder=\"Write your email\"></textarea>\n </div>\n\n <div id=\"errorBox\" class=\"status error hidden\" role=\"alert\">\n <span id=\"errorText\"></span>\n <button id=\"retryButton\" type=\"button\" class=\"link-button\">Retry</button>\n </div>\n\n <div id=\"successBox\" class=\"status success hidden\" role=\"status\" aria-live=\"polite\"></div>\n\n <div id=\"unknownBox\" class=\"status warning hidden\" role=\"status\" aria-live=\"polite\">\n <strong id=\"unknownTitle\"></strong>\n <span id=\"unknownText\" class=\"warning-detail\"></span>\n </div>\n\n <div class=\"actions\">\n <button id=\"cancelButton\" type=\"button\" class=\"button button-secondary\">Cancel</button>\n <button id=\"draftButton\" type=\"button\" class=\"button button-secondary\">\n <span id=\"draftSpinner\" class=\"spinner hidden\" aria-hidden=\"true\"></span>\n <span id=\"draftLabel\">Save draft</span>\n </button>\n <button id=\"sendButton\" type=\"button\" class=\"button button-primary\">\n <span id=\"sendSpinner\" class=\"spinner hidden\" aria-hidden=\"true\"></span>\n <span id=\"sendLabel\">Send email</span>\n </button>\n </div>\n </form>\n\n <div id=\"sentView\" class=\"card hidden\" role=\"status\" aria-live=\"polite\">\n <div class=\"sent-header\">\n <span class=\"sent-badge\">Sent</span>\n <span id=\"sentTimestamp\" class=\"sent-timestamp\"></span>\n </div>\n\n <div class=\"field\">\n <label>From</label>\n <span id=\"sentFrom\" class=\"sent-value\"></span>\n </div>\n\n <div class=\"field\">\n <label>To</label>\n <span id=\"sentTo\" class=\"sent-value\"></span>\n </div>\n\n <div id=\"sentCcField\" class=\"field hidden\">\n <label>CC</label>\n <span id=\"sentCc\" class=\"sent-value\"></span>\n </div>\n\n <div id=\"sentBccField\" class=\"field hidden\">\n <label>BCC</label>\n <span id=\"sentBcc\" class=\"sent-value\"></span>\n </div>\n\n <div class=\"field\">\n <label>Subject</label>\n <span id=\"sentSubject\" class=\"sent-value\"></span>\n </div>\n\n <div class=\"field\">\n <label>Message</label>\n <div id=\"sentBody\" class=\"sent-body\"></div>\n </div>\n\n <div class=\"actions\">\n <button id=\"sentCollapseButton\" type=\"button\" class=\"button button-secondary\">Collapse</button>\n </div>\n </div>\n </div>\n\n <script>\n (function () {\n 'use strict';\n\n var RESOURCE_URI = 'ui://microsoft-mail/compose-email';\n var SEND_OPTIONS = {\"sendToolName\":\"send_email\",\"fields\":{\"cc\":true,\"bcc\":true},\"includeAccount\":false};\n function buildSendArguments(mode, draft, options) {\n // Match input/textarea value sanitization, including an unedited prefill.\n const target = String(draft.target || '').replace(/[\\r\\n]/g, '').trim();\n const text = String(draft.text || '').replace(/\\r\\n?/g, '\\n');\n if (mode === 'slack') return { tool: options.sendToolName, arguments: {\n channel: target, text,\n } };\n if (mode === 'teams') return { tool: options.sendToolName, arguments: {\n chatId: target, content: text,\n } };\n const addresses = [draft.to, draft.cc, draft.bcc].map(value => {\n const input = Array.isArray(value) ? value.map(item => {\n if (!item || typeof item !== 'object') return String(item || '').trim();\n const email = String(item.email || item.address || item.value || '').trim();\n const name = String(item.name || item.displayName || '').trim();\n return email && name ? name + ' <' + email + '>' : email;\n }).filter(Boolean).join(', ') : typeof value === 'string' ? value : '';\n return input.replace(/[\\r\\n]/g, '').split(',').map(item => item.trim()).filter(Boolean);\n });\n const email = draft.sendEmail === undefined ? draft.email : draft.sendEmail;\n return { tool: options.sendToolName, arguments: {\n to: addresses[0],\n ...(options.fields.cc ? { cc: addresses[1] } : {}),\n ...(options.fields.bcc ? { bcc: addresses[2] } : {}),\n subject: String(draft.subject || '').replace(/[\\r\\n]/g, ''),\n body: String(draft.body || '').replace(/\\r\\n?/g, '\\n'),\n ...(options.includeAccount !== false && email ? { email } : {}),\n } };\n}\n var currentEmail = '';\n var currentSendEmail = '';\n // The host prefills the draft exactly once via ui/notifications/tool-result\n // on ready. We apply only the FIRST prefill and ignore any later ones, so a\n // stray or hostile re-post can't silently rewrite a draft the user has\n // already reviewed before clicking Send.\n var draftApplied = false;\n var baselineForm = null;\n var deferredHostOutcome = null;\n var pendingRequestId = null;\n var pendingSendPayload = null;\n // Retain across the local timeout so even a late reply clears its payload.\n var pendingSendRequestId = null;\n var sending = false;\n var hostSending = false;\n var collapsed = false;\n var sendMayHaveGone = false;\n var sent = false;\n // Which action the in-flight request belongs to ('send' | 'draft').\n // Captured before clearing on reply/timeout so the response handler can\n // route error/success correctly. retryAction survives the reply so a\n // later Retry click still knows which tool to re-invoke.\n var pendingAction = null;\n var retryAction = null;\n var sendBlocked = false;\n var persistentBlockMessage = '';\n var sendTimeoutId = null;\n // Just beyond the host-side tool-call timeout (60s) so a legitimately slow\n // send resolves to its real result first; this only fires when the reply\n // is genuinely lost, so the button can never stay stuck-silent.\n var SEND_TIMEOUT_MS = 75000;\n\n var composeForm = document.getElementById('composeForm');\n var collapsedState = document.getElementById('collapsedState');\n var collapsedMessage = document.getElementById('collapsedMessage');\n var reopenButton = document.getElementById('reopenButton');\n\n var sentView = document.getElementById('sentView');\n var sentTimestamp = document.getElementById('sentTimestamp');\n var sentFrom = document.getElementById('sentFrom');\n var sentTo = document.getElementById('sentTo');\n var sentCcField = document.getElementById('sentCcField');\n var sentCc = document.getElementById('sentCc');\n var sentBccField = document.getElementById('sentBccField');\n var sentBcc = document.getElementById('sentBcc');\n var sentSubject = document.getElementById('sentSubject');\n var sentBody = document.getElementById('sentBody');\n var sentCollapseButton = document.getElementById('sentCollapseButton');\n\n var toInput = document.getElementById('toInput');\n var ccInput = document.getElementById('ccInput');\n var bccInput = document.getElementById('bccInput');\n var subjectInput = document.getElementById('subjectInput');\n var bodyInput = document.getElementById('bodyInput');\n var fromValue = document.getElementById('fromValue');\n var fromHelper = document.getElementById('fromHelper');\n var ccRow = document.getElementById('ccRow');\n var bccRow = document.getElementById('bccRow');\n var toggleCcButton = document.getElementById('toggleCcButton');\n var toggleBccButton = document.getElementById('toggleBccButton');\n\n var sendButton = document.getElementById('sendButton');\n var sendLabel = document.getElementById('sendLabel');\n var sendSpinner = document.getElementById('sendSpinner');\n var draftButton = document.getElementById('draftButton');\n var draftLabel = document.getElementById('draftLabel');\n var draftSpinner = document.getElementById('draftSpinner');\n var cancelButton = document.getElementById('cancelButton');\n var retryButton = document.getElementById('retryButton');\n\n var errorBox = document.getElementById('errorBox');\n var errorText = document.getElementById('errorText');\n var successBox = document.getElementById('successBox');\n var unknownBox = document.getElementById('unknownBox');\n var unknownTitle = document.getElementById('unknownTitle');\n var unknownText = document.getElementById('unknownText');\n\n function applyThemeFromHostContext() {\n try {\n var context = window.__MCP_HOST_CONTEXT__;\n if (!context || (context.theme !== 'light' && context.theme !== 'dark')) {\n return;\n }\n document.documentElement.setAttribute('data-theme', context.theme);\n } catch (_) {\n // Ignore theme extraction errors\n }\n }\n\n function trimString(value) {\n return String(value || '').trim();\n }\n\n function applyFromValue(email) {\n var trimmed = trimString(email);\n if (trimmed) {\n fromValue.textContent = trimmed;\n fromValue.style.color = '';\n fromHelper.textContent = '';\n fromHelper.classList.add('hidden');\n } else {\n fromValue.textContent = 'Account not shown';\n fromValue.style.color = 'var(--muted)';\n fromHelper.textContent = 'Couldn\\'t confirm which email account to send from. Cancel, then ask your assistant to recreate this draft.';\n fromHelper.classList.remove('hidden');\n }\n }\n\n function formatAddressItem(item) {\n if (item && typeof item === 'object') {\n var email = trimString(item.email || item.address || item.value);\n var name = trimString(item.name || item.displayName);\n if (email && name) {\n return name + ' <' + email + '>';\n }\n return email;\n }\n return trimString(item);\n }\n\n function normalizeAddressList(value) {\n if (Array.isArray(value)) {\n return value.map(formatAddressItem).filter(Boolean);\n }\n if (typeof value === 'string') {\n return value\n .split(',')\n .map(function (item) { return trimString(item); })\n .filter(Boolean);\n }\n return [];\n }\n\n function listToInputValue(list) {\n return normalizeAddressList(list).join(', ');\n }\n\n var resizeQueued = false;\n function postResize() {\n if (resizeQueued) return;\n resizeQueued = true;\n requestAnimationFrame(function () {\n resizeQueued = false;\n var height = Math.max(\n document.documentElement.scrollHeight,\n document.body ? document.body.scrollHeight : 0\n );\n window.parent.postMessage(\n { jsonrpc: '2.0', method: 'ui/resize', params: { height: height } },\n '*'\n );\n });\n }\n\n function postReady() {\n window.parent.postMessage(\n {\n method: 'mcp-app:ready',\n params: { resourceUri: RESOURCE_URI }\n },\n '*'\n );\n }\n\n // Exactly one of the three panels is visible at a time: the editable form,\n // the read-only sent view, or the collapsed summary bar.\n function showView(view) {\n composeForm.classList.toggle('hidden', view !== 'form');\n sentView.classList.toggle('hidden', view !== 'sent');\n collapsedState.classList.toggle('hidden', view !== 'collapsed');\n postResize();\n }\n\n function setCollapsed(nextCollapsed, message) {\n collapsed = nextCollapsed;\n if (nextCollapsed) {\n collapsedMessage.textContent = message || 'Draft collapsed.';\n showView('collapsed');\n } else {\n // Expanding after a send restores the read-only sent view (never the\n // editable form) so the user can re-read what went out without any risk\n // of a duplicate send; before sending, it restores the editable form.\n showView(sent ? 'sent' : 'form');\n }\n }\n\n function setSending(nextSending) {\n // Only a host outcome can release another copy's in-flight send.\n nextSending = nextSending || hostSending;\n sending = nextSending;\n sendButton.disabled = nextSending || sendBlocked;\n retryButton.disabled = nextSending;\n draftButton.disabled = nextSending;\n cancelButton.disabled = nextSending;\n toInput.disabled = nextSending;\n ccInput.disabled = nextSending;\n bccInput.disabled = nextSending;\n subjectInput.disabled = nextSending;\n bodyInput.disabled = nextSending;\n sendSpinner.classList.toggle('hidden', !nextSending);\n sendLabel.textContent = nextSending ? 'Sending\u2026' : 'Send email';\n sendButton.setAttribute('aria-busy', nextSending ? 'true' : 'false');\n postResize();\n }\n\n // One local request is in flight at a time, but a send in another\n // copy can overlap this draft save and must keep the controls locked.\n function setSavingDraft(nextSaving) {\n sending = nextSaving;\n sendButton.disabled = nextSaving || sendBlocked;\n draftButton.disabled = nextSaving;\n cancelButton.disabled = nextSaving;\n toInput.disabled = nextSaving;\n ccInput.disabled = nextSaving;\n bccInput.disabled = nextSaving;\n subjectInput.disabled = nextSaving;\n bodyInput.disabled = nextSaving;\n sendSpinner.classList.add('hidden');\n sendLabel.textContent = 'Send email';\n sendButton.setAttribute('aria-busy', 'false');\n draftSpinner.classList.toggle('hidden', !nextSaving);\n draftLabel.textContent = nextSaving ? 'Saving\u2026' : 'Save draft';\n draftButton.setAttribute('aria-busy', nextSaving ? 'true' : 'false');\n if (hostSending) setSending(true);\n postResize();\n }\n\n function clearError() {\n if (persistentBlockMessage) {\n errorText.textContent = persistentBlockMessage;\n retryButton.classList.toggle('hidden', sendBlocked && retryAction !== 'draft');\n errorBox.classList.remove('hidden');\n postResize();\n return;\n }\n errorText.textContent = '';\n errorBox.classList.add('hidden');\n }\n\n function showError(message) {\n retryButton.classList.toggle('hidden', sendBlocked && retryAction !== 'draft');\n errorText.textContent = message || 'Failed to send email.';\n errorBox.classList.remove('hidden');\n postResize();\n }\n\n function clearSuccess() {\n successBox.textContent = '';\n successBox.classList.add('hidden');\n }\n\n function showSuccess(message) {\n successBox.textContent = message;\n successBox.classList.remove('hidden');\n postResize();\n }\n\n function clearSendTimeout() {\n if (sendTimeoutId !== null) {\n clearTimeout(sendTimeoutId);\n sendTimeoutId = null;\n }\n }\n\n function clearUnknown() {\n unknownTitle.textContent = '';\n unknownText.textContent = '';\n unknownBox.classList.add('hidden');\n errorBox.appendChild(retryButton);\n }\n\n // No reply ever came back for the send (e.g. the host's response was lost\n // before reaching this iframe). We genuinely don't know whether the email\n // went out, so we must NOT claim success or failure: re-enable the form and\n // tell the user to verify before resending (the send is not idempotent, so\n // a blind retry could send a duplicate).\n function showSendUnknown() {\n sendMayHaveGone = true;\n retryAction = null;\n clearSuccess();\n unknownTitle.textContent = 'Not sure if this sent.';\n unknownText.textContent = \"Check your Sent folder before sending again, so it doesn't go out twice.\";\n unknownBox.classList.remove('hidden');\n retryButton.classList.toggle('hidden', sendBlocked);\n if (!sendBlocked) unknownBox.appendChild(retryButton);\n postResize();\n }\n\n function handleSendTimeout() {\n sendTimeoutId = null;\n if (!pendingRequestId || sent) {\n return;\n }\n pendingRequestId = null;\n if (pendingAction === 'draft') {\n pendingAction = null;\n setSavingDraft(false);\n if (sendMayHaveGone) showSendUnknown();\n else showDraftSaveUnknown();\n return;\n }\n pendingAction = null;\n setSending(false);\n showSendUnknown();\n }\n\n // Same lost-reply honesty as a send, lower stakes: a blind retry here\n // could create a duplicate draft, so we say we're not sure and point at\n // the Drafts folder instead of offering Retry.\n function showDraftSaveUnknown() {\n clearError();\n clearSuccess();\n unknownTitle.textContent = 'Not sure if the draft was saved.';\n unknownText.textContent =\n \"Check your Drafts folder before trying again, so you don't create a duplicate.\";\n unknownBox.classList.remove('hidden');\n postResize();\n }\n\n function setCcVisible(visible) {\n ccRow.classList.toggle('hidden', !visible);\n toggleCcButton.textContent = visible ? 'Hide CC' : 'Add CC';\n toggleCcButton.setAttribute('aria-expanded', visible ? 'true' : 'false');\n }\n\n function setBccVisible(visible) {\n bccRow.classList.toggle('hidden', !visible);\n toggleBccButton.textContent = visible ? 'Hide BCC' : 'Add BCC';\n toggleBccButton.setAttribute('aria-expanded', visible ? 'true' : 'false');\n }\n\n function readFormPayload() {\n return buildSendArguments('email', {\n to: toInput.value,\n cc: ccInput.value,\n bcc: bccInput.value,\n subject: String(subjectInput.value || ''),\n body: String(bodyInput.value || ''),\n email: currentEmail, sendEmail: currentSendEmail\n }, SEND_OPTIONS).arguments;\n }\n\n function validatePayload(payload) {\n if (!payload.to || payload.to.length === 0) {\n return 'Add at least one recipient in To.';\n }\n if (!trimString(payload.subject)) {\n return 'Add a subject before sending.';\n }\n if (!trimString(payload.body)) {\n return 'Add an email body before sending.';\n }\n return null;\n }\n\n // Same provider-compatible minimum as sending (the draft tools require\n // To, Subject, and Body too) with save-specific copy. Draft is\n // email-mode only, so this body is the email shape unconditionally.\n function validateDraftPayload(payload) {\n if (!payload.to || payload.to.length === 0) {\n return 'Add at least one recipient in To.';\n }\n if (!trimString(payload.subject)) {\n return 'Add a subject before saving.';\n }\n if (!trimString(payload.body)) {\n return 'Add an email body before saving.';\n }\n return null;\n }\n\n function sendPayload(payload) {\n pendingSendPayload = payload;\n pendingRequestId = 'send-' + Date.now() + '-' + Math.random().toString(16).slice(2);\n pendingSendRequestId = pendingRequestId;\n pendingAction = 'send';\n retryAction = null;\n setSending(true);\n clearError();\n clearSuccess();\n clearUnknown();\n clearSendTimeout();\n sendTimeoutId = setTimeout(handleSendTimeout, SEND_TIMEOUT_MS);\n\n window.parent.postMessage(\n {\n jsonrpc: '2.0',\n method: 'tools/call',\n params: {\n name: 'send_email',\n _meta: { 'mcp-app/cardOutcome': 'sent' },\n arguments: payload\n },\n id: pendingRequestId\n },\n '*'\n );\n }\n\n function saveDraftPayload(payload) {\n pendingRequestId = 'draft-' + Date.now() + '-' + Math.random().toString(16).slice(2);\n pendingAction = 'draft';\n retryAction = null;\n setSavingDraft(true);\n clearError();\n clearSuccess();\n clearUnknown();\n clearSendTimeout();\n sendTimeoutId = setTimeout(handleSendTimeout, SEND_TIMEOUT_MS);\n\n window.parent.postMessage(\n {\n jsonrpc: '2.0',\n method: 'tools/call',\n params: {\n name: 'create_draft',\n arguments: payload\n },\n id: pendingRequestId\n },\n '*'\n );\n }\n\n function applyDraftData(rawDraft) {\n var draft = rawDraft && typeof rawDraft === 'object' ? rawDraft : {};\n toInput.value = listToInputValue(draft.to);\n ccInput.value = listToInputValue(draft.cc);\n bccInput.value = listToInputValue(draft.bcc);\n subjectInput.value = typeof draft.subject === 'string' ? draft.subject : '';\n bodyInput.value = typeof draft.body === 'string' ? draft.body : '';\n currentEmail = typeof draft.email === 'string' ? draft.email : '';\n currentSendEmail = draft.sendEmail === undefined ? currentEmail : draft.sendEmail;\n applyFromValue(currentEmail);\n setCcVisible(normalizeAddressList(draft.cc).length > 0);\n setBccVisible(normalizeAddressList(draft.bcc).length > 0);\n clearError();\n clearSuccess();\n postResize();\n }\n\n function getDraftFromToolResult(payload) {\n if (!payload || typeof payload !== 'object') {\n return null;\n }\n // CANONICAL: post-A0 super-mcp hoists structuredContent onto the\n // outer block; the host posts it through `params.structuredContent`.\n if (payload.structuredContent && typeof payload.structuredContent === 'object') {\n return payload.structuredContent;\n }\n // MIGRATION SHIM: pre-A0 stored sessions replayed through the\n // current iframe lack `params.structuredContent` because the outer\n // block had no hoist at capture time. Read inner envelope text \u2192\n // JSON.parse \u2192 result.structuredContent. NOT regex-based.\n //\n // Lifetime: PERMANENT defensive read-side helper. Pre-A0 sessions\n // are persisted on disk and may be replayed indefinitely; there is\n // no time-based sunset. Removing this fallback would silently break\n // pre-A0 conversation replay.\n var text = typeof payload.text === 'string' ? payload.text :\n (Array.isArray(payload.content)\n ? (payload.content.find(function (c) { return c && c.type === 'text' && typeof c.text === 'string'; }) || {}).text\n : null);\n if (typeof text !== 'string') return null;\n try {\n var parsed = JSON.parse(text);\n if (parsed && typeof parsed === 'object' && parsed.result && typeof parsed.result === 'object') {\n var inner = parsed.result;\n if (inner.structuredContent && typeof inner.structuredContent === 'object') {\n return inner.structuredContent;\n }\n }\n } catch (_) {\n // Likely-envelope heuristic: text starts with `{` and contains\n // `\"package_id\"` in the first 64 chars. If JSON.parse failed on a\n // likely-envelope, surface a warning so the developer chasing\n // \"compose form is empty on replay\" sees a signal. For non-envelope\n // text (the dominant case), no log fires.\n var prefix = text.length > 64 ? text.slice(0, 64) : text;\n var likelyEnvelope = prefix.charAt(0) === '{' && prefix.indexOf('\"package_id\"') !== -1;\n if (likelyEnvelope && typeof console !== 'undefined' && typeof console.warn === 'function') {\n console.warn('[compose-email] Migration shim: JSON.parse failed on likely super-mcp envelope; pre-fill skipped');\n }\n }\n return null;\n }\n\n function findTextBlock(blocks) {\n if (!Array.isArray(blocks)) return null;\n var block = blocks.find(function (c) {\n return c && c.type === 'text' && typeof c.text === 'string';\n });\n return block ? block.text : null;\n }\n\n // Extract the send result identifiers ({ messageId, threadId, labelIds })\n // from the tool-call reply. The connector attaches structuredContent, which\n // super-mcp hoists onto the outer block, so the fast path is a single read.\n // The envelope-unwrapping fallback keeps this robust for hosts (or replayed\n // sessions) that forward only the serialized super-mcp text envelope.\n function getSendMetaFromResult(result) {\n if (!result || typeof result !== 'object') return null;\n if (result.structuredContent && typeof result.structuredContent === 'object') {\n return result.structuredContent;\n }\n try {\n var outerText = findTextBlock(result.content);\n if (typeof outerText !== 'string' && typeof result.text === 'string') {\n outerText = result.text;\n }\n if (typeof outerText !== 'string') return null;\n var envelope = JSON.parse(outerText);\n if (!envelope || typeof envelope !== 'object') return null;\n // outerText was the connector payload directly (no super-mcp envelope).\n if (envelope.messageId || envelope.threadId) return envelope;\n var inner = envelope.result;\n if (!inner || typeof inner !== 'object') return null;\n if (inner.structuredContent && typeof inner.structuredContent === 'object') {\n return inner.structuredContent;\n }\n var innerText = findTextBlock(inner.content);\n if (typeof innerText !== 'string') return null;\n var payload = JSON.parse(innerText);\n return (payload && typeof payload === 'object') ? payload : null;\n } catch (_) {\n return null;\n }\n }\n\n function formatSentTime(at) {\n if (typeof at !== 'number' || !Number.isFinite(at)) return '';\n var date = new Date(at);\n if (!Number.isFinite(date.getTime())) return '';\n try {\n return date.toLocaleString(undefined, {\n month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit'\n });\n } catch (_) {\n return '';\n }\n }\n\n function readFormState() {\n return JSON.stringify([toInput, ccInput, bccInput, subjectInput, bodyInput].map(function (element) { return element.value; }));\n }\n\n function applyCardOutcome(o) {\n if (!draftApplied) {\n deferredHostOutcome = o && o.by === 'agent' ? o : null;\n if (deferredHostOutcome) return;\n }\n if (sent) return;\n if (pendingRequestId && pendingRequestId === pendingSendRequestId &&\n (!o || o.outcome === 'sending' || o.outcome === 'maybe-sent')) return;\n if (hostSending) {\n hostSending = false;\n setSending(false);\n if (sendMayHaveGone) showSendUnknown();\n }\n if (!o || typeof o !== 'object') return;\n if (o.outcome === 'sending') {\n hostSending = true;\n setCollapsed(false);\n setSending(true);\n clearUnknown();\n return;\n }\n if (o.outcome === 'maybe-sent') {\n showSendUnknown();\n setCollapsed(false);\n return;\n }\n if (o.outcome !== 'sent' && o.outcome !== 'submitted') return;\n if (o.by === 'agent' && readFormState() !== baselineForm) {\n deferredHostOutcome = o;\n showSuccess('Your assistant sent the original version');\n setCollapsed(false);\n return;\n }\n sent = true;\n sendMayHaveGone = false;\n clearSendTimeout();\n clearError();\n clearSuccess();\n clearUnknown();\n var stamp = formatSentTime(o.at);\n var message = o.by === 'agent' ? 'Sent by your assistant' : 'Email sent.';\n if (stamp) message = o.by === 'agent' ? message + ' \u00B7 ' + stamp : 'Email sent \u00B7 ' + stamp;\n setCollapsed(true, message);\n if (pendingSendPayload) renderSentView(pendingSendPayload, null, stamp);\n reopenButton.classList.toggle('hidden', !pendingSendPayload);\n }\n\n function renderSentView(payload, meta, stamp) {\n payload = payload && typeof payload === 'object' ? payload : {};\n sentTimestamp.textContent = stamp ? 'Sent ' + stamp : 'Sent';\n sentFrom.textContent = trimString(payload.email || currentEmail) || 'Account not shown';\n sentTo.textContent = normalizeAddressList(payload.to).join(', ');\n var ccList = normalizeAddressList(payload.cc);\n sentCc.textContent = ccList.join(', ');\n sentCcField.classList.toggle('hidden', ccList.length === 0);\n var bccList = normalizeAddressList(payload.bcc);\n sentBcc.textContent = bccList.join(', ');\n sentBccField.classList.toggle('hidden', bccList.length === 0);\n sentSubject.textContent = String(payload.subject || '');\n sentBody.textContent = String(payload.body || '');\n }\n\n function handleSendRequest() {\n if (sent) return;\n if (sending) return;\n if (sendBlocked) return;\n var payload = readFormPayload();\n var validationError = validatePayload(payload);\n if (validationError) {\n showError(validationError);\n return;\n }\n\n sendPayload(payload);\n }\n\n // The Send button is type=\"button\" with an explicit click handler rather\n // than a form submit button. The host renders this iframe with a\n // sandbox of \"allow-scripts\" only \u2014 no \"allow-forms\" \u2014 so native form\n // submission is blocked by the browser BEFORE the submit event fires\n // (\"Blocked form submission ... the form's frame is sandboxed and the\n // allow-forms permission is not set\"). A submit-driven Send therefore\n // silently did nothing: no postMessage, no spinner, no telemetry.\n // A click handler needs no sandbox permission and is the same path\n // Cancel/Retry already use. The submit listener below stays only as a\n // defensive fallback for hosts that DO grant allow-forms; in this sandbox\n // it never fires (neither the button click nor Enter routes through it).\n // The sending guard keeps any double-fire (in an allow-forms host) a no-op.\n sendButton.addEventListener('click', function () {\n handleSendRequest();\n });\n\n draftButton.addEventListener('click', function () {\n if (sending) return;\n var payload = readFormPayload();\n var validationError = validateDraftPayload(payload);\n if (validationError) {\n showError(validationError);\n return;\n }\n saveDraftPayload(payload);\n });\n\n composeForm.addEventListener('submit', function (event) {\n event.preventDefault();\n handleSendRequest();\n });\n\n retryButton.addEventListener('click', function () {\n if (sent) return;\n if (sending) return;\n if (sendBlocked && retryAction !== 'draft') return;\n var payload = readFormPayload();\n if (retryAction === 'draft') {\n var draftValidationError = validateDraftPayload(payload);\n if (draftValidationError) {\n showError(draftValidationError);\n return;\n }\n retryAction = null;\n saveDraftPayload(payload);\n return;\n }\n var validationError = validatePayload(payload);\n if (validationError) {\n showError(validationError);\n return;\n }\n sendPayload(payload);\n });\n\n cancelButton.addEventListener('click', function () {\n if (sending) return;\n // Hiding the notice does not resolve whether an earlier send went out.\n var collapseMessage = sendMayHaveGone\n ? 'Collapsed. Check your Sent folder if you are not sure.'\n : 'Draft collapsed. Nothing sent.';\n if (!sendMayHaveGone) clearError();\n clearSuccess();\n clearUnknown();\n setCollapsed(true, collapseMessage);\n });\n\n reopenButton.addEventListener('click', function () {\n setCollapsed(false);\n if (!sent && sendMayHaveGone) showSendUnknown();\n });\n\n sentCollapseButton.addEventListener('click', function () {\n setCollapsed(true, collapsedMessage.textContent || 'Email sent.');\n });\n\n toggleCcButton.addEventListener('click', function () {\n setCcVisible(ccRow.classList.contains('hidden'));\n postResize();\n });\n\n toggleBccButton.addEventListener('click', function () {\n setBccVisible(bccRow.classList.contains('hidden'));\n postResize();\n });\n\n [toInput, ccInput, bccInput, subjectInput, bodyInput].forEach(function (element) {\n element.addEventListener('input', function () {\n if (!sendBlocked || persistentBlockMessage) clearError();\n clearSuccess();\n if (!sendMayHaveGone) clearUnknown();\n if (deferredHostOutcome && draftApplied) applyCardOutcome(deferredHostOutcome);\n postResize();\n });\n });\n\n window.addEventListener('message', function (event) {\n // Honest scope (origin-independent): the iframe sandbox origin is 'null',\n // so validating event.origin is unreliable across dev/prod/custom-scheme\n // hosts. Instead reject any *identified* sender that isn't our host frame\n // (window.parent). A real cross-frame postMessage always stamps\n // event.source with the sending window, so a hostile sibling frame is\n // rejected here; a null source only occurs for same-context synthetic\n // dispatch (our own code) and cannot be forged from outside, so we\n // tolerate it. This does not authenticate the host's identity \u2014 the host\n // separately authenticates this iframe by origin+source.\n if (event.source && event.source !== window.parent) {\n return;\n }\n\n var data = event.data;\n if (!data || typeof data !== 'object') {\n return;\n }\n\n if (data.method === 'mcp-app:card-outcome') {\n if (event.source === window.parent) applyCardOutcome(data.params);\n return;\n }\n\n if (data.method === 'ui/notifications/tool-result') {\n // Always parse (so the migration-shim's malformed-envelope warning\n // still fires), but apply only the first successful prefill: a stray\n // or hostile re-post can't silently rewrite a draft the user has\n // already reviewed.\n var draft = getDraftFromToolResult(data.params);\n if (draft && !draftApplied) {\n draftApplied = true;\n applyDraftData(draft);\n baselineForm = readFormState();\n if (deferredHostOutcome) applyCardOutcome(deferredHostOutcome);\n }\n return;\n }\n\n if (data.jsonrpc !== '2.0') return;\n var completedSendPayload = null;\n if (pendingSendRequestId && data.id === pendingSendRequestId) {\n completedSendPayload = pendingSendPayload;\n pendingSendPayload = null;\n pendingSendRequestId = null;\n }\n if (!pendingRequestId || data.id !== pendingRequestId) {\n return;\n }\n\n pendingRequestId = null;\n clearSendTimeout();\n clearUnknown();\n var completedAction = pendingAction;\n pendingAction = null;\n if (completedAction === 'draft') {\n setSavingDraft(false);\n } else {\n setSending(false);\n }\n\n if (data.error) {\n var errorMessage = data.error && typeof data.error.message === 'string'\n ? data.error.message\n : (completedAction === 'draft' ? 'Failed to save draft.' : 'Failed to send email.');\n if (completedAction === 'draft') {\n // Retry re-invokes the draft tool, not the send tool \u2014 pendingAction\n // is already cleared, so this is what the Retry handler routes on.\n retryAction = 'draft';\n }\n var blockedReason = data.error.data && data.error.data.reason;\n var retryCannotChangeBlock = blockedReason === 'user-disabled' || blockedReason === 'admin-disabled' || blockedReason === 'security-policy';\n var blockedBeforeSend = retryCannotChangeBlock || blockedReason === 'not-dispatched';\n if (completedAction !== 'draft' && retryCannotChangeBlock) {\n sendBlocked = true;\n if (true) {\n persistentBlockMessage = errorMessage;\n }\n sendButton.disabled = true;\n }\n if (completedAction === 'draft' && sendMayHaveGone) {\n // A draft save is undeclared, so it cannot resolve an earlier send\n // uncertainty. Retry must remain a Send, never a silent draft save.\n retryAction = null;\n showSendUnknown();\n } else if (completedAction !== 'draft' && (!blockedBeforeSend || sendMayHaveGone)) {\n showSendUnknown();\n }\n\n showError(errorMessage);\n return;\n }\n\n clearError();\n clearSuccess();\n if (completedAction === 'draft') {\n // Terminal: the draft now lives in the mailbox's Drafts folder.\n // Collapse to a stamped confirmation and retire the form \u2014 Reopen\n // would resurrect an editable copy whose next Save/Send silently\n // diverges from (or duplicates) the saved draft.\n var draftStamp = formatSentTime(Date.now());\n setCollapsed(true, draftStamp ? 'Draft saved \u00B7 ' + draftStamp : 'Draft saved.');\n reopenButton.classList.add('hidden');\n return;\n }\n // Preserve what was sent instead of discarding the draft. completedSendPayload\n // is the exact payload we posted. We default to the collapsed summary, but\n // Reopen now restores a read-only view of the sent message.\n var sentPayload = completedSendPayload || readFormPayload();\n var stamp = formatSentTime(Date.now());\n renderSentView(sentPayload, getSendMetaFromResult(data.result), stamp);\n sent = true;\n sendMayHaveGone = false;\n reopenButton.classList.remove('hidden');\n setCollapsed(true, stamp ? 'Email sent \u00B7 ' + stamp : 'Email sent.');\n });\n\n if (typeof ResizeObserver === 'function' && document.body) {\n var observer = new ResizeObserver(postResize);\n observer.observe(document.body);\n }\n\n applyThemeFromHostContext();\n setCcVisible(false);\n setBccVisible(false);\n var hostOutcome = (window.__MCP_HOST_CONTEXT__ || {}).cardOutcome;\n if (hostOutcome) applyCardOutcome(hostOutcome);\n else setCollapsed(false);\n postResize();\n postReady();\n\n window.parent.postMessage(\n {\n jsonrpc: '2.0',\n method: 'ui/initialize',\n params: { resourceUri: RESOURCE_URI },\n id: 'compose-email-init'\n },\n '*'\n );\n })();\n </script>\n</body>\n</html>\n";
|
|
16
|
+
export declare const COMPOSE_EMAIL_HTML = "\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>Compose Email</title>\n <style>\n :root {\n --bg: #ffffff;\n --panel: #ffffff;\n --border: #d9dde5;\n --text: #1f2937;\n --muted: #6b7280;\n --input-bg: #ffffff;\n --button-bg: #1f6feb;\n --button-text: #ffffff;\n --button-bg-hover: #1b63d3;\n --secondary-bg: #f3f4f6;\n --secondary-text: #1f2937;\n --secondary-border: #d1d5db;\n --error-bg: #fef2f2;\n --error-border: #fecaca;\n --error-text: #991b1b;\n --success-bg: #ecfdf5;\n --success-border: #bbf7d0;\n --success-text: #166534;\n --warning-bg: #fffbeb;\n --warning-border: #fde68a;\n --warning-text: #92400e;\n }\n\n @media (prefers-color-scheme: dark) {\n :root {\n --bg: #0f172a;\n --panel: #111827;\n --border: #334155;\n --text: #e5e7eb;\n --muted: #9ca3af;\n --input-bg: #0b1220;\n --button-bg: #3b82f6;\n --button-text: #eff6ff;\n --button-bg-hover: #2563eb;\n --secondary-bg: #1f2937;\n --secondary-text: #e5e7eb;\n --secondary-border: #374151;\n --error-bg: #2b1011;\n --error-border: #7f1d1d;\n --error-text: #fca5a5;\n --success-bg: #052e1b;\n --success-border: #166534;\n --success-text: #86efac;\n --warning-bg: #2a2106;\n --warning-border: #854d0e;\n --warning-text: #fcd34d;\n }\n }\n\n html[data-theme=\"light\"] {\n color-scheme: light;\n }\n\n html[data-theme=\"dark\"] {\n color-scheme: dark;\n --bg: #0f172a;\n --panel: #111827;\n --border: #334155;\n --text: #e5e7eb;\n --muted: #9ca3af;\n --input-bg: #0b1220;\n --button-bg: #3b82f6;\n --button-text: #eff6ff;\n --button-bg-hover: #2563eb;\n --secondary-bg: #1f2937;\n --secondary-text: #e5e7eb;\n --secondary-border: #374151;\n --error-bg: #2b1011;\n --error-border: #7f1d1d;\n --error-text: #fca5a5;\n --success-bg: #052e1b;\n --success-border: #166534;\n --success-text: #86efac;\n --warning-bg: #2a2106;\n --warning-border: #854d0e;\n --warning-text: #fcd34d;\n }\n\n * {\n box-sizing: border-box;\n }\n\n body {\n margin: 0;\n padding: 16px;\n background: var(--bg);\n color: var(--text);\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n line-height: 1.4;\n }\n\n .wrapper {\n width: 100%;\n max-width: 720px;\n margin: 0 auto;\n }\n\n .card {\n background: var(--panel);\n border: 1px solid var(--border);\n border-radius: 12px;\n padding: 14px;\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .field {\n display: flex;\n flex-direction: column;\n gap: 6px;\n }\n\n .field label {\n font-size: 12px;\n font-weight: 600;\n color: var(--muted);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n }\n\n .from-value {\n color: var(--text);\n font-size: 14px;\n padding: 2px 0;\n word-break: break-word;\n }\n\n .from-helper {\n font-size: 12px;\n color: var(--muted);\n margin-top: 2px;\n }\n\n .input,\n .textarea {\n width: 100%;\n background: var(--input-bg);\n color: var(--text);\n border: 1px solid var(--border);\n border-radius: 8px;\n padding: 10px 12px;\n font-size: 14px;\n font-family: inherit;\n }\n\n .input:focus,\n .textarea:focus {\n outline: 2px solid rgba(59, 130, 246, 0.35);\n outline-offset: 1px;\n }\n\n .textarea {\n min-height: 180px;\n resize: vertical;\n white-space: pre-wrap;\n }\n\n .toggles {\n display: flex;\n gap: 12px;\n align-items: center;\n flex-wrap: wrap;\n }\n\n .link-button {\n border: none;\n padding: 0;\n background: none;\n color: var(--muted);\n text-decoration: underline;\n font-size: 12px;\n cursor: pointer;\n }\n\n .link-button:hover {\n color: var(--text);\n }\n\n .actions {\n display: flex;\n justify-content: flex-end;\n gap: 10px;\n margin-top: 2px;\n flex-wrap: wrap;\n }\n\n .button {\n border-radius: 8px;\n border: 1px solid transparent;\n min-height: 36px;\n padding: 0 14px;\n font-size: 13px;\n font-weight: 600;\n font-family: inherit;\n cursor: pointer;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n transition: background 120ms ease, opacity 120ms ease, border-color 120ms ease;\n }\n\n .button:disabled {\n cursor: not-allowed;\n opacity: 0.75;\n }\n\n .button-primary {\n background: var(--button-bg);\n color: var(--button-text);\n }\n\n .button-primary:hover:enabled {\n background: var(--button-bg-hover);\n }\n\n .button-secondary {\n background: var(--secondary-bg);\n color: var(--secondary-text);\n border-color: var(--secondary-border);\n }\n\n .spinner {\n width: 14px;\n height: 14px;\n border: 2px solid currentColor;\n border-right-color: transparent;\n border-radius: 50%;\n display: inline-block;\n animation: spin 700ms linear infinite;\n }\n\n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n\n .status {\n border-radius: 8px;\n border: 1px solid transparent;\n padding: 8px 10px;\n font-size: 13px;\n }\n\n .error {\n background: var(--error-bg);\n border-color: var(--error-border);\n color: var(--error-text);\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 8px;\n flex-wrap: wrap;\n }\n\n .success {\n background: var(--success-bg);\n border-color: var(--success-border);\n color: var(--success-text);\n }\n\n .warning {\n background: var(--warning-bg);\n border-color: var(--warning-border);\n color: var(--warning-text);\n display: block;\n }\n\n .warning strong {\n display: block;\n margin-bottom: 2px;\n }\n\n .warning .warning-detail {\n opacity: 0.85;\n }\n\n .collapsed {\n border: 1px solid var(--border);\n border-radius: 10px;\n background: var(--panel);\n padding: 10px 12px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 8px;\n font-size: 13px;\n }\n\n .hidden {\n display: none !important;\n }\n\n .sent-header {\n display: flex;\n align-items: center;\n gap: 8px;\n flex-wrap: wrap;\n }\n\n .sent-badge {\n display: inline-flex;\n align-items: center;\n background: var(--success-bg);\n color: var(--success-text);\n border: 1px solid var(--success-border);\n border-radius: 999px;\n padding: 2px 10px;\n font-size: 12px;\n font-weight: 600;\n }\n\n .sent-timestamp {\n color: var(--muted);\n font-size: 12px;\n }\n\n .sent-value {\n color: var(--text);\n font-size: 14px;\n word-break: break-word;\n }\n\n .sent-body {\n color: var(--text);\n font-size: 14px;\n white-space: pre-wrap;\n word-break: break-word;\n max-height: 260px;\n overflow: auto;\n border: 1px solid var(--border);\n border-radius: 8px;\n padding: 10px 12px;\n background: var(--input-bg);\n }\n </style>\n</head>\n<body>\n <div class=\"wrapper\">\n <div id=\"collapsedState\" class=\"collapsed hidden\">\n <span id=\"collapsedMessage\">Draft collapsed.</span>\n <button id=\"reopenButton\" type=\"button\" class=\"button button-secondary\">Reopen</button>\n </div>\n\n <form id=\"composeForm\" class=\"card\" novalidate aria-label=\"Compose email\">\n <div class=\"field from-field\">\n <label>From</label>\n <span id=\"fromValue\" class=\"from-value\"></span>\n <span id=\"fromHelper\" class=\"from-helper hidden\"></span>\n </div>\n\n <div class=\"field\">\n <label for=\"toInput\">To</label>\n <input id=\"toInput\" class=\"input\" type=\"text\" autocomplete=\"off\" placeholder=\"name@example.com, team@example.com\">\n </div>\n\n <div class=\"toggles\">\n <button id=\"toggleCcButton\" type=\"button\" class=\"link-button\" aria-expanded=\"false\" aria-controls=\"ccRow\">Add CC</button>\n <button id=\"toggleBccButton\" type=\"button\" class=\"link-button\" aria-expanded=\"false\" aria-controls=\"bccRow\">Add BCC</button>\n </div>\n\n <div id=\"ccRow\" class=\"field hidden\">\n <label for=\"ccInput\">CC</label>\n <input id=\"ccInput\" class=\"input\" type=\"text\" autocomplete=\"off\" placeholder=\"cc@example.com\">\n </div>\n\n <div id=\"bccRow\" class=\"field hidden\">\n <label for=\"bccInput\">BCC</label>\n <input id=\"bccInput\" class=\"input\" type=\"text\" autocomplete=\"off\" placeholder=\"bcc@example.com\">\n </div>\n\n <div class=\"field\">\n <label for=\"subjectInput\">Subject</label>\n <input id=\"subjectInput\" class=\"input\" type=\"text\" autocomplete=\"off\" placeholder=\"Email subject\">\n </div>\n\n <div class=\"field\">\n <label for=\"bodyInput\">Body</label>\n <textarea id=\"bodyInput\" class=\"textarea\" placeholder=\"Write your email\"></textarea>\n </div>\n\n <div id=\"errorBox\" class=\"status error hidden\" role=\"alert\">\n <span id=\"errorText\"></span>\n <button id=\"retryButton\" type=\"button\" class=\"link-button\">Retry</button>\n </div>\n\n <div id=\"successBox\" class=\"status success hidden\" role=\"status\" aria-live=\"polite\"></div>\n\n <div id=\"unknownBox\" class=\"status warning hidden\" role=\"status\" aria-live=\"polite\">\n <strong id=\"unknownTitle\"></strong>\n <span id=\"unknownText\" class=\"warning-detail\"></span>\n </div>\n\n <div class=\"actions\">\n <button id=\"cancelButton\" type=\"button\" class=\"button button-secondary\">Cancel</button>\n <button id=\"draftButton\" type=\"button\" class=\"button button-secondary\">\n <span id=\"draftSpinner\" class=\"spinner hidden\" aria-hidden=\"true\"></span>\n <span id=\"draftLabel\">Save draft</span>\n </button>\n <button id=\"sendButton\" type=\"button\" class=\"button button-primary\">\n <span id=\"sendSpinner\" class=\"spinner hidden\" aria-hidden=\"true\"></span>\n <span id=\"sendLabel\">Send email</span>\n </button>\n </div>\n </form>\n\n <div id=\"sentView\" class=\"card hidden\" role=\"status\" aria-live=\"polite\">\n <div class=\"sent-header\">\n <span class=\"sent-badge\">Sent</span>\n <span id=\"sentTimestamp\" class=\"sent-timestamp\"></span>\n </div>\n\n <div class=\"field\">\n <label>From</label>\n <span id=\"sentFrom\" class=\"sent-value\"></span>\n </div>\n\n <div class=\"field\">\n <label>To</label>\n <span id=\"sentTo\" class=\"sent-value\"></span>\n </div>\n\n <div id=\"sentCcField\" class=\"field hidden\">\n <label>CC</label>\n <span id=\"sentCc\" class=\"sent-value\"></span>\n </div>\n\n <div id=\"sentBccField\" class=\"field hidden\">\n <label>BCC</label>\n <span id=\"sentBcc\" class=\"sent-value\"></span>\n </div>\n\n <div class=\"field\">\n <label>Subject</label>\n <span id=\"sentSubject\" class=\"sent-value\"></span>\n </div>\n\n <div class=\"field\">\n <label>Message</label>\n <div id=\"sentBody\" class=\"sent-body\"></div>\n </div>\n\n <div class=\"actions\">\n <button id=\"sentCollapseButton\" type=\"button\" class=\"button button-secondary\">Collapse</button>\n </div>\n </div>\n </div>\n\n <script>\n (function () {\n 'use strict';\n\n var RESOURCE_URI = 'ui://microsoft-mail/compose-email';\n var SEND_OPTIONS = {\"sendToolName\":\"send_email\",\"fields\":{\"cc\":true,\"bcc\":true},\"includeAccount\":false};\n function buildSendArguments(mode, draft, options) {\n // Match input/textarea value sanitization, including an unedited prefill.\n const target = String(draft.target || '').replace(/[\\r\\n]/g, '').trim();\n const text = String(draft.text || '').replace(/\\r\\n?/g, '\\n');\n if (mode === 'slack') return { tool: options.sendToolName, arguments: {\n channel: target, text,\n } };\n if (mode === 'teams') return { tool: options.sendToolName, arguments: {\n chatId: target, content: text,\n } };\n const addresses = [draft.to, draft.cc, draft.bcc].map(value => {\n const input = Array.isArray(value) ? value.map(item => {\n if (!item || typeof item !== 'object') return String(item || '').trim();\n const email = String(item.email || item.address || item.value || '').trim();\n const name = String(item.name || item.displayName || '').trim();\n return email && name ? name + ' <' + email + '>' : email;\n }).filter(Boolean).join(', ') : typeof value === 'string' ? value : '';\n return input.replace(/[\\r\\n]/g, '').split(',').map(item => item.trim()).filter(Boolean);\n });\n const email = draft.sendEmail === undefined ? draft.email : draft.sendEmail;\n return { tool: options.sendToolName, arguments: {\n to: addresses[0],\n ...(options.fields.cc ? { cc: addresses[1] } : {}),\n ...(options.fields.bcc ? { bcc: addresses[2] } : {}),\n subject: String(draft.subject || '').replace(/[\\r\\n]/g, ''),\n body: String(draft.body || '').replace(/\\r\\n?/g, '\\n'),\n ...(options.includeAccount !== false && email ? { email } : {}),\n } };\n}\n var currentEmail = '';\n var currentSendEmail = '';\n // The host prefills the draft exactly once via ui/notifications/tool-result\n // on ready. We apply only the FIRST prefill and ignore any later ones, so a\n // stray or hostile re-post can't silently rewrite a draft the user has\n // already reviewed before clicking Send.\n var draftApplied = false;\n var baselineForm = null;\n var deferredHostOutcome = null;\n var pendingRequestId = null;\n var pendingSendPayload = null;\n // Retain across the local timeout so even a late reply clears its payload.\n var pendingSendRequestId = null;\n var sending = false;\n var hostSending = false;\n var collapsed = false;\n var sendMayHaveGone = false;\n var sent = false;\n // Which action the in-flight request belongs to ('send' | 'draft').\n // Captured before clearing on reply/timeout so the response handler can\n // route error/success correctly. retryAction survives the reply so a\n // later Retry click still knows which tool to re-invoke.\n var pendingAction = null;\n var retryAction = null;\n var sendBlocked = false;\n var persistentBlockMessage = '';\n var sendTimeoutId = null;\n // Just beyond the host-side tool-call timeout (60s) so a legitimately slow\n // send resolves to its real result first; this only fires when the reply\n // is genuinely lost, so the button can never stay stuck-silent.\n var SEND_TIMEOUT_MS = 75000;\n\n var composeForm = document.getElementById('composeForm');\n var collapsedState = document.getElementById('collapsedState');\n var collapsedMessage = document.getElementById('collapsedMessage');\n var reopenButton = document.getElementById('reopenButton');\n\n var sentView = document.getElementById('sentView');\n var sentTimestamp = document.getElementById('sentTimestamp');\n var sentFrom = document.getElementById('sentFrom');\n var sentTo = document.getElementById('sentTo');\n var sentCcField = document.getElementById('sentCcField');\n var sentCc = document.getElementById('sentCc');\n var sentBccField = document.getElementById('sentBccField');\n var sentBcc = document.getElementById('sentBcc');\n var sentSubject = document.getElementById('sentSubject');\n var sentBody = document.getElementById('sentBody');\n var sentCollapseButton = document.getElementById('sentCollapseButton');\n\n var toInput = document.getElementById('toInput');\n var ccInput = document.getElementById('ccInput');\n var bccInput = document.getElementById('bccInput');\n var subjectInput = document.getElementById('subjectInput');\n var bodyInput = document.getElementById('bodyInput');\n var fromValue = document.getElementById('fromValue');\n var fromHelper = document.getElementById('fromHelper');\n var ccRow = document.getElementById('ccRow');\n var bccRow = document.getElementById('bccRow');\n var toggleCcButton = document.getElementById('toggleCcButton');\n var toggleBccButton = document.getElementById('toggleBccButton');\n\n var sendButton = document.getElementById('sendButton');\n var sendLabel = document.getElementById('sendLabel');\n var sendSpinner = document.getElementById('sendSpinner');\n var draftButton = document.getElementById('draftButton');\n var draftLabel = document.getElementById('draftLabel');\n var draftSpinner = document.getElementById('draftSpinner');\n var cancelButton = document.getElementById('cancelButton');\n var retryButton = document.getElementById('retryButton');\n\n var errorBox = document.getElementById('errorBox');\n var errorText = document.getElementById('errorText');\n var successBox = document.getElementById('successBox');\n var unknownBox = document.getElementById('unknownBox');\n var unknownTitle = document.getElementById('unknownTitle');\n var unknownText = document.getElementById('unknownText');\n\n function applyThemeFromHostContext() {\n try {\n var context = window.__MCP_HOST_CONTEXT__;\n if (!context || (context.theme !== 'light' && context.theme !== 'dark')) {\n return;\n }\n document.documentElement.setAttribute('data-theme', context.theme);\n } catch (_) {\n // Ignore theme extraction errors\n }\n }\n\n function trimString(value) {\n return String(value || '').trim();\n }\n\n function applyFromValue(email) {\n var trimmed = trimString(email);\n if (trimmed) {\n fromValue.textContent = trimmed;\n fromValue.style.color = '';\n fromHelper.textContent = '';\n fromHelper.classList.add('hidden');\n } else {\n fromValue.textContent = 'Account not shown';\n fromValue.style.color = 'var(--muted)';\n fromHelper.textContent = 'Couldn\\'t confirm which email account to send from. Cancel, then ask your assistant to recreate this draft.';\n fromHelper.classList.remove('hidden');\n }\n }\n\n function formatAddressItem(item) {\n if (item && typeof item === 'object') {\n var email = trimString(item.email || item.address || item.value);\n var name = trimString(item.name || item.displayName);\n if (email && name) {\n return name + ' <' + email + '>';\n }\n return email;\n }\n return trimString(item);\n }\n\n function normalizeAddressList(value) {\n if (Array.isArray(value)) {\n return value.map(formatAddressItem).filter(Boolean);\n }\n if (typeof value === 'string') {\n return value\n .split(',')\n .map(function (item) { return trimString(item); })\n .filter(Boolean);\n }\n return [];\n }\n\n function listToInputValue(list) {\n return normalizeAddressList(list).join(', ');\n }\n\n var resizeQueued = false;\n function postResize() {\n if (resizeQueued) return;\n resizeQueued = true;\n requestAnimationFrame(function () {\n resizeQueued = false;\n var height = Math.max(\n document.documentElement.scrollHeight,\n document.body ? document.body.scrollHeight : 0\n );\n window.parent.postMessage(\n { jsonrpc: '2.0', method: 'ui/resize', params: { height: height } },\n '*'\n );\n });\n }\n\n function postReady() {\n window.parent.postMessage(\n {\n method: 'mcp-app:ready',\n params: { resourceUri: RESOURCE_URI }\n },\n '*'\n );\n }\n\n // Exactly one of the three panels is visible at a time: the editable form,\n // the read-only sent view, or the collapsed summary bar.\n function showView(view) {\n composeForm.classList.toggle('hidden', view !== 'form');\n sentView.classList.toggle('hidden', view !== 'sent');\n collapsedState.classList.toggle('hidden', view !== 'collapsed');\n postResize();\n }\n\n function setCollapsed(nextCollapsed, message) {\n collapsed = nextCollapsed;\n if (nextCollapsed) {\n collapsedMessage.textContent = message || 'Draft collapsed.';\n showView('collapsed');\n } else {\n // Expanding after a send restores the read-only sent view (never the\n // editable form) so the user can re-read what went out without any risk\n // of a duplicate send; before sending, it restores the editable form.\n showView(sent ? 'sent' : 'form');\n }\n }\n\n function setSending(nextSending) {\n // Only a host outcome can release another copy's in-flight send.\n nextSending = nextSending || hostSending;\n sending = nextSending;\n sendButton.disabled = nextSending || sendBlocked;\n retryButton.disabled = nextSending;\n draftButton.disabled = nextSending;\n cancelButton.disabled = nextSending;\n toInput.disabled = nextSending;\n ccInput.disabled = nextSending;\n bccInput.disabled = nextSending;\n subjectInput.disabled = nextSending;\n bodyInput.disabled = nextSending;\n sendSpinner.classList.toggle('hidden', !nextSending);\n sendLabel.textContent = nextSending ? 'Sending\u2026' : 'Send email';\n sendButton.setAttribute('aria-busy', nextSending ? 'true' : 'false');\n postResize();\n }\n\n // One local request is in flight at a time, but a send in another\n // copy can overlap this draft save and must keep the controls locked.\n function setSavingDraft(nextSaving) {\n sending = nextSaving;\n sendButton.disabled = nextSaving || sendBlocked;\n draftButton.disabled = nextSaving;\n cancelButton.disabled = nextSaving;\n toInput.disabled = nextSaving;\n ccInput.disabled = nextSaving;\n bccInput.disabled = nextSaving;\n subjectInput.disabled = nextSaving;\n bodyInput.disabled = nextSaving;\n sendSpinner.classList.add('hidden');\n sendLabel.textContent = 'Send email';\n sendButton.setAttribute('aria-busy', 'false');\n draftSpinner.classList.toggle('hidden', !nextSaving);\n draftLabel.textContent = nextSaving ? 'Saving\u2026' : 'Save draft';\n draftButton.setAttribute('aria-busy', nextSaving ? 'true' : 'false');\n if (hostSending) setSending(true);\n postResize();\n }\n\n function clearError() {\n if (persistentBlockMessage) {\n errorText.textContent = persistentBlockMessage;\n retryButton.classList.toggle('hidden', sendBlocked && retryAction !== 'draft');\n errorBox.classList.remove('hidden');\n postResize();\n return;\n }\n errorText.textContent = '';\n errorBox.classList.add('hidden');\n }\n\n function showError(message) {\n retryButton.classList.toggle('hidden', sendBlocked && retryAction !== 'draft');\n errorText.textContent = message || 'Failed to send email.';\n errorBox.classList.remove('hidden');\n postResize();\n }\n\n function clearSuccess() {\n successBox.textContent = '';\n successBox.classList.add('hidden');\n }\n\n function showSuccess(message) {\n successBox.textContent = message;\n successBox.classList.remove('hidden');\n postResize();\n }\n\n function clearSendTimeout() {\n if (sendTimeoutId !== null) {\n clearTimeout(sendTimeoutId);\n sendTimeoutId = null;\n }\n }\n\n function clearUnknown() {\n unknownTitle.textContent = '';\n unknownText.textContent = '';\n unknownBox.classList.add('hidden');\n errorBox.appendChild(retryButton);\n }\n\n // No reply ever came back for the send (e.g. the host's response was lost\n // before reaching this iframe). We genuinely don't know whether the email\n // went out, so we must NOT claim success or failure: re-enable the form and\n // tell the user to verify before resending (the send is not idempotent, so\n // a blind retry could send a duplicate).\n function showSendUnknown() {\n sendMayHaveGone = true;\n retryAction = null;\n clearSuccess();\n unknownTitle.textContent = 'Not sure if this sent.';\n unknownText.textContent = \"Check your Sent folder before sending again, so it doesn't go out twice.\";\n unknownBox.classList.remove('hidden');\n retryButton.classList.toggle('hidden', sendBlocked);\n if (!sendBlocked) unknownBox.appendChild(retryButton);\n postResize();\n }\n\n function handleSendTimeout() {\n sendTimeoutId = null;\n if (!pendingRequestId || sent) {\n return;\n }\n pendingRequestId = null;\n if (pendingAction === 'draft') {\n pendingAction = null;\n setSavingDraft(false);\n if (sendMayHaveGone) showSendUnknown();\n else showDraftSaveUnknown();\n return;\n }\n pendingAction = null;\n setSending(false);\n showSendUnknown();\n }\n\n // Same lost-reply honesty as a send, lower stakes: a blind retry here\n // could create a duplicate draft, so we say we're not sure and point at\n // the Drafts folder instead of offering Retry.\n function showDraftSaveUnknown() {\n clearError();\n clearSuccess();\n unknownTitle.textContent = 'Not sure if the draft was saved.';\n unknownText.textContent =\n \"Check your Drafts folder before trying again, so you don't create a duplicate.\";\n unknownBox.classList.remove('hidden');\n postResize();\n }\n\n function setCcVisible(visible) {\n ccRow.classList.toggle('hidden', !visible);\n toggleCcButton.textContent = visible ? 'Hide CC' : 'Add CC';\n toggleCcButton.setAttribute('aria-expanded', visible ? 'true' : 'false');\n }\n\n function setBccVisible(visible) {\n bccRow.classList.toggle('hidden', !visible);\n toggleBccButton.textContent = visible ? 'Hide BCC' : 'Add BCC';\n toggleBccButton.setAttribute('aria-expanded', visible ? 'true' : 'false');\n }\n\n function readFormPayload() {\n return buildSendArguments('email', {\n to: toInput.value,\n cc: ccInput.value,\n bcc: bccInput.value,\n subject: String(subjectInput.value || ''),\n body: String(bodyInput.value || ''),\n email: currentEmail, sendEmail: currentSendEmail\n }, SEND_OPTIONS).arguments;\n }\n\n function validatePayload(payload) {\n if (!payload.to || payload.to.length === 0) {\n return 'Add at least one recipient in To.';\n }\n if (!trimString(payload.subject)) {\n return 'Add a subject before sending.';\n }\n if (!trimString(payload.body)) {\n return 'Add an email body before sending.';\n }\n return null;\n }\n\n // Same provider-compatible minimum as sending (the draft tools require\n // To, Subject, and Body too) with save-specific copy. Draft is\n // email-mode only, so this body is the email shape unconditionally.\n function validateDraftPayload(payload) {\n if (!payload.to || payload.to.length === 0) {\n return 'Add at least one recipient in To.';\n }\n if (!trimString(payload.subject)) {\n return 'Add a subject before saving.';\n }\n if (!trimString(payload.body)) {\n return 'Add an email body before saving.';\n }\n return null;\n }\n\n function sendPayload(payload) {\n pendingSendPayload = payload;\n pendingRequestId = 'send-' + Date.now() + '-' + Math.random().toString(16).slice(2);\n pendingSendRequestId = pendingRequestId;\n pendingAction = 'send';\n retryAction = null;\n setSending(true);\n clearError();\n clearSuccess();\n clearUnknown();\n clearSendTimeout();\n sendTimeoutId = setTimeout(handleSendTimeout, SEND_TIMEOUT_MS);\n\n window.parent.postMessage(\n {\n jsonrpc: '2.0',\n method: 'tools/call',\n params: {\n name: 'send_email',\n _meta: { 'mcp-app/cardOutcome': 'sent' },\n arguments: payload\n },\n id: pendingRequestId\n },\n '*'\n );\n }\n\n function saveDraftPayload(payload) {\n pendingRequestId = 'draft-' + Date.now() + '-' + Math.random().toString(16).slice(2);\n pendingAction = 'draft';\n retryAction = null;\n setSavingDraft(true);\n clearError();\n clearSuccess();\n clearUnknown();\n clearSendTimeout();\n sendTimeoutId = setTimeout(handleSendTimeout, SEND_TIMEOUT_MS);\n\n window.parent.postMessage(\n {\n jsonrpc: '2.0',\n method: 'tools/call',\n params: {\n name: 'create_draft',\n arguments: payload\n },\n id: pendingRequestId\n },\n '*'\n );\n }\n\n function applyDraftData(rawDraft) {\n var draft = rawDraft && typeof rawDraft === 'object' ? rawDraft : {};\n toInput.value = listToInputValue(draft.to);\n ccInput.value = listToInputValue(draft.cc);\n bccInput.value = listToInputValue(draft.bcc);\n subjectInput.value = typeof draft.subject === 'string' ? draft.subject : '';\n bodyInput.value = typeof draft.body === 'string' ? draft.body : '';\n currentEmail = typeof draft.email === 'string' ? draft.email : '';\n currentSendEmail = draft.sendEmail === undefined ? currentEmail : draft.sendEmail;\n applyFromValue(currentEmail);\n setCcVisible(normalizeAddressList(draft.cc).length > 0);\n setBccVisible(normalizeAddressList(draft.bcc).length > 0);\n clearError();\n clearSuccess();\n postResize();\n }\n\n function getDraftFromToolResult(payload) {\n if (!payload || typeof payload !== 'object') {\n return null;\n }\n // CANONICAL: post-A0 super-mcp hoists structuredContent onto the\n // outer block; the host posts it through `params.structuredContent`.\n if (payload.structuredContent && typeof payload.structuredContent === 'object') {\n return payload.structuredContent;\n }\n // MIGRATION SHIM: pre-A0 stored sessions replayed through the\n // current iframe lack `params.structuredContent` because the outer\n // block had no hoist at capture time. Read inner envelope text \u2192\n // JSON.parse \u2192 result.structuredContent. NOT regex-based.\n //\n // Lifetime: PERMANENT defensive read-side helper. Pre-A0 sessions\n // are persisted on disk and may be replayed indefinitely; there is\n // no time-based sunset. Removing this fallback would silently break\n // pre-A0 conversation replay.\n var text = typeof payload.text === 'string' ? payload.text :\n (Array.isArray(payload.content)\n ? (payload.content.find(function (c) { return c && c.type === 'text' && typeof c.text === 'string'; }) || {}).text\n : null);\n if (typeof text !== 'string') return null;\n try {\n var parsed = JSON.parse(text);\n if (parsed && typeof parsed === 'object' && parsed.result && typeof parsed.result === 'object') {\n var inner = parsed.result;\n if (inner.structuredContent && typeof inner.structuredContent === 'object') {\n return inner.structuredContent;\n }\n }\n } catch (_) {\n // Likely-envelope heuristic: text starts with `{` and contains\n // `\"package_id\"` in the first 64 chars. If JSON.parse failed on a\n // likely-envelope, surface a warning so the developer chasing\n // \"compose form is empty on replay\" sees a signal. For non-envelope\n // text (the dominant case), no log fires.\n var prefix = text.length > 64 ? text.slice(0, 64) : text;\n var likelyEnvelope = prefix.charAt(0) === '{' && prefix.indexOf('\"package_id\"') !== -1;\n if (likelyEnvelope && typeof console !== 'undefined' && typeof console.warn === 'function') {\n console.warn('[compose-email] Migration shim: JSON.parse failed on likely super-mcp envelope; pre-fill skipped');\n }\n }\n return null;\n }\n\n function findTextBlock(blocks) {\n if (!Array.isArray(blocks)) return null;\n var block = blocks.find(function (c) {\n return c && c.type === 'text' && typeof c.text === 'string';\n });\n return block ? block.text : null;\n }\n\n // Extract the send result identifiers ({ messageId, threadId, labelIds })\n // from the tool-call reply. The connector attaches structuredContent, which\n // super-mcp hoists onto the outer block, so the fast path is a single read.\n // The envelope-unwrapping fallback keeps this robust for hosts (or replayed\n // sessions) that forward only the serialized super-mcp text envelope.\n function getSendMetaFromResult(result) {\n if (!result || typeof result !== 'object') return null;\n if (result.structuredContent && typeof result.structuredContent === 'object') {\n return result.structuredContent;\n }\n try {\n var outerText = findTextBlock(result.content);\n if (typeof outerText !== 'string' && typeof result.text === 'string') {\n outerText = result.text;\n }\n if (typeof outerText !== 'string') return null;\n var envelope = JSON.parse(outerText);\n if (!envelope || typeof envelope !== 'object') return null;\n // outerText was the connector payload directly (no super-mcp envelope).\n if (envelope.messageId || envelope.threadId) return envelope;\n var inner = envelope.result;\n if (!inner || typeof inner !== 'object') return null;\n if (inner.structuredContent && typeof inner.structuredContent === 'object') {\n return inner.structuredContent;\n }\n var innerText = findTextBlock(inner.content);\n if (typeof innerText !== 'string') return null;\n var payload = JSON.parse(innerText);\n return (payload && typeof payload === 'object') ? payload : null;\n } catch (_) {\n return null;\n }\n }\n\n function formatSentTime(at) {\n if (typeof at !== 'number' || !Number.isFinite(at)) return '';\n var date = new Date(at);\n if (!Number.isFinite(date.getTime())) return '';\n try {\n return date.toLocaleString(undefined, {\n month: 'short', day: 'numeric', hour: 'numeric', minute: '2-digit'\n });\n } catch (_) {\n return '';\n }\n }\n\n function readFormState() {\n return JSON.stringify([toInput, ccInput, bccInput, subjectInput, bodyInput].map(function (element) { return element.value; }));\n }\n\n function assistantSentOriginal() {\n return !sent && draftApplied && !!deferredHostOutcome && deferredHostOutcome.by === 'agent';\n }\n\n function applyCardOutcome(o) {\n if (!draftApplied) {\n deferredHostOutcome = o && o.by === 'agent' ? o : null;\n if (deferredHostOutcome) return;\n }\n if (sent) return;\n if (pendingRequestId && pendingRequestId === pendingSendRequestId &&\n (!o || o.outcome === 'sending' || o.outcome === 'maybe-sent')) return;\n if (hostSending) {\n hostSending = false;\n setSending(false);\n if (sendMayHaveGone) showSendUnknown();\n }\n if (!o || typeof o !== 'object') return;\n if (o.outcome === 'sending') {\n hostSending = true;\n setCollapsed(false);\n setSending(true);\n clearUnknown();\n return;\n }\n if (o.outcome === 'maybe-sent') {\n showSendUnknown();\n setCollapsed(false);\n return;\n }\n if (o.outcome !== 'sent' && o.outcome !== 'submitted') return;\n if (o.by === 'agent' && readFormState() !== baselineForm) {\n deferredHostOutcome = o;\n showSuccess('Your assistant sent the original version');\n setCollapsed(false);\n return;\n }\n sent = true;\n sendMayHaveGone = false;\n clearSendTimeout();\n clearError();\n clearSuccess();\n clearUnknown();\n var stamp = formatSentTime(o.at);\n var message = o.by === 'agent' ? 'Sent by your assistant' : 'Email sent.';\n if (stamp) message = o.by === 'agent' ? message + ' \u00B7 ' + stamp : 'Email sent \u00B7 ' + stamp;\n setCollapsed(true, message);\n if (pendingSendPayload) renderSentView(pendingSendPayload, null, stamp);\n reopenButton.classList.toggle('hidden', !pendingSendPayload);\n }\n\n function renderSentView(payload, meta, stamp) {\n payload = payload && typeof payload === 'object' ? payload : {};\n sentTimestamp.textContent = stamp ? 'Sent ' + stamp : 'Sent';\n sentFrom.textContent = trimString(payload.email || currentEmail) || 'Account not shown';\n sentTo.textContent = normalizeAddressList(payload.to).join(', ');\n var ccList = normalizeAddressList(payload.cc);\n sentCc.textContent = ccList.join(', ');\n sentCcField.classList.toggle('hidden', ccList.length === 0);\n var bccList = normalizeAddressList(payload.bcc);\n sentBcc.textContent = bccList.join(', ');\n sentBccField.classList.toggle('hidden', bccList.length === 0);\n sentSubject.textContent = String(payload.subject || '');\n sentBody.textContent = String(payload.body || '');\n }\n\n function handleSendRequest() {\n if (sent) return;\n if (sending) return;\n if (sendBlocked) return;\n var payload = readFormPayload();\n var validationError = validatePayload(payload);\n if (validationError) {\n showError(validationError);\n return;\n }\n\n sendPayload(payload);\n }\n\n // The Send button is type=\"button\" with an explicit click handler rather\n // than a form submit button. The host renders this iframe with a\n // sandbox of \"allow-scripts\" only \u2014 no \"allow-forms\" \u2014 so native form\n // submission is blocked by the browser BEFORE the submit event fires\n // (\"Blocked form submission ... the form's frame is sandboxed and the\n // allow-forms permission is not set\"). A submit-driven Send therefore\n // silently did nothing: no postMessage, no spinner, no telemetry.\n // A click handler needs no sandbox permission and is the same path\n // Cancel/Retry already use. The submit listener below stays only as a\n // defensive fallback for hosts that DO grant allow-forms; in this sandbox\n // it never fires (neither the button click nor Enter routes through it).\n // The sending guard keeps any double-fire (in an allow-forms host) a no-op.\n sendButton.addEventListener('click', function () {\n handleSendRequest();\n });\n\n draftButton.addEventListener('click', function () {\n if (sending) return;\n var payload = readFormPayload();\n var validationError = validateDraftPayload(payload);\n if (validationError) {\n showError(validationError);\n return;\n }\n saveDraftPayload(payload);\n });\n\n composeForm.addEventListener('submit', function (event) {\n event.preventDefault();\n handleSendRequest();\n });\n\n retryButton.addEventListener('click', function () {\n if (sent) return;\n if (sending) return;\n if (sendBlocked && retryAction !== 'draft') return;\n var payload = readFormPayload();\n if (retryAction === 'draft') {\n var draftValidationError = validateDraftPayload(payload);\n if (draftValidationError) {\n showError(draftValidationError);\n return;\n }\n retryAction = null;\n saveDraftPayload(payload);\n return;\n }\n var validationError = validatePayload(payload);\n if (validationError) {\n showError(validationError);\n return;\n }\n sendPayload(payload);\n });\n\n cancelButton.addEventListener('click', function () {\n if (sending) return;\n // Hiding the notice does not resolve whether an earlier send went out.\n // After the assistant sent the original, \"Nothing sent\" would be untrue.\n var collapseMessage = sendMayHaveGone\n ? 'Collapsed. Check your Sent folder if you are not sure.'\n : assistantSentOriginal()\n ? 'Your assistant sent the original version. Your edits were not sent.'\n : 'Draft collapsed. Nothing sent.';\n if (!sendMayHaveGone) clearError();\n clearSuccess();\n clearUnknown();\n setCollapsed(true, collapseMessage);\n });\n\n reopenButton.addEventListener('click', function () {\n setCollapsed(false);\n if (!sent && sendMayHaveGone) showSendUnknown();\n else if (assistantSentOriginal()) showSuccess('Your assistant sent the original version');\n });\n\n sentCollapseButton.addEventListener('click', function () {\n setCollapsed(true, collapsedMessage.textContent || 'Email sent.');\n });\n\n toggleCcButton.addEventListener('click', function () {\n setCcVisible(ccRow.classList.contains('hidden'));\n postResize();\n });\n\n toggleBccButton.addEventListener('click', function () {\n setBccVisible(bccRow.classList.contains('hidden'));\n postResize();\n });\n\n [toInput, ccInput, bccInput, subjectInput, bodyInput].forEach(function (element) {\n element.addEventListener('input', function () {\n if (!sendBlocked || persistentBlockMessage) clearError();\n clearSuccess();\n if (!sendMayHaveGone) clearUnknown();\n if (deferredHostOutcome && draftApplied) applyCardOutcome(deferredHostOutcome);\n postResize();\n });\n });\n\n window.addEventListener('message', function (event) {\n // Honest scope (origin-independent): the iframe sandbox origin is 'null',\n // so validating event.origin is unreliable across dev/prod/custom-scheme\n // hosts. Instead reject any *identified* sender that isn't our host frame\n // (window.parent). A real cross-frame postMessage always stamps\n // event.source with the sending window, so a hostile sibling frame is\n // rejected here; a null source only occurs for same-context synthetic\n // dispatch (our own code) and cannot be forged from outside, so we\n // tolerate it. This does not authenticate the host's identity \u2014 the host\n // separately authenticates this iframe by origin+source.\n if (event.source && event.source !== window.parent) {\n return;\n }\n\n var data = event.data;\n if (!data || typeof data !== 'object') {\n return;\n }\n\n if (data.method === 'mcp-app:card-outcome') {\n if (event.source === window.parent) applyCardOutcome(data.params);\n return;\n }\n\n if (data.method === 'ui/notifications/tool-result') {\n // Always parse (so the migration-shim's malformed-envelope warning\n // still fires), but apply only the first successful prefill: a stray\n // or hostile re-post can't silently rewrite a draft the user has\n // already reviewed.\n var draft = getDraftFromToolResult(data.params);\n if (draft && !draftApplied) {\n draftApplied = true;\n applyDraftData(draft);\n baselineForm = readFormState();\n if (deferredHostOutcome) applyCardOutcome(deferredHostOutcome);\n }\n return;\n }\n\n if (data.jsonrpc !== '2.0') return;\n var completedSendPayload = null;\n if (pendingSendRequestId && data.id === pendingSendRequestId) {\n completedSendPayload = pendingSendPayload;\n pendingSendPayload = null;\n pendingSendRequestId = null;\n }\n if (!pendingRequestId || data.id !== pendingRequestId) {\n return;\n }\n\n pendingRequestId = null;\n clearSendTimeout();\n clearUnknown();\n var completedAction = pendingAction;\n pendingAction = null;\n if (completedAction === 'draft') {\n setSavingDraft(false);\n } else {\n setSending(false);\n }\n\n if (data.error) {\n var errorMessage = data.error && typeof data.error.message === 'string'\n ? data.error.message\n : (completedAction === 'draft' ? 'Failed to save draft.' : 'Failed to send email.');\n if (completedAction === 'draft') {\n // Retry re-invokes the draft tool, not the send tool \u2014 pendingAction\n // is already cleared, so this is what the Retry handler routes on.\n retryAction = 'draft';\n }\n var blockedReason = data.error.data && data.error.data.reason;\n var retryCannotChangeBlock = blockedReason === 'user-disabled' || blockedReason === 'admin-disabled' || blockedReason === 'security-policy';\n var blockedBeforeSend = retryCannotChangeBlock || blockedReason === 'not-dispatched';\n if (completedAction !== 'draft' && retryCannotChangeBlock) {\n sendBlocked = true;\n if (true) {\n persistentBlockMessage = errorMessage;\n }\n sendButton.disabled = true;\n }\n if (completedAction === 'draft' && sendMayHaveGone) {\n // A draft save is undeclared, so it cannot resolve an earlier send\n // uncertainty. Retry must remain a Send, never a silent draft save.\n retryAction = null;\n showSendUnknown();\n } else if (completedAction !== 'draft' && (!blockedBeforeSend || sendMayHaveGone)) {\n showSendUnknown();\n }\n\n showError(errorMessage);\n return;\n }\n\n clearError();\n clearSuccess();\n if (completedAction === 'draft') {\n // Terminal: the draft now lives in the mailbox's Drafts folder.\n // Collapse to a stamped confirmation and retire the form \u2014 Reopen\n // would resurrect an editable copy whose next Save/Send silently\n // diverges from (or duplicates) the saved draft.\n var draftStamp = formatSentTime(Date.now());\n setCollapsed(true, draftStamp ? 'Draft saved \u00B7 ' + draftStamp : 'Draft saved.');\n reopenButton.classList.add('hidden');\n return;\n }\n // Preserve what was sent instead of discarding the draft. completedSendPayload\n // is the exact payload we posted. We default to the collapsed summary, but\n // Reopen now restores a read-only view of the sent message.\n var sentPayload = completedSendPayload || readFormPayload();\n var stamp = formatSentTime(Date.now());\n renderSentView(sentPayload, getSendMetaFromResult(data.result), stamp);\n sent = true;\n sendMayHaveGone = false;\n reopenButton.classList.remove('hidden');\n setCollapsed(true, stamp ? 'Email sent \u00B7 ' + stamp : 'Email sent.');\n });\n\n if (typeof ResizeObserver === 'function' && document.body) {\n var observer = new ResizeObserver(postResize);\n observer.observe(document.body);\n }\n\n applyThemeFromHostContext();\n setCcVisible(false);\n setBccVisible(false);\n var hostOutcome = (window.__MCP_HOST_CONTEXT__ || {}).cardOutcome;\n if (hostOutcome) applyCardOutcome(hostOutcome);\n else setCollapsed(false);\n postResize();\n postReady();\n\n window.parent.postMessage(\n {\n jsonrpc: '2.0',\n method: 'ui/initialize',\n params: { resourceUri: RESOURCE_URI },\n id: 'compose-email-init'\n },\n '*'\n );\n })();\n </script>\n</body>\n</html>\n";
|
|
17
17
|
//# sourceMappingURL=compose-email-template.d.ts.map
|
|
@@ -1074,6 +1074,10 @@ export const COMPOSE_EMAIL_HTML = `
|
|
|
1074
1074
|
return JSON.stringify([toInput, ccInput, bccInput, subjectInput, bodyInput].map(function (element) { return element.value; }));
|
|
1075
1075
|
}
|
|
1076
1076
|
|
|
1077
|
+
function assistantSentOriginal() {
|
|
1078
|
+
return !sent && draftApplied && !!deferredHostOutcome && deferredHostOutcome.by === 'agent';
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1077
1081
|
function applyCardOutcome(o) {
|
|
1078
1082
|
if (!draftApplied) {
|
|
1079
1083
|
deferredHostOutcome = o && o.by === 'agent' ? o : null;
|
|
@@ -1208,9 +1212,12 @@ export const COMPOSE_EMAIL_HTML = `
|
|
|
1208
1212
|
cancelButton.addEventListener('click', function () {
|
|
1209
1213
|
if (sending) return;
|
|
1210
1214
|
// Hiding the notice does not resolve whether an earlier send went out.
|
|
1215
|
+
// After the assistant sent the original, "Nothing sent" would be untrue.
|
|
1211
1216
|
var collapseMessage = sendMayHaveGone
|
|
1212
1217
|
? 'Collapsed. Check your Sent folder if you are not sure.'
|
|
1213
|
-
:
|
|
1218
|
+
: assistantSentOriginal()
|
|
1219
|
+
? 'Your assistant sent the original version. Your edits were not sent.'
|
|
1220
|
+
: 'Draft collapsed. Nothing sent.';
|
|
1214
1221
|
if (!sendMayHaveGone) clearError();
|
|
1215
1222
|
clearSuccess();
|
|
1216
1223
|
clearUnknown();
|
|
@@ -1220,6 +1227,7 @@ export const COMPOSE_EMAIL_HTML = `
|
|
|
1220
1227
|
reopenButton.addEventListener('click', function () {
|
|
1221
1228
|
setCollapsed(false);
|
|
1222
1229
|
if (!sent && sendMayHaveGone) showSendUnknown();
|
|
1230
|
+
else if (assistantSentOriginal()) showSuccess('Your assistant sent the original version');
|
|
1223
1231
|
});
|
|
1224
1232
|
|
|
1225
1233
|
sentCollapseButton.addEventListener('click', function () {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'isomorphic-fetch';
|
|
2
2
|
import { Client } from '@microsoft/microsoft-graph-client';
|
|
3
3
|
import { TokenProvider } from './tokenProvider.js';
|
|
4
|
-
import { createLogger } from './logger.js';
|
|
4
|
+
import { createLogger, redactEmail } from './logger.js';
|
|
5
5
|
const log = createLogger('microsoft-graph');
|
|
6
6
|
class GraphAuthProvider {
|
|
7
7
|
tokenProvider;
|
|
@@ -34,7 +34,7 @@ export function createGraphClientWithRetry(options) {
|
|
|
34
34
|
const authProvider = new GraphAuthProvider(tokenProvider, options.email);
|
|
35
35
|
log.debug('Creating Microsoft Graph client', {
|
|
36
36
|
configDir: options.configDir,
|
|
37
|
-
|
|
37
|
+
account: options.email ? redactEmail(options.email) : 'default',
|
|
38
38
|
});
|
|
39
39
|
const client = Client.initWithMiddleware({
|
|
40
40
|
authProvider: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createGraphClient, createGraphClientWithRetry, GraphClientOptions, GraphClientWithRetry, listMicrosoftAccounts, getTokenProvider, checkGraphConnection, } from './graphClient.js';
|
|
2
2
|
export { TokenProvider, TokenData, MicrosoftAccount, MicrosoftRefreshDisabledError, MicrosoftRefreshDisabledReason, } from './tokenProvider.js';
|
|
3
|
-
export { MicrosoftLogger, createLogger } from './logger.js';
|
|
3
|
+
export { MicrosoftLogger, createLogger, redactEmail } from './logger.js';
|
|
4
4
|
export { windowsToIanaTimezone } from './timezoneMapping.js';
|
|
5
5
|
export { atomicCredentialWrite, sweepStaleTemps } from './utils/atomicCredentialWrite.js';
|
|
6
6
|
export * from './types.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { createGraphClient, createGraphClientWithRetry, listMicrosoftAccounts, getTokenProvider, checkGraphConnection, } from './graphClient.js';
|
|
2
2
|
export { TokenProvider, MicrosoftRefreshDisabledError, } from './tokenProvider.js';
|
|
3
|
-
export { createLogger } from './logger.js';
|
|
3
|
+
export { createLogger, redactEmail } from './logger.js';
|
|
4
4
|
export { windowsToIanaTimezone } from './timezoneMapping.js';
|
|
5
5
|
export { atomicCredentialWrite, sweepStaleTemps } from './utils/atomicCredentialWrite.js';
|
|
6
6
|
export * from './types.js';
|
|
@@ -4,5 +4,13 @@ export interface MicrosoftLogger {
|
|
|
4
4
|
warn(message: string, data?: Record<string, unknown>): void;
|
|
5
5
|
debug(message: string, data?: Record<string, unknown>): void;
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Redact an email address before it is written to a log sink. Returns a string
|
|
9
|
+
* shaped like the original (`x***@y*.z*`) so an operator can still distinguish
|
|
10
|
+
* accounts in a multi-account session, but the local-part and domain
|
|
11
|
+
* characters are replaced with asterisks. Defeats CodeQL
|
|
12
|
+
* `js/clear-text-logging` flagging email addresses as sensitive PII.
|
|
13
|
+
*/
|
|
14
|
+
export declare function redactEmail(email: string): string;
|
|
7
15
|
export declare function createLogger(service: string): MicrosoftLogger;
|
|
8
16
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1,8 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
// Sanitised LOG_MODE: only a boolean equality check is observable from the env
|
|
2
|
+
// var, so CodeQL does not flow the (possibly sensitive) raw value into log
|
|
3
|
+
// sinks below. Anything other than "strict" defaults to verbose logging.
|
|
4
|
+
const STRICT_LOGGING = process.env.LOG_MODE === 'strict';
|
|
5
|
+
/**
|
|
6
|
+
* Redact an email address before it is written to a log sink. Returns a string
|
|
7
|
+
* shaped like the original (`x***@y*.z*`) so an operator can still distinguish
|
|
8
|
+
* accounts in a multi-account session, but the local-part and domain
|
|
9
|
+
* characters are replaced with asterisks. Defeats CodeQL
|
|
10
|
+
* `js/clear-text-logging` flagging email addresses as sensitive PII.
|
|
11
|
+
*/
|
|
12
|
+
export function redactEmail(email) {
|
|
13
|
+
const at = email.indexOf('@');
|
|
14
|
+
if (at <= 0)
|
|
15
|
+
return '***';
|
|
16
|
+
const domain = email.slice(at + 1);
|
|
17
|
+
const redactedDomain = domain
|
|
18
|
+
.split('.')
|
|
19
|
+
.map((part) => (part.length > 0 ? part[0] + '*' : '*'))
|
|
20
|
+
.join('.');
|
|
21
|
+
return `${email[0]}***@${redactedDomain}`;
|
|
22
|
+
}
|
|
2
23
|
export function createLogger(service) {
|
|
3
24
|
const prefix = `[${service}]`;
|
|
4
25
|
const shouldLog = (level) => {
|
|
5
|
-
if (
|
|
26
|
+
if (STRICT_LOGGING) {
|
|
6
27
|
return level === 'error' || level === 'warn';
|
|
7
28
|
}
|
|
8
29
|
return true;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { createLogger } from './logger.js';
|
|
3
|
+
import { createLogger, redactEmail } from './logger.js';
|
|
4
4
|
import { atomicCredentialWrite, sweepStaleTemps } from './utils/atomicCredentialWrite.js';
|
|
5
5
|
const log = createLogger('microsoft-token');
|
|
6
6
|
export class MicrosoftRefreshDisabledError extends Error {
|
|
@@ -148,28 +148,28 @@ export class TokenProvider {
|
|
|
148
148
|
if (isExpired && token.refresh_token) {
|
|
149
149
|
const diskToken = await this.loadToken(resolvedEmail);
|
|
150
150
|
if (diskToken && diskToken.expires_at > Date.now() + 5 * 60 * 1000) {
|
|
151
|
-
log.warn('Token refreshed by another process, using disk token', {
|
|
151
|
+
log.warn('Token refreshed by another process, using disk token', { account: redactEmail(resolvedEmail) });
|
|
152
152
|
return diskToken.access_token;
|
|
153
153
|
}
|
|
154
154
|
if (isRefreshDisabled()) {
|
|
155
|
-
log.warn('Token expired and MICROSOFT_DISABLE_REFRESH=1; signalling auth_required', {
|
|
155
|
+
log.warn('Token expired and MICROSOFT_DISABLE_REFRESH=1; signalling auth_required', { account: redactEmail(resolvedEmail) });
|
|
156
156
|
throw new MicrosoftRefreshDisabledError(resolvedEmail, 'token_expired', 'Microsoft token expired and host has disabled refresh.');
|
|
157
157
|
}
|
|
158
|
-
log.warn('Token expired, attempting refresh', {
|
|
158
|
+
log.warn('Token expired, attempting refresh', { account: redactEmail(resolvedEmail) });
|
|
159
159
|
try {
|
|
160
160
|
const refreshedToken = await this.refreshToken(diskToken?.refresh_token ?? token.refresh_token, diskToken?.scope ?? token.scope);
|
|
161
161
|
this.cachedToken = refreshedToken;
|
|
162
162
|
await this.saveToken(resolvedEmail, refreshedToken);
|
|
163
|
-
log.info('Token refreshed successfully', {
|
|
163
|
+
log.info('Token refreshed successfully', { account: redactEmail(resolvedEmail) });
|
|
164
164
|
return refreshedToken.access_token;
|
|
165
165
|
}
|
|
166
166
|
catch (err) {
|
|
167
167
|
const fallbackToken = await this.loadToken(resolvedEmail);
|
|
168
168
|
if (fallbackToken && fallbackToken.expires_at > Date.now() + 5 * 60 * 1000) {
|
|
169
|
-
log.warn('Refresh failed but another process refreshed, using disk token', {
|
|
169
|
+
log.warn('Refresh failed but another process refreshed, using disk token', { account: redactEmail(resolvedEmail) });
|
|
170
170
|
return fallbackToken.access_token;
|
|
171
171
|
}
|
|
172
|
-
log.error('Failed to refresh token', {
|
|
172
|
+
log.error('Failed to refresh token', { account: redactEmail(resolvedEmail), error: String(err) });
|
|
173
173
|
throw new Error('Microsoft token expired and refresh failed. Please reconnect your account.');
|
|
174
174
|
}
|
|
175
175
|
}
|
package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/utils/atomicCredentialWrite.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function atomicCredentialWrite(filePath: string, data: string, opts?: {
|
|
1
|
+
export declare function atomicCredentialWrite(filePath: string, data: string | Buffer, opts?: {
|
|
2
2
|
mode?: number;
|
|
3
3
|
}): Promise<void>;
|
|
4
4
|
export declare function sweepStaleTemps(dir: string): Promise<void>;
|
package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/utils/atomicCredentialWrite.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// vendored from upstream commit 4fcf6bcf2cc8170e656dc4e9a7f362116b9025c9
|
|
2
|
+
// keep byte-equivalent (modulo import path); see check-atomic-helper-equivalence.ts
|
|
1
3
|
import crypto from 'node:crypto';
|
|
2
4
|
import fs from 'node:fs';
|
|
3
5
|
import path from 'node:path';
|
|
@@ -6,12 +8,22 @@ const CREDENTIAL_FILE_MODE = 0o600;
|
|
|
6
8
|
const CREDENTIAL_DIR_MODE = 0o700;
|
|
7
9
|
const STALE_TEMP_MAX_AGE_MS = 5 * 60 * 1000;
|
|
8
10
|
function getSafeTempOpenFlags() {
|
|
11
|
+
// Use exclusive create (`wx`) so pre-existing temp paths fail closed.
|
|
12
|
+
// When available, add O_NOFOLLOW to refuse symlink traversal outright.
|
|
9
13
|
if (process.platform !== 'win32' && typeof fs.constants.O_NOFOLLOW === 'number') {
|
|
10
14
|
return fs.constants.O_WRONLY | fs.constants.O_CREAT | fs.constants.O_EXCL | fs.constants.O_NOFOLLOW;
|
|
11
15
|
}
|
|
12
16
|
return 'wx';
|
|
13
17
|
}
|
|
14
18
|
function assertTargetIsNotSymlink(filePath) {
|
|
19
|
+
// Policy guard, NOT a race-free primitive: this lstat is TOCTOU-racy by design
|
|
20
|
+
// (an attacker who controls the parent directory can swap the entry between this
|
|
21
|
+
// check and the later rename). It exists to fail loud — and give a clear error —
|
|
22
|
+
// when a pre-existing credential path is already a symlink. The real write-through
|
|
23
|
+
// protection is the exclusive-create temp open (wx/O_EXCL + O_NOFOLLOW where
|
|
24
|
+
// available) plus rename(), which replaces the destination entry rather than
|
|
25
|
+
// following a symlink. See check-atomic-helper-equivalence.ts: this guard is part
|
|
26
|
+
// of the byte-equivalent contract across host + OSS copies.
|
|
15
27
|
try {
|
|
16
28
|
const stats = withSingleSyncRetryOnEmfile(() => fs.lstatSync(filePath));
|
|
17
29
|
if (stats.isSymbolicLink()) {
|
|
@@ -29,6 +41,7 @@ function assertTargetIsNotSymlink(filePath) {
|
|
|
29
41
|
}
|
|
30
42
|
function fsyncParentDirectory(dirPath) {
|
|
31
43
|
if (process.platform === 'win32') {
|
|
44
|
+
// Windows does not support fsync on directory file descriptors in a portable way.
|
|
32
45
|
return;
|
|
33
46
|
}
|
|
34
47
|
let dirFd;
|
|
@@ -64,10 +77,13 @@ export async function atomicCredentialWrite(filePath, data, opts) {
|
|
|
64
77
|
assertTargetIsNotSymlink(filePath);
|
|
65
78
|
const openedFileDescriptor = withSingleSyncRetryOnEmfile(() => fs.openSync(tempPath, getSafeTempOpenFlags(), fileMode));
|
|
66
79
|
fileDescriptor = openedFileDescriptor;
|
|
67
|
-
withSingleSyncRetryOnEmfile(() =>
|
|
80
|
+
withSingleSyncRetryOnEmfile(() => typeof data === 'string'
|
|
81
|
+
? fs.writeFileSync(openedFileDescriptor, data, { encoding: 'utf8' })
|
|
82
|
+
: fs.writeFileSync(openedFileDescriptor, data));
|
|
68
83
|
withSingleSyncRetryOnEmfile(() => fs.fsyncSync(openedFileDescriptor));
|
|
69
84
|
withSingleSyncRetryOnEmfile(() => fs.closeSync(openedFileDescriptor));
|
|
70
85
|
fileDescriptor = undefined;
|
|
86
|
+
withSingleSyncRetryOnEmfile(() => fs.chmodSync(tempPath, CREDENTIAL_FILE_MODE));
|
|
71
87
|
withSingleSyncRetryOnEmfile(() => fs.renameSync(tempPath, filePath));
|
|
72
88
|
withSingleSyncRetryOnEmfile(() => fs.chmodSync(filePath, CREDENTIAL_FILE_MODE));
|
|
73
89
|
fsyncParentDirectory(parentDir);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindstone/mcp-server-microsoft-shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Shared Microsoft Graph client, token persistence, logging, and types for @mindstone/mcp-server-microsoft-* connectors",
|
|
5
5
|
"license": "FSL-1.1-MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"dist",
|
|
17
|
+
"!dist/**/*.map",
|
|
17
18
|
"README.md",
|
|
18
19
|
"LICENSE"
|
|
19
20
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindstone/mcp-server-microsoft-mail",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"mcpName": "io.github.mindstone/mcp-server-microsoft-mail",
|
|
5
5
|
"description": "Microsoft 365 Outlook mail via Graph: read, search, send, reply, forward, draft, move, delete.",
|
|
6
6
|
"license": "FSL-1.1-MIT",
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.mindstone/mcp-server-microsoft-mail",
|
|
4
4
|
"title": "Microsoft 365 Mail",
|
|
5
5
|
"description": "Microsoft 365 Outlook mail via Graph: read, search, send, reply, forward, draft, move, delete.",
|
|
6
|
-
"version": "0.4.
|
|
6
|
+
"version": "0.4.3",
|
|
7
7
|
"repository": {
|
|
8
8
|
"url": "https://github.com/mindstone/mcp-servers",
|
|
9
9
|
"source": "github",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
16
16
|
"identifier": "@mindstone/mcp-server-microsoft-mail",
|
|
17
|
-
"version": "0.4.
|
|
17
|
+
"version": "0.4.3",
|
|
18
18
|
"runtimeHint": "npx",
|
|
19
19
|
"transport": {
|
|
20
20
|
"type": "stdio"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graphClient.d.ts","sourceRoot":"","sources":["../src/graphClient.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAKrE,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkBD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,aAAa,CAKhG;AAED,wBAAsB,qBAAqB,CAAC,OAAO,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAGzH;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,CAGrE;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,kBAAkB,GAAG,oBAAoB,CAiB5F;AAED,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAa1H"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graphClient.js","sourceRoot":"","sources":["../src/graphClient.ts"],"names":[],"mappings":"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B,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAC1F,cAAc,YAAY,CAAC;AAE3B,YAAY,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAG1B,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EAGb,6BAA6B,GAE9B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAmB,YAAY,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAC1F,cAAc,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7D,IAAI,C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,EAAE,CAAC;gBACvB,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,WAAW,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAClE,CAAC;QACH,CAAC;QACD,IAAI,CAAC,OAAe,EAAE,IAA8B;YAClD,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;gBACtB,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,UAAU,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;QACD,KAAK,CAAC,OAAe,EAAE,IAA8B;YACnD,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;gBACvB,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,WAAW,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAClE,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timezoneMapping.d.ts","sourceRoot":"","sources":["../src/timezoneMapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAgJH;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAa/D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"timezoneMapping.js","sourceRoot":"","sources":["../src/timezoneMapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,eAAe,GAA2B;IAC9C,2BAA2B,EAAE,kBAAkB;IAC/C,2BAA2B,EAAE,kBAAkB;IAC/C,2BAA2B,EAAE,YAAY;IACzC,uBAAuB,EAAE,mBAAmB;IAC5C,wBAAwB,EAAE,cAAc;IACxC,qBAAqB,EAAE,cAAc;IACrC,oBAAoB,EAAE,aAAa;IACnC,uBAAuB,EAAE,YAAY;IACrC,sBAAsB,EAAE,cAAc;IACtC,yBAAyB,EAAE,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,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"atomicCredentialWrite.d.ts","sourceRoot":"","sources":["../../src/utils/atomicCredentialWrite.ts"],"names":[],"mappings":"AAwDA,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GACvB,OAAO,CAAC,IAAI,CAAC,CA0Cf;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBhE"}
|
package/node_modules/@mindstone/mcp-server-microsoft-shared/dist/utils/atomicCredentialWrite.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"atomicCredentialWrite.js","sourceRoot":"","sources":["../../src/utils/atomicCredentialWrite.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAElF,MAAM,oBAAoB,GAAG,KAAK,CAAC;AACnC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAClC,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAE5C,SAAS,oBAAoB;IAC3B,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,OAAO,EAAE,CAAC,SAAS,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;QAChF,OAAO,EAAE,CAAC,SAAS,CAAC,QAAQ,GAAG,EAAE,CAAC,SAAS,CAAC,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,GAAG,EAAE,CAAC,SAA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T,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QAC5C,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC;YAAE,OAAO;QAErC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,iBAAiB,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YACxE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;gBAAE,OAAO;YAC5B,IAAI,GAAG,GAAG,KAAK,CAAC,OAAO,IAAI,qBAAqB;gBAAE,OAAO;YACzD,MAAM,iBAAiB,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC9D,CAAC;QAAC,MAAM,CAAC;YACP,mCAAmC;QACrC,CAAC;IACH,CAAC,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emfileRetry.d.ts","sourceRoot":"","sources":["../../src/utils/emfileRetry.ts"],"names":[],"mappings":"AAAA,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAUlF;AAED,wBAAgB,2BAA2B,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,CASpE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emfileRetry.js","sourceRoot":"","sources":["../../src/utils/emfileRetry.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAI,SAA2B;IACpE,IAAI,CAAC;QACH,OAAO,MAAM,SAAS,EAAE,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA2C,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;YACpE,MAAM,KAAK,CAAC;QACd,CAAC;QACD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;QACtD,OAAO,SAAS,EAAE,CAAC;IACrB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAI,SAAkB;IAC/D,IAAI,CAAC;QACH,OAAO,SAAS,EAAE,CAAC;IACrB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAK,KAA2C,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;YACpE,MAAM,KAAK,CAAC;QACd,CAAC;QACD,OAAO,SAAS,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
|