@sentry/junior 0.302.0 → 0.304.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/{adapter-context-Cx9fn9B3.js → adapter-context-B1IpoELr.js} +2 -2
- package/dist/{admin-_poE5NKL.js → admin-BnVFGo_z.js} +5 -5
- package/dist/{agent-runner-CY9RvsTX.js → agent-runner-CoEeZSRh.js} +1461 -1248
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api.d.ts +13 -12
- package/dist/api.js +230 -105
- package/dist/{app-BpY3wtRP.d.ts → app-Cs157Zc5.d.ts} +17 -15
- package/dist/app.d.ts +1 -1
- package/dist/app.js +108 -96
- package/dist/{automation-Cva5ZOwW.js → automation-CuA3yEcD.js} +3 -1
- package/dist/{background-compaction-queue-CXFq1_Cz.js → background-compaction-queue-WLPNSF_b.js} +6 -6
- package/dist/{briefs-B3NG-pid.js → briefs-CagVVefw.js} +12 -9
- package/dist/{catalog-runtime-Dss0lSV6.js → catalog-runtime-B8ZXvXWm.js} +2 -2
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +21 -21
- package/dist/cli/check.js +10 -10
- package/dist/cli/env.d.ts +1 -0
- package/dist/cli/env.js +8 -7
- package/dist/cli/init.js +13 -4
- package/dist/cli/main.js +4 -4
- package/dist/cli/plugins.js +6 -6
- package/dist/cli/snapshot-create.js +7 -5
- package/dist/cli/upgrade.d.ts +2 -2
- package/dist/cli/upgrade.js +6 -6
- package/dist/{config-CzeZiMKs.js → config-DdO1BNcw.js} +142 -67
- package/dist/{connections-CDYhMfrs.js → connections-D20kp0j5.js} +6 -6
- package/dist/{continue-in-slack-7Uf05ndC.js → continue-in-slack-BKEVMBj1.js} +8 -8
- package/dist/{conversation-BNXfq6Lb.js → conversation-BOqdRtUx.js} +4 -12
- package/dist/{conversation-feed-Clf_cv0n.js → conversation-feed-CgpgP7yi.js} +35 -2
- package/dist/{conversation-privacy-D9xnM5mK.js → conversation-privacy-L1SK_v0V.js} +16 -8
- package/dist/{conversation-turn-D7SEZgTG.js → conversation-turn-BptVJylj.js} +20 -23
- package/dist/{credential-sync-DoD0gW-j.js → credential-sync-D1J1CGzL.js} +19 -19
- package/dist/{db-B-gtnNjr.js → db-EKJnkrIb.js} +180 -17
- package/dist/{db-BdsCzytP.d.ts → db-zbN5ZV_o.d.ts} +26 -26
- package/dist/{executor-DZg20EqU.js → executor-CoIZmFK8.js} +55 -15
- package/dist/{history-IjdmO_r6.js → history-m2-ceTTX.js} +21 -12
- package/dist/{install-t1KQyTUs.js → install-BT2Pf6HP.js} +3 -3
- package/dist/instrumentation.d.ts +4 -4
- package/dist/instrumentation.js +15 -11
- package/dist/{lineage-C79GjoQr.js → lineage-C5DGQCS_.js} +2 -2
- package/dist/{logging-C9oDAg4M.js → logging-QSZuMcvo.js} +19 -19
- package/dist/{message-BLUCzJXN.js → message-TtxftRHj.js} +9 -9
- package/dist/{model-input-5jwNC45G.js → model-input-BHXfA29g.js} +4 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +8 -8
- package/dist/{oauth-callback-server-BBl66vCb.js → oauth-callback-server-B0enqHtZ.js} +5 -4
- package/dist/{oauth-relay-DRzq73b6.js → oauth-relay-DAmfVmJu.js} +3 -6
- package/dist/{package-discovery-DJhGdS4c.js → package-discovery-x4AvVhMj.js} +1 -1
- package/dist/{plugin-module-Cf5gVPWP.js → plugin-module-Cv2ETe8Y.js} +1 -1
- package/dist/{plugins-BBX07Jzt.js → plugins-Bkk0XRo2.js} +3 -3
- package/dist/{projection-CIBwgD3s.js → projection-CNKK7doO.js} +755 -221
- package/dist/{prompt-CRQbzp5e.js → prompt-DSjhoKu5.js} +185 -12
- package/dist/{queue-DtCDaIct.js → queue-CDxkit82.js} +4 -4
- package/dist/{queue-CZyYgPF0.d.ts → queue-CbEHUO0l.d.ts} +1 -1
- package/dist/{registry-DdFQHZ_d.js → registry-DBDNUUmz.js} +37 -37
- package/dist/{resolve-CdW4BdrK.js → resolve-CQLhMWSu.js} +3 -3
- package/dist/{result-oOMv1t4O.js → result-B-pauj42.js} +10 -15
- package/dist/rolldown-runtime-BKpuH2hG.js +26 -0
- package/dist/{runner-DqitLtm-.js → runner-B3KxKks5.js} +10 -10
- package/dist/{sandbox-egress-signals-Bw9I0yfJ.js → sandbox-egress-signals-DJJX9ClG.js} +1 -1
- package/dist/{schema-DnVQepWP.js → schema-Bx0Mlo32.js} +77 -13
- package/dist/{schema-BIFM-U1a.d.ts → schema-CKcu-IK6.d.ts} +562 -23
- package/dist/{secrets-DebYU866.js → secrets-DHaJ5TTn.js} +4 -4
- package/dist/{sentry-BRTJqumy.js → sentry-CPbZjomA.js} +3 -28
- package/dist/{sentry-route-name-BhwWnfqj.js → sentry-route-name-C6EIzAGP.js} +1 -1
- package/dist/{service-account-CrZftRTb.js → service-account-2HmlNPvy.js} +49 -48
- package/dist/{service-account-B6mKAPVo.js → service-account-DQLqkSVv.js} +5 -5
- package/dist/{session-stop-DW63Z3kj.js → session-stop-DEeZKqbX.js} +132 -74
- package/dist/{skills-C16fz60Z.js → skills-2UrD7JkN.js} +6 -9
- package/dist/{slack-conversation-unfurl-BHhefEb7.js → slack-conversation-unfurl-Dd129Uov.js} +14 -18
- package/dist/{spawn-D_RnFYfy.js → spawn-eMho9HDJ.js} +7 -7
- package/dist/{legacy-web-actor-id-C-cEeWqL.js → state-Bveuc4Zh.js} +32 -32
- package/dist/{stop-7p1i08CY.js → stop-D_ltJLDS.js} +359 -171
- package/dist/{store-C28I0CVW.js → store-COeYnPL_.js} +5 -5
- package/dist/{task-queue-BVUJbQ28.js → task-queue-CBIDXZpV.js} +3 -3
- package/dist/{task-runner-CWi8j7Z6.js → task-runner-CJF7zIJL.js} +15 -18
- package/dist/{thread-context-D3-yYUd0.js → thread-context-Cg0jt0aE.js} +12 -12
- package/dist/{turn-session-routing-BFMS9ATF.js → turn-session-routing-CaY3Tp8m.js} +32 -32
- package/dist/{turn-user-message-C3-O8Omt.js → turn-user-message-tcom1RYd.js} +3 -3
- package/dist/{validation-BSFKUIb4.js → validation-EU91JwIT.js} +2 -2
- package/dist/vercel.js +1 -1
- package/dist/{version-BHHXNi-0.js → version-BYRPhY5G.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-B1SO21Qa.js → viewer-Cf8ISkAc.js} +3 -3
- package/dist/{warmup-Bz9bzkzN.js → warmup-TgY4S1vx.js} +202 -577
- package/dist/{worker-BspReIIK.js → worker-C6Uq4OKD.js} +9 -12
- package/migrations/0109_user_preferences.sql +1 -0
- package/migrations/0110_code_change_repository_state_index.sql +1 -0
- package/migrations/0111_attachment_kinds.sql +14 -0
- package/migrations/0112_attachment_url_fill.sql +51 -0
- package/migrations/0113_attachment_url_index.sql +1 -0
- package/migrations/meta/0099_snapshot.json +102 -326
- package/migrations/meta/0109_snapshot.json +4925 -0
- package/migrations/meta/0110_snapshot.json +4952 -0
- package/migrations/meta/0111_snapshot.json +5011 -0
- package/migrations/meta/0112_snapshot.json +5011 -0
- package/migrations/meta/0113_snapshot.json +5033 -0
- package/migrations/meta/_journal.json +36 -1
- package/package.json +16 -19
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// src/chat/secrets.ts
|
|
2
2
|
/** Read the server secret that signs internal tokens and payloads. */
|
|
3
3
|
function readJuniorSecret() {
|
|
4
|
-
return process.env
|
|
4
|
+
return process.env["JUNIOR_SECRET"]?.trim() || void 0;
|
|
5
5
|
}
|
|
6
6
|
/** Read the raw dashboard session secret, with `JUNIOR_SECRET` as fallback. */
|
|
7
7
|
function readSignInSecret() {
|
|
8
|
-
return process.env
|
|
8
|
+
return process.env["BETTER_AUTH_SECRET"] ?? process.env["JUNIOR_SECRET"];
|
|
9
9
|
}
|
|
10
10
|
/** Read the bearer secret that internal cron requests must send. */
|
|
11
11
|
function readSchedulerSecret() {
|
|
12
|
-
return process.env
|
|
12
|
+
return process.env["JUNIOR_SCHEDULER_SECRET"]?.trim() || process.env["CRON_SECRET"]?.trim();
|
|
13
13
|
}
|
|
14
14
|
/** Read the VAPID private key that signs web push messages. */
|
|
15
15
|
function readWebPushPrivateKey() {
|
|
16
|
-
return process.env
|
|
16
|
+
return process.env["JUNIOR_WEB_PUSH_PRIVATE_KEY"]?.trim();
|
|
17
17
|
}
|
|
18
18
|
export { readWebPushPrivateKey as i, readSchedulerSecret as n, readSignInSecret as r, readJuniorSecret as t };
|
|
@@ -1,30 +1,5 @@
|
|
|
1
|
-
import "
|
|
1
|
+
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
2
|
import { captureException, captureMessage, continueTrace, flush, getActiveSpan, getClient, getGlobalScope, getTraceData, init, logger, setTag, setUser, spanToJSON, startInactiveSpan, startSpan, startSpanManual, withActiveSpan, withScope } from "@sentry/node";
|
|
3
|
-
// \0rolldown/runtime.js
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __exportAll = (all, no_symbols) => {
|
|
9
|
-
let target = {};
|
|
10
|
-
for (var name in all) __defProp(target, name, {
|
|
11
|
-
get: all[name],
|
|
12
|
-
enumerable: true
|
|
13
|
-
});
|
|
14
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
15
|
-
return target;
|
|
16
|
-
};
|
|
17
|
-
var __copyProps = (to, from, except, desc) => {
|
|
18
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
|
-
key = keys[i];
|
|
20
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
21
|
-
get: ((k) => from[k]).bind(null, key),
|
|
22
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
28
3
|
// src/chat/sentry.ts
|
|
29
4
|
var sentry_exports = /* @__PURE__ */ __exportAll({
|
|
30
5
|
captureException: () => captureException,
|
|
@@ -45,7 +20,7 @@ var sentry_exports = /* @__PURE__ */ __exportAll({
|
|
|
45
20
|
startSpanManual: () => startSpanManual,
|
|
46
21
|
withActiveSpan: () => withActiveSpan,
|
|
47
22
|
withScope: () => withScope
|
|
48
|
-
});
|
|
23
|
+
}, 2);
|
|
49
24
|
import * as import__sentry_node from "@sentry/node";
|
|
50
25
|
__reExport(sentry_exports, import__sentry_node);
|
|
51
|
-
export { withScope as _, getClient as a, init as c, setTag as d, setUser as f, withActiveSpan as g, startSpan as h, getActiveSpan as i, logger as l, startInactiveSpan as m, captureMessage as n, getGlobalScope as o, spanToJSON as p, continueTrace as r, getTraceData as s, captureException as t, sentry_exports as u
|
|
26
|
+
export { withScope as _, getClient as a, init as c, setTag as d, setUser as f, withActiveSpan as g, startSpan as h, getActiveSpan as i, logger as l, startInactiveSpan as m, captureMessage as n, getGlobalScope as o, spanToJSON as p, continueTrace as r, getTraceData as s, captureException as t, sentry_exports as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getActiveSpan, u as sentry_exports } from "./sentry-
|
|
1
|
+
import { i as getActiveSpan, u as sentry_exports } from "./sentry-CPbZjomA.js";
|
|
2
2
|
import { matchedRoutes } from "hono/route";
|
|
3
3
|
// src/chat/sentry-route-name.ts
|
|
4
4
|
const HTTP_ROUTE_ATTRIBUTE = "app.http.route";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { K as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { K as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-QSZuMcvo.js";
|
|
2
|
+
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-DBDNUUmz.js";
|
|
3
|
+
import { $ as MUTATION_LOCK_TTL_MS, X as getStateAdapter, _t as parseDestination, nt as withLock, tt as fenceLock } from "./db-EKJnkrIb.js";
|
|
4
|
+
import { n as readEncryptedState, r as findLegacyWebActorUserId, t as createEncryptedState } from "./state-Bveuc4Zh.js";
|
|
5
|
+
import { n as botConfig } from "./config-DdO1BNcw.js";
|
|
5
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
7
|
import { randomUUID } from "node:crypto";
|
|
7
8
|
import { sourceSchema } from "@sentry/junior-plugin-api";
|
|
@@ -119,29 +120,29 @@ function parseMcpAuthSession(value) {
|
|
|
119
120
|
if (!isRecord(value)) return;
|
|
120
121
|
try {
|
|
121
122
|
const parsed = value;
|
|
122
|
-
if (parsed
|
|
123
|
-
const destination = parsed
|
|
124
|
-
if (parsed
|
|
125
|
-
const source = parsed
|
|
126
|
-
if (parsed
|
|
123
|
+
if (parsed["schemaVersion"] !== 2 || typeof parsed["authSessionId"] !== "string" || typeof parsed["provider"] !== "string" || typeof parsed["userId"] !== "string" || typeof parsed["conversationId"] !== "string" || typeof parsed["sessionId"] !== "string" || typeof parsed["userMessage"] !== "string" || typeof parsed["createdAtMs"] !== "number" || typeof parsed["updatedAtMs"] !== "number") return;
|
|
124
|
+
const destination = parsed["destination"] === void 0 ? void 0 : parseDestination(parsed["destination"]);
|
|
125
|
+
if (parsed["destination"] !== void 0 && !destination) return;
|
|
126
|
+
const source = parsed["source"] === void 0 ? void 0 : sourceSchema.safeParse(parsed["source"]);
|
|
127
|
+
if (parsed["source"] !== void 0 && (!source || !source.success)) return;
|
|
127
128
|
return {
|
|
128
129
|
schemaVersion: 2,
|
|
129
|
-
authSessionId: parsed
|
|
130
|
-
provider: parsed
|
|
131
|
-
userId: parsed
|
|
132
|
-
conversationId: parsed
|
|
130
|
+
authSessionId: parsed["authSessionId"],
|
|
131
|
+
provider: parsed["provider"],
|
|
132
|
+
userId: parsed["userId"],
|
|
133
|
+
conversationId: parsed["conversationId"],
|
|
133
134
|
...destination ? { destination } : void 0,
|
|
134
135
|
...source?.success ? { source: source.data } : void 0,
|
|
135
|
-
sessionId: parsed
|
|
136
|
-
userMessage: parsed
|
|
137
|
-
createdAtMs: parsed
|
|
138
|
-
updatedAtMs: parsed
|
|
139
|
-
...typeof parsed
|
|
140
|
-
...typeof parsed
|
|
141
|
-
...typeof parsed
|
|
142
|
-
...isRecord(parsed
|
|
143
|
-
...typeof parsed
|
|
144
|
-
...typeof parsed
|
|
136
|
+
sessionId: parsed["sessionId"],
|
|
137
|
+
userMessage: parsed["userMessage"],
|
|
138
|
+
createdAtMs: parsed["createdAtMs"],
|
|
139
|
+
updatedAtMs: parsed["updatedAtMs"],
|
|
140
|
+
...typeof parsed["channelId"] === "string" ? { channelId: parsed["channelId"] } : void 0,
|
|
141
|
+
...typeof parsed["threadTs"] === "string" ? { threadTs: parsed["threadTs"] } : void 0,
|
|
142
|
+
...typeof parsed["toolChannelId"] === "string" ? { toolChannelId: parsed["toolChannelId"] } : void 0,
|
|
143
|
+
...isRecord(parsed["configuration"]) ? { configuration: parsed["configuration"] } : void 0,
|
|
144
|
+
...typeof parsed["authorizationUrl"] === "string" ? { authorizationUrl: parsed["authorizationUrl"] } : void 0,
|
|
145
|
+
...typeof parsed["codeVerifier"] === "string" ? { codeVerifier: parsed["codeVerifier"] } : void 0
|
|
145
146
|
};
|
|
146
147
|
} catch {
|
|
147
148
|
return;
|
|
@@ -151,10 +152,10 @@ function parseServerSession(value) {
|
|
|
151
152
|
if (typeof value !== "string") return;
|
|
152
153
|
try {
|
|
153
154
|
const parsed = JSON.parse(value);
|
|
154
|
-
if (!isRecord(parsed) || typeof parsed
|
|
155
|
+
if (!isRecord(parsed) || typeof parsed["sessionId"] !== "string" || typeof parsed["updatedAtMs"] !== "number") return;
|
|
155
156
|
return {
|
|
156
|
-
sessionId: parsed
|
|
157
|
-
updatedAtMs: parsed
|
|
157
|
+
sessionId: parsed["sessionId"],
|
|
158
|
+
updatedAtMs: parsed["updatedAtMs"]
|
|
158
159
|
};
|
|
159
160
|
} catch {
|
|
160
161
|
return;
|
|
@@ -165,9 +166,9 @@ function parseStoredCredentials(value) {
|
|
|
165
166
|
const parsed = typeof value === "string" ? JSON.parse(value) : value;
|
|
166
167
|
if (!isRecord(parsed)) return;
|
|
167
168
|
return {
|
|
168
|
-
...isRecord(parsed
|
|
169
|
-
...isRecord(parsed
|
|
170
|
-
...isRecord(parsed
|
|
169
|
+
...isRecord(parsed["clientInformation"]) ? { clientInformation: parsed["clientInformation"] } : void 0,
|
|
170
|
+
...isRecord(parsed["discoveryState"]) ? { discoveryState: parsed.discoveryState } : void 0,
|
|
171
|
+
...isRecord(parsed["tokens"]) ? { tokens: parsed["tokens"] } : void 0
|
|
171
172
|
};
|
|
172
173
|
} catch {
|
|
173
174
|
return;
|
|
@@ -294,7 +295,7 @@ function refreshTokenOf(body) {
|
|
|
294
295
|
*/
|
|
295
296
|
function serializeMcpTokenRefresh(owner, fetchFn = globalThis.fetch) {
|
|
296
297
|
let sentAccessToken;
|
|
297
|
-
return
|
|
298
|
+
return async (input, init) => {
|
|
298
299
|
const sentRefreshToken = refreshTokenOf(init?.body);
|
|
299
300
|
if (!sentRefreshToken) {
|
|
300
301
|
const authorization = new Headers(init?.headers).get("authorization");
|
|
@@ -312,14 +313,14 @@ function serializeMcpTokenRefresh(owner, fetchFn = globalThis.fetch) {
|
|
|
312
313
|
const response = await fetchFn(input, init);
|
|
313
314
|
if (!response.ok) return response;
|
|
314
315
|
const tokens = await response.clone().json();
|
|
315
|
-
if (typeof tokens
|
|
316
|
+
if (typeof tokens["access_token"] !== "string") return response;
|
|
316
317
|
await fenceLock(state, lock, REFRESH_LOCK_TTL_MS);
|
|
317
318
|
await putMcpStoredOAuthCredentials(userId, provider, {
|
|
318
319
|
...stored,
|
|
319
320
|
tokens: {
|
|
320
321
|
...current,
|
|
321
322
|
...tokens,
|
|
322
|
-
refresh_token: typeof tokens
|
|
323
|
+
refresh_token: typeof tokens["refresh_token"] === "string" ? tokens["refresh_token"] : sentRefreshToken
|
|
323
324
|
}
|
|
324
325
|
});
|
|
325
326
|
return response;
|
|
@@ -330,7 +331,7 @@ function serializeMcpTokenRefresh(owner, fetchFn = globalThis.fetch) {
|
|
|
330
331
|
});
|
|
331
332
|
if (!attempt.acquired) throw new Error(`Timed out waiting for the ${provider} MCP token refresh`);
|
|
332
333
|
return attempt.value;
|
|
333
|
-
}
|
|
334
|
+
};
|
|
334
335
|
}
|
|
335
336
|
// src/chat/mcp/client.ts
|
|
336
337
|
const MCP_CLIENT_INFO = {
|
|
@@ -567,14 +568,14 @@ function updateLockKey(provider) {
|
|
|
567
568
|
function parseCredentials(value) {
|
|
568
569
|
try {
|
|
569
570
|
const parsed = typeof value === "string" ? JSON.parse(value) : value;
|
|
570
|
-
if (!isRecord(parsed) || !isRecord(parsed
|
|
571
|
+
if (!isRecord(parsed) || !isRecord(parsed["clientInformation"]) || !isRecord(parsed["tokens"]) || typeof parsed["connectedAtMs"] !== "number" || typeof parsed["redirectUrl"] !== "string") return;
|
|
571
572
|
return {
|
|
572
|
-
clientInformation: parsed
|
|
573
|
-
connectedAtMs: parsed
|
|
574
|
-
...typeof parsed
|
|
575
|
-
...isRecord(parsed
|
|
576
|
-
redirectUrl: parsed
|
|
577
|
-
tokens: parsed
|
|
573
|
+
clientInformation: parsed["clientInformation"],
|
|
574
|
+
connectedAtMs: parsed["connectedAtMs"],
|
|
575
|
+
...typeof parsed["connectedBy"] === "string" ? { connectedBy: parsed["connectedBy"] } : void 0,
|
|
576
|
+
...isRecord(parsed["discoveryState"]) ? { discoveryState: parsed.discoveryState } : void 0,
|
|
577
|
+
redirectUrl: parsed["redirectUrl"],
|
|
578
|
+
tokens: parsed["tokens"]
|
|
578
579
|
};
|
|
579
580
|
} catch {
|
|
580
581
|
return;
|
|
@@ -614,7 +615,7 @@ async function deleteMcpServiceAccountCredentials(provider) {
|
|
|
614
615
|
}
|
|
615
616
|
function clientMetadata(redirectUrl) {
|
|
616
617
|
return {
|
|
617
|
-
client_name:
|
|
618
|
+
client_name: `${botConfig.userName} MCP Service Account`,
|
|
618
619
|
redirect_uris: [redirectUrl],
|
|
619
620
|
grant_types: ["authorization_code", "refresh_token"],
|
|
620
621
|
response_types: ["code"],
|
|
@@ -709,14 +710,14 @@ function signInKey(state) {
|
|
|
709
710
|
return `${SIGN_IN_KEY_PREFIX}:${state}`;
|
|
710
711
|
}
|
|
711
712
|
function parseSignIn(value) {
|
|
712
|
-
if (!isRecord(value) || !isRecord(value
|
|
713
|
+
if (!isRecord(value) || !isRecord(value["clientInformation"]) || typeof value["codeVerifier"] !== "string" || typeof value["provider"] !== "string" || typeof value["redirectUrl"] !== "string") return;
|
|
713
714
|
return {
|
|
714
|
-
clientInformation: value
|
|
715
|
-
codeVerifier: value
|
|
716
|
-
...isRecord(value
|
|
717
|
-
provider: value
|
|
718
|
-
redirectUrl: value
|
|
719
|
-
...typeof value
|
|
715
|
+
clientInformation: value["clientInformation"],
|
|
716
|
+
codeVerifier: value["codeVerifier"],
|
|
717
|
+
...isRecord(value["discoveryState"]) ? { discoveryState: value.discoveryState } : void 0,
|
|
718
|
+
provider: value["provider"],
|
|
719
|
+
redirectUrl: value["redirectUrl"],
|
|
720
|
+
...typeof value["startedBy"] === "string" ? { startedBy: value["startedBy"] } : void 0
|
|
720
721
|
};
|
|
721
722
|
}
|
|
722
723
|
/** Build an OAuth client provider that keeps sign-in state in memory. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
3
|
-
import {
|
|
1
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-2HmlNPvy.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-B8ZXvXWm.js";
|
|
3
|
+
import { J as disconnectStateAdapter } from "./db-EKJnkrIb.js";
|
|
4
4
|
import { CLI_USAGE } from "./cli/run.js";
|
|
5
5
|
import { createServer } from "node:http";
|
|
6
6
|
// src/cli/service-account.ts
|
|
@@ -69,7 +69,7 @@ async function runConnect(plugin) {
|
|
|
69
69
|
redirectUrl: loopback.redirectUrl
|
|
70
70
|
});
|
|
71
71
|
console.log([
|
|
72
|
-
`Open this URL in a browser on this machine. Sign in as the account
|
|
72
|
+
`Open this URL in a browser on this machine. Sign in as the account the bot should use for ${provider}, not as yourself:`,
|
|
73
73
|
"",
|
|
74
74
|
authorizationUrl.toString(),
|
|
75
75
|
"",
|
|
@@ -98,7 +98,7 @@ async function runStatus(plugin) {
|
|
|
98
98
|
async function runDisconnect(plugin) {
|
|
99
99
|
const provider = plugin.manifest.name;
|
|
100
100
|
await disconnectServiceAccount(plugin);
|
|
101
|
-
console.log(`Removed the ${provider} service account
|
|
101
|
+
console.log(`Removed the ${provider} service account. To revoke the grant, remove the app connection in the ${provider} account settings.`);
|
|
102
102
|
return 0;
|
|
103
103
|
}
|
|
104
104
|
/** Run `junior service-account connect|status|disconnect <plugin>`. */
|