@justjoshn/pi-pstack 0.0.0-stage → 0.15.36-pi.7
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 +39 -0
- package/LICENSE +21 -0
- package/README.md +98 -2
- package/agents/ci-watcher.md +27 -0
- package/agents/comment-sicko.md +32 -0
- package/agents/poteto-agent.md +9 -0
- package/agents/thermo-nuclear-code-quality-review.md +23 -0
- package/assets/logo.png +0 -0
- package/automations/benny/FOR_AGENTS.md +82 -0
- package/automations/benny/README.md +20 -0
- package/automations/benny/skills/reproduce-and-fix-issues/SKILL.md +310 -0
- package/automations/benny/skills/reproduce-and-fix-issues/references/control-adapter.md +169 -0
- package/automations/benny/skills/reproduce-and-fix-issues/references/feature-map.example.md +205 -0
- package/automations/benny/skills/reproduce-and-fix-issues/references/verify-existing-fix.md +93 -0
- package/automations/benny/skills/setup-benny/SKILL.md +253 -0
- package/automations/benny/skills/triage-issue-reports/SKILL.md +240 -0
- package/automations/benny/skills/triage-issue-reports/references/routing.example.md +61 -0
- package/automations/benny/templates/configuration.example.yaml +113 -0
- package/automations/benny/templates/reproduce-automation-prompt.md +49 -0
- package/automations/benny/templates/triage-automation-prompt.md +53 -0
- package/bin/pstack-routines-supervisor +9 -0
- package/docs/guide/01-setup.md +67 -0
- package/docs/guide/02-poteto-mode.md +139 -0
- package/docs/guide/03-understand.md +79 -0
- package/docs/guide/04-design.md +133 -0
- package/docs/guide/05-build-and-clean.md +83 -0
- package/docs/guide/06-verify-and-ship.md +162 -0
- package/docs/guide/07-overnight.md +122 -0
- package/docs/guide/08-principles.md +72 -0
- package/docs/guide/09-make-it-yours.md +100 -0
- package/docs/guide/10-recipes-and-pitfalls.md +182 -0
- package/docs/guide/README.md +38 -0
- package/docs/guide/images/design.jpg +0 -0
- package/docs/guide/images/overnight.jpg +0 -0
- package/docs/guide/images/recipes.jpg +0 -0
- package/docs/guide/images/router.jpg +0 -0
- package/docs/guide/images/understanding.jpg +0 -0
- package/docs/guide/images/verification.jpg +0 -0
- package/docs/native-gaps.md +73 -0
- package/docs/parity-reverse-engineering.md +94 -0
- package/licenses/cursor-team-kit.LICENSE +21 -0
- package/licenses/pstack.LICENSE +21 -0
- package/package.json +86 -4
- package/packaging/install-supervisor-unit.sh +164 -0
- package/packaging/launchd/com.pstack.routines-supervisor.plist.example +24 -0
- package/packaging/systemd/pstack-routines-supervisor.service.example +15 -0
- package/skills/architect/SKILL.md +79 -0
- package/skills/architect/references/design-red-flags.md +57 -0
- package/skills/architect/references/rationale-template.md +35 -0
- package/skills/architect/references/runner-prompt.md +20 -0
- package/skills/arena/SKILL.md +48 -0
- package/skills/automate-me/SKILL.md +104 -0
- package/skills/benchmark-checklist/SKILL.md +39 -0
- package/skills/blast-radius/SKILL.md +50 -0
- package/skills/bro/SKILL.md +7 -0
- package/skills/check-compiler-errors/SKILL.md +23 -0
- package/skills/control-cli/SKILL.md +109 -0
- package/skills/control-ui/SKILL.md +109 -0
- package/skills/correct/SKILL.md +32 -0
- package/skills/create-formal-verification-skill/SKILL.md +43 -0
- package/skills/create-skill/SKILL.md +548 -0
- package/skills/create-verification-skill/SKILL.md +44 -0
- package/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
- package/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
- package/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
- package/skills/deslop/SKILL.md +22 -0
- package/skills/figure-it-out/SKILL.md +52 -0
- package/skills/fix-ci/SKILL.md +29 -0
- package/skills/fix-merge-conflicts/SKILL.md +32 -0
- package/skills/get-pr-comments/SKILL.md +23 -0
- package/skills/how/SKILL.md +36 -0
- package/skills/how/references/explainer-prompt.md +55 -0
- package/skills/how/references/explorer-prompt.md +35 -0
- package/skills/in-your-own-words/SKILL.md +7 -0
- package/skills/interrogate/SKILL.md +31 -0
- package/skills/ketchup/SKILL.md +43 -0
- package/skills/ketchup-video/SKILL.md +29 -0
- package/skills/loop-on-ci/SKILL.md +50 -0
- package/skills/maintain-formal-verification-skill/SKILL.md +58 -0
- package/skills/maintain-verification-skill/SKILL.md +39 -0
- package/skills/make-bot-ui/SKILL.md +104 -0
- package/skills/make-pr-easy-to-review/SKILL.md +59 -0
- package/skills/new-branch-and-pr/SKILL.md +29 -0
- package/skills/no-comments/SKILL.md +24 -0
- package/skills/no-inline-imports/SKILL.md +12 -0
- package/skills/poteto-help/SKILL.md +161 -0
- package/skills/poteto-help/references/prompting.md +51 -0
- package/skills/poteto-help/references/recipes.md +51 -0
- package/skills/poteto-mode/SKILL.md +151 -0
- package/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
- package/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
- package/skills/poteto-mode/playbooks/autopilot-full.md +25 -0
- package/skills/poteto-mode/playbooks/autopilot-stack.md +8 -0
- package/skills/poteto-mode/playbooks/babysit.md +23 -0
- package/skills/poteto-mode/playbooks/bug-fix.md +15 -0
- package/skills/poteto-mode/playbooks/eval.md +25 -0
- package/skills/poteto-mode/playbooks/feature.md +21 -0
- package/skills/poteto-mode/playbooks/hillclimb.md +21 -0
- package/skills/poteto-mode/playbooks/investigation.md +14 -0
- package/skills/poteto-mode/playbooks/multi-phase-plan.md +155 -0
- package/skills/poteto-mode/playbooks/opening-a-pr.md +34 -0
- package/skills/poteto-mode/playbooks/orchestrate.md +25 -0
- package/skills/poteto-mode/playbooks/pause-safely.md +10 -0
- package/skills/poteto-mode/playbooks/perf-issue.md +25 -0
- package/skills/poteto-mode/playbooks/prototype.md +14 -0
- package/skills/poteto-mode/playbooks/refactoring.md +16 -0
- package/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
- package/skills/poteto-mode/playbooks/session-pickup.md +11 -0
- package/skills/poteto-mode/playbooks/shipping.md +12 -0
- package/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
- package/skills/poteto-mode/playbooks/visual-parity.md +11 -0
- package/skills/poteto-mode/playbooks/worktree-cleanup.md +12 -0
- package/skills/poteto-mode/references/bugbot-triage.md +142 -0
- package/skills/poteto-mode/scripts/bootstrap.ts +62 -0
- package/skills/poteto-mode/scripts/bun.lock +67 -0
- package/skills/poteto-mode/scripts/check-plan.mjs +205 -0
- package/skills/poteto-mode/scripts/check-plan.test.ts +110 -0
- package/skills/poteto-mode/scripts/package.json +16 -0
- package/skills/poteto-mode/scripts/watch-pr/cli.test.ts +224 -0
- package/skills/poteto-mode/scripts/watch-pr/cli.ts +223 -0
- package/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +129 -0
- package/skills/poteto-mode/scripts/watch-pr/github.test.ts +498 -0
- package/skills/poteto-mode/scripts/watch-pr/github.ts +726 -0
- package/skills/poteto-mode/scripts/watch-pr/policy.test.ts +482 -0
- package/skills/poteto-mode/scripts/watch-pr/policy.ts +842 -0
- package/skills/poteto-mode/scripts/watch-pr/render.ts +169 -0
- package/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
- package/skills/poteto-mode/scripts/watch-pr/types.compile.ts +93 -0
- package/skills/poteto-mode/scripts/watch-pr/types.ts +414 -0
- package/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
- package/skills/poteto-mode/scripts/worktree-audit.sh +156 -0
- package/skills/pr-review-canvas/SKILL.md +176 -0
- package/skills/pr-review-canvas/renderer.js +170 -0
- package/skills/pr-review-canvas/styles.css +96 -0
- package/skills/pr-review-canvas/template.html +18 -0
- package/skills/principle-attack-the-premise/SKILL.md +21 -0
- package/skills/principle-boundary-discipline/SKILL.md +34 -0
- package/skills/principle-build-the-lever/SKILL.md +23 -0
- package/skills/principle-encode-lessons-in-structure/SKILL.md +11 -0
- package/skills/principle-exhaust-the-design-space/SKILL.md +9 -0
- package/skills/principle-experience-first/SKILL.md +19 -0
- package/skills/principle-explain-the-number/SKILL.md +18 -0
- package/skills/principle-fix-root-causes/SKILL.md +21 -0
- package/skills/principle-foundational-thinking/SKILL.md +21 -0
- package/skills/principle-guard-the-context-window/SKILL.md +12 -0
- package/skills/principle-laziness-protocol/SKILL.md +10 -0
- package/skills/principle-make-operations-idempotent/SKILL.md +22 -0
- package/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +14 -0
- package/skills/principle-minimize-reader-load/SKILL.md +18 -0
- package/skills/principle-model-the-domain/SKILL.md +24 -0
- package/skills/principle-never-block-on-the-human/SKILL.md +15 -0
- package/skills/principle-outcome-oriented-execution/SKILL.md +21 -0
- package/skills/principle-prove-it-works/SKILL.md +22 -0
- package/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
- package/skills/principle-separate-before-serializing-shared-state/SKILL.md +16 -0
- package/skills/principle-sequence-verifiable-units/SKILL.md +17 -0
- package/skills/principle-subtract-before-you-add/SKILL.md +18 -0
- package/skills/principle-test-behavior-not-implementation/SKILL.md +20 -0
- package/skills/principle-type-system-discipline/SKILL.md +13 -0
- package/skills/recall/SKILL.md +35 -0
- package/skills/reflect/SKILL.md +69 -0
- package/skills/reflect/references/divergent-reviewer.md +38 -0
- package/skills/reflect/references/judgment-reviewer.md +37 -0
- package/skills/reflect/references/synthesizer.md +56 -0
- package/skills/reflect/references/tooling-reviewer.md +48 -0
- package/skills/review-and-ship/SKILL.md +41 -0
- package/skills/run-smoke-tests/SKILL.md +42 -0
- package/skills/setup-pstack/SKILL.md +74 -0
- package/skills/sharpen/SKILL.md +16 -0
- package/skills/show-me-your-work/SKILL.md +82 -0
- package/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/skills/show-me-your-work/scripts/log.sh +42 -0
- package/skills/statechart/SKILL.md +82 -0
- package/skills/statechart/references/render.md +93 -0
- package/skills/statechart/scripts/backends/cfg.ts +33 -0
- package/skills/statechart/scripts/backends/mermaid.ts +201 -0
- package/skills/statechart/scripts/backends/plain-text.ts +72 -0
- package/skills/statechart/scripts/backends/report.ts +177 -0
- package/skills/statechart/scripts/frontends/config.ts +276 -0
- package/skills/statechart/scripts/frontends/dot.ts +74 -0
- package/skills/statechart/scripts/frontends/marks.ts +93 -0
- package/skills/statechart/scripts/frontends/messages.ts +52 -0
- package/skills/statechart/scripts/frontends/spec.ts +114 -0
- package/skills/statechart/scripts/frontends/trace.ts +24 -0
- package/skills/statechart/scripts/frontends/value.ts +166 -0
- package/skills/statechart/scripts/frontends/verdict.ts +40 -0
- package/skills/statechart/scripts/frontends/view.ts +119 -0
- package/skills/statechart/scripts/ir.ts +547 -0
- package/skills/statechart/scripts/package.json +11 -0
- package/skills/statechart/scripts/passes/annotate.ts +128 -0
- package/skills/statechart/scripts/passes/label.ts +269 -0
- package/skills/statechart/scripts/passes/lift.ts +85 -0
- package/skills/statechart/scripts/passes/loop-check.ts +68 -0
- package/skills/statechart/scripts/passes/paths.ts +60 -0
- package/skills/statechart/scripts/passes/reach.ts +135 -0
- package/skills/statechart/scripts/passes/region-check.ts +97 -0
- package/skills/statechart/scripts/passes/regions.ts +295 -0
- package/skills/statechart/scripts/pipeline.ts +76 -0
- package/skills/statechart/scripts/run.ts +481 -0
- package/skills/statechart/scripts/statechart +29 -0
- package/skills/statechart/scripts/statechart.ts +164 -0
- package/skills/statechart/scripts/test/ConfigOracle.java +63 -0
- package/skills/statechart/scripts/test/chart.test.ts +1210 -0
- package/skills/statechart/scripts/test/charts/Braces.mmd +7 -0
- package/skills/statechart/scripts/test/charts/Escapes.mmd +11 -0
- package/skills/statechart/scripts/test/charts/Phases.mmd +29 -0
- package/skills/statechart/scripts/test/cli.test.ts +1314 -0
- package/skills/statechart/scripts/test/config-fuzz.test.ts +263 -0
- package/skills/statechart/scripts/test/corpus/Counter/ChartRun.out +57 -0
- package/skills/statechart/scripts/test/corpus/Counter/Counter.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/Counter/Counter.tla +10 -0
- package/skills/statechart/scripts/test/corpus/Counter/chart.mmd +9 -0
- package/skills/statechart/scripts/test/corpus/Counter/graph.dot +16 -0
- package/skills/statechart/scripts/test/corpus/Counter/report.md +7 -0
- package/skills/statechart/scripts/test/corpus/Counter/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/Counter/verdict-1.out +49 -0
- package/skills/statechart/scripts/test/corpus/CounterAction/ChartRun.out +60 -0
- package/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.cfg +4 -0
- package/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.tla +22 -0
- package/skills/statechart/scripts/test/corpus/CounterAction/chart.mmd +26 -0
- package/skills/statechart/scripts/test/corpus/CounterAction/graph.dot +19 -0
- package/skills/statechart/scripts/test/corpus/CounterAction/report.md +20 -0
- package/skills/statechart/scripts/test/corpus/CounterAction/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.out +56 -0
- package/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.out +82 -0
- package/skills/statechart/scripts/test/corpus/CounterAction/verdict-3.out +57 -0
- package/skills/statechart/scripts/test/corpus/CounterDeadlock/ChartRun.out +59 -0
- package/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.tla +11 -0
- package/skills/statechart/scripts/test/corpus/CounterDeadlock/chart.mmd +22 -0
- package/skills/statechart/scripts/test/corpus/CounterDeadlock/graph.dot +16 -0
- package/skills/statechart/scripts/test/corpus/CounterDeadlock/report.md +17 -0
- package/skills/statechart/scripts/test/corpus/CounterDeadlock/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.out +56 -0
- package/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.out +77 -0
- package/skills/statechart/scripts/test/corpus/CounterFan/ChartRun.out +69 -0
- package/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.cfg +2 -0
- package/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.tla +11 -0
- package/skills/statechart/scripts/test/corpus/CounterFan/chart.mmd +85 -0
- package/skills/statechart/scripts/test/corpus/CounterFan/graph.dot +70 -0
- package/skills/statechart/scripts/test/corpus/CounterFan/report.md +12 -0
- package/skills/statechart/scripts/test/corpus/CounterFan/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.out +67 -0
- package/skills/statechart/scripts/test/corpus/CounterFan/verdict-2.out +57 -0
- package/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.out +85 -0
- package/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.cfg +6 -0
- package/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.tla +13 -0
- package/skills/statechart/scripts/test/corpus/CounterGuard/chart.mmd +5 -0
- package/skills/statechart/scripts/test/corpus/CounterGuard/graph.dot +10 -0
- package/skills/statechart/scripts/test/corpus/CounterGuard/report.md +31 -0
- package/skills/statechart/scripts/test/corpus/CounterGuard/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.out +64 -0
- package/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.out +77 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPast/ChartRun.out +55 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.tla +10 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPast/chart.mmd +12 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPast/graph.dot +6 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPast/report.md +12 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPast/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.out +33 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-2.out +54 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/ChartRun.out +54 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.tla +10 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/chart.mmd +1 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/graph.dot +6 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/report.md +7 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterInitPastHolds/verdict-1.out +46 -0
- package/skills/statechart/scripts/test/corpus/CounterInstance/ChartRun.out +59 -0
- package/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.cfg +2 -0
- package/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.tla +10 -0
- package/skills/statechart/scripts/test/corpus/CounterInstance/CounterSteps.tla +6 -0
- package/skills/statechart/scripts/test/corpus/CounterInstance/chart.mmd +17 -0
- package/skills/statechart/scripts/test/corpus/CounterInstance/graph.dot +15 -0
- package/skills/statechart/scripts/test/corpus/CounterInstance/report.md +14 -0
- package/skills/statechart/scripts/test/corpus/CounterInstance/sany.out +3 -0
- package/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.out +78 -0
- package/skills/statechart/scripts/test/corpus/CounterJump/ChartRun.out +59 -0
- package/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.tla +19 -0
- package/skills/statechart/scripts/test/corpus/CounterJump/chart.mmd +26 -0
- package/skills/statechart/scripts/test/corpus/CounterJump/graph.dot +22 -0
- package/skills/statechart/scripts/test/corpus/CounterJump/report.md +12 -0
- package/skills/statechart/scripts/test/corpus/CounterJump/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.out +58 -0
- package/skills/statechart/scripts/test/corpus/CounterJump/verdict-2.out +57 -0
- package/skills/statechart/scripts/test/corpus/CounterLoop/ChartRun.out +57 -0
- package/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.cfg +2 -0
- package/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.tla +11 -0
- package/skills/statechart/scripts/test/corpus/CounterLoop/chart.mmd +17 -0
- package/skills/statechart/scripts/test/corpus/CounterLoop/graph.dot +15 -0
- package/skills/statechart/scripts/test/corpus/CounterLoop/report.md +14 -0
- package/skills/statechart/scripts/test/corpus/CounterLoop/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.out +76 -0
- package/skills/statechart/scripts/test/corpus/CounterOrder/ChartRun.out +59 -0
- package/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.tla +11 -0
- package/skills/statechart/scripts/test/corpus/CounterOrder/chart.mmd +19 -0
- package/skills/statechart/scripts/test/corpus/CounterOrder/graph.dot +10 -0
- package/skills/statechart/scripts/test/corpus/CounterOrder/report.md +15 -0
- package/skills/statechart/scripts/test/corpus/CounterOrder/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.out +56 -0
- package/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.out +67 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/ChartRun.out +62 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.cfg +6 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.tla +24 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/Moves.tla +5 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/chart.mmd +22 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/graph.dot +10 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/report.md +23 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/sany.out +3 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.out +58 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.out +66 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.out +74 -0
- package/skills/statechart/scripts/test/corpus/CounterRules/verdict-4.out +59 -0
- package/skills/statechart/scripts/test/corpus/CounterStart/ChartRun.out +58 -0
- package/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.tla +15 -0
- package/skills/statechart/scripts/test/corpus/CounterStart/chart.mmd +18 -0
- package/skills/statechart/scripts/test/corpus/CounterStart/graph.dot +13 -0
- package/skills/statechart/scripts/test/corpus/CounterStart/report.md +11 -0
- package/skills/statechart/scripts/test/corpus/CounterStart/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.out +33 -0
- package/skills/statechart/scripts/test/corpus/CounterStart/verdict-2.out +57 -0
- package/skills/statechart/scripts/test/corpus/CounterStop/ChartRun.out +57 -0
- package/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.tla +15 -0
- package/skills/statechart/scripts/test/corpus/CounterStop/chart.mmd +7 -0
- package/skills/statechart/scripts/test/corpus/CounterStop/graph.dot +13 -0
- package/skills/statechart/scripts/test/corpus/CounterStop/report.md +6 -0
- package/skills/statechart/scripts/test/corpus/CounterStop/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterStop/verdict-1.out +49 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/ChartRun.out +61 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.cfg +4 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.tla +14 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/chart.mmd +30 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/graph.dot +19 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/report.md +27 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.out +56 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.out +64 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.out +87 -0
- package/skills/statechart/scripts/test/corpus/CounterTie/verdict-4.out +57 -0
- package/skills/statechart/scripts/test/corpus/CounterTieInGraph/ChartRun.out +60 -0
- package/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.tla +12 -0
- package/skills/statechart/scripts/test/corpus/CounterTieInGraph/chart.mmd +23 -0
- package/skills/statechart/scripts/test/corpus/CounterTieInGraph/graph.dot +19 -0
- package/skills/statechart/scripts/test/corpus/CounterTieInGraph/report.md +11 -0
- package/skills/statechart/scripts/test/corpus/CounterTieInGraph/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.out +56 -0
- package/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-2.out +57 -0
- package/skills/statechart/scripts/test/corpus/CounterView/ChartRun.out +61 -0
- package/skills/statechart/scripts/test/corpus/CounterView/CounterView.cfg +4 -0
- package/skills/statechart/scripts/test/corpus/CounterView/CounterView.tla +14 -0
- package/skills/statechart/scripts/test/corpus/CounterView/chart.mmd +23 -0
- package/skills/statechart/scripts/test/corpus/CounterView/graph.dot +19 -0
- package/skills/statechart/scripts/test/corpus/CounterView/report.md +27 -0
- package/skills/statechart/scripts/test/corpus/CounterView/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/CounterView/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterView/verdict-1.out +56 -0
- package/skills/statechart/scripts/test/corpus/CounterView/verdict-2.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterView/verdict-2.out +64 -0
- package/skills/statechart/scripts/test/corpus/CounterView/verdict-3.exit +1 -0
- package/skills/statechart/scripts/test/corpus/CounterView/verdict-3.out +87 -0
- package/skills/statechart/scripts/test/corpus/CounterView/verdict-4.out +57 -0
- package/skills/statechart/scripts/test/corpus/CounterView/view.mjs +1 -0
- package/skills/statechart/scripts/test/corpus/DieHard/ChartRun.out +59 -0
- package/skills/statechart/scripts/test/corpus/DieHard/DieHard.cfg +4 -0
- package/skills/statechart/scripts/test/corpus/DieHard/DieHard.tla +38 -0
- package/skills/statechart/scripts/test/corpus/DieHard/chart.mmd +92 -0
- package/skills/statechart/scripts/test/corpus/DieHard/graph.dot +126 -0
- package/skills/statechart/scripts/test/corpus/DieHard/report.md +17 -0
- package/skills/statechart/scripts/test/corpus/DieHard/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/DieHard/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/DieHard/verdict-1.out +91 -0
- package/skills/statechart/scripts/test/corpus/DieHard/verdict-2.out +57 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/ChartRun.out +61 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.cfg +6 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.tla +11 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/chart.mmd +22 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/graph.dot +16 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/report.md +25 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.out +56 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.exit +1 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.out +64 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.exit +1 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.out +64 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.exit +1 -0
- package/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.out +77 -0
- package/skills/statechart/scripts/test/corpus/HiddenClock/ChartRun.out +57 -0
- package/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.cfg +4 -0
- package/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.tla +11 -0
- package/skills/statechart/scripts/test/corpus/HiddenClock/chart.mmd +13 -0
- package/skills/statechart/scripts/test/corpus/HiddenClock/graph.dot +12 -0
- package/skills/statechart/scripts/test/corpus/HiddenClock/report.md +11 -0
- package/skills/statechart/scripts/test/corpus/HiddenClock/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.out +72 -0
- package/skills/statechart/scripts/test/corpus/Login/ChartRun.out +57 -0
- package/skills/statechart/scripts/test/corpus/Login/Login.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/Login/Login.tla +62 -0
- package/skills/statechart/scripts/test/corpus/Login/chart.mmd +27 -0
- package/skills/statechart/scripts/test/corpus/Login/graph.dot +40 -0
- package/skills/statechart/scripts/test/corpus/Login/report.md +7 -0
- package/skills/statechart/scripts/test/corpus/Login/sany.out +1 -0
- package/skills/statechart/scripts/test/corpus/Login/verdict-1.out +47 -0
- package/skills/statechart/scripts/test/corpus/Login/view.mjs +1 -0
- package/skills/statechart/scripts/test/corpus/LoginGuarded/ChartRun.out +57 -0
- package/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.cfg +2 -0
- package/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.tla +64 -0
- package/skills/statechart/scripts/test/corpus/LoginGuarded/chart.mmd +28 -0
- package/skills/statechart/scripts/test/corpus/LoginGuarded/graph.dot +37 -0
- package/skills/statechart/scripts/test/corpus/LoginGuarded/report.md +8 -0
- package/skills/statechart/scripts/test/corpus/LoginGuarded/sany.out +1 -0
- package/skills/statechart/scripts/test/corpus/LoginGuarded/verdict-1.out +47 -0
- package/skills/statechart/scripts/test/corpus/LoginGuarded/view.mjs +1 -0
- package/skills/statechart/scripts/test/corpus/LoginParallel/ChartRun.out +60 -0
- package/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.tla +64 -0
- package/skills/statechart/scripts/test/corpus/LoginParallel/chart.mmd +44 -0
- package/skills/statechart/scripts/test/corpus/LoginParallel/graph.dot +58 -0
- package/skills/statechart/scripts/test/corpus/LoginParallel/report.md +17 -0
- package/skills/statechart/scripts/test/corpus/LoginParallel/sany.out +1 -0
- package/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.out +83 -0
- package/skills/statechart/scripts/test/corpus/LoginParallel/verdict-2.out +57 -0
- package/skills/statechart/scripts/test/corpus/LoginParallel/view.mjs +1 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayer/ChartRun.out +60 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.tla +103 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayer/chart.mmd +43 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayer/graph.dot +93 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayer/report.md +14 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayer/sany.out +1 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.out +59 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-2.out +72 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayer/view.mjs +3 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/ChartRun.out +57 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.cfg +2 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.tla +100 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/chart.mmd +31 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/graph.dot +85 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/report.md +9 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/sany.out +1 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/verdict-1.out +47 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerFixed/view.mjs +3 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/ChartRun.out +59 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayer.tla +103 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.tla +6 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/chart.mmd +42 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/graph.dot +93 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/report.md +19 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.out +61 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-2.out +59 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-3.out +61 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.exit +1 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.out +66 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.exit +1 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.out +58 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-6.out +49 -0
- package/skills/statechart/scripts/test/corpus/MediaPlayerProps/view.mjs +3 -0
- package/skills/statechart/scripts/test/corpus/PickWorker/ChartRun.out +57 -0
- package/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.cfg +6 -0
- package/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.tla +11 -0
- package/skills/statechart/scripts/test/corpus/PickWorker/chart.mmd +5 -0
- package/skills/statechart/scripts/test/corpus/PickWorker/graph.dot +11 -0
- package/skills/statechart/scripts/test/corpus/PickWorker/report.md +7 -0
- package/skills/statechart/scripts/test/corpus/PickWorker/sany.out +5 -0
- package/skills/statechart/scripts/test/corpus/PickWorker/verdict-1.out +70 -0
- package/skills/statechart/scripts/test/corpus/Shadow/ChartRun.out +61 -0
- package/skills/statechart/scripts/test/corpus/Shadow/Shadow.cfg +4 -0
- package/skills/statechart/scripts/test/corpus/Shadow/Shadow.tla +11 -0
- package/skills/statechart/scripts/test/corpus/Shadow/ShadowLib.tla +6 -0
- package/skills/statechart/scripts/test/corpus/Shadow/ShadowSub.tla +3 -0
- package/skills/statechart/scripts/test/corpus/Shadow/chart.mmd +9 -0
- package/skills/statechart/scripts/test/corpus/Shadow/graph.dot +16 -0
- package/skills/statechart/scripts/test/corpus/Shadow/report.md +8 -0
- package/skills/statechart/scripts/test/corpus/Shadow/sany.out +4 -0
- package/skills/statechart/scripts/test/corpus/Shadow/verdict-1.out +65 -0
- package/skills/statechart/scripts/test/corpus/SpacedNames/ChartRun.out +59 -0
- package/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.cfg +2 -0
- package/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.tla +9 -0
- package/skills/statechart/scripts/test/corpus/SpacedNames/chart.mmd +23 -0
- package/skills/statechart/scripts/test/corpus/SpacedNames/graph.dot +17 -0
- package/skills/statechart/scripts/test/corpus/SpacedNames/report.md +15 -0
- package/skills/statechart/scripts/test/corpus/SpacedNames/sany.out +1 -0
- package/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.out +65 -0
- package/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.exit +1 -0
- package/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.out +75 -0
- package/skills/statechart/scripts/test/corpus/TwoPhase/ChartRun.out +69 -0
- package/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.tla +75 -0
- package/skills/statechart/scripts/test/corpus/TwoPhase/chart.mmd +60 -0
- package/skills/statechart/scripts/test/corpus/TwoPhase/graph.dot +297 -0
- package/skills/statechart/scripts/test/corpus/TwoPhase/report.md +20 -0
- package/skills/statechart/scripts/test/corpus/TwoPhase/sany.out +1 -0
- package/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.out +95 -0
- package/skills/statechart/scripts/test/corpus/TwoPhase/verdict-2.out +57 -0
- package/skills/statechart/scripts/test/corpus/TwoPhase/view.mjs +1 -0
- package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/ChartRun.out +57 -0
- package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.cfg +3 -0
- package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.tla +75 -0
- package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/chart.mmd +37 -0
- package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/graph.dot +223 -0
- package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/report.md +11 -0
- package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/sany.out +1 -0
- package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/verdict-1.out +47 -0
- package/skills/statechart/scripts/test/corpus/TwoPhaseFixed/view.mjs +1 -0
- package/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.exit +1 -0
- package/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.out +75 -0
- package/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.cfg +5 -0
- package/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.tla +11 -0
- package/skills/statechart/scripts/test/corpus/TypeGuard/chart.mmd +18 -0
- package/skills/statechart/scripts/test/corpus/TypeGuard/graph.dot +14 -0
- package/skills/statechart/scripts/test/corpus/TypeGuard/report.md +29 -0
- package/skills/statechart/scripts/test/corpus/TypeGuard/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.out +64 -0
- package/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.exit +1 -0
- package/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.out +75 -0
- package/skills/statechart/scripts/test/corpus/UserNoDeadlock/ChartRun.out +58 -0
- package/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.cfg +2 -0
- package/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.tla +8 -0
- package/skills/statechart/scripts/test/corpus/UserNoDeadlock/chart.mmd +22 -0
- package/skills/statechart/scripts/test/corpus/UserNoDeadlock/graph.dot +16 -0
- package/skills/statechart/scripts/test/corpus/UserNoDeadlock/report.md +15 -0
- package/skills/statechart/scripts/test/corpus/UserNoDeadlock/sany.out +2 -0
- package/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.exit +1 -0
- package/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.out +56 -0
- package/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.exit +1 -0
- package/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.out +77 -0
- package/skills/statechart/scripts/test/corpus.test.ts +403 -0
- package/skills/statechart/scripts/test/differential.test.ts +565 -0
- package/skills/statechart/scripts/test/grid/Grid.cfg +2 -0
- package/skills/statechart/scripts/test/grid/Grid.tla +9 -0
- package/skills/statechart/scripts/test/grid/sany.out +2 -0
- package/skills/statechart/scripts/test/java.ts +63 -0
- package/skills/statechart/scripts/test/labels.ts +643 -0
- package/skills/statechart/scripts/test/messages.test.ts +212 -0
- package/skills/statechart/scripts/test/pipeline.test.ts +270 -0
- package/skills/statechart/scripts/test/plain-tlc.test.ts +255 -0
- package/skills/statechart/scripts/test/render.test.ts +81 -0
- package/skills/statechart/scripts/test/tlc-out.test.ts +90 -0
- package/skills/statechart/scripts/test/tlc.ts +158 -0
- package/skills/statechart/scripts/tsconfig.json +11 -0
- package/skills/statechart/scripts/worker.ts +35 -0
- package/skills/swarm/SKILL.md +41 -0
- package/skills/tdd/SKILL.md +42 -0
- package/skills/teach/SKILL.md +21 -0
- package/skills/technical-writing/SKILL.md +106 -0
- package/skills/thermo-nuclear-code-quality-review/SKILL.md +192 -0
- package/skills/typescript-best-practices/SKILL.md +32 -0
- package/skills/typescript-best-practices/references/patterns.md +328 -0
- package/skills/typescript-exhaustive-switch/SKILL.md +10 -0
- package/skills/unslop/SKILL.md +62 -0
- package/skills/verify-this/SKILL.md +74 -0
- package/skills/weekly-review/SKILL.md +32 -0
- package/skills/what-did-i-get-done/SKILL.md +31 -0
- package/skills/why/SKILL.md +98 -0
- package/skills/why/references/epistemics.md +71 -0
- package/skills/why/references/investigator-prompt.md +84 -0
- package/skills/why/references/source-playbook.md +17 -0
- package/skills/why/references/sources/code-archaeology.md +51 -0
- package/skills/why/references/sources/databricks.md +70 -0
- package/skills/why/references/sources/datadog.md +97 -0
- package/skills/why/references/sources/incident-postmortem.md +5 -0
- package/skills/why/references/sources/linear.md +48 -0
- package/skills/why/references/sources/notion.md +55 -0
- package/skills/why/references/sources/sentry.md +66 -0
- package/skills/why/references/sources/slack.md +17 -0
- package/skills/why/references/synthesizer-prompt.md +129 -0
- package/skills/workflow-from-chats/SKILL.md +50 -0
- package/src/aliases.ts +64 -0
- package/src/ask.ts +131 -0
- package/src/autocomplete.ts +21 -0
- package/src/child-env.ts +44 -0
- package/src/index.ts +123 -0
- package/src/loop.ts +189 -0
- package/src/mode.ts +156 -0
- package/src/modes.ts +8 -0
- package/src/paths.ts +85 -0
- package/src/pi-command.ts +12 -0
- package/src/plan.ts +141 -0
- package/src/readonly-shell.ts +107 -0
- package/src/rule.ts +56 -0
- package/src/sections.ts +118 -0
- package/src/subscriptions/cron.ts +75 -0
- package/src/subscriptions/durable-store.ts +482 -0
- package/src/subscriptions/durable-types.ts +41 -0
- package/src/subscriptions/ensure-supervisor.ts +67 -0
- package/src/subscriptions/github.ts +149 -0
- package/src/subscriptions/index.ts +507 -0
- package/src/subscriptions/supervisor-main.ts +88 -0
- package/src/subscriptions/supervisor.ts +271 -0
- package/src/subscriptions/webhook.ts +222 -0
- package/src/task/agents.ts +55 -0
- package/src/task/card.ts +61 -0
- package/src/task/format.ts +88 -0
- package/src/task/models.ts +140 -0
- package/src/task/records.ts +227 -0
- package/src/task/registry.ts +77 -0
- package/src/task/runner.ts +365 -0
- package/src/task/status.ts +170 -0
- package/src/task/stop.ts +100 -0
- package/src/task/tool.ts +488 -0
- package/src/task/worktree.ts +67 -0
- package/src/todo.ts +121 -0
- package/src/visualize.ts +244 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Synthesizer Prompt Template
|
|
2
|
+
|
|
3
|
+
Fill in the placeholders.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
You are answering a "why" question about a piece of code by synthesizing findings from investigators who searched different historical sources (source control, issue / ticket tracker, long-form documents, real-time team chat, infrastructure observability, error / exception tracking, product analytics warehouse, and code comments). Produce a confidence-weighted, evidence-cited narrative that says honestly what the evidence supports, and just as honestly what it doesn't.
|
|
8
|
+
|
|
9
|
+
## The Question
|
|
10
|
+
|
|
11
|
+
> {QUESTION}
|
|
12
|
+
|
|
13
|
+
## The Code Anchor
|
|
14
|
+
|
|
15
|
+
**Target files:** {FILES_WITH_LINE_RANGES}
|
|
16
|
+
|
|
17
|
+
**Key symbols:** {SYMBOLS}
|
|
18
|
+
|
|
19
|
+
## Investigator Findings
|
|
20
|
+
|
|
21
|
+
{ALL_INVESTIGATOR_FINDINGS}
|
|
22
|
+
|
|
23
|
+
## Sources That Weren't Searched
|
|
24
|
+
|
|
25
|
+
{SKIPPED_SOURCES_WITH_REASONS}
|
|
26
|
+
|
|
27
|
+
## Epistemics Framework
|
|
28
|
+
|
|
29
|
+
You MUST follow `references/epistemics.md`. Read it in full before writing. The key rules:
|
|
30
|
+
|
|
31
|
+
1. Every claim must sit in one tier: **Direct**, **Supported**, **Inferred**, **Speculative**, **Unknown**. The tier sets its section and its phrasing.
|
|
32
|
+
2. Every Direct/Supported claim must have a citation (PR #, ticket ID, doc URL, chat permalink, commit hash, or file:line).
|
|
33
|
+
3. Inferred and Speculative claims must use hedged language ("appears to", "likely", "suggests", "one possibility is").
|
|
34
|
+
4. Never cite code as evidence for its own intent.
|
|
35
|
+
5. Document gaps. Don't fill them with plausible-sounding guesses.
|
|
36
|
+
6. Treat a hypothesis embedded in the user's question as a candidate, not a conclusion. Check it independently.
|
|
37
|
+
|
|
38
|
+
## Instructions
|
|
39
|
+
|
|
40
|
+
1. **Read all investigator findings** and weigh the evidence yourself. Investigators gathered raw evidence, not conclusions.
|
|
41
|
+
2. **Merge overlaps.** When several investigators cite the same PR, ticket, or doc, give it one authoritative reference.
|
|
42
|
+
3. **Surface contradictions.** When two items disagree, show both. Don't pick one.
|
|
43
|
+
4. **Calibrate each claim.** Find its evidence and tier. Direct: cite it and state it plainly. Inferred: hedge it and show the inference. Speculative: mark it. No evidence: put it in the gaps.
|
|
44
|
+
5. **Verify citations by spot-checking.** If you're uncertain a cited item exists or says what the investigator claims, check it by reading the codebase or calling MCP tools. Don't propagate errors. Do not write files, commit, or modify external state.
|
|
45
|
+
6. **Don't overreach.** The user will act on this. Leave an open question open rather than fill it with a confident guess.
|
|
46
|
+
|
|
47
|
+
## Output Format
|
|
48
|
+
|
|
49
|
+
Write for the user, in this exact structure:
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### The Question
|
|
54
|
+
|
|
55
|
+
Restate the user's question in one or two sentences.
|
|
56
|
+
|
|
57
|
+
### The Code in Question
|
|
58
|
+
|
|
59
|
+
File paths, line ranges, key symbols. Two or three lines to orient a cold reader.
|
|
60
|
+
|
|
61
|
+
### What We Found
|
|
62
|
+
|
|
63
|
+
Claims with textual evidence, each quoted or paraphrased and cited precisely:
|
|
64
|
+
|
|
65
|
+
- **[Direct]** {Claim}. Source: [PR #123](url) / ticket ID / file:line. {Brief quote or paraphrase.}
|
|
66
|
+
- **[Supported]** {Claim}. Evidence: {list of items and what each contributes}.
|
|
67
|
+
|
|
68
|
+
`[Direct]` is single-source, explicit evidence. `[Supported]` is multiple indirect items converging on a conclusion.
|
|
69
|
+
|
|
70
|
+
### What We Can Reasonably Infer
|
|
71
|
+
|
|
72
|
+
Claims stated nowhere but well-supported by indirect evidence. Each bullet must make the inference chain visible ("Given A and B, it's likely that C") and must use hedged language ("appears to", "likely", "suggests", "is consistent with"):
|
|
73
|
+
|
|
74
|
+
- **[Inferred]** {Hedged claim}. Reasoning: {the specific evidence and the inference step}.
|
|
75
|
+
|
|
76
|
+
Skip this section if there's nothing to infer.
|
|
77
|
+
|
|
78
|
+
### Competing Hypotheses
|
|
79
|
+
|
|
80
|
+
If the evidence fits multiple stories, present each. Don't force a winner the record doesn't support. For each hypothesis:
|
|
81
|
+
|
|
82
|
+
- **Hypothesis:** {one-sentence statement}
|
|
83
|
+
- **Evidence for:** {specific items}
|
|
84
|
+
- **Evidence against or missing:** {what would need to be true but isn't, or what counter-signals exist}
|
|
85
|
+
|
|
86
|
+
Skip this section if there's a single clear answer.
|
|
87
|
+
|
|
88
|
+
### What We Don't Know
|
|
89
|
+
|
|
90
|
+
Specific gaps: "We searched the issue tracker for [query1], [query2], [query3] and found no issue discussing the rate-limit threshold", not "We don't know why." Include:
|
|
91
|
+
|
|
92
|
+
- Questions that went unanswered
|
|
93
|
+
- Searches that returned nothing
|
|
94
|
+
- Sources that were unavailable, and why (such as a missing real-time team chat MCP)
|
|
95
|
+
- People who would likely know but whom you can't ask
|
|
96
|
+
|
|
97
|
+
### Sources Consulted
|
|
98
|
+
|
|
99
|
+
What was actually searched, so the user can judge coverage and redirect:
|
|
100
|
+
|
|
101
|
+
- **Source control history**: {file paths}, {number of commits reviewed}, PRs #{numbers}, and code comments searched. Or "Not searched. This should not happen because git and `gh` are always expected."
|
|
102
|
+
- **Issue / ticket tracker**: {ticket IDs and keyword searches}. Or "Not searched. No matching MCP available in this environment."
|
|
103
|
+
- **Long-form documents**: {page titles and search queries}. Or "Not searched. No matching MCP available in this environment."
|
|
104
|
+
- **Real-time team chat**: {channels searched, date ranges, queries}. Or "Not searched. No matching MCP available in this environment."
|
|
105
|
+
- **Infrastructure observability**: {dashboards, monitors, metrics, logs, traces, or incidents searched}. Or "Not searched. No matching MCP available in this environment."
|
|
106
|
+
- **Error / exception tracking**: {issues, events, or releases searched}. Or "Not searched. No matching MCP available in this environment."
|
|
107
|
+
- **Product analytics warehouse**: {fully-qualified tables queried, the time windows, and the numeric summaries (counts, percentiles, first/last-seen timestamps) that bore on the question}. Or "Not searched. No matching MCP available in this environment."
|
|
108
|
+
|
|
109
|
+
### Confidence Summary
|
|
110
|
+
|
|
111
|
+
One or two sentences on overall confidence, e.g.:
|
|
112
|
+
|
|
113
|
+
> "The core rationale (A) is well-supported by direct PR and ticket evidence. The specific threshold value (100) is inferred from the surrounding context but not explicitly documented. The question of whether this was driven by a customer request could not be answered. No relevant issue tracker or long-form doc content surfaced, and real-time team chat search was unavailable."
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Quality Check Before Returning
|
|
118
|
+
|
|
119
|
+
Revise if any item fails:
|
|
120
|
+
|
|
121
|
+
1. Does every claim in "What We Found" have a citation? If not, add one or move it to "Inferred" or "Hypotheses."
|
|
122
|
+
2. Is the phrasing tier-appropriate? (Direct claims can use "because". Inferred claims cannot.)
|
|
123
|
+
3. Did you surface every contradiction you noticed, or quietly pick one?
|
|
124
|
+
4. Does "What We Don't Know" name specific gaps? If it's empty or missing, be suspicious. Historical investigations almost always have gaps.
|
|
125
|
+
5. Did you check any hypothesis embedded in the question against the evidence rather than rubber-stamp it?
|
|
126
|
+
6. Did you cite code as evidence for its own intent? Remove it. Code is mechanics, not motivation.
|
|
127
|
+
7. Is the tone calibrated? A confident-sounding answer on weak evidence is the exact failure this skill exists to prevent.
|
|
128
|
+
|
|
129
|
+
The value of this output is its honesty, not its authority. A reader who takes it to the original author, an engineering lead, or a product manager should know what's known, what's inferred, and what's missing, so they can ask the right follow-up questions. Optimize for being useful, not for looking decisive.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflow-from-chats
|
|
3
|
+
description: Extract durable working preferences from recent Pi chats and convert them into skills, rules, or workflow docs. Use when asked to learn preferences, mine feedback, personalize workflows, or generate team/person-specific agent guidance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Workflow From Chats
|
|
7
|
+
|
|
8
|
+
Infer durable working preferences from recent chats. Do not summarize chats; extract reusable workflow guidance.
|
|
9
|
+
|
|
10
|
+
## Scope
|
|
11
|
+
|
|
12
|
+
- Default to the last 7 days unless the user asks for a different window.
|
|
13
|
+
- Read parent transcripts and relevant subagent transcripts. Use subagent content as evidence, but cite only parent conversations.
|
|
14
|
+
- Do not expose local transcript paths, secrets, customer data, private chat content, or credentials.
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
1. State the target workflow or preference surface in one paragraph.
|
|
19
|
+
2. Build an internal transcript inventory: title/topic, parent conversation ID, approximate date, completion state, relevant subagents, and why it may contain preference evidence.
|
|
20
|
+
3. Scan for explicit preferences, corrections, and workflow markers such as "I prefer", "always", "never", "not what I asked", "stop", "review", "PR", "CI", "logs", and "skill".
|
|
21
|
+
4. Extract preference atoms: trigger, workflow step, decision rule, quality bar, stop condition, evidence, and confidence.
|
|
22
|
+
5. Rate confidence as strong, medium, weak, or contradicted.
|
|
23
|
+
6. Cluster by workflow shape rather than transcript: shipping, review, simplification, debugging, capture, communication, delegation, or validation.
|
|
24
|
+
7. Choose the artifact: new skill, skill edit, rule, workflow doc, or no artifact.
|
|
25
|
+
8. Draft only the reusable guidance. Filter anecdotes that will not help future tasks.
|
|
26
|
+
|
|
27
|
+
## Confidence
|
|
28
|
+
|
|
29
|
+
- Strong: explicit user preference, workflow-changing correction, repeated parent-chat pattern, or direct request to encode behavior.
|
|
30
|
+
- Medium: accepted workflow, repeated tool/model/validation preference, or subagent consensus that the parent used successfully.
|
|
31
|
+
- Weak: agent-chosen behavior with no user feedback, one ambiguous transcript, or a likely task-specific correction.
|
|
32
|
+
- Contradicted: evidence points in incompatible directions; ask the user before writing files.
|
|
33
|
+
|
|
34
|
+
## Artifact Choice
|
|
35
|
+
|
|
36
|
+
- Skill: recurring multi-step workflow with clear triggers.
|
|
37
|
+
- Rule: general behavior that should apply broadly.
|
|
38
|
+
- Workflow doc: useful context that is not reliably triggerable.
|
|
39
|
+
- No artifact: situational, stale, or low-confidence observation.
|
|
40
|
+
|
|
41
|
+
## Output
|
|
42
|
+
|
|
43
|
+
Return a concise synthesis first:
|
|
44
|
+
|
|
45
|
+
- Target workflow.
|
|
46
|
+
- Evidence corpus with parent conversation citations only.
|
|
47
|
+
- Preference profile.
|
|
48
|
+
- Adopt, consider, dismissed.
|
|
49
|
+
- Proposed artifacts.
|
|
50
|
+
- Open questions only if they block writing.
|
package/src/aliases.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { existsSync, realpathSync } from 'node:fs';
|
|
2
|
+
import { sep } from 'node:path';
|
|
3
|
+
|
|
4
|
+
import type { ImageContent } from '@earendil-works/pi-ai';
|
|
5
|
+
import type { SlashCommandInfo } from '@earendil-works/pi-coding-agent';
|
|
6
|
+
import { SKILLS_DIR } from './paths.ts';
|
|
7
|
+
|
|
8
|
+
const ALIAS = /^\/([a-z0-9]+(?:-[a-z0-9]+)*)(?=\s|$)/;
|
|
9
|
+
const SKILL_PREFIX = 'skill:';
|
|
10
|
+
|
|
11
|
+
const isSkill = (command: SlashCommandInfo) => command.source === 'skill' && command.name.startsWith(SKILL_PREFIX);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* `/name` aliases with their descriptions: every skill Pi loaded, so any skill attaches by name
|
|
15
|
+
* (pstack itself creates skills such as `/<handle>-mode`), minus any name a prompt template or extension command owns.
|
|
16
|
+
* Settings that filter a skill out also drop its alias. Pi handles its built-in commands before the input event.
|
|
17
|
+
*/
|
|
18
|
+
export function aliasTable(commands: readonly SlashCommandInfo[]): ReadonlyMap<string, string> {
|
|
19
|
+
const taken = new Set(commands.filter((command) => command.source !== 'skill').map((command) => command.name));
|
|
20
|
+
const table = new Map<string, string>();
|
|
21
|
+
for (const command of commands.filter(isSkill)) {
|
|
22
|
+
const name = command.name.slice(SKILL_PREFIX.length);
|
|
23
|
+
if (!taken.has(name)) table.set(name, command.description ?? '');
|
|
24
|
+
}
|
|
25
|
+
return table;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Pi records a skill path as configured, which can run through a symlink; realpaths are cached per runtime.
|
|
29
|
+
const realPaths = new Map<string, string | undefined>();
|
|
30
|
+
function realPath(path: string): string | undefined {
|
|
31
|
+
if (!realPaths.has(path)) realPaths.set(path, existsSync(path) ? realpathSync(path) : undefined);
|
|
32
|
+
return realPaths.get(path);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Names of the loaded skills that live in this package, sorted; the host map's skill list. */
|
|
36
|
+
export function packageSkillNames(commands: readonly SlashCommandInfo[], skillsDir: string = SKILLS_DIR): string[] {
|
|
37
|
+
const root = `${realPath(skillsDir) ?? skillsDir}${sep}`;
|
|
38
|
+
return commands
|
|
39
|
+
.filter((command) => isSkill(command) && realPath(command.sourceInfo.path)?.startsWith(root) === true)
|
|
40
|
+
.map((command) => command.name.slice(SKILL_PREFIX.length))
|
|
41
|
+
.toSorted();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Rewrites `/name args` to Pi's native `/skill:name args` for an aliased skill, keeping the argument text.
|
|
46
|
+
* Pi splits the skill name at the first space and trims the arguments, so a space always follows the name.
|
|
47
|
+
*/
|
|
48
|
+
export function aliasTransform(text: string, names: ReadonlySet<string>): string | undefined {
|
|
49
|
+
const match = ALIAS.exec(text);
|
|
50
|
+
const name = match?.[1];
|
|
51
|
+
if (match === null || name === undefined || !names.has(name)) return undefined;
|
|
52
|
+
const rest = text.slice(match[0].length);
|
|
53
|
+
if (rest.length === 0) return `/skill:${name}`;
|
|
54
|
+
return `/skill:${name} ${rest.startsWith(' ') ? rest.slice(1) : rest}`;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type AliasInputResult = { action: 'continue' } | { action: 'transform'; text: string; images?: ImageContent[] };
|
|
58
|
+
|
|
59
|
+
/** The `input` handler result: Pi's native skill command for an aliased skill, otherwise continue unchanged. */
|
|
60
|
+
export function aliasInputResult(event: { text: string; images?: ImageContent[] }, names: ReadonlySet<string>): AliasInputResult {
|
|
61
|
+
const text = aliasTransform(event.text, names);
|
|
62
|
+
if (text === undefined) return { action: 'continue' };
|
|
63
|
+
return { action: 'transform', text, ...(event.images === undefined ? {} : { images: event.images }) };
|
|
64
|
+
}
|
package/src/ask.ts
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
import { type Static, Type } from 'typebox';
|
|
3
|
+
import { canAsk } from './modes.ts';
|
|
4
|
+
|
|
5
|
+
export const DONE_LABEL = '✓ Done selecting';
|
|
6
|
+
// Every question ends with a typed-answer option.
|
|
7
|
+
export const OTHER_LABEL = 'Other: (type to answer)';
|
|
8
|
+
export const OTHER_ID = 'other';
|
|
9
|
+
const SKIPPED = 'skipped (no one can answer questions in this session; decide yourself and say what you chose)';
|
|
10
|
+
|
|
11
|
+
export const AskParams = Type.Object({
|
|
12
|
+
title: Type.Optional(Type.String({ description: 'Short heading shown above the questions' })),
|
|
13
|
+
questions: Type.Array(
|
|
14
|
+
Type.Object({
|
|
15
|
+
id: Type.String({ description: 'Stable identifier for the question' }),
|
|
16
|
+
prompt: Type.String({ description: 'The question shown to the user' }),
|
|
17
|
+
options: Type.Array(Type.Object({ id: Type.String(), label: Type.String(), description: Type.Optional(Type.String({ description: 'Detail shown after the label' })) }), {
|
|
18
|
+
description: 'Choices the user picks from',
|
|
19
|
+
}),
|
|
20
|
+
allow_multiple: Type.Optional(Type.Boolean({ description: 'Let the user pick several options' })),
|
|
21
|
+
}),
|
|
22
|
+
{ description: 'Questions asked one after another' },
|
|
23
|
+
),
|
|
24
|
+
});
|
|
25
|
+
export type Question = Static<typeof AskParams>['questions'][number];
|
|
26
|
+
type Option = Question['options'][number];
|
|
27
|
+
|
|
28
|
+
/** What the user sees for an option: its label, then its description when it has one. */
|
|
29
|
+
const shown = (option: Option): string => (option.description === undefined || option.description === '' ? option.label : `${option.label} — ${option.description}`);
|
|
30
|
+
|
|
31
|
+
function duplicate(values: readonly string[]): string | undefined {
|
|
32
|
+
return values.find((value, index) => values.indexOf(value) !== index);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Answers map back to options by their shown text, so that text and ids must be unique, and the sentinels are reserved. */
|
|
36
|
+
export function validateQuestions(questions: readonly Question[]): void {
|
|
37
|
+
const repeatedId = duplicate(questions.map((question) => question.id));
|
|
38
|
+
if (repeatedId !== undefined) throw new Error(`Question id "${repeatedId}" appears more than once.`);
|
|
39
|
+
for (const question of questions) {
|
|
40
|
+
if (question.options.length === 0) throw new Error(`Question "${question.id}" has no options.`);
|
|
41
|
+
const label = duplicate(question.options.map(shown));
|
|
42
|
+
if (label !== undefined) throw new Error(`Question "${question.id}" has two options labelled "${label}".`);
|
|
43
|
+
const id = duplicate(question.options.map((option) => option.id));
|
|
44
|
+
if (id !== undefined) throw new Error(`Question "${question.id}" has two options with id "${id}".`);
|
|
45
|
+
if (question.allow_multiple === true && question.options.some((option) => shown(option) === DONE_LABEL)) throw new Error(`Option label "${DONE_LABEL}" is reserved for ending a multi-select question.`);
|
|
46
|
+
if (question.options.some((option) => shown(option) === OTHER_LABEL || option.id === OTHER_ID)) throw new Error(`Option label "${OTHER_LABEL}" and id "${OTHER_ID}" are reserved for the typed answer.`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface Answer {
|
|
51
|
+
ids: string[];
|
|
52
|
+
other?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** The typed answer behind Other; an empty or dismissed input is no answer. */
|
|
56
|
+
async function typedAnswer(prompt: string, ctx: ExtensionContext): Promise<string | undefined> {
|
|
57
|
+
const text = (await ctx.ui.input(prompt))?.trim();
|
|
58
|
+
return text === undefined || text === '' ? undefined : text;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
async function askOne(question: Question, ctx: ExtensionContext, title: string | undefined): Promise<Answer | undefined> {
|
|
62
|
+
const labelToId = new Map(question.options.map((option) => [shown(option), option.id]));
|
|
63
|
+
const prompt = title === undefined || title === '' ? question.prompt : `${title}: ${question.prompt}`;
|
|
64
|
+
if (question.allow_multiple !== true) {
|
|
65
|
+
const label = await ctx.ui.select(prompt, [...question.options.map(shown), OTHER_LABEL]);
|
|
66
|
+
if (label === OTHER_LABEL) {
|
|
67
|
+
const other = await typedAnswer(prompt, ctx);
|
|
68
|
+
return other === undefined ? undefined : { ids: [OTHER_ID], other };
|
|
69
|
+
}
|
|
70
|
+
const id = label === undefined ? undefined : labelToId.get(label);
|
|
71
|
+
return id === undefined ? undefined : { ids: [id] };
|
|
72
|
+
}
|
|
73
|
+
const picked: string[] = [];
|
|
74
|
+
let other: string | undefined;
|
|
75
|
+
const result = (): Answer => (other === undefined ? { ids: picked } : { ids: [...picked, OTHER_ID], other });
|
|
76
|
+
for (;;) {
|
|
77
|
+
const remaining = [...question.options.filter((option) => !picked.includes(option.id)).map(shown), ...(other === undefined ? [OTHER_LABEL] : [])];
|
|
78
|
+
const heading =
|
|
79
|
+
picked.length === 0 && other === undefined
|
|
80
|
+
? `${prompt} (pick one at a time, then ${DONE_LABEL})`
|
|
81
|
+
: `${prompt} (picked: ${[...picked.map((id) => question.options.find((option) => option.id === id)?.label), ...(other === undefined ? [] : [`"${other}"`])].join(', ')})`;
|
|
82
|
+
const label = await ctx.ui.select(heading, [...remaining, DONE_LABEL]);
|
|
83
|
+
if (label === undefined) return picked.length === 0 && other === undefined ? undefined : result();
|
|
84
|
+
if (label === OTHER_LABEL) {
|
|
85
|
+
other = await typedAnswer(prompt, ctx);
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const id = labelToId.get(label);
|
|
89
|
+
if (label === DONE_LABEL || id === undefined) return result();
|
|
90
|
+
picked.push(id);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function answerLine(question: Question, answer: Answer | undefined): string {
|
|
95
|
+
if (answer === undefined) return `${question.id}: no answer (the user dismissed the question)`;
|
|
96
|
+
const parts = answer.ids.map((id) => (id === OTHER_ID ? `other ("${answer.other}")` : `${id} (${question.options.find((option) => option.id === id)?.label ?? id})`));
|
|
97
|
+
return `${question.id}: ${parts.length === 0 ? 'none selected' : parts.join(', ')}`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Structured questions (pstack: "Prefer AskQuestion over free text"), over Pi's select dialog. */
|
|
101
|
+
export function registerAskQuestion(pi: ExtensionAPI): void {
|
|
102
|
+
pi.registerTool({
|
|
103
|
+
name: 'AskQuestion',
|
|
104
|
+
label: 'Ask question',
|
|
105
|
+
description:
|
|
106
|
+
'Ask the user one or more structured multiple-choice questions and wait for the answers. Each answer comes back as option IDs, or as other with the text the user typed. Use it for a genuine product or preference choice, not for a fact you can check yourself.',
|
|
107
|
+
promptSnippet: 'Structured multiple-choice questions for the user',
|
|
108
|
+
parameters: AskParams,
|
|
109
|
+
exposure: 'model-only',
|
|
110
|
+
executionMode: 'sequential',
|
|
111
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
112
|
+
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
113
|
+
validateQuestions(params.questions);
|
|
114
|
+
// Print and JSON runs and subagents have no one to answer, so the questions come back skipped.
|
|
115
|
+
if (!canAsk(ctx)) {
|
|
116
|
+
const text = params.questions.map((question) => `${question.id}: ${SKIPPED}`).join('\n');
|
|
117
|
+
return { content: [{ type: 'text', text }], details: { answers: {}, skipped: params.questions.map((question) => question.id) } };
|
|
118
|
+
}
|
|
119
|
+
const answers: Record<string, string[]> = {};
|
|
120
|
+
const other: Record<string, string> = {};
|
|
121
|
+
const lines: string[] = [];
|
|
122
|
+
for (const question of params.questions) {
|
|
123
|
+
const answer = await askOne(question, ctx, params.title);
|
|
124
|
+
if (answer !== undefined) answers[question.id] = answer.ids;
|
|
125
|
+
if (answer?.other !== undefined) other[question.id] = answer.other;
|
|
126
|
+
lines.push(answerLine(question, answer));
|
|
127
|
+
}
|
|
128
|
+
return { content: [{ type: 'text', text: lines.join('\n') }], details: Object.keys(other).length === 0 ? { answers } : { answers, other } };
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AutocompleteItem, AutocompleteProvider, AutocompleteSuggestions } from '@earendil-works/pi-tui';
|
|
2
|
+
|
|
3
|
+
const COMMAND_TOKEN = /^\/([a-z0-9-]*)$/;
|
|
4
|
+
|
|
5
|
+
/** Adds the `/name` skill aliases to Pi's `/` menu; everything else is Pi's. */
|
|
6
|
+
export function aliasAutocomplete(current: AutocompleteProvider, aliases: ReadonlyMap<string, string>): AutocompleteProvider {
|
|
7
|
+
return {
|
|
8
|
+
...(current.triggerCharacters === undefined ? {} : { triggerCharacters: current.triggerCharacters }),
|
|
9
|
+
async getSuggestions(lines, cursorLine, cursorCol, options): Promise<AutocompleteSuggestions | null> {
|
|
10
|
+
const base = await current.getSuggestions(lines, cursorLine, cursorCol, options);
|
|
11
|
+
const token = cursorLine === 0 ? COMMAND_TOKEN.exec((lines[0] ?? '').slice(0, cursorCol))?.[1] : undefined;
|
|
12
|
+
if (token === undefined) return base;
|
|
13
|
+
const mine: AutocompleteItem[] = [...aliases].filter(([name]) => name.startsWith(token)).map(([name, description]) => ({ value: name, label: name, description }));
|
|
14
|
+
if (mine.length === 0) return base;
|
|
15
|
+
const taken = new Set(mine.map((item) => item.value));
|
|
16
|
+
return { prefix: `/${token}`, items: [...mine, ...(base?.items ?? []).filter((item) => !taken.has(item.value))] };
|
|
17
|
+
},
|
|
18
|
+
applyCompletion: (lines, cursorLine, cursorCol, item, prefix) => current.applyCompletion(lines, cursorLine, cursorCol, item, prefix),
|
|
19
|
+
...(current.shouldTriggerFileCompletion === undefined ? {} : { shouldTriggerFileCompletion: (lines: string[], cursorLine: number, cursorCol: number) => current.shouldTriggerFileCompletion?.(lines, cursorLine, cursorCol) ?? true }),
|
|
20
|
+
};
|
|
21
|
+
}
|
package/src/child-env.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// A subagent learns its depth, its agent type, whether it is readonly, its parent's pid, and the main chat's store and workspace state from these variables. They are read once and
|
|
2
|
+
// removed, so commands the subagent runs (including a nested `pi` driven through bash) do not inherit them.
|
|
3
|
+
export const DEPTH_ENV = 'PI_PSTACK_DEPTH';
|
|
4
|
+
export const AGENT_ENV = 'PI_PSTACK_AGENT';
|
|
5
|
+
export const PARENT_ENV = 'PI_PSTACK_PARENT_PID';
|
|
6
|
+
export const READONLY_ENV = 'PI_PSTACK_READONLY';
|
|
7
|
+
export const ROOT_STORE_ENV = 'PI_PSTACK_ROOT_STORE';
|
|
8
|
+
export const WORKSPACE_ENV = 'PI_PSTACK_WORKSPACE_STATE';
|
|
9
|
+
|
|
10
|
+
export interface ChildIdentity {
|
|
11
|
+
depth: number;
|
|
12
|
+
agentType: string | undefined;
|
|
13
|
+
parentPid: number | undefined;
|
|
14
|
+
readonly: boolean;
|
|
15
|
+
rootStore: string | undefined;
|
|
16
|
+
/** The main chat's workspace state folder, which every agent in the tree shares, an isolated worker included. */
|
|
17
|
+
workspaceState: string | undefined;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function read(): ChildIdentity {
|
|
21
|
+
const depth = Number(process.env[DEPTH_ENV] ?? '0');
|
|
22
|
+
const parentPid = Number(process.env[PARENT_ENV] ?? '');
|
|
23
|
+
return {
|
|
24
|
+
depth: Number.isInteger(depth) && depth > 0 ? depth : 0,
|
|
25
|
+
agentType: process.env[AGENT_ENV],
|
|
26
|
+
parentPid: Number.isInteger(parentPid) && parentPid > 1 ? parentPid : undefined,
|
|
27
|
+
readonly: process.env[READONLY_ENV] === '1',
|
|
28
|
+
rootStore: process.env[ROOT_STORE_ENV] || undefined,
|
|
29
|
+
workspaceState: process.env[WORKSPACE_ENV] || undefined,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const childIdentity: ChildIdentity = read();
|
|
34
|
+
delete process.env[DEPTH_ENV];
|
|
35
|
+
delete process.env[AGENT_ENV];
|
|
36
|
+
delete process.env[PARENT_ENV];
|
|
37
|
+
delete process.env[READONLY_ENV];
|
|
38
|
+
delete process.env[ROOT_STORE_ENV];
|
|
39
|
+
delete process.env[WORKSPACE_ENV];
|
|
40
|
+
|
|
41
|
+
/** Variables for a child of this process at `depth` (an agent keeps the depth it was created at). */
|
|
42
|
+
export function childVariables(agentType: string, depth: number, readonly: boolean, rootStore: string, workspaceState: string): Record<string, string> {
|
|
43
|
+
return { [DEPTH_ENV]: String(depth), [AGENT_ENV]: agentType, [PARENT_ENV]: String(process.pid), [ROOT_STORE_ENV]: rootStore, [WORKSPACE_ENV]: workspaceState, ...(readonly ? { [READONLY_ENV]: '1' } : {}) };
|
|
44
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import type { ExtensionAPI, ExtensionContext } from '@earendil-works/pi-coding-agent';
|
|
2
|
+
import { getAgentDir } from '@earendil-works/pi-coding-agent';
|
|
3
|
+
import { aliasInputResult, aliasTable, packageSkillNames } from './aliases.ts';
|
|
4
|
+
import { registerAskQuestion } from './ask.ts';
|
|
5
|
+
import { aliasAutocomplete } from './autocomplete.ts';
|
|
6
|
+
import { childIdentity } from './child-env.ts';
|
|
7
|
+
import { registerLoop } from './loop.ts';
|
|
8
|
+
import { registerMode } from './mode.ts';
|
|
9
|
+
import { canAsk, isOneShot } from './modes.ts';
|
|
10
|
+
import { artifactsDir, PACKAGE_ROOT, projectsDir, rootStoreDir, rulePath, SKILLS_DIR, storeDir, subagentDir } from './paths.ts';
|
|
11
|
+
import { registerPlanMode } from './plan.ts';
|
|
12
|
+
import { registerReadonlyShell } from './readonly-shell.ts';
|
|
13
|
+
import { migrateLegacyRule, modelsSection, readRule } from './rule.ts';
|
|
14
|
+
import { hostSection, subagentsSection } from './sections.ts';
|
|
15
|
+
import { registerSubscriptions } from './subscriptions/index.ts';
|
|
16
|
+
import { type AgentDefinition, loadAgentDefinitions } from './task/agents.ts';
|
|
17
|
+
import { registerAgentStatus } from './task/status.ts';
|
|
18
|
+
import { availableModels, parentModel, registerTask } from './task/tool.ts';
|
|
19
|
+
import { registerTodoWrite } from './todo.ts';
|
|
20
|
+
import { registerVisualize } from './visualize.ts';
|
|
21
|
+
|
|
22
|
+
const WATCHDOG_MS = 1_000;
|
|
23
|
+
const ORPHAN_EXIT_MS = 5_000;
|
|
24
|
+
|
|
25
|
+
/** In a subagent, the agent definition body joins the system prompt as the agent's own instructions. */
|
|
26
|
+
function agentSection(agents: readonly AgentDefinition[]): Record<string, string> {
|
|
27
|
+
const prompt = agents.find((agent) => agent.type === childIdentity.agentType)?.prompt ?? '';
|
|
28
|
+
return prompt === '' ? {} : { pstack_agent: prompt };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function hostSections(pi: ExtensionAPI, ctx: ExtensionContext, agents: readonly AgentDefinition[]): Record<string, string> {
|
|
32
|
+
const activeTools = pi.getActiveTools();
|
|
33
|
+
return {
|
|
34
|
+
pstack_host: hostSection({
|
|
35
|
+
packageRoot: PACKAGE_ROOT,
|
|
36
|
+
skillsDir: SKILLS_DIR,
|
|
37
|
+
skillNames: packageSkillNames(pi.getCommands()),
|
|
38
|
+
agentDir: getAgentDir(),
|
|
39
|
+
rulePath: rulePath(),
|
|
40
|
+
sessionDir: ctx.sessionManager.getSessionDir(),
|
|
41
|
+
sessionFile: ctx.sessionManager.getSessionFile(),
|
|
42
|
+
subagentDir: subagentDir(ctx.cwd),
|
|
43
|
+
storeDir: storeDir(ctx.cwd, ctx.sessionManager.getSessionId()),
|
|
44
|
+
rootStoreDir: rootStoreDir(ctx.cwd, ctx.sessionManager.getSessionId(), childIdentity.rootStore),
|
|
45
|
+
projectsDir: projectsDir(ctx.cwd),
|
|
46
|
+
artifactsDir: artifactsDir(ctx.cwd, ctx.sessionManager.getSessionId()),
|
|
47
|
+
loopAvailable: !isOneShot(ctx.mode),
|
|
48
|
+
questionsAvailable: canAsk(ctx),
|
|
49
|
+
activeTools,
|
|
50
|
+
}),
|
|
51
|
+
...(activeTools.includes('Task') ? { pstack_subagents: subagentsSection(agents, availableModels(ctx), parentModel(ctx)) } : {}),
|
|
52
|
+
pstack_models: modelsSection(readRule(rulePath()), rulePath()),
|
|
53
|
+
...agentSection(agents),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function alive(pid: number): boolean {
|
|
58
|
+
try {
|
|
59
|
+
process.kill(pid, 0);
|
|
60
|
+
return true;
|
|
61
|
+
} catch (error) {
|
|
62
|
+
return (error as NodeJS.ErrnoException).code === 'EPERM';
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A subagent runs in its own process group so abort and shutdown can stop everything it started, which also means
|
|
68
|
+
* it outlives a parent that crashes or is killed. The subagent therefore exits once its parent is gone. Normally the
|
|
69
|
+
* parent Pi is the direct parent, and a live `process.ppid` change (the OS reparents an orphan) cannot be fooled by a
|
|
70
|
+
* reused pid. When a launcher that does not exec sits in between, the parent pid is checked as well.
|
|
71
|
+
*/
|
|
72
|
+
function watchParent(pi: ExtensionAPI, parentPid: number): void {
|
|
73
|
+
let timer: ReturnType<typeof setInterval> | undefined;
|
|
74
|
+
const initialParent = process.ppid;
|
|
75
|
+
const parentGone = () => process.ppid !== initialParent || (initialParent !== parentPid && !alive(parentPid));
|
|
76
|
+
pi.on('session_start', (_event, ctx) => {
|
|
77
|
+
timer = setInterval(() => {
|
|
78
|
+
if (!parentGone()) return;
|
|
79
|
+
clearInterval(timer);
|
|
80
|
+
ctx.abort();
|
|
81
|
+
ctx.shutdown();
|
|
82
|
+
setTimeout(() => process.exit(0), ORPHAN_EXIT_MS).unref();
|
|
83
|
+
}, WATCHDOG_MS);
|
|
84
|
+
timer.unref();
|
|
85
|
+
});
|
|
86
|
+
pi.on('session_shutdown', () => clearInterval(timer));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export default function piPstack(pi: ExtensionAPI): void {
|
|
90
|
+
const agents = loadAgentDefinitions();
|
|
91
|
+
|
|
92
|
+
pi.on('input', (event) => aliasInputResult(event, new Set(aliasTable(pi.getCommands()).keys())));
|
|
93
|
+
pi.on('session_start', (_event, ctx) => {
|
|
94
|
+
if (ctx.mode === 'tui') ctx.ui.addAutocompleteProvider((current) => aliasAutocomplete(current, aliasTable(pi.getCommands())));
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const mode = registerMode(pi);
|
|
98
|
+
const plan = registerPlanMode(pi);
|
|
99
|
+
registerVisualize(pi, { artifactsDir: (ctx) => artifactsDir(ctx.cwd, ctx.sessionManager.getSessionId()) });
|
|
100
|
+
const task = registerTask(pi, { agents, depth: childIdentity.depth, planMode: plan.enabled });
|
|
101
|
+
registerAgentStatus(pi);
|
|
102
|
+
registerSubscriptions(pi, { runFresh: async (prompt, name) => void (await task.startBackground(`timer ${name}`, prompt)) });
|
|
103
|
+
const loop = registerLoop(pi, { hasPendingWork: task.hasBackgroundWork });
|
|
104
|
+
registerTodoWrite(pi);
|
|
105
|
+
registerAskQuestion(pi);
|
|
106
|
+
if (childIdentity.parentPid !== undefined) watchParent(pi, childIdentity.parentPid);
|
|
107
|
+
if (childIdentity.readonly) registerReadonlyShell(pi);
|
|
108
|
+
|
|
109
|
+
pi.on('before_agent_start', (event, ctx) => {
|
|
110
|
+
const modeText = mode.section();
|
|
111
|
+
const loopText = loop.section();
|
|
112
|
+
const planText = plan.section();
|
|
113
|
+
Object.assign(
|
|
114
|
+
event.systemPromptOptions.sections,
|
|
115
|
+
hostSections(pi, ctx, agents),
|
|
116
|
+
modeText === undefined ? {} : { pstack_mode: modeText },
|
|
117
|
+
loopText === undefined ? {} : { pstack_loop: loopText },
|
|
118
|
+
planText === undefined ? {} : { pstack_plan: planText },
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
pi.on('session_start', () => migrateLegacyRule(rulePath()));
|
|
123
|
+
}
|