@sentry/junior 0.9.2 → 0.9.4

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.
@@ -1,3 +1,6 @@
1
+ import {
2
+ getProductionBot
3
+ } from "./chunk-FLP5I4NM.js";
1
4
  import {
2
5
  createRequestContext,
3
6
  logException,
@@ -6,17 +9,13 @@ import {
6
9
  setSpanStatus,
7
10
  withContext,
8
11
  withSpan
9
- } from "./chunk-ZW4OVKF5.js";
12
+ } from "./chunk-MY7JNCS2.js";
10
13
 
11
14
  // src/handlers/webhooks.ts
12
15
  import { after } from "next/server";
13
16
  import * as Sentry from "@sentry/nextjs";
14
- async function loadBot() {
15
- const { bot } = await import("./production-H3THODDE.js");
16
- return bot;
17
- }
18
17
  async function POST(request, context) {
19
- const bot = await loadBot();
18
+ const bot = getProductionBot();
20
19
  const { platform } = await context.params;
21
20
  const handler = bot.webhooks[platform];
22
21
  const requestContext = createRequestContext(request, { platform });
@@ -1,15 +1,13 @@
1
1
  import {
2
2
  getPluginCapabilityProviders,
3
3
  getPluginForSkillPath,
4
- getPluginSkillRoots
5
- } from "./chunk-ZBWWHP6Q.js";
4
+ getPluginSkillRoots,
5
+ logInfo,
6
+ logWarn
7
+ } from "./chunk-MY7JNCS2.js";
6
8
  import {
7
9
  skillRoots
8
10
  } from "./chunk-KCLEEKYX.js";
9
- import {
10
- logInfo,
11
- logWarn
12
- } from "./chunk-ZW4OVKF5.js";
13
11
 
14
12
  // src/chat/skills.ts
15
13
  import fs from "fs/promises";
@@ -4,14 +4,14 @@ import {
4
4
  coerceThreadConversationState,
5
5
  createQueueCallbackHandler,
6
6
  downloadPrivateSlackFile,
7
+ getProductionSlackRuntime,
7
8
  getThreadMessageTopic,
8
- removeReactionFromMessage,
9
- slackRuntime
10
- } from "./chunk-OPT4JB73.js";
9
+ removeReactionFromMessage
10
+ } from "./chunk-FLP5I4NM.js";
11
11
  import {
12
12
  getConnectedStateContext,
13
13
  getStateAdapter
14
- } from "./chunk-7DAWPSTI.js";
14
+ } from "./chunk-FS5Y4CF2.js";
15
15
  import {
16
16
  createRequestContext,
17
17
  logError,
@@ -21,7 +21,7 @@ import {
21
21
  setSpanStatus,
22
22
  withContext,
23
23
  withSpan
24
- } from "./chunk-ZW4OVKF5.js";
24
+ } from "./chunk-MY7JNCS2.js";
25
25
 
26
26
  // src/chat/queue/process-thread-message.ts
27
27
  import { Message, ThreadImpl } from "chat";
@@ -598,9 +598,16 @@ function createThreadMessageDispatcher(options) {
598
598
  }
599
599
 
600
600
  // src/handlers/queue-callback.ts
601
- var dispatch = createThreadMessageDispatcher({
602
- runtime: slackRuntime
603
- });
601
+ var productionThreadDispatch;
602
+ function getProductionDispatch() {
603
+ if (!productionThreadDispatch) {
604
+ productionThreadDispatch = createThreadMessageDispatcher({
605
+ runtime: getProductionSlackRuntime()
606
+ });
607
+ }
608
+ return productionThreadDispatch;
609
+ }
610
+ var dispatch = (args) => getProductionDispatch()(args);
604
611
  var callbackHandler = createQueueCallbackHandler(
605
612
  async (message, metadata) => {
606
613
  if (metadata.topicName === getThreadMessageTopic()) {
package/dist/cli/check.js CHANGED
@@ -1,11 +1,10 @@
1
1
  import {
2
2
  parseSkillFile
3
- } from "../chunk-VM3CPAZF.js";
3
+ } from "../chunk-WM66QDLA.js";
4
4
  import {
5
5
  parsePluginManifest
6
- } from "../chunk-ZBWWHP6Q.js";
6
+ } from "../chunk-MY7JNCS2.js";
7
7
  import "../chunk-KCLEEKYX.js";
8
- import "../chunk-ZW4OVKF5.js";
9
8
 
10
9
  // src/cli/check.ts
11
10
  import fs from "fs/promises";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Load CLI env files from the nearest package root and workspace root so
3
+ * `pnpm exec junior ...` sees the same credentials as local repo scripts.
4
+ */
5
+ declare function loadCliEnvFiles(cwd?: string): void;
6
+
7
+ export { loadCliEnvFiles };
@@ -0,0 +1,54 @@
1
+ // src/cli/env.ts
2
+ import fs from "fs";
3
+ import path from "path";
4
+ function envFileNames(nodeEnv) {
5
+ return [
6
+ `.env.${nodeEnv}.local`,
7
+ ...nodeEnv === "test" ? [] : [".env.local"],
8
+ `.env.${nodeEnv}`,
9
+ ".env"
10
+ ];
11
+ }
12
+ function hasEnvRootMarker(dir) {
13
+ return fs.existsSync(path.join(dir, "package.json")) || fs.existsSync(path.join(dir, "pnpm-workspace.yaml"));
14
+ }
15
+ function resolveCliEnvRoots(cwd) {
16
+ const roots = [];
17
+ const seen = /* @__PURE__ */ new Set();
18
+ const addRoot = (candidate) => {
19
+ const resolved = path.resolve(candidate);
20
+ if (seen.has(resolved)) {
21
+ return;
22
+ }
23
+ seen.add(resolved);
24
+ roots.push(resolved);
25
+ };
26
+ let current = path.resolve(cwd);
27
+ addRoot(current);
28
+ while (true) {
29
+ if (hasEnvRootMarker(current)) {
30
+ addRoot(current);
31
+ }
32
+ const parent = path.dirname(current);
33
+ if (parent === current) {
34
+ break;
35
+ }
36
+ current = parent;
37
+ }
38
+ return roots;
39
+ }
40
+ function loadCliEnvFiles(cwd = process.cwd()) {
41
+ const nodeEnv = process.env.NODE_ENV ?? "development";
42
+ for (const root of resolveCliEnvRoots(cwd)) {
43
+ for (const envFile of envFileNames(nodeEnv)) {
44
+ const absolutePath = path.join(root, envFile);
45
+ if (!fs.existsSync(absolutePath)) {
46
+ continue;
47
+ }
48
+ process.loadEnvFile(absolutePath);
49
+ }
50
+ }
51
+ }
52
+ export {
53
+ loadCliEnvFiles
54
+ };
@@ -1,14 +1,13 @@
1
1
  import {
2
2
  disconnectStateAdapter,
3
3
  resolveRuntimeDependencySnapshot
4
- } from "../chunk-7DAWPSTI.js";
4
+ } from "../chunk-FS5Y4CF2.js";
5
5
  import {
6
6
  getPluginProviders,
7
7
  getPluginRuntimeDependencies,
8
8
  getPluginRuntimePostinstall
9
- } from "../chunk-ZBWWHP6Q.js";
9
+ } from "../chunk-MY7JNCS2.js";
10
10
  import "../chunk-KCLEEKYX.js";
11
- import "../chunk-ZW4OVKF5.js";
12
11
 
13
12
  // src/cli/snapshot-warmup.ts
14
13
  var DEFAULT_RUNTIME = "node22";
@@ -1,12 +1,11 @@
1
1
  import {
2
2
  POST
3
- } from "../chunk-KZWHD5KH.js";
4
- import "../chunk-OPT4JB73.js";
5
- import "../chunk-VM3CPAZF.js";
6
- import "../chunk-7DAWPSTI.js";
7
- import "../chunk-ZBWWHP6Q.js";
3
+ } from "../chunk-YGERYE7Y.js";
4
+ import "../chunk-FLP5I4NM.js";
5
+ import "../chunk-FS5Y4CF2.js";
6
+ import "../chunk-WM66QDLA.js";
7
+ import "../chunk-MY7JNCS2.js";
8
8
  import "../chunk-KCLEEKYX.js";
9
- import "../chunk-ZW4OVKF5.js";
10
9
  export {
11
10
  POST
12
11
  };
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  POST as POST2
3
- } from "../chunk-D4ULS2MW.js";
3
+ } from "../chunk-SO4ORZJR.js";
4
4
  import {
5
5
  POST
6
- } from "../chunk-KZWHD5KH.js";
6
+ } from "../chunk-YGERYE7Y.js";
7
7
  import {
8
8
  buildConversationContext,
9
9
  buildSlackOutputMessage,
@@ -31,26 +31,24 @@ import {
31
31
  updateConversationStats,
32
32
  uploadFilesToThread,
33
33
  upsertConversationMessage
34
- } from "../chunk-OPT4JB73.js";
35
- import {
36
- GET
37
- } from "../chunk-4RBEYCOG.js";
38
- import "../chunk-VM3CPAZF.js";
34
+ } from "../chunk-FLP5I4NM.js";
39
35
  import {
40
36
  botConfig,
41
37
  getStateAdapter
42
- } from "../chunk-7DAWPSTI.js";
38
+ } from "../chunk-FS5Y4CF2.js";
39
+ import {
40
+ GET
41
+ } from "../chunk-4RBEYCOG.js";
42
+ import "../chunk-WM66QDLA.js";
43
43
  import {
44
44
  buildOAuthTokenRequest,
45
45
  getPluginOAuthConfig,
46
- parseOAuthTokenResponse
47
- } from "../chunk-ZBWWHP6Q.js";
48
- import "../chunk-KCLEEKYX.js";
49
- import {
50
46
  logException,
51
47
  logInfo,
52
- logWarn
53
- } from "../chunk-ZW4OVKF5.js";
48
+ logWarn,
49
+ parseOAuthTokenResponse
50
+ } from "../chunk-MY7JNCS2.js";
51
+ import "../chunk-KCLEEKYX.js";
54
52
 
55
53
  // src/handlers/mcp-oauth-callback.ts
56
54
  import { Buffer } from "buffer";
@@ -1,7 +1,11 @@
1
1
  import {
2
2
  POST
3
- } from "../chunk-D4ULS2MW.js";
4
- import "../chunk-ZW4OVKF5.js";
3
+ } from "../chunk-SO4ORZJR.js";
4
+ import "../chunk-FLP5I4NM.js";
5
+ import "../chunk-FS5Y4CF2.js";
6
+ import "../chunk-WM66QDLA.js";
7
+ import "../chunk-MY7JNCS2.js";
8
+ import "../chunk-KCLEEKYX.js";
5
9
  export {
6
10
  POST
7
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"