@sentry/junior 0.188.0 → 0.189.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 (109) hide show
  1. package/dist/{agent-hooks-5RQEVLQD.js → agent-hooks-6QRYH6PX.js} +11 -11
  2. package/dist/api/acp/conversations.d.ts +2 -2
  3. package/dist/api/conversations/list.d.ts +7 -0
  4. package/dist/api/people/shared.d.ts +54 -0
  5. package/dist/api.js +41 -52
  6. package/dist/app.d.ts +1 -1
  7. package/dist/app.js +1003 -346
  8. package/dist/{catalog-runtime-L4A6BJ3U.js → catalog-runtime-IETJLJFG.js} +4 -4
  9. package/dist/chat/agent/resume.d.ts +0 -2
  10. package/dist/chat/agent/types.d.ts +8 -9
  11. package/dist/chat/agent-dispatch/work.d.ts +1 -10
  12. package/dist/chat/agent-invocations/spawn.d.ts +1 -1
  13. package/dist/chat/agent-invocations/types.d.ts +296 -96
  14. package/dist/chat/app/conversation-work.d.ts +16 -8
  15. package/dist/chat/conversation-privacy.d.ts +7 -7
  16. package/dist/chat/conversations/destination.d.ts +12 -0
  17. package/dist/chat/conversations/projection.d.ts +2 -2
  18. package/dist/chat/conversations/sql/location.d.ts +13 -4
  19. package/dist/chat/{api-turns → conversations}/stop.d.ts +2 -2
  20. package/dist/chat/conversations/store.d.ts +4 -4
  21. package/dist/chat/conversations/structured-events.d.ts +1 -1
  22. package/dist/chat/{api-turns/authorization.d.ts → conversations/web-authorization.d.ts} +1 -0
  23. package/dist/chat/conversations/web-input.d.ts +98 -0
  24. package/dist/chat/conversations/web-mailbox.d.ts +12 -0
  25. package/dist/chat/event-tasks/tool-support.d.ts +0 -6
  26. package/dist/chat/providers/slack/runtime.d.ts +1 -0
  27. package/dist/chat/providers/slack/system-turn.d.ts +8 -0
  28. package/dist/chat/resource-events/actor.d.ts +13 -12
  29. package/dist/chat/resource-events/notification.d.ts +1 -1
  30. package/dist/chat/services/guardian-action-policy.d.ts +1 -1
  31. package/dist/chat/services/turn-session-routing.d.ts +2 -2
  32. package/dist/chat/task-execution/assistant-message.d.ts +32 -0
  33. package/dist/chat/task-execution/conversation-turn.d.ts +8 -0
  34. package/dist/chat/{api-turns → task-execution}/mailbox-input.d.ts +1 -2
  35. package/dist/chat/task-execution/mailbox-turn.d.ts +42 -0
  36. package/dist/chat/task-execution/paused-turn.d.ts +1 -1
  37. package/dist/chat/task-execution/slack-work.d.ts +0 -2
  38. package/dist/{chunk-AW77HH54.js → chunk-4RHJ3CXR.js} +14 -295
  39. package/dist/{chunk-ZX7RSBQ6.js → chunk-5CXCGDIL.js} +1 -1
  40. package/dist/{chunk-QVH6FW3T.js → chunk-5VWAY27R.js} +7 -3
  41. package/dist/{chunk-XJIPMHKI.js → chunk-6AUR6PWR.js} +3 -3
  42. package/dist/{chunk-QDHJTKPE.js → chunk-7R5JRPCY.js} +8 -6
  43. package/dist/{chunk-6JZGXLL2.js → chunk-AC7MDOJW.js} +5 -7
  44. package/dist/{chunk-Q7O74WOO.js → chunk-BYBSI5TI.js} +2 -2
  45. package/dist/{chunk-VFZAUQ5V.js → chunk-CMWIMFM6.js} +4 -182
  46. package/dist/{chunk-IUUQWIG2.js → chunk-CUYFCI4G.js} +59 -11
  47. package/dist/chunk-DA2KGZZI.js +13 -0
  48. package/dist/{chunk-FIUCHYT6.js → chunk-DYXVAO2E.js} +1 -1
  49. package/dist/{chunk-NZLZ4KYZ.js → chunk-E3PDZPGV.js} +1 -1
  50. package/dist/{chunk-Z5SKZE5B.js → chunk-GP32KD2J.js} +4 -12
  51. package/dist/{chunk-XI4PVY2T.js → chunk-KN32OWL2.js} +5 -5
  52. package/dist/chunk-LHKZKAZ4.js +285 -0
  53. package/dist/{chunk-6YGFBU3A.js → chunk-MFSET7Q7.js} +44 -334
  54. package/dist/{chunk-QCGNHSMA.js → chunk-MI6ZBDTS.js} +6 -6
  55. package/dist/{chunk-CIG6WI7Q.js → chunk-MRXMFB4L.js} +5 -5
  56. package/dist/{chunk-CVBDVIF4.js → chunk-MVPLEPSI.js} +1 -1
  57. package/dist/{chunk-32XSSFZV.js → chunk-NY2F7BZA.js} +1 -1
  58. package/dist/chunk-O35GZCKL.js +311 -0
  59. package/dist/{chunk-HCIVBCP5.js → chunk-OEIITG5F.js} +1 -1
  60. package/dist/{chunk-UVUXFRYN.js → chunk-PCPSX4ES.js} +209 -7
  61. package/dist/{chunk-QIMN3FXL.js → chunk-PY3EIEAF.js} +1 -1
  62. package/dist/{chunk-RMB7CERI.js → chunk-QNIOBNOY.js} +282 -121
  63. package/dist/{chunk-WGZJ5SU4.js → chunk-S3SGZUOI.js} +1 -1
  64. package/dist/chunk-SR6OMO5C.js +703 -0
  65. package/dist/{chunk-CDSLOYOR.js → chunk-UCWO5MKP.js} +6 -6
  66. package/dist/{chunk-PSHMPRIU.js → chunk-VKQWU4PO.js} +2 -2
  67. package/dist/{chunk-X55FOVZO.js → chunk-WDHPN2GH.js} +3 -3
  68. package/dist/{chunk-WW2Y7JIA.js → chunk-WMUAKAIF.js} +43 -44
  69. package/dist/{chunk-MQDIIFZM.js → chunk-WN6VLHOU.js} +12 -5
  70. package/dist/{chunk-W42ENMJW.js → chunk-WWYUYKKV.js} +1 -1
  71. package/dist/{chunk-ERZMACYA.js → chunk-WYDF6PGK.js} +3 -3
  72. package/dist/{chunk-SC67CH3C.js → chunk-YNZPOFF3.js} +14 -17
  73. package/dist/{chunk-3HEZWDS5.js → chunk-YYSEH2WC.js} +2 -2
  74. package/dist/{chunk-W2DDJCPS.js → chunk-YYZNESC3.js} +8 -8
  75. package/dist/{chunk-CZRWU4ZM.js → chunk-ZUPDSJUE.js} +2 -5
  76. package/dist/{chunk-QIOUTXTZ.js → chunk-ZV6PFUA4.js} +1 -1
  77. package/dist/cli/chat.js +34 -33
  78. package/dist/cli/check.js +5 -5
  79. package/dist/cli/plugins.js +12 -12
  80. package/dist/cli/snapshot-create.js +9 -9
  81. package/dist/cli/upgrade.js +6 -6
  82. package/dist/db/schema/agent-invocations.d.ts +0 -36
  83. package/dist/db/schema/conversations.d.ts +62 -0
  84. package/dist/db/schema.d.ts +31 -36
  85. package/dist/{db-YPRZAA2T.js → db-LPJKR2EO.js} +6 -6
  86. package/dist/instrumentation.js +3 -3
  87. package/dist/nitro.js +6 -6
  88. package/dist/{oauth-callback-server-DBBIR3XG.js → oauth-callback-server-DMXF4TTQ.js} +30 -28
  89. package/dist/{runner-FKVFFPLO.js → runner-L5DPVYCN.js} +25 -21
  90. package/dist/{skills-4RBAZEMV.js → skills-NXG3LBCK.js} +5 -5
  91. package/dist/spawn-VRUIGKWW.js +42 -0
  92. package/dist/task-runner-7YTBSPXW.js +36 -0
  93. package/dist/{validation-E6Z5LHZM.js → validation-CH36LTOS.js} +5 -5
  94. package/dist/version.js +1 -1
  95. package/dist/{work-OFTXWOK4.js → work-HBC5Y5VZ.js} +22 -21
  96. package/dist/{worker-OMWNOKTJ.js → worker-5RDZHLXH.js} +10 -10
  97. package/migrations/0037_conversation_location.sql +23 -0
  98. package/migrations/meta/0037_snapshot.json +3192 -0
  99. package/migrations/meta/_journal.json +7 -0
  100. package/package.json +5 -5
  101. package/dist/chat/api-turns/assistant-message.d.ts +0 -12
  102. package/dist/chat/api-turns/cancellation.d.ts +0 -24
  103. package/dist/chat/api-turns/routing.d.ts +0 -51
  104. package/dist/chat/api-turns/work.d.ts +0 -99
  105. package/dist/chat/task-execution/slack-resource-event.d.ts +0 -55
  106. package/dist/chunk-6FGN7ZEG.js +0 -221
  107. package/dist/chunk-LODJKINF.js +0 -1502
  108. package/dist/spawn-CO7QFCNJ.js +0 -41
  109. package/dist/task-runner-DUGZGI7V.js +0 -34
@@ -19,23 +19,23 @@ import {
19
19
  releaseConversationWork,
20
20
  requestAnotherSlice,
21
21
  startConversationWork
22
- } from "./chunk-MQDIIFZM.js";
22
+ } from "./chunk-WN6VLHOU.js";
23
+ import {
24
+ getTurnRequestDeadline
25
+ } from "./chunk-S3SGZUOI.js";
23
26
  import {
24
27
  ConversationQueueMessageRejectedError
25
28
  } from "./chunk-JAL3CH4G.js";
26
- import {
27
- getTurnRequestDeadline
28
- } from "./chunk-WGZJ5SU4.js";
29
29
  import {
30
30
  getChatConfig,
31
31
  isProviderRetryError
32
- } from "./chunk-Q7O74WOO.js";
32
+ } from "./chunk-BYBSI5TI.js";
33
33
  import {
34
34
  logException,
35
35
  logInfo,
36
36
  logWarn,
37
37
  withLogContext
38
- } from "./chunk-QIMN3FXL.js";
38
+ } from "./chunk-PY3EIEAF.js";
39
39
 
40
40
  // src/chat/task-execution/worker.ts
41
41
  var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getStateAdapter
3
- } from "./chunk-ZX7RSBQ6.js";
3
+ } from "./chunk-5CXCGDIL.js";
4
4
  import {
5
5
  getClient
6
6
  } from "./chunk-PEQXYSSE.js";
7
7
 
8
- // src/chat/api-turns/authorization.ts
8
+ // src/chat/conversations/web-authorization.ts
9
9
  import { randomUUID } from "crypto";
10
10
  var WEB_AUTHORIZATION_PREFIX = "junior:web_authorization:v1";
11
11
  var WEB_AUTHORIZATION_TTL_MS = 24 * 60 * 60 * 1e3;
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  toOptionalTrimmed
3
- } from "./chunk-Q7O74WOO.js";
3
+ } from "./chunk-BYBSI5TI.js";
4
4
  import {
5
5
  pluginCatalogRuntime
6
- } from "./chunk-NZLZ4KYZ.js";
6
+ } from "./chunk-E3PDZPGV.js";
7
7
  import {
8
8
  setSpanAttributes,
9
9
  setSpanStatus
10
- } from "./chunk-QIMN3FXL.js";
10
+ } from "./chunk-PY3EIEAF.js";
11
11
 
12
12
  // src/chat/sandbox/paths.ts
13
13
  function normalizeWorkspaceRoot(input) {
@@ -1,14 +1,10 @@
1
1
  import {
2
2
  relayLocalOAuthCallback
3
3
  } from "./chunk-FA6POGLH.js";
4
- import {
5
- buildSentryConversationUrl,
6
- deleteWebAuthorization
7
- } from "./chunk-PSHMPRIU.js";
8
4
  import {
9
5
  AgentRunError,
10
6
  executeTurn
11
- } from "./chunk-ERZMACYA.js";
7
+ } from "./chunk-WYDF6PGK.js";
12
8
  import {
13
9
  buildDeliveredTurnStatePatch,
14
10
  finalizeFailedTurnReplyWithEvent,
@@ -19,14 +15,14 @@ import {
19
15
  getTurnUserSlackMessageTs,
20
16
  persistAuthPauseTurnState,
21
17
  requireTurnFailureEventId
22
- } from "./chunk-QDHJTKPE.js";
18
+ } from "./chunk-7R5JRPCY.js";
23
19
  import {
24
20
  resolveTurnSessionRouting,
25
21
  scheduleSessionCompletedPluginTasks
26
- } from "./chunk-AW77HH54.js";
22
+ } from "./chunk-4RHJ3CXR.js";
27
23
  import {
28
24
  getTurnLifecycle
29
- } from "./chunk-W42ENMJW.js";
25
+ } from "./chunk-WWYUYKKV.js";
30
26
  import {
31
27
  coerceThreadConversationState,
32
28
  configValueSchema,
@@ -34,7 +30,11 @@ import {
34
30
  getPersistedSandboxState,
35
31
  getPersistedThreadState,
36
32
  persistThreadStateById
37
- } from "./chunk-CIG6WI7Q.js";
33
+ } from "./chunk-MRXMFB4L.js";
34
+ import {
35
+ buildSentryConversationUrl,
36
+ deleteWebAuthorization
37
+ } from "./chunk-VKQWU4PO.js";
38
38
  import {
39
39
  createUserTokenStore,
40
40
  deleteMcpAuthSession,
@@ -44,8 +44,9 @@ import {
44
44
  getMcpStoredOAuthCredentials,
45
45
  lookupSlackUserProfile,
46
46
  resolvePluginOAuthAccount
47
- } from "./chunk-W2DDJCPS.js";
47
+ } from "./chunk-YYZNESC3.js";
48
48
  import {
49
+ RetryableDeliveryError,
49
50
  addReactionToMessage,
50
51
  escapeSlackMrkdwnText,
51
52
  formatProviderLabel,
@@ -57,20 +58,7 @@ import {
57
58
  removeReactionFromMessage,
58
59
  resolveBaseUrl,
59
60
  truncateStatusText
60
- } from "./chunk-UVUXFRYN.js";
61
- import {
62
- parseSlackThreadId,
63
- readSlackRawMessageContext,
64
- resolveSlackChannelIdFromMessage,
65
- resolveSlackChannelIdFromThreadId
66
- } from "./chunk-CVBDVIF4.js";
67
- import {
68
- RetryableDeliveryError
69
- } from "./chunk-6FGN7ZEG.js";
70
- import {
71
- ensureConversationWake,
72
- requestConversationWork
73
- } from "./chunk-MQDIIFZM.js";
61
+ } from "./chunk-PCPSX4ES.js";
74
62
  import {
75
63
  CooperativeTurnYieldError,
76
64
  clearPendingAuth,
@@ -79,7 +67,7 @@ import {
79
67
  isCooperativeTurnYieldError,
80
68
  isPendingAuthLatestRequest,
81
69
  markTurnFailed
82
- } from "./chunk-Z5SKZE5B.js";
70
+ } from "./chunk-GP32KD2J.js";
83
71
  import {
84
72
  TurnSliceLimitExceededError,
85
73
  abandonTurnRecord,
@@ -99,13 +87,23 @@ import {
99
87
  recordTurnSummary,
100
88
  saveTurnCheckpoint,
101
89
  turnHasReply
102
- } from "./chunk-6YGFBU3A.js";
90
+ } from "./chunk-MFSET7Q7.js";
103
91
  import {
104
- getVercelConversationWorkQueue
105
- } from "./chunk-DKIJ2RP5.js";
92
+ parseSlackThreadId,
93
+ readSlackRawMessageContext,
94
+ resolveSlackChannelIdFromMessage,
95
+ resolveSlackChannelIdFromThreadId
96
+ } from "./chunk-MVPLEPSI.js";
97
+ import {
98
+ ensureConversationWake,
99
+ requestConversationWork
100
+ } from "./chunk-WN6VLHOU.js";
106
101
  import {
107
102
  getTurnRequestDeadline
108
- } from "./chunk-WGZJ5SU4.js";
103
+ } from "./chunk-S3SGZUOI.js";
104
+ import {
105
+ getVercelConversationWorkQueue
106
+ } from "./chunk-DKIJ2RP5.js";
109
107
  import {
110
108
  SlackActionError,
111
109
  getDashboardConversationLink,
@@ -114,38 +112,39 @@ import {
114
112
  getSlackClient,
115
113
  isDmChannel,
116
114
  normalizeSlackConversationId
117
- } from "./chunk-QCGNHSMA.js";
115
+ } from "./chunk-MI6ZBDTS.js";
118
116
  import {
117
+ getConversationStore,
119
118
  getSqlExecutor,
120
119
  requireSlackDestination,
121
120
  upsertIdentity,
122
121
  upsertLinkedIdentity
123
- } from "./chunk-IUUQWIG2.js";
122
+ } from "./chunk-CUYFCI4G.js";
124
123
  import {
125
124
  acquireActiveLock,
126
125
  getStateAdapter
127
- } from "./chunk-ZX7RSBQ6.js";
126
+ } from "./chunk-5CXCGDIL.js";
128
127
  import {
129
128
  botConfig,
130
129
  escapeXml,
131
130
  getChatConfig,
132
131
  getRuntimeMetadata,
133
132
  normalizeSlackEmojiName
134
- } from "./chunk-Q7O74WOO.js";
133
+ } from "./chunk-BYBSI5TI.js";
135
134
  import {
136
135
  defaultModelId
137
136
  } from "./chunk-D4YV5TDV.js";
138
137
  import {
139
138
  discoverSkills
140
- } from "./chunk-3HEZWDS5.js";
139
+ } from "./chunk-YYSEH2WC.js";
141
140
  import {
142
141
  pluginCatalogRuntime
143
- } from "./chunk-NZLZ4KYZ.js";
142
+ } from "./chunk-E3PDZPGV.js";
144
143
  import {
145
144
  buildOAuthTokenRequest,
146
145
  hasRequiredOAuthScope,
147
146
  parseOAuthTokenResponse
148
- } from "./chunk-QIOUTXTZ.js";
147
+ } from "./chunk-ZV6PFUA4.js";
149
148
  import {
150
149
  createSlackResumeActor,
151
150
  isUserActor,
@@ -164,7 +163,7 @@ import {
164
163
  setTags,
165
164
  toOptionalString,
166
165
  withLogContext
167
- } from "./chunk-QIMN3FXL.js";
166
+ } from "./chunk-PY3EIEAF.js";
168
167
 
169
168
  // src/chat/slack/assistant-thread/status-render.ts
170
169
  var DEFAULT_STATUS_CONTEXTS = {
@@ -1374,6 +1373,7 @@ async function resumeSlackTurnInContext(args) {
1374
1373
  }
1375
1374
  status.update(runArgs.initialStatus);
1376
1375
  const conversationId = runArgs.conversationId;
1376
+ const visibility = (await getConversationStore().get({ conversationId }))?.visibility;
1377
1377
  const visibleConversationId = lockKey;
1378
1378
  const sessionId = runArgs.turnId;
1379
1379
  let deliveryConversation;
@@ -1481,7 +1481,7 @@ async function resumeSlackTurnInContext(args) {
1481
1481
  () => recordTurnSummary({
1482
1482
  conversationId: runArgs.conversationId,
1483
1483
  destination: savedRun.destination,
1484
- destinationVisibility: savedRun.destinationVisibility,
1484
+ destinationVisibility: visibility,
1485
1485
  dispatchId,
1486
1486
  resultMessageId: messageTs,
1487
1487
  turnId: runArgs.turnId,
@@ -1502,10 +1502,7 @@ async function resumeSlackTurnInContext(args) {
1502
1502
  deliveryState.conversation,
1503
1503
  sessionId
1504
1504
  );
1505
- const run = buildResumedRun(runArgs, status, {
1506
- ...runArgs.run?.publishExternally !== false && runArgs.run?.source.location ? { location: runArgs.run.source.location } : void 0,
1507
- send: deliverAssistantMessage
1508
- });
1505
+ const run = buildResumedRun(runArgs, status, deliverAssistantMessage);
1509
1506
  if (runArgs.inputMessageIds?.length) {
1510
1507
  await turnLifecycle.start({
1511
1508
  conversationId: runArgs.conversationId,
@@ -1540,7 +1537,7 @@ async function resumeSlackTurnInContext(args) {
1540
1537
  durationMs: reply.diagnostics.durationMs,
1541
1538
  usage: reply.diagnostics.usage,
1542
1539
  destination: run.destination,
1543
- destinationVisibility: run.destinationVisibility,
1540
+ destinationVisibility: visibility,
1544
1541
  dispatchId: run.dispatch?.id,
1545
1542
  dispatchOutcome: reply.diagnostics.outcome === "success" ? "completed" : "failed",
1546
1543
  ...dispatchErrorMessage ? { errorMessage: dispatchErrorMessage } : void 0,
@@ -1554,7 +1551,7 @@ async function resumeSlackTurnInContext(args) {
1554
1551
  await recordTurnSummary({
1555
1552
  conversationId: runArgs.conversationId,
1556
1553
  destination: run.destination,
1557
- destinationVisibility: run.destinationVisibility,
1554
+ destinationVisibility: visibility,
1558
1555
  dispatchId: run.dispatch?.id,
1559
1556
  dispatchOutcome: reply.diagnostics.outcome === "success" ? "completed" : "failed",
1560
1557
  ...acceptedDeliveryId ? { resultMessageId: acceptedDeliveryId } : void 0,
@@ -2092,6 +2089,7 @@ async function resumeAuthorizedMcpTurn(args) {
2092
2089
  },
2093
2090
  actor,
2094
2091
  destination,
2092
+ ...routing.location ? { location: routing.location } : void 0,
2095
2093
  source: routing.source,
2096
2094
  toolChannelId: authSession.toolChannelId ?? authSession.channelId,
2097
2095
  environment: {
@@ -2757,6 +2755,7 @@ async function resumeOAuthSessionRecordTurn(stored, options) {
2757
2755
  },
2758
2756
  actor,
2759
2757
  destination,
2758
+ ...routing.location ? { location: routing.location } : void 0,
2760
2759
  source: routing.source,
2761
2760
  toolChannelId: stored.channelId,
2762
2761
  environment: {
@@ -8,14 +8,14 @@ import {
8
8
  getConversationStore,
9
9
  parseDestination,
10
10
  sameDestination
11
- } from "./chunk-IUUQWIG2.js";
11
+ } from "./chunk-CUYFCI4G.js";
12
12
  import {
13
13
  getDefaultRedisStateAdapterFor,
14
14
  getStateAdapter
15
- } from "./chunk-ZX7RSBQ6.js";
15
+ } from "./chunk-5CXCGDIL.js";
16
16
  import {
17
17
  getChatConfig
18
- } from "./chunk-Q7O74WOO.js";
18
+ } from "./chunk-BYBSI5TI.js";
19
19
  import {
20
20
  parseStoredSlackActor
21
21
  } from "./chunk-N7TMSOZH.js";
@@ -23,7 +23,7 @@ import {
23
23
  isRecord,
24
24
  toOptionalNumber,
25
25
  toOptionalString
26
- } from "./chunk-QIMN3FXL.js";
26
+ } from "./chunk-PY3EIEAF.js";
27
27
 
28
28
  // src/chat/task-execution/state.ts
29
29
  import { randomUUID } from "crypto";
@@ -730,7 +730,14 @@ async function appendInboundMessageWithAdmission(args) {
730
730
  if (args.exclusive && hasRunnableWork(current)) {
731
731
  return { status: "active" };
732
732
  }
733
- const status = current.execution.lease && current.execution.status === "running" ? "running" : current.execution.lease ? "paused" : "pending";
733
+ let status;
734
+ if (current.execution.lease) {
735
+ status = current.execution.status === "running" ? "running" : "paused";
736
+ } else if (current.execution.status === "paused" && args.message.delivery === "defer") {
737
+ status = "paused";
738
+ } else {
739
+ status = "pending";
740
+ }
734
741
  const next = {
735
742
  ...current,
736
743
  destination: current.destination ?? args.message.destination,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getConversationEventStore
3
- } from "./chunk-IUUQWIG2.js";
3
+ } from "./chunk-CUYFCI4G.js";
4
4
 
5
5
  // src/chat/conversations/turn-lifecycle.ts
6
6
  var ConversationTurnLifecycleService = class {
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ConversationTurnLifecycleService
3
- } from "./chunk-W42ENMJW.js";
3
+ } from "./chunk-WWYUYKKV.js";
4
4
  import {
5
5
  runAgentWithTimeout
6
- } from "./chunk-6FGN7ZEG.js";
6
+ } from "./chunk-PCPSX4ES.js";
7
7
  import {
8
8
  getConversationEventStore
9
- } from "./chunk-IUUQWIG2.js";
9
+ } from "./chunk-CUYFCI4G.js";
10
10
 
11
11
  // src/chat/runtime/turn-execution.ts
12
12
  var AgentRunError = class extends Error {
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  AgentRunError,
3
3
  executeTurn
4
- } from "./chunk-ERZMACYA.js";
4
+ } from "./chunk-WYDF6PGK.js";
5
5
  import {
6
6
  ConversationTurnLifecycleService
7
- } from "./chunk-W42ENMJW.js";
7
+ } from "./chunk-WWYUYKKV.js";
8
8
  import {
9
9
  getPersistedSandboxState,
10
10
  getPersistedThreadState,
11
11
  persistThreadStateById
12
- } from "./chunk-CIG6WI7Q.js";
12
+ } from "./chunk-MRXMFB4L.js";
13
13
  import {
14
14
  AgentInvocationBusyError,
15
15
  AgentInvocationLimitError,
@@ -18,32 +18,32 @@ import {
18
18
  agentBindingSchema,
19
19
  agentInvocationSchema,
20
20
  createAgentInvocationSchema
21
- } from "./chunk-6JZGXLL2.js";
22
- import {
23
- appendAndEnqueueInboundMessage
24
- } from "./chunk-MQDIIFZM.js";
21
+ } from "./chunk-AC7MDOJW.js";
25
22
  import {
26
23
  TurnInputCommitLostError,
27
24
  getAssistantReplyText,
28
25
  getConversationTurnBoundaryError,
29
26
  isTurnInputCommitLostError
30
- } from "./chunk-Z5SKZE5B.js";
27
+ } from "./chunk-GP32KD2J.js";
31
28
  import {
32
29
  failTurnRecord,
33
30
  getTerminalAssistantMessages,
34
31
  getTurnRecord,
35
32
  openConversationProjection,
36
33
  saveTurnCheckpoint
37
- } from "./chunk-6YGFBU3A.js";
34
+ } from "./chunk-MFSET7Q7.js";
35
+ import {
36
+ appendAndEnqueueInboundMessage
37
+ } from "./chunk-WN6VLHOU.js";
38
38
  import {
39
39
  getConversationEventStore,
40
40
  getConversationStore,
41
41
  getSqlExecutor
42
- } from "./chunk-IUUQWIG2.js";
42
+ } from "./chunk-CUYFCI4G.js";
43
43
  import {
44
44
  juniorAgentBindings,
45
45
  juniorAgentInvocations
46
- } from "./chunk-QVH6FW3T.js";
46
+ } from "./chunk-5VWAY27R.js";
47
47
 
48
48
  // src/chat/agent-invocations/work.ts
49
49
  import { z } from "zod";
@@ -97,7 +97,6 @@ function invocationFromRow(row) {
97
97
  createdAtMs: row.createdAt.getTime(),
98
98
  ...row.credentialContext ? { credentialContext: row.credentialContext } : void 0,
99
99
  destination: row.destination,
100
- ...row.destinationVisibility ? { destinationVisibility: row.destinationVisibility } : void 0,
101
100
  ...row.errorMessage !== null ? { errorMessage: row.errorMessage } : void 0,
102
101
  input: row.input,
103
102
  invocationId: row.invocationId,
@@ -112,7 +111,7 @@ function invocationFromRow(row) {
112
111
  });
113
112
  }
114
113
  function sameCreateInput(invocation, input) {
115
- return invocation.parentConversationId === input.parentConversationId && invocation.agentName === input.agentName && invocation.input === input.input && invocation.reasoningLevel === input.reasoningLevel && JSON.stringify(invocation.actor) === JSON.stringify(input.actor) && JSON.stringify(invocation.credentialContext) === JSON.stringify(input.credentialContext) && JSON.stringify(invocation.destination) === JSON.stringify(input.destination) && invocation.destinationVisibility === input.destinationVisibility && JSON.stringify(invocation.source) === JSON.stringify(input.source);
114
+ return invocation.parentConversationId === input.parentConversationId && invocation.agentName === input.agentName && invocation.input === input.input && invocation.reasoningLevel === input.reasoningLevel && JSON.stringify(invocation.actor) === JSON.stringify(input.actor) && JSON.stringify(invocation.credentialContext) === JSON.stringify(input.credentialContext) && JSON.stringify(invocation.destination) === JSON.stringify(input.destination) && JSON.stringify(invocation.source) === JSON.stringify(input.source);
116
115
  }
117
116
  async function getAgentBinding(args) {
118
117
  const rows = await getSqlExecutor().db().select().from(juniorAgentBindings).where(
@@ -226,7 +225,6 @@ async function createAgentInvocation(rawInput, nowMs = Date.now()) {
226
225
  credentialContext: input.credentialContext ?? null,
227
226
  source: input.source,
228
227
  destination: input.destination,
229
- destinationVisibility: input.destinationVisibility ?? null,
230
228
  reasoningLevel: input.reasoningLevel ?? null,
231
229
  status: "pending",
232
230
  mailboxStatus: "pending",
@@ -458,7 +456,6 @@ async function saveAgentInvocationResult(args) {
458
456
  durationMs: args.result.diagnostics.durationMs,
459
457
  usage: args.result.diagnostics.usage,
460
458
  destination: args.invocation.destination,
461
- destinationVisibility: args.invocation.destinationVisibility,
462
459
  ...failed ? {
463
460
  errorMessage: args.result.diagnostics.errorMessage ?? "Agent invocation failed"
464
461
  } : void 0,
@@ -593,9 +590,9 @@ function createAgentInvocationWorker(agentRunner) {
593
590
  actor: invocation.actor,
594
591
  credentialContext: invocation.credentialContext,
595
592
  destination: invocation.destination,
596
- destinationVisibility: invocation.destinationVisibility,
597
593
  publishExternally: context.publishExternally,
598
- source: location ? { ...invocation.source, location } : invocation.source,
594
+ source: invocation.source,
595
+ ...location ? { location } : void 0,
599
596
  surface: "internal",
600
597
  // TODO(dcramer): Issues #881 and #883 track a path for child runs to
601
598
  // force interactive auth when a delegated tool requires credentials
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-NZLZ4KYZ.js";
3
+ } from "./chunk-E3PDZPGV.js";
4
4
  import {
5
5
  skillRoots
6
6
  } from "./chunk-TXKUKMVO.js";
7
7
  import {
8
8
  logWarn
9
- } from "./chunk-QIMN3FXL.js";
9
+ } from "./chunk-PY3EIEAF.js";
10
10
 
11
11
  // src/chat/skills.ts
12
12
  import fs from "fs/promises";
@@ -1,32 +1,32 @@
1
1
  import {
2
2
  resolveBaseUrl
3
- } from "./chunk-UVUXFRYN.js";
3
+ } from "./chunk-PCPSX4ES.js";
4
4
  import {
5
5
  createPluginLogger,
6
6
  getPlugins,
7
7
  getSlackClient,
8
8
  withSlackRetries
9
- } from "./chunk-QCGNHSMA.js";
9
+ } from "./chunk-MI6ZBDTS.js";
10
10
  import {
11
11
  getDb,
12
12
  parseDestination
13
- } from "./chunk-IUUQWIG2.js";
13
+ } from "./chunk-CUYFCI4G.js";
14
14
  import {
15
15
  sleep
16
- } from "./chunk-X55FOVZO.js";
16
+ } from "./chunk-WDHPN2GH.js";
17
17
  import {
18
18
  acquireActiveLock,
19
19
  getStateAdapter
20
- } from "./chunk-ZX7RSBQ6.js";
20
+ } from "./chunk-5CXCGDIL.js";
21
21
  import {
22
22
  pluginCatalogRuntime
23
- } from "./chunk-NZLZ4KYZ.js";
23
+ } from "./chunk-E3PDZPGV.js";
24
24
  import {
25
25
  fetchWithBoundedOAuthErrorBodies
26
- } from "./chunk-QIOUTXTZ.js";
26
+ } from "./chunk-ZV6PFUA4.js";
27
27
  import {
28
28
  isRecord
29
- } from "./chunk-QIMN3FXL.js";
29
+ } from "./chunk-PY3EIEAF.js";
30
30
 
31
31
  // src/chat/capabilities/router.ts
32
32
  var ProviderCredentialRouter = class {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  createAndEnqueueAgentInvocation
3
- } from "./chunk-SC67CH3C.js";
3
+ } from "./chunk-YNZPOFF3.js";
4
4
  import {
5
5
  actorFromRun,
6
6
  toolInvocationDestination
7
- } from "./chunk-6FGN7ZEG.js";
7
+ } from "./chunk-PCPSX4ES.js";
8
8
 
9
9
  // src/chat/agent-invocations/spawn.ts
10
10
  function bindSpawnAgent(run, options) {
@@ -21,9 +21,6 @@ function bindSpawnAgent(run, options) {
21
21
  ...input.name ? { agentName: input.name } : void 0,
22
22
  ...run.credentialContext ? { credentialContext: run.credentialContext } : void 0,
23
23
  destination: toolInvocationDestination(run),
24
- ...run.destinationVisibility ? {
25
- destinationVisibility: run.destinationVisibility
26
- } : void 0,
27
24
  idempotencyKey: `${run.turnId}:${call.toolCallId}`,
28
25
  input: input.task,
29
26
  parentConversationId: run.conversationId,
@@ -12,7 +12,7 @@ import {
12
12
  logInfo,
13
13
  logWarn,
14
14
  setSpanAttributes
15
- } from "./chunk-QIMN3FXL.js";
15
+ } from "./chunk-PY3EIEAF.js";
16
16
 
17
17
  // src/chat/plugins/manifest.ts
18
18
  import { z } from "zod";
package/dist/cli/chat.js CHANGED
@@ -1,52 +1,53 @@
1
1
  import {
2
2
  executeAgentRun
3
- } from "../chunk-RMB7CERI.js";
4
- import "../chunk-6JZGXLL2.js";
3
+ } from "../chunk-QNIOBNOY.js";
4
+ import "../chunk-AC7MDOJW.js";
5
5
  import "../chunk-6Y5B5PEX.js";
6
6
  import "../chunk-DIB4GX3G.js";
7
- import "../chunk-W2DDJCPS.js";
8
- import "../chunk-UVUXFRYN.js";
9
- import "../chunk-VFZAUQ5V.js";
10
- import "../chunk-CVBDVIF4.js";
7
+ import "../chunk-YYZNESC3.js";
11
8
  import {
12
9
  createAgentRunner
13
- } from "../chunk-6FGN7ZEG.js";
14
- import "../chunk-MQDIIFZM.js";
15
- import "../chunk-Z5SKZE5B.js";
16
- import "../chunk-6YGFBU3A.js";
10
+ } from "../chunk-PCPSX4ES.js";
11
+ import "../chunk-GP32KD2J.js";
12
+ import "../chunk-MFSET7Q7.js";
17
13
  import "../chunk-2LYHWMR4.js";
18
- import "../chunk-XJIPMHKI.js";
14
+ import "../chunk-CMWIMFM6.js";
15
+ import "../chunk-MVPLEPSI.js";
16
+ import "../chunk-WN6VLHOU.js";
17
+ import "../chunk-DA2KGZZI.js";
18
+ import "../chunk-O35GZCKL.js";
19
+ import "../chunk-6AUR6PWR.js";
19
20
  import "../chunk-PDO5BLNM.js";
20
21
  import "../chunk-UIE3R5XU.js";
21
22
  import "../chunk-X6GDDWQH.js";
23
+ import "../chunk-S3SGZUOI.js";
22
24
  import "../chunk-DKIJ2RP5.js";
23
25
  import "../chunk-JAL3CH4G.js";
24
26
  import "../chunk-7H2VZTWN.js";
25
- import "../chunk-WGZJ5SU4.js";
26
27
  import {
27
28
  loadAppPluginSet
28
29
  } from "../chunk-Y2CM7HXH.js";
29
- import "../chunk-QCGNHSMA.js";
30
+ import "../chunk-MI6ZBDTS.js";
30
31
  import "../chunk-3Y47VMHV.js";
31
- import "../chunk-IUUQWIG2.js";
32
- import "../chunk-QVH6FW3T.js";
33
- import "../chunk-X55FOVZO.js";
34
- import "../chunk-ZX7RSBQ6.js";
32
+ import "../chunk-CUYFCI4G.js";
33
+ import "../chunk-5VWAY27R.js";
34
+ import "../chunk-WDHPN2GH.js";
35
+ import "../chunk-5CXCGDIL.js";
35
36
  import "../chunk-GFBR4S3Q.js";
36
37
  import "../chunk-VFUK3X5B.js";
37
- import "../chunk-Q7O74WOO.js";
38
+ import "../chunk-BYBSI5TI.js";
38
39
  import "../chunk-D4YV5TDV.js";
39
- import "../chunk-FIUCHYT6.js";
40
- import "../chunk-3HEZWDS5.js";
41
- import "../chunk-NZLZ4KYZ.js";
42
- import "../chunk-QIOUTXTZ.js";
40
+ import "../chunk-DYXVAO2E.js";
41
+ import "../chunk-YYSEH2WC.js";
42
+ import "../chunk-E3PDZPGV.js";
43
+ import "../chunk-ZV6PFUA4.js";
43
44
  import "../chunk-CEMMLV5L.js";
44
45
  import "../chunk-N7TMSOZH.js";
45
46
  import "../chunk-DWPN6SCH.js";
46
47
  import "../chunk-TXKUKMVO.js";
47
- import "../chunk-QIMN3FXL.js";
48
+ import "../chunk-PY3EIEAF.js";
48
49
  import "../chunk-PEQXYSSE.js";
49
- import "../chunk-32XSSFZV.js";
50
+ import "../chunk-NY2F7BZA.js";
50
51
 
51
52
  // src/cli/chat.ts
52
53
  import {
@@ -168,10 +169,10 @@ async function configureLocalChatPlugins(pluginSet) {
168
169
  databaseModule
169
170
  ] = await Promise.all([
170
171
  import("../plugins-YTYJMMJF.js"),
171
- import("../agent-hooks-5RQEVLQD.js"),
172
- import("../catalog-runtime-L4A6BJ3U.js"),
173
- import("../validation-E6Z5LHZM.js"),
174
- import("../db-YPRZAA2T.js")
172
+ import("../agent-hooks-6QRYH6PX.js"),
173
+ import("../catalog-runtime-IETJLJFG.js"),
174
+ import("../validation-CH36LTOS.js"),
175
+ import("../db-LPJKR2EO.js")
175
176
  ]);
176
177
  const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
177
178
  const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
@@ -237,14 +238,14 @@ async function prepareLocalChatRun(io, pluginSet) {
237
238
  await configureLocalChatPlugins(pluginSet);
238
239
  const { setExperimentalFeatures } = await import("../experimental-P5FZM4CU.js");
239
240
  setExperimentalFeatures({ subagents: true });
240
- const { runLocalAgentTurn } = await import("../runner-FKVFFPLO.js");
241
- const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-DBBIR3XG.js");
241
+ const { runLocalAgentTurn } = await import("../runner-L5DPVYCN.js");
242
+ const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-DMXF4TTQ.js");
242
243
  const { createLocalOAuthState } = await import("../oauth-relay-5XPVRPYB.js");
243
244
  const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-FIL7EGPR.js");
244
- const { bindSpawnAgent } = await import("../spawn-CO7QFCNJ.js");
245
- const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-OFTXWOK4.js");
245
+ const { bindSpawnAgent } = await import("../spawn-VRUIGKWW.js");
246
+ const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-HBC5Y5VZ.js");
246
247
  const { createLocalConversationWork } = await import("../conversation-work-VIOQ5ZF3.js");
247
- const { processConversationWork } = await import("../worker-OMWNOKTJ.js");
248
+ const { processConversationWork } = await import("../worker-5RDZHLXH.js");
248
249
  let agentRunner;
249
250
  const localConversationWork = createLocalConversationWork(async (message) => {
250
251
  if (!agentRunner) {