@sentry/junior 0.117.0 → 0.118.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 (66) hide show
  1. package/dist/{agent-hooks-5IK4LPLP.js → agent-hooks-J2FB7XD6.js} +8 -10
  2. package/dist/api/schema/stats.d.ts +22 -0
  3. package/dist/api/schema.d.ts +2 -0
  4. package/dist/api/schema.js +7 -3
  5. package/dist/api/stats.d.ts +16 -0
  6. package/dist/api/user-pages/routes.d.ts +4 -0
  7. package/dist/api.js +179 -18
  8. package/dist/app.js +40 -35
  9. package/dist/{catalog-runtime-MTUYW3AA.js → catalog-runtime-UHHLU53I.js} +5 -5
  10. package/dist/chat/agent/prompt.d.ts +4 -2
  11. package/dist/chat/plugins/user-pages.d.ts +15 -0
  12. package/dist/chat/plugins/viewer-actors.d.ts +6 -0
  13. package/dist/chat/prompt.d.ts +1 -2
  14. package/dist/chat/sandbox/paths.d.ts +2 -0
  15. package/dist/chat/sandbox/sandbox.d.ts +3 -1
  16. package/dist/chat/sandbox/workspace.d.ts +1 -0
  17. package/dist/chat/skills.d.ts +1 -2
  18. package/dist/chat/tools/index.d.ts +4 -1
  19. package/dist/chat/tools/sandbox/file-utils.d.ts +11 -0
  20. package/dist/chat/tools/sandbox/find-files.d.ts +2 -1
  21. package/dist/chat/tools/sandbox/grep.d.ts +2 -1
  22. package/dist/{chunk-5O3JDQDG.js → chunk-3LGCVRBQ.js} +1 -1
  23. package/dist/{chunk-WEK3V5RI.js → chunk-3MUSSFMP.js} +17 -19
  24. package/dist/{chunk-KU6ALEJC.js → chunk-3N3FMCKN.js} +30 -2
  25. package/dist/{chunk-FAWBONPC.js → chunk-4LPPH7Y6.js} +5 -7
  26. package/dist/{chunk-W5JEQQEA.js → chunk-4SOQPUF4.js} +1 -1
  27. package/dist/{chunk-LN765Y4N.js → chunk-6BGUAOYP.js} +8 -8
  28. package/dist/{chunk-NHZEUHKH.js → chunk-6K2QE2UI.js} +231 -94
  29. package/dist/{chunk-AKG4TZNH.js → chunk-7GADTCNS.js} +30 -9
  30. package/dist/{chunk-BFIRIZPH.js → chunk-7SM3P4XR.js} +19 -1
  31. package/dist/{chunk-WKU7TY22.js → chunk-FIANEE7Z.js} +3 -1
  32. package/dist/{chunk-RXRQJF7Y.js → chunk-GCGJGSQL.js} +21 -0
  33. package/dist/{chunk-STUI6NIL.js → chunk-GT2ZUALJ.js} +511 -14
  34. package/dist/{chunk-LUMEBOWC.js → chunk-HN6LFYG3.js} +1 -1
  35. package/dist/{chunk-3GE3F4LT.js → chunk-HWUBBHLK.js} +1 -1
  36. package/dist/{chunk-ZRQUQJUV.js → chunk-KC5EE27Y.js} +3 -3
  37. package/dist/chunk-L72GDKSN.js +37 -0
  38. package/dist/{chunk-72Z3HNTQ.js → chunk-MLZFK4KP.js} +1 -1
  39. package/dist/{chunk-27KWTFP6.js → chunk-PJPKHGLG.js} +5 -7
  40. package/dist/{chunk-DS27ZBSP.js → chunk-PWRFTDTY.js} +1 -1
  41. package/dist/{chunk-WUNPRM76.js → chunk-QWCF4RAC.js} +1 -1
  42. package/dist/{chunk-6G45D3YG.js → chunk-S6R23MFB.js} +12 -16
  43. package/dist/{chunk-CU7HTGNI.js → chunk-UXLYAVYL.js} +1 -1
  44. package/dist/cli/chat.js +23 -24
  45. package/dist/cli/check.js +6 -6
  46. package/dist/cli/plugins.js +12 -14
  47. package/dist/cli/snapshot-create.js +8 -9
  48. package/dist/cli/upgrade.js +7 -7
  49. package/dist/db/schema/stats.d.ts +93 -0
  50. package/dist/db/schema.d.ts +94 -1
  51. package/dist/{db-J2ITKS63.js → db-PMRHFSYL.js} +6 -6
  52. package/dist/instrumentation.js +2 -2
  53. package/dist/nitro.js +3 -3
  54. package/dist/{oauth-callback-server-NQYKBT24.js → oauth-callback-server-QJUC7S4X.js} +15 -17
  55. package/dist/{plugins-IUJA4VBU.js → plugins-HW4VWW6G.js} +1 -1
  56. package/dist/{runner-53V5GIQM.js → runner-PZMV6JQW.js} +10 -12
  57. package/dist/{skills-BU3ZMLVB.js → skills-W4JETYSV.js} +6 -6
  58. package/dist/stats.d.ts +18 -0
  59. package/dist/{validation-74EIKKE6.js → validation-IJLNHZSU.js} +6 -6
  60. package/dist/version.js +1 -1
  61. package/migrations/0011_sour_golden_guardian.sql +8 -0
  62. package/migrations/meta/0011_snapshot.json +1195 -0
  63. package/migrations/meta/_journal.json +8 -1
  64. package/package.json +5 -5
  65. package/dist/chunk-4ZNGQH7C.js +0 -25
  66. package/dist/chunk-YRWJ3KEU.js +0 -517
@@ -11,22 +11,20 @@ import {
11
11
  getPlugins,
12
12
  setPlugins,
13
13
  validatePlugins
14
- } from "./chunk-STUI6NIL.js";
15
- import "./chunk-KU6ALEJC.js";
16
- import "./chunk-YRWJ3KEU.js";
17
- import "./chunk-ZRQUQJUV.js";
18
- import "./chunk-RXRQJF7Y.js";
19
- import "./chunk-4ZNGQH7C.js";
20
- import "./chunk-DS27ZBSP.js";
14
+ } from "./chunk-GT2ZUALJ.js";
15
+ import "./chunk-KC5EE27Y.js";
16
+ import "./chunk-GCGJGSQL.js";
17
+ import "./chunk-3N3FMCKN.js";
18
+ import "./chunk-PWRFTDTY.js";
21
19
  import "./chunk-VFUK3X5B.js";
22
20
  import "./chunk-FXOYURO4.js";
23
21
  import "./chunk-HZF5P5UN.js";
24
- import "./chunk-72Z3HNTQ.js";
22
+ import "./chunk-MLZFK4KP.js";
25
23
  import "./chunk-OB42YVAE.js";
26
24
  import "./chunk-F3B2YJ76.js";
27
25
  import "./chunk-6GWA276C.js";
28
- import "./chunk-WUNPRM76.js";
29
- import "./chunk-3GE3F4LT.js";
26
+ import "./chunk-QWCF4RAC.js";
27
+ import "./chunk-HWUBBHLK.js";
30
28
  import "./chunk-MLKGABMK.js";
31
29
  export {
32
30
  PluginHookDeniedError,
@@ -0,0 +1,22 @@
1
+ import { z } from "zod";
2
+ export declare const statSchema: z.ZodObject<{
3
+ count: z.ZodNumber;
4
+ date: z.ZodString;
5
+ metric: z.ZodString;
6
+ name: z.ZodString;
7
+ namespace: z.ZodString;
8
+ }, z.core.$strict>;
9
+ export declare const statsReportSchema: z.ZodObject<{
10
+ generatedAt: z.ZodString;
11
+ stats: z.ZodArray<z.ZodObject<{
12
+ count: z.ZodNumber;
13
+ date: z.ZodString;
14
+ metric: z.ZodString;
15
+ name: z.ZodString;
16
+ namespace: z.ZodString;
17
+ }, z.core.$strict>>;
18
+ windowEnd: z.ZodString;
19
+ windowStart: z.ZodString;
20
+ }, z.core.$strict>;
21
+ export type StatReport = z.infer<typeof statSchema>;
22
+ export type StatsReport = z.infer<typeof statsReportSchema>;
@@ -10,5 +10,7 @@ export { apiErrorSchema } from "./schema/common";
10
10
  export type { ApiError } from "./schema/common";
11
11
  export { createPersonalTokenBodySchema, createdPersonalTokenSchema, personalTokenListSchema, personalTokenMetadataSchema, personalTokenParamsSchema, revokePersonalTokenResponseSchema, } from "./schema/personal-token";
12
12
  export type { PersonalTokenMetadata } from "./schema/personal-token";
13
+ export { statSchema, statsReportSchema } from "./schema/stats";
14
+ export type { StatReport, StatsReport } from "./schema/stats";
13
15
  export { healthReportSchema, pluginOperationalReportFeedSchema, pluginOperationalReportSchema, pluginPackageContentItemReportSchema, pluginPackageContentReportSchema, pluginSchema, pluginsSchema, runtimeInfoReportSchema, skillReportSchema, skillReportsSchema, } from "../reporting-schema";
14
16
  export type { HealthReport, PluginOperationalReport, PluginOperationalReportFeed, PluginPackageContentItemReport, PluginPackageContentReport, Plugin, Plugins, RuntimeInfoReport, SkillReport, SkillReports, } from "../reporting-schema";
@@ -27,8 +27,10 @@ import {
27
27
  personalTokenListSchema,
28
28
  personalTokenMetadataSchema,
29
29
  personalTokenParamsSchema,
30
- revokePersonalTokenResponseSchema
31
- } from "../chunk-BFIRIZPH.js";
30
+ revokePersonalTokenResponseSchema,
31
+ statSchema,
32
+ statsReportSchema
33
+ } from "../chunk-7SM3P4XR.js";
32
34
  import {
33
35
  healthReportSchema,
34
36
  pluginOperationalReportFeedSchema,
@@ -83,5 +85,7 @@ export {
83
85
  revokePersonalTokenResponseSchema,
84
86
  runtimeInfoReportSchema,
85
87
  skillReportSchema,
86
- skillReportsSchema
88
+ skillReportsSchema,
89
+ statSchema,
90
+ statsReportSchema
87
91
  };
@@ -0,0 +1,16 @@
1
+ import { type StatsReport } from "./schema/stats";
2
+ /** Read the last 90 days of named daily counters. */
3
+ export declare function readStatsReport(): Promise<StatsReport>;
4
+ declare const _default: import("./route").ApiRoute<import("zod").ZodObject<{
5
+ generatedAt: import("zod").ZodString;
6
+ stats: import("zod").ZodArray<import("zod").ZodObject<{
7
+ count: import("zod").ZodNumber;
8
+ date: import("zod").ZodString;
9
+ metric: import("zod").ZodString;
10
+ name: import("zod").ZodString;
11
+ namespace: import("zod").ZodString;
12
+ }, import("zod/v4/core").$strict>>;
13
+ windowEnd: import("zod").ZodString;
14
+ windowStart: import("zod").ZodString;
15
+ }, import("zod/v4/core").$strict>>;
16
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { Hono } from "hono";
2
+ import type { JuniorApiEnv } from "../route";
3
+ /** Create authenticated discovery and read routes for plugin user pages. */
4
+ export declare function createUserPageRoutes(): Hono<JuniorApiEnv>;
package/dist/api.js CHANGED
@@ -22,13 +22,14 @@ import {
22
22
  personParamsSchema,
23
23
  personalTokenListSchema,
24
24
  personalTokenParamsSchema,
25
- revokePersonalTokenResponseSchema
26
- } from "./chunk-BFIRIZPH.js";
25
+ revokePersonalTokenResponseSchema,
26
+ statsReportSchema
27
+ } from "./chunk-7SM3P4XR.js";
27
28
  import {
28
29
  formatSlackConversationRedactedLabel,
29
30
  readHealthReport,
30
31
  resolveSlackConversationContextFromThreadId
31
- } from "./chunk-LUMEBOWC.js";
32
+ } from "./chunk-HN6LFYG3.js";
32
33
  import {
33
34
  buildSentryConversationUrl
34
35
  } from "./chunk-4CODA7P5.js";
@@ -39,28 +40,33 @@ import {
39
40
  runtimeInfoReportSchema,
40
41
  skillReportsSchema
41
42
  } from "./chunk-PE44LDDQ.js";
43
+ import {
44
+ readStats
45
+ } from "./chunk-L72GDKSN.js";
42
46
  import {
43
47
  agentTurnUsageSchema,
44
48
  hasAgentTurnUsage
45
49
  } from "./chunk-MU6HHZEN.js";
46
50
  import "./chunk-PDO5BLNM.js";
47
51
  import {
52
+ createPluginLogger,
53
+ getPlugins,
48
54
  listConversationAnnotations
49
- } from "./chunk-YRWJ3KEU.js";
55
+ } from "./chunk-GT2ZUALJ.js";
50
56
  import {
51
57
  decodeStoredConversationEvent,
52
58
  getDb,
53
59
  getSqlExecutor
54
- } from "./chunk-ZRQUQJUV.js";
60
+ } from "./chunk-KC5EE27Y.js";
55
61
  import {
56
62
  juniorApiTokens,
57
63
  juniorConversationEvents,
58
64
  juniorConversations,
59
65
  juniorIdentities,
60
66
  juniorUsers
61
- } from "./chunk-RXRQJF7Y.js";
62
- import "./chunk-4ZNGQH7C.js";
63
- import "./chunk-DS27ZBSP.js";
67
+ } from "./chunk-GCGJGSQL.js";
68
+ import "./chunk-3N3FMCKN.js";
69
+ import "./chunk-PWRFTDTY.js";
64
70
  import {
65
71
  juniorDestinations
66
72
  } from "./chunk-VFUK3X5B.js";
@@ -68,16 +74,19 @@ import {
68
74
  canExposeConversationPayload,
69
75
  parseSlackThreadId
70
76
  } from "./chunk-FXOYURO4.js";
71
- import "./chunk-72Z3HNTQ.js";
77
+ import "./chunk-HZF5P5UN.js";
78
+ import {
79
+ normalizeIdentityEmail
80
+ } from "./chunk-MLZFK4KP.js";
72
81
  import "./chunk-OB42YVAE.js";
73
82
  import "./chunk-F3B2YJ76.js";
74
83
  import "./chunk-6GWA276C.js";
75
- import "./chunk-WUNPRM76.js";
76
- import "./chunk-3GE3F4LT.js";
84
+ import "./chunk-QWCF4RAC.js";
85
+ import "./chunk-HWUBBHLK.js";
77
86
  import "./chunk-MLKGABMK.js";
78
87
 
79
88
  // src/api.ts
80
- import { Hono as Hono5 } from "hono";
89
+ import { Hono as Hono6 } from "hono";
81
90
 
82
91
  // src/api/conversations/routes.ts
83
92
  import { Hono } from "hono";
@@ -1690,7 +1699,7 @@ function readDescriptionText(home) {
1690
1699
  }
1691
1700
  }
1692
1701
  async function readSkillReports() {
1693
- const { discoverSkills } = await import("./skills-BU3ZMLVB.js");
1702
+ const { discoverSkills } = await import("./skills-W4JETYSV.js");
1694
1703
  const skills = await discoverSkills();
1695
1704
  return skillReportsSchema.parse(
1696
1705
  skills.map((skill) => ({
@@ -1700,7 +1709,7 @@ async function readSkillReports() {
1700
1709
  );
1701
1710
  }
1702
1711
  async function readPlugins() {
1703
- const { pluginCatalogRuntime } = await import("./catalog-runtime-MTUYW3AA.js");
1712
+ const { pluginCatalogRuntime } = await import("./catalog-runtime-UHHLU53I.js");
1704
1713
  return pluginsSchema.parse(
1705
1714
  pluginCatalogRuntime.getProviders().map((plugin) => ({
1706
1715
  configKeys: plugin.manifest.configKeys ?? [],
@@ -1713,7 +1722,7 @@ async function readPlugins() {
1713
1722
  async function readRuntimeInfoReport() {
1714
1723
  const [{ homeDir }, { pluginCatalogRuntime }, plugins, skills] = await Promise.all([
1715
1724
  import("./discovery-RMHYSRL7.js"),
1716
- import("./catalog-runtime-MTUYW3AA.js"),
1725
+ import("./catalog-runtime-UHHLU53I.js"),
1717
1726
  readPlugins(),
1718
1727
  readSkillReports()
1719
1728
  ]);
@@ -1729,7 +1738,7 @@ async function readRuntimeInfoReport() {
1729
1738
  }
1730
1739
  async function readPluginOperationalReportFeed() {
1731
1740
  const nowMs = Date.now();
1732
- const { getPluginOperationalReports } = await import("./agent-hooks-5IK4LPLP.js");
1741
+ const { getPluginOperationalReports } = await import("./agent-hooks-J2FB7XD6.js");
1733
1742
  return pluginOperationalReportFeedSchema.parse({
1734
1743
  source: "plugins",
1735
1744
  generatedAt: new Date(nowMs).toISOString(),
@@ -2799,6 +2808,133 @@ function createPersonalTokenRoutes() {
2799
2808
  return app;
2800
2809
  }
2801
2810
 
2811
+ // src/api/user-pages/routes.ts
2812
+ import { Hono as Hono5 } from "hono";
2813
+ import {
2814
+ pluginUserPageContentSchema as pluginUserPageContentSchema2,
2815
+ pluginUserPageLinksSchema as pluginUserPageLinksSchema2
2816
+ } from "@sentry/junior-plugin-api";
2817
+
2818
+ // src/chat/plugins/user-pages.ts
2819
+ import {
2820
+ pluginUserPageContentSchema,
2821
+ pluginUserPageLinksSchema
2822
+ } from "@sentry/junior-plugin-api";
2823
+
2824
+ // src/chat/plugins/viewer-actors.ts
2825
+ import { and as and12, eq as eq13 } from "drizzle-orm";
2826
+ import {
2827
+ actorSchema
2828
+ } from "@sentry/junior-plugin-api";
2829
+ async function readViewerActorsFromSql(db, email) {
2830
+ const normalizedEmail = normalizeIdentityEmail(email);
2831
+ if (!normalizedEmail) return [];
2832
+ const rows = await db.select({
2833
+ displayName: juniorIdentities.displayName,
2834
+ email: juniorUsers.primaryEmail,
2835
+ handle: juniorIdentities.handle,
2836
+ provider: juniorIdentities.provider,
2837
+ providerSubjectId: juniorIdentities.providerSubjectId,
2838
+ providerTenantId: juniorIdentities.providerTenantId
2839
+ }).from(juniorIdentities).innerJoin(juniorUsers, eq13(juniorUsers.id, juniorIdentities.userId)).where(
2840
+ and12(
2841
+ eq13(juniorUsers.primaryEmailNormalized, normalizedEmail),
2842
+ eq13(juniorIdentities.kind, "user")
2843
+ )
2844
+ );
2845
+ const actors = [];
2846
+ for (const row of rows) {
2847
+ const candidate = row.provider === "slack" ? {
2848
+ platform: "slack",
2849
+ teamId: row.providerTenantId,
2850
+ userId: row.providerSubjectId,
2851
+ email: row.email,
2852
+ ...row.displayName ? { fullName: row.displayName } : {},
2853
+ ...row.handle ? { userName: row.handle } : {}
2854
+ } : row.provider === "local" ? {
2855
+ platform: "local",
2856
+ userId: row.providerSubjectId,
2857
+ email: row.email,
2858
+ ...row.displayName ? { fullName: row.displayName } : {},
2859
+ ...row.handle ? { userName: row.handle } : {}
2860
+ } : void 0;
2861
+ if (!candidate) continue;
2862
+ const parsed = actorSchema.safeParse(candidate);
2863
+ if (parsed.success && parsed.data.platform !== "system") {
2864
+ actors.push(parsed.data);
2865
+ }
2866
+ }
2867
+ return actors;
2868
+ }
2869
+ async function readViewerActors(email) {
2870
+ return await readViewerActorsFromSql(getDb(), email);
2871
+ }
2872
+
2873
+ // src/chat/plugins/user-pages.ts
2874
+ function readPluginUserPageLinks() {
2875
+ return pluginUserPageLinksSchema.parse(
2876
+ getPlugins().flatMap(
2877
+ (plugin) => (plugin.userPages ?? []).map((page) => ({
2878
+ description: page.description,
2879
+ id: page.id,
2880
+ label: page.label,
2881
+ pluginDisplayName: plugin.manifest.displayName,
2882
+ pluginName: plugin.manifest.name
2883
+ }))
2884
+ )
2885
+ );
2886
+ }
2887
+ async function readPluginUserPage(input) {
2888
+ const plugin = getPlugins().find(
2889
+ (candidate) => candidate.manifest.name === input.pluginName
2890
+ );
2891
+ const page = plugin?.userPages?.find(
2892
+ (candidate) => candidate.id === input.pageId
2893
+ );
2894
+ if (!plugin || !page) return void 0;
2895
+ return pluginUserPageContentSchema.parse(
2896
+ await page.read({
2897
+ db: getDb(),
2898
+ log: createPluginLogger(plugin.manifest.name),
2899
+ plugin: { name: plugin.manifest.name },
2900
+ viewer: {
2901
+ actors: await readViewerActors(input.email),
2902
+ email: input.email
2903
+ }
2904
+ })
2905
+ );
2906
+ }
2907
+
2908
+ // src/api/user-pages/routes.ts
2909
+ function createUserPageRoutes() {
2910
+ const app = new Hono5();
2911
+ app.get(
2912
+ "/",
2913
+ () => jsonResponse(pluginUserPageLinksSchema2, readPluginUserPageLinks())
2914
+ );
2915
+ app.get("/:pluginName/:pageId", async (context) => {
2916
+ const email = context.get("verifiedViewerEmail")?.trim();
2917
+ if (!email) {
2918
+ return jsonResponse(
2919
+ apiErrorSchema,
2920
+ { error: "Authentication required." },
2921
+ { status: 401 }
2922
+ );
2923
+ }
2924
+ const page = await readPluginUserPage({
2925
+ email,
2926
+ pageId: context.req.param("pageId"),
2927
+ pluginName: context.req.param("pluginName")
2928
+ });
2929
+ return page ? jsonResponse(pluginUserPageContentSchema2, page) : jsonResponse(
2930
+ apiErrorSchema,
2931
+ { error: "User page not found." },
2932
+ { status: 404 }
2933
+ );
2934
+ });
2935
+ return app;
2936
+ }
2937
+
2802
2938
  // src/api/plugins.ts
2803
2939
  var plugins_default = defineApiRoute({
2804
2940
  method: "get",
@@ -2823,21 +2959,46 @@ var skills_default = defineApiRoute({
2823
2959
  handler: readSkillReports
2824
2960
  });
2825
2961
 
2962
+ // src/api/stats.ts
2963
+ var WINDOW_DAYS2 = 90;
2964
+ async function readStatsReport() {
2965
+ const now = /* @__PURE__ */ new Date();
2966
+ const end = now.toISOString().slice(0, 10);
2967
+ const startDate = new Date(now);
2968
+ startDate.setUTCHours(0, 0, 0, 0);
2969
+ startDate.setUTCDate(startDate.getUTCDate() - (WINDOW_DAYS2 - 1));
2970
+ const start = startDate.toISOString().slice(0, 10);
2971
+ return statsReportSchema.parse({
2972
+ generatedAt: now.toISOString(),
2973
+ stats: await readStats(start, end),
2974
+ windowEnd: end,
2975
+ windowStart: start
2976
+ });
2977
+ }
2978
+ var stats_default2 = defineApiRoute({
2979
+ method: "get",
2980
+ path: "/api/stats",
2981
+ responseSchema: statsReportSchema,
2982
+ handler: readStatsReport
2983
+ });
2984
+
2826
2985
  // src/api.ts
2827
2986
  var routes5 = [
2828
2987
  health_default,
2829
2988
  runtime_default,
2830
2989
  plugins_default,
2831
2990
  skills_default,
2832
- plugin_reports_default
2991
+ plugin_reports_default,
2992
+ stats_default2
2833
2993
  ];
2834
2994
  function createJuniorApi() {
2835
- const app = new Hono5();
2995
+ const app = new Hono6();
2836
2996
  registerApiRoutes(app, routes5);
2837
2997
  app.route("/api/conversations", createConversationRoutes());
2838
2998
  app.route("/api/personal-tokens", createPersonalTokenRoutes());
2839
2999
  app.route("/api/people", createPeopleRoutes());
2840
3000
  app.route("/api/locations", createLocationRoutes());
3001
+ app.route("/api/user-pages", createUserPageRoutes());
2841
3002
  app.notFound(
2842
3003
  () => jsonResponse(
2843
3004
  apiErrorSchema,
package/dist/app.js CHANGED
@@ -48,7 +48,7 @@ import {
48
48
  startConversationWork,
49
49
  startSlackProcessingReaction,
50
50
  stripLeadingBotMention
51
- } from "./chunk-WEK3V5RI.js";
51
+ } from "./chunk-3MUSSFMP.js";
52
52
  import "./chunk-FA6POGLH.js";
53
53
  import {
54
54
  ConversationTurnLifecycleService,
@@ -63,13 +63,13 @@ import {
63
63
  processPluginTask,
64
64
  requireTurnFailureEventId,
65
65
  scheduleSessionCompletedPluginTasks
66
- } from "./chunk-LN765Y4N.js";
66
+ } from "./chunk-6BGUAOYP.js";
67
67
  import {
68
68
  GET,
69
69
  conversationVisibilityFromSlackChannelType,
70
70
  resolveSlackChannelTypeFromMessage,
71
71
  resolveSlackConversationContext
72
- } from "./chunk-LUMEBOWC.js";
72
+ } from "./chunk-HN6LFYG3.js";
73
73
  import "./chunk-4CODA7P5.js";
74
74
  import "./chunk-PE44LDDQ.js";
75
75
  import {
@@ -88,13 +88,13 @@ import {
88
88
  import {
89
89
  validatePluginEgressCredentialHooks,
90
90
  validatePluginRegistrations
91
- } from "./chunk-W5JEQQEA.js";
91
+ } from "./chunk-4SOQPUF4.js";
92
92
  import {
93
93
  defineJuniorPlugins,
94
94
  pluginCatalogConfigFromEnv,
95
95
  pluginCatalogConfigFromPluginSet,
96
96
  pluginRuntimeRegistrationsFromPluginSet
97
- } from "./chunk-WKU7TY22.js";
97
+ } from "./chunk-FIANEE7Z.js";
98
98
  import {
99
99
  AuthorizationFlowDisabledError,
100
100
  PluginCredentialFailureError,
@@ -121,7 +121,7 @@ import {
121
121
  setConfigDefaults,
122
122
  shouldEmitDevAgentTrace,
123
123
  shouldPropagateSandboxEgressTrace
124
- } from "./chunk-NHZEUHKH.js";
124
+ } from "./chunk-6K2QE2UI.js";
125
125
  import "./chunk-DIB4GX3G.js";
126
126
  import {
127
127
  RetryableDeliveryError,
@@ -134,7 +134,7 @@ import {
134
134
  postSlackMessage,
135
135
  splitSlackReplyText,
136
136
  startOAuthFlow
137
- } from "./chunk-6G45D3YG.js";
137
+ } from "./chunk-S6R23MFB.js";
138
138
  import {
139
139
  ConversationTurnBoundaryError,
140
140
  CooperativeTurnYieldError,
@@ -188,40 +188,35 @@ import {
188
188
  trimTrailingAssistantMessages,
189
189
  updateConversationStats,
190
190
  upsertConversationMessage
191
- } from "./chunk-27KWTFP6.js";
191
+ } from "./chunk-PJPKHGLG.js";
192
192
  import "./chunk-HDSDCEPK.js";
193
- import "./chunk-FAWBONPC.js";
193
+ import "./chunk-4LPPH7Y6.js";
194
+ import "./chunk-L72GDKSN.js";
194
195
  import "./chunk-MU6HHZEN.js";
195
196
  import "./chunk-PDO5BLNM.js";
196
197
  import "./chunk-UIE3R5XU.js";
197
198
  import {
199
+ SlackActionError,
198
200
  bindScheduledTaskCredentialSubject,
199
201
  bindSlackDirectCredentialSubject,
200
202
  createPluginLogger,
201
203
  createPluginState,
204
+ downloadPrivateSlackFile,
202
205
  getPluginApiRoutes,
203
206
  getPluginRoutes,
204
207
  getPlugins,
205
- setDashboardConversationLinkOptions,
206
- setPlugins,
207
- validatePlugins,
208
- verifyScheduledTaskCredentialSubject,
209
- verifySlackDirectCredentialSubject
210
- } from "./chunk-STUI6NIL.js";
211
- import {
212
- acquireActiveLock,
213
- getStateAdapter
214
- } from "./chunk-KU6ALEJC.js";
215
- import {
216
- SlackActionError,
217
- downloadPrivateSlackFile,
218
208
  getSlackClient,
219
209
  getWorkspaceTeamId,
220
210
  isDmChannel,
221
211
  normalizeSlackConversationId,
222
212
  runWithSlackInstallationToken,
223
- runWithWorkspaceTeamId
224
- } from "./chunk-YRWJ3KEU.js";
213
+ runWithWorkspaceTeamId,
214
+ setDashboardConversationLinkOptions,
215
+ setPlugins,
216
+ validatePlugins,
217
+ verifyScheduledTaskCredentialSubject,
218
+ verifySlackDirectCredentialSubject
219
+ } from "./chunk-GT2ZUALJ.js";
225
220
  import {
226
221
  contextProvenance,
227
222
  createSlackDestination,
@@ -232,14 +227,16 @@ import {
232
227
  instructionProvenanceFor,
233
228
  requireSlackDestination,
234
229
  withConversationEventLock
235
- } from "./chunk-ZRQUQJUV.js";
230
+ } from "./chunk-KC5EE27Y.js";
236
231
  import {
237
232
  juniorConversationEvents,
238
233
  juniorConversations
239
- } from "./chunk-RXRQJF7Y.js";
234
+ } from "./chunk-GCGJGSQL.js";
240
235
  import {
236
+ acquireActiveLock,
237
+ getStateAdapter,
241
238
  sleep
242
- } from "./chunk-4ZNGQH7C.js";
239
+ } from "./chunk-3N3FMCKN.js";
243
240
  import {
244
241
  STANDARD_MODEL_PROFILE,
245
242
  botConfig,
@@ -257,18 +254,18 @@ import {
257
254
  modelIdForProfile,
258
255
  setSlackReactionConfig,
259
256
  standardModelId
260
- } from "./chunk-DS27ZBSP.js";
257
+ } from "./chunk-PWRFTDTY.js";
261
258
  import {
262
259
  juniorDestinations
263
260
  } from "./chunk-VFUK3X5B.js";
264
261
  import {
265
262
  parseSlackThreadId
266
263
  } from "./chunk-FXOYURO4.js";
267
- import "./chunk-AKG4TZNH.js";
264
+ import "./chunk-7GADTCNS.js";
268
265
  import {
269
266
  pluginCatalogRuntime
270
- } from "./chunk-CU7HTGNI.js";
271
- import "./chunk-5O3JDQDG.js";
267
+ } from "./chunk-UXLYAVYL.js";
268
+ import "./chunk-3LGCVRBQ.js";
272
269
  import {
273
270
  credentialSubjectSchema
274
271
  } from "./chunk-W3U3YQYI.js";
@@ -294,7 +291,7 @@ import {
294
291
  setTags,
295
292
  withContext,
296
293
  withSpan
297
- } from "./chunk-72Z3HNTQ.js";
294
+ } from "./chunk-MLZFK4KP.js";
298
295
  import {
299
296
  toOptionalString
300
297
  } from "./chunk-OB42YVAE.js";
@@ -309,10 +306,10 @@ import "./chunk-B3IT5END.js";
309
306
  import "./chunk-3V7OFJZC.js";
310
307
  import {
311
308
  JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
312
- } from "./chunk-WUNPRM76.js";
309
+ } from "./chunk-QWCF4RAC.js";
313
310
  import {
314
311
  JUNIOR_VERSION
315
- } from "./chunk-3GE3F4LT.js";
312
+ } from "./chunk-HWUBBHLK.js";
316
313
  import "./chunk-MLKGABMK.js";
317
314
 
318
315
  // src/app.ts
@@ -9440,7 +9437,10 @@ function dashboardHostRoutePaths(dashboard) {
9440
9437
  peoplePath,
9441
9438
  `${peoplePath}/*`,
9442
9439
  pagePath("system"),
9443
- `${pagePath("system")}/*`
9440
+ `${pagePath("system")}/*`,
9441
+ pagePath("settings/plugins"),
9442
+ `${pagePath("settings/plugins")}/*`,
9443
+ pagePath("settings/api-tokens")
9444
9444
  ];
9445
9445
  if (dashboard.componentGallery) {
9446
9446
  pagePaths.push(pagePath("dev"), `${pagePath("dev")}/*`);
@@ -9457,13 +9457,18 @@ function dashboardHostRoutePaths(dashboard) {
9457
9457
  "/api/plugins",
9458
9458
  "/api/plugins/*",
9459
9459
  "/api/plugin-reports",
9460
+ "/api/user-pages",
9461
+ "/api/user-pages/*",
9460
9462
  "/api/skills",
9463
+ "/api/stats",
9461
9464
  "/api/conversations",
9462
9465
  "/api/conversations/*",
9463
9466
  "/api/locations",
9464
9467
  "/api/locations/*",
9465
9468
  "/api/people",
9466
9469
  "/api/people/*",
9470
+ "/api/personal-tokens",
9471
+ "/api/personal-tokens/*",
9467
9472
  "/api/config",
9468
9473
  "/api/me",
9469
9474
  authPath,
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-CU7HTGNI.js";
4
- import "./chunk-5O3JDQDG.js";
3
+ } from "./chunk-UXLYAVYL.js";
4
+ import "./chunk-3LGCVRBQ.js";
5
5
  import "./chunk-W3U3YQYI.js";
6
6
  import "./chunk-HZF5P5UN.js";
7
- import "./chunk-72Z3HNTQ.js";
7
+ import "./chunk-MLZFK4KP.js";
8
8
  import "./chunk-OB42YVAE.js";
9
9
  import "./chunk-F3B2YJ76.js";
10
10
  import "./chunk-6GWA276C.js";
11
11
  import "./chunk-B3IT5END.js";
12
12
  import "./chunk-3V7OFJZC.js";
13
- import "./chunk-WUNPRM76.js";
14
- import "./chunk-3GE3F4LT.js";
13
+ import "./chunk-QWCF4RAC.js";
14
+ import "./chunk-HWUBBHLK.js";
15
15
  import "./chunk-MLKGABMK.js";
16
16
  export {
17
17
  pluginCatalogRuntime
@@ -1,7 +1,7 @@
1
1
  import type { PiMessage } from "@/chat/pi/messages";
2
2
  import { type LogContext } from "@/chat/logging";
3
3
  import type { ConversationPrivacy } from "@/chat/conversation-privacy";
4
- import type { SkillInvocation, SkillMetadata } from "@/chat/skills";
4
+ import type { Skill, SkillMetadata } from "@/chat/skills";
5
5
  import type { ActiveMcpCatalogSummary } from "@/chat/tool-support/skill/mcp-tool-summary";
6
6
  import type { ToolRuntimeContext } from "@/chat/tools/types";
7
7
  import type { AnyToolDefinition } from "@/chat/tools/definition";
@@ -39,6 +39,8 @@ export interface PromptAssembly {
39
39
  * Keep thread text separate from the canonical active task boundary.
40
40
  */
41
41
  export declare function buildUserTurnText(userInput: string, conversationContext?: string, actor?: AgentRunInstructionActor): string;
42
+ /** Render an explicitly selected skill as instructions for the current turn. */
43
+ export declare function renderExplicitSkillInstructions(skill: Skill): string;
42
44
  /** Encode a non-image attachment as base64 XML for the prompt. */
43
45
  export declare function encodeNonImageAttachmentForPrompt(attachment: {
44
46
  data: Buffer;
@@ -65,7 +67,7 @@ export declare function assemblePrompt(args: {
65
67
  conversationPrivacy?: ConversationPrivacy;
66
68
  existingSessionPiMessages?: PiMessage[];
67
69
  existingTurnStartMessageIndex?: number;
68
- invocation: SkillInvocation | null;
70
+ explicitSkill: Skill | null;
69
71
  priorPiMessages?: PiMessage[];
70
72
  resumedFromSessionRecord: boolean;
71
73
  routing: AgentRunRouting;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Runtime ownership for plugin user pages.
3
+ *
4
+ * This module joins registered readers with the authenticated viewer and
5
+ * validates every plugin response before it reaches the dashboard.
6
+ */
7
+ import { type PluginUserPageContent, type PluginUserPageLink } from "@sentry/junior-plugin-api";
8
+ /** List safe navigation metadata for registered plugin user pages. */
9
+ export declare function readPluginUserPageLinks(): PluginUserPageLink[];
10
+ /** Read one registered plugin user page for the authenticated viewer. */
11
+ export declare function readPluginUserPage(input: {
12
+ email: string;
13
+ pageId: string;
14
+ pluginName: string;
15
+ }): Promise<PluginUserPageContent | undefined>;