@sentry/junior 0.78.0 → 0.80.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 (53) hide show
  1. package/dist/{agent-hooks-OFDNZJB2.js → agent-hooks-ZGTDOXQY.js} +11 -10
  2. package/dist/api-reference.d.ts +1 -1
  3. package/dist/app.js +39 -41
  4. package/dist/catalog-runtime-IVWRAPSI.js +12 -0
  5. package/dist/chat/conversation-privacy.d.ts +4 -0
  6. package/dist/chat/plugins/catalog-runtime.d.ts +1 -0
  7. package/dist/chat/plugins/registry.d.ts +27 -26
  8. package/dist/chat/sentry-payload-filter.d.ts +14 -0
  9. package/dist/chat/sentry.d.ts +1 -1
  10. package/dist/chat/state/session-log.d.ts +84 -0
  11. package/dist/chat/tools/advisor/tool.d.ts +1 -0
  12. package/dist/chat/tools/definition.d.ts +6 -0
  13. package/dist/{chunk-LUNMJQ7D.js → chunk-2AJ4TEKE.js} +6 -6
  14. package/dist/{chunk-ST6YNAXG.js → chunk-3DA7X2U3.js} +6 -3
  15. package/dist/{chunk-PNGAJ75P.js → chunk-3JKTVW4R.js} +7 -8
  16. package/dist/{chunk-Q6XFTRV5.js → chunk-4XHCVBXH.js} +2 -2
  17. package/dist/{chunk-Z4CIQ3EB.js → chunk-66NX7MNW.js} +1 -1
  18. package/dist/{chunk-Q3XNY442.js → chunk-6APU57E6.js} +1 -3
  19. package/dist/{chunk-T77LUIX3.js → chunk-ABRNFE3N.js} +7 -211
  20. package/dist/chunk-DR75T7J3.js +225 -0
  21. package/dist/{chunk-KIDP757T.js → chunk-FAGWUF44.js} +17 -7
  22. package/dist/{chunk-OJ53FYVG.js → chunk-FTMXFBDC.js} +14 -0
  23. package/dist/{chunk-RARSKPVT.js → chunk-GUO4EE7L.js} +2 -2
  24. package/dist/{chunk-2ECJXSVQ.js → chunk-IOBSRZK5.js} +1 -1
  25. package/dist/{chunk-EJN6G5A2.js → chunk-KF7522P3.js} +5 -19
  26. package/dist/{chunk-C2YBH4S6.js → chunk-LX5GBMEP.js} +6 -6
  27. package/dist/{chunk-237T7XAN.js → chunk-PQ2U2AO3.js} +3 -3
  28. package/dist/{chunk-YLVJRYTD.js → chunk-TW23AT22.js} +190 -196
  29. package/dist/{chunk-2MSW5BZY.js → chunk-W2QGQCKG.js} +129 -62
  30. package/dist/{chunk-Y3EG7S7P.js → chunk-WCXVEQPI.js} +7 -8
  31. package/dist/{chunk-LXTPBU4K.js → chunk-X2FL5ZH5.js} +1 -1
  32. package/dist/{chunk-SSWBYEFH.js → chunk-Y3YUOEAZ.js} +13 -7
  33. package/dist/{chunk-QDQVOMBA.js → chunk-YA2JCC7G.js} +165 -14
  34. package/dist/{chunk-VALUBQ7R.js → chunk-ZPCGQRFJ.js} +1 -1
  35. package/dist/cli/chat.js +12 -10
  36. package/dist/cli/check.js +7 -7
  37. package/dist/cli/main.js +1 -1
  38. package/dist/cli/plugins.js +17 -16
  39. package/dist/cli/snapshot-warmup.js +14 -15
  40. package/dist/cli/upgrade.js +20 -22
  41. package/dist/db-GQJKBX5W.js +18 -0
  42. package/dist/instrumentation.js +76 -3
  43. package/dist/nitro.js +8 -7
  44. package/dist/reporting/conversations.d.ts +30 -0
  45. package/dist/reporting.d.ts +1 -1
  46. package/dist/reporting.js +115 -24
  47. package/dist/{runner-WW4GJFUB.js → runner-JOVPVMIH.js} +18 -17
  48. package/dist/{sentry-4CP5NNQ5.js → sentry-EGFOV3DH.js} +5 -3
  49. package/dist/validation-TN6HMZAD.js +15 -0
  50. package/package.json +4 -4
  51. package/dist/db-NGQ3JCMF.js +0 -17
  52. package/dist/registry-RRIDPJBT.js +0 -46
  53. package/dist/validation-MDMYBRFB.js +0 -15
@@ -11,17 +11,18 @@ import {
11
11
  getPlugins,
12
12
  setPlugins,
13
13
  validatePlugins
14
- } from "./chunk-SSWBYEFH.js";
15
- import "./chunk-RARSKPVT.js";
16
- import "./chunk-237T7XAN.js";
14
+ } from "./chunk-Y3YUOEAZ.js";
15
+ import "./chunk-GUO4EE7L.js";
16
+ import "./chunk-PQ2U2AO3.js";
17
17
  import "./chunk-G3E7SCME.js";
18
- import "./chunk-LXTPBU4K.js";
19
- import "./chunk-Q6XFTRV5.js";
20
- import "./chunk-T77LUIX3.js";
21
- import "./chunk-VALUBQ7R.js";
22
- import "./chunk-EJN6G5A2.js";
23
- import "./chunk-OJ53FYVG.js";
24
- import "./chunk-ST6YNAXG.js";
18
+ import "./chunk-X2FL5ZH5.js";
19
+ import "./chunk-4XHCVBXH.js";
20
+ import "./chunk-ABRNFE3N.js";
21
+ import "./chunk-DR75T7J3.js";
22
+ import "./chunk-ZPCGQRFJ.js";
23
+ import "./chunk-KF7522P3.js";
24
+ import "./chunk-FTMXFBDC.js";
25
+ import "./chunk-3DA7X2U3.js";
25
26
  import "./chunk-MLKGABMK.js";
26
27
  export {
27
28
  PluginHookDeniedError,
@@ -8,6 +8,6 @@ export type { JuniorPluginInput, JuniorPluginSet, JuniorPluginSetOptions, } from
8
8
  export type { PluginRunContext, PluginRunTranscriptEntry, PluginTaskContext, PluginTaskDefinition, PluginTasks, } from "@sentry/junior-plugin-api";
9
9
  export { pluginRunContextSchema, pluginRunTranscriptEntrySchema, } from "@sentry/junior-plugin-api";
10
10
  export { createJuniorReporting } from "./reporting";
11
- export type { PluginConversationStatus, PluginConversations, PluginConversationSummary, ConversationFeed, ConversationReport, ConversationReportStatus, ConversationRunReport, ConversationStatsItem, ConversationStatsReport, ConversationSummaryReport, ConversationSurface, ConversationUsage, HealthReport, JuniorReporting, PluginOperationalReport, PluginOperationalReportFeed, PluginPackageContentItemReport, PluginPackageContentReport, PluginReport, RequesterIdentity, RuntimeInfoReport, SkillReport, TranscriptMessage, TranscriptPart, TranscriptPartType, TranscriptRole, } from "./reporting";
11
+ export type { PluginConversationStatus, PluginConversations, PluginConversationSummary, ConversationActivityReport, ConversationActivityStatus, ConversationFeed, ConversationReport, ConversationReportStatus, ConversationRunReport, ConversationSubagentActivityReport, ConversationStatsItem, ConversationStatsReport, ConversationSummaryReport, ConversationSurface, ConversationToolActivityReport, ConversationUsage, HealthReport, JuniorReporting, PluginOperationalReport, PluginOperationalReportFeed, PluginPackageContentItemReport, PluginPackageContentReport, PluginReport, RequesterIdentity, RuntimeInfoReport, SkillReport, TranscriptMessage, TranscriptPart, TranscriptPartType, TranscriptRole, } from "./reporting";
12
12
  export { juniorVercelConfig } from "./vercel";
13
13
  export type { JuniorVercelConfigOptions } from "./vercel";
package/dist/app.js CHANGED
@@ -71,7 +71,7 @@ import {
71
71
  updateConversationStats,
72
72
  uploadFilesToThread,
73
73
  upsertConversationMessage
74
- } from "./chunk-2MSW5BZY.js";
74
+ } from "./chunk-W2QGQCKG.js";
75
75
  import {
76
76
  CONVERSATION_WORK_CHECK_IN_INTERVAL_MS,
77
77
  CONVERSATION_WORK_STALE_ENQUEUE_MS,
@@ -90,17 +90,17 @@ import {
90
90
  requestConversationContinuation,
91
91
  requestConversationWork,
92
92
  startConversationWork
93
- } from "./chunk-LUNMJQ7D.js";
93
+ } from "./chunk-2AJ4TEKE.js";
94
94
  import {
95
95
  JUNIOR_THREAD_STATE_TTL_MS,
96
96
  coerceThreadConversationState
97
- } from "./chunk-Z4CIQ3EB.js";
98
- import "./chunk-PNGAJ75P.js";
97
+ } from "./chunk-66NX7MNW.js";
98
+ import "./chunk-3JKTVW4R.js";
99
99
  import {
100
100
  getVercelConversationWorkQueue,
101
101
  resolveConversationWorkQueueTopic,
102
102
  verifyConversationQueueMessage
103
- } from "./chunk-2ECJXSVQ.js";
103
+ } from "./chunk-IOBSRZK5.js";
104
104
  import {
105
105
  PLUGIN_TASK_QUEUE_TOPIC,
106
106
  createVercelQueueClient,
@@ -113,7 +113,7 @@ import {
113
113
  resolveSlackChannelTypeFromMessage,
114
114
  resolveSlackConversationContext,
115
115
  setConversationTitle
116
- } from "./chunk-C2YBH4S6.js";
116
+ } from "./chunk-LX5GBMEP.js";
117
117
  import {
118
118
  abandonAgentTurnSessionRecord,
119
119
  buildSlackOutputMessage,
@@ -129,11 +129,11 @@ import {
129
129
  recordAuthorizationCompleted,
130
130
  splitSlackReplyText,
131
131
  truncateStatusText
132
- } from "./chunk-QDQVOMBA.js";
132
+ } from "./chunk-YA2JCC7G.js";
133
133
  import {
134
134
  validatePluginEgressCredentialHooks,
135
135
  validatePluginRegistrations
136
- } from "./chunk-KIDP757T.js";
136
+ } from "./chunk-FAGWUF44.js";
137
137
  import {
138
138
  defineJuniorPlugins,
139
139
  pluginCatalogConfigFromEnv,
@@ -149,20 +149,20 @@ import {
149
149
  setPlugins,
150
150
  validatePlugins,
151
151
  verifySlackDirectCredentialSubject
152
- } from "./chunk-SSWBYEFH.js";
152
+ } from "./chunk-Y3YUOEAZ.js";
153
153
  import {
154
154
  createPluginLogger,
155
155
  createPluginState
156
- } from "./chunk-RARSKPVT.js";
156
+ } from "./chunk-GUO4EE7L.js";
157
157
  import {
158
158
  getConversationStore,
159
159
  getDb
160
- } from "./chunk-237T7XAN.js";
160
+ } from "./chunk-PQ2U2AO3.js";
161
161
  import "./chunk-G3E7SCME.js";
162
162
  import {
163
163
  acquireActiveLock,
164
164
  getStateAdapter
165
- } from "./chunk-LXTPBU4K.js";
165
+ } from "./chunk-X2FL5ZH5.js";
166
166
  import {
167
167
  createSlackDestination,
168
168
  destinationKey,
@@ -174,7 +174,7 @@ import {
174
174
  parseDestination,
175
175
  requireSlackDestination,
176
176
  sameDestination
177
- } from "./chunk-Q6XFTRV5.js";
177
+ } from "./chunk-4XHCVBXH.js";
178
178
  import {
179
179
  FUNCTION_TIMEOUT_BUFFER_SECONDS,
180
180
  GEN_AI_PROVIDER_NAME,
@@ -190,27 +190,25 @@ import {
190
190
  getSlackSigningSecret,
191
191
  isProviderRetryError,
192
192
  normalizeSlackEmojiName,
193
- parseSlackThreadId,
194
- resolveSlackChannelIdFromMessage,
195
- resolveSlackChannelIdFromThreadId,
196
193
  setSlackReactionConfig,
197
194
  stripRuntimeTurnContext,
198
195
  trimTrailingAssistantMessages
199
- } from "./chunk-T77LUIX3.js";
196
+ } from "./chunk-ABRNFE3N.js";
197
+ import {
198
+ parseSlackThreadId,
199
+ resolveSlackChannelIdFromMessage,
200
+ resolveSlackChannelIdFromThreadId
201
+ } from "./chunk-DR75T7J3.js";
200
202
  import {
201
203
  discoverSkills
202
- } from "./chunk-Y3EG7S7P.js";
204
+ } from "./chunk-WCXVEQPI.js";
203
205
  import {
204
206
  CredentialUnavailableError,
205
207
  buildOAuthTokenRequest,
206
- getPluginCatalogSignature,
207
- getPluginOAuthConfig,
208
- getPluginProviders,
209
208
  hasRequiredOAuthScope,
210
- isPluginProvider,
211
209
  parseOAuthTokenResponse,
212
- setPluginCatalogConfig
213
- } from "./chunk-YLVJRYTD.js";
210
+ pluginCatalogRuntime
211
+ } from "./chunk-TW23AT22.js";
214
212
  import {
215
213
  createRequester,
216
214
  createSlackRequester,
@@ -218,10 +216,10 @@ import {
218
216
  isActorUserId,
219
217
  parseActorUserId,
220
218
  toStoredSlackRequester
221
- } from "./chunk-VALUBQ7R.js";
219
+ } from "./chunk-ZPCGQRFJ.js";
222
220
  import {
223
221
  homeDir
224
- } from "./chunk-Q3XNY442.js";
222
+ } from "./chunk-6APU57E6.js";
225
223
  import {
226
224
  buildTurnFailureResponse,
227
225
  createChatSdkLogger,
@@ -235,16 +233,16 @@ import {
235
233
  setSpanAttributes,
236
234
  setSpanStatus,
237
235
  setTags,
238
- toOptionalString,
239
236
  withContext,
240
237
  withSpan
241
- } from "./chunk-EJN6G5A2.js";
238
+ } from "./chunk-KF7522P3.js";
242
239
  import {
243
- JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
244
- } from "./chunk-OJ53FYVG.js";
240
+ JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE,
241
+ toOptionalString
242
+ } from "./chunk-FTMXFBDC.js";
245
243
  import {
246
244
  continueTrace
247
- } from "./chunk-ST6YNAXG.js";
245
+ } from "./chunk-3DA7X2U3.js";
248
246
  import "./chunk-MLKGABMK.js";
249
247
 
250
248
  // src/app.ts
@@ -3806,7 +3804,7 @@ async function buildHomeView(userId, userTokenStore) {
3806
3804
  const runtimeMetadata = getRuntimeMetadata();
3807
3805
  const descriptionText = loadDescriptionText();
3808
3806
  const skillsSummaryText = await buildSkillsSummaryText();
3809
- const providers = getPluginProviders();
3807
+ const providers = pluginCatalogRuntime.getProviders();
3810
3808
  const connectedSections = [];
3811
3809
  for (const plugin of providers) {
3812
3810
  const tokens = await connectedOAuthTokens(userId, plugin, userTokenStore);
@@ -4364,7 +4362,7 @@ async function resumePendingOAuthMessage(stored, options) {
4364
4362
  });
4365
4363
  }
4366
4364
  async function GET4(request, provider, waitUntil, options = {}) {
4367
- const providerConfig = getPluginOAuthConfig(provider);
4365
+ const providerConfig = pluginCatalogRuntime.getOAuthConfig(provider);
4368
4366
  if (!providerConfig) {
4369
4367
  return htmlErrorResponse(
4370
4368
  "Unknown provider",
@@ -4586,7 +4584,7 @@ function defaultGrantForProvider(input) {
4586
4584
  };
4587
4585
  }
4588
4586
  function oauthAuthorizationForProvider(provider) {
4589
- const oauth = getPluginOAuthConfig(provider);
4587
+ const oauth = pluginCatalogRuntime.getOAuthConfig(provider);
4590
4588
  return oauth ? {
4591
4589
  type: "oauth",
4592
4590
  provider,
@@ -6190,11 +6188,11 @@ function getCommandName() {
6190
6188
  return getChatConfig().slack.slashCommand;
6191
6189
  }
6192
6190
  async function handleLink(event, requesterId, provider) {
6193
- if (!isPluginProvider(provider)) {
6191
+ if (!pluginCatalogRuntime.isProvider(provider)) {
6194
6192
  await postEphemeral(event, `Unknown provider: \`${provider}\``);
6195
6193
  return;
6196
6194
  }
6197
- if (!getPluginOAuthConfig(provider)) {
6195
+ if (!pluginCatalogRuntime.getOAuthConfig(provider)) {
6198
6196
  await postEphemeral(
6199
6197
  event,
6200
6198
  `${formatProviderLabel(provider)} doesn't support account linking.`
@@ -6223,11 +6221,11 @@ async function handleLink(event, requesterId, provider) {
6223
6221
  }
6224
6222
  }
6225
6223
  async function handleUnlink(event, requesterId, provider) {
6226
- if (!isPluginProvider(provider)) {
6224
+ if (!pluginCatalogRuntime.isProvider(provider)) {
6227
6225
  await postEphemeral(event, `Unknown provider: \`${provider}\``);
6228
6226
  return;
6229
6227
  }
6230
- if (!getPluginOAuthConfig(provider)) {
6228
+ if (!pluginCatalogRuntime.getOAuthConfig(provider)) {
6231
6229
  await postEphemeral(
6232
6230
  event,
6233
6231
  `${formatProviderLabel(provider)} doesn't support account unlinking.`
@@ -11475,7 +11473,7 @@ async function createApp(options) {
11475
11473
  validatePlugins(plugins);
11476
11474
  getDb();
11477
11475
  const shouldValidatePluginCatalog = hasConfiguredPluginCatalog(pluginConfig) || Boolean(configuredPlugins?.registrations.length) || Boolean(Object.keys(options?.configDefaults ?? {}).length);
11478
- const previousPluginCatalogConfig = setPluginCatalogConfig(pluginConfig);
11476
+ const previousPluginCatalogConfig = pluginCatalogRuntime.setConfig(pluginConfig);
11479
11477
  const previousPlugins = setPlugins(plugins);
11480
11478
  const previousConfigDefaults = getConfigDefaults();
11481
11479
  const previousSlackReactionConfig = getSlackReactionConfig();
@@ -11492,7 +11490,7 @@ async function createApp(options) {
11492
11490
  setSlackReactionConfig(options.slack);
11493
11491
  }
11494
11492
  if (shouldValidatePluginCatalog) {
11495
- getPluginCatalogSignature();
11493
+ pluginCatalogRuntime.getSignature();
11496
11494
  validatePluginRegistrations(configuredPlugins?.registrations ?? []);
11497
11495
  validatePluginEgressCredentialHooks(
11498
11496
  configuredPlugins?.registrations ?? []
@@ -11504,7 +11502,7 @@ async function createApp(options) {
11504
11502
  pluginDashboardRoutes = getPluginDashboardRoutes();
11505
11503
  }
11506
11504
  } catch (error) {
11507
- setPluginCatalogConfig(previousPluginCatalogConfig);
11505
+ pluginCatalogRuntime.setConfig(previousPluginCatalogConfig);
11508
11506
  setPlugins(previousPlugins);
11509
11507
  setConfigDefaults(previousConfigDefaults);
11510
11508
  setSlackReactionConfig(previousSlackReactionConfig);
@@ -0,0 +1,12 @@
1
+ import {
2
+ pluginCatalogRuntime
3
+ } from "./chunk-TW23AT22.js";
4
+ import "./chunk-ZPCGQRFJ.js";
5
+ import "./chunk-6APU57E6.js";
6
+ import "./chunk-KF7522P3.js";
7
+ import "./chunk-FTMXFBDC.js";
8
+ import "./chunk-3DA7X2U3.js";
9
+ import "./chunk-MLKGABMK.js";
10
+ export {
11
+ pluginCatalogRuntime
12
+ };
@@ -10,6 +10,10 @@ export declare function canExposeConversationPayload(input: {
10
10
  channelId?: string;
11
11
  conversationId?: string;
12
12
  }): boolean;
13
+ /** Return the privacy mode bound to the current agent turn. */
14
+ export declare function getCurrentConversationPrivacy(): ConversationPrivacy | undefined;
15
+ /** Bind one conversation privacy mode to all async work in a turn. */
16
+ export declare function runWithConversationPrivacy<T>(privacy: ConversationPrivacy, callback: () => T): T;
13
17
  /** Convert a GenAI message into safe metadata for private trace contexts. */
14
18
  export declare function toGenAiMessageMetadata(message: unknown): Record<string, unknown>;
15
19
  /** Convert raw text into size-only metadata for private trace contexts. */
@@ -0,0 +1 @@
1
+ export declare const pluginCatalogRuntime: import("@/chat/plugins/registry").PluginCatalogRuntime;
@@ -1,29 +1,30 @@
1
1
  import type { CapabilityProviderDefinition } from "@/chat/capabilities/catalog";
2
2
  import type { CredentialBroker } from "@/chat/credentials/broker";
3
3
  import { type InstalledPluginPackageContent } from "./package-discovery";
4
- import type { PluginBrokerDeps, PluginCatalogConfig, PluginDefinition, OAuthProviderConfig, PluginRuntimeDependency, PluginRuntimePostinstallCommand } from "./types";
5
- /** Set install-wide plugin configuration and return the previous value for rollback. */
6
- export declare function setPluginCatalogConfig(config: PluginCatalogConfig | undefined): PluginCatalogConfig | undefined;
7
- /** Return installed plugin package content from the active plugin configuration. */
8
- export declare function getPluginPackageContent(): InstalledPluginPackageContent;
9
- /** Return the current plugin catalog signature used for cache invalidation. */
10
- export declare function getPluginCatalogSignature(): string;
11
- export declare function getPluginCapabilityProviders(): CapabilityProviderDefinition[];
12
- export declare function getPluginProviders(): PluginDefinition[];
13
- export declare function getPluginMigrationRoots(): {
14
- dir: string;
15
- pluginName: string;
16
- }[];
17
- export declare function getPluginMcpProviders(): PluginDefinition[];
18
- export declare function getPluginRuntimeDependencies(): PluginRuntimeDependency[];
19
- export declare function getPluginRuntimePostinstall(): PluginRuntimePostinstallCommand[];
20
- export declare function getPluginOAuthConfig(provider: string): OAuthProviderConfig | undefined;
21
- export declare function getPluginSkillRoots(): string[];
22
- export declare function getPluginForSkillPath(skillPath: string): PluginDefinition | undefined;
23
- export declare function getPluginDefinition(provider: string): PluginDefinition | undefined;
24
- /** Return the human-facing provider label from the plugin manifest. */
25
- export declare function getPluginDisplayName(provider: string): string | undefined;
26
- export declare function isPluginProvider(provider: string): boolean;
27
- export declare function isPluginCapability(capability: string): boolean;
28
- export declare function isPluginConfigKey(key: string): boolean;
29
- export declare function createPluginBroker(provider: string, deps: PluginBrokerDeps): CredentialBroker;
4
+ import type { InlinePluginManifestDefinition, PluginBrokerDeps, PluginCatalogConfig, PluginDefinition, OAuthProviderConfig, PluginRuntimeDependency, PluginRuntimePostinstallCommand } from "./types";
5
+ export interface PluginCatalogRuntime {
6
+ createBroker(provider: string, deps: PluginBrokerDeps): CredentialBroker;
7
+ getCapabilityProviders(): CapabilityProviderDefinition[];
8
+ getDefinition(provider: string): PluginDefinition | undefined;
9
+ getDisplayName(provider: string): string | undefined;
10
+ getForSkillPath(skillPath: string): PluginDefinition | undefined;
11
+ getMcpProviders(): PluginDefinition[];
12
+ getMigrationRoots(): {
13
+ dir: string;
14
+ pluginName: string;
15
+ }[];
16
+ getOAuthConfig(provider: string): OAuthProviderConfig | undefined;
17
+ getPackageContent(): InstalledPluginPackageContent;
18
+ getProviders(): PluginDefinition[];
19
+ getRuntimeDependencies(): PluginRuntimeDependency[];
20
+ getRuntimePostinstall(): PluginRuntimePostinstallCommand[];
21
+ getSignature(): string;
22
+ getSkillRoots(): string[];
23
+ isCapability(capability: string): boolean;
24
+ isConfigKey(key: string): boolean;
25
+ isProvider(provider: string): boolean;
26
+ parseConfiguredInlineManifest(manifest: InlinePluginManifestDefinition["manifest"], dir: string): PluginDefinition["manifest"];
27
+ setConfig(config: PluginCatalogConfig | undefined): PluginCatalogConfig | undefined;
28
+ }
29
+ /** Create an isolated plugin catalog runtime for explicit app wiring. */
30
+ export declare function createPluginCatalogRuntime(): PluginCatalogRuntime;
@@ -0,0 +1,14 @@
1
+ import type * as Sentry from "@/chat/sentry";
2
+ type SentryErrorEvent = Parameters<NonNullable<Sentry.NodeOptions["beforeSend"]>>[0];
3
+ type SentryTransactionEvent = Parameters<NonNullable<Sentry.NodeOptions["beforeSendTransaction"]>>[0];
4
+ type SentrySpan = Parameters<Parameters<typeof Sentry.withStreamedSpan>[0]>[0];
5
+ type SentryLog = Parameters<NonNullable<Sentry.NodeOptions["beforeSendLog"]>>[0];
6
+ /** Remove raw private conversation payloads from Sentry error events. */
7
+ export declare function scrubPrivateSentryEvent(event: SentryErrorEvent): SentryErrorEvent | null;
8
+ /** Remove raw private conversation payloads from Sentry transaction events. */
9
+ export declare function scrubPrivateSentryTransaction(event: SentryTransactionEvent): SentryTransactionEvent | null;
10
+ /** Remove raw private conversation payloads from streamed Sentry spans. */
11
+ export declare function scrubPrivateSentrySpan(span: SentrySpan): SentrySpan;
12
+ /** Remove raw private conversation payloads from Sentry structured logs. */
13
+ export declare function scrubPrivateSentryLog(log: SentryLog): SentryLog | null;
14
+ export {};
@@ -1,3 +1,3 @@
1
1
  /** Sentry SDK re-export. Isolates the concrete package to a single file. */
2
- export { captureException, continueTrace, flush, getClient, getGlobalScope, init, setTag, setUser, startInactiveSpan, startSpan, vercelAIIntegration, withActiveSpan, withScope, } from "@sentry/node";
2
+ export { captureException, continueTrace, flush, getClient, getGlobalScope, init, setTag, setUser, startInactiveSpan, startSpan, vercelAIIntegration, withActiveSpan, withScope, withStreamedSpan, } from "@sentry/node";
3
3
  export * from "@sentry/node";
@@ -2,6 +2,11 @@ import { z } from "zod";
2
2
  import type { PiMessage } from "@/chat/pi/messages";
3
3
  import { type StoredSlackRequester } from "@/chat/requester";
4
4
  declare const authorizationKindSchema: z.ZodUnion<readonly [z.ZodLiteral<"plugin">, z.ZodLiteral<"mcp">]>;
5
+ declare const transcriptRefSchema: z.ZodObject<{
6
+ type: z.ZodLiteral<"advisor_session">;
7
+ parentConversationId: z.ZodString;
8
+ key: z.ZodString;
9
+ }, z.core.$strip>;
5
10
  declare const sessionLogEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
6
11
  schemaVersion: z.ZodLiteral<1>;
7
12
  type: z.ZodLiteral<"pi_message">;
@@ -74,10 +79,50 @@ declare const sessionLogEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
74
79
  provider: z.ZodString;
75
80
  requesterId: z.ZodString;
76
81
  authorizationId: z.ZodString;
82
+ }, z.core.$strip>, z.ZodObject<{
83
+ schemaVersion: z.ZodLiteral<1>;
84
+ type: z.ZodLiteral<"tool_execution_started">;
85
+ sessionId: z.ZodDefault<z.ZodString>;
86
+ createdAtMs: z.ZodNumber;
87
+ toolCallId: z.ZodString;
88
+ toolName: z.ZodString;
89
+ args: z.ZodOptional<z.ZodUnknown>;
90
+ }, z.core.$strip>, z.ZodObject<{
91
+ schemaVersion: z.ZodLiteral<1>;
92
+ type: z.ZodLiteral<"subagent_started">;
93
+ sessionId: z.ZodDefault<z.ZodString>;
94
+ subagentInvocationId: z.ZodString;
95
+ subagentKind: z.ZodString;
96
+ parentToolCallId: z.ZodOptional<z.ZodString>;
97
+ parentConversationId: z.ZodString;
98
+ parentSessionId: z.ZodOptional<z.ZodString>;
99
+ transcriptRef: z.ZodObject<{
100
+ type: z.ZodLiteral<"advisor_session">;
101
+ parentConversationId: z.ZodString;
102
+ key: z.ZodString;
103
+ }, z.core.$strip>;
104
+ historyMode: z.ZodLiteral<"shared">;
105
+ createdAtMs: z.ZodNumber;
106
+ }, z.core.$strip>, z.ZodObject<{
107
+ schemaVersion: z.ZodLiteral<1>;
108
+ type: z.ZodLiteral<"subagent_ended">;
109
+ sessionId: z.ZodDefault<z.ZodString>;
110
+ subagentInvocationId: z.ZodString;
111
+ outcome: z.ZodUnion<readonly [z.ZodLiteral<"success">, z.ZodLiteral<"error">, z.ZodLiteral<"aborted">]>;
112
+ errorCode: z.ZodOptional<z.ZodString>;
113
+ createdAtMs: z.ZodNumber;
77
114
  }, z.core.$strip>], "type">;
78
115
  /** Requester identity stored with turn-start messages for durable continuation. */
79
116
  export type SessionLogEntry = z.infer<typeof sessionLogEntrySchema>;
80
117
  export type AuthorizationKind = z.infer<typeof authorizationKindSchema>;
118
+ export type TranscriptRef = z.infer<typeof transcriptRefSchema>;
119
+ export type SessionActivityEntry = Extract<SessionLogEntry, {
120
+ type: "tool_execution_started";
121
+ }> | Extract<SessionLogEntry, {
122
+ type: "subagent_started";
123
+ }> | Extract<SessionLogEntry, {
124
+ type: "subagent_ended";
125
+ }>;
81
126
  interface Scope {
82
127
  conversationId: string;
83
128
  }
@@ -94,6 +139,11 @@ export interface SessionProjection {
94
139
  messages: PiMessage[];
95
140
  requester?: StoredSlackRequester;
96
141
  }
142
+ /** Load chronological host-only runtime activity entries for reporting. */
143
+ export declare function loadActivityEntries(args: Scope & {
144
+ store?: SessionLogStore;
145
+ sessionId?: string;
146
+ }): Promise<SessionActivityEntry[]>;
97
147
  /** Load the committed Pi-message projection for a conversation. */
98
148
  export declare function loadMessages(args: Scope & {
99
149
  store?: SessionLogStore;
@@ -142,6 +192,40 @@ export declare function recordAuthorizationCompleted(args: Scope & {
142
192
  authorizationId: string;
143
193
  ttlMs: number;
144
194
  }): Promise<void>;
195
+ /** Record a host-observed parent tool start without adding it to Pi replay. */
196
+ export declare function recordToolExecutionStarted(args: Scope & {
197
+ args?: unknown;
198
+ createdAtMs?: number;
199
+ sessionId?: string;
200
+ store?: SessionLogStore;
201
+ toolCallId: string;
202
+ toolName: string;
203
+ ttlMs: number;
204
+ }): Promise<void>;
205
+ /** Record that a child agent execution became visible from this parent run. */
206
+ export declare function recordSubagentStarted(args: Scope & {
207
+ createdAtMs?: number;
208
+ historyMode: "shared";
209
+ parentConversationId: string;
210
+ parentSessionId?: string;
211
+ parentToolCallId?: string;
212
+ sessionId?: string;
213
+ store?: SessionLogStore;
214
+ subagentInvocationId: string;
215
+ subagentKind: string;
216
+ transcriptRef: TranscriptRef;
217
+ ttlMs: number;
218
+ }): Promise<void>;
219
+ /** Record the terminal state for a previously-started child agent execution. */
220
+ export declare function recordSubagentEnded(args: Scope & {
221
+ createdAtMs?: number;
222
+ errorCode?: string;
223
+ outcome: "success" | "error" | "aborted";
224
+ sessionId?: string;
225
+ store?: SessionLogStore;
226
+ subagentInvocationId: string;
227
+ ttlMs: number;
228
+ }): Promise<void>;
145
229
  /**
146
230
  * Append conversation-log entries and advance the current Pi projection.
147
231
  *
@@ -23,6 +23,7 @@ export interface AdvisorToolRuntimeContext {
23
23
  conversationPrivacy?: ConversationPrivacy;
24
24
  getTools: () => AgentTool[];
25
25
  logContext?: LogContext;
26
+ parentSessionId?: string;
26
27
  store?: AdvisorSessionStore;
27
28
  streamFn?: StreamFn;
28
29
  }
@@ -3,6 +3,12 @@ import type { Static, TSchema } from "@sinclair/typebox";
3
3
  import type { ToolExecutionMode } from "@earendil-works/pi-agent-core";
4
4
  import type { ConversationPrivacy } from "@/chat/conversation-privacy";
5
5
  export interface ToolDefinition<TInputSchema extends TSchema = TSchema> {
6
+ /** Stable internal owner-qualified identity for plugin-contributed tools. */
7
+ identity?: {
8
+ id: string;
9
+ name: string;
10
+ plugin: string;
11
+ };
6
12
  description: string;
7
13
  inputSchema: TInputSchema;
8
14
  annotations?: ToolAnnotations;
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  JUNIOR_THREAD_STATE_TTL_MS
3
- } from "./chunk-Z4CIQ3EB.js";
3
+ } from "./chunk-66NX7MNW.js";
4
4
  import {
5
5
  getDefaultRedisStateAdapterFor,
6
6
  getStateAdapter
7
- } from "./chunk-LXTPBU4K.js";
7
+ } from "./chunk-X2FL5ZH5.js";
8
8
  import {
9
9
  parseDestination,
10
10
  sameDestination
11
- } from "./chunk-Q6XFTRV5.js";
11
+ } from "./chunk-4XHCVBXH.js";
12
12
  import {
13
13
  getChatConfig
14
- } from "./chunk-T77LUIX3.js";
14
+ } from "./chunk-ABRNFE3N.js";
15
15
  import {
16
16
  parseStoredSlackRequester
17
- } from "./chunk-VALUBQ7R.js";
17
+ } from "./chunk-ZPCGQRFJ.js";
18
18
  import {
19
19
  isRecord,
20
20
  toOptionalNumber,
21
21
  toOptionalString
22
- } from "./chunk-EJN6G5A2.js";
22
+ } from "./chunk-FTMXFBDC.js";
23
23
 
24
24
  // src/chat/task-execution/state.ts
25
25
  import { randomUUID } from "crypto";
@@ -17,7 +17,8 @@ __export(sentry_exports, {
17
17
  startSpan: () => startSpan,
18
18
  vercelAIIntegration: () => vercelAIIntegration,
19
19
  withActiveSpan: () => withActiveSpan,
20
- withScope: () => withScope
20
+ withScope: () => withScope,
21
+ withStreamedSpan: () => withStreamedSpan
21
22
  });
22
23
  import {
23
24
  captureException,
@@ -32,7 +33,8 @@ import {
32
33
  startSpan,
33
34
  vercelAIIntegration,
34
35
  withActiveSpan,
35
- withScope
36
+ withScope,
37
+ withStreamedSpan
36
38
  } from "@sentry/node";
37
39
  export * from "@sentry/node";
38
40
 
@@ -50,5 +52,6 @@ export {
50
52
  startSpan,
51
53
  vercelAIIntegration,
52
54
  withActiveSpan,
53
- withScope
55
+ withScope,
56
+ withStreamedSpan
54
57
  };
@@ -3,17 +3,16 @@ import {
3
3
  } from "./chunk-G3E7SCME.js";
4
4
  import {
5
5
  getStateAdapter
6
- } from "./chunk-LXTPBU4K.js";
6
+ } from "./chunk-X2FL5ZH5.js";
7
7
  import {
8
8
  toOptionalTrimmed
9
- } from "./chunk-T77LUIX3.js";
9
+ } from "./chunk-ABRNFE3N.js";
10
10
  import {
11
- getPluginRuntimeDependencies,
12
- getPluginRuntimePostinstall
13
- } from "./chunk-YLVJRYTD.js";
11
+ pluginCatalogRuntime
12
+ } from "./chunk-TW23AT22.js";
14
13
  import {
15
14
  withSpan
16
- } from "./chunk-EJN6G5A2.js";
15
+ } from "./chunk-KF7522P3.js";
17
16
 
18
17
  // src/chat/sandbox/runtime-dependency-snapshots.ts
19
18
  import { createHash } from "crypto";
@@ -172,8 +171,8 @@ function parseFloatingDepMaxAgeMs() {
172
171
  return parsed;
173
172
  }
174
173
  function buildDependencyProfile(runtime) {
175
- const dependencies = getPluginRuntimeDependencies();
176
- const postinstall = getPluginRuntimePostinstall();
174
+ const dependencies = pluginCatalogRuntime.getRuntimeDependencies();
175
+ const postinstall = pluginCatalogRuntime.getRuntimePostinstall();
177
176
  if (dependencies.length === 0 && postinstall.length === 0) {
178
177
  return null;
179
178
  }
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  getSlackBotToken
3
- } from "./chunk-T77LUIX3.js";
3
+ } from "./chunk-ABRNFE3N.js";
4
4
  import {
5
5
  isSlackConversationId,
6
6
  isSlackTeamId,
7
7
  logWarn
8
- } from "./chunk-EJN6G5A2.js";
8
+ } from "./chunk-KF7522P3.js";
9
9
 
10
10
  // src/chat/slack/client.ts
11
11
  import { WebClient } from "@slack/web-api";
@@ -2,7 +2,7 @@ import {
2
2
  isRecord,
3
3
  toOptionalNumber,
4
4
  toOptionalString
5
- } from "./chunk-EJN6G5A2.js";
5
+ } from "./chunk-FTMXFBDC.js";
6
6
 
7
7
  // src/chat/state/conversation.ts
8
8
  function coerceRole(value) {