@sentry/junior 0.267.0 → 0.269.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/README.md +2 -9
- package/dist/{actor-DZSokpwj.js → actor-CP9K2Idu.js} +2 -1
- package/dist/{adapter-BybMEezj.js → adapter-2-CG25be.js} +3 -51
- package/dist/{admin-DOs1_EiW.js → admin-DSs8S5Uy.js} +1 -1
- package/dist/{agent-invocations-CxKldAeB.js → agent-invocations-C1RNOCs8.js} +2 -0
- package/dist/{agent-runner-DgNATN4D.js → agent-runner-CrDrPUtY.js} +3411 -1640
- package/dist/api/schema.d.ts +2 -5630
- package/dist/api/schema.js +7 -7
- package/dist/api.d.ts +3 -1
- package/dist/api.js +268 -287
- package/dist/{app-DAB3fzyp.d.ts → app-BrMMzjYm.d.ts} +10 -3
- package/dist/app.d.ts +1 -1
- package/dist/app.js +371 -223
- package/dist/{automation-CmeFBSEh.js → automation-p87hg_AV.js} +74 -74
- package/dist/{briefs-CWKjka7v.js → briefs-PtODdLNu.js} +4 -4
- package/dist/{catalog-runtime-cMlAI5LY.js → catalog-runtime-BsoSmTM0.js} +1 -1
- package/dist/cli/chat.js +16 -26
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +5 -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-BjgbMawj.js → client-Cqf4TboL.js} +20 -15
- package/dist/{config-CdB6yJj5.js → config-CPsE4T5L.js} +2 -2
- package/dist/{connections-RE_65jzK.js → connections-upFXLmhG.js} +10 -11
- package/dist/{conversation-DSo310Ps.js → conversation-CTpD_PGk.js} +7 -84
- package/dist/{conversation-privacy-BzgJC5k0.js → conversation-privacy-D6zJc8ff.js} +1 -1
- package/dist/{credential-sync-DhEGEpgq.js → credential-sync-CS_6IC-f.js} +30 -34
- package/dist/{credentialed-CIGwoLU2.js → credentialed-BU-OW7HP.js} +577 -74
- package/dist/{store-B8CABbmR.d.ts → db-BzOCzVb1.d.ts} +17 -7
- package/dist/{executor-VYrx_K4w.js → executor-CNS7ONt-.js} +78 -4
- package/dist/instrumentation.js +2 -2
- package/dist/{assistant-reply-CT7VcXQe.js → interruption-marker-g6Xup3Fk.js} +8 -2
- package/dist/{job-queue-C0BZSa7r.js → job-queue-DI-k-Bbk.js} +2 -2
- package/dist/{list-1XQP-o6K.js → list-CGoQdXTp.js} +429 -1401
- package/dist/locks-D-0h111u.js +48 -0
- package/dist/{logging-DuZ1A4ab.js → logging-n7knse-O.js} +1 -1
- package/dist/{history-C84mlAwO.js → media-85PDJxO_.js} +83 -1
- package/dist/{message-NKSbbnA6.js → message-BpaWd8TT.js} +4 -4
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-qAHLPtml.js → oauth-callback-server-CpGmEw_i.js} +2 -2
- package/dist/{prompt-BW9jFsqZ.js → prompt-BlQB0QQt.js} +1 -1
- package/dist/{registry-FQutO926.js → registry-By36_xsm.js} +2 -2
- package/dist/reporting-schema-CZREhYc-.js +104 -0
- package/dist/reporting-window-CVarfId9.js +255 -0
- package/dist/{resolve-Bk4yeuHy.js → resolve-CUIBcdPd.js} +3 -3
- package/dist/{result-B9e9ATOU.js → result-BemsOMOO.js} +31 -12
- package/dist/{runner-C3S2ObH-.js → runner-BVok7PAA.js} +12 -11
- package/dist/{sandbox-egress-signals-DqpGzzMB.js → sandbox-egress-signals-BSUWQI95.js} +1 -1
- package/dist/{schema-X7Fj4fv1.js → schema-ChnFo5f2.js} +98 -6
- package/dist/schema-jK4-1u_H.d.ts +5927 -0
- package/dist/{service-account-Do30HUNv.js → service-account-DHvlLnZw.js} +4 -3
- package/dist/{service-account-BQasl-qq.js → service-account-hMmESDcr.js} +3 -3
- package/dist/{session-stop-DkOjt46_.js → session-stop-BQW_iFcd.js} +499 -23
- package/dist/{skills-CQHrwfOa.js → skills-DmJJIuLF.js} +2 -2
- package/dist/{spawn-BHuqN14f.js → spawn-ChCm46i-.js} +2 -2
- package/dist/{store-6EetVP-m.js → store-1DVhoKOL.js} +4 -4
- package/dist/{store-DvNZIsCr.js → store-DCo2n5iJ.js} +3 -3
- package/dist/{task-queue-B0DLgd2P.js → task-queue-HMC4QjFm.js} +3 -3
- package/dist/task-runner-cA6yjn_E.js +269 -0
- package/dist/{thread-state-DRmdJ2QN.js → thread-state-CHy8LS0C.js} +8 -18
- package/dist/{turn-failure-response-G11cs2gE.js → turn-failure-response-Dr7erLWs.js} +11 -16
- package/dist/{turn-lifecycle-OzLIwvi1.js → turn-lifecycle-bf2fIYi_.js} +1 -1
- package/dist/{tasks-0ilmuCux.js → turn-session-routing-BqO0qXLk.js} +959 -44
- package/dist/{validation-CxEmt1id.js → validation-DHR1ivfh.js} +1 -1
- package/dist/{version-Bapedn4A.js → version-CXCHLgWm.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-DrN3oC2X.js → viewer-DSbD6DF6.js} +503 -241
- package/dist/{work-DUQoNcqP.js → work-BE_qTYGi.js} +17 -36
- package/dist/{worker-D1l4Ugk0.js → worker-Cm9_sWXg.js} +15 -7
- package/migrations/0065_user_customization.sql +1 -0
- package/migrations/0066_review_items.sql +53 -0
- package/migrations/0067_review_item_dedupe_tenant.sql +2 -0
- package/migrations/0068_review_item_slack_cards.sql +10 -0
- package/migrations/0069_system_identity.sql +25 -0
- package/migrations/0070_review_item_foreign_keys.sql +5 -0
- package/migrations/AGENTS.md +17 -0
- package/migrations/meta/0065_snapshot.json +3511 -0
- package/migrations/meta/0066_snapshot.json +4099 -0
- package/migrations/meta/0067_snapshot.json +3921 -0
- package/migrations/meta/0068_snapshot.json +4176 -0
- package/migrations/meta/0069_snapshot.json +3979 -0
- package/migrations/meta/0070_snapshot.json +3997 -0
- package/migrations/meta/_journal.json +42 -0
- package/package.json +5 -5
- package/dist/db-Bg-zC3r5.d.ts +0 -5
- package/dist/history-BgI33Kie.d.ts +0 -78
- package/dist/images-CecjXAAz.js +0 -64
- package/dist/task-runner-B-PD_JOj.js +0 -1074
- package/dist/turn-session-routing-Dyut9l7Y.js +0 -76
- package/dist/user-input-request-BDFBdF8r.js +0 -116
- package/dist/web-message-id-CJSUiksE.js +0 -236
- package/migrations/README.md +0 -30
|
@@ -1,14 +1,7 @@
|
|
|
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-CTpD_PGk.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
|
-
// src/chat/task-outcomes-schema.ts
|
|
6
|
-
const taskMessageDestinationInputSchema = z.enum(["current_conversation", "task_creator"]).describe("Where to send the message. Use current_conversation for posts, digests, summaries, and channel reminders. Use task_creator only when the user asks for a direct reminder or notification.");
|
|
7
|
-
/** Input accepted by task authoring tools before a user becomes a DM Destination. */
|
|
8
|
-
const taskOutcomeInputSchema = z.object({
|
|
9
|
-
action: z.literal("send_message"),
|
|
10
|
-
destination: taskMessageDestinationInputSchema
|
|
11
|
-
}).strict();
|
|
12
5
|
// src/chat/scheduled-automations/schedule-intent.ts
|
|
13
6
|
/**
|
|
14
7
|
* Owns model-facing schedule intent and materializes it against the trusted
|
|
@@ -211,70 +204,6 @@ function compileScheduleIntent(args) {
|
|
|
211
204
|
}
|
|
212
205
|
};
|
|
213
206
|
}
|
|
214
|
-
/** Validate the persisted Slack creator identity for an event automation. */
|
|
215
|
-
const eventAutomationPrincipalSchema = z.object({
|
|
216
|
-
slackUserId: actorUserIdSchema,
|
|
217
|
-
fullName: z.string().optional(),
|
|
218
|
-
userName: z.string().optional()
|
|
219
|
-
}).strict();
|
|
220
|
-
/**
|
|
221
|
-
* Validate one persisted event-automation selector and its presentation
|
|
222
|
-
* metadata. A trigger names one resource with a resource type and an
|
|
223
|
-
* identifier, or it names neither. With neither, it runs for every resource
|
|
224
|
-
* of the namespace that its filters match.
|
|
225
|
-
*/
|
|
226
|
-
const eventAutomationTriggerSchema = z.object({
|
|
227
|
-
events: z.array(eventTypeSchema).min(1),
|
|
228
|
-
label: z.string().min(1),
|
|
229
|
-
match: eventMatchSchema.optional(),
|
|
230
|
-
namespace: z.string().min(1),
|
|
231
|
-
identifier: z.string().min(1).max(300).optional(),
|
|
232
|
-
resourceType: z.string().min(1).optional()
|
|
233
|
-
}).strict().refine((trigger) => trigger.identifier === void 0 === (trigger.resourceType === void 0), {
|
|
234
|
-
message: "Set both a resource type and an identifier, or leave out both to run for every resource.",
|
|
235
|
-
path: ["identifier"]
|
|
236
|
-
});
|
|
237
|
-
/** Event automations target a Slack channel or DM, never a message thread. */
|
|
238
|
-
const eventAutomationDestinationSchema = slackDestinationSchema.omit({ threadTs: true });
|
|
239
|
-
const eventAutomationOutcomeSchema = taskOutcomeSchema.extend({ destination: eventAutomationDestinationSchema });
|
|
240
|
-
/** Validate one persisted event automation. */
|
|
241
|
-
const eventAutomationSchema = z.object({
|
|
242
|
-
id: z.string().min(1),
|
|
243
|
-
createdAtMs: z.number().finite(),
|
|
244
|
-
createdBy: eventAutomationPrincipalSchema,
|
|
245
|
-
/** Junior identity that created the automation. It decides ownership. */
|
|
246
|
-
creatorIdentityId: z.string().min(1),
|
|
247
|
-
credentialMode: z.enum(["system", "creator"]),
|
|
248
|
-
destination: eventAutomationDestinationSchema,
|
|
249
|
-
destinationVisibility: destinationVisibilitySchema,
|
|
250
|
-
/** Explicit visible effects after successful work. An empty list is silent. */
|
|
251
|
-
outcomes: z.array(eventAutomationOutcomeSchema).max(5),
|
|
252
|
-
task: z.object({ text: z.string().min(1) }).strict(),
|
|
253
|
-
trigger: eventAutomationTriggerSchema
|
|
254
|
-
}).strict();
|
|
255
|
-
// src/chat/automations/edit-schema.ts
|
|
256
|
-
const automationTitleSchema = z.string().trim().min(1).max(60);
|
|
257
|
-
const automationInstructionSchema = z.string().trim().min(1).max(4e3);
|
|
258
|
-
/**
|
|
259
|
-
* Instruction input for agent tools. The run does not see the request, so the
|
|
260
|
-
* instruction names exact targets. It calls the creator "the Automation
|
|
261
|
-
* creator". It names every other person with their mention.
|
|
262
|
-
*/
|
|
263
|
-
const automationInstructionToolSchema = automationInstructionSchema.describe("Work to perform when the Automation runs. The run does not see this conversation, so words like \"this channel\" or \"here\" will mean nothing then. Write the exact target instead, such as a channel mention or a link. Call the person who created the Automation \"the Automation creator\", not \"me\"; each run knows who that is. Name every other person with their Slack mention, such as <@U123>, including a requester who did not create the Automation. Preserve the user's scope, targets, and constraints. Do not add permissions or side effects the user did not request.");
|
|
264
|
-
const automationEditFieldsSchema = z.object({
|
|
265
|
-
title: automationTitleSchema.optional(),
|
|
266
|
-
instruction: automationInstructionSchema.optional(),
|
|
267
|
-
credentialMode: z.enum(["system", "creator"]).optional(),
|
|
268
|
-
outcomes: z.array(z.union([taskOutcomeInputSchema, taskOutcomeSchema])).max(5).optional()
|
|
269
|
-
});
|
|
270
|
-
const scheduledAutomationEditSchema = automationEditFieldsSchema.extend({
|
|
271
|
-
schedule: scheduleIntentSchema.optional(),
|
|
272
|
-
status: z.enum(["active", "blocked"]).optional()
|
|
273
|
-
}).strict();
|
|
274
|
-
const eventAutomationEditSchema = automationEditFieldsSchema.extend({ trigger: eventAutomationTriggerSchema.safeExtend({
|
|
275
|
-
identifier: z.string().trim().min(1).max(300).optional(),
|
|
276
|
-
label: z.string().trim().min(1).max(500)
|
|
277
|
-
}).optional() }).strict();
|
|
278
207
|
// src/chat/scheduled-automations/types.ts
|
|
279
208
|
/** Durable scheduled-automation domain types owned by Junior core. */
|
|
280
209
|
const scheduledAutomationStatusSchema = z.enum([
|
|
@@ -382,6 +311,77 @@ const SCHEDULED_AUTOMATION_SYSTEM_ACTOR = Object.freeze({
|
|
|
382
311
|
platform: "system",
|
|
383
312
|
name: "scheduled-automation"
|
|
384
313
|
});
|
|
314
|
+
/** Validate the persisted Slack creator identity for an event automation. */
|
|
315
|
+
const eventAutomationPrincipalSchema = z.object({
|
|
316
|
+
slackUserId: actorUserIdSchema,
|
|
317
|
+
fullName: z.string().optional(),
|
|
318
|
+
userName: z.string().optional()
|
|
319
|
+
}).strict();
|
|
320
|
+
/**
|
|
321
|
+
* Validate one persisted event-automation selector and its presentation
|
|
322
|
+
* metadata. A trigger names one resource with a resource type and an
|
|
323
|
+
* identifier, or it names neither. With neither, it runs for every resource
|
|
324
|
+
* of the namespace that its filters match.
|
|
325
|
+
*/
|
|
326
|
+
const eventAutomationTriggerSchema = z.object({
|
|
327
|
+
events: z.array(eventTypeSchema).min(1),
|
|
328
|
+
label: z.string().min(1),
|
|
329
|
+
match: eventMatchSchema.optional(),
|
|
330
|
+
namespace: z.string().min(1),
|
|
331
|
+
identifier: z.string().min(1).max(300).optional(),
|
|
332
|
+
resourceType: z.string().min(1).optional()
|
|
333
|
+
}).strict().refine((trigger) => trigger.identifier === void 0 === (trigger.resourceType === void 0), {
|
|
334
|
+
message: "Set both a resource type and an identifier, or leave out both to run for every resource.",
|
|
335
|
+
path: ["identifier"]
|
|
336
|
+
});
|
|
337
|
+
/** Event automations target a Slack channel or DM, never a message thread. */
|
|
338
|
+
const eventAutomationDestinationSchema = slackDestinationSchema.omit({ threadTs: true });
|
|
339
|
+
const eventAutomationOutcomeSchema = taskOutcomeSchema.extend({ destination: eventAutomationDestinationSchema });
|
|
340
|
+
/** Validate one persisted event automation. */
|
|
341
|
+
const eventAutomationSchema = z.object({
|
|
342
|
+
id: z.string().min(1),
|
|
343
|
+
createdAtMs: z.number().finite(),
|
|
344
|
+
createdBy: eventAutomationPrincipalSchema,
|
|
345
|
+
/** Junior identity that created the automation. It decides ownership. */
|
|
346
|
+
creatorIdentityId: z.string().min(1),
|
|
347
|
+
credentialMode: z.enum(["system", "creator"]),
|
|
348
|
+
destination: eventAutomationDestinationSchema,
|
|
349
|
+
destinationVisibility: destinationVisibilitySchema,
|
|
350
|
+
/** Explicit visible effects after successful work. An empty list is silent. */
|
|
351
|
+
outcomes: z.array(eventAutomationOutcomeSchema).max(5),
|
|
352
|
+
task: z.object({ text: z.string().min(1) }).strict(),
|
|
353
|
+
trigger: eventAutomationTriggerSchema
|
|
354
|
+
}).strict();
|
|
355
|
+
// src/chat/task-outcomes-schema.ts
|
|
356
|
+
const taskMessageDestinationInputSchema = z.enum(["current_conversation", "task_creator"]).describe("Where to send the message. Use current_conversation for posts, digests, summaries, and channel reminders. Use task_creator only when the user asks for a direct reminder or notification.");
|
|
357
|
+
/** Input accepted by task authoring tools before a user becomes a DM Destination. */
|
|
358
|
+
const taskOutcomeInputSchema = z.object({
|
|
359
|
+
action: z.literal("send_message"),
|
|
360
|
+
destination: taskMessageDestinationInputSchema
|
|
361
|
+
}).strict();
|
|
362
|
+
// src/chat/automations/edit-schema.ts
|
|
363
|
+
const automationTitleSchema = z.string().trim().min(1).max(60);
|
|
364
|
+
const automationInstructionSchema = z.string().trim().min(1).max(4e3);
|
|
365
|
+
/**
|
|
366
|
+
* Instruction input for agent tools. The run does not see the request, so the
|
|
367
|
+
* instruction names exact targets. It calls the creator "the Automation
|
|
368
|
+
* creator". It names every other person with their mention.
|
|
369
|
+
*/
|
|
370
|
+
const automationInstructionToolSchema = automationInstructionSchema.describe("Work to perform when the Automation runs. The run does not see this conversation, so words like \"this channel\" or \"here\" will mean nothing then. Write the exact target instead, such as a channel mention or a link. Call the person who created the Automation \"the Automation creator\", not \"me\"; each run knows who that is. Name every other person with their Slack mention, such as <@U123>, including a requester who did not create the Automation. Preserve the user's scope, targets, and constraints. Do not add permissions or side effects the user did not request.");
|
|
371
|
+
const automationEditFieldsSchema = z.object({
|
|
372
|
+
title: automationTitleSchema.optional(),
|
|
373
|
+
instruction: automationInstructionSchema.optional(),
|
|
374
|
+
credentialMode: z.enum(["system", "creator"]).optional(),
|
|
375
|
+
outcomes: z.array(z.union([taskOutcomeInputSchema, taskOutcomeSchema])).max(5).optional()
|
|
376
|
+
});
|
|
377
|
+
const scheduledAutomationEditSchema = automationEditFieldsSchema.extend({
|
|
378
|
+
schedule: scheduleIntentSchema.optional(),
|
|
379
|
+
status: z.enum(["active", "blocked"]).optional()
|
|
380
|
+
}).strict();
|
|
381
|
+
const eventAutomationEditSchema = automationEditFieldsSchema.extend({ trigger: eventAutomationTriggerSchema.safeExtend({
|
|
382
|
+
identifier: z.string().trim().min(1).max(300).optional(),
|
|
383
|
+
label: z.string().trim().min(1).max(500)
|
|
384
|
+
}).optional() }).strict();
|
|
385
385
|
// src/api/schema/automation.ts
|
|
386
386
|
const automationDestinationSchema = z.object({
|
|
387
387
|
channelId: z.string().min(1),
|
|
@@ -408,7 +408,7 @@ const automationSummaryBaseSchema = z.object({
|
|
|
408
408
|
credentialMode: z.enum(["creator", "system"]),
|
|
409
409
|
createdAt: z.string().datetime(),
|
|
410
410
|
createdBy: z.string().min(1),
|
|
411
|
-
createdByAvatarUrl: z.string().
|
|
411
|
+
createdByAvatarUrl: z.string().optional(),
|
|
412
412
|
createdByEmail: z.string().trim().email().optional(),
|
|
413
413
|
destination: automationDestinationSchema,
|
|
414
414
|
id: z.string().min(1),
|
|
@@ -694,4 +694,4 @@ const automationEventCatalogSchema = z.array(z.object({
|
|
|
694
694
|
}).strict());
|
|
695
695
|
const automationScheduleIntentSchema = scheduleIntentSchema;
|
|
696
696
|
const automationSchedulePreviewSchema = scheduledAutomationSchema.pick({ schedule: true }).extend({ nextRunAtMs: z.number() }).strict();
|
|
697
|
-
export {
|
|
697
|
+
export { SCHEDULED_AUTOMATION_SYSTEM_ACTOR as A, eventAutomationSummarySchema as C, taskOutcomeInputSchema as D, automationTitleSchema as E, scheduleIntentSchema as F, weekdaySchema as I, 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,7 +1,7 @@
|
|
|
1
|
-
import { i as completeObject } from "./client-
|
|
1
|
+
import { i as completeObject } from "./client-Cqf4TboL.js";
|
|
2
2
|
import { r as defaultModelId } from "./model-profile-Bg8EoCKD.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
3
|
+
import { G as briefCodeChangeSchema, Y as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-CTpD_PGk.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-BlQB0QQt.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-CPsE4T5L.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-By36_xsm.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-CrDrPUtY.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("../credentialed-
|
|
103
|
-
import("../catalog-runtime-
|
|
104
|
-
import("../validation-
|
|
105
|
-
import("../viewer-
|
|
102
|
+
import("../credentialed-BU-OW7HP.js").then((n) => n.a),
|
|
103
|
+
import("../catalog-runtime-BsoSmTM0.js").then((n) => n.t),
|
|
104
|
+
import("../validation-DHR1ivfh.js").then((n) => n.r),
|
|
105
|
+
import("../viewer-DSbD6DF6.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,35 +152,25 @@ function localDevServerUrl() {
|
|
|
152
152
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
153
153
|
defaultStateAdapterForLocalChat();
|
|
154
154
|
await configureLocalChatPlugins(pluginSet);
|
|
155
|
-
const { setBriefsConfig } = await import("../credentialed-
|
|
155
|
+
const { setBriefsConfig } = await import("../credentialed-BU-OW7HP.js").then((n) => n._);
|
|
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-BVok7PAA.js");
|
|
158
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-CpGmEw_i.js");
|
|
159
159
|
const { createLocalOAuthState } = await import("../oauth-relay-CTygMkNx.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 {
|
|
164
|
-
const {
|
|
165
|
-
const { skipInputBeforeConversationStop } = await import("../session-stop-DkOjt46_.js").then((n) => n.r);
|
|
160
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-BSUWQI95.js");
|
|
161
|
+
const { bindSpawnAgent } = await import("../spawn-ChCm46i-.js").then((n) => n.n);
|
|
162
|
+
const { bindMessageAgent } = await import("../message-BpaWd8TT.js").then((n) => n.n);
|
|
163
|
+
const { createChildConversationWorker } = await import("../result-BemsOMOO.js").then((n) => n.i);
|
|
164
|
+
const { skipInputBeforeConversationStop } = await import("../session-stop-BQW_iFcd.js").then((n) => n.r);
|
|
166
165
|
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
167
|
-
const { processConversationWork } = await import("../worker-
|
|
166
|
+
const { processConversationWork } = await import("../worker-Cm9_sWXg.js").then((n) => n.n);
|
|
168
167
|
let agentRunner;
|
|
169
168
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
170
169
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
|
171
|
-
const
|
|
172
|
-
fallbackWorker: async (context) => {
|
|
173
|
-
const skipped = await skipInputBeforeConversationStop(context);
|
|
174
|
-
if (skipped) return skipped;
|
|
175
|
-
const started = await startAgentInvocationsForChildInput(context, { queue: localConversationWork.queue });
|
|
176
|
-
if (!started) throw new Error("Local child queue received non-invocation work");
|
|
177
|
-
return started;
|
|
178
|
-
},
|
|
179
|
-
invocationWorker: createAgentInvocationWorker(agentRunner)
|
|
180
|
-
});
|
|
170
|
+
const childWorker = createChildConversationWorker(agentRunner, { queue: localConversationWork.queue });
|
|
181
171
|
await processConversationWork(message, {
|
|
182
172
|
queue: localConversationWork.queue,
|
|
183
|
-
run
|
|
173
|
+
run: async (context) => await skipInputBeforeConversationStop(context) ?? await childWorker(context)
|
|
184
174
|
});
|
|
185
175
|
});
|
|
186
176
|
agentRunner = createAgentRunner(executeAgentRun, {
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, P as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, k as JUNIOR_HEARTBEAT_ROUTE } from "../logging-
|
|
2
|
-
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { D as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, P as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, k as JUNIOR_HEARTBEAT_ROUTE } from "../logging-n7knse-O.js";
|
|
2
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-By36_xsm.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-DmJJIuLF.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,19 +25,21 @@ 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-DSs8S5Uy.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-hMmESDcr.js")).runServiceAccount(argv);
|
|
32
32
|
}
|
|
33
33
|
async function runBriefs(argv) {
|
|
34
|
-
return await (await import("../briefs-
|
|
34
|
+
return await (await import("../briefs-PtODdLNu.js")).runBriefs(argv);
|
|
35
35
|
}
|
|
36
36
|
function topLevelCommand(argv) {
|
|
37
37
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
|
38
38
|
}
|
|
39
39
|
/** Run the packaged CLI entrypoint with plugin command bootstrap enabled. */
|
|
40
40
|
async function runMain(argv, options = {}) {
|
|
41
|
+
console.info = console.error;
|
|
42
|
+
console.debug = console.error;
|
|
41
43
|
loadCliEnvFiles();
|
|
42
44
|
const instrument = options.instrument ?? true;
|
|
43
45
|
if (instrument) await initSentry();
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import {
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { S as getDb } from "../viewer-DSbD6DF6.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-BsoSmTM0.js";
|
|
3
|
+
import { ar as createPluginLogger, h as validatePlugins, m as setPlugins } from "../credentialed-BU-OW7HP.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-DHR1ivfh.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 { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { t as disconnectStateAdapter } from "../adapter-
|
|
4
|
-
import { n as resolve } from "../resolve-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-BsoSmTM0.js";
|
|
2
|
+
import { nt as create } from "../credentialed-BU-OW7HP.js";
|
|
3
|
+
import { t as disconnectStateAdapter } from "../adapter-2-CG25be.js";
|
|
4
|
+
import { n as resolve } from "../resolve-CUIBcdPd.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-CPsE4T5L.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-CNS7ONt-.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-By36_xsm.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-n7knse-O.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-D6zJc8ff.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";
|
|
@@ -23,14 +23,15 @@ function toOptionalTrimmed(value) {
|
|
|
23
23
|
* project. Fall back to AI_GATEWAY_API_KEY for local/CI and non-Vercel hosts.
|
|
24
24
|
* Never cache resolved tokens: runtime OIDC rotates on each invocation.
|
|
25
25
|
*/
|
|
26
|
-
const
|
|
26
|
+
const UNAUTHENTICATED_GATEWAY_TOKEN = "unauthenticated";
|
|
27
27
|
/**
|
|
28
|
-
* Resolve the
|
|
28
|
+
* Resolve the AI Gateway bearer credential.
|
|
29
29
|
*
|
|
30
30
|
* Order:
|
|
31
31
|
* 1. Vercel OIDC via `@vercel/oidc` (request header `x-vercel-oidc-token`,
|
|
32
32
|
* then `VERCEL_OIDC_TOKEN`, with local refresh when needed)
|
|
33
33
|
* 2. Explicit `AI_GATEWAY_API_KEY` / pi-ai env mapping for vercel-ai-gateway
|
|
34
|
+
* 3. A placeholder token (`mode: "none"`), so auth fails on the server side
|
|
34
35
|
*/
|
|
35
36
|
async function resolveGatewayCredential() {
|
|
36
37
|
try {
|
|
@@ -45,10 +46,14 @@ async function resolveGatewayCredential() {
|
|
|
45
46
|
mode: "api_key",
|
|
46
47
|
token: apiKey
|
|
47
48
|
};
|
|
49
|
+
return {
|
|
50
|
+
mode: "none",
|
|
51
|
+
token: UNAUTHENTICATED_GATEWAY_TOKEN
|
|
52
|
+
};
|
|
48
53
|
}
|
|
49
54
|
/** Resolve the bearer token string for Authorization headers and Pi getApiKey. */
|
|
50
55
|
async function getGatewayApiKey() {
|
|
51
|
-
return (await resolveGatewayCredential())
|
|
56
|
+
return (await resolveGatewayCredential()).token;
|
|
52
57
|
}
|
|
53
58
|
// src/chat/services/provider-error.ts
|
|
54
59
|
/** Structured failure produced at an AI provider boundary. */
|
|
@@ -437,8 +442,8 @@ function resolveGatewayModel(modelId) {
|
|
|
437
442
|
async function completeText(params) {
|
|
438
443
|
const model = resolveGatewayModel(params.modelId);
|
|
439
444
|
const credential = await resolveGatewayCredential();
|
|
440
|
-
const apiKey = credential
|
|
441
|
-
const authMode = credential
|
|
445
|
+
const apiKey = credential.token;
|
|
446
|
+
const authMode = credential.mode;
|
|
442
447
|
const effectivePrivacy = getCurrentConversationPrivacy() ?? "private";
|
|
443
448
|
const messageAttributeMode = params.messageAttributeMode ?? (effectivePrivacy === "public" ? "content" : "metadata");
|
|
444
449
|
const requestMessagesAttribute = messageAttributeMode === "content" ? serializeGenAiAttribute(params.messages.map(toCanonicalInputMessage)) : void 0;
|
|
@@ -475,7 +480,7 @@ async function completeText(params) {
|
|
|
475
480
|
systemPrompt: params.system,
|
|
476
481
|
messages: params.messages
|
|
477
482
|
}, {
|
|
478
|
-
|
|
483
|
+
apiKey,
|
|
479
484
|
temperature: params.temperature,
|
|
480
485
|
maxTokens: params.maxTokens,
|
|
481
486
|
reasoning: params.thinkingLevel,
|
|
@@ -566,7 +571,7 @@ function bestEffortObjectCompletionCost(modelId, usage) {
|
|
|
566
571
|
/** Execute a schema-constrained completion using the AI SDK structured output path. */
|
|
567
572
|
async function completeObject(params) {
|
|
568
573
|
const credential = await resolveGatewayCredential();
|
|
569
|
-
const provider = createGatewayProvider(
|
|
574
|
+
const provider = createGatewayProvider({ apiKey: credential.token });
|
|
570
575
|
let result;
|
|
571
576
|
try {
|
|
572
577
|
result = await withSpan(`${GEN_AI_OPERATION_CHAT} ${params.modelId}`, "gen_ai.chat", logContextFromMetadata(params.modelId, params.metadata), async (setSpanAttributes) => {
|
|
@@ -592,7 +597,7 @@ async function completeObject(params) {
|
|
|
592
597
|
...params.promptName ? { "gen_ai.prompt.name": params.promptName } : void 0,
|
|
593
598
|
"server.address": GEN_AI_SERVER_ADDRESS,
|
|
594
599
|
"server.port": 443,
|
|
595
|
-
"gen_ai.provider.auth_mode": credential
|
|
600
|
+
"gen_ai.provider.auth_mode": credential.mode,
|
|
596
601
|
...params.thinkingLevel ? { "gen_ai.request.reasoning.level": params.thinkingLevel } : void 0,
|
|
597
602
|
...params.temperature !== void 0 ? { "gen_ai.request.temperature": params.temperature } : void 0,
|
|
598
603
|
...params.maxTokens !== void 0 ? { "gen_ai.request.max_tokens": params.maxTokens } : void 0
|
|
@@ -612,7 +617,7 @@ async function completeObject(params) {
|
|
|
612
617
|
/** Answer typed decision questions with an AI Gateway decision model, such as Jev. */
|
|
613
618
|
async function completeDecision(params) {
|
|
614
619
|
const credential = await resolveGatewayCredential();
|
|
615
|
-
const provider = createGatewayProvider(
|
|
620
|
+
const provider = createGatewayProvider({ apiKey: credential.token });
|
|
616
621
|
try {
|
|
617
622
|
const result = await withSpan(`${GEN_AI_OPERATION_DECIDE} ${params.modelId}`, "gen_ai.decide", logContextFromMetadata(params.modelId, params.metadata), async (setSpanAttributes) => {
|
|
618
623
|
const result = await experimental_decide({
|
|
@@ -640,7 +645,7 @@ async function completeDecision(params) {
|
|
|
640
645
|
...params.promptName ? { "gen_ai.prompt.name": params.promptName } : void 0,
|
|
641
646
|
"server.address": GEN_AI_SERVER_ADDRESS,
|
|
642
647
|
"server.port": 443,
|
|
643
|
-
"gen_ai.provider.auth_mode": credential
|
|
648
|
+
"gen_ai.provider.auth_mode": credential.mode
|
|
644
649
|
});
|
|
645
650
|
return {
|
|
646
651
|
answers: result.answers,
|
|
@@ -658,7 +663,7 @@ async function embedTexts(params) {
|
|
|
658
663
|
const texts = params.texts.map((text) => text.trim());
|
|
659
664
|
if (texts.length === 0 || texts.some((text) => text.length === 0)) throw new Error("Embedding text is required.");
|
|
660
665
|
const credential = await resolveGatewayCredential();
|
|
661
|
-
const provider = createGatewayProvider(
|
|
666
|
+
const provider = createGatewayProvider({ apiKey: credential.token });
|
|
662
667
|
try {
|
|
663
668
|
const result = await withSpan(`${GEN_AI_OPERATION_EMBEDDINGS} ${params.modelId}`, "gen_ai.embeddings", logContextFromMetadata(params.modelId, params.metadata), async (setSpanAttributes) => {
|
|
664
669
|
const result = await embedMany({
|
|
@@ -693,7 +698,7 @@ async function embedTexts(params) {
|
|
|
693
698
|
"gen_ai.request.model": params.modelId,
|
|
694
699
|
"server.address": GEN_AI_SERVER_ADDRESS,
|
|
695
700
|
"server.port": 443,
|
|
696
|
-
"gen_ai.provider.auth_mode": credential
|
|
701
|
+
"gen_ai.provider.auth_mode": credential.mode
|
|
697
702
|
});
|
|
698
703
|
return {
|
|
699
704
|
...result.costUsd !== void 0 ? { costUsd: result.costUsd } : void 0,
|
|
@@ -713,4 +718,4 @@ async function embedTexts(params) {
|
|
|
713
718
|
throw providerError;
|
|
714
719
|
}
|
|
715
720
|
}
|
|
716
|
-
export { toOptionalTrimmed as
|
|
721
|
+
export { toOptionalTrimmed as S, getProviderErrorAttributes as _, completeText as a, getGatewayApiKey as b, COMPACTION_SUMMARY_PREFIX as c, renderCurrentInstruction as d, unwrapCurrentInstruction as f, findProviderError as g, createProviderError as h, completeObject as i, hasCompactedConversationContext as l, ProviderError as m, GEN_AI_SERVER_ADDRESS as n, embedTexts as o, escapeXml as p, completeDecision as r, resolveGatewayModel as s, GEN_AI_PROVIDER_NAME as t, isCompactionSummaryText as u, getProviderErrorUserMessage as v, resolveGatewayCredential as x, isProviderRetryError as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
|
|
2
|
-
import {
|
|
3
|
-
import { h as logWarn } from "./logging-
|
|
2
|
+
import { S as toOptionalTrimmed, s as resolveGatewayModel } from "./client-Cqf4TboL.js";
|
|
3
|
+
import { h as logWarn } from "./logging-n7knse-O.js";
|
|
4
4
|
import { l as TURN_REASONING_LEVELS, s as modelProfileSchema, t as DEFAULT_MODEL_PROFILES, u as parseTurnReasoningLevel } from "./model-profile-Bg8EoCKD.js";
|
|
5
5
|
import { AwsClient } from "aws4fetch";
|
|
6
6
|
// src/chat/attachments/s3.ts
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import {
|
|
4
|
-
import { u as hasRequiredOAuthScope } from "./registry-
|
|
5
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
6
|
-
import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { a as getVercelConversationWorkQueue } from "./job-queue-
|
|
10
|
-
import { m as ensureConversationWake, w as requestConversationWork } from "./store-
|
|
11
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-Dyut9l7Y.js";
|
|
1
|
+
import { Cn as loadTurnCheckpoint, Dn as failTurnRecord, On as getTurnRecord, n as resolveTurnSessionRouting } from "./turn-session-routing-BqO0qXLk.js";
|
|
2
|
+
import { n as botConfig } from "./config-CPsE4T5L.js";
|
|
3
|
+
import { C as getSqlExecutor, F as deleteProviderIdentityForUser, P as deleteProviderIdentityForSlackUser, y as getConversationEventStore } from "./viewer-DSbD6DF6.js";
|
|
4
|
+
import { u as hasRequiredOAuthScope } from "./registry-By36_xsm.js";
|
|
5
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BsoSmTM0.js";
|
|
6
|
+
import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-CrDrPUtY.js";
|
|
7
|
+
import { pt as startOAuthFlow } from "./credentialed-BU-OW7HP.js";
|
|
8
|
+
import { r as getStateAdapter } from "./adapter-2-CG25be.js";
|
|
9
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-DI-k-Bbk.js";
|
|
10
|
+
import { m as ensureConversationWake, w as requestConversationWork } from "./store-DCo2n5iJ.js";
|
|
12
11
|
import { z } from "zod";
|
|
13
12
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
14
13
|
// src/chat/task-execution/authorized-turn.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as conversationTurnFailureReasonSchema, s as conversationTurnFailureCodeSchema, t as INPUT_IMAGE_TYPES, v as usageSchema } from "./media-85PDJxO_.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, objectFactFields, objectTypeSchema } from "@sentry/junior-plugin-api";
|
|
4
4
|
// src/chat/briefs/schema.ts
|
|
@@ -118,88 +118,6 @@ function parseBriefInput(input) {
|
|
|
118
118
|
entries: [...parsed.entries].sort((left, right) => left.index - right.index || left.createdAtMs - right.createdAtMs)
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
// src/chat/attachments/media.ts
|
|
122
|
-
const INPUT_IMAGE_TYPES = [
|
|
123
|
-
"image/png",
|
|
124
|
-
"image/jpeg",
|
|
125
|
-
"image/gif",
|
|
126
|
-
"image/webp"
|
|
127
|
-
];
|
|
128
|
-
/** Leading bytes of each accepted image type. `null` matches any byte. */
|
|
129
|
-
const IMAGE_SIGNATURES = [
|
|
130
|
-
{
|
|
131
|
-
mediaType: "image/png",
|
|
132
|
-
bytes: [
|
|
133
|
-
137,
|
|
134
|
-
80,
|
|
135
|
-
78,
|
|
136
|
-
71,
|
|
137
|
-
13,
|
|
138
|
-
10,
|
|
139
|
-
26,
|
|
140
|
-
10
|
|
141
|
-
]
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
mediaType: "image/jpeg",
|
|
145
|
-
bytes: [
|
|
146
|
-
255,
|
|
147
|
-
216,
|
|
148
|
-
255
|
|
149
|
-
]
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
mediaType: "image/gif",
|
|
153
|
-
bytes: [
|
|
154
|
-
71,
|
|
155
|
-
73,
|
|
156
|
-
70,
|
|
157
|
-
56,
|
|
158
|
-
55,
|
|
159
|
-
97
|
|
160
|
-
]
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
mediaType: "image/gif",
|
|
164
|
-
bytes: [
|
|
165
|
-
71,
|
|
166
|
-
73,
|
|
167
|
-
70,
|
|
168
|
-
56,
|
|
169
|
-
57,
|
|
170
|
-
97
|
|
171
|
-
]
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
mediaType: "image/webp",
|
|
175
|
-
bytes: [
|
|
176
|
-
82,
|
|
177
|
-
73,
|
|
178
|
-
70,
|
|
179
|
-
70,
|
|
180
|
-
null,
|
|
181
|
-
null,
|
|
182
|
-
null,
|
|
183
|
-
null,
|
|
184
|
-
87,
|
|
185
|
-
69,
|
|
186
|
-
66,
|
|
187
|
-
80
|
|
188
|
-
]
|
|
189
|
-
}
|
|
190
|
-
];
|
|
191
|
-
/**
|
|
192
|
-
* Detect an accepted image type from file bytes. Use this instead of a file
|
|
193
|
-
* name or declared content type, which can be wrong.
|
|
194
|
-
*/
|
|
195
|
-
function detectImageMediaType(data) {
|
|
196
|
-
return IMAGE_SIGNATURES.find(({ bytes }) => data.length >= bytes.length && bytes.every((byte, index) => byte === null || data[index] === byte))?.mediaType;
|
|
197
|
-
}
|
|
198
|
-
/** Report whether a media type is a raster image accepted by vision models. */
|
|
199
|
-
function isVisionImageMediaType(mediaType) {
|
|
200
|
-
const normalized = mediaType.split(";", 1)[0]?.trim().toLowerCase();
|
|
201
|
-
return normalized ? INPUT_IMAGE_TYPES.some((type) => type === normalized) : false;
|
|
202
|
-
}
|
|
203
121
|
// src/chat/attachments/input.ts
|
|
204
122
|
/** Bound JSON image input below the hosting platform's request size limit. */
|
|
205
123
|
const MAX_INPUT_IMAGE_BYTES = 3145728;
|
|
@@ -372,6 +290,11 @@ const acceptedConversationMessageSchema = z.object({
|
|
|
372
290
|
status: z.enum(["accepted", "duplicate"])
|
|
373
291
|
}).strict();
|
|
374
292
|
const actorIdentitySchema = z.object({
|
|
293
|
+
/**
|
|
294
|
+
* Junior API path of the profile photo: the person's Slack photo, then
|
|
295
|
+
* their Google photo.
|
|
296
|
+
*/
|
|
297
|
+
avatarUrl: z.string().optional(),
|
|
375
298
|
email: z.string().optional(),
|
|
376
299
|
fullName: z.string().optional(),
|
|
377
300
|
slackUserId: z.string().optional(),
|
|
@@ -920,4 +843,4 @@ const conversationFeedSchema = z.object({
|
|
|
920
843
|
source: z.literal("conversation_index"),
|
|
921
844
|
generatedAt: z.string()
|
|
922
845
|
}).strict();
|
|
923
|
-
export { createConversationMessageBodySchema as A, removedCardSchema as B, conversationReportEventSchema as C, conversationSurfaceSchema as D, conversationSummaryReportSchema as E, conversationChildAgentTotalsSchema as F,
|
|
846
|
+
export { createConversationMessageBodySchema as A, removedCardSchema as B, conversationReportEventSchema as C, conversationSurfaceSchema as D, conversationSummaryReportSchema as E, conversationChildAgentTotalsSchema as F, briefCodeChangeSchema as G, MAX_INPUT_IMAGES as H, annotationCard as I, conversationBriefSchema as J, briefLinkSchema as K, messageCardRef as L, forkConversationResponseSchema as M, steerConversationPendingMessagesBodySchema as N, conversationUsageSchema as O, steerConversationPendingMessagesResponseSchema as P, messageCardText as R, conversationReportEventDataSchema as S, conversationReportStatusSchema as T, MAX_INPUT_IMAGE_BYTES as U, resolveMessageCards as V, readMessageAttachments as W, parseBriefInput as Y, 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, briefOutcomeStatusSchema 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, readMessageCardRefs as z };
|