@symerian/symi 3.5.3 → 3.5.4
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/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +4 -4
- package/dist/bundled/session-memory/handler.js +4 -4
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{chrome-DPjznJQ-.js → chrome-C_I81hbq.js} +7 -7
- package/dist/{deliver-DTRkeYm3.js → deliver-DyO3QD8O.js} +4 -4
- package/dist/llm-slug-generator.js +4 -4
- package/dist/{manager-CsxTf96V.js → manager-PTSjHNVq.js} +1 -1
- package/dist/{pw-ai-D2pEVS5n.js → pw-ai-Cx-Ko_FL.js} +1 -1
- package/dist/{synthesis-CBIT6Vnk.js → synthesis-fD8J2vag.js} +4 -4
- package/dist/{unified-runner-BVvvnjXW.js → unified-runner-BIiKFnNF.js} +10 -10
- package/extensions/outlook/src/graph-mail.test.ts +76 -0
- package/extensions/outlook/src/graph-mail.ts +7 -2
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -4,16 +4,16 @@ import { E as shouldLogVerbose, G as isRecord, r as DEFAULT_CHAT_CHANNEL, v as i
|
|
|
4
4
|
import { a as resolveAgentSkillsFilter, c as resolveEffectiveModelFallbacks, i as resolveAgentModelPrimary, l as resolveSessionAgentId, o as resolveAgentWorkspaceDir, r as resolveAgentDir, t as listAgentIds, u as resolveSessionAgentIds } from "../../agent-scope-B1Ina6jV.js";
|
|
5
5
|
import { r as defaultRuntime, t as createSubsystemLogger } from "../../subsystem-DzRUKS9f.js";
|
|
6
6
|
import { l as ensureAgentWorkspace } from "../../workspace-CsaDUuDn.js";
|
|
7
|
-
import { A as runWithModelFallback, C as resolveSymiDocsPath, D as resolveRunWorkspaceDir, E as redactRunIdentifier, M as resolveFailoverStatus, O as deriveSessionTotalTokens, S as buildAgentSystemPrompt, T as resolveBootstrapContextForRun, _ as AGENT_LANE_NESTED, a as resolveSessionDeliveryTarget, b as emitAgentEvent, c as detectRuntimeShell, d as applyModelOverrideToSessionEntry, f as applyVerboseOverride, g as resolveAgentTimeoutMs, i as resolveOutboundTarget, j as FailoverError, k as hasNonzeroUsage, l as resolveSendPolicy, m as clearSessionAuthProfileOverride, n as buildModelAliasLines, o as buildSystemPromptParams, p as loadModelCatalog, s as getProcessSupervisor, t as runAgentTurn, u as lookupContextTokens, v as AGENT_LANE_SUBAGENT, w as makeBootstrapWarn, x as registerAgentRunContext, y as clearAgentRunContext } from "../../unified-runner-
|
|
7
|
+
import { A as runWithModelFallback, C as resolveSymiDocsPath, D as resolveRunWorkspaceDir, E as redactRunIdentifier, M as resolveFailoverStatus, O as deriveSessionTotalTokens, S as buildAgentSystemPrompt, T as resolveBootstrapContextForRun, _ as AGENT_LANE_NESTED, a as resolveSessionDeliveryTarget, b as emitAgentEvent, c as detectRuntimeShell, d as applyModelOverrideToSessionEntry, f as applyVerboseOverride, g as resolveAgentTimeoutMs, i as resolveOutboundTarget, j as FailoverError, k as hasNonzeroUsage, l as resolveSendPolicy, m as clearSessionAuthProfileOverride, n as buildModelAliasLines, o as buildSystemPromptParams, p as loadModelCatalog, s as getProcessSupervisor, t as runAgentTurn, u as lookupContextTokens, v as AGENT_LANE_SUBAGENT, w as makeBootstrapWarn, x as registerAgentRunContext, y as clearAgentRunContext } from "../../unified-runner-BIiKFnNF.js";
|
|
8
8
|
import { d as ensureAuthProfileStore } from "../../auth-profiles-BSw0aQND.js";
|
|
9
9
|
import { t as formatCliCommand } from "../../command-format-BrrHNE8r.js";
|
|
10
10
|
import { _ as DEFAULT_MODEL, a as isCliProvider, c as normalizeProviderId, d as resolveDefaultModelForAgent, g as DEFAULT_CONTEXT_TOKENS, m as resolveThinkingDefault, o as modelKey, s as normalizeModelRef, t as buildAllowedModelSet, u as resolveConfiguredModelRef, v as DEFAULT_PROVIDER } from "../../model-selection-BqshlIZc.js";
|
|
11
|
-
import { At as resolveSessionResetPolicy, Dt as resolveSessionKey, It as resolveAgentMainSessionKey, Lt as resolveExplicitAgentSessionKey, M as classifyFailoverReason, Ot as evaluateSessionFreshness, Rt as resolveMainSessionKey, U as isFailoverErrorMessage, a as normalizeOutboundPayloadsForJson, at as loadSessionStore, i as normalizeOutboundPayloads, it as resolveAndPersistSessionFile, jt as resolveSessionResetType, kt as resolveChannelResetConfig, lt as updateSessionStore, nt as parseSessionThreadInfo, r as formatOutboundPayloadLog, t as deliverOutboundPayloads, vt as normalizeAccountId } from "../../deliver-
|
|
11
|
+
import { At as resolveSessionResetPolicy, Dt as resolveSessionKey, It as resolveAgentMainSessionKey, Lt as resolveExplicitAgentSessionKey, M as classifyFailoverReason, Ot as evaluateSessionFreshness, Rt as resolveMainSessionKey, U as isFailoverErrorMessage, a as normalizeOutboundPayloadsForJson, at as loadSessionStore, i as normalizeOutboundPayloads, it as resolveAndPersistSessionFile, jt as resolveSessionResetType, kt as resolveChannelResetConfig, lt as updateSessionStore, nt as parseSessionThreadInfo, r as formatOutboundPayloadLog, t as deliverOutboundPayloads, vt as normalizeAccountId } from "../../deliver-DyO3QD8O.js";
|
|
12
12
|
import { c as loadConfig } from "../../ssrf-oI58TMOb.js";
|
|
13
13
|
import "../../boolean-BsqeuxE6.js";
|
|
14
14
|
import { s as isTruthyEnvValue } from "../../shell-env-B1lDWz4t.js";
|
|
15
15
|
import "../../manifest-registry-BGJu2aC-.js";
|
|
16
|
-
import "../../chrome-
|
|
16
|
+
import "../../chrome-C_I81hbq.js";
|
|
17
17
|
import "../../frontmatter-CJEX1BrH.js";
|
|
18
18
|
import { n as buildWorkspaceSkillSnapshot } from "../../skills-Dm4gX4Tl.js";
|
|
19
19
|
import "../../redact-CSGZUFxa.js";
|
|
@@ -27,7 +27,7 @@ import { i as resolveSessionTranscriptPath, n as resolveSessionFilePath, s as re
|
|
|
27
27
|
import { t as SILENT_REPLY_TOKEN } from "../../tokens-D_vCJSzF.js";
|
|
28
28
|
import "../../diagnostic-BALvP9wI.js";
|
|
29
29
|
import "../../diagnostic-session-state-BDfanaOY.js";
|
|
30
|
-
import "../../manager-
|
|
30
|
+
import "../../manager-PTSjHNVq.js";
|
|
31
31
|
import "../../github-copilot-token-uhEBNQfj.js";
|
|
32
32
|
import "../../pi-auth-json-DCGR3yfh.js";
|
|
33
33
|
import "../../reply-prefix-D0NzzC4I.js";
|
|
@@ -4,15 +4,15 @@ import "../../registry-C-JddWwo.js";
|
|
|
4
4
|
import { o as resolveAgentWorkspaceDir } from "../../agent-scope-B1Ina6jV.js";
|
|
5
5
|
import { t as createSubsystemLogger } from "../../subsystem-DzRUKS9f.js";
|
|
6
6
|
import "../../workspace-CsaDUuDn.js";
|
|
7
|
-
import "../../unified-runner-
|
|
7
|
+
import "../../unified-runner-BIiKFnNF.js";
|
|
8
8
|
import "../../auth-profiles-BSw0aQND.js";
|
|
9
9
|
import "../../model-selection-BqshlIZc.js";
|
|
10
|
-
import { Tt as hasInterSessionUserProvenance } from "../../deliver-
|
|
10
|
+
import { Tt as hasInterSessionUserProvenance } from "../../deliver-DyO3QD8O.js";
|
|
11
11
|
import "../../ssrf-oI58TMOb.js";
|
|
12
12
|
import "../../boolean-BsqeuxE6.js";
|
|
13
13
|
import "../../shell-env-B1lDWz4t.js";
|
|
14
14
|
import "../../manifest-registry-BGJu2aC-.js";
|
|
15
|
-
import "../../chrome-
|
|
15
|
+
import "../../chrome-C_I81hbq.js";
|
|
16
16
|
import "../../frontmatter-CJEX1BrH.js";
|
|
17
17
|
import "../../skills-Dm4gX4Tl.js";
|
|
18
18
|
import "../../redact-CSGZUFxa.js";
|
|
@@ -26,7 +26,7 @@ import "../../paths-BsT3BvfH.js";
|
|
|
26
26
|
import "../../tokens-D_vCJSzF.js";
|
|
27
27
|
import "../../diagnostic-BALvP9wI.js";
|
|
28
28
|
import "../../diagnostic-session-state-BDfanaOY.js";
|
|
29
|
-
import "../../manager-
|
|
29
|
+
import "../../manager-PTSjHNVq.js";
|
|
30
30
|
import "../../github-copilot-token-uhEBNQfj.js";
|
|
31
31
|
import "../../pi-auth-json-DCGR3yfh.js";
|
|
32
32
|
import "../../reply-prefix-D0NzzC4I.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
5ee3d5340dddf150c007fc3a6affaca8c1e3fdaa096547286ef5608318124868
|
|
@@ -9,7 +9,7 @@ import fs$1 from "node:fs/promises";
|
|
|
9
9
|
import { execFileSync, spawn } from "node:child_process";
|
|
10
10
|
import net from "node:net";
|
|
11
11
|
import { createServer } from "node:http";
|
|
12
|
-
import WebSocket
|
|
12
|
+
import WebSocket, { WebSocketServer } from "ws";
|
|
13
13
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
14
14
|
|
|
15
15
|
//#region src/browser/constants.ts
|
|
@@ -177,7 +177,7 @@ async function ensureChromeExtensionRelayServer(opts) {
|
|
|
177
177
|
let nextExtensionId = 1;
|
|
178
178
|
const sendToExtension = async (payload) => {
|
|
179
179
|
const ws = extensionWs;
|
|
180
|
-
if (!ws || ws.readyState !== WebSocket
|
|
180
|
+
if (!ws || ws.readyState !== WebSocket.OPEN) throw new Error("Chrome extension not connected");
|
|
181
181
|
ws.send(JSON.stringify(payload));
|
|
182
182
|
return await new Promise((resolve, reject) => {
|
|
183
183
|
const timer = setTimeout(() => {
|
|
@@ -194,12 +194,12 @@ async function ensureChromeExtensionRelayServer(opts) {
|
|
|
194
194
|
const broadcastToCdpClients = (evt) => {
|
|
195
195
|
const msg = JSON.stringify(evt);
|
|
196
196
|
for (const ws of cdpClients) {
|
|
197
|
-
if (ws.readyState !== WebSocket
|
|
197
|
+
if (ws.readyState !== WebSocket.OPEN) continue;
|
|
198
198
|
ws.send(msg);
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
201
|
const sendResponseToCdp = (ws, res) => {
|
|
202
|
-
if (ws.readyState !== WebSocket
|
|
202
|
+
if (ws.readyState !== WebSocket.OPEN) return;
|
|
203
203
|
ws.send(JSON.stringify(res));
|
|
204
204
|
};
|
|
205
205
|
const ensureTargetEventsForClient = (ws, mode) => {
|
|
@@ -424,7 +424,7 @@ async function ensureChromeExtensionRelayServer(opts) {
|
|
|
424
424
|
wssExtension.on("connection", (ws) => {
|
|
425
425
|
extensionWs = ws;
|
|
426
426
|
const ping = setInterval(() => {
|
|
427
|
-
if (ws.readyState !== WebSocket
|
|
427
|
+
if (ws.readyState !== WebSocket.OPEN) return;
|
|
428
428
|
ws.send(JSON.stringify({ method: "ping" }));
|
|
429
429
|
}, 5e3);
|
|
430
430
|
ws.on("message", (data) => {
|
|
@@ -742,7 +742,7 @@ async function fetchOk(url, timeoutMs = 1500, init) {
|
|
|
742
742
|
}
|
|
743
743
|
async function withCdpSocket(wsUrl, fn, opts) {
|
|
744
744
|
const headers = getHeadersWithAuth(wsUrl, opts?.headers ?? {});
|
|
745
|
-
const ws = new WebSocket
|
|
745
|
+
const ws = new WebSocket(wsUrl, {
|
|
746
746
|
handshakeTimeout: typeof opts?.handshakeTimeoutMs === "number" && Number.isFinite(opts.handshakeTimeoutMs) ? Math.max(1, Math.floor(opts.handshakeTimeoutMs)) : 5e3,
|
|
747
747
|
...Object.keys(headers).length ? { headers } : {}
|
|
748
748
|
});
|
|
@@ -1636,7 +1636,7 @@ async function getChromeWebSocketUrl(cdpUrl, timeoutMs = 500) {
|
|
|
1636
1636
|
async function canOpenWebSocket(wsUrl, timeoutMs = 800) {
|
|
1637
1637
|
return await new Promise((resolve) => {
|
|
1638
1638
|
const headers = getHeadersWithAuth(wsUrl);
|
|
1639
|
-
const ws = new WebSocket
|
|
1639
|
+
const ws = new WebSocket(wsUrl, {
|
|
1640
1640
|
handshakeTimeout: timeoutMs,
|
|
1641
1641
|
...Object.keys(headers).length ? { headers } : {}
|
|
1642
1642
|
});
|
|
@@ -9,7 +9,7 @@ import { t as formatCliCommand } from "./command-format-BrrHNE8r.js";
|
|
|
9
9
|
import { n as isPidAlive, t as resolveProcessScopedMap } from "./process-scoped-map-B-dHc_9I.js";
|
|
10
10
|
import { c as loadConfig, d as writeConfigFile, m as parseByteSize, p as parseDurationMs, s as createConfigIO, t as SsrFBlockedError } from "./ssrf-oI58TMOb.js";
|
|
11
11
|
import { t as parseBooleanValue } from "./boolean-BsqeuxE6.js";
|
|
12
|
-
import { A as DEFAULT_BROWSER_EVALUATE_ENABLED, D as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS, E as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, M as DEFAULT_SYMI_BROWSER_ENABLED, N as DEFAULT_SYMI_BROWSER_PROFILE_NAME, O as DEFAULT_AI_SNAPSHOT_MAX_CHARS, S as stopChromeExtensionRelayServer, _ as fetchJson, a as resolveSymiUserDataDir, c as captureScreenshot, d as normalizeCdpWsUrl, f as snapshotAria, g as appendCdpPath, h as withBrowserNavigationPolicy, i as launchSymiChrome, j as DEFAULT_SYMI_BROWSER_COLOR, k as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, l as createTargetViaCdp, m as assertBrowserNavigationAllowed, n as isChromeCdpReady, o as stopSymiChrome, p as InvalidBrowserNavigationUrlError, r as isChromeReachable, s as resolveBrowserExecutableForPlatform, v as fetchOk, w as isLoopbackHost, x as ensureChromeExtensionRelayServer } from "./chrome-
|
|
12
|
+
import { A as DEFAULT_BROWSER_EVALUATE_ENABLED, D as DEFAULT_AI_SNAPSHOT_EFFICIENT_MAX_CHARS, E as DEFAULT_AI_SNAPSHOT_EFFICIENT_DEPTH, M as DEFAULT_SYMI_BROWSER_ENABLED, N as DEFAULT_SYMI_BROWSER_PROFILE_NAME, O as DEFAULT_AI_SNAPSHOT_MAX_CHARS, S as stopChromeExtensionRelayServer, _ as fetchJson, a as resolveSymiUserDataDir, c as captureScreenshot, d as normalizeCdpWsUrl, f as snapshotAria, g as appendCdpPath, h as withBrowserNavigationPolicy, i as launchSymiChrome, j as DEFAULT_SYMI_BROWSER_COLOR, k as DEFAULT_BROWSER_DEFAULT_PROFILE_NAME, l as createTargetViaCdp, m as assertBrowserNavigationAllowed, n as isChromeCdpReady, o as stopSymiChrome, p as InvalidBrowserNavigationUrlError, r as isChromeReachable, s as resolveBrowserExecutableForPlatform, v as fetchOk, w as isLoopbackHost, x as ensureChromeExtensionRelayServer } from "./chrome-C_I81hbq.js";
|
|
13
13
|
import { a as syncSkillsToWorkspace, l as resolveSandboxInputPath, m as sanitizeEnvVars, u as resolveSandboxPath } from "./skills-Dm4gX4Tl.js";
|
|
14
14
|
import { n as formatErrorMessage, t as extractErrorCode } from "./errors-C89ppfp9.js";
|
|
15
15
|
import { b as SafeOpenError, d as extensionForMime, i as buildImageResizeSideGrid, l as resizeToJpeg, o as getImageMetadata, r as IMAGE_REDUCE_QUALITY_STEPS, t as getAgentScopedMediaLocalRoots, u as detectMime, x as openFileWithinRoot } from "./local-roots-C7fBKoOI.js";
|
|
@@ -939,7 +939,7 @@ function isModuleNotFoundError(err) {
|
|
|
939
939
|
}
|
|
940
940
|
async function loadPwAiModule(mode) {
|
|
941
941
|
try {
|
|
942
|
-
return await import("./pw-ai-
|
|
942
|
+
return await import("./pw-ai-Cx-Ko_FL.js");
|
|
943
943
|
} catch (err) {
|
|
944
944
|
if (mode === "soft") return null;
|
|
945
945
|
if (isModuleNotFoundError(err)) return null;
|
|
@@ -3536,11 +3536,11 @@ function createProfileContext(opts, profile) {
|
|
|
3536
3536
|
const userDataDir = resolveSymiUserDataDir(profile.name);
|
|
3537
3537
|
const profileState = getProfileState();
|
|
3538
3538
|
if (await isHttpReachable(300) && !profileState.running) try {
|
|
3539
|
-
await (await import("./pw-ai-
|
|
3539
|
+
await (await import("./pw-ai-Cx-Ko_FL.js")).closePlaywrightBrowserConnection();
|
|
3540
3540
|
} catch {}
|
|
3541
3541
|
if (profileState.running) await stopRunningBrowser();
|
|
3542
3542
|
try {
|
|
3543
|
-
await (await import("./pw-ai-
|
|
3543
|
+
await (await import("./pw-ai-Cx-Ko_FL.js")).closePlaywrightBrowserConnection();
|
|
3544
3544
|
} catch {}
|
|
3545
3545
|
if (!fs.existsSync(userDataDir)) return {
|
|
3546
3546
|
moved: false,
|
|
@@ -3,15 +3,15 @@ import "./registry-C-JddWwo.js";
|
|
|
3
3
|
import { o as resolveAgentWorkspaceDir, s as resolveDefaultAgentId } from "./agent-scope-B1Ina6jV.js";
|
|
4
4
|
import "./subsystem-DzRUKS9f.js";
|
|
5
5
|
import "./workspace-CsaDUuDn.js";
|
|
6
|
-
import { t as runAgentTurn } from "./unified-runner-
|
|
6
|
+
import { t as runAgentTurn } from "./unified-runner-BIiKFnNF.js";
|
|
7
7
|
import "./auth-profiles-BSw0aQND.js";
|
|
8
8
|
import "./model-selection-BqshlIZc.js";
|
|
9
|
-
import "./deliver-
|
|
9
|
+
import "./deliver-DyO3QD8O.js";
|
|
10
10
|
import "./ssrf-oI58TMOb.js";
|
|
11
11
|
import "./boolean-BsqeuxE6.js";
|
|
12
12
|
import "./shell-env-B1lDWz4t.js";
|
|
13
13
|
import "./manifest-registry-BGJu2aC-.js";
|
|
14
|
-
import "./chrome-
|
|
14
|
+
import "./chrome-C_I81hbq.js";
|
|
15
15
|
import "./frontmatter-CJEX1BrH.js";
|
|
16
16
|
import "./skills-Dm4gX4Tl.js";
|
|
17
17
|
import "./redact-CSGZUFxa.js";
|
|
@@ -25,7 +25,7 @@ import "./paths-BsT3BvfH.js";
|
|
|
25
25
|
import "./tokens-D_vCJSzF.js";
|
|
26
26
|
import "./diagnostic-BALvP9wI.js";
|
|
27
27
|
import "./diagnostic-session-state-BDfanaOY.js";
|
|
28
|
-
import "./manager-
|
|
28
|
+
import "./manager-PTSjHNVq.js";
|
|
29
29
|
import "./github-copilot-token-uhEBNQfj.js";
|
|
30
30
|
import "./pi-auth-json-DCGR3yfh.js";
|
|
31
31
|
import "./reply-prefix-D0NzzC4I.js";
|
|
@@ -4449,7 +4449,7 @@ var MemoryIndexManager = class MemoryIndexManager extends MemoryManagerEmbedding
|
|
|
4449
4449
|
* to bypass the min-interval guard (CLI use).
|
|
4450
4450
|
*/
|
|
4451
4451
|
async runL3CycleIfDue(params) {
|
|
4452
|
-
const [{ runL3Cycle, runL3CycleIfDue }, { createSynthesizer }] = await Promise.all([import("./consolidate-Dyh_aESo.js"), import("./synthesis-
|
|
4452
|
+
const [{ runL3Cycle, runL3CycleIfDue }, { createSynthesizer }] = await Promise.all([import("./consolidate-Dyh_aESo.js"), import("./synthesis-fD8J2vag.js")]);
|
|
4453
4453
|
const synthesize = createSynthesizer({
|
|
4454
4454
|
cfg: this.cfg,
|
|
4455
4455
|
agentId: this.agentId,
|
|
@@ -9,7 +9,7 @@ import "./ssrf-oI58TMOb.js";
|
|
|
9
9
|
import "./boolean-BsqeuxE6.js";
|
|
10
10
|
import "./shell-env-B1lDWz4t.js";
|
|
11
11
|
import "./manifest-registry-BGJu2aC-.js";
|
|
12
|
-
import { _ as fetchJson, b as withCdpSocket, d as normalizeCdpWsUrl, g as appendCdpPath, h as withBrowserNavigationPolicy, m as assertBrowserNavigationAllowed, t as getChromeWebSocketUrl, u as formatAriaSnapshot, y as getHeadersWithAuth } from "./chrome-
|
|
12
|
+
import { _ as fetchJson, b as withCdpSocket, d as normalizeCdpWsUrl, g as appendCdpPath, h as withBrowserNavigationPolicy, m as assertBrowserNavigationAllowed, t as getChromeWebSocketUrl, u as formatAriaSnapshot, y as getHeadersWithAuth } from "./chrome-C_I81hbq.js";
|
|
13
13
|
import "./redact-CSGZUFxa.js";
|
|
14
14
|
import { n as formatErrorMessage } from "./errors-C89ppfp9.js";
|
|
15
15
|
import path from "node:path";
|
|
@@ -3,15 +3,15 @@ import "./registry-C-JddWwo.js";
|
|
|
3
3
|
import "./agent-scope-B1Ina6jV.js";
|
|
4
4
|
import { t as createSubsystemLogger } from "./subsystem-DzRUKS9f.js";
|
|
5
5
|
import "./workspace-CsaDUuDn.js";
|
|
6
|
-
import { t as runAgentTurn } from "./unified-runner-
|
|
6
|
+
import { t as runAgentTurn } from "./unified-runner-BIiKFnNF.js";
|
|
7
7
|
import "./auth-profiles-BSw0aQND.js";
|
|
8
8
|
import "./model-selection-BqshlIZc.js";
|
|
9
|
-
import "./deliver-
|
|
9
|
+
import "./deliver-DyO3QD8O.js";
|
|
10
10
|
import "./ssrf-oI58TMOb.js";
|
|
11
11
|
import "./boolean-BsqeuxE6.js";
|
|
12
12
|
import "./shell-env-B1lDWz4t.js";
|
|
13
13
|
import "./manifest-registry-BGJu2aC-.js";
|
|
14
|
-
import "./chrome-
|
|
14
|
+
import "./chrome-C_I81hbq.js";
|
|
15
15
|
import "./frontmatter-CJEX1BrH.js";
|
|
16
16
|
import "./skills-Dm4gX4Tl.js";
|
|
17
17
|
import "./redact-CSGZUFxa.js";
|
|
@@ -25,7 +25,7 @@ import "./paths-BsT3BvfH.js";
|
|
|
25
25
|
import "./tokens-D_vCJSzF.js";
|
|
26
26
|
import "./diagnostic-BALvP9wI.js";
|
|
27
27
|
import "./diagnostic-session-state-BDfanaOY.js";
|
|
28
|
-
import "./manager-
|
|
28
|
+
import "./manager-PTSjHNVq.js";
|
|
29
29
|
import "./github-copilot-token-uhEBNQfj.js";
|
|
30
30
|
import "./pi-auth-json-DCGR3yfh.js";
|
|
31
31
|
import "./reply-prefix-D0NzzC4I.js";
|
|
@@ -9,12 +9,12 @@ import { _ as resolveAuthProfileDisplayLabel, a as markAuthProfileFailure, c as
|
|
|
9
9
|
import { n as resolveCliName, t as formatCliCommand } from "./command-format-BrrHNE8r.js";
|
|
10
10
|
import { _ as DEFAULT_MODEL, c as normalizeProviderId, d as resolveDefaultModelForAgent, f as resolveModelRefFromString, g as DEFAULT_CONTEXT_TOKENS, h as getProviderAdapter, i as findNormalizedProviderValue, m as resolveThinkingDefault, n as buildConfiguredAllowlistKeys, o as modelKey, p as resolveSubagentSpawnModelSelection, r as buildModelAliasIndex, s as normalizeModelRef$1, t as buildAllowedModelSet, u as resolveConfiguredModelRef, v as DEFAULT_PROVIDER } from "./model-selection-BqshlIZc.js";
|
|
11
11
|
import { n as saveJsonFile, t as loadJsonFile } from "./json-file-CZ3ssFR9.js";
|
|
12
|
-
import { $ as resolveSandboxContext, $t as resolveBrowserControlAuth, A as isGoogleModelApi, At as resolveSessionResetPolicy, B as isCompactionFailureError, Bt as resolveGroupSessionKey, C as sanitizeImageBlocks, Ct as INPUT_PROVENANCE_KIND_VALUES, D as extractToolResultId, Dt as resolveSessionKey, E as extractToolCallsFromAssistant, Et as normalizeInputProvenance, F as formatRawAssistantErrorForUi, Ft as canonicalizeMainSessionAlias, G as isRateLimitAssistantError, Gt as resolveBrowserConfig, H as isFailoverAssistantError, Ht as resolveSessionLockMaxHoldFromTimeout, I as getApiErrorPayloadFingerprint, J as isTransientHttpError, Jt as saveMediaBuffer, K as isRawApiErrorPayload, Kt as resolveProfile, L as isAuthAssistantError, M as classifyFailoverReason, Mt as resolveThreadFlag, N as formatAssistantErrorText, Nt as DEFAULT_RESET_TRIGGERS, O as downgradeOpenAIReasoningBlocks, Ot as evaluateSessionFreshness, P as formatBillingErrorMessage, Pt as resolveFreshSessionTotalTokens, Q as ensureSandboxWorkspaceForSession, Qt as ensureBrowserControlAuth, R as isBillingAssistantError, Rt as resolveMainSessionKey, S as sanitizeSessionMessagesImages, St as extractToolCallNames, T as resolveImageSanitizationLimits, Tt as hasInterSessionUserProvenance, U as isFailoverErrorMessage, Ut as createBrowserRouteContext, V as isContextOverflowError, Vt as acquireSessionWriteLock, W as isLikelyContextOverflowError, Wt as registerBrowserRoutes, X as parseImageSizeError, Xt as resolveExistingPathsWithinRoot, Y as parseImageDimensionError, Yt as DEFAULT_UPLOAD_DIR, Z as sanitizeUserFacingText, Zt as getBridgeAuthForPort, _ as validateAnthropicTurns, _t as normalizeSessionDeliveryFields, an as mergeAlsoAllowPolicy, at as loadSessionStore, b as isMessagingToolDuplicateNormalized, bt as capArrayByJsonBytes, c as normalizeChannelTargetInput, cn as stripPluginOnlyAllowlist, ct as updateLastRoute, d as parseReplyDirectives, dn as buildBootstrapContextFiles, dt as isCacheEnabled, en as applyOwnerOnlyToolPolicy, et as resolveSandboxRuntimeStatus, f as MEDIA_TOKEN_RE, fn as ensureSessionHeader, ft as resolveCacheTtlMs$1, g as initializeGlobalHookRunner, gt as normalizeDeliveryContext, h as getGlobalHookRunner, hn as sanitizeGoogleTurnOrdering, ht as mergeDeliveryContext, in as expandToolGroups, it as resolveAndPersistSessionFile, j as BILLING_ERROR_USER_MESSAGE, jt as resolveSessionResetType, k as isAntigravityClaude, kt as resolveChannelResetConfig, l as normalizeTargetForProvider, ln as compileGlobPatterns, lt as updateSessionStore, m as parseInlineDirectives$1, mn as resolveBootstrapTotalMaxChars, mt as deliveryContextKey, nn as collectExplicitAllowlist, o as normalizeReplyPayloadsForDelivery, on as normalizeToolName$1, ot as readSessionUpdatedAt, p as splitMediaFromOutput, pn as resolveBootstrapMaxChars, pt as deliveryContextFromSession, q as isTimeoutErrorMessage, qt as getMediaDir, rn as expandPolicyWithPluginGroups, rt as appendAssistantMessageToSessionTranscript, s as buildTargetResolverSignature, sn as resolveToolProfilePolicy, st as recordSessionMetaFromInbound, t as deliverOutboundPayloads, tn as buildPluginToolGroups, tt as extractDeliveryInfo, u as throwIfAborted, un as matchesAnyGlobPattern, ut as updateSessionStoreEntry, v as validateGeminiTurns, w as sanitizeToolResultImages, wt as applyInputProvenanceToUserMessage, x as normalizeTextForComparison, xt as countToolResults, y as pickFallbackThinkingLevel, yt as archiveSessionTranscripts, z as isCloudCodeAssistFormatError, zt as deriveSessionMetaPatch } from "./deliver-
|
|
12
|
+
import { $ as resolveSandboxContext, $t as resolveBrowserControlAuth, A as isGoogleModelApi, At as resolveSessionResetPolicy, B as isCompactionFailureError, Bt as resolveGroupSessionKey, C as sanitizeImageBlocks, Ct as INPUT_PROVENANCE_KIND_VALUES, D as extractToolResultId, Dt as resolveSessionKey, E as extractToolCallsFromAssistant, Et as normalizeInputProvenance, F as formatRawAssistantErrorForUi, Ft as canonicalizeMainSessionAlias, G as isRateLimitAssistantError, Gt as resolveBrowserConfig, H as isFailoverAssistantError, Ht as resolveSessionLockMaxHoldFromTimeout, I as getApiErrorPayloadFingerprint, J as isTransientHttpError, Jt as saveMediaBuffer, K as isRawApiErrorPayload, Kt as resolveProfile, L as isAuthAssistantError, M as classifyFailoverReason, Mt as resolveThreadFlag, N as formatAssistantErrorText, Nt as DEFAULT_RESET_TRIGGERS, O as downgradeOpenAIReasoningBlocks, Ot as evaluateSessionFreshness, P as formatBillingErrorMessage, Pt as resolveFreshSessionTotalTokens, Q as ensureSandboxWorkspaceForSession, Qt as ensureBrowserControlAuth, R as isBillingAssistantError, Rt as resolveMainSessionKey, S as sanitizeSessionMessagesImages, St as extractToolCallNames, T as resolveImageSanitizationLimits, Tt as hasInterSessionUserProvenance, U as isFailoverErrorMessage, Ut as createBrowserRouteContext, V as isContextOverflowError, Vt as acquireSessionWriteLock, W as isLikelyContextOverflowError, Wt as registerBrowserRoutes, X as parseImageSizeError, Xt as resolveExistingPathsWithinRoot, Y as parseImageDimensionError, Yt as DEFAULT_UPLOAD_DIR, Z as sanitizeUserFacingText, Zt as getBridgeAuthForPort, _ as validateAnthropicTurns, _t as normalizeSessionDeliveryFields, an as mergeAlsoAllowPolicy, at as loadSessionStore, b as isMessagingToolDuplicateNormalized, bt as capArrayByJsonBytes, c as normalizeChannelTargetInput, cn as stripPluginOnlyAllowlist, ct as updateLastRoute, d as parseReplyDirectives, dn as buildBootstrapContextFiles, dt as isCacheEnabled, en as applyOwnerOnlyToolPolicy, et as resolveSandboxRuntimeStatus, f as MEDIA_TOKEN_RE, fn as ensureSessionHeader, ft as resolveCacheTtlMs$1, g as initializeGlobalHookRunner, gt as normalizeDeliveryContext, h as getGlobalHookRunner, hn as sanitizeGoogleTurnOrdering, ht as mergeDeliveryContext, in as expandToolGroups, it as resolveAndPersistSessionFile, j as BILLING_ERROR_USER_MESSAGE, jt as resolveSessionResetType, k as isAntigravityClaude, kt as resolveChannelResetConfig, l as normalizeTargetForProvider, ln as compileGlobPatterns, lt as updateSessionStore, m as parseInlineDirectives$1, mn as resolveBootstrapTotalMaxChars, mt as deliveryContextKey, nn as collectExplicitAllowlist, o as normalizeReplyPayloadsForDelivery, on as normalizeToolName$1, ot as readSessionUpdatedAt, p as splitMediaFromOutput, pn as resolveBootstrapMaxChars, pt as deliveryContextFromSession, q as isTimeoutErrorMessage, qt as getMediaDir, rn as expandPolicyWithPluginGroups, rt as appendAssistantMessageToSessionTranscript, s as buildTargetResolverSignature, sn as resolveToolProfilePolicy, st as recordSessionMetaFromInbound, t as deliverOutboundPayloads, tn as buildPluginToolGroups, tt as extractDeliveryInfo, u as throwIfAborted, un as matchesAnyGlobPattern, ut as updateSessionStoreEntry, v as validateGeminiTurns, w as sanitizeToolResultImages, wt as applyInputProvenanceToUserMessage, x as normalizeTextForComparison, xt as countToolResults, y as pickFallbackThinkingLevel, yt as archiveSessionTranscripts, z as isCloudCodeAssistFormatError, zt as deriveSessionMetaPatch } from "./deliver-DyO3QD8O.js";
|
|
13
13
|
import { C as unsetConfigValueAtPath, S as setConfigValueAtPath, T as VERSION, _ as resetConfigOverrides, b as getConfigValueAtPath, c as loadConfig, d as writeConfigFile, f as validateConfigObjectWithPlugins, g as getConfigOverrides, h as validateJsonSchemaValue, i as isBlockedHostnameOrIp, l as readConfigFileSnapshot, o as normalizeHostname, p as parseDurationMs, t as SsrFBlockedError, u as resolveConfigSnapshotHash, v as setConfigOverride, w as DEFAULT_SUBAGENT_MAX_SPAWN_DEPTH, x as parseConfigPath, y as unsetConfigOverride } from "./ssrf-oI58TMOb.js";
|
|
14
14
|
import { t as parseBooleanValue } from "./boolean-BsqeuxE6.js";
|
|
15
15
|
import { i as resolveShellEnvFallbackTimeoutMs, n as getShellPathFromLoginShell, s as isTruthyEnvValue } from "./shell-env-B1lDWz4t.js";
|
|
16
16
|
import { a as applyTestPluginDefaults, c as resolveMemorySlotDecision, d as isDangerousHostEnvVarName, i as safeStatSync, n as discoverSymiPlugins, o as normalizePluginsConfig, r as isPathInside, s as resolveEnableState, t as loadPluginManifestRegistry, u as isPathInsideWithRealpath } from "./manifest-registry-BGJu2aC-.js";
|
|
17
|
-
import { C as rawDataToString, O as DEFAULT_AI_SNAPSHOT_MAX_CHARS, T as isSecureWebSocketUrl, x as ensureChromeExtensionRelayServer } from "./chrome-
|
|
17
|
+
import { C as rawDataToString, O as DEFAULT_AI_SNAPSHOT_MAX_CHARS, T as isSecureWebSocketUrl, x as ensureChromeExtensionRelayServer } from "./chrome-C_I81hbq.js";
|
|
18
18
|
import { l as parseFrontmatterBlock } from "./frontmatter-CJEX1BrH.js";
|
|
19
19
|
import { c as assertSandboxPath, d as resolveSandboxedMediaSource, f as applySkillEnvOverrides, i as resolveSkillsPromptForRun, l as resolveSandboxInputPath, n as buildWorkspaceSkillSnapshot, p as applySkillEnvOverridesFromSnapshot, r as loadWorkspaceSkillEntries, s as assertMediaNotDataUrl } from "./skills-Dm4gX4Tl.js";
|
|
20
20
|
import { n as redactToolDetail } from "./redact-CSGZUFxa.js";
|
|
@@ -31,7 +31,7 @@ import { t as emitSessionTranscriptUpdate } from "./transcript-events-ChU6IQwp.j
|
|
|
31
31
|
import { n as isSilentReplyText, t as SILENT_REPLY_TOKEN } from "./tokens-D_vCJSzF.js";
|
|
32
32
|
import { a as logMessageProcessed, i as logLaneEnqueue, o as logMessageQueued, r as logLaneDequeue, s as logSessionStateChange, t as diag } from "./diagnostic-BALvP9wI.js";
|
|
33
33
|
import { n as getDiagnosticSessionState } from "./diagnostic-session-state-BDfanaOY.js";
|
|
34
|
-
import { a as parseGeminiAuth, c as resolveMemorySearchConfig, d as requireApiKey, f as resolveApiKeyForProvider, h as resolveModelAuthMode, i as resolveOllamaBaseUrl, l as getApiKeyForModel, m as resolveEnvApiKey, n as retryAsync, o as collectProviderApiKeysForExecution, p as resolveAwsSdkEnvVarName, r as probeOllamaEmbeddingModels, s as executeWithApiKeyRotation, u as getCustomProviderApiKey } from "./manager-
|
|
34
|
+
import { a as parseGeminiAuth, c as resolveMemorySearchConfig, d as requireApiKey, f as resolveApiKeyForProvider, h as resolveModelAuthMode, i as resolveOllamaBaseUrl, l as getApiKeyForModel, m as resolveEnvApiKey, n as retryAsync, o as collectProviderApiKeysForExecution, p as resolveAwsSdkEnvVarName, r as probeOllamaEmbeddingModels, s as executeWithApiKeyRotation, u as getCustomProviderApiKey } from "./manager-PTSjHNVq.js";
|
|
35
35
|
import { r as resolveCopilotApiToken, t as DEFAULT_COPILOT_API_BASE_URL } from "./github-copilot-token-uhEBNQfj.js";
|
|
36
36
|
import { t as ensurePiAuthJsonFromAuthProfiles } from "./pi-auth-json-DCGR3yfh.js";
|
|
37
37
|
import { a as resolveEffectiveMessagesConfig, i as resolveAckReaction, o as resolveHumanDelayConfig, r as resolveResponsePrefixTemplate, t as createReplyPrefixOptions } from "./reply-prefix-D0NzzC4I.js";
|
|
@@ -58,7 +58,7 @@ import crypto, { X509Certificate, createHash, createHmac, randomBytes, randomUUI
|
|
|
58
58
|
import { complete, createAssistantMessageEventStream, streamSimple } from "@mariozechner/pi-ai";
|
|
59
59
|
import AjvPkg from "ajv";
|
|
60
60
|
import { CURRENT_SESSION_VERSION, DefaultResourceLoader, SessionManager, SettingsManager, codingTools, createAgentSession, createEditTool, createReadTool, createWriteTool, estimateTokens, generateSummary, readTool } from "@mariozechner/pi-coding-agent";
|
|
61
|
-
import { WebSocket } from "ws";
|
|
61
|
+
import { WebSocket as WebSocket$1 } from "ws";
|
|
62
62
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
63
63
|
import { BedrockClient, ListFoundationModelsCommand } from "@aws-sdk/client-bedrock";
|
|
64
64
|
import { createJiti } from "jiti";
|
|
@@ -4460,7 +4460,7 @@ async function getMemorySearchManager(params) {
|
|
|
4460
4460
|
const wrapper = new FallbackMemoryManager({
|
|
4461
4461
|
primary,
|
|
4462
4462
|
fallbackFactory: async () => {
|
|
4463
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
4463
|
+
const { MemoryIndexManager } = await import("./manager-PTSjHNVq.js").then((n) => n.t);
|
|
4464
4464
|
return await MemoryIndexManager.get(params);
|
|
4465
4465
|
}
|
|
4466
4466
|
}, () => QMD_MANAGER_CACHE.delete(cacheKey));
|
|
@@ -4473,7 +4473,7 @@ async function getMemorySearchManager(params) {
|
|
|
4473
4473
|
}
|
|
4474
4474
|
}
|
|
4475
4475
|
try {
|
|
4476
|
-
const { MemoryIndexManager } = await import("./manager-
|
|
4476
|
+
const { MemoryIndexManager } = await import("./manager-PTSjHNVq.js").then((n) => n.t);
|
|
4477
4477
|
return { manager: await MemoryIndexManager.get(params) };
|
|
4478
4478
|
} catch (err) {
|
|
4479
4479
|
return {
|
|
@@ -9621,7 +9621,7 @@ var GatewayClient = class {
|
|
|
9621
9621
|
if (fingerprint !== expected) return /* @__PURE__ */ new Error("gateway tls fingerprint mismatch");
|
|
9622
9622
|
});
|
|
9623
9623
|
}
|
|
9624
|
-
this.ws = new WebSocket(url, wsOptions);
|
|
9624
|
+
this.ws = new WebSocket$1(url, wsOptions);
|
|
9625
9625
|
this.ws.on("open", () => {
|
|
9626
9626
|
if (url.startsWith("wss://") && this.opts.tlsFingerprint) {
|
|
9627
9627
|
const tlsError = this.validateTlsFingerprint();
|
|
@@ -9840,7 +9840,7 @@ var GatewayClient = class {
|
|
|
9840
9840
|
return null;
|
|
9841
9841
|
}
|
|
9842
9842
|
async request(method, params, opts) {
|
|
9843
|
-
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) throw new Error("gateway not connected");
|
|
9843
|
+
if (!this.ws || this.ws.readyState !== WebSocket$1.OPEN) throw new Error("gateway not connected");
|
|
9844
9844
|
const id = randomUUID();
|
|
9845
9845
|
const frame = {
|
|
9846
9846
|
type: "req",
|
|
@@ -10801,7 +10801,7 @@ async function routeReply(params) {
|
|
|
10801
10801
|
const resolvedReplyToId = replyToId ?? (channelId === "slack" && threadId != null && threadId !== "" ? String(threadId) : void 0);
|
|
10802
10802
|
const resolvedThreadId = channelId === "slack" ? null : threadId ?? null;
|
|
10803
10803
|
try {
|
|
10804
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
10804
|
+
const { deliverOutboundPayloads } = await import("./deliver-DyO3QD8O.js").then((n) => n.n);
|
|
10805
10805
|
return {
|
|
10806
10806
|
ok: true,
|
|
10807
10807
|
messageId: (await deliverOutboundPayloads({
|
|
@@ -43644,7 +43644,7 @@ async function deliverSessionMaintenanceWarning(params) {
|
|
|
43644
43644
|
return;
|
|
43645
43645
|
}
|
|
43646
43646
|
try {
|
|
43647
|
-
const { deliverOutboundPayloads } = await import("./deliver-
|
|
43647
|
+
const { deliverOutboundPayloads } = await import("./deliver-DyO3QD8O.js").then((n) => n.n);
|
|
43648
43648
|
await deliverOutboundPayloads({
|
|
43649
43649
|
cfg: params.cfg,
|
|
43650
43650
|
channel,
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { sendMessage } from "./graph-mail.js";
|
|
3
|
+
import * as store from "./store.js";
|
|
4
|
+
|
|
5
|
+
describe("graphFetch — empty-body success responses", () => {
|
|
6
|
+
let originalFetch: typeof fetch;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
originalFetch = globalThis.fetch;
|
|
10
|
+
vi.spyOn(store, "getAccessToken").mockResolvedValue("test-bearer-token");
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
afterEach(() => {
|
|
14
|
+
globalThis.fetch = originalFetch;
|
|
15
|
+
vi.restoreAllMocks();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("resolves on HTTP 202 with empty body (the /me/sendMail success shape)", async () => {
|
|
19
|
+
const fetchMock = vi.fn().mockResolvedValue(
|
|
20
|
+
new Response("", {
|
|
21
|
+
status: 202,
|
|
22
|
+
statusText: "Accepted",
|
|
23
|
+
}),
|
|
24
|
+
);
|
|
25
|
+
globalThis.fetch = fetchMock as unknown as typeof fetch;
|
|
26
|
+
|
|
27
|
+
await expect(
|
|
28
|
+
sendMessage({
|
|
29
|
+
to: ["test@example.com"],
|
|
30
|
+
subject: "test",
|
|
31
|
+
body: "test body",
|
|
32
|
+
}),
|
|
33
|
+
).resolves.toBeUndefined();
|
|
34
|
+
|
|
35
|
+
expect(fetchMock).toHaveBeenCalledOnce();
|
|
36
|
+
const [url, init] = fetchMock.mock.calls[0]!;
|
|
37
|
+
expect(url).toBe("https://graph.microsoft.com/v1.0/me/sendMail");
|
|
38
|
+
expect(init?.method).toBe("POST");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("resolves on HTTP 204 with empty body (existing behavior preserved)", async () => {
|
|
42
|
+
const fetchMock = vi.fn().mockResolvedValue(
|
|
43
|
+
new Response(null, {
|
|
44
|
+
status: 204,
|
|
45
|
+
statusText: "No Content",
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
48
|
+
globalThis.fetch = fetchMock as unknown as typeof fetch;
|
|
49
|
+
|
|
50
|
+
await expect(
|
|
51
|
+
sendMessage({
|
|
52
|
+
to: ["test@example.com"],
|
|
53
|
+
subject: "test",
|
|
54
|
+
body: "test body",
|
|
55
|
+
}),
|
|
56
|
+
).resolves.toBeUndefined();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("propagates 4xx errors with body text in the thrown message", async () => {
|
|
60
|
+
const fetchMock = vi.fn().mockResolvedValue(
|
|
61
|
+
new Response(JSON.stringify({ error: { message: "InvalidRecipient" } }), {
|
|
62
|
+
status: 400,
|
|
63
|
+
statusText: "Bad Request",
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
globalThis.fetch = fetchMock as unknown as typeof fetch;
|
|
67
|
+
|
|
68
|
+
await expect(
|
|
69
|
+
sendMessage({
|
|
70
|
+
to: ["test@example.com"],
|
|
71
|
+
subject: "test",
|
|
72
|
+
body: "test body",
|
|
73
|
+
}),
|
|
74
|
+
).rejects.toThrow(/Graph API .* failed \(400\)/);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -38,10 +38,15 @@ async function graphFetch<T>(path: string, init?: RequestInit): Promise<T> {
|
|
|
38
38
|
const text = await response.text().catch(() => "");
|
|
39
39
|
throw new Error(`Graph API ${path} failed (${response.status}): ${text || "unknown error"}`);
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
// Microsoft Graph returns 202 Accepted (empty body) for action endpoints
|
|
42
|
+
// like /me/sendMail and /me/messages/{id}/reply, and 204 No Content for
|
|
43
|
+
// others. Read the body as text first so any no-body success status
|
|
44
|
+
// resolves to {} instead of throwing "Unexpected end of JSON input".
|
|
45
|
+
const text = await response.text();
|
|
46
|
+
if (!text) {
|
|
42
47
|
return {} as T;
|
|
43
48
|
}
|
|
44
|
-
return
|
|
49
|
+
return JSON.parse(text) as T;
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
export async function listMessages(params?: {
|