@sentry/junior 0.9.0 → 0.9.2

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.
package/bin/junior.mjs CHANGED
@@ -6,14 +6,20 @@ import { fileURLToPath, pathToFileURL } from "node:url";
6
6
 
7
7
  const { positionals } = parseArgs({
8
8
  allowPositionals: true,
9
- strict: false
9
+ strict: false,
10
10
  });
11
11
 
12
12
  const command = positionals[0];
13
13
 
14
14
  async function loadCliFunction(moduleName, exportName, unavailableMessage) {
15
15
  const currentFile = fileURLToPath(import.meta.url);
16
- const modulePath = path.join(path.dirname(currentFile), "..", "dist", "cli", `${moduleName}.js`);
16
+ const modulePath = path.join(
17
+ path.dirname(currentFile),
18
+ "..",
19
+ "dist",
20
+ "cli",
21
+ `${moduleName}.js`,
22
+ );
17
23
  const moduleUrl = pathToFileURL(modulePath).href;
18
24
  const loadedModule = await import(moduleUrl);
19
25
  if (typeof loadedModule[exportName] !== "function") {
@@ -22,17 +28,30 @@ async function loadCliFunction(moduleName, exportName, unavailableMessage) {
22
28
  return loadedModule[exportName];
23
29
  }
24
30
 
31
+ async function loadCliEnvFiles() {
32
+ const loadCliEnvFilesFn = await loadCliFunction(
33
+ "env",
34
+ "loadCliEnvFiles",
35
+ "CLI env loader is unavailable; reinstall @sentry/junior and retry.",
36
+ );
37
+ loadCliEnvFilesFn(process.cwd());
38
+ }
39
+
25
40
  async function runSnapshotCreate() {
26
41
  const runSnapshotCreateFn = await loadCliFunction(
27
42
  "snapshot-warmup",
28
43
  "runSnapshotCreate",
29
- "Snapshot create module is unavailable; reinstall @sentry/junior and retry."
44
+ "Snapshot create module is unavailable; reinstall @sentry/junior and retry.",
30
45
  );
31
46
  await runSnapshotCreateFn();
32
47
  }
33
48
 
34
49
  async function runInit(dir) {
35
- const runInitFn = await loadCliFunction("init", "runInit", "Init module is unavailable; reinstall @sentry/junior and retry.");
50
+ const runInitFn = await loadCliFunction(
51
+ "init",
52
+ "runInit",
53
+ "Init module is unavailable; reinstall @sentry/junior and retry.",
54
+ );
36
55
  await runInitFn(dir);
37
56
  }
38
57
 
@@ -40,21 +59,22 @@ async function runCheck(dir) {
40
59
  const runCheckFn = await loadCliFunction(
41
60
  "check",
42
61
  "runCheck",
43
- "Check module is unavailable; reinstall @sentry/junior and retry."
62
+ "Check module is unavailable; reinstall @sentry/junior and retry.",
44
63
  );
45
64
  await runCheckFn(dir);
46
65
  }
47
66
 
48
67
  async function main() {
68
+ await loadCliEnvFiles();
49
69
  const runCli = await loadCliFunction(
50
70
  "run",
51
71
  "runCli",
52
- "CLI dispatcher module is unavailable; reinstall @sentry/junior and retry."
72
+ "CLI dispatcher module is unavailable; reinstall @sentry/junior and retry.",
53
73
  );
54
74
  const exitCode = await runCli(positionals, {
55
75
  runInit,
56
76
  runSnapshotCreate,
57
- runCheck
77
+ runCheck,
58
78
  });
59
79
  if (exitCode !== 0) {
60
80
  process.exit(exitCode);
@@ -243,23 +243,25 @@ function toOptionalTrimmed2(value) {
243
243
  const trimmed = value.trim();
244
244
  return trimmed.length > 0 ? trimmed : void 0;
245
245
  }
246
+ function isVercelRuntime() {
247
+ return process.env.VERCEL === "1" || Boolean(process.env.VERCEL_ENV) || Boolean(process.env.VERCEL_REGION) || Boolean(process.env.VERCEL_URL);
248
+ }
246
249
  function getVercelSandboxCredentials() {
247
250
  const token = toOptionalTrimmed2(process.env.VERCEL_TOKEN);
248
251
  const teamId = toOptionalTrimmed2(process.env.VERCEL_TEAM_ID);
249
252
  const projectId = toOptionalTrimmed2(process.env.VERCEL_PROJECT_ID);
250
- if (!token && !teamId && !projectId) {
253
+ if (token && teamId && projectId) {
254
+ return { token, teamId, projectId };
255
+ }
256
+ if (toOptionalTrimmed2(process.env.VERCEL_OIDC_TOKEN) || isVercelRuntime()) {
251
257
  return void 0;
252
258
  }
253
- if (!token || !teamId || !projectId) {
259
+ if (token || teamId || projectId) {
254
260
  throw new Error(
255
- "Missing Vercel Sandbox credentials: set VERCEL_TOKEN, VERCEL_TEAM_ID, and VERCEL_PROJECT_ID together."
261
+ "Missing Vercel Sandbox credentials: set VERCEL_TOKEN, VERCEL_TEAM_ID, and VERCEL_PROJECT_ID together, or provide VERCEL_OIDC_TOKEN."
256
262
  );
257
263
  }
258
- return {
259
- token,
260
- teamId,
261
- projectId
262
- };
264
+ return void 0;
263
265
  }
264
266
 
265
267
  // src/chat/sandbox/paths.ts
@@ -12,7 +12,7 @@ import {
12
12
  import { after } from "next/server";
13
13
  import * as Sentry from "@sentry/nextjs";
14
14
  async function loadBot() {
15
- const { bot } = await import("./production-XMCJXOOI.js");
15
+ const { bot } = await import("./production-H3THODDE.js");
16
16
  return bot;
17
17
  }
18
18
  async function POST(request, context) {
@@ -7,11 +7,11 @@ import {
7
7
  getThreadMessageTopic,
8
8
  removeReactionFromMessage,
9
9
  slackRuntime
10
- } from "./chunk-DIMXJUSL.js";
10
+ } from "./chunk-OPT4JB73.js";
11
11
  import {
12
12
  getConnectedStateContext,
13
13
  getStateAdapter
14
- } from "./chunk-IJVZEV3K.js";
14
+ } from "./chunk-7DAWPSTI.js";
15
15
  import {
16
16
  createRequestContext,
17
17
  logError,
@@ -26,7 +26,7 @@ import {
26
26
  resolveRuntimeDependencySnapshot,
27
27
  runNonInteractiveCommand,
28
28
  sandboxSkillDir
29
- } from "./chunk-IJVZEV3K.js";
29
+ } from "./chunk-7DAWPSTI.js";
30
30
  import {
31
31
  CredentialUnavailableError,
32
32
  createPluginBroker,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  disconnectStateAdapter,
3
3
  resolveRuntimeDependencySnapshot
4
- } from "../chunk-IJVZEV3K.js";
4
+ } from "../chunk-7DAWPSTI.js";
5
5
  import {
6
6
  getPluginProviders,
7
7
  getPluginRuntimeDependencies,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  POST
3
- } from "../chunk-4G2LA7RO.js";
4
- import "../chunk-DIMXJUSL.js";
3
+ } from "../chunk-KZWHD5KH.js";
4
+ import "../chunk-OPT4JB73.js";
5
5
  import "../chunk-VM3CPAZF.js";
6
- import "../chunk-IJVZEV3K.js";
6
+ import "../chunk-7DAWPSTI.js";
7
7
  import "../chunk-ZBWWHP6Q.js";
8
8
  import "../chunk-KCLEEKYX.js";
9
9
  import "../chunk-ZW4OVKF5.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  POST as POST2
3
- } from "../chunk-I3DYWLM6.js";
3
+ } from "../chunk-D4ULS2MW.js";
4
4
  import {
5
5
  POST
6
- } from "../chunk-4G2LA7RO.js";
6
+ } from "../chunk-KZWHD5KH.js";
7
7
  import {
8
8
  buildConversationContext,
9
9
  buildSlackOutputMessage,
@@ -31,7 +31,7 @@ import {
31
31
  updateConversationStats,
32
32
  uploadFilesToThread,
33
33
  upsertConversationMessage
34
- } from "../chunk-DIMXJUSL.js";
34
+ } from "../chunk-OPT4JB73.js";
35
35
  import {
36
36
  GET
37
37
  } from "../chunk-4RBEYCOG.js";
@@ -39,7 +39,7 @@ import "../chunk-VM3CPAZF.js";
39
39
  import {
40
40
  botConfig,
41
41
  getStateAdapter
42
- } from "../chunk-IJVZEV3K.js";
42
+ } from "../chunk-7DAWPSTI.js";
43
43
  import {
44
44
  buildOAuthTokenRequest,
45
45
  getPluginOAuthConfig,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  POST
3
- } from "../chunk-I3DYWLM6.js";
3
+ } from "../chunk-D4ULS2MW.js";
4
4
  import "../chunk-ZW4OVKF5.js";
5
5
  export {
6
6
  POST
@@ -2,9 +2,9 @@ import {
2
2
  bot,
3
3
  createNormalizingStream,
4
4
  slackRuntime
5
- } from "./chunk-DIMXJUSL.js";
5
+ } from "./chunk-OPT4JB73.js";
6
6
  import "./chunk-VM3CPAZF.js";
7
- import "./chunk-IJVZEV3K.js";
7
+ import "./chunk-7DAWPSTI.js";
8
8
  import "./chunk-ZBWWHP6Q.js";
9
9
  import "./chunk-KCLEEKYX.js";
10
10
  import "./chunk-ZW4OVKF5.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"