@sentry/junior 0.179.0 → 0.181.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-hooks-32IDCLMW.js → agent-hooks-IQUW6ERD.js} +16 -18
- package/dist/api/schema/workspace.d.ts +2 -0
- package/dist/api/schema.js +1 -2
- package/dist/api.js +202 -199
- package/dist/app.d.ts +4 -0
- package/dist/app.js +300 -1259
- package/dist/catalog-runtime-PMQWNIXA.js +14 -0
- package/dist/chat/agent/sandbox.d.ts +0 -2
- package/dist/chat/api-turns/routing.d.ts +4 -0
- package/dist/chat/api-turns/work.d.ts +5 -0
- package/dist/chat/config.d.ts +5 -2
- package/dist/chat/configuration/defaults.d.ts +1 -1
- package/dist/chat/conversations/projection.d.ts +6 -4
- package/dist/chat/ingress/message-router.d.ts +3 -0
- package/dist/chat/model-profile.d.ts +8 -10
- package/dist/chat/pi/conversation-events.d.ts +3 -2
- package/dist/chat/plugins/agent-hooks.d.ts +1 -1
- package/dist/chat/plugins/task-queue.d.ts +40 -3
- package/dist/chat/plugins/task-runner.d.ts +1 -1
- package/dist/chat/queue/callback.d.ts +26 -0
- package/dist/chat/queue/sign.d.ts +30 -0
- package/dist/chat/sandbox/sandbox.d.ts +0 -2
- package/dist/chat/sandbox/session.d.ts +0 -2
- package/dist/chat/sandbox/skill-sync.d.ts +1 -1
- package/dist/chat/sandbox/snapshot/events.d.ts +23 -0
- package/dist/chat/sandbox/snapshot/job-callback.d.ts +5 -0
- package/dist/chat/sandbox/snapshot/job-queue.d.ts +26 -0
- package/dist/chat/sandbox/snapshot/job-runner.d.ts +11 -0
- package/dist/chat/sandbox/snapshot/not-ready-error.d.ts +6 -0
- package/dist/chat/sandbox/snapshot/workspace.d.ts +9 -3
- package/dist/chat/services/turn-router.d.ts +4 -3
- package/dist/chat/services/turn-session-routing.d.ts +1 -0
- package/dist/chat/task-execution/queue-signing.d.ts +10 -21
- package/dist/chat/task-execution/state.d.ts +48 -0
- package/dist/chat/task-execution/store.d.ts +28 -2
- package/dist/chat/task-execution/worker.d.ts +4 -1
- package/dist/chat/tools/handoff/tool.d.ts +1 -1
- package/dist/chat/tools/types.d.ts +2 -0
- package/dist/chat/workspaces/types.d.ts +2 -0
- package/dist/{chunk-Q5B3WTGG.js → chunk-3KCQEG6W.js} +42 -41
- package/dist/{chunk-XZY6G5YZ.js → chunk-3KSSALN4.js} +180 -87
- package/dist/{chunk-3AFVR5UC.js → chunk-3X55QRAG.js} +18 -16
- package/dist/{chunk-SLGGOASN.js → chunk-4IX32NSL.js} +46 -46
- package/dist/{chunk-6ZWRNC4D.js → chunk-6Y5B5PEX.js} +1 -1
- package/dist/chunk-7H2VZTWN.js +103 -0
- package/dist/{chunk-CGA4ERJ5.js → chunk-CEMMLV5L.js} +1 -1
- package/dist/{chunk-FIANEE7Z.js → chunk-CM5HNV2W.js} +6 -6
- package/dist/{chunk-TKB25A3L.js → chunk-CZYNWPWD.js} +2 -1
- package/dist/{chunk-3I7XE3PA.js → chunk-D6ZD7VXP.js} +49 -38
- package/dist/chunk-DKIJ2RP5.js +68 -0
- package/dist/{chunk-G2CAC4CV.js → chunk-DSA6WTRP.js} +74 -68
- package/dist/{chunk-OOUNJNMR.js → chunk-DWPN6SCH.js} +1 -1
- package/dist/{chunk-HQNE5APD.js → chunk-EBMRB6Z6.js} +100 -79
- package/dist/{chunk-ZQMG3CL5.js → chunk-EM7EECT5.js} +16 -16
- package/dist/{chunk-XSPSCWLH.js → chunk-ETJTXYHY.js} +4 -4
- package/dist/{chunk-FTGD2FBP.js → chunk-EU7KJDOG.js} +2 -2
- package/dist/{chunk-CJLBLELR.js → chunk-FWILPBVQ.js} +8 -61
- package/dist/{chunk-4GWXAILB.js → chunk-GPA3ZSYY.js} +1 -1
- package/dist/{chunk-U4TKB6F6.js → chunk-GREV5PJK.js} +108 -5
- package/dist/{chunk-KJLHIHFF.js → chunk-GWFRPQNP.js} +43 -230
- package/dist/{chunk-YFNAMRGE.js → chunk-HEBMSITT.js} +1 -1
- package/dist/chunk-HJ27A6YB.js +218 -0
- package/dist/{chunk-R5NWWYIS.js → chunk-HZHUMCNV.js} +5 -5
- package/dist/{chunk-RTRBYSF3.js → chunk-IJ6SS4WB.js} +1 -1
- package/dist/{chunk-B6ECUSVX.js → chunk-IKKETMQC.js} +8 -8
- package/dist/{chunk-R6U7N4FS.js → chunk-KKSVCHDO.js} +10 -3
- package/dist/{chunk-JMJNFEDC.js → chunk-KMBU4PJP.js} +9 -54
- package/dist/chunk-KQZX24QQ.js +164 -0
- package/dist/{chunk-GPLAT6H7.js → chunk-LCNPXLE7.js} +22 -18
- package/dist/{chunk-2HIPYNQI.js → chunk-LG5MYY6U.js} +33 -32
- package/dist/chunk-LZOQFC5F.js +209 -0
- package/dist/chunk-M3QYTBQ6.js +55 -0
- package/dist/{chunk-M63DETLL.js → chunk-N7TMSOZH.js} +6 -6
- package/dist/{chunk-FIDMHAO6.js → chunk-NQTA72Q3.js} +84 -274
- package/dist/{chunk-RZRYOLCE.js → chunk-PBKZQAUA.js} +2315 -1150
- package/dist/chunk-PEQXYSSE.js +45 -0
- package/dist/{chunk-3TM3FYLQ.js → chunk-PL57B6NC.js} +1 -1
- package/dist/{chunk-JT4WMD3C.js → chunk-PPYDHUEL.js} +144 -218
- package/dist/{chunk-5IRROPA5.js → chunk-Q2KY27IX.js} +129 -31
- package/dist/{chunk-VP4OVRDD.js → chunk-RNMASWLP.js} +69 -73
- package/dist/{chunk-FAS6AIMF.js → chunk-TDT2R77B.js} +8 -8
- package/dist/{chunk-TIEKUH4Q.js → chunk-TJHSAHQN.js} +4 -3
- package/dist/{chunk-H4HBKISO.js → chunk-TXKUKMVO.js} +1 -1
- package/dist/chunk-X6GDDWQH.js +60 -0
- package/dist/{chunk-GENV6KF2.js → chunk-XYTJUHRZ.js} +108 -76
- package/dist/cli/chat.js +47 -43
- package/dist/cli/check.js +13 -15
- package/dist/cli/env.js +0 -1
- package/dist/cli/init.js +0 -1
- package/dist/cli/main.js +2 -3
- package/dist/cli/plugins.js +18 -20
- package/dist/cli/run.js +0 -1
- package/dist/cli/snapshot-create.js +14 -16
- package/dist/cli/upgrade.js +16 -18
- package/dist/{conversation-work-KATFHLG3.js → conversation-work-VIOQ5ZF3.js} +0 -2
- package/dist/db/schema/snapshots.d.ts +17 -0
- package/dist/db/schema.d.ts +17 -0
- package/dist/{db-EJAV7JL6.js → db-QNPVCQPT.js} +8 -10
- package/dist/deployment.d.ts +1 -0
- package/dist/{discovery-GUFTFBTL.js → discovery-DWVDM7UK.js} +1 -2
- package/dist/{experimental-XVDOSRBS.js → experimental-SIJSRDJD.js} +0 -1
- package/dist/instrumentation.js +7 -9
- package/dist/nitro.js +39 -13
- package/dist/{oauth-callback-server-GAVSUBTQ.js → oauth-callback-server-KYMPJOTC.js} +34 -32
- package/dist/{oauth-relay-3ZU72UGL.js → oauth-relay-5XPVRPYB.js} +0 -1
- package/dist/{plugins-HW4VWW6G.js → plugins-YTYJMMJF.js} +1 -2
- package/dist/{runner-34JL64JF.js → runner-3RS2D2ZR.js} +39 -33
- package/dist/{sandbox-egress-signals-DXOOBSBI.js → sandbox-egress-signals-FIL7EGPR.js} +5 -6
- package/dist/{sentry-JMWTS32N.js → sentry-MB3NL3IR.js} +1 -2
- package/dist/skills-5B3Y6XX6.js +27 -0
- package/dist/spawn-VYARS3DU.js +37 -0
- package/dist/task-runner-4IXKKZHL.js +32 -0
- package/dist/validation-Q65QD27B.js +17 -0
- package/dist/vercel.js +0 -1
- package/dist/version.js +1 -2
- package/dist/work-DCMQWAAP.js +45 -0
- package/dist/worker-QL3CHLZL.js +22 -0
- package/migrations/0035_workspace_snapshot_size_bytes.sql +2 -0
- package/migrations/meta/0035_snapshot.json +3048 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +7 -6
- package/dist/catalog-runtime-FBVA6WAQ.js +0 -16
- package/dist/chat/plugins/task-callback.d.ts +0 -5
- package/dist/chat/plugins/task-message.d.ts +0 -23
- package/dist/chat/plugins/task-signing.d.ts +0 -31
- package/dist/chat/sandbox/snapshot/waiting-error.d.ts +0 -15
- package/dist/chat/services/workspace-snapshot-wait.d.ts +0 -27
- package/dist/chunk-5I6ORJUY.js +0 -127
- package/dist/chunk-6GWA276C.js +0 -72
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/chunk-UT6X7XN7.js +0 -51
- package/dist/chunk-WR76IVA5.js +0 -130
- package/dist/skills-U545HALM.js +0 -29
- package/dist/spawn-I2S4IDUQ.js +0 -37
- package/dist/validation-EVXVGA44.js +0 -19
- package/dist/work-QOAUPDBU.js +0 -45
- package/dist/worker-5GX2IKLZ.js +0 -24
|
@@ -2,8 +2,8 @@ import type { StateAdapter } from "chat";
|
|
|
2
2
|
import type { ConversationStore } from "@/chat/conversations/store";
|
|
3
3
|
import { type ConversationWorkQueue } from "./queue";
|
|
4
4
|
import * as workState from "./state";
|
|
5
|
-
export { CONVERSATION_ACTIVE_INDEX_KEY, CONVERSATION_BY_ACTIVITY_INDEX_KEY, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS, CONVERSATION_WORK_LEASE_TTL_MS, CONVERSATION_WORK_MAX_DELIVERY_ATTEMPTS, CONVERSATION_WORK_MAX_RETRIES, CONVERSATION_WORK_STALE_ENQUEUE_MS, isFinalAttempt, isInvalidConversationRecordError, type AgentInput, type AttemptFailure, type AppendAndEnqueueInboundMessageResult, type AppendInboundMessageResult, type Conversation, type ConversationExecution, type ConversationWorkLease, type ConversationWorkState, type ExecutionStatus, type InboundMessage, type InboundMessageDelivery, type Lease, type RequestConversationWorkResult, type Source, type StartConversationWorkAcquired, type StartConversationWorkActive, type StartConversationWorkNoWork, type StartConversationWorkResult, } from "@/chat/task-execution/state";
|
|
6
|
-
import type { AppendAndEnqueueInboundMessageResult, Conversation, InboundMessage } from "@/chat/task-execution/state";
|
|
5
|
+
export { CONVERSATION_ACTIVE_INDEX_KEY, CONVERSATION_BY_ACTIVITY_INDEX_KEY, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS, CONVERSATION_WORK_LEASE_TTL_MS, CONVERSATION_WORK_MAX_DELIVERY_ATTEMPTS, CONVERSATION_WORK_MAX_RETRIES, CONVERSATION_WORK_STALE_ENQUEUE_MS, isFinalAttempt, isInvalidConversationRecordError, type AgentInput, type AttemptFailure, type AppendAndEnqueueInboundMessageResult, type AppendInboundMessageResult, type CompleteConversationStopResult, type Conversation, type ConversationExecution, type ConversationStop, type ConversationWorkLease, type ConversationWorkState, type ExecutionStatus, type InboundMessage, type InboundMessageDelivery, type Lease, type RequestConversationWorkResult, type Source, type StartConversationWorkAcquired, type StartConversationWorkActive, type StartConversationWorkNoWork, type StartConversationWorkResult, type StopConversationWorkResult, } from "@/chat/task-execution/state";
|
|
6
|
+
import type { AppendAndEnqueueExclusiveInboundMessageResult, AppendAndEnqueueInboundMessageResult, Conversation, InboundMessage } from "@/chat/task-execution/state";
|
|
7
7
|
export type EnsureConversationWakeResult = {
|
|
8
8
|
queueMessageId?: string;
|
|
9
9
|
status: "enqueued";
|
|
@@ -63,6 +63,30 @@ export declare function appendAndEnqueueInboundMessage(args: {
|
|
|
63
63
|
queue: ConversationWorkQueue;
|
|
64
64
|
state?: StateAdapter;
|
|
65
65
|
}): Promise<AppendAndEnqueueInboundMessageResult>;
|
|
66
|
+
/** Persist exclusive inbound work and wake its worker when admitted. */
|
|
67
|
+
export declare function appendAndEnqueueExclusiveInboundMessage(args: {
|
|
68
|
+
message: InboundMessage;
|
|
69
|
+
conversationStore?: ConversationStore;
|
|
70
|
+
nowMs?: number;
|
|
71
|
+
queue: ConversationWorkQueue;
|
|
72
|
+
state?: StateAdapter;
|
|
73
|
+
}): Promise<AppendAndEnqueueExclusiveInboundMessageResult>;
|
|
74
|
+
/** Persist a stop request for the current Conversation run. */
|
|
75
|
+
export declare function stopConversationWork(args: {
|
|
76
|
+
conversationId: string;
|
|
77
|
+
conversationStore?: ConversationStore;
|
|
78
|
+
nowMs?: number;
|
|
79
|
+
state?: StateAdapter;
|
|
80
|
+
}): Promise<workState.StopConversationWorkResult>;
|
|
81
|
+
/** Finish an observed stop request under the current worker lease. */
|
|
82
|
+
export declare function completeConversationStop(args: {
|
|
83
|
+
conversationId: string;
|
|
84
|
+
conversationStore?: ConversationStore;
|
|
85
|
+
leaseToken: string;
|
|
86
|
+
nowMs?: number;
|
|
87
|
+
runId: string;
|
|
88
|
+
state?: StateAdapter;
|
|
89
|
+
}): Promise<workState.CompleteConversationStopResult>;
|
|
66
90
|
/** Clear an accepted wake marker after its delivery finds no runnable work. */
|
|
67
91
|
export declare function clearConsumedConversationWake(args: {
|
|
68
92
|
conversationId: string;
|
|
@@ -179,6 +203,8 @@ export declare function completeConversationWork(args: {
|
|
|
179
203
|
madeProgress?: boolean;
|
|
180
204
|
conversationStore?: ConversationStore;
|
|
181
205
|
nowMs?: number;
|
|
206
|
+
/** Keep a raced stop runnable after a stop-aware adapter returns. */
|
|
207
|
+
resumeIfStopped?: boolean;
|
|
182
208
|
state?: StateAdapter;
|
|
183
209
|
}): Promise<"pending" | "completed" | "lost_lease">;
|
|
184
210
|
/** Record one failed delivery attempt and dead-letter messages at their limit. */
|
|
@@ -12,6 +12,8 @@ export interface ConversationWorkerContext {
|
|
|
12
12
|
publishExternally: boolean;
|
|
13
13
|
/** True when the current execution slice must stop at its next safe boundary. */
|
|
14
14
|
shouldYield(): boolean;
|
|
15
|
+
/** Return an AbortSignal backed by the durable Conversation stop request. */
|
|
16
|
+
stopSignal?(): AbortSignal;
|
|
15
17
|
}
|
|
16
18
|
export interface InboxAttempt {
|
|
17
19
|
ack(): Promise<void>;
|
|
@@ -22,7 +24,8 @@ export interface InboxAttempt {
|
|
|
22
24
|
messages: InboundMessage[];
|
|
23
25
|
}
|
|
24
26
|
export interface ConversationWorkerResult {
|
|
25
|
-
|
|
27
|
+
/** `paused` waits for an external wake but must resume if a stop raced it. */
|
|
28
|
+
status: "completed" | "deferred" | "lost_lease" | "paused" | "yielded";
|
|
26
29
|
}
|
|
27
30
|
export interface ConversationWorkProcessResult {
|
|
28
31
|
status: "active" | "completed" | "failed" | "lost_lease" | "no_work" | "pending_requeued" | "yielded";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToolRuntimeContext } from "@/chat/tools/types";
|
|
2
2
|
export declare const HANDOFF_TOOL_NAME = "handoff";
|
|
3
|
-
/** Create the
|
|
3
|
+
/** Create the tool that switches the active model profile. */
|
|
4
4
|
export declare function createHandoffTool(handoff: NonNullable<ToolRuntimeContext["handoff"]>): Omit<import("../definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
|
|
5
5
|
inputSchema: import("../definition").JsonSchemaObject;
|
|
6
6
|
outputSchema: import("../definition").JsonSchemaObject;
|
|
@@ -64,6 +64,8 @@ interface BaseToolRuntimeContext {
|
|
|
64
64
|
* Do not parse as Slack unless the value starts with `slack:`.
|
|
65
65
|
*/
|
|
66
66
|
conversationId?: string;
|
|
67
|
+
/** Location associated with this Conversation. */
|
|
68
|
+
locationId?: string;
|
|
67
69
|
/** Runtime-owned default outbound destination for this invocation. */
|
|
68
70
|
destination: Destination;
|
|
69
71
|
actor?: Actor;
|
|
@@ -8,6 +8,8 @@ export interface WorkspaceSnapshot {
|
|
|
8
8
|
id: string;
|
|
9
9
|
generatedAt: Date;
|
|
10
10
|
buildDurationMs: number;
|
|
11
|
+
/** Provider snapshot size in bytes when capture reported it. */
|
|
12
|
+
sizeBytes: number | null;
|
|
11
13
|
profileHash: string;
|
|
12
14
|
}
|
|
13
15
|
export type WorkspaceSnapshotBuildStatus = "building" | "failed";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-RF6J3DIO.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveBaseUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LG5MYY6U.js";
|
|
7
7
|
import {
|
|
8
8
|
isExperimentalFeatureEnabled
|
|
9
9
|
} from "./chunk-VRS6WDK5.js";
|
|
@@ -12,27 +12,27 @@ import {
|
|
|
12
12
|
getPlugins,
|
|
13
13
|
getSlackClient,
|
|
14
14
|
withSlackRetries
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-D6ZD7VXP.js";
|
|
16
16
|
import {
|
|
17
17
|
getDb,
|
|
18
18
|
parseDestination
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-RNMASWLP.js";
|
|
20
20
|
import {
|
|
21
21
|
sleep
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-KMBU4PJP.js";
|
|
23
23
|
import {
|
|
24
24
|
acquireActiveLock,
|
|
25
25
|
getStateAdapter
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-PL57B6NC.js";
|
|
27
27
|
import {
|
|
28
28
|
pluginCatalogRuntime
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-HEBMSITT.js";
|
|
30
30
|
import {
|
|
31
31
|
fetchWithBoundedOAuthErrorBodies
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-4IX32NSL.js";
|
|
33
33
|
import {
|
|
34
34
|
isRecord
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-EBMRB6Z6.js";
|
|
36
36
|
|
|
37
37
|
// src/chat/capabilities/router.ts
|
|
38
38
|
var ProviderCredentialRouter = class {
|
|
@@ -167,7 +167,7 @@ function createAgentRunner(execute, options) {
|
|
|
167
167
|
...run.durability,
|
|
168
168
|
spawnAgent
|
|
169
169
|
}
|
|
170
|
-
} :
|
|
170
|
+
} : void 0
|
|
171
171
|
};
|
|
172
172
|
return await execute(nextRun, streamFn);
|
|
173
173
|
}
|
|
@@ -262,8 +262,8 @@ function getMcpProviderErrorAttributes(error) {
|
|
|
262
262
|
return {
|
|
263
263
|
"app.credential.provider": error.provider,
|
|
264
264
|
"app.mcp.error.phase": error.phase,
|
|
265
|
-
...error.status !== void 0 ? { "http.response.status_code": error.status } :
|
|
266
|
-
...error.resourceHost ? { "server.address": error.resourceHost } :
|
|
265
|
+
...error.status !== void 0 ? { "http.response.status_code": error.status } : void 0,
|
|
266
|
+
...error.resourceHost ? { "server.address": error.resourceHost } : void 0
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
269
|
var McpToolError = class extends Error {
|
|
@@ -322,7 +322,7 @@ function normalizeUser(raw) {
|
|
|
322
322
|
is_bot: raw.is_bot ?? false,
|
|
323
323
|
is_deleted: raw.deleted ?? false,
|
|
324
324
|
timezone: raw.tz || void 0,
|
|
325
|
-
...profileFields.length > 0 ? { profile_fields: profileFields } :
|
|
325
|
+
...profileFields.length > 0 ? { profile_fields: profileFields } : void 0
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
328
|
function normalizeNameTokens(value) {
|
|
@@ -420,7 +420,7 @@ async function listWorkspaceUsers(options) {
|
|
|
420
420
|
const result = await withSlackRetries(
|
|
421
421
|
() => client.users.list({
|
|
422
422
|
limit: 200,
|
|
423
|
-
...cursor ? { cursor } :
|
|
423
|
+
...cursor ? { cursor } : void 0
|
|
424
424
|
}),
|
|
425
425
|
3,
|
|
426
426
|
{ action: "users.list" }
|
|
@@ -547,9 +547,9 @@ async function selectPluginGrant(input) {
|
|
|
547
547
|
const result = await hook({
|
|
548
548
|
...basePluginContext(plugin),
|
|
549
549
|
request: {
|
|
550
|
-
...input.bodyText !== void 0 ? { bodyText: input.bodyText } :
|
|
550
|
+
...input.bodyText !== void 0 ? { bodyText: input.bodyText } : void 0,
|
|
551
551
|
method: input.method,
|
|
552
|
-
...input.operation ? { operation: input.operation } :
|
|
552
|
+
...input.operation ? { operation: input.operation } : void 0,
|
|
553
553
|
url: input.upstreamUrl.toString()
|
|
554
554
|
}
|
|
555
555
|
});
|
|
@@ -576,7 +576,7 @@ async function onPluginEgressResponse(input) {
|
|
|
576
576
|
},
|
|
577
577
|
request: {
|
|
578
578
|
method: input.method,
|
|
579
|
-
...input.operation ? { operation: input.operation } :
|
|
579
|
+
...input.operation ? { operation: input.operation } : void 0,
|
|
580
580
|
url: input.upstreamUrl.toString()
|
|
581
581
|
},
|
|
582
582
|
response: input.response
|
|
@@ -618,7 +618,7 @@ async function issuePluginCredential(input) {
|
|
|
618
618
|
...basePluginContext(plugin),
|
|
619
619
|
actor: input.actor,
|
|
620
620
|
grant: input.grant,
|
|
621
|
-
...input.credentialSubject ? { credentialSubject: input.credentialSubject } :
|
|
621
|
+
...input.credentialSubject ? { credentialSubject: input.credentialSubject } : void 0,
|
|
622
622
|
tokens: {
|
|
623
623
|
...currentUserId ? {
|
|
624
624
|
currentUser: {
|
|
@@ -640,7 +640,7 @@ async function issuePluginCredential(input) {
|
|
|
640
640
|
callback
|
|
641
641
|
)
|
|
642
642
|
}
|
|
643
|
-
} :
|
|
643
|
+
} : void 0,
|
|
644
644
|
...credentialSubjectUserId ? {
|
|
645
645
|
credentialSubject: {
|
|
646
646
|
userId: credentialSubjectUserId,
|
|
@@ -661,7 +661,7 @@ async function issuePluginCredential(input) {
|
|
|
661
661
|
callback
|
|
662
662
|
)
|
|
663
663
|
}
|
|
664
|
-
} :
|
|
664
|
+
} : void 0
|
|
665
665
|
}
|
|
666
666
|
});
|
|
667
667
|
return parseCredentialResult(result, plugin.manifest.name);
|
|
@@ -732,18 +732,18 @@ function parseMcpAuthSession(value) {
|
|
|
732
732
|
provider: parsed.provider,
|
|
733
733
|
userId: parsed.userId,
|
|
734
734
|
conversationId: parsed.conversationId,
|
|
735
|
-
...destination ? { destination } :
|
|
736
|
-
...source?.success ? { source: source.data } :
|
|
735
|
+
...destination ? { destination } : void 0,
|
|
736
|
+
...source?.success ? { source: source.data } : void 0,
|
|
737
737
|
sessionId: parsed.sessionId,
|
|
738
738
|
userMessage: parsed.userMessage,
|
|
739
739
|
createdAtMs: parsed.createdAtMs,
|
|
740
740
|
updatedAtMs: parsed.updatedAtMs,
|
|
741
|
-
...typeof parsed.channelId === "string" ? { channelId: parsed.channelId } :
|
|
742
|
-
...typeof parsed.threadTs === "string" ? { threadTs: parsed.threadTs } :
|
|
743
|
-
...typeof parsed.toolChannelId === "string" ? { toolChannelId: parsed.toolChannelId } :
|
|
744
|
-
...isRecord(parsed.configuration) ? { configuration: parsed.configuration } :
|
|
745
|
-
...typeof parsed.authorizationUrl === "string" ? { authorizationUrl: parsed.authorizationUrl } :
|
|
746
|
-
...typeof parsed.codeVerifier === "string" ? { codeVerifier: parsed.codeVerifier } :
|
|
741
|
+
...typeof parsed.channelId === "string" ? { channelId: parsed.channelId } : void 0,
|
|
742
|
+
...typeof parsed.threadTs === "string" ? { threadTs: parsed.threadTs } : void 0,
|
|
743
|
+
...typeof parsed.toolChannelId === "string" ? { toolChannelId: parsed.toolChannelId } : void 0,
|
|
744
|
+
...isRecord(parsed.configuration) ? { configuration: parsed.configuration } : void 0,
|
|
745
|
+
...typeof parsed.authorizationUrl === "string" ? { authorizationUrl: parsed.authorizationUrl } : void 0,
|
|
746
|
+
...typeof parsed.codeVerifier === "string" ? { codeVerifier: parsed.codeVerifier } : void 0
|
|
747
747
|
};
|
|
748
748
|
} catch {
|
|
749
749
|
return void 0;
|
|
@@ -778,11 +778,12 @@ function parseStoredCredentials(value) {
|
|
|
778
778
|
return {
|
|
779
779
|
...isRecord(parsed.clientInformation) ? {
|
|
780
780
|
clientInformation: parsed.clientInformation
|
|
781
|
-
} :
|
|
781
|
+
} : void 0,
|
|
782
782
|
...isRecord(parsed.discoveryState) ? {
|
|
783
|
+
// @ts-expect-error non-overlapping boundary cast; rule forbids as-unknown-as chains
|
|
783
784
|
discoveryState: parsed.discoveryState
|
|
784
|
-
} :
|
|
785
|
-
...isRecord(parsed.tokens) ? { tokens: parsed.tokens } :
|
|
785
|
+
} : void 0,
|
|
786
|
+
...isRecord(parsed.tokens) ? { tokens: parsed.tokens } : void 0
|
|
786
787
|
};
|
|
787
788
|
} catch {
|
|
788
789
|
return void 0;
|
|
@@ -829,7 +830,7 @@ async function patchMcpAuthSession(authSessionId, patch) {
|
|
|
829
830
|
provider: current.provider,
|
|
830
831
|
userId: current.userId,
|
|
831
832
|
conversationId: current.conversationId,
|
|
832
|
-
...current.destination ? { destination: current.destination } :
|
|
833
|
+
...current.destination ? { destination: current.destination } : void 0,
|
|
833
834
|
sessionId: current.sessionId,
|
|
834
835
|
userMessage: current.userMessage,
|
|
835
836
|
createdAtMs: current.createdAtMs,
|
|
@@ -1050,9 +1051,9 @@ var StateBackedMcpOAuthClientProvider = class {
|
|
|
1050
1051
|
session.provider
|
|
1051
1052
|
) ?? {};
|
|
1052
1053
|
await putMcpStoredOAuthCredentials(session.userId, session.provider, {
|
|
1053
|
-
...scope === "tokens" || scope === "all" ?
|
|
1054
|
-
...scope === "client" || scope === "all" ?
|
|
1055
|
-
...scope === "discovery" || scope === "all" ?
|
|
1054
|
+
...scope === "tokens" || scope === "all" ? void 0 : credentials.tokens ? { tokens: credentials.tokens } : {},
|
|
1055
|
+
...scope === "client" || scope === "all" ? void 0 : credentials.clientInformation ? { clientInformation: credentials.clientInformation } : {},
|
|
1056
|
+
...scope === "discovery" || scope === "all" ? void 0 : credentials.discoveryState ? { discoveryState: credentials.discoveryState } : {}
|
|
1056
1057
|
});
|
|
1057
1058
|
});
|
|
1058
1059
|
}
|
|
@@ -1133,14 +1134,14 @@ async function createMcpOAuthClientProvider(input) {
|
|
|
1133
1134
|
provider: input.provider,
|
|
1134
1135
|
userId: input.userId,
|
|
1135
1136
|
conversationId: input.conversationId,
|
|
1136
|
-
...input.destination ? { destination: input.destination } :
|
|
1137
|
-
...input.source ? { source: input.source } :
|
|
1137
|
+
...input.destination ? { destination: input.destination } : void 0,
|
|
1138
|
+
...input.source ? { source: input.source } : void 0,
|
|
1138
1139
|
sessionId: input.sessionId,
|
|
1139
1140
|
userMessage: input.userMessage,
|
|
1140
|
-
...input.channelId ? { channelId: input.channelId } :
|
|
1141
|
-
...input.threadTs ? { threadTs: input.threadTs } :
|
|
1142
|
-
...input.toolChannelId ? { toolChannelId: input.toolChannelId } :
|
|
1143
|
-
...input.configuration ? { configuration: input.configuration } :
|
|
1141
|
+
...input.channelId ? { channelId: input.channelId } : void 0,
|
|
1142
|
+
...input.threadTs ? { threadTs: input.threadTs } : void 0,
|
|
1143
|
+
...input.toolChannelId ? { toolChannelId: input.toolChannelId } : void 0,
|
|
1144
|
+
...input.configuration ? { configuration: input.configuration } : void 0
|
|
1144
1145
|
}
|
|
1145
1146
|
);
|
|
1146
1147
|
}
|
|
@@ -1178,7 +1179,7 @@ async function finalizeMcpAuthorization(provider, authSessionId, authorizationCo
|
|
|
1178
1179
|
}
|
|
1179
1180
|
let providerStatus2;
|
|
1180
1181
|
const transport = new StreamableHTTPClientTransport(new URL(mcp.url), {
|
|
1181
|
-
...Object.keys(requestInit).length > 0 ? { requestInit } :
|
|
1182
|
+
...Object.keys(requestInit).length > 0 ? { requestInit } : void 0,
|
|
1182
1183
|
authProvider,
|
|
1183
1184
|
fetch: fetchWithBoundedOAuthErrorBodies(void 0, (status) => {
|
|
1184
1185
|
providerStatus2 = status;
|