@sentry/junior 0.257.0 → 0.259.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 (104) hide show
  1. package/dist/{actor-BTtLaeWy.js → actor-tlxzqaRe.js} +3 -6
  2. package/dist/adapter-Bn0gFVSF.js +270 -0
  3. package/dist/{admin-DgIkm6Vy.js → admin-C8xz2f10.js} +2 -3
  4. package/dist/{agent-hooks-BjtTzvru.js → agent-hooks-B00FaKdP.js} +70 -109
  5. package/dist/{agent-invocations-Bdu3ROfo.js → agent-invocations-Qfz7dWgU.js} +6 -12
  6. package/dist/{agent-runner-D7OboVb3.js → agent-runner-CPSd7rKm.js} +324 -742
  7. package/dist/api/schema.d.ts +442 -447
  8. package/dist/api/schema.js +6 -6
  9. package/dist/api.d.ts +2 -12
  10. package/dist/api.js +165 -158
  11. package/dist/{app-BsU5QNBd.d.ts → app-Bbxrehjf.d.ts} +25 -45
  12. package/dist/app.d.ts +3 -3
  13. package/dist/app.js +206 -321
  14. package/dist/{assistant-reply-CbTPebzL.js → assistant-reply-CqthTerd.js} +3 -5
  15. package/dist/{automation-CHdlHVZP.js → automation-DWBFBenG.js} +6 -11
  16. package/dist/{briefs-oLOldnDM.js → briefs-DNYbQ9cD.js} +8 -11
  17. package/dist/{cadence-D00SCzT1.js → cadence-R7Em4RjE.js} +1 -2
  18. package/dist/{catalog-runtime-CZzhGQ7F.js → catalog-runtime-B8SuFPGb.js} +3 -4
  19. package/dist/cli/chat.d.ts +2 -4
  20. package/dist/cli/chat.js +22 -24
  21. package/dist/cli/check.d.ts +1 -3
  22. package/dist/cli/check.js +4 -5
  23. package/dist/cli/env.d.ts +1 -3
  24. package/dist/cli/env.js +1 -2
  25. package/dist/cli/init.d.ts +1 -3
  26. package/dist/cli/init.js +3 -3
  27. package/dist/cli/main.d.ts +1 -3
  28. package/dist/cli/main.js +8 -5
  29. package/dist/cli/plugins.d.ts +2 -4
  30. package/dist/cli/plugins.js +7 -8
  31. package/dist/cli/run.d.ts +3 -3
  32. package/dist/cli/run.js +3 -3
  33. package/dist/cli/snapshot-create.d.ts +1 -3
  34. package/dist/cli/snapshot-create.js +5 -5
  35. package/dist/cli/upgrade.d.ts +3 -6
  36. package/dist/cli/upgrade.js +11 -17
  37. package/dist/{client-D8HnkOQX.js → client-BZdxgKyL.js} +64 -18
  38. package/dist/{config-CJRnWK9H.js → config-Deqpfpg9.js} +21 -15
  39. package/dist/{connections-ClYrKzpX.js → connections-9gJkfS85.js} +179 -20
  40. package/dist/{conversation-CKNLYBJt.js → conversation-DjN3mlog.js} +8 -15
  41. package/dist/{conversation-privacy-C8b1nphZ.js → conversation-privacy-CFhNKxp-.js} +2 -3
  42. package/dist/{conversation-work-C6y3T5Hx.js → conversation-work-BaT_T6EB.js} +1 -2
  43. package/dist/{credential-sync-BXfohNmJ.js → credential-sync-BABGymK3.js} +23 -190
  44. package/dist/{db-Ca9Nt5ci.d.ts → db-BnRqQ7G5.d.ts} +1 -1
  45. package/dist/{executor-Do0THDRR.js → executor-Bb3eQb8q.js} +30 -52
  46. package/dist/{experimental-CQIvMUO7.js → experimental-BNK1l1jv.js} +2 -4
  47. package/dist/{history-9pO1Zd4Y.js → history-AY8rs-FR.js} +5 -9
  48. package/dist/{history-DvqWZlYX.d.ts → history-BgI33Kie.d.ts} +12 -20
  49. package/dist/{images-BN_BiBXF.js → images-BbSdVHC6.js} +5 -6
  50. package/dist/instrumentation.d.ts +1 -3
  51. package/dist/instrumentation.js +6 -8
  52. package/dist/{job-queue-B6SV9uVa.js → job-queue-vdGU-5ge.js} +6 -12
  53. package/dist/{logging-CWxiIuCF.js → logging-BStXN56b.js} +7 -12
  54. package/dist/{message-TUOdbSBW.js → message-DRf6m4uO.js} +5 -6
  55. package/dist/{model-profile-BwU8mqwD.js → model-profile-Bg8EoCKD.js} +2 -4
  56. package/dist/nitro.d.ts +3 -5
  57. package/dist/nitro.js +12 -17
  58. package/dist/{oauth-authorization-BA4Dt6a7.js → oauth-authorization-djQn5Nhy.js} +2 -4
  59. package/dist/{oauth-callback-server-Dj5UJODo.js → oauth-callback-server-JmOgLcGl.js} +3 -4
  60. package/dist/{oauth-relay-CdCnu80W.js → oauth-relay-CTygMkNx.js} +2 -3
  61. package/dist/{package-discovery-BVvSnQBB.js → package-discovery-DJBompdd.js} +17 -21
  62. package/dist/{pending-auth-s_QFribU.js → pending-auth-rG5U_QS1.js} +92 -83
  63. package/dist/{plugin-module-CVvEUSMH.js → plugin-module-Cf5gVPWP.js} +1 -2
  64. package/dist/{plugins-CjfUP5gJ.d.ts → plugins-B_0Cr0MO.d.ts} +5 -5
  65. package/dist/{plugins-egKWjgue.js → plugins-DOm9Y6qI.js} +2 -3
  66. package/dist/{private-trace-result-BLvBjy_e.js → private-trace-result-CE7_lEdq.js} +1 -2
  67. package/dist/{profile-h-72wM78.js → profile-qBM6B_-V.js} +14 -295
  68. package/dist/{prompt-DyoEj9c2.js → prompt-xgpyMtg7.js} +5 -9
  69. package/dist/{queue-B5SnqRln.d.ts → queue-C37RbDVc.d.ts} +0 -2
  70. package/dist/{registry-sLTr-sV9.js → registry-B_M_x_iS.js} +56 -30
  71. package/dist/{resolve-ncQPZROQ.js → resolve-BzpuLh8c.js} +8 -12
  72. package/dist/{result-C883vngT.js → result-DEZH_AnZ.js} +13 -17
  73. package/dist/{rolldown-runtime-B4FMCO8f.js → rolldown-runtime-nwUcYXjP.js} +1 -2
  74. package/dist/{runner-CzYImdOF.js → runner-BqQlG10t.js} +12 -13
  75. package/dist/{sandbox-egress-signals-CZbMINHI.js → sandbox-egress-signals-DCq3WLs5.js} +2 -3
  76. package/dist/{schema-Dy69D4Ge.js → schema-CF9HqNRY.js} +30 -27
  77. package/dist/{sentry-CgWZM_kV.js → sentry-BBUlHih9.js} +2 -3
  78. package/dist/service-account-BqTBkyD7.js +120 -0
  79. package/dist/service-account-BzhW7kXu.js +661 -0
  80. package/dist/{session-stop-CQjKd4a2.js → session-stop-CV65ZlU3.js} +23 -33
  81. package/dist/{skills-C22SLruK.js → skills-CiWS5_Ub.js} +9 -9
  82. package/dist/{spawn-DY9CLXDL.js → spawn-BSAQ7UQZ.js} +4 -5
  83. package/dist/{store-DXFIQy-G.js → store-B1GES4gC.js} +13 -15
  84. package/dist/{store-DoewL5mG.d.ts → store-CG0VJyye.d.ts} +0 -14
  85. package/dist/{task-queue-B17vV0La.js → task-queue-BAeGEMjJ.js} +5 -7
  86. package/dist/{task-runner-DUjvzYXj.js → task-runner-BlGhcQPi.js} +22 -26
  87. package/dist/{tasks-D_WIJtvO.js → tasks-DieKX3d4.js} +63 -78
  88. package/dist/{thread-state-Ch4yuCqG.js → thread-state-DpSWS4Rr.js} +13 -19
  89. package/dist/{turn-failure-response-C5nBKC4S.js → turn-failure-response-DQljogGJ.js} +16 -22
  90. package/dist/{turn-lifecycle-CO-ylUmV.js → turn-lifecycle-BLgrkV_L.js} +2 -3
  91. package/dist/{turn-session-routing-B3LWooK5.js → turn-session-routing-BlajheOU.js} +2 -3
  92. package/dist/{validation-CXYxaNYx.js → validation-23d7K9tX.js} +3 -4
  93. package/dist/vercel.d.ts +1 -3
  94. package/dist/vercel.js +1 -2
  95. package/dist/{version-BcdZy2zg.js → version-B_XumRx-.js} +3 -5
  96. package/dist/{version-CnXZ614E.d.ts → version-Cc2OFd9G.d.ts} +0 -2
  97. package/dist/version.d.ts +1 -1
  98. package/dist/version.js +1 -2
  99. package/dist/{viewer-DSZXygMU.js → viewer-B2_ABsYi.js} +26 -57
  100. package/dist/{web-input-B9Bv0_lR.js → web-input-BZDyxpzR.js} +101 -158
  101. package/dist/{web-message-id-xPI_EFSC.js → web-message-id-CJSUiksE.js} +3 -6
  102. package/dist/{work-nAfDSUFP.js → work-D3QKiV0O.js} +14 -16
  103. package/dist/{worker-vGXZ6XFT.js → worker-C8mUjYf9.js} +7 -8
  104. package/package.json +10 -9
@@ -1,30 +1,30 @@
1
- import { d as unwrapCurrentInstruction, f as escapeXml, i as completeText, o as resolveGatewayModel } from "./client-D8HnkOQX.js";
2
- import { f as logException, m as logWarn, o as getActiveTraceId, s as getLogContextAttributes, t as buildTurnFailureResponse, y as setSpanAttributes } from "./logging-CWxiIuCF.js";
3
- import { n as captureMessage } from "./sentry-CgWZM_kV.js";
4
- import { n as botConfig, v as normalizeSlackEmojiName } from "./config-CJRnWK9H.js";
5
- import { c as toStoredSlackActor, f as parseSlackUserId, g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
6
- import { S as bindProviderConversation, b as startLocationThread, d as getConversationStore, h as withConversationEventLock, l as getConversationEventStore, m as createSqlConversationEventStore, p as getSqlExecutor, w as addAgentTurnUsage } from "./viewer-DSZXygMU.js";
7
- import { a as juniorAutomationRuns, o as juniorAutomationVersions, s as juniorAutomations } from "./executor-Do0THDRR.js";
8
- import { d as contextProvenance, f as instructionActors, n as agentHistoryItemSchema, p as instructionProvenanceFor } from "./history-9pO1Zd4Y.js";
9
- import { h as credentialSubjectSchema } from "./registry-sLTr-sV9.js";
10
- import { $t as authenticationUnlinkedEvent, Gt as normalizeSlackConversationId, Ht as getSlackClient, Qt as authenticationLinkedEvent, Rt as SlackActionError, Xt as JUNIOR_NATIVE_EVENT_NAMESPACE, Zt as agentsInstructionsUpdatedEvent, n as applyPluginFormatMarkdown, qt as withSlackRetries } from "./agent-hooks-BjtTzvru.js";
11
- import { G as messageCardRef } from "./conversation-CKNLYBJt.js";
12
- import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-h-72wM78.js";
13
- import { A as eventAutomationSchema, E as scheduledAutomationSchema, S as automationVersionSchema } from "./automation-CHdlHVZP.js";
1
+ import { a as completeText, f as unwrapCurrentInstruction, p as escapeXml, s as resolveGatewayModel } from "./client-BZdxgKyL.js";
2
+ import { f as logException, m as logWarn, o as getActiveTraceId, s as getLogContextAttributes, t as buildTurnFailureResponse, y as setSpanAttributes } from "./logging-BStXN56b.js";
3
+ import { n as captureMessage } from "./sentry-BBUlHih9.js";
4
+ import { n as botConfig, v as normalizeSlackEmojiName } from "./config-Deqpfpg9.js";
5
+ import { c as toStoredSlackActor, f as parseSlackUserId, g as parseSlackMessageTs } from "./actor-tlxzqaRe.js";
6
+ import { C as addAgentTurnUsage, c as getConversationEventStore, f as getSqlExecutor, m as withConversationEventLock, p as createSqlConversationEventStore, u as getConversationStore, x as bindProviderConversation, y as startLocationThread } from "./viewer-B2_ABsYi.js";
7
+ import { a as juniorAutomationRuns, o as juniorAutomationVersions, s as juniorAutomations } from "./executor-Bb3eQb8q.js";
8
+ import { d as contextProvenance, f as instructionActors, n as agentHistoryItemSchema, p as instructionProvenanceFor } from "./history-AY8rs-FR.js";
9
+ import { h as credentialSubjectSchema } from "./registry-B_M_x_iS.js";
10
+ import { $t as authenticationUnlinkedEvent, Gt as normalizeSlackConversationId, Ht as getSlackClient, Qt as authenticationLinkedEvent, Rt as SlackActionError, Xt as JUNIOR_NATIVE_EVENT_NAMESPACE, Zt as agentsInstructionsUpdatedEvent, n as applyPluginFormatMarkdown, qt as withSlackRetries } from "./agent-hooks-B00FaKdP.js";
11
+ import { G as messageCardRef } from "./conversation-DjN3mlog.js";
12
+ import { S as sleep } from "./profile-qBM6B_-V.js";
13
+ import { i as MUTATION_LOCK_TTL_MS, o as fenceLock, r as getStateAdapter, s as withLock } from "./adapter-Bn0gFVSF.js";
14
+ import { A as eventAutomationSchema, E as scheduledAutomationSchema, S as automationVersionSchema } from "./automation-DWBFBenG.js";
14
15
  import { isDeepStrictEqual } from "node:util";
15
16
  import { z } from "zod";
16
17
  import { createHash } from "node:crypto";
17
18
  import { and, asc, desc, eq, inArray, ne, or, sql } from "drizzle-orm";
18
19
  import { actorSchema, eventMatches, sourceSchema } from "@sentry/junior-plugin-api";
19
- //#region src/chat/pi/messages.ts
20
+ // src/chat/pi/messages.ts
20
21
  /** Permissive schema for durable Pi SDK messages whose content shape may evolve. */
21
22
  const piMessageSchema = z.object({ role: z.string() }).passthrough().transform((value) => value);
22
23
  z.object({
23
24
  content: z.array(z.unknown()),
24
25
  role: z.string().min(1)
25
26
  }).passthrough().transform((value) => value);
26
- //#endregion
27
- //#region src/chat/pi/conversation-events.ts
27
+ // src/chat/pi/conversation-events.ts
28
28
  function authorizationObservationMessage(data, createdAtMs) {
29
29
  const label = data.kind === "mcp" ? "MCP authorization" : "Authorization";
30
30
  return piMessageSchema.parse({
@@ -129,8 +129,7 @@ function projectConversationEvents(events, options) {
129
129
  replacementSeq
130
130
  };
131
131
  }
132
- //#endregion
133
- //#region src/chat/services/context-budget.ts
132
+ // src/chat/services/context-budget.ts
134
133
  const COMPACTION_TRIGGER_RATIO = .9;
135
134
  const CONTEXT_INPUT_LIMIT_RATIO = .95;
136
135
  const COMPACTION_TARGET_RATIO = .8;
@@ -173,8 +172,7 @@ function getAgentContextInputLimitTokens(modelId) {
173
172
  function getConversationContextCompactionTriggerTokens() {
174
173
  return calculateContextCompactionTriggerTokens(getModelContextBudget(botConfig.fastModelId));
175
174
  }
176
- //#endregion
177
- //#region src/chat/services/conversation-memory.ts
175
+ // src/chat/services/conversation-memory.ts
178
176
  const CONTEXT_MIN_LIVE_MESSAGES = 12;
179
177
  const CONTEXT_COMPACTION_BATCH_SIZE = 24;
180
178
  const CONTEXT_MAX_COMPACTIONS = 16;
@@ -271,6 +269,7 @@ function markConversationMessage(conversation, messageId, patch) {
271
269
  const messageIndex = conversation.messages.findIndex((entry) => entry.id === messageId);
272
270
  if (messageIndex < 0) return;
273
271
  const current = conversation.messages[messageIndex];
272
+ if (!current) return;
274
273
  conversation.messages[messageIndex] = {
275
274
  ...current,
276
275
  meta: {
@@ -526,8 +525,7 @@ async function resolveTaskTitle(args) {
526
525
  signal: args.signal
527
526
  });
528
527
  }
529
- //#endregion
530
- //#region src/chat/services/conversation-title.ts
528
+ // src/chat/services/conversation-title.ts
531
529
  const inFlightTitles = /* @__PURE__ */ new Map();
532
530
  /**
533
531
  * Set-once conversation title from the earliest human message.
@@ -630,8 +628,7 @@ async function resolveConversationTitle(args) {
630
628
  }
631
629
  return (await (args.conversationStore ?? getConversationStore()).get({ conversationId: args.conversationId }))?.title?.trim() || void 0;
632
630
  }
633
- //#endregion
634
- //#region src/chat/conversations/message-summaries.ts
631
+ // src/chat/conversations/message-summaries.ts
635
632
  /** Project the latest source-message summary snapshot from event history. */
636
633
  function projectConversationMessageSummaries(events) {
637
634
  for (let index = events.length - 1; index >= 0; index -= 1) {
@@ -657,8 +654,7 @@ async function persistConversationMessageSummaries(args) {
657
654
  createdAtMs: args.conversation.compactions.at(-1)?.createdAtMs ?? Date.now()
658
655
  }]);
659
656
  }
660
- //#endregion
661
- //#region src/chat/conversations/message-projection.ts
657
+ // src/chat/conversations/message-projection.ts
662
658
  function isMessageEvent(event) {
663
659
  return event.data.type === "message" || event.data.type === "message_updated" || event.data.type === "message_handled";
664
660
  }
@@ -720,8 +716,7 @@ function projectConversationMessages(history) {
720
716
  };
721
717
  });
722
718
  }
723
- //#endregion
724
- //#region src/chat/conversations/messages.ts
719
+ // src/chat/conversations/messages.ts
725
720
  /**
726
721
  * Conversation-message persistence and hydration.
727
722
  */
@@ -813,8 +808,7 @@ async function appendConversationMessages(eventStore, args) {
813
808
  });
814
809
  await eventStore.append(args.conversationId, events);
815
810
  }
816
- //#endregion
817
- //#region src/chat/conversations/projection.ts
811
+ // src/chat/conversations/projection.ts
818
812
  /**
819
813
  * Conversation projection orchestration.
820
814
  *
@@ -1281,8 +1275,7 @@ async function recordGuardianActionReviewed(args) {
1281
1275
  createdAtMs: Date.now()
1282
1276
  }]);
1283
1277
  }
1284
- //#endregion
1285
- //#region src/chat/tools/execution/tool-input-error.ts
1278
+ // src/chat/tools/execution/tool-input-error.ts
1286
1279
  /** Thrown when a tool fails due to invalid model/user input, not a system error. */
1287
1280
  var ToolInputError = class extends Error {
1288
1281
  constructor(message, options) {
@@ -1290,16 +1283,14 @@ var ToolInputError = class extends Error {
1290
1283
  this.name = "ToolInputError";
1291
1284
  }
1292
1285
  };
1293
- //#endregion
1294
- //#region src/chat/turn-context-tag.ts
1286
+ // src/chat/turn-context-tag.ts
1295
1287
  /**
1296
1288
  * Canonical tag name for the runtime turn context block injected into Pi
1297
1289
  * messages. Shared between prompt assembly and turn context stripping to keep
1298
1290
  * both in sync without requiring the full prompt module.
1299
1291
  */
1300
1292
  const TURN_CONTEXT_TAG = "runtime-turn-context";
1301
- //#endregion
1302
- //#region src/chat/pi/transcript.ts
1293
+ // src/chat/pi/transcript.ts
1303
1294
  const RUNTIME_TURN_CONTEXT_START = `<${TURN_CONTEXT_TAG}>`;
1304
1295
  const AGENTS_INSTRUCTIONS_START = "# AGENTS.md instructions";
1305
1296
  function userMessageContent(message) {
@@ -1431,8 +1422,7 @@ function stripRuntimeTurnContext(messages) {
1431
1422
  }];
1432
1423
  });
1433
1424
  }
1434
- //#endregion
1435
- //#region src/chat/services/turn-limit.ts
1425
+ // src/chat/services/turn-limit.ts
1436
1426
  /** Terminal failure when one turn uses too many execution slices. */
1437
1427
  var TurnSliceLimitExceededError = class extends Error {
1438
1428
  constructor(maxSlices) {
@@ -1495,8 +1485,7 @@ function buildTurnLimitResponse(eventId) {
1495
1485
  function buildTurnErrorResponse(error, eventId) {
1496
1486
  return isTurnExecutionLimitExceededError(error) ? buildTurnLimitResponse(eventId) : buildTurnFailureResponse(eventId);
1497
1487
  }
1498
- //#endregion
1499
- //#region src/chat/services/persist-retry.ts
1488
+ // src/chat/services/persist-retry.ts
1500
1489
  /**
1501
1490
  * Shared post-delivery persist retry.
1502
1491
  *
@@ -1517,8 +1506,7 @@ async function persistWithRetry(persist) {
1517
1506
  }
1518
1507
  throw lastError;
1519
1508
  }
1520
- //#endregion
1521
- //#region src/chat/task-execution/turn-cursor-keys.ts
1509
+ // src/chat/task-execution/turn-cursor-keys.ts
1522
1510
  /** Redis namespace for the current turn cursor format. */
1523
1511
  const TURN_CURSOR_PREFIX = "junior:turn_cursor:v2";
1524
1512
  /** Return the Redis key for one turn cursor. */
@@ -1533,8 +1521,7 @@ function turnCursorIndexKey(conversationId) {
1533
1521
  function turnCursorMutationKey(conversationId, turnId) {
1534
1522
  return `${TURN_CURSOR_PREFIX}:mutation:${conversationId}:${turnId}`;
1535
1523
  }
1536
- //#endregion
1537
- //#region src/chat/task-execution/turn-cursor.ts
1524
+ // src/chat/task-execution/turn-cursor.ts
1538
1525
  /**
1539
1526
  * Internal turn cursor storage for `checkpoint.ts`.
1540
1527
  *
@@ -2089,8 +2076,7 @@ async function failTurnRecord(args) {
2089
2076
  });
2090
2077
  });
2091
2078
  }
2092
- //#endregion
2093
- //#region src/chat/task-execution/checkpoint.ts
2079
+ // src/chat/task-execution/checkpoint.ts
2094
2080
  function definedProps(values) {
2095
2081
  return Object.fromEntries(Object.entries(values).filter(([, value]) => value !== void 0));
2096
2082
  }
@@ -2241,8 +2227,7 @@ async function saveDone(args) {
2241
2227
  });
2242
2228
  });
2243
2229
  }
2244
- //#endregion
2245
- //#region src/chat/slack/post-warning.ts
2230
+ // src/chat/slack/post-warning.ts
2246
2231
  const codes = /* @__PURE__ */ new Set([
2247
2232
  "invalid_metadata_format",
2248
2233
  "invalid_metadata_schema",
@@ -2338,8 +2323,7 @@ function captureSlackPostWarning(response, attributes) {
2338
2323
  }
2339
2324
  });
2340
2325
  }
2341
- //#endregion
2342
- //#region src/chat/slack/work-object.ts
2326
+ // src/chat/slack/work-object.ts
2343
2327
  const url = z.url({ protocol: /^https?$/ });
2344
2328
  const textField = z.strictObject({
2345
2329
  type: z.literal("string"),
@@ -2388,8 +2372,7 @@ const slackEntitySchema = z.discriminatedUnion("entity_type", [entity.extend({
2388
2372
  entity_type: z.literal("slack#/entities/task"),
2389
2373
  entity_payload: payload.extend({ fields: z.strictObject({ status: z.strictObject({ value: z.string() }).optional() }).optional() })
2390
2374
  })]);
2391
- //#endregion
2392
- //#region src/chat/slack/outbound.ts
2375
+ // src/chat/slack/outbound.ts
2393
2376
  const MAX_SLACK_MESSAGE_TEXT_CHARS = 4e4;
2394
2377
  function requireSlackConversationId(channelId, action) {
2395
2378
  const normalized = normalizeSlackConversationId(channelId);
@@ -2579,8 +2562,7 @@ async function removeReactionFromMessage(input) {
2579
2562
  }
2580
2563
  return { ok: true };
2581
2564
  }
2582
- //#endregion
2583
- //#region src/chat/slack/status-format.ts
2565
+ // src/chat/slack/status-format.ts
2584
2566
  const SLACK_STATUS_MAX_LENGTH = 50;
2585
2567
  /** Truncate a status string to fit Slack's 50-char assistant status limit. */
2586
2568
  function truncateStatusText(text) {
@@ -2589,8 +2571,7 @@ function truncateStatusText(text) {
2589
2571
  if (trimmed.length <= SLACK_STATUS_MAX_LENGTH) return trimmed;
2590
2572
  return `${trimmed.slice(0, 47).trimEnd()}...`;
2591
2573
  }
2592
- //#endregion
2593
- //#region src/chat/slack/mrkdwn.ts
2574
+ // src/chat/slack/mrkdwn.ts
2594
2575
  /** Escape dynamic text for Slack mrkdwn without changing intended formatting. */
2595
2576
  function escapeSlackMrkdwnText(text) {
2596
2577
  return text.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
@@ -2652,7 +2633,7 @@ function hasUnmatchedClosingParen(text) {
2652
2633
  function readBareUrl(line, start) {
2653
2634
  let end = start;
2654
2635
  while (end < line.length) {
2655
- const ch = line[end];
2636
+ const ch = line.charAt(end);
2656
2637
  if (/\s/.test(ch) || ch === "<" || ch === ">" || ch === "\"" || ch === "`" || ch === "|" || ch === "*") break;
2657
2638
  end++;
2658
2639
  }
@@ -2757,8 +2738,7 @@ function ensureBlockSpacing(text) {
2757
2738
  const lines = text.split("\n");
2758
2739
  const result = [];
2759
2740
  let inCodeBlock = false;
2760
- for (let i = 0; i < lines.length; i++) {
2761
- const line = lines[i];
2741
+ for (const line of lines) {
2762
2742
  if (codeBlockPattern.test(line.trimStart())) {
2763
2743
  if (!inCodeBlock) {
2764
2744
  const prev = result.length > 0 ? result[result.length - 1] : void 0;
@@ -2802,8 +2782,7 @@ function normalizeSlackStatusText(text) {
2802
2782
  function slackMention(userId) {
2803
2783
  return `<@${userId}>`;
2804
2784
  }
2805
- //#endregion
2806
- //#region src/chat/automations/revision.ts
2785
+ // src/chat/automations/revision.ts
2807
2786
  /** Storage revisions prevent stale edits from replacing newer values. */
2808
2787
  var AutomationConflictError = class extends ToolInputError {
2809
2788
  constructor() {
@@ -2825,8 +2804,7 @@ function automationRevision(task) {
2825
2804
  function requireAutomationRevision(task, revision) {
2826
2805
  if (!task || automationRevision(task) !== revision) throw new AutomationConflictError();
2827
2806
  }
2828
- //#endregion
2829
- //#region src/chat/automations/versions.ts
2807
+ // src/chat/automations/versions.ts
2830
2808
  /** Automation versions keep each saved definition so people can see how it changed. */
2831
2809
  /** Return the versioned part of an Automation. Lifecycle and run state are excluded. */
2832
2810
  function automationDefinition(task) {
@@ -2909,12 +2887,9 @@ async function readAutomationVersion(db, automationId, version) {
2909
2887
  async function listAutomationVersions(db, automationId, limit) {
2910
2888
  return (await db.select(versionColumns).from(juniorAutomationVersions).innerJoin(juniorAutomations, eq(juniorAutomations.id, juniorAutomationVersions.automationId)).where(eq(juniorAutomationVersions.automationId, automationId)).orderBy(desc(juniorAutomationVersions.version)).limit(limit)).map(parseVersionRow);
2911
2889
  }
2912
- //#endregion
2913
- //#region src/chat/event-automations/run-limit.ts
2890
+ // src/chat/event-automations/run-limit.ts
2914
2891
  const RUN_LIST_PREFIX = "junior:event_automation_runs:v1";
2915
2892
  const RUN_LIST_BURST_ROOM = 100;
2916
- /** Length of the rolling window for the run limit. */
2917
- const EVENT_AUTOMATION_RUN_WINDOW_MS = 36e5;
2918
2893
  const runEntrySchema = z.union([z.object({
2919
2894
  atMs: z.number().finite(),
2920
2895
  id: z.string().min(1)
@@ -2923,21 +2898,34 @@ function runListKey(automationId) {
2923
2898
  return `${RUN_LIST_PREFIX}:${automationId}`;
2924
2899
  }
2925
2900
  function runListMaxLength() {
2926
- return botConfig.maxEventAutomationRunsPerHour + RUN_LIST_BURST_ROOM;
2901
+ return botConfig.maxEventAutomationRuns + RUN_LIST_BURST_ROOM;
2927
2902
  }
2928
2903
  async function appendRunEntry(state, automationId, entry) {
2929
2904
  await state.connect();
2930
2905
  await state.appendToList(runListKey(automationId), entry, {
2931
2906
  maxLength: runListMaxLength(),
2932
- ttlMs: EVENT_AUTOMATION_RUN_WINDOW_MS
2907
+ ttlMs: botConfig.eventAutomationRunWindowMs
2933
2908
  });
2934
2909
  }
2910
+ function describeRunWindow(windowMs) {
2911
+ for (const [unit, unitMs] of [
2912
+ ["day", 864e5],
2913
+ ["hour", 36e5],
2914
+ ["minute", 6e4],
2915
+ ["second", 1e3]
2916
+ ]) if (windowMs % unitMs === 0) {
2917
+ const count = windowMs / unitMs;
2918
+ return count === 1 ? unit : `${count} ${unit}s`;
2919
+ }
2920
+ return `${windowMs} ms`;
2921
+ }
2935
2922
  /** Reason stored on an Event automation that the run limit blocked. */
2936
2923
  function eventAutomationRunLimitReason() {
2937
- return `This automation reached its limit of ${botConfig.maxEventAutomationRunsPerHour} runs per hour. Check that its trigger is not too broad, then resume it.`;
2924
+ const window = describeRunWindow(botConfig.eventAutomationRunWindowMs);
2925
+ return `This automation reached its limit of ${botConfig.maxEventAutomationRuns} runs per ${window}. Check that its trigger is not too broad, then resume it.`;
2938
2926
  }
2939
2927
  /**
2940
- * Count one run of an Event automation, or refuse when its hour is full.
2928
+ * Count one run of an Event automation, or refuse when its window is full.
2941
2929
  *
2942
2930
  * `runKey` is the dispatch idempotency key, so a provider retry of the same
2943
2931
  * Event does not count again.
@@ -2948,7 +2936,7 @@ async function admitEventAutomationRun(args) {
2948
2936
  atMs: args.nowMs,
2949
2937
  id: args.runKey
2950
2938
  });
2951
- const windowStartMs = args.nowMs - EVENT_AUTOMATION_RUN_WINDOW_MS;
2939
+ const windowStartMs = args.nowMs - botConfig.eventAutomationRunWindowMs;
2952
2940
  const values = await state.getList(runListKey(args.automationId));
2953
2941
  const entries = values.flatMap((value) => {
2954
2942
  const entry = runEntrySchema.safeParse(value);
@@ -2964,7 +2952,7 @@ async function admitEventAutomationRun(args) {
2964
2952
  for (const entry of entries.slice(lastReset + 1)) {
2965
2953
  if ("reset" in entry) continue;
2966
2954
  if (entry.atMs > windowStartMs) runKeys.add(entry.id);
2967
- if (entry.id === args.runKey) return full || runKeys.size > botConfig.maxEventAutomationRunsPerHour ? "limited" : "allowed";
2955
+ if (entry.id === args.runKey) return full || runKeys.size > botConfig.maxEventAutomationRuns ? "limited" : "allowed";
2968
2956
  }
2969
2957
  return "limited";
2970
2958
  }
@@ -2978,8 +2966,7 @@ async function admitEventAutomationRun(args) {
2978
2966
  async function clearEventAutomationRuns(automationId, state = getStateAdapter()) {
2979
2967
  await appendRunEntry(state, automationId, { reset: true });
2980
2968
  }
2981
- //#endregion
2982
- //#region src/chat/event-automations/store.ts
2969
+ // src/chat/event-automations/store.ts
2983
2970
  /**
2984
2971
  * Validate an event automation and split it into its SQL columns. Lifecycle
2985
2972
  * columns are written separately.
@@ -3161,8 +3148,7 @@ async function blockEventAutomation(db, id, reason) {
3161
3148
  statusReason: reason
3162
3149
  }).where(and(eventAutomationWhere(id), or(eq(juniorAutomations.status, "active"), and(eq(juniorAutomations.status, "paused"), sql`${juniorAutomations.statusReason} is distinct from ${reason}`)))).returning({ status: juniorAutomations.status }))[0]?.status === "blocked";
3163
3150
  }
3164
- //#endregion
3165
- //#region src/chat/scheduled-automations/tasks.ts
3151
+ // src/chat/scheduled-automations/tasks.ts
3166
3152
  const SCHEDULER_KEY_PREFIX = "junior:scheduler";
3167
3153
  /** Decode a Scheduled automation row. Returns undefined for an invalid row. */
3168
3154
  function parseScheduledAutomationRow(row) {
@@ -3284,5 +3270,4 @@ async function saveScheduledAutomation(db, task, expectedRevision, editedBy) {
3284
3270
  async function saveScheduledAutomationInLock(db, task, current) {
3285
3271
  await writeScheduledAutomation(db, requireStoredTask(task), current);
3286
3272
  }
3287
- //#endregion
3288
3273
  export { recordTurnSummary as $, buildConversationContext as $t, escapeSlackMrkdwnText as A, loadTurnProjection as At, postSlackMessage as B, recordSubscribedReplyRoute as Bt, automationVersionOf as C, ToolInputError as Ct, AutomationConflictError as D, loadConversationProjection as Dt, sameDefinitionValue as E, loadConnectedMcpProviders as Et, truncateStatusText as F, recordAuthenticationLinked as Ft, continuableMessages as G, persistConversationMessages as Gt, uploadFilesToConversation as H, recordTurnRoute as Ht, addReactionToMessage as I, recordAuthorizationCompleted as It, abandonTurnRecord as J, resolveConversationTitle as Jt, loadTurnCheckpoint as K, projectConversationMessages as Kt, getSlackMessagePermalink as L, recordAuthorizationRequested as Lt, normalizeSlackReplyMarkdown as M, openConversationProjection as Mt, normalizeSlackStatusText as N, recordAgentsInstructionsUpdated as Nt, automationRevision as O, loadLastModelProfile as Ot, slackMention as P, recordAttachmentsDelivered as Pt, listTurnSummaries as Q, appendThreadContextMessages as Qt, openSlackDirectMessage as R, recordGuardianActionReviewed as Rt, automationDefinition as S, TURN_CONTEXT_TAG as St, readAutomationVersion as T, commitMessages as Tt, slackEntitySchema as U, appendConversationMessages as Ut, removeReactionFromMessage as V, recordToolExecutionStarted as Vt, slackExternalRefIdSchema as W, hydrateConversationMessages as Wt, failTurnRecord as X, fallbackShortTitle as Xt, completeTurnRecord as Y, settleConversationTitleWork as Yt, getTurnRecord as Z, resolveTaskTitle as Zt, parseEventAutomationRow as _, isToolResultMessage as _t, saveScheduledAutomation as a, normalizeConversationText as an, buildTurnErrorResponse as at, admitEventAutomationRun as b, stripRuntimeTurnContext as bt, withScheduledAutomationLock as c, upsertConversationMessage as cn, extractAssistantText as ct, createEventAutomation as d, getAgentContextInputLimitTokens as dn, getUserMessageInstructionText as dt, createConversationMemoryService as en, persistWithRetry as et, deleteEventAutomation as f, historyItemFromPiMessage as fn, hasRuntimeTurnContext as ft, listEventAutomationsForTeam as g, isToolResultError as gt, listDeletedEventAutomationsCreatedBy as h, isContinuablePiBoundary as ht, readScheduledAutomation as i, markConversationMessage as in, TurnToolCallLimitExceededError as it, formatSlackLink as j, loadTurnRoute as jt, requireAutomationRevision as k, loadProjection as kt, blockEventAutomation as l, estimateTextTokens as ln, getPiMessageRole as lt, getEventAutomation as m, isAssistantMessage as mt, listScheduledAutomationsForTeam as n, getConversationMessageSlackTs as nn, TurnBudgetExceededError as nt, saveScheduledAutomationInLock as o, recordDeliveredAssistantMessage as on, createTurnLimitGate as ot, findMatchingEventAutomations as p, piMessageFromHistoryItem as pn, instructionTextForProjection as pt, saveTurnCheckpoint as q, persistConversationMessageSummaries as qt, parseScheduledAutomationRow as r, isHumanConversationMessage as rn, TurnSliceLimitExceededError as rt, scheduledRunId as s, turnHasReply as sn, isTurnExecutionLimitExceededError as st, createScheduledAutomation as t, estimateConversationContextTokens as tn, TURN_LIMIT_DISABLED_REASON as tt, collectEventAutomationMatchKeys as u, getAgentContextCompactionTriggerTokens as un, getTerminalAssistantMessages as ut, saveEventAutomation as v, normalizeToolNameFromResult as vt, listAutomationVersions as w, commitAcceptedReply as wt, eventAutomationRunLimitReason as x, trimTrailingAssistantMessages as xt, setEventAutomationStatus as y, retainRuntimeTurnContext as yt, postSlackEphemeralMessage as z, recordMcpProviderConnected as zt };
@@ -1,18 +1,17 @@
1
- import { B as toOptionalNumber, V as toOptionalString, z as isRecord } from "./logging-CWxiIuCF.js";
2
- import { f as getDb } from "./viewer-DSZXygMU.js";
3
- import { d as juniorDestinations } from "./agent-invocations-Bdu3ROfo.js";
4
- import { l as juniorLocationConfigurations } from "./executor-Do0THDRR.js";
5
- import { Gt as persistConversationMessages } from "./tasks-D_WIJtvO.js";
6
- import { it as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-BjtTzvru.js";
7
- import { w as getStateAdapter } from "./profile-h-72wM78.js";
1
+ import { B as toOptionalNumber, V as toOptionalString, z as isRecord } from "./logging-BStXN56b.js";
2
+ import { d as getDb } from "./viewer-B2_ABsYi.js";
3
+ import { d as juniorDestinations } from "./agent-invocations-Qfz7dWgU.js";
4
+ import { l as juniorLocationConfigurations } from "./executor-Bb3eQb8q.js";
5
+ import { Gt as persistConversationMessages } from "./tasks-DieKX3d4.js";
6
+ import { it as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-B00FaKdP.js";
7
+ import { r as getStateAdapter } from "./adapter-Bn0gFVSF.js";
8
8
  import { z } from "zod";
9
9
  import { randomUUID } from "node:crypto";
10
10
  import { and, eq, sql } from "drizzle-orm";
11
- //#region src/chat/configuration/types.ts
11
+ // src/chat/configuration/types.ts
12
12
  /** JSON value accepted by Location configuration. */
13
13
  const configValueSchema = z.json();
14
- //#endregion
15
- //#region src/chat/configuration/validation.ts
14
+ // src/chat/configuration/validation.ts
16
15
  const CONFIG_KEY_RE = /^[a-z0-9]+(?:\.[a-z0-9-]+)+$/;
17
16
  const SECRET_KEY_RE = /(?:^|[_.-])(token|secret|password|passphrase|api[-_]?key|private[-_]?key|credential|auth)(?:$|[_.-])/i;
18
17
  const SECRET_VALUE_PATTERNS = [
@@ -51,8 +50,7 @@ function validateConfigValue(value) {
51
50
  collectStringValues(value, stringValues);
52
51
  for (const text of stringValues) for (const pattern of SECRET_VALUE_PATTERNS) if (pattern.test(text)) return "Configuration value appears to contain secret material and is not allowed";
53
52
  }
54
- //#endregion
55
- //#region src/chat/configuration/service.ts
53
+ // src/chat/configuration/service.ts
56
54
  function sanitizeEntry(value) {
57
55
  if (!isRecord(value)) return;
58
56
  const key = toOptionalString(value.key);
@@ -123,8 +121,7 @@ function createLocationConfigurationService(storage) {
123
121
  resolveValues
124
122
  };
125
123
  }
126
- //#endregion
127
- //#region src/chat/configuration/sql.ts
124
+ // src/chat/configuration/sql.ts
128
125
  /** Resolve or create the canonical Location for a Slack Destination. */
129
126
  async function resolveLocationId(db, destination) {
130
127
  const channelId = destination.channelId;
@@ -248,8 +245,7 @@ function createDurableLocationConfigurationService(args) {
248
245
  }
249
246
  });
250
247
  }
251
- //#endregion
252
- //#region src/chat/state/conversation.ts
248
+ // src/chat/state/conversation.ts
253
249
  function defaultConversationState() {
254
250
  return {
255
251
  schemaVersion: 1,
@@ -335,8 +331,7 @@ function buildConversationStatePatch(conversation) {
335
331
  processing: { ...conversation.processing }
336
332
  } };
337
333
  }
338
- //#endregion
339
- //#region src/chat/runtime/thread-state.ts
334
+ // src/chat/runtime/thread-state.ts
340
335
  function threadStateKey(threadId) {
341
336
  return `thread-state:${threadId}`;
342
337
  }
@@ -428,5 +423,4 @@ function getLocationConfigurationService(destination) {
428
423
  loadLegacy: async () => await getLegacyChannelState(destination.channelId)
429
424
  });
430
425
  }
431
- //#endregion
432
426
  export { persistThreadState as a, configValueSchema as c, persistThreadRuntimeState as i, getPersistedSandboxState as n, persistThreadStateById as o, getPersistedThreadState as r, coerceThreadConversationState as s, getLocationConfigurationService as t };
@@ -1,14 +1,14 @@
1
- import { _ as getProviderErrorUserMessage, g as getProviderErrorAttributes, h as findProviderError, p as ProviderError } from "./client-D8HnkOQX.js";
2
- import { t as buildTurnFailureResponse, z as isRecord } from "./logging-CWxiIuCF.js";
3
- import { g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
4
- import { f as getDb, l as getConversationEventStore } from "./viewer-DSZXygMU.js";
5
- import { Wt as hydrateConversationMessages, in as markConversationMessage } from "./tasks-D_WIJtvO.js";
6
- import { Nt as listConversationAnnotations } from "./agent-hooks-BjtTzvru.js";
7
- import { J as removedCardSchema, Y as resolveMessageCards, q as readMessageCardRefs } from "./conversation-CKNLYBJt.js";
8
- import { r as clearPendingAuth, u as buildDeterministicTurnId } from "./pending-auth-s_QFribU.js";
9
- import { d as markTurnCompleted, u as markTurnClosed } from "./oauth-authorization-BA4Dt6a7.js";
10
- import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-Ch4yuCqG.js";
11
- //#region src/chat/conversations/pending-cards.ts
1
+ import { _ as getProviderErrorAttributes, g as findProviderError, m as ProviderError, v as getProviderErrorUserMessage } from "./client-BZdxgKyL.js";
2
+ import { t as buildTurnFailureResponse, z as isRecord } from "./logging-BStXN56b.js";
3
+ import { g as parseSlackMessageTs } from "./actor-tlxzqaRe.js";
4
+ import { c as getConversationEventStore, d as getDb } from "./viewer-B2_ABsYi.js";
5
+ import { Wt as hydrateConversationMessages, in as markConversationMessage } from "./tasks-DieKX3d4.js";
6
+ import { Nt as listConversationAnnotations } from "./agent-hooks-B00FaKdP.js";
7
+ import { J as removedCardSchema, Y as resolveMessageCards, q as readMessageCardRefs } from "./conversation-DjN3mlog.js";
8
+ import { d as buildDeterministicTurnId, r as clearPendingAuth } from "./pending-auth-rG5U_QS1.js";
9
+ import { d as markTurnCompleted, u as markTurnClosed } from "./oauth-authorization-djQn5Nhy.js";
10
+ import { o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-DpSWS4Rr.js";
11
+ // src/chat/conversations/pending-cards.ts
12
12
  /** Select undelivered cards and load their latest saved facts. */
13
13
  async function loadPendingMessageCards(conversationId) {
14
14
  const cards = /* @__PURE__ */ new Map();
@@ -41,15 +41,13 @@ async function loadPendingMessageCards(conversationId) {
41
41
  if (cards.size === 0) return [];
42
42
  return resolveMessageCards([...cards.values()].reverse(), await listConversationAnnotations(getDb(), conversationId));
43
43
  }
44
- //#endregion
45
- //#region src/chat/interruption-marker.ts
44
+ // src/chat/interruption-marker.ts
46
45
  const INTERRUPTED_MARKER = "\n\n[Response interrupted before completion]";
47
46
  /** Return the marker added when a visible reply ended mid-execution. */
48
47
  function getInterruptionMarker() {
49
48
  return INTERRUPTED_MARKER;
50
49
  }
51
- //#endregion
52
- //#region src/chat/runtime/delivered-turn-state.ts
50
+ // src/chat/runtime/delivered-turn-state.ts
53
51
  /** Build state after destination delivery or intentional no-reply completion. */
54
52
  function buildDeliveredTurnStatePatch(args) {
55
53
  const conversation = structuredClone(args.conversation);
@@ -68,8 +66,7 @@ function buildDeliveredTurnStatePatch(args) {
68
66
  sandboxRef: args.reply.sandboxRef
69
67
  };
70
68
  }
71
- //#endregion
72
- //#region src/chat/runtime/turn-user-message.ts
69
+ // src/chat/runtime/turn-user-message.ts
73
70
  /** Return the user message for a persisted turn/session, if one exists. */
74
71
  function getTurnUserMessage(conversation, sessionId) {
75
72
  for (let index = conversation.messages.length - 1; index >= 0; index -= 1) {
@@ -96,8 +93,7 @@ function getTurnUserReplyAttachmentContext(message) {
96
93
  ...!imagesHydrated && imageAttachmentCount > 0 ? { omittedImageAttachmentCount: imageAttachmentCount } : void 0
97
94
  };
98
95
  }
99
- //#endregion
100
- //#region src/chat/runtime/auth-pause-state.ts
96
+ // src/chat/runtime/auth-pause-state.ts
101
97
  /** Mark an auth-paused turn complete after private authorization link delivery. */
102
98
  function completeAuthPauseTurn(args) {
103
99
  markConversationMessage(args.conversation, getTurnUserMessageId(args.conversation, args.sessionId), {
@@ -124,8 +120,7 @@ async function persistAuthPauseTurnState(args) {
124
120
  });
125
121
  await persistThreadStateById(args.threadStateId, { conversation });
126
122
  }
127
- //#endregion
128
- //#region src/chat/services/turn-failure-response.ts
123
+ // src/chat/services/turn-failure-response.ts
129
124
  /** Require captured turn failures to carry a real Sentry event reference. */
130
125
  function requireTurnFailureEventId(eventId, eventName) {
131
126
  if (!eventId) throw new Error(`Sentry did not return an event ID for ${eventName}`);
@@ -202,5 +197,4 @@ function finalizeFailedTurnReplyWithEvent(args) {
202
197
  }
203
198
  };
204
199
  }
205
- //#endregion
206
200
  export { persistAuthPauseTurnState as a, getTurnUserSlackMessageTs as c, loadPendingMessageCards as d, completeAuthPauseTurn as i, buildDeliveredTurnStatePatch as l, getAgentTurnDiagnosticsAttributes as n, getTurnUserMessage as o, requireTurnFailureEventId as r, getTurnUserReplyAttachmentContext as s, finalizeFailedTurnReplyWithEvent as t, getInterruptionMarker as u };
@@ -1,5 +1,5 @@
1
- import { l as getConversationEventStore } from "./viewer-DSZXygMU.js";
2
- //#region src/chat/conversations/turn-lifecycle.ts
1
+ import { c as getConversationEventStore } from "./viewer-B2_ABsYi.js";
2
+ // src/chat/conversations/turn-lifecycle.ts
3
3
  /** Persist correlated turn lifecycle facts with retry-safe terminal exclusion. */
4
4
  var ConversationTurnLifecycleService = class {
5
5
  events;
@@ -50,5 +50,4 @@ var ConversationTurnLifecycleService = class {
50
50
  function getTurnLifecycle() {
51
51
  return new ConversationTurnLifecycleService(getConversationEventStore());
52
52
  }
53
- //#endregion
54
53
  export { getTurnLifecycle as n, ConversationTurnLifecycleService as t };
@@ -1,4 +1,4 @@
1
- //#region src/chat/services/turn-session-routing.ts
1
+ // src/chat/services/turn-session-routing.ts
2
2
  async function loadConversationChain(conversationId, conversationStore) {
3
3
  const chain = [];
4
4
  const seen = /* @__PURE__ */ new Set();
@@ -34,7 +34,7 @@ function slackSourceForDestination(args) {
34
34
  * Reads parent Conversations when this Conversation has no Destination.
35
35
  */
36
36
  async function resolveConversationRouting(args) {
37
- const conversationStore = args.conversationStore ?? (await import("./viewer-DSZXygMU.js").then((n) => n.c)).getConversationStore();
37
+ const conversationStore = args.conversationStore ?? (await import("./viewer-B2_ABsYi.js").then((n) => n.s)).getConversationStore();
38
38
  const chain = await loadConversationChain(args.conversationId, conversationStore);
39
39
  let destination;
40
40
  let source;
@@ -73,5 +73,4 @@ async function resolveTurnSessionRouting(args) {
73
73
  source: routing.source
74
74
  };
75
75
  }
76
- //#endregion
77
76
  export { resolveTurnSessionRouting as n, resolveConversationRouting as t };
@@ -1,7 +1,7 @@
1
- import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
2
- import { n as pluginCatalogRuntime } from "./catalog-runtime-CZzhGQ7F.js";
1
+ import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.js";
2
+ import { n as pluginCatalogRuntime } from "./catalog-runtime-B8SuFPGb.js";
3
3
  import { isDeepStrictEqual } from "node:util";
4
- //#region src/chat/plugins/validation.ts
4
+ // src/chat/plugins/validation.ts
5
5
  var validation_exports = /* @__PURE__ */ __exportAll({
6
6
  validatePluginEgressCredentialHooks: () => validatePluginEgressCredentialHooks,
7
7
  validatePluginRegistrations: () => validatePluginRegistrations
@@ -35,5 +35,4 @@ function validatePluginEgressCredentialHooks(registrations) {
35
35
  if (!hasDomains && !hasGenericCredentials) throw new Error(`Plugin "${provider.manifest.name}" egress credential hooks require manifest.domains to list sandbox egress hosts.`);
36
36
  }
37
37
  }
38
- //#endregion
39
38
  export { validatePluginRegistrations as n, validation_exports as r, validatePluginEgressCredentialHooks as t };
package/dist/vercel.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/vercel.d.ts
2
1
  export interface JuniorVercelConfigOptions {
3
2
  /** Override the Vercel build command, or pass null to omit it. */
4
3
  buildCommand?: string | null;
@@ -8,5 +7,4 @@ export interface JuniorVercelConfigOptions {
8
7
  * New apps run `junior upgrade` before `pnpm build`; older installs without
9
8
  * Junior SQL configured can override `buildCommand` to keep their prior build.
10
9
  */
11
- export declare function juniorVercelConfig(options?: JuniorVercelConfigOptions): Record<string, unknown>;
12
- //#endregion
10
+ export declare function juniorVercelConfig(options?: JuniorVercelConfigOptions): Record<string, unknown>;
package/dist/vercel.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/vercel.ts
1
+ // src/vercel.ts
2
2
  /** Return the root Vercel project config for scaffolded Junior apps.
3
3
  *
4
4
  * New apps run `junior upgrade` before `pnpm build`; older installs without
@@ -10,5 +10,4 @@ function juniorVercelConfig(options = {}) {
10
10
  if (buildCommand !== null) config.buildCommand = buildCommand;
11
11
  return config;
12
12
  }
13
- //#endregion
14
13
  export { juniorVercelConfig };
@@ -1,8 +1,6 @@
1
- //#region package.json
2
- var version = "0.257.0";
3
- //#endregion
4
- //#region src/version.ts
1
+ // package.json
2
+ var version = "0.259.0";
3
+ // src/version.ts
5
4
  /** Installed Junior package version, or `unknown` when package metadata is unavailable. */
6
5
  const JUNIOR_VERSION = typeof version === "string" && version.trim() ? version : "unknown";
7
- //#endregion
8
6
  export { JUNIOR_VERSION as t };
@@ -1,5 +1,3 @@
1
- //#region src/version.d.ts
2
1
  /** Installed Junior package version, or `unknown` when package metadata is unavailable. */
3
2
  declare const JUNIOR_VERSION: string;
4
- //#endregion
5
3
  export { JUNIOR_VERSION as t };
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as JUNIOR_VERSION } from "./version-CnXZ614E.js";
1
+ import { t as JUNIOR_VERSION } from "./version-Cc2OFd9G.js";
2
2
  export { JUNIOR_VERSION };