@sentry/junior 0.119.0 → 0.120.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 (47) hide show
  1. package/dist/{agent-hooks-NZSV4QQR.js → agent-hooks-5DDPWRYO.js} +7 -7
  2. package/dist/api.js +58 -79
  3. package/dist/app.js +21 -21
  4. package/dist/build/copy-build-content.d.ts +2 -2
  5. package/dist/{catalog-runtime-TAOYIZIZ.js → catalog-runtime-5KR5XBMJ.js} +7 -7
  6. package/dist/chat/discovery.d.ts +2 -0
  7. package/dist/chat/mcp/tool-manager.d.ts +14 -1
  8. package/dist/chat/plugins/types.d.ts +3 -9
  9. package/dist/chat/plugins/user-pages.d.ts +2 -1
  10. package/dist/{chunk-BLQZACHV.js → chunk-24B5R6OU.js} +92 -6
  11. package/dist/{chunk-JXRAOOXQ.js → chunk-6WX5SPI3.js} +1 -1
  12. package/dist/{chunk-VJTWKJWQ.js → chunk-ALAKN7LR.js} +1 -1
  13. package/dist/{chunk-ZJ6IVZVO.js → chunk-ALYQOZG7.js} +1 -1
  14. package/dist/{chunk-ZFX4M743.js → chunk-BHXW734F.js} +6 -6
  15. package/dist/{chunk-GKFDU3ZI.js → chunk-DJDGDJDF.js} +4 -4
  16. package/dist/{chunk-JLJLZS2N.js → chunk-DMKHRBI6.js} +4 -3
  17. package/dist/{chunk-NUENIPQL.js → chunk-DWOH57FW.js} +1 -1
  18. package/dist/{chunk-QZ7XRJDB.js → chunk-EIVE6GL4.js} +3 -3
  19. package/dist/{chunk-TGIQN7QW.js → chunk-ERYVNWNE.js} +93 -18
  20. package/dist/{chunk-JSTGI7TX.js → chunk-GNNV3UTY.js} +1 -1
  21. package/dist/chunk-H4HBKISO.js +417 -0
  22. package/dist/{chunk-BNJEPYTC.js → chunk-JQWP6V22.js} +4 -4
  23. package/dist/{chunk-D3N4BPSL.js → chunk-M243JMZH.js} +2 -2
  24. package/dist/{chunk-B3IT5END.js → chunk-OOUNJNMR.js} +16 -152
  25. package/dist/{chunk-6ZR455DC.js → chunk-Q3RL6A4E.js} +1 -1
  26. package/dist/{chunk-YLYJIQRX.js → chunk-QOQPPRFS.js} +12 -12
  27. package/dist/{chunk-4UIUDOOV.js → chunk-TKUCRFNX.js} +7 -7
  28. package/dist/{chunk-VLTWQQKH.js → chunk-VURFJVFH.js} +1 -1
  29. package/dist/{chunk-R53UT2OI.js → chunk-XAI2HNAY.js} +9 -5
  30. package/dist/{chunk-TAGV4Z3J.js → chunk-YEAOUT5W.js} +1 -1
  31. package/dist/cli/chat.js +23 -23
  32. package/dist/cli/check.js +8 -8
  33. package/dist/cli/plugins.js +12 -12
  34. package/dist/cli/snapshot-create.js +10 -10
  35. package/dist/cli/upgrade.js +7 -7
  36. package/dist/{db-FWGP5CKY.js → db-T4ZY64PB.js} +5 -5
  37. package/dist/{discovery-RMHYSRL7.js → discovery-GUFTFBTL.js} +3 -1
  38. package/dist/instrumentation.js +2 -2
  39. package/dist/nitro.js +24 -7
  40. package/dist/{oauth-callback-server-PM3QNXJQ.js → oauth-callback-server-LQ6DFI26.js} +16 -16
  41. package/dist/{runner-DV55N6ZB.js → runner-D3ZU6TJH.js} +9 -9
  42. package/dist/{skills-MANV5ZK6.js → skills-JMXY7LIY.js} +8 -8
  43. package/dist/{validation-QGB4INTI.js → validation-OEPJS7JX.js} +8 -8
  44. package/dist/version.js +1 -1
  45. package/package.json +8 -7
  46. package/skills/jr-rpc/SKILL.md +40 -0
  47. package/dist/chunk-3V7OFJZC.js +0 -264
@@ -11,20 +11,20 @@ import {
11
11
  getPlugins,
12
12
  setPlugins,
13
13
  validatePlugins
14
- } from "./chunk-BLQZACHV.js";
15
- import "./chunk-D3N4BPSL.js";
14
+ } from "./chunk-24B5R6OU.js";
15
+ import "./chunk-M243JMZH.js";
16
16
  import "./chunk-GCGJGSQL.js";
17
- import "./chunk-VJTWKJWQ.js";
18
- import "./chunk-VLTWQQKH.js";
17
+ import "./chunk-ALAKN7LR.js";
18
+ import "./chunk-VURFJVFH.js";
19
19
  import "./chunk-VFUK3X5B.js";
20
20
  import "./chunk-HDFGNU5E.js";
21
21
  import "./chunk-HZF5P5UN.js";
22
- import "./chunk-ZJ6IVZVO.js";
22
+ import "./chunk-ALYQOZG7.js";
23
23
  import "./chunk-OB42YVAE.js";
24
24
  import "./chunk-F3B2YJ76.js";
25
25
  import "./chunk-6GWA276C.js";
26
- import "./chunk-NUENIPQL.js";
27
- import "./chunk-JLJLZS2N.js";
26
+ import "./chunk-DWOH57FW.js";
27
+ import "./chunk-DMKHRBI6.js";
28
28
  import "./chunk-MLKGABMK.js";
29
29
  export {
30
30
  PluginHookDeniedError,
package/dist/api.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  formatSlackConversationRedactedLabel,
30
30
  readHealthReport,
31
31
  resolveSlackConversationContextFromThreadId
32
- } from "./chunk-6ZR455DC.js";
32
+ } from "./chunk-Q3RL6A4E.js";
33
33
  import {
34
34
  buildSentryConversationUrl
35
35
  } from "./chunk-4CODA7P5.js";
@@ -42,7 +42,7 @@ import {
42
42
  } from "./chunk-PE44LDDQ.js";
43
43
  import {
44
44
  readStats
45
- } from "./chunk-JXRAOOXQ.js";
45
+ } from "./chunk-6WX5SPI3.js";
46
46
  import {
47
47
  agentTurnUsageSchema,
48
48
  hasAgentTurnUsage
@@ -51,13 +51,14 @@ import "./chunk-PDO5BLNM.js";
51
51
  import {
52
52
  createPluginLogger,
53
53
  getPlugins,
54
- listConversationAnnotations
55
- } from "./chunk-BLQZACHV.js";
54
+ listConversationAnnotations,
55
+ readViewerActors
56
+ } from "./chunk-24B5R6OU.js";
56
57
  import {
57
58
  decodeStoredConversationEvent,
58
59
  getDb,
59
60
  getSqlExecutor
60
- } from "./chunk-D3N4BPSL.js";
61
+ } from "./chunk-M243JMZH.js";
61
62
  import {
62
63
  juniorApiTokens,
63
64
  juniorConversationEvents,
@@ -65,8 +66,8 @@ import {
65
66
  juniorIdentities,
66
67
  juniorUsers
67
68
  } from "./chunk-GCGJGSQL.js";
68
- import "./chunk-VJTWKJWQ.js";
69
- import "./chunk-VLTWQQKH.js";
69
+ import "./chunk-ALAKN7LR.js";
70
+ import "./chunk-VURFJVFH.js";
70
71
  import {
71
72
  juniorDestinations
72
73
  } from "./chunk-VFUK3X5B.js";
@@ -75,14 +76,12 @@ import {
75
76
  parseSlackThreadId
76
77
  } from "./chunk-HDFGNU5E.js";
77
78
  import "./chunk-HZF5P5UN.js";
78
- import {
79
- normalizeIdentityEmail
80
- } from "./chunk-ZJ6IVZVO.js";
79
+ import "./chunk-ALYQOZG7.js";
81
80
  import "./chunk-OB42YVAE.js";
82
81
  import "./chunk-F3B2YJ76.js";
83
82
  import "./chunk-6GWA276C.js";
84
- import "./chunk-NUENIPQL.js";
85
- import "./chunk-JLJLZS2N.js";
83
+ import "./chunk-DWOH57FW.js";
84
+ import "./chunk-DMKHRBI6.js";
86
85
  import "./chunk-MLKGABMK.js";
87
86
 
88
87
  // src/api.ts
@@ -1741,7 +1740,7 @@ function readDescriptionText(home) {
1741
1740
  }
1742
1741
  }
1743
1742
  async function readSkillReports() {
1744
- const { discoverSkills } = await import("./skills-MANV5ZK6.js");
1743
+ const { discoverSkills } = await import("./skills-JMXY7LIY.js");
1745
1744
  const skills = await discoverSkills();
1746
1745
  return skillReportsSchema.parse(
1747
1746
  skills.map((skill) => ({
@@ -1751,7 +1750,7 @@ async function readSkillReports() {
1751
1750
  );
1752
1751
  }
1753
1752
  async function readPlugins() {
1754
- const { pluginCatalogRuntime } = await import("./catalog-runtime-TAOYIZIZ.js");
1753
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-5KR5XBMJ.js");
1755
1754
  return pluginsSchema.parse(
1756
1755
  pluginCatalogRuntime.getProviders().map((plugin) => ({
1757
1756
  configKeys: plugin.manifest.configKeys ?? [],
@@ -1763,8 +1762,8 @@ async function readPlugins() {
1763
1762
  }
1764
1763
  async function readRuntimeInfoReport() {
1765
1764
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
1766
- import("./discovery-RMHYSRL7.js"),
1767
- import("./catalog-runtime-TAOYIZIZ.js"),
1765
+ import("./discovery-GUFTFBTL.js"),
1766
+ import("./catalog-runtime-5KR5XBMJ.js"),
1768
1767
  readPlugins(),
1769
1768
  readSkillReports()
1770
1769
  ]);
@@ -1780,7 +1779,7 @@ async function readRuntimeInfoReport() {
1780
1779
  }
1781
1780
  async function readPluginOperationalReportFeed() {
1782
1781
  const nowMs = Date.now();
1783
- const { getPluginOperationalReports } = await import("./agent-hooks-NZSV4QQR.js");
1782
+ const { getPluginOperationalReports } = await import("./agent-hooks-5DDPWRYO.js");
1784
1783
  return pluginOperationalReportFeedSchema.parse({
1785
1784
  source: "plugins",
1786
1785
  generatedAt: new Date(nowMs).toISOString(),
@@ -2854,6 +2853,7 @@ function createPersonalTokenRoutes() {
2854
2853
  import { Hono as Hono5 } from "hono";
2855
2854
  import {
2856
2855
  pluginUserPageContentSchema as pluginUserPageContentSchema2,
2856
+ pluginUserPageInputSchema,
2857
2857
  pluginUserPageLinksSchema as pluginUserPageLinksSchema2
2858
2858
  } from "@sentry/junior-plugin-api";
2859
2859
 
@@ -2862,57 +2862,6 @@ import {
2862
2862
  pluginUserPageContentSchema,
2863
2863
  pluginUserPageLinksSchema
2864
2864
  } from "@sentry/junior-plugin-api";
2865
-
2866
- // src/chat/plugins/viewer-actors.ts
2867
- import { and as and12, eq as eq13 } from "drizzle-orm";
2868
- import {
2869
- actorSchema
2870
- } from "@sentry/junior-plugin-api";
2871
- async function readViewerActorsFromSql(db, email) {
2872
- const normalizedEmail = normalizeIdentityEmail(email);
2873
- if (!normalizedEmail) return [];
2874
- const rows = await db.select({
2875
- displayName: juniorIdentities.displayName,
2876
- email: juniorUsers.primaryEmail,
2877
- handle: juniorIdentities.handle,
2878
- provider: juniorIdentities.provider,
2879
- providerSubjectId: juniorIdentities.providerSubjectId,
2880
- providerTenantId: juniorIdentities.providerTenantId
2881
- }).from(juniorIdentities).innerJoin(juniorUsers, eq13(juniorUsers.id, juniorIdentities.userId)).where(
2882
- and12(
2883
- eq13(juniorUsers.primaryEmailNormalized, normalizedEmail),
2884
- eq13(juniorIdentities.kind, "user")
2885
- )
2886
- );
2887
- const actors = [];
2888
- for (const row of rows) {
2889
- const candidate = row.provider === "slack" ? {
2890
- platform: "slack",
2891
- teamId: row.providerTenantId,
2892
- userId: row.providerSubjectId,
2893
- email: row.email,
2894
- ...row.displayName ? { fullName: row.displayName } : {},
2895
- ...row.handle ? { userName: row.handle } : {}
2896
- } : row.provider === "local" ? {
2897
- platform: "local",
2898
- userId: row.providerSubjectId,
2899
- email: row.email,
2900
- ...row.displayName ? { fullName: row.displayName } : {},
2901
- ...row.handle ? { userName: row.handle } : {}
2902
- } : void 0;
2903
- if (!candidate) continue;
2904
- const parsed = actorSchema.safeParse(candidate);
2905
- if (parsed.success && parsed.data.platform !== "system") {
2906
- actors.push(parsed.data);
2907
- }
2908
- }
2909
- return actors;
2910
- }
2911
- async function readViewerActors(email) {
2912
- return await readViewerActorsFromSql(getDb(), email);
2913
- }
2914
-
2915
- // src/chat/plugins/user-pages.ts
2916
2865
  function readPluginUserPageLinks() {
2917
2866
  return pluginUserPageLinksSchema.parse(
2918
2867
  getPlugins().flatMap(
@@ -2926,6 +2875,10 @@ function readPluginUserPageLinks() {
2926
2875
  )
2927
2876
  );
2928
2877
  }
2878
+ function actionBelongsToPlugin(href, pluginName) {
2879
+ const parsed = new URL(href, "http://junior.local");
2880
+ return parsed.origin === "http://junior.local" && parsed.pathname === href && parsed.pathname.startsWith(`/api/plugins/${pluginName}/`) && !parsed.search && !parsed.hash;
2881
+ }
2929
2882
  async function readPluginUserPage(input) {
2930
2883
  const plugin = getPlugins().find(
2931
2884
  (candidate) => candidate.manifest.name === input.pluginName
@@ -2934,17 +2887,30 @@ async function readPluginUserPage(input) {
2934
2887
  (candidate) => candidate.id === input.pageId
2935
2888
  );
2936
2889
  if (!plugin || !page) return void 0;
2937
- return pluginUserPageContentSchema.parse(
2938
- await page.read({
2939
- db: getDb(),
2940
- log: createPluginLogger(plugin.manifest.name),
2941
- plugin: { name: plugin.manifest.name },
2942
- viewer: {
2943
- actors: await readViewerActors(input.email),
2944
- email: input.email
2945
- }
2946
- })
2890
+ const content = pluginUserPageContentSchema.parse(
2891
+ await page.read(
2892
+ {
2893
+ db: getDb(),
2894
+ log: createPluginLogger(plugin.manifest.name),
2895
+ plugin: { name: plugin.manifest.name },
2896
+ viewer: {
2897
+ actors: await readViewerActors(input.email),
2898
+ email: input.email
2899
+ }
2900
+ },
2901
+ input.query
2902
+ )
2947
2903
  );
2904
+ if (content.records.some(
2905
+ (record) => record.actions?.some(
2906
+ (action) => !actionBelongsToPlugin(action.href, plugin.manifest.name)
2907
+ )
2908
+ )) {
2909
+ throw new Error(
2910
+ `Plugin user page "${plugin.manifest.name}/${page.id}" returned an action outside its API namespace.`
2911
+ );
2912
+ }
2913
+ return content;
2948
2914
  }
2949
2915
 
2950
2916
  // src/api/user-pages/routes.ts
@@ -2963,10 +2929,23 @@ function createUserPageRoutes() {
2963
2929
  { status: 401 }
2964
2930
  );
2965
2931
  }
2932
+ const pageInput = pluginUserPageInputSchema.safeParse({
2933
+ cursor: context.req.query("cursor") || void 0,
2934
+ limit: context.req.query("limit") ? Number(context.req.query("limit")) : 20,
2935
+ query: context.req.query("q") || void 0
2936
+ });
2937
+ if (!pageInput.success) {
2938
+ return jsonResponse(
2939
+ apiErrorSchema,
2940
+ { error: "Invalid user page query." },
2941
+ { status: 400 }
2942
+ );
2943
+ }
2966
2944
  const page = await readPluginUserPage({
2967
2945
  email,
2968
2946
  pageId: context.req.param("pageId"),
2969
- pluginName: context.req.param("pluginName")
2947
+ pluginName: context.req.param("pluginName"),
2948
+ query: pageInput.data
2970
2949
  });
2971
2950
  return page ? jsonResponse(pluginUserPageContentSchema2, page) : jsonResponse(
2972
2951
  apiErrorSchema,
package/dist/app.js CHANGED
@@ -50,7 +50,7 @@ import {
50
50
  startConversationWork,
51
51
  startSlackProcessingReaction,
52
52
  stripLeadingBotMention
53
- } from "./chunk-YLYJIQRX.js";
53
+ } from "./chunk-QOQPPRFS.js";
54
54
  import "./chunk-FA6POGLH.js";
55
55
  import {
56
56
  ConversationTurnLifecycleService,
@@ -65,13 +65,13 @@ import {
65
65
  processPluginTask,
66
66
  requireTurnFailureEventId,
67
67
  scheduleSessionCompletedPluginTasks
68
- } from "./chunk-ZFX4M743.js";
68
+ } from "./chunk-BHXW734F.js";
69
69
  import {
70
70
  GET,
71
71
  conversationVisibilityFromSlackChannelType,
72
72
  resolveSlackChannelTypeFromMessage,
73
73
  resolveSlackConversationContext
74
- } from "./chunk-6ZR455DC.js";
74
+ } from "./chunk-Q3RL6A4E.js";
75
75
  import "./chunk-4CODA7P5.js";
76
76
  import "./chunk-PE44LDDQ.js";
77
77
  import {
@@ -90,7 +90,7 @@ import {
90
90
  import {
91
91
  validatePluginEgressCredentialHooks,
92
92
  validatePluginRegistrations
93
- } from "./chunk-TAGV4Z3J.js";
93
+ } from "./chunk-YEAOUT5W.js";
94
94
  import {
95
95
  defineJuniorPlugins,
96
96
  pluginCatalogConfigFromEnv,
@@ -123,7 +123,7 @@ import {
123
123
  setConfigDefaults,
124
124
  shouldEmitDevAgentTrace,
125
125
  shouldPropagateSandboxEgressTrace
126
- } from "./chunk-TGIQN7QW.js";
126
+ } from "./chunk-ERYVNWNE.js";
127
127
  import "./chunk-DIB4GX3G.js";
128
128
  import {
129
129
  RetryableDeliveryError,
@@ -134,7 +134,7 @@ import {
134
134
  formatProviderLabel,
135
135
  postSlackMessage,
136
136
  startOAuthFlow
137
- } from "./chunk-4UIUDOOV.js";
137
+ } from "./chunk-TKUCRFNX.js";
138
138
  import {
139
139
  ConversationTurnBoundaryError,
140
140
  CooperativeTurnYieldError,
@@ -188,10 +188,10 @@ import {
188
188
  trimTrailingAssistantMessages,
189
189
  updateConversationStats,
190
190
  upsertConversationMessage
191
- } from "./chunk-BNJEPYTC.js";
191
+ } from "./chunk-JQWP6V22.js";
192
192
  import "./chunk-HDSDCEPK.js";
193
- import "./chunk-GKFDU3ZI.js";
194
- import "./chunk-JXRAOOXQ.js";
193
+ import "./chunk-DJDGDJDF.js";
194
+ import "./chunk-6WX5SPI3.js";
195
195
  import "./chunk-MU6HHZEN.js";
196
196
  import "./chunk-PDO5BLNM.js";
197
197
  import "./chunk-UIE3R5XU.js";
@@ -216,7 +216,7 @@ import {
216
216
  validatePlugins,
217
217
  verifyScheduledTaskCredentialSubject,
218
218
  verifySlackDirectCredentialSubject
219
- } from "./chunk-BLQZACHV.js";
219
+ } from "./chunk-24B5R6OU.js";
220
220
  import {
221
221
  contextProvenance,
222
222
  createSlackDestination,
@@ -227,7 +227,7 @@ import {
227
227
  instructionProvenanceFor,
228
228
  requireSlackDestination,
229
229
  withConversationEventLock
230
- } from "./chunk-D3N4BPSL.js";
230
+ } from "./chunk-M243JMZH.js";
231
231
  import {
232
232
  juniorConversationEvents,
233
233
  juniorConversations
@@ -236,7 +236,7 @@ import {
236
236
  acquireActiveLock,
237
237
  getStateAdapter,
238
238
  sleep
239
- } from "./chunk-VJTWKJWQ.js";
239
+ } from "./chunk-ALAKN7LR.js";
240
240
  import {
241
241
  STANDARD_MODEL_PROFILE,
242
242
  botConfig,
@@ -254,18 +254,18 @@ import {
254
254
  modelIdForProfile,
255
255
  setSlackReactionConfig,
256
256
  standardModelId
257
- } from "./chunk-VLTWQQKH.js";
257
+ } from "./chunk-VURFJVFH.js";
258
258
  import {
259
259
  juniorDestinations
260
260
  } from "./chunk-VFUK3X5B.js";
261
261
  import {
262
262
  parseSlackThreadId
263
263
  } from "./chunk-HDFGNU5E.js";
264
- import "./chunk-QZ7XRJDB.js";
264
+ import "./chunk-EIVE6GL4.js";
265
265
  import {
266
266
  pluginCatalogRuntime
267
- } from "./chunk-JSTGI7TX.js";
268
- import "./chunk-R53UT2OI.js";
267
+ } from "./chunk-GNNV3UTY.js";
268
+ import "./chunk-XAI2HNAY.js";
269
269
  import {
270
270
  credentialSubjectSchema
271
271
  } from "./chunk-W3U3YQYI.js";
@@ -291,7 +291,7 @@ import {
291
291
  setTags,
292
292
  withContext,
293
293
  withSpan
294
- } from "./chunk-ZJ6IVZVO.js";
294
+ } from "./chunk-ALYQOZG7.js";
295
295
  import {
296
296
  toOptionalString
297
297
  } from "./chunk-OB42YVAE.js";
@@ -302,14 +302,14 @@ import {
302
302
  import {
303
303
  continueTrace
304
304
  } from "./chunk-6GWA276C.js";
305
- import "./chunk-B3IT5END.js";
306
- import "./chunk-3V7OFJZC.js";
305
+ import "./chunk-OOUNJNMR.js";
306
+ import "./chunk-H4HBKISO.js";
307
307
  import {
308
308
  JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
309
- } from "./chunk-NUENIPQL.js";
309
+ } from "./chunk-DWOH57FW.js";
310
310
  import {
311
311
  JUNIOR_VERSION
312
- } from "./chunk-JLJLZS2N.js";
312
+ } from "./chunk-DMKHRBI6.js";
313
313
  import "./chunk-MLKGABMK.js";
314
314
 
315
315
  // src/app.ts
@@ -1,5 +1,5 @@
1
- /** Copy app and declared plugin package content into the server output. */
2
- export declare function copyAppAndPluginContent(cwd: string, serverRoot: string, packageNames?: unknown): void;
1
+ /** Copy app, built-in skill, and declared plugin content into server output. */
2
+ export declare function copyRuntimeContent(cwd: string, serverRoot: string, packageNames?: unknown): void;
3
3
  /** Copy dashboard browser assets when core dashboard routes are enabled. */
4
4
  export declare function copyDashboardAssets(cwd: string, serverRoot: string): void;
5
5
  /** Copy extra file patterns into server output for files the bundler cannot trace. */
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-JSTGI7TX.js";
4
- import "./chunk-R53UT2OI.js";
3
+ } from "./chunk-GNNV3UTY.js";
4
+ import "./chunk-XAI2HNAY.js";
5
5
  import "./chunk-W3U3YQYI.js";
6
6
  import "./chunk-HZF5P5UN.js";
7
- import "./chunk-ZJ6IVZVO.js";
7
+ import "./chunk-ALYQOZG7.js";
8
8
  import "./chunk-OB42YVAE.js";
9
9
  import "./chunk-F3B2YJ76.js";
10
10
  import "./chunk-6GWA276C.js";
11
- import "./chunk-B3IT5END.js";
12
- import "./chunk-3V7OFJZC.js";
13
- import "./chunk-NUENIPQL.js";
14
- import "./chunk-JLJLZS2N.js";
11
+ import "./chunk-OOUNJNMR.js";
12
+ import "./chunk-H4HBKISO.js";
13
+ import "./chunk-DWOH57FW.js";
14
+ import "./chunk-DMKHRBI6.js";
15
15
  import "./chunk-MLKGABMK.js";
16
16
  export {
17
17
  pluginCatalogRuntime
@@ -19,6 +19,8 @@ export interface ResolveHomeDirOptions {
19
19
  }
20
20
  /** Resolve the app home directory by scoring candidate `app/` directories. */
21
21
  export declare function resolveHomeDir(cwd?: string, options?: ResolveHomeDirOptions): string;
22
+ /** Return the built-in skills directory in source and packaged builds. */
23
+ export declare function builtInSkillsDir(): string;
22
24
  /** Return the data directory (same as homeDir). */
23
25
  export declare function dataDir(): string;
24
26
  /** Return the path to the SOUL.md file. */
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import type { ImageContent, TextContent } from "@earendil-works/pi-ai";
10
10
  import type { OAuthClientProvider } from "@modelcontextprotocol/sdk/client/auth.js";
11
- import type { ToolAnnotations } from "@sentry/junior-plugin-api";
11
+ import type { PluginMcpToolResult, ToolAnnotations } from "@sentry/junior-plugin-api";
12
12
  import type { ConversationPrivacy } from "@/chat/conversation-privacy";
13
13
  import type { SkillMetadata } from "@/chat/skills";
14
14
  import type { PluginDefinition } from "@/chat/plugins/types";
@@ -19,7 +19,15 @@ export interface McpToolManagerOptions {
19
19
  onAuthorizationRequired?: (provider: string, error: McpAuthorizationRequiredError) => Promise<boolean | void> | boolean | void;
20
20
  }
21
21
  export interface ManagedMcpToolResult {
22
+ /**
23
+ * Internal bridge for direct model calls, which need placeholder content
24
+ * while the wrapper boundary receives a content-free discriminated result.
25
+ */
26
+ authorizationPending?: boolean;
22
27
  content: Array<TextContent | ImageContent>;
28
+ /** Original provider content before model-visible result normalization. */
29
+ providerContent?: Array<TextContent | ImageContent>;
30
+ structuredContent?: unknown;
23
31
  }
24
32
  export interface ManagedMcpToolDescriptor {
25
33
  name: string;
@@ -62,6 +70,7 @@ export declare class McpToolManager {
62
70
  provider?: string;
63
71
  }): ManagedMcpToolDescriptor[];
64
72
  private filterListedTools;
73
+ private assertWrappedToolsAvailable;
65
74
  private getClient;
66
75
  private createClient;
67
76
  private toManagedTool;
@@ -70,6 +79,10 @@ export declare class McpToolManager {
70
79
  getResolvedActiveTools(options?: {
71
80
  provider?: string;
72
81
  }): ManagedMcpTool[];
82
+ /** Call one active provider tool declared for plugin-owned wrapping. */
83
+ callWrappedTool(provider: string, rawName: string, args: Record<string, unknown>, options?: {
84
+ toolCallId?: string;
85
+ }): Promise<PluginMcpToolResult>;
73
86
  private toToolDescriptor;
74
87
  }
75
88
  export {};
@@ -1,6 +1,6 @@
1
- import type { PluginRuntimeDependency, PluginRuntimePostinstallCommand } from "@sentry/junior-plugin-api";
1
+ import type { PluginMcpConfig, PluginRuntimeDependency, PluginRuntimePostinstallCommand } from "@sentry/junior-plugin-api";
2
2
  import type { UserTokenStore } from "@/chat/credentials/user-token-store";
3
- export type { PluginNpmRuntimeDependency, PluginRuntimeDependency, PluginRuntimePostinstallCommand, PluginSystemRuntimeDependency, PluginSystemRuntimeDependencyFromUrl, } from "@sentry/junior-plugin-api";
3
+ export type { PluginNpmRuntimeDependency, PluginMcpConfig, PluginRuntimeDependency, PluginRuntimePostinstallCommand, PluginSystemRuntimeDependency, PluginSystemRuntimeDependencyFromUrl, } from "@sentry/junior-plugin-api";
4
4
  export interface PluginOAuthConfig {
5
5
  clientIdEnv: string;
6
6
  clientSecretEnv: string;
@@ -30,13 +30,6 @@ export interface OAuthBearerCredentials {
30
30
  authTokenPlaceholder?: string;
31
31
  }
32
32
  export type PluginCredentials = OAuthBearerCredentials;
33
- export interface PluginMcpHttpConfig {
34
- transport: "http";
35
- url: string;
36
- headers?: Record<string, string>;
37
- allowedTools?: string[];
38
- }
39
- export type PluginMcpConfig = PluginMcpHttpConfig;
40
33
  export interface PluginEnvVarDeclaration {
41
34
  default?: string;
42
35
  exposeToCommandEnv?: boolean;
@@ -103,6 +96,7 @@ export interface PluginManifestConfig {
103
96
  url?: string;
104
97
  headers?: Record<string, string | null> | null;
105
98
  allowedTools?: string[] | null;
99
+ wrappedTools?: string[] | null;
106
100
  } | null;
107
101
  oauth?: PluginOAuthConfigPatch | null;
108
102
  target?: {
@@ -4,7 +4,7 @@
4
4
  * This module joins registered readers with the authenticated viewer and
5
5
  * validates every plugin response before it reaches the dashboard.
6
6
  */
7
- import { type PluginUserPageContent, type PluginUserPageLink } from "@sentry/junior-plugin-api";
7
+ import { type PluginUserPageContent, type PluginUserPageInput, type PluginUserPageLink } from "@sentry/junior-plugin-api";
8
8
  /** List safe navigation metadata for registered plugin user pages. */
9
9
  export declare function readPluginUserPageLinks(): PluginUserPageLink[];
10
10
  /** Read one registered plugin user page for the authenticated viewer. */
@@ -12,4 +12,5 @@ export declare function readPluginUserPage(input: {
12
12
  email: string;
13
13
  pageId: string;
14
14
  pluginName: string;
15
+ query: PluginUserPageInput;
15
16
  }): Promise<PluginUserPageContent | undefined>;