@sentry/junior 0.119.0 → 0.121.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 (52) hide show
  1. package/dist/{agent-hooks-NZSV4QQR.js → agent-hooks-CQDGDBCP.js} +7 -7
  2. package/dist/api.js +58 -79
  3. package/dist/app.js +21 -21
  4. package/dist/build/copy-build-content.d.ts +2 -2
  5. package/dist/{catalog-runtime-TAOYIZIZ.js → catalog-runtime-AD3YNTTM.js} +7 -7
  6. package/dist/chat/discovery.d.ts +2 -0
  7. package/dist/chat/mcp/tool-manager.d.ts +14 -1
  8. package/dist/chat/plugins/types.d.ts +3 -9
  9. package/dist/chat/plugins/user-pages.d.ts +2 -1
  10. package/dist/chat/sandbox/noninteractive-command.d.ts +1 -0
  11. package/dist/chat/sandbox/session.d.ts +2 -2
  12. package/dist/chat/sandbox/snapshot/install.d.ts +2 -2
  13. package/dist/chat/sandbox/snapshot/resolve.d.ts +1 -0
  14. package/dist/chat/sandbox/workspace.d.ts +3 -1
  15. package/dist/{chunk-D3N4BPSL.js → chunk-254MFDOF.js} +2 -2
  16. package/dist/{chunk-4UIUDOOV.js → chunk-3DBMANUI.js} +7 -7
  17. package/dist/{chunk-BLQZACHV.js → chunk-7HYV7KFM.js} +92 -6
  18. package/dist/{chunk-JLJLZS2N.js → chunk-D2EMOH3N.js} +4 -3
  19. package/dist/{chunk-R53UT2OI.js → chunk-ET2SDCNV.js} +9 -5
  20. package/dist/chunk-H4HBKISO.js +417 -0
  21. package/dist/{chunk-VLTWQQKH.js → chunk-IDXLBKPS.js} +1 -1
  22. package/dist/{chunk-NUENIPQL.js → chunk-IK4QSS5H.js} +1 -1
  23. package/dist/{chunk-GKFDU3ZI.js → chunk-ITMEXX5H.js} +44 -23
  24. package/dist/{chunk-ZFX4M743.js → chunk-JYDIBXFY.js} +6 -6
  25. package/dist/{chunk-ZJ6IVZVO.js → chunk-JZ47AFSH.js} +1 -1
  26. package/dist/{chunk-YLYJIQRX.js → chunk-KLUMVJRQ.js} +12 -12
  27. package/dist/{chunk-TAGV4Z3J.js → chunk-LE77HHF3.js} +1 -1
  28. package/dist/{chunk-B3IT5END.js → chunk-OOUNJNMR.js} +16 -152
  29. package/dist/{chunk-QZ7XRJDB.js → chunk-TRECK7RV.js} +3 -3
  30. package/dist/{chunk-VJTWKJWQ.js → chunk-UURFXX66.js} +1 -1
  31. package/dist/{chunk-6ZR455DC.js → chunk-UXQ5XSA2.js} +1 -1
  32. package/dist/{chunk-TGIQN7QW.js → chunk-VWBKDPMQ.js} +242 -69
  33. package/dist/{chunk-JSTGI7TX.js → chunk-WUP7NWMP.js} +1 -1
  34. package/dist/{chunk-JXRAOOXQ.js → chunk-XDRGYDED.js} +1 -1
  35. package/dist/{chunk-BNJEPYTC.js → chunk-Z2XXPUZG.js} +4 -4
  36. package/dist/cli/chat.js +23 -23
  37. package/dist/cli/check.js +8 -8
  38. package/dist/cli/plugins.js +12 -12
  39. package/dist/cli/snapshot-create.js +10 -10
  40. package/dist/cli/upgrade.js +7 -7
  41. package/dist/{db-FWGP5CKY.js → db-7HQT2SXQ.js} +5 -5
  42. package/dist/{discovery-RMHYSRL7.js → discovery-GUFTFBTL.js} +3 -1
  43. package/dist/instrumentation.js +2 -2
  44. package/dist/nitro.js +24 -7
  45. package/dist/{oauth-callback-server-PM3QNXJQ.js → oauth-callback-server-VHTUCNHK.js} +16 -16
  46. package/dist/{runner-DV55N6ZB.js → runner-3ONPZRED.js} +9 -9
  47. package/dist/{skills-MANV5ZK6.js → skills-WGAYGGPA.js} +8 -8
  48. package/dist/{validation-QGB4INTI.js → validation-ZIWNBG4D.js} +8 -8
  49. package/dist/version.js +1 -1
  50. package/package.json +8 -7
  51. package/skills/jr-rpc/SKILL.md +40 -0
  52. package/dist/chunk-3V7OFJZC.js +0 -264
@@ -1,264 +0,0 @@
1
- // src/chat/discovery.ts
2
- import fs, { statSync } from "fs";
3
- import path from "path";
4
- import { fileURLToPath } from "url";
5
- function isDirectory(targetPath) {
6
- try {
7
- return statSync(targetPath).isDirectory();
8
- } catch {
9
- return false;
10
- }
11
- }
12
- function isFile(targetPath) {
13
- try {
14
- return statSync(targetPath).isFile();
15
- } catch {
16
- return false;
17
- }
18
- }
19
- function normalizePath(targetPath) {
20
- return path.resolve(targetPath);
21
- }
22
- function uniqueResolvedPathsInOrder(values) {
23
- const seen = /* @__PURE__ */ new Set();
24
- const resolved = [];
25
- for (const value of values) {
26
- const normalized = normalizePath(value);
27
- if (seen.has(normalized)) {
28
- continue;
29
- }
30
- seen.add(normalized);
31
- resolved.push(normalized);
32
- }
33
- return resolved;
34
- }
35
- function isNodeModulesPath(candidatePath) {
36
- return path.basename(candidatePath) === "node_modules";
37
- }
38
- function isInsidePnpmStore(candidatePath) {
39
- return candidatePath.split(path.sep).includes(".pnpm");
40
- }
41
- function runningFromInstalledPackage() {
42
- const currentFile = fileURLToPath(import.meta.url);
43
- const marker = `${path.sep}node_modules${path.sep}@sentry${path.sep}junior${path.sep}`;
44
- return currentFile.includes(marker);
45
- }
46
- function listInstalledPackageNodeModulesDirs() {
47
- if (!runningFromInstalledPackage()) {
48
- return [];
49
- }
50
- const dirs = [];
51
- let current = path.resolve(path.dirname(fileURLToPath(import.meta.url)));
52
- while (true) {
53
- if (isNodeModulesPath(current) && !isInsidePnpmStore(current) && isDirectory(current)) {
54
- dirs.push(current);
55
- }
56
- const parent = path.dirname(current);
57
- if (parent === current) {
58
- break;
59
- }
60
- current = parent;
61
- }
62
- return dirs;
63
- }
64
- function listCwdAncestorNodeModulesDirs(cwd) {
65
- const resolvedCwd = normalizePath(cwd);
66
- const dirs = [];
67
- let current = resolvedCwd;
68
- while (true) {
69
- const nodeModulesDir = path.join(current, "node_modules");
70
- if (isDirectory(nodeModulesDir)) {
71
- dirs.push(nodeModulesDir);
72
- }
73
- if (isFile(path.join(current, "package.json"))) {
74
- break;
75
- }
76
- const parent = path.dirname(current);
77
- if (parent === current) {
78
- break;
79
- }
80
- current = parent;
81
- }
82
- return dirs;
83
- }
84
- function discoverNodeModulesDirs(cwd = process.cwd(), options) {
85
- const explicit = options?.candidateDirs?.filter((dir) => isDirectory(dir)) ?? [];
86
- if (explicit.length > 0) {
87
- return uniqueResolvedPathsInOrder(explicit);
88
- }
89
- return uniqueResolvedPathsInOrder([
90
- ...listInstalledPackageNodeModulesDirs(),
91
- ...listCwdAncestorNodeModulesDirs(cwd)
92
- ]);
93
- }
94
- function discoverProjectRoots(cwd = process.cwd(), options) {
95
- const roots = discoverNodeModulesDirs(
96
- cwd,
97
- options?.nodeModulesDirs ? { candidateDirs: options.nodeModulesDirs } : void 0
98
- ).map((nodeModulesDir) => path.dirname(nodeModulesDir));
99
- return uniqueResolvedPathsInOrder([cwd, ...roots]);
100
- }
101
- function unique(values) {
102
- return [...new Set(values)];
103
- }
104
- function pathExists(targetPath) {
105
- try {
106
- fs.accessSync(targetPath);
107
- return true;
108
- } catch {
109
- return false;
110
- }
111
- }
112
- function hasAnyDataMarkers(appDir) {
113
- return pathExists(path.join(appDir, "SOUL.md")) || pathExists(path.join(appDir, "WORLD.md"));
114
- }
115
- function scoreAppCandidate(appDir) {
116
- let score = 0;
117
- if (pathExists(path.join(appDir, "SOUL.md"))) {
118
- score += 4;
119
- }
120
- if (pathExists(path.join(appDir, "WORLD.md"))) {
121
- score += 2;
122
- }
123
- if (pathExists(path.join(appDir, "skills"))) {
124
- score += 1;
125
- }
126
- if (pathExists(path.join(appDir, "plugins"))) {
127
- score += 1;
128
- }
129
- return score;
130
- }
131
- function resolveCandidateAppDirs(cwd, projectRoots) {
132
- const roots = projectRoots ?? discoverProjectRoots(cwd);
133
- const resolved = [];
134
- const seen = /* @__PURE__ */ new Set();
135
- for (const root of roots) {
136
- const appDir = path.resolve(root, "app");
137
- if (!pathExists(appDir)) {
138
- continue;
139
- }
140
- if (seen.has(appDir)) {
141
- continue;
142
- }
143
- seen.add(appDir);
144
- resolved.push(appDir);
145
- }
146
- return resolved;
147
- }
148
- function homeDir() {
149
- return resolveHomeDir();
150
- }
151
- function resolveHomeDir(cwd = process.cwd(), options) {
152
- const resolvedCwd = path.resolve(cwd);
153
- const directApp = path.resolve(resolvedCwd, "app");
154
- if (pathExists(directApp) && hasAnyDataMarkers(directApp)) {
155
- return directApp;
156
- }
157
- const candidates = resolveCandidateAppDirs(
158
- resolvedCwd,
159
- options?.projectRoots
160
- );
161
- if (candidates.length === 0) {
162
- return directApp;
163
- }
164
- candidates.sort((left, right) => {
165
- const leftScore = scoreAppCandidate(left);
166
- const rightScore = scoreAppCandidate(right);
167
- if (leftScore !== rightScore) {
168
- return rightScore - leftScore;
169
- }
170
- const leftDistance = path.relative(resolvedCwd, left).split(path.sep).length;
171
- const rightDistance = path.relative(resolvedCwd, right).split(path.sep).length;
172
- if (leftDistance !== rightDistance) {
173
- return leftDistance - rightDistance;
174
- }
175
- return left.localeCompare(right);
176
- });
177
- return candidates[0];
178
- }
179
- function resolveContentRoots(subdir) {
180
- if (subdir === "data") {
181
- return [homeDir()];
182
- }
183
- return [path.join(homeDir(), subdir)];
184
- }
185
- function dataDir() {
186
- return resolveContentRoots("data")[0];
187
- }
188
- function soulPath() {
189
- return path.join(dataDir(), "SOUL.md");
190
- }
191
- function worldPath() {
192
- return path.join(dataDir(), "WORLD.md");
193
- }
194
- function descriptionPath() {
195
- return path.join(dataDir(), "DESCRIPTION.md");
196
- }
197
- function skillsDir() {
198
- return resolveContentRoots("skills")[0];
199
- }
200
- function pluginsDir() {
201
- return resolveContentRoots("plugins")[0];
202
- }
203
- function dataRoots() {
204
- return unique(resolveContentRoots("data"));
205
- }
206
- function skillRoots() {
207
- return unique(resolveContentRoots("skills"));
208
- }
209
- function pluginRoots() {
210
- return unique(resolveContentRoots("plugins"));
211
- }
212
- function soulPathCandidates() {
213
- const candidates = dataRoots().map((root) => path.join(root, "SOUL.md"));
214
- return unique(candidates);
215
- }
216
- function worldPathCandidates() {
217
- const candidates = dataRoots().map((root) => path.join(root, "WORLD.md"));
218
- return unique(candidates);
219
- }
220
- function descriptionPathCandidates() {
221
- const candidates = dataRoots().map(
222
- (root) => path.join(root, "DESCRIPTION.md")
223
- );
224
- return unique(candidates);
225
- }
226
- var RESERVED_APP_FILES = /* @__PURE__ */ new Set([
227
- "SOUL.md",
228
- "WORLD.md",
229
- "DESCRIPTION.md",
230
- "ABOUT.md"
231
- ]);
232
- function listReferenceFiles() {
233
- const appDir = homeDir();
234
- try {
235
- const entries = fs.readdirSync(appDir, { withFileTypes: true });
236
- return entries.filter(
237
- (entry) => entry.isFile() && entry.name.endsWith(".md") && !RESERVED_APP_FILES.has(entry.name)
238
- ).map((entry) => path.join(appDir, entry.name)).sort();
239
- } catch {
240
- return [];
241
- }
242
- }
243
-
244
- export {
245
- isDirectory,
246
- isFile,
247
- discoverNodeModulesDirs,
248
- discoverProjectRoots,
249
- homeDir,
250
- resolveHomeDir,
251
- dataDir,
252
- soulPath,
253
- worldPath,
254
- descriptionPath,
255
- skillsDir,
256
- pluginsDir,
257
- dataRoots,
258
- skillRoots,
259
- pluginRoots,
260
- soulPathCandidates,
261
- worldPathCandidates,
262
- descriptionPathCandidates,
263
- listReferenceFiles
264
- };