@sentry/junior 0.184.0 → 0.186.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 (129) hide show
  1. package/dist/{agent-hooks-XTZVALGQ.js → agent-hooks-4B3Z4WRK.js} +13 -11
  2. package/dist/api/acp/schema.d.ts +20 -2
  3. package/dist/api/code/overview.d.ts +39 -0
  4. package/dist/api/locations/detail.d.ts +1 -1
  5. package/dist/api/people/code.d.ts +22 -0
  6. package/dist/api/schema/code.d.ts +46 -0
  7. package/dist/api/schema/conversation.d.ts +108 -20
  8. package/dist/api/schema/location.d.ts +1 -1
  9. package/dist/api/schema/person.d.ts +1 -1
  10. package/dist/api/schema.d.ts +4 -4
  11. package/dist/api/schema.js +12 -1
  12. package/dist/api.js +368 -78
  13. package/dist/app.js +1412 -538
  14. package/dist/{catalog-runtime-5357XR4F.js → catalog-runtime-AFJCAOHC.js} +4 -4
  15. package/dist/chat/api-turns/accepted-reply.d.ts +11 -0
  16. package/dist/chat/api-turns/cancellation.d.ts +3 -5
  17. package/dist/chat/api-turns/mailbox-input.d.ts +7 -0
  18. package/dist/chat/api-turns/routing.d.ts +18 -3
  19. package/dist/chat/api-turns/work.d.ts +4 -9
  20. package/dist/chat/app/conversation-work.d.ts +1 -1
  21. package/dist/chat/app/factory.d.ts +4 -0
  22. package/dist/chat/app/services.d.ts +4 -3
  23. package/dist/chat/conversations/history.d.ts +83 -9
  24. package/dist/chat/conversations/turn-lifecycle.d.ts +6 -3
  25. package/dist/chat/providers/slack/input.d.ts +32 -0
  26. package/dist/chat/{runtime → providers/slack}/processing-reaction.d.ts +6 -8
  27. package/dist/chat/{runtime/slack-resume.d.ts → providers/slack/resume.d.ts} +16 -19
  28. package/dist/chat/providers/slack/runtime.d.ts +1 -12
  29. package/dist/chat/providers/slack/turn.d.ts +10 -25
  30. package/dist/chat/resource-events/actor.d.ts +7 -2
  31. package/dist/chat/resource-events/app-publisher.d.ts +18 -0
  32. package/dist/chat/resource-events/catalog.d.ts +19 -0
  33. package/dist/chat/resource-events/ingest.d.ts +0 -1
  34. package/dist/chat/resource-events/notification.d.ts +28 -3
  35. package/dist/chat/resource-events/runtime-catalog.d.ts +7 -2
  36. package/dist/chat/resource-events/store.d.ts +2 -14
  37. package/dist/chat/resource-events/tool-support.d.ts +0 -5
  38. package/dist/chat/resource-events/workspace.d.ts +7 -3
  39. package/dist/chat/runtime/turn-execution.d.ts +7 -2
  40. package/dist/chat/sandbox/egress/credentials.d.ts +5 -4
  41. package/dist/chat/sandbox/egress/session.d.ts +10 -11
  42. package/dist/chat/sandbox/errors.d.ts +1 -1
  43. package/dist/chat/sandbox/ref.d.ts +1 -1
  44. package/dist/chat/sandbox/snapshot/events.d.ts +8 -1
  45. package/dist/chat/sandbox/snapshot/not-ready-error.d.ts +6 -1
  46. package/dist/chat/scheduled-tasks/tool-support.d.ts +5 -5
  47. package/dist/chat/scheduled-tasks/tools/create.d.ts +2 -2
  48. package/dist/chat/scheduled-tasks/tools/delete.d.ts +2 -2
  49. package/dist/chat/scheduled-tasks/tools/list.d.ts +2 -2
  50. package/dist/chat/scheduled-tasks/tools/run-now.d.ts +2 -2
  51. package/dist/chat/scheduled-tasks/tools/update.d.ts +2 -2
  52. package/dist/chat/scheduled-tasks/types.d.ts +1 -1
  53. package/dist/chat/sentry-links.d.ts +2 -0
  54. package/dist/chat/services/provider-retry.d.ts +2 -0
  55. package/dist/chat/services/turn-failure-response.d.ts +4 -0
  56. package/dist/chat/services/turn-session-routing.d.ts +20 -5
  57. package/dist/chat/task-execution/paused-turn.d.ts +0 -2
  58. package/dist/chat/task-execution/slack-resource-event.d.ts +47 -0
  59. package/dist/chat/task-execution/slack-work.d.ts +0 -21
  60. package/dist/chat/task-execution/state.d.ts +2 -2
  61. package/dist/chat/task-execution/store.d.ts +1 -1
  62. package/dist/chat/task-execution/turn-wake.d.ts +12 -0
  63. package/dist/chat/tool-support/action-review.d.ts +1 -1
  64. package/dist/chat/tools/event-tasks.d.ts +1 -1
  65. package/dist/chat/tools/resource-events.d.ts +2 -2
  66. package/dist/chat/tools/search-conversation-events.d.ts +1 -1
  67. package/dist/chat/tools/types.d.ts +1 -1
  68. package/dist/chat/tools/watch-resource-events.d.ts +2 -2
  69. package/dist/{chunk-Z3QAXJR7.js → chunk-2IBDVE62.js} +12 -9
  70. package/dist/{chunk-4RONS3WR.js → chunk-2U7EPTRZ.js} +11 -5
  71. package/dist/{chunk-3S7ULUWW.js → chunk-3CVEE6LA.js} +1 -1
  72. package/dist/{chunk-IZDYYYGP.js → chunk-43LODHJM.js} +24 -384
  73. package/dist/{chunk-LHXIZLFF.js → chunk-64WF2GQ3.js} +1 -1
  74. package/dist/{chunk-YKX6MTLU.js → chunk-7EOWT62G.js} +1 -1
  75. package/dist/{chunk-UBOIHNTH.js → chunk-7EU4YSZ4.js} +362 -188
  76. package/dist/{chunk-UF6BUA5W.js → chunk-ACGWTJ74.js} +3 -3
  77. package/dist/{chunk-6UDPINOX.js → chunk-AD64YMEC.js} +19 -44
  78. package/dist/{chunk-MLSQX2EX.js → chunk-BRKB5R7P.js} +1 -1
  79. package/dist/{chunk-E57WPXWY.js → chunk-CM6RTYSO.js} +5 -5
  80. package/dist/{chunk-MAPJFUMV.js → chunk-CV5CPRVG.js} +3 -3
  81. package/dist/chunk-D4YV5TDV.js +45 -0
  82. package/dist/{chunk-HIPUIPJM.js → chunk-DHYZ4VKG.js} +383 -254
  83. package/dist/{chunk-DUKIDPF6.js → chunk-DOP3FIQC.js} +1 -1
  84. package/dist/{chunk-BT53RIGJ.js → chunk-EWRPUXE3.js} +12 -50
  85. package/dist/{chunk-BHYRYYLY.js → chunk-FFYDRLXW.js} +1 -1
  86. package/dist/chunk-GFBR4S3Q.js +406 -0
  87. package/dist/chunk-GQMQCY7H.js +58 -0
  88. package/dist/{chunk-JNO2GUDS.js → chunk-GSB3NTNS.js} +926 -1856
  89. package/dist/{chunk-2ZQPVX7C.js → chunk-H7X2G2KS.js} +25 -12
  90. package/dist/{chunk-WQFEWULF.js → chunk-HKFLRIBD.js} +2 -2
  91. package/dist/{chunk-SHJK75Z2.js → chunk-HWXP6RHG.js} +38 -4
  92. package/dist/{chunk-RF6J3DIO.js → chunk-INQHUE72.js} +84 -1
  93. package/dist/{chunk-4CNDGK25.js → chunk-JFPY6XFF.js} +911 -993
  94. package/dist/{chunk-6WGC3SO4.js → chunk-MCLWOBPN.js} +80 -18
  95. package/dist/{chunk-PJPRXO2T.js → chunk-NRMAOGRS.js} +1 -1
  96. package/dist/{chunk-ACPDVEJO.js → chunk-O6GQO7VP.js} +201 -218
  97. package/dist/{chunk-M5YWNMTE.js → chunk-OZG7E22Y.js} +24 -6
  98. package/dist/{chunk-WVIA7V3M.js → chunk-PFAZSRGR.js} +29 -1
  99. package/dist/{chunk-LCP4EDKR.js → chunk-PZZOGHVR.js} +14 -4
  100. package/dist/{chunk-QABCY33S.js → chunk-QBL2AVFF.js} +2 -2
  101. package/dist/{chunk-FKEZZMXS.js → chunk-QU3URVWG.js} +9 -94
  102. package/dist/{chunk-M3QYTBQ6.js → chunk-STOCCPWH.js} +11 -2
  103. package/dist/{chunk-K7VDC2QW.js → chunk-TXLBLGNQ.js} +6 -6
  104. package/dist/{chunk-JA43DV4Y.js → chunk-VOGOTEW7.js} +1 -1
  105. package/dist/{chunk-HUXFMDBZ.js → chunk-VQIWBJOP.js} +1 -1
  106. package/dist/{chunk-JM2COLGC.js → chunk-VQZYIVYN.js} +6 -6
  107. package/dist/{chunk-BCHYQS4B.js → chunk-VXL2LBPK.js} +1 -1
  108. package/dist/{chunk-6VOYP4M6.js → chunk-YXSBZRP7.js} +1 -1
  109. package/dist/cli/chat.js +35 -33
  110. package/dist/cli/check.js +5 -5
  111. package/dist/cli/plugins.js +14 -12
  112. package/dist/cli/snapshot-create.js +10 -9
  113. package/dist/cli/upgrade.js +7 -6
  114. package/dist/{db-MA52H62H.js → db-7XL4UPAE.js} +8 -6
  115. package/dist/instrumentation.js +3 -3
  116. package/dist/nitro.js +7 -6
  117. package/dist/{oauth-callback-server-DXGHKN6S.js → oauth-callback-server-RAOYHWDI.js} +30 -27
  118. package/dist/{runner-4IXUAQNK.js → runner-KMPBWRPM.js} +24 -19
  119. package/dist/{skills-X3DY7AXO.js → skills-IPCALGLQ.js} +5 -5
  120. package/dist/spawn-OSOWTMBG.js +41 -0
  121. package/dist/task-runner-IQNBA3RY.js +34 -0
  122. package/dist/{validation-Z6JXSTJS.js → validation-BSRCCX6N.js} +5 -5
  123. package/dist/version.js +1 -1
  124. package/dist/{work-OKWRFBDW.js → work-T6UFTOJY.js} +24 -19
  125. package/dist/worker-L35OG7VA.js +24 -0
  126. package/package.json +5 -5
  127. package/dist/spawn-43WGS6CH.js +0 -37
  128. package/dist/task-runner-VDRKITPV.js +0 -32
  129. package/dist/worker-B236AE72.js +0 -22
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  coerceThreadConversationState,
3
3
  getPersistedThreadState
4
- } from "./chunk-E57WPXWY.js";
4
+ } from "./chunk-CM6RTYSO.js";
5
5
  import {
6
6
  pluginTaskId,
7
7
  pluginTaskParamsSchema,
8
8
  sendVercelPluginTask
9
- } from "./chunk-UF6BUA5W.js";
9
+ } from "./chunk-ACGWTJ74.js";
10
10
  import {
11
11
  getPiMessageRole,
12
12
  getTurnRecord,
@@ -16,7 +16,7 @@ import {
16
16
  isToolResultMessage,
17
17
  normalizeToolNameFromResult,
18
18
  stripRuntimeTurnContext
19
- } from "./chunk-2ZQPVX7C.js";
19
+ } from "./chunk-H7X2G2KS.js";
20
20
  import {
21
21
  createPluginConversationEvents,
22
22
  createPluginEmbedder,
@@ -25,22 +25,24 @@ import {
25
25
  createPluginState,
26
26
  getPlugins,
27
27
  readActorIdentity
28
- } from "./chunk-4CNDGK25.js";
28
+ } from "./chunk-JFPY6XFF.js";
29
29
  import {
30
30
  JUNIOR_THREAD_STATE_TTL_MS
31
31
  } from "./chunk-3Y47VMHV.js";
32
32
  import {
33
33
  getConversationStore,
34
- getDb,
35
- sameActorIdentity
36
- } from "./chunk-IZDYYYGP.js";
34
+ getDb
35
+ } from "./chunk-43LODHJM.js";
37
36
  import {
38
37
  juniorConversations,
39
38
  juniorTaskExecutions
40
- } from "./chunk-BCHYQS4B.js";
39
+ } from "./chunk-VXL2LBPK.js";
41
40
  import {
42
41
  getStateAdapter
43
- } from "./chunk-DUKIDPF6.js";
42
+ } from "./chunk-DOP3FIQC.js";
43
+ import {
44
+ sameActorIdentity
45
+ } from "./chunk-GFBR4S3Q.js";
44
46
  import {
45
47
  credentialSubjectSchema
46
48
  } from "./chunk-CEMMLV5L.js";
@@ -49,26 +51,85 @@ import {
49
51
  } from "./chunk-N7TMSOZH.js";
50
52
  import {
51
53
  logWarn
52
- } from "./chunk-3S7ULUWW.js";
54
+ } from "./chunk-3CVEE6LA.js";
53
55
 
54
56
  // src/chat/plugins/task-runner.ts
55
57
  import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
56
58
 
57
59
  // src/chat/services/turn-session-routing.ts
60
+ async function loadConversationChain(conversationId, conversationStore) {
61
+ const chain = [];
62
+ const seen = /* @__PURE__ */ new Set();
63
+ let cursor = conversationId;
64
+ while (cursor && !seen.has(cursor)) {
65
+ seen.add(cursor);
66
+ const conversation = await conversationStore.get({ conversationId: cursor });
67
+ if (!conversation) {
68
+ break;
69
+ }
70
+ chain.push(conversation);
71
+ cursor = conversation.lineage?.parentConversationId;
72
+ }
73
+ return chain;
74
+ }
75
+ function slackSourceForDestination(args) {
76
+ if (args.source?.platform !== "slack" || args.source.channelId !== args.destination.channelId) {
77
+ return void 0;
78
+ }
79
+ const threadTs = args.source.threadTs?.trim();
80
+ return {
81
+ platform: "slack",
82
+ visibility: args.source.visibility ?? "public",
83
+ teamId: args.source.teamId?.trim() || args.destination.teamId,
84
+ channelId: args.source.channelId,
85
+ ...threadTs ? { threadTs } : void 0
86
+ };
87
+ }
88
+ async function resolveConversationRouting(args) {
89
+ const conversationStore = args.conversationStore ?? (await import("./db-7XL4UPAE.js")).getConversationStore();
90
+ const chain = await loadConversationChain(
91
+ args.conversationId,
92
+ conversationStore
93
+ );
94
+ let destination;
95
+ let source;
96
+ let locationId;
97
+ for (const conversation of chain) {
98
+ destination ??= conversation.destination;
99
+ source ??= conversation.sessionSource;
100
+ locationId ??= conversation.location?.id;
101
+ if (destination && source) {
102
+ break;
103
+ }
104
+ }
105
+ if (!destination) {
106
+ return void 0;
107
+ }
108
+ if (destination.platform === "slack") {
109
+ const slackSource = slackSourceForDestination({ destination, source });
110
+ return {
111
+ destination,
112
+ ...locationId ? { locationId } : void 0,
113
+ ...slackSource ? { source: slackSource } : void 0
114
+ };
115
+ }
116
+ return {
117
+ destination,
118
+ ...locationId ? { locationId } : void 0,
119
+ ...source ? { source } : void 0
120
+ };
121
+ }
58
122
  async function resolveTurnSessionRouting(args) {
59
- const conversationStore = args.conversationStore ?? (await import("./db-MA52H62H.js")).getConversationStore();
60
- const conversation = await conversationStore.get({
61
- conversationId: args.conversationId
62
- });
63
- if (!conversation?.destination || !conversation.sessionSource) {
123
+ const routing = await resolveConversationRouting(args);
124
+ if (!routing?.destination || !routing.source) {
64
125
  throw new Error(
65
126
  `Conversation ${args.conversationId} is missing durable routing metadata`
66
127
  );
67
128
  }
68
129
  return {
69
- destination: conversation.destination,
70
- ...conversation.location ? { locationId: conversation.location.id } : void 0,
71
- source: conversation.sessionSource
130
+ destination: routing.destination,
131
+ source: routing.source,
132
+ ...routing.locationId ? { locationId: routing.locationId } : void 0
72
133
  };
73
134
  }
74
135
 
@@ -1021,6 +1082,7 @@ export {
1021
1082
  listPendingDispatchMailboxAppends,
1022
1083
  claimDispatchMailboxAppend,
1023
1084
  getPluginDispatchProjection,
1085
+ resolveConversationRouting,
1024
1086
  resolveTurnSessionRouting,
1025
1087
  scheduleSessionCompletedPluginTasks,
1026
1088
  processPluginTask
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createPluginCatalogRuntime
3
- } from "./chunk-LHXIZLFF.js";
3
+ } from "./chunk-64WF2GQ3.js";
4
4
 
5
5
  // src/chat/plugins/catalog-runtime.ts
6
6
  var pluginCatalogRuntime = createPluginCatalogRuntime();