@sentry/junior 0.175.0 → 0.176.1

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 (61) hide show
  1. package/dist/{agent-hooks-DOXAOEHI.js → agent-hooks-ZCRXEWPE.js} +12 -12
  2. package/dist/api.js +26 -26
  3. package/dist/app.js +256 -342
  4. package/dist/{catalog-runtime-OTFZT3R2.js → catalog-runtime-O7ZMK27R.js} +5 -5
  5. package/dist/chat/agent-dispatch/heartbeat.d.ts +1 -1
  6. package/dist/chat/agent-dispatch/store.d.ts +3 -16
  7. package/dist/chat/resource-events/catalog.d.ts +2 -2
  8. package/dist/chat/resource-events/notification.d.ts +1 -1
  9. package/dist/{chunk-2XWTVTLS.js → chunk-425VJ2C7.js} +1 -1
  10. package/dist/{chunk-RG6JSBDJ.js → chunk-4BO7CQTP.js} +1 -1
  11. package/dist/{chunk-2AEUOTQL.js → chunk-4OLTNDE5.js} +1 -1
  12. package/dist/{chunk-YMBCD6FB.js → chunk-53D4PCKF.js} +6 -6
  13. package/dist/{chunk-RAV6B2TQ.js → chunk-7V5CF6SH.js} +2 -2
  14. package/dist/{chunk-UQURHDWJ.js → chunk-B74MKQA3.js} +4 -4
  15. package/dist/{chunk-2WCXOLNX.js → chunk-BTAXMONT.js} +2 -2
  16. package/dist/{chunk-HVI3ZLMV.js → chunk-BV66CCPV.js} +1 -1
  17. package/dist/{chunk-DVWHUWTB.js → chunk-DKQC4BZG.js} +12 -12
  18. package/dist/{chunk-JLHYNMXZ.js → chunk-DKXXKOHJ.js} +6 -6
  19. package/dist/{chunk-GBDCHVNI.js → chunk-F4K7AAHQ.js} +5 -5
  20. package/dist/{chunk-I7F7WVUW.js → chunk-FFQR4YEB.js} +6 -6
  21. package/dist/{chunk-K4SGLRWX.js → chunk-G26PYGXP.js} +6 -6
  22. package/dist/{chunk-XL24YNNO.js → chunk-GUIEHC3H.js} +1 -1
  23. package/dist/{chunk-CSV5XEQN.js → chunk-H4WJ6GCS.js} +1 -1
  24. package/dist/{chunk-T3RN2B3T.js → chunk-I2OSXB2S.js} +13 -55
  25. package/dist/{chunk-PQV33DEV.js → chunk-I7VX7SFH.js} +4 -4
  26. package/dist/{chunk-HHAR5IDU.js → chunk-IKIQ6N44.js} +6 -6
  27. package/dist/{chunk-DSZNZ7AW.js → chunk-KMZ54JGE.js} +18 -18
  28. package/dist/{chunk-NBE6DME6.js → chunk-NBASTXA5.js} +1 -1
  29. package/dist/{chunk-RMANRIHC.js → chunk-O72OX3BI.js} +5 -5
  30. package/dist/{chunk-WHKREAVX.js → chunk-OCK3LT7D.js} +1 -1
  31. package/dist/{chunk-6KKCC7CG.js → chunk-OYQSJ2NN.js} +4 -4
  32. package/dist/{chunk-46BUAC7H.js → chunk-QD27ZPYB.js} +3 -3
  33. package/dist/{chunk-VMVTHLJM.js → chunk-QHEYFDCZ.js} +1 -1
  34. package/dist/{chunk-WNQBHYAQ.js → chunk-RTNSAKYV.js} +1 -1
  35. package/dist/{chunk-KGKKBFOI.js → chunk-SZPWKEVR.js} +1 -1
  36. package/dist/{chunk-YUUMDYLN.js → chunk-VRWFZY2Q.js} +1 -1
  37. package/dist/{chunk-GLYH4OBP.js → chunk-X3M2JJGL.js} +1 -1
  38. package/dist/{chunk-TYSWSX3M.js → chunk-XGGLAKES.js} +8 -8
  39. package/dist/{chunk-4CVWSS6Q.js → chunk-YGIPCZZD.js} +1 -1
  40. package/dist/{chunk-V7QS3Z53.js → chunk-ZO7WMPPR.js} +17 -17
  41. package/dist/cli/chat.js +30 -30
  42. package/dist/cli/check.js +6 -6
  43. package/dist/cli/plugins.js +13 -13
  44. package/dist/cli/snapshot-create.js +10 -10
  45. package/dist/cli/upgrade.js +7 -7
  46. package/dist/{db-B7NVPW7Y.js → db-N4UWAT3N.js} +7 -7
  47. package/dist/instrumentation.js +4 -4
  48. package/dist/nitro.js +2 -2
  49. package/dist/{oauth-callback-server-TMTQK74Z.js → oauth-callback-server-BYURWP3V.js} +23 -23
  50. package/dist/{runner-HROVFS4C.js → runner-AYSX73AQ.js} +15 -15
  51. package/dist/{skills-77LC6PFU.js → skills-L4ZYR5E3.js} +6 -6
  52. package/dist/spawn-GXHJJJYU.js +37 -0
  53. package/dist/{validation-EL4J4FYB.js → validation-AAFNNQUZ.js} +6 -6
  54. package/dist/version.js +1 -1
  55. package/dist/{work-5UQRXUOD.js → work-JHA35XRS.js} +18 -18
  56. package/dist/worker-F3BYG2FG.js +24 -0
  57. package/package.json +5 -5
  58. package/dist/chat/agent-dispatch/signing.d.ts +0 -14
  59. package/dist/handlers/agent-dispatch.d.ts +0 -12
  60. package/dist/spawn-JBWVVXIL.js +0 -37
  61. package/dist/worker-3FBM4GWV.js +0 -24
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-XL24YNNO.js";
4
- import "./chunk-2AEUOTQL.js";
3
+ } from "./chunk-GUIEHC3H.js";
4
+ import "./chunk-4OLTNDE5.js";
5
5
  import "./chunk-CGA4ERJ5.js";
6
6
  import "./chunk-M63DETLL.js";
7
- import "./chunk-VMVTHLJM.js";
7
+ import "./chunk-QHEYFDCZ.js";
8
8
  import "./chunk-6GWA276C.js";
9
9
  import "./chunk-OOUNJNMR.js";
10
10
  import "./chunk-H4HBKISO.js";
11
- import "./chunk-HVI3ZLMV.js";
12
- import "./chunk-4CVWSS6Q.js";
11
+ import "./chunk-BV66CCPV.js";
12
+ import "./chunk-YGIPCZZD.js";
13
13
  import "./chunk-MLKGABMK.js";
14
14
  export {
15
15
  pluginCatalogRuntime
@@ -6,7 +6,7 @@ export declare function runPluginHeartbeats(args: {
6
6
  nowMs: number;
7
7
  }): Promise<void>;
8
8
  /**
9
- * Repair bounded dispatch mailbox appends, including pre-cutover records.
9
+ * Repair bounded dispatch mailbox appends that crashed before enqueue.
10
10
  *
11
11
  * This index is only an ingress receipt; conversation work owns execution,
12
12
  * leases, retries, and continuation after the mailbox append succeeds.
@@ -1,20 +1,12 @@
1
1
  import type { BoundDispatchOptions, DispatchCreateResult, DispatchProjection, DispatchRecord, DispatchStatus } from "./types";
2
2
  /** Return the durable key for one plugin-facing dispatch projection. */
3
3
  export declare function getDispatchStorageKey(id: string): string;
4
- /** Parse current and rollout-compatible dispatch projection records. */
4
+ /** Parse one durable dispatch projection record. */
5
5
  export declare function parseDispatchRecord(value: unknown): DispatchRecord | undefined;
6
6
  /** Return the isolated durable conversation id for one dispatch. */
7
7
  export declare function getDispatchConversationId(dispatch: Pick<DispatchRecord, "id">): string;
8
8
  /** Return the stable synthetic input message id for one dispatch turn. */
9
9
  export declare function getDispatchInputMessageId(dispatchId: string): string;
10
- /**
11
- * Return the synthetic input id written by the pre-conversation-work runner.
12
- *
13
- * TODO(v0.116.0): Remove after v0.114 dispatch sessions can no longer resume.
14
- */
15
- export declare function getLegacyDispatchInputMessageId(dispatchId: string): string;
16
- /** Return every persisted input id accepted while resuming one dispatch. */
17
- export declare function getDispatchInputMessageIds(dispatchId: string): readonly string[];
18
10
  /** Return the stable turn id used by every run of one dispatch. */
19
11
  export declare function getDispatchTurnId(dispatchId: string): string;
20
12
  /** Gate recovery to dispatches that can still make progress. */
@@ -41,13 +33,8 @@ export declare function markDispatchFailed(id: string, errorMessage: string, res
41
33
  export declare function confirmDispatchMailboxAppend(id: string): Promise<void>;
42
34
  /** List dispatches whose durable mailbox append may not have completed. */
43
35
  export declare function listPendingDispatchMailboxAppends(): Promise<string[]>;
44
- /**
45
- * Atomically move a rollout-era record behind conversation-owned execution.
46
- *
47
- * Rewriting the canonical record under the dispatch lock removes the callback
48
- * version/lease claim before mailbox work can become visible.
49
- */
50
- export declare function claimDispatchMailboxAppend(id: string, nowMs: number): Promise<DispatchRecord | undefined>;
36
+ /** Load the dispatch under lock before its mailbox append becomes visible. */
37
+ export declare function claimDispatchMailboxAppend(id: string): Promise<DispatchRecord | undefined>;
51
38
  /** Return a plugin-scoped dispatch projection without exposing raw runtime state. */
52
39
  export declare function getPluginDispatchProjection(args: {
53
40
  id: string;
@@ -16,8 +16,8 @@ export declare function registeredResourceTypeSchema(catalog: ResourceEventCatal
16
16
  }>;
17
17
  /** Return whether one enabled plugin declared an event type. */
18
18
  export declare function pluginSupportsEvent(catalog: ResourceEventCatalog, namespace: string, resourceType: string, eventType: string): boolean;
19
- /** Return install guidance for one registered resource event type. */
20
- export declare function resourceEventGuidance(catalog: ResourceEventCatalog, namespace: string, eventType: string): string | undefined;
19
+ /** Return app guidance for one registered resource type and event type. */
20
+ export declare function resourceEventGuidance(catalog: ResourceEventCatalog, namespace: string, resourceType: string, eventType: string): string | undefined;
21
21
  /** Normalize one selector with the convention declared by its plugin. */
22
22
  export declare function normalizeEventIdentifier(catalog: ResourceEventCatalog, namespace: string, identifier: string): string;
23
23
  export {};
@@ -13,7 +13,7 @@ export interface ResourceEventNotification {
13
13
  untrustedText?: string;
14
14
  }
15
15
  /** Render the runtime-owned conversation message for a subscribed event. */
16
- export declare function renderResourceEventNotificationText(subscription: Pick<ResourceEventSubscription, "intent" | "label">, event: Pick<ResourceEventNotification, "namespace" | "eventType" | "trustedSummary" | "data" | "untrustedText">): string;
16
+ export declare function renderResourceEventNotificationText(subscription: Pick<ResourceEventSubscription, "intent" | "label" | "resourceType">, event: Pick<ResourceEventNotification, "namespace" | "eventType" | "trustedSummary" | "data" | "untrustedText">): string;
17
17
  /** Enqueue a resource event as normal conversation mailbox input. */
18
18
  export declare function enqueueResourceEventNotification(args: {
19
19
  event: ResourceEventNotification;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FUNCTION_TIMEOUT_BUFFER_SECONDS,
3
3
  getChatConfig
4
- } from "./chunk-RAV6B2TQ.js";
4
+ } from "./chunk-7V5CF6SH.js";
5
5
 
6
6
  // src/chat/runtime/request-deadline.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DEFAULT_SQL_STATEMENT_TIMEOUT_MS
3
- } from "./chunk-RAV6B2TQ.js";
3
+ } from "./chunk-7V5CF6SH.js";
4
4
  import {
5
5
  juniorDestinations,
6
6
  timestamptz
@@ -5,7 +5,7 @@ import {
5
5
  logInfo,
6
6
  logWarn,
7
7
  setSpanAttributes
8
- } from "./chunk-VMVTHLJM.js";
8
+ } from "./chunk-QHEYFDCZ.js";
9
9
  import {
10
10
  discoverInstalledPluginPackageContent,
11
11
  normalizePluginPackageNames
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-PDO5BLNM.js";
4
4
  import {
5
5
  ToolInputError
6
- } from "./chunk-K4SGLRWX.js";
6
+ } from "./chunk-G26PYGXP.js";
7
7
  import {
8
8
  agentHistoryItemSchema,
9
9
  bindProviderConversation,
@@ -16,25 +16,25 @@ import {
16
16
  instructionProvenanceFor,
17
17
  sanitizePostgresJson,
18
18
  withConversationEventLock
19
- } from "./chunk-46BUAC7H.js";
19
+ } from "./chunk-QD27ZPYB.js";
20
20
  import {
21
21
  SANDBOX_REPOS_ROOT,
22
22
  SANDBOX_WORKSPACE_ROOT,
23
23
  sleep
24
- } from "./chunk-YUUMDYLN.js";
24
+ } from "./chunk-VRWFZY2Q.js";
25
25
  import {
26
26
  MUTATION_LOCK_TTL_MS,
27
27
  fenceLock,
28
28
  getStateAdapter,
29
29
  withLock
30
- } from "./chunk-CSV5XEQN.js";
30
+ } from "./chunk-H4WJ6GCS.js";
31
31
  import {
32
32
  botConfig,
33
33
  completeText,
34
34
  escapeXml,
35
35
  resolveGatewayModel,
36
36
  unwrapCurrentInstruction
37
- } from "./chunk-RAV6B2TQ.js";
37
+ } from "./chunk-7V5CF6SH.js";
38
38
  import {
39
39
  parseSlackMessageTs,
40
40
  toStoredSlackActor
@@ -44,7 +44,7 @@ import {
44
44
  logException,
45
45
  logWarn,
46
46
  setSpanAttributes
47
- } from "./chunk-VMVTHLJM.js";
47
+ } from "./chunk-QHEYFDCZ.js";
48
48
 
49
49
  // src/chat/turn-context-tag.ts
50
50
  var TURN_CONTEXT_TAG = "runtime-turn-context";
@@ -3,7 +3,7 @@ import {
3
3
  toCanonicalInputMessage,
4
4
  toCanonicalOutputMessage,
5
5
  toGenAiMessagesTraceAttributes
6
- } from "./chunk-NBE6DME6.js";
6
+ } from "./chunk-NBASTXA5.js";
7
7
  import {
8
8
  extractGenAiUsageAttributes,
9
9
  logException,
@@ -11,7 +11,7 @@ import {
11
11
  normalizeGenAiFinishReason,
12
12
  serializeGenAiAttribute,
13
13
  withSpan
14
- } from "./chunk-VMVTHLJM.js";
14
+ } from "./chunk-QHEYFDCZ.js";
15
15
 
16
16
  // src/chat/services/provider-error.ts
17
17
  var ProviderError = class extends Error {
@@ -4,18 +4,18 @@ import {
4
4
  isStale,
5
5
  runNonInteractiveCommand,
6
6
  sleep
7
- } from "./chunk-YUUMDYLN.js";
7
+ } from "./chunk-VRWFZY2Q.js";
8
8
  import {
9
9
  getStateAdapter
10
- } from "./chunk-CSV5XEQN.js";
10
+ } from "./chunk-H4WJ6GCS.js";
11
11
  import {
12
12
  toOptionalTrimmed
13
- } from "./chunk-RAV6B2TQ.js";
13
+ } from "./chunk-7V5CF6SH.js";
14
14
  import {
15
15
  setSpanAttributes,
16
16
  setSpanStatus,
17
17
  withSpan
18
- } from "./chunk-VMVTHLJM.js";
18
+ } from "./chunk-QHEYFDCZ.js";
19
19
 
20
20
  // src/chat/sandbox/resources.ts
21
21
  var configuredResources;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-XL24YNNO.js";
3
+ } from "./chunk-GUIEHC3H.js";
4
4
  import {
5
5
  logWarn
6
- } from "./chunk-VMVTHLJM.js";
6
+ } from "./chunk-QHEYFDCZ.js";
7
7
  import {
8
8
  skillRoots
9
9
  } from "./chunk-H4HBKISO.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JUNIOR_VERSION
3
- } from "./chunk-4CVWSS6Q.js";
3
+ } from "./chunk-YGIPCZZD.js";
4
4
 
5
5
  // src/deployment.ts
6
6
  var JUNIOR_HEARTBEAT_ROUTE = "/api/internal/heartbeat";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createWebAuthorization,
3
3
  deleteWebAuthorization
4
- } from "./chunk-GLYH4OBP.js";
4
+ } from "./chunk-X3M2JJGL.js";
5
5
  import {
6
6
  appendAndEnqueueInboundMessage
7
- } from "./chunk-PQV33DEV.js";
7
+ } from "./chunk-I7VX7SFH.js";
8
8
  import {
9
9
  buildDeliveredTurnStatePatch,
10
10
  completeAuthPauseTurn,
@@ -12,20 +12,20 @@ import {
12
12
  getTurnUserMessage,
13
13
  processPluginTask,
14
14
  scheduleSessionCompletedPluginTasks
15
- } from "./chunk-T3RN2B3T.js";
15
+ } from "./chunk-I2OSXB2S.js";
16
16
  import {
17
17
  ConversationTurnLifecycleService,
18
18
  coerceThreadConversationState,
19
19
  getPersistedSandboxState,
20
20
  getPersistedThreadState,
21
21
  persistThreadStateById
22
- } from "./chunk-RMANRIHC.js";
22
+ } from "./chunk-O72OX3BI.js";
23
23
  import {
24
24
  healthReportSchema
25
25
  } from "./chunk-UTL3MHPC.js";
26
26
  import {
27
27
  parseSlackThreadId
28
- } from "./chunk-WNQBHYAQ.js";
28
+ } from "./chunk-RTNSAKYV.js";
29
29
  import {
30
30
  TurnInputCommitLostError,
31
31
  abandonTurnRecord,
@@ -49,31 +49,31 @@ import {
49
49
  saveTurnCheckpoint,
50
50
  startActiveTurn,
51
51
  upsertConversationMessage
52
- } from "./chunk-YMBCD6FB.js";
52
+ } from "./chunk-53D4PCKF.js";
53
53
  import {
54
54
  normalizeSlackConversationId
55
- } from "./chunk-K4SGLRWX.js";
55
+ } from "./chunk-G26PYGXP.js";
56
56
  import {
57
57
  getConversationEventStore,
58
58
  getConversationStore,
59
59
  getDb
60
- } from "./chunk-46BUAC7H.js";
60
+ } from "./chunk-QD27ZPYB.js";
61
61
  import {
62
62
  juniorApiTokens,
63
63
  juniorConversationParticipants,
64
64
  juniorConversations,
65
65
  juniorIdentities,
66
66
  juniorUsers
67
- } from "./chunk-RG6JSBDJ.js";
67
+ } from "./chunk-4BO7CQTP.js";
68
68
  import {
69
69
  getSlackBotToken
70
- } from "./chunk-RAV6B2TQ.js";
70
+ } from "./chunk-7V5CF6SH.js";
71
71
  import {
72
72
  juniorDestinations
73
73
  } from "./chunk-VFUK3X5B.js";
74
74
  import {
75
75
  canExposeConversationPayload
76
- } from "./chunk-NBE6DME6.js";
76
+ } from "./chunk-NBASTXA5.js";
77
77
  import {
78
78
  credentialContextForActor
79
79
  } from "./chunk-CGA4ERJ5.js";
@@ -82,7 +82,7 @@ import {
82
82
  logWarn,
83
83
  setTags,
84
84
  withLogContext
85
- } from "./chunk-VMVTHLJM.js";
85
+ } from "./chunk-QHEYFDCZ.js";
86
86
 
87
87
  // src/handlers/health.ts
88
88
  function readHealthReport() {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  appendAndEnqueueInboundMessage
3
- } from "./chunk-PQV33DEV.js";
3
+ } from "./chunk-I7VX7SFH.js";
4
4
  import {
5
5
  ConversationTurnLifecycleService,
6
6
  getPersistedSandboxState,
7
7
  getPersistedThreadState,
8
8
  persistThreadStateById
9
- } from "./chunk-RMANRIHC.js";
9
+ } from "./chunk-O72OX3BI.js";
10
10
  import {
11
11
  AgentInvocationBusyError,
12
12
  AgentInvocationLimitError,
@@ -15,7 +15,7 @@ import {
15
15
  agentBindingSchema,
16
16
  agentInvocationSchema,
17
17
  createAgentInvocationSchema
18
- } from "./chunk-GBDCHVNI.js";
18
+ } from "./chunk-F4K7AAHQ.js";
19
19
  import {
20
20
  TurnInputCommitLostError,
21
21
  failTurnRecord,
@@ -26,16 +26,16 @@ import {
26
26
  isTurnInputCommitLostError,
27
27
  openConversationProjection,
28
28
  saveTurnCheckpoint
29
- } from "./chunk-YMBCD6FB.js";
29
+ } from "./chunk-53D4PCKF.js";
30
30
  import {
31
31
  getConversationEventStore,
32
32
  getConversationStore,
33
33
  getSqlExecutor
34
- } from "./chunk-46BUAC7H.js";
34
+ } from "./chunk-QD27ZPYB.js";
35
35
  import {
36
36
  juniorAgentBindings,
37
37
  juniorAgentInvocations
38
- } from "./chunk-RG6JSBDJ.js";
38
+ } from "./chunk-4BO7CQTP.js";
39
39
 
40
40
  // src/chat/agent-invocations/work.ts
41
41
  import { z } from "zod";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  formatProviderLabel,
6
6
  startOAuthFlow
7
- } from "./chunk-HHAR5IDU.js";
7
+ } from "./chunk-IKIQ6N44.js";
8
8
  import {
9
9
  parseSandboxEgressAuthRequiredSignal
10
10
  } from "./chunk-6ZWRNC4D.js";
@@ -12,16 +12,16 @@ import {
12
12
  abandonReplacedPendingAuth,
13
13
  canReusePendingAuthLink,
14
14
  recordAuthorizationRequested
15
- } from "./chunk-YMBCD6FB.js";
15
+ } from "./chunk-53D4PCKF.js";
16
16
  import {
17
17
  AGENT_INVOCATION_MAILBOX_STATUSES
18
- } from "./chunk-RG6JSBDJ.js";
18
+ } from "./chunk-4BO7CQTP.js";
19
19
  import {
20
20
  TURN_REASONING_LEVELS
21
- } from "./chunk-RAV6B2TQ.js";
21
+ } from "./chunk-7V5CF6SH.js";
22
22
  import {
23
23
  pluginCatalogRuntime
24
- } from "./chunk-XL24YNNO.js";
24
+ } from "./chunk-GUIEHC3H.js";
25
25
  import {
26
26
  credentialContextSchema
27
27
  } from "./chunk-CGA4ERJ5.js";
@@ -2,10 +2,10 @@ import {
2
2
  ToolInputError,
3
3
  canRouteResourceEvents,
4
4
  getPlugins
5
- } from "./chunk-K4SGLRWX.js";
5
+ } from "./chunk-G26PYGXP.js";
6
6
  import {
7
7
  getDb
8
- } from "./chunk-46BUAC7H.js";
8
+ } from "./chunk-QD27ZPYB.js";
9
9
  import {
10
10
  juniorAttachments,
11
11
  juniorConversations,
@@ -13,13 +13,13 @@ import {
13
13
  juniorSchedulerRuns,
14
14
  juniorSchedulerTasks,
15
15
  juniorStats
16
- } from "./chunk-RG6JSBDJ.js";
16
+ } from "./chunk-4BO7CQTP.js";
17
17
  import {
18
18
  juniorDestinations
19
19
  } from "./chunk-VFUK3X5B.js";
20
20
  import {
21
21
  logInfo
22
- } from "./chunk-VMVTHLJM.js";
22
+ } from "./chunk-QHEYFDCZ.js";
23
23
 
24
24
  // src/chat/resource-events/catalog.ts
25
25
  import {
@@ -67,9 +67,9 @@ function registeredResourceTypeSchema(catalog) {
67
67
  function pluginSupportsEvent(catalog, namespace, resourceType, eventType) {
68
68
  return catalog[namespace]?.resourceTypes.find((candidate) => candidate.type === resourceType)?.supportedEvents.includes(eventType) ?? false;
69
69
  }
70
- function resourceEventGuidance(catalog, namespace, eventType) {
70
+ function resourceEventGuidance(catalog, namespace, resourceType, eventType) {
71
71
  return catalog[namespace]?.resourceTypes.find(
72
- (resourceType) => resourceType.supportedEvents.includes(eventType)
72
+ (candidate) => candidate.type === resourceType
73
73
  )?.guidance?.[eventType];
74
74
  }
75
75
  function normalizeEventIdentifier(catalog, namespace, identifier) {
@@ -5,7 +5,7 @@ import {
5
5
  getConversationEventStore,
6
6
  getDb,
7
7
  getSqlExecutor
8
- } from "./chunk-46BUAC7H.js";
8
+ } from "./chunk-QD27ZPYB.js";
9
9
  import {
10
10
  juniorConversationAnnotations,
11
11
  juniorConversationEvents,
@@ -14,23 +14,23 @@ import {
14
14
  juniorUsers,
15
15
  juniorWorkspaceRepos,
16
16
  juniorWorkspaces
17
- } from "./chunk-RG6JSBDJ.js";
17
+ } from "./chunk-4BO7CQTP.js";
18
18
  import {
19
19
  SANDBOX_WORKSPACE_ROOT,
20
20
  hash,
21
21
  runNonInteractiveCommand,
22
22
  sleep
23
- } from "./chunk-YUUMDYLN.js";
23
+ } from "./chunk-VRWFZY2Q.js";
24
24
  import {
25
25
  getStateAdapter
26
- } from "./chunk-CSV5XEQN.js";
26
+ } from "./chunk-H4WJ6GCS.js";
27
27
  import {
28
28
  botConfig,
29
29
  completeObject,
30
30
  embedTexts,
31
31
  getSlackBotToken,
32
32
  standardModelId
33
- } from "./chunk-RAV6B2TQ.js";
33
+ } from "./chunk-7V5CF6SH.js";
34
34
  import {
35
35
  isActorUserId,
36
36
  parseActorUserId,
@@ -46,7 +46,7 @@ import {
46
46
  setSpanAttributes,
47
47
  setSpanStatus,
48
48
  withSpan
49
- } from "./chunk-VMVTHLJM.js";
49
+ } from "./chunk-QHEYFDCZ.js";
50
50
 
51
51
  // src/chat/plugins/agent-hooks.ts
52
52
  import {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-2AEUOTQL.js";
3
+ } from "./chunk-4OLTNDE5.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-RAV6B2TQ.js";
3
+ } from "./chunk-7V5CF6SH.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -2,7 +2,7 @@ import {
2
2
  coerceThreadConversationState,
3
3
  getPersistedThreadState,
4
4
  persistThreadStateById
5
- } from "./chunk-RMANRIHC.js";
5
+ } from "./chunk-O72OX3BI.js";
6
6
  import {
7
7
  pluginTaskId,
8
8
  pluginTaskParamsSchema,
@@ -22,7 +22,7 @@ import {
22
22
  markTurnCompleted,
23
23
  normalizeToolNameFromResult,
24
24
  stripRuntimeTurnContext
25
- } from "./chunk-YMBCD6FB.js";
25
+ } from "./chunk-53D4PCKF.js";
26
26
  import {
27
27
  createPluginConversationEvents,
28
28
  createPluginEmbedder,
@@ -30,7 +30,7 @@ import {
30
30
  createPluginModel,
31
31
  createPluginState,
32
32
  getPlugins
33
- } from "./chunk-K4SGLRWX.js";
33
+ } from "./chunk-G26PYGXP.js";
34
34
  import {
35
35
  JUNIOR_THREAD_STATE_TTL_MS
36
36
  } from "./chunk-3Y47VMHV.js";
@@ -38,20 +38,20 @@ import {
38
38
  getConversationStore,
39
39
  getDb,
40
40
  sameActorIdentity
41
- } from "./chunk-46BUAC7H.js";
41
+ } from "./chunk-QD27ZPYB.js";
42
42
  import {
43
43
  juniorConversations,
44
44
  juniorTaskExecutions
45
- } from "./chunk-RG6JSBDJ.js";
45
+ } from "./chunk-4BO7CQTP.js";
46
46
  import {
47
47
  getStateAdapter
48
- } from "./chunk-CSV5XEQN.js";
48
+ } from "./chunk-H4WJ6GCS.js";
49
49
  import {
50
50
  ProviderError,
51
51
  findProviderError,
52
52
  getProviderErrorAttributes,
53
53
  getProviderErrorUserMessage
54
- } from "./chunk-RAV6B2TQ.js";
54
+ } from "./chunk-7V5CF6SH.js";
55
55
  import {
56
56
  credentialSubjectSchema
57
57
  } from "./chunk-CGA4ERJ5.js";
@@ -61,7 +61,7 @@ import {
61
61
  import {
62
62
  buildTurnFailureResponse,
63
63
  logWarn
64
- } from "./chunk-VMVTHLJM.js";
64
+ } from "./chunk-QHEYFDCZ.js";
65
65
 
66
66
  // src/chat/runtime/delivered-turn-state.ts
67
67
  function buildDeliveredTurnStatePatch(args) {
@@ -87,7 +87,7 @@ import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
87
87
 
88
88
  // src/chat/services/turn-session-routing.ts
89
89
  async function resolveTurnSessionRouting(args) {
90
- const conversationStore = args.conversationStore ?? (await import("./db-B7NVPW7Y.js")).getConversationStore();
90
+ const conversationStore = args.conversationStore ?? (await import("./db-N4UWAT3N.js")).getConversationStore();
91
91
  const conversation = await conversationStore.get({
92
92
  conversationId: args.conversationId
93
93
  });
@@ -457,13 +457,6 @@ var dispatchRecordSchema = z.object({
457
457
  });
458
458
  }
459
459
  });
460
- var storedDispatchRecordSchema = dispatchRecordSchema.extend({
461
- attempt: z.number().int().nonnegative().optional(),
462
- lastCallbackAtMs: z.number().finite().optional(),
463
- leaseExpiresAtMs: z.number().finite().optional(),
464
- maxAttempts: z.number().int().positive().optional(),
465
- version: z.number().int().positive().optional()
466
- });
467
460
  function getDispatchStorageKey(id) {
468
461
  return `${DISPATCH_PREFIX}:record:${id}`;
469
462
  }
@@ -490,26 +483,8 @@ function buildDispatchId(plugin, idempotencyKey) {
490
483
  return `dispatch_${digest}`;
491
484
  }
492
485
  function parseDispatchRecord(value) {
493
- const parsed = parseStoredDispatchRecord(value);
494
- return parsed?.record;
495
- }
496
- function parseStoredDispatchRecord(value) {
497
- const parsed = storedDispatchRecordSchema.safeParse(value);
498
- if (!parsed.success) {
499
- return void 0;
500
- }
501
- const {
502
- attempt: _attempt,
503
- lastCallbackAtMs: _lastCallbackAtMs,
504
- leaseExpiresAtMs: _leaseExpiresAtMs,
505
- maxAttempts: _maxAttempts,
506
- version: _version,
507
- ...record
508
- } = parsed.data;
509
- return {
510
- ...typeof parsed.data.leaseExpiresAtMs === "number" ? { legacyLeaseExpiresAtMs: parsed.data.leaseExpiresAtMs } : {},
511
- record
512
- };
486
+ const parsed = dispatchRecordSchema.safeParse(value);
487
+ return parsed.success ? parsed.data : void 0;
513
488
  }
514
489
  function getDispatchConversationId(dispatch) {
515
490
  return `agent-dispatch:${dispatch.id}`;
@@ -517,15 +492,6 @@ function getDispatchConversationId(dispatch) {
517
492
  function getDispatchInputMessageId(dispatchId) {
518
493
  return `agent-dispatch:${dispatchId}`;
519
494
  }
520
- function getLegacyDispatchInputMessageId(dispatchId) {
521
- return `dispatch:${dispatchId}:user`;
522
- }
523
- function getDispatchInputMessageIds(dispatchId) {
524
- return [
525
- getDispatchInputMessageId(dispatchId),
526
- getLegacyDispatchInputMessageId(dispatchId)
527
- ];
528
- }
529
495
  function getDispatchTurnId(dispatchId) {
530
496
  return `dispatch:${dispatchId}`;
531
497
  }
@@ -740,16 +706,9 @@ async function listPendingDispatchMailboxAppends() {
740
706
  const stored = await state.get(pendingDispatchMailboxAppendIndexKey());
741
707
  return stored === void 0 || stored === null ? [] : [...new Set(pendingDispatchMailboxAppendIndexSchema.parse(stored))];
742
708
  }
743
- async function claimDispatchMailboxAppend(id, nowMs) {
709
+ async function claimDispatchMailboxAppend(id) {
744
710
  return await withDispatchLock(id, async (state) => {
745
- const stored = parseStoredDispatchRecord(
746
- await state.get(getDispatchStorageKey(id))
747
- );
748
- if (!stored || stored.legacyLeaseExpiresAtMs && stored.legacyLeaseExpiresAtMs > nowMs) {
749
- return void 0;
750
- }
751
- await putRecord(state, stored.record);
752
- return stored.record;
711
+ return parseDispatchRecord(await state.get(getDispatchStorageKey(id)));
753
712
  });
754
713
  }
755
714
  async function getPluginDispatchProjection(args) {
@@ -1225,7 +1184,6 @@ export {
1225
1184
  readTaskExecutionStatusDays,
1226
1185
  getDispatchConversationId,
1227
1186
  getDispatchInputMessageId,
1228
- getDispatchInputMessageIds,
1229
1187
  getDispatchTurnId,
1230
1188
  isTerminalDispatchStatus,
1231
1189
  getDispatchRecord,