wtf-p 0.8.4 → 0.9.1
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/README.md +31 -27
- package/bin/commands/install-logic.js +5 -5
- package/bin/install.js +11 -11
- package/bin/lib/adapter-compiler.js +275 -225
- package/bin/lib/manifest.js +21 -21
- package/bin/lib/native-registration.js +25 -10
- package/bin/lib/{clio-registration.js → pancode-registration.js} +62 -63
- package/bin/lib/utils.js +3 -3
- package/bin/uninstall.js +8 -8
- package/package.json +5 -4
- package/{vendors/clio-extension → pancode/extension}/.wtfp-generated.json +15 -11
- package/{vendors/clio-extension → pancode/extension}/compatibility/action-availability.json +14 -14
- package/{vendors/clio-extension/clio-coder-extension.yaml → pancode/extension/pancode-extension.yaml} +6 -5
- package/{vendors/clio-extension → pancode/extension}/runtime/claim-coverage.cjs +1 -1
- package/{vendors/clio-extension → pancode/extension}/runtime/desk-trust.cjs +1 -1
- package/{vendors/clio-extension → pancode/extension}/runtime/extension.test.ts +184 -97
- package/{vendors/clio-extension → pancode/extension}/runtime/extension.ts +169 -83
- package/pancode/extension/runtime/help.json +82 -0
- package/{vendors/clio-extension → pancode/extension}/runtime/write-guard.json +1 -1
- package/{vendors → pancode}/plugin/.wtfp-generated.json +114 -114
- package/{vendors → pancode}/plugin/compatibility/action-availability.json +16 -16
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-argument-verifier.md +7 -3
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-citation-expert.md +6 -2
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-citation-formatter.md +6 -2
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-coherence-checker.md +7 -3
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-outliner.md +6 -2
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-plan-checker.md +7 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-prose-polisher.md +6 -2
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-research-synthesizer.md +6 -2
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-section-planner.md +6 -2
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-section-reviewer.md +7 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/agents/wtfp-section-writer.md +7 -3
- package/{vendors/claude/ai.iowarp.clio/fleets → pancode/plugin/dev.pancode/playbooks}/wtfp-draft-review.md +1 -1
- package/{vendors/claude/ai.iowarp.clio/fleets → pancode/plugin/dev.pancode/playbooks}/wtfp-plan-section.md +2 -0
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/add-todo.md +1 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/advance.md +8 -8
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/analyze-bib.md +5 -5
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/audit-milestone.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/check-refs.md +5 -5
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/check-todos.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/checkpoint.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/contribute.md +4 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/create-outline.md +6 -6
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/create-poster.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/create-slides.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/discuss-section.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/execute-outline.md +6 -6
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/export-latex.md +3 -3
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/help.md +7 -7
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/insert-section.md +4 -4
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/list-assumptions.md +1 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/map-project.md +1 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/new-paper.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/pause-writing.md +2 -2
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/plan-milestone-gaps.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/plan-revision.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/plan-section.md +6 -6
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/polish-prose.md +5 -5
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/progress.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/quick.md +5 -5
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/remove-section.md +4 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/report-bug.md +4 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/request-feature.md +4 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/research-gap.md +6 -6
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/resume-writing.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/review-section.md +6 -6
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/settings.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/submit-milestone.md +3 -3
- package/{vendors/claude/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/update.md +4 -1
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/verify-work.md +3 -3
- package/{vendors/plugin/ai.iowarp.clio → pancode/plugin/dev.pancode}/prompts/wtfp/write-section.md +6 -6
- package/{vendors → pancode}/plugin/plugin.json +56 -56
- package/{vendors → pancode}/plugin/repository/CONTRIBUTING.md +5 -2
- package/{vendors → pancode}/plugin/skills/wtfp-plan-section/references/actions.md +2 -2
- package/{vendors → pancode}/plugin/workflows/create-outline.md +1 -1
- package/{vendors → pancode}/plugin/workflows/insert-section.md +1 -1
- package/{vendors → pancode}/plugin/workflows/pause-writing.md +1 -1
- package/protocol/workflows/create-outline.md +1 -1
- package/protocol/workflows/insert-section.md +1 -1
- package/protocol/workflows/pause-writing.md +1 -1
- package/vendors/antigravity/.wtfp-generated.json +9 -9
- package/vendors/antigravity/plugin.json +2 -2
- package/vendors/antigravity/repository/CONTRIBUTING.md +5 -2
- package/vendors/antigravity/skills/wtfp-create-outline/SKILL.md +1 -1
- package/vendors/antigravity/skills/wtfp-insert-section/SKILL.md +1 -1
- package/vendors/antigravity/skills/wtfp-pause-writing/SKILL.md +1 -1
- package/vendors/antigravity/workflows/create-outline.md +1 -1
- package/vendors/antigravity/workflows/insert-section.md +1 -1
- package/vendors/antigravity/workflows/pause-writing.md +1 -1
- package/vendors/claude/.claude-plugin/marketplace.json +2 -2
- package/vendors/claude/.claude-plugin/plugin.json +1 -1
- package/vendors/claude/.wtfp-generated.json +188 -188
- package/vendors/claude/commands/create-outline.md +1 -1
- package/vendors/claude/commands/insert-section.md +1 -1
- package/vendors/claude/commands/pause-writing.md +1 -1
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-argument-verifier.md +7 -3
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-citation-expert.md +6 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/agents/wtfp-citation-formatter.md +6 -2
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-coherence-checker.md +7 -3
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-outliner.md +6 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/agents/wtfp-plan-checker.md +7 -3
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/agents/wtfp-prose-polisher.md +6 -2
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-research-synthesizer.md +6 -2
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-section-planner.md +6 -2
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/agents/wtfp-section-reviewer.md +7 -3
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/agents/wtfp-section-writer.md +7 -3
- package/vendors/{plugin/ai.iowarp.clio/playbooks → claude/dev.pancode/fleets}/wtfp-draft-review.md +1 -1
- package/vendors/{plugin/ai.iowarp.clio/playbooks → claude/dev.pancode/fleets}/wtfp-plan-section.md +2 -0
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/advance.md +4 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/analyze-bib.md +4 -4
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/audit-milestone.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/check-refs.md +4 -4
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/check-todos.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/checkpoint.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/contribute.md +4 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/create-outline.md +5 -5
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/create-poster.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/create-slides.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/discuss-section.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/execute-outline.md +5 -5
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/export-latex.md +2 -2
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/prompts/wtfp/help.md +7 -7
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/insert-section.md +3 -3
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/new-paper.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/pause-writing.md +1 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/plan-milestone-gaps.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/plan-revision.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/plan-section.md +5 -5
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/polish-prose.md +4 -4
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/progress.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/quick.md +4 -4
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/prompts/wtfp/remove-section.md +4 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/report-bug.md +4 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/request-feature.md +4 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/research-gap.md +5 -5
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/resume-writing.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/review-section.md +5 -5
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/settings.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/submit-milestone.md +2 -2
- package/vendors/{plugin/ai.iowarp.clio → claude/dev.pancode}/prompts/wtfp/update.md +4 -1
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/verify-work.md +2 -2
- package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/write-section.md +5 -5
- package/vendors/claude/plugin.json +56 -56
- package/vendors/claude/repository/CONTRIBUTING.md +5 -2
- package/vendors/claude/workflows/create-outline.md +1 -1
- package/vendors/claude/workflows/insert-section.md +1 -1
- package/vendors/claude/workflows/pause-writing.md +1 -1
- package/vendors/codex/plugins/wtfp/.codex-plugin/plugin.json +1 -1
- package/vendors/codex/plugins/wtfp/.wtfp-generated.json +7 -7
- package/vendors/codex/plugins/wtfp/plugin.json +1 -1
- package/vendors/codex/plugins/wtfp/repository/CONTRIBUTING.md +5 -2
- package/vendors/codex/plugins/wtfp/workflows/create-outline.md +1 -1
- package/vendors/codex/plugins/wtfp/workflows/insert-section.md +1 -1
- package/vendors/codex/plugins/wtfp/workflows/pause-writing.md +1 -1
- package/vendors/copilot/.wtfp-generated.json +6 -6
- package/vendors/copilot/marketplace.json +2 -2
- package/vendors/copilot/plugins/wtfp/.claude-plugin/plugin.json +1 -1
- package/vendors/copilot/plugins/wtfp/.wtfp-generated.json +9 -9
- package/vendors/copilot/plugins/wtfp/commands/wtfp-create-outline.md +1 -1
- package/vendors/copilot/plugins/wtfp/commands/wtfp-insert-section.md +1 -1
- package/vendors/copilot/plugins/wtfp/commands/wtfp-pause-writing.md +1 -1
- package/vendors/copilot/plugins/wtfp/repository/CONTRIBUTING.md +5 -2
- package/vendors/copilot/plugins/wtfp/workflows/create-outline.md +1 -1
- package/vendors/copilot/plugins/wtfp/workflows/insert-section.md +1 -1
- package/vendors/copilot/plugins/wtfp/workflows/pause-writing.md +1 -1
- package/vendors/copilot/project/.github/prompts/wtfp-pause-writing.prompt.md +1 -1
- package/vendors/copilot/project/.github/wtfp/workflows/create-outline.md +1 -1
- package/vendors/copilot/project/.github/wtfp/workflows/insert-section.md +1 -1
- package/vendors/copilot/project/.github/wtfp/workflows/pause-writing.md +1 -1
- package/vendors/gemini/.wtfp-generated.json +9 -9
- package/vendors/gemini/commands/wtfp/create-outline.toml +1 -1
- package/vendors/gemini/commands/wtfp/insert-section.toml +1 -1
- package/vendors/gemini/commands/wtfp/pause-writing.toml +1 -1
- package/vendors/gemini/gemini-extension.json +1 -1
- package/vendors/gemini/repository/CONTRIBUTING.md +5 -2
- package/vendors/gemini/workflows/create-outline.md +1 -1
- package/vendors/gemini/workflows/insert-section.md +1 -1
- package/vendors/gemini/workflows/pause-writing.md +1 -1
- package/vendors/opencode/.wtfp-generated.json +8 -8
- package/vendors/opencode/commands/wtfp/create-outline.md +1 -1
- package/vendors/opencode/commands/wtfp/insert-section.md +1 -1
- package/vendors/opencode/commands/wtfp/pause-writing.md +1 -1
- package/vendors/opencode/repository/CONTRIBUTING.md +5 -2
- package/vendors/opencode/workflows/create-outline.md +1 -1
- package/vendors/opencode/workflows/insert-section.md +1 -1
- package/vendors/opencode/workflows/pause-writing.md +1 -1
- /package/{vendors/clio-extension → pancode/extension}/actions/add-todo.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/advance.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/analyze-bib.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/audit-milestone.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/check-refs.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/check-todos.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/checkpoint.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/contribute.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/create-outline.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/create-poster.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/create-slides.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/discuss-section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/execute-outline.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/export-latex.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/help.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/insert-section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/list-assumptions.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/map-project.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/new-paper.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/pause-writing.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/plan-milestone-gaps.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/plan-revision.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/plan-section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/polish-prose.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/progress.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/quick.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/remove-section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/report-bug.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/request-feature.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/research-gap.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/resume-writing.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/review-section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/settings.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/submit-milestone.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/update.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/verify-work.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/actions/write-section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/checkpoint.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/common.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/config.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/decisions.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/evidence.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/interaction.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/manifest.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/outline.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/section.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/source.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/state.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/schemas/validation.schema.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/checkpoint.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/config.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/decisions.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/evidence.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/interaction.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/manifest.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/outline.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/section.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/source.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/state.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/project/templates/validation.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/runtime/json-schema.cjs +0 -0
- /package/{vendors/clio-extension → pancode/extension}/runtime/package.json +0 -0
- /package/{vendors/clio-extension → pancode/extension}/skins/wtfp.json +0 -0
- /package/{vendors → pancode}/plugin/actions/add-todo.json +0 -0
- /package/{vendors → pancode}/plugin/actions/advance.json +0 -0
- /package/{vendors → pancode}/plugin/actions/analyze-bib.json +0 -0
- /package/{vendors → pancode}/plugin/actions/audit-milestone.json +0 -0
- /package/{vendors → pancode}/plugin/actions/check-refs.json +0 -0
- /package/{vendors → pancode}/plugin/actions/check-todos.json +0 -0
- /package/{vendors → pancode}/plugin/actions/checkpoint.json +0 -0
- /package/{vendors → pancode}/plugin/actions/contribute.json +0 -0
- /package/{vendors → pancode}/plugin/actions/create-outline.json +0 -0
- /package/{vendors → pancode}/plugin/actions/create-poster.json +0 -0
- /package/{vendors → pancode}/plugin/actions/create-slides.json +0 -0
- /package/{vendors → pancode}/plugin/actions/discuss-section.json +0 -0
- /package/{vendors → pancode}/plugin/actions/execute-outline.json +0 -0
- /package/{vendors → pancode}/plugin/actions/export-latex.json +0 -0
- /package/{vendors → pancode}/plugin/actions/help.json +0 -0
- /package/{vendors → pancode}/plugin/actions/insert-section.json +0 -0
- /package/{vendors → pancode}/plugin/actions/list-assumptions.json +0 -0
- /package/{vendors → pancode}/plugin/actions/map-project.json +0 -0
- /package/{vendors → pancode}/plugin/actions/new-paper.json +0 -0
- /package/{vendors → pancode}/plugin/actions/pause-writing.json +0 -0
- /package/{vendors → pancode}/plugin/actions/plan-milestone-gaps.json +0 -0
- /package/{vendors → pancode}/plugin/actions/plan-revision.json +0 -0
- /package/{vendors → pancode}/plugin/actions/plan-section.json +0 -0
- /package/{vendors → pancode}/plugin/actions/polish-prose.json +0 -0
- /package/{vendors → pancode}/plugin/actions/progress.json +0 -0
- /package/{vendors → pancode}/plugin/actions/quick.json +0 -0
- /package/{vendors → pancode}/plugin/actions/remove-section.json +0 -0
- /package/{vendors → pancode}/plugin/actions/report-bug.json +0 -0
- /package/{vendors → pancode}/plugin/actions/request-feature.json +0 -0
- /package/{vendors → pancode}/plugin/actions/research-gap.json +0 -0
- /package/{vendors → pancode}/plugin/actions/resume-writing.json +0 -0
- /package/{vendors → pancode}/plugin/actions/review-section.json +0 -0
- /package/{vendors → pancode}/plugin/actions/settings.json +0 -0
- /package/{vendors → pancode}/plugin/actions/submit-milestone.json +0 -0
- /package/{vendors → pancode}/plugin/actions/update.json +0 -0
- /package/{vendors → pancode}/plugin/actions/verify-work.json +0 -0
- /package/{vendors → pancode}/plugin/actions/write-section.json +0 -0
- /package/{vendors → pancode}/plugin/aliases.lock.json +0 -0
- /package/{vendors → pancode}/plugin/catalog.json +0 -0
- /package/{vendors → pancode}/plugin/effects.json +0 -0
- /package/{vendors → pancode}/plugin/project/README.md +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/checkpoint.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/common.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/config.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/decisions.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/evidence.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/interaction.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/manifest.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/outline.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/section.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/source.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/state.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/schemas/validation.schema.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/checkpoint.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/config.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/decisions.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/evidence.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/interaction.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/manifest.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/outline.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/section.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/source.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/state.json +0 -0
- /package/{vendors → pancode}/plugin/project/templates/validation.json +0 -0
- /package/{vendors → pancode}/plugin/roles/argument-verifier.md +0 -0
- /package/{vendors → pancode}/plugin/roles/citation-expert.md +0 -0
- /package/{vendors → pancode}/plugin/roles/citation-formatter.md +0 -0
- /package/{vendors → pancode}/plugin/roles/coherence-checker.md +0 -0
- /package/{vendors → pancode}/plugin/roles/outliner.md +0 -0
- /package/{vendors → pancode}/plugin/roles/plan-checker.md +0 -0
- /package/{vendors → pancode}/plugin/roles/prose-polisher.md +0 -0
- /package/{vendors → pancode}/plugin/roles/research-synthesizer.md +0 -0
- /package/{vendors → pancode}/plugin/roles/section-planner.md +0 -0
- /package/{vendors → pancode}/plugin/roles/section-reviewer.md +0 -0
- /package/{vendors → pancode}/plugin/roles/section-writer.md +0 -0
- /package/{vendors → pancode}/plugin/schemas/action.schema.json +0 -0
- /package/{vendors → pancode}/plugin/schemas/aliases.schema.json +0 -0
- /package/{vendors → pancode}/plugin/schemas/catalog.schema.json +0 -0
- /package/{vendors → pancode}/plugin/schemas/effects.schema.json +0 -0
- /package/{vendors → pancode}/plugin/schemas/role-result.schema.json +0 -0
- /package/{vendors → pancode}/plugin/schemas/tools.schema.json +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-deliver-research/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-deliver-research/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-deliver-research/references/actions.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-manage-project/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-manage-project/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-manage-project/references/actions.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-plan-section/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-plan-section/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-research-literature/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-research-literature/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-research-literature/references/actions.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-review-manuscript/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-review-manuscript/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-review-manuscript/references/actions.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-start-project/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-start-project/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-start-project/references/actions.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-write-section/SKILL.md +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-write-section/agents/openai.yaml +0 -0
- /package/{vendors → pancode}/plugin/skills/wtfp-write-section/references/actions.md +0 -0
- /package/{vendors → pancode}/plugin/templates/README.md +0 -0
- /package/{vendors → pancode}/plugin/templates/grant-proposal-outline.md +0 -0
- /package/{vendors → pancode}/plugin/templates/paper-outline.md +0 -0
- /package/{vendors → pancode}/plugin/templates/poster.md +0 -0
- /package/{vendors → pancode}/plugin/templates/slides.md +0 -0
- /package/{vendors → pancode}/plugin/tools/README.md +0 -0
- /package/{vendors → pancode}/plugin/tools/bibliography/analyze-impact.js +0 -0
- /package/{vendors → pancode}/plugin/tools/bibliography/format.js +0 -0
- /package/{vendors → pancode}/plugin/tools/bibliography/index.js +0 -0
- /package/{vendors → pancode}/plugin/tools/citation/fetch.js +0 -0
- /package/{vendors → pancode}/plugin/tools/citation/rank.js +0 -0
- /package/{vendors → pancode}/plugin/tools/citation/scholar-lookup.js +0 -0
- /package/{vendors → pancode}/plugin/tools/citation/semantic-scholar.js +0 -0
- /package/{vendors → pancode}/plugin/tools/package.json +0 -0
- /package/{vendors → pancode}/plugin/tools/support/cite-nexus-client.js +0 -0
- /package/{vendors → pancode}/plugin/tools/wtfp-tool.js +0 -0
- /package/{vendors → pancode}/plugin/tools.json +0 -0
- /package/{vendors → pancode}/plugin/workflows/add-todo.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/advance.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/analyze-bib.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/audit-milestone.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/check-refs.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/check-todos.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/checkpoint.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/contribute.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/create-poster.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/create-slides.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/discuss-section.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/execute-outline.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/export-latex.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/help.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/list-assumptions.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/map-project.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/new-paper.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/plan-milestone-gaps.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/plan-revision.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/plan-section.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/polish-prose.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/progress.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/quick.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/remove-section.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/report-bug.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/request-feature.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/research-gap.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/resume-writing.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/review-section.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/settings.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/submit-milestone.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/update.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/verify-work.md +0 -0
- /package/{vendors → pancode}/plugin/workflows/write-section.md +0 -0
- /package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/add-todo.md +0 -0
- /package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/list-assumptions.md +0 -0
- /package/vendors/claude/{ai.iowarp.clio → dev.pancode}/prompts/wtfp/map-project.md +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// Generated by WTF-P adapter compiler v5 from
|
|
1
|
+
// Generated by WTF-P adapter compiler v5 from hosts/pancode/runtime/extension.ts; do not edit.
|
|
2
2
|
/**
|
|
3
|
-
* WTF-P writing desk for
|
|
4
|
-
* compiler copies it to
|
|
5
|
-
* generated write-guard.json, json-schema.cjs and claim-coverage.cjs.
|
|
3
|
+
* WTF-P writing desk for PanCode. Human-edited source; the adapter
|
|
4
|
+
* compiler copies it to pancode/extension/runtime/ beside the
|
|
5
|
+
* generated write-guard.json, help.json, json-schema.cjs and claim-coverage.cjs.
|
|
6
6
|
*
|
|
7
7
|
* The desk reads the portable `.planning` records and the manuscript and
|
|
8
|
-
* draws them. It is also the project's one JSON record writer on
|
|
8
|
+
* draws them. It is also the project's one JSON record writer on PanCode: each
|
|
9
9
|
* write is validated, compared with the version its writer read, and
|
|
10
10
|
* committed under a project lock, with paired records journaled so a failed
|
|
11
11
|
* process leaves a state the next write completes. It alone records an
|
|
@@ -46,7 +46,7 @@ import type {
|
|
|
46
46
|
InterviewStep,
|
|
47
47
|
View,
|
|
48
48
|
ViewTone,
|
|
49
|
-
} from "
|
|
49
|
+
} from "pancode/sdk/extension";
|
|
50
50
|
|
|
51
51
|
const require = createRequire(import.meta.url);
|
|
52
52
|
const { SchemaRegistry, validateInstance } = require("./json-schema.cjs") as {
|
|
@@ -104,7 +104,7 @@ function withTemplate(message: string, type: string): string {
|
|
|
104
104
|
return template ? `${message}\nA ${type} record looks like this example; replace its ids, project_id and content, and omit ${CREATED_AT[type] ? `updated_at and ${CREATED_AT[type]}, which the desk sets` : "updated_at, which the desk sets"}: ${template}` : message;
|
|
105
105
|
}
|
|
106
106
|
interface GuardAction {
|
|
107
|
-
/** The
|
|
107
|
+
/** The PanCode agent IDs of the roles the action's contract delegates to. */
|
|
108
108
|
agents: string[];
|
|
109
109
|
produces: Array<{ uri: string; mode: string }>;
|
|
110
110
|
}
|
|
@@ -113,6 +113,10 @@ const GUARD = JSON.parse(readFileSync(new URL("./write-guard.json", import.meta.
|
|
|
113
113
|
actions: Record<string, GuardAction>;
|
|
114
114
|
paperWriters: string[];
|
|
115
115
|
};
|
|
116
|
+
const HELP = JSON.parse(readFileSync(new URL("./help.json", import.meta.url), "utf8")) as {
|
|
117
|
+
schema: string;
|
|
118
|
+
groups: Array<{ title: string; actions: string[] }>;
|
|
119
|
+
};
|
|
116
120
|
const SKIN = JSON.parse(readFileSync(new URL("../skins/wtfp.json", import.meta.url), "utf8")) as ExtensionSkin;
|
|
117
121
|
const RECORD_LIMIT = 1024 * 1024;
|
|
118
122
|
const PHASES = ["initialized", "mapped", "outlining", "planning", "writing", "reviewing", "ready", "delivered"] as const;
|
|
@@ -249,7 +253,7 @@ interface Desk {
|
|
|
249
253
|
audit: { fresh: boolean; errors: number } | null;
|
|
250
254
|
/** A passed submit-milestone validation that no later draft or record outdates. */
|
|
251
255
|
delivered: boolean;
|
|
252
|
-
/** The WTF-P plugin while
|
|
256
|
+
/** The WTF-P plugin while PanCode serves it; null when it is not installed and enabled. */
|
|
253
257
|
served: ServedPlugin;
|
|
254
258
|
}
|
|
255
259
|
|
|
@@ -304,7 +308,7 @@ function contained(workspace: string, relative: string): string | null {
|
|
|
304
308
|
return file;
|
|
305
309
|
}
|
|
306
310
|
|
|
307
|
-
/** The workspace's real path, against which
|
|
311
|
+
/** The workspace's real path, against which PanCode reports every landing. */
|
|
308
312
|
function realWorkspace(workspace: string): string {
|
|
309
313
|
try {
|
|
310
314
|
return realpathSync(workspace);
|
|
@@ -917,11 +921,7 @@ function reconcile(workspace: string, desk: Desk): Finding[] {
|
|
|
917
921
|
continue;
|
|
918
922
|
}
|
|
919
923
|
const artifacts = (section.record.artifacts ?? {}) as Json;
|
|
920
|
-
for (const uri of
|
|
921
|
-
...(Array.isArray(artifacts.plans) ? (artifacts.plans as string[]) : []),
|
|
922
|
-
...(Array.isArray(artifacts.reviews) ? (artifacts.reviews as string[]) : []),
|
|
923
|
-
...["context", "research", "summary", "handoff"].map((key) => artifacts[key]).filter((uri): uri is string => typeof uri === "string"),
|
|
924
|
-
]) {
|
|
924
|
+
for (const uri of sectionLinks(section.record)) {
|
|
925
925
|
const file = artifactFile(workspace, uri, desk.outputFormat);
|
|
926
926
|
if (file === null || readBytes(workspace, file) === null) add("error", "artifact-dangling", subject, `${uri} is linked but does not resolve to a file.`);
|
|
927
927
|
}
|
|
@@ -987,7 +987,7 @@ function withLock<T>(workspace: string, work: () => T): T {
|
|
|
987
987
|
|
|
988
988
|
/**
|
|
989
989
|
* Writes a new file and flushes it where the process may. Node's permission
|
|
990
|
-
* model, which
|
|
990
|
+
* model, which PanCode runs the desk under, refuses every flush (fsync,
|
|
991
991
|
* fdatasync, flush: true) with ERR_ACCESS_DENIED, so there a write is still
|
|
992
992
|
* all-or-nothing by its rename but not durable across power loss. A file that
|
|
993
993
|
* could not be written whole is removed.
|
|
@@ -1158,7 +1158,7 @@ function commit(workspace: string, writes: PendingWrite[]): void {
|
|
|
1158
1158
|
fault("before-commit");
|
|
1159
1159
|
if (staged.length > 1) {
|
|
1160
1160
|
const journal = `${JOURNAL}.${randomUUID()}.partial`;
|
|
1161
|
-
writeDurably(path.join(workspace, journal), `${JSON.stringify({ schema: "wtfp.
|
|
1161
|
+
writeDurably(path.join(workspace, journal), `${JSON.stringify({ schema: "wtfp.pancode-journal/v1", at: timestamp(), entries: staged }, null, 2)}\n`);
|
|
1162
1162
|
renameSync(path.join(workspace, journal), path.join(workspace, JOURNAL));
|
|
1163
1163
|
}
|
|
1164
1164
|
} catch (error) {
|
|
@@ -1382,6 +1382,56 @@ function prepare(workspace: string, input: RecordWrite, origin: "agent" | "desk"
|
|
|
1382
1382
|
}
|
|
1383
1383
|
}
|
|
1384
1384
|
|
|
1385
|
+
/** The artifact URIs a section record links, manuscript aside: the links reconcile resolves. */
|
|
1386
|
+
function sectionLinks(record: Json | null): string[] {
|
|
1387
|
+
const artifacts = isObject(record?.artifacts) ? (record.artifacts as Json) : {};
|
|
1388
|
+
return [
|
|
1389
|
+
...(Array.isArray(artifacts.plans) ? artifacts.plans : []),
|
|
1390
|
+
...(Array.isArray(artifacts.reviews) ? artifacts.reviews : []),
|
|
1391
|
+
...["context", "research", "summary", "handoff"].map((key) => artifacts[key]),
|
|
1392
|
+
].filter((uri): uri is string => typeof uri === "string");
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
function claimIds(record: Json | null): string[] {
|
|
1396
|
+
return (Array.isArray(record?.claims) ? record.claims : []).map((claim) => (isObject(claim) ? text(claim.id) : "")).filter(Boolean);
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
/**
|
|
1400
|
+
* Why a section write would leave the project failing validation, judged on what
|
|
1401
|
+
* this write adds: a link to an artifact file that does not exist, or a claim id
|
|
1402
|
+
* another claim already holds.
|
|
1403
|
+
*/
|
|
1404
|
+
function sectionRefusal(workspace: string, uri: string, prior: Json | null, record: Json): string | null {
|
|
1405
|
+
const linked = new Set(sectionLinks(prior));
|
|
1406
|
+
const missing = sectionLinks(record).filter((link) => {
|
|
1407
|
+
if (linked.has(link)) return false;
|
|
1408
|
+
const file = artifactFile(workspace, link);
|
|
1409
|
+
return file === null || readBytes(workspace, file) === null;
|
|
1410
|
+
});
|
|
1411
|
+
if (missing.length > 0)
|
|
1412
|
+
return `${uri} links ${missing.join(", ")}, which ${missing.length === 1 ? "has" : "have"} no file yet. Write the artifact first or leave the link out until it exists, then send the write again; a missing artifact is not a refusal and does not end the step`;
|
|
1413
|
+
const held = new Set(claimIds(prior));
|
|
1414
|
+
const ids = claimIds(record);
|
|
1415
|
+
const added = ids.filter((id) => !held.has(id));
|
|
1416
|
+
const twice = [...new Set(added.filter((id, index) => added.indexOf(id) !== index))];
|
|
1417
|
+
const owners = new Map<string, string>();
|
|
1418
|
+
const directory = contained(workspace, ".planning/sections");
|
|
1419
|
+
const own = record.id;
|
|
1420
|
+
if (directory !== null && existsSync(directory) && lstatSync(directory).isDirectory())
|
|
1421
|
+
for (const entry of readdirSync(directory, { withFileTypes: true })) {
|
|
1422
|
+
if (!entry.isDirectory() || entry.name === own) continue;
|
|
1423
|
+
for (const id of claimIds(readRecord(workspace, `.planning/sections/${entry.name}/section.json`)))
|
|
1424
|
+
if (added.includes(id) && !owners.has(id)) owners.set(id, entry.name);
|
|
1425
|
+
}
|
|
1426
|
+
const clashes = [
|
|
1427
|
+
...twice.map((id) => `${id} appears twice in this record`),
|
|
1428
|
+
...[...owners].map(([id, section]) => `${id} is already a claim of project://sections/${section}`),
|
|
1429
|
+
];
|
|
1430
|
+
return clashes.length > 0
|
|
1431
|
+
? `${uri}: ${clashes.join("; ")}. Each claim needs an id no other claim in the project holds; rename the claim and send the write again. A duplicate id is not a refusal and does not end the step`
|
|
1432
|
+
: null;
|
|
1433
|
+
}
|
|
1434
|
+
|
|
1385
1435
|
function prepareRecord(workspace: string, input: RecordWrite, origin: "agent" | "desk", armed: Armed | null): Prepared {
|
|
1386
1436
|
const { uri } = input;
|
|
1387
1437
|
const record = input.record;
|
|
@@ -1443,6 +1493,10 @@ function prepareRecord(workspace: string, input: RecordWrite, origin: "agent" |
|
|
|
1443
1493
|
const refusal = checkpointRefusal(prior, record, superseded);
|
|
1444
1494
|
if (refusal) throw new Error(`${uri}: ${refusal}`);
|
|
1445
1495
|
}
|
|
1496
|
+
if (route.type === "section") {
|
|
1497
|
+
const refusal = sectionRefusal(workspace, uri, prior, record);
|
|
1498
|
+
if (refusal) throw new Error(refusal);
|
|
1499
|
+
}
|
|
1446
1500
|
const next: Json = { ...record };
|
|
1447
1501
|
let revision: number | null = null;
|
|
1448
1502
|
if (REVISIONED.has(route.type)) {
|
|
@@ -1692,7 +1746,7 @@ function driveStep(desk: Desk, drive: Drive): DriveDecision {
|
|
|
1692
1746
|
kind: "step",
|
|
1693
1747
|
action: next.action,
|
|
1694
1748
|
section,
|
|
1695
|
-
prompt: `
|
|
1749
|
+
prompt: `dev.pancode/prompts/wtfp/${next.action}.md`,
|
|
1696
1750
|
reason: `Continue ${next.command}; it has not failed. It recorded nothing the next step depends on, so record its outputs for what it found, whatever the outcome (${creates.join(", ")}), then call extension_wtfp__next_step. Do not repeat its work.`,
|
|
1697
1751
|
finish: true,
|
|
1698
1752
|
};
|
|
@@ -1704,21 +1758,21 @@ function driveStep(desk: Desk, drive: Drive): DriveDecision {
|
|
|
1704
1758
|
kind: "step",
|
|
1705
1759
|
action: next.action,
|
|
1706
1760
|
section,
|
|
1707
|
-
prompt: `
|
|
1761
|
+
prompt: `dev.pancode/prompts/wtfp/${next.action}.md`,
|
|
1708
1762
|
reason: `Continue ${next.command}: it made progress but has not finished, so the desk arms it again on purpose; this is not a loop. ${next.reason}`,
|
|
1709
1763
|
};
|
|
1710
|
-
return { kind: "step", action: next.action, section, prompt: `
|
|
1764
|
+
return { kind: "step", action: next.action, section, prompt: `dev.pancode/prompts/wtfp/${next.action}.md`, reason: next.reason };
|
|
1711
1765
|
}
|
|
1712
1766
|
|
|
1713
1767
|
/**
|
|
1714
|
-
* Every next_step result ends with this rule, so a turn
|
|
1768
|
+
* Every next_step result ends with this rule, so a turn PanCode compacted after
|
|
1715
1769
|
* dropping the advance prompt can still continue from the last result alone.
|
|
1716
1770
|
*/
|
|
1717
1771
|
const DRIVER_RULE =
|
|
1718
1772
|
"Driver rule for this /wtfp:advance run: the desk, not you, picks every step, so finish the step it armed and call extension_wtfp__next_step with after naming that step (\"start\" for the first call), call extension_wtfp__gate with the checkpoint it names and then extension_wtfp__next_step, and on a stop, a failed step or a refused call report the steps taken and end the turn without choosing another action.";
|
|
1719
1773
|
|
|
1720
1774
|
/**
|
|
1721
|
-
* Live on
|
|
1775
|
+
* Live on the 0.8.3 host, the model looked for a capability named after the step's action, found none in the
|
|
1722
1776
|
* turn's list, and stopped the drive as if the step were forbidden.
|
|
1723
1777
|
*/
|
|
1724
1778
|
const STEP_IS_A_PROCEDURE =
|
|
@@ -1952,9 +2006,9 @@ function islands(desk: Desk, running: Record<string, { agentId: string; at: numb
|
|
|
1952
2006
|
items: [
|
|
1953
2007
|
{ label: "sources verified", value: String(verified), tone: verified > 0 ? "positive" : "muted" },
|
|
1954
2008
|
{ label: "provisional", value: String(provisional), tone: provisional > 0 ? "warning" : "muted" },
|
|
1955
|
-
...(lost > 0 ? [{ label: "
|
|
2009
|
+
...(lost > 0 ? [{ label: "sources unusable", value: String(lost), tone: "error" as ViewTone }] : []),
|
|
1956
2010
|
{ label: "evidence items", value: String(desk.evidence) },
|
|
1957
|
-
{ label: "
|
|
2011
|
+
{ label: "unsupported claims", value: String(unsupported), tone: unsupported > 0 ? "warning" : "positive" },
|
|
1958
2012
|
],
|
|
1959
2013
|
},
|
|
1960
2014
|
});
|
|
@@ -2109,6 +2163,8 @@ async function revalidate(ctx: ExtensionContextV2, files: string[]): Promise<Vie
|
|
|
2109
2163
|
const KEEP = "__keep";
|
|
2110
2164
|
const RESOLVE = "__resolve";
|
|
2111
2165
|
const WAIVE = "__waive";
|
|
2166
|
+
/** The pause checkpoint's option that returns a paused project to active (pause-writing step 2). */
|
|
2167
|
+
const RESUME = "resume";
|
|
2112
2168
|
|
|
2113
2169
|
/** What the author was shown, kept until the answer arrives so a changed question cannot take an old answer. */
|
|
2114
2170
|
interface Asked {
|
|
@@ -2223,7 +2279,7 @@ function interactionId(): string {
|
|
|
2223
2279
|
return `interaction-${timestamp().replace(/[^0-9]/gu, "")}-${randomBytes(4).toString("hex")}`;
|
|
2224
2280
|
}
|
|
2225
2281
|
|
|
2226
|
-
type AnswerResult = { kind: "recorded" | "kept" | "stale" | "refused"; text: string; checkpoint?: string };
|
|
2282
|
+
type AnswerResult = { kind: "recorded" | "kept" | "stale" | "refused"; text: string; author?: string; checkpoint?: string };
|
|
2227
2283
|
|
|
2228
2284
|
/**
|
|
2229
2285
|
* Records one gate answer. The answer counts only if it names an option the
|
|
@@ -2272,6 +2328,7 @@ async function answer(ctx: ExtensionContextV2, stepKey: string, picked: unknown,
|
|
|
2272
2328
|
);
|
|
2273
2329
|
const writes: Array<{ input: RecordWrite }> = [{ input: { uri: `project://interactions/${String(interaction.id)}`, record: interaction } }];
|
|
2274
2330
|
let linkedIn: string | null = null;
|
|
2331
|
+
let resumed = false;
|
|
2275
2332
|
if (!stale && picked !== KEEP) {
|
|
2276
2333
|
const { file: _file, trust: _trust, answer: _answer, ...stored } = checkpoint;
|
|
2277
2334
|
writes.push({
|
|
@@ -2286,10 +2343,10 @@ async function answer(ctx: ExtensionContextV2, stepKey: string, picked: unknown,
|
|
|
2286
2343
|
...(option ? { selected_option: option.id } : {}),
|
|
2287
2344
|
summary: `${
|
|
2288
2345
|
option
|
|
2289
|
-
? `The author chose "${shown(checkpoint, option).label}" at the
|
|
2346
|
+
? `The author chose "${shown(checkpoint, option).label}" at the PanCode WTF-P desk.`
|
|
2290
2347
|
: picked === WAIVE
|
|
2291
|
-
? "The author waived this gate at the
|
|
2292
|
-
: "The author marked this done at the
|
|
2348
|
+
? "The author waived this gate at the PanCode WTF-P desk."
|
|
2349
|
+
: "The author marked this done at the PanCode WTF-P desk."
|
|
2293
2350
|
}${note ? `${NOTE_LEAD}${note}` : ""}`,
|
|
2294
2351
|
resolved_at: now,
|
|
2295
2352
|
},
|
|
@@ -2298,14 +2355,22 @@ async function answer(ctx: ExtensionContextV2, stepKey: string, picked: unknown,
|
|
|
2298
2355
|
});
|
|
2299
2356
|
const state = readRecord(workspace, ".planning/state.json");
|
|
2300
2357
|
const uri = `project://checkpoints/${checkpoint.id}`;
|
|
2301
|
-
if (state && Array.isArray(state.active_checkpoint_uris) && state.active_checkpoint_uris.includes(uri))
|
|
2358
|
+
if (state && Array.isArray(state.active_checkpoint_uris) && state.active_checkpoint_uris.includes(uri)) {
|
|
2359
|
+
resumed = option?.id === RESUME && state.status === "paused";
|
|
2302
2360
|
writes.push({
|
|
2303
2361
|
input: {
|
|
2304
2362
|
uri: "project://state",
|
|
2305
2363
|
expect_revision: typeof state.revision === "number" ? state.revision : 0,
|
|
2306
|
-
record: {
|
|
2364
|
+
record: {
|
|
2365
|
+
...state,
|
|
2366
|
+
active_checkpoint_uris: (state.active_checkpoint_uris as string[]).filter((entry) => entry !== uri),
|
|
2367
|
+
...(resumed
|
|
2368
|
+
? { status: "active", last_transition: { from: "paused", to: "active", reason: `The author chose to resume at ${checkpoint.id}.`, at: now } }
|
|
2369
|
+
: {}),
|
|
2370
|
+
},
|
|
2307
2371
|
},
|
|
2308
2372
|
});
|
|
2373
|
+
}
|
|
2309
2374
|
// The author's approval links the plan in the same commit: live, the model asked the desk for its next
|
|
2310
2375
|
// step before linking, and the approved plan sat unlinked while the driver planned again.
|
|
2311
2376
|
const planned = option?.id === APPROVE && planGate(checkpoint) ? /^project:\/\/sections\/([^/]+)\/plans\//u.exec(checkpoint.scope_uri)?.[1] : undefined;
|
|
@@ -2345,14 +2410,16 @@ async function answer(ctx: ExtensionContextV2, stepKey: string, picked: unknown,
|
|
|
2345
2410
|
checkpoint: checkpoint.id,
|
|
2346
2411
|
};
|
|
2347
2412
|
if (picked === KEEP) return { kind: "kept", text: `${checkpoint.id}: kept pending`, checkpoint: checkpoint.id };
|
|
2413
|
+
const chosen = `${option ? `${checkpoint.id}: ${shown(checkpoint, option).label}` : `${checkpoint.id}: ${picked === WAIVE ? "waived" : "done"}`}${
|
|
2414
|
+
resumed ? ". The project is active again" : ""
|
|
2415
|
+
}`;
|
|
2348
2416
|
return {
|
|
2349
2417
|
kind: "recorded",
|
|
2350
|
-
text: `${
|
|
2351
|
-
linkedIn ? `. The desk linked ${checkpoint.scope_uri} in ${linkedIn} with this answer; do not link it again` : ""
|
|
2352
|
-
}. The desk wrote ${writes
|
|
2418
|
+
text: `${chosen}${linkedIn ? `. The desk linked ${checkpoint.scope_uri} in ${linkedIn} with this answer; do not link it again` : ""}. The desk wrote ${writes
|
|
2353
2419
|
.slice(1)
|
|
2354
2420
|
.map((entry) => entry.input.uri)
|
|
2355
2421
|
.join(", ")}; read any of them again before writing it`,
|
|
2422
|
+
author: chosen,
|
|
2356
2423
|
checkpoint: checkpoint.id,
|
|
2357
2424
|
};
|
|
2358
2425
|
}
|
|
@@ -2516,7 +2583,7 @@ async function recordTool(ctx: ExtensionContextV2, input: Json): Promise<{ text:
|
|
|
2516
2583
|
|
|
2517
2584
|
/**
|
|
2518
2585
|
* Authored artifacts keep their own format and are read and written with
|
|
2519
|
-
*
|
|
2586
|
+
* PanCode's file tools; a refusal names the conventional file so the model does
|
|
2520
2587
|
* not search the workspace for it.
|
|
2521
2588
|
*/
|
|
2522
2589
|
const ARTIFACT_URIS: ReadonlyArray<{ pattern: RegExp; file: (match: RegExpExecArray) => string }> = [
|
|
@@ -2823,10 +2890,10 @@ function statusDigest(desk: Desk): Json {
|
|
|
2823
2890
|
};
|
|
2824
2891
|
}
|
|
2825
2892
|
|
|
2826
|
-
/**
|
|
2893
|
+
/** PanCode refuses effect text longer than this many UTF-16 code units. */
|
|
2827
2894
|
const EFFECT_TEXT_LIMIT = 2000;
|
|
2828
2895
|
|
|
2829
|
-
/** Text cut to
|
|
2896
|
+
/** Text cut to PanCode's effect limit with `tail` appended, never splitting a surrogate pair. */
|
|
2830
2897
|
function clip(message: string, tail: string): string {
|
|
2831
2898
|
if (message.length <= EFFECT_TEXT_LIMIT) return message;
|
|
2832
2899
|
let end = EFFECT_TEXT_LIMIT - tail.length;
|
|
@@ -2835,7 +2902,7 @@ function clip(message: string, tail: string): string {
|
|
|
2835
2902
|
return `${message.slice(0, end)}${tail}`;
|
|
2836
2903
|
}
|
|
2837
2904
|
|
|
2838
|
-
/** The desk's status as one reminder within
|
|
2905
|
+
/** The desk's status as one reminder within PanCode's effect limit. */
|
|
2839
2906
|
function statusReminder(desk: Desk): string {
|
|
2840
2907
|
const gates = openGates(desk);
|
|
2841
2908
|
const lines = [
|
|
@@ -2860,6 +2927,7 @@ function helpCard(served: ServedPlugin): { text: string; card: View } {
|
|
|
2860
2927
|
];
|
|
2861
2928
|
});
|
|
2862
2929
|
const local = [...DESK_COMMANDS].map((id) => actionName(served, id));
|
|
2930
|
+
const unavailable = new Set(availability.actions.filter((entry) => entry.status !== "available").map((entry) => entry.id));
|
|
2863
2931
|
return {
|
|
2864
2932
|
text: rows.map((row) => `${row[0]} ${row[1]}`).join("\n"),
|
|
2865
2933
|
card: {
|
|
@@ -2869,7 +2937,14 @@ function helpCard(served: ServedPlugin): { text: string; card: View } {
|
|
|
2869
2937
|
title: "WTF-P actions",
|
|
2870
2938
|
meta: `${rows.length}`,
|
|
2871
2939
|
children: [
|
|
2872
|
-
{
|
|
2940
|
+
{
|
|
2941
|
+
t: "kv",
|
|
2942
|
+
items: HELP.groups.map((group) => ({
|
|
2943
|
+
label: group.title,
|
|
2944
|
+
value: group.actions.map((id) => `${actionName(served, id)}${unavailable.has(id) ? " (unavailable)" : ""}`).join(" "),
|
|
2945
|
+
})),
|
|
2946
|
+
},
|
|
2947
|
+
...(served ? [{ t: "text", wrap: "wrap", tone: "muted", text: "Type /wtfp: in the prompt to see what each action does." } as View] : []),
|
|
2873
2948
|
{
|
|
2874
2949
|
t: "text",
|
|
2875
2950
|
wrap: "wrap",
|
|
@@ -2949,9 +3024,17 @@ async function validateAll(ctx: ExtensionContextV2): Promise<ExtensionOutputV2>
|
|
|
2949
3024
|
...(findings.length > 0
|
|
2950
3025
|
? [
|
|
2951
3026
|
{
|
|
2952
|
-
t: "
|
|
2953
|
-
|
|
2954
|
-
|
|
3027
|
+
t: "list",
|
|
3028
|
+
items: findings.slice(0, 40).map((finding, index) => {
|
|
3029
|
+
const tone: ViewTone = finding.severity === "warning" ? "warning" : finding.severity === "info" ? "muted" : "error";
|
|
3030
|
+
return {
|
|
3031
|
+
key: String(index),
|
|
3032
|
+
mark: tone === "error" ? "✗" : tone === "warning" ? "!" : "·",
|
|
3033
|
+
tone,
|
|
3034
|
+
label: `${finding.severity} ${finding.code} · ${finding.subject.replace(/^project:\/\//u, "")}`,
|
|
3035
|
+
detail: finding.message,
|
|
3036
|
+
};
|
|
3037
|
+
}),
|
|
2955
3038
|
} as View,
|
|
2956
3039
|
]
|
|
2957
3040
|
: []),
|
|
@@ -3033,11 +3116,11 @@ function block(reason: string): ExtensionHookResult {
|
|
|
3033
3116
|
}
|
|
3034
3117
|
|
|
3035
3118
|
/**
|
|
3036
|
-
* What
|
|
3119
|
+
* What PanCode resolve for a tool hook beside its `args`
|
|
3037
3120
|
* (public-api-v2 ExtensionToolHookLanding): where a path-taking tool lands,
|
|
3038
3121
|
* and a dispatch call's tasks as admission parsed them. The desk judges only
|
|
3039
|
-
* these, never its own reading of a call, so it cannot drift from
|
|
3040
|
-
* grammar.
|
|
3122
|
+
* these, never its own reading of a call, so it cannot drift from PanCode's
|
|
3123
|
+
* grammar. When a host sends `args` alone, the desk refuses writes and
|
|
3041
3124
|
* dispatches inside a WTF-P project or action and leaves the rest alone.
|
|
3042
3125
|
*/
|
|
3043
3126
|
interface HostTarget {
|
|
@@ -3067,7 +3150,7 @@ interface HostLanding {
|
|
|
3067
3150
|
dispatch?: HostDispatch;
|
|
3068
3151
|
}
|
|
3069
3152
|
|
|
3070
|
-
/** Roles that only judge a dispatch's work;
|
|
3153
|
+
/** Roles that only judge a dispatch's work; PanCode runs them read-only with no write roots. */
|
|
3071
3154
|
const GATE_ROLES = new Set(["reviewer", "judge", "member", "synthesis"]);
|
|
3072
3155
|
|
|
3073
3156
|
const strings = (value: unknown): value is string[] => Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
@@ -3167,22 +3250,22 @@ async function projectOrArmed(ctx: ExtensionContextV2): Promise<boolean> {
|
|
|
3167
3250
|
}
|
|
3168
3251
|
|
|
3169
3252
|
/** Why a host that sends no landing or dispatch plan cannot be guarded. */
|
|
3170
|
-
const NEEDS_HOST_FACTS = "WTF-P needs
|
|
3253
|
+
const NEEDS_HOST_FACTS = "WTF-P needs PanCode 0.9.0 or later, which tells the desk where each call lands and what each dispatch starts; this PanCode does not, so the desk refuses the call inside a WTF-P project or action.";
|
|
3171
3254
|
|
|
3172
|
-
/** Why a call
|
|
3255
|
+
/** Why a call PanCode sent no usable facts for is refused, once this PanCode has shown it sends them. */
|
|
3173
3256
|
async function missingFacts(ctx: ExtensionContextV2, malformed: string | undefined): Promise<string> {
|
|
3174
|
-
if (malformed) return `
|
|
3175
|
-
return (await ctx.state.get<boolean>("host-facts")).value ? "
|
|
3257
|
+
if (malformed) return `PanCode's ${malformed} for this call is in a form the desk cannot read; refused.`;
|
|
3258
|
+
return (await ctx.state.get<boolean>("host-facts")).value ? "PanCode sent no landing for this call, so the desk cannot see where it lands; refused." : NEEDS_HOST_FACTS;
|
|
3176
3259
|
}
|
|
3177
3260
|
|
|
3178
3261
|
/**
|
|
3179
|
-
* Where a write lands, relative to the project, or null outside it, as
|
|
3180
|
-
* resolved it: the file the tool opens, which
|
|
3262
|
+
* Where a write lands, relative to the project, or null outside it, as PanCode
|
|
3263
|
+
* resolved it: the file the tool opens, which PanCode refuses to change before
|
|
3181
3264
|
* the tool runs, and for a worker in a task worktree the checkout path it
|
|
3182
3265
|
* merges into.
|
|
3183
3266
|
*/
|
|
3184
3267
|
function writeLanding(target: string, workspace: string, host: HostTarget): { relative: string | null } | { refused: string } {
|
|
3185
|
-
if (!host.resolved) return { refused: `WTF-P write guard:
|
|
3268
|
+
if (!host.resolved) return { refused: `WTF-P write guard: PanCode could not resolve where ${target} lands (a link loop, or a component it cannot inspect); refused.` };
|
|
3186
3269
|
if (host.workspacePath !== undefined) return { relative: host.workspacePath };
|
|
3187
3270
|
const root = realWorkspace(workspace);
|
|
3188
3271
|
return { relative: inside(root, host.path) ? posix(path.relative(root, host.path)) || "." : null };
|
|
@@ -3203,8 +3286,8 @@ async function guardWrite(ctx: ExtensionContextV2, target: string, host?: HostTa
|
|
|
3203
3286
|
);
|
|
3204
3287
|
const desk = loadDesk(workspace, await storedKey(ctx, false));
|
|
3205
3288
|
const armed = await armedFor(ctx);
|
|
3206
|
-
//
|
|
3207
|
-
if (armed && !under(".
|
|
3289
|
+
// PanCode's own artifact directory is no project file; a link that leads it into the project lands, and is judged, elsewhere.
|
|
3290
|
+
if (armed && !under(".pancode/artifacts", relative)) {
|
|
3208
3291
|
const roots = writeRoots(desk, armed);
|
|
3209
3292
|
if (!roots.some((allowed) => under(allowed, relative)))
|
|
3210
3293
|
return block(
|
|
@@ -3255,13 +3338,13 @@ function narrow(requested: string[], allowed: string[]): string[] {
|
|
|
3255
3338
|
|
|
3256
3339
|
const WTFP_AGENT = /^wtfp-[a-z-]+$/u;
|
|
3257
3340
|
|
|
3258
|
-
/** One worker a dispatch names, as
|
|
3341
|
+
/** One worker a dispatch names, as PanCode parsed it. */
|
|
3259
3342
|
interface DispatchTask {
|
|
3260
|
-
/** The agent
|
|
3343
|
+
/** The agent PanCode resolved, `auto` and an omitted agent included. */
|
|
3261
3344
|
agent: string;
|
|
3262
3345
|
/** Project-relative write roots, or null when the worker would have no boundary. */
|
|
3263
3346
|
roots: string[] | null;
|
|
3264
|
-
/** True when
|
|
3347
|
+
/** True when PanCode runs the worker read-only, as it does every read-only recipe's; it then has no write roots. */
|
|
3265
3348
|
readOnly: boolean;
|
|
3266
3349
|
}
|
|
3267
3350
|
|
|
@@ -3275,13 +3358,13 @@ function plainSpelling(root: string): string {
|
|
|
3275
3358
|
}
|
|
3276
3359
|
|
|
3277
3360
|
/**
|
|
3278
|
-
* The workers a dispatch starts, from the plan
|
|
3361
|
+
* The workers a dispatch starts, from the plan PanCode parsed. Gate roles only
|
|
3279
3362
|
* judge, so they are left out. Every worker runs from the project root, no
|
|
3280
3363
|
* writer works in a task worktree whose merge the desk would not see, and a
|
|
3281
|
-
* write root must land where it reads:
|
|
3364
|
+
* write root must land where it reads: PanCode fixes a boundary at the root's
|
|
3282
3365
|
* physical location, so a root through a link would let a worker write
|
|
3283
3366
|
* wherever the link points. A root that lands on the whole project is no
|
|
3284
|
-
* boundary. Throws for any of these.
|
|
3367
|
+
* boundary. Throws for any of these. PanCode judges a rewritten call again, so
|
|
3285
3368
|
* the roots the desk itself hands a worker are checked the same way.
|
|
3286
3369
|
*/
|
|
3287
3370
|
function planTasks(plan: Extract<HostDispatch, { kind: "tasks" }>, workspace: string, present: boolean): DispatchTask[] {
|
|
@@ -3311,13 +3394,13 @@ function planTasks(plan: Extract<HostDispatch, { kind: "tasks" }>, workspace: st
|
|
|
3311
3394
|
});
|
|
3312
3395
|
}
|
|
3313
3396
|
|
|
3314
|
-
/** The call's arguments without
|
|
3397
|
+
/** The call's arguments without PanCode's private admission keys, which PanCode recomputes for any rewritten call. */
|
|
3315
3398
|
function withoutHostKeys(args: Json): Json {
|
|
3316
|
-
return Object.fromEntries(Object.entries(args).filter(([key]) => !key.startsWith("
|
|
3399
|
+
return Object.fromEntries(Object.entries(args).filter(([key]) => !key.startsWith("__pancode_")));
|
|
3317
3400
|
}
|
|
3318
3401
|
|
|
3319
3402
|
/**
|
|
3320
|
-
* The call with each named worker held to its roots, in the shape
|
|
3403
|
+
* The call with each named worker held to its roots, in the shape PanCode
|
|
3321
3404
|
* prepares for hooks: `tasks` an array of task objects or task strings, one
|
|
3322
3405
|
* per named worker, whose own intent overrides the shared one.
|
|
3323
3406
|
*/
|
|
@@ -3339,8 +3422,8 @@ const sameRoots = (left: string[] | null, right: string[] | null): boolean =>
|
|
|
3339
3422
|
|
|
3340
3423
|
async function guardDispatch(ctx: ExtensionContextV2, args: Json, host?: HostDispatch, malformed?: string): Promise<ExtensionHookResult> {
|
|
3341
3424
|
if (args.list === true || host?.kind === "list") return {};
|
|
3342
|
-
//
|
|
3343
|
-
if (!host && typeof args.
|
|
3425
|
+
// PanCode could not prepare this call and refuses it itself, with its own reason; nothing of it runs.
|
|
3426
|
+
if (!host && typeof args.__pancode_dispatch_plan_preparation_error === "string") return {};
|
|
3344
3427
|
if (!host) return (await projectOrArmed(ctx)) ? block(`WTF-P dispatch guard: ${await missingFacts(ctx, malformed)}`) : {};
|
|
3345
3428
|
const workspace = ctx.snapshot.workspace;
|
|
3346
3429
|
const served = ctx.snapshot.plugin ?? null;
|
|
@@ -3379,7 +3462,7 @@ async function guardDispatch(ctx: ExtensionContextV2, args: Json, host?: HostDis
|
|
|
3379
3462
|
return {};
|
|
3380
3463
|
}
|
|
3381
3464
|
const name = actionName(served, armed.action);
|
|
3382
|
-
// Inside an action that delegates, a writing worker is one of its roles; a call without agent falls to
|
|
3465
|
+
// Inside an action that delegates, a writing worker is one of its roles; a call without agent falls to PanCode's default worker.
|
|
3383
3466
|
const agents = GUARD.actions[armed.action]?.agents ?? [];
|
|
3384
3467
|
const stranger = agents.length > 0 ? entries.find((entry) => !entry.readOnly && !agents.includes(entry.agent)) : undefined;
|
|
3385
3468
|
if (stranger)
|
|
@@ -3414,7 +3497,7 @@ async function guardDispatch(ctx: ExtensionContextV2, args: Json, host?: HostDis
|
|
|
3414
3497
|
: `WTF-P dispatch guard: ${entry.agent} would have no manuscript it may write. ${notes.length > 0 ? notes.join(" · ") : "Name the section and approve its plan first."}`,
|
|
3415
3498
|
);
|
|
3416
3499
|
if (roots.length > 0) return roots;
|
|
3417
|
-
//
|
|
3500
|
+
// PanCode reads an empty write_roots as no boundary at all, so an empty list is refused, never sent.
|
|
3418
3501
|
if (entry.roots !== null && allowed.length > 0)
|
|
3419
3502
|
throw new Error(`WTF-P dispatch guard: ${entry.roots.join(", ")} lie outside what ${armed.action} may write (${allowed.join(", ")}).`);
|
|
3420
3503
|
throw new Error(
|
|
@@ -3431,7 +3514,7 @@ async function guardDispatch(ctx: ExtensionContextV2, args: Json, host?: HostDis
|
|
|
3431
3514
|
// A worker whose roots already are its confinement, in any order, needs no rewrite.
|
|
3432
3515
|
const needed = narrowed.map((roots, index) => (roots === null || sameRoots(roots, entries[index]?.roots ?? null) ? null : roots));
|
|
3433
3516
|
if (needed.every((roots) => roots === null)) return {};
|
|
3434
|
-
//
|
|
3517
|
+
// PanCode admits a rewritten call afresh, without the operator's approval of the original, so a call
|
|
3435
3518
|
// that needs approval (more than one worker, a review loop, compete) is refused with the exact roots instead.
|
|
3436
3519
|
if (host.tasks.length > 1)
|
|
3437
3520
|
return block(
|
|
@@ -3439,13 +3522,13 @@ async function guardDispatch(ctx: ExtensionContextV2, args: Json, host?: HostDis
|
|
|
3439
3522
|
.map((entry, index) => `task ${index + 1} (${entry.agent}): ${(narrowed[index] ?? []).join(", ") || "none, it only reads"}`)
|
|
3440
3523
|
.join("; ")}.`,
|
|
3441
3524
|
);
|
|
3442
|
-
//
|
|
3525
|
+
// PanCode admits an extension's rewrite only as a narrowing. A declared intent without write roots is an empty
|
|
3443
3526
|
// write ceiling there, although the worker itself treats it as no boundary, so the desk cannot fill the roots in.
|
|
3444
3527
|
const declaresEmpty = (item: unknown): boolean =>
|
|
3445
3528
|
isObject(item) && isObject(item.intent) && (!Array.isArray(item.intent.write_roots) || item.intent.write_roots.length === 0);
|
|
3446
3529
|
if (declaresEmpty(args) || (Array.isArray(args.tasks) && args.tasks.some(declaresEmpty)))
|
|
3447
3530
|
return block(
|
|
3448
|
-
`WTF-P dispatch guard: an intent without write_roots bounds nothing for the worker, and
|
|
3531
|
+
`WTF-P dispatch guard: an intent without write_roots bounds nothing for the worker, and PanCode will not let the desk fill them in. Send ${entries
|
|
3449
3532
|
.map((entry, index) => `${entries.length > 1 ? `task ${index + 1} (${entry.agent}) ` : ""}intent.write_roots ${(needed[index] ?? []).join(", ") || "omitted, since it only reads"}`)
|
|
3450
3533
|
.join("; ")} in that intent.`,
|
|
3451
3534
|
);
|
|
@@ -3466,7 +3549,7 @@ const BASH_DESK_PATHS = /\.planning\/(?:interactions\b|\.wtfp-)/u;
|
|
|
3466
3549
|
const COMMAND_TOOLS = new Set(["bash", "run_script", "job"]);
|
|
3467
3550
|
|
|
3468
3551
|
/**
|
|
3469
|
-
* Inside a WTF-P action every question is the author's.
|
|
3552
|
+
* Inside a WTF-P action every question is the author's. PanCode answers an
|
|
3470
3553
|
* unanswered `ask_user` round with its recommended option after
|
|
3471
3554
|
* `safety.unattendedAfterSeconds`, unless the question is `operator_only`, so
|
|
3472
3555
|
* the desk marks a lone question that way and refuses a round that would need
|
|
@@ -3478,13 +3561,13 @@ async function guardQuestions(ctx: ExtensionContextV2, input: Json): Promise<Ext
|
|
|
3478
3561
|
if (questions.length === 0 || questions.every((question) => (question as Json | null)?.operator_only === true)) return {};
|
|
3479
3562
|
if (!(await armedFor(ctx))) return {};
|
|
3480
3563
|
if (questions.length > 1)
|
|
3481
|
-
return block("WTF-P: inside a WTF-P action each question is the author's to answer. Ask them one call at a time, each with operator_only: true and its own options, so
|
|
3564
|
+
return block("WTF-P: inside a WTF-P action each question is the author's to answer. Ask them one call at a time, each with operator_only: true and its own options, so PanCode never answers one for an absent author.");
|
|
3482
3565
|
return {
|
|
3483
3566
|
effects: [
|
|
3484
3567
|
{
|
|
3485
3568
|
kind: "rewrite_tool_input",
|
|
3486
3569
|
args: { ...input, questions: [{ ...(questions[0] as Json), operator_only: true }] },
|
|
3487
|
-
reason: "WTF-P asks the author, and only the author may answer:
|
|
3570
|
+
reason: "WTF-P asks the author, and only the author may answer: PanCode never takes a recommended option for this question.",
|
|
3488
3571
|
},
|
|
3489
3572
|
],
|
|
3490
3573
|
};
|
|
@@ -3501,7 +3584,7 @@ async function guard(ctx: ExtensionContextV2, tool: string, args: unknown, event
|
|
|
3501
3584
|
let result: ExtensionHookResult = {};
|
|
3502
3585
|
try {
|
|
3503
3586
|
const host = hostLanding(event);
|
|
3504
|
-
// A host that sends facts once sends them for every call it can resolve, so a later call without them failed in
|
|
3587
|
+
// A host that sends facts once sends them for every call it can resolve, so a later call without them failed in PanCode.
|
|
3505
3588
|
if ((host.target || host.dispatch) && !(await ctx.state.get<boolean>("host-facts")).value) await ctx.state.set("host-facts", true);
|
|
3506
3589
|
if (tool === "dispatch") result = await guardDispatch(ctx, input, host.dispatch, host.malformed);
|
|
3507
3590
|
else if (tool === "ask_user") result = await guardQuestions(ctx, input);
|
|
@@ -3509,7 +3592,7 @@ async function guard(ctx: ExtensionContextV2, tool: string, args: unknown, event
|
|
|
3509
3592
|
if (BASH_DESK_PATHS.test(JSON.stringify(input))) result = block("WTF-P write guard: commands may not touch the desk's own records under .planning.");
|
|
3510
3593
|
} else {
|
|
3511
3594
|
const raw = input.path ?? input.file_path ?? input.filePath;
|
|
3512
|
-
// The artifact tool trims its path; without one it writes under
|
|
3595
|
+
// The artifact tool trims its path; without one it writes under PanCode's own artifact directory, where PanCode's landing still says it lands.
|
|
3513
3596
|
const target = typeof raw === "string" ? (tool === "artifact" ? raw.trim() : raw) : "";
|
|
3514
3597
|
if (target.length > 0 || host.target) result = await guardWrite(ctx, target || "the artifact", host.target, host.malformed);
|
|
3515
3598
|
}
|
|
@@ -3524,7 +3607,7 @@ async function guard(ctx: ExtensionContextV2, tool: string, args: unknown, event
|
|
|
3524
3607
|
* action may measure: its recorded word count is stale until measure_section
|
|
3525
3608
|
* runs. It rides on the tool result, so it spends none of the turn's shared
|
|
3526
3609
|
* continuation budget, and it reaches a dispatched worker too, whose writes
|
|
3527
|
-
*
|
|
3610
|
+
* PanCode hooks, so it says whose call the measurement is. Each section is noted
|
|
3528
3611
|
* once until it is measured again.
|
|
3529
3612
|
*/
|
|
3530
3613
|
async function noteManuscriptWrite(ctx: ExtensionContextV2, event: unknown): Promise<ExtensionHookResult> {
|
|
@@ -3760,7 +3843,7 @@ export default function extension(api: ExtensionApiV2): void {
|
|
|
3760
3843
|
...(await picture(ctx)),
|
|
3761
3844
|
};
|
|
3762
3845
|
const kept = (await ctx.state.get<string[]>("gate-kept")).value ?? [];
|
|
3763
|
-
const recorded = (await ctx.state.get<string
|
|
3846
|
+
const recorded = (await ctx.state.get<Array<{ text: string; author: string }>>("gate-recorded")).value ?? [];
|
|
3764
3847
|
let note = "";
|
|
3765
3848
|
try {
|
|
3766
3849
|
const typed = await freeText(ctx, event);
|
|
@@ -3771,7 +3854,7 @@ export default function extension(api: ExtensionApiV2): void {
|
|
|
3771
3854
|
if (current && remaining.includes(current)) return { step: await ask(ctx, desk, current, FREE_TEXT), total: remaining.length + recorded.length + kept.length };
|
|
3772
3855
|
}
|
|
3773
3856
|
const result = typed ?? (await answer(ctx, event.step, choiceOf(event.answers), noteOf(event)));
|
|
3774
|
-
if (result.kind === "recorded") recorded.push(result.text);
|
|
3857
|
+
if (result.kind === "recorded") recorded.push({ text: result.text, author: result.author ?? result.text });
|
|
3775
3858
|
else if (result.kind === "kept" && result.checkpoint) kept.push(result.checkpoint);
|
|
3776
3859
|
else if (result.kind === "refused") {
|
|
3777
3860
|
note = result.text;
|
|
@@ -3787,11 +3870,12 @@ export default function extension(api: ExtensionApiV2): void {
|
|
|
3787
3870
|
const next = remaining[0];
|
|
3788
3871
|
if (next && !note.startsWith("Nothing was recorded")) return { step: await ask(ctx, desk, next), total: remaining.length + recorded.length + kept.length };
|
|
3789
3872
|
await ctx.state.set("gate-recorded", []);
|
|
3790
|
-
const summary =
|
|
3873
|
+
const summary = (pick: "text" | "author"): string =>
|
|
3874
|
+
[recorded.length > 0 ? `Recorded: ${recorded.map((entry) => entry[pick]).join("; ")}.` : "Nothing recorded.", note].filter(Boolean).join(" ");
|
|
3791
3875
|
return {
|
|
3792
3876
|
done: true,
|
|
3793
|
-
text: summary,
|
|
3794
|
-
card: { t: "text", text: `${recorded.length > 0 ? "✓" : "·"} ${summary}`, tone: recorded.length > 0 ? "positive" : "muted", wrap: "wrap" },
|
|
3877
|
+
text: summary("text"),
|
|
3878
|
+
card: { t: "text", text: `${recorded.length > 0 ? "✓" : "·"} ${summary("author")}`, tone: recorded.length > 0 ? "positive" : "muted", wrap: "wrap" },
|
|
3795
3879
|
...(await picture(ctx, desk)),
|
|
3796
3880
|
};
|
|
3797
3881
|
});
|
|
@@ -3851,7 +3935,7 @@ export default function extension(api: ExtensionApiV2): void {
|
|
|
3851
3935
|
});
|
|
3852
3936
|
|
|
3853
3937
|
api.hook("prompt_submit", async (event, ctx) => {
|
|
3854
|
-
//
|
|
3938
|
+
// PanCode continuing a stopped yolo turn (tool budget, loop guard, a failure) resumes that turn's drive and armed step.
|
|
3855
3939
|
const held = (await ctx.state.get<{ armed?: Armed; drive?: Drive; workspace: string }>("held")).value;
|
|
3856
3940
|
await ctx.state.delete("held");
|
|
3857
3941
|
if (event.point === "prompt_submit" && (event as { origin?: string }).origin === "continuation") {
|
|
@@ -3890,7 +3974,9 @@ export default function extension(api: ExtensionApiV2): void {
|
|
|
3890
3974
|
{
|
|
3891
3975
|
kind: "notify_operator",
|
|
3892
3976
|
key: "wtfp-guard",
|
|
3893
|
-
message: `WTF-P write guard armed for ${actionName(ctx.snapshot.plugin ?? null, armed.action)}${armed.section ? ` ${armed.section}` : ""}:
|
|
3977
|
+
message: `WTF-P write guard armed for ${actionName(ctx.snapshot.plugin ?? null, armed.action)}${armed.section ? ` ${armed.section}` : ""}: ${
|
|
3978
|
+
roots.length > 0 ? `files stay under ${roots.join(", ")}` : "it writes no files"
|
|
3979
|
+
}, and records only the ones its contract declares.`,
|
|
3894
3980
|
},
|
|
3895
3981
|
],
|
|
3896
3982
|
};
|
|
@@ -3916,7 +4002,7 @@ export default function extension(api: ExtensionApiV2): void {
|
|
|
3916
4002
|
return { text: recovered ?? "", ...(recovered ? { toast: { text: recovered, tone: "warning" as const } } : {}), ...(await picture(ctx)) };
|
|
3917
4003
|
});
|
|
3918
4004
|
api.on("turn_end", async (_event, ctx) => {
|
|
3919
|
-
// An action arms for the turn its command starts; nothing it allowed outlives that turn.
|
|
4005
|
+
// An action arms for the turn its command starts; nothing it allowed outlives that turn. PanCode's own
|
|
3920
4006
|
// continuation of the turn may resume it, so the desk holds what it had until the next prompt says whose it is.
|
|
3921
4007
|
const armed = (await ctx.state.get<Armed>("armed")).value;
|
|
3922
4008
|
const drive = (await ctx.state.get<Drive>("drive")).value;
|