@sentry/warden 0.13.0 → 0.14.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 (92) hide show
  1. package/agents.lock +7 -0
  2. package/dist/cli/args.d.ts +14 -12
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +44 -1
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/cli/commands/init.d.ts +0 -3
  7. package/dist/cli/commands/init.d.ts.map +1 -1
  8. package/dist/cli/commands/init.js +206 -19
  9. package/dist/cli/commands/init.js.map +1 -1
  10. package/dist/cli/commands/logs.d.ts +19 -0
  11. package/dist/cli/commands/logs.d.ts.map +1 -0
  12. package/dist/cli/commands/logs.js +419 -0
  13. package/dist/cli/commands/logs.js.map +1 -0
  14. package/dist/cli/main.d.ts.map +1 -1
  15. package/dist/cli/main.js +54 -21
  16. package/dist/cli/main.js.map +1 -1
  17. package/dist/cli/output/formatters.d.ts +2 -1
  18. package/dist/cli/output/formatters.d.ts.map +1 -1
  19. package/dist/cli/output/formatters.js +22 -19
  20. package/dist/cli/output/formatters.js.map +1 -1
  21. package/dist/cli/output/index.d.ts +1 -1
  22. package/dist/cli/output/index.d.ts.map +1 -1
  23. package/dist/cli/output/index.js +1 -1
  24. package/dist/cli/output/index.js.map +1 -1
  25. package/dist/cli/output/ink-runner.js +1 -1
  26. package/dist/cli/output/ink-runner.js.map +1 -1
  27. package/dist/cli/output/jsonl.d.ts +49 -13
  28. package/dist/cli/output/jsonl.d.ts.map +1 -1
  29. package/dist/cli/output/jsonl.js +137 -4
  30. package/dist/cli/output/jsonl.js.map +1 -1
  31. package/dist/cli/output/tasks.d.ts.map +1 -1
  32. package/dist/cli/output/tasks.js +1 -22
  33. package/dist/cli/output/tasks.js.map +1 -1
  34. package/dist/cli/terminal.d.ts.map +1 -1
  35. package/dist/cli/terminal.js +0 -2
  36. package/dist/cli/terminal.js.map +1 -1
  37. package/dist/config/schema.d.ts +49 -98
  38. package/dist/config/schema.d.ts.map +1 -1
  39. package/dist/config/schema.js +0 -12
  40. package/dist/config/schema.js.map +1 -1
  41. package/dist/evals/runner.d.ts.map +1 -1
  42. package/dist/evals/runner.js +0 -1
  43. package/dist/evals/runner.js.map +1 -1
  44. package/dist/evals/types.d.ts +9 -15
  45. package/dist/evals/types.d.ts.map +1 -1
  46. package/dist/output/github-checks.d.ts +1 -1
  47. package/dist/output/github-checks.d.ts.map +1 -1
  48. package/dist/output/github-checks.js +2 -6
  49. package/dist/output/github-checks.js.map +1 -1
  50. package/dist/output/issue-renderer.js +1 -1
  51. package/dist/output/issue-renderer.js.map +1 -1
  52. package/dist/sdk/analyze.d.ts.map +1 -1
  53. package/dist/sdk/analyze.js +13 -26
  54. package/dist/sdk/analyze.js.map +1 -1
  55. package/dist/sdk/auth.d.ts +16 -0
  56. package/dist/sdk/auth.d.ts.map +1 -0
  57. package/dist/sdk/auth.js +37 -0
  58. package/dist/sdk/auth.js.map +1 -0
  59. package/dist/sdk/errors.d.ts +5 -0
  60. package/dist/sdk/errors.d.ts.map +1 -1
  61. package/dist/sdk/errors.js +20 -0
  62. package/dist/sdk/errors.js.map +1 -1
  63. package/dist/sdk/prompt.js +1 -1
  64. package/dist/sdk/runner.d.ts +2 -1
  65. package/dist/sdk/runner.d.ts.map +1 -1
  66. package/dist/sdk/runner.js +3 -1
  67. package/dist/sdk/runner.js.map +1 -1
  68. package/dist/sdk/types.d.ts +0 -3
  69. package/dist/sdk/types.d.ts.map +1 -1
  70. package/dist/sdk/types.js.map +1 -1
  71. package/dist/types/index.d.ts +23 -24
  72. package/dist/types/index.d.ts.map +1 -1
  73. package/dist/types/index.js +19 -7
  74. package/dist/types/index.js.map +1 -1
  75. package/package.json +1 -1
  76. package/skills/warden/SKILL.md +76 -0
  77. package/skills/warden/references/cli-reference.md +142 -0
  78. package/skills/warden/references/config-schema.md +111 -0
  79. package/skills/warden/references/configuration.md +110 -0
  80. package/skills/warden/references/creating-skills.md +84 -0
  81. package/skills/warden-sweep/SKILL.md +407 -0
  82. package/skills/warden-sweep/scripts/_utils.py +37 -0
  83. package/skills/warden-sweep/scripts/extract_findings.py +219 -0
  84. package/skills/warden-sweep/scripts/find_reviewers.py +115 -0
  85. package/skills/warden-sweep/scripts/generate_report.py +271 -0
  86. package/skills/warden-sweep/scripts/index_prs.py +187 -0
  87. package/skills/warden-sweep/scripts/organize.py +315 -0
  88. package/skills/warden-sweep/scripts/scan.py +632 -0
  89. package/dist/sdk/session.d.ts +0 -43
  90. package/dist/sdk/session.d.ts.map +0 -1
  91. package/dist/sdk/session.js +0 -105
  92. package/dist/sdk/session.js.map +0 -1
@@ -1,105 +0,0 @@
1
- import fs from 'node:fs';
2
- import os from 'node:os';
3
- import path from 'node:path';
4
- /** Default directory for session storage relative to repo root */
5
- export const DEFAULT_SESSIONS_DIR = '.warden/sessions';
6
- /**
7
- * Derive the directory key Claude Code uses for a given project path.
8
- * Claude Code maps /abs/path/to/project → -abs-path-to-project
9
- */
10
- export function getClaudeProjectHash(projectPath) {
11
- return projectPath.replace(/\//g, '-');
12
- }
13
- /**
14
- * Return the directory where Claude Code stores session files for a given repo path.
15
- * Sessions are stored as <uuid>.jsonl files inside this directory.
16
- */
17
- export function getClaudeProjectDir(repoPath) {
18
- const homeDir = os.homedir();
19
- const hash = getClaudeProjectHash(repoPath);
20
- return path.join(homeDir, '.claude', 'projects', hash);
21
- }
22
- /**
23
- * Ensure the sessions directory exists.
24
- * Creates the directory and any parent directories if they don't exist.
25
- */
26
- export function ensureSessionsDir(dir) {
27
- if (!fs.existsSync(dir)) {
28
- fs.mkdirSync(dir, { recursive: true });
29
- }
30
- }
31
- /**
32
- * Snapshot the set of .jsonl files in Claude's project directory for a given repo.
33
- * Call before analysis, then use moveNewSessions after to capture any new files.
34
- */
35
- export function snapshotSessionFiles(repoPath) {
36
- const projectDir = getClaudeProjectDir(repoPath);
37
- try {
38
- return new Set(fs.readdirSync(projectDir).filter(f => f.endsWith('.jsonl')));
39
- }
40
- catch {
41
- return new Set();
42
- }
43
- }
44
- /**
45
- * Move any new session files that appeared since the snapshot.
46
- * Files are named <prefix>-<uuid>.jsonl where prefix identifies the warden run
47
- * (e.g. "notseer-a049e7f7") and uuid is the Claude session ID.
48
- *
49
- * Safe to call concurrently -- skips files already moved by another caller.
50
- * Returns paths of moved files.
51
- */
52
- export function moveNewSessions(repoPath, before, targetDir, prefix) {
53
- const projectDir = getClaudeProjectDir(repoPath);
54
- let current;
55
- try {
56
- current = fs.readdirSync(projectDir).filter(f => f.endsWith('.jsonl'));
57
- }
58
- catch {
59
- return [];
60
- }
61
- const newFiles = current.filter(f => !before.has(f));
62
- if (newFiles.length === 0)
63
- return [];
64
- ensureSessionsDir(targetDir);
65
- const moved = [];
66
- for (const file of newFiles) {
67
- const sourceFile = path.join(projectDir, file);
68
- // Guard against race: another concurrent hunk may have already moved this file
69
- if (!fs.existsSync(sourceFile))
70
- continue;
71
- // Skip empty files (SDK may not have flushed yet)
72
- try {
73
- const stat = fs.statSync(sourceFile);
74
- if (stat.size === 0)
75
- continue;
76
- }
77
- catch {
78
- continue;
79
- }
80
- const uuid = file.replace('.jsonl', '');
81
- // Short UUID: first 8 chars of the session ID
82
- const shortUuid = uuid.split('-')[0] || uuid.slice(0, 8);
83
- const ts = new Date().toISOString().replace(/[:.]/g, '-');
84
- const targetName = prefix ? `${prefix}-${shortUuid}-${ts}.jsonl` : `${shortUuid}-${ts}.jsonl`;
85
- const targetFile = path.join(targetDir, targetName);
86
- try {
87
- // Use copy+delete instead of rename to handle cross-device moves (EXDEV)
88
- fs.copyFileSync(sourceFile, targetFile);
89
- fs.unlinkSync(sourceFile);
90
- moved.push(targetFile);
91
- }
92
- catch {
93
- // Non-fatal: file may have been moved by a concurrent hunk
94
- }
95
- }
96
- return moved;
97
- }
98
- /**
99
- * Resolve the absolute sessions directory from options and repo path.
100
- */
101
- export function resolveSessionsDir(repoPath, directory) {
102
- const dir = directory ?? DEFAULT_SESSIONS_DIR;
103
- return path.isAbsolute(dir) ? dir : path.join(repoPath, dir);
104
- }
105
- //# sourceMappingURL=session.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/sdk/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,kEAAkE;AAClE,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAUvD;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,WAAmB;IACtD,OAAO,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAgB;IAClD,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;IAC7B,MAAM,IAAI,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;AACzD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,MAAM,UAAU,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CACZ,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAA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