@sentry/junior 0.162.0 → 0.163.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 (90) hide show
  1. package/README.md +2 -0
  2. package/dist/{agent-hooks-TL2SGC5W.js → agent-hooks-6IX5CV7G.js} +10 -10
  3. package/dist/api/acp/route.d.ts +13 -0
  4. package/dist/api.js +204 -403
  5. package/dist/app.d.ts +2 -2
  6. package/dist/app.js +480 -38
  7. package/dist/{catalog-runtime-IGSMIADJ.js → catalog-runtime-NEPZNTOM.js} +5 -5
  8. package/dist/chat/agent/sandbox.d.ts +4 -0
  9. package/dist/chat/api-turns/cancellation.d.ts +27 -0
  10. package/dist/chat/api-turns/routing.d.ts +31 -0
  11. package/dist/chat/api-turns/work.d.ts +12 -29
  12. package/dist/chat/app/conversation-work.d.ts +6 -1
  13. package/dist/chat/app/production.d.ts +2 -2
  14. package/dist/chat/conversations/history.d.ts +3 -0
  15. package/dist/chat/conversations/turn-lifecycle.d.ts +1 -1
  16. package/dist/chat/experimental.d.ts +1 -1
  17. package/dist/chat/plugins/agent-hooks.d.ts +4 -0
  18. package/dist/chat/repository-instructions.d.ts +1 -1
  19. package/dist/chat/sandbox/paths.d.ts +1 -0
  20. package/dist/chat/sandbox/prepare-workspace.d.ts +11 -0
  21. package/dist/chat/sandbox/ref.d.ts +1 -0
  22. package/dist/chat/sandbox/sandbox.d.ts +4 -0
  23. package/dist/chat/sandbox/session.d.ts +4 -0
  24. package/dist/chat/sandbox/snapshot/profile.d.ts +4 -3
  25. package/dist/chat/sandbox/snapshot/resolve.d.ts +4 -0
  26. package/dist/chat/sandbox/workspace.d.ts +4 -0
  27. package/dist/chat/tools/types.d.ts +5 -0
  28. package/dist/chat/workspaces/checkout-path.d.ts +4 -0
  29. package/dist/chat/workspaces/store.d.ts +8 -0
  30. package/dist/chat/workspaces/tools.d.ts +4 -0
  31. package/dist/chat/workspaces/types.d.ts +13 -0
  32. package/dist/{chunk-BPZQWAZJ.js → chunk-2FBPN2Y4.js} +4 -1
  33. package/dist/{chunk-H2KW7AZC.js → chunk-2HBJQEBE.js} +1 -1
  34. package/dist/{chunk-O6P7DZ6O.js → chunk-3OZNFCPR.js} +6 -6
  35. package/dist/{chunk-7DTPFFQX.js → chunk-3T7RJVDJ.js} +1 -1
  36. package/dist/{chunk-FEWT5KPP.js → chunk-4P2XNVTO.js} +2 -2
  37. package/dist/{chunk-CZ6EHOU5.js → chunk-ATWHPSMF.js} +40 -2
  38. package/dist/{chunk-MMBMDSRK.js → chunk-BLZUFHM7.js} +1 -1
  39. package/dist/chunk-BVREIWBD.js +131 -0
  40. package/dist/{chunk-OPNJRQDP.js → chunk-EKGJVUVS.js} +9 -6
  41. package/dist/{chunk-4WYGQ47U.js → chunk-FEIHINKR.js} +5 -5
  42. package/dist/{chunk-JJ3VXFDI.js → chunk-GCLHNRMU.js} +1 -1
  43. package/dist/{chunk-WHAJ3QVY.js → chunk-ICJ3KCA2.js} +1 -1
  44. package/dist/{chunk-5NEBOHRG.js → chunk-IIT23D3M.js} +4 -4
  45. package/dist/{chunk-EHQLTK3X.js → chunk-IX4XI42N.js} +376 -128
  46. package/dist/{chunk-DDQ43S5Q.js → chunk-JI5EPI3O.js} +4 -4
  47. package/dist/{chunk-C3KUKA27.js → chunk-KD3ROG6P.js} +17 -17
  48. package/dist/{chunk-JRVURR3H.js → chunk-MWVQ35U6.js} +543 -164
  49. package/dist/{chunk-V7QL4QMW.js → chunk-MXFL7LNZ.js} +12 -7
  50. package/dist/{chunk-RDV4BQRZ.js → chunk-NL53P7PS.js} +1 -1
  51. package/dist/{chunk-EBEHJPFF.js → chunk-O4IK4O7C.js} +1 -1
  52. package/dist/{chunk-KQSO4DJ4.js → chunk-O5ZZL7IR.js} +9 -9
  53. package/dist/{chunk-FESUWAYU.js → chunk-RK7KPI6G.js} +1 -1
  54. package/dist/{chunk-OBFRMQBY.js → chunk-RTPJRLOP.js} +9 -9
  55. package/dist/{chunk-HW4BW3PC.js → chunk-SR6WRBJW.js} +4 -4
  56. package/dist/{chunk-6BJFIWEV.js → chunk-THS4CKN4.js} +46 -87
  57. package/dist/{chunk-DZC3F2UI.js → chunk-TPDNZCZU.js} +1 -1
  58. package/dist/{chunk-Y75ZDQB5.js → chunk-TPT6EF7K.js} +1 -1
  59. package/dist/{chunk-5IDFPCON.js → chunk-VRS6WDK5.js} +1 -1
  60. package/dist/{chunk-AJ7J2HWY.js → chunk-WPGYWDJR.js} +6 -6
  61. package/dist/{chunk-K7IV6UV3.js → chunk-XY2IVIAY.js} +5 -5
  62. package/dist/{chunk-MNCEGXEH.js → chunk-YAUQXZVT.js} +2 -2
  63. package/dist/{chunk-THXMSSFZ.js → chunk-ZDKTZG3G.js} +1 -1
  64. package/dist/{chunk-QHCIZLIX.js → chunk-ZF6IC27P.js} +87 -10
  65. package/dist/cli/chat.js +32 -32
  66. package/dist/cli/check.js +6 -6
  67. package/dist/cli/plugins.js +13 -13
  68. package/dist/cli/snapshot-create.js +10 -10
  69. package/dist/cli/upgrade.js +7 -7
  70. package/dist/db/schema/workspaces.d.ts +169 -0
  71. package/dist/db/schema.d.ts +169 -1
  72. package/dist/{db-66XZ4HHQ.js → db-6VBMHVW2.js} +7 -7
  73. package/dist/{experimental-HH6OM6UH.js → experimental-XVDOSRBS.js} +1 -1
  74. package/dist/instrumentation.js +4 -4
  75. package/dist/nitro.js +2 -2
  76. package/dist/{oauth-callback-server-FMLKDUUF.js → oauth-callback-server-5NCCUIM2.js} +24 -24
  77. package/dist/{runner-YZONUMNY.js → runner-6ONEB6TQ.js} +13 -13
  78. package/dist/{skills-3UDJJXSO.js → skills-Y5R36UH4.js} +6 -6
  79. package/dist/spawn-RFMBQ6B3.js +37 -0
  80. package/dist/{validation-3HTDBONC.js → validation-HLHEQDEK.js} +6 -6
  81. package/dist/version.js +1 -1
  82. package/dist/{work-O4YTIS54.js → work-VIEFYTFG.js} +18 -18
  83. package/dist/worker-MRSKPKQZ.js +24 -0
  84. package/migrations/0029_dizzy_barracuda.sql +19 -0
  85. package/migrations/meta/0029_snapshot.json +2709 -0
  86. package/migrations/meta/_journal.json +8 -1
  87. package/package.json +8 -5
  88. package/dist/chunk-EM225ITJ.js +0 -56
  89. package/dist/spawn-TBPVA5S2.js +0 -37
  90. package/dist/worker-WHURUEYX.js +0 -24
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FUNCTION_TIMEOUT_BUFFER_SECONDS,
3
3
  getChatConfig
4
- } from "./chunk-MNCEGXEH.js";
4
+ } from "./chunk-YAUQXZVT.js";
5
5
 
6
6
  // src/chat/runtime/request-deadline.ts
7
7
  import { AsyncLocalStorage } from "async_hooks";
@@ -0,0 +1,131 @@
1
+ // src/chat/sandbox/paths.ts
2
+ function normalizeWorkspaceRoot(input) {
3
+ const candidate = (input ?? "").trim();
4
+ if (!candidate) {
5
+ return "/vercel/sandbox";
6
+ }
7
+ const normalized = candidate.replace(/\/+$/, "");
8
+ return normalized.startsWith("/") ? normalized : `/${normalized}`;
9
+ }
10
+ var SANDBOX_WORKSPACE_ROOT = normalizeWorkspaceRoot(
11
+ process.env.VERCEL_SANDBOX_WORKSPACE_DIR
12
+ );
13
+ var SANDBOX_REPOS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/repos`;
14
+ var SANDBOX_SKILLS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/skills`;
15
+ var SANDBOX_DATA_ROOT = `${SANDBOX_WORKSPACE_ROOT}/data`;
16
+ function sandboxSkillDir(skillName) {
17
+ return `${SANDBOX_SKILLS_ROOT}/${skillName}`;
18
+ }
19
+ function sandboxSkillFile(skillName) {
20
+ return `${sandboxSkillDir(skillName)}/SKILL.md`;
21
+ }
22
+ function sandboxSkillPathResolution(skillName) {
23
+ const skillDir = sandboxSkillDir(skillName);
24
+ return `Resolve relative paths in this skill against ${skillDir}. For bash commands from this skill, cd to ${skillDir} first or use absolute paths.`;
25
+ }
26
+
27
+ // src/chat/sandbox/noninteractive-command.ts
28
+ var NON_INTERACTIVE_ENV = {
29
+ CI: "1",
30
+ TERM: "dumb",
31
+ NO_COLOR: "1",
32
+ PAGER: "cat",
33
+ GIT_PAGER: "cat",
34
+ GH_PROMPT_DISABLED: "1",
35
+ GH_NO_UPDATE_NOTIFIER: "1",
36
+ GH_NO_EXTENSION_UPDATE_NOTIFIER: "1",
37
+ GH_SPINNER_DISABLED: "1",
38
+ GIT_TERMINAL_PROMPT: "0",
39
+ GCM_INTERACTIVE: "never",
40
+ DEBIAN_FRONTEND: "noninteractive",
41
+ // Git credential isolation: prevent git from sending its own auth so the
42
+ // sandbox egress proxy's header transforms are the sole credential source.
43
+ GIT_ASKPASS: "/bin/true",
44
+ GIT_CONFIG_NOSYSTEM: "1",
45
+ GIT_CONFIG_COUNT: "2",
46
+ GIT_CONFIG_KEY_0: "credential.helper",
47
+ GIT_CONFIG_VALUE_0: "",
48
+ GIT_CONFIG_KEY_1: "http.emptyAuth",
49
+ GIT_CONFIG_VALUE_1: "true"
50
+ };
51
+ function shellQuote(value) {
52
+ return `'${value.replace(/'/g, "'\\''")}'`;
53
+ }
54
+ function buildEnvExports(options) {
55
+ const lines = [];
56
+ if (options.pathPrefix) {
57
+ lines.push(`export PATH="${options.pathPrefix}"`);
58
+ }
59
+ for (const [key, value] of Object.entries(NON_INTERACTIVE_ENV)) {
60
+ lines.push(`export ${key}=${shellQuote(value)}`);
61
+ }
62
+ for (const [key, value] of Object.entries(options.env ?? {})) {
63
+ lines.push(`export ${key}=${shellQuote(value)}`);
64
+ }
65
+ return lines;
66
+ }
67
+ function buildCommandScript(input) {
68
+ return [shellQuote(input.cmd), ...(input.args ?? []).map(shellQuote)].join(
69
+ " "
70
+ );
71
+ }
72
+ function buildNonInteractiveShellScript(script, options = {}) {
73
+ return [...buildEnvExports(options), "exec </dev/null", script].join(" && ");
74
+ }
75
+ function buildNonInteractiveCommand(input) {
76
+ return {
77
+ cmd: "bash",
78
+ args: [
79
+ input.login ? "-lc" : "-c",
80
+ buildNonInteractiveShellScript(buildCommandScript(input), {
81
+ env: input.env,
82
+ pathPrefix: input.pathPrefix
83
+ })
84
+ ]
85
+ };
86
+ }
87
+ async function runNonInteractiveCommand(sandbox, input) {
88
+ const command = {
89
+ ...buildNonInteractiveCommand(input),
90
+ ...input.cwd ? { cwd: input.cwd } : {},
91
+ ...input.signal ? { signal: input.signal } : {},
92
+ ...input.sudo !== void 0 ? { sudo: input.sudo } : {}
93
+ };
94
+ return await sandbox.runCommand(command);
95
+ }
96
+
97
+ // src/chat/sleep.ts
98
+ function sleep(ms, signal) {
99
+ if (!signal) {
100
+ return new Promise((resolve) => setTimeout(resolve, ms));
101
+ }
102
+ return new Promise((resolve, reject) => {
103
+ if (signal.aborted) {
104
+ reject(signal.reason);
105
+ return;
106
+ }
107
+ const timeoutId = setTimeout(() => {
108
+ signal.removeEventListener("abort", onAbort);
109
+ resolve();
110
+ }, ms);
111
+ const onAbort = () => {
112
+ clearTimeout(timeoutId);
113
+ reject(signal.reason);
114
+ };
115
+ signal.addEventListener("abort", onAbort, { once: true });
116
+ });
117
+ }
118
+
119
+ export {
120
+ SANDBOX_WORKSPACE_ROOT,
121
+ SANDBOX_REPOS_ROOT,
122
+ SANDBOX_SKILLS_ROOT,
123
+ SANDBOX_DATA_ROOT,
124
+ sandboxSkillDir,
125
+ sandboxSkillFile,
126
+ sandboxSkillPathResolution,
127
+ sleep,
128
+ buildCommandScript,
129
+ buildNonInteractiveShellScript,
130
+ runNonInteractiveCommand
131
+ };
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  persistConversationMessages
3
- } from "./chunk-V7QL4QMW.js";
3
+ } from "./chunk-MXFL7LNZ.js";
4
4
  import {
5
5
  JUNIOR_THREAD_STATE_TTL_MS
6
6
  } from "./chunk-3Y47VMHV.js";
7
7
  import {
8
8
  getDb
9
- } from "./chunk-DDQ43S5Q.js";
9
+ } from "./chunk-JI5EPI3O.js";
10
10
  import {
11
11
  juniorLocationConfigurations
12
- } from "./chunk-CZ6EHOU5.js";
12
+ } from "./chunk-ATWHPSMF.js";
13
13
  import {
14
14
  getStateAdapter
15
- } from "./chunk-DZC3F2UI.js";
15
+ } from "./chunk-TPDNZCZU.js";
16
16
  import {
17
17
  juniorDestinations
18
18
  } from "./chunk-VFUK3X5B.js";
@@ -20,7 +20,7 @@ import {
20
20
  isRecord,
21
21
  toOptionalNumber,
22
22
  toOptionalString
23
- } from "./chunk-Y75ZDQB5.js";
23
+ } from "./chunk-TPT6EF7K.js";
24
24
 
25
25
  // src/chat/conversations/turn-lifecycle.ts
26
26
  var ConversationTurnLifecycleService = class {
@@ -468,6 +468,7 @@ function buildThreadStatePayload(patch) {
468
468
  if (patch.sandboxRef !== void 0) {
469
469
  payload.app_sandbox_id = patch.sandboxRef?.id ?? "";
470
470
  payload.app_sandbox_dependency_profile_hash = patch.sandboxRef?.profileHash ?? "";
471
+ payload.app_sandbox_workspace_id = patch.sandboxRef?.workspaceId ?? "";
471
472
  }
472
473
  return payload;
473
474
  }
@@ -492,9 +493,11 @@ function getPersistedSandboxState(state) {
492
493
  const profileHash = toOptionalString(
493
494
  state.app_sandbox_dependency_profile_hash
494
495
  );
496
+ const workspaceId = toOptionalString(state.app_sandbox_workspace_id);
495
497
  return {
496
498
  id,
497
- ...profileHash ? { profileHash } : {}
499
+ ...profileHash ? { profileHash } : {},
500
+ ...workspaceId ? { workspaceId } : {}
498
501
  };
499
502
  }
500
503
  async function persistThreadState(thread, patch) {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ToolInputError
3
- } from "./chunk-V7QL4QMW.js";
3
+ } from "./chunk-MXFL7LNZ.js";
4
4
  import {
5
5
  canRouteResourceEvents,
6
6
  getPlugins
7
- } from "./chunk-QHCIZLIX.js";
7
+ } from "./chunk-ZF6IC27P.js";
8
8
  import {
9
9
  getDb
10
- } from "./chunk-DDQ43S5Q.js";
10
+ } from "./chunk-JI5EPI3O.js";
11
11
  import {
12
12
  juniorAttachments,
13
13
  juniorConversations,
@@ -15,13 +15,13 @@ import {
15
15
  juniorSchedulerRuns,
16
16
  juniorSchedulerTasks,
17
17
  juniorStats
18
- } from "./chunk-CZ6EHOU5.js";
18
+ } from "./chunk-ATWHPSMF.js";
19
19
  import {
20
20
  juniorDestinations
21
21
  } from "./chunk-VFUK3X5B.js";
22
22
  import {
23
23
  logInfo
24
- } from "./chunk-Y75ZDQB5.js";
24
+ } from "./chunk-TPT6EF7K.js";
25
25
 
26
26
  // src/chat/event-tasks/store.ts
27
27
  import { and, asc, desc, eq, inArray, or, sql } from "drizzle-orm";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-FESUWAYU.js";
3
+ } from "./chunk-RK7KPI6G.js";
4
4
 
5
5
  // src/chat/plugins/validation.ts
6
6
  import { isDeepStrictEqual } from "util";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-V7YE4WCP.js";
6
6
  import {
7
7
  toOptionalString
8
- } from "./chunk-Y75ZDQB5.js";
8
+ } from "./chunk-TPT6EF7K.js";
9
9
 
10
10
  // src/chat/slack/context.ts
11
11
  import { z } from "zod";
@@ -8,14 +8,14 @@ import {
8
8
  getConversationStore,
9
9
  parseDestination,
10
10
  sameDestination
11
- } from "./chunk-DDQ43S5Q.js";
11
+ } from "./chunk-JI5EPI3O.js";
12
12
  import {
13
13
  getDefaultRedisStateAdapterFor,
14
14
  getStateAdapter
15
- } from "./chunk-DZC3F2UI.js";
15
+ } from "./chunk-TPDNZCZU.js";
16
16
  import {
17
17
  getChatConfig
18
- } from "./chunk-MNCEGXEH.js";
18
+ } from "./chunk-YAUQXZVT.js";
19
19
  import {
20
20
  parseStoredSlackActor
21
21
  } from "./chunk-V7YE4WCP.js";
@@ -23,7 +23,7 @@ import {
23
23
  isRecord,
24
24
  toOptionalNumber,
25
25
  toOptionalString
26
- } from "./chunk-Y75ZDQB5.js";
26
+ } from "./chunk-TPT6EF7K.js";
27
27
 
28
28
  // src/chat/task-execution/state.ts
29
29
  import { randomUUID } from "crypto";