@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,191 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
/**
|
|
3
|
+
* Unicode box-drawing characters for TTY mode.
|
|
4
|
+
*/
|
|
5
|
+
const BOX = {
|
|
6
|
+
topLeft: '┌',
|
|
7
|
+
topRight: '┐',
|
|
8
|
+
bottomLeft: '└',
|
|
9
|
+
bottomRight: '┘',
|
|
10
|
+
horizontal: '─',
|
|
11
|
+
vertical: '│',
|
|
12
|
+
leftT: '├',
|
|
13
|
+
rightT: '┤',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Renders box-style containers for terminal output.
|
|
17
|
+
* Supports TTY mode with Unicode box characters and CI mode with plain text.
|
|
18
|
+
*/
|
|
19
|
+
export class BoxRenderer {
|
|
20
|
+
title;
|
|
21
|
+
badge;
|
|
22
|
+
mode;
|
|
23
|
+
width;
|
|
24
|
+
lines = [];
|
|
25
|
+
constructor(options) {
|
|
26
|
+
this.title = options.title;
|
|
27
|
+
this.badge = options.badge;
|
|
28
|
+
this.mode = options.mode;
|
|
29
|
+
// Calculate width based on terminal columns, with min/max constraints
|
|
30
|
+
const minWidth = options.minWidth ?? 50;
|
|
31
|
+
const maxWidth = Math.min(options.mode.columns - 2, 100);
|
|
32
|
+
this.width = Math.max(minWidth, maxWidth);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Render the top border with title and optional badge.
|
|
36
|
+
* TTY: ┌─ title ─────────────────────── badge ─┐
|
|
37
|
+
* CI: === title (badge) ===
|
|
38
|
+
*/
|
|
39
|
+
header() {
|
|
40
|
+
if (this.mode.isTTY) {
|
|
41
|
+
const titlePart = `${BOX.horizontal} ${this.title} `;
|
|
42
|
+
const badgePart = this.badge ? ` ${this.badge} ${BOX.horizontal}` : BOX.horizontal;
|
|
43
|
+
const titleLen = this.stripAnsi(titlePart).length;
|
|
44
|
+
const badgeLen = this.stripAnsi(badgePart).length;
|
|
45
|
+
const fillLen = Math.max(0, this.width - titleLen - badgeLen - 2);
|
|
46
|
+
const fill = BOX.horizontal.repeat(fillLen);
|
|
47
|
+
this.lines.push(chalk.dim(BOX.topLeft) +
|
|
48
|
+
chalk.dim(BOX.horizontal) + ' ' +
|
|
49
|
+
chalk.bold(this.title) +
|
|
50
|
+
' ' + chalk.dim(fill) +
|
|
51
|
+
(this.badge ? chalk.dim(` ${this.badge} `) : '') +
|
|
52
|
+
chalk.dim(BOX.horizontal + BOX.topRight));
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
const badgePart = this.badge ? ` (${this.badge})` : '';
|
|
56
|
+
this.lines.push(`=== ${this.title}${badgePart} ===`);
|
|
57
|
+
}
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get the available content width (excluding borders and padding).
|
|
62
|
+
*/
|
|
63
|
+
get contentWidth() {
|
|
64
|
+
return this.width - 4; // 2 for borders + 2 for padding spaces
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Add content lines with side borders (TTY) or plain (CI).
|
|
68
|
+
* Long lines are automatically wrapped to fit within the box.
|
|
69
|
+
*/
|
|
70
|
+
content(contentLines) {
|
|
71
|
+
const lines = Array.isArray(contentLines) ? contentLines : [contentLines];
|
|
72
|
+
for (const line of lines) {
|
|
73
|
+
// Wrap long lines to fit within the box
|
|
74
|
+
const wrappedLines = this.wrapLine(line);
|
|
75
|
+
for (const wrappedLine of wrappedLines) {
|
|
76
|
+
if (this.mode.isTTY) {
|
|
77
|
+
const strippedLen = this.stripAnsi(wrappedLine).length;
|
|
78
|
+
const padding = Math.max(0, this.width - strippedLen - 4);
|
|
79
|
+
this.lines.push(chalk.dim(BOX.vertical) + ' ' + wrappedLine + ' '.repeat(padding) + ' ' + chalk.dim(BOX.vertical));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
this.lines.push(wrappedLine);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Wrap a line to fit within the content width.
|
|
90
|
+
* Preserves leading indentation on wrapped lines.
|
|
91
|
+
*/
|
|
92
|
+
wrapLine(line) {
|
|
93
|
+
const maxWidth = this.contentWidth;
|
|
94
|
+
const stripped = this.stripAnsi(line);
|
|
95
|
+
// If it fits, return as-is
|
|
96
|
+
if (stripped.length <= maxWidth) {
|
|
97
|
+
return [line];
|
|
98
|
+
}
|
|
99
|
+
// For lines with ANSI codes, we need to be careful.
|
|
100
|
+
// For simplicity, if the line has ANSI codes and is too long,
|
|
101
|
+
// we'll wrap the stripped version and lose formatting on continuation lines.
|
|
102
|
+
const hasAnsi = line !== stripped;
|
|
103
|
+
// Detect leading indentation
|
|
104
|
+
const indentMatch = stripped.match(/^(\s*)/);
|
|
105
|
+
const indent = indentMatch?.[1] ?? '';
|
|
106
|
+
const textToWrap = hasAnsi ? stripped : line;
|
|
107
|
+
const result = [];
|
|
108
|
+
let remaining = textToWrap;
|
|
109
|
+
let isFirstLine = true;
|
|
110
|
+
while (remaining.length > 0) {
|
|
111
|
+
const currentIndent = isFirstLine ? '' : indent;
|
|
112
|
+
const availableWidth = maxWidth - currentIndent.length;
|
|
113
|
+
if (this.stripAnsi(remaining).length <= availableWidth) {
|
|
114
|
+
result.push(currentIndent + remaining);
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
// Find a good break point (prefer word boundaries)
|
|
118
|
+
let breakPoint = availableWidth;
|
|
119
|
+
const searchStart = Math.max(0, availableWidth - 20);
|
|
120
|
+
for (let i = availableWidth; i >= searchStart; i--) {
|
|
121
|
+
if (remaining[i] === ' ') {
|
|
122
|
+
breakPoint = i;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// If no space found, hard break at max width
|
|
127
|
+
if (breakPoint === availableWidth && remaining[availableWidth] !== ' ') {
|
|
128
|
+
breakPoint = availableWidth;
|
|
129
|
+
}
|
|
130
|
+
const chunk = remaining.slice(0, breakPoint);
|
|
131
|
+
result.push(currentIndent + chunk);
|
|
132
|
+
// Skip the space at the break point if there is one
|
|
133
|
+
remaining = remaining.slice(breakPoint).trimStart();
|
|
134
|
+
isFirstLine = false;
|
|
135
|
+
}
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Add an empty content line.
|
|
140
|
+
*/
|
|
141
|
+
blank() {
|
|
142
|
+
return this.content('');
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Render a horizontal divider.
|
|
146
|
+
* TTY: ├─────────────────────────────────────────────┤
|
|
147
|
+
* CI: ---
|
|
148
|
+
*/
|
|
149
|
+
divider() {
|
|
150
|
+
if (this.mode.isTTY) {
|
|
151
|
+
const fill = BOX.horizontal.repeat(this.width - 2);
|
|
152
|
+
this.lines.push(chalk.dim(BOX.leftT + fill + BOX.rightT));
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
this.lines.push('---');
|
|
156
|
+
}
|
|
157
|
+
return this;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Render the bottom border.
|
|
161
|
+
* TTY: └─────────────────────────────────────────────┘
|
|
162
|
+
* CI: (nothing in CI mode - just ends)
|
|
163
|
+
*/
|
|
164
|
+
footer() {
|
|
165
|
+
if (this.mode.isTTY) {
|
|
166
|
+
const fill = BOX.horizontal.repeat(this.width - 2);
|
|
167
|
+
this.lines.push(chalk.dim(BOX.bottomLeft + fill + BOX.bottomRight));
|
|
168
|
+
}
|
|
169
|
+
return this;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Get all rendered lines.
|
|
173
|
+
*/
|
|
174
|
+
render() {
|
|
175
|
+
return [...this.lines];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Get the rendered output as a single string.
|
|
179
|
+
*/
|
|
180
|
+
toString() {
|
|
181
|
+
return this.lines.join('\n');
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Strip ANSI escape codes from a string for length calculation.
|
|
185
|
+
*/
|
|
186
|
+
stripAnsi(str) {
|
|
187
|
+
// eslint-disable-next-line no-control-regex
|
|
188
|
+
return str.replace(/\x1b\[[0-9;]*m/g, '');
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=box.js.map
|
|
@@ -0,0 +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AC,CAAC;YACnD,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,GAAG,IAAI,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACK,SAAS,CAAC,GAAW;QAC3B,4CAA4C;QAC5C,OAAO,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { Severity, Finding, FileChange, UsageStats } from '../../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Pluralize a word based on count.
|
|
4
|
+
* @example pluralize(1, 'file') // 'file'
|
|
5
|
+
* @example pluralize(2, 'file') // 'files'
|
|
6
|
+
* @example pluralize(1, 'fix', 'fixes') // 'fix'
|
|
7
|
+
* @example pluralize(2, 'fix', 'fixes') // 'fixes'
|
|
8
|
+
*/
|
|
9
|
+
export declare function pluralize(count: number, singular: string, plural?: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Format a duration in milliseconds to a human-readable string.
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatDuration(ms: number): string;
|
|
14
|
+
/**
|
|
15
|
+
* Format an elapsed time for display (e.g., "+0.8s").
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatElapsed(ms: number): string;
|
|
18
|
+
/**
|
|
19
|
+
* Format a severity dot for terminal output.
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatSeverityDot(severity: Severity): string;
|
|
22
|
+
/**
|
|
23
|
+
* Format a severity badge for terminal output (colored dot + severity text).
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatSeverityBadge(severity: Severity): string;
|
|
26
|
+
/**
|
|
27
|
+
* Format a severity for plain text (CI mode).
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatSeverityPlain(severity: Severity): string;
|
|
30
|
+
/**
|
|
31
|
+
* Format a file location string.
|
|
32
|
+
*/
|
|
33
|
+
export declare function formatLocation(path: string, startLine?: number, endLine?: number): string;
|
|
34
|
+
/**
|
|
35
|
+
* Format a finding for terminal display.
|
|
36
|
+
*/
|
|
37
|
+
export declare function formatFindingCompact(finding: Finding): string;
|
|
38
|
+
/**
|
|
39
|
+
* Format finding counts for display (with colored dots).
|
|
40
|
+
*/
|
|
41
|
+
export declare function formatFindingCounts(counts: Record<Severity, number>): string;
|
|
42
|
+
/**
|
|
43
|
+
* Format finding counts for plain text.
|
|
44
|
+
*/
|
|
45
|
+
export declare function formatFindingCountsPlain(counts: Record<Severity, number>): string;
|
|
46
|
+
/**
|
|
47
|
+
* Format a progress indicator like [1/3].
|
|
48
|
+
*/
|
|
49
|
+
export declare function formatProgress(current: number, total: number): string;
|
|
50
|
+
/**
|
|
51
|
+
* Format file change summary.
|
|
52
|
+
*/
|
|
53
|
+
export declare function formatFileStats(files: FileChange[]): string;
|
|
54
|
+
/**
|
|
55
|
+
* Truncate a string to fit within a width, adding ellipsis if needed.
|
|
56
|
+
*/
|
|
57
|
+
export declare function truncate(str: string, maxWidth: number): string;
|
|
58
|
+
/**
|
|
59
|
+
* Pad a string on the right to reach a certain width.
|
|
60
|
+
*/
|
|
61
|
+
export declare function padRight(str: string, width: number): string;
|
|
62
|
+
/**
|
|
63
|
+
* Count findings by severity.
|
|
64
|
+
*/
|
|
65
|
+
export declare function countBySeverity(findings: Finding[]): Record<Severity, number>;
|
|
66
|
+
/**
|
|
67
|
+
* Format a USD cost for display.
|
|
68
|
+
*/
|
|
69
|
+
export declare function formatCost(costUSD: number): string;
|
|
70
|
+
/**
|
|
71
|
+
* Format token counts for display.
|
|
72
|
+
*/
|
|
73
|
+
export declare function formatTokens(tokens: number): string;
|
|
74
|
+
/**
|
|
75
|
+
* Format usage stats for terminal display.
|
|
76
|
+
*/
|
|
77
|
+
export declare function formatUsage(usage: UsageStats): string;
|
|
78
|
+
/**
|
|
79
|
+
* Format usage stats for plain text display.
|
|
80
|
+
*/
|
|
81
|
+
export declare function formatUsagePlain(usage: UsageStats): string;
|
|
82
|
+
/**
|
|
83
|
+
* Format stats (duration, tokens, cost) into a compact single-line format.
|
|
84
|
+
* Used for markdown footers in PR comments and check annotations.
|
|
85
|
+
*
|
|
86
|
+
* @example formatStatsCompact(15800, { inputTokens: 3000, outputTokens: 680, costUSD: 0.0048 })
|
|
87
|
+
* // Returns: "⏱ 15.8s · 3.0k in / 680 out · $0.0048"
|
|
88
|
+
*/
|
|
89
|
+
export declare function formatStatsCompact(durationMs?: number, usage?: UsageStats): string;
|
|
90
|
+
//# sourceMappingURL=formatters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../src/cli/output/formatters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEtF;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAGlF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAKhD;AAaD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAG5D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAA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CAOrD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAO1D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,MAAM,CAclF"}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import figures from 'figures';
|
|
3
|
+
/**
|
|
4
|
+
* Pluralize a word based on count.
|
|
5
|
+
* @example pluralize(1, 'file') // 'file'
|
|
6
|
+
* @example pluralize(2, 'file') // 'files'
|
|
7
|
+
* @example pluralize(1, 'fix', 'fixes') // 'fix'
|
|
8
|
+
* @example pluralize(2, 'fix', 'fixes') // 'fixes'
|
|
9
|
+
*/
|
|
10
|
+
export function pluralize(count, singular, plural) {
|
|
11
|
+
if (count === 1)
|
|
12
|
+
return singular;
|
|
13
|
+
return plural ?? `${singular}s`;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Format a duration in milliseconds to a human-readable string.
|
|
17
|
+
*/
|
|
18
|
+
export function formatDuration(ms) {
|
|
19
|
+
if (ms < 1000) {
|
|
20
|
+
return `${Math.round(ms)}ms`;
|
|
21
|
+
}
|
|
22
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Format an elapsed time for display (e.g., "+0.8s").
|
|
26
|
+
*/
|
|
27
|
+
export function formatElapsed(ms) {
|
|
28
|
+
if (ms < 1000) {
|
|
29
|
+
return `+${Math.round(ms)}ms`;
|
|
30
|
+
}
|
|
31
|
+
return `+${(ms / 1000).toFixed(1)}s`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Severity configuration for display.
|
|
35
|
+
*/
|
|
36
|
+
const SEVERITY_CONFIG = {
|
|
37
|
+
critical: { color: chalk.red, symbol: figures.bullet },
|
|
38
|
+
high: { color: chalk.redBright, symbol: figures.bullet },
|
|
39
|
+
medium: { color: chalk.yellow, symbol: figures.bullet },
|
|
40
|
+
low: { color: chalk.green, symbol: figures.bullet },
|
|
41
|
+
info: { color: chalk.blue, symbol: figures.bullet },
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Format a severity dot for terminal output.
|
|
45
|
+
*/
|
|
46
|
+
export function formatSeverityDot(severity) {
|
|
47
|
+
const config = SEVERITY_CONFIG[severity];
|
|
48
|
+
return config.color(config.symbol);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Format a severity badge for terminal output (colored dot + severity text).
|
|
52
|
+
*/
|
|
53
|
+
export function formatSeverityBadge(severity) {
|
|
54
|
+
const config = SEVERITY_CONFIG[severity];
|
|
55
|
+
return `${config.color(config.symbol)} ${config.color(`(${severity})`)}`;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Format a severity for plain text (CI mode).
|
|
59
|
+
*/
|
|
60
|
+
export function formatSeverityPlain(severity) {
|
|
61
|
+
return `[${severity}]`;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Format a file location string.
|
|
65
|
+
*/
|
|
66
|
+
export function formatLocation(path, startLine, endLine) {
|
|
67
|
+
if (!startLine) {
|
|
68
|
+
return path;
|
|
69
|
+
}
|
|
70
|
+
if (endLine && endLine !== startLine) {
|
|
71
|
+
return `${path}:${startLine}-${endLine}`;
|
|
72
|
+
}
|
|
73
|
+
return `${path}:${startLine}`;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Format a finding for terminal display.
|
|
77
|
+
*/
|
|
78
|
+
export function formatFindingCompact(finding) {
|
|
79
|
+
const badge = formatSeverityBadge(finding.severity);
|
|
80
|
+
const location = finding.location
|
|
81
|
+
? chalk.dim(formatLocation(finding.location.path, finding.location.startLine, finding.location.endLine))
|
|
82
|
+
: '';
|
|
83
|
+
return `${badge} ${finding.title}${location ? ` ${location}` : ''}`;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Format finding counts for display (with colored dots).
|
|
87
|
+
*/
|
|
88
|
+
export function formatFindingCounts(counts) {
|
|
89
|
+
const total = Object.values(counts).reduce((a, b) => a + b, 0);
|
|
90
|
+
if (total === 0) {
|
|
91
|
+
return chalk.green('No findings');
|
|
92
|
+
}
|
|
93
|
+
const parts = [];
|
|
94
|
+
if (counts.critical > 0)
|
|
95
|
+
parts.push(`${formatSeverityDot('critical')} ${counts.critical} critical`);
|
|
96
|
+
if (counts.high > 0)
|
|
97
|
+
parts.push(`${formatSeverityDot('high')} ${counts.high} high`);
|
|
98
|
+
if (counts.medium > 0)
|
|
99
|
+
parts.push(`${formatSeverityDot('medium')} ${counts.medium} medium`);
|
|
100
|
+
if (counts.low > 0)
|
|
101
|
+
parts.push(`${formatSeverityDot('low')} ${counts.low} low`);
|
|
102
|
+
if (counts.info > 0)
|
|
103
|
+
parts.push(`${formatSeverityDot('info')} ${counts.info} info`);
|
|
104
|
+
return `${total} finding${total === 1 ? '' : 's'}: ${parts.join(' ')}`;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Format finding counts for plain text.
|
|
108
|
+
*/
|
|
109
|
+
export function formatFindingCountsPlain(counts) {
|
|
110
|
+
const total = Object.values(counts).reduce((a, b) => a + b, 0);
|
|
111
|
+
if (total === 0) {
|
|
112
|
+
return 'No findings';
|
|
113
|
+
}
|
|
114
|
+
const parts = [];
|
|
115
|
+
if (counts.critical > 0)
|
|
116
|
+
parts.push(`${counts.critical} critical`);
|
|
117
|
+
if (counts.high > 0)
|
|
118
|
+
parts.push(`${counts.high} high`);
|
|
119
|
+
if (counts.medium > 0)
|
|
120
|
+
parts.push(`${counts.medium} medium`);
|
|
121
|
+
if (counts.low > 0)
|
|
122
|
+
parts.push(`${counts.low} low`);
|
|
123
|
+
if (counts.info > 0)
|
|
124
|
+
parts.push(`${counts.info} info`);
|
|
125
|
+
return `${total} finding${total === 1 ? '' : 's'} (${parts.join(', ')})`;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Format a progress indicator like [1/3].
|
|
129
|
+
*/
|
|
130
|
+
export function formatProgress(current, total) {
|
|
131
|
+
return chalk.dim(`[${current}/${total}]`);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Format file change summary.
|
|
135
|
+
*/
|
|
136
|
+
export function formatFileStats(files) {
|
|
137
|
+
const added = files.filter((f) => f.status === 'added').length;
|
|
138
|
+
const modified = files.filter((f) => f.status === 'modified').length;
|
|
139
|
+
const removed = files.filter((f) => f.status === 'removed').length;
|
|
140
|
+
const parts = [];
|
|
141
|
+
if (added > 0)
|
|
142
|
+
parts.push(chalk.green(`+${added}`));
|
|
143
|
+
if (modified > 0)
|
|
144
|
+
parts.push(chalk.yellow(`~${modified}`));
|
|
145
|
+
if (removed > 0)
|
|
146
|
+
parts.push(chalk.red(`-${removed}`));
|
|
147
|
+
return parts.length > 0 ? parts.join(' ') : '';
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Truncate a string to fit within a width, adding ellipsis if needed.
|
|
151
|
+
*/
|
|
152
|
+
export function truncate(str, maxWidth) {
|
|
153
|
+
if (str.length <= maxWidth) {
|
|
154
|
+
return str;
|
|
155
|
+
}
|
|
156
|
+
if (maxWidth <= 3) {
|
|
157
|
+
return str.slice(0, maxWidth);
|
|
158
|
+
}
|
|
159
|
+
return str.slice(0, maxWidth - 1) + figures.ellipsis;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Pad a string on the right to reach a certain width.
|
|
163
|
+
*/
|
|
164
|
+
export function padRight(str, width) {
|
|
165
|
+
if (str.length >= width) {
|
|
166
|
+
return str;
|
|
167
|
+
}
|
|
168
|
+
return str + ' '.repeat(width - str.length);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Count findings by severity.
|
|
172
|
+
*/
|
|
173
|
+
export function countBySeverity(findings) {
|
|
174
|
+
const counts = {
|
|
175
|
+
critical: 0,
|
|
176
|
+
high: 0,
|
|
177
|
+
medium: 0,
|
|
178
|
+
low: 0,
|
|
179
|
+
info: 0,
|
|
180
|
+
};
|
|
181
|
+
for (const finding of findings) {
|
|
182
|
+
counts[finding.severity]++;
|
|
183
|
+
}
|
|
184
|
+
return counts;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Format a USD cost for display.
|
|
188
|
+
*/
|
|
189
|
+
export function formatCost(costUSD) {
|
|
190
|
+
if (costUSD < 0.01) {
|
|
191
|
+
return `$${costUSD.toFixed(4)}`;
|
|
192
|
+
}
|
|
193
|
+
return `$${costUSD.toFixed(2)}`;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Format token counts for display.
|
|
197
|
+
*/
|
|
198
|
+
export function formatTokens(tokens) {
|
|
199
|
+
if (tokens >= 1_000_000) {
|
|
200
|
+
return `${(tokens / 1_000_000).toFixed(1)}M`;
|
|
201
|
+
}
|
|
202
|
+
if (tokens >= 1_000) {
|
|
203
|
+
return `${(tokens / 1_000).toFixed(1)}k`;
|
|
204
|
+
}
|
|
205
|
+
return String(tokens);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Format usage stats for terminal display.
|
|
209
|
+
*/
|
|
210
|
+
export function formatUsage(usage) {
|
|
211
|
+
// Total input includes fresh tokens + cache reads
|
|
212
|
+
const totalInput = usage.inputTokens + (usage.cacheReadInputTokens ?? 0);
|
|
213
|
+
const inputStr = formatTokens(totalInput);
|
|
214
|
+
const outputStr = formatTokens(usage.outputTokens);
|
|
215
|
+
const costStr = formatCost(usage.costUSD);
|
|
216
|
+
return `${inputStr} in / ${outputStr} out · ${costStr}`;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Format usage stats for plain text display.
|
|
220
|
+
*/
|
|
221
|
+
export function formatUsagePlain(usage) {
|
|
222
|
+
// Total input includes fresh tokens + cache reads
|
|
223
|
+
const totalInput = usage.inputTokens + (usage.cacheReadInputTokens ?? 0);
|
|
224
|
+
const inputStr = formatTokens(totalInput);
|
|
225
|
+
const outputStr = formatTokens(usage.outputTokens);
|
|
226
|
+
const costStr = formatCost(usage.costUSD);
|
|
227
|
+
return `${inputStr} input, ${outputStr} output, ${costStr}`;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Format stats (duration, tokens, cost) into a compact single-line format.
|
|
231
|
+
* Used for markdown footers in PR comments and check annotations.
|
|
232
|
+
*
|
|
233
|
+
* @example formatStatsCompact(15800, { inputTokens: 3000, outputTokens: 680, costUSD: 0.0048 })
|
|
234
|
+
* // Returns: "⏱ 15.8s · 3.0k in / 680 out · $0.0048"
|
|
235
|
+
*/
|
|
236
|
+
export function formatStatsCompact(durationMs, usage) {
|
|
237
|
+
const parts = [];
|
|
238
|
+
if (durationMs !== undefined) {
|
|
239
|
+
parts.push(`⏱ ${formatDuration(durationMs)}`);
|
|
240
|
+
}
|
|
241
|
+
if (usage) {
|
|
242
|
+
const totalInput = usage.inputTokens + (usage.cacheReadInputTokens ?? 0);
|
|
243
|
+
parts.push(`${formatTokens(totalInput)} in / ${formatTokens(usage.outputTokens)} out`);
|
|
244
|
+
parts.push(formatCost(usage.costUSD));
|
|
245
|
+
}
|
|
246
|
+
return parts.join(' · ');
|
|
247
|
+
}
|
|
248
|
+
//# sourceMappingURL=formatters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../src/cli/output/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa,EAAE,QAAgB,EAAE,MAAe;IACxE,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACjC,OAAO,MAAM,IAAI,GAAG,QAAQ,GAAG,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CA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