@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
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { formatHunkForAnalysis } from '../diff/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Builds the system prompt for hunk-based analysis.
|
|
6
|
+
*
|
|
7
|
+
* Future enhancement: Could have the agent output a structured `contextAssessment`
|
|
8
|
+
* (applicationType, trustBoundaries, filesChecked) to cache across hunks, allow
|
|
9
|
+
* user overrides, or build analytics. Not implemented since we don't consume it yet.
|
|
10
|
+
*/
|
|
11
|
+
export function buildHunkSystemPrompt(skill) {
|
|
12
|
+
const sections = [
|
|
13
|
+
`<role>
|
|
14
|
+
You are a code analysis agent for Warden. You evaluate code changes against specific skill criteria and report findings ONLY when the code violates or conflicts with those criteria. You do not perform general code review or report issues outside the skill's scope.
|
|
15
|
+
</role>`,
|
|
16
|
+
`<tools>
|
|
17
|
+
You have access to these tools to gather context:
|
|
18
|
+
- **Read**: Check related files to understand context
|
|
19
|
+
- **Grep**: Search for patterns to trace data flow or find related code
|
|
20
|
+
</tools>`,
|
|
21
|
+
`<skill_instructions>
|
|
22
|
+
The following defines the ONLY criteria you should evaluate. Do not report findings outside this scope:
|
|
23
|
+
|
|
24
|
+
${skill.prompt}
|
|
25
|
+
</skill_instructions>`,
|
|
26
|
+
`<output_format>
|
|
27
|
+
IMPORTANT: Your response must be ONLY a valid JSON object. No markdown, no explanation, no code fences.
|
|
28
|
+
|
|
29
|
+
Example response format:
|
|
30
|
+
{"findings": [{"id": "example-1", "severity": "medium", "confidence": "high", "title": "Issue title", "description": "Description", "location": {"path": "file.ts", "startLine": 10}}]}
|
|
31
|
+
|
|
32
|
+
Full schema:
|
|
33
|
+
{
|
|
34
|
+
"findings": [
|
|
35
|
+
{
|
|
36
|
+
"id": "unique-identifier",
|
|
37
|
+
"severity": "critical|high|medium|low|info",
|
|
38
|
+
"confidence": "high|medium|low",
|
|
39
|
+
"title": "Short descriptive title",
|
|
40
|
+
"description": "Detailed explanation of the issue",
|
|
41
|
+
"location": {
|
|
42
|
+
"path": "path/to/file.ts",
|
|
43
|
+
"startLine": 10,
|
|
44
|
+
"endLine": 15
|
|
45
|
+
},
|
|
46
|
+
"suggestedFix": {
|
|
47
|
+
"description": "How to fix this issue",
|
|
48
|
+
"diff": "unified diff format"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
Requirements:
|
|
55
|
+
- Return ONLY valid JSON starting with {"findings":
|
|
56
|
+
- "findings" array can be empty if no issues found
|
|
57
|
+
- "location.path" is auto-filled from context - just provide startLine (and optionally endLine). Omit location entirely for general findings not about a specific line.
|
|
58
|
+
- "confidence" reflects how certain you are this is a real issue given the codebase context
|
|
59
|
+
- "suggestedFix" is optional - only include when you can provide a complete, correct fix **to the file being analyzed**. Omit suggestedFix if:
|
|
60
|
+
- The fix would be incomplete or you're uncertain about the correct solution
|
|
61
|
+
- The fix requires changes to a different file or a new file (describe the fix in the description field instead)
|
|
62
|
+
- Keep descriptions SHORT (1-2 sentences max) - avoid lengthy explanations
|
|
63
|
+
- Be concise - focus only on the changes shown
|
|
64
|
+
</output_format>`,
|
|
65
|
+
];
|
|
66
|
+
const { rootDir } = skill;
|
|
67
|
+
if (rootDir) {
|
|
68
|
+
const resourceDirs = ['scripts', 'references', 'assets'].filter((dir) => existsSync(join(rootDir, dir)));
|
|
69
|
+
if (resourceDirs.length > 0) {
|
|
70
|
+
const dirList = resourceDirs.map((d) => `${d}/`).join(', ');
|
|
71
|
+
sections.push(`<skill_resources>
|
|
72
|
+
This skill is located at: ${rootDir}
|
|
73
|
+
You can read files from ${dirList} subdirectories using the Read tool with the full path.
|
|
74
|
+
</skill_resources>`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return sections.join('\n\n');
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Builds the user prompt for a single hunk.
|
|
81
|
+
*/
|
|
82
|
+
export function buildHunkUserPrompt(skill, hunkCtx, prContext) {
|
|
83
|
+
const sections = [];
|
|
84
|
+
sections.push(`Analyze this code change according to the "${skill.name}" skill criteria.`);
|
|
85
|
+
// Include PR title and description for context on intent
|
|
86
|
+
if (prContext?.title) {
|
|
87
|
+
let prSection = `## Pull Request Context\n**Title:** ${prContext.title}`;
|
|
88
|
+
if (prContext.body) {
|
|
89
|
+
// Truncate very long PR descriptions to avoid bloating prompts
|
|
90
|
+
const maxBodyLength = 1000;
|
|
91
|
+
const body = prContext.body.length > maxBodyLength
|
|
92
|
+
? prContext.body.slice(0, maxBodyLength) + '...'
|
|
93
|
+
: prContext.body;
|
|
94
|
+
prSection += `\n\n**Description:**\n${body}`;
|
|
95
|
+
}
|
|
96
|
+
sections.push(prSection);
|
|
97
|
+
}
|
|
98
|
+
// Include list of other files being changed in the PR for context
|
|
99
|
+
const otherFiles = prContext?.changedFiles.filter((f) => f !== hunkCtx.filename) ?? [];
|
|
100
|
+
if (otherFiles.length > 0) {
|
|
101
|
+
sections.push(`## Other Files in This PR
|
|
102
|
+
The following files are also being changed in this PR (may provide useful context):
|
|
103
|
+
${otherFiles.map((f) => `- ${f}`).join('\n')}`);
|
|
104
|
+
}
|
|
105
|
+
sections.push(formatHunkForAnalysis(hunkCtx));
|
|
106
|
+
sections.push(`IMPORTANT: Only report findings that are explicitly covered by the skill instructions. Do not report general code quality issues, bugs, or improvements unless the skill specifically asks for them. Return an empty findings array if no issues match the skill's criteria.`);
|
|
107
|
+
return sections.join('\n\n');
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/sdk/prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,qBAAqB,EAAwB,MAAM,kBAAkB,CAAC;AAkB/E;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAsB;IAC1D,MAAM,QAAQ,GAAG;QACf;;QAEI;QAEJ;;;;SAIK;QAEL;;;EAGF,KAAK,CAAC,MAAM;sBACQ;QAElB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCa;KACd,CAAC;IAEF,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CACtE,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAC/B,CAAC;QACF,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5D,QAAQ,CAAC,IAAI,CAAC;4BACQ,OAAO;0BACT,OAAO;mBACd,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAsB,EACtB,OAAwB,EACxB,SAA2B;IAE3B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,QAAQ,CAAC,IAAI,CAAC,8CAA8C,KAAK,CAAC,IAAI,mBAAmB,CAAC,CAAC;IAE3F,yDAAyD;IACzD,IAAI,SAAS,EAAE,KAAK,EAAE,CAAC;QACrB,IAAI,SAAS,GAAG,uCAAuC,SAAS,CAAC,KAAK,EAAE,CAAC;QACzE,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;YACnB,+DAA+D;YAC/D,MAAM,aAAa,GAAG,IAAI,CAAC;YAC3B,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,GAAG,aAAa;gBAChD,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,GAAG,KAAK;gBAChD,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC;YACnB,SAAS,IAAI,yBAAyB,IAAI,EAAE,CAAC;QAC/C,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,kEAAkE;IAClE,MAAM,UAAU,GAAG,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IACvF,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,QAAQ,CAAC,IAAI,CAAC;;EAEhB,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC9C,CAAC;IAED,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;IAE9C,QAAQ,CAAC,IAAI,CACX,8QAA8Q,CAC/Q,CAAC;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RetryConfig } from '../types/index.js';
|
|
2
|
+
/** Default retry configuration */
|
|
3
|
+
export declare const DEFAULT_RETRY_CONFIG: Required<RetryConfig>;
|
|
4
|
+
/**
|
|
5
|
+
* Calculate delay for a retry attempt using exponential backoff.
|
|
6
|
+
*/
|
|
7
|
+
export declare function calculateRetryDelay(attempt: number, config: Required<RetryConfig>): number;
|
|
8
|
+
/**
|
|
9
|
+
* Sleep for a specified duration, respecting abort signal.
|
|
10
|
+
*/
|
|
11
|
+
export declare function sleep(ms: number, abortSignal?: AbortSignal): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/sdk/retry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,kCAAkC;AAClC,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAKtD,CAAC;AAEF;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,GAC5B,MAAM,CAGR;AAED;;GAEG;AACH,wBAAsB,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAchF"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Default retry configuration */
|
|
2
|
+
export const DEFAULT_RETRY_CONFIG = {
|
|
3
|
+
maxRetries: 3,
|
|
4
|
+
initialDelayMs: 1000,
|
|
5
|
+
backoffMultiplier: 2,
|
|
6
|
+
maxDelayMs: 30000,
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Calculate delay for a retry attempt using exponential backoff.
|
|
10
|
+
*/
|
|
11
|
+
export function calculateRetryDelay(attempt, config) {
|
|
12
|
+
const delay = config.initialDelayMs * Math.pow(config.backoffMultiplier, attempt);
|
|
13
|
+
return Math.min(delay, config.maxDelayMs);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Sleep for a specified duration, respecting abort signal.
|
|
17
|
+
*/
|
|
18
|
+
export async function sleep(ms, abortSignal) {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
if (abortSignal?.aborted) {
|
|
21
|
+
reject(new Error('Aborted'));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const timeout = setTimeout(resolve, ms);
|
|
25
|
+
abortSignal?.addEventListener('abort', () => {
|
|
26
|
+
clearTimeout(timeout);
|
|
27
|
+
reject(new Error('Aborted'));
|
|
28
|
+
}, { once: true });
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/sdk/retry.ts"],"names":[],"mappings":"AAEA,kCAAkC;AAClC,MAAM,CAAC,MAAM,oBAAoB,GAA0B;IACzD,UAAU,EAAE,CAAC;IACb,cAAc,EAAE,IAAI;IACpB,iBAAiB,EAAE,CAAC;IACpB,UAAU,EAAE,KAAK;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAAe,EACf,MAA6B;IAE7B,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAClF,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,EAAU,EAAE,WAAyB;IAC/D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,WAAW,EAAE,OAAO,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;YAC7B,OAAO;QACT,CAAC;QAED,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAExC,WAAW,EAAE,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE;YAC1C,YAAY,CAAC,OAAO,CAAC,CAAC;YACtB,MAAM,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;QAC/B,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/sdk/runner.d.ts
CHANGED
|
@@ -1,202 +1,25 @@
|
|
|
1
|
-
import type { SkillDefinition, ChunkingConfig } from '../config/schema.js';
|
|
2
|
-
import type { EventContext, SkillReport, Finding, UsageStats, SkippedFile, RetryConfig } from '../types/index.js';
|
|
3
|
-
import { type HunkWithContext } from '../diff/index.js';
|
|
4
|
-
export declare class SkillRunnerError extends Error {
|
|
5
|
-
constructor(message: string, options?: {
|
|
6
|
-
cause?: unknown;
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
1
|
/**
|
|
10
|
-
*
|
|
11
|
-
* Uses chars/4 as a rough approximation for English text.
|
|
12
|
-
*/
|
|
13
|
-
export declare function estimateTokens(chars: number): number;
|
|
14
|
-
/**
|
|
15
|
-
* Aggregate multiple usage stats into one.
|
|
16
|
-
*/
|
|
17
|
-
export declare function aggregateUsage(usages: UsageStats[]): UsageStats;
|
|
18
|
-
/**
|
|
19
|
-
* Check if an error is retryable.
|
|
20
|
-
* Retries on: rate limits (429), server errors (5xx), connection errors, timeouts.
|
|
21
|
-
*/
|
|
22
|
-
export declare function isRetryableError(error: unknown): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Check if an error is an authentication failure.
|
|
25
|
-
* These require user action (login or API key) and should not be retried.
|
|
26
|
-
*/
|
|
27
|
-
export declare function isAuthenticationError(error: unknown): boolean;
|
|
28
|
-
export declare class WardenAuthenticationError extends Error {
|
|
29
|
-
constructor();
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Calculate delay for a retry attempt using exponential backoff.
|
|
33
|
-
*/
|
|
34
|
-
export declare function calculateRetryDelay(attempt: number, config: Required<RetryConfig>): number;
|
|
35
|
-
/**
|
|
36
|
-
* Callbacks for progress reporting during skill execution.
|
|
37
|
-
*/
|
|
38
|
-
export interface SkillRunnerCallbacks {
|
|
39
|
-
/** Start time of the skill execution (for elapsed time calculations) */
|
|
40
|
-
skillStartTime?: number;
|
|
41
|
-
onFileStart?: (file: string, index: number, total: number) => void;
|
|
42
|
-
onHunkStart?: (file: string, hunkNum: number, totalHunks: number, lineRange: string) => void;
|
|
43
|
-
onHunkComplete?: (file: string, hunkNum: number, findings: Finding[]) => void;
|
|
44
|
-
onFileComplete?: (file: string, index: number, total: number) => void;
|
|
45
|
-
/** Called when a prompt exceeds the large prompt threshold */
|
|
46
|
-
onLargePrompt?: (file: string, lineRange: string, chars: number, estimatedTokens: number) => void;
|
|
47
|
-
/** Called with prompt size info in debug mode */
|
|
48
|
-
onPromptSize?: (file: string, lineRange: string, systemChars: number, userChars: number, totalChars: number, estimatedTokens: number) => void;
|
|
49
|
-
/** Called when a retry attempt is made (verbose mode) */
|
|
50
|
-
onRetry?: (file: string, lineRange: string, attempt: number, maxRetries: number, error: string, delayMs: number) => void;
|
|
51
|
-
}
|
|
52
|
-
export interface SkillRunnerOptions {
|
|
53
|
-
apiKey?: string;
|
|
54
|
-
maxTurns?: number;
|
|
55
|
-
/** Lines of context to include around each hunk */
|
|
56
|
-
contextLines?: number;
|
|
57
|
-
/** Process files in parallel (default: true) */
|
|
58
|
-
parallel?: boolean;
|
|
59
|
-
/** Max concurrent file analyses when parallel=true (default: 5) */
|
|
60
|
-
concurrency?: number;
|
|
61
|
-
/** Delay in milliseconds between batch starts when parallel=true (default: 0) */
|
|
62
|
-
batchDelayMs?: number;
|
|
63
|
-
/** Model to use for analysis (e.g., 'claude-sonnet-4-20250514'). Uses SDK default if not specified. */
|
|
64
|
-
model?: string;
|
|
65
|
-
/** Progress callbacks */
|
|
66
|
-
callbacks?: SkillRunnerCallbacks;
|
|
67
|
-
/** Abort controller for cancellation on SIGINT */
|
|
68
|
-
abortController?: AbortController;
|
|
69
|
-
/** Path to Claude Code CLI executable. Required in CI environments. */
|
|
70
|
-
pathToClaudeCodeExecutable?: string;
|
|
71
|
-
/** Retry configuration for transient API failures */
|
|
72
|
-
retry?: RetryConfig;
|
|
73
|
-
/** Enable verbose logging for retry attempts */
|
|
74
|
-
verbose?: boolean;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Builds the system prompt for hunk-based analysis.
|
|
78
|
-
*
|
|
79
|
-
* Future enhancement: Could have the agent output a structured `contextAssessment`
|
|
80
|
-
* (applicationType, trustBoundaries, filesChecked) to cache across hunks, allow
|
|
81
|
-
* user overrides, or build analytics. Not implemented since we don't consume it yet.
|
|
82
|
-
*/
|
|
83
|
-
declare function buildHunkSystemPrompt(skill: SkillDefinition): string;
|
|
84
|
-
/**
|
|
85
|
-
* Context about the PR being analyzed, for inclusion in prompts.
|
|
86
|
-
*
|
|
87
|
-
* The title and body (like a commit message) help explain the _intent_ of the
|
|
88
|
-
* changes to the agent, enabling it to better understand what the author was
|
|
89
|
-
* trying to accomplish and identify issues that conflict with that intent.
|
|
90
|
-
*/
|
|
91
|
-
export interface PRPromptContext {
|
|
92
|
-
/** All files being changed in the PR */
|
|
93
|
-
changedFiles: string[];
|
|
94
|
-
/** PR title - explains what the change does */
|
|
95
|
-
title?: string;
|
|
96
|
-
/** PR description/body - explains why and provides additional context */
|
|
97
|
-
body?: string | null;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Result from extracting findings JSON from text.
|
|
101
|
-
*/
|
|
102
|
-
export type ExtractFindingsResult = {
|
|
103
|
-
success: true;
|
|
104
|
-
findings: unknown[];
|
|
105
|
-
} | {
|
|
106
|
-
success: false;
|
|
107
|
-
error: string;
|
|
108
|
-
preview: string;
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Extract JSON object from text, handling nested braces correctly.
|
|
112
|
-
* Starts from the given position and returns the balanced JSON object.
|
|
113
|
-
*/
|
|
114
|
-
export declare function extractBalancedJson(text: string, startIndex: number): string | null;
|
|
115
|
-
/**
|
|
116
|
-
* Extract findings JSON from model output text.
|
|
117
|
-
* Handles markdown code fences, prose before JSON, and nested objects.
|
|
118
|
-
*/
|
|
119
|
-
export declare function extractFindingsJson(rawText: string): ExtractFindingsResult;
|
|
120
|
-
/**
|
|
121
|
-
* Truncate text for LLM fallback while preserving the findings JSON.
|
|
2
|
+
* SDK Runner - Main orchestration for skill execution.
|
|
122
3
|
*
|
|
123
|
-
*
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
export
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
export
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
*/
|
|
145
|
-
export interface PrepareFilesOptions {
|
|
146
|
-
/** Lines of context to include around each hunk */
|
|
147
|
-
contextLines?: number;
|
|
148
|
-
/** Chunking configuration for file patterns and coalescing */
|
|
149
|
-
chunking?: ChunkingConfig;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Result from preparing files for analysis.
|
|
153
|
-
*/
|
|
154
|
-
export interface PrepareFilesResult {
|
|
155
|
-
/** Files prepared for analysis */
|
|
156
|
-
files: PreparedFile[];
|
|
157
|
-
/** Files that were skipped due to chunking patterns */
|
|
158
|
-
skippedFiles: SkippedFile[];
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Prepare files for analysis by parsing patches into hunks with context.
|
|
162
|
-
* Returns files that have changes to analyze and files that were skipped.
|
|
163
|
-
*/
|
|
164
|
-
export declare function prepareFiles(context: EventContext, options?: PrepareFilesOptions): PrepareFilesResult;
|
|
165
|
-
/**
|
|
166
|
-
* Callbacks for per-file analysis progress.
|
|
167
|
-
*/
|
|
168
|
-
export interface FileAnalysisCallbacks {
|
|
169
|
-
skillStartTime?: number;
|
|
170
|
-
onHunkStart?: (hunkNum: number, totalHunks: number, lineRange: string) => void;
|
|
171
|
-
onHunkComplete?: (hunkNum: number, findings: Finding[]) => void;
|
|
172
|
-
/** Called when a prompt exceeds the large prompt threshold */
|
|
173
|
-
onLargePrompt?: (lineRange: string, chars: number, estimatedTokens: number) => void;
|
|
174
|
-
/** Called with prompt size info in debug mode */
|
|
175
|
-
onPromptSize?: (lineRange: string, systemChars: number, userChars: number, totalChars: number, estimatedTokens: number) => void;
|
|
176
|
-
/** Called when a retry attempt is made (verbose mode) */
|
|
177
|
-
onRetry?: (lineRange: string, attempt: number, maxRetries: number, error: string, delayMs: number) => void;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Result from analyzing a single file.
|
|
181
|
-
*/
|
|
182
|
-
export interface FileAnalysisResult {
|
|
183
|
-
filename: string;
|
|
184
|
-
findings: Finding[];
|
|
185
|
-
usage: UsageStats;
|
|
186
|
-
/** Number of hunks that failed to analyze */
|
|
187
|
-
failedHunks: number;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Analyze a single prepared file's hunks.
|
|
191
|
-
*/
|
|
192
|
-
export declare function analyzeFile(skill: SkillDefinition, file: PreparedFile, repoPath: string, options?: SkillRunnerOptions, callbacks?: FileAnalysisCallbacks, prContext?: PRPromptContext): Promise<FileAnalysisResult>;
|
|
193
|
-
/**
|
|
194
|
-
* Run a skill on a PR, analyzing each hunk separately.
|
|
195
|
-
*/
|
|
196
|
-
export declare function runSkill(skill: SkillDefinition, context: EventContext, options?: SkillRunnerOptions): Promise<SkillReport>;
|
|
197
|
-
/**
|
|
198
|
-
* Generate a summary of findings.
|
|
199
|
-
*/
|
|
200
|
-
export declare function generateSummary(skillName: string, findings: Finding[]): string;
|
|
201
|
-
export { buildHunkSystemPrompt as buildSystemPrompt };
|
|
4
|
+
* This module re-exports functionality from focused submodules:
|
|
5
|
+
* - errors.ts: Error classes and classification (SkillRunnerError, WardenAuthenticationError)
|
|
6
|
+
* - retry.ts: Retry logic with exponential backoff
|
|
7
|
+
* - usage.ts: Usage stats extraction and aggregation
|
|
8
|
+
* - prompt.ts: Prompt building for skills
|
|
9
|
+
* - extract.ts: JSON extraction from model output
|
|
10
|
+
* - prepare.ts: File preparation for analysis
|
|
11
|
+
* - analyze.ts: Hunk and file analysis orchestration
|
|
12
|
+
* - types.ts: Shared interfaces
|
|
13
|
+
*/
|
|
14
|
+
export { SkillRunnerError, WardenAuthenticationError, isRetryableError, isAuthenticationError, isAuthenticationErrorMessage } from './errors.js';
|
|
15
|
+
export { calculateRetryDelay } from './retry.js';
|
|
16
|
+
export { aggregateUsage, estimateTokens } from './usage.js';
|
|
17
|
+
export { buildHunkSystemPrompt, buildHunkUserPrompt } from './prompt.js';
|
|
18
|
+
export type { PRPromptContext } from './prompt.js';
|
|
19
|
+
export { buildHunkSystemPrompt as buildSystemPrompt } from './prompt.js';
|
|
20
|
+
export { extractFindingsJson, extractBalancedJson, extractFindingsWithLLM, truncateForLLMFallback, deduplicateFindings, } from './extract.js';
|
|
21
|
+
export type { ExtractFindingsResult } from './extract.js';
|
|
22
|
+
export { prepareFiles } from './prepare.js';
|
|
23
|
+
export { analyzeFile, runSkill, generateSummary } from './analyze.js';
|
|
24
|
+
export type { SkillRunnerCallbacks, SkillRunnerOptions, PreparedFile, PrepareFilesOptions, PrepareFilesResult, FileAnalysisCallbacks, FileAnalysisResult, } from './types.js';
|
|
202
25
|
//# sourceMappingURL=runner.d.ts.map
|
package/dist/sdk/runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/sdk/runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/sdk/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAGjJ,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAGjD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5D,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACzE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,qBAAqB,IAAI,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGzE,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGtE,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|