@sentry/junior 0.92.0 → 0.93.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 (30) hide show
  1. package/dist/{agent-hooks-BYSSWCNW.js → agent-hooks-ZG7IDOIN.js} +5 -5
  2. package/dist/api/people/list.js +3 -3
  3. package/dist/api/people/profile.js +3 -3
  4. package/dist/app.js +44 -15
  5. package/dist/chat/agent/tools.d.ts +2 -0
  6. package/dist/chat/pi/client.d.ts +1 -1
  7. package/dist/chat/pi/sdk.d.ts +7 -0
  8. package/dist/chat/plugins/agent-hooks.d.ts +2 -0
  9. package/dist/{chunk-H7KUZAMZ.js → chunk-6H4PP63X.js} +2 -2
  10. package/dist/{chunk-ZATRYQLR.js → chunk-7STN2ZSK.js} +1 -1
  11. package/dist/{chunk-OJP53WIU.js → chunk-HDNWZMUN.js} +3 -3
  12. package/dist/{chunk-7DVIELX3.js → chunk-JJUJ4CO2.js} +416 -415
  13. package/dist/{chunk-BMQ5DXHV.js → chunk-LE5ANBUZ.js} +2 -2
  14. package/dist/{chunk-N25HRI6B.js → chunk-LNCREA5Z.js} +2 -2
  15. package/dist/{chunk-ACJENBVF.js → chunk-MAVOJ54A.js} +7 -7
  16. package/dist/{chunk-3F54A3YM.js → chunk-NAPITCZ6.js} +12 -10
  17. package/dist/{chunk-NIFONS4W.js → chunk-NFXSLTYG.js} +1 -1
  18. package/dist/{chunk-TF5VLGA7.js → chunk-QGEWC27H.js} +2 -2
  19. package/dist/{chunk-7FS3K243.js → chunk-QL66APYJ.js} +4 -3
  20. package/dist/{chunk-OZJXGX4U.js → chunk-TNUUATT7.js} +1 -1
  21. package/dist/{chunk-VY7TVOIK.js → chunk-UUB3D2XI.js} +5 -3
  22. package/dist/{chunk-APIVR44P.js → chunk-YJ4OPVNA.js} +1 -1
  23. package/dist/cli/chat.js +13 -13
  24. package/dist/cli/plugins.js +5 -5
  25. package/dist/cli/snapshot-warmup.js +3 -3
  26. package/dist/cli/upgrade.js +5 -5
  27. package/dist/{db-GCK43OO3.js → db-YDN6AFJH.js} +2 -2
  28. package/dist/reporting.js +8 -8
  29. package/dist/{runner-XWTFA26U.js → runner-XAZPJNAQ.js} +8 -8
  30. package/package.json +8 -8
@@ -11,12 +11,12 @@ import {
11
11
  getPlugins,
12
12
  setPlugins,
13
13
  validatePlugins
14
- } from "./chunk-VY7TVOIK.js";
15
- import "./chunk-OZJXGX4U.js";
14
+ } from "./chunk-UUB3D2XI.js";
15
+ import "./chunk-TNUUATT7.js";
16
16
  import "./chunk-G3E7SCME.js";
17
- import "./chunk-ZATRYQLR.js";
18
- import "./chunk-NIFONS4W.js";
19
- import "./chunk-3F54A3YM.js";
17
+ import "./chunk-7STN2ZSK.js";
18
+ import "./chunk-NFXSLTYG.js";
19
+ import "./chunk-NAPITCZ6.js";
20
20
  import "./chunk-YYBX2BD5.js";
21
21
  import "./chunk-GHGPTPBL.js";
22
22
  import "./chunk-S6QKIGRM.js";
@@ -9,9 +9,9 @@ import {
9
9
  reportTime,
10
10
  signals,
11
11
  summaryFromRow
12
- } from "../../chunk-APIVR44P.js";
13
- import "../../chunk-NIFONS4W.js";
14
- import "../../chunk-3F54A3YM.js";
12
+ } from "../../chunk-YJ4OPVNA.js";
13
+ import "../../chunk-NFXSLTYG.js";
14
+ import "../../chunk-NAPITCZ6.js";
15
15
  import "../../chunk-YYBX2BD5.js";
16
16
  import "../../chunk-GHGPTPBL.js";
17
17
  import "../../chunk-S6QKIGRM.js";
@@ -18,9 +18,9 @@ import {
18
18
  statsItems,
19
19
  summaryFromRow,
20
20
  surfaceLabel
21
- } from "../../chunk-APIVR44P.js";
22
- import "../../chunk-NIFONS4W.js";
23
- import "../../chunk-3F54A3YM.js";
21
+ } from "../../chunk-YJ4OPVNA.js";
22
+ import "../../chunk-NFXSLTYG.js";
23
+ import "../../chunk-NAPITCZ6.js";
24
24
  import "../../chunk-YYBX2BD5.js";
25
25
  import "../../chunk-GHGPTPBL.js";
26
26
  import "../../chunk-S6QKIGRM.js";
package/dist/app.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  scheduleSessionCompletedPluginTasks,
18
18
  updateConversationStats,
19
19
  upsertConversationMessage
20
- } from "./chunk-ACJENBVF.js";
20
+ } from "./chunk-MAVOJ54A.js";
21
21
  import {
22
22
  CONVERSATION_WORK_CHECK_IN_INTERVAL_MS,
23
23
  CONVERSATION_WORK_STALE_ENQUEUE_MS,
@@ -41,7 +41,7 @@ import {
41
41
  requestConversationContinuation,
42
42
  requestConversationWork,
43
43
  startConversationWork
44
- } from "./chunk-TF5VLGA7.js";
44
+ } from "./chunk-QGEWC27H.js";
45
45
  import {
46
46
  getVercelConversationWorkQueue,
47
47
  resolveConversationWorkQueueTopic,
@@ -60,7 +60,7 @@ import {
60
60
  resolveSlackChannelTypeFromMessage,
61
61
  resolveSlackConversationContext,
62
62
  setConversationTitle
63
- } from "./chunk-N25HRI6B.js";
63
+ } from "./chunk-LNCREA5Z.js";
64
64
  import {
65
65
  validatePluginEgressCredentialHooks,
66
66
  validatePluginRegistrations
@@ -81,6 +81,9 @@ import {
81
81
  createAgentRunner,
82
82
  createUserTokenStore,
83
83
  deleteMcpAuthSession,
84
+ deleteMcpAuthSessionsForUserProvider,
85
+ deleteMcpServerSessionId,
86
+ deleteMcpStoredOAuthCredentials,
84
87
  deliverResourceEventSubscription,
85
88
  executeAgentRun,
86
89
  executeCredentialedEgressRequest,
@@ -102,9 +105,8 @@ import {
102
105
  setConfigDefaults,
103
106
  shouldEmitDevAgentTrace,
104
107
  shouldPropagateSandboxEgressTrace,
105
- startOAuthFlow,
106
- unlinkProvider
107
- } from "./chunk-7DVIELX3.js";
108
+ startOAuthFlow
109
+ } from "./chunk-JJUJ4CO2.js";
108
110
  import {
109
111
  CooperativeTurnYieldError,
110
112
  TurnInputCommitLostError,
@@ -131,12 +133,12 @@ import {
131
133
  persistThreadStateById,
132
134
  persistYieldSessionRecord,
133
135
  startActiveTurn
134
- } from "./chunk-OJP53WIU.js";
136
+ } from "./chunk-HDNWZMUN.js";
135
137
  import {
136
138
  JUNIOR_THREAD_STATE_TTL_MS,
137
139
  coerceThreadConversationState
138
140
  } from "./chunk-PFXC67GJ.js";
139
- import "./chunk-H7KUZAMZ.js";
141
+ import "./chunk-6H4PP63X.js";
140
142
  import {
141
143
  buildSlackOutputMessage,
142
144
  escapeSlackMrkdwnText,
@@ -144,7 +146,7 @@ import {
144
146
  normalizeSlackStatusText,
145
147
  splitSlackReplyText,
146
148
  truncateStatusText
147
- } from "./chunk-BMQ5DXHV.js";
149
+ } from "./chunk-LE5ANBUZ.js";
148
150
  import {
149
151
  abandonAgentTurnSessionRecord,
150
152
  commitMessages,
@@ -157,7 +159,7 @@ import {
157
159
  loadProjectionWithProvenance,
158
160
  recordAgentTurnSessionSummary,
159
161
  recordAuthorizationCompleted
160
- } from "./chunk-7FS3K243.js";
162
+ } from "./chunk-QL66APYJ.js";
161
163
  import {
162
164
  SlackActionError,
163
165
  bindSlackDirectCredentialSubject,
@@ -176,20 +178,20 @@ import {
176
178
  setPlugins,
177
179
  validatePlugins,
178
180
  verifySlackDirectCredentialSubject
179
- } from "./chunk-VY7TVOIK.js";
181
+ } from "./chunk-UUB3D2XI.js";
180
182
  import {
181
183
  createPluginLogger,
182
184
  createPluginState
183
- } from "./chunk-OZJXGX4U.js";
185
+ } from "./chunk-TNUUATT7.js";
184
186
  import "./chunk-G3E7SCME.js";
185
187
  import {
186
188
  acquireActiveLock,
187
189
  getStateAdapter
188
- } from "./chunk-ZATRYQLR.js";
190
+ } from "./chunk-7STN2ZSK.js";
189
191
  import {
190
192
  getConversationStore,
191
193
  getDb
192
- } from "./chunk-NIFONS4W.js";
194
+ } from "./chunk-NFXSLTYG.js";
193
195
  import {
194
196
  FUNCTION_TIMEOUT_BUFFER_SECONDS,
195
197
  botConfig,
@@ -209,7 +211,7 @@ import {
209
211
  stripRuntimeTurnContext,
210
212
  trimTrailingAssistantMessages,
211
213
  unwrapCurrentInstruction
212
- } from "./chunk-3F54A3YM.js";
214
+ } from "./chunk-NAPITCZ6.js";
213
215
  import {
214
216
  parseSlackThreadId,
215
217
  readSlackRawMessageContext,
@@ -5333,6 +5335,23 @@ async function GET4(request, provider, waitUntil, options) {
5333
5335
  }
5334
5336
  } catch (error) {
5335
5337
  if (error instanceof ResumeTurnBusyError) {
5338
+ logWarn(
5339
+ "oauth_callback_resume_busy",
5340
+ {
5341
+ ...stored.resumeConversationId && {
5342
+ conversationId: stored.resumeConversationId
5343
+ },
5344
+ ...stored.userId && { actorId: stored.userId },
5345
+ ...stored.channelId && { channelId: stored.channelId }
5346
+ },
5347
+ {
5348
+ "app.credential.provider": stored.provider,
5349
+ ...stored.resumeSessionId && {
5350
+ "app.ai.session_id": stored.resumeSessionId
5351
+ }
5352
+ },
5353
+ "OAuth callback resume was busy; user must send another message to continue"
5354
+ );
5336
5355
  return;
5337
5356
  }
5338
5357
  throw error;
@@ -5936,6 +5955,16 @@ async function handleSlashCommand(event) {
5936
5955
  }
5937
5956
  }
5938
5957
 
5958
+ // src/chat/credentials/unlink-provider.ts
5959
+ async function unlinkProvider(userId, provider, userTokenStore) {
5960
+ await Promise.all([
5961
+ userTokenStore.delete(userId, provider),
5962
+ deleteMcpStoredOAuthCredentials(userId, provider),
5963
+ deleteMcpServerSessionId(userId, provider),
5964
+ deleteMcpAuthSessionsForUserProvider(userId, provider)
5965
+ ]);
5966
+ }
5967
+
5939
5968
  // src/chat/ingress/slack-webhook.ts
5940
5969
  var IGNORED_MESSAGE_SUBTYPES = /* @__PURE__ */ new Set([
5941
5970
  "message_changed",
@@ -30,6 +30,8 @@ interface ToolWiringArgs {
30
30
  abortAgent: () => void;
31
31
  activeSkills: Skill[];
32
32
  currentActor?: Actor;
33
+ /** Live projection of the run's committed instruction-authority actors so far. */
34
+ currentActors?: () => Actor[];
33
35
  artifactStatePatch: Partial<ThreadArtifactsState>;
34
36
  availableSkills: SkillMetadata[];
35
37
  configurationValues: Record<string, unknown>;
@@ -1,4 +1,4 @@
1
- import { type Message, type Model, type ThinkingLevel } from "@earendil-works/pi-ai";
1
+ import { type Message, type Model, type ThinkingLevel } from "@/chat/pi/sdk";
2
2
  import type { ZodTypeAny, z } from "zod";
3
3
  export declare const GEN_AI_PROVIDER_NAME: "vercel-ai-gateway";
4
4
  export declare const GEN_AI_SERVER_ADDRESS = "ai-gateway.vercel.sh";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Local Pi SDK boundary. All Pi package imports used by chat/pi/client.ts
3
+ * are re-exported here so tests can mock a single Junior-owned path instead
4
+ * of Pi's internal subpath layout, which changes across SDK versions.
5
+ */
6
+ export { completeSimple, getEnvApiKey, getModels, registerApiProvider, type Message, type Model, type ThinkingLevel, } from "@earendil-works/pi-ai/compat";
7
+ export { stream as streamAnthropic, streamSimple as streamSimpleAnthropic, } from "@earendil-works/pi-ai/api/anthropic-messages";
@@ -52,4 +52,6 @@ export declare function getPluginOperationalReports(nowMs: number, conversations
52
52
  /** Create one runner over runtime hook plugins registered by the app. */
53
53
  export declare function createPluginHookRunner(input?: {
54
54
  actor?: Actor;
55
+ /** Live getter for the run's committed instruction actors; see `multi-actor-runs.md`. */
56
+ actors?: () => Actor[];
55
57
  }): PluginHookRunner;
@@ -3,10 +3,10 @@ import {
3
3
  } from "./chunk-G3E7SCME.js";
4
4
  import {
5
5
  getStateAdapter
6
- } from "./chunk-ZATRYQLR.js";
6
+ } from "./chunk-7STN2ZSK.js";
7
7
  import {
8
8
  toOptionalTrimmed
9
- } from "./chunk-3F54A3YM.js";
9
+ } from "./chunk-NAPITCZ6.js";
10
10
  import {
11
11
  pluginCatalogRuntime
12
12
  } from "./chunk-BTH37NCU.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getChatConfig
3
- } from "./chunk-3F54A3YM.js";
3
+ } from "./chunk-NAPITCZ6.js";
4
4
 
5
5
  // src/chat/state/adapter.ts
6
6
  import { createMemoryState } from "@chat-adapter/state-memory";
@@ -6,14 +6,14 @@ import {
6
6
  abandonAgentTurnSessionRecord,
7
7
  getAgentTurnSessionRecord,
8
8
  upsertAgentTurnSessionRecord
9
- } from "./chunk-7FS3K243.js";
9
+ } from "./chunk-QL66APYJ.js";
10
10
  import {
11
11
  getStateAdapter
12
- } from "./chunk-ZATRYQLR.js";
12
+ } from "./chunk-7STN2ZSK.js";
13
13
  import {
14
14
  getPiMessageRole,
15
15
  trimTrailingAssistantMessages
16
- } from "./chunk-3F54A3YM.js";
16
+ } from "./chunk-NAPITCZ6.js";
17
17
  import {
18
18
  getActiveTraceId,
19
19
  logException