@sentry/warden 0.0.0 → 0.1.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.
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/release.yml +6 -1
- package/.github/workflows/warden.yml +1 -1
- package/dist/action/159.index.js +523 -0
- package/dist/action/159.index.js.map +1 -0
- package/dist/action/action/index.d.ts +2 -0
- package/dist/action/action/index.d.ts.map +1 -0
- package/dist/action/action/main.d.ts +2 -0
- package/dist/action/action/main.d.ts.map +1 -0
- package/dist/action/cli/args.d.ts +74 -0
- package/dist/action/cli/args.d.ts.map +1 -0
- package/dist/action/cli/args.test.d.ts +2 -0
- package/dist/action/cli/args.test.d.ts.map +1 -0
- package/dist/action/cli/commands/add.d.ts +7 -0
- package/dist/action/cli/commands/add.d.ts.map +1 -0
- package/dist/action/cli/commands/init.d.ts +10 -0
- package/dist/action/cli/commands/init.d.ts.map +1 -0
- package/dist/action/cli/commands/init.test.d.ts +2 -0
- package/dist/action/cli/commands/init.test.d.ts.map +1 -0
- package/dist/action/cli/commands/setup-app/browser.d.ts +9 -0
- package/dist/action/cli/commands/setup-app/browser.d.ts.map +1 -0
- package/dist/action/cli/commands/setup-app/credentials.d.ts +15 -0
- package/dist/action/cli/commands/setup-app/credentials.d.ts.map +1 -0
- package/dist/action/cli/commands/setup-app/manifest.d.ts +24 -0
- package/dist/action/cli/commands/setup-app/manifest.d.ts.map +1 -0
- package/dist/action/cli/commands/setup-app/server.d.ts +28 -0
- package/dist/action/cli/commands/setup-app/server.d.ts.map +1 -0
- package/dist/action/cli/commands/setup-app.d.ts +11 -0
- package/dist/action/cli/commands/setup-app.d.ts.map +1 -0
- package/dist/action/cli/commands/sync.d.ts +9 -0
- package/dist/action/cli/commands/sync.d.ts.map +1 -0
- package/dist/action/cli/context.d.ts +27 -0
- package/dist/action/cli/context.d.ts.map +1 -0
- package/dist/action/cli/files.d.ts +22 -0
- package/dist/action/cli/files.d.ts.map +1 -0
- package/dist/action/cli/files.test.d.ts +2 -0
- package/dist/action/cli/files.test.d.ts.map +1 -0
- package/dist/action/cli/fix.d.ts +41 -0
- package/dist/action/cli/fix.d.ts.map +1 -0
- package/dist/action/cli/fix.test.d.ts +2 -0
- package/dist/action/cli/fix.test.d.ts.map +1 -0
- package/dist/action/cli/git.d.ts +73 -0
- package/dist/action/cli/git.d.ts.map +1 -0
- package/dist/action/cli/git.test.d.ts +2 -0
- package/dist/action/cli/git.test.d.ts.map +1 -0
- package/dist/action/cli/index.d.ts +3 -0
- package/dist/action/cli/index.d.ts.map +1 -0
- package/dist/action/cli/main.d.ts +7 -0
- package/dist/action/cli/main.d.ts.map +1 -0
- package/dist/action/cli/output/box.d.ts +75 -0
- package/dist/action/cli/output/box.d.ts.map +1 -0
- package/dist/action/cli/output/formatters.d.ts +90 -0
- package/dist/action/cli/output/formatters.d.ts.map +1 -0
- package/dist/action/cli/output/formatters.test.d.ts +2 -0
- package/dist/action/cli/output/formatters.test.d.ts.map +1 -0
- package/dist/action/cli/output/icons.d.ts +11 -0
- package/dist/action/cli/output/icons.d.ts.map +1 -0
- package/dist/action/cli/output/index.d.ts +10 -0
- package/dist/action/cli/output/index.d.ts.map +1 -0
- package/dist/action/cli/output/ink-runner.d.ts +9 -0
- package/dist/action/cli/output/ink-runner.d.ts.map +1 -0
- package/dist/action/cli/output/jsonl.d.ts +43 -0
- package/dist/action/cli/output/jsonl.d.ts.map +1 -0
- package/dist/action/cli/output/jsonl.test.d.ts +2 -0
- package/dist/action/cli/output/jsonl.test.d.ts.map +1 -0
- package/dist/action/cli/output/reporter.d.ts +108 -0
- package/dist/action/cli/output/reporter.d.ts.map +1 -0
- package/dist/action/cli/output/tasks.d.ts +89 -0
- package/dist/action/cli/output/tasks.d.ts.map +1 -0
- package/dist/action/cli/output/tty.d.ts +21 -0
- package/dist/action/cli/output/tty.d.ts.map +1 -0
- package/dist/action/cli/output/tty.test.d.ts +2 -0
- package/dist/action/cli/output/tty.test.d.ts.map +1 -0
- package/dist/action/cli/output/verbosity.d.ts +20 -0
- package/dist/action/cli/output/verbosity.d.ts.map +1 -0
- package/dist/action/cli/output/verbosity.test.d.ts +2 -0
- package/dist/action/cli/output/verbosity.test.d.ts.map +1 -0
- package/dist/action/cli/terminal.d.ts +19 -0
- package/dist/action/cli/terminal.d.ts.map +1 -0
- package/dist/action/cli/terminal.test.d.ts +2 -0
- package/dist/action/cli/terminal.test.d.ts.map +1 -0
- package/dist/action/config/index.d.ts +4 -0
- package/dist/action/config/index.d.ts.map +1 -0
- package/dist/action/config/loader.d.ts +27 -0
- package/dist/action/config/loader.d.ts.map +1 -0
- package/dist/action/config/loader.test.d.ts +2 -0
- package/dist/action/config/loader.test.d.ts.map +1 -0
- package/dist/action/config/schema.d.ts +318 -0
- package/dist/action/config/schema.d.ts.map +1 -0
- package/dist/action/config/writer.d.ts +11 -0
- package/dist/action/config/writer.d.ts.map +1 -0
- package/dist/action/config/writer.test.d.ts +2 -0
- package/dist/action/config/writer.test.d.ts.map +1 -0
- package/dist/action/diff/classify.d.ts +29 -0
- package/dist/action/diff/classify.d.ts.map +1 -0
- package/dist/action/diff/classify.test.d.ts +2 -0
- package/dist/action/diff/classify.test.d.ts.map +1 -0
- package/dist/action/diff/coalesce.d.ts +42 -0
- package/dist/action/diff/coalesce.d.ts.map +1 -0
- package/dist/action/diff/coalesce.test.d.ts +2 -0
- package/dist/action/diff/coalesce.test.d.ts.map +1 -0
- package/dist/action/diff/context.d.ts +30 -0
- package/dist/action/diff/context.d.ts.map +1 -0
- package/dist/action/diff/context.test.d.ts +2 -0
- package/dist/action/diff/context.test.d.ts.map +1 -0
- package/dist/action/diff/index.d.ts +5 -0
- package/dist/action/diff/index.d.ts.map +1 -0
- package/dist/action/diff/parser.d.ts +52 -0
- package/dist/action/diff/parser.d.ts.map +1 -0
- package/dist/action/diff/parser.test.d.ts +2 -0
- package/dist/action/diff/parser.test.d.ts.map +1 -0
- package/dist/action/event/context.d.ts +9 -0
- package/dist/action/event/context.d.ts.map +1 -0
- package/dist/action/event/index.d.ts +3 -0
- package/dist/action/event/index.d.ts.map +1 -0
- package/dist/action/event/schedule-context.d.ts +30 -0
- package/dist/action/event/schedule-context.d.ts.map +1 -0
- package/dist/action/examples/examples.integration.test.d.ts +2 -0
- package/dist/action/examples/examples.integration.test.d.ts.map +1 -0
- package/dist/action/examples/index.d.ts +50 -0
- package/dist/action/examples/index.d.ts.map +1 -0
- package/dist/action/examples/index.test.d.ts +2 -0
- package/dist/action/examples/index.test.d.ts.map +1 -0
- package/dist/action/examples/setup.d.ts +2 -0
- package/dist/action/examples/setup.d.ts.map +1 -0
- package/dist/action/index.d.ts +11 -0
- package/dist/action/index.d.ts.map +1 -0
- package/dist/action/index.js +38231 -0
- package/dist/action/index.js.map +1 -0
- package/dist/action/licenses.txt +992 -0
- package/dist/action/main.d.ts +2 -0
- package/dist/action/main.d.ts.map +1 -0
- package/dist/action/main.js +707 -0
- package/dist/action/main.js.map +1 -0
- package/dist/action/output/dedup.d.ts +153 -0
- package/dist/action/output/dedup.d.ts.map +1 -0
- package/dist/action/output/dedup.test.d.ts +2 -0
- package/dist/action/output/dedup.test.d.ts.map +1 -0
- package/dist/action/output/github-checks.d.ts +106 -0
- package/dist/action/output/github-checks.d.ts.map +1 -0
- package/dist/action/output/github-checks.test.d.ts +2 -0
- package/dist/action/output/github-checks.test.d.ts.map +1 -0
- package/dist/action/output/github-issues.d.ts +35 -0
- package/dist/action/output/github-issues.d.ts.map +1 -0
- package/dist/action/output/index.d.ts +6 -0
- package/dist/action/output/index.d.ts.map +1 -0
- package/dist/action/output/issue-renderer.d.ts +20 -0
- package/dist/action/output/issue-renderer.d.ts.map +1 -0
- package/dist/action/output/renderer.d.ts +4 -0
- package/dist/action/output/renderer.d.ts.map +1 -0
- package/dist/action/output/renderer.test.d.ts +2 -0
- package/dist/action/output/renderer.test.d.ts.map +1 -0
- package/dist/action/output/stale.d.ts +31 -0
- package/dist/action/output/stale.d.ts.map +1 -0
- package/dist/action/output/stale.test.d.ts +2 -0
- package/dist/action/output/stale.test.d.ts.map +1 -0
- package/dist/action/output/types.d.ts +31 -0
- package/dist/action/output/types.d.ts.map +1 -0
- package/dist/action/package.json +3 -0
- package/dist/action/sdk/index.d.ts +2 -0
- package/dist/action/sdk/index.d.ts.map +1 -0
- package/dist/action/sdk/runner.d.ts +202 -0
- package/dist/action/sdk/runner.d.ts.map +1 -0
- package/dist/action/sdk/runner.test.d.ts +2 -0
- package/dist/action/sdk/runner.test.d.ts.map +1 -0
- package/dist/action/skills/index.d.ts +5 -0
- package/dist/action/skills/index.d.ts.map +1 -0
- package/dist/action/skills/loader.d.ts +111 -0
- package/dist/action/skills/loader.d.ts.map +1 -0
- package/dist/action/skills/loader.test.d.ts +2 -0
- package/dist/action/skills/loader.test.d.ts.map +1 -0
- package/dist/action/skills/remote.d.ts +117 -0
- package/dist/action/skills/remote.d.ts.map +1 -0
- package/dist/action/skills/remote.test.d.ts +2 -0
- package/dist/action/skills/remote.test.d.ts.map +1 -0
- package/dist/action/sourcemap-register.cjs +1 -0
- package/dist/action/triggers/matcher.d.ts +30 -0
- package/dist/action/triggers/matcher.d.ts.map +1 -0
- package/dist/action/triggers/matcher.test.d.ts +2 -0
- package/dist/action/triggers/matcher.test.d.ts.map +1 -0
- package/dist/action/types/index.d.ts +269 -0
- package/dist/action/types/index.d.ts.map +1 -0
- package/dist/action/utils/async.d.ts +5 -0
- package/dist/action/utils/async.d.ts.map +1 -0
- package/dist/action/utils/index.d.ts +16 -0
- package/dist/action/utils/index.d.ts.map +1 -0
- package/dist/action/utils/index.test.d.ts +2 -0
- package/dist/action/utils/index.test.d.ts.map +1 -0
- package/dist/action/utils/version.d.ts +3 -0
- package/dist/action/utils/version.d.ts.map +1 -0
- package/dist/cli/args.d.ts +74 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +359 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/args.test.d.ts +2 -0
- package/dist/cli/args.test.d.ts.map +1 -0
- package/dist/cli/args.test.js +392 -0
- package/dist/cli/args.test.js.map +1 -0
- package/dist/cli/commands/add.d.ts +7 -0
- package/dist/cli/commands/add.d.ts.map +1 -0
- package/dist/cli/commands/add.js +380 -0
- package/dist/cli/commands/add.js.map +1 -0
- package/dist/cli/commands/init.d.ts +10 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +113 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/init.test.d.ts +2 -0
- package/dist/cli/commands/init.test.d.ts.map +1 -0
- package/dist/cli/commands/init.test.js +117 -0
- package/dist/cli/commands/init.test.js.map +1 -0
- package/dist/cli/commands/setup-app/browser.d.ts +9 -0
- package/dist/cli/commands/setup-app/browser.d.ts.map +1 -0
- package/dist/cli/commands/setup-app/browser.js +36 -0
- package/dist/cli/commands/setup-app/browser.js.map +1 -0
- package/dist/cli/commands/setup-app/credentials.d.ts +15 -0
- package/dist/cli/commands/setup-app/credentials.d.ts.map +1 -0
- package/dist/cli/commands/setup-app/credentials.js +29 -0
- package/dist/cli/commands/setup-app/credentials.js.map +1 -0
- package/dist/cli/commands/setup-app/manifest.d.ts +24 -0
- package/dist/cli/commands/setup-app/manifest.d.ts.map +1 -0
- package/dist/cli/commands/setup-app/manifest.js +29 -0
- package/dist/cli/commands/setup-app/manifest.js.map +1 -0
- package/dist/cli/commands/setup-app/server.d.ts +28 -0
- package/dist/cli/commands/setup-app/server.d.ts.map +1 -0
- package/dist/cli/commands/setup-app/server.js +136 -0
- package/dist/cli/commands/setup-app/server.js.map +1 -0
- package/dist/cli/commands/setup-app.d.ts +11 -0
- package/dist/cli/commands/setup-app.d.ts.map +1 -0
- package/dist/cli/commands/setup-app.js +139 -0
- package/dist/cli/commands/setup-app.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +9 -0
- package/dist/cli/commands/sync.d.ts.map +1 -0
- package/dist/cli/commands/sync.js +96 -0
- package/dist/cli/commands/sync.js.map +1 -0
- package/dist/cli/context.d.ts +27 -0
- package/dist/cli/context.d.ts.map +1 -0
- package/dist/cli/context.js +101 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/files.d.ts +22 -0
- package/dist/cli/files.d.ts.map +1 -0
- package/dist/cli/files.js +66 -0
- package/dist/cli/files.js.map +1 -0
- package/dist/cli/files.test.d.ts +2 -0
- package/dist/cli/files.test.d.ts.map +1 -0
- package/dist/cli/files.test.js +117 -0
- package/dist/cli/files.test.js.map +1 -0
- package/dist/cli/fix.d.ts +41 -0
- package/dist/cli/fix.d.ts.map +1 -0
- package/dist/cli/fix.js +320 -0
- package/dist/cli/fix.js.map +1 -0
- package/dist/cli/fix.test.d.ts +2 -0
- package/dist/cli/fix.test.d.ts.map +1 -0
- package/dist/cli/fix.test.js +251 -0
- package/dist/cli/fix.test.js.map +1 -0
- package/dist/cli/git.d.ts +73 -0
- package/dist/cli/git.d.ts.map +1 -0
- package/dist/cli/git.js +267 -0
- package/dist/cli/git.js.map +1 -0
- package/dist/cli/git.test.d.ts +2 -0
- package/dist/cli/git.test.d.ts.map +1 -0
- package/dist/cli/git.test.js +96 -0
- package/dist/cli/git.test.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +13 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/main.d.ts +7 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +560 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/output/box.d.ts +75 -0
- package/dist/cli/output/box.d.ts.map +1 -0
- package/dist/cli/output/box.js +191 -0
- package/dist/cli/output/box.js.map +1 -0
- package/dist/cli/output/formatters.d.ts +90 -0
- package/dist/cli/output/formatters.d.ts.map +1 -0
- package/dist/cli/output/formatters.js +248 -0
- package/dist/cli/output/formatters.js.map +1 -0
- package/dist/cli/output/formatters.test.d.ts +2 -0
- package/dist/cli/output/formatters.test.d.ts.map +1 -0
- package/dist/cli/output/formatters.test.js +152 -0
- package/dist/cli/output/formatters.test.js.map +1 -0
- package/dist/cli/output/icons.d.ts +11 -0
- package/dist/cli/output/icons.d.ts.map +1 -0
- package/dist/cli/output/icons.js +11 -0
- package/dist/cli/output/icons.js.map +1 -0
- package/dist/cli/output/index.d.ts +10 -0
- package/dist/cli/output/index.d.ts.map +1 -0
- package/dist/cli/output/index.js +10 -0
- package/dist/cli/output/index.js.map +1 -0
- package/dist/cli/output/ink-runner.d.ts +9 -0
- package/dist/cli/output/ink-runner.d.ts.map +1 -0
- package/dist/cli/output/ink-runner.js +207 -0
- package/dist/cli/output/ink-runner.js.map +1 -0
- package/dist/cli/output/jsonl.d.ts +43 -0
- package/dist/cli/output/jsonl.d.ts.map +1 -0
- package/dist/cli/output/jsonl.js +89 -0
- package/dist/cli/output/jsonl.js.map +1 -0
- package/dist/cli/output/jsonl.test.d.ts +2 -0
- package/dist/cli/output/jsonl.test.d.ts.map +1 -0
- package/dist/cli/output/jsonl.test.js +284 -0
- package/dist/cli/output/jsonl.test.js.map +1 -0
- package/dist/cli/output/reporter.d.ts +108 -0
- package/dist/cli/output/reporter.d.ts.map +1 -0
- package/dist/cli/output/reporter.js +378 -0
- package/dist/cli/output/reporter.js.map +1 -0
- package/dist/cli/output/tasks.d.ts +89 -0
- package/dist/cli/output/tasks.d.ts.map +1 -0
- package/dist/cli/output/tasks.js +251 -0
- package/dist/cli/output/tasks.js.map +1 -0
- package/dist/cli/output/tty.d.ts +21 -0
- package/dist/cli/output/tty.d.ts.map +1 -0
- package/dist/cli/output/tty.js +44 -0
- package/dist/cli/output/tty.js.map +1 -0
- package/dist/cli/output/tty.test.d.ts +2 -0
- package/dist/cli/output/tty.test.d.ts.map +1 -0
- package/dist/cli/output/tty.test.js +105 -0
- package/dist/cli/output/tty.test.js.map +1 -0
- package/dist/cli/output/verbosity.d.ts +20 -0
- package/dist/cli/output/verbosity.d.ts.map +1 -0
- package/dist/cli/output/verbosity.js +32 -0
- package/dist/cli/output/verbosity.js.map +1 -0
- package/dist/cli/output/verbosity.test.d.ts +2 -0
- package/dist/cli/output/verbosity.test.d.ts.map +1 -0
- package/dist/cli/output/verbosity.test.js +35 -0
- package/dist/cli/output/verbosity.test.js.map +1 -0
- package/dist/cli/terminal.d.ts +19 -0
- package/dist/cli/terminal.d.ts.map +1 -0
- package/dist/cli/terminal.js +247 -0
- package/dist/cli/terminal.js.map +1 -0
- package/dist/cli/terminal.test.d.ts +2 -0
- package/dist/cli/terminal.test.d.ts.map +1 -0
- package/dist/cli/terminal.test.js +123 -0
- package/dist/cli/terminal.test.js.map +1 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +4 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +27 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +77 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/loader.test.d.ts +2 -0
- package/dist/config/loader.test.d.ts.map +1 -0
- package/dist/config/loader.test.js +263 -0
- package/dist/config/loader.test.js.map +1 -0
- package/dist/config/schema.d.ts +318 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +137 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/writer.d.ts +11 -0
- package/dist/config/writer.d.ts.map +1 -0
- package/dist/config/writer.js +74 -0
- package/dist/config/writer.js.map +1 -0
- package/dist/config/writer.test.d.ts +2 -0
- package/dist/config/writer.test.d.ts.map +1 -0
- package/dist/config/writer.test.js +98 -0
- package/dist/config/writer.test.js.map +1 -0
- package/dist/diff/classify.d.ts +29 -0
- package/dist/diff/classify.d.ts.map +1 -0
- package/dist/diff/classify.js +74 -0
- package/dist/diff/classify.js.map +1 -0
- package/dist/diff/classify.test.d.ts +2 -0
- package/dist/diff/classify.test.d.ts.map +1 -0
- package/dist/diff/classify.test.js +140 -0
- package/dist/diff/classify.test.js.map +1 -0
- package/dist/diff/coalesce.d.ts +42 -0
- package/dist/diff/coalesce.d.ts.map +1 -0
- package/dist/diff/coalesce.js +104 -0
- package/dist/diff/coalesce.js.map +1 -0
- package/dist/diff/coalesce.test.d.ts +2 -0
- package/dist/diff/coalesce.test.d.ts.map +1 -0
- package/dist/diff/coalesce.test.js +159 -0
- package/dist/diff/coalesce.test.js.map +1 -0
- package/dist/diff/context.d.ts +30 -0
- package/dist/diff/context.d.ts.map +1 -0
- package/dist/diff/context.js +144 -0
- package/dist/diff/context.js.map +1 -0
- package/dist/diff/context.test.d.ts +2 -0
- package/dist/diff/context.test.d.ts.map +1 -0
- package/dist/diff/context.test.js +190 -0
- package/dist/diff/context.test.js.map +1 -0
- package/dist/diff/index.d.ts +5 -0
- package/dist/diff/index.d.ts.map +1 -0
- package/dist/diff/index.js +5 -0
- package/dist/diff/index.js.map +1 -0
- package/dist/diff/parser.d.ts +52 -0
- package/dist/diff/parser.d.ts.map +1 -0
- package/dist/diff/parser.js +95 -0
- package/dist/diff/parser.js.map +1 -0
- package/dist/diff/parser.test.d.ts +2 -0
- package/dist/diff/parser.test.d.ts.map +1 -0
- package/dist/diff/parser.test.js +178 -0
- package/dist/diff/parser.test.js.map +1 -0
- package/dist/event/context.d.ts +9 -0
- package/dist/event/context.d.ts.map +1 -0
- package/dist/event/context.js +94 -0
- package/dist/event/context.js.map +1 -0
- package/dist/event/index.d.ts +3 -0
- package/dist/event/index.d.ts.map +1 -0
- package/dist/event/index.js +3 -0
- package/dist/event/index.js.map +1 -0
- package/dist/event/schedule-context.d.ts +30 -0
- package/dist/event/schedule-context.d.ts.map +1 -0
- package/dist/event/schedule-context.js +57 -0
- package/dist/event/schedule-context.js.map +1 -0
- package/dist/examples/examples.integration.test.d.ts +2 -0
- package/dist/examples/examples.integration.test.d.ts.map +1 -0
- package/dist/examples/examples.integration.test.js +55 -0
- package/dist/examples/examples.integration.test.js.map +1 -0
- package/dist/examples/index.d.ts +50 -0
- package/dist/examples/index.d.ts.map +1 -0
- package/dist/examples/index.js +104 -0
- package/dist/examples/index.js.map +1 -0
- package/dist/examples/index.test.d.ts +2 -0
- package/dist/examples/index.test.d.ts.map +1 -0
- package/dist/examples/index.test.js +88 -0
- package/dist/examples/index.test.js.map +1 -0
- package/dist/examples/setup.d.ts +2 -0
- package/dist/examples/setup.d.ts.map +1 -0
- package/dist/examples/setup.js +22 -0
- package/dist/examples/setup.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/output/dedup.d.ts +153 -0
- package/dist/output/dedup.d.ts.map +1 -0
- package/dist/output/dedup.js +416 -0
- package/dist/output/dedup.js.map +1 -0
- package/dist/output/dedup.test.d.ts +2 -0
- package/dist/output/dedup.test.d.ts.map +1 -0
- package/dist/output/dedup.test.js +357 -0
- package/dist/output/dedup.test.js.map +1 -0
- package/dist/output/github-checks.d.ts +106 -0
- package/dist/output/github-checks.d.ts.map +1 -0
- package/dist/output/github-checks.js +321 -0
- package/dist/output/github-checks.js.map +1 -0
- package/dist/output/github-checks.test.d.ts +2 -0
- package/dist/output/github-checks.test.d.ts.map +1 -0
- package/dist/output/github-checks.test.js +255 -0
- package/dist/output/github-checks.test.js.map +1 -0
- package/dist/output/github-issues.d.ts +35 -0
- package/dist/output/github-issues.d.ts.map +1 -0
- package/dist/output/github-issues.js +246 -0
- package/dist/output/github-issues.js.map +1 -0
- package/dist/output/index.d.ts +6 -0
- package/dist/output/index.d.ts.map +1 -0
- package/dist/output/index.js +6 -0
- package/dist/output/index.js.map +1 -0
- package/dist/output/issue-renderer.d.ts +20 -0
- package/dist/output/issue-renderer.d.ts.map +1 -0
- package/dist/output/issue-renderer.js +154 -0
- package/dist/output/issue-renderer.js.map +1 -0
- package/dist/output/renderer.d.ts +4 -0
- package/dist/output/renderer.d.ts.map +1 -0
- package/dist/output/renderer.js +168 -0
- package/dist/output/renderer.js.map +1 -0
- package/dist/output/renderer.test.d.ts +2 -0
- package/dist/output/renderer.test.d.ts.map +1 -0
- package/dist/output/renderer.test.js +645 -0
- package/dist/output/renderer.test.js.map +1 -0
- package/dist/output/stale.d.ts +31 -0
- package/dist/output/stale.d.ts.map +1 -0
- package/dist/output/stale.js +114 -0
- package/dist/output/stale.js.map +1 -0
- package/dist/output/stale.test.d.ts +2 -0
- package/dist/output/stale.test.d.ts.map +1 -0
- package/dist/output/stale.test.js +330 -0
- package/dist/output/stale.test.js.map +1 -0
- package/dist/output/types.d.ts +31 -0
- package/dist/output/types.d.ts.map +1 -0
- package/dist/output/types.js +2 -0
- package/dist/output/types.js.map +1 -0
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +2 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/runner.d.ts +202 -0
- package/dist/sdk/runner.d.ts.map +1 -0
- package/dist/sdk/runner.js +888 -0
- package/dist/sdk/runner.js.map +1 -0
- package/dist/sdk/runner.test.d.ts +2 -0
- package/dist/sdk/runner.test.d.ts.map +1 -0
- package/dist/sdk/runner.test.js +677 -0
- package/dist/sdk/runner.test.js.map +1 -0
- package/dist/skills/index.d.ts +5 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +3 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/loader.d.ts +111 -0
- package/dist/skills/loader.d.ts.map +1 -0
- package/dist/skills/loader.js +319 -0
- package/dist/skills/loader.js.map +1 -0
- package/dist/skills/loader.test.d.ts +2 -0
- package/dist/skills/loader.test.d.ts.map +1 -0
- package/dist/skills/loader.test.js +241 -0
- package/dist/skills/loader.test.js.map +1 -0
- package/dist/skills/remote.d.ts +117 -0
- package/dist/skills/remote.d.ts.map +1 -0
- package/dist/skills/remote.js +496 -0
- package/dist/skills/remote.js.map +1 -0
- package/dist/skills/remote.test.d.ts +2 -0
- package/dist/skills/remote.test.d.ts.map +1 -0
- package/dist/skills/remote.test.js +582 -0
- package/dist/skills/remote.test.js.map +1 -0
- package/dist/triggers/matcher.d.ts +30 -0
- package/dist/triggers/matcher.d.ts.map +1 -0
- package/dist/triggers/matcher.js +122 -0
- package/dist/triggers/matcher.js.map +1 -0
- package/dist/triggers/matcher.test.d.ts +2 -0
- package/dist/triggers/matcher.test.d.ts.map +1 -0
- package/dist/triggers/matcher.test.js +234 -0
- package/dist/triggers/matcher.test.js.map +1 -0
- package/dist/types/index.d.ts +269 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +162 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/async.d.ts +5 -0
- package/dist/utils/async.d.ts.map +1 -0
- package/dist/utils/async.js +13 -0
- package/dist/utils/async.js.map +1 -0
- package/dist/utils/index.d.ts +16 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +44 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.test.d.ts +2 -0
- package/dist/utils/index.test.d.ts.map +1 -0
- package/dist/utils/index.test.js +68 -0
- package/dist/utils/index.test.js.map +1 -0
- package/dist/utils/version.d.ts +3 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +16 -0
- package/dist/utils/version.js.map +1 -0
- package/docs/src/pages/config.astro +2 -1
- package/docs/src/pages/guide.astro +2 -1
- package/docs/src/utils/version.ts +6 -0
- package/package.json +12 -2
- package/src/cli/args.ts +2 -3
- package/src/cli/commands/init.test.ts +2 -1
- package/src/cli/commands/init.ts +3 -1
- package/src/cli/output/reporter.ts +3 -4
- package/src/utils/index.ts +1 -0
- package/src/utils/version.ts +17 -0
- package/.claude/settings.local.json +0 -88
- package/docs/.claude/settings.local.json +0 -11
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// Severity levels for findings
|
|
3
|
+
export const SeveritySchema = z.enum(['critical', 'high', 'medium', 'low', 'info']);
|
|
4
|
+
// Confidence levels for findings
|
|
5
|
+
export const ConfidenceSchema = z.enum(['high', 'medium', 'low']);
|
|
6
|
+
/**
|
|
7
|
+
* Confidence order for comparison (lower = more confident).
|
|
8
|
+
* Single source of truth for confidence ordering across the codebase.
|
|
9
|
+
*/
|
|
10
|
+
export const CONFIDENCE_ORDER = {
|
|
11
|
+
high: 0,
|
|
12
|
+
medium: 1,
|
|
13
|
+
low: 2,
|
|
14
|
+
};
|
|
15
|
+
// Severity threshold for config options (includes 'off' to disable)
|
|
16
|
+
export const SeverityThresholdSchema = z.enum(['off', 'critical', 'high', 'medium', 'low', 'info']);
|
|
17
|
+
/**
|
|
18
|
+
* Severity order for comparison (lower = more severe).
|
|
19
|
+
* Single source of truth for severity ordering across the codebase.
|
|
20
|
+
*/
|
|
21
|
+
export const SEVERITY_ORDER = {
|
|
22
|
+
critical: 0,
|
|
23
|
+
high: 1,
|
|
24
|
+
medium: 2,
|
|
25
|
+
low: 3,
|
|
26
|
+
info: 4,
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Filter findings to only include those at or above the given severity threshold.
|
|
30
|
+
* If no threshold is provided, returns all findings unchanged.
|
|
31
|
+
* If threshold is 'off', returns empty array (disabled).
|
|
32
|
+
*/
|
|
33
|
+
export function filterFindingsBySeverity(findings, threshold) {
|
|
34
|
+
if (!threshold)
|
|
35
|
+
return findings;
|
|
36
|
+
if (threshold === 'off')
|
|
37
|
+
return [];
|
|
38
|
+
const thresholdOrder = SEVERITY_ORDER[threshold];
|
|
39
|
+
return findings.filter((f) => SEVERITY_ORDER[f.severity] <= thresholdOrder);
|
|
40
|
+
}
|
|
41
|
+
// Location within a file
|
|
42
|
+
export const LocationSchema = z.object({
|
|
43
|
+
path: z.string(),
|
|
44
|
+
startLine: z.number().int().positive(),
|
|
45
|
+
endLine: z.number().int().positive().optional(),
|
|
46
|
+
});
|
|
47
|
+
// Suggested fix with diff
|
|
48
|
+
export const SuggestedFixSchema = z.object({
|
|
49
|
+
description: z.string(),
|
|
50
|
+
diff: z.string(),
|
|
51
|
+
});
|
|
52
|
+
// Individual finding from a skill
|
|
53
|
+
export const FindingSchema = z.object({
|
|
54
|
+
id: z.string(),
|
|
55
|
+
severity: SeveritySchema,
|
|
56
|
+
confidence: ConfidenceSchema.optional(),
|
|
57
|
+
title: z.string(),
|
|
58
|
+
description: z.string(),
|
|
59
|
+
location: LocationSchema.optional(),
|
|
60
|
+
suggestedFix: SuggestedFixSchema.optional(),
|
|
61
|
+
elapsedMs: z.number().nonnegative().optional(),
|
|
62
|
+
});
|
|
63
|
+
// Usage statistics from SDK
|
|
64
|
+
export const UsageStatsSchema = z.object({
|
|
65
|
+
inputTokens: z.number().int().nonnegative(),
|
|
66
|
+
outputTokens: z.number().int().nonnegative(),
|
|
67
|
+
cacheReadInputTokens: z.number().int().nonnegative().optional(),
|
|
68
|
+
cacheCreationInputTokens: z.number().int().nonnegative().optional(),
|
|
69
|
+
costUSD: z.number().nonnegative(),
|
|
70
|
+
});
|
|
71
|
+
// Skipped file info for chunking
|
|
72
|
+
export const SkippedFileSchema = z.object({
|
|
73
|
+
filename: z.string(),
|
|
74
|
+
reason: z.enum(['pattern', 'builtin']),
|
|
75
|
+
pattern: z.string().optional(),
|
|
76
|
+
});
|
|
77
|
+
// Skill report output
|
|
78
|
+
export const SkillReportSchema = z.object({
|
|
79
|
+
skill: z.string(),
|
|
80
|
+
summary: z.string(),
|
|
81
|
+
findings: z.array(FindingSchema),
|
|
82
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
83
|
+
durationMs: z.number().nonnegative().optional(),
|
|
84
|
+
usage: UsageStatsSchema.optional(),
|
|
85
|
+
/** Files that were skipped due to chunking patterns */
|
|
86
|
+
skippedFiles: z.array(SkippedFileSchema).optional(),
|
|
87
|
+
/** Number of hunks that failed to analyze (SDK errors, API errors, etc.) */
|
|
88
|
+
failedHunks: z.number().int().nonnegative().optional(),
|
|
89
|
+
});
|
|
90
|
+
// GitHub event types
|
|
91
|
+
export const GitHubEventTypeSchema = z.enum([
|
|
92
|
+
'pull_request',
|
|
93
|
+
'issues',
|
|
94
|
+
'issue_comment',
|
|
95
|
+
'pull_request_review',
|
|
96
|
+
'pull_request_review_comment',
|
|
97
|
+
'schedule',
|
|
98
|
+
]);
|
|
99
|
+
// Pull request actions
|
|
100
|
+
export const PullRequestActionSchema = z.enum([
|
|
101
|
+
'opened',
|
|
102
|
+
'synchronize',
|
|
103
|
+
'reopened',
|
|
104
|
+
'closed',
|
|
105
|
+
]);
|
|
106
|
+
// File change info
|
|
107
|
+
export const FileChangeSchema = z.object({
|
|
108
|
+
filename: z.string(),
|
|
109
|
+
status: z.enum(['added', 'removed', 'modified', 'renamed', 'copied', 'changed', 'unchanged']),
|
|
110
|
+
additions: z.number().int().nonnegative(),
|
|
111
|
+
deletions: z.number().int().nonnegative(),
|
|
112
|
+
patch: z.string().optional(),
|
|
113
|
+
chunks: z.number().int().nonnegative().optional(),
|
|
114
|
+
});
|
|
115
|
+
/**
|
|
116
|
+
* Count the number of chunks/hunks in a patch string.
|
|
117
|
+
* Each chunk starts with @@ -X,Y +A,B @@
|
|
118
|
+
*/
|
|
119
|
+
export function countPatchChunks(patch) {
|
|
120
|
+
if (!patch)
|
|
121
|
+
return 0;
|
|
122
|
+
const matches = patch.match(/^@@\s/gm);
|
|
123
|
+
return matches?.length ?? 0;
|
|
124
|
+
}
|
|
125
|
+
// Pull request context
|
|
126
|
+
export const PullRequestContextSchema = z.object({
|
|
127
|
+
number: z.number().int().positive(),
|
|
128
|
+
title: z.string(),
|
|
129
|
+
body: z.string().nullable(),
|
|
130
|
+
author: z.string(),
|
|
131
|
+
baseBranch: z.string(),
|
|
132
|
+
headBranch: z.string(),
|
|
133
|
+
headSha: z.string(),
|
|
134
|
+
files: z.array(FileChangeSchema),
|
|
135
|
+
});
|
|
136
|
+
// Repository context
|
|
137
|
+
export const RepositoryContextSchema = z.object({
|
|
138
|
+
owner: z.string(),
|
|
139
|
+
name: z.string(),
|
|
140
|
+
fullName: z.string(),
|
|
141
|
+
defaultBranch: z.string(),
|
|
142
|
+
});
|
|
143
|
+
// Full event context
|
|
144
|
+
export const EventContextSchema = z.object({
|
|
145
|
+
eventType: GitHubEventTypeSchema,
|
|
146
|
+
action: z.string(),
|
|
147
|
+
repository: RepositoryContextSchema,
|
|
148
|
+
pullRequest: PullRequestContextSchema.optional(),
|
|
149
|
+
repoPath: z.string(),
|
|
150
|
+
});
|
|
151
|
+
// Retry configuration for SDK calls
|
|
152
|
+
export const RetryConfigSchema = z.object({
|
|
153
|
+
/** Maximum number of retry attempts (default: 3) */
|
|
154
|
+
maxRetries: z.number().int().nonnegative().default(3),
|
|
155
|
+
/** Initial delay in milliseconds before first retry (default: 1000) */
|
|
156
|
+
initialDelayMs: z.number().int().positive().default(1000),
|
|
157
|
+
/** Multiplier for exponential backoff (default: 2) */
|
|
158
|
+
backoffMultiplier: z.number().positive().default(2),
|
|
159
|
+
/** Maximum delay in milliseconds between retries (default: 30000) */
|
|
160
|
+
maxDelayMs: z.number().int().positive().default(30000),
|
|
161
|
+
});
|
|
162
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+BAA+B;AAC/B,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAGpF,iCAAiC;AACjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AAGlE;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA+B;IAC1D,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,GAAG,EAAE,CAAC;CACP,CAAC;AAEF,oEAAoE;AACpE,MAAM,CAAC,MAA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AM,GAChB,OAAO,CAAC,CAAC,EAAE,CAAC,CAUd"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Process items with limited concurrency using chunked batches.
|
|
3
|
+
*/
|
|
4
|
+
export async function processInBatches(items, fn, batchSize) {
|
|
5
|
+
const results = [];
|
|
6
|
+
for (let i = 0; i < items.length; i += batchSize) {
|
|
7
|
+
const batch = items.slice(i, i + batchSize);
|
|
8
|
+
const batchResults = await Promise.all(batch.map(fn));
|
|
9
|
+
results.push(...batchResults);
|
|
10
|
+
}
|
|
11
|
+
return results;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=async.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"async.js","sourceRoot":"","sources":["../../src/utils/async.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,KAAU,EACV,EAA2B,EAC3B,SAAiB;IAEjB,MAAM,OAAO,GAAQ,EAAE,CAAC;IAExB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC;QAC5C,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACtD,OAAO,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { processInBatches } from './async.js';
|
|
2
|
+
export { getVersion, getMajorVersion } from './version.js';
|
|
3
|
+
/** Default concurrency for parallel trigger/skill execution */
|
|
4
|
+
export declare const DEFAULT_CONCURRENCY = 4;
|
|
5
|
+
/**
|
|
6
|
+
* Escape HTML special characters to prevent them from being interpreted as HTML.
|
|
7
|
+
* Preserves content inside markdown code blocks (```) and inline code (`).
|
|
8
|
+
* Used when rendering finding titles/descriptions in GitHub comments.
|
|
9
|
+
*/
|
|
10
|
+
export declare function escapeHtml(text: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Get the Anthropic API key from environment variables.
|
|
13
|
+
* Checks WARDEN_ANTHROPIC_API_KEY first, then falls back to ANTHROPIC_API_KEY.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getAnthropicApiKey(): string | undefined;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,+DAA+D;AAC/D,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA+B/C;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAEvD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export { processInBatches } from './async.js';
|
|
2
|
+
export { getVersion, getMajorVersion } from './version.js';
|
|
3
|
+
/** Default concurrency for parallel trigger/skill execution */
|
|
4
|
+
export const DEFAULT_CONCURRENCY = 4;
|
|
5
|
+
/**
|
|
6
|
+
* Escape HTML special characters to prevent them from being interpreted as HTML.
|
|
7
|
+
* Preserves content inside markdown code blocks (```) and inline code (`).
|
|
8
|
+
* Used when rendering finding titles/descriptions in GitHub comments.
|
|
9
|
+
*/
|
|
10
|
+
export function escapeHtml(text) {
|
|
11
|
+
// Extract code blocks and inline code, escape HTML in the rest
|
|
12
|
+
const codeBlocks = [];
|
|
13
|
+
// Replace code blocks (``` ... ```) and inline code (` ... `) with indexed placeholders
|
|
14
|
+
// Process triple backticks first (they may contain single backticks)
|
|
15
|
+
let processed = text.replace(/```[\s\S]*?```/g, (match) => {
|
|
16
|
+
const idx = codeBlocks.length;
|
|
17
|
+
codeBlocks.push(match);
|
|
18
|
+
return `\0CODE${idx}\0`;
|
|
19
|
+
});
|
|
20
|
+
// Then process inline code (single backticks)
|
|
21
|
+
processed = processed.replace(/`[^`]+`/g, (match) => {
|
|
22
|
+
const idx = codeBlocks.length;
|
|
23
|
+
codeBlocks.push(match);
|
|
24
|
+
return `\0CODE${idx}\0`;
|
|
25
|
+
});
|
|
26
|
+
// Escape HTML in the non-code portions
|
|
27
|
+
processed = processed
|
|
28
|
+
.replace(/&/g, '&')
|
|
29
|
+
.replace(/</g, '<')
|
|
30
|
+
.replace(/>/g, '>');
|
|
31
|
+
// Restore code blocks by index
|
|
32
|
+
codeBlocks.forEach((block, i) => {
|
|
33
|
+
processed = processed.replace(`\0CODE${i}\0`, block);
|
|
34
|
+
});
|
|
35
|
+
return processed;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the Anthropic API key from environment variables.
|
|
39
|
+
* Checks WARDEN_ANTHROPIC_API_KEY first, then falls back to ANTHROPIC_API_KEY.
|
|
40
|
+
*/
|
|
41
|
+
export function getAnthropicApiKey() {
|
|
42
|
+
return process.env['WARDEN_ANTHROPIC_API_KEY'] ?? process.env['ANTHROPIC_API_KEY'];
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,+DAA+D;AAC/D,MAAM,CAAC,MAAM,mBAAm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
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/utils/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import { escapeHtml, getAnthropicApiKey } from './index.js';
|
|
3
|
+
describe('escapeHtml', () => {
|
|
4
|
+
it('escapes angle brackets outside code', () => {
|
|
5
|
+
expect(escapeHtml('Check the <sub> tag')).toBe('Check the <sub> tag');
|
|
6
|
+
});
|
|
7
|
+
it('escapes ampersands', () => {
|
|
8
|
+
expect(escapeHtml('foo & bar')).toBe('foo & bar');
|
|
9
|
+
});
|
|
10
|
+
it('escapes multiple HTML characters', () => {
|
|
11
|
+
expect(escapeHtml('<div>foo & bar</div>')).toBe('<div>foo & bar</div>');
|
|
12
|
+
});
|
|
13
|
+
it('preserves content inside inline code', () => {
|
|
14
|
+
expect(escapeHtml('no `<sub>warden:` tag')).toBe('no `<sub>warden:` tag');
|
|
15
|
+
});
|
|
16
|
+
it('preserves content inside code blocks', () => {
|
|
17
|
+
const input = 'Check this:\n```\n<html>\n <body></body>\n</html>\n```\nDone';
|
|
18
|
+
expect(escapeHtml(input)).toBe(input);
|
|
19
|
+
});
|
|
20
|
+
it('escapes outside code but preserves inside', () => {
|
|
21
|
+
const input = 'When <sub> tag like `<sub>warden:` is missing';
|
|
22
|
+
const expected = 'When <sub> tag like `<sub>warden:` is missing';
|
|
23
|
+
expect(escapeHtml(input)).toBe(expected);
|
|
24
|
+
});
|
|
25
|
+
it('handles multiple inline code spans', () => {
|
|
26
|
+
const input = 'Use `<div>` or `<span>` elements';
|
|
27
|
+
expect(escapeHtml(input)).toBe(input);
|
|
28
|
+
});
|
|
29
|
+
it('handles mixed code blocks and inline code', () => {
|
|
30
|
+
const input = 'See `<tag>` and:\n```\n<html>\n```\nThen <other>';
|
|
31
|
+
const expected = 'See `<tag>` and:\n```\n<html>\n```\nThen <other>';
|
|
32
|
+
expect(escapeHtml(input)).toBe(expected);
|
|
33
|
+
});
|
|
34
|
+
it('returns empty string unchanged', () => {
|
|
35
|
+
expect(escapeHtml('')).toBe('');
|
|
36
|
+
});
|
|
37
|
+
it('returns string without HTML unchanged', () => {
|
|
38
|
+
expect(escapeHtml('plain text')).toBe('plain text');
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
describe('getAnthropicApiKey', () => {
|
|
42
|
+
const originalEnv = process.env;
|
|
43
|
+
beforeEach(() => {
|
|
44
|
+
process.env = { ...originalEnv };
|
|
45
|
+
delete process.env['WARDEN_ANTHROPIC_API_KEY'];
|
|
46
|
+
delete process.env['ANTHROPIC_API_KEY'];
|
|
47
|
+
});
|
|
48
|
+
afterEach(() => {
|
|
49
|
+
process.env = originalEnv;
|
|
50
|
+
});
|
|
51
|
+
it('returns WARDEN_ANTHROPIC_API_KEY when set', () => {
|
|
52
|
+
process.env['WARDEN_ANTHROPIC_API_KEY'] = 'warden-key';
|
|
53
|
+
expect(getAnthropicApiKey()).toBe('warden-key');
|
|
54
|
+
});
|
|
55
|
+
it('returns WARDEN_ANTHROPIC_API_KEY over ANTHROPIC_API_KEY when both set', () => {
|
|
56
|
+
process.env['WARDEN_ANTHROPIC_API_KEY'] = 'warden-key';
|
|
57
|
+
process.env['ANTHROPIC_API_KEY'] = 'anthropic-key';
|
|
58
|
+
expect(getAnthropicApiKey()).toBe('warden-key');
|
|
59
|
+
});
|
|
60
|
+
it('falls back to ANTHROPIC_API_KEY when WARDEN key not set', () => {
|
|
61
|
+
process.env['ANTHROPIC_API_KEY'] = 'anthropic-key';
|
|
62
|
+
expect(getAnthropicApiKey()).toBe('anthropic-key');
|
|
63
|
+
});
|
|
64
|
+
it('returns undefined when neither key is set', () => {
|
|
65
|
+
expect(getAnthropicApiKey()).toBeUndefined();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
//# sourceMappingURL=index.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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,WAAW,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,GAAG,YAAY,CAAC;QACvD,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;QAC/E,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,GAAG,YAAY,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC;QACnD,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC;QACnD,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,CAAC,kBAAkB,EAAE,CAAC,CAAC,aAAa,EAAE,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAMA,wBAAgB,UAAU,IAAI,MAAM,CAMnC;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
let cachedVersion;
|
|
5
|
+
export function getVersion() {
|
|
6
|
+
if (cachedVersion)
|
|
7
|
+
return cachedVersion;
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, '..', '..', 'package.json'), 'utf-8'));
|
|
10
|
+
cachedVersion = pkg.version;
|
|
11
|
+
return cachedVersion;
|
|
12
|
+
}
|
|
13
|
+
export function getMajorVersion() {
|
|
14
|
+
return getVersion().split('.')[0] ?? '0';
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,IAAI,aAAiC,CAAC;AAEtC,MAAM,UAAU,UAAU;IACxB,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC;IACxC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAwB,CAAC;IAClH,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC;IAC5B,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,UAAU,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;AAC3C,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import Base from '../layouts/Base.astro';
|
|
3
3
|
import Terminal from '../components/Terminal.astro';
|
|
4
4
|
import { Code } from 'astro:components';
|
|
5
|
+
import { WARDEN_ACTION } from '../utils/version.js';
|
|
5
6
|
---
|
|
6
7
|
|
|
7
8
|
<Base title="Config" description="Warden configuration reference">
|
|
@@ -368,7 +369,7 @@ jobs:
|
|
|
368
369
|
# app-id: \${{ secrets.WARDEN_APP_ID }}
|
|
369
370
|
# private-key: \${{ secrets.WARDEN_PRIVATE_KEY }}
|
|
370
371
|
|
|
371
|
-
- uses:
|
|
372
|
+
- uses: ${WARDEN_ACTION}
|
|
372
373
|
with:
|
|
373
374
|
github-token: \${{ secrets.GITHUB_TOKEN }}
|
|
374
375
|
# github-token: \${{ steps.app-token.outputs.token }}`}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import Base from '../layouts/Base.astro';
|
|
3
3
|
import Terminal from '../components/Terminal.astro';
|
|
4
4
|
import { Code } from 'astro:components';
|
|
5
|
+
import { WARDEN_ACTION } from '../utils/version.js';
|
|
5
6
|
|
|
6
7
|
const base = import.meta.env.BASE_URL.replace(/\/$/, '');
|
|
7
8
|
---
|
|
@@ -384,7 +385,7 @@ commentOn = "medium" # Post comments for medium and above`}
|
|
|
384
385
|
app-id: \${{ secrets.WARDEN_APP_ID }}
|
|
385
386
|
private-key: \${{ secrets.WARDEN_PRIVATE_KEY }}
|
|
386
387
|
|
|
387
|
-
- uses:
|
|
388
|
+
- uses: ${WARDEN_ACTION}
|
|
388
389
|
with:
|
|
389
390
|
github-token: \${{ steps.app-token.outputs.token }}`}
|
|
390
391
|
lang="yaml"
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
|
|
4
|
+
const pkg = JSON.parse(readFileSync(join(process.cwd(), '..', 'package.json'), 'utf-8'));
|
|
5
|
+
export const MAJOR_VERSION = pkg.version.split('.')[0] ?? '0';
|
|
6
|
+
export const WARDEN_ACTION = `getsentry/warden@v${MAJOR_VERSION}`;
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/warden",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Event-driven agent that reacts to GitHub events and executes skills via Claude Code SDK",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"warden": "dist/cli/index.js"
|
|
10
|
+
},
|
|
6
11
|
"scripts": {
|
|
7
12
|
"cli": "tsx src/cli/index.ts",
|
|
8
13
|
"build": "tsc",
|
|
@@ -36,8 +41,13 @@
|
|
|
36
41
|
"code-review",
|
|
37
42
|
"security"
|
|
38
43
|
],
|
|
39
|
-
"author": "
|
|
44
|
+
"author": "Sentry",
|
|
40
45
|
"license": "FSL-1.1-ALv2",
|
|
46
|
+
"repository": "https://github.com/getsentry/warden",
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/getsentry/warden/issues"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://warden.sentry.dev",
|
|
41
51
|
"dependencies": {
|
|
42
52
|
"@anthropic-ai/claude-agent-sdk": "^0.2.22",
|
|
43
53
|
"@anthropic-ai/sdk": "^0.72.1",
|
package/src/cli/args.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { parseArgs } from 'node:util';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { SeverityThresholdSchema } from '../types/index.js';
|
|
5
5
|
import type { SeverityThreshold } from '../types/index.js';
|
|
6
|
+
import { getVersion } from '../utils/index.js';
|
|
6
7
|
|
|
7
8
|
export const CLIOptionsSchema = z.object({
|
|
8
9
|
targets: z.array(z.string()).optional(),
|
|
@@ -53,10 +54,8 @@ export interface ParsedArgs {
|
|
|
53
54
|
setupAppOptions?: SetupAppOptions;
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
const VERSION = '0.1.0';
|
|
57
|
-
|
|
58
57
|
export function showVersion(): void {
|
|
59
|
-
console.log(`warden ${
|
|
58
|
+
console.log(`warden ${getVersion()}`);
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
const HELP_TEXT = `
|
|
@@ -8,6 +8,7 @@ import { Reporter } from '../output/reporter.js';
|
|
|
8
8
|
import { detectOutputMode } from '../output/tty.js';
|
|
9
9
|
import { Verbosity } from '../output/verbosity.js';
|
|
10
10
|
import type { CLIOptions } from '../args.js';
|
|
11
|
+
import { getMajorVersion } from '../../utils/index.js';
|
|
11
12
|
|
|
12
13
|
function createMockReporter(): Reporter {
|
|
13
14
|
return new Reporter(detectOutputMode(false), Verbosity.Normal);
|
|
@@ -75,7 +76,7 @@ describe('init command', () => {
|
|
|
75
76
|
expect(content).toContain('pull-requests: write');
|
|
76
77
|
expect(content).toContain('checks: write');
|
|
77
78
|
expect(content).toContain('WARDEN_ANTHROPIC_API_KEY');
|
|
78
|
-
expect(content).toContain(
|
|
79
|
+
expect(content).toContain(`getsentry/warden@v${getMajorVersion()}`);
|
|
79
80
|
});
|
|
80
81
|
});
|
|
81
82
|
|
package/src/cli/commands/init.ts
CHANGED
|
@@ -4,6 +4,7 @@ import chalk from 'chalk';
|
|
|
4
4
|
import { getRepoRoot, getGitHubRepoUrl } from '../git.js';
|
|
5
5
|
import type { Reporter } from '../output/reporter.js';
|
|
6
6
|
import type { CLIOptions } from '../args.js';
|
|
7
|
+
import { getMajorVersion } from '../../utils/index.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Template for warden.toml configuration file.
|
|
@@ -17,6 +18,7 @@ function generateWardenToml(): string {
|
|
|
17
18
|
* Template for GitHub Actions workflow file.
|
|
18
19
|
*/
|
|
19
20
|
function generateWorkflowYaml(): string {
|
|
21
|
+
const majorVersion = getMajorVersion();
|
|
20
22
|
return `name: Warden
|
|
21
23
|
|
|
22
24
|
on:
|
|
@@ -33,7 +35,7 @@ jobs:
|
|
|
33
35
|
runs-on: ubuntu-latest
|
|
34
36
|
steps:
|
|
35
37
|
- uses: actions/checkout@v4
|
|
36
|
-
- uses: getsentry/warden@
|
|
38
|
+
- uses: getsentry/warden@v${majorVersion}
|
|
37
39
|
with:
|
|
38
40
|
anthropic-api-key: \${{ secrets.WARDEN_ANTHROPIC_API_KEY }}
|
|
39
41
|
`;
|
|
@@ -13,8 +13,7 @@ import {
|
|
|
13
13
|
} from './formatters.js';
|
|
14
14
|
import { BoxRenderer } from './box.js';
|
|
15
15
|
import { ICON_CHECK } from './icons.js';
|
|
16
|
-
|
|
17
|
-
const VERSION = '0.1.0';
|
|
16
|
+
import { getVersion } from '../../utils/index.js';
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* ASCII art logo for TTY header.
|
|
@@ -82,10 +81,10 @@ export class Reporter {
|
|
|
82
81
|
for (const line of LOGO.split('\n')) {
|
|
83
82
|
this.log(chalk.dim(line));
|
|
84
83
|
}
|
|
85
|
-
this.log(chalk.dim(`v${
|
|
84
|
+
this.log(chalk.dim(`v${getVersion()}`));
|
|
86
85
|
this.log('');
|
|
87
86
|
} else {
|
|
88
|
-
this.logCI(`Warden v${
|
|
87
|
+
this.logCI(`Warden v${getVersion()}`);
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
|
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
let cachedVersion: string | undefined;
|
|
6
|
+
|
|
7
|
+
export function getVersion(): string {
|
|
8
|
+
if (cachedVersion) return cachedVersion;
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, '..', '..', 'package.json'), 'utf-8')) as { version: string };
|
|
11
|
+
cachedVersion = pkg.version;
|
|
12
|
+
return cachedVersion;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function getMajorVersion(): string {
|
|
16
|
+
return getVersion().split('.')[0] ?? '0';
|
|
17
|
+
}
|