@sentry/junior 0.74.1 → 0.76.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 (121) hide show
  1. package/README.md +1 -1
  2. package/bin/junior.mjs +4 -66
  3. package/dist/agent-hooks-ZOE7RIED.js +37 -0
  4. package/dist/api-reference.d.ts +3 -1
  5. package/dist/app.js +5516 -5422
  6. package/dist/build/copy-build-content.d.ts +1 -1
  7. package/dist/build/virtual-config.d.ts +2 -2
  8. package/dist/chat/agent-dispatch/context.d.ts +2 -3
  9. package/dist/chat/agent-dispatch/runner.d.ts +2 -0
  10. package/dist/chat/agent-dispatch/types.d.ts +2 -1
  11. package/dist/chat/config.d.ts +3 -0
  12. package/dist/chat/credentials/state-adapter-token-store.d.ts +2 -0
  13. package/dist/chat/credentials/subject.d.ts +3 -3
  14. package/dist/chat/credentials/user-token-store.d.ts +17 -12
  15. package/dist/chat/db.d.ts +8 -0
  16. package/dist/chat/mcp/auth-store.d.ts +2 -1
  17. package/dist/chat/mcp/oauth.d.ts +2 -1
  18. package/dist/chat/oauth-flow.d.ts +3 -1
  19. package/dist/chat/pi/client.d.ts +15 -7
  20. package/dist/chat/plugins/agent-hooks.d.ts +20 -13
  21. package/dist/chat/plugins/auth/oauth-request.d.ts +11 -7
  22. package/dist/chat/plugins/credential-hooks.d.ts +6 -6
  23. package/dist/chat/plugins/logging.d.ts +2 -2
  24. package/dist/chat/plugins/model.d.ts +9 -0
  25. package/dist/chat/plugins/package-discovery.d.ts +2 -1
  26. package/dist/chat/plugins/prompt.d.ts +5 -0
  27. package/dist/chat/plugins/registry.d.ts +4 -0
  28. package/dist/chat/plugins/state.d.ts +3 -5
  29. package/dist/chat/plugins/task-callback.d.ts +5 -0
  30. package/dist/chat/plugins/task-message.d.ts +23 -0
  31. package/dist/chat/plugins/task-queue.d.ts +5 -0
  32. package/dist/chat/plugins/task-runner.d.ts +12 -0
  33. package/dist/chat/plugins/task-signing.d.ts +31 -0
  34. package/dist/chat/plugins/types.d.ts +1 -0
  35. package/dist/chat/plugins/validation.d.ts +5 -0
  36. package/dist/chat/prompt.d.ts +15 -1
  37. package/dist/chat/requester.d.ts +6 -5
  38. package/dist/chat/respond-helpers.d.ts +2 -0
  39. package/dist/chat/respond.d.ts +13 -2
  40. package/dist/chat/runtime/agent-continue-runner.d.ts +4 -0
  41. package/dist/chat/runtime/reply-executor.d.ts +5 -1
  42. package/dist/chat/runtime/slack-resume.d.ts +10 -2
  43. package/dist/chat/runtime/slack-runtime.d.ts +6 -1
  44. package/dist/chat/sandbox/egress-credentials.d.ts +8 -8
  45. package/dist/chat/sandbox/sandbox.d.ts +2 -2
  46. package/dist/chat/sentry.d.ts +1 -0
  47. package/dist/chat/services/mcp-auth-orchestration.d.ts +2 -1
  48. package/dist/chat/services/plugin-auth-orchestration.d.ts +2 -1
  49. package/dist/chat/services/subscribed-decision.d.ts +2 -2
  50. package/dist/chat/services/turn-session-record.d.ts +11 -7
  51. package/dist/chat/sql/db.d.ts +3 -0
  52. package/dist/chat/sql/executor.d.ts +7 -0
  53. package/dist/chat/sql/neon.d.ts +2 -4
  54. package/dist/chat/sql/postgres.d.ts +6 -0
  55. package/dist/chat/state/turn-session.d.ts +8 -5
  56. package/dist/chat/task-execution/state.d.ts +7 -2
  57. package/dist/chat/task-execution/worker.d.ts +1 -1
  58. package/dist/chat/tools/agent-tools.d.ts +9 -2
  59. package/dist/chat/tools/slack/context.d.ts +2 -2
  60. package/dist/chat/tools/types.d.ts +7 -4
  61. package/dist/chat/vercel-queue-client.d.ts +3 -0
  62. package/dist/{chunk-YOHFWWBV.js → chunk-2ECJXSVQ.js} +5 -107
  63. package/dist/{chunk-OR6NQJ5E.js → chunk-4SCWV7TJ.js} +3 -3
  64. package/dist/chunk-4UO6FK4G.js +64 -0
  65. package/dist/chunk-56TBVRJG.js +115 -0
  66. package/dist/{chunk-3BYAPS6B.js → chunk-EJN6G5A2.js} +17 -11
  67. package/dist/{chunk-SQGMG7OD.js → chunk-HHDUKWVG.js} +508 -149
  68. package/dist/{chunk-6UP2Z2RZ.js → chunk-JBASI5VV.js} +7 -7
  69. package/dist/chunk-KNFROR7R.js +127 -0
  70. package/dist/{chunk-HYHKTFG2.js → chunk-KOIMO7S3.js} +186 -910
  71. package/dist/chunk-MLKGABMK.js +9 -0
  72. package/dist/chunk-NFTMTIP3.js +964 -0
  73. package/dist/chunk-NYKJ3KON.js +1082 -0
  74. package/dist/{chunk-SJHUF3DP.js → chunk-OJ53FYVG.js} +2 -10
  75. package/dist/{chunk-KVZL5NZS.js → chunk-Q3XNY442.js} +17 -7
  76. package/dist/{chunk-YRDS7VKO.js → chunk-Q6XFTRV5.js} +2 -2
  77. package/dist/chunk-R6Z5XWY3.js +1076 -0
  78. package/dist/chunk-RV5RYIJW.js +56 -0
  79. package/dist/chunk-SG5WAA7H.js +132 -0
  80. package/dist/chunk-ST6YNAXG.js +54 -0
  81. package/dist/{chunk-GM7HTXYC.js → chunk-T77LUIX3.js} +148 -151
  82. package/dist/{chunk-CYUI7JU5.js → chunk-VALUBQ7R.js} +22 -30
  83. package/dist/chunk-XBBC6W45.js +71 -0
  84. package/dist/chunk-Y2CM7HXH.js +111 -0
  85. package/dist/{chunk-F6HWCPOC.js → chunk-Y5OFBCBZ.js} +1 -1
  86. package/dist/{chunk-M4FLLXXD.js → chunk-Z4CIQ3EB.js} +5 -1
  87. package/dist/{chunk-7Q5YOUUT.js → chunk-ZLMBNBUG.js} +146 -52
  88. package/dist/{chunk-2LUZA3LY.js → chunk-ZQB37HUX.js} +11 -11
  89. package/dist/cli/chat.js +87 -8
  90. package/dist/cli/check.js +8 -7
  91. package/dist/cli/env.js +4 -53
  92. package/dist/cli/init.js +6 -1
  93. package/dist/cli/main.js +84 -0
  94. package/dist/cli/plugins.js +244 -0
  95. package/dist/cli/run.js +5 -52
  96. package/dist/cli/snapshot-warmup.js +12 -11
  97. package/dist/cli/upgrade.js +385 -26
  98. package/dist/db-7A7PFRGL.js +17 -0
  99. package/dist/deployment.d.ts +1 -0
  100. package/dist/handlers/sandbox-egress-route.d.ts +4 -0
  101. package/dist/handlers/slack-webhook.d.ts +4 -0
  102. package/dist/handlers/webhooks.d.ts +6 -13
  103. package/dist/instrumentation.js +14 -18
  104. package/dist/nitro.d.ts +1 -1
  105. package/dist/nitro.js +67 -101
  106. package/dist/plugin-module.d.ts +21 -0
  107. package/dist/plugins-PZMDS7AT.js +15 -0
  108. package/dist/plugins.d.ts +9 -5
  109. package/dist/registry-OIPAJU2O.js +46 -0
  110. package/dist/reporting/conversations.d.ts +3 -3
  111. package/dist/reporting.d.ts +6 -5
  112. package/dist/reporting.js +42 -28
  113. package/dist/{runner-27NP2TEO.js → runner-KPLNHDCV.js} +77 -19
  114. package/dist/sentry-4CP5NNQ5.js +31 -0
  115. package/dist/validation-SLA6IGF7.js +15 -0
  116. package/dist/vercel.js +1 -1
  117. package/package.json +14 -11
  118. package/dist/chat/conversations/configured.d.ts +0 -5
  119. package/dist/chat/conversations/state.d.ts +0 -4
  120. package/dist/chunk-2KG3PWR4.js +0 -17
  121. package/dist/chunk-JL2SLRAT.js +0 -1970
package/README.md CHANGED
@@ -28,7 +28,7 @@ Run `junior init my-bot` to scaffold a complete project including `vercel.json`
28
28
  Use `defineJuniorPlugins([...])` in a runtime-safe plugin module, then point
29
29
  `juniorNitro({ plugins: "./plugins" })` at that module. `createApp()` reads the
30
30
  same enabled set from Nitro's virtual module. Manifest-only packages use
31
- package-name strings; trusted factories such as `githubPlugin()` register their
31
+ package-name strings; factories such as `githubPlugin()` register their
32
32
  manifest and in-process hooks together.
33
33
 
34
34
  ## Full docs
package/bin/junior.mjs CHANGED
@@ -20,75 +20,13 @@ async function loadCliFunction(moduleName, exportName, unavailableMessage) {
20
20
  return loadedModule[exportName];
21
21
  }
22
22
 
23
- async function loadCliEnvFiles() {
24
- const loadCliEnvFilesFn = await loadCliFunction(
25
- "env",
26
- "loadCliEnvFiles",
27
- "CLI env loader is unavailable; reinstall @sentry/junior and retry.",
28
- );
29
- loadCliEnvFilesFn(process.cwd());
30
- }
31
-
32
- async function runSnapshotCreate() {
33
- const runSnapshotCreateFn = await loadCliFunction(
34
- "snapshot-warmup",
35
- "runSnapshotCreate",
36
- "Snapshot create module is unavailable; reinstall @sentry/junior and retry.",
37
- );
38
- await runSnapshotCreateFn();
39
- }
40
-
41
- async function runInit(dir) {
42
- const runInitFn = await loadCliFunction(
43
- "init",
44
- "runInit",
45
- "Init module is unavailable; reinstall @sentry/junior and retry.",
46
- );
47
- await runInitFn(dir);
48
- }
49
-
50
- async function runCheck(dir) {
51
- const runCheckFn = await loadCliFunction(
52
- "check",
53
- "runCheck",
54
- "Check module is unavailable; reinstall @sentry/junior and retry.",
55
- );
56
- await runCheckFn(dir);
57
- }
58
-
59
- async function runUpgrade() {
60
- const runUpgradeFn = await loadCliFunction(
61
- "upgrade",
62
- "runUpgrade",
63
- "Upgrade module is unavailable; reinstall @sentry/junior and retry.",
64
- );
65
- await runUpgradeFn();
66
- }
67
-
68
- async function runChat(argv) {
69
- const runChatFn = await loadCliFunction(
70
- "chat",
71
- "runChat",
72
- "Chat module is unavailable; reinstall @sentry/junior and retry.",
73
- );
74
- return await runChatFn(argv);
75
- }
76
-
77
23
  async function main() {
78
- await loadCliEnvFiles();
79
- const runCli = await loadCliFunction(
80
- "run",
81
- "runCli",
24
+ const runMain = await loadCliFunction(
25
+ "main",
26
+ "runMain",
82
27
  "CLI dispatcher module is unavailable; reinstall @sentry/junior and retry.",
83
28
  );
84
- const exitCode = await runCli(process.argv.slice(2), {
85
- runChat,
86
- runInit,
87
- runSnapshotCreate,
88
- runCheck,
89
- runUpgrade,
90
- });
91
- process.exit(exitCode);
29
+ await runMain(process.argv.slice(2), { instrument: false });
92
30
  }
93
31
 
94
32
  main().catch((error) => {
@@ -0,0 +1,37 @@
1
+ import {
2
+ PluginHookDeniedError,
3
+ createPluginHookRunner,
4
+ getPluginOperationalReports,
5
+ getPluginRoutes,
6
+ getPluginSlackConversationLink,
7
+ getPluginSystemPromptContributions,
8
+ getPluginTools,
9
+ getPluginUserPromptContributions,
10
+ getPlugins,
11
+ setPlugins,
12
+ validatePlugins
13
+ } from "./chunk-NFTMTIP3.js";
14
+ import "./chunk-56TBVRJG.js";
15
+ import "./chunk-NYKJ3KON.js";
16
+ import "./chunk-G3E7SCME.js";
17
+ import "./chunk-Y5OFBCBZ.js";
18
+ import "./chunk-Q6XFTRV5.js";
19
+ import "./chunk-T77LUIX3.js";
20
+ import "./chunk-VALUBQ7R.js";
21
+ import "./chunk-EJN6G5A2.js";
22
+ import "./chunk-OJ53FYVG.js";
23
+ import "./chunk-ST6YNAXG.js";
24
+ import "./chunk-MLKGABMK.js";
25
+ export {
26
+ PluginHookDeniedError,
27
+ createPluginHookRunner,
28
+ getPluginOperationalReports,
29
+ getPluginRoutes,
30
+ getPluginSlackConversationLink,
31
+ getPluginSystemPromptContributions,
32
+ getPluginTools,
33
+ getPluginUserPromptContributions,
34
+ getPlugins,
35
+ setPlugins,
36
+ validatePlugins
37
+ };
@@ -5,7 +5,9 @@ export { juniorNitro } from "./nitro";
5
5
  export type { JuniorNitroOptions } from "./nitro";
6
6
  export { defineJuniorPlugins } from "./plugins";
7
7
  export type { JuniorPluginInput, JuniorPluginSet, JuniorPluginSetOptions, } from "./plugins";
8
+ export type { PluginRunContext, PluginRunTranscriptEntry, PluginTaskContext, PluginTaskDefinition, PluginTasks, } from "@sentry/junior-plugin-api";
9
+ export { pluginRunContextSchema, pluginRunTranscriptEntrySchema, } from "@sentry/junior-plugin-api";
8
10
  export { createJuniorReporting } from "./reporting";
9
- export type { AgentPluginConversationStatus, AgentPluginConversations, AgentPluginConversationSummary, 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, 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";
10
12
  export { juniorVercelConfig } from "./vercel";
11
13
  export type { JuniorVercelConfigOptions } from "./vercel";