wtf-p 0.7.4 → 0.8.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 +10 -10
- package/bin/commands/install-logic.js +1 -1
- package/bin/lib/adapter-compiler.js +305 -78
- package/bin/lib/clio-registration.js +159 -41
- package/bin/lib/manifest.js +11 -3
- package/bin/uninstall.js +22 -6
- package/package.json +3 -3
- package/protocol/actions/checkpoint.json +10 -1
- package/protocol/actions/execute-outline.json +10 -2
- package/protocol/actions/export-latex.json +15 -2
- package/protocol/actions/plan-revision.json +17 -4
- package/protocol/actions/polish-prose.json +13 -3
- package/protocol/actions/research-gap.json +16 -3
- package/protocol/actions/verify-work.json +7 -2
- package/protocol/project/README.md +37 -0
- package/protocol/project/schemas/interaction.schema.json +100 -0
- package/protocol/project/templates/interaction.json +16 -0
- package/protocol/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/protocol/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/protocol/skills/wtfp-plan-section/SKILL.md +1 -1
- package/protocol/skills/wtfp-plan-section/references/actions.md +4 -3
- package/protocol/skills/wtfp-research-literature/SKILL.md +1 -1
- package/protocol/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/protocol/skills/wtfp-write-section/SKILL.md +1 -1
- package/protocol/skills/wtfp-write-section/references/actions.md +1 -1
- package/protocol/workflows/checkpoint.md +2 -2
- package/protocol/workflows/execute-outline.md +2 -2
- package/protocol/workflows/export-latex.md +4 -4
- package/protocol/workflows/plan-revision.md +4 -3
- package/protocol/workflows/plan-section.md +2 -2
- package/protocol/workflows/polish-prose.md +3 -3
- package/protocol/workflows/research-gap.md +2 -2
- package/protocol/workflows/verify-work.md +3 -3
- package/protocol/workflows/write-section.md +2 -2
- package/vendors/antigravity/.wtfp-generated.json +172 -172
- package/vendors/antigravity/actions/checkpoint.json +10 -1
- package/vendors/antigravity/actions/execute-outline.json +10 -2
- package/vendors/antigravity/actions/export-latex.json +15 -2
- package/vendors/antigravity/actions/plan-revision.json +17 -4
- package/vendors/antigravity/actions/polish-prose.json +13 -3
- package/vendors/antigravity/actions/research-gap.json +16 -3
- package/vendors/antigravity/actions/verify-work.json +7 -2
- package/vendors/antigravity/plugin.json +2 -1
- package/vendors/antigravity/project/README.md +37 -0
- package/vendors/antigravity/project/schemas/interaction.schema.json +100 -0
- package/vendors/antigravity/project/templates/interaction.json +16 -0
- package/vendors/antigravity/rules/wtfp-project-state.md +41 -1
- package/vendors/antigravity/{commands/wtfp-add-todo.md → skills/wtfp-add-todo/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-analyze-bib.md → skills/wtfp-analyze-bib/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-audit-milestone.md → skills/wtfp-audit-milestone/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-check-refs.md → skills/wtfp-check-refs/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-check-todos.md → skills/wtfp-check-todos/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-checkpoint.md → skills/wtfp-checkpoint/SKILL.md} +4 -3
- package/vendors/antigravity/{commands/wtfp-contribute.md → skills/wtfp-contribute/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-create-outline.md → skills/wtfp-create-outline/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-create-poster.md → skills/wtfp-create-poster/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-create-slides.md → skills/wtfp-create-slides/SKILL.md} +2 -1
- package/vendors/antigravity/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/antigravity/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/antigravity/{commands/wtfp-discuss-section.md → skills/wtfp-discuss-section/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-execute-outline.md → skills/wtfp-execute-outline/SKILL.md} +4 -3
- package/vendors/antigravity/{commands/wtfp-export-latex.md → skills/wtfp-export-latex/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-help.md → skills/wtfp-help/SKILL.md} +3 -2
- package/vendors/antigravity/{commands/wtfp-insert-section.md → skills/wtfp-insert-section/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-list-assumptions.md → skills/wtfp-list-assumptions/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-map-project.md → skills/wtfp-map-project/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-new-paper.md → skills/wtfp-new-paper/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-pause-writing.md → skills/wtfp-pause-writing/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-plan-milestone-gaps.md → skills/wtfp-plan-milestone-gaps/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-plan-revision.md → skills/wtfp-plan-revision/SKILL.md} +10 -4
- package/vendors/antigravity/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/antigravity/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/antigravity/{commands/wtfp-polish-prose.md → skills/wtfp-polish-prose/SKILL.md} +9 -4
- package/vendors/antigravity/{commands/wtfp-progress.md → skills/wtfp-progress/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-quick.md → skills/wtfp-quick/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-remove-section.md → skills/wtfp-remove-section/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-report-bug.md → skills/wtfp-report-bug/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-request-feature.md → skills/wtfp-request-feature/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-research-gap.md → skills/wtfp-research-gap/SKILL.md} +2 -1
- package/vendors/antigravity/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/antigravity/{commands/wtfp-resume-writing.md → skills/wtfp-resume-writing/SKILL.md} +2 -1
- package/vendors/antigravity/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/antigravity/{commands/wtfp-review-section.md → skills/wtfp-review-section/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-settings.md → skills/wtfp-settings/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-submit-milestone.md → skills/wtfp-submit-milestone/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-update.md → skills/wtfp-update/SKILL.md} +2 -1
- package/vendors/antigravity/{commands/wtfp-verify-work.md → skills/wtfp-verify-work/SKILL.md} +5 -4
- package/vendors/antigravity/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/antigravity/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/antigravity/workflows/checkpoint.md +2 -2
- package/vendors/antigravity/workflows/execute-outline.md +2 -2
- package/vendors/antigravity/workflows/export-latex.md +4 -4
- package/vendors/antigravity/workflows/plan-revision.md +4 -3
- package/vendors/antigravity/workflows/plan-section.md +2 -2
- package/vendors/antigravity/workflows/polish-prose.md +3 -3
- package/vendors/antigravity/workflows/research-gap.md +2 -2
- package/vendors/antigravity/workflows/verify-work.md +3 -3
- package/vendors/antigravity/workflows/write-section.md +2 -2
- package/vendors/claude/.claude-plugin/marketplace.json +2 -2
- package/vendors/claude/.claude-plugin/plugin.json +1 -1
- package/vendors/claude/.wtfp-generated.json +84 -76
- package/vendors/claude/actions/checkpoint.json +10 -1
- package/vendors/claude/actions/execute-outline.json +10 -2
- package/vendors/claude/actions/export-latex.json +15 -2
- package/vendors/claude/actions/plan-revision.json +17 -4
- package/vendors/claude/actions/polish-prose.json +13 -3
- package/vendors/claude/actions/research-gap.json +16 -3
- package/vendors/claude/actions/verify-work.json +7 -2
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-argument-verifier.md +3 -3
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-coherence-checker.md +3 -3
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-plan-checker.md +3 -3
- package/vendors/claude/ai.iowarp.clio/agents/wtfp-section-reviewer.md +3 -3
- package/vendors/claude/ai.iowarp.clio/fleets/wtfp-draft-review.md +1 -1
- package/vendors/claude/ai.iowarp.clio/fleets/wtfp-plan-section.md +1 -1
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/add-todo.md +8 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/analyze-bib.md +22 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/audit-milestone.md +10 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/check-refs.md +22 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/check-todos.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/checkpoint.md +11 -2
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/create-outline.md +21 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/create-poster.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/create-slides.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/discuss-section.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/execute-outline.md +24 -3
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/export-latex.md +14 -4
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/help.md +1 -1
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/insert-section.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/list-assumptions.md +6 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/map-project.md +8 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/new-paper.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/pause-writing.md +8 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/plan-milestone-gaps.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/plan-revision.md +17 -3
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/plan-section.md +24 -3
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/polish-prose.md +28 -3
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/progress.md +7 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/quick.md +21 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/research-gap.md +25 -2
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/resume-writing.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/review-section.md +19 -1
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/settings.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/submit-milestone.md +9 -0
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/verify-work.md +12 -3
- package/vendors/claude/ai.iowarp.clio/prompts/wtfp/write-section.md +24 -3
- package/vendors/claude/commands/checkpoint.md +2 -2
- package/vendors/claude/commands/execute-outline.md +2 -2
- package/vendors/claude/commands/export-latex.md +4 -4
- package/vendors/claude/commands/plan-revision.md +8 -3
- package/vendors/claude/commands/plan-section.md +2 -2
- package/vendors/claude/commands/polish-prose.md +7 -3
- package/vendors/claude/commands/research-gap.md +2 -2
- package/vendors/claude/commands/verify-work.md +3 -3
- package/vendors/claude/commands/write-section.md +2 -2
- package/vendors/claude/output-styles/wtfp-academic-writing.md +5 -5
- package/vendors/claude/plugin.json +1 -1
- package/vendors/claude/project/README.md +37 -0
- package/vendors/claude/project/schemas/interaction.schema.json +100 -0
- package/vendors/claude/project/templates/interaction.json +16 -0
- package/vendors/claude/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/claude/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/claude/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/claude/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/claude/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/claude/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/claude/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/claude/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/claude/workflows/checkpoint.md +2 -2
- package/vendors/claude/workflows/execute-outline.md +2 -2
- package/vendors/claude/workflows/export-latex.md +4 -4
- package/vendors/claude/workflows/plan-revision.md +4 -3
- package/vendors/claude/workflows/plan-section.md +2 -2
- package/vendors/claude/workflows/polish-prose.md +3 -3
- package/vendors/claude/workflows/research-gap.md +2 -2
- package/vendors/claude/workflows/verify-work.md +3 -3
- package/vendors/claude/workflows/write-section.md +2 -2
- package/vendors/clio-extension/.wtfp-generated.json +240 -0
- package/vendors/clio-extension/actions/add-todo.json +52 -0
- package/vendors/clio-extension/actions/analyze-bib.json +97 -0
- package/vendors/clio-extension/actions/audit-milestone.json +63 -0
- package/vendors/clio-extension/actions/check-refs.json +80 -0
- package/vendors/clio-extension/actions/check-todos.json +52 -0
- package/vendors/clio-extension/actions/checkpoint.json +85 -0
- package/vendors/clio-extension/actions/contribute.json +57 -0
- package/vendors/clio-extension/actions/create-outline.json +84 -0
- package/vendors/clio-extension/actions/create-poster.json +54 -0
- package/vendors/clio-extension/actions/create-slides.json +54 -0
- package/vendors/clio-extension/actions/discuss-section.json +76 -0
- package/vendors/clio-extension/actions/execute-outline.json +124 -0
- package/vendors/clio-extension/actions/export-latex.json +78 -0
- package/vendors/clio-extension/actions/help.json +30 -0
- package/vendors/clio-extension/actions/insert-section.json +61 -0
- package/vendors/clio-extension/actions/list-assumptions.json +35 -0
- package/vendors/clio-extension/actions/map-project.json +71 -0
- package/vendors/clio-extension/actions/new-paper.json +70 -0
- package/vendors/clio-extension/actions/pause-writing.json +71 -0
- package/vendors/clio-extension/actions/plan-milestone-gaps.json +57 -0
- package/vendors/clio-extension/actions/plan-revision.json +71 -0
- package/vendors/clio-extension/actions/plan-section.json +100 -0
- package/vendors/clio-extension/actions/polish-prose.json +79 -0
- package/vendors/clio-extension/actions/progress.json +51 -0
- package/vendors/clio-extension/actions/quick.json +70 -0
- package/vendors/clio-extension/actions/remove-section.json +63 -0
- package/vendors/clio-extension/actions/report-bug.json +47 -0
- package/vendors/clio-extension/actions/request-feature.json +47 -0
- package/vendors/clio-extension/actions/research-gap.json +115 -0
- package/vendors/clio-extension/actions/resume-writing.json +65 -0
- package/vendors/clio-extension/actions/review-section.json +83 -0
- package/vendors/clio-extension/actions/settings.json +47 -0
- package/vendors/clio-extension/actions/submit-milestone.json +77 -0
- package/vendors/clio-extension/actions/update.json +42 -0
- package/vendors/clio-extension/actions/verify-work.json +68 -0
- package/vendors/clio-extension/actions/write-section.json +115 -0
- package/vendors/clio-extension/clio-coder-extension.yaml +76 -0
- package/vendors/clio-extension/compatibility/action-availability.json +295 -0
- package/vendors/clio-extension/project/schemas/checkpoint.schema.json +102 -0
- package/vendors/clio-extension/project/schemas/common.schema.json +33 -0
- package/vendors/clio-extension/project/schemas/config.schema.json +69 -0
- package/vendors/clio-extension/project/schemas/decisions.schema.json +31 -0
- package/vendors/clio-extension/project/schemas/evidence.schema.json +48 -0
- package/vendors/clio-extension/project/schemas/interaction.schema.json +100 -0
- package/vendors/clio-extension/project/schemas/manifest.schema.json +102 -0
- package/vendors/clio-extension/project/schemas/outline.schema.json +67 -0
- package/vendors/clio-extension/project/schemas/section.schema.json +95 -0
- package/vendors/clio-extension/project/schemas/source.schema.json +73 -0
- package/vendors/clio-extension/project/schemas/state.schema.json +58 -0
- package/vendors/clio-extension/project/schemas/validation.schema.json +74 -0
- package/vendors/clio-extension/runtime/claim-coverage.cjs +332 -0
- package/vendors/clio-extension/runtime/desk-trust.cjs +112 -0
- package/vendors/clio-extension/runtime/extension.test.ts +1567 -0
- package/vendors/clio-extension/runtime/extension.ts +3074 -0
- package/vendors/clio-extension/runtime/json-schema.cjs +304 -0
- package/vendors/clio-extension/runtime/package.json +3 -0
- package/vendors/clio-extension/runtime/write-guard.json +566 -0
- package/vendors/clio-extension/skins/wtfp.json +20 -0
- package/vendors/codex/plugins/wtfp/.codex-plugin/plugin.json +1 -1
- package/vendors/codex/plugins/wtfp/.wtfp-generated.json +36 -28
- package/vendors/codex/plugins/wtfp/actions/checkpoint.json +10 -1
- package/vendors/codex/plugins/wtfp/actions/execute-outline.json +10 -2
- package/vendors/codex/plugins/wtfp/actions/export-latex.json +15 -2
- package/vendors/codex/plugins/wtfp/actions/plan-revision.json +17 -4
- package/vendors/codex/plugins/wtfp/actions/polish-prose.json +13 -3
- package/vendors/codex/plugins/wtfp/actions/research-gap.json +16 -3
- package/vendors/codex/plugins/wtfp/actions/verify-work.json +7 -2
- package/vendors/codex/plugins/wtfp/plugin.json +1 -1
- package/vendors/codex/plugins/wtfp/project/README.md +37 -0
- package/vendors/codex/plugins/wtfp/project/schemas/interaction.schema.json +100 -0
- package/vendors/codex/plugins/wtfp/project/templates/interaction.json +16 -0
- package/vendors/codex/plugins/wtfp/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/codex/plugins/wtfp/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/codex/plugins/wtfp/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/codex/plugins/wtfp/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/codex/plugins/wtfp/workflows/checkpoint.md +2 -2
- package/vendors/codex/plugins/wtfp/workflows/execute-outline.md +2 -2
- package/vendors/codex/plugins/wtfp/workflows/export-latex.md +4 -4
- package/vendors/codex/plugins/wtfp/workflows/plan-revision.md +4 -3
- package/vendors/codex/plugins/wtfp/workflows/plan-section.md +2 -2
- package/vendors/codex/plugins/wtfp/workflows/polish-prose.md +3 -3
- package/vendors/codex/plugins/wtfp/workflows/research-gap.md +2 -2
- package/vendors/codex/plugins/wtfp/workflows/verify-work.md +3 -3
- package/vendors/codex/plugins/wtfp/workflows/write-section.md +2 -2
- package/vendors/copilot/.wtfp-generated.json +43 -35
- 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 +42 -34
- package/vendors/copilot/plugins/wtfp/actions/checkpoint.json +10 -1
- package/vendors/copilot/plugins/wtfp/actions/execute-outline.json +10 -2
- package/vendors/copilot/plugins/wtfp/actions/export-latex.json +15 -2
- package/vendors/copilot/plugins/wtfp/actions/plan-revision.json +17 -4
- package/vendors/copilot/plugins/wtfp/actions/polish-prose.json +13 -3
- package/vendors/copilot/plugins/wtfp/actions/research-gap.json +16 -3
- package/vendors/copilot/plugins/wtfp/actions/verify-work.json +7 -2
- package/vendors/copilot/plugins/wtfp/commands/wtfp-checkpoint.md +2 -2
- package/vendors/copilot/plugins/wtfp/commands/wtfp-execute-outline.md +2 -2
- package/vendors/copilot/plugins/wtfp/commands/wtfp-plan-revision.md +8 -3
- package/vendors/copilot/plugins/wtfp/commands/wtfp-plan-section.md +2 -2
- package/vendors/copilot/plugins/wtfp/commands/wtfp-polish-prose.md +7 -3
- package/vendors/copilot/plugins/wtfp/commands/wtfp-verify-work.md +3 -3
- package/vendors/copilot/plugins/wtfp/commands/wtfp-write-section.md +2 -2
- package/vendors/copilot/plugins/wtfp/project/README.md +37 -0
- package/vendors/copilot/plugins/wtfp/project/schemas/interaction.schema.json +100 -0
- package/vendors/copilot/plugins/wtfp/project/templates/interaction.json +16 -0
- package/vendors/copilot/plugins/wtfp/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/copilot/plugins/wtfp/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/copilot/plugins/wtfp/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/copilot/plugins/wtfp/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/copilot/plugins/wtfp/workflows/checkpoint.md +2 -2
- package/vendors/copilot/plugins/wtfp/workflows/execute-outline.md +2 -2
- package/vendors/copilot/plugins/wtfp/workflows/export-latex.md +4 -4
- package/vendors/copilot/plugins/wtfp/workflows/plan-revision.md +4 -3
- package/vendors/copilot/plugins/wtfp/workflows/plan-section.md +2 -2
- package/vendors/copilot/plugins/wtfp/workflows/polish-prose.md +3 -3
- package/vendors/copilot/plugins/wtfp/workflows/research-gap.md +2 -2
- package/vendors/copilot/plugins/wtfp/workflows/verify-work.md +3 -3
- package/vendors/copilot/plugins/wtfp/workflows/write-section.md +2 -2
- package/vendors/copilot/project/.github/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/copilot/project/.github/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/copilot/project/.github/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/copilot/project/.github/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/copilot/project/.github/wtfp/actions/checkpoint.json +10 -1
- package/vendors/copilot/project/.github/wtfp/actions/execute-outline.json +10 -2
- package/vendors/copilot/project/.github/wtfp/actions/export-latex.json +15 -2
- package/vendors/copilot/project/.github/wtfp/actions/plan-revision.json +17 -4
- package/vendors/copilot/project/.github/wtfp/actions/polish-prose.json +13 -3
- package/vendors/copilot/project/.github/wtfp/actions/research-gap.json +16 -3
- package/vendors/copilot/project/.github/wtfp/actions/verify-work.json +7 -2
- package/vendors/copilot/project/.github/wtfp/project/README.md +37 -0
- package/vendors/copilot/project/.github/wtfp/project/schemas/interaction.schema.json +100 -0
- package/vendors/copilot/project/.github/wtfp/project/templates/interaction.json +16 -0
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/copilot/project/.github/wtfp/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/copilot/project/.github/wtfp/workflows/checkpoint.md +2 -2
- package/vendors/copilot/project/.github/wtfp/workflows/execute-outline.md +2 -2
- package/vendors/copilot/project/.github/wtfp/workflows/export-latex.md +4 -4
- package/vendors/copilot/project/.github/wtfp/workflows/plan-revision.md +4 -3
- package/vendors/copilot/project/.github/wtfp/workflows/plan-section.md +2 -2
- package/vendors/copilot/project/.github/wtfp/workflows/polish-prose.md +3 -3
- package/vendors/copilot/project/.github/wtfp/workflows/research-gap.md +2 -2
- package/vendors/copilot/project/.github/wtfp/workflows/verify-work.md +3 -3
- package/vendors/copilot/project/.github/wtfp/workflows/write-section.md +2 -2
- package/vendors/gemini/.wtfp-generated.json +61 -53
- package/vendors/gemini/actions/checkpoint.json +10 -1
- package/vendors/gemini/actions/execute-outline.json +10 -2
- package/vendors/gemini/actions/export-latex.json +15 -2
- package/vendors/gemini/actions/plan-revision.json +17 -4
- package/vendors/gemini/actions/polish-prose.json +13 -3
- package/vendors/gemini/actions/research-gap.json +16 -3
- package/vendors/gemini/actions/verify-work.json +7 -2
- package/vendors/gemini/commands/wtfp/add-todo.toml +37 -0
- package/vendors/gemini/commands/wtfp/check-todos.toml +37 -0
- package/vendors/gemini/commands/wtfp/checkpoint.toml +49 -3
- package/vendors/gemini/commands/wtfp/create-outline.toml +37 -0
- package/vendors/gemini/commands/wtfp/create-poster.toml +40 -3
- package/vendors/gemini/commands/wtfp/create-slides.toml +40 -3
- package/vendors/gemini/commands/wtfp/discuss-section.toml +42 -4
- package/vendors/gemini/commands/wtfp/execute-outline.toml +51 -6
- package/vendors/gemini/commands/wtfp/help.toml +37 -0
- package/vendors/gemini/commands/wtfp/insert-section.toml +42 -4
- package/vendors/gemini/commands/wtfp/list-assumptions.toml +42 -4
- package/vendors/gemini/commands/wtfp/map-project.toml +37 -0
- package/vendors/gemini/commands/wtfp/new-paper.toml +37 -0
- package/vendors/gemini/commands/wtfp/pause-writing.toml +37 -0
- package/vendors/gemini/commands/wtfp/plan-milestone-gaps.toml +38 -1
- package/vendors/gemini/commands/wtfp/plan-revision.toml +310 -11
- package/vendors/gemini/commands/wtfp/plan-section.toml +44 -6
- package/vendors/gemini/commands/wtfp/polish-prose.toml +281 -7
- package/vendors/gemini/commands/wtfp/progress.toml +37 -0
- package/vendors/gemini/commands/wtfp/quick.toml +39 -2
- package/vendors/gemini/commands/wtfp/resume-writing.toml +37 -0
- package/vendors/gemini/commands/wtfp/review-section.toml +38 -1
- package/vendors/gemini/commands/wtfp/settings.toml +37 -0
- package/vendors/gemini/commands/wtfp/submit-milestone.toml +40 -3
- package/vendors/gemini/commands/wtfp/verify-work.toml +48 -6
- package/vendors/gemini/commands/wtfp/write-section.toml +41 -4
- package/vendors/gemini/gemini-extension.json +1 -1
- package/vendors/gemini/project/README.md +37 -0
- package/vendors/gemini/project/schemas/interaction.schema.json +100 -0
- package/vendors/gemini/project/templates/interaction.json +16 -0
- package/vendors/gemini/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/gemini/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/gemini/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/gemini/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/gemini/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/gemini/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/gemini/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/gemini/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/gemini/workflows/checkpoint.md +2 -2
- package/vendors/gemini/workflows/execute-outline.md +2 -2
- package/vendors/gemini/workflows/export-latex.md +4 -4
- package/vendors/gemini/workflows/plan-revision.md +4 -3
- package/vendors/gemini/workflows/plan-section.md +2 -2
- package/vendors/gemini/workflows/polish-prose.md +3 -3
- package/vendors/gemini/workflows/research-gap.md +2 -2
- package/vendors/gemini/workflows/verify-work.md +3 -3
- package/vendors/gemini/workflows/write-section.md +2 -2
- package/vendors/opencode/.wtfp-generated.json +60 -52
- package/vendors/opencode/actions/checkpoint.json +10 -1
- package/vendors/opencode/actions/execute-outline.json +10 -2
- package/vendors/opencode/actions/export-latex.json +15 -2
- package/vendors/opencode/actions/plan-revision.json +17 -4
- package/vendors/opencode/actions/polish-prose.json +13 -3
- package/vendors/opencode/actions/research-gap.json +16 -3
- package/vendors/opencode/actions/verify-work.json +7 -2
- package/vendors/opencode/commands/wtfp/add-todo.md +37 -0
- package/vendors/opencode/commands/wtfp/check-todos.md +37 -0
- package/vendors/opencode/commands/wtfp/checkpoint.md +49 -3
- package/vendors/opencode/commands/wtfp/create-outline.md +37 -0
- package/vendors/opencode/commands/wtfp/create-poster.md +40 -3
- package/vendors/opencode/commands/wtfp/create-slides.md +40 -3
- package/vendors/opencode/commands/wtfp/discuss-section.md +42 -4
- package/vendors/opencode/commands/wtfp/execute-outline.md +51 -6
- package/vendors/opencode/commands/wtfp/help.md +37 -0
- package/vendors/opencode/commands/wtfp/insert-section.md +42 -4
- package/vendors/opencode/commands/wtfp/list-assumptions.md +42 -4
- package/vendors/opencode/commands/wtfp/map-project.md +37 -0
- package/vendors/opencode/commands/wtfp/new-paper.md +37 -0
- package/vendors/opencode/commands/wtfp/pause-writing.md +37 -0
- package/vendors/opencode/commands/wtfp/plan-milestone-gaps.md +38 -1
- package/vendors/opencode/commands/wtfp/plan-revision.md +310 -11
- package/vendors/opencode/commands/wtfp/plan-section.md +44 -6
- package/vendors/opencode/commands/wtfp/polish-prose.md +281 -7
- package/vendors/opencode/commands/wtfp/progress.md +37 -0
- package/vendors/opencode/commands/wtfp/quick.md +39 -2
- package/vendors/opencode/commands/wtfp/resume-writing.md +37 -0
- package/vendors/opencode/commands/wtfp/review-section.md +38 -1
- package/vendors/opencode/commands/wtfp/settings.md +37 -0
- package/vendors/opencode/commands/wtfp/submit-milestone.md +40 -3
- package/vendors/opencode/commands/wtfp/verify-work.md +48 -6
- package/vendors/opencode/commands/wtfp/write-section.md +41 -4
- package/vendors/opencode/project/README.md +37 -0
- package/vendors/opencode/project/schemas/interaction.schema.json +100 -0
- package/vendors/opencode/project/templates/interaction.json +16 -0
- package/vendors/opencode/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/opencode/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/opencode/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/opencode/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/opencode/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/opencode/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/opencode/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/opencode/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/opencode/workflows/checkpoint.md +2 -2
- package/vendors/opencode/workflows/execute-outline.md +2 -2
- package/vendors/opencode/workflows/export-latex.md +4 -4
- package/vendors/opencode/workflows/plan-revision.md +4 -3
- package/vendors/opencode/workflows/plan-section.md +2 -2
- package/vendors/opencode/workflows/polish-prose.md +3 -3
- package/vendors/opencode/workflows/research-gap.md +2 -2
- package/vendors/opencode/workflows/verify-work.md +3 -3
- package/vendors/opencode/workflows/write-section.md +2 -2
- package/vendors/plugin/.wtfp-generated.json +75 -67
- package/vendors/plugin/actions/checkpoint.json +10 -1
- package/vendors/plugin/actions/execute-outline.json +10 -2
- package/vendors/plugin/actions/export-latex.json +15 -2
- package/vendors/plugin/actions/plan-revision.json +17 -4
- package/vendors/plugin/actions/polish-prose.json +13 -3
- package/vendors/plugin/actions/research-gap.json +16 -3
- package/vendors/plugin/actions/verify-work.json +7 -2
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-argument-verifier.md +3 -3
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-coherence-checker.md +3 -3
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-plan-checker.md +3 -3
- package/vendors/plugin/ai.iowarp.clio/agents/wtfp-section-reviewer.md +3 -3
- package/vendors/plugin/ai.iowarp.clio/{fleets → playbooks}/wtfp-draft-review.md +1 -1
- package/vendors/plugin/ai.iowarp.clio/{fleets → playbooks}/wtfp-plan-section.md +1 -1
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/add-todo.md +19 -12
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/analyze-bib.md +34 -19
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/audit-milestone.md +22 -25
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/check-refs.md +34 -15
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/check-todos.md +23 -13
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/checkpoint.md +23 -29
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/create-outline.md +33 -25
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/create-poster.md +9 -0
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/create-slides.md +9 -0
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/discuss-section.md +21 -17
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/execute-outline.md +38 -30
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/export-latex.md +26 -21
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/help.md +2 -2
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/insert-section.md +21 -13
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/list-assumptions.md +6 -0
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/map-project.md +19 -14
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/new-paper.md +21 -17
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/pause-writing.md +19 -18
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-milestone-gaps.md +21 -15
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-revision.md +25 -18
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/plan-section.md +36 -30
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/polish-prose.md +38 -18
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/progress.md +7 -0
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/quick.md +35 -15
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/research-gap.md +37 -23
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/resume-writing.md +21 -23
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/review-section.md +31 -20
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/settings.md +21 -9
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/submit-milestone.md +21 -25
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/verify-work.md +24 -18
- package/vendors/plugin/ai.iowarp.clio/prompts/wtfp/write-section.md +38 -31
- package/vendors/plugin/compatibility/action-availability.json +18 -3
- package/vendors/plugin/plugin.json +7 -7
- package/vendors/plugin/project/README.md +37 -0
- package/vendors/plugin/project/schemas/interaction.schema.json +100 -0
- package/vendors/plugin/project/templates/interaction.json +16 -0
- package/vendors/plugin/skills/wtfp-deliver-research/SKILL.md +1 -1
- package/vendors/plugin/skills/wtfp-deliver-research/references/actions.md +2 -2
- package/vendors/plugin/skills/wtfp-plan-section/SKILL.md +1 -1
- package/vendors/plugin/skills/wtfp-plan-section/references/actions.md +4 -3
- package/vendors/plugin/skills/wtfp-research-literature/SKILL.md +1 -1
- package/vendors/plugin/skills/wtfp-review-manuscript/SKILL.md +1 -1
- package/vendors/plugin/skills/wtfp-write-section/SKILL.md +1 -1
- package/vendors/plugin/skills/wtfp-write-section/references/actions.md +1 -1
- package/vendors/plugin/workflows/checkpoint.md +2 -2
- package/vendors/plugin/workflows/execute-outline.md +2 -2
- package/vendors/plugin/workflows/export-latex.md +4 -4
- package/vendors/plugin/workflows/plan-revision.md +4 -3
- package/vendors/plugin/workflows/plan-section.md +2 -2
- package/vendors/plugin/workflows/polish-prose.md +3 -3
- package/vendors/plugin/workflows/research-gap.md +2 -2
- package/vendors/plugin/workflows/verify-work.md +3 -3
- package/vendors/plugin/workflows/write-section.md +2 -2
- package/vendors/antigravity/commands/wtfp-plan-section.md +0 -78
- package/vendors/antigravity/commands/wtfp-write-section.md +0 -77
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
// Generated by WTF-P adapter compiler v5 from evaluation/lib/json-schema.js; do not edit.
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
function readJson(file) {
|
|
8
|
+
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function deepEqual(left, right) {
|
|
12
|
+
return JSON.stringify(left) === JSON.stringify(right);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function valueType(value) {
|
|
16
|
+
if (value === null) return 'null';
|
|
17
|
+
if (Array.isArray(value)) return 'array';
|
|
18
|
+
if (Number.isInteger(value)) return 'integer';
|
|
19
|
+
return typeof value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function escapeLocationSegment(segment) {
|
|
23
|
+
return /^[A-Za-z_$][A-Za-z0-9_$-]*$/.test(segment)
|
|
24
|
+
? `.${segment}`
|
|
25
|
+
: `[${JSON.stringify(segment)}]`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function calendarDateValid(year, month, day) {
|
|
29
|
+
if (month < 1 || month > 12 || day < 1) return false;
|
|
30
|
+
const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
31
|
+
const days = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
32
|
+
return day <= days[month - 1];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function rfc3339DateValid(value) {
|
|
36
|
+
const match = value.match(/^(\d{4})-(\d{2})-(\d{2})$/u);
|
|
37
|
+
return Boolean(match && calendarDateValid(Number(match[1]), Number(match[2]), Number(match[3])));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function rfc3339DateTimeValid(value) {
|
|
41
|
+
const match = value.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(Z|([+-])(\d{2}):(\d{2}))$/u);
|
|
42
|
+
if (!match || !calendarDateValid(Number(match[1]), Number(match[2]), Number(match[3]))) return false;
|
|
43
|
+
const hour = Number(match[4]);
|
|
44
|
+
const minute = Number(match[5]);
|
|
45
|
+
const second = Number(match[6]);
|
|
46
|
+
// Leap seconds are intentionally rejected: the evaluator needs deterministic
|
|
47
|
+
// ordering through JavaScript Date parsing, which does not represent :60.
|
|
48
|
+
if (hour > 23 || minute > 59 || second > 59) return false;
|
|
49
|
+
if (match[7] !== 'Z' && (Number(match[9]) > 23 || Number(match[10]) > 59)) return false;
|
|
50
|
+
return Number.isFinite(Date.parse(value));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function resolvePointer(document, fragment, source) {
|
|
54
|
+
if (!fragment || fragment === '#') return document;
|
|
55
|
+
if (!fragment.startsWith('#/')) {
|
|
56
|
+
throw new Error(`${source}: unsupported JSON Schema fragment ${fragment}`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return decodeURIComponent(fragment.slice(2)).split('/').reduce((value, segment) => {
|
|
60
|
+
const key = segment.replace(/~1/g, '/').replace(/~0/g, '~');
|
|
61
|
+
if (!value || !Object.prototype.hasOwnProperty.call(value, key)) {
|
|
62
|
+
throw new Error(`${source}: unresolved JSON pointer ${fragment}`);
|
|
63
|
+
}
|
|
64
|
+
return value[key];
|
|
65
|
+
}, document);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
class SchemaRegistry {
|
|
69
|
+
constructor(schemaFiles = []) {
|
|
70
|
+
this.documents = new Map();
|
|
71
|
+
this.identifiers = new Map();
|
|
72
|
+
for (const file of schemaFiles) this.add(file);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
add(file) {
|
|
76
|
+
const resolved = path.resolve(file);
|
|
77
|
+
if (this.documents.has(resolved)) return this.documents.get(resolved);
|
|
78
|
+
const document = readJson(resolved);
|
|
79
|
+
this.documents.set(resolved, document);
|
|
80
|
+
if (document.$id) {
|
|
81
|
+
if (this.identifiers.has(document.$id) && this.identifiers.get(document.$id) !== resolved) {
|
|
82
|
+
throw new Error(`duplicate JSON Schema identifier ${document.$id}`);
|
|
83
|
+
}
|
|
84
|
+
this.identifiers.set(document.$id, resolved);
|
|
85
|
+
}
|
|
86
|
+
return document;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
get(file) {
|
|
90
|
+
return this.add(file);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
resolve(reference, currentFile) {
|
|
94
|
+
const separator = reference.indexOf('#');
|
|
95
|
+
const resource = separator === -1 ? reference : reference.slice(0, separator);
|
|
96
|
+
const fragment = separator === -1 ? '' : reference.slice(separator);
|
|
97
|
+
let targetFile = path.resolve(currentFile);
|
|
98
|
+
|
|
99
|
+
if (resource) {
|
|
100
|
+
if (this.identifiers.has(resource)) {
|
|
101
|
+
targetFile = this.identifiers.get(resource);
|
|
102
|
+
} else if (/^[A-Za-z][A-Za-z0-9+.-]*:/.test(resource)) {
|
|
103
|
+
throw new Error(`${currentFile}: unregistered JSON Schema identifier ${resource}`);
|
|
104
|
+
} else {
|
|
105
|
+
targetFile = path.resolve(path.dirname(currentFile), resource);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const document = this.get(targetFile);
|
|
110
|
+
return {
|
|
111
|
+
file: targetFile,
|
|
112
|
+
schema: resolvePointer(document, fragment, targetFile)
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function validateInstance(instance, schema, schemaFile, registry, location = '$') {
|
|
118
|
+
if (schema === true) return [];
|
|
119
|
+
if (schema === false) return [`${location}: is rejected by the false schema`];
|
|
120
|
+
if (!schema || typeof schema !== 'object' || Array.isArray(schema)) {
|
|
121
|
+
throw new Error(`${schemaFile}: JSON Schema node at ${location} must be an object or boolean`);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const errors = [];
|
|
125
|
+
|
|
126
|
+
if (schema.$ref) {
|
|
127
|
+
const target = registry.resolve(schema.$ref, schemaFile);
|
|
128
|
+
errors.push(...validateInstance(instance, target.schema, target.file, registry, location));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
for (const child of schema.allOf || []) {
|
|
132
|
+
errors.push(...validateInstance(instance, child, schemaFile, registry, location));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (schema.anyOf) {
|
|
136
|
+
const matches = schema.anyOf.filter(child =>
|
|
137
|
+
validateInstance(instance, child, schemaFile, registry, location).length === 0
|
|
138
|
+
).length;
|
|
139
|
+
if (matches === 0) errors.push(`${location}: must match at least one anyOf branch`);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (schema.oneOf) {
|
|
143
|
+
const matches = schema.oneOf.filter(child =>
|
|
144
|
+
validateInstance(instance, child, schemaFile, registry, location).length === 0
|
|
145
|
+
).length;
|
|
146
|
+
if (matches !== 1) errors.push(`${location}: must match exactly one oneOf branch (matched ${matches})`);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (schema.if) {
|
|
150
|
+
const conditionMatches = validateInstance(instance, schema.if, schemaFile, registry, location).length === 0;
|
|
151
|
+
if (conditionMatches && schema.then) {
|
|
152
|
+
errors.push(...validateInstance(instance, schema.then, schemaFile, registry, location));
|
|
153
|
+
}
|
|
154
|
+
if (!conditionMatches && schema.else) {
|
|
155
|
+
errors.push(...validateInstance(instance, schema.else, schemaFile, registry, location));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (schema.not && validateInstance(instance, schema.not, schemaFile, registry, location).length === 0) {
|
|
160
|
+
errors.push(`${location}: must not match the forbidden schema`);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (Object.prototype.hasOwnProperty.call(schema, 'const') && !deepEqual(instance, schema.const)) {
|
|
164
|
+
errors.push(`${location}: must equal ${JSON.stringify(schema.const)}`);
|
|
165
|
+
}
|
|
166
|
+
if (schema.enum && !schema.enum.some(item => deepEqual(instance, item))) {
|
|
167
|
+
errors.push(`${location}: must be one of ${schema.enum.map(JSON.stringify).join(', ')}`);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (schema.type) {
|
|
171
|
+
const allowed = Array.isArray(schema.type) ? schema.type : [schema.type];
|
|
172
|
+
const actual = valueType(instance);
|
|
173
|
+
const matches = allowed.some(type => type === actual || (type === 'number' && actual === 'integer'));
|
|
174
|
+
if (!matches) {
|
|
175
|
+
errors.push(`${location}: expected ${allowed.join('|')}, got ${actual}`);
|
|
176
|
+
return errors;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (typeof instance === 'string') {
|
|
181
|
+
if (schema.minLength !== undefined && instance.length < schema.minLength) {
|
|
182
|
+
errors.push(`${location}: string is shorter than ${schema.minLength}`);
|
|
183
|
+
}
|
|
184
|
+
if (schema.maxLength !== undefined && instance.length > schema.maxLength) {
|
|
185
|
+
errors.push(`${location}: string is longer than ${schema.maxLength}`);
|
|
186
|
+
}
|
|
187
|
+
if (schema.pattern && !new RegExp(schema.pattern, 'u').test(instance)) {
|
|
188
|
+
errors.push(`${location}: does not match ${schema.pattern}`);
|
|
189
|
+
}
|
|
190
|
+
if (schema.format === 'date-time' && !rfc3339DateTimeValid(instance)) {
|
|
191
|
+
errors.push(`${location}: is not an RFC 3339 date-time`);
|
|
192
|
+
}
|
|
193
|
+
if (schema.format === 'date' && !rfc3339DateValid(instance)) {
|
|
194
|
+
errors.push(`${location}: is not an ISO 8601 date`);
|
|
195
|
+
}
|
|
196
|
+
if (schema.format === 'uri') {
|
|
197
|
+
try {
|
|
198
|
+
new URL(instance);
|
|
199
|
+
} catch {
|
|
200
|
+
errors.push(`${location}: is not an absolute URI`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
if (typeof instance === 'number') {
|
|
206
|
+
if (schema.minimum !== undefined && instance < schema.minimum) {
|
|
207
|
+
errors.push(`${location}: is below ${schema.minimum}`);
|
|
208
|
+
}
|
|
209
|
+
if (schema.maximum !== undefined && instance > schema.maximum) {
|
|
210
|
+
errors.push(`${location}: is above ${schema.maximum}`);
|
|
211
|
+
}
|
|
212
|
+
if (schema.exclusiveMinimum !== undefined && instance <= schema.exclusiveMinimum) {
|
|
213
|
+
errors.push(`${location}: is not greater than ${schema.exclusiveMinimum}`);
|
|
214
|
+
}
|
|
215
|
+
if (schema.exclusiveMaximum !== undefined && instance >= schema.exclusiveMaximum) {
|
|
216
|
+
errors.push(`${location}: is not less than ${schema.exclusiveMaximum}`);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
if (Array.isArray(instance)) {
|
|
221
|
+
if (schema.minItems !== undefined && instance.length < schema.minItems) {
|
|
222
|
+
errors.push(`${location}: has fewer than ${schema.minItems} items`);
|
|
223
|
+
}
|
|
224
|
+
if (schema.maxItems !== undefined && instance.length > schema.maxItems) {
|
|
225
|
+
errors.push(`${location}: has more than ${schema.maxItems} items`);
|
|
226
|
+
}
|
|
227
|
+
if (schema.uniqueItems) {
|
|
228
|
+
const serialized = instance.map(item => JSON.stringify(item));
|
|
229
|
+
if (new Set(serialized).size !== serialized.length) {
|
|
230
|
+
errors.push(`${location}: items are not unique`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (schema.items) {
|
|
234
|
+
instance.forEach((item, index) => {
|
|
235
|
+
errors.push(...validateInstance(item, schema.items, schemaFile, registry, `${location}[${index}]`));
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (instance && typeof instance === 'object' && !Array.isArray(instance)) {
|
|
241
|
+
const properties = schema.properties || {};
|
|
242
|
+
const patternProperties = schema.patternProperties || {};
|
|
243
|
+
const keys = Object.keys(instance);
|
|
244
|
+
if (schema.minProperties !== undefined && keys.length < schema.minProperties) {
|
|
245
|
+
errors.push(`${location}: has fewer than ${schema.minProperties} properties`);
|
|
246
|
+
}
|
|
247
|
+
if (schema.maxProperties !== undefined && keys.length > schema.maxProperties) {
|
|
248
|
+
errors.push(`${location}: has more than ${schema.maxProperties} properties`);
|
|
249
|
+
}
|
|
250
|
+
for (const required of schema.required || []) {
|
|
251
|
+
if (!Object.prototype.hasOwnProperty.call(instance, required)) {
|
|
252
|
+
errors.push(`${location}: missing required property ${required}`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
for (const key of keys) {
|
|
257
|
+
const matchingPatterns = Object.entries(patternProperties)
|
|
258
|
+
.filter(([pattern]) => new RegExp(pattern, 'u').test(key));
|
|
259
|
+
const declared = Object.prototype.hasOwnProperty.call(properties, key);
|
|
260
|
+
if (!declared && matchingPatterns.length === 0) {
|
|
261
|
+
if (schema.additionalProperties === false) {
|
|
262
|
+
errors.push(`${location}: unknown property ${key}`);
|
|
263
|
+
} else if (schema.additionalProperties && typeof schema.additionalProperties === 'object') {
|
|
264
|
+
errors.push(...validateInstance(
|
|
265
|
+
instance[key],
|
|
266
|
+
schema.additionalProperties,
|
|
267
|
+
schemaFile,
|
|
268
|
+
registry,
|
|
269
|
+
`${location}${escapeLocationSegment(key)}`
|
|
270
|
+
));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
for (const [, childSchema] of matchingPatterns) {
|
|
274
|
+
errors.push(...validateInstance(
|
|
275
|
+
instance[key],
|
|
276
|
+
childSchema,
|
|
277
|
+
schemaFile,
|
|
278
|
+
registry,
|
|
279
|
+
`${location}${escapeLocationSegment(key)}`
|
|
280
|
+
));
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
for (const [key, childSchema] of Object.entries(properties)) {
|
|
285
|
+
if (Object.prototype.hasOwnProperty.call(instance, key)) {
|
|
286
|
+
errors.push(...validateInstance(
|
|
287
|
+
instance[key],
|
|
288
|
+
childSchema,
|
|
289
|
+
schemaFile,
|
|
290
|
+
registry,
|
|
291
|
+
`${location}${escapeLocationSegment(key)}`
|
|
292
|
+
));
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
return errors;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
module.exports = {
|
|
301
|
+
SchemaRegistry,
|
|
302
|
+
readJson,
|
|
303
|
+
validateInstance
|
|
304
|
+
};
|