@sentry/junior 0.294.0 → 0.296.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-vt8aSiCD.js → admin-z_lgDi-z.js} +2 -2
- package/dist/{agent-runner-DJu7w6mI.js → agent-runner-HoQiUKLL.js} +318 -199
- 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 +321 -331
- package/dist/{app--a5RLOrr.d.ts → app-C75Ft-A_.d.ts} +3 -3
- package/dist/app.d.ts +2 -2
- package/dist/app.js +33 -34
- package/dist/{automation-BM-OBsKW.js → automation-yJX3C7i3.js} +3 -3
- package/dist/{background-compaction-queue-D2j-0XkH.js → background-compaction-queue-Cre1wFt9.js} +7 -9
- package/dist/{briefs-JOAoCb6d.js → briefs-BXECHduJ.js} +3 -3
- package/dist/{catalog-runtime-CLMA9AXd.js → catalog-runtime-CpCmlD9L.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 +3 -3
- package/dist/{config-mIZeGEWv.js → config-CCPHvTqx.js} +59 -2
- package/dist/{connections-XhdVg7OR.js → connections-B5pWh8e2.js} +6 -6
- package/dist/{conversation-CDWejM4R.js → conversation-CMkSmi02.js} +2 -11
- package/dist/{conversation-pending-messages-Dh2tfbaw.js → conversation-feed-BVAOga0H.js} +27 -2
- package/dist/{conversation-privacy-C6h-X2cZ.js → conversation-privacy-CZD5soDW.js} +1 -1
- package/dist/{credential-sync-zigBlXS3.js → credential-sync-DwLkIvXI.js} +16 -15
- package/dist/{db-DV5AbcGM.d.ts → db-B3iyr_Or.d.ts} +6 -1
- package/dist/{db--xuNV7g6.js → db-C1M1y-bh.js} +64 -26
- package/dist/{executor-BItuRqAR.js → executor-DUSEwXaO.js} +16 -5
- package/dist/instrumentation.js +19 -2
- package/dist/{logging-Cb6MGvdt.js → logging-D0svFM8r.js} +2 -1
- package/dist/{message-BTGgSmaH.js → message-BFnIwKpx.js} +9 -9
- package/dist/nitro.d.ts +2 -2
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-Dvh1aOIi.js → oauth-callback-server-BXRtD6Fk.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-DLQgfO5N.js → projection-B6VS7kbo.js} +386 -108
- package/dist/{prompt-qp_LdxLX.js → prompt-CD11tfG8.js} +4 -4
- package/dist/{registry-MtwokaqW.js → registry-CHewwYEo.js} +3 -13
- package/dist/{resolve-BnJA0UNE.js → resolve-1owMH4qo.js} +3 -3
- package/dist/{result-ChL-1KyW.js → result-CEqQFrEf.js} +8 -8
- package/dist/{runner-BONN7Dp2.js → runner-BtWvJslp.js} +8 -8
- package/dist/{sandbox-egress-signals-nmlmI5Ab.js → sandbox-egress-signals-ByftwJVt.js} +1 -1
- package/dist/{schema-DgvcyJ1y.d.ts → schema-Ct1Zf2xy.d.ts} +66 -14
- package/dist/{schema-yr0ccDni.js → schema-D2iGyYIp.js} +24 -6
- package/dist/secrets-DebYU866.js +18 -0
- package/dist/{service-account-Bd0lBaGr.js → service-account-BZEuMKdo.js} +3 -3
- package/dist/{service-account-kio5nXSD.js → service-account-DLoeoHww.js} +42 -26
- package/dist/{session-stop-CeCXL3j9.js → session-stop-hYNTNpVf.js} +23 -778
- package/dist/{skills-e3DDNlKO.js → skills-DXgd5Inh.js} +3 -3
- package/dist/{spawn--cRxITWQ.js → spawn-YeqlNDv8.js} +5 -5
- package/dist/{adapter-DxLhJEnO.js → state-C3CbtD_m.js} +132 -2
- package/dist/{stop-Iai5N2PU.js → stop-Cze_pEL8.js} +351 -255
- package/dist/{store-C8LsaJwS.js → store-CZ9vqR4P.js} +3 -3
- package/dist/{task-runner-Dw7exu0-.js → task-runner-CMiNGsER.js} +275 -251
- package/dist/{turn-failure-response-BqTTx3XG.js → turn-failure-response-pXhZ2wMK.js} +12 -9
- package/dist/{validation-BrGahtnv.js → validation-Du7NdkOR.js} +1 -1
- package/dist/{version-Bdqhx8Qh.js → version-EN3Wnq-R.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-CjRFHR5U.js → viewer-Agxi_o5c.js} +3 -3
- package/dist/warmup-CY2ArYag.js +2017 -0
- package/dist/{work-BWBG1EGV.js → work-EA98F0ia.js} +11 -11
- package/dist/{worker-DAnBIVMs.js → worker-BALVdWbv.js} +6 -6
- 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/0101_drop_legacy_columns.sql +12 -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/0101_snapshot.json +4496 -0
- package/migrations/meta/_journal.json +28 -0
- package/package.json +6 -5
- package/dist/assistant-reply-iTtEdDyc.js +0 -58
- package/dist/warmup-DuxCtzKC.js +0 -1039
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as completeText$1, S as completeObject$1, x as completeDecision$1 } from "./config-
|
|
2
|
-
import { _ as runBestEffort, a as extractGenAiUsageSummary } from "./logging-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { C as completeText$1, S as completeObject$1, x as completeDecision$1 } from "./config-CCPHvTqx.js";
|
|
2
|
+
import { _ as runBestEffort, a as extractGenAiUsageSummary } from "./logging-D0svFM8r.js";
|
|
3
|
+
import { J as agentTurnCostUsd, r as getConversationEventStore } from "./db-C1M1y-bh.js";
|
|
4
|
+
import { J as conversationBriefSchema, K as briefOutcomeStatusSchema, Y as parseBriefInput } from "./conversation-CMkSmi02.js";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { conversationEventPresentationSchema, defineConversationEvent } from "@sentry/junior-plugin-api";
|
|
7
7
|
// src/chat/conversations/structured-events.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-
|
|
1
|
+
import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-D0svFM8r.js";
|
|
2
2
|
import { o as isUserActor, s as parseActorUserId } from "./actor-6jsm_v96.js";
|
|
3
3
|
import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-DJhGdS4c.js";
|
|
4
4
|
import path from "node:path";
|
|
@@ -66,7 +66,6 @@ function inlineMcpSource(mcp) {
|
|
|
66
66
|
setDefined$1(result, "oauth-client", mcp.oauthClient && mcpOauthClientSource(mcp.oauthClient));
|
|
67
67
|
setDefined$1(result, "allowed-tools", mcp.allowedTools);
|
|
68
68
|
setDefined$1(result, "wrapped-tools", mcp.wrappedTools);
|
|
69
|
-
setDefined$1(result, "audit-tools", mcp.auditTools);
|
|
70
69
|
return result;
|
|
71
70
|
}
|
|
72
71
|
function inlineOauthSource(oauth) {
|
|
@@ -269,8 +268,7 @@ const mcpSourceSchema = z.object({
|
|
|
269
268
|
headers: stringMapSchema.optional(),
|
|
270
269
|
"oauth-client": mcpOauthClientSourceSchema.optional(),
|
|
271
270
|
"allowed-tools": nonEmptyStringArraySchema("allowed-tools").optional(),
|
|
272
|
-
"wrapped-tools": nonEmptyStringArraySchema("wrapped-tools").optional()
|
|
273
|
-
"audit-tools": nonEmptyStringArraySchema("audit-tools").optional()
|
|
271
|
+
"wrapped-tools": nonEmptyStringArraySchema("wrapped-tools").optional()
|
|
274
272
|
}).passthrough();
|
|
275
273
|
const targetSourceSchema = z.object({
|
|
276
274
|
type: nonEmptyTrimmedString.refine((value) => PLUGIN_NAME_RE.test(value), { error: "type must be a lowercase target identifier" }),
|
|
@@ -331,7 +329,6 @@ function manifestConfigPatch(config) {
|
|
|
331
329
|
setDefined(mcp, "oauth-client", config.mcp.oauthClient && mcpOauthClientSource(config.mcp.oauthClient));
|
|
332
330
|
setDefined(mcp, "allowed-tools", config.mcp.allowedTools);
|
|
333
331
|
setDefined(mcp, "wrapped-tools", config.mcp.wrappedTools);
|
|
334
|
-
setDefined(mcp, "audit-tools", config.mcp.auditTools);
|
|
335
332
|
result.mcp = mcp;
|
|
336
333
|
}
|
|
337
334
|
}
|
|
@@ -608,12 +605,6 @@ function normalizeMcp(data, envVars, name) {
|
|
|
608
605
|
if (typeof prepared.url === "string") prepared.url = expandEnvPlaceholders(prepared.url, envVars, `Plugin ${name} mcp.url`);
|
|
609
606
|
const result = mcpSourceSchema.safeParse(prepared);
|
|
610
607
|
if (!result.success) throw new Error(issueMessage(result.error, `Plugin ${name} mcp`));
|
|
611
|
-
const auditTools = result.data["audit-tools"];
|
|
612
|
-
const unknownAuditTools = unloadedMcpTools({
|
|
613
|
-
allowedTools: result.data["allowed-tools"],
|
|
614
|
-
wrappedTools: result.data["wrapped-tools"]
|
|
615
|
-
}, auditTools ?? []);
|
|
616
|
-
if (unknownAuditTools.length > 0) throw new Error(`Plugin ${name} mcp.audit-tools must be listed in mcp.allowed-tools or mcp.wrapped-tools: ${unknownAuditTools.join(", ")}`);
|
|
617
608
|
const headers = result.data.headers ? normalizeStringMap(result.data.headers, `Plugin ${name} mcp.headers`, { forbiddenKeys: FORBIDDEN_API_HEADER_NAMES }) : void 0;
|
|
618
609
|
assertDeclaredHeaderEnvReferences(headers, envVars, `Plugin ${name} mcp.headers`);
|
|
619
610
|
if (result.data.auth) assertDeclaredHostSecretEnv(result.data.auth["private-key-env"], envVars, `Plugin ${name} mcp.auth.private-key-env`);
|
|
@@ -640,8 +631,7 @@ function normalizeMcp(data, envVars, name) {
|
|
|
640
631
|
...oauthClientAuthorizeParams ? { authorizeParams: oauthClientAuthorizeParams } : void 0
|
|
641
632
|
} } : void 0,
|
|
642
633
|
...result.data["allowed-tools"] ? { allowedTools: result.data["allowed-tools"] } : void 0,
|
|
643
|
-
...result.data["wrapped-tools"] ? { wrappedTools: result.data["wrapped-tools"] } : void 0
|
|
644
|
-
...auditTools ? { auditTools } : void 0
|
|
634
|
+
...result.data["wrapped-tools"] ? { wrappedTools: result.data["wrapped-tools"] } : void 0
|
|
645
635
|
};
|
|
646
636
|
}
|
|
647
637
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Di as isStale, Ha as SANDBOX_WORKSPACE_ROOT, Ja as runNonInteractiveCommand, Ma as sleep, Ra as SANDBOX_COMMAND_PATH, Ti as create, ki as getSandboxProvider } from "./projection-
|
|
2
|
-
import { E as withSpan, b as setSpanAttributes } from "./logging-
|
|
3
|
-
import {
|
|
1
|
+
import { Di as isStale, Ha as SANDBOX_WORKSPACE_ROOT, Ja as runNonInteractiveCommand, Ma as sleep, Ra as SANDBOX_COMMAND_PATH, Ti as create, ki as getSandboxProvider } from "./projection-B6VS7kbo.js";
|
|
2
|
+
import { E as withSpan, b as setSpanAttributes } from "./logging-D0svFM8r.js";
|
|
3
|
+
import { a as getStateAdapter } from "./state-C3CbtD_m.js";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
// src/chat/sandbox/resources.ts
|
|
6
6
|
let configuredResources;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { Cn as renderUntrustedTag } from "./projection-
|
|
3
|
-
import {
|
|
4
|
-
import { f as credentialContextForActor } from "./registry-
|
|
5
|
-
import { cn as listUnreportedSiblingAgents } from "./agent-runner-
|
|
6
|
-
import { C as isTerminalAgentInvocation, G as getAgentInvocationIdForEvents, K as getAgentInvocationIdForMessage, Y as getAgentInvocationResultMessageId, k as markAgentInvocationParentMailboxAppended, q as getAgentInvocationIdForResult, x as getLatestAgentInvocationForConversation, y as getAgentInvocation } from "./turn-failure-response-
|
|
7
|
-
import { D as timerWatchCredentialSubject, E as renderEventBatchInputs, S as EVENT_WAIT_MS, T as isEventMailboxMetadata, f as getEventBatchDelayMs, m as parseEventMessages, n as isWatchEvent, s as eventReviewItemInputs, w as eventBatchMessageMeta } from "./session-stop-
|
|
8
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
9
|
-
import { a as enqueueAgentInvocation, l as createAgentInvocationFromLatest, o as resolveAgentInvocationId, t as createAgentInvocationWorker } from "./work-
|
|
2
|
+
import { Cn as renderUntrustedTag } from "./projection-B6VS7kbo.js";
|
|
3
|
+
import { M as SYSTEM_IDENTITY_ID } from "./db-C1M1y-bh.js";
|
|
4
|
+
import { f as credentialContextForActor } from "./registry-CHewwYEo.js";
|
|
5
|
+
import { cn as listUnreportedSiblingAgents } from "./agent-runner-HoQiUKLL.js";
|
|
6
|
+
import { C as isTerminalAgentInvocation, G as getAgentInvocationIdForEvents, K as getAgentInvocationIdForMessage, Y as getAgentInvocationResultMessageId, k as markAgentInvocationParentMailboxAppended, q as getAgentInvocationIdForResult, x as getLatestAgentInvocationForConversation, y as getAgentInvocation } from "./turn-failure-response-pXhZ2wMK.js";
|
|
7
|
+
import { D as timerWatchCredentialSubject, E as renderEventBatchInputs, S as EVENT_WAIT_MS, T as isEventMailboxMetadata, f as getEventBatchDelayMs, m as parseEventMessages, n as isWatchEvent, s as eventReviewItemInputs, w as eventBatchMessageMeta } from "./session-stop-hYNTNpVf.js";
|
|
8
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-CZ9vqR4P.js";
|
|
9
|
+
import { a as enqueueAgentInvocation, l as createAgentInvocationFromLatest, o as resolveAgentInvocationId, t as createAgentInvocationWorker } from "./work-EA98F0ia.js";
|
|
10
10
|
import { n as isAgentInvocationResultEventType, t as agentInvocationResultEventType } from "./result-event-type-DD6BAgT7.js";
|
|
11
11
|
// src/chat/agent-invocations/result.ts
|
|
12
12
|
var result_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A as latestConversationMessageSeq, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, Qt as persistWithRetry, W as authorizationId, a as loadProjection, b as persistConversationMessages, d as recordAuthorizationCompleted, j as markConversationMessage, nt as saveTurnCheckpoint, t as commitAcceptedReply, v as hydrateConversationMessages } from "./projection-
|
|
2
|
-
import { S as setTags, T as withLogContext, p as logException } from "./logging-
|
|
3
|
-
import {
|
|
4
|
-
import { f as credentialContextForActor } from "./registry-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { A as latestConversationMessageSeq, I as upsertConversationMessage, M as normalizeConversationText, N as recordDeliveredAssistantMessage, Qt as persistWithRetry, W as authorizationId, a as loadProjection, b as persistConversationMessages, d as recordAuthorizationCompleted, j as markConversationMessage, nt as saveTurnCheckpoint, t as commitAcceptedReply, v as hydrateConversationMessages } from "./projection-B6VS7kbo.js";
|
|
2
|
+
import { S as setTags, T as withLogContext, p as logException } from "./logging-D0svFM8r.js";
|
|
3
|
+
import { M as SYSTEM_IDENTITY_ID, a as getConversationStore, r as getConversationEventStore } from "./db-C1M1y-bh.js";
|
|
4
|
+
import { f as credentialContextForActor } from "./registry-CHewwYEo.js";
|
|
5
|
+
import { I as messageCardText } from "./conversation-CMkSmi02.js";
|
|
6
|
+
import { T as getAssistantReplyText } from "./warmup-CY2ArYag.js";
|
|
7
|
+
import { dt as markTurnFailed, f as ConversationTurnLifecycleService, ft as startActiveTurn, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, m as loadPendingMessageCards, t as finalizeFailedTurnReplyWithEvent, u as buildTurnThreadContext } from "./turn-failure-response-pXhZ2wMK.js";
|
|
8
|
+
import { c as getPersistedThreadState, d as coerceThreadConversationState, n as scheduleSessionCompletedPluginTasks, s as getPersistedSandboxState, t as processPluginTask, u as persistThreadStateById } from "./task-runner-CMiNGsER.js";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
11
11
|
// src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Da as sandboxEgressSignalsResponseSchema } from "./projection-
|
|
1
|
+
import { Da as sandboxEgressSignalsResponseSchema } from "./projection-B6VS7kbo.js";
|
|
2
2
|
// src/chat/local/sandbox-egress-signals.ts
|
|
3
3
|
const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
|
|
4
4
|
const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
|
|
@@ -771,6 +771,7 @@ declare const conversationSummaryReportSchema: z.ZodObject<{
|
|
|
771
771
|
startedAt: z.ZodString;
|
|
772
772
|
lastSeenAt: z.ZodString;
|
|
773
773
|
lastProgressAt: z.ZodString;
|
|
774
|
+
lastMessageAt: z.ZodOptional<z.ZodString>;
|
|
774
775
|
surface: z.ZodEnum<{
|
|
775
776
|
api: "api";
|
|
776
777
|
internal: "internal";
|
|
@@ -1911,6 +1912,7 @@ declare const conversationDetailReportSchema: z.ZodObject<{
|
|
|
1911
1912
|
startedAt: z.ZodString;
|
|
1912
1913
|
lastSeenAt: z.ZodString;
|
|
1913
1914
|
lastProgressAt: z.ZodString;
|
|
1915
|
+
lastMessageAt: z.ZodOptional<z.ZodString>;
|
|
1914
1916
|
surface: z.ZodEnum<{
|
|
1915
1917
|
api: "api";
|
|
1916
1918
|
internal: "internal";
|
|
@@ -2795,15 +2797,6 @@ declare const conversationDetailReportSchema: z.ZodObject<{
|
|
|
2795
2797
|
credentialUser: z.ZodOptional<z.ZodString>;
|
|
2796
2798
|
}, z.core.$strict>>;
|
|
2797
2799
|
}, z.core.$strict>;
|
|
2798
|
-
/** A feed row, with its visible Threads nested under their parents. */
|
|
2799
|
-
type ConversationFeedItem = ConversationSummaryReport & {
|
|
2800
|
-
threads?: ConversationFeedItem[];
|
|
2801
|
-
};
|
|
2802
|
-
declare const conversationFeedSchema: z.ZodObject<{
|
|
2803
|
-
conversations: z.ZodArray<z.ZodType<ConversationFeedItem, unknown, z.core.$ZodTypeInternals<ConversationFeedItem, unknown>>>;
|
|
2804
|
-
source: z.ZodLiteral<"conversation_index">;
|
|
2805
|
-
generatedAt: z.ZodString;
|
|
2806
|
-
}, z.core.$strict>;
|
|
2807
2800
|
type ConversationReportStatus = z.infer<typeof conversationReportStatusSchema>;
|
|
2808
2801
|
type ConversationTurnFailureCode = z.infer<typeof conversationTurnFailureCodeSchema>;
|
|
2809
2802
|
type ConversationTurnFailureReason = z.infer<typeof conversationTurnFailureReasonSchema>;
|
|
@@ -2822,7 +2815,6 @@ type ConversationEventHistory = z.infer<typeof conversationEventHistorySchema>;
|
|
|
2822
2815
|
type ConversationSourceTask = z.infer<typeof conversationSourceTaskSchema>;
|
|
2823
2816
|
type ConversationDetailReport = z.infer<typeof conversationDetailReportSchema>;
|
|
2824
2817
|
type ConversationEventPage = z.infer<typeof conversationEventPageSchema>;
|
|
2825
|
-
type ConversationFeed = z.infer<typeof conversationFeedSchema>;
|
|
2826
2818
|
type ConversationParams = z.infer<typeof conversationParamsSchema>;
|
|
2827
2819
|
type CreateConversationBody = z.infer<typeof createConversationBodySchema>;
|
|
2828
2820
|
type CreateConversationMessageBody = z.infer<typeof createConversationMessageBodySchema>;
|
|
@@ -3026,6 +3018,7 @@ declare const conversationDetailWithMailboxReportSchema: z.ZodObject<{
|
|
|
3026
3018
|
startedAt: z.ZodString;
|
|
3027
3019
|
lastSeenAt: z.ZodString;
|
|
3028
3020
|
lastProgressAt: z.ZodString;
|
|
3021
|
+
lastMessageAt: z.ZodOptional<z.ZodString>;
|
|
3029
3022
|
surface: z.ZodEnum<{
|
|
3030
3023
|
api: "api";
|
|
3031
3024
|
internal: "internal";
|
|
@@ -4054,6 +4047,34 @@ type CancelConversationPendingMessagesBody = z.infer<typeof cancelConversationPe
|
|
|
4054
4047
|
type CancelConversationPendingMessagesResponse = z.infer<typeof cancelConversationPendingMessagesResponseSchema>;
|
|
4055
4048
|
type SteerConversationPendingMessagesBody = z.infer<typeof steerConversationPendingMessagesBodySchema>;
|
|
4056
4049
|
type SteerConversationPendingMessagesResponse = z.infer<typeof steerConversationPendingMessagesResponseSchema>;
|
|
4050
|
+
/**
|
|
4051
|
+
* The part of a Conversation's latest Brief that a feed row shows: what the
|
|
4052
|
+
* work is about and how it stands.
|
|
4053
|
+
*/
|
|
4054
|
+
declare const conversationFeedBriefSchema: z.ZodObject<{
|
|
4055
|
+
intent: z.ZodString;
|
|
4056
|
+
status: z.ZodEnum<{
|
|
4057
|
+
abandoned: "abandoned";
|
|
4058
|
+
answered: "answered";
|
|
4059
|
+
blocked: "blocked";
|
|
4060
|
+
done: "done";
|
|
4061
|
+
in_progress: "in_progress";
|
|
4062
|
+
partial: "partial";
|
|
4063
|
+
}>;
|
|
4064
|
+
summary: z.ZodString;
|
|
4065
|
+
}, z.core.$strict>;
|
|
4066
|
+
type ConversationFeedBrief = z.infer<typeof conversationFeedBriefSchema>;
|
|
4067
|
+
/** A feed row, with its visible Threads nested under their parents. */
|
|
4068
|
+
type ConversationFeedItem = ConversationSummaryReport & {
|
|
4069
|
+
brief?: ConversationFeedBrief;
|
|
4070
|
+
threads?: ConversationFeedItem[];
|
|
4071
|
+
};
|
|
4072
|
+
declare const conversationFeedSchema: z.ZodObject<{
|
|
4073
|
+
conversations: z.ZodArray<z.ZodType<ConversationFeedItem, unknown, z.core.$ZodTypeInternals<ConversationFeedItem, unknown>>>;
|
|
4074
|
+
source: z.ZodLiteral<"conversation_index">;
|
|
4075
|
+
generatedAt: z.ZodString;
|
|
4076
|
+
}, z.core.$strict>;
|
|
4077
|
+
type ConversationFeed = z.infer<typeof conversationFeedSchema>;
|
|
4057
4078
|
/**
|
|
4058
4079
|
* Archive or restore one conversation. `applyToChildren` applies to a child
|
|
4059
4080
|
* only: archive refuses while a descendant is unarchived unless it is true,
|
|
@@ -4096,6 +4117,10 @@ declare const conversationMetricDaySchema: z.ZodObject<{
|
|
|
4096
4117
|
date: z.ZodString;
|
|
4097
4118
|
durationMs: z.ZodNumber;
|
|
4098
4119
|
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
4120
|
+
mergedCodeChangeCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
4121
|
+
mergedCodeChanges: z.ZodOptional<z.ZodNumber>;
|
|
4122
|
+
outcomeCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
4123
|
+
outcomes: z.ZodOptional<z.ZodNumber>;
|
|
4099
4124
|
tokens: z.ZodOptional<z.ZodNumber>;
|
|
4100
4125
|
}, z.core.$strict>;
|
|
4101
4126
|
declare const guardianMetricDaySchema: z.ZodObject<{
|
|
@@ -4184,6 +4209,10 @@ declare const conversationStatsReportSchema: z.ZodObject<{
|
|
|
4184
4209
|
date: z.ZodString;
|
|
4185
4210
|
durationMs: z.ZodNumber;
|
|
4186
4211
|
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
4212
|
+
mergedCodeChangeCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
4213
|
+
mergedCodeChanges: z.ZodOptional<z.ZodNumber>;
|
|
4214
|
+
outcomeCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
4215
|
+
outcomes: z.ZodOptional<z.ZodNumber>;
|
|
4187
4216
|
tokens: z.ZodOptional<z.ZodNumber>;
|
|
4188
4217
|
}, z.core.$strict>>;
|
|
4189
4218
|
metricHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -4194,6 +4223,10 @@ declare const conversationStatsReportSchema: z.ZodObject<{
|
|
|
4194
4223
|
date: z.ZodString;
|
|
4195
4224
|
durationMs: z.ZodNumber;
|
|
4196
4225
|
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
4226
|
+
mergedCodeChangeCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
4227
|
+
mergedCodeChanges: z.ZodOptional<z.ZodNumber>;
|
|
4228
|
+
outcomeCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
4229
|
+
outcomes: z.ZodOptional<z.ZodNumber>;
|
|
4197
4230
|
tokens: z.ZodOptional<z.ZodNumber>;
|
|
4198
4231
|
}, z.core.$strict>>>;
|
|
4199
4232
|
metricSixHours: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -4204,6 +4237,10 @@ declare const conversationStatsReportSchema: z.ZodObject<{
|
|
|
4204
4237
|
date: z.ZodString;
|
|
4205
4238
|
durationMs: z.ZodNumber;
|
|
4206
4239
|
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
4240
|
+
mergedCodeChangeCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
4241
|
+
mergedCodeChanges: z.ZodOptional<z.ZodNumber>;
|
|
4242
|
+
outcomeCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
4243
|
+
outcomes: z.ZodOptional<z.ZodNumber>;
|
|
4207
4244
|
tokens: z.ZodOptional<z.ZodNumber>;
|
|
4208
4245
|
}, z.core.$strict>>>;
|
|
4209
4246
|
locations: z.ZodArray<z.ZodObject<{
|
|
@@ -4889,6 +4926,7 @@ declare const actorProfileReportSchema: z.ZodObject<{
|
|
|
4889
4926
|
startedAt: z.ZodString;
|
|
4890
4927
|
lastSeenAt: z.ZodString;
|
|
4891
4928
|
lastProgressAt: z.ZodString;
|
|
4929
|
+
lastMessageAt: z.ZodOptional<z.ZodString>;
|
|
4892
4930
|
surface: z.ZodEnum<{
|
|
4893
4931
|
api: "api";
|
|
4894
4932
|
internal: "internal";
|
|
@@ -5324,6 +5362,7 @@ declare const locationDetailReportSchema: z.ZodObject<{
|
|
|
5324
5362
|
startedAt: z.ZodString;
|
|
5325
5363
|
lastSeenAt: z.ZodString;
|
|
5326
5364
|
lastProgressAt: z.ZodString;
|
|
5365
|
+
lastMessageAt: z.ZodOptional<z.ZodString>;
|
|
5327
5366
|
surface: z.ZodEnum<{
|
|
5328
5367
|
api: "api";
|
|
5329
5368
|
internal: "internal";
|
|
@@ -7423,6 +7462,14 @@ declare const skillReportsSchema: z.ZodArray<z.ZodObject<{
|
|
|
7423
7462
|
pluginProvider: z.ZodOptional<z.ZodString>;
|
|
7424
7463
|
disableModelInvocation: z.ZodOptional<z.ZodBoolean>;
|
|
7425
7464
|
}, z.core.$strict>>;
|
|
7465
|
+
/** One skill with its authored SKILL.md body, without frontmatter. */
|
|
7466
|
+
declare const skillDetailReportSchema: z.ZodObject<{
|
|
7467
|
+
name: z.ZodString;
|
|
7468
|
+
description: z.ZodString;
|
|
7469
|
+
pluginProvider: z.ZodOptional<z.ZodString>;
|
|
7470
|
+
disableModelInvocation: z.ZodOptional<z.ZodBoolean>;
|
|
7471
|
+
body: z.ZodString;
|
|
7472
|
+
}, z.core.$strict>;
|
|
7426
7473
|
declare const pluginPackageContentItemReportSchema: z.ZodObject<{
|
|
7427
7474
|
dir: z.ZodString;
|
|
7428
7475
|
hasMigrationsDir: z.ZodBoolean;
|
|
@@ -7588,6 +7635,7 @@ type Plugin = z.infer<typeof pluginSchema>;
|
|
|
7588
7635
|
type Plugins = z.infer<typeof pluginsSchema>;
|
|
7589
7636
|
type SkillReport = z.infer<typeof skillReportSchema>;
|
|
7590
7637
|
type SkillReports = z.infer<typeof skillReportsSchema>;
|
|
7638
|
+
type SkillDetailReport = z.infer<typeof skillDetailReportSchema>;
|
|
7591
7639
|
type RuntimeInfoReport = z.infer<typeof runtimeInfoReportSchema>;
|
|
7592
7640
|
type PluginPackageContentItemReport = z.infer<typeof pluginPackageContentItemReportSchema>;
|
|
7593
7641
|
type PluginPackageContentReport = z.infer<typeof pluginPackageContentReportSchema>;
|
|
@@ -7781,13 +7829,17 @@ declare const reviewItemCountSchema: z.ZodObject<{
|
|
|
7781
7829
|
}, z.core.$strict>;
|
|
7782
7830
|
/**
|
|
7783
7831
|
* Conversations linked to an open action item assigned to the viewer. `title`
|
|
7784
|
-
* is the newest such item; `count` is how many there are
|
|
7832
|
+
* is the newest such item; `count` is how many there are; `waitingSince` is
|
|
7833
|
+
* when the oldest was added.
|
|
7785
7834
|
*/
|
|
7786
7835
|
declare const reviewItemWaitingConversationsSchema: z.ZodObject<{
|
|
7787
7836
|
conversations: z.ZodArray<z.ZodObject<{
|
|
7788
7837
|
conversationId: z.ZodString;
|
|
7789
|
-
|
|
7790
|
-
|
|
7838
|
+
items: z.ZodArray<z.ZodObject<{
|
|
7839
|
+
plugin: z.ZodOptional<z.ZodString>;
|
|
7840
|
+
title: z.ZodString;
|
|
7841
|
+
}, z.core.$strict>>;
|
|
7842
|
+
waitingSince: z.ZodString;
|
|
7791
7843
|
}, z.core.$strict>>;
|
|
7792
7844
|
}, z.core.$strict>;
|
|
7793
7845
|
/** One person action on a Review item. */
|
|
@@ -7815,4 +7867,4 @@ declare const versionsSchema: z.ZodObject<{
|
|
|
7815
7867
|
spend: z.ZodString;
|
|
7816
7868
|
}, z.core.$strict>;
|
|
7817
7869
|
type Versions = z.output<typeof versionsSchema>;
|
|
7818
|
-
export {
|
|
7870
|
+
export { AutomationVersionList as $, CodeOverviewReport as $i, ConversationSubscriptionResponse as $n, conversationDetailWithMailboxReportSchema as $r, isWithinNotificationSchedule as $t, runtimeInfoReportSchema as A, normalizeUserInputAnswer as Aa, CreateConversationBody as Ai, personParamsSchema as An, ConversationStatsReport as Ar, workspaceListSchema as At, replyTimeSegmentsReportSchema as B, conversationFeedQuerySchema as Bi, CONVERSATION_TITLE_MAX_LENGTH as Bn, conversationAutoArchiveSchema as Br, personalTokenMetadataSchema as Bt, healthReportSchema as C, AutomationCard as Ca, ConversationReportStatus as Ci, ActorTotalsReport as Cn, ContinueConversationInSlackResponse as Cr, scheduledAutomationSummarySchema as Ct, pluginPackageContentReportSchema as D, UserInputRequest as Da, ConversationTurnFailureCode as Di, PersonalSpendReport as Dn, stopConversationTurnResponseSchema as Dr, baselineSnapshotSchema as Dt, pluginPackageContentItemReportSchema as E, UserInputField as Ea, ConversationSurface as Ei, PersonParams as En, StopConversationTurnResponse as Er, WorkspaceReport as Et, StatsReport as F, MAX_INPUT_IMAGE_BYTES as Fa, conversationDetailQuerySchema as Fi, conversationWatchesReportSchema as Fn, ArchiveConversationResponse as Fr, userCustomizationSchema as Ft, AutomationList as G, createConversationBodySchema as Gi, CONVERSATION_OUTLINE_TEXT_LENGTH as Gn, CancelConversationPendingMessagesResponse as Gr, serviceAccountParamsSchema as Gt, AutomationExecution as H, conversationReportEventDataSchema as Hi, RenameConversationResponse as Hn, ConversationFeedItem as Hr, revokePersonalTokenResponseSchema as Ht, statSchema as I, MessageAttachment as Ia, conversationDetailReportSchema as Ii, ConversationChildAgent as In, ConversationAutoArchive as Ir, PersonalTokenMetadata as It, AutomationRunList as J, forkConversationResponseSchema as Ji, ConversationUnread as Jn, ConversationPendingMessagesReport as Jr, NotificationSettings as Jt, AutomationListQuery as K, createConversationMessageBodySchema as Ki, ConversationOutline as Kn, ConversationPendingMessage as Kr, serviceAccountSchema as Kt, statsReportSchema as L, INLINE_VIDEO_TYPES as La, conversationEventHistorySchema as Li, ConversationChildAgentsReport as Ln, archiveConversationBodySchema as Lr, createPersonalTokenBodySchema as Lt, skillReportSchema as M, isAgentInvocationResultEventType as Ma, acceptedConversationMessageSchema as Mi, ConversationWatch as Mn, GuardianStats as Mr, workspaceRepoSchema as Mt, skillReportsSchema as N, InputImage as Na, conversationActivityPreviewSchema as Ni, ConversationWatchesReport as Nn, conversationStatsReportSchema as Nr, workspaceSchema as Nt, pluginSchema as O, buttonUserInputField as Oa, ConversationTurnFailureReason as Oi, actorDirectoryReportSchema as On, ConversationMetricDay as Or, deleteWorkspaceResponseSchema as Ot, StatReport as P, MAX_INPUT_IMAGES as Pa, conversationAuxiliaryCostsSchema as Pi, conversationWatchSchema as Pn, ArchiveConversationBody as Pr, USER_CUSTOMIZATION_MAX_CHARS as Pt, AutomationUpdate as Q, CodeChangeSummaryReport as Qi, ConversationSubscriptionBody as Qn, cancelConversationPendingMessagesResponseSchema as Qr, NotificationSchedule as Qt, ReplyTimeHistogram as R, INPUT_IMAGE_TYPES as Ra, conversationEventPageSchema as Ri, conversationChildAgentSchema as Rn, archiveConversationResponseSchema as Rr, createdPersonalTokenSchema as Rt, SkillReports as S, AutomationTask as Sa, ConversationReportMessageEvent as Si, ActorSummaryReport as Sn, ContinueConversationInSlackBody as Sr, eventAutomationSummarySchema as St, pluginOperationalReportSchema as T, UserInputAnswer as Ta, ConversationSummaryReport as Ti, PeopleActivityDayReport as Tn, continueConversationInSlackResponseSchema as Tr, WorkspaceListReport as Tt, AutomationExecutionList as U, conversationReportEventSchema as Ui, renameConversationBodySchema as Un, conversationFeedSchema as Ur, disconnectServiceAccountResponseSchema as Ut, AutomationEdit as V, conversationParamsSchema as Vi, RenameConversationBody as Vn, ConversationFeed as Vr, personalTokenParamsSchema as Vt, AutomationExecutionStatusDay as W, conversationSummaryReportSchema as Wi, renameConversationResponseSchema as Wn, CancelConversationPendingMessagesBody as Wr, serviceAccountListSchema as Wt, AutomationScheduleIntent as X, conversationTurnFailureReasonSchema as Xi, conversationUnreadSchema as Xn, SteerConversationPendingMessagesResponse as Xr, testNotificationResponseSchema as Xt, AutomationRunWindows as Y, conversationTurnFailureCodeSchema as Yi, MarkConversationUnreadBody as Yn, SteerConversationPendingMessagesBody as Yr, notificationSettingsSchema as Yt, AutomationSummary as Z, CodeActivityDay as Zi, markConversationUnreadBodySchema as Zn, cancelConversationPendingMessagesBodySchema as Zr, DEFAULT_NOTIFICATION_SCHEDULE as Zt, PluginPackageContentReport as _, BoardReport as _a, ConversationEventPage as _i, locationParamsSchema as _n, conversationCatchUpSchema as _r, automationUpdateSchema as _t, ReviewItemPayload as a, codeChangeSummarySchema as aa, steerConversationPendingMessagesBodySchema as ai, startConnectionResponseSchema as an, conversationDeliveryResponseSchema as ar, automationExecutionSchema as at, SkillDetailReport as b, messageCardText as ba, ConversationReportEvent as bi, ActorDirectoryWindows as bn, conversationReadPositionSchema as br, automationVersionParamsSchema as bt, reviewItemListSchema as c, codeRepositoryParamsSchema as ca, ActorIdentity as ci, LocationActivityDayReport as cn, ReorderPinnedConversationsBody as cr, automationListQuerySchema as ct, ReviewItemChangeRecord as d, ConversationChildAgentTotals as da, ConversationActivityPreview as di, LocationDirectoryReport as dn, pinConversationResponseSchema as dr, automationRunListSchema as dt, CodePersonReport as ea, conversationPendingAuthorizationSchema as ei, notificationScheduleSchema as en, conversationSubscriptionBodySchema as er, ListedAutomationVersion as et, HealthReport as f, conversationChildAgentTotalsSchema as fa, ConversationAgentTreeNode as fi, LocationParams as fn, reorderPinnedConversationsBodySchema as fr, automationRunSchema as ft, PluginPackageContentItemReport as g, BoardColumn as ga, ConversationEventHistory as gi, locationDirectoryReportSchema as gn, conversationCatchUpBodySchema as gr, automationSummarySchema as gt, PluginOperationalReportFeed as h, BoardCard as ha, ConversationDetailReport as hi, locationDetailReportSchema as hn, ConversationCatchUpBody as hr, automationSchedulePreviewSchema as ht, ReviewItemActionBody as i, codeChangeSummaryReportSchema as ia, conversationUnchangedDetailWithMailboxSchema as ii, disconnectConnectionResponseSchema as in, conversationDeliveryBodySchema as ir, automationExecutionListSchema as it, skillDetailReportSchema as j, webMessageId as ja, CreateConversationMessageBody as ji, personalSpendReportSchema as jn, GuardianMetricDay as jr, workspaceParamsSchema as jt, pluginsSchema as k, isEmptyUserInputAnswer as ka, ConversationUsage as ki, actorProfileReportSchema as kn, ConversationStatsItem as kr, workspaceBodySchema as kt, reviewItemSchema as l, codeRepositoryReportSchema as la, CONVERSATION_DETAIL_VERSION_HEADER as li, LocationActorSummaryReport as ln, ReorderPinnedConversationsResponse as lr, automationListSchema as lt, PluginOperationalReport as m, dailyConversationActivitySchema as ma, ConversationCost as mi, locationActivityDayReportSchema as mn, ConversationCatchUp as mr, automationScheduleIntentSchema as mt, Versions as n, CodeRepositorySummary as na, conversationPendingMessageSchema as ni, connectionParamsSchema as nn, ConversationDeliveryBody as nr, automationEditSchema as nt, reviewItemActionSchema as o, codeOverviewReportSchema as oa, steerConversationPendingMessagesResponseSchema as oi, ApiError as on, PinConversationBody as or, automationExecutionStatusDaySchema as ot, Plugin as p, DailyConversationActivity as pa, ConversationAuxiliaryCosts as pi, LocationSummaryReport as pn, reorderPinnedConversationsResponseSchema as pr, automationRunWindowsSchema as pt, AutomationRun as q, forkConversationBodySchema as qi, conversationOutlineSchema as qn, ConversationPendingMessageDelivery as qr, startServiceAccountSignInResponseSchema as qt, versionsSchema as r, codeActivityDaySchema as ra, conversationPendingMessagesReportSchema as ri, connectionSchema as rn, ConversationDeliveryResponse as rr, automationEventCatalogSchema as rt, reviewItemCountSchema as s, codePersonReportSchema as sa, AcceptedConversationMessage as si, apiErrorSchema as sn, PinConversationResponse as sr, automationExecutionStatusSchema as st, OwnedObjectAnnotation$1 as t, CodeRepositoryReport as ta, conversationPendingMessageDeliverySchema as ti, connectionListSchema as tn, conversationSubscriptionResponseSchema as tr, automationEditErrorSchema as tt, reviewItemWaitingConversationsSchema as u, codeRepositorySummarySchema as ua, CONVERSATION_VERSION_HEADER as ui, LocationDetailReport as un, pinConversationBodySchema as ur, automationParamsSchema as ut, Plugins as v, boardReportSchema as va, ConversationModelUsage as vi, ActorActivityDayReport as vn, ConversationReadPosition as vr, automationVersionActivateSchema as vt, pluginOperationalReportFeedSchema as w, USER_INPUT_NOTE as wa, ConversationSourceTask as wi, ActorWindowMetrics as wn, continueConversationInSlackBodySchema as wr, BaselineSnapshotReport as wt, SkillReport as x, resolveMessageCards as xa, ConversationReportEventData as xi, ActorProfileReport as xn, conversationReadReportSchema as xr, automationVersionSchema as xt, RuntimeInfoReport as y, MessageCard as ya, ConversationParams as yi, ActorDirectoryReport as yn, ConversationReadReport as yr, automationVersionListSchema as yt, ReplyTimeSegmentsReport as z, conversationEventsQuerySchema as zi, conversationChildAgentsReportSchema as zn, archiveDoneConversationsResponseSchema as zr, personalTokenListSchema as zt };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as notificationScheduleSchema } from "./schedule-cP0AACm1.js";
|
|
2
|
-
import {
|
|
2
|
+
import { E as conversationChildAgentTotalsSchema, i as actorIdentitySchema, s as conversationAuxiliaryCostsSchema, x as conversationUsageSchema, y as conversationSummaryReportSchema } from "./conversation-CMkSmi02.js";
|
|
3
3
|
import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours, w as AGENT_INVOCATION_STATUSES, x as userInputRequestSchema } from "./reporting-window-B3Ze-Qnt.js";
|
|
4
|
-
import "./automation-
|
|
5
|
-
import "./conversation-
|
|
4
|
+
import "./automation-yJX3C7i3.js";
|
|
5
|
+
import "./conversation-feed-BVAOga0H.js";
|
|
6
6
|
import { t as isPushServiceEndpoint } from "./push-endpoint-CO-nomUd.js";
|
|
7
7
|
import * as z from "zod";
|
|
8
8
|
import { codeChangeStateSchema, eventMatchSchema } from "@sentry/junior-plugin-api";
|
|
@@ -111,6 +111,17 @@ const conversationMetricDaySchema = z.object({
|
|
|
111
111
|
date: conversationMetricBucketSchema,
|
|
112
112
|
durationMs: z.number(),
|
|
113
113
|
inputTokens: z.number().optional(),
|
|
114
|
+
/** Conversation cost split to `mergedCodeChanges`. */
|
|
115
|
+
mergedCodeChangeCostUsd: z.number().optional(),
|
|
116
|
+
/** Code changes merged in this bucket. They are also `outcomes`. */
|
|
117
|
+
mergedCodeChanges: z.number().optional(),
|
|
118
|
+
/** Conversation cost of `outcomes`. */
|
|
119
|
+
outcomeCostUsd: z.number().optional(),
|
|
120
|
+
/**
|
|
121
|
+
* Merged code changes, plus root Conversations without code changes
|
|
122
|
+
* whose latest Brief is `done` or `answered`.
|
|
123
|
+
*/
|
|
124
|
+
outcomes: z.number().optional(),
|
|
114
125
|
tokens: z.number().optional()
|
|
115
126
|
}).strict();
|
|
116
127
|
const guardianMetricDaySchema = z.object({
|
|
@@ -735,12 +746,19 @@ const reviewItemCountSchema = z.object({
|
|
|
735
746
|
needsViewer: z.number().int().nonnegative() }).strict();
|
|
736
747
|
/**
|
|
737
748
|
* Conversations linked to an open action item assigned to the viewer. `title`
|
|
738
|
-
* is the newest such item; `count` is how many there are
|
|
749
|
+
* is the newest such item; `count` is how many there are; `waitingSince` is
|
|
750
|
+
* when the oldest was added.
|
|
739
751
|
*/
|
|
740
752
|
const reviewItemWaitingConversationsSchema = z.object({ conversations: z.array(z.object({
|
|
741
753
|
conversationId: z.string().min(1),
|
|
742
|
-
|
|
743
|
-
|
|
754
|
+
/** Open items that need the viewer, newest first. */
|
|
755
|
+
items: z.array(z.object({
|
|
756
|
+
/** The plugin that added the item, such as `github`. */
|
|
757
|
+
plugin: z.string().min(1).optional(),
|
|
758
|
+
title: z.string().min(1)
|
|
759
|
+
}).strict()).min(1),
|
|
760
|
+
/** When the oldest of those items was added: when the wait began. */
|
|
761
|
+
waitingSince: z.string().datetime()
|
|
744
762
|
}).strict()) }).strict();
|
|
745
763
|
const reviewItemParamsSchema = z.object({ id: z.string().min(1) }).strict();
|
|
746
764
|
/** One person action on a Review item. */
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/chat/secrets.ts
|
|
2
|
+
/** Read the server secret that signs internal tokens and payloads. */
|
|
3
|
+
function readJuniorSecret() {
|
|
4
|
+
return process.env.JUNIOR_SECRET?.trim() || void 0;
|
|
5
|
+
}
|
|
6
|
+
/** Read the raw dashboard session secret, with `JUNIOR_SECRET` as fallback. */
|
|
7
|
+
function readSignInSecret() {
|
|
8
|
+
return process.env.BETTER_AUTH_SECRET ?? process.env.JUNIOR_SECRET;
|
|
9
|
+
}
|
|
10
|
+
/** Read the bearer secret that internal cron requests must send. */
|
|
11
|
+
function readSchedulerSecret() {
|
|
12
|
+
return process.env.JUNIOR_SCHEDULER_SECRET?.trim() || process.env.CRON_SECRET?.trim();
|
|
13
|
+
}
|
|
14
|
+
/** Read the VAPID private key that signs web push messages. */
|
|
15
|
+
function readWebPushPrivateKey() {
|
|
16
|
+
return process.env.JUNIOR_WEB_PUSH_PRIVATE_KEY?.trim();
|
|
17
|
+
}
|
|
18
|
+
export { readWebPushPrivateKey as i, readSchedulerSecret as n, readSignInSecret as r, readJuniorSecret as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-CpCmlD9L.js";
|
|
2
|
+
import { r as disconnectStateAdapter } from "./state-C3CbtD_m.js";
|
|
3
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-DLoeoHww.js";
|
|
4
4
|
import { CLI_USAGE } from "./cli/run.js";
|
|
5
5
|
import { createServer } from "node:http";
|
|
6
6
|
// src/cli/service-account.ts
|
|
@@ -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-D0svFM8r.js";
|
|
2
|
+
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-CHewwYEo.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-C3CbtD_m.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."
|