neondeck 1.0.0-beta.10
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/CHANGELOG.md +76 -0
- package/DEVELOPMENT.md +304 -0
- package/LICENSE +21 -0
- package/README.md +129 -0
- package/SOUL.md +8 -0
- package/bin/neondeck.mjs +27 -0
- package/config/dashboard.json +224 -0
- package/config/dashboard.schema.json +247 -0
- package/dist/SOUL.md +8 -0
- package/dist/assets/app-CnXGMuTl.js +3878 -0
- package/dist/assets/app-CnXGMuTl.js.map +1 -0
- package/dist/assets/autopilot-B8lfWyA1.js +68813 -0
- package/dist/assets/autopilot-B8lfWyA1.js.map +1 -0
- package/dist/assets/briefing-BT8h9XXT.js +52 -0
- package/dist/assets/briefing-BT8h9XXT.js.map +1 -0
- package/dist/assets/briefing-VMdQPEGc.js +2 -0
- package/dist/assets/briefings-DuApznpN.js +1596 -0
- package/dist/assets/briefings-DuApznpN.js.map +1 -0
- package/dist/assets/command-run-CnPOA8iY.js +20 -0
- package/dist/assets/command-run-CnPOA8iY.js.map +1 -0
- package/dist/assets/command-run-Smpq7waT.js +2 -0
- package/dist/assets/display-assistant-CKU4YJlc.js +392 -0
- package/dist/assets/display-assistant-CKU4YJlc.js.map +1 -0
- package/dist/assets/fix-pr-ci-Ce2SIcyf.js +46 -0
- package/dist/assets/fix-pr-ci-Ce2SIcyf.js.map +1 -0
- package/dist/assets/fix-pr-ci-P3dLxmbx.js +2 -0
- package/dist/assets/migrations/20260710061339_neondeck_pre_1_0_baseline/migration.sql +748 -0
- package/dist/assets/migrations/20260710061339_neondeck_pre_1_0_baseline/snapshot.json +7126 -0
- package/dist/assets/migrations/20260711171708_conversational_briefings/migration.sql +35 -0
- package/dist/assets/migrations/20260711171708_conversational_briefings/snapshot.json +7458 -0
- package/dist/assets/migrations/20260714191624_worktree_lock_revocation/migration.sql +1 -0
- package/dist/assets/migrations/20260714191624_worktree_lock_revocation/snapshot.json +7468 -0
- package/dist/assets/migrations/20260714213018_pr_reviews/migration.sql +34 -0
- package/dist/assets/migrations/20260714213018_pr_reviews/snapshot.json +7809 -0
- package/dist/assets/pr-reviews-BtJ5cm5P.js +521 -0
- package/dist/assets/pr-reviews-BtJ5cm5P.js.map +1 -0
- package/dist/assets/prepare-pr-worktree-B0qMZMRP.js +2 -0
- package/dist/assets/prepare-pr-worktree-C7SmiaTp.js +17 -0
- package/dist/assets/prepare-pr-worktree-C7SmiaTp.js.map +1 -0
- package/dist/assets/push-pr-autofix-CsMbrnXR.js +17 -0
- package/dist/assets/push-pr-autofix-CsMbrnXR.js.map +1 -0
- package/dist/assets/push-pr-autofix-njuM6ej2.js +2 -0
- package/dist/assets/review-pr-for-human-CEciM46A.js +2 -0
- package/dist/assets/review-pr-for-human-TPiQNRWV.js +790 -0
- package/dist/assets/review-pr-for-human-TPiQNRWV.js.map +1 -0
- package/dist/assets/safety-BQC7exnI.js +1931 -0
- package/dist/assets/safety-BQC7exnI.js.map +1 -0
- package/dist/assets/scheduled-agent-instruction-BbxwCKbU.js +2 -0
- package/dist/assets/scheduled-agent-instruction-C58itQyU.js +22 -0
- package/dist/assets/scheduled-agent-instruction-C58itQyU.js.map +1 -0
- package/dist/assets/scheduler-tick-B2S9jCYS.js +90 -0
- package/dist/assets/scheduler-tick-B2S9jCYS.js.map +1 -0
- package/dist/assets/scheduler-workflow-CnI0tWbg.js +21 -0
- package/dist/assets/scheduler-workflow-CnI0tWbg.js.map +1 -0
- package/dist/assets/skills/github-gh/SKILL.md +56 -0
- package/dist/assets/skills/neon-ci-fix/SKILL.md +15 -0
- package/dist/assets/skills/neon-docs-fix/SKILL.md +15 -0
- package/dist/assets/skills/neon-issue-triage/SKILL.md +13 -0
- package/dist/assets/skills/neon-pr-review/SKILL.md +19 -0
- package/dist/assets/skills/neondeck/SKILL.md +127 -0
- package/dist/assets/skills/neondeck-handoff/SKILL.md +31 -0
- package/dist/assets/triage-pr-event-CBje6df5.js +2 -0
- package/dist/assets/triage-pr-event-IgC-IrNs.js +17 -0
- package/dist/assets/triage-pr-event-IgC-IrNs.js.map +1 -0
- package/dist/assets/verify-then-push-pr-autofix-C5Dpomtd.js +75 -0
- package/dist/assets/verify-then-push-pr-autofix-C5Dpomtd.js.map +1 -0
- package/dist/assets/verify-then-push-pr-autofix-oZ0-wa7L.js +2 -0
- package/dist/config/dashboard.json +224 -0
- package/dist/config/dashboard.schema.json +247 -0
- package/dist/server.mjs +583 -0
- package/dist/server.mjs.map +1 -0
- package/dist/skills/github-gh/SKILL.md +56 -0
- package/dist/skills/neon-ci-fix/SKILL.md +15 -0
- package/dist/skills/neon-docs-fix/SKILL.md +15 -0
- package/dist/skills/neon-issue-triage/SKILL.md +13 -0
- package/dist/skills/neon-pr-review/SKILL.md +19 -0
- package/dist/skills/neondeck/SKILL.md +127 -0
- package/dist/skills/neondeck-handoff/SKILL.md +31 -0
- package/drizzle.config.ts +7 -0
- package/package.json +156 -0
- package/shared/patch-anchors.ts +78 -0
- package/shared/report-document.ts +91 -0
- package/src/agents/busywork-workflow.ts +24 -0
- package/src/agents/display-assistant.ts +137 -0
- package/src/agents/pr-review-assistant.ts +25 -0
- package/src/agents/scheduler-workflow.ts +20 -0
- package/src/agents/support/tools.ts +346 -0
- package/src/app.ts +1 -0
- package/src/cli/index.ts +560 -0
- package/src/cli/learning.ts +44 -0
- package/src/cli/mcp.ts +496 -0
- package/src/cli/modules.ts +107 -0
- package/src/cli/onboarding.ts +666 -0
- package/src/cli/options.ts +102 -0
- package/src/cli/output.ts +399 -0
- package/src/cli/preapprovals.ts +204 -0
- package/src/cli/prompts.ts +108 -0
- package/src/cli/types.ts +59 -0
- package/src/db.ts +41 -0
- package/src/desktop/open.ts +698 -0
- package/src/desktop/service.ts +863 -0
- package/src/domains/mcp/actions.ts +420 -0
- package/src/domains/mcp/config.ts +501 -0
- package/src/domains/mcp/format.ts +35 -0
- package/src/domains/mcp/gate.ts +188 -0
- package/src/domains/mcp/index.ts +9 -0
- package/src/domains/mcp/instructions.ts +18 -0
- package/src/domains/mcp/oauth.ts +1063 -0
- package/src/domains/mcp/policy.ts +15 -0
- package/src/domains/mcp/registry.ts +461 -0
- package/src/domains/mcp/schemas.ts +171 -0
- package/src/domains/mcp/stdio.ts +451 -0
- package/src/domains/mcp/store.ts +905 -0
- package/src/domains/mcp/tools.ts +119 -0
- package/src/lib/action-result.ts +51 -0
- package/src/lib/exec.ts +118 -0
- package/src/lib/git.ts +20 -0
- package/src/lib/report-html.ts +193 -0
- package/src/lib/sqlite.ts +51 -0
- package/src/lib/valibot.ts +33 -0
- package/src/modules/app-state/index.ts +4 -0
- package/src/modules/app-state/notification-events.ts +44 -0
- package/src/modules/app-state/notifications.ts +259 -0
- package/src/modules/app-state/types.ts +42 -0
- package/src/modules/app-state/workflow-summaries.ts +201 -0
- package/src/modules/autonomous-audit/index.ts +225 -0
- package/src/modules/autopilot/actions.ts +186 -0
- package/src/modules/autopilot/admissions.ts +865 -0
- package/src/modules/autopilot/approvals.ts +59 -0
- package/src/modules/autopilot/ci-fix-run.ts +1332 -0
- package/src/modules/autopilot/ci-fix.ts +718 -0
- package/src/modules/autopilot/comments.ts +426 -0
- package/src/modules/autopilot/fixtures.ts +344 -0
- package/src/modules/autopilot/github-facts.ts +306 -0
- package/src/modules/autopilot/index.ts +64 -0
- package/src/modules/autopilot/notifications.ts +271 -0
- package/src/modules/autopilot/push-support.ts +260 -0
- package/src/modules/autopilot/push.ts +670 -0
- package/src/modules/autopilot/recovery.ts +656 -0
- package/src/modules/autopilot/review-feedback.ts +649 -0
- package/src/modules/autopilot/review-support.ts +524 -0
- package/src/modules/autopilot/revision-run.ts +445 -0
- package/src/modules/autopilot/schemas.ts +485 -0
- package/src/modules/autopilot/state-mappers.ts +517 -0
- package/src/modules/autopilot/state-schemas.ts +450 -0
- package/src/modules/autopilot/state-store.ts +183 -0
- package/src/modules/autopilot/state.ts +255 -0
- package/src/modules/autopilot/triage-support.ts +234 -0
- package/src/modules/autopilot/triage.ts +156 -0
- package/src/modules/autopilot/utils.ts +145 -0
- package/src/modules/autopilot/worktree.ts +637 -0
- package/src/modules/autopilot-policy/config.ts +101 -0
- package/src/modules/autopilot-policy/index.ts +4 -0
- package/src/modules/autopilot-policy/risk.ts +359 -0
- package/src/modules/autopilot-policy/schemas.ts +229 -0
- package/src/modules/autopilot-policy/service.ts +272 -0
- package/src/modules/briefings/actions.ts +80 -0
- package/src/modules/briefings/index.ts +5 -0
- package/src/modules/briefings/schemas.ts +125 -0
- package/src/modules/briefings/service.ts +642 -0
- package/src/modules/briefings/snapshot.ts +291 -0
- package/src/modules/briefings/store.ts +644 -0
- package/src/modules/commands/actions.ts +112 -0
- package/src/modules/commands/handlers/index.ts +3 -0
- package/src/modules/commands/handlers/misc.ts +367 -0
- package/src/modules/commands/handlers/queue.ts +710 -0
- package/src/modules/commands/handlers/repo.ts +339 -0
- package/src/modules/commands/index.ts +5 -0
- package/src/modules/commands/registry.ts +157 -0
- package/src/modules/commands/runner.ts +152 -0
- package/src/modules/commands/schemas.ts +109 -0
- package/src/modules/commands/summaries.ts +108 -0
- package/src/modules/commands/utils.ts +113 -0
- package/src/modules/config/actions.ts +253 -0
- package/src/modules/config/events.ts +80 -0
- package/src/modules/config/files.ts +9 -0
- package/src/modules/config/history.ts +74 -0
- package/src/modules/config/index.ts +9 -0
- package/src/modules/config/mutations/dashboard.ts +333 -0
- package/src/modules/config/mutations/execution.ts +89 -0
- package/src/modules/config/mutations/models.ts +467 -0
- package/src/modules/config/mutations/providers.ts +163 -0
- package/src/modules/config/mutations/repos.ts +663 -0
- package/src/modules/config/read.ts +130 -0
- package/src/modules/config/result.ts +66 -0
- package/src/modules/config/schemas.ts +180 -0
- package/src/modules/docs-drift/index.ts +1 -0
- package/src/modules/docs-drift/service.ts +863 -0
- package/src/modules/execution/actions.ts +35 -0
- package/src/modules/execution/approvals.ts +322 -0
- package/src/modules/execution/exedev/checkouts.ts +356 -0
- package/src/modules/execution/exedev/context.ts +286 -0
- package/src/modules/execution/index.ts +7 -0
- package/src/modules/execution/policy.ts +102 -0
- package/src/modules/execution/run.ts +589 -0
- package/src/modules/execution/schemas.ts +116 -0
- package/src/modules/execution/scope.ts +137 -0
- package/src/modules/execution/store.ts +320 -0
- package/src/modules/execution/utils.ts +105 -0
- package/src/modules/execution-policy/index.ts +424 -0
- package/src/modules/flue/execution-context.ts +40 -0
- package/src/modules/flue/index.ts +2 -0
- package/src/modules/flue/origin.ts +7 -0
- package/src/modules/github/actions.ts +334 -0
- package/src/modules/github/checks.ts +484 -0
- package/src/modules/github/client.ts +110 -0
- package/src/modules/github/comments.ts +204 -0
- package/src/modules/github/errors.ts +50 -0
- package/src/modules/github/index.ts +93 -0
- package/src/modules/github/issues.ts +116 -0
- package/src/modules/github/pr-file-cache.ts +264 -0
- package/src/modules/github/pull-requests.ts +411 -0
- package/src/modules/github/queue.ts +350 -0
- package/src/modules/github/reviews.ts +1446 -0
- package/src/modules/github/schemas.ts +794 -0
- package/src/modules/github/state-truncation.ts +31 -0
- package/src/modules/handoff/index.ts +2 -0
- package/src/modules/handoff/schemas.ts +61 -0
- package/src/modules/handoff/service.ts +587 -0
- package/src/modules/hygiene/index.ts +1 -0
- package/src/modules/hygiene/service.ts +513 -0
- package/src/modules/kilo/actions.ts +229 -0
- package/src/modules/kilo/ci-fix-run-reconcile.ts +299 -0
- package/src/modules/kilo/docs-drift-boundary.ts +178 -0
- package/src/modules/kilo/index.ts +8 -0
- package/src/modules/kilo/notifications.ts +295 -0
- package/src/modules/kilo/process.ts +637 -0
- package/src/modules/kilo/results/actions.ts +66 -0
- package/src/modules/kilo/results/gates.ts +227 -0
- package/src/modules/kilo/results/index.ts +23 -0
- package/src/modules/kilo/results/schemas.ts +112 -0
- package/src/modules/kilo/results/service.ts +512 -0
- package/src/modules/kilo/results/state.ts +508 -0
- package/src/modules/kilo/results/verify.ts +328 -0
- package/src/modules/kilo/revision-reconcile.ts +187 -0
- package/src/modules/kilo/runtime-facts.ts +128 -0
- package/src/modules/kilo/schemas.ts +265 -0
- package/src/modules/kilo/service.ts +714 -0
- package/src/modules/kilo/sessions-adapters.ts +343 -0
- package/src/modules/kilo/sessions.ts +446 -0
- package/src/modules/kilo/store.ts +689 -0
- package/src/modules/kilo/utils.ts +166 -0
- package/src/modules/learning/automation-health.ts +441 -0
- package/src/modules/learning/automation-memory.ts +179 -0
- package/src/modules/learning/index.ts +6 -0
- package/src/modules/learning/observability.ts +616 -0
- package/src/modules/learning/operator.ts +404 -0
- package/src/modules/learning/reviews/agents.ts +33 -0
- package/src/modules/learning/reviews/complete.ts +321 -0
- package/src/modules/learning/reviews/context.ts +145 -0
- package/src/modules/learning/reviews/events.ts +306 -0
- package/src/modules/learning/reviews/index.ts +6 -0
- package/src/modules/learning/reviews/pr-cadence.ts +157 -0
- package/src/modules/learning/reviews/pr-context.ts +749 -0
- package/src/modules/learning/reviews/prepare.ts +387 -0
- package/src/modules/learning/reviews/schemas.ts +184 -0
- package/src/modules/learning/reviews/store.ts +405 -0
- package/src/modules/learning/skill-patches/actions.ts +86 -0
- package/src/modules/learning/skill-patches/index.ts +3 -0
- package/src/modules/learning/skill-patches/schemas.ts +60 -0
- package/src/modules/learning/skill-patches/service.ts +571 -0
- package/src/modules/learning/skill-patches/support.ts +417 -0
- package/src/modules/memory/actions.ts +183 -0
- package/src/modules/memory/candidates.ts +525 -0
- package/src/modules/memory/events.ts +2 -0
- package/src/modules/memory/index.ts +6 -0
- package/src/modules/memory/prompt.ts +214 -0
- package/src/modules/memory/schemas.ts +170 -0
- package/src/modules/memory/service.ts +578 -0
- package/src/modules/memory/store.ts +489 -0
- package/src/modules/pr-events/actions.ts +191 -0
- package/src/modules/pr-events/index.ts +46 -0
- package/src/modules/pr-events/schemas.ts +186 -0
- package/src/modules/pr-events/service.ts +1414 -0
- package/src/modules/pr-events/target.ts +222 -0
- package/src/modules/pr-events/utils.ts +85 -0
- package/src/modules/pr-events/watermarks.ts +308 -0
- package/src/modules/pr-local-diffs/index.ts +334 -0
- package/src/modules/pr-review-assist/actions.ts +239 -0
- package/src/modules/pr-review-assist/index.ts +3 -0
- package/src/modules/pr-review-assist/schemas.ts +86 -0
- package/src/modules/pr-review-assist/service.ts +706 -0
- package/src/modules/pr-reviews/events.ts +39 -0
- package/src/modules/pr-reviews/index.ts +4 -0
- package/src/modules/pr-reviews/service.ts +655 -0
- package/src/modules/pr-reviews/store.ts +186 -0
- package/src/modules/pr-reviews/types.ts +48 -0
- package/src/modules/prepared-diffs/actions.ts +132 -0
- package/src/modules/prepared-diffs/index.ts +53 -0
- package/src/modules/prepared-diffs/schemas.ts +255 -0
- package/src/modules/prepared-diffs/service.ts +791 -0
- package/src/modules/prepared-diffs/store.ts +678 -0
- package/src/modules/repo-guardrails/config.ts +61 -0
- package/src/modules/repo-guardrails/index.ts +162 -0
- package/src/modules/repo-guardrails/risk.ts +2 -0
- package/src/modules/reports/index.ts +1 -0
- package/src/modules/reports/service.ts +337 -0
- package/src/modules/repos/index.ts +3 -0
- package/src/modules/repos/model-discovery.ts +233 -0
- package/src/modules/repos/providers.ts +194 -0
- package/src/modules/repos/registry.ts +232 -0
- package/src/modules/runtime/agent-config.ts +167 -0
- package/src/modules/runtime/doctor.ts +528 -0
- package/src/modules/runtime/env.ts +123 -0
- package/src/modules/runtime/index.ts +12 -0
- package/src/modules/runtime/local-api-auth.ts +43 -0
- package/src/modules/runtime/metrics.ts +211 -0
- package/src/modules/runtime/skills-actions.ts +141 -0
- package/src/modules/runtime/skills.ts +689 -0
- package/src/modules/runtime/soul.ts +68 -0
- package/src/modules/runtime/status-database.ts +252 -0
- package/src/modules/runtime/status-schema.ts +149 -0
- package/src/modules/runtime/status.ts +481 -0
- package/src/modules/runtime/subagents.ts +37 -0
- package/src/modules/runtime/utility-model.ts +47 -0
- package/src/modules/safety/index.ts +3 -0
- package/src/modules/safety/policy-entries.ts +2528 -0
- package/src/modules/safety/schemas.ts +63 -0
- package/src/modules/safety/service.ts +58 -0
- package/src/modules/safety/tools.ts +15 -0
- package/src/modules/scheduled-tasks/actions.ts +113 -0
- package/src/modules/scheduled-tasks/dispatch.ts +107 -0
- package/src/modules/scheduled-tasks/index.ts +6 -0
- package/src/modules/scheduled-tasks/schemas.ts +91 -0
- package/src/modules/scheduled-tasks/service.ts +296 -0
- package/src/modules/scheduled-tasks/store.ts +814 -0
- package/src/modules/scheduled-tasks/triggers.ts +87 -0
- package/src/modules/scheduler/actions.ts +37 -0
- package/src/modules/scheduler/dispatch.ts +192 -0
- package/src/modules/scheduler/index.ts +4 -0
- package/src/modules/scheduler/lease.ts +247 -0
- package/src/modules/scheduler/pr-watch-event-deltas.ts +367 -0
- package/src/modules/scheduler/pr-watch-events.ts +834 -0
- package/src/modules/scheduler/schemas.ts +79 -0
- package/src/modules/scheduler/service.ts +228 -0
- package/src/modules/scheduler/utils.ts +106 -0
- package/src/modules/scheduler/workflow-invocation.ts +48 -0
- package/src/modules/sessions/actions.ts +213 -0
- package/src/modules/sessions/active-session.ts +46 -0
- package/src/modules/sessions/activity.ts +122 -0
- package/src/modules/sessions/agent-context.ts +152 -0
- package/src/modules/sessions/approval-nudges.ts +156 -0
- package/src/modules/sessions/events.ts +57 -0
- package/src/modules/sessions/index.ts +12 -0
- package/src/modules/sessions/queries.ts +252 -0
- package/src/modules/sessions/references.ts +113 -0
- package/src/modules/sessions/repo-context.ts +131 -0
- package/src/modules/sessions/schemas.ts +285 -0
- package/src/modules/sessions/service.ts +845 -0
- package/src/modules/sessions/store.ts +560 -0
- package/src/modules/sessions/summaries.ts +129 -0
- package/src/modules/sessions/utils.ts +18 -0
- package/src/modules/watches/actions.ts +115 -0
- package/src/modules/watches/index.ts +6 -0
- package/src/modules/watches/polling.ts +245 -0
- package/src/modules/watches/references.ts +293 -0
- package/src/modules/watches/schemas.ts +156 -0
- package/src/modules/watches/service.ts +557 -0
- package/src/modules/watches/store.ts +398 -0
- package/src/modules/watches/utils.ts +51 -0
- package/src/modules/worktree-verification/index.ts +256 -0
- package/src/modules/worktrees/access.ts +129 -0
- package/src/modules/worktrees/actions.ts +108 -0
- package/src/modules/worktrees/cleanup.ts +98 -0
- package/src/modules/worktrees/ensure-pr-worktree.ts +63 -0
- package/src/modules/worktrees/errors.ts +38 -0
- package/src/modules/worktrees/git.ts +48 -0
- package/src/modules/worktrees/index.ts +7 -0
- package/src/modules/worktrees/locks.ts +231 -0
- package/src/modules/worktrees/paths.ts +209 -0
- package/src/modules/worktrees/push-target.ts +39 -0
- package/src/modules/worktrees/queries.ts +31 -0
- package/src/modules/worktrees/schemas.ts +237 -0
- package/src/modules/worktrees/service.ts +680 -0
- package/src/modules/worktrees/store.ts +415 -0
- package/src/repo-edit/actions.ts +509 -0
- package/src/repo-edit/audit.ts +180 -0
- package/src/repo-edit/fuzzy-replace.ts +256 -0
- package/src/repo-edit/git.ts +830 -0
- package/src/repo-edit/index.ts +4 -0
- package/src/repo-edit/locks.ts +27 -0
- package/src/repo-edit/patch-parser.ts +212 -0
- package/src/repo-edit/patch-service.ts +572 -0
- package/src/repo-edit/path-safety.ts +299 -0
- package/src/repo-edit/schemas.ts +239 -0
- package/src/repo-edit/service.ts +488 -0
- package/src/repo-edit/support.ts +459 -0
- package/src/runtime-home/app-db/index.ts +74 -0
- package/src/runtime-home/app-db/migrate.ts +491 -0
- package/src/runtime-home/app-db/migrations/20260710061339_neondeck_pre_1_0_baseline/migration.sql +748 -0
- package/src/runtime-home/app-db/migrations/20260710061339_neondeck_pre_1_0_baseline/snapshot.json +7126 -0
- package/src/runtime-home/app-db/migrations/20260711171708_conversational_briefings/migration.sql +35 -0
- package/src/runtime-home/app-db/migrations/20260711171708_conversational_briefings/snapshot.json +7458 -0
- package/src/runtime-home/app-db/migrations/20260714191624_worktree_lock_revocation/migration.sql +1 -0
- package/src/runtime-home/app-db/migrations/20260714191624_worktree_lock_revocation/snapshot.json +7468 -0
- package/src/runtime-home/app-db/migrations/20260714213018_pr_reviews/migration.sql +34 -0
- package/src/runtime-home/app-db/migrations/20260714213018_pr_reviews/snapshot.json +7809 -0
- package/src/runtime-home/app-db/reconcile.ts +155 -0
- package/src/runtime-home/app-db/schema.ts +1209 -0
- package/src/runtime-home/bootstrap.ts +177 -0
- package/src/runtime-home/dashboard-migrations.ts +101 -0
- package/src/runtime-home/defaults.ts +54 -0
- package/src/runtime-home/files.ts +193 -0
- package/src/runtime-home/guardrails.ts +77 -0
- package/src/runtime-home/index.ts +71 -0
- package/src/runtime-home/paths.ts +75 -0
- package/src/runtime-home/schemas.ts +520 -0
- package/src/sandboxes/exedev.ts +676 -0
- package/src/server/app.ts +5 -0
- package/src/server/autopilot-push-dispatch.ts +326 -0
- package/src/server/create-app.ts +160 -0
- package/src/server/events/event-stream.ts +109 -0
- package/src/server/http.ts +56 -0
- package/src/server/learning-hooks.ts +489 -0
- package/src/server/middleware.ts +81 -0
- package/src/server/routes/autopilot.ts +318 -0
- package/src/server/routes/briefings.ts +34 -0
- package/src/server/routes/commands.ts +12 -0
- package/src/server/routes/config.ts +124 -0
- package/src/server/routes/execution.ts +71 -0
- package/src/server/routes/github.ts +559 -0
- package/src/server/routes/handoff.ts +69 -0
- package/src/server/routes/kilo.ts +179 -0
- package/src/server/routes/learning.ts +384 -0
- package/src/server/routes/mcp.ts +301 -0
- package/src/server/routes/memory.ts +99 -0
- package/src/server/routes/metrics.ts +12 -0
- package/src/server/routes/notifications.ts +48 -0
- package/src/server/routes/repo-edit.ts +115 -0
- package/src/server/routes/reports.ts +128 -0
- package/src/server/routes/repos.ts +50 -0
- package/src/server/routes/reviews.ts +257 -0
- package/src/server/routes/runtime.ts +48 -0
- package/src/server/routes/safety.ts +13 -0
- package/src/server/routes/scheduled-tasks.ts +60 -0
- package/src/server/routes/scheduler.ts +13 -0
- package/src/server/routes/sessions.ts +229 -0
- package/src/server/routes/skills.ts +103 -0
- package/src/server/routes/watches.ts +81 -0
- package/src/server/routes/workflows.ts +21 -0
- package/src/server/routes/worktrees.ts +64 -0
- package/src/server/scheduler-workflow.ts +541 -0
- package/src/server/serve.ts +100 -0
- package/src/setup.ts +162 -0
- package/src/skills/github-gh/SKILL.md +56 -0
- package/src/skills/neon-ci-fix/SKILL.md +15 -0
- package/src/skills/neon-docs-fix/SKILL.md +15 -0
- package/src/skills/neon-issue-triage/SKILL.md +13 -0
- package/src/skills/neon-pr-review/SKILL.md +19 -0
- package/src/skills/neondeck/SKILL.md +127 -0
- package/src/skills/neondeck-handoff/SKILL.md +31 -0
- package/src/workflows/briefing.ts +50 -0
- package/src/workflows/command-run.ts +15 -0
- package/src/workflows/comment-pr-autofix-result.ts +10 -0
- package/src/workflows/curate_learning_store.ts +37 -0
- package/src/workflows/dev-doctor.ts +10 -0
- package/src/workflows/fix-pr-ci-failure.ts +10 -0
- package/src/workflows/fix-pr-ci.ts +15 -0
- package/src/workflows/fix-pr-review-feedback.ts +10 -0
- package/src/workflows/handoff_to_kilo.ts +10 -0
- package/src/workflows/prepare-pr-worktree.ts +10 -0
- package/src/workflows/promote_kilo_result.ts +10 -0
- package/src/workflows/push-pr-autofix.ts +10 -0
- package/src/workflows/reconcile_kilo_task.ts +10 -0
- package/src/workflows/review-pr-for-human.ts +15 -0
- package/src/workflows/review_conversation_for_learning.ts +37 -0
- package/src/workflows/review_kilo_result.ts +10 -0
- package/src/workflows/review_pr_batch_for_learning.ts +37 -0
- package/src/workflows/scheduled-agent-instruction.ts +16 -0
- package/src/workflows/scheduler-tick.ts +10 -0
- package/src/workflows/summarize_kilo_session.ts +25 -0
- package/src/workflows/triage-pr-event.ts +10 -0
- package/src/workflows/verify-pr-worktree.ts +10 -0
- package/src/workflows/verify-then-push-pr-autofix.ts +82 -0
- package/src/workflows/verify_kilo_result.ts +10 -0
- package/src/workflows/watch-pr.ts +10 -0
- package/web/dist/assets/GitHubPrReview-Bf8PXCaq.js +3 -0
- package/web/dist/assets/MultiFileView-CFYStqTV.js +2970 -0
- package/web/dist/assets/PrReviewPopoutPage-CZN1CV82.js +1 -0
- package/web/dist/assets/abap-CLvhMVsD.js +1 -0
- package/web/dist/assets/actionscript-3--17pq3dv.js +1 -0
- package/web/dist/assets/ada-C5qYipkI.js +1 -0
- package/web/dist/assets/andromeeda-vGVdxbeo.js +1 -0
- package/web/dist/assets/angular-html-BVBpGdXr.js +1 -0
- package/web/dist/assets/angular-ts-BfdufMKP.js +1 -0
- package/web/dist/assets/apache-U0d_L8uA.js +1 -0
- package/web/dist/assets/apex-VAyPSnFM.js +1 -0
- package/web/dist/assets/apl-DWBSSoBH.js +1 -0
- package/web/dist/assets/applescript-CCn79oCD.js +1 -0
- package/web/dist/assets/ara-4CJ0cIlV.js +1 -0
- package/web/dist/assets/asciidoc-DE70LPWp.js +1 -0
- package/web/dist/assets/asm-Cmm7eHzH.js +1 -0
- package/web/dist/assets/astro-3LtMP0Sq.js +1 -0
- package/web/dist/assets/aurora-x-CDeNXAV0.js +1 -0
- package/web/dist/assets/awk-BWXHIvNe.js +1 -0
- package/web/dist/assets/ayu-dark-DluEY0Gj.js +1 -0
- package/web/dist/assets/ayu-light-C3h-C4tm.js +1 -0
- package/web/dist/assets/ayu-mirage-Bqwy1Gya.js +1 -0
- package/web/dist/assets/ballerina-B7ZEbQpA.js +1 -0
- package/web/dist/assets/bat-Bo4NYOV-.js +1 -0
- package/web/dist/assets/beancount-D-usSTwE.js +1 -0
- package/web/dist/assets/berry-DKpUyyne.js +1 -0
- package/web/dist/assets/bibtex-Ci_nEsc7.js +1 -0
- package/web/dist/assets/bicep-CUHmPFLl.js +1 -0
- package/web/dist/assets/bird2-C6vDhewU.js +1 -0
- package/web/dist/assets/blade-llJRbbtR.js +1 -0
- package/web/dist/assets/bsl-BkkzgIyY.js +1 -0
- package/web/dist/assets/c-Wt1voDr2.js +1 -0
- package/web/dist/assets/c3-BFHwR3_K.js +1 -0
- package/web/dist/assets/cadence-CQ2zXKGN.js +1 -0
- package/web/dist/assets/cairo-DLTphjLi.js +1 -0
- package/web/dist/assets/catppuccin-frappe-3VR1Za6u.js +1 -0
- package/web/dist/assets/catppuccin-latte-DwIHMF0Q.js +1 -0
- package/web/dist/assets/catppuccin-macchiato-DYnBP6_5.js +1 -0
- package/web/dist/assets/catppuccin-mocha-DYhrFGRu.js +1 -0
- package/web/dist/assets/ccount-CMHa3wy6.js +1 -0
- package/web/dist/assets/clarity-SemFz856.js +1 -0
- package/web/dist/assets/clojure-DqKBuwfJ.js +1 -0
- package/web/dist/assets/cmake-Bj61d0ZC.js +1 -0
- package/web/dist/assets/cobol-x_HIyl2P.js +1 -0
- package/web/dist/assets/codeowners-C8r90Shi.js +1 -0
- package/web/dist/assets/codeql-oeQT6MSM.js +1 -0
- package/web/dist/assets/coffee-CThvmt4R.js +1 -0
- package/web/dist/assets/common-lisp-Cv5bFMCO.js +1 -0
- package/web/dist/assets/coq-BrsZFFmf.js +1 -0
- package/web/dist/assets/cpp-NtAeskI3.js +1 -0
- package/web/dist/assets/crystal-DNu_sX0G.js +1 -0
- package/web/dist/assets/csharp-oqKa8noW.js +1 -0
- package/web/dist/assets/css-DJp_X0uY.js +1 -0
- package/web/dist/assets/csv-Dx-8-gkx.js +1 -0
- package/web/dist/assets/cue-CE9AQfxI.js +1 -0
- package/web/dist/assets/cypher-ClKdZ_lG.js +1 -0
- package/web/dist/assets/d-qD-0Kul2.js +1 -0
- package/web/dist/assets/dark-plus-Cs2F2srj.js +1 -0
- package/web/dist/assets/dart-CnvKMtbv.js +1 -0
- package/web/dist/assets/dax-BkyTk9wS.js +1 -0
- package/web/dist/assets/desktop-Dlh5hvp9.js +1 -0
- package/web/dist/assets/diff-woXpYk--.js +1 -0
- package/web/dist/assets/docker-IyjqRm3v.js +1 -0
- package/web/dist/assets/dotenv-_5a1GRtc.js +1 -0
- package/web/dist/assets/dracula-BHWKrbxM.js +1 -0
- package/web/dist/assets/dracula-soft-5eyTD99u.js +1 -0
- package/web/dist/assets/dream-maker-DW3nJb8Q.js +1 -0
- package/web/dist/assets/edge-ozw5tpLl.js +1 -0
- package/web/dist/assets/elixir-VhA6FeZt.js +1 -0
- package/web/dist/assets/elm-dREJmIFz.js +1 -0
- package/web/dist/assets/emacs-lisp-B4R74twV.js +1 -0
- package/web/dist/assets/erb-CIg6G69l.js +1 -0
- package/web/dist/assets/erlang-Cphh6RMH.js +1 -0
- package/web/dist/assets/everforest-dark-sB-x3p7T.js +1 -0
- package/web/dist/assets/everforest-light-Df2xbC6M.js +1 -0
- package/web/dist/assets/fennel-DQxkIbk2.js +1 -0
- package/web/dist/assets/fish-BJitypiv.js +1 -0
- package/web/dist/assets/fluent-C03EYrpw.js +1 -0
- package/web/dist/assets/fortran-fixed-form-DEKoE2YW.js +1 -0
- package/web/dist/assets/fortran-free-form-CYNrtFtB.js +1 -0
- package/web/dist/assets/fsharp-D13ZGOAj.js +1 -0
- package/web/dist/assets/gdresource-C0sCabJj.js +1 -0
- package/web/dist/assets/gdscript-Cp2uCuqX.js +1 -0
- package/web/dist/assets/gdshader-CBce3t8t.js +1 -0
- package/web/dist/assets/genie-CV2tkWYe.js +1 -0
- package/web/dist/assets/gherkin-DExj1W_8.js +1 -0
- package/web/dist/assets/git-commit-BSykSTBG.js +1 -0
- package/web/dist/assets/git-rebase-B44mJPta.js +1 -0
- package/web/dist/assets/github-dark-C-LZuMrd.js +1 -0
- package/web/dist/assets/github-dark-default-DXG-b-1a.js +1 -0
- package/web/dist/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
- package/web/dist/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
- package/web/dist/assets/github-light-EUqPIrTm.js +1 -0
- package/web/dist/assets/github-light-default-BXViO-2h.js +1 -0
- package/web/dist/assets/github-light-high-contrast-B68TUdTA.js +1 -0
- package/web/dist/assets/gleam-CSRkHgEL.js +1 -0
- package/web/dist/assets/glimmer-js-vH_gHG0-.js +1 -0
- package/web/dist/assets/glimmer-ts--abOzSAQ.js +1 -0
- package/web/dist/assets/glsl-Dv5r7kPw.js +1 -0
- package/web/dist/assets/gn-ilITqXS6.js +1 -0
- package/web/dist/assets/gnuplot-7GGW24-e.js +1 -0
- package/web/dist/assets/go-rLFTqkRN.js +1 -0
- package/web/dist/assets/graphql-CB4jsw2E.js +1 -0
- package/web/dist/assets/groovy-CacY0gHj.js +1 -0
- package/web/dist/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
- package/web/dist/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
- package/web/dist/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
- package/web/dist/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
- package/web/dist/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
- package/web/dist/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
- package/web/dist/assets/hack-DvEYX148.js +1 -0
- package/web/dist/assets/haml-zE6W3STP.js +1 -0
- package/web/dist/assets/handlebars-CzBR2SDs.js +1 -0
- package/web/dist/assets/haskell-D8IpX4py.js +1 -0
- package/web/dist/assets/haxe-OTjmBuCE.js +1 -0
- package/web/dist/assets/hcl-Dh228itO.js +1 -0
- package/web/dist/assets/hjson-CxZEssPk.js +1 -0
- package/web/dist/assets/hlsl-Cvrh5tZx.js +1 -0
- package/web/dist/assets/horizon-CE9ld1lL.js +1 -0
- package/web/dist/assets/horizon-bright-DSNQnXHK.js +1 -0
- package/web/dist/assets/houston-CsvMBhTu.js +1 -0
- package/web/dist/assets/html-C8UlPnhE.js +1 -0
- package/web/dist/assets/html-derivative-CY6NRz-J.js +1 -0
- package/web/dist/assets/http-Cyd7bS_S.js +1 -0
- package/web/dist/assets/hurl-CWPsiEpf.js +1 -0
- package/web/dist/assets/hxml-B0Qn7Nwc.js +1 -0
- package/web/dist/assets/hy-CZbG8q4J.js +1 -0
- package/web/dist/assets/imba-DsUTQ-LC.js +1 -0
- package/web/dist/assets/index-BTjK1c82.js +44 -0
- package/web/dist/assets/index-D0kg2-9O.css +2 -0
- package/web/dist/assets/ini-B5eOa1yu.js +1 -0
- package/web/dist/assets/java-CGc3VwQr.js +1 -0
- package/web/dist/assets/javascript-CUt1pgmJ.js +1 -0
- package/web/dist/assets/jinja-CD-Z-FLd.js +1 -0
- package/web/dist/assets/jison-imPNup1l.js +1 -0
- package/web/dist/assets/json-Bg9ijW3F.js +1 -0
- package/web/dist/assets/json5-BR5RXkoi.js +1 -0
- package/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
- package/web/dist/assets/jsonl-CmCQp5Yx.js +1 -0
- package/web/dist/assets/jsonnet-CJTPZ8u_.js +1 -0
- package/web/dist/assets/jssm-DXw9l8Rf.js +1 -0
- package/web/dist/assets/jsx-CY6oMTks.js +1 -0
- package/web/dist/assets/julia-Dc3O-irA.js +1 -0
- package/web/dist/assets/just-BhOq_Kbv.js +1 -0
- package/web/dist/assets/kanagawa-dragon-CXtmUGW6.js +1 -0
- package/web/dist/assets/kanagawa-lotus-BN08jTvb.js +1 -0
- package/web/dist/assets/kanagawa-wave-CTweb8Dz.js +1 -0
- package/web/dist/assets/kdl-CsD5j6eV.js +1 -0
- package/web/dist/assets/kilo-CvN-tXHs.js +1 -0
- package/web/dist/assets/kotlin-DhhofPvG.js +1 -0
- package/web/dist/assets/kusto-C7mF5XQf.js +1 -0
- package/web/dist/assets/laserwave-C_8bwKvT.js +1 -0
- package/web/dist/assets/latex-Cu4Y1d5w.js +1 -0
- package/web/dist/assets/lean-CewbzKMR.js +1 -0
- package/web/dist/assets/less-DVTAwKKz.js +1 -0
- package/web/dist/assets/light-plus-DVQuIRkW.js +1 -0
- package/web/dist/assets/liquid-CvXMrjlQ.js +1 -0
- package/web/dist/assets/llvm-Cm23YOpf.js +1 -0
- package/web/dist/assets/log-BNLmms1o.js +1 -0
- package/web/dist/assets/logo-Cluzi2Zq.js +1 -0
- package/web/dist/assets/lua-BjLEUjKY.js +1 -0
- package/web/dist/assets/luau-FMPmPwt6.js +1 -0
- package/web/dist/assets/make-Dixweg8N.js +1 -0
- package/web/dist/assets/markdown-BYOwaDjH.js +1 -0
- package/web/dist/assets/marko-DvhNOisQ.js +1 -0
- package/web/dist/assets/material-theme-Bm3Qr25_.js +1 -0
- package/web/dist/assets/material-theme-darker-2IIEA8gg.js +1 -0
- package/web/dist/assets/material-theme-lighter-uhdI0v04.js +1 -0
- package/web/dist/assets/material-theme-ocean-CHQ94UKr.js +1 -0
- package/web/dist/assets/material-theme-palenight-B5W6OYN7.js +1 -0
- package/web/dist/assets/matlab-D7qyCx1q.js +1 -0
- package/web/dist/assets/mdc-Bm9TpL1X.js +1 -0
- package/web/dist/assets/mdx-DQZ5AkYe.js +1 -0
- package/web/dist/assets/mermaid-Bk4SNUv9.js +1 -0
- package/web/dist/assets/min-dark-BSWPekZh.js +1 -0
- package/web/dist/assets/min-light-DDpmG2fV.js +1 -0
- package/web/dist/assets/mipsasm-BMqwQI7S.js +1 -0
- package/web/dist/assets/mojo-BgCJLMeH.js +1 -0
- package/web/dist/assets/monokai-CdkpiU2Y.js +1 -0
- package/web/dist/assets/moonbit-CaWjb8XO.js +1 -0
- package/web/dist/assets/move-B1IS1UjX.js +1 -0
- package/web/dist/assets/narrat-_X_XdTYD.js +1 -0
- package/web/dist/assets/nextflow-BJtWHP5T.js +1 -0
- package/web/dist/assets/nextflow-groovy-DJMQeKeT.js +1 -0
- package/web/dist/assets/nginx-Bhc82uuv.js +1 -0
- package/web/dist/assets/night-owl-DhmEMT88.js +1 -0
- package/web/dist/assets/night-owl-light-eJ-hLW7d.js +1 -0
- package/web/dist/assets/nim-DXTVBFnF.js +1 -0
- package/web/dist/assets/nix-IvuFDN5E.js +1 -0
- package/web/dist/assets/nord-Cb4Vim4T.js +1 -0
- package/web/dist/assets/nushell-DcLAeLz5.js +1 -0
- package/web/dist/assets/objective-c-D1A_Heim.js +1 -0
- package/web/dist/assets/objective-cpp-BsSzOQcm.js +1 -0
- package/web/dist/assets/ocaml-O90oeIOV.js +1 -0
- package/web/dist/assets/odin-B1RWQWA5.js +1 -0
- package/web/dist/assets/one-dark-pro-CLwyXe_n.js +1 -0
- package/web/dist/assets/one-light-D7Lr4KcI.js +1 -0
- package/web/dist/assets/openscad-BUDT5pXO.js +1 -0
- package/web/dist/assets/pascal-4ZHwLPI5.js +1 -0
- package/web/dist/assets/perl-C7veXV9z.js +1 -0
- package/web/dist/assets/php-BRiuMnnr.js +1 -0
- package/web/dist/assets/pierre-dark-CpLgRqie.js +1 -0
- package/web/dist/assets/pierre-dark-protanopia-deuteranopia-B35FxJx-.js +1 -0
- package/web/dist/assets/pierre-dark-soft-kZQmAZld.js +1 -0
- package/web/dist/assets/pierre-dark-tritanopia-CpjhbsIL.js +1 -0
- package/web/dist/assets/pierre-dark-vibrant-CpQYzh95.js +1 -0
- package/web/dist/assets/pierre-light-CoaEpmwp.js +1 -0
- package/web/dist/assets/pierre-light-protanopia-deuteranopia-0fSaH845.js +1 -0
- package/web/dist/assets/pierre-light-soft-lWLdNTOI.js +1 -0
- package/web/dist/assets/pierre-light-tritanopia-CEbqgOJL.js +1 -0
- package/web/dist/assets/pierre-light-vibrant-D80Fkn33.js +1 -0
- package/web/dist/assets/pkl-ot-7Btpt.js +1 -0
- package/web/dist/assets/plastic-DQwYfKfQ.js +1 -0
- package/web/dist/assets/plsql-DGHpHOYJ.js +1 -0
- package/web/dist/assets/po-BiJDBrnU.js +1 -0
- package/web/dist/assets/poimandres-DRFjx7u4.js +1 -0
- package/web/dist/assets/polar-C7UOKdEL.js +1 -0
- package/web/dist/assets/postcss-BXeXVLqQ.js +1 -0
- package/web/dist/assets/powerquery-DNMTfnFr.js +1 -0
- package/web/dist/assets/powershell-DshXNtvi.js +1 -0
- package/web/dist/assets/prisma-BsRQq5mF.js +1 -0
- package/web/dist/assets/prolog-iXnhIJG7.js +1 -0
- package/web/dist/assets/proto-DB4EqR-F.js +1 -0
- package/web/dist/assets/pug-C5hz5LQ7.js +1 -0
- package/web/dist/assets/puppet-CDv2pdJW.js +1 -0
- package/web/dist/assets/purescript-9MfHhQsQ.js +1 -0
- package/web/dist/assets/python-gzcpVVnB.js +1 -0
- package/web/dist/assets/qml-BdUV3aTS.js +1 -0
- package/web/dist/assets/qmldir-DCQb3MpD.js +1 -0
- package/web/dist/assets/qss-Fe1Jh2GI.js +1 -0
- package/web/dist/assets/r-8R7vtdQc.js +1 -0
- package/web/dist/assets/racket-DcIDlBhZ.js +1 -0
- package/web/dist/assets/raku-B3gFvitq.js +1 -0
- package/web/dist/assets/razor-DRL52XO2.js +1 -0
- package/web/dist/assets/red-CJ3rzSJv.js +1 -0
- package/web/dist/assets/reg-CRGYupPL.js +1 -0
- package/web/dist/assets/regexp-Omp9DhTb.js +1 -0
- package/web/dist/assets/rel-BtDbiS_P.js +1 -0
- package/web/dist/assets/reviews-CUXp47M8.js +1 -0
- package/web/dist/assets/riscv-Ckw8ddFX.js +1 -0
- package/web/dist/assets/rolldown-runtime-QTnfLwEv.js +1 -0
- package/web/dist/assets/ron-VUp2lXgN.js +1 -0
- package/web/dist/assets/rose-pine-BthvhNj6.js +1 -0
- package/web/dist/assets/rose-pine-dawn-Dg85fqjY.js +1 -0
- package/web/dist/assets/rose-pine-moon-hon4tzzS.js +1 -0
- package/web/dist/assets/rosmsg-CAekHB0j.js +1 -0
- package/web/dist/assets/rst-BHX71KW9.js +1 -0
- package/web/dist/assets/ruby-B--HzjGU.js +1 -0
- package/web/dist/assets/rust-Cfkwpbl8.js +1 -0
- package/web/dist/assets/sas-DrLaYOK_.js +1 -0
- package/web/dist/assets/sass-DXrisJhu.js +1 -0
- package/web/dist/assets/scala-DKOlJaKm.js +1 -0
- package/web/dist/assets/scheme-DQCgrYNe.js +1 -0
- package/web/dist/assets/scss-DdSxiZKl.js +1 -0
- package/web/dist/assets/sdbl-bTVj8UrX.js +1 -0
- package/web/dist/assets/shaderlab-TOUzSsQk.js +1 -0
- package/web/dist/assets/shellscript-DwcUjJBL.js +1 -0
- package/web/dist/assets/shellsession-CPZkydE6.js +1 -0
- package/web/dist/assets/slack-dark-DnToyrRv.js +1 -0
- package/web/dist/assets/slack-ochin-B2OO5cIa.js +1 -0
- package/web/dist/assets/smalltalk-B16xEiuN.js +1 -0
- package/web/dist/assets/snazzy-light-4G7pJPwS.js +1 -0
- package/web/dist/assets/solarized-dark-DV17i1UV.js +1 -0
- package/web/dist/assets/solarized-light-DSh2HLQt.js +1 -0
- package/web/dist/assets/solidity-CKzVLygQ.js +1 -0
- package/web/dist/assets/soy-Br5FhD7c.js +1 -0
- package/web/dist/assets/sparql-D_iOobhT.js +1 -0
- package/web/dist/assets/splunk-BC2Px7Mm.js +1 -0
- package/web/dist/assets/sql-DNssxck8.js +1 -0
- package/web/dist/assets/ssh-config-BgfXC-Er.js +1 -0
- package/web/dist/assets/stata-DXn1tqOr.js +1 -0
- package/web/dist/assets/stylus-B6D30XZt.js +1 -0
- package/web/dist/assets/surfaces-Dlg1xLbg.js +1 -0
- package/web/dist/assets/surrealql-IeLNQw0f.js +1 -0
- package/web/dist/assets/svelte-DOdLCIlh.js +1 -0
- package/web/dist/assets/swift-DonLKvLd.js +1 -0
- package/web/dist/assets/synthwave-84-nFMaYfgc.js +1 -0
- package/web/dist/assets/system-verilog-DJ5XKQeo.js +1 -0
- package/web/dist/assets/systemd-BxMlprV5.js +1 -0
- package/web/dist/assets/talonscript-CohzipZa.js +1 -0
- package/web/dist/assets/tasl-DMoTqEGO.js +1 -0
- package/web/dist/assets/tcl-CZd0xW_V.js +1 -0
- package/web/dist/assets/templ-CIwIngms.js +1 -0
- package/web/dist/assets/terraform-DswuEJGm.js +1 -0
- package/web/dist/assets/tex-D8QMumu5.js +1 -0
- package/web/dist/assets/tokyo-night-oM2G3aXe.js +1 -0
- package/web/dist/assets/toml-CcmNWLt0.js +1 -0
- package/web/dist/assets/ts-tags-BMVY4q-l.js +1 -0
- package/web/dist/assets/tsv-sltzmVWM.js +1 -0
- package/web/dist/assets/tsx-5Eka4NBX.js +1 -0
- package/web/dist/assets/turtle-ByJddavk.js +1 -0
- package/web/dist/assets/twig-C8o_5mgw.js +1 -0
- package/web/dist/assets/typescript-DOu2WMV5.js +1 -0
- package/web/dist/assets/typespec-BRdr0IET.js +1 -0
- package/web/dist/assets/typst-DI99ib-x.js +1 -0
- package/web/dist/assets/v-DETTlOr0.js +1 -0
- package/web/dist/assets/vala-zf12oZj6.js +1 -0
- package/web/dist/assets/vb-Djn5o6TS.js +1 -0
- package/web/dist/assets/verilog-CiiDBU1e.js +1 -0
- package/web/dist/assets/vesper-DdrHHSXu.js +1 -0
- package/web/dist/assets/vhdl-BroJfC0k.js +1 -0
- package/web/dist/assets/viml-DvXPmvsu.js +1 -0
- package/web/dist/assets/vitesse-black-fwtXNY1n.js +1 -0
- package/web/dist/assets/vitesse-dark-BZCL-v6S.js +1 -0
- package/web/dist/assets/vitesse-light-VbXTXTou.js +1 -0
- package/web/dist/assets/vue-BU18DNDL.js +1 -0
- package/web/dist/assets/vue-html-BeluIYX0.js +1 -0
- package/web/dist/assets/vue-vine-DGUAbOCX.js +1 -0
- package/web/dist/assets/vyper-CgoNMtux.js +1 -0
- package/web/dist/assets/wasm-BnjxR4X6.js +1 -0
- package/web/dist/assets/wasm-ByWQv1Qj.js +1 -0
- package/web/dist/assets/wenyan-C8pVoKbM.js +1 -0
- package/web/dist/assets/wgsl-BsKzXJz4.js +1 -0
- package/web/dist/assets/wikitext-ClFFjSW2.js +1 -0
- package/web/dist/assets/wit-DdvCle-K.js +1 -0
- package/web/dist/assets/wolfram-DLL8P-h_.js +1 -0
- package/web/dist/assets/worker-05jVtNwz.js +160 -0
- package/web/dist/assets/xml-DIqSwXR3.js +1 -0
- package/web/dist/assets/xsl-Ct_-YIAy.js +1 -0
- package/web/dist/assets/yaml-DTtCYNlS.js +1 -0
- package/web/dist/assets/zenscript-BnlCZFoB.js +1 -0
- package/web/dist/assets/zig-CMLA9XwU.js +1 -0
- package/web/dist/icons/neondeck-icon-192.png +0 -0
- package/web/dist/icons/neondeck-icon-512.png +0 -0
- package/web/dist/icons/neondeck-icon.svg +41 -0
- package/web/dist/icons/neondeck-maskable-512.png +0 -0
- package/web/dist/index.html +27 -0
- package/web/dist/manifest.webmanifest +28 -0
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
GitHubPullRequestQueue,
|
|
3
|
+
GitHubPullRequest,
|
|
4
|
+
GitHubQueueIssue,
|
|
5
|
+
} from '../../github';
|
|
6
|
+
import { fetchGitHubLogin, fetchPullRequestQueue } from '../../github';
|
|
7
|
+
import { createCiFailureDossierReport } from '../../autopilot';
|
|
8
|
+
import { readRepoRegistrySnapshot } from '../../repos';
|
|
9
|
+
import { listPrWatchRecords } from '../../watches';
|
|
10
|
+
import { startPrReview } from '../../pr-reviews';
|
|
11
|
+
import type { RuntimePaths } from '../../../runtime-home';
|
|
12
|
+
import type {
|
|
13
|
+
CommandDependencies,
|
|
14
|
+
NeonCommandResult,
|
|
15
|
+
ParsedNeonCommand,
|
|
16
|
+
ReviewQueueAction,
|
|
17
|
+
} from '../schemas';
|
|
18
|
+
import {
|
|
19
|
+
completedCommand,
|
|
20
|
+
failedCommand,
|
|
21
|
+
needsConfigCommand,
|
|
22
|
+
runningCommand,
|
|
23
|
+
} from '../summaries';
|
|
24
|
+
import { errorMessage } from '../utils';
|
|
25
|
+
|
|
26
|
+
export async function reviewQueueCommand(
|
|
27
|
+
command: ParsedNeonCommand,
|
|
28
|
+
paths: RuntimePaths,
|
|
29
|
+
dependencies: CommandDependencies,
|
|
30
|
+
): Promise<NeonCommandResult> {
|
|
31
|
+
const queue = await readReviewQueue(paths, dependencies);
|
|
32
|
+
if (!queue.ok) {
|
|
33
|
+
return needsConfigCommand(command.name, command.raw, queue.message, {
|
|
34
|
+
requires: queue.requires,
|
|
35
|
+
errors: queue.errors,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const watches = await listPrWatchRecords(paths);
|
|
39
|
+
const triage = triageReviewQueue(queue.queue, watches);
|
|
40
|
+
|
|
41
|
+
return completedCommand(
|
|
42
|
+
command.name,
|
|
43
|
+
command.raw,
|
|
44
|
+
reviewQueueMessage(triage),
|
|
45
|
+
{
|
|
46
|
+
fetchedAt: queue.queue.fetchedAt,
|
|
47
|
+
login: queue.queue.login,
|
|
48
|
+
repos: queue.queue.repos,
|
|
49
|
+
count: queue.queue.items.length,
|
|
50
|
+
truncated: queue.queue.truncated,
|
|
51
|
+
issues: queue.queue.issues,
|
|
52
|
+
items: queue.queue.items,
|
|
53
|
+
triage,
|
|
54
|
+
topActions: triage.topActions,
|
|
55
|
+
},
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function reviewPrCommand(
|
|
60
|
+
command: ParsedNeonCommand,
|
|
61
|
+
paths: RuntimePaths,
|
|
62
|
+
dependencies: CommandDependencies,
|
|
63
|
+
): Promise<NeonCommandResult> {
|
|
64
|
+
const ref = command.args.join(' ').trim();
|
|
65
|
+
if (!ref) {
|
|
66
|
+
return failedCommand(
|
|
67
|
+
command.name,
|
|
68
|
+
command.raw,
|
|
69
|
+
'/review-pr requires a PR reference.',
|
|
70
|
+
{ requires: ['ref'] },
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const starter = dependencies.startPrReview ?? startPrReview;
|
|
75
|
+
const { review, reviewId, runId } = await starter(
|
|
76
|
+
{ ref, origin: 'chat' },
|
|
77
|
+
paths,
|
|
78
|
+
dependencies.invokeReviewPrWorkflow
|
|
79
|
+
? {
|
|
80
|
+
invokeWorkflow: (input) =>
|
|
81
|
+
dependencies.invokeReviewPrWorkflow!({
|
|
82
|
+
ref: input.ref,
|
|
83
|
+
reviewId: input.reviewId,
|
|
84
|
+
attemptId: input.attemptId,
|
|
85
|
+
}),
|
|
86
|
+
}
|
|
87
|
+
: undefined,
|
|
88
|
+
);
|
|
89
|
+
return runningCommand(
|
|
90
|
+
command.name,
|
|
91
|
+
command.raw,
|
|
92
|
+
`Reviewing ${review.repoFullName}#${review.prNumber}.`,
|
|
93
|
+
{
|
|
94
|
+
workflow: 'review-pr-for-human',
|
|
95
|
+
reviewId,
|
|
96
|
+
runId,
|
|
97
|
+
ref: review.ref,
|
|
98
|
+
queued: true,
|
|
99
|
+
reviewUrl: review.reviewUrl,
|
|
100
|
+
trustBoundary: review.trustBoundary,
|
|
101
|
+
assistantBrief:
|
|
102
|
+
'Track the durable review record. It will transition to ready with report links and local draft counts; the human reviewer owns edits and submission.',
|
|
103
|
+
},
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export async function invokeReviewPrWorkflow(input: {
|
|
108
|
+
ref: string;
|
|
109
|
+
reviewId?: string;
|
|
110
|
+
attemptId?: string;
|
|
111
|
+
}) {
|
|
112
|
+
const { invoke } = await import('@flue/runtime');
|
|
113
|
+
const workflow = await import('../../../workflows/review-pr-for-human');
|
|
114
|
+
return invoke(workflow.default, { input });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export async function fixCiCommand(
|
|
118
|
+
command: ParsedNeonCommand,
|
|
119
|
+
paths: RuntimePaths,
|
|
120
|
+
dependencies: CommandDependencies,
|
|
121
|
+
): Promise<NeonCommandResult> {
|
|
122
|
+
const explicitRef = command.args.join(' ').trim();
|
|
123
|
+
if (explicitRef) {
|
|
124
|
+
const parsed = parsePullRequestRef(explicitRef);
|
|
125
|
+
if (!parsed) {
|
|
126
|
+
return failedCommand(
|
|
127
|
+
command.name,
|
|
128
|
+
command.raw,
|
|
129
|
+
'Expected a PR reference like repo#123, owner/repo#123, or a GitHub pull request URL.',
|
|
130
|
+
{ requires: ['pr'] },
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
return queueFixCiWorkflow(
|
|
134
|
+
command,
|
|
135
|
+
`${parsed.repo}#${parsed.number}`,
|
|
136
|
+
dependencies,
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const queue = await readReviewQueue(paths, dependencies);
|
|
141
|
+
if (!queue.ok) {
|
|
142
|
+
return needsConfigCommand(command.name, command.raw, queue.message, {
|
|
143
|
+
requires: queue.requires,
|
|
144
|
+
errors: queue.errors,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const selected = selectPullRequest(queue.queue, command.args, {
|
|
149
|
+
prefer: isCiFixCandidate,
|
|
150
|
+
});
|
|
151
|
+
if (!selected.ok) {
|
|
152
|
+
return failedCommand(command.name, command.raw, selected.message, {
|
|
153
|
+
requires: selected.requires,
|
|
154
|
+
data: {
|
|
155
|
+
available: summarizePullRequests(queue.queue.items).slice(0, 10),
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (!isCiFixCandidate(selected.item)) {
|
|
160
|
+
return failedCommand(
|
|
161
|
+
command.name,
|
|
162
|
+
command.raw,
|
|
163
|
+
`${selected.item.repo}#${selected.item.number} does not have failing or unknown CI checks.`,
|
|
164
|
+
{
|
|
165
|
+
requires: ['failingChecks'],
|
|
166
|
+
data: { pr: summarizePullRequests([selected.item])[0] },
|
|
167
|
+
},
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const ref = `${selected.item.repo}#${selected.item.number}`;
|
|
172
|
+
return queueFixCiWorkflow(command, ref, dependencies);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
async function queueFixCiWorkflow(
|
|
176
|
+
command: ParsedNeonCommand,
|
|
177
|
+
ref: string,
|
|
178
|
+
dependencies: CommandDependencies,
|
|
179
|
+
): Promise<NeonCommandResult> {
|
|
180
|
+
const invokeWorkflow =
|
|
181
|
+
dependencies.invokeFixCiWorkflow ?? invokeFixCiWorkflow;
|
|
182
|
+
const { runId } = await invokeWorkflow({ ref });
|
|
183
|
+
return completedCommand(
|
|
184
|
+
command.name,
|
|
185
|
+
command.raw,
|
|
186
|
+
`Queued CI fix workflow ${runId} for ${ref}.`,
|
|
187
|
+
{
|
|
188
|
+
workflow: 'fix-pr-ci',
|
|
189
|
+
runId,
|
|
190
|
+
ref,
|
|
191
|
+
queued: true,
|
|
192
|
+
reportUrlHint: '/reports',
|
|
193
|
+
trustBoundary:
|
|
194
|
+
'The workflow can create local reports, a managed local worktree, a Kilo task, and a prepared diff only; it does not push, comment, or submit a GitHub review.',
|
|
195
|
+
assistantBrief:
|
|
196
|
+
'Track the returned workflow run id. The dossier report is local; any code changes must pass through the prepared-diff review loop.',
|
|
197
|
+
},
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export async function invokeFixCiWorkflow(input: { ref: string }) {
|
|
202
|
+
const { invoke } = await import('@flue/runtime');
|
|
203
|
+
const workflow = await import('../../../workflows/fix-pr-ci');
|
|
204
|
+
return invoke(workflow.default, { input });
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export async function explainCiCommand(
|
|
208
|
+
command: ParsedNeonCommand,
|
|
209
|
+
paths: RuntimePaths,
|
|
210
|
+
dependencies: CommandDependencies,
|
|
211
|
+
): Promise<NeonCommandResult> {
|
|
212
|
+
const options = parseExplainCiArgs(command.args);
|
|
213
|
+
const queue = await readReviewQueue(paths, dependencies);
|
|
214
|
+
if (!queue.ok) {
|
|
215
|
+
return needsConfigCommand(command.name, command.raw, queue.message, {
|
|
216
|
+
requires: queue.requires,
|
|
217
|
+
errors: queue.errors,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const selected = selectPullRequest(queue.queue, options.args, {
|
|
222
|
+
prefer: (item) =>
|
|
223
|
+
item.checks?.status === 'failure' ||
|
|
224
|
+
item.checkError !== undefined ||
|
|
225
|
+
item.checks?.status === 'pending',
|
|
226
|
+
});
|
|
227
|
+
if (!selected.ok) {
|
|
228
|
+
return failedCommand(command.name, command.raw, selected.message, {
|
|
229
|
+
requires: selected.requires,
|
|
230
|
+
data: {
|
|
231
|
+
available: summarizePullRequests(queue.queue.items).slice(0, 10),
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const pr = selected.item;
|
|
237
|
+
const explanation = ciExplanation(pr);
|
|
238
|
+
if (options.report) {
|
|
239
|
+
const writer =
|
|
240
|
+
dependencies.createCiFailureDossierReport ?? createCiFailureDossierReport;
|
|
241
|
+
const report = await writer(
|
|
242
|
+
{ ref: `${pr.repo}#${pr.number}`, reportOnly: true },
|
|
243
|
+
paths,
|
|
244
|
+
);
|
|
245
|
+
if (!report.ok) {
|
|
246
|
+
const requires = 'requires' in report ? report.requires : undefined;
|
|
247
|
+
const errors = 'errors' in report ? report.errors : undefined;
|
|
248
|
+
return requires?.includes('GITHUB_TOKEN')
|
|
249
|
+
? needsConfigCommand(command.name, command.raw, report.message, {
|
|
250
|
+
requires,
|
|
251
|
+
errors,
|
|
252
|
+
})
|
|
253
|
+
: failedCommand(command.name, command.raw, report.message, {
|
|
254
|
+
requires,
|
|
255
|
+
errors,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
if (!('report' in report)) {
|
|
259
|
+
return failedCommand(
|
|
260
|
+
command.name,
|
|
261
|
+
command.raw,
|
|
262
|
+
'CI dossier report writer did not return a report record.',
|
|
263
|
+
{ requires: ['report'] },
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
return completedCommand(
|
|
267
|
+
command.name,
|
|
268
|
+
command.raw,
|
|
269
|
+
`${explanation.message} Created CI dossier report ${report.report.id}.`,
|
|
270
|
+
{
|
|
271
|
+
pr: summarizePullRequests([pr])[0],
|
|
272
|
+
checks: pr.checks,
|
|
273
|
+
checkError: pr.checkError,
|
|
274
|
+
explanation,
|
|
275
|
+
report: {
|
|
276
|
+
id: report.report.id,
|
|
277
|
+
kind: report.report.kind,
|
|
278
|
+
title: report.report.title,
|
|
279
|
+
url: `/reports/${report.report.id}`,
|
|
280
|
+
},
|
|
281
|
+
assistantBrief:
|
|
282
|
+
'Use the deterministic CI dossier report and queue facts first. Separate observed facts from likely next debugging steps.',
|
|
283
|
+
},
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
return completedCommand(command.name, command.raw, explanation.message, {
|
|
287
|
+
pr: summarizePullRequests([pr])[0],
|
|
288
|
+
checks: pr.checks,
|
|
289
|
+
checkError: pr.checkError,
|
|
290
|
+
explanation,
|
|
291
|
+
assistantBrief:
|
|
292
|
+
'Use these deterministic CI/check facts first. Separate observed facts from likely next debugging steps.',
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function parseExplainCiArgs(args: string[]) {
|
|
297
|
+
return {
|
|
298
|
+
report: args.includes('--report'),
|
|
299
|
+
args: args.filter((arg) => arg !== '--report'),
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export async function summarizePrCommand(
|
|
304
|
+
command: ParsedNeonCommand,
|
|
305
|
+
paths: RuntimePaths,
|
|
306
|
+
dependencies: CommandDependencies,
|
|
307
|
+
): Promise<NeonCommandResult> {
|
|
308
|
+
const queue = await readReviewQueue(paths, dependencies);
|
|
309
|
+
if (!queue.ok) {
|
|
310
|
+
return needsConfigCommand(command.name, command.raw, queue.message, {
|
|
311
|
+
requires: queue.requires,
|
|
312
|
+
errors: queue.errors,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const selected = selectPullRequest(queue.queue, command.args);
|
|
317
|
+
if (!selected.ok) {
|
|
318
|
+
return failedCommand(command.name, command.raw, selected.message, {
|
|
319
|
+
requires: selected.requires,
|
|
320
|
+
data: {
|
|
321
|
+
available: summarizePullRequests(queue.queue.items).slice(0, 10),
|
|
322
|
+
},
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const pr = selected.item;
|
|
327
|
+
const summary = {
|
|
328
|
+
headline: `${pr.repo}#${pr.number}: ${pr.title}`,
|
|
329
|
+
state: pr.state,
|
|
330
|
+
author: pr.author,
|
|
331
|
+
relations: pr.relations,
|
|
332
|
+
labels: pr.labels,
|
|
333
|
+
comments: pr.comments,
|
|
334
|
+
ageDays: pr.ageDays,
|
|
335
|
+
stale: pr.stale,
|
|
336
|
+
baseRef: pr.baseRef,
|
|
337
|
+
headSha: pr.headSha,
|
|
338
|
+
checks: pr.checks?.status ?? 'unknown',
|
|
339
|
+
url: pr.url,
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
return completedCommand(
|
|
343
|
+
command.name,
|
|
344
|
+
command.raw,
|
|
345
|
+
`Summarized ${pr.repo}#${pr.number}.`,
|
|
346
|
+
{
|
|
347
|
+
pr: summarizePullRequests([pr])[0],
|
|
348
|
+
summary,
|
|
349
|
+
assistantBrief:
|
|
350
|
+
'Summarize the PR from these deterministic facts. Do not invent diff contents that were not fetched.',
|
|
351
|
+
},
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export function triageReviewQueue(
|
|
356
|
+
queue: GitHubPullRequestQueue,
|
|
357
|
+
watches: Awaited<ReturnType<typeof listPrWatchRecords>>,
|
|
358
|
+
) {
|
|
359
|
+
const authored = queue.items.filter((item) =>
|
|
360
|
+
item.relations.includes('authored'),
|
|
361
|
+
);
|
|
362
|
+
const assigned = queue.items.filter((item) =>
|
|
363
|
+
item.relations.includes('assigned'),
|
|
364
|
+
);
|
|
365
|
+
const requestedReviews = queue.items.filter((item) =>
|
|
366
|
+
item.relations.includes('review-requested'),
|
|
367
|
+
);
|
|
368
|
+
const failedChecks = queue.items.filter(
|
|
369
|
+
(item) => item.checks?.status === 'failure',
|
|
370
|
+
);
|
|
371
|
+
const checkErrors = queue.items.filter((item) => item.checkError);
|
|
372
|
+
const stalePrs = queue.items.filter((item) => item.stale);
|
|
373
|
+
const activeWatches = watches.filter((watch) =>
|
|
374
|
+
['watching', 'merged', 'attention-needed'].includes(watch.status),
|
|
375
|
+
);
|
|
376
|
+
const watchedPrs = queue.items.filter((item) =>
|
|
377
|
+
activeWatches.some(
|
|
378
|
+
(watch) =>
|
|
379
|
+
watch.repoFullName === item.repo && watch.prNumber === item.number,
|
|
380
|
+
),
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
return {
|
|
384
|
+
summary: {
|
|
385
|
+
authored: authored.length,
|
|
386
|
+
assigned: assigned.length,
|
|
387
|
+
requestedReviews: requestedReviews.length,
|
|
388
|
+
failedChecks: failedChecks.length,
|
|
389
|
+
checkErrors: checkErrors.length,
|
|
390
|
+
stale: stalePrs.length,
|
|
391
|
+
activeWatches: activeWatches.length,
|
|
392
|
+
watchedPrs: watchedPrs.length,
|
|
393
|
+
truncated: queue.truncated,
|
|
394
|
+
issues: queue.issues.length,
|
|
395
|
+
},
|
|
396
|
+
authored: summarizePullRequests(authored),
|
|
397
|
+
assigned: summarizePullRequests(assigned),
|
|
398
|
+
requestedReviews: summarizePullRequests(requestedReviews),
|
|
399
|
+
failedChecks: summarizePullRequests(failedChecks),
|
|
400
|
+
checkErrors: summarizePullRequests(checkErrors),
|
|
401
|
+
stalePrs: summarizePullRequests(stalePrs),
|
|
402
|
+
issues: summarizeQueueIssues(queue.issues),
|
|
403
|
+
activeWatches: activeWatches.map((watch) => ({
|
|
404
|
+
id: watch.id,
|
|
405
|
+
repo: watch.repoFullName,
|
|
406
|
+
number: watch.prNumber,
|
|
407
|
+
status: watch.status,
|
|
408
|
+
desiredTerminalState: watch.desiredTerminalState,
|
|
409
|
+
url: watch.url,
|
|
410
|
+
updatedAt: watch.updatedAt,
|
|
411
|
+
})),
|
|
412
|
+
topActions: rankReviewQueueActions(
|
|
413
|
+
queue.items,
|
|
414
|
+
activeWatches,
|
|
415
|
+
failedChecks,
|
|
416
|
+
checkErrors,
|
|
417
|
+
requestedReviews,
|
|
418
|
+
assigned,
|
|
419
|
+
stalePrs,
|
|
420
|
+
authored,
|
|
421
|
+
).slice(0, 3),
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export function summarizePullRequests(items: GitHubPullRequest[]) {
|
|
426
|
+
return items.map((item) => ({
|
|
427
|
+
repo: item.repo,
|
|
428
|
+
number: item.number,
|
|
429
|
+
title: item.title,
|
|
430
|
+
url: item.url,
|
|
431
|
+
author: item.author,
|
|
432
|
+
relations: item.relations,
|
|
433
|
+
checks: item.checks?.status ?? 'unknown',
|
|
434
|
+
checkError: item.checkError,
|
|
435
|
+
stale: item.stale,
|
|
436
|
+
ageDays: item.ageDays,
|
|
437
|
+
updatedAt: item.updatedAt,
|
|
438
|
+
}));
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export function summarizeQueueIssues(issues: GitHubQueueIssue[]) {
|
|
442
|
+
return issues.map((issue) => ({
|
|
443
|
+
type: issue.type,
|
|
444
|
+
message: issue.message,
|
|
445
|
+
query: issue.query,
|
|
446
|
+
repo: issue.repo,
|
|
447
|
+
number: issue.number,
|
|
448
|
+
}));
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export function rankReviewQueueActions(
|
|
452
|
+
items: GitHubPullRequest[],
|
|
453
|
+
watches: Awaited<ReturnType<typeof listPrWatchRecords>>,
|
|
454
|
+
failedChecks: GitHubPullRequest[],
|
|
455
|
+
checkErrors: GitHubPullRequest[],
|
|
456
|
+
requestedReviews: GitHubPullRequest[],
|
|
457
|
+
assigned: GitHubPullRequest[],
|
|
458
|
+
stalePrs: GitHubPullRequest[],
|
|
459
|
+
authored: GitHubPullRequest[],
|
|
460
|
+
): ReviewQueueAction[] {
|
|
461
|
+
const actions: ReviewQueueAction[] = [];
|
|
462
|
+
for (const item of failedChecks) {
|
|
463
|
+
actions.push(prAction(item, 'Fix failing checks', 'urgent'));
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
for (const item of checkErrors) {
|
|
467
|
+
actions.push(prAction(item, 'Investigate unknown CI status', 'urgent'));
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
for (const watch of watches.filter(
|
|
471
|
+
(item) => item.status === 'attention-needed',
|
|
472
|
+
)) {
|
|
473
|
+
actions.push({
|
|
474
|
+
title: `Resolve watch ${watch.id}`,
|
|
475
|
+
reason: `Watch is ${watch.status}.`,
|
|
476
|
+
priority: 'urgent',
|
|
477
|
+
url: watch.url,
|
|
478
|
+
repo: watch.repoFullName,
|
|
479
|
+
number: watch.prNumber,
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
for (const item of requestedReviews) {
|
|
484
|
+
actions.push(prAction(item, 'Review requested PR', 'high'));
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
for (const item of assigned) {
|
|
488
|
+
actions.push(prAction(item, 'Move assigned PR forward', 'high'));
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
for (const item of stalePrs) {
|
|
492
|
+
actions.push(prAction(item, 'Refresh stale PR', 'medium'));
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
for (const item of authored) {
|
|
496
|
+
actions.push(prAction(item, 'Advance authored PR', 'medium'));
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
for (const item of items) {
|
|
500
|
+
actions.push(prAction(item, 'Inspect open PR', 'low'));
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
return dedupeActions(actions);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
export function prAction(
|
|
507
|
+
item: GitHubPullRequest,
|
|
508
|
+
reason: string,
|
|
509
|
+
priority: ReviewQueueAction['priority'],
|
|
510
|
+
): ReviewQueueAction {
|
|
511
|
+
return {
|
|
512
|
+
title: `${reason}: ${item.repo}#${item.number}`,
|
|
513
|
+
reason:
|
|
514
|
+
item.checks?.status === 'failure'
|
|
515
|
+
? `${item.checks.failed} checks failed.`
|
|
516
|
+
: item.checkError
|
|
517
|
+
? `GitHub enrichment failed: ${item.checkError}`
|
|
518
|
+
: reason,
|
|
519
|
+
priority,
|
|
520
|
+
url: item.url,
|
|
521
|
+
repo: item.repo,
|
|
522
|
+
number: item.number,
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
export function dedupeActions(actions: ReviewQueueAction[]) {
|
|
527
|
+
const seen = new Set<string>();
|
|
528
|
+
return actions.filter((action) => {
|
|
529
|
+
const key =
|
|
530
|
+
action.repo && action.number
|
|
531
|
+
? `${action.repo}#${action.number}`
|
|
532
|
+
: `${action.title}:${action.reason}`;
|
|
533
|
+
if (seen.has(key)) return false;
|
|
534
|
+
seen.add(key);
|
|
535
|
+
return true;
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
export function isCiFixCandidate(item: GitHubPullRequest) {
|
|
540
|
+
return item.checks?.status === 'failure' || item.checkError !== undefined;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export function reviewQueueMessage(
|
|
544
|
+
triage: ReturnType<typeof triageReviewQueue>,
|
|
545
|
+
) {
|
|
546
|
+
const { summary } = triage;
|
|
547
|
+
const partial = summary.truncated || summary.issues > 0;
|
|
548
|
+
return `Triaged ${summary.authored + summary.assigned + summary.requestedReviews} user-related PR signal${summary.authored + summary.assigned + summary.requestedReviews === 1 ? '' : 's'}: ${summary.requestedReviews} review request${summary.requestedReviews === 1 ? '' : 's'}, ${summary.failedChecks} failing check set${summary.failedChecks === 1 ? '' : 's'}, ${summary.checkErrors} unknown check state${summary.checkErrors === 1 ? '' : 's'}, ${summary.stale} stale PR${summary.stale === 1 ? '' : 's'}.${partial ? ' Results are partial; inspect queue issues.' : ''}`;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
export function selectPullRequest(
|
|
552
|
+
queue: GitHubPullRequestQueue,
|
|
553
|
+
args: string[],
|
|
554
|
+
options: { prefer?: (item: GitHubPullRequest) => boolean } = {},
|
|
555
|
+
):
|
|
556
|
+
| { ok: true; item: GitHubPullRequest }
|
|
557
|
+
| { ok: false; message: string; requires?: string[] } {
|
|
558
|
+
const ref = args.join(' ').trim();
|
|
559
|
+
if (ref) {
|
|
560
|
+
const parsed = parsePullRequestRef(ref);
|
|
561
|
+
if (!parsed) {
|
|
562
|
+
return {
|
|
563
|
+
ok: false,
|
|
564
|
+
message:
|
|
565
|
+
'Expected a PR reference like repo#123, owner/repo#123, or a GitHub pull request URL.',
|
|
566
|
+
requires: ['pr'],
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
const match = queue.items.find(
|
|
571
|
+
(item) =>
|
|
572
|
+
item.number === parsed.number &&
|
|
573
|
+
(item.repo.toLowerCase() === parsed.repo.toLowerCase() ||
|
|
574
|
+
item.repo.split('/').at(1)?.toLowerCase() ===
|
|
575
|
+
parsed.repo.toLowerCase()),
|
|
576
|
+
);
|
|
577
|
+
if (!match) {
|
|
578
|
+
return {
|
|
579
|
+
ok: false,
|
|
580
|
+
message: `PR ${parsed.repo}#${parsed.number} was not found in the current review queue.`,
|
|
581
|
+
requires: ['queuedPr'],
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
return { ok: true, item: match };
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
const preferred = options.prefer
|
|
589
|
+
? queue.items.find(options.prefer)
|
|
590
|
+
: undefined;
|
|
591
|
+
const item = preferred ?? queue.items[0];
|
|
592
|
+
if (!item) {
|
|
593
|
+
return {
|
|
594
|
+
ok: false,
|
|
595
|
+
message: 'No pull requests are available in the current review queue.',
|
|
596
|
+
requires: ['pr'],
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
return { ok: true, item };
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
export function parsePullRequestRef(ref: string) {
|
|
604
|
+
const url = ref.match(/github\.com\/([^/\s]+)\/([^/\s]+)\/pull\/(\d+)/i);
|
|
605
|
+
if (url) {
|
|
606
|
+
return {
|
|
607
|
+
repo: `${url[1]}/${url[2].replace(/\.git$/, '')}`,
|
|
608
|
+
number: Number(url[3]),
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
const hash = ref.match(/^([A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)?)#(\d+)$/);
|
|
613
|
+
if (!hash) return undefined;
|
|
614
|
+
|
|
615
|
+
return {
|
|
616
|
+
repo: hash[1],
|
|
617
|
+
number: Number(hash[2]),
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
export function ciExplanation(pr: GitHubPullRequest) {
|
|
622
|
+
if (pr.checkError) {
|
|
623
|
+
return {
|
|
624
|
+
status: 'unknown',
|
|
625
|
+
message: `GitHub check status for ${pr.repo}#${pr.number} could not be enriched.`,
|
|
626
|
+
facts: [`Enrichment error: ${pr.checkError}`],
|
|
627
|
+
nextActions: [
|
|
628
|
+
'Open the PR checks page in GitHub.',
|
|
629
|
+
'Retry after confirming the token can read checks.',
|
|
630
|
+
],
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
if (!pr.checks) {
|
|
635
|
+
return {
|
|
636
|
+
status: 'unknown',
|
|
637
|
+
message: `${pr.repo}#${pr.number} has no check summary in the queue.`,
|
|
638
|
+
facts: ['No check runs or commit statuses were available.'],
|
|
639
|
+
nextActions: [
|
|
640
|
+
'Confirm the PR head SHA and configured repository access.',
|
|
641
|
+
],
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
const facts = [
|
|
646
|
+
`${pr.checks.total} total check signal${pr.checks.total === 1 ? '' : 's'}.`,
|
|
647
|
+
`${pr.checks.failed} failed, ${pr.checks.pending} pending, ${pr.checks.successful} successful.`,
|
|
648
|
+
`${pr.checks.statusContexts ?? 0} legacy status context${pr.checks.statusContexts === 1 ? '' : 's'}.`,
|
|
649
|
+
];
|
|
650
|
+
const nextActions =
|
|
651
|
+
pr.checks.status === 'failure'
|
|
652
|
+
? [
|
|
653
|
+
'Open the failing GitHub checks and inspect the first failed job log.',
|
|
654
|
+
'Run the matching local validation command if the repo exposes one.',
|
|
655
|
+
'After fixing, rerun failed checks or push an update.',
|
|
656
|
+
]
|
|
657
|
+
: pr.checks.status === 'pending'
|
|
658
|
+
? [
|
|
659
|
+
'Wait for pending checks or inspect queued jobs for capacity issues.',
|
|
660
|
+
]
|
|
661
|
+
: pr.checks.status === 'success'
|
|
662
|
+
? ['No CI action is needed unless review feedback remains.']
|
|
663
|
+
: ['Confirm whether this repo is expected to publish checks.'];
|
|
664
|
+
|
|
665
|
+
return {
|
|
666
|
+
status: pr.checks.status,
|
|
667
|
+
message: `${pr.repo}#${pr.number} CI is ${pr.checks.status}.`,
|
|
668
|
+
facts,
|
|
669
|
+
nextActions,
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
export async function readReviewQueue(
|
|
674
|
+
paths: RuntimePaths,
|
|
675
|
+
dependencies: CommandDependencies,
|
|
676
|
+
): Promise<
|
|
677
|
+
| { ok: true; queue: GitHubPullRequestQueue }
|
|
678
|
+
| { ok: false; message: string; errors?: string[]; requires?: string[] }
|
|
679
|
+
> {
|
|
680
|
+
const token = process.env.GITHUB_TOKEN;
|
|
681
|
+
if (!token) {
|
|
682
|
+
return {
|
|
683
|
+
ok: false,
|
|
684
|
+
message: 'GITHUB_TOKEN is not configured.',
|
|
685
|
+
requires: ['GITHUB_TOKEN'],
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
try {
|
|
690
|
+
const registry = await readRepoRegistrySnapshot(paths);
|
|
691
|
+
const fetchLogin = dependencies.fetchGitHubLogin ?? fetchGitHubLogin;
|
|
692
|
+
const fetchQueue =
|
|
693
|
+
dependencies.fetchPullRequestQueue ?? fetchPullRequestQueue;
|
|
694
|
+
const login = process.env.GITHUB_LOGIN ?? (await fetchLogin(token));
|
|
695
|
+
return {
|
|
696
|
+
ok: true,
|
|
697
|
+
queue: await fetchQueue({
|
|
698
|
+
token,
|
|
699
|
+
login,
|
|
700
|
+
repos: registry.repos,
|
|
701
|
+
}),
|
|
702
|
+
};
|
|
703
|
+
} catch (error) {
|
|
704
|
+
return {
|
|
705
|
+
ok: false,
|
|
706
|
+
message: 'Could not fetch GitHub review queue.',
|
|
707
|
+
errors: [errorMessage(error)],
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
}
|