@sentry/junior 0.274.0 → 0.276.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-4qThDhgF.js → adapter-DoPR2jS-.js} +1 -1
- package/dist/{admin-c7ASvs6x.js → admin-BJTT-kXb.js} +1 -1
- package/dist/{agent-invocations-C1RNOCs8.js → agent-invocations-CUWrrzkc.js} +1 -0
- package/dist/{agent-runner-CLHM48dh.js → agent-runner-sMpA5qGM.js} +1118 -394
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +3 -3
- package/dist/api.d.ts +1 -1
- package/dist/api.js +75 -66
- package/dist/{app-BlmPpPoR.d.ts → app-DTj-yAQt.d.ts} +26 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +237 -87
- package/dist/{assistant-reply-2IwdFWuQ.js → assistant-reply-DbxKnBQF.js} +1 -1
- package/dist/{automation-BGrd03QO.js → automation-B8_mC68r.js} +42 -13
- package/dist/{job-queue-Bh9sFO9t.js → background-compaction-queue-Bywqo1WJ.js} +42 -3
- package/dist/{briefs-C1-NOh8m.js → briefs-IL7QnCCR.js} +4 -4
- package/dist/{catalog-runtime-BnIJimKZ.js → catalog-runtime--sC2CYLQ.js} +1 -1
- package/dist/cli/chat.js +14 -14
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-C0ZIxoDr.js → client-7diKvInp.js} +2 -2
- package/dist/{config-DS-QLVSL.js → config-Cb--cuv-.js} +2 -2
- package/dist/{connections-Djb6ANAh.js → connections-C4-4fxaE.js} +14 -14
- package/dist/{conversation-BjTo9ZFL.js → conversation-DppJ83Hw.js} +32 -7
- package/dist/{conversation-privacy-3IMUZSHC.js → conversation-privacy-DTwdT3Pi.js} +1 -1
- package/dist/{credential-sync-ig88EB_v.js → credential-sync-Sl5RQCkS.js} +13 -13
- package/dist/{db-BMZhoYKj.d.ts → db-Ck6TXQIx.d.ts} +1 -1
- package/dist/{executor-C2moGIHS.js → executor-BFKmqxYe.js} +3 -3
- package/dist/instrumentation.d.ts +14 -0
- package/dist/instrumentation.js +29 -6
- package/dist/{logging-DYRS7E8s.js → logging-B04X_eCB.js} +3 -2
- package/dist/{message-CicNrhCv.js → message-DQMFyyE-.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +13 -3
- package/dist/{oauth-callback-server-BXyrepfY.js → oauth-callback-server-BGq0_vQI.js} +2 -2
- package/dist/{projection-CMRrv9Pt.js → projection-6dXaN0n-.js} +109 -17
- package/dist/{prompt-JEWUUpLW.js → prompt-B4fQKGZR.js} +1 -1
- package/dist/{registry-D92WLl5I.js → registry-CEqKR_ld.js} +1 -1
- package/dist/{resolve-C-Dh14ps.js → resolve-8I5DkrfI.js} +3 -3
- package/dist/{result-DZ8TCQkd.js → result-BgAW90IM.js} +9 -9
- package/dist/{runner-BBmhrQTM.js → runner-CSKDr_19.js} +12 -12
- package/dist/{sandbox-egress-signals-Cehpq6hC.js → sandbox-egress-signals-BxAT276e.js} +1 -1
- package/dist/{schema-DfdHlBnb.d.ts → schema-CaUWl2EV.d.ts} +74 -6
- package/dist/{schema-CX9XGKCm.js → schema-Cal-EFdi.js} +9 -7
- package/dist/{service-account-Bapo6l0R.js → service-account-CUuVJCKT.js} +3 -3
- package/dist/{service-account-Ce1465Fn.js → service-account-CtOab1Xz.js} +3 -3
- package/dist/{session-stop-CI5qJU7a.js → session-stop-DK8LuPZW.js} +155 -54
- package/dist/{skills-D-d79XQ6.js → skills-Bc0D7BGy.js} +2 -2
- package/dist/{spawn-C_FETz5x.js → spawn-DF_GUcd8.js} +2 -2
- package/dist/{stop-CmwFHwiN.js → stop-DthSy-z8.js} +159 -121
- package/dist/{store-BvI3yBGS.js → store-BgH2P3X9.js} +3 -3
- package/dist/{store-BIQYXvoV.js → store-C5uVTx2G.js} +11 -9
- package/dist/{task-queue-BdB0pab8.js → task-queue-C6ROM_XJ.js} +3 -3
- package/dist/{task-runner-DQr2QfvJ.js → task-runner-BwAkjjVE.js} +6 -6
- package/dist/{thread-state-ngCvtWNa.js → thread-state-BXjgk1pW.js} +4 -4
- package/dist/{turn-failure-response-BDT3sT2v.js → turn-failure-response-CVI57qKL.js} +7 -7
- package/dist/{turn-lifecycle-B7O6rZEX.js → turn-lifecycle-CF6ibonp.js} +6 -1
- package/dist/{turn-session-routing-DIeqG2pO.js → turn-session-routing-DddybdNu.js} +17 -16
- package/dist/{validation-D3Xik64v.js → validation-BxF1nQbC.js} +1 -1
- package/dist/{version-BoWLhNzj.js → version-CTzSbCmR.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-D25XOUHc.js → viewer-CQwBszc7.js} +10 -7
- package/dist/{work-D12-wcf4.js → work-BHlShEQ6.js} +30 -12
- package/dist/{worker-DGxfDtES.js → worker-DhY9MnsH.js} +6 -6
- package/migrations/0073_conversation_quick_question.sql +1 -0
- package/migrations/meta/0073_snapshot.json +4070 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +6 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as resolveLocalScheduleAtMs, i as isValidTimeZone, r as getZonedDateTimeParts, t as getFirstRunAtMs } from "./cadence-R7Em4RjE.js";
|
|
2
|
-
import { n as actorIdentitySchema } from "./conversation-
|
|
2
|
+
import { n as actorIdentitySchema } from "./conversation-DppJ83Hw.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { actorUserIdSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
5
5
|
// src/chat/scheduled-automations/schedule-intent.ts
|
|
@@ -39,7 +39,7 @@ const oneOffScheduleIntentSchema = z.object({
|
|
|
39
39
|
time: localTimeSchema.describe("Requested local wall-clock time in HH:MM format.")
|
|
40
40
|
}).strict()]).describe("Relative delay or explicit local time for the one-off run.")
|
|
41
41
|
}).strict();
|
|
42
|
-
const
|
|
42
|
+
const recurringScheduleFields = {
|
|
43
43
|
kind: z.literal("recurring").describe("A repeating calendar schedule."),
|
|
44
44
|
frequency: z.enum([
|
|
45
45
|
"daily",
|
|
@@ -50,20 +50,21 @@ const recurringScheduleIntentSchema = z.object({
|
|
|
50
50
|
interval: z.number().int().positive().max(365).describe("Repeat every N frequency units. Defaults to 1.").nullable().optional(),
|
|
51
51
|
time: localTimeSchema.describe("Local wall-clock time for each occurrence in HH:MM format."),
|
|
52
52
|
weekdays: z.array(weekdaySchema).min(1).max(7).describe("Required for weekly schedules.").nullable().optional(),
|
|
53
|
-
dayOfMonth: z.number().int().min(1).max(31).describe("Required for monthly and yearly schedules.").nullable().optional(),
|
|
54
53
|
month: z.number().int().min(1).max(12).describe("Required for yearly schedules, where January is 1.").nullable().optional(),
|
|
55
|
-
startDate: localDateSchema.describe("Optional local calendar date that anchors the recurrence. Omit to start with the next matching occurrence.").nullable().optional(),
|
|
56
54
|
timezone: timezoneSchema
|
|
57
|
-
}
|
|
55
|
+
};
|
|
56
|
+
const dayOfMonthSchema = z.number().int().min(1).max(31).describe("Required for monthly and yearly schedules.").nullable().optional();
|
|
57
|
+
const startDateSchema = localDateSchema.describe("Optional local calendar date that anchors the recurrence. Omit to start with the next matching occurrence.").nullable().optional();
|
|
58
|
+
function checkRecurringSchedule(schedule, dayOfMonth, context) {
|
|
58
59
|
if (schedule.frequency === "weekly" && schedule.weekdays == null) context.addIssue({
|
|
59
60
|
code: "custom",
|
|
60
61
|
message: "Weekly schedules require weekdays.",
|
|
61
62
|
path: ["weekdays"]
|
|
62
63
|
});
|
|
63
|
-
if ((schedule.frequency === "monthly" || schedule.frequency === "yearly") &&
|
|
64
|
+
if ((schedule.frequency === "monthly" || schedule.frequency === "yearly") && dayOfMonth.value == null) context.addIssue({
|
|
64
65
|
code: "custom",
|
|
65
|
-
message: `${schedule.frequency} schedules require dayOfMonth.`,
|
|
66
|
-
path: [
|
|
66
|
+
message: `${schedule.frequency} schedules require ${dayOfMonth.key}.`,
|
|
67
|
+
path: [dayOfMonth.key]
|
|
67
68
|
});
|
|
68
69
|
if (schedule.frequency === "yearly" && schedule.month == null) context.addIssue({
|
|
69
70
|
code: "custom",
|
|
@@ -75,18 +76,46 @@ const recurringScheduleIntentSchema = z.object({
|
|
|
75
76
|
message: "weekdays applies only to weekly schedules.",
|
|
76
77
|
path: ["weekdays"]
|
|
77
78
|
});
|
|
78
|
-
if (schedule.frequency !== "monthly" && schedule.frequency !== "yearly" &&
|
|
79
|
+
if (schedule.frequency !== "monthly" && schedule.frequency !== "yearly" && dayOfMonth.value != null) context.addIssue({
|
|
79
80
|
code: "custom",
|
|
80
|
-
message:
|
|
81
|
-
path: [
|
|
81
|
+
message: `${dayOfMonth.key} applies only to monthly or yearly schedules.`,
|
|
82
|
+
path: [dayOfMonth.key]
|
|
82
83
|
});
|
|
83
84
|
if (schedule.frequency !== "yearly" && schedule.month != null) context.addIssue({
|
|
84
85
|
code: "custom",
|
|
85
86
|
message: "month applies only to yearly schedules.",
|
|
86
87
|
path: ["month"]
|
|
87
88
|
});
|
|
88
|
-
}
|
|
89
|
+
}
|
|
90
|
+
const recurringScheduleIntentSchema = z.object({
|
|
91
|
+
...recurringScheduleFields,
|
|
92
|
+
dayOfMonth: dayOfMonthSchema,
|
|
93
|
+
startDate: startDateSchema
|
|
94
|
+
}).strict().superRefine((schedule, context) => checkRecurringSchedule(schedule, {
|
|
95
|
+
key: "dayOfMonth",
|
|
96
|
+
value: schedule.dayOfMonth
|
|
97
|
+
}, context));
|
|
98
|
+
const recurringToolScheduleIntentSchema = z.object({
|
|
99
|
+
...recurringScheduleFields,
|
|
100
|
+
day_of_month: dayOfMonthSchema,
|
|
101
|
+
start_date: startDateSchema
|
|
102
|
+
}).strict().superRefine((schedule, context) => checkRecurringSchedule(schedule, {
|
|
103
|
+
key: "day_of_month",
|
|
104
|
+
value: schedule.day_of_month
|
|
105
|
+
}, context));
|
|
89
106
|
const scheduleIntentSchema = z.union([oneOffScheduleIntentSchema, recurringScheduleIntentSchema]);
|
|
107
|
+
/** Model-facing schedule intent of the Automation tools. */
|
|
108
|
+
const toolScheduleIntentSchema = z.union([oneOffScheduleIntentSchema, recurringToolScheduleIntentSchema]);
|
|
109
|
+
/** Map a tool schedule intent to the shape that core compiles and saves. */
|
|
110
|
+
function scheduleIntentFromTool(intent) {
|
|
111
|
+
if (intent.kind === "one_off") return intent;
|
|
112
|
+
const { day_of_month, start_date, ...rest } = intent;
|
|
113
|
+
return {
|
|
114
|
+
...rest,
|
|
115
|
+
dayOfMonth: day_of_month,
|
|
116
|
+
startDate: start_date
|
|
117
|
+
};
|
|
118
|
+
}
|
|
90
119
|
const WEEKDAY_INDEX = {
|
|
91
120
|
sunday: 0,
|
|
92
121
|
monday: 1,
|
|
@@ -694,4 +723,4 @@ const automationEventCatalogSchema = z.array(z.object({
|
|
|
694
723
|
}).strict());
|
|
695
724
|
const automationScheduleIntentSchema = scheduleIntentSchema;
|
|
696
725
|
const automationSchedulePreviewSchema = scheduledAutomationSchema.pick({ schedule: true }).extend({ nextRunAtMs: z.number() }).strict();
|
|
697
|
-
export { SCHEDULED_AUTOMATION_SYSTEM_ACTOR as A, eventAutomationSummarySchema as C, taskOutcomeInputSchema as D, automationTitleSchema as E,
|
|
726
|
+
export { SCHEDULED_AUTOMATION_SYSTEM_ACTOR as A, eventAutomationSummarySchema as C, taskOutcomeInputSchema as D, automationTitleSchema as E, scheduleIntentFromTool as F, toolScheduleIntentSchema as I, weekdaySchema as L, scheduledRunSchema as M, ScheduleIntentError as N, eventAutomationSchema as O, compileScheduleIntent as P, automationVersionSchema as S, automationInstructionToolSchema as T, automationSummarySchema as _, automationExecutionSchema as a, automationVersionListSchema as b, automationLifecycleSchema as c, automationParamsSchema as d, automationRunListSchema as f, automationSchedulePreviewSchema as g, automationScheduleIntentSchema as h, automationExecutionListSchema as i, scheduledAutomationSchema as j, eventAutomationTriggerSchema as k, automationListQuerySchema as l, automationRunWindowsSchema as m, automationEditSchema as n, automationExecutionStatusDaySchema as o, automationRunSchema as p, automationEventCatalogSchema as r, automationExecutionStatusSchema as s, automationEditErrorSchema as t, automationListSchema as u, automationUpdateSchema as v, scheduledAutomationSummarySchema as w, automationVersionParamsSchema as x, automationVersionActivateSchema as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { E as withSpan, m as logInfo, p as logException } from "./logging-
|
|
1
|
+
import { i as getChatConfig } from "./config-Cb--cuv-.js";
|
|
2
|
+
import { E as withSpan, m as logInfo, p as logException } from "./logging-B04X_eCB.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -381,4 +381,43 @@ async function sendWorkspaceSnapshotJob(message) {
|
|
|
381
381
|
async function sendNextWorkspaceSnapshotJob(message) {
|
|
382
382
|
await send(message);
|
|
383
383
|
}
|
|
384
|
-
|
|
384
|
+
// src/chat/services/background-compaction-queue.ts
|
|
385
|
+
/**
|
|
386
|
+
* Messages of background compaction jobs.
|
|
387
|
+
*
|
|
388
|
+
* A message names one `compaction_requested` event. The event log holds the
|
|
389
|
+
* request, and the State adapter holds the request snapshot, so the message
|
|
390
|
+
* stays small.
|
|
391
|
+
*/
|
|
392
|
+
/** Deploy topic name. Keep stable for Vercel queue wiring. */
|
|
393
|
+
const BACKGROUND_COMPACTION_QUEUE_TOPIC = "junior_context_compaction";
|
|
394
|
+
const backgroundCompactionSign = {
|
|
395
|
+
context: "junior.context_compaction_queue.v1",
|
|
396
|
+
schema: z.object({
|
|
397
|
+
conversationId: z.string().min(1),
|
|
398
|
+
historyVersion: z.number().int().nonnegative(),
|
|
399
|
+
markSeq: z.number().int().nonnegative()
|
|
400
|
+
}).strict(),
|
|
401
|
+
signatureVersion: "v1",
|
|
402
|
+
parts: (message) => [
|
|
403
|
+
message.conversationId,
|
|
404
|
+
String(message.historyVersion),
|
|
405
|
+
String(message.markSeq)
|
|
406
|
+
]
|
|
407
|
+
};
|
|
408
|
+
/** Stable id of one request, for event, snapshot, and delivery dedupe. */
|
|
409
|
+
function backgroundCompactionId(message) {
|
|
410
|
+
return `context-compaction_${createHash("sha256").update(message.conversationId).update("\0").update(String(message.historyVersion)).update("\0").update(String(message.markSeq)).digest("hex").slice(0, 32)}`;
|
|
411
|
+
}
|
|
412
|
+
/** Check that a recent queue message came from Junior. */
|
|
413
|
+
function verifyBackgroundCompactionMessage(value) {
|
|
414
|
+
return verifyQueueMessage(backgroundCompactionSign, value);
|
|
415
|
+
}
|
|
416
|
+
/** The production queue for background compaction jobs. */
|
|
417
|
+
const vercelBackgroundCompactionQueue = { send: async (message) => {
|
|
418
|
+
await getQueueProvider().send(BACKGROUND_COMPACTION_QUEUE_TOPIC, signQueueMessage(backgroundCompactionSign, message), {
|
|
419
|
+
idempotencyKey: backgroundCompactionId(message),
|
|
420
|
+
retentionSeconds: QUEUE_SIGNATURE_MAX_AGE_MS / 1e3
|
|
421
|
+
});
|
|
422
|
+
} };
|
|
423
|
+
export { runWithTurnRequestDeadline as _, WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC as a, isConversationQueueMessageRejectedError as b, verifyWorkspaceSnapshotJobMessage as c, verifyConversationQueueMessage as d, QUEUE_SIGNATURE_MAX_AGE_MS as f, getTurnRequestDeadline as g, getQueueProvider as h, verifyBackgroundCompactionMessage as i, getVercelConversationWorkQueue as l, verifyQueueMessage as m, backgroundCompactionId as n, sendNextWorkspaceSnapshotJob as o, signQueueMessage as p, vercelBackgroundCompactionQueue as r, sendWorkspaceSnapshotJob as s, BACKGROUND_COMPACTION_QUEUE_TOPIC as t, resolveConversationWorkQueueTopic as u, ConversationQueueMessageRejectedError as v, conversationQueueMessageSchema as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as completeObject } from "./client-
|
|
1
|
+
import { i as completeObject } from "./client-7diKvInp.js";
|
|
2
2
|
import { i as defaultModelId } from "./model-profile-B998sjVd.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
3
|
+
import { Z as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema, q as briefCodeChangeSchema } from "./conversation-DppJ83Hw.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-B4fQKGZR.js";
|
|
5
5
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -267,7 +267,7 @@ async function parseRunOptions(argv) {
|
|
|
267
267
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
268
268
|
*/
|
|
269
269
|
async function configuredDefaultModelId() {
|
|
270
|
-
const { botConfig } = await import("./config-
|
|
270
|
+
const { botConfig } = await import("./config-Cb--cuv-.js").then((n) => n.r);
|
|
271
271
|
return defaultModelId(botConfig);
|
|
272
272
|
}
|
|
273
273
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-CEqKR_ld.js";
|
|
3
3
|
// src/chat/plugins/catalog-runtime.ts
|
|
4
4
|
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
5
|
const pluginCatalogRuntime = createPluginCatalogRuntime();
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-
|
|
1
|
+
import { n as executeAgentRun, t as createAgentRunner } from "../agent-runner-sMpA5qGM.js";
|
|
2
2
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -99,10 +99,10 @@ async function loadLocalPluginSet() {
|
|
|
99
99
|
async function configureLocalChatPlugins(pluginSet) {
|
|
100
100
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
101
101
|
import("../plugins-DOm9Y6qI.js").then((n) => n.o),
|
|
102
|
-
import("../projection-
|
|
103
|
-
import("../catalog-runtime
|
|
104
|
-
import("../validation-
|
|
105
|
-
import("../viewer-
|
|
102
|
+
import("../projection-6dXaN0n-.js").then((n) => n.Mn),
|
|
103
|
+
import("../catalog-runtime--sC2CYLQ.js").then((n) => n.t),
|
|
104
|
+
import("../validation-BxF1nQbC.js").then((n) => n.r),
|
|
105
|
+
import("../viewer-CQwBszc7.js").then((n) => n.v)
|
|
106
106
|
]);
|
|
107
107
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
108
108
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -152,18 +152,18 @@ function localDevServerUrl() {
|
|
|
152
152
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
153
153
|
defaultStateAdapterForLocalChat();
|
|
154
154
|
await configureLocalChatPlugins(pluginSet);
|
|
155
|
-
const { setBriefsConfig } = await import("../projection-
|
|
155
|
+
const { setBriefsConfig } = await import("../projection-6dXaN0n-.js").then((n) => n.Wn);
|
|
156
156
|
setBriefsConfig({ enabled: true });
|
|
157
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
158
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
157
|
+
const { runLocalAgentTurn } = await import("../runner-CSKDr_19.js");
|
|
158
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-BGq0_vQI.js");
|
|
159
159
|
const { createLocalOAuthState } = await import("../oauth-relay-C6ZAyJgf.js").then((n) => n.t);
|
|
160
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
161
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
162
|
-
const { bindMessageAgent } = await import("../message-
|
|
163
|
-
const { createChildConversationWorker } = await import("../result-
|
|
164
|
-
const { skipInputBeforeConversationStop } = await import("../session-stop-
|
|
160
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-BxAT276e.js");
|
|
161
|
+
const { bindSpawnAgent } = await import("../spawn-DF_GUcd8.js").then((n) => n.n);
|
|
162
|
+
const { bindMessageAgent } = await import("../message-DQMFyyE-.js").then((n) => n.n);
|
|
163
|
+
const { createChildConversationWorker } = await import("../result-BgAW90IM.js").then((n) => n.i);
|
|
164
|
+
const { skipInputBeforeConversationStop } = await import("../session-stop-DK8LuPZW.js").then((n) => n.r);
|
|
165
165
|
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
166
|
-
const { processConversationWork } = await import("../worker-
|
|
166
|
+
const { processConversationWork } = await import("../worker-DhY9MnsH.js").then((n) => n.n);
|
|
167
167
|
let agentRunner;
|
|
168
168
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
169
169
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { A as JUNIOR_HEARTBEAT_ROUTE, F as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, O as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-B04X_eCB.js";
|
|
2
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-CEqKR_ld.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-Bc0D7BGy.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs/promises";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
package/dist/cli/main.js
CHANGED
|
@@ -25,13 +25,13 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runAdmin(argv) {
|
|
28
|
-
return await (await import("../admin-
|
|
28
|
+
return await (await import("../admin-BJTT-kXb.js")).runAdmin(argv);
|
|
29
29
|
}
|
|
30
30
|
async function runServiceAccount(argv) {
|
|
31
|
-
return await (await import("../service-account-
|
|
31
|
+
return await (await import("../service-account-CtOab1Xz.js")).runServiceAccount(argv);
|
|
32
32
|
}
|
|
33
33
|
async function runBriefs(argv) {
|
|
34
|
-
return await (await import("../briefs-
|
|
34
|
+
return await (await import("../briefs-IL7QnCCR.js")).runBriefs(argv);
|
|
35
35
|
}
|
|
36
36
|
function topLevelCommand(argv) {
|
|
37
37
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as getDb } from "../viewer-
|
|
3
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { Aa as createPluginLogger, Hn as validatePlugins, Vn as setPlugins } from "../projection-6dXaN0n-.js";
|
|
2
|
+
import { S as getDb } from "../viewer-CQwBszc7.js";
|
|
3
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime--sC2CYLQ.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BxF1nQbC.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-DOm9Y6qI.js";
|
|
6
6
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
7
7
|
import { stderr, stdout } from "node:process";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime
|
|
3
|
-
import { t as disconnectStateAdapter } from "../adapter-
|
|
4
|
-
import { n as resolve } from "../resolve-
|
|
1
|
+
import { kr as create } from "../projection-6dXaN0n-.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime--sC2CYLQ.js";
|
|
3
|
+
import { t as disconnectStateAdapter } from "../adapter-DoPR2jS-.js";
|
|
4
|
+
import { n as resolve } from "../resolve-8I5DkrfI.js";
|
|
5
5
|
// src/cli/snapshot-create.ts
|
|
6
6
|
const DEFAULT_RUNTIME = "node22";
|
|
7
7
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
package/dist/cli/upgrade.d.ts
CHANGED
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { i as getChatConfig } from "../config-Cb--cuv-.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-BFKmqxYe.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-CEqKR_ld.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-DOm9Y6qI.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-B04X_eCB.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-DTwdT3Pi.js";
|
|
3
3
|
import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
|
|
4
4
|
import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
|
|
5
5
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import { C as toOptionalTrimmed, c as resolveGatewayModel } from "./client-
|
|
3
|
-
import { h as logWarn } from "./logging-
|
|
2
|
+
import { C as toOptionalTrimmed, c as resolveGatewayModel } from "./client-7diKvInp.js";
|
|
3
|
+
import { h as logWarn } from "./logging-B04X_eCB.js";
|
|
4
4
|
import { c as modelProfileSchema, d as parseTurnReasoningLevel, t as DEFAULT_MODEL_PROFILES, u as TURN_REASONING_LEVELS } from "./model-profile-B998sjVd.js";
|
|
5
5
|
import { AwsClient } from "aws4fetch";
|
|
6
6
|
// src/chat/attachments/s3.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { $ as loadTurnCheckpoint,
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { C as getSqlExecutor, F as deleteProviderIdentityForSlackUser, I as deleteProviderIdentityForUser, y as getConversationEventStore } from "./viewer-
|
|
4
|
-
import { u as hasRequiredOAuthScope } from "./registry-
|
|
5
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime
|
|
6
|
-
import { c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-
|
|
7
|
-
import { r as getStateAdapter } from "./adapter-
|
|
8
|
-
import {
|
|
9
|
-
import { m as ensureConversationWake, w as requestConversationWork } from "./store-
|
|
10
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
1
|
+
import { $ as loadTurnCheckpoint, Br as startOAuthFlow, it as getTurnRecord, rt as failTurnRecord } from "./projection-6dXaN0n-.js";
|
|
2
|
+
import { n as botConfig } from "./config-Cb--cuv-.js";
|
|
3
|
+
import { C as getSqlExecutor, F as deleteProviderIdentityForSlackUser, I as deleteProviderIdentityForUser, y as getConversationEventStore } from "./viewer-CQwBszc7.js";
|
|
4
|
+
import { u as hasRequiredOAuthScope } from "./registry-CEqKR_ld.js";
|
|
5
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime--sC2CYLQ.js";
|
|
6
|
+
import { c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-sMpA5qGM.js";
|
|
7
|
+
import { r as getStateAdapter } from "./adapter-DoPR2jS-.js";
|
|
8
|
+
import { l as getVercelConversationWorkQueue } from "./background-compaction-queue-Bywqo1WJ.js";
|
|
9
|
+
import { m as ensureConversationWake, w as requestConversationWork } from "./store-BgH2P3X9.js";
|
|
10
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-DddybdNu.js";
|
|
11
11
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
// src/chat/task-execution/authorized-turn.ts
|
|
@@ -393,12 +393,12 @@ async function startConnection(provider, actor) {
|
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
395
|
/**
|
|
396
|
-
* Remove the
|
|
397
|
-
* identity that the connection linked to the viewer's
|
|
396
|
+
* Remove the viewer's stored connection for one provider and the provider
|
|
397
|
+
* identity that the connection linked to the viewer's User.
|
|
398
398
|
*/
|
|
399
|
-
async function disconnectConnection(userId, provider, userTokenStore
|
|
399
|
+
async function disconnectConnection(userId, provider, userTokenStore) {
|
|
400
400
|
const tokens = await userTokenStore.get(userId, provider);
|
|
401
|
-
if (tokens?.account) await deleteProviderIdentityForUser(getSqlExecutor(),
|
|
401
|
+
if (tokens?.account) await deleteProviderIdentityForUser(getSqlExecutor(), userId, provider, tokens.account.id);
|
|
402
402
|
await unlinkProvider(userId, provider, userTokenStore);
|
|
403
403
|
}
|
|
404
404
|
export { startConnection as a, deleteWebAuthorization as c, createPausedTurns as d, getPausedTurnRequest as f, getTurnAuthorization as h, readConnectedOAuthTokens as i, getWebAuthorization as l, wakePausedTurn as m, isConnectableProvider as n, unlinkProvider as o, wakeAuthorizedTurn as p, listConnections as r, createWebAuthorization as s, disconnectConnection as t, htmlCallbackResponse as u };
|
|
@@ -230,6 +230,21 @@ function annotationCard(annotation) {
|
|
|
230
230
|
title: value.label
|
|
231
231
|
};
|
|
232
232
|
}
|
|
233
|
+
// src/chat/review-items/change-record.ts
|
|
234
|
+
/**
|
|
235
|
+
* The person change to a Review item that one message records. Each inbound
|
|
236
|
+
* message and saved Message that reports a take, answer, or dismiss carries
|
|
237
|
+
* its own record, so the dashboard shows what that message did, not what the
|
|
238
|
+
* item looks like now.
|
|
239
|
+
*/
|
|
240
|
+
const reviewItemChangeRecordSchema = z.object({
|
|
241
|
+
kind: z.enum([
|
|
242
|
+
"submitted",
|
|
243
|
+
"dismissed",
|
|
244
|
+
"taken"
|
|
245
|
+
]),
|
|
246
|
+
reviewItemId: z.string().min(1)
|
|
247
|
+
}).strict();
|
|
233
248
|
// src/api/schema/conversation-read-position.ts
|
|
234
249
|
/**
|
|
235
250
|
* How far the signed-in viewer has read a Conversation transcript.
|
|
@@ -327,15 +342,17 @@ const conversationPendingMessageSchema = z.object({
|
|
|
327
342
|
/** People mentioned in the text, resolved at read time. */
|
|
328
343
|
mentions: z.array(actorIdentitySchema).optional(),
|
|
329
344
|
attachments: z.array(messageAttachmentSchema).optional(),
|
|
345
|
+
/** Review item change that this Message records. */
|
|
346
|
+
reviewItemChange: reviewItemChangeRecordSchema.optional(),
|
|
330
347
|
redacted: z.literal(true).optional()
|
|
331
348
|
}).strict().superRefine((data, context) => {
|
|
332
349
|
if (data.text === void 0 === (data.redacted !== true)) context.addIssue({
|
|
333
350
|
code: "custom",
|
|
334
351
|
message: "pending message content must be text or explicitly redacted"
|
|
335
352
|
});
|
|
336
|
-
if (data.redacted && (data.actorIdentity || data.attachments || data.mentions)) context.addIssue({
|
|
353
|
+
if (data.redacted && (data.actorIdentity || data.attachments || data.mentions || data.reviewItemChange)) context.addIssue({
|
|
337
354
|
code: "custom",
|
|
338
|
-
message: "redacted pending messages must not expose actor identity, attachments, or
|
|
355
|
+
message: "redacted pending messages must not expose actor identity, attachments, mentions, or a review item"
|
|
339
356
|
});
|
|
340
357
|
});
|
|
341
358
|
/** Participant-only authorization prompt for a parked web turn. */
|
|
@@ -481,9 +498,15 @@ const conversationReportMessageEventDataSchema = z.object({
|
|
|
481
498
|
eventObjectType: objectTypeSchema.optional(),
|
|
482
499
|
explicitMention: z.boolean().optional(),
|
|
483
500
|
trustedSummary: z.string().min(1).optional(),
|
|
484
|
-
/**
|
|
501
|
+
/**
|
|
502
|
+
* The Watch Events when several arrived together. A message that also
|
|
503
|
+
* records Review item changes lists its own Event here even when it has
|
|
504
|
+
* one.
|
|
505
|
+
*/
|
|
485
506
|
events: z.array(conversationReportMessageEventSchema).optional(),
|
|
486
507
|
cards: z.array(messageCardRefSchema).optional(),
|
|
508
|
+
/** Person changes to Review items that this message records. */
|
|
509
|
+
reviewItemChanges: z.array(reviewItemChangeRecordSchema).min(1).optional(),
|
|
487
510
|
text: z.string().optional(),
|
|
488
511
|
attachments: z.array(messageAttachmentSchema).optional(),
|
|
489
512
|
redacted: z.literal(true).optional()
|
|
@@ -492,9 +515,9 @@ const conversationReportMessageEventDataSchema = z.object({
|
|
|
492
515
|
code: "custom",
|
|
493
516
|
message: "message content must be text or explicitly redacted"
|
|
494
517
|
});
|
|
495
|
-
if (data.redacted && (data.actorIdentity || data.cards || data.attachments || data.events)) context.addIssue({
|
|
518
|
+
if (data.redacted && (data.actorIdentity || data.cards || data.attachments || data.events || data.reviewItemChanges)) context.addIssue({
|
|
496
519
|
code: "custom",
|
|
497
|
-
message: "redacted messages must not expose actor identity, cards, attachments, or
|
|
520
|
+
message: "redacted messages must not expose actor identity, cards, attachments, events, or review item changes"
|
|
498
521
|
});
|
|
499
522
|
});
|
|
500
523
|
const conversationReportMessageHandledEventDataSchema = z.object({
|
|
@@ -812,7 +835,9 @@ function validateConversationEvents(report, context) {
|
|
|
812
835
|
const forkConversationBodySchema = z.object({
|
|
813
836
|
/** Assistant reply that ends the copied history. */
|
|
814
837
|
messageId: z.string().min(1).max(500),
|
|
815
|
-
idempotencyKey: z.string().trim().min(1).max(200)
|
|
838
|
+
idempotencyKey: z.string().trim().min(1).max(200),
|
|
839
|
+
/** Start a hidden, read-only Quick question about this reply text. */
|
|
840
|
+
quickQuestion: z.object({ quote: z.string().trim().min(1).max(4e3) }).strict().optional()
|
|
816
841
|
}).strict();
|
|
817
842
|
const forkConversationResponseSchema = z.object({ conversationId: z.string() }).strict();
|
|
818
843
|
/** One Conversation in the agent tree of a child Conversation. */
|
|
@@ -866,4 +891,4 @@ const conversationFeedSchema = z.object({
|
|
|
866
891
|
source: z.literal("conversation_index"),
|
|
867
892
|
generatedAt: z.string()
|
|
868
893
|
}).strict();
|
|
869
|
-
export { createConversationMessageBodySchema as A,
|
|
894
|
+
export { createConversationMessageBodySchema as A, messageCardText as B, conversationReportEventSchema as C, conversationSurfaceSchema as D, conversationSummaryReportSchema as E, conversationChildAgentTotalsSchema as F, MAX_INPUT_IMAGE_BYTES as G, removedCardSchema as H, conversationReadPositionSchema as I, briefLinkSchema as J, readMessageAttachments as K, reviewItemChangeRecordSchema as L, forkConversationResponseSchema as M, steerConversationPendingMessagesBodySchema as N, conversationUsageSchema as O, steerConversationPendingMessagesResponseSchema as P, annotationCard as R, conversationReportEventDataSchema as S, conversationReportStatusSchema as T, resolveMessageCards as U, readMessageCardRefs as V, MAX_INPUT_IMAGES as W, conversationBriefSchema as X, briefOutcomeStatusSchema as Y, parseBriefInput as Z, conversationParamsSchema as _, cancelConversationPendingMessagesBodySchema as a, conversationPendingMessageSchema as b, conversationAttachmentParamsSchema as c, conversationDetailReportSchema as d, conversationEventHistorySchema as f, conversationFeedSchema as g, conversationFeedQuerySchema as h, archiveConversationResponseSchema as i, forkConversationBodySchema as j, createConversationBodySchema as k, conversationAuxiliaryCostsSchema as l, conversationEventsQuerySchema as m, actorIdentitySchema as n, cancelConversationPendingMessagesResponseSchema as o, conversationEventPageSchema as p, briefCodeChangeSchema as q, archiveConversationBodySchema as r, conversationActivityPreviewSchema as s, acceptedConversationMessageSchema as t, conversationDetailQuerySchema as u, conversationPendingAuthorizationSchema as v, conversationReportMessageEventSchema as w, conversationPendingMessagesReportSchema as x, conversationPendingMessageDeliverySchema as y, messageCardRef as z };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { m as escapeXml } from "./client-
|
|
3
|
-
import { a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
4
|
-
import { _ as runBestEffort, h as logWarn, p as logException
|
|
1
|
+
import { $r as postSlackMessage, Dn as createUserTokenStore, Lr as formatProviderLabel, Qi as getSlackClient, Rr as parseOAuthStatePayload, X as getConversationPendingAuth, f as recordAuthenticationLinked, it as getTurnRecord, jn as resolvePluginOAuthAccount, p as recordAuthorizationCompleted, zr as resolveBaseUrl } from "./projection-6dXaN0n-.js";
|
|
2
|
+
import { m as escapeXml } from "./client-7diKvInp.js";
|
|
3
|
+
import { a as getRuntimeMetadata, n as botConfig } from "./config-Cb--cuv-.js";
|
|
4
|
+
import { B as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-B04X_eCB.js";
|
|
5
5
|
import { p as parseSlackUserId } from "./actor-B4DYygOB.js";
|
|
6
|
-
import { C as getSqlExecutor, L as findUserByVerifiedEmails, N as resolveActorIdentityId, V as upsertLinkedIdentity, o as readIdentityById } from "./viewer-
|
|
6
|
+
import { C as getSqlExecutor, L as findUserByVerifiedEmails, N as resolveActorIdentityId, V as upsertLinkedIdentity, o as readIdentityById } from "./viewer-CQwBszc7.js";
|
|
7
7
|
import { i as homeDir } from "./package-discovery-DJBompdd.js";
|
|
8
|
-
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime
|
|
10
|
-
import { t as discoverSkills } from "./skills-
|
|
11
|
-
import { d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-
|
|
8
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-CEqKR_ld.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime--sC2CYLQ.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-Bc0D7BGy.js";
|
|
11
|
+
import { d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-sMpA5qGM.js";
|
|
12
12
|
import { r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
13
|
-
import { r as getStateAdapter } from "./adapter-
|
|
14
|
-
import { _ as getMcpProviderErrorAttributes } from "./service-account-
|
|
15
|
-
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
16
|
-
import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-
|
|
13
|
+
import { r as getStateAdapter } from "./adapter-DoPR2jS-.js";
|
|
14
|
+
import { _ as getMcpProviderErrorAttributes } from "./service-account-CUuVJCKT.js";
|
|
15
|
+
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BXjgk1pW.js";
|
|
16
|
+
import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-C4-4fxaE.js";
|
|
17
17
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-C6ZAyJgf.js";
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./config-
|
|
2
|
-
import { p as logException } from "./logging-
|
|
3
|
-
import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-
|
|
1
|
+
import "./config-Cb--cuv-.js";
|
|
2
|
+
import { p as logException } from "./logging-B04X_eCB.js";
|
|
3
|
+
import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-CUWrrzkc.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { sql } from "drizzle-orm";
|
|
6
6
|
import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
+
/** Browser SDK settings and the current request's trace, for an HTML page. */
|
|
2
|
+
export interface BrowserSentryConfig {
|
|
3
|
+
baggage?: string;
|
|
4
|
+
dsn: string;
|
|
5
|
+
environment?: string;
|
|
6
|
+
release?: string;
|
|
7
|
+
sentryTrace?: string;
|
|
8
|
+
tracesSampleRate: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Read the settings a served page needs to send browser spans to the same
|
|
12
|
+
* project, continuing the trace of the request that rendered it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getBrowserSentryConfig(): BrowserSentryConfig | undefined;
|
|
1
15
|
/** Initialize Sentry for the Junior runtime. Call at the top of your entry point. */
|
|
2
16
|
export declare function initSentry(): void;
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as getClient, c as init, i as getActiveSpan, o as getGlobalScope, p as spanToJSON } from "./sentry-MDkYAVPV.js";
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
1
|
+
import { I as getDeploymentServiceVersion, L as getDeploymentTelemetryAttributes } from "./logging-B04X_eCB.js";
|
|
2
|
+
import { a as getClient, c as init, i as getActiveSpan, o as getGlobalScope, p as spanToJSON, s as getTraceData } from "./sentry-MDkYAVPV.js";
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-DTwdT3Pi.js";
|
|
4
4
|
import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
|
|
5
5
|
import { performance } from "node:perf_hooks";
|
|
6
6
|
import { subscribe, unsubscribe } from "node:diagnostics_channel";
|
|
@@ -262,6 +262,29 @@ function getBoolean(value, fallback) {
|
|
|
262
262
|
].includes(normalized)) return false;
|
|
263
263
|
return fallback;
|
|
264
264
|
}
|
|
265
|
+
function getEnvironment() {
|
|
266
|
+
return process.env.SENTRY_ENVIRONMENT ?? process.env.VERCEL_ENV ?? process.env.NODE_ENV;
|
|
267
|
+
}
|
|
268
|
+
function getTracesSampleRate() {
|
|
269
|
+
return getSampleRate(process.env.SENTRY_TRACES_SAMPLE_RATE, 1);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Read the settings a served page needs to send browser spans to the same
|
|
273
|
+
* project, continuing the trace of the request that rendered it.
|
|
274
|
+
*/
|
|
275
|
+
function getBrowserSentryConfig() {
|
|
276
|
+
const dsn = process.env.SENTRY_DSN?.trim();
|
|
277
|
+
if (!dsn) return void 0;
|
|
278
|
+
const trace = getTraceData();
|
|
279
|
+
return {
|
|
280
|
+
baggage: trace.baggage,
|
|
281
|
+
dsn,
|
|
282
|
+
environment: getEnvironment(),
|
|
283
|
+
release: getDeploymentServiceVersion(),
|
|
284
|
+
sentryTrace: trace["sentry-trace"],
|
|
285
|
+
tracesSampleRate: getTracesSampleRate()
|
|
286
|
+
};
|
|
287
|
+
}
|
|
265
288
|
/** Initialize Sentry for the Junior runtime. Call at the top of your entry point. */
|
|
266
289
|
function initSentry() {
|
|
267
290
|
if (getClient()) return;
|
|
@@ -271,9 +294,9 @@ function initSentry() {
|
|
|
271
294
|
const deploymentSpanAttributes = getDeploymentTelemetryAttributes();
|
|
272
295
|
init({
|
|
273
296
|
dsn,
|
|
274
|
-
environment:
|
|
297
|
+
environment: getEnvironment(),
|
|
275
298
|
release: serviceVersion,
|
|
276
|
-
tracesSampleRate:
|
|
299
|
+
tracesSampleRate: getTracesSampleRate(),
|
|
277
300
|
ignoreSpans: [{
|
|
278
301
|
op: "http.server",
|
|
279
302
|
attributes: { "url.path": "/_vercel/ping" }
|
|
@@ -290,4 +313,4 @@ function initSentry() {
|
|
|
290
313
|
getGlobalScope().setAttributes(deploymentSpanAttributes);
|
|
291
314
|
subscribeGatewayRequestTiming();
|
|
292
315
|
}
|
|
293
|
-
export { initSentry };
|
|
316
|
+
export { getBrowserSentryConfig, initSentry };
|