@sentry/junior 0.292.0 → 0.294.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-Cigb1MTr.js → adapter-DxLhJEnO.js} +1 -1
- package/dist/{admin-BO9V7vnn.js → admin-vt8aSiCD.js} +2 -2
- package/dist/{agent-runner-BuH7EHrX.js → agent-runner-DJu7w6mI.js} +318 -162
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +5 -5
- package/dist/api.d.ts +1 -1
- package/dist/api.js +65 -40
- package/dist/{app-C47PT68y.d.ts → app--a5RLOrr.d.ts} +4 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +454 -435
- package/dist/{assistant-reply-ZjLRGHm2.js → assistant-reply-iTtEdDyc.js} +1 -1
- package/dist/{automation-CrsYnvdV.js → automation-BM-OBsKW.js} +72 -23
- package/dist/{background-compaction-queue-CqZBPe9g.js → background-compaction-queue-D2j-0XkH.js} +4 -4
- package/dist/{briefs-DZrhXJss.js → briefs-JOAoCb6d.js} +3 -3
- package/dist/{catalog-runtime-Cj9I0dco.js → catalog-runtime-CLMA9AXd.js} +1 -1
- package/dist/cli/chat.js +15 -15
- 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 +7 -74
- package/dist/{config-BerMjSVL.js → config-mIZeGEWv.js} +17 -7
- package/dist/{connections-BWmTOVPB.js → connections-XhdVg7OR.js} +6 -6
- package/dist/{conversation-CtjR1Zcx.js → conversation-CDWejM4R.js} +1 -0
- package/dist/{conversation-pending-messages-Cd7ShwBs.js → conversation-pending-messages-Dh2tfbaw.js} +5 -2
- package/dist/{conversation-privacy-BMfbOUCo.js → conversation-privacy-C6h-X2cZ.js} +1 -1
- package/dist/{credential-sync-DZDij2CU.js → credential-sync-zigBlXS3.js} +13 -13
- package/dist/{db-BlfjuqzW.js → db--xuNV7g6.js} +99 -6
- package/dist/{db-7glZCI18.d.ts → db-DV5AbcGM.d.ts} +8 -6
- package/dist/{executor-ikZvFaMD.js → executor-BItuRqAR.js} +87 -21
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-CTCH5jOy.js → logging-Cb6MGvdt.js} +1 -1
- package/dist/{message-C1ID1tKi.js → message-BTGgSmaH.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-CStBgDU7.js → oauth-callback-server-Dvh1aOIi.js} +2 -2
- package/dist/{projection-DY93nCfX.js → projection-DLQgfO5N.js} +61 -52
- package/dist/{prompt-exicBZeb.js → prompt-qp_LdxLX.js} +5 -6
- package/dist/{registry-X_xdFY9L.js → registry-MtwokaqW.js} +1 -1
- package/dist/{resolve-B9dYN-nS.js → resolve-BnJA0UNE.js} +3 -3
- package/dist/{result-CC8bV8Fl.js → result-ChL-1KyW.js} +8 -8
- package/dist/{runner-D44qp4rc.js → runner-BONN7Dp2.js} +8 -8
- package/dist/{sandbox-egress-signals-BrH6DWkt.js → sandbox-egress-signals-nmlmI5Ab.js} +1 -1
- package/dist/{schema-CC2RxDAV.d.ts → schema-DgvcyJ1y.d.ts} +283 -45
- package/dist/{schema-CVV5r-qP.js → schema-yr0ccDni.js} +29 -4
- package/dist/{service-account-DoNZuJb-.js → service-account-Bd0lBaGr.js} +3 -3
- package/dist/{service-account-89JZHWCE.js → service-account-kio5nXSD.js} +3 -3
- package/dist/{session-stop-DNucbmPf.js → session-stop-CeCXL3j9.js} +20 -41
- package/dist/{skills-BeUfmYXL.js → skills-e3DDNlKO.js} +10 -9
- package/dist/{spawn-CIAcfcvZ.js → spawn--cRxITWQ.js} +5 -5
- package/dist/{stop-Ckd3735h.js → stop-Iai5N2PU.js} +34 -29
- package/dist/{store-CS0xoqXW.js → store-C8LsaJwS.js} +3 -3
- package/dist/{task-runner-DjjHCX_m.js → task-runner-Dw7exu0-.js} +65 -90
- package/dist/{turn-failure-response-D0bwI462.js → turn-failure-response-BqTTx3XG.js} +8 -8
- package/dist/{validation-Cvx_AupF.js → validation-BrGahtnv.js} +1 -1
- package/dist/{version-BrDx4Fzc.js → version-Bdqhx8Qh.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-4CxdwLLQ.js → viewer-CjRFHR5U.js} +3 -3
- package/dist/{warmup-B62hd4lD.js → warmup-DuxCtzKC.js} +104 -26
- package/dist/{work-Cu315oJl.js → work-BWBG1EGV.js} +11 -11
- package/dist/{worker-4ClZu6ry.js → worker-DAnBIVMs.js} +6 -6
- package/migrations/0062_plugin_report_index.sql +1 -20
- package/migrations/0078_plugin_conversation_index.sql +1 -20
- package/migrations/0079_conversation_event_author_index.sql +1 -20
- package/migrations/0080_conversation_event_latest_message_indexes.sql +2 -27
- package/migrations/0090_guardian_review_time_index.sql +1 -20
- package/migrations/0091_conversation_participant_unsubscribed_index.sql +1 -20
- package/migrations/0096_automation_task_kind.sql +75 -0
- package/migrations/0097_conversation_kind_automation.sql +6 -0
- package/migrations/meta/0096_snapshot.json +4490 -0
- package/migrations/meta/0097_snapshot.json +4490 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as extractAssistantText, dn as normalizeToolNameFromResult, ln as isToolResultError, un as isToolResultMessage } from "./projection-
|
|
1
|
+
import { $t as extractAssistantText, dn as normalizeToolNameFromResult, ln as isToolResultError, un as isToolResultMessage } from "./projection-DLQgfO5N.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
// src/chat/no-reply.ts
|
|
4
4
|
/** No-reply result of a Turn. */
|
|
@@ -1,7 +1,49 @@
|
|
|
1
1
|
import { c as resolveLocalScheduleAtMs, i as getFirstRunAtMs, o as getZonedDateTimeParts, s as isValidTimeZone } from "./schedule-cP0AACm1.js";
|
|
2
|
-
import { i as actorIdentitySchema } from "./conversation-
|
|
2
|
+
import { i as actorIdentitySchema } from "./conversation-CDWejM4R.js";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { actorUserIdSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
5
|
+
// src/chat/automations/task.ts
|
|
6
|
+
/**
|
|
7
|
+
* The work of an Automation run. An Automation runs either a written
|
|
8
|
+
* instruction or a skill. A skill can have context: what the Automation
|
|
9
|
+
* needs beyond the skill.
|
|
10
|
+
*/
|
|
11
|
+
/** A skill name, in the form that skill frontmatter allows. */
|
|
12
|
+
const automationSkillNameSchema = z.string().max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "Use a skill name, such as tpm.");
|
|
13
|
+
/** Text of an instruction or a context, trimmed and not empty. */
|
|
14
|
+
const automationTaskTextSchema = z.string().trim().min(1, "Write at least one word.").max(4e3);
|
|
15
|
+
/** Validate the stored task of either Automation kind. */
|
|
16
|
+
const automationTaskSchema = z.discriminatedUnion("kind", [z.object({
|
|
17
|
+
kind: z.literal("instruction"),
|
|
18
|
+
instruction: automationTaskTextSchema
|
|
19
|
+
}).strict(), z.object({
|
|
20
|
+
kind: z.literal("skill"),
|
|
21
|
+
skill: automationSkillNameSchema,
|
|
22
|
+
/** Absent when the skill needs nothing more. */
|
|
23
|
+
context: automationTaskTextSchema.optional()
|
|
24
|
+
}).strict()]);
|
|
25
|
+
/** Return the written text of a task: its instruction or its context. */
|
|
26
|
+
function automationTaskText(task) {
|
|
27
|
+
return task.kind === "instruction" ? task.instruction : task.context;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Describe the work in one plain text for title fallback, title generation,
|
|
31
|
+
* and cards, so a skill-mode Automation shows its skill. Do not store it.
|
|
32
|
+
*/
|
|
33
|
+
function automationTaskDescription(task) {
|
|
34
|
+
if (task.kind === "instruction") return task.instruction;
|
|
35
|
+
return task.context ? `Run the ${task.skill} skill. ${task.context}` : `Run the ${task.skill} skill.`;
|
|
36
|
+
}
|
|
37
|
+
/** Return the `instruction` and `skill` columns of a task. One is null. */
|
|
38
|
+
function automationTaskColumns(task) {
|
|
39
|
+
return task.kind === "instruction" ? {
|
|
40
|
+
instruction: task.instruction,
|
|
41
|
+
skill: null
|
|
42
|
+
} : {
|
|
43
|
+
instruction: null,
|
|
44
|
+
skill: task.skill
|
|
45
|
+
};
|
|
46
|
+
}
|
|
5
47
|
// src/chat/scheduled-automations/schedule-intent.ts
|
|
6
48
|
/**
|
|
7
49
|
* Owns model-facing schedule intent and materializes it against the trusted
|
|
@@ -317,7 +359,7 @@ const scheduledAutomationSchema = z.object({
|
|
|
317
359
|
statusReason: z.string().optional(),
|
|
318
360
|
/** Explicit visible effects after successful work. An empty list is silent. */
|
|
319
361
|
outcomes: z.array(scheduledAutomationOutcomeSchema).max(5),
|
|
320
|
-
task:
|
|
362
|
+
task: automationTaskSchema,
|
|
321
363
|
/** SQL-backed short display title generated from the task instruction. */
|
|
322
364
|
title: z.string().optional(),
|
|
323
365
|
updatedAtMs: z.number()
|
|
@@ -378,7 +420,7 @@ const eventAutomationSchema = z.object({
|
|
|
378
420
|
destinationVisibility: destinationVisibilitySchema,
|
|
379
421
|
/** Explicit visible effects after successful work. An empty list is silent. */
|
|
380
422
|
outcomes: z.array(eventAutomationOutcomeSchema).max(5),
|
|
381
|
-
task:
|
|
423
|
+
task: automationTaskSchema,
|
|
382
424
|
trigger: eventAutomationTriggerSchema
|
|
383
425
|
}).strict();
|
|
384
426
|
// src/chat/task-outcomes-schema.ts
|
|
@@ -390,16 +432,18 @@ const taskOutcomeInputSchema = z.object({
|
|
|
390
432
|
}).strict();
|
|
391
433
|
// src/chat/automations/edit-schema.ts
|
|
392
434
|
const automationTitleSchema = z.string().trim().min(1).max(60);
|
|
393
|
-
const automationInstructionSchema = z.string().trim().min(1).max(4e3);
|
|
394
435
|
/**
|
|
395
436
|
* Instruction input for agent tools. The run does not see the request, so the
|
|
396
437
|
* instruction names exact targets. It calls the creator "the Automation
|
|
397
438
|
* creator". It names every other person with their mention.
|
|
398
439
|
*/
|
|
399
|
-
const automationInstructionToolSchema =
|
|
440
|
+
const automationInstructionToolSchema = automationTaskTextSchema.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.");
|
|
441
|
+
/** Context input for agent tools. It follows the same rules as an instruction. */
|
|
442
|
+
const automationContextToolSchema = automationTaskTextSchema.describe("What a skill run needs beyond the skill, such as a repo, a threshold, or who to tag. Follow the same rules as an instruction: write exact targets, call the creator \"the Automation creator\", and name other people with their Slack mention.");
|
|
400
443
|
const automationEditFieldsSchema = z.object({
|
|
401
444
|
title: automationTitleSchema.optional(),
|
|
402
|
-
|
|
445
|
+
/** Replaces the whole task, so a mode switch drops the other mode's text. */
|
|
446
|
+
task: automationTaskSchema.optional(),
|
|
403
447
|
credentialMode: z.enum(["system", "creator"]).optional(),
|
|
404
448
|
outcomes: z.array(z.union([taskOutcomeInputSchema, taskOutcomeSchema])).max(5).optional()
|
|
405
449
|
});
|
|
@@ -438,8 +482,8 @@ const automationSummaryBaseSchema = z.object({
|
|
|
438
482
|
createdByEmail: z.string().trim().email().optional(),
|
|
439
483
|
destination: automationDestinationSchema,
|
|
440
484
|
id: z.string().min(1),
|
|
441
|
-
|
|
442
|
-
/** People mentioned in the
|
|
485
|
+
task: automationTaskSchema,
|
|
486
|
+
/** People mentioned in the task text, resolved at read time. */
|
|
443
487
|
mentions: z.array(actorIdentitySchema).optional(),
|
|
444
488
|
lastConversationId: z.string().min(1).optional(),
|
|
445
489
|
lastRunAt: z.string().datetime().optional(),
|
|
@@ -449,10 +493,22 @@ const automationSummaryBaseSchema = z.object({
|
|
|
449
493
|
"failed"
|
|
450
494
|
]).optional(),
|
|
451
495
|
ownedByViewer: z.boolean(),
|
|
496
|
+
/** Newest terminal runs, oldest first, so the list can show recent health. */
|
|
497
|
+
recentRuns: z.array(z.object({
|
|
498
|
+
durationMs: z.number().finite().nonnegative().optional(),
|
|
499
|
+
executedAt: z.string().datetime(),
|
|
500
|
+
status: z.enum([
|
|
501
|
+
"blocked",
|
|
502
|
+
"completed",
|
|
503
|
+
"failed"
|
|
504
|
+
])
|
|
505
|
+
}).strict()).max(20),
|
|
452
506
|
runs: automationRunWindowsSchema,
|
|
453
507
|
outcomes: z.array(taskOutcomeSchema).max(5),
|
|
454
|
-
/** Short display title; falls back from
|
|
508
|
+
/** Short display title; falls back from the task when unset. */
|
|
455
509
|
title: z.string().min(1),
|
|
510
|
+
/** Linked Conversation cost of every run, since the Automation was created. */
|
|
511
|
+
totalCostUsd: z.number().finite().nonnegative(),
|
|
456
512
|
totalRuns: z.number().int().nonnegative()
|
|
457
513
|
});
|
|
458
514
|
const scheduledAutomationSummarySchema = automationSummaryBaseSchema.extend({
|
|
@@ -490,14 +546,6 @@ const eventAutomationSummarySchema = automationSummaryBaseSchema.extend({
|
|
|
490
546
|
const automationSummarySchema = z.discriminatedUnion("kind", [scheduledAutomationSummarySchema, eventAutomationSummarySchema]);
|
|
491
547
|
/** UTC day (`YYYY-MM-DD`) or hour (`YYYY-MM-DDTHH`) execution bucket key. */
|
|
492
548
|
const automationMetricBucketSchema = z.string().regex(/^\d{4}-\d{2}-\d{2}(T\d{2})?$/);
|
|
493
|
-
/** One UTC day/hour of completed automation executions stacked by automation type. */
|
|
494
|
-
const automationExecutionDaySchema = z.object({
|
|
495
|
-
/** Linked conversation spend for executions in this bucket. */
|
|
496
|
-
costUsd: z.number().finite().nonnegative(),
|
|
497
|
-
date: automationMetricBucketSchema,
|
|
498
|
-
event: z.number().int().nonnegative(),
|
|
499
|
-
scheduled: z.number().int().nonnegative()
|
|
500
|
-
}).strict();
|
|
501
549
|
const automationListQuerySchema = z.object({
|
|
502
550
|
q: z.string().trim().max(200).optional(),
|
|
503
551
|
scope: z.enum([
|
|
@@ -521,6 +569,8 @@ const automationListQuerySchema = z.object({
|
|
|
521
569
|
]).default("all"),
|
|
522
570
|
creator: z.string().max(300).optional(),
|
|
523
571
|
destination: z.string().max(300).optional(),
|
|
572
|
+
/** Only Automations that run this skill. */
|
|
573
|
+
skill: automationSkillNameSchema.optional(),
|
|
524
574
|
sort: z.enum([
|
|
525
575
|
"newest",
|
|
526
576
|
"oldest",
|
|
@@ -534,9 +584,6 @@ const automationFilterOptionSchema = z.object({
|
|
|
534
584
|
label: z.string()
|
|
535
585
|
}).strict();
|
|
536
586
|
const automationListSchema = z.object({
|
|
537
|
-
executionDays: z.array(automationExecutionDaySchema),
|
|
538
|
-
executionHours: z.array(automationExecutionDaySchema).optional(),
|
|
539
|
-
executionSixHours: z.array(automationExecutionDaySchema).optional(),
|
|
540
587
|
automations: z.array(automationSummarySchema),
|
|
541
588
|
total: z.number().int().nonnegative(),
|
|
542
589
|
page: z.number().int().positive(),
|
|
@@ -582,6 +629,8 @@ const automationExecutionSchema = z.object({
|
|
|
582
629
|
const automationExecutionStatusDaySchema = z.object({
|
|
583
630
|
blocked: z.number().int().nonnegative(),
|
|
584
631
|
completed: z.number().int().nonnegative(),
|
|
632
|
+
/** Linked Conversation cost of the runs in this bucket. */
|
|
633
|
+
costUsd: z.number().finite().nonnegative(),
|
|
585
634
|
date: automationMetricBucketSchema,
|
|
586
635
|
failed: z.number().int().nonnegative()
|
|
587
636
|
}).strict();
|
|
@@ -604,7 +653,7 @@ const automationRunListSchema = z.object({
|
|
|
604
653
|
}).strict();
|
|
605
654
|
const automationDefinitionFields = {
|
|
606
655
|
title: z.string().nullable(),
|
|
607
|
-
|
|
656
|
+
task: automationTaskSchema
|
|
608
657
|
};
|
|
609
658
|
const automationVersionFields = {
|
|
610
659
|
version: z.number().int().positive(),
|
|
@@ -663,7 +712,7 @@ const automationEditBaseSchema = scheduledAutomationSchema.pick({
|
|
|
663
712
|
id: z.string().min(1),
|
|
664
713
|
revision: automationRevisionSchema,
|
|
665
714
|
title: z.string().nullable(),
|
|
666
|
-
|
|
715
|
+
task: automationTaskSchema,
|
|
667
716
|
credentialMode: z.enum(["system", "creator"]),
|
|
668
717
|
outcomes: z.array(taskOutcomeSchema).max(5),
|
|
669
718
|
/** Creator-only rules apply when false. */
|
|
@@ -720,4 +769,4 @@ const automationEventCatalogSchema = z.array(z.object({
|
|
|
720
769
|
}).strict());
|
|
721
770
|
const automationScheduleIntentSchema = scheduleIntentSchema;
|
|
722
771
|
const automationSchedulePreviewSchema = scheduledAutomationSchema.pick({ schedule: true }).extend({ nextRunAtMs: z.number() }).strict();
|
|
723
|
-
export {
|
|
772
|
+
export { eventAutomationTriggerSchema as A, automationTaskColumns as B, eventAutomationSummarySchema as C, automationTitleSchema as D, automationInstructionToolSchema as E, compileScheduleIntent as F, automationTaskSchema as H, scheduleIntentFromTool as I, toolScheduleIntentSchema as L, scheduledAutomationSchema as M, scheduledRunSchema as N, taskOutcomeInputSchema as O, ScheduleIntentError as P, weekdaySchema as R, automationVersionSchema as S, automationContextToolSchema as T, automationTaskText as U, automationTaskDescription as V, 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, SCHEDULED_AUTOMATION_SYSTEM_ACTOR as j, eventAutomationSchema 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, automationSkillNameSchema as z };
|
package/dist/{background-compaction-queue-CqZBPe9g.js → background-compaction-queue-D2j-0XkH.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
2
|
-
import { E as withSpan, h as logWarn, m as logInfo, p as logException } from "./logging-
|
|
1
|
+
import { i as getChatConfig } from "./config-mIZeGEWv.js";
|
|
2
|
+
import { E as withSpan, h as logWarn, m as logInfo, p as logException } from "./logging-Cb6MGvdt.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
5
5
|
import * as z from "zod";
|
|
@@ -371,7 +371,7 @@ function cacheWarmupCallback() {
|
|
|
371
371
|
maxDeliveries: 1,
|
|
372
372
|
onRejected: logCacheWarmupRejected,
|
|
373
373
|
run: async (message) => {
|
|
374
|
-
const { runCacheWarmup } = await import("./warmup-
|
|
374
|
+
const { runCacheWarmup } = await import("./warmup-DuxCtzKC.js").then((n) => n.o);
|
|
375
375
|
await runCacheWarmup(message);
|
|
376
376
|
},
|
|
377
377
|
skip: () => !getChatConfig().cacheWarmingEnabled,
|
|
@@ -560,7 +560,7 @@ function pluginTaskCallback() {
|
|
|
560
560
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
561
561
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
562
562
|
run: async (message) => {
|
|
563
|
-
const { processPluginTask } = await import("./task-runner-
|
|
563
|
+
const { processPluginTask } = await import("./task-runner-Dw7exu0-.js").then((n) => n.r);
|
|
564
564
|
await processPluginTask(message);
|
|
565
565
|
},
|
|
566
566
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
2
|
-
import { G as briefCodeChangeSchema, J as briefResourceLabel, X as parseBriefInput, d as conversationEventPageSchema, l as conversationDetailReportSchema } from "./conversation-
|
|
1
|
+
import { l as completeObject, n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-qp_LdxLX.js";
|
|
2
|
+
import { G as briefCodeChangeSchema, J as briefResourceLabel, X as parseBriefInput, d as conversationEventPageSchema, l as conversationDetailReportSchema } from "./conversation-CDWejM4R.js";
|
|
3
3
|
import { CLI_USAGE } from "./cli/run.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import * as z from "zod";
|
|
@@ -262,7 +262,7 @@ async function parseRunOptions(argv) {
|
|
|
262
262
|
* token.
|
|
263
263
|
*/
|
|
264
264
|
async function configuredBriefModelId() {
|
|
265
|
-
const { botConfig } = await import("./config-
|
|
265
|
+
const { botConfig } = await import("./config-mIZeGEWv.js").then((n) => n.r);
|
|
266
266
|
return botConfig.fastModelId;
|
|
267
267
|
}
|
|
268
268
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-MtwokaqW.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-DJu7w6mI.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-HYh_JOdw.js").then((n) => n.o),
|
|
102
|
-
import("../projection-
|
|
103
|
-
import("../catalog-runtime-
|
|
104
|
-
import("../validation-
|
|
105
|
-
import("../db
|
|
102
|
+
import("../projection-DLQgfO5N.js").then((n) => n.jn),
|
|
103
|
+
import("../catalog-runtime-CLMA9AXd.js").then((n) => n.t),
|
|
104
|
+
import("../validation-BrGahtnv.js").then((n) => n.r),
|
|
105
|
+
import("../db--xuNV7g6.js").then((n) => n.n)
|
|
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-DLQgfO5N.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-BONN7Dp2.js");
|
|
158
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-Dvh1aOIi.js");
|
|
159
159
|
const { createLocalOAuthState } = await import("../oauth-relay-D6xxVywK.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 { skipInputAfterConversationStop } = await import("../session-stop-
|
|
160
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-nmlmI5Ab.js");
|
|
161
|
+
const { bindSpawnAgent } = await import("../spawn--cRxITWQ.js").then((n) => n.n);
|
|
162
|
+
const { bindMessageAgent } = await import("../message-BTGgSmaH.js").then((n) => n.n);
|
|
163
|
+
const { createChildConversationWorker } = await import("../result-ChL-1KyW.js").then((n) => n.i);
|
|
164
|
+
const { skipInputAfterConversationStop } = await import("../session-stop-CeCXL3j9.js").then((n) => n.a);
|
|
165
165
|
const { createLocalConversationWork } = await import("../conversation-work-BaT_T6EB.js");
|
|
166
|
-
const { processConversationWork } = await import("../worker-
|
|
166
|
+
const { processConversationWork } = await import("../worker-DAnBIVMs.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");
|
|
@@ -177,7 +177,7 @@ async function prepareLocalChatRun(io, pluginSet) {
|
|
|
177
177
|
});
|
|
178
178
|
});
|
|
179
179
|
agentRunner = createAgentRunner(executeAgentRun, {
|
|
180
|
-
bindMessageAgent: (request) =>
|
|
180
|
+
bindMessageAgent: (request, agents) => agents === "children_and_parent" ? void 0 : bindMessageAgent(request, { queue: localConversationWork.queue }),
|
|
181
181
|
bindSpawnAgent: (request) => bindSpawnAgent(request, { queue: localConversationWork.queue })
|
|
182
182
|
});
|
|
183
183
|
const oauthCallback = await startLocalOAuthCallbackServer();
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-
|
|
2
|
-
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { N as JUNIOR_HEARTBEAT_ROUTE, R as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-Cb6MGvdt.js";
|
|
2
|
+
import { v as parseInlinePluginManifest, y as parsePluginManifest } from "../registry-MtwokaqW.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-e3DDNlKO.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
|
@@ -45,13 +45,13 @@ async function runChat(argv, pluginSet) {
|
|
|
45
45
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
46
46
|
}
|
|
47
47
|
async function runAdmin(argv) {
|
|
48
|
-
return await (await import("../admin-
|
|
48
|
+
return await (await import("../admin-vt8aSiCD.js")).runAdmin(argv);
|
|
49
49
|
}
|
|
50
50
|
async function runServiceAccount(argv) {
|
|
51
|
-
return await (await import("../service-account-
|
|
51
|
+
return await (await import("../service-account-Bd0lBaGr.js")).runServiceAccount(argv);
|
|
52
52
|
}
|
|
53
53
|
async function runBriefs(argv) {
|
|
54
|
-
return await (await import("../briefs-
|
|
54
|
+
return await (await import("../briefs-JOAoCb6d.js")).runBriefs(argv);
|
|
55
55
|
}
|
|
56
56
|
function topLevelCommand(argv) {
|
|
57
57
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { o as getDb } from "../db
|
|
3
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { Hn as validatePlugins, Vn as setPlugins, Xa as createPluginLogger } from "../projection-DLQgfO5N.js";
|
|
2
|
+
import { o as getDb } from "../db--xuNV7g6.js";
|
|
3
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-CLMA9AXd.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-BrGahtnv.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-HYh_JOdw.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 { Ti as create, ja as SANDBOX_RUNTIME } from "../projection-DLQgfO5N.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-CLMA9AXd.js";
|
|
3
|
+
import { t as disconnectStateAdapter } from "../adapter-DxLhJEnO.js";
|
|
4
|
+
import { n as resolve } from "../resolve-BnJA0UNE.js";
|
|
5
5
|
// src/cli/snapshot-create.ts
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
|
7
7
|
function progressMessage(phase) {
|
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-mIZeGEWv.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-BItuRqAR.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-MtwokaqW.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-HYh_JOdw.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -8,69 +8,6 @@ import { createHash } from "node:crypto";
|
|
|
8
8
|
import { readMigrationFiles } from "drizzle-orm/migrator";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
10
|
import { createJiti } from "jiti";
|
|
11
|
-
// src/db/concurrent-indexes.ts
|
|
12
|
-
const CONCURRENT_INDEX_MARKER = "-- junior:concurrent-index";
|
|
13
|
-
const INDEX_STATEMENT = /^CREATE INDEX "([a-z0-9_]+)" ON "([a-z0-9_]+)" .+;$/;
|
|
14
|
-
function markedIndexes(migration) {
|
|
15
|
-
const lines = migration.sql.join("").split("\n").map((line) => line.trim());
|
|
16
|
-
const indexes = [];
|
|
17
|
-
for (const [index, line] of lines.entries()) {
|
|
18
|
-
if (line !== CONCURRENT_INDEX_MARKER) continue;
|
|
19
|
-
const statement = lines[index + 1] ?? "";
|
|
20
|
-
const match = INDEX_STATEMENT.exec(statement);
|
|
21
|
-
if (!match?.[1] || !match[2]) throw new Error(`Migration ${migration.folderMillis}: the line after "${CONCURRENT_INDEX_MARKER}" must be one CREATE INDEX statement on one line.`);
|
|
22
|
-
indexes.push({
|
|
23
|
-
name: match[1],
|
|
24
|
-
statement,
|
|
25
|
-
table: match[2]
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return indexes;
|
|
29
|
-
}
|
|
30
|
-
/** Remove the schema name so indexes on same-name tables compare equal. */
|
|
31
|
-
function withoutSchema(definition) {
|
|
32
|
-
return definition.replace(/ ON [^ ]+\./, " ON ");
|
|
33
|
-
}
|
|
34
|
-
async function readIndexState(executor, name) {
|
|
35
|
-
const [row] = await executor.query(`SELECT pg_get_indexdef(indexrelid) AS definition,
|
|
36
|
-
indisvalid AND indisready AS usable
|
|
37
|
-
FROM pg_index
|
|
38
|
-
WHERE indexrelid = to_regclass($1)`, [name]);
|
|
39
|
-
return row;
|
|
40
|
-
}
|
|
41
|
-
async function expectedDefinition(executor, index) {
|
|
42
|
-
return await executor.transaction(async () => {
|
|
43
|
-
await executor.execute(`CREATE TEMPORARY TABLE "${index.table}" (LIKE "${index.table}") ON COMMIT DROP`);
|
|
44
|
-
await executor.execute(index.statement);
|
|
45
|
-
const [row] = await executor.query(`SELECT pg_get_indexdef(format('pg_temp.%I', $1::text)::regclass) AS definition`, [index.name]);
|
|
46
|
-
if (!row) throw new Error(`Index ${index.name} was not built on the empty copy.`);
|
|
47
|
-
return withoutSchema(row.definition);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
async function buildConcurrentIndex(executor, index) {
|
|
51
|
-
const [table] = await executor.query(`SELECT to_regclass($1) IS NOT NULL AS "exists"`, [index.table]);
|
|
52
|
-
if (!table?.exists) return;
|
|
53
|
-
const expected = await expectedDefinition(executor, index);
|
|
54
|
-
let state = await readIndexState(executor, index.name);
|
|
55
|
-
if (state && !state.usable) {
|
|
56
|
-
await executor.execute(`DROP INDEX CONCURRENTLY IF EXISTS "${index.name}"`);
|
|
57
|
-
state = void 0;
|
|
58
|
-
}
|
|
59
|
-
if (!state) {
|
|
60
|
-
await executor.execute(index.statement.replace(/^CREATE INDEX /, "CREATE INDEX CONCURRENTLY "));
|
|
61
|
-
state = await readIndexState(executor, index.name);
|
|
62
|
-
}
|
|
63
|
-
if (!state?.usable || withoutSchema(state.definition) !== expected) throw new Error(`Index ${index.name} does not match its migration. Expected "${expected}", found "${state?.definition ?? "no index"}". Drop the index, then run junior upgrade again.`);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Build the marked indexes of pending migrations before the transactional
|
|
67
|
-
* migrate, so that the migrate does not block writes to existing tables.
|
|
68
|
-
* Call it while the migration lock is held.
|
|
69
|
-
*/
|
|
70
|
-
async function buildPendingConcurrentIndexes(executor, migrations, appliedAt) {
|
|
71
|
-
const pending = migrations.filter((migration) => appliedAt === void 0 || migration.folderMillis > appliedAt);
|
|
72
|
-
for (const index of pending.flatMap(markedIndexes)) await buildConcurrentIndex(executor, index);
|
|
73
|
-
}
|
|
74
11
|
// src/db/postgres-error.ts
|
|
75
12
|
/** Return whether an unknown PostgreSQL failure has the requested SQLSTATE. */
|
|
76
13
|
function isPostgresErrorCode(error, code) {
|
|
@@ -142,7 +79,6 @@ async function migrateSchema(executor) {
|
|
|
142
79
|
const lockedState = await loadCoreMigrationState(executor);
|
|
143
80
|
if (isCurrentMigrationState(lockedState, latestMigration.folderMillis)) return migrationResult(migrations, lockedState);
|
|
144
81
|
assertSupportedMigrationState(lockedState);
|
|
145
|
-
await buildPendingConcurrentIndexes(executor, migrations, lockedState.appliedAt);
|
|
146
82
|
await executor.migrate({
|
|
147
83
|
migrationsFolder,
|
|
148
84
|
migrationsTable: MIGRATIONS_TABLE
|
|
@@ -257,13 +193,10 @@ async function migratePluginSchemas(executor, roots, options = {}) {
|
|
|
257
193
|
table
|
|
258
194
|
});
|
|
259
195
|
const existing = appliedCount(migrations, currentTime);
|
|
260
|
-
if (existing < migrations.length) {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
migrationsTable: table
|
|
265
|
-
});
|
|
266
|
-
}
|
|
196
|
+
if (existing < migrations.length) await executor.migrate({
|
|
197
|
+
migrationsFolder: root.dir,
|
|
198
|
+
migrationsTable: table
|
|
199
|
+
});
|
|
267
200
|
return {
|
|
268
201
|
existing,
|
|
269
202
|
migrated: migrations.length - existing,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
3
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
2
|
+
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-Cb6MGvdt.js";
|
|
3
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-C6h-X2cZ.js";
|
|
4
4
|
import { AwsClient } from "aws4fetch";
|
|
5
5
|
import { del, get, put } from "@vercel/blob";
|
|
6
6
|
import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
|
|
@@ -401,6 +401,18 @@ function createProviderError(error, options = {}) {
|
|
|
401
401
|
status
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
|
+
const REFUSAL_STOP_REASONS = /* @__PURE__ */ new Set(["refusal", "sensitive"]);
|
|
405
|
+
/** Return whether the provider refused to answer a Pi assistant message. */
|
|
406
|
+
function isProviderRefusal(message) {
|
|
407
|
+
return message.rawStopReason !== void 0 && REFUSAL_STOP_REASONS.has(message.rawStopReason);
|
|
408
|
+
}
|
|
409
|
+
/** Normalize a failed Pi assistant message. A provider refusal is a content policy block. */
|
|
410
|
+
function createAssistantProviderError(message, options = {}) {
|
|
411
|
+
return createProviderError(message.errorMessage ?? "", {
|
|
412
|
+
...options,
|
|
413
|
+
...isProviderRefusal(message) ? { kind: "content_policy" } : void 0
|
|
414
|
+
});
|
|
415
|
+
}
|
|
404
416
|
/** Return whether a provider-boundary error should be retried. */
|
|
405
417
|
function isProviderRetryError(error) {
|
|
406
418
|
return error instanceof ProviderError && error.retryable;
|
|
@@ -1043,7 +1055,6 @@ async function completeText(params) {
|
|
|
1043
1055
|
...hasCompactedConversationContext(params.messages) ? { "gen_ai.conversation.compacted": true } : void 0,
|
|
1044
1056
|
"app.conversation.privacy": effectivePrivacy,
|
|
1045
1057
|
...params.thinkingLevel ? { "gen_ai.request.reasoning.level": params.thinkingLevel } : void 0,
|
|
1046
|
-
...params.temperature !== void 0 ? { "gen_ai.request.temperature": params.temperature } : void 0,
|
|
1047
1058
|
...params.maxTokens !== void 0 ? { "gen_ai.request.max_tokens": params.maxTokens } : void 0
|
|
1048
1059
|
};
|
|
1049
1060
|
const startAttributes = {
|
|
@@ -1063,7 +1074,6 @@ async function completeText(params) {
|
|
|
1063
1074
|
...params.tools ? { tools: params.tools } : void 0
|
|
1064
1075
|
}, {
|
|
1065
1076
|
apiKey,
|
|
1066
|
-
temperature: params.temperature,
|
|
1067
1077
|
maxTokens: params.maxTokens,
|
|
1068
1078
|
reasoning: params.thinkingLevel,
|
|
1069
1079
|
cacheRetention: params.cacheRetention,
|
|
@@ -1166,7 +1176,6 @@ async function completeObject(params) {
|
|
|
1166
1176
|
schema: params.schema,
|
|
1167
1177
|
prompt: params.prompt,
|
|
1168
1178
|
...params.system !== void 0 ? { system: params.system } : void 0,
|
|
1169
|
-
...params.temperature !== void 0 ? { temperature: params.temperature } : void 0,
|
|
1170
1179
|
...params.maxTokens !== void 0 ? { maxOutputTokens: params.maxTokens } : void 0,
|
|
1171
1180
|
...params.signal !== void 0 ? { abortSignal: params.signal } : void 0
|
|
1172
1181
|
});
|
|
@@ -1185,7 +1194,6 @@ async function completeObject(params) {
|
|
|
1185
1194
|
"server.port": 443,
|
|
1186
1195
|
"gen_ai.provider.auth_mode": credential.mode,
|
|
1187
1196
|
...params.thinkingLevel ? { "gen_ai.request.reasoning.level": params.thinkingLevel } : void 0,
|
|
1188
|
-
...params.temperature !== void 0 ? { "gen_ai.request.temperature": params.temperature } : void 0,
|
|
1189
1197
|
...params.maxTokens !== void 0 ? { "gen_ai.request.max_tokens": params.maxTokens } : void 0
|
|
1190
1198
|
});
|
|
1191
1199
|
} catch (error) {
|
|
@@ -1552,6 +1560,7 @@ function readBotConfig(env, functionMaxDurationSeconds) {
|
|
|
1552
1560
|
embeddingModelId: validateEmbeddingModelId(env.AI_EMBEDDING_MODEL) ?? DEFAULT_EMBEDDING_MODEL_ID,
|
|
1553
1561
|
rerankingModelId: toOptionalTrimmed(env.AI_RERANKING_MODEL) ?? DEFAULT_RERANKING_MODEL_ID,
|
|
1554
1562
|
loadingMessages: parseLoadingMessages(env.JUNIOR_LOADING_MESSAGES),
|
|
1563
|
+
refusalFallbackModelId: validateGatewayModelId(env.AI_REFUSAL_FALLBACK_MODEL),
|
|
1555
1564
|
visionModelId: env.AI_VISION_MODEL === void 0 ? DEFAULT_VISION_MODEL_ID : validateGatewayModelId(env.AI_VISION_MODEL),
|
|
1556
1565
|
maxAgentDepth: 0,
|
|
1557
1566
|
maxSlicesPerTurn: MAX_SLICES_PER_TURN,
|
|
@@ -1715,6 +1724,7 @@ function setBotModelConfig(config) {
|
|
|
1715
1724
|
if (config.rerankingModelId !== void 0) botConfig.rerankingModelId = requireModelId("rerankingModelId", config.rerankingModelId, toOptionalTrimmed);
|
|
1716
1725
|
if (config.imageGenerationModelId !== void 0) botConfig.imageGenerationModelId = requireModelId("imageGenerationModelId", config.imageGenerationModelId, validateEmbeddingModelId);
|
|
1717
1726
|
if (config.visionModelId !== void 0) botConfig.visionModelId = requireModelId("visionModelId", config.visionModelId, validateGatewayModelId);
|
|
1727
|
+
if (config.refusalFallbackModelId !== void 0) botConfig.refusalFallbackModelId = requireModelId("refusalFallbackModelId", config.refusalFallbackModelId, validateGatewayModelId);
|
|
1718
1728
|
if (config.webSearchModelId !== void 0) botConfig.webSearchModelId = requireModelId("webSearchModelId", config.webSearchModelId, validateGatewayModelId);
|
|
1719
1729
|
}
|
|
1720
1730
|
/** Apply Slack reaction emoji overrides from createApp() options, validating names. */
|
|
@@ -1722,4 +1732,4 @@ function setSlackReactionConfig(overrides) {
|
|
|
1722
1732
|
if (overrides.processingReactionEmoji !== void 0) chatConfig.slack.processingReactionEmoji = parseReactionEmoji("processingReactionEmoji", overrides.processingReactionEmoji, chatConfig.slack.processingReactionEmoji);
|
|
1723
1733
|
if (overrides.completedReactionEmoji !== void 0) chatConfig.slack.completedReactionEmoji = parseReactionEmoji("completedReactionEmoji", overrides.completedReactionEmoji, chatConfig.slack.completedReactionEmoji);
|
|
1724
1734
|
}
|
|
1725
|
-
export { estimateTextTokens as A,
|
|
1735
|
+
export { estimateTextTokens as A, createAssistantProviderError as B, completeText as C, requestPrefixAttributes as D, resolveGatewayModel as E, renderCurrentInstruction as F, isProviderRefusal as G, findProviderError as H, unwrapCurrentInstruction as I, resolveGatewayCredential as J, isProviderRetryError as K, escapeXml as L, COMPACTION_SUMMARY_PREFIX as M, hasCompactedConversationContext as N, estimateMessagesTokens as O, isCompactionSummaryText as P, escapeXmlText as R, completeObject as S, rerankTexts as T, getProviderErrorAttributes as U, createProviderError as V, getProviderErrorUserMessage as W, toOptionalTrimmed as X, getAttachmentStorage as Y, toPiReasoningLevel as _, getRuntimeMetadata as a, GEN_AI_SERVER_ADDRESS as b, getSlackClientSecret as c, restoreRuntimeConfig as d, setBotModelConfig as f, TURN_REASONING_LEVELS as g, snapshotRuntimeConfig as h, getChatConfig as i, textCharsForTokens as j, estimateRequestOverheadTokens as k, getSlackSigningSecret as l, setSlackReactionConfig as m, botConfig as n, getSlackBotToken as o, setRuntimeLimits as p, getGatewayApiKey as q, config_exports as r, getSlackClientId as s, DEFAULT_SQL_STATEMENT_TIMEOUT_MS as t, resetRuntimeConfig as u, normalizeSlackEmojiName as v, embedTexts as w, completeDecision as x, GEN_AI_PROVIDER_NAME as y, ProviderError as z };
|
|
@@ -1,9 +1,9 @@
|
|
|
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-
|
|
1
|
+
import { Ii as startOAuthFlow } from "./projection-DLQgfO5N.js";
|
|
2
|
+
import { n as botConfig } from "./config-mIZeGEWv.js";
|
|
3
|
+
import { F as deleteProviderIdentityForUser, P as deleteProviderIdentityForSlackUser, s as getSqlExecutor } from "./db--xuNV7g6.js";
|
|
4
|
+
import { u as hasRequiredOAuthScope } from "./registry-MtwokaqW.js";
|
|
5
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-CLMA9AXd.js";
|
|
6
|
+
import { c as deleteMcpServerSessionId, l as deleteMcpStoredOAuthCredentials, s as deleteMcpAuthSessionsForUserProvider } from "./agent-runner-DJu7w6mI.js";
|
|
7
7
|
import { randomBytes } from "node:crypto";
|
|
8
8
|
// src/handlers/oauth-html.ts
|
|
9
9
|
/** Build pre-escaped callback HTML with the shared response security policy. */
|
package/dist/{conversation-pending-messages-Cd7ShwBs.js → conversation-pending-messages-Dh2tfbaw.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as reviewItemChangeRecordSchema, U as messageAttachmentSchema, i as actorIdentitySchema, l as conversationDetailReportSchema } from "./conversation-
|
|
1
|
+
import { P as reviewItemChangeRecordSchema, U as messageAttachmentSchema, i as actorIdentitySchema, l as conversationDetailReportSchema } from "./conversation-CDWejM4R.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
// src/reporting-schema.ts
|
|
4
4
|
const healthReportSchema = z.object({
|
|
@@ -15,7 +15,10 @@ const pluginSchema = z.object({
|
|
|
15
15
|
const pluginsSchema = z.array(pluginSchema);
|
|
16
16
|
const skillReportSchema = z.object({
|
|
17
17
|
name: z.string(),
|
|
18
|
-
|
|
18
|
+
description: z.string(),
|
|
19
|
+
pluginProvider: z.string().optional(),
|
|
20
|
+
/** The skill runs only when invoked by name, such as from an Automation. */
|
|
21
|
+
disableModelInvocation: z.boolean().optional()
|
|
19
22
|
}).strict();
|
|
20
23
|
const skillReportsSchema = z.array(skillReportSchema);
|
|
21
24
|
const pluginPackageContentItemReportSchema = z.object({
|