@sentry/junior 0.287.0 → 0.288.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.
Files changed (72) hide show
  1. package/dist/{adapter-CL-HUKgd.js → adapter-Cikcqdty.js} +1 -1
  2. package/dist/{admin-C9urXVfi.js → admin-BcSxHuTB.js} +2 -2
  3. package/dist/{agent-runner-Bfnw551N.js → agent-runner-9MXyWUL8.js} +173 -89
  4. package/dist/api/schema.d.ts +2 -2
  5. package/dist/api/schema.js +8 -7
  6. package/dist/api.d.ts +1 -1
  7. package/dist/api.js +403 -40
  8. package/dist/{app-DBY5TnfY.d.ts → app-BUklJVBe.d.ts} +4 -2
  9. package/dist/app.d.ts +1 -1
  10. package/dist/app.js +521 -70
  11. package/dist/{assistant-reply-u_PRYzuz.js → assistant-reply-mj47jMRV.js} +1 -1
  12. package/dist/{automation-DksGNDRO.js → automation-DDXwHQs5.js} +2 -2
  13. package/dist/{background-compaction-queue-CYI909P5.js → background-compaction-queue-CjllSPir.js} +161 -90
  14. package/dist/{briefs-DaXiMWzT.js → briefs-DW9iuolG.js} +4 -3
  15. package/dist/{catalog-runtime-BCIuBe4d.js → catalog-runtime-B3gfH58M.js} +1 -1
  16. package/dist/cli/chat.js +14 -14
  17. package/dist/cli/check.js +3 -3
  18. package/dist/cli/main.js +3 -3
  19. package/dist/cli/plugins.js +4 -4
  20. package/dist/cli/snapshot-create.js +4 -4
  21. package/dist/cli/upgrade.d.ts +1 -1
  22. package/dist/cli/upgrade.js +3 -3
  23. package/dist/{config-CkHcUMN7.js → config-CLJcyYEF.js} +401 -9
  24. package/dist/{connections-BnIj0wtx.js → connections-BtdJftow.js} +9 -9
  25. package/dist/{conversation-E7ZPJx2H.js → conversation-DhoqHtQ7.js} +23 -6
  26. package/dist/{conversation-pending-messages-DVch6YQw.js → conversation-pending-messages-DHV0S4uF.js} +1 -1
  27. package/dist/{conversation-privacy-DF1hW0ja.js → conversation-privacy-BPirIVlX.js} +1 -1
  28. package/dist/core-model-BTt5E5b0.js +182 -0
  29. package/dist/{credential-sync-CzMar9hq.js → credential-sync-Co8Q2xRW.js} +28 -20
  30. package/dist/{db-DJ11eZqq.js → db-Co7DTYYh.js} +30 -20
  31. package/dist/{db-YDKKDxlh.d.ts → db-zIs8-Ba3.d.ts} +6 -2
  32. package/dist/{executor-BY9TB31g.js → executor-m0kIN71Q.js} +93 -12
  33. package/dist/{media-Cz1ZiV1U.js → history-IjdmO_r6.js} +6 -86
  34. package/dist/instrumentation.js +2 -2
  35. package/dist/{logging-BO5zU6Mt.js → logging-DbD-dErY.js} +3 -2
  36. package/dist/media-BAHvgkok.js +85 -0
  37. package/dist/{message-CsUbuEc8.js → message-DKTdTYm-.js} +9 -9
  38. package/dist/nitro.d.ts +1 -1
  39. package/dist/nitro.js +19 -41
  40. package/dist/{oauth-callback-server-hiDKK0_n.js → oauth-callback-server-CpbepSbp.js} +2 -2
  41. package/dist/{projection-CL_YWeGf.js → projection-BViECfYu.js} +309 -616
  42. package/dist/{prompt-BHOEQSmf.js → prompt-KT6MaDHN.js} +2 -182
  43. package/dist/{registry-BriFLnaJ.js → registry-D-Acyjhh.js} +1 -1
  44. package/dist/{resolve-Bt6GgAiA.js → resolve-gkT2R66z.js} +3 -3
  45. package/dist/{result-Bo1TZu0Q.js → result-DHmCFEt8.js} +8 -8
  46. package/dist/{runner-D3YeCQgt.js → runner-DBKjGjH-.js} +8 -8
  47. package/dist/{sandbox-egress-signals-CcnSPP4S.js → sandbox-egress-signals-9n8hqx29.js} +1 -1
  48. package/dist/{schedule-BTp__wrw.js → schedule-cP0AACm1.js} +11 -2
  49. package/dist/{schema-C6fsEwjo.d.ts → schema-B_6aOcx5.d.ts} +114 -3
  50. package/dist/{schema-BWE3RJEB.js → schema-DxicIQbc.js} +66 -13
  51. package/dist/{service-account-r6fl0b-9.js → service-account-Bi0HsY6w.js} +3 -3
  52. package/dist/{service-account-DiQQuuw7.js → service-account-CDlC9ssy.js} +3 -3
  53. package/dist/{session-stop-B2Nut40V.js → session-stop-BWOsuo8p.js} +56 -14
  54. package/dist/{skills-CD5aJdzg.js → skills-DO5K68Rq.js} +2 -2
  55. package/dist/{spawn-CalgZQiu.js → spawn-BBqZDcPa.js} +5 -5
  56. package/dist/{stop-kujZLbi0.js → stop-WC97cmHz.js} +802 -338
  57. package/dist/{store-DdIEUL1q.js → store-ByR1Lr7e.js} +4 -16
  58. package/dist/{task-runner-D_RDr2Hu.js → task-runner-B-Ewf8TX.js} +30 -22
  59. package/dist/{turn-failure-response-B5nV1Er-.js → turn-failure-response-CpdPoZSl.js} +18 -9
  60. package/dist/{validation-K4pqwoVZ.js → validation-B4sbIoES.js} +1 -1
  61. package/dist/{version-DBvhk1X9.js → version-D6lpuAgL.js} +1 -1
  62. package/dist/version.js +1 -1
  63. package/dist/{viewer-DrMmFUul.js → viewer-CeP27tC3.js} +4 -4
  64. package/dist/warmup-P_GJCL1c.js +767 -0
  65. package/dist/{work-ljRoODGu.js → work-DI7x1Slm.js} +14 -13
  66. package/dist/{worker-CYO1Q0Js.js → worker-CYPTOT4j.js} +6 -6
  67. package/migrations/0089_conversation_paused_status.sql +3 -0
  68. package/migrations/0090_guardian_review_time_index.sql +20 -0
  69. package/migrations/meta/0089_snapshot.json +4372 -0
  70. package/migrations/meta/0090_snapshot.json +4388 -0
  71. package/migrations/meta/_journal.json +14 -0
  72. package/package.json +5 -4
@@ -177,6 +177,7 @@ const historyReplacementEventDataSchema = z.object({
177
177
  modelProfile: legacyModelProfileSchema,
178
178
  modelId: z.string().min(1),
179
179
  details: compactionDetailsSchema.optional(),
180
+ costUsd: z.number().finite().nonnegative().optional(),
180
181
  summary: z.string().min(1).optional(),
181
182
  replacementHistory: replacementHistorySchema
182
183
  }).strict();
@@ -414,7 +415,10 @@ const compactionRequestedEventDataSchema = z.object({
414
415
  modelProfile: legacyModelProfileSchema,
415
416
  modelId: z.string().min(1)
416
417
  }).strict();
417
- const compactionPreparedFields = compactionRequestedEventDataSchema.extend({ type: z.literal("compaction_prepared") });
418
+ const compactionPreparedFields = compactionRequestedEventDataSchema.extend({
419
+ type: z.literal("compaction_prepared"),
420
+ costUsd: z.number().finite().nonnegative().optional()
421
+ });
418
422
  const compactionPreparedEventDataSchema = z.discriminatedUnion("outcome", [compactionPreparedFields.extend({
419
423
  outcome: z.literal("ready"),
420
424
  summary: z.string().min(1)
@@ -551,88 +555,4 @@ const newConversationEventSchema = z.object({
551
555
  idempotencyKey: z.string().min(1).optional(),
552
556
  createdAtMs: z.number().finite()
553
557
  }).strict();
554
- // src/chat/attachments/media.ts
555
- const INPUT_IMAGE_TYPES = [
556
- "image/png",
557
- "image/jpeg",
558
- "image/gif",
559
- "image/webp"
560
- ];
561
- /** Video types that browsers play in a `<video>` element. */
562
- const INLINE_VIDEO_TYPES = ["video/mp4", "video/webm"];
563
- /** Leading bytes of each accepted image type. `null` matches any byte. */
564
- const IMAGE_SIGNATURES = [
565
- {
566
- mediaType: "image/png",
567
- bytes: [
568
- 137,
569
- 80,
570
- 78,
571
- 71,
572
- 13,
573
- 10,
574
- 26,
575
- 10
576
- ]
577
- },
578
- {
579
- mediaType: "image/jpeg",
580
- bytes: [
581
- 255,
582
- 216,
583
- 255
584
- ]
585
- },
586
- {
587
- mediaType: "image/gif",
588
- bytes: [
589
- 71,
590
- 73,
591
- 70,
592
- 56,
593
- 55,
594
- 97
595
- ]
596
- },
597
- {
598
- mediaType: "image/gif",
599
- bytes: [
600
- 71,
601
- 73,
602
- 70,
603
- 56,
604
- 57,
605
- 97
606
- ]
607
- },
608
- {
609
- mediaType: "image/webp",
610
- bytes: [
611
- 82,
612
- 73,
613
- 70,
614
- 70,
615
- null,
616
- null,
617
- null,
618
- null,
619
- 87,
620
- 69,
621
- 66,
622
- 80
623
- ]
624
- }
625
- ];
626
- /**
627
- * Detect an accepted image type from file bytes. Use this instead of a file
628
- * name or declared content type, which can be wrong.
629
- */
630
- function detectImageMediaType(data) {
631
- return IMAGE_SIGNATURES.find(({ bytes }) => data.length >= bytes.length && bytes.every((byte, index) => byte === null || data[index] === byte))?.mediaType;
632
- }
633
- /** Report whether a media type is a raster image accepted by vision models. */
634
- function isVisionImageMediaType(mediaType) {
635
- const normalized = mediaType.split(";", 1)[0]?.trim().toLowerCase();
636
- return normalized ? INPUT_IMAGE_TYPES.some((type) => type === normalized) : false;
637
- }
638
- export { instructionProvenanceFor as _, KNOWN_CONVERSATION_EVENT_TYPES as a, conversationTurnFailureCodeSchema as c, historyReplacementSchema as d, newConversationEventSchema as f, instructionActors as g, contextProvenance as h, isVisionImageMediaType as i, conversationTurnFailureReasonSchema as l, agentInstructionProvenance as m, INPUT_IMAGE_TYPES as n, agentHistoryItemSchema as o, encodeHistoryPayload as p, detectImageMediaType as r, conversationEventDataSchema as s, INLINE_VIDEO_TYPES as t, decodeStoredConversationEvent as u, sameActorIdentity as v, usageSchema as y };
558
+ export { conversationTurnFailureReasonSchema as a, newConversationEventSchema as c, contextProvenance as d, instructionActors as f, usageSchema as h, conversationTurnFailureCodeSchema as i, encodeHistoryPayload as l, sameActorIdentity as m, agentHistoryItemSchema as n, decodeStoredConversationEvent as o, instructionProvenanceFor as p, conversationEventDataSchema as r, historyReplacementSchema as s, KNOWN_CONVERSATION_EVENT_TYPES as t, agentInstructionProvenance as u };
@@ -1,6 +1,6 @@
1
1
  import { a as getClient, c as init, i as getActiveSpan, o as getGlobalScope, p as spanToJSON, s as getTraceData } from "./sentry-BRTJqumy.js";
2
- import { R as getDeploymentServiceVersion, z as getDeploymentTelemetryAttributes } from "./logging-BO5zU6Mt.js";
3
- import { n as getCurrentConversationPrivacy } from "./conversation-privacy-DF1hW0ja.js";
2
+ import { B as getDeploymentTelemetryAttributes, z as getDeploymentServiceVersion } from "./logging-DbD-dErY.js";
3
+ import { n as getCurrentConversationPrivacy } from "./conversation-privacy-BPirIVlX.js";
4
4
  import { n as redactSandboxEgressProxyPath } from "./proxy-path-BHYoKZdq.js";
5
5
  import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
6
6
  import { n as promoteHttpRouteName, r as routeNameMiddleware, t as nameRequestRoute } from "./sentry-route-name-BhwWnfqj.js";
@@ -1,5 +1,5 @@
1
1
  import { _ as withScope, d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException } from "./sentry-BRTJqumy.js";
2
- import { t as JUNIOR_VERSION } from "./version-DBvhk1X9.js";
2
+ import { t as JUNIOR_VERSION } from "./version-D6lpuAgL.js";
3
3
  import path from "node:path";
4
4
  import { styleText } from "node:util";
5
5
  import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
@@ -117,6 +117,7 @@ const JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE = "17 * * * *";
117
117
  const JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE = "/api/internal/agent/continue";
118
118
  const JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE = "/api/internal/plugin/tasks";
119
119
  const JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE = "/api/internal/workspace/snapshots";
120
+ const JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE = "/api/internal/cache/warmups";
120
121
  const JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE = "/api/internal/context/compactions";
121
122
  const LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION = "api/internal/agent/continue.ts";
122
123
  const SERVICE_INSTANCE_ID = randomUUID();
@@ -1247,4 +1248,4 @@ function extractGenAiUsageAttributes(...sources) {
1247
1248
  ...cost?.total !== void 0 ? { "app.cost.total_usd": cost.total } : void 0
1248
1249
  };
1249
1250
  }
1250
- export { JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE as A, runWithLogAttributes as B, summarizeMessageText as C, JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE as D, withSpan as E, JUNIOR_RETENTION_ROUTE as F, toOptionalNumber as G, isNativeIdentityProvider as H, JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE as I, toOptionalString as K, LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION as L, JUNIOR_HEARTBEAT_ROUTE as M, JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE as N, JUNIOR_AUTO_ARCHIVE_ROUTE as O, JUNIOR_RETENTION_CRON_SCHEDULE as P, getDeploymentServiceVersion as R, setTags as S, withLogContext as T, normalizeIdentityEmail as U, GOOGLE_IDENTITY_PROVIDER as V, isRecord as W, runBestEffort as _, extractGenAiUsageSummary as a, setSpanAttributes as b, getLogContextAttributes as c, logAudit as d, logError as f, normalizeGenAiFinishReason as g, logWarn as h, extractGenAiUsageAttributes as i, JUNIOR_HEARTBEAT_CRON_SCHEDULE as j, JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE as k, getLogContextAttributesForSpan as l, logInfo as m, createChatSdkLogger as n, getActiveTraceContext as o, logException as p, createRequestContext as r, getActiveTraceId as s, buildTurnFailureResponse as t, getTracePropagationHeaders as u, serializeGenAiAttribute as v, withContext as w, setSpanStatus as x, setSentryUser as y, getDeploymentTelemetryAttributes as z };
1251
+ export { JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE as A, getDeploymentTelemetryAttributes as B, summarizeMessageText as C, JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE as D, withSpan as E, JUNIOR_RETENTION_CRON_SCHEDULE as F, normalizeIdentityEmail as G, runWithLogContext as H, JUNIOR_RETENTION_ROUTE as I, toOptionalString as J, isRecord as K, JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE as L, JUNIOR_HEARTBEAT_CRON_SCHEDULE as M, JUNIOR_HEARTBEAT_ROUTE as N, JUNIOR_AUTO_ARCHIVE_ROUTE as O, JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE as P, LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION as R, setTags as S, withLogContext as T, GOOGLE_IDENTITY_PROVIDER as U, runWithLogAttributes as V, isNativeIdentityProvider as W, runBestEffort as _, extractGenAiUsageSummary as a, setSpanAttributes as b, getLogContextAttributes as c, logAudit as d, logError as f, normalizeGenAiFinishReason as g, logWarn as h, extractGenAiUsageAttributes as i, JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE as j, JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE as k, getLogContextAttributesForSpan as l, logInfo as m, createChatSdkLogger as n, getActiveTraceContext as o, logException as p, toOptionalNumber as q, createRequestContext as r, getActiveTraceId as s, buildTurnFailureResponse as t, getTracePropagationHeaders as u, serializeGenAiAttribute as v, withContext as w, setSpanStatus as x, setSentryUser as y, getDeploymentServiceVersion as z };
@@ -0,0 +1,85 @@
1
+ // src/chat/attachments/media.ts
2
+ const INPUT_IMAGE_TYPES = [
3
+ "image/png",
4
+ "image/jpeg",
5
+ "image/gif",
6
+ "image/webp"
7
+ ];
8
+ /** Video types that browsers play in a `<video>` element. */
9
+ const INLINE_VIDEO_TYPES = ["video/mp4", "video/webm"];
10
+ /** Leading bytes of each accepted image type. `null` matches any byte. */
11
+ const IMAGE_SIGNATURES = [
12
+ {
13
+ mediaType: "image/png",
14
+ bytes: [
15
+ 137,
16
+ 80,
17
+ 78,
18
+ 71,
19
+ 13,
20
+ 10,
21
+ 26,
22
+ 10
23
+ ]
24
+ },
25
+ {
26
+ mediaType: "image/jpeg",
27
+ bytes: [
28
+ 255,
29
+ 216,
30
+ 255
31
+ ]
32
+ },
33
+ {
34
+ mediaType: "image/gif",
35
+ bytes: [
36
+ 71,
37
+ 73,
38
+ 70,
39
+ 56,
40
+ 55,
41
+ 97
42
+ ]
43
+ },
44
+ {
45
+ mediaType: "image/gif",
46
+ bytes: [
47
+ 71,
48
+ 73,
49
+ 70,
50
+ 56,
51
+ 57,
52
+ 97
53
+ ]
54
+ },
55
+ {
56
+ mediaType: "image/webp",
57
+ bytes: [
58
+ 82,
59
+ 73,
60
+ 70,
61
+ 70,
62
+ null,
63
+ null,
64
+ null,
65
+ null,
66
+ 87,
67
+ 69,
68
+ 66,
69
+ 80
70
+ ]
71
+ }
72
+ ];
73
+ /**
74
+ * Detect an accepted image type from file bytes. Use this instead of a file
75
+ * name or declared content type, which can be wrong.
76
+ */
77
+ function detectImageMediaType(data) {
78
+ return IMAGE_SIGNATURES.find(({ bytes }) => data.length >= bytes.length && bytes.every((byte, index) => byte === null || data[index] === byte))?.mediaType;
79
+ }
80
+ /** Report whether a media type is a raster image accepted by vision models. */
81
+ function isVisionImageMediaType(mediaType) {
82
+ const normalized = mediaType.split(";", 1)[0]?.trim().toLowerCase();
83
+ return normalized ? INPUT_IMAGE_TYPES.some((type) => type === normalized) : false;
84
+ }
85
+ export { isVisionImageMediaType as i, INPUT_IMAGE_TYPES as n, detectImageMediaType as r, INLINE_VIDEO_TYPES as t };
@@ -1,13 +1,13 @@
1
1
  import { v as __exportAll } from "./sentry-BRTJqumy.js";
2
- import { bn as renderUntrustedTag, eo as canAccessConversation, no as readConversationAccessFromSql } from "./projection-CL_YWeGf.js";
3
- import { n as botConfig } from "./config-CkHcUMN7.js";
4
- import { T as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-DJ11eZqq.js";
5
- import { $t as toolInvocationDestination, Gt as AgentMessageTargetError, Qt as actorFromRun, Ut as AgentMessagePausedError } from "./agent-runner-Bfnw551N.js";
6
- import { I as PARENT_AGENT_TARGET, v as getActiveAgentInvocationForConversation } from "./turn-failure-response-B5nV1Er-.js";
7
- import { G as admitAutomatedTurn, S as EVENT_WAIT_MS, V as postAutomatedTurnLimitNoticeForConversation } from "./session-stop-B2Nut40V.js";
8
- import { r as appendAndEnqueueInboundMessage } from "./store-DdIEUL1q.js";
9
- import { a as enqueueAgentInvocation, c as createAgentInvocationForMessage, u as findChildAgentConversationId } from "./work-ljRoODGu.js";
10
- import { r as enqueueAgentMessageToParent } from "./result-Bo1TZu0Q.js";
2
+ import { Ya as readConversationAccessFromSql, qa as canAccessConversation, wn as renderUntrustedTag } from "./projection-BViECfYu.js";
3
+ import { n as botConfig } from "./config-CLJcyYEF.js";
4
+ import { T as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-Co7DTYYh.js";
5
+ import { $t as actorFromRun, Kt as AgentMessageTargetError, Wt as AgentMessagePausedError, en as toolInvocationDestination } from "./agent-runner-9MXyWUL8.js";
6
+ import { I as PARENT_AGENT_TARGET, v as getActiveAgentInvocationForConversation } from "./turn-failure-response-CpdPoZSl.js";
7
+ import { G as admitAutomatedTurn, S as EVENT_WAIT_MS, V as postAutomatedTurnLimitNoticeForConversation } from "./session-stop-BWOsuo8p.js";
8
+ import { r as appendAndEnqueueInboundMessage } from "./store-ByR1Lr7e.js";
9
+ import { a as enqueueAgentInvocation, c as createAgentInvocationForMessage, u as findChildAgentConversationId } from "./work-DI7x1Slm.js";
10
+ import { r as enqueueAgentMessageToParent } from "./result-DHmCFEt8.js";
11
11
  // src/chat/agent-invocations/top-level-message.ts
12
12
  const AGENT_MESSAGE_EVENT_NAMESPACE = "junior";
13
13
  /** Event type of a message from another top-level agent. */
package/dist/nitro.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { i as JuniorDashboardOptions } from "./app-DBY5TnfY.js";
1
+ import { i as JuniorDashboardOptions } from "./app-BUklJVBe.js";
2
2
  import { n as JuniorPluginSet } from "./plugins-DtmjkTza.js";
3
3
  import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
4
4
  type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
package/dist/nitro.js CHANGED
@@ -1,6 +1,6 @@
1
- import { A as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_ROUTE, I as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_ROUTE, N as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_RETENTION_CRON_SCHEDULE, R as getDeploymentServiceVersion, j as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE } from "./logging-BO5zU6Mt.js";
1
+ import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, z as getDeploymentServiceVersion } from "./logging-DbD-dErY.js";
2
2
  import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DJhGdS4c.js";
3
- import { a as PLUGIN_TASK_QUEUE_TOPIC, p as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, v as resolveConversationWorkQueueTopic } from "./background-compaction-queue-CYI909P5.js";
3
+ import { S as CACHE_WARMUP_QUEUE_TOPIC, _ as resolveConversationWorkQueueTopic, a as PLUGIN_TASK_QUEUE_TOPIC, f as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-CjllSPir.js";
4
4
  import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-HYh_JOdw.js";
5
5
  import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cf5gVPWP.js";
6
6
  import path from "node:path";
@@ -239,46 +239,24 @@ function configureVercelDeployment(nitro, options) {
239
239
  nitro.options.vercel.functions ??= {};
240
240
  nitro.options.vercel.functions.maxDuration = defaultMaxDuration;
241
241
  nitro.options.vercel.functionRules ??= {};
242
- const existingRule = nitro.options.vercel.functionRules["/api/internal/agent/continue"] ?? {};
243
- const otherTriggers = (Array.isArray(existingRule.experimentalTriggers) ? existingRule.experimentalTriggers : []).filter((trigger) => trigger.type !== VERCEL_QUEUE_TRIGGER_TYPE);
244
- nitro.options.vercel.functionRules[JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE] = {
245
- ...existingRule,
246
- maxDuration: defaultMaxDuration,
247
- experimentalTriggers: [...otherTriggers, {
248
- type: VERCEL_QUEUE_TRIGGER_TYPE,
249
- topic: queueTopic
250
- }]
251
- };
252
- const existingPluginTaskRule = nitro.options.vercel.functionRules["/api/internal/plugin/tasks"] ?? {};
253
- const otherPluginTaskTriggers = (Array.isArray(existingPluginTaskRule.experimentalTriggers) ? existingPluginTaskRule.experimentalTriggers : []).filter((trigger) => trigger.type !== VERCEL_QUEUE_TRIGGER_TYPE);
254
- nitro.options.vercel.functionRules[JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE] = {
255
- ...existingPluginTaskRule,
256
- maxDuration: defaultMaxDuration,
257
- experimentalTriggers: [...otherPluginTaskTriggers, {
258
- type: VERCEL_QUEUE_TRIGGER_TYPE,
259
- topic: PLUGIN_TASK_QUEUE_TOPIC
260
- }]
261
- };
262
- const existingSnapshotJobRule = nitro.options.vercel.functionRules["/api/internal/workspace/snapshots"] ?? {};
263
- const otherSnapshotJobTriggers = (Array.isArray(existingSnapshotJobRule.experimentalTriggers) ? existingSnapshotJobRule.experimentalTriggers : []).filter((trigger) => trigger.type !== VERCEL_QUEUE_TRIGGER_TYPE);
264
- nitro.options.vercel.functionRules[JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE] = {
265
- ...existingSnapshotJobRule,
266
- maxDuration: defaultMaxDuration,
267
- experimentalTriggers: [...otherSnapshotJobTriggers, {
268
- type: VERCEL_QUEUE_TRIGGER_TYPE,
269
- topic: WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC
270
- }]
271
- };
272
- const existingCompactionRule = nitro.options.vercel.functionRules["/api/internal/context/compactions"] ?? {};
273
- const otherCompactionTriggers = (Array.isArray(existingCompactionRule.experimentalTriggers) ? existingCompactionRule.experimentalTriggers : []).filter((trigger) => trigger.type !== VERCEL_QUEUE_TRIGGER_TYPE);
274
- nitro.options.vercel.functionRules[JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE] = {
275
- ...existingCompactionRule,
276
- maxDuration: defaultMaxDuration,
277
- experimentalTriggers: [...otherCompactionTriggers, {
278
- type: VERCEL_QUEUE_TRIGGER_TYPE,
279
- topic: BACKGROUND_COMPACTION_QUEUE_TOPIC
280
- }]
242
+ const functionRules = nitro.options.vercel.functionRules;
243
+ const addQueueTrigger = (route, topic) => {
244
+ const existingRule = functionRules[route] ?? {};
245
+ const existingTriggers = Array.isArray(existingRule.experimentalTriggers) ? existingRule.experimentalTriggers : [];
246
+ functionRules[route] = {
247
+ ...existingRule,
248
+ maxDuration: defaultMaxDuration,
249
+ experimentalTriggers: [...existingTriggers.filter((trigger) => trigger.type !== VERCEL_QUEUE_TRIGGER_TYPE), {
250
+ type: VERCEL_QUEUE_TRIGGER_TYPE,
251
+ topic
252
+ }]
253
+ };
281
254
  };
255
+ addQueueTrigger(JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, queueTopic);
256
+ addQueueTrigger(JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, PLUGIN_TASK_QUEUE_TOPIC);
257
+ addQueueTrigger(JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC);
258
+ addQueueTrigger(JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, CACHE_WARMUP_QUEUE_TOPIC);
259
+ addQueueTrigger(JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, BACKGROUND_COMPACTION_QUEUE_TOPIC);
282
260
  return defaultMaxDuration;
283
261
  }
284
262
  /** Nitro module that configures deployment wiring and copies app/plugin content into the Vercel build output. */
@@ -1,5 +1,5 @@
1
- import { Rn as createUserTokenStore } from "./projection-CL_YWeGf.js";
2
- import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-CzMar9hq.js";
1
+ import { Dn as createUserTokenStore } from "./projection-BViECfYu.js";
2
+ import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-Co8Q2xRW.js";
3
3
  import { createServer } from "node:http";
4
4
  // src/chat/local/oauth-callback-server.ts
5
5
  const LOCAL_OAUTH_TIMEOUT_MS = 6e5;