@sentry/junior 0.293.0 → 0.295.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/{admin-uuecrKuD.js → admin-ifgjyfpF.js} +2 -2
- package/dist/{agent-runner-DHq1pjUg.js → agent-runner-DjMTPWEO.js} +192 -100
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +5 -5
- package/dist/api.d.ts +1 -1
- package/dist/api.js +73 -29
- package/dist/{app-fWzCHFIb.d.ts → app-uiTzRbvq.d.ts} +5 -3
- package/dist/app.d.ts +2 -2
- package/dist/app.js +64 -74
- package/dist/{automation-BE3z19VN.js → automation-yJX3C7i3.js} +3 -3
- package/dist/{background-compaction-queue-D7ncdEa6.js → background-compaction-queue-DUkHZjmL.js} +7 -9
- package/dist/{briefs-NpgMEFh1.js → briefs-CbNYM-q2.js} +3 -3
- package/dist/{catalog-runtime-DwbTyNRD.js → catalog-runtime-DgouZKZm.js} +1 -1
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +2 -0
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.d.ts +1 -1
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +2 -2
- package/dist/cli/upgrade.js +7 -74
- package/dist/{config-B4b-NXH5.js → config-DvnTPCfp.js} +58 -7
- package/dist/{connections-Dz_AQg5p.js → connections-CWaIVl_1.js} +6 -6
- package/dist/{conversation-CtjR1Zcx.js → conversation-CMkSmi02.js} +3 -11
- package/dist/{conversation-pending-messages-1Kad1Mif.js → conversation-feed-BVAOga0H.js} +27 -2
- package/dist/{conversation-privacy-DRsSgLGO.js → conversation-privacy-DPjv4SnA.js} +1 -1
- package/dist/{credential-sync-ClCnnGVj.js → credential-sync-BhbaZfmO.js} +16 -15
- package/dist/{db-BbpttyKH.d.ts → db-CCUqQe0E.d.ts} +13 -6
- package/dist/{db-CoA7_Xqu.js → db-Dts2XvLu.js} +144 -7
- package/dist/{executor-SWyHhit0.js → executor-Ck73J0wP.js} +64 -10
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-BN5drSEZ.js → logging-9OAq-fdg.js} +2 -1
- package/dist/{message-D4qjpW1C.js → message-CtaPzC7m.js} +9 -9
- package/dist/nitro.d.ts +2 -2
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-Xi-mTLOV.js → oauth-callback-server-C_LXY1d4.js} +2 -2
- package/dist/{oauth-relay-D6xxVywK.js → oauth-relay-CsfIazeF.js} +2 -1
- package/dist/{plugins-DtmjkTza.d.ts → plugins-B_0Cr0MO.d.ts} +0 -1
- package/dist/{projection-DXl4ftyL.js → projection-BzJQncZV.js} +251 -161
- package/dist/{prompt-Dmx6IfWZ.js → prompt-Cbq5b4SO.js} +5 -6
- package/dist/{registry-DosVt9f9.js → registry-cbpOxO4M.js} +3 -13
- package/dist/{resolve-BDjWJC9s.js → resolve-t-pmRdwS.js} +3 -3
- package/dist/{result-CaAFpf4B.js → result-DhgjR3nQ.js} +8 -8
- package/dist/{runner-h96Mkss6.js → runner-CHv9X9TH.js} +8 -8
- package/dist/{sandbox-egress-signals-rK91BW7i.js → sandbox-egress-signals-Yy3fSCbg.js} +1 -1
- package/dist/{schema-C_v8wb80.js → schema-BhneuGYv.js} +39 -7
- package/dist/{schema-CHsBmXIj.d.ts → schema-TSEisVJR.d.ts} +87 -14
- package/dist/secrets-DebYU866.js +18 -0
- package/dist/{service-account-WUMVuqVL.js → service-account-C4rBP8ne.js} +3 -3
- package/dist/{service-account-BpGpScaT.js → service-account-DjPIwCMj.js} +42 -26
- package/dist/{session-stop-xYK15HUu.js → session-stop-DkxI5vc3.js} +20 -775
- package/dist/{skills-DHApyCjj.js → skills-BZE2DP8I.js} +2 -2
- package/dist/{spawn-BQQrwGNe.js → spawn-BvULxIiu.js} +5 -5
- package/dist/{adapter-CMJfmHso.js → state-CO9ETDzk.js} +132 -2
- package/dist/{stop-CBeD6_Gs.js → stop-CL-rdtQb.js} +85 -32
- package/dist/{store-xtibD98L.js → store-DgD78_NK.js} +3 -3
- package/dist/{task-runner-BYPN4BEO.js → task-runner-CKOj6xla.js} +11 -11
- package/dist/{turn-failure-response-jNVl00MD.js → turn-failure-response-BTSo6SMJ.js} +8 -8
- package/dist/{validation-DGeB_moV.js → validation-CXeYgBzq.js} +1 -1
- package/dist/{version-C6nqU3Qc.js → version-AQa7Fr2H.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-9KLQibjn.js → viewer-Bqkb678l.js} +3 -3
- package/dist/warmup-h6u1e9n0.js +1869 -0
- package/dist/{work-xwX6unUE.js → work-yN_GAuXY.js} +11 -11
- package/dist/{worker-CiCCfwd4.js → worker-Hl7N292I.js} +6 -6
- package/migrations/0062_plugin_report_index.sql +1 -20
- package/migrations/0078_plugin_conversation_index.sql +1 -20
- package/migrations/0079_conversation_event_author_index.sql +1 -20
- package/migrations/0080_conversation_event_latest_message_indexes.sql +2 -27
- package/migrations/0090_guardian_review_time_index.sql +1 -20
- package/migrations/0091_conversation_participant_unsubscribed_index.sql +1 -20
- package/migrations/0097_conversation_kind_automation.sql +6 -0
- package/migrations/0098_review_item_plugin_actions.sql +5 -0
- package/migrations/0099_conversation_last_message_at.sql +1 -0
- package/migrations/0100_automation_task_kind_repair.sql +48 -0
- package/migrations/meta/0097_snapshot.json +4490 -0
- package/migrations/meta/0098_snapshot.json +4490 -0
- package/migrations/meta/0099_snapshot.json +4720 -0
- package/migrations/meta/0100_snapshot.json +4496 -0
- package/migrations/meta/_journal.json +28 -0
- package/package.json +5 -5
- package/dist/assistant-reply-CIApSfor.js +0 -58
- package/dist/warmup-7S6z068f.js +0 -993
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { G as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-
|
|
2
|
-
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-
|
|
1
|
+
import { G as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-9OAq-fdg.js";
|
|
2
|
+
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-cbpOxO4M.js";
|
|
3
3
|
import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
|
|
4
|
-
import {
|
|
4
|
+
import { a as getStateAdapter, n as readEncryptedState, t as createEncryptedState } from "./state-CO9ETDzk.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
import { UnauthorizedError, auth } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
@@ -310,10 +310,12 @@ const UPDATE_LOCK_WAIT_MS = 5e3;
|
|
|
310
310
|
function serviceAccountKey(provider) {
|
|
311
311
|
return `${SERVICE_ACCOUNT_KEY_PREFIX}:${provider}`;
|
|
312
312
|
}
|
|
313
|
+
function updateLockKey(provider) {
|
|
314
|
+
return `${serviceAccountKey(provider)}:update`;
|
|
315
|
+
}
|
|
313
316
|
function parseCredentials(value) {
|
|
314
|
-
if (typeof value !== "string") return;
|
|
315
317
|
try {
|
|
316
|
-
const parsed = JSON.parse(value);
|
|
318
|
+
const parsed = typeof value === "string" ? JSON.parse(value) : value;
|
|
317
319
|
if (!isRecord(parsed) || !isRecord(parsed.clientInformation) || !isRecord(parsed.tokens) || typeof parsed.connectedAtMs !== "number" || typeof parsed.redirectUrl !== "string") return;
|
|
318
320
|
return {
|
|
319
321
|
clientInformation: parsed.clientInformation,
|
|
@@ -329,11 +331,31 @@ function parseCredentials(value) {
|
|
|
329
331
|
}
|
|
330
332
|
/** Read the connected service account for one plugin, if any. */
|
|
331
333
|
async function getMcpServiceAccountCredentials(provider) {
|
|
332
|
-
|
|
334
|
+
const state = getStateAdapter();
|
|
335
|
+
const stored = await readEncryptedState(state, serviceAccountKey(provider));
|
|
336
|
+
const credentials = parseCredentials(stored?.value);
|
|
337
|
+
if (credentials && stored?.stale) await saveStaleCredentials(provider);
|
|
338
|
+
return credentials;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Save stale credentials again with the active key. It runs only when the
|
|
342
|
+
* update lock is free, so it cannot write back a refresh token that an
|
|
343
|
+
* update replaced.
|
|
344
|
+
*/
|
|
345
|
+
async function saveStaleCredentials(provider) {
|
|
346
|
+
const state = getStateAdapter();
|
|
347
|
+
await withLock(state, updateLockKey(provider), async (lock) => {
|
|
348
|
+
const key = serviceAccountKey(provider);
|
|
349
|
+
const current = await readEncryptedState(state, key);
|
|
350
|
+
const credentials = parseCredentials(current?.value);
|
|
351
|
+
if (!current?.stale || !credentials) return;
|
|
352
|
+
await fenceLock(state, lock);
|
|
353
|
+
await putMcpServiceAccountCredentials(provider, credentials);
|
|
354
|
+
}, { ttlMs: MUTATION_LOCK_TTL_MS });
|
|
333
355
|
}
|
|
334
356
|
/** Save the service account for one plugin. It does not expire. */
|
|
335
357
|
async function putMcpServiceAccountCredentials(provider, credentials) {
|
|
336
|
-
await getStateAdapter().set(serviceAccountKey(provider),
|
|
358
|
+
await createEncryptedState(getStateAdapter()).set(serviceAccountKey(provider), credentials);
|
|
337
359
|
}
|
|
338
360
|
/** Remove the service account for one plugin. The provider grant stays until the provider revokes it. */
|
|
339
361
|
async function deleteMcpServiceAccountCredentials(provider) {
|
|
@@ -368,7 +390,7 @@ function createMcpServiceAccountClientProvider(provider, connected) {
|
|
|
368
390
|
let tokensRejected = false;
|
|
369
391
|
const withStoreLock = async (run) => {
|
|
370
392
|
const state = getStateAdapter();
|
|
371
|
-
const result = await withLock(state,
|
|
393
|
+
const result = await withLock(state, updateLockKey(provider), async (lock) => await run(() => fenceLock(state, lock)), {
|
|
372
394
|
ttlMs: MUTATION_LOCK_TTL_MS,
|
|
373
395
|
waitMs: UPDATE_LOCK_WAIT_MS
|
|
374
396
|
});
|
|
@@ -436,21 +458,15 @@ function signInKey(state) {
|
|
|
436
458
|
return `${SIGN_IN_KEY_PREFIX}:${state}`;
|
|
437
459
|
}
|
|
438
460
|
function parseSignIn(value) {
|
|
439
|
-
if (typeof value !== "string") return;
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
redirectUrl: parsed.redirectUrl,
|
|
449
|
-
...typeof parsed.startedBy === "string" ? { startedBy: parsed.startedBy } : void 0
|
|
450
|
-
};
|
|
451
|
-
} catch {
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
461
|
+
if (!isRecord(value) || !isRecord(value.clientInformation) || typeof value.codeVerifier !== "string" || typeof value.provider !== "string" || typeof value.redirectUrl !== "string") return;
|
|
462
|
+
return {
|
|
463
|
+
clientInformation: value.clientInformation,
|
|
464
|
+
codeVerifier: value.codeVerifier,
|
|
465
|
+
...isRecord(value.discoveryState) ? { discoveryState: value.discoveryState } : void 0,
|
|
466
|
+
provider: value.provider,
|
|
467
|
+
redirectUrl: value.redirectUrl,
|
|
468
|
+
...typeof value.startedBy === "string" ? { startedBy: value.startedBy } : void 0
|
|
469
|
+
};
|
|
454
470
|
}
|
|
455
471
|
/** Build an OAuth client provider that keeps sign-in state in memory. */
|
|
456
472
|
function signInProvider(input) {
|
|
@@ -513,14 +529,14 @@ async function startMcpServiceAccountSignIn(input) {
|
|
|
513
529
|
if (await auth(signIn.provider, { serverUrl: mcp.url }) !== "REDIRECT") throw new Error(`${provider} did not start an OAuth sign-in`);
|
|
514
530
|
const { authorizationUrl, clientInformation, codeVerifier, discoveryState } = signIn.captured;
|
|
515
531
|
if (!authorizationUrl || !clientInformation || !codeVerifier) throw new Error(`${provider} did not return an authorization URL`);
|
|
516
|
-
await getStateAdapter().set(signInKey(state),
|
|
532
|
+
await createEncryptedState(getStateAdapter()).set(signInKey(state), {
|
|
517
533
|
clientInformation,
|
|
518
534
|
codeVerifier,
|
|
519
535
|
...discoveryState ? { discoveryState } : void 0,
|
|
520
536
|
provider,
|
|
521
537
|
redirectUrl: input.redirectUrl,
|
|
522
538
|
...input.startedBy ? { startedBy: input.startedBy } : void 0
|
|
523
|
-
}
|
|
539
|
+
}, SIGN_IN_TTL_MS);
|
|
524
540
|
return { authorizationUrl };
|
|
525
541
|
}
|
|
526
542
|
/**
|
|
@@ -533,7 +549,7 @@ async function finishMcpServiceAccountSignIn(input) {
|
|
|
533
549
|
const mcp = requireServiceAccountMcp(input.plugin);
|
|
534
550
|
const provider = input.plugin.manifest.name;
|
|
535
551
|
const state = input.callback.get("state");
|
|
536
|
-
const pending = state ? parseSignIn(await getStateAdapter().get(signInKey(state))) : void 0;
|
|
552
|
+
const pending = state ? parseSignIn(await createEncryptedState(getStateAdapter()).get(signInKey(state))) : void 0;
|
|
537
553
|
if (!state || !pending || pending.provider !== provider || pending.startedBy !== input.connectedBy) return {
|
|
538
554
|
ok: false,
|
|
539
555
|
message: "This sign-in expired or did not start here. Start it again."
|