@sentry/warden 0.1.0 → 0.2.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/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +3 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/setup-app/manifest.d.ts.map +1 -1
- package/dist/cli/commands/setup-app/manifest.js +3 -1
- package/dist/cli/commands/setup-app/manifest.js.map +1 -1
- package/dist/cli/commands/setup-app.js +1 -1
- package/dist/cli/commands/setup-app.js.map +1 -1
- package/dist/cli/files.d.ts +11 -1
- package/dist/cli/files.d.ts.map +1 -1
- package/dist/cli/files.js +145 -4
- package/dist/cli/files.js.map +1 -1
- package/dist/cli/git.d.ts.map +1 -1
- package/dist/cli/git.js +5 -9
- package/dist/cli/git.js.map +1 -1
- package/dist/cli/index.js +0 -0
- package/dist/cli/output/icons.d.ts +4 -0
- package/dist/cli/output/icons.d.ts.map +1 -1
- package/dist/cli/output/icons.js +4 -0
- package/dist/cli/output/icons.js.map +1 -1
- package/dist/cli/output/ink-runner.d.ts +20 -0
- package/dist/cli/output/ink-runner.d.ts.map +1 -1
- package/dist/cli/output/ink-runner.js +53 -19
- package/dist/cli/output/ink-runner.js.map +1 -1
- package/dist/cli/output/tasks.d.ts.map +1 -1
- package/dist/cli/output/tasks.js +5 -1
- package/dist/cli/output/tasks.js.map +1 -1
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +15 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/diff/coalesce.d.ts +32 -2
- package/dist/diff/coalesce.d.ts.map +1 -1
- package/dist/diff/coalesce.js +174 -2
- package/dist/diff/coalesce.js.map +1 -1
- package/dist/output/dedup.d.ts.map +1 -1
- package/dist/output/dedup.js +8 -3
- package/dist/output/dedup.js.map +1 -1
- package/dist/output/renderer.d.ts.map +1 -1
- package/dist/output/renderer.js +49 -5
- package/dist/output/renderer.js.map +1 -1
- package/dist/output/stale.d.ts.map +1 -1
- package/dist/output/stale.js +7 -0
- package/dist/output/stale.js.map +1 -1
- package/dist/output/types.d.ts +15 -1
- package/dist/output/types.d.ts.map +1 -1
- package/dist/sdk/analyze.d.ts +18 -0
- package/dist/sdk/analyze.d.ts.map +1 -0
- package/dist/sdk/analyze.js +425 -0
- package/dist/sdk/analyze.js.map +1 -0
- package/dist/sdk/errors.d.ts +23 -0
- package/dist/sdk/errors.d.ts.map +1 -0
- package/dist/sdk/errors.js +72 -0
- package/dist/sdk/errors.js.map +1 -0
- package/dist/sdk/extract.d.ts +44 -0
- package/dist/sdk/extract.d.ts.map +1 -0
- package/dist/sdk/extract.js +224 -0
- package/dist/sdk/extract.js.map +1 -0
- package/dist/sdk/prepare.d.ts +13 -0
- package/dist/sdk/prepare.d.ts.map +1 -0
- package/dist/sdk/prepare.js +73 -0
- package/dist/sdk/prepare.js.map +1 -0
- package/dist/sdk/prompt.d.ts +30 -0
- package/dist/sdk/prompt.d.ts.map +1 -0
- package/dist/sdk/prompt.js +109 -0
- package/dist/sdk/prompt.js.map +1 -0
- package/dist/sdk/retry.d.ts +12 -0
- package/dist/sdk/retry.d.ts.map +1 -0
- package/dist/sdk/retry.js +31 -0
- package/dist/sdk/retry.js.map +1 -0
- package/dist/sdk/runner.d.ts +22 -199
- package/dist/sdk/runner.d.ts.map +1 -1
- package/dist/sdk/runner.js +26 -884
- package/dist/sdk/runner.js.map +1 -1
- package/dist/sdk/types.d.ts +127 -0
- package/dist/sdk/types.d.ts.map +1 -0
- package/dist/sdk/types.js +5 -0
- package/dist/sdk/types.js.map +1 -0
- package/dist/sdk/usage.d.ts +20 -0
- package/dist/sdk/usage.d.ts.map +1 -0
- package/dist/sdk/usage.js +44 -0
- package/dist/sdk/usage.js.map +1 -0
- package/dist/skills/remote.d.ts.map +1 -1
- package/dist/skills/remote.js +3 -7
- package/dist/skills/remote.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/exec.d.ts +61 -0
- package/dist/utils/exec.d.ts.map +1 -0
- package/dist/utils/exec.js +111 -0
- package/dist/utils/exec.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +15 -16
- package/.agents/skills/find-bugs/SKILL.md +0 -75
- package/.agents/skills/vercel-react-best-practices/AGENTS.md +0 -2934
- package/.agents/skills/vercel-react-best-practices/SKILL.md +0 -136
- package/.agents/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
- package/.agents/skills/vercel-react-best-practices/rules/advanced-init-once.md +0 -42
- package/.agents/skills/vercel-react-best-practices/rules/advanced-use-latest.md +0 -39
- package/.agents/skills/vercel-react-best-practices/rules/async-api-routes.md +0 -38
- package/.agents/skills/vercel-react-best-practices/rules/async-defer-await.md +0 -80
- package/.agents/skills/vercel-react-best-practices/rules/async-dependencies.md +0 -51
- package/.agents/skills/vercel-react-best-practices/rules/async-parallel.md +0 -28
- package/.agents/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
- package/.agents/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -59
- package/.agents/skills/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
- package/.agents/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
- package/.agents/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
- package/.agents/skills/vercel-react-best-practices/rules/bundle-preload.md +0 -50
- package/.agents/skills/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
- package/.agents/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
- package/.agents/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
- package/.agents/skills/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
- package/.agents/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -107
- package/.agents/skills/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
- package/.agents/skills/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
- package/.agents/skills/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
- package/.agents/skills/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
- package/.agents/skills/vercel-react-best-practices/rules/js-early-exit.md +0 -50
- package/.agents/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
- package/.agents/skills/vercel-react-best-practices/rules/js-index-maps.md +0 -37
- package/.agents/skills/vercel-react-best-practices/rules/js-length-check-first.md +0 -49
- package/.agents/skills/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
- package/.agents/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
- package/.agents/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
- package/.agents/skills/vercel-react-best-practices/rules/rendering-activity.md +0 -26
- package/.agents/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
- package/.agents/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
- package/.agents/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
- package/.agents/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
- package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
- package/.agents/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +0 -30
- package/.agents/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
- package/.agents/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +0 -75
- package/.agents/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
- package/.agents/skills/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
- package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +0 -40
- package/.agents/skills/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
- package/.agents/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
- package/.agents/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
- package/.agents/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +0 -38
- package/.agents/skills/vercel-react-best-practices/rules/rerender-memo.md +0 -44
- package/.agents/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +0 -45
- package/.agents/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -35
- package/.agents/skills/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
- package/.agents/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +0 -73
- package/.agents/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
- package/.agents/skills/vercel-react-best-practices/rules/server-auth-actions.md +0 -96
- package/.agents/skills/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
- package/.agents/skills/vercel-react-best-practices/rules/server-cache-react.md +0 -76
- package/.agents/skills/vercel-react-best-practices/rules/server-dedup-props.md +0 -65
- package/.agents/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
- package/.agents/skills/vercel-react-best-practices/rules/server-serialization.md +0 -38
- package/.claude/settings.json +0 -57
- package/.claude/skills/agent-prompt/SKILL.md +0 -54
- package/.claude/skills/agent-prompt/references/agentic-patterns.md +0 -94
- package/.claude/skills/agent-prompt/references/anti-patterns.md +0 -140
- package/.claude/skills/agent-prompt/references/context-design.md +0 -124
- package/.claude/skills/agent-prompt/references/core-principles.md +0 -75
- package/.claude/skills/agent-prompt/references/model-guidance.md +0 -118
- package/.claude/skills/agent-prompt/references/output-formats.md +0 -98
- package/.claude/skills/agent-prompt/references/skill-structure.md +0 -115
- package/.claude/skills/agent-prompt/references/system-prompts.md +0 -115
- package/.claude/skills/notseer/SKILL.md +0 -131
- package/.claude/skills/skill-writer/SKILL.md +0 -140
- package/.claude/skills/testing-guidelines/SKILL.md +0 -132
- package/.claude/skills/warden-skill/SKILL.md +0 -250
- package/.claude/skills/warden-skill/references/config-schema.md +0 -133
- package/.dex/config.toml +0 -2
- package/.github/workflows/ci.yml +0 -33
- package/.github/workflows/release.yml +0 -59
- package/.github/workflows/warden.yml +0 -40
- package/AGENTS.md +0 -89
- package/CONTRIBUTING.md +0 -60
- package/SPEC.md +0 -263
- package/action.yml +0 -87
- package/assets/favicon.png +0 -0
- package/assets/warden-icon-bw.svg +0 -5
- package/assets/warden-icon-purple.png +0 -0
- package/assets/warden-icon-purple.svg +0 -5
- package/dist/action/159.index.js +0 -523
- package/dist/action/159.index.js.map +0 -1
- package/dist/action/action/index.d.ts +0 -2
- package/dist/action/action/index.d.ts.map +0 -1
- package/dist/action/action/main.d.ts +0 -2
- package/dist/action/action/main.d.ts.map +0 -1
- package/dist/action/cli/args.d.ts +0 -74
- package/dist/action/cli/args.d.ts.map +0 -1
- package/dist/action/cli/args.test.d.ts +0 -2
- package/dist/action/cli/args.test.d.ts.map +0 -1
- package/dist/action/cli/commands/add.d.ts +0 -7
- package/dist/action/cli/commands/add.d.ts.map +0 -1
- package/dist/action/cli/commands/init.d.ts +0 -10
- package/dist/action/cli/commands/init.d.ts.map +0 -1
- package/dist/action/cli/commands/init.test.d.ts +0 -2
- package/dist/action/cli/commands/init.test.d.ts.map +0 -1
- package/dist/action/cli/commands/setup-app/browser.d.ts +0 -9
- package/dist/action/cli/commands/setup-app/browser.d.ts.map +0 -1
- package/dist/action/cli/commands/setup-app/credentials.d.ts +0 -15
- package/dist/action/cli/commands/setup-app/credentials.d.ts.map +0 -1
- package/dist/action/cli/commands/setup-app/manifest.d.ts +0 -24
- package/dist/action/cli/commands/setup-app/manifest.d.ts.map +0 -1
- package/dist/action/cli/commands/setup-app/server.d.ts +0 -28
- package/dist/action/cli/commands/setup-app/server.d.ts.map +0 -1
- package/dist/action/cli/commands/setup-app.d.ts +0 -11
- package/dist/action/cli/commands/setup-app.d.ts.map +0 -1
- package/dist/action/cli/commands/sync.d.ts +0 -9
- package/dist/action/cli/commands/sync.d.ts.map +0 -1
- package/dist/action/cli/context.d.ts +0 -27
- package/dist/action/cli/context.d.ts.map +0 -1
- package/dist/action/cli/files.d.ts +0 -22
- package/dist/action/cli/files.d.ts.map +0 -1
- package/dist/action/cli/files.test.d.ts +0 -2
- package/dist/action/cli/files.test.d.ts.map +0 -1
- package/dist/action/cli/fix.d.ts +0 -41
- package/dist/action/cli/fix.d.ts.map +0 -1
- package/dist/action/cli/fix.test.d.ts +0 -2
- package/dist/action/cli/fix.test.d.ts.map +0 -1
- package/dist/action/cli/git.d.ts +0 -73
- package/dist/action/cli/git.d.ts.map +0 -1
- package/dist/action/cli/git.test.d.ts +0 -2
- package/dist/action/cli/git.test.d.ts.map +0 -1
- package/dist/action/cli/index.d.ts +0 -3
- package/dist/action/cli/index.d.ts.map +0 -1
- package/dist/action/cli/main.d.ts +0 -7
- package/dist/action/cli/main.d.ts.map +0 -1
- package/dist/action/cli/output/box.d.ts +0 -75
- package/dist/action/cli/output/box.d.ts.map +0 -1
- package/dist/action/cli/output/formatters.d.ts +0 -90
- package/dist/action/cli/output/formatters.d.ts.map +0 -1
- package/dist/action/cli/output/formatters.test.d.ts +0 -2
- package/dist/action/cli/output/formatters.test.d.ts.map +0 -1
- package/dist/action/cli/output/icons.d.ts +0 -11
- package/dist/action/cli/output/icons.d.ts.map +0 -1
- package/dist/action/cli/output/index.d.ts +0 -10
- package/dist/action/cli/output/index.d.ts.map +0 -1
- package/dist/action/cli/output/ink-runner.d.ts +0 -9
- package/dist/action/cli/output/ink-runner.d.ts.map +0 -1
- package/dist/action/cli/output/jsonl.d.ts +0 -43
- package/dist/action/cli/output/jsonl.d.ts.map +0 -1
- package/dist/action/cli/output/jsonl.test.d.ts +0 -2
- package/dist/action/cli/output/jsonl.test.d.ts.map +0 -1
- package/dist/action/cli/output/reporter.d.ts +0 -108
- package/dist/action/cli/output/reporter.d.ts.map +0 -1
- package/dist/action/cli/output/tasks.d.ts +0 -89
- package/dist/action/cli/output/tasks.d.ts.map +0 -1
- package/dist/action/cli/output/tty.d.ts +0 -21
- package/dist/action/cli/output/tty.d.ts.map +0 -1
- package/dist/action/cli/output/tty.test.d.ts +0 -2
- package/dist/action/cli/output/tty.test.d.ts.map +0 -1
- package/dist/action/cli/output/verbosity.d.ts +0 -20
- package/dist/action/cli/output/verbosity.d.ts.map +0 -1
- package/dist/action/cli/output/verbosity.test.d.ts +0 -2
- package/dist/action/cli/output/verbosity.test.d.ts.map +0 -1
- package/dist/action/cli/terminal.d.ts +0 -19
- package/dist/action/cli/terminal.d.ts.map +0 -1
- package/dist/action/cli/terminal.test.d.ts +0 -2
- package/dist/action/cli/terminal.test.d.ts.map +0 -1
- package/dist/action/config/index.d.ts +0 -4
- package/dist/action/config/index.d.ts.map +0 -1
- package/dist/action/config/loader.d.ts +0 -27
- package/dist/action/config/loader.d.ts.map +0 -1
- package/dist/action/config/loader.test.d.ts +0 -2
- package/dist/action/config/loader.test.d.ts.map +0 -1
- package/dist/action/config/schema.d.ts +0 -318
- package/dist/action/config/schema.d.ts.map +0 -1
- package/dist/action/config/writer.d.ts +0 -11
- package/dist/action/config/writer.d.ts.map +0 -1
- package/dist/action/config/writer.test.d.ts +0 -2
- package/dist/action/config/writer.test.d.ts.map +0 -1
- package/dist/action/diff/classify.d.ts +0 -29
- package/dist/action/diff/classify.d.ts.map +0 -1
- package/dist/action/diff/classify.test.d.ts +0 -2
- package/dist/action/diff/classify.test.d.ts.map +0 -1
- package/dist/action/diff/coalesce.d.ts +0 -42
- package/dist/action/diff/coalesce.d.ts.map +0 -1
- package/dist/action/diff/coalesce.test.d.ts +0 -2
- package/dist/action/diff/coalesce.test.d.ts.map +0 -1
- package/dist/action/diff/context.d.ts +0 -30
- package/dist/action/diff/context.d.ts.map +0 -1
- package/dist/action/diff/context.test.d.ts +0 -2
- package/dist/action/diff/context.test.d.ts.map +0 -1
- package/dist/action/diff/index.d.ts +0 -5
- package/dist/action/diff/index.d.ts.map +0 -1
- package/dist/action/diff/parser.d.ts +0 -52
- package/dist/action/diff/parser.d.ts.map +0 -1
- package/dist/action/diff/parser.test.d.ts +0 -2
- package/dist/action/diff/parser.test.d.ts.map +0 -1
- package/dist/action/event/context.d.ts +0 -9
- package/dist/action/event/context.d.ts.map +0 -1
- package/dist/action/event/index.d.ts +0 -3
- package/dist/action/event/index.d.ts.map +0 -1
- package/dist/action/event/schedule-context.d.ts +0 -30
- package/dist/action/event/schedule-context.d.ts.map +0 -1
- package/dist/action/examples/examples.integration.test.d.ts +0 -2
- package/dist/action/examples/examples.integration.test.d.ts.map +0 -1
- package/dist/action/examples/index.d.ts +0 -50
- package/dist/action/examples/index.d.ts.map +0 -1
- package/dist/action/examples/index.test.d.ts +0 -2
- package/dist/action/examples/index.test.d.ts.map +0 -1
- package/dist/action/examples/setup.d.ts +0 -2
- package/dist/action/examples/setup.d.ts.map +0 -1
- package/dist/action/index.d.ts +0 -11
- package/dist/action/index.d.ts.map +0 -1
- package/dist/action/index.js +0 -38231
- package/dist/action/index.js.map +0 -1
- package/dist/action/licenses.txt +0 -992
- package/dist/action/main.d.ts +0 -2
- package/dist/action/main.d.ts.map +0 -1
- package/dist/action/main.js +0 -707
- package/dist/action/main.js.map +0 -1
- package/dist/action/output/dedup.d.ts +0 -153
- package/dist/action/output/dedup.d.ts.map +0 -1
- package/dist/action/output/dedup.test.d.ts +0 -2
- package/dist/action/output/dedup.test.d.ts.map +0 -1
- package/dist/action/output/github-checks.d.ts +0 -106
- package/dist/action/output/github-checks.d.ts.map +0 -1
- package/dist/action/output/github-checks.test.d.ts +0 -2
- package/dist/action/output/github-checks.test.d.ts.map +0 -1
- package/dist/action/output/github-issues.d.ts +0 -35
- package/dist/action/output/github-issues.d.ts.map +0 -1
- package/dist/action/output/index.d.ts +0 -6
- package/dist/action/output/index.d.ts.map +0 -1
- package/dist/action/output/issue-renderer.d.ts +0 -20
- package/dist/action/output/issue-renderer.d.ts.map +0 -1
- package/dist/action/output/renderer.d.ts +0 -4
- package/dist/action/output/renderer.d.ts.map +0 -1
- package/dist/action/output/renderer.test.d.ts +0 -2
- package/dist/action/output/renderer.test.d.ts.map +0 -1
- package/dist/action/output/stale.d.ts +0 -31
- package/dist/action/output/stale.d.ts.map +0 -1
- package/dist/action/output/stale.test.d.ts +0 -2
- package/dist/action/output/stale.test.d.ts.map +0 -1
- package/dist/action/output/types.d.ts +0 -31
- package/dist/action/output/types.d.ts.map +0 -1
- package/dist/action/package.json +0 -3
- package/dist/action/sdk/index.d.ts +0 -2
- package/dist/action/sdk/index.d.ts.map +0 -1
- package/dist/action/sdk/runner.d.ts +0 -202
- package/dist/action/sdk/runner.d.ts.map +0 -1
- package/dist/action/sdk/runner.test.d.ts +0 -2
- package/dist/action/sdk/runner.test.d.ts.map +0 -1
- package/dist/action/skills/index.d.ts +0 -5
- package/dist/action/skills/index.d.ts.map +0 -1
- package/dist/action/skills/loader.d.ts +0 -111
- package/dist/action/skills/loader.d.ts.map +0 -1
- package/dist/action/skills/loader.test.d.ts +0 -2
- package/dist/action/skills/loader.test.d.ts.map +0 -1
- package/dist/action/skills/remote.d.ts +0 -117
- package/dist/action/skills/remote.d.ts.map +0 -1
- package/dist/action/skills/remote.test.d.ts +0 -2
- package/dist/action/skills/remote.test.d.ts.map +0 -1
- package/dist/action/sourcemap-register.cjs +0 -1
- package/dist/action/triggers/matcher.d.ts +0 -30
- package/dist/action/triggers/matcher.d.ts.map +0 -1
- package/dist/action/triggers/matcher.test.d.ts +0 -2
- package/dist/action/triggers/matcher.test.d.ts.map +0 -1
- package/dist/action/types/index.d.ts +0 -269
- package/dist/action/types/index.d.ts.map +0 -1
- package/dist/action/utils/async.d.ts +0 -5
- package/dist/action/utils/async.d.ts.map +0 -1
- package/dist/action/utils/index.d.ts +0 -16
- package/dist/action/utils/index.d.ts.map +0 -1
- package/dist/action/utils/index.test.d.ts +0 -2
- package/dist/action/utils/index.test.d.ts.map +0 -1
- package/dist/action/utils/version.d.ts +0 -3
- package/dist/action/utils/version.d.ts.map +0 -1
- package/dist/cli/args.test.d.ts +0 -2
- package/dist/cli/args.test.d.ts.map +0 -1
- package/dist/cli/args.test.js +0 -392
- package/dist/cli/args.test.js.map +0 -1
- package/dist/cli/commands/init.test.d.ts +0 -2
- package/dist/cli/commands/init.test.d.ts.map +0 -1
- package/dist/cli/commands/init.test.js +0 -117
- package/dist/cli/commands/init.test.js.map +0 -1
- package/dist/cli/files.test.d.ts +0 -2
- package/dist/cli/files.test.d.ts.map +0 -1
- package/dist/cli/files.test.js +0 -117
- package/dist/cli/files.test.js.map +0 -1
- package/dist/cli/fix.test.d.ts +0 -2
- package/dist/cli/fix.test.d.ts.map +0 -1
- package/dist/cli/fix.test.js +0 -251
- package/dist/cli/fix.test.js.map +0 -1
- package/dist/cli/git.test.d.ts +0 -2
- package/dist/cli/git.test.d.ts.map +0 -1
- package/dist/cli/git.test.js +0 -96
- package/dist/cli/git.test.js.map +0 -1
- package/dist/cli/output/formatters.test.d.ts +0 -2
- package/dist/cli/output/formatters.test.d.ts.map +0 -1
- package/dist/cli/output/formatters.test.js +0 -152
- package/dist/cli/output/formatters.test.js.map +0 -1
- package/dist/cli/output/jsonl.test.d.ts +0 -2
- package/dist/cli/output/jsonl.test.d.ts.map +0 -1
- package/dist/cli/output/jsonl.test.js +0 -284
- package/dist/cli/output/jsonl.test.js.map +0 -1
- package/dist/cli/output/tty.test.d.ts +0 -2
- package/dist/cli/output/tty.test.d.ts.map +0 -1
- package/dist/cli/output/tty.test.js +0 -105
- package/dist/cli/output/tty.test.js.map +0 -1
- package/dist/cli/output/verbosity.test.d.ts +0 -2
- package/dist/cli/output/verbosity.test.d.ts.map +0 -1
- package/dist/cli/output/verbosity.test.js +0 -35
- package/dist/cli/output/verbosity.test.js.map +0 -1
- package/dist/cli/terminal.test.d.ts +0 -2
- package/dist/cli/terminal.test.d.ts.map +0 -1
- package/dist/cli/terminal.test.js +0 -123
- package/dist/cli/terminal.test.js.map +0 -1
- package/dist/config/loader.test.d.ts +0 -2
- package/dist/config/loader.test.d.ts.map +0 -1
- package/dist/config/loader.test.js +0 -263
- package/dist/config/loader.test.js.map +0 -1
- package/dist/config/writer.test.d.ts +0 -2
- package/dist/config/writer.test.d.ts.map +0 -1
- package/dist/config/writer.test.js +0 -98
- package/dist/config/writer.test.js.map +0 -1
- package/dist/diff/classify.test.d.ts +0 -2
- package/dist/diff/classify.test.d.ts.map +0 -1
- package/dist/diff/classify.test.js +0 -140
- package/dist/diff/classify.test.js.map +0 -1
- package/dist/diff/coalesce.test.d.ts +0 -2
- package/dist/diff/coalesce.test.d.ts.map +0 -1
- package/dist/diff/coalesce.test.js +0 -159
- package/dist/diff/coalesce.test.js.map +0 -1
- package/dist/diff/context.test.d.ts +0 -2
- package/dist/diff/context.test.d.ts.map +0 -1
- package/dist/diff/context.test.js +0 -190
- package/dist/diff/context.test.js.map +0 -1
- package/dist/diff/parser.test.d.ts +0 -2
- package/dist/diff/parser.test.d.ts.map +0 -1
- package/dist/diff/parser.test.js +0 -178
- package/dist/diff/parser.test.js.map +0 -1
- package/dist/examples/examples.integration.test.d.ts +0 -2
- package/dist/examples/examples.integration.test.d.ts.map +0 -1
- package/dist/examples/examples.integration.test.js +0 -55
- package/dist/examples/examples.integration.test.js.map +0 -1
- package/dist/examples/index.test.d.ts +0 -2
- package/dist/examples/index.test.d.ts.map +0 -1
- package/dist/examples/index.test.js +0 -88
- package/dist/examples/index.test.js.map +0 -1
- package/dist/output/dedup.test.d.ts +0 -2
- package/dist/output/dedup.test.d.ts.map +0 -1
- package/dist/output/dedup.test.js +0 -357
- package/dist/output/dedup.test.js.map +0 -1
- package/dist/output/github-checks.test.d.ts +0 -2
- package/dist/output/github-checks.test.d.ts.map +0 -1
- package/dist/output/github-checks.test.js +0 -255
- package/dist/output/github-checks.test.js.map +0 -1
- package/dist/output/renderer.test.d.ts +0 -2
- package/dist/output/renderer.test.d.ts.map +0 -1
- package/dist/output/renderer.test.js +0 -645
- package/dist/output/renderer.test.js.map +0 -1
- package/dist/output/stale.test.d.ts +0 -2
- package/dist/output/stale.test.d.ts.map +0 -1
- package/dist/output/stale.test.js +0 -330
- package/dist/output/stale.test.js.map +0 -1
- package/dist/sdk/runner.test.d.ts +0 -2
- package/dist/sdk/runner.test.d.ts.map +0 -1
- package/dist/sdk/runner.test.js +0 -677
- package/dist/sdk/runner.test.js.map +0 -1
- package/dist/skills/loader.test.d.ts +0 -2
- package/dist/skills/loader.test.d.ts.map +0 -1
- package/dist/skills/loader.test.js +0 -241
- package/dist/skills/loader.test.js.map +0 -1
- package/dist/skills/remote.test.d.ts +0 -2
- package/dist/skills/remote.test.d.ts.map +0 -1
- package/dist/skills/remote.test.js +0 -582
- package/dist/skills/remote.test.js.map +0 -1
- package/dist/triggers/matcher.test.d.ts +0 -2
- package/dist/triggers/matcher.test.d.ts.map +0 -1
- package/dist/triggers/matcher.test.js +0 -234
- package/dist/triggers/matcher.test.js.map +0 -1
- package/dist/utils/index.test.d.ts +0 -2
- package/dist/utils/index.test.d.ts.map +0 -1
- package/dist/utils/index.test.js +0 -68
- package/dist/utils/index.test.js.map +0 -1
- package/docs/astro.config.mjs +0 -43
- package/docs/package.json +0 -19
- package/docs/pnpm-lock.yaml +0 -4000
- package/docs/public/favicon.svg +0 -5
- package/docs/src/components/Code.astro +0 -141
- package/docs/src/components/PackageManagerTabs.astro +0 -183
- package/docs/src/components/Terminal.astro +0 -212
- package/docs/src/layouts/Base.astro +0 -380
- package/docs/src/pages/cli.astro +0 -167
- package/docs/src/pages/config.astro +0 -395
- package/docs/src/pages/guide.astro +0 -450
- package/docs/src/pages/index.astro +0 -490
- package/docs/src/styles/global.css +0 -551
- package/docs/src/utils/version.ts +0 -6
- package/docs/tsconfig.json +0 -3
- package/docs/vercel.json +0 -5
- package/eslint.config.js +0 -33
- package/src/action/index.ts +0 -1
- package/src/action/main.ts +0 -868
- package/src/cli/args.test.ts +0 -477
- package/src/cli/args.ts +0 -414
- package/src/cli/commands/add.ts +0 -447
- package/src/cli/commands/init.test.ts +0 -137
- package/src/cli/commands/init.ts +0 -134
- package/src/cli/commands/setup-app/browser.ts +0 -38
- package/src/cli/commands/setup-app/credentials.ts +0 -45
- package/src/cli/commands/setup-app/manifest.ts +0 -48
- package/src/cli/commands/setup-app/server.ts +0 -172
- package/src/cli/commands/setup-app.ts +0 -156
- package/src/cli/commands/sync.ts +0 -114
- package/src/cli/context.ts +0 -131
- package/src/cli/files.test.ts +0 -155
- package/src/cli/files.ts +0 -89
- package/src/cli/fix.test.ts +0 -310
- package/src/cli/fix.ts +0 -387
- package/src/cli/git.test.ts +0 -119
- package/src/cli/git.ts +0 -318
- package/src/cli/index.ts +0 -14
- package/src/cli/main.ts +0 -672
- package/src/cli/output/box.ts +0 -235
- package/src/cli/output/formatters.test.ts +0 -187
- package/src/cli/output/formatters.ts +0 -269
- package/src/cli/output/icons.ts +0 -13
- package/src/cli/output/index.ts +0 -44
- package/src/cli/output/ink-runner.tsx +0 -337
- package/src/cli/output/jsonl.test.ts +0 -347
- package/src/cli/output/jsonl.ts +0 -126
- package/src/cli/output/reporter.ts +0 -434
- package/src/cli/output/tasks.ts +0 -374
- package/src/cli/output/tty.test.ts +0 -117
- package/src/cli/output/tty.ts +0 -60
- package/src/cli/output/verbosity.test.ts +0 -40
- package/src/cli/output/verbosity.ts +0 -31
- package/src/cli/terminal.test.ts +0 -148
- package/src/cli/terminal.ts +0 -301
- package/src/config/index.ts +0 -3
- package/src/config/loader.test.ts +0 -313
- package/src/config/loader.ts +0 -103
- package/src/config/schema.ts +0 -168
- package/src/config/writer.test.ts +0 -119
- package/src/config/writer.ts +0 -84
- package/src/diff/classify.test.ts +0 -162
- package/src/diff/classify.ts +0 -92
- package/src/diff/coalesce.test.ts +0 -208
- package/src/diff/coalesce.ts +0 -133
- package/src/diff/context.test.ts +0 -226
- package/src/diff/context.ts +0 -201
- package/src/diff/index.ts +0 -4
- package/src/diff/parser.test.ts +0 -212
- package/src/diff/parser.ts +0 -149
- package/src/event/context.ts +0 -132
- package/src/event/index.ts +0 -2
- package/src/event/schedule-context.ts +0 -101
- package/src/examples/examples.integration.test.ts +0 -66
- package/src/examples/index.test.ts +0 -101
- package/src/examples/index.ts +0 -122
- package/src/examples/setup.ts +0 -25
- package/src/index.ts +0 -115
- package/src/output/dedup.test.ts +0 -419
- package/src/output/dedup.ts +0 -607
- package/src/output/github-checks.test.ts +0 -300
- package/src/output/github-checks.ts +0 -476
- package/src/output/github-issues.ts +0 -329
- package/src/output/index.ts +0 -5
- package/src/output/issue-renderer.ts +0 -197
- package/src/output/renderer.test.ts +0 -727
- package/src/output/renderer.ts +0 -217
- package/src/output/stale.test.ts +0 -375
- package/src/output/stale.ts +0 -155
- package/src/output/types.ts +0 -34
- package/src/sdk/index.ts +0 -1
- package/src/sdk/runner.test.ts +0 -806
- package/src/sdk/runner.ts +0 -1232
- package/src/skills/index.ts +0 -36
- package/src/skills/loader.test.ts +0 -300
- package/src/skills/loader.ts +0 -423
- package/src/skills/remote.test.ts +0 -704
- package/src/skills/remote.ts +0 -604
- package/src/triggers/matcher.test.ts +0 -277
- package/src/triggers/matcher.ts +0 -152
- package/src/types/index.ts +0 -194
- package/src/utils/async.ts +0 -18
- package/src/utils/index.test.ts +0 -84
- package/src/utils/index.ts +0 -51
- package/src/utils/version.ts +0 -17
- package/tsconfig.json +0 -25
- package/vitest.config.ts +0 -8
- package/vitest.integration.config.ts +0 -11
- package/warden.toml +0 -19
|
@@ -1,476 +0,0 @@
|
|
|
1
|
-
import type { Octokit } from '@octokit/rest';
|
|
2
|
-
import { SEVERITY_ORDER, filterFindingsBySeverity } from '../types/index.js';
|
|
3
|
-
import type { Severity, SeverityThreshold, Finding, SkillReport, UsageStats } from '../types/index.js';
|
|
4
|
-
import { formatDuration, formatCost, formatTokens } from '../cli/output/formatters.js';
|
|
5
|
-
import { escapeHtml } from '../utils/index.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* GitHub Check annotation for inline code comments.
|
|
9
|
-
*/
|
|
10
|
-
export interface CheckAnnotation {
|
|
11
|
-
path: string;
|
|
12
|
-
start_line: number;
|
|
13
|
-
end_line: number;
|
|
14
|
-
annotation_level: 'failure' | 'warning' | 'notice';
|
|
15
|
-
message: string;
|
|
16
|
-
title?: string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Possible conclusions for a GitHub Check run.
|
|
21
|
-
*/
|
|
22
|
-
export type CheckConclusion = 'success' | 'failure' | 'neutral' | 'cancelled';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Options for creating/updating checks.
|
|
26
|
-
*/
|
|
27
|
-
export interface CheckOptions {
|
|
28
|
-
owner: string;
|
|
29
|
-
repo: string;
|
|
30
|
-
headSha: string;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Options for updating a skill check.
|
|
35
|
-
*/
|
|
36
|
-
export interface UpdateSkillCheckOptions extends CheckOptions {
|
|
37
|
-
failOn?: SeverityThreshold;
|
|
38
|
-
/** Only include findings at or above this severity level in annotations */
|
|
39
|
-
commentOn?: SeverityThreshold;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Summary data for the core warden check.
|
|
44
|
-
*/
|
|
45
|
-
export interface CoreCheckSummaryData {
|
|
46
|
-
totalSkills: number;
|
|
47
|
-
totalFindings: number;
|
|
48
|
-
findingsBySeverity: Record<Severity, number>;
|
|
49
|
-
totalDurationMs?: number;
|
|
50
|
-
totalUsage?: UsageStats;
|
|
51
|
-
/** All findings from all skills */
|
|
52
|
-
findings: Finding[];
|
|
53
|
-
skillResults: {
|
|
54
|
-
name: string;
|
|
55
|
-
findingCount: number;
|
|
56
|
-
conclusion: CheckConclusion;
|
|
57
|
-
durationMs?: number;
|
|
58
|
-
usage?: UsageStats;
|
|
59
|
-
}[];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Result from creating a check run.
|
|
64
|
-
*/
|
|
65
|
-
export interface CreateCheckResult {
|
|
66
|
-
checkRunId: number;
|
|
67
|
-
url: string;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Maximum number of annotations per API call (GitHub limit).
|
|
72
|
-
*/
|
|
73
|
-
const MAX_ANNOTATIONS_PER_REQUEST = 50;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Map severity levels to GitHub annotation levels.
|
|
77
|
-
* critical/high -> failure, medium -> warning, low/info -> notice
|
|
78
|
-
*/
|
|
79
|
-
export function severityToAnnotationLevel(
|
|
80
|
-
severity: Severity
|
|
81
|
-
): CheckAnnotation['annotation_level'] {
|
|
82
|
-
switch (severity) {
|
|
83
|
-
case 'critical':
|
|
84
|
-
case 'high':
|
|
85
|
-
return 'failure';
|
|
86
|
-
case 'medium':
|
|
87
|
-
return 'warning';
|
|
88
|
-
case 'low':
|
|
89
|
-
case 'info':
|
|
90
|
-
return 'notice';
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Convert findings to GitHub Check annotations.
|
|
96
|
-
* Only findings with locations can be converted to annotations.
|
|
97
|
-
* Returns at most MAX_ANNOTATIONS_PER_REQUEST annotations.
|
|
98
|
-
* If commentOn is specified, only include findings at or above that severity.
|
|
99
|
-
*/
|
|
100
|
-
export function findingsToAnnotations(findings: Finding[], commentOn?: SeverityThreshold): CheckAnnotation[] {
|
|
101
|
-
// Filter by commentOn threshold if specified
|
|
102
|
-
const filtered = filterFindingsBySeverity(findings, commentOn);
|
|
103
|
-
|
|
104
|
-
// Filter to findings with location using type predicate
|
|
105
|
-
const withLocation = filtered.filter(
|
|
106
|
-
(f): f is Finding & { location: NonNullable<Finding['location']> } => Boolean(f.location)
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
// Sort by severity (most severe first)
|
|
110
|
-
const sorted = [...withLocation].sort(
|
|
111
|
-
(a, b) => SEVERITY_ORDER[a.severity] - SEVERITY_ORDER[b.severity]
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
// Limit to max annotations
|
|
115
|
-
const limited = sorted.slice(0, MAX_ANNOTATIONS_PER_REQUEST);
|
|
116
|
-
|
|
117
|
-
return limited.map((finding) => ({
|
|
118
|
-
path: finding.location.path,
|
|
119
|
-
start_line: finding.location.startLine,
|
|
120
|
-
end_line: finding.location.endLine ?? finding.location.startLine,
|
|
121
|
-
annotation_level: severityToAnnotationLevel(finding.severity),
|
|
122
|
-
message: escapeHtml(finding.description),
|
|
123
|
-
title: escapeHtml(finding.title),
|
|
124
|
-
}));
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Determine the check conclusion based on findings and failOn threshold.
|
|
129
|
-
* - No findings: success
|
|
130
|
-
* - Findings, none >= failOn: neutral
|
|
131
|
-
* - Findings >= failOn threshold: failure
|
|
132
|
-
*/
|
|
133
|
-
export function determineConclusion(
|
|
134
|
-
findings: Finding[],
|
|
135
|
-
failOn?: SeverityThreshold
|
|
136
|
-
): CheckConclusion {
|
|
137
|
-
if (findings.length === 0) {
|
|
138
|
-
return 'success';
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (!failOn || failOn === 'off') {
|
|
142
|
-
// No failure threshold or disabled, findings exist but don't cause failure
|
|
143
|
-
return 'neutral';
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
const failOnOrder = SEVERITY_ORDER[failOn];
|
|
147
|
-
const hasFailingSeverity = findings.some(
|
|
148
|
-
(f) => SEVERITY_ORDER[f.severity] <= failOnOrder
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
return hasFailingSeverity ? 'failure' : 'neutral';
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Create a check run for a skill.
|
|
156
|
-
* The check is created with status: in_progress.
|
|
157
|
-
*/
|
|
158
|
-
export async function createSkillCheck(
|
|
159
|
-
octokit: Octokit,
|
|
160
|
-
skillName: string,
|
|
161
|
-
options: CheckOptions
|
|
162
|
-
): Promise<CreateCheckResult> {
|
|
163
|
-
const { data } = await octokit.checks.create({
|
|
164
|
-
owner: options.owner,
|
|
165
|
-
repo: options.repo,
|
|
166
|
-
name: `warden: ${skillName}`,
|
|
167
|
-
head_sha: options.headSha,
|
|
168
|
-
status: 'in_progress',
|
|
169
|
-
started_at: new Date().toISOString(),
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
return {
|
|
173
|
-
checkRunId: data.id,
|
|
174
|
-
url: data.html_url ?? '',
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Update a skill check with results.
|
|
180
|
-
* Completes the check with conclusion, summary, and annotations.
|
|
181
|
-
*/
|
|
182
|
-
export async function updateSkillCheck(
|
|
183
|
-
octokit: Octokit,
|
|
184
|
-
checkRunId: number,
|
|
185
|
-
report: SkillReport,
|
|
186
|
-
options: UpdateSkillCheckOptions
|
|
187
|
-
): Promise<void> {
|
|
188
|
-
// Conclusion is based on all findings (failOn behavior)
|
|
189
|
-
const conclusion = determineConclusion(report.findings, options.failOn);
|
|
190
|
-
// Annotations are filtered by commentOn threshold
|
|
191
|
-
const annotations = findingsToAnnotations(report.findings, options.commentOn);
|
|
192
|
-
|
|
193
|
-
const summary = buildSkillSummary(report);
|
|
194
|
-
|
|
195
|
-
const title = report.findings.length === 0
|
|
196
|
-
? 'No issues'
|
|
197
|
-
: `${report.findings.length} issue${report.findings.length === 1 ? '' : 's'}`;
|
|
198
|
-
|
|
199
|
-
await octokit.checks.update({
|
|
200
|
-
owner: options.owner,
|
|
201
|
-
repo: options.repo,
|
|
202
|
-
check_run_id: checkRunId,
|
|
203
|
-
status: 'completed',
|
|
204
|
-
conclusion,
|
|
205
|
-
completed_at: new Date().toISOString(),
|
|
206
|
-
output: {
|
|
207
|
-
title,
|
|
208
|
-
summary,
|
|
209
|
-
annotations,
|
|
210
|
-
},
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Mark a skill check as failed due to execution error.
|
|
216
|
-
*/
|
|
217
|
-
export async function failSkillCheck(
|
|
218
|
-
octokit: Octokit,
|
|
219
|
-
checkRunId: number,
|
|
220
|
-
error: unknown,
|
|
221
|
-
options: CheckOptions
|
|
222
|
-
): Promise<void> {
|
|
223
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
224
|
-
|
|
225
|
-
await octokit.checks.update({
|
|
226
|
-
owner: options.owner,
|
|
227
|
-
repo: options.repo,
|
|
228
|
-
check_run_id: checkRunId,
|
|
229
|
-
status: 'completed',
|
|
230
|
-
conclusion: 'failure',
|
|
231
|
-
completed_at: new Date().toISOString(),
|
|
232
|
-
output: {
|
|
233
|
-
title: 'Skill execution failed',
|
|
234
|
-
summary: `Error: ${errorMessage}`,
|
|
235
|
-
},
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Create the core warden check run.
|
|
241
|
-
* The check is created with status: in_progress.
|
|
242
|
-
*/
|
|
243
|
-
export async function createCoreCheck(
|
|
244
|
-
octokit: Octokit,
|
|
245
|
-
options: CheckOptions
|
|
246
|
-
): Promise<CreateCheckResult> {
|
|
247
|
-
const { data } = await octokit.checks.create({
|
|
248
|
-
owner: options.owner,
|
|
249
|
-
repo: options.repo,
|
|
250
|
-
name: 'warden',
|
|
251
|
-
head_sha: options.headSha,
|
|
252
|
-
status: 'in_progress',
|
|
253
|
-
started_at: new Date().toISOString(),
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
return {
|
|
257
|
-
checkRunId: data.id,
|
|
258
|
-
url: data.html_url ?? '',
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Update the core warden check with overall summary.
|
|
264
|
-
*/
|
|
265
|
-
export async function updateCoreCheck(
|
|
266
|
-
octokit: Octokit,
|
|
267
|
-
checkRunId: number,
|
|
268
|
-
summaryData: CoreCheckSummaryData,
|
|
269
|
-
conclusion: CheckConclusion,
|
|
270
|
-
options: Omit<CheckOptions, 'headSha'>
|
|
271
|
-
): Promise<void> {
|
|
272
|
-
const summary = buildCoreSummary(summaryData);
|
|
273
|
-
|
|
274
|
-
const title = summaryData.totalFindings === 0
|
|
275
|
-
? 'No issues'
|
|
276
|
-
: `${summaryData.totalFindings} issue${summaryData.totalFindings === 1 ? '' : 's'}`;
|
|
277
|
-
|
|
278
|
-
await octokit.checks.update({
|
|
279
|
-
owner: options.owner,
|
|
280
|
-
repo: options.repo,
|
|
281
|
-
check_run_id: checkRunId,
|
|
282
|
-
status: 'completed',
|
|
283
|
-
conclusion,
|
|
284
|
-
completed_at: new Date().toISOString(),
|
|
285
|
-
output: {
|
|
286
|
-
title,
|
|
287
|
-
summary,
|
|
288
|
-
},
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Build the summary markdown for a skill check.
|
|
294
|
-
*/
|
|
295
|
-
function buildSkillSummary(report: SkillReport): string {
|
|
296
|
-
const lines: string[] = [escapeHtml(report.summary), ''];
|
|
297
|
-
|
|
298
|
-
if (report.findings.length === 0) {
|
|
299
|
-
lines.push('No issues found.');
|
|
300
|
-
} else {
|
|
301
|
-
// Sort findings by severity
|
|
302
|
-
const sortedFindings = [...report.findings].sort(
|
|
303
|
-
(a, b) => SEVERITY_ORDER[a.severity] - SEVERITY_ORDER[b.severity]
|
|
304
|
-
);
|
|
305
|
-
|
|
306
|
-
// Group findings by severity
|
|
307
|
-
const findingsBySeverity = new Map<Severity, Finding[]>();
|
|
308
|
-
for (const finding of sortedFindings) {
|
|
309
|
-
const existing = findingsBySeverity.get(finding.severity) ?? [];
|
|
310
|
-
existing.push(finding);
|
|
311
|
-
findingsBySeverity.set(finding.severity, existing);
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
const severityOrder: Severity[] = ['critical', 'high', 'medium', 'low', 'info'];
|
|
315
|
-
for (const severity of severityOrder) {
|
|
316
|
-
const findings = findingsBySeverity.get(severity);
|
|
317
|
-
if (!findings?.length) continue;
|
|
318
|
-
|
|
319
|
-
const label = severity.charAt(0).toUpperCase() + severity.slice(1);
|
|
320
|
-
lines.push(`### ${label}`, '');
|
|
321
|
-
|
|
322
|
-
for (const finding of findings) {
|
|
323
|
-
const location = finding.location ? ` - ${formatLocation(finding.location)}` : '';
|
|
324
|
-
lines.push('<details>');
|
|
325
|
-
lines.push(`<summary><strong>${escapeHtml(finding.title)}</strong>${location}</summary>`, '');
|
|
326
|
-
lines.push(escapeHtml(finding.description), '');
|
|
327
|
-
lines.push('</details>', '');
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
// Add stats footer if available
|
|
333
|
-
if (report.durationMs !== undefined || report.usage) {
|
|
334
|
-
const statsParts: string[] = [];
|
|
335
|
-
if (report.durationMs !== undefined) {
|
|
336
|
-
statsParts.push(`**Duration:** ${formatDuration(report.durationMs)}`);
|
|
337
|
-
}
|
|
338
|
-
if (report.usage) {
|
|
339
|
-
const totalInput = report.usage.inputTokens + (report.usage.cacheReadInputTokens ?? 0);
|
|
340
|
-
statsParts.push(`**Tokens:** ${formatTokens(totalInput)} in / ${formatTokens(report.usage.outputTokens)} out`);
|
|
341
|
-
statsParts.push(`**Cost:** ${formatCost(report.usage.costUSD)}`);
|
|
342
|
-
}
|
|
343
|
-
lines.push('---', statsParts.join(' · '));
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
return lines.join('\n');
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Format a file location as a markdown code span.
|
|
351
|
-
*/
|
|
352
|
-
function formatLocation(location: { path: string; startLine: number; endLine?: number }): string {
|
|
353
|
-
const { path, startLine, endLine } = location;
|
|
354
|
-
const lineRange = endLine && endLine !== startLine ? `${startLine}-${endLine}` : `${startLine}`;
|
|
355
|
-
return `\`${path}:${lineRange}\``;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/** Maximum findings to show in the summary */
|
|
359
|
-
const MAX_SUMMARY_FINDINGS = 10;
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Build the summary markdown for the core warden check.
|
|
363
|
-
*/
|
|
364
|
-
function buildCoreSummary(data: CoreCheckSummaryData): string {
|
|
365
|
-
const lines: string[] = [];
|
|
366
|
-
|
|
367
|
-
// Sort findings by severity and take top N
|
|
368
|
-
const sortedFindings = [...data.findings].sort(
|
|
369
|
-
(a, b) => SEVERITY_ORDER[a.severity] - SEVERITY_ORDER[b.severity]
|
|
370
|
-
);
|
|
371
|
-
const topFindings = sortedFindings.slice(0, MAX_SUMMARY_FINDINGS);
|
|
372
|
-
|
|
373
|
-
// Show findings grouped by severity, each in a collapsible details
|
|
374
|
-
if (topFindings.length > 0) {
|
|
375
|
-
const findingsBySeverity = new Map<Severity, Finding[]>();
|
|
376
|
-
for (const finding of topFindings) {
|
|
377
|
-
const existing = findingsBySeverity.get(finding.severity) ?? [];
|
|
378
|
-
existing.push(finding);
|
|
379
|
-
findingsBySeverity.set(finding.severity, existing);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
const severityOrder: Severity[] = ['critical', 'high', 'medium', 'low', 'info'];
|
|
383
|
-
for (const severity of severityOrder) {
|
|
384
|
-
const findings = findingsBySeverity.get(severity);
|
|
385
|
-
if (!findings?.length) continue;
|
|
386
|
-
|
|
387
|
-
const label = severity.charAt(0).toUpperCase() + severity.slice(1);
|
|
388
|
-
lines.push(`### ${label}`, '');
|
|
389
|
-
|
|
390
|
-
for (const finding of findings) {
|
|
391
|
-
const location = finding.location ? ` - ${formatLocation(finding.location)}` : '';
|
|
392
|
-
lines.push('<details>');
|
|
393
|
-
lines.push(`<summary><strong>${escapeHtml(finding.title)}</strong>${location}</summary>`, '');
|
|
394
|
-
lines.push(escapeHtml(finding.description), '');
|
|
395
|
-
lines.push('</details>', '');
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
// Note if there are more findings not shown
|
|
400
|
-
if (data.totalFindings > topFindings.length) {
|
|
401
|
-
const remaining = data.totalFindings - topFindings.length;
|
|
402
|
-
lines.push(`*...and ${remaining} more*`, '');
|
|
403
|
-
}
|
|
404
|
-
} else {
|
|
405
|
-
lines.push('No issues found.', '');
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
// Skills table in collapsible section
|
|
409
|
-
const hasSkillStats = data.skillResults.some((s) => s.durationMs !== undefined || s.usage);
|
|
410
|
-
const skillPlural = data.totalSkills === 1 ? '' : 's';
|
|
411
|
-
|
|
412
|
-
lines.push('<details>');
|
|
413
|
-
lines.push(`<summary>${data.totalSkills} skill${skillPlural} analyzed</summary>`, '');
|
|
414
|
-
|
|
415
|
-
if (hasSkillStats) {
|
|
416
|
-
lines.push(
|
|
417
|
-
'| Skill | Findings | Duration | Cost |',
|
|
418
|
-
'|-------|----------|----------|------|'
|
|
419
|
-
);
|
|
420
|
-
for (const skill of data.skillResults) {
|
|
421
|
-
const duration = skill.durationMs !== undefined ? formatDuration(skill.durationMs) : '-';
|
|
422
|
-
const cost = skill.usage ? formatCost(skill.usage.costUSD) : '-';
|
|
423
|
-
lines.push(`| ${skill.name} | ${skill.findingCount} | ${duration} | ${cost} |`);
|
|
424
|
-
}
|
|
425
|
-
} else {
|
|
426
|
-
lines.push(
|
|
427
|
-
'| Skill | Findings |',
|
|
428
|
-
'|-------|----------|'
|
|
429
|
-
);
|
|
430
|
-
for (const skill of data.skillResults) {
|
|
431
|
-
lines.push(`| ${skill.name} | ${skill.findingCount} |`);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
lines.push('', '</details>', '');
|
|
436
|
-
|
|
437
|
-
// Stats footer with labeled inline format
|
|
438
|
-
const hasStats = data.totalDurationMs !== undefined || data.totalUsage;
|
|
439
|
-
if (hasStats) {
|
|
440
|
-
const statsParts: string[] = [];
|
|
441
|
-
if (data.totalDurationMs !== undefined) {
|
|
442
|
-
statsParts.push(`**Duration:** ${formatDuration(data.totalDurationMs)}`);
|
|
443
|
-
}
|
|
444
|
-
if (data.totalUsage) {
|
|
445
|
-
const totalInput = data.totalUsage.inputTokens + (data.totalUsage.cacheReadInputTokens ?? 0);
|
|
446
|
-
statsParts.push(`**Tokens:** ${formatTokens(totalInput)} in / ${formatTokens(data.totalUsage.outputTokens)} out`);
|
|
447
|
-
statsParts.push(`**Cost:** ${formatCost(data.totalUsage.costUSD)}`);
|
|
448
|
-
}
|
|
449
|
-
lines.push('---', statsParts.join(' · '));
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
return lines.join('\n');
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* Aggregate severity counts from multiple reports.
|
|
457
|
-
*/
|
|
458
|
-
export function aggregateSeverityCounts(
|
|
459
|
-
reports: SkillReport[]
|
|
460
|
-
): Record<Severity, number> {
|
|
461
|
-
const counts: Record<Severity, number> = {
|
|
462
|
-
critical: 0,
|
|
463
|
-
high: 0,
|
|
464
|
-
medium: 0,
|
|
465
|
-
low: 0,
|
|
466
|
-
info: 0,
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
for (const report of reports) {
|
|
470
|
-
for (const finding of report.findings) {
|
|
471
|
-
counts[finding.severity]++;
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
return counts;
|
|
476
|
-
}
|