@vibe-agent-toolkit/cli 0.2.0-rc.11 → 0.2.0-rc.12
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 +3 -3
- package/dist/bin/supervise-cli.d.ts +45 -0
- package/dist/bin/supervise-cli.d.ts.map +1 -0
- package/dist/bin/supervise-cli.js +83 -0
- package/dist/bin/supervise-cli.js.map +1 -0
- package/dist/bin/vat +95 -43
- package/dist/bin/vat.d.ts +15 -4
- package/dist/bin/vat.d.ts.map +1 -1
- package/dist/bin/vat.js +95 -43
- package/dist/bin/vat.js.map +1 -1
- package/dist/bin.js +21 -29
- package/dist/bin.js.map +1 -1
- package/dist/command-tree.d.ts +45 -0
- package/dist/command-tree.d.ts.map +1 -0
- package/dist/command-tree.js +60 -0
- package/dist/command-tree.js.map +1 -0
- package/dist/commands/agent/build-schema.d.ts +100 -0
- package/dist/commands/agent/build-schema.d.ts.map +1 -0
- package/dist/commands/agent/build-schema.js +32 -0
- package/dist/commands/agent/build-schema.js.map +1 -0
- package/dist/commands/agent/build.d.ts +1 -0
- package/dist/commands/agent/build.d.ts.map +1 -1
- package/dist/commands/agent/build.js +63 -33
- package/dist/commands/agent/build.js.map +1 -1
- package/dist/commands/agent/import-schema.d.ts +75 -0
- package/dist/commands/agent/import-schema.d.ts.map +1 -0
- package/dist/commands/agent/import-schema.js +25 -0
- package/dist/commands/agent/import-schema.js.map +1 -0
- package/dist/commands/agent/import.d.ts.map +1 -1
- package/dist/commands/agent/import.js +33 -27
- package/dist/commands/agent/import.js.map +1 -1
- package/dist/commands/agent/index.d.ts.map +1 -1
- package/dist/commands/agent/index.js +132 -37
- package/dist/commands/agent/index.js.map +1 -1
- package/dist/commands/agent/install-path.d.ts.map +1 -1
- package/dist/commands/agent/install-path.js +2 -1
- package/dist/commands/agent/install-path.js.map +1 -1
- package/dist/commands/agent/install-schema.d.ts +89 -0
- package/dist/commands/agent/install-schema.d.ts.map +1 -0
- package/dist/commands/agent/install-schema.js +29 -0
- package/dist/commands/agent/install-schema.js.map +1 -0
- package/dist/commands/agent/install.d.ts +7 -1
- package/dist/commands/agent/install.d.ts.map +1 -1
- package/dist/commands/agent/install.js +78 -108
- package/dist/commands/agent/install.js.map +1 -1
- package/dist/commands/agent/installed-schema.d.ts +140 -0
- package/dist/commands/agent/installed-schema.d.ts.map +1 -0
- package/dist/commands/agent/installed-schema.js +36 -0
- package/dist/commands/agent/installed-schema.js.map +1 -0
- package/dist/commands/agent/installed.d.ts +1 -1
- package/dist/commands/agent/installed.d.ts.map +1 -1
- package/dist/commands/agent/installed.js +104 -75
- package/dist/commands/agent/installed.js.map +1 -1
- package/dist/commands/agent/list-schema.d.ts +128 -0
- package/dist/commands/agent/list-schema.d.ts.map +1 -0
- package/dist/commands/agent/list-schema.js +34 -0
- package/dist/commands/agent/list-schema.js.map +1 -0
- package/dist/commands/agent/list.d.ts +4 -3
- package/dist/commands/agent/list.d.ts.map +1 -1
- package/dist/commands/agent/list.js +50 -37
- package/dist/commands/agent/list.js.map +1 -1
- package/dist/commands/agent/run.d.ts +3 -0
- package/dist/commands/agent/run.d.ts.map +1 -1
- package/dist/commands/agent/run.js +8 -3
- package/dist/commands/agent/run.js.map +1 -1
- package/dist/commands/agent/uninstall-schema.d.ts +89 -0
- package/dist/commands/agent/uninstall-schema.d.ts.map +1 -0
- package/dist/commands/agent/uninstall-schema.js +29 -0
- package/dist/commands/agent/uninstall-schema.js.map +1 -0
- package/dist/commands/agent/uninstall.d.ts +5 -1
- package/dist/commands/agent/uninstall.d.ts.map +1 -1
- package/dist/commands/agent/uninstall.js +50 -38
- package/dist/commands/agent/uninstall.js.map +1 -1
- package/dist/commands/agent/validate-schema.d.ts +129 -0
- package/dist/commands/agent/validate-schema.d.ts.map +1 -0
- package/dist/commands/agent/validate-schema.js +35 -0
- package/dist/commands/agent/validate-schema.js.map +1 -0
- package/dist/commands/agent/validate.d.ts +6 -0
- package/dist/commands/agent/validate.d.ts.map +1 -1
- package/dist/commands/agent/validate.js +64 -36
- package/dist/commands/agent/validate.js.map +1 -1
- package/dist/commands/ard/emit-schema.d.ts +108 -0
- package/dist/commands/ard/emit-schema.d.ts.map +1 -0
- package/dist/commands/ard/emit-schema.js +37 -0
- package/dist/commands/ard/emit-schema.js.map +1 -0
- package/dist/commands/ard/emit.d.ts +21 -65
- package/dist/commands/ard/emit.d.ts.map +1 -1
- package/dist/commands/ard/emit.js +68 -74
- package/dist/commands/ard/emit.js.map +1 -1
- package/dist/commands/ard/index.d.ts.map +1 -1
- package/dist/commands/ard/index.js +14 -11
- package/dist/commands/ard/index.js.map +1 -1
- package/dist/commands/audit/compat-lane-findings.d.ts +65 -0
- package/dist/commands/audit/compat-lane-findings.d.ts.map +1 -0
- package/dist/commands/audit/compat-lane-findings.js +72 -0
- package/dist/commands/audit/compat-lane-findings.js.map +1 -0
- package/dist/commands/audit/distributed-tree.d.ts +2 -2
- package/dist/commands/audit/distributed-tree.d.ts.map +1 -1
- package/dist/commands/audit/distributed-tree.js +23 -12
- package/dist/commands/audit/distributed-tree.js.map +1 -1
- package/dist/commands/audit/git-url-clone.d.ts +15 -7
- package/dist/commands/audit/git-url-clone.d.ts.map +1 -1
- package/dist/commands/audit/git-url-clone.js +85 -42
- package/dist/commands/audit/git-url-clone.js.map +1 -1
- package/dist/commands/audit/hierarchical-output.d.ts +28 -4
- package/dist/commands/audit/hierarchical-output.d.ts.map +1 -1
- package/dist/commands/audit/hierarchical-output.js +44 -27
- package/dist/commands/audit/hierarchical-output.js.map +1 -1
- package/dist/commands/audit/scan-population.d.ts.map +1 -1
- package/dist/commands/audit/scan-population.js +2 -1
- package/dist/commands/audit/scan-population.js.map +1 -1
- package/dist/commands/audit-schema.d.ts +1247 -0
- package/dist/commands/audit-schema.d.ts.map +1 -0
- package/dist/commands/audit-schema.js +139 -0
- package/dist/commands/audit-schema.js.map +1 -0
- package/dist/commands/audit-settings-schema.d.ts +417 -0
- package/dist/commands/audit-settings-schema.d.ts.map +1 -0
- package/dist/commands/audit-settings-schema.js +77 -0
- package/dist/commands/audit-settings-schema.js.map +1 -0
- package/dist/commands/audit-settings.d.ts +28 -9
- package/dist/commands/audit-settings.d.ts.map +1 -1
- package/dist/commands/audit-settings.js +215 -151
- package/dist/commands/audit-settings.js.map +1 -1
- package/dist/commands/audit.d.ts +72 -33
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +405 -411
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/build.d.ts +61 -4
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +176 -190
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/cache/clear-schema.d.ts +111 -0
- package/dist/commands/cache/clear-schema.d.ts.map +1 -0
- package/dist/commands/cache/clear-schema.js +37 -0
- package/dist/commands/cache/clear-schema.js.map +1 -0
- package/dist/commands/cache/clear.d.ts +28 -26
- package/dist/commands/cache/clear.d.ts.map +1 -1
- package/dist/commands/cache/clear.js +108 -103
- package/dist/commands/cache/clear.js.map +1 -1
- package/dist/commands/cache/index.d.ts.map +1 -1
- package/dist/commands/cache/index.js +13 -7
- package/dist/commands/cache/index.js.map +1 -1
- package/dist/commands/claude/claude-config.d.ts +23 -6
- package/dist/commands/claude/claude-config.d.ts.map +1 -1
- package/dist/commands/claude/claude-config.js +29 -15
- package/dist/commands/claude/claude-config.js.map +1 -1
- package/dist/commands/claude/context.d.ts +55 -2
- package/dist/commands/claude/context.d.ts.map +1 -1
- package/dist/commands/claude/context.js +74 -50
- package/dist/commands/claude/context.js.map +1 -1
- package/dist/commands/claude/marketplace/changelog-utils.js +2 -2
- package/dist/commands/claude/marketplace/changelog-utils.js.map +1 -1
- package/dist/commands/claude/marketplace/git-publish.d.ts +14 -1
- package/dist/commands/claude/marketplace/git-publish.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/git-publish.js +135 -68
- package/dist/commands/claude/marketplace/git-publish.js.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.d.ts +3 -5
- package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.js +16 -7
- package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
- package/dist/commands/claude/marketplace/publish-schema.d.ts +137 -0
- package/dist/commands/claude/marketplace/publish-schema.d.ts.map +1 -0
- package/dist/commands/claude/marketplace/publish-schema.js +32 -0
- package/dist/commands/claude/marketplace/publish-schema.js.map +1 -0
- package/dist/commands/claude/marketplace/publish-tree.d.ts +6 -0
- package/dist/commands/claude/marketplace/publish-tree.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/publish-tree.js +75 -17
- package/dist/commands/claude/marketplace/publish-tree.js.map +1 -1
- package/dist/commands/claude/marketplace/publish.d.ts +27 -0
- package/dist/commands/claude/marketplace/publish.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/publish.js +84 -50
- package/dist/commands/claude/marketplace/publish.js.map +1 -1
- package/dist/commands/claude/marketplace/validate-schema.d.ts +362 -0
- package/dist/commands/claude/marketplace/validate-schema.d.ts.map +1 -0
- package/dist/commands/claude/marketplace/validate-schema.js +67 -0
- package/dist/commands/claude/marketplace/validate-schema.js.map +1 -0
- package/dist/commands/claude/marketplace/validate.d.ts +40 -53
- package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/validate.js +358 -214
- package/dist/commands/claude/marketplace/validate.js.map +1 -1
- package/dist/commands/claude/org/api-keys.d.ts +3 -0
- package/dist/commands/claude/org/api-keys.d.ts.map +1 -1
- package/dist/commands/claude/org/api-keys.js +4 -5
- package/dist/commands/claude/org/api-keys.js.map +1 -1
- package/dist/commands/claude/org/code-analytics.js +1 -1
- package/dist/commands/claude/org/code-analytics.js.map +1 -1
- package/dist/commands/claude/org/cost.d.ts.map +1 -1
- package/dist/commands/claude/org/cost.js +11 -33
- package/dist/commands/claude/org/cost.js.map +1 -1
- package/dist/commands/claude/org/helpers.d.ts +40 -27
- package/dist/commands/claude/org/helpers.d.ts.map +1 -1
- package/dist/commands/claude/org/helpers.js +61 -66
- package/dist/commands/claude/org/helpers.js.map +1 -1
- package/dist/commands/claude/org/index.d.ts.map +1 -1
- package/dist/commands/claude/org/index.js +10 -4
- package/dist/commands/claude/org/index.js.map +1 -1
- package/dist/commands/claude/org/info.d.ts.map +1 -1
- package/dist/commands/claude/org/info.js +2 -3
- package/dist/commands/claude/org/info.js.map +1 -1
- package/dist/commands/claude/org/invites.d.ts +3 -0
- package/dist/commands/claude/org/invites.d.ts.map +1 -1
- package/dist/commands/claude/org/invites.js +5 -7
- package/dist/commands/claude/org/invites.js.map +1 -1
- package/dist/commands/claude/org/skills.d.ts +76 -21
- package/dist/commands/claude/org/skills.d.ts.map +1 -1
- package/dist/commands/claude/org/skills.js +273 -246
- package/dist/commands/claude/org/skills.js.map +1 -1
- package/dist/commands/claude/org/stubs-schema.d.ts +56 -0
- package/dist/commands/claude/org/stubs-schema.d.ts.map +1 -0
- package/dist/commands/claude/org/stubs-schema.js +23 -0
- package/dist/commands/claude/org/stubs-schema.js.map +1 -0
- package/dist/commands/claude/org/stubs.d.ts +8 -3
- package/dist/commands/claude/org/stubs.d.ts.map +1 -1
- package/dist/commands/claude/org/stubs.js +9 -9
- package/dist/commands/claude/org/stubs.js.map +1 -1
- package/dist/commands/claude/org/usage.d.ts.map +1 -1
- package/dist/commands/claude/org/usage.js +1 -2
- package/dist/commands/claude/org/usage.js.map +1 -1
- package/dist/commands/claude/org/users.d.ts +3 -0
- package/dist/commands/claude/org/users.d.ts.map +1 -1
- package/dist/commands/claude/org/users.js +6 -8
- package/dist/commands/claude/org/users.js.map +1 -1
- package/dist/commands/claude/org/workspaces.d.ts +3 -0
- package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
- package/dist/commands/claude/org/workspaces.js +10 -15
- package/dist/commands/claude/org/workspaces.js.map +1 -1
- package/dist/commands/claude/plugin/build-schema.d.ts +642 -0
- package/dist/commands/claude/plugin/build-schema.d.ts.map +1 -0
- package/dist/commands/claude/plugin/build-schema.js +51 -0
- package/dist/commands/claude/plugin/build-schema.js.map +1 -0
- package/dist/commands/claude/plugin/build.d.ts +220 -45
- package/dist/commands/claude/plugin/build.d.ts.map +1 -1
- package/dist/commands/claude/plugin/build.js +466 -249
- package/dist/commands/claude/plugin/build.js.map +1 -1
- package/dist/commands/claude/plugin/helpers.d.ts +186 -24
- package/dist/commands/claude/plugin/helpers.d.ts.map +1 -1
- package/dist/commands/claude/plugin/helpers.js +110 -68
- package/dist/commands/claude/plugin/helpers.js.map +1 -1
- package/dist/commands/claude/plugin/install-schema.d.ts +144 -0
- package/dist/commands/claude/plugin/install-schema.d.ts.map +1 -0
- package/dist/commands/claude/plugin/install-schema.js +36 -0
- package/dist/commands/claude/plugin/install-schema.js.map +1 -0
- package/dist/commands/claude/plugin/install.d.ts +191 -11
- package/dist/commands/claude/plugin/install.d.ts.map +1 -1
- package/dist/commands/claude/plugin/install.js +688 -628
- package/dist/commands/claude/plugin/install.js.map +1 -1
- package/dist/commands/claude/plugin/kept-findings.d.ts +19 -0
- package/dist/commands/claude/plugin/kept-findings.d.ts.map +1 -0
- package/dist/commands/claude/plugin/kept-findings.js +24 -0
- package/dist/commands/claude/plugin/kept-findings.js.map +1 -0
- package/dist/commands/claude/plugin/list-schema.d.ts +223 -0
- package/dist/commands/claude/plugin/list-schema.d.ts.map +1 -0
- package/dist/commands/claude/plugin/list-schema.js +34 -0
- package/dist/commands/claude/plugin/list-schema.js.map +1 -0
- package/dist/commands/claude/plugin/list.d.ts +18 -0
- package/dist/commands/claude/plugin/list.d.ts.map +1 -1
- package/dist/commands/claude/plugin/list.js +53 -45
- package/dist/commands/claude/plugin/list.js.map +1 -1
- package/dist/commands/claude/plugin/npm-pack.d.ts +15 -0
- package/dist/commands/claude/plugin/npm-pack.d.ts.map +1 -0
- package/dist/commands/claude/plugin/npm-pack.js +39 -0
- package/dist/commands/claude/plugin/npm-pack.js.map +1 -0
- package/dist/commands/claude/plugin/plugin-changelog.d.ts +5 -1
- package/dist/commands/claude/plugin/plugin-changelog.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-changelog.js +9 -5
- package/dist/commands/claude/plugin/plugin-changelog.js.map +1 -1
- package/dist/commands/claude/plugin/plugin-files.d.ts +21 -2
- package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-files.js +65 -32
- package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
- package/dist/commands/claude/plugin/plugin-validators.d.ts +13 -0
- package/dist/commands/claude/plugin/plugin-validators.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-validators.js +64 -16
- package/dist/commands/claude/plugin/plugin-validators.js.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.js +63 -37
- package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
- package/dist/commands/claude/plugin/uninstall-schema.d.ts +112 -0
- package/dist/commands/claude/plugin/uninstall-schema.d.ts.map +1 -0
- package/dist/commands/claude/plugin/uninstall-schema.js +28 -0
- package/dist/commands/claude/plugin/uninstall-schema.js.map +1 -0
- package/dist/commands/claude/plugin/uninstall.d.ts +57 -0
- package/dist/commands/claude/plugin/uninstall.d.ts.map +1 -1
- package/dist/commands/claude/plugin/uninstall.js +176 -64
- package/dist/commands/claude/plugin/uninstall.js.map +1 -1
- package/dist/commands/consistency-check.d.ts.map +1 -1
- package/dist/commands/consistency-check.js +8 -6
- package/dist/commands/consistency-check.js.map +1 -1
- package/dist/commands/corpus/index.d.ts.map +1 -1
- package/dist/commands/corpus/index.js +26 -10
- package/dist/commands/corpus/index.js.map +1 -1
- package/dist/commands/corpus/report.d.ts +34 -16
- package/dist/commands/corpus/report.d.ts.map +1 -1
- package/dist/commands/corpus/report.js +36 -18
- package/dist/commands/corpus/report.js.map +1 -1
- package/dist/commands/corpus/runner.d.ts +25 -20
- package/dist/commands/corpus/runner.d.ts.map +1 -1
- package/dist/commands/corpus/runner.js +123 -67
- package/dist/commands/corpus/runner.js.map +1 -1
- package/dist/commands/corpus/scan-schema.d.ts +127 -0
- package/dist/commands/corpus/scan-schema.d.ts.map +1 -0
- package/dist/commands/corpus/scan-schema.js +31 -0
- package/dist/commands/corpus/scan-schema.js.map +1 -0
- package/dist/commands/corpus/scan.d.ts +31 -0
- package/dist/commands/corpus/scan.d.ts.map +1 -1
- package/dist/commands/corpus/scan.js +124 -50
- package/dist/commands/corpus/scan.js.map +1 -1
- package/dist/commands/corpus/seed.d.ts +11 -8
- package/dist/commands/corpus/seed.d.ts.map +1 -1
- package/dist/commands/corpus/seed.js +29 -11
- package/dist/commands/corpus/seed.js.map +1 -1
- package/dist/commands/doctor-render.d.ts +52 -0
- package/dist/commands/doctor-render.d.ts.map +1 -0
- package/dist/commands/doctor-render.js +110 -0
- package/dist/commands/doctor-render.js.map +1 -0
- package/dist/commands/doctor-schema.d.ts +191 -0
- package/dist/commands/doctor-schema.d.ts.map +1 -0
- package/dist/commands/doctor-schema.js +44 -0
- package/dist/commands/doctor-schema.js.map +1 -0
- package/dist/commands/doctor.d.ts +7 -62
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +126 -165
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/inventory-schema.d.ts +7297 -0
- package/dist/commands/inventory-schema.d.ts.map +1 -0
- package/dist/commands/inventory-schema.js +28 -0
- package/dist/commands/inventory-schema.js.map +1 -0
- package/dist/commands/inventory.d.ts +1 -1
- package/dist/commands/inventory.d.ts.map +1 -1
- package/dist/commands/inventory.js +89 -41
- package/dist/commands/inventory.js.map +1 -1
- package/dist/commands/mcp/index.d.ts.map +1 -1
- package/dist/commands/mcp/index.js +15 -0
- package/dist/commands/mcp/index.js.map +1 -1
- package/dist/commands/mcp/list-collections-schema.d.ts +101 -0
- package/dist/commands/mcp/list-collections-schema.d.ts.map +1 -0
- package/dist/commands/mcp/list-collections-schema.js +22 -0
- package/dist/commands/mcp/list-collections-schema.js.map +1 -0
- package/dist/commands/mcp/list-collections.d.ts +1 -1
- package/dist/commands/mcp/list-collections.d.ts.map +1 -1
- package/dist/commands/mcp/list-collections.js +19 -17
- package/dist/commands/mcp/list-collections.js.map +1 -1
- package/dist/commands/mcp/serve.d.ts +5 -0
- package/dist/commands/mcp/serve.d.ts.map +1 -1
- package/dist/commands/mcp/serve.js +29 -15
- package/dist/commands/mcp/serve.js.map +1 -1
- package/dist/commands/okf/index.d.ts.map +1 -1
- package/dist/commands/okf/index.js +6 -5
- package/dist/commands/okf/index.js.map +1 -1
- package/dist/commands/okf/validate-schema.d.ts +171 -0
- package/dist/commands/okf/validate-schema.d.ts.map +1 -0
- package/dist/commands/okf/validate-schema.js +44 -0
- package/dist/commands/okf/validate-schema.js.map +1 -0
- package/dist/commands/okf/validate.d.ts +16 -149
- package/dist/commands/okf/validate.d.ts.map +1 -1
- package/dist/commands/okf/validate.js +64 -62
- package/dist/commands/okf/validate.js.map +1 -1
- package/dist/commands/orchestrator-schema.d.ts +419 -0
- package/dist/commands/orchestrator-schema.d.ts.map +1 -0
- package/dist/commands/orchestrator-schema.js +91 -0
- package/dist/commands/orchestrator-schema.js.map +1 -0
- package/dist/commands/phase-utils.d.ts +188 -220
- package/dist/commands/phase-utils.d.ts.map +1 -1
- package/dist/commands/phase-utils.js +210 -258
- package/dist/commands/phase-utils.js.map +1 -1
- package/dist/commands/positional-args.d.ts +13 -11
- package/dist/commands/positional-args.d.ts.map +1 -1
- package/dist/commands/positional-args.js +16 -15
- package/dist/commands/positional-args.js.map +1 -1
- package/dist/commands/rag/admin-schema.d.ts +152 -0
- package/dist/commands/rag/admin-schema.d.ts.map +1 -0
- package/dist/commands/rag/admin-schema.js +31 -0
- package/dist/commands/rag/admin-schema.js.map +1 -0
- package/dist/commands/rag/clear-command.d.ts.map +1 -1
- package/dist/commands/rag/clear-command.js +30 -15
- package/dist/commands/rag/clear-command.js.map +1 -1
- package/dist/commands/rag/command-helpers.d.ts +31 -7
- package/dist/commands/rag/command-helpers.d.ts.map +1 -1
- package/dist/commands/rag/command-helpers.js +41 -21
- package/dist/commands/rag/command-helpers.js.map +1 -1
- package/dist/commands/rag/index-command.d.ts +37 -48
- package/dist/commands/rag/index-command.d.ts.map +1 -1
- package/dist/commands/rag/index-command.js +80 -65
- package/dist/commands/rag/index-command.js.map +1 -1
- package/dist/commands/rag/index-schema.d.ts +107 -0
- package/dist/commands/rag/index-schema.d.ts.map +1 -0
- package/dist/commands/rag/index-schema.js +34 -0
- package/dist/commands/rag/index-schema.js.map +1 -0
- package/dist/commands/rag/index.d.ts.map +1 -1
- package/dist/commands/rag/index.js +88 -41
- package/dist/commands/rag/index.js.map +1 -1
- package/dist/commands/rag/query-command.d.ts +18 -4
- package/dist/commands/rag/query-command.d.ts.map +1 -1
- package/dist/commands/rag/query-command.js +42 -27
- package/dist/commands/rag/query-command.js.map +1 -1
- package/dist/commands/rag/query-schema.d.ts +363 -0
- package/dist/commands/rag/query-schema.d.ts.map +1 -0
- package/dist/commands/rag/query-schema.js +59 -0
- package/dist/commands/rag/query-schema.js.map +1 -0
- package/dist/commands/rag/stats-command.d.ts.map +1 -1
- package/dist/commands/rag/stats-command.js +19 -18
- package/dist/commands/rag/stats-command.js.map +1 -1
- package/dist/commands/resources/check-progress.d.ts +64 -11
- package/dist/commands/resources/check-progress.d.ts.map +1 -1
- package/dist/commands/resources/check-progress.js +77 -4
- package/dist/commands/resources/check-progress.js.map +1 -1
- package/dist/commands/resources/check-schema.d.ts +335 -0
- package/dist/commands/resources/check-schema.d.ts.map +1 -0
- package/dist/commands/resources/check-schema.js +104 -0
- package/dist/commands/resources/check-schema.js.map +1 -0
- package/dist/commands/resources/check-supervisor.d.ts +315 -71
- package/dist/commands/resources/check-supervisor.d.ts.map +1 -1
- package/dist/commands/resources/check-supervisor.js +493 -107
- package/dist/commands/resources/check-supervisor.js.map +1 -1
- package/dist/commands/resources/check.d.ts +56 -249
- package/dist/commands/resources/check.d.ts.map +1 -1
- package/dist/commands/resources/check.js +416 -276
- package/dist/commands/resources/check.js.map +1 -1
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +165 -91
- package/dist/commands/resources/index.js.map +1 -1
- package/dist/commands/resources/query-schema.d.ts +188 -0
- package/dist/commands/resources/query-schema.d.ts.map +1 -0
- package/dist/commands/resources/query-schema.js +48 -0
- package/dist/commands/resources/query-schema.js.map +1 -0
- package/dist/commands/resources/query.d.ts +17 -12
- package/dist/commands/resources/query.d.ts.map +1 -1
- package/dist/commands/resources/query.js +60 -48
- package/dist/commands/resources/query.js.map +1 -1
- package/dist/commands/resources/scan-schema.d.ts +195 -0
- package/dist/commands/resources/scan-schema.d.ts.map +1 -0
- package/dist/commands/resources/scan-schema.js +53 -0
- package/dist/commands/resources/scan-schema.js.map +1 -0
- package/dist/commands/resources/scan.d.ts +26 -3
- package/dist/commands/resources/scan.d.ts.map +1 -1
- package/dist/commands/resources/scan.js +51 -53
- package/dist/commands/resources/scan.js.map +1 -1
- package/dist/commands/resources/validate-schema.d.ts +326 -0
- package/dist/commands/resources/validate-schema.d.ts.map +1 -0
- package/dist/commands/resources/validate-schema.js +60 -0
- package/dist/commands/resources/validate-schema.js.map +1 -0
- package/dist/commands/resources/validate.d.ts +45 -169
- package/dist/commands/resources/validate.d.ts.map +1 -1
- package/dist/commands/resources/validate.js +221 -485
- package/dist/commands/resources/validate.js.map +1 -1
- package/dist/commands/skill/review-checklist.d.ts.map +1 -1
- package/dist/commands/skill/review-checklist.js +0 -1
- package/dist/commands/skill/review-checklist.js.map +1 -1
- package/dist/commands/skill/review-schema.d.ts +278 -0
- package/dist/commands/skill/review-schema.d.ts.map +1 -0
- package/dist/commands/skill/review-schema.js +46 -0
- package/dist/commands/skill/review-schema.js.map +1 -0
- package/dist/commands/skill/review.d.ts +8 -234
- package/dist/commands/skill/review.d.ts.map +1 -1
- package/dist/commands/skill/review.js +54 -78
- package/dist/commands/skill/review.js.map +1 -1
- package/dist/commands/skill/test/auth-flags.d.ts +3 -0
- package/dist/commands/skill/test/auth-flags.d.ts.map +1 -1
- package/dist/commands/skill/test/auth-flags.js +6 -2
- package/dist/commands/skill/test/auth-flags.js.map +1 -1
- package/dist/commands/skill/test/configure-schema.d.ts +67 -0
- package/dist/commands/skill/test/configure-schema.d.ts.map +1 -0
- package/dist/commands/skill/test/configure-schema.js +27 -0
- package/dist/commands/skill/test/configure-schema.js.map +1 -0
- package/dist/commands/skill/test/configure.d.ts +12 -5
- package/dist/commands/skill/test/configure.d.ts.map +1 -1
- package/dist/commands/skill/test/configure.js +101 -31
- package/dist/commands/skill/test/configure.js.map +1 -1
- package/dist/commands/skill/test/run-schema.d.ts +107 -0
- package/dist/commands/skill/test/run-schema.d.ts.map +1 -0
- package/dist/commands/skill/test/run-schema.js +36 -0
- package/dist/commands/skill/test/run-schema.js.map +1 -0
- package/dist/commands/skill/test/run.d.ts +3 -2
- package/dist/commands/skill/test/run.d.ts.map +1 -1
- package/dist/commands/skill/test/run.js +316 -155
- package/dist/commands/skill/test/run.js.map +1 -1
- package/dist/commands/skills/build-schema.d.ts +199 -0
- package/dist/commands/skills/build-schema.d.ts.map +1 -0
- package/dist/commands/skills/build-schema.js +55 -0
- package/dist/commands/skills/build-schema.js.map +1 -0
- package/dist/commands/skills/build.d.ts +95 -298
- package/dist/commands/skills/build.d.ts.map +1 -1
- package/dist/commands/skills/build.js +415 -818
- package/dist/commands/skills/build.js.map +1 -1
- package/dist/commands/skills/command-helpers.d.ts +5 -11
- package/dist/commands/skills/command-helpers.d.ts.map +1 -1
- package/dist/commands/skills/command-helpers.js +7 -17
- package/dist/commands/skills/command-helpers.js.map +1 -1
- package/dist/commands/skills/index.js +12 -6
- package/dist/commands/skills/index.js.map +1 -1
- package/dist/commands/skills/install-schema.d.ts +153 -0
- package/dist/commands/skills/install-schema.d.ts.map +1 -0
- package/dist/commands/skills/install-schema.js +44 -0
- package/dist/commands/skills/install-schema.js.map +1 -0
- package/dist/commands/skills/install.d.ts +76 -8
- package/dist/commands/skills/install.d.ts.map +1 -1
- package/dist/commands/skills/install.js +230 -194
- package/dist/commands/skills/install.js.map +1 -1
- package/dist/commands/skills/list-schema.d.ts +145 -0
- package/dist/commands/skills/list-schema.d.ts.map +1 -0
- package/dist/commands/skills/list-schema.js +37 -0
- package/dist/commands/skills/list-schema.js.map +1 -0
- package/dist/commands/skills/list.d.ts +39 -8
- package/dist/commands/skills/list.d.ts.map +1 -1
- package/dist/commands/skills/list.js +110 -122
- package/dist/commands/skills/list.js.map +1 -1
- package/dist/commands/skills/package-schema.d.ts +98 -0
- package/dist/commands/skills/package-schema.d.ts.map +1 -0
- package/dist/commands/skills/package-schema.js +32 -0
- package/dist/commands/skills/package-schema.js.map +1 -0
- package/dist/commands/skills/package.d.ts +85 -14
- package/dist/commands/skills/package.d.ts.map +1 -1
- package/dist/commands/skills/package.js +288 -207
- package/dist/commands/skills/package.js.map +1 -1
- package/dist/commands/skills/scope-guard.d.ts +27 -20
- package/dist/commands/skills/scope-guard.d.ts.map +1 -1
- package/dist/commands/skills/scope-guard.js +43 -32
- package/dist/commands/skills/scope-guard.js.map +1 -1
- package/dist/commands/skills/skill-discovery.d.ts +1 -1
- package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
- package/dist/commands/skills/skill-discovery.js +40 -19
- package/dist/commands/skills/skill-discovery.js.map +1 -1
- package/dist/commands/skills/source-resolvers.d.ts +58 -8
- package/dist/commands/skills/source-resolvers.d.ts.map +1 -1
- package/dist/commands/skills/source-resolvers.js +113 -38
- package/dist/commands/skills/source-resolvers.js.map +1 -1
- package/dist/commands/skills/validate-command.d.ts.map +1 -1
- package/dist/commands/skills/validate-command.js +31 -51
- package/dist/commands/skills/validate-command.js.map +1 -1
- package/dist/commands/skills/validate-schema.d.ts +199 -0
- package/dist/commands/skills/validate-schema.d.ts.map +1 -0
- package/dist/commands/skills/validate-schema.js +44 -0
- package/dist/commands/skills/validate-schema.js.map +1 -0
- package/dist/commands/skills/validate.d.ts +100 -136
- package/dist/commands/skills/validate.d.ts.map +1 -1
- package/dist/commands/skills/validate.js +257 -343
- package/dist/commands/skills/validate.js.map +1 -1
- package/dist/commands/validate.d.ts +17 -5
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +139 -94
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/verify.d.ts +121 -110
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +230 -294
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/report-schemas.d.ts +12398 -35
- package/dist/report-schemas.d.ts.map +1 -1
- package/dist/report-schemas.js +624 -66
- package/dist/report-schemas.js.map +1 -1
- package/dist/skill-resolution/packaging-config.js +2 -2
- package/dist/skill-resolution/packaging-config.js.map +1 -1
- package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
- package/dist/skill-resolution/resolve-skill-reference.js +20 -13
- package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
- package/dist/utils/agent-discovery.d.ts +34 -1
- package/dist/utils/agent-discovery.d.ts.map +1 -1
- package/dist/utils/agent-discovery.js +80 -38
- package/dist/utils/agent-discovery.js.map +1 -1
- package/dist/utils/claude-context-lens.d.ts +13 -6
- package/dist/utils/claude-context-lens.d.ts.map +1 -1
- package/dist/utils/claude-context-lens.js +11 -12
- package/dist/utils/claude-context-lens.js.map +1 -1
- package/dist/utils/command-error-codes.d.ts +12 -0
- package/dist/utils/command-error-codes.d.ts.map +1 -0
- package/dist/utils/command-error-codes.js +12 -0
- package/dist/utils/command-error-codes.js.map +1 -0
- package/dist/utils/command-refusal.d.ts +58 -0
- package/dist/utils/command-refusal.d.ts.map +1 -0
- package/dist/utils/command-refusal.js +170 -0
- package/dist/utils/command-refusal.js.map +1 -0
- package/dist/utils/commander-ending.d.ts +40 -0
- package/dist/utils/commander-ending.d.ts.map +1 -0
- package/dist/utils/commander-ending.js +42 -0
- package/dist/utils/commander-ending.js.map +1 -0
- package/dist/utils/config-loader.d.ts +13 -8
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +84 -45
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/corpus-target.d.ts +1 -1
- package/dist/utils/corpus-target.d.ts.map +1 -1
- package/dist/utils/corpus-target.js +6 -4
- package/dist/utils/corpus-target.js.map +1 -1
- package/dist/utils/debug-diagnostics.d.ts +18 -0
- package/dist/utils/debug-diagnostics.d.ts.map +1 -0
- package/dist/utils/debug-diagnostics.js +23 -0
- package/dist/utils/debug-diagnostics.js.map +1 -0
- package/dist/utils/document-writer.d.ts +191 -0
- package/dist/utils/document-writer.d.ts.map +1 -0
- package/dist/utils/document-writer.js +319 -0
- package/dist/utils/document-writer.js.map +1 -0
- package/dist/utils/help-loader.d.ts +2 -2
- package/dist/utils/help-loader.js +2 -2
- package/dist/utils/install-plan.d.ts +99 -0
- package/dist/utils/install-plan.d.ts.map +1 -0
- package/dist/utils/install-plan.js +146 -0
- package/dist/utils/install-plan.js.map +1 -0
- package/dist/utils/issue-anchor.d.ts +1 -1
- package/dist/utils/issue-anchor.d.ts.map +1 -1
- package/dist/utils/issue-anchor.js.map +1 -1
- package/dist/utils/issue-rendering.d.ts +8 -3
- package/dist/utils/issue-rendering.d.ts.map +1 -1
- package/dist/utils/issue-rendering.js +4 -0
- package/dist/utils/issue-rendering.js.map +1 -1
- package/dist/utils/lens-population.d.ts +20 -0
- package/dist/utils/lens-population.d.ts.map +1 -0
- package/dist/utils/lens-population.js +15 -0
- package/dist/utils/lens-population.js.map +1 -0
- package/dist/utils/marketplace-io.d.ts +63 -0
- package/dist/utils/marketplace-io.d.ts.map +1 -0
- package/dist/utils/marketplace-io.js +63 -0
- package/dist/utils/marketplace-io.js.map +1 -0
- package/dist/utils/operator-notices.d.ts +97 -0
- package/dist/utils/operator-notices.d.ts.map +1 -0
- package/dist/utils/operator-notices.js +115 -0
- package/dist/utils/operator-notices.js.map +1 -0
- package/dist/utils/optional-backend.d.ts +18 -15
- package/dist/utils/optional-backend.d.ts.map +1 -1
- package/dist/utils/optional-backend.js +22 -33
- package/dist/utils/optional-backend.js.map +1 -1
- package/dist/utils/output.d.ts +5 -43
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +8 -63
- package/dist/utils/output.js.map +1 -1
- package/dist/utils/package-json.d.ts +3 -4
- package/dist/utils/package-json.d.ts.map +1 -1
- package/dist/utils/package-json.js +8 -8
- package/dist/utils/package-json.js.map +1 -1
- package/dist/utils/population-wiring.d.ts +31 -38
- package/dist/utils/population-wiring.d.ts.map +1 -1
- package/dist/utils/population-wiring.js +38 -32
- package/dist/utils/population-wiring.js.map +1 -1
- package/dist/utils/project-root-policy.d.ts +74 -1
- package/dist/utils/project-root-policy.d.ts.map +1 -1
- package/dist/utils/project-root-policy.js +146 -8
- package/dist/utils/project-root-policy.js.map +1 -1
- package/dist/utils/projection-lenses.d.ts +25 -7
- package/dist/utils/projection-lenses.d.ts.map +1 -1
- package/dist/utils/projection-lenses.js +20 -6
- package/dist/utils/projection-lenses.js.map +1 -1
- package/dist/utils/projection-query.d.ts +17 -10
- package/dist/utils/projection-query.d.ts.map +1 -1
- package/dist/utils/projection-query.js +47 -28
- package/dist/utils/projection-query.js.map +1 -1
- package/dist/utils/projection-store.d.ts +2 -2
- package/dist/utils/projection-store.d.ts.map +1 -1
- package/dist/utils/projection-store.js +74 -45
- package/dist/utils/projection-store.js.map +1 -1
- package/dist/utils/rag-database.d.ts +61 -0
- package/dist/utils/rag-database.d.ts.map +1 -0
- package/dist/utils/rag-database.js +178 -0
- package/dist/utils/rag-database.js.map +1 -0
- package/dist/utils/relation-limits.d.ts +7 -2
- package/dist/utils/relation-limits.d.ts.map +1 -1
- package/dist/utils/relation-limits.js +6 -1
- package/dist/utils/relation-limits.js.map +1 -1
- package/dist/utils/relativize-paths.d.ts +23 -0
- package/dist/utils/relativize-paths.d.ts.map +1 -1
- package/dist/utils/relativize-paths.js +32 -1
- package/dist/utils/relativize-paths.js.map +1 -1
- package/dist/utils/resource-loader.d.ts +76 -32
- package/dist/utils/resource-loader.d.ts.map +1 -1
- package/dist/utils/resource-loader.js +132 -66
- package/dist/utils/resource-loader.js.map +1 -1
- package/dist/utils/run-integrity.d.ts +64 -31
- package/dist/utils/run-integrity.d.ts.map +1 -1
- package/dist/utils/run-integrity.js +76 -35
- package/dist/utils/run-integrity.js.map +1 -1
- package/dist/utils/scope-locations.d.ts +7 -5
- package/dist/utils/scope-locations.d.ts.map +1 -1
- package/dist/utils/scope-locations.js +37 -12
- package/dist/utils/scope-locations.js.map +1 -1
- package/dist/utils/staging-dir.d.ts +7 -0
- package/dist/utils/staging-dir.d.ts.map +1 -0
- package/dist/utils/staging-dir.js +12 -0
- package/dist/utils/staging-dir.js.map +1 -0
- package/dist/utils/url-redact.d.ts +9 -0
- package/dist/utils/url-redact.d.ts.map +1 -1
- package/dist/utils/url-redact.js +13 -0
- package/dist/utils/url-redact.js.map +1 -1
- package/dist/utils/user-context-scanner.d.ts +3 -2
- package/dist/utils/user-context-scanner.d.ts.map +1 -1
- package/dist/utils/user-context-scanner.js +24 -4
- package/dist/utils/user-context-scanner.js.map +1 -1
- package/dist/utils/validate-help-files.d.ts.map +1 -1
- package/dist/utils/validate-help-files.js +8 -14
- package/dist/utils/validate-help-files.js.map +1 -1
- package/dist/utils/vat-bin-path.d.ts.map +1 -1
- package/dist/utils/vat-bin-path.js +3 -3
- package/dist/utils/vat-bin-path.js.map +1 -1
- package/dist/utils/verdict-helpers.d.ts.map +1 -1
- package/dist/utils/verdict-helpers.js +5 -5
- package/dist/utils/verdict-helpers.js.map +1 -1
- package/docs/agent.md +347 -2
- package/docs/audit.md +312 -89
- package/docs/doctor.md +65 -19
- package/docs/index.md +571 -20
- package/docs/mcp.md +64 -12
- package/docs/rag.md +176 -48
- package/docs/resources.md +257 -71
- package/docs/skill-test.md +148 -19
- package/docs/skills.md +459 -174
- package/package.json +16 -19
- package/schemas/agent-build.json +268 -0
- package/schemas/agent-import.json +252 -0
- package/schemas/agent-install.json +260 -0
- package/schemas/agent-installed.json +287 -0
- package/schemas/agent-list.json +279 -0
- package/schemas/agent-uninstall.json +260 -0
- package/schemas/agent-validate.json +279 -0
- package/schemas/ard-emit.json +224 -106
- package/schemas/audit-settings.json +472 -0
- package/schemas/audit.json +635 -0
- package/schemas/cache-clear.json +273 -0
- package/schemas/claude-marketplace-publish.json +286 -0
- package/schemas/claude-marketplace-validate.json +352 -0
- package/schemas/claude-org-not-implemented.json +239 -0
- package/schemas/claude-plugin-build.json +446 -0
- package/schemas/claude-plugin-install.json +291 -0
- package/schemas/claude-plugin-list.json +326 -0
- package/schemas/claude-plugin-uninstall.json +272 -0
- package/schemas/corpus-audit.json +635 -0
- package/schemas/corpus-scan.json +293 -0
- package/schemas/doctor.json +299 -0
- package/schemas/inventory.json +982 -0
- package/schemas/mcp-list-collections.json +268 -0
- package/schemas/okf-validate.json +224 -106
- package/schemas/orchestrator.json +299 -0
- package/schemas/rag-clear.json +253 -0
- package/schemas/rag-index.json +273 -0
- package/schemas/rag-query.json +365 -0
- package/schemas/rag-stats.json +269 -0
- package/schemas/resources-check.json +242 -108
- package/schemas/resources-query.json +333 -0
- package/schemas/resources-scan.json +321 -0
- package/schemas/resources-validate.json +332 -0
- package/schemas/skill-review.json +224 -106
- package/schemas/skill-test-configure.json +256 -0
- package/schemas/skill-test-run.json +296 -0
- package/schemas/skills-build.json +325 -0
- package/schemas/skills-install.json +287 -0
- package/schemas/skills-list.json +283 -0
- package/schemas/skills-package.json +270 -0
- package/schemas/skills-validate.json +285 -0
- package/dist/commands/skills/shared.d.ts +0 -29
- package/dist/commands/skills/shared.d.ts.map +0 -1
- package/dist/commands/skills/shared.js +0 -33
- package/dist/commands/skills/shared.js.map +0 -1
- package/dist/utils/command-error.d.ts +0 -194
- package/dist/utils/command-error.d.ts.map +0 -1
- package/dist/utils/command-error.js +0 -237
- package/dist/utils/command-error.js.map +0 -1
|
@@ -15,12 +15,20 @@
|
|
|
15
15
|
* JS — which is why the parse pool's `terminate()` genuinely works — but a
|
|
16
16
|
* thread inside a synchronous native call is not spinning in JS. Do NOT
|
|
17
17
|
* "align" this design with the parse pool's.
|
|
18
|
-
* - **A signal handler is a REGRESSION.** A
|
|
19
|
-
* `node:sqlite` dies INSTANTLY on SIGINT while
|
|
20
|
-
* SURVIVES both SIGINT and SIGTERM once one is —
|
|
21
|
-
* and the event loop that would schedule it is
|
|
22
|
-
* Installing one removes the operator's Ctrl-C.
|
|
23
|
-
*
|
|
18
|
+
* - **A signal handler in the process RUNNING THE SQL is a REGRESSION.** A
|
|
19
|
+
* process blocked in synchronous `node:sqlite` dies INSTANTLY on SIGINT while
|
|
20
|
+
* no handler is installed, and SURVIVES both SIGINT and SIGTERM once one is —
|
|
21
|
+
* the handler is a JS callback, and the event loop that would schedule it is
|
|
22
|
+
* the resource that is blocked. Installing one removes the operator's Ctrl-C.
|
|
23
|
+
* That process — the supervised child, or this command under `--budget 0` —
|
|
24
|
+
* must never have a `process.on(<signal>)`, and nothing on its path installs
|
|
25
|
+
* one.
|
|
26
|
+
*
|
|
27
|
+
* The SUPERVISING process may, and does: its event loop only waits on the
|
|
28
|
+
* child, so a handler there fires. It guards every `TERMINATING_SIGNALS`
|
|
29
|
+
* member (through `handleTerminatingSignals`, the one way a handler is
|
|
30
|
+
* installed) for exactly the duration of a supervision, only to take the
|
|
31
|
+
* child down with it and re-raise; see `guardSupervision`.
|
|
24
32
|
* - **The kill is `SIGKILL` because SIGKILL cannot be REGRESSED.** No code the
|
|
25
33
|
* child runs, now or after any future edit, can handle, ignore or block it.
|
|
26
34
|
*
|
|
@@ -82,11 +90,64 @@
|
|
|
82
90
|
*
|
|
83
91
|
* ## Why the child is the CLI itself
|
|
84
92
|
*
|
|
85
|
-
* The child is `vat resources check` with a hidden `--
|
|
93
|
+
* The child is `vat resources check` with a hidden `--supervised-by` flag, running
|
|
86
94
|
* the ordinary in-process path. Forking the logic would give the supervised lane
|
|
87
95
|
* and the unsupervised one two implementations of the same gate — and the one
|
|
88
96
|
* nobody runs interactively is the one that would rot.
|
|
97
|
+
*
|
|
98
|
+
* ## ⚠️ When the SUPERVISOR dies
|
|
99
|
+
*
|
|
100
|
+
* Its signal handlers and `exit` guard take the child down on every ending that
|
|
101
|
+
* runs its code (see `guardSupervision`). SIGKILL, an OOM killer and, on Windows,
|
|
102
|
+
* any outside kill run none of it.
|
|
103
|
+
*
|
|
104
|
+
* - **Windows**: the OS takes the child down. libuv puts every child spawned
|
|
105
|
+
* without `detached` in a job object with `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE`
|
|
106
|
+
* whose only handle this process holds (`uv__init_global_job_handle`,
|
|
107
|
+
* `src/win/process.c`), so its `TerminateProcess` terminates the child too, at
|
|
108
|
+
* once and mid-check: none of the child's code runs, nothing is published.
|
|
109
|
+
* - **POSIX**: the child ends ITSELF. Its stdin is a pipe whose write end only
|
|
110
|
+
* this process holds and never writes or ends, so however this process dies
|
|
111
|
+
* the OS closes it and the child reads end-of-file (`endWhenSupervisorGone`).
|
|
112
|
+
* The child notices when its event loop next turns: at once during the
|
|
113
|
+
* population; during the synchronous check loop, once the LAST check has
|
|
114
|
+
* returned (a statement blocked inside SQLite reaches nothing until it
|
|
115
|
+
* returns) — and still before it publishes anything
|
|
116
|
+
* (`letSupervisorLossSurface`). Either way it exits 2 with one stderr line.
|
|
117
|
+
* (The pipe is there on Windows too; the job object simply ends the child
|
|
118
|
+
* first.)
|
|
119
|
+
*/
|
|
120
|
+
import { type ChildProcess } from 'node:child_process';
|
|
121
|
+
import { type TempDirOutcome } from '@vibe-agent-toolkit/utils';
|
|
122
|
+
import { type ForwardedDocument } from '../../utils/document-writer.js';
|
|
123
|
+
/**
|
|
124
|
+
* The bound applied when `--budget` is not passed, in seconds.
|
|
125
|
+
*
|
|
126
|
+
* Not a round number chosen for looks, and no longer sized against this
|
|
127
|
+
* repository alone. Population is ~1.2 s warm here and 33-35 s with a cold parse
|
|
128
|
+
* cache; on a real adopter tree of 9,992 tracked files it is ~5 s warm and
|
|
129
|
+
* **16.5 s cold**, which is the first time the default was checked outside VAT.
|
|
130
|
+
* So 300 s is ~18× the worst thing anyone has actually measured — deliberately
|
|
131
|
+
* loose, because a FALSE kill is far worse than a slow honest failure: it
|
|
132
|
+
* teaches the operator to pass `--budget 0` and lose the bound entirely. Five
|
|
133
|
+
* minutes still turns an infinite hang into a clean bounded failure, which is
|
|
134
|
+
* the whole objective. A tree ten times that adopter's lands near 165 s, still
|
|
135
|
+
* inside the default but no longer comfortably.
|
|
89
136
|
*/
|
|
137
|
+
export declare const DEFAULT_BUDGET_SECONDS = 300;
|
|
138
|
+
/**
|
|
139
|
+
* 🔑 THE text that says what interrupting a supervised checks run does — rendered verbatim into
|
|
140
|
+
* BOTH `vat validate --help` and `vat resources check --help` (a unit test pins that), so the two
|
|
141
|
+
* can never describe it differently. Help-text indentation (two spaces), no backticks.
|
|
142
|
+
*
|
|
143
|
+
* Each claim is pinned: POSIX signals by `checks-supervisor-orphan.system.test.ts`, the group
|
|
144
|
+
* Ctrl-C by the same file and `signal-guard-group-ctrl-c.system.test.ts`, the orphan's own ending
|
|
145
|
+
* by `checks-supervisor-orphan.system.test.ts` (population) and
|
|
146
|
+
* `checks-supervisor-orphan-loop.system.test.ts` (the check loop) — on Windows the same two cases
|
|
147
|
+
* pin the job object ending the child with its supervisor — the Windows wrapper by
|
|
148
|
+
* `supervise-cli.test.ts`.
|
|
149
|
+
*/
|
|
150
|
+
export declare const SUPERVISION_SIGNAL_CONTRACT = "Interrupting a supervised checks run:\n POSIX: SIGTERM, SIGHUP, SIGINT or SIGQUIT sent to this process, to the\n 'vat' wrapper (which forwards it), or to the terminal's process group\n (Ctrl-C) kills the checks child, removes the progress directory, publishes\n nothing, and dies of the signal (status 128+n; exit 2 where the signal\n cannot kill it, PID 1). A process the child itself started (git) is not\n killed with it; it ends on its own.\n POSIX, ended where it runs no code (SIGKILL, an OOM killer), this process\n cannot kill the child: the child reads end-of-file on the stdin pipe this\n process held and ends itself -- one stderr line, exit 2, nothing\n published -- at once during its population, and during the checks once\n the last check returns (a statement inside SQLite is not reached until it\n returns). A SIGKILL of the 'vat' wrapper kills the wrapper alone: this\n process (whose stdin is the terminal's, so it reads no end-of-file) and\n its child run on to completion, or until --budget seconds pass with no\n progress.\n Windows: a console Ctrl-C, Ctrl-Break or window close reaches every process\n on the console; this one kills the child and exits 2, no document. An\n outside kill (TerminateProcess, taskkill /F) of the 'vat' wrapper or of\n this process runs no handler and ends the processes it started with it\n (the OS job object Node puts them in): exit 1, nothing published, the\n progress directory left behind.";
|
|
90
151
|
/** What the watchdog remembers between polls. */
|
|
91
152
|
export interface WatchdogState {
|
|
92
153
|
/** How large the progress log was when it last changed. */
|
|
@@ -166,57 +227,96 @@ export declare function pollWatchdog(state: WatchdogState, observation: {
|
|
|
166
227
|
* non-negative number
|
|
167
228
|
*/
|
|
168
229
|
export declare function parseBudgetSeconds(raw: string | undefined): number;
|
|
230
|
+
/**
|
|
231
|
+
* Who asked for the supervised run: the operator, as `vat resources check`, or an orchestrator,
|
|
232
|
+
* as its `checks` phase. It decides how a kill's remedy is worded, and whether the child owes the
|
|
233
|
+
* operator the store notice (see `operator-notices.ts`).
|
|
234
|
+
*/
|
|
235
|
+
export type CheckInvocation = 'standalone' | 'phase';
|
|
236
|
+
/**
|
|
237
|
+
* What the hidden `--supervised-by` flag carries, read: everything a supervisor tells the child it
|
|
238
|
+
* spawned, in ONE value so no half of it can arrive without the other.
|
|
239
|
+
*/
|
|
240
|
+
export interface SupervisedChild {
|
|
241
|
+
/** Who started the supervision. */
|
|
242
|
+
readonly invoker: CheckInvocation;
|
|
243
|
+
/**
|
|
244
|
+
* The supervisor's pid — this process's parent when it started, checked once at boot (see
|
|
245
|
+
* {@link requireSupervisableFlags}) and named in the line the child prints when it ends itself
|
|
246
|
+
* because the supervisor is gone (`endWhenSupervisorGone`, which watches stdin, not this pid).
|
|
247
|
+
*/
|
|
248
|
+
readonly supervisorPid: number;
|
|
249
|
+
/** The progress log both processes watch; the child appends to it. */
|
|
250
|
+
readonly progressLog: string;
|
|
251
|
+
}
|
|
252
|
+
/** The hidden flag a supervisor hands the child it spawns, and nothing else passes. */
|
|
253
|
+
export declare const SUPERVISED_BY_FLAG = "--supervised-by";
|
|
254
|
+
/**
|
|
255
|
+
* The value of {@link SUPERVISED_BY_FLAG} for a child this process is about to spawn:
|
|
256
|
+
* `<invoker>:<this process's pid>:<progress log>`.
|
|
257
|
+
*
|
|
258
|
+
* The pid is what makes the flag unforgeable by accident: the child refuses it unless the pid
|
|
259
|
+
* named is its own parent's — see {@link requireSupervisableFlags}.
|
|
260
|
+
*
|
|
261
|
+
* @param child - Who asked, and where the progress goes (the supervisor is always this process)
|
|
262
|
+
* @returns The flag's value
|
|
263
|
+
*/
|
|
264
|
+
export declare function supervisedByValue(child: Omit<SupervisedChild, 'supervisorPid'>): string;
|
|
169
265
|
/**
|
|
170
266
|
* Does this process do the work, or supervise a child that does?
|
|
171
267
|
*
|
|
172
|
-
* 🚨 **The recursion guard, and the reason it is a named function.** `--
|
|
173
|
-
*
|
|
174
|
-
* budget
|
|
175
|
-
*
|
|
176
|
-
*
|
|
268
|
+
* 🚨 **The recursion guard, and the reason it is a named function.** `--supervised-by` is what a
|
|
269
|
+
* supervising parent hands its child, and it must WIN against the budget — a child that consulted
|
|
270
|
+
* the budget first would spawn a child of its own, which would spawn a child of its own. A
|
|
271
|
+
* condition inline in the command would be a fork bomb one refactor away with nothing asserting
|
|
272
|
+
* on it.
|
|
177
273
|
*
|
|
178
|
-
* `--budget 0` also runs here: there is nothing to supervise, and a spawn would
|
|
179
|
-
*
|
|
274
|
+
* `--budget 0` also runs here: there is nothing to supervise, and a spawn would cost a second
|
|
275
|
+
* process startup to buy no bound at all.
|
|
180
276
|
*
|
|
181
277
|
* @param options - The run
|
|
182
|
-
* @param options.
|
|
278
|
+
* @param options.supervisedBy - The hidden `--supervised-by` value, or undefined
|
|
183
279
|
* @param options.budgetSecs - The bound in seconds; 0 means none
|
|
184
280
|
* @returns True when the checks run in this process
|
|
185
281
|
*/
|
|
186
282
|
export declare function runsInThisProcess(options: {
|
|
187
|
-
|
|
283
|
+
supervisedBy: string | undefined;
|
|
188
284
|
budgetSecs: number;
|
|
189
285
|
}): boolean;
|
|
190
286
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* `--budget
|
|
207
|
-
*
|
|
287
|
+
* Read `--supervised-by` into the child it describes, refusing it unless this process really is
|
|
288
|
+
* the child of the supervisor it names — and refuse a `--budget` it would silently ignore.
|
|
289
|
+
*
|
|
290
|
+
* 🚨 **Not an operator's flag, and passing it by hand is refused, not tolerated.** It used to be
|
|
291
|
+
* harmless-looking: the process ran the checks unbounded, printed none of the notices its
|
|
292
|
+
* supervisor would have, and appended to a log nobody watched. A flag that silently removes the
|
|
293
|
+
* bound is the shape an operator never discovers until the hang it was meant to prevent. So the
|
|
294
|
+
* value names its supervisor's pid, and a process whose parent is not that pid is refused
|
|
295
|
+
* `USAGE_INVALID` in plain words.
|
|
296
|
+
*
|
|
297
|
+
* 🔑 **One value, so an invalid combination cannot be written.** The invoker and the progress log
|
|
298
|
+
* used to be two hidden flags that had to arrive together, refused when one came alone. Now they
|
|
299
|
+
* are fields of one value, and the only thing left to refuse is a value that does not parse.
|
|
300
|
+
*
|
|
301
|
+
* 🚨 **`--budget` beside it is refused.** The flag wins the fork in {@link runsInThisProcess}
|
|
302
|
+
* unconditionally, so `--budget 60` with it would run UNBOUNDED and say nothing. The RAW
|
|
303
|
+
* `--budget` is the discriminator, not the parsed seconds: the real spawn path never forwards
|
|
304
|
+
* `--budget`, so the child's `budgetSecs` is the default, not anything an operator typed.
|
|
305
|
+
* `--budget 0` beside it is allowed: both say "nobody is supervising this".
|
|
208
306
|
*
|
|
209
307
|
* @param options - The run
|
|
210
|
-
* @param options.
|
|
308
|
+
* @param options.supervisedBy - The hidden `--supervised-by` value, or undefined
|
|
211
309
|
* @param options.budgetRaw - What the operator actually typed for `--budget`
|
|
212
310
|
* @param options.budgetSecs - The parsed bound; 0 means none
|
|
213
|
-
* @
|
|
311
|
+
* @returns The supervised child this process is, or undefined when it is not one
|
|
312
|
+
* @throws When the flag does not parse, names a supervisor that is not this process's parent, or
|
|
313
|
+
* comes with a `--budget` it would ignore
|
|
214
314
|
*/
|
|
215
315
|
export declare function requireSupervisableFlags(options: {
|
|
216
|
-
|
|
316
|
+
supervisedBy: string | undefined;
|
|
217
317
|
budgetRaw: string | undefined;
|
|
218
318
|
budgetSecs: number;
|
|
219
|
-
}):
|
|
319
|
+
}): SupervisedChild | undefined;
|
|
220
320
|
/**
|
|
221
321
|
* Why a child ended without completing.
|
|
222
322
|
*
|
|
@@ -234,8 +334,11 @@ export type AbnormalDeath = {
|
|
|
234
334
|
readonly detail: string;
|
|
235
335
|
}
|
|
236
336
|
/**
|
|
237
|
-
* The watchdog fired and the KILL
|
|
238
|
-
* this process can tell, still running.
|
|
337
|
+
* The watchdog fired and the KILL DID NOT END THE CHILD — so the child is, as
|
|
338
|
+
* far as this process can tell, still running. `refused` says which way: the
|
|
339
|
+
* kernel refused the SIGKILL (`EPERM`, in practice), or accepted it and the
|
|
340
|
+
* child still had not ended {@link KILL_POLLS_BEFORE_REPORTING_UNREAPED} polls
|
|
341
|
+
* later (uninterruptible I/O).
|
|
239
342
|
*
|
|
240
343
|
* 🚨 Distinct from `spawn-failed` and that distinction is the whole point.
|
|
241
344
|
* Both arrive on `child.on('error')` and the handler used to read every one of
|
|
@@ -251,6 +354,7 @@ export type AbnormalDeath = {
|
|
|
251
354
|
readonly kind: 'kill-failed';
|
|
252
355
|
readonly detail: string;
|
|
253
356
|
readonly pid: number | undefined;
|
|
357
|
+
readonly refused: boolean;
|
|
254
358
|
} | {
|
|
255
359
|
readonly kind: 'no-status';
|
|
256
360
|
}
|
|
@@ -259,7 +363,7 @@ export type AbnormalDeath = {
|
|
|
259
363
|
*
|
|
260
364
|
* 🚨 The Windows half of the signal-death defect, and it survived the fix for
|
|
261
365
|
* the POSIX half. A fatal abort — Node's own heap limit among them — has no
|
|
262
|
-
* signal to report on a platform that has none, so `
|
|
366
|
+
* signal to report on a platform that has none, so `exit` fires with
|
|
263
367
|
* `(134, null)` where macOS and Linux give `(null, 'SIGABRT')`. That shape is
|
|
264
368
|
* indistinguishable from an ordinary nonzero exit to
|
|
265
369
|
* {@link resolveChildEnding}, which read it as a COMPLETED run and handed the
|
|
@@ -276,7 +380,37 @@ export type AbnormalDeath = {
|
|
|
276
380
|
| {
|
|
277
381
|
readonly kind: 'no-output';
|
|
278
382
|
readonly code: number;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* The child exited with a code and wrote something that is not this verb's
|
|
386
|
+
* document — cut off mid-write, most often. The sibling of `no-output`: the
|
|
387
|
+
* same situation (no usable report), so the same ending (the interrupted
|
|
388
|
+
* document from the progress log), never an internal error.
|
|
389
|
+
*/
|
|
390
|
+
| {
|
|
391
|
+
readonly kind: 'unparseable-output';
|
|
392
|
+
readonly code: number;
|
|
393
|
+
readonly detail: string;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* The child published a whole, valid document — and then exited with a code that document does
|
|
397
|
+
* not imply.
|
|
398
|
+
*
|
|
399
|
+
* 🚨 The document alone decided the forwarded exit, so a complete `ok` report followed by a
|
|
400
|
+
* non-zero exit was forwarded as a clean pass. Every path through the command ends on the code
|
|
401
|
+
* its own document derives, so a disagreement means something ended the child AFTER it wrote —
|
|
402
|
+
* a crash in teardown, a termination from outside that left an exit code — or a defect in vat.
|
|
403
|
+
* Which of the two is the truth cannot be known here, so neither is forwarded.
|
|
404
|
+
*/
|
|
405
|
+
| {
|
|
406
|
+
readonly kind: 'exit-disagrees';
|
|
407
|
+
readonly code: number;
|
|
408
|
+
readonly documentExit: number;
|
|
279
409
|
};
|
|
410
|
+
/** A watchdog SIGKILL that did not end the child — the fields of the `kill-failed` death. */
|
|
411
|
+
type KillFailure = Omit<Extract<AbnormalDeath, {
|
|
412
|
+
kind: 'kill-failed';
|
|
413
|
+
}>, 'kind'>;
|
|
280
414
|
/** What a child's ending MEANT, once the watchdog's belief is reconciled with it. */
|
|
281
415
|
export type RunResolution = {
|
|
282
416
|
readonly kind: 'completed';
|
|
@@ -288,11 +422,11 @@ export type RunResolution = {
|
|
|
288
422
|
readonly death: AbnormalDeath;
|
|
289
423
|
};
|
|
290
424
|
/**
|
|
291
|
-
* Read `
|
|
425
|
+
* Read `exit`'s two arguments, and the watchdog's belief, into one answer.
|
|
292
426
|
*
|
|
293
427
|
* ## 🚨 The defect this closes: a signal death READ AS SUCCESS
|
|
294
428
|
*
|
|
295
|
-
* `
|
|
429
|
+
* `exit` fires with `(code, signal)`, and a process that dies from a signal has
|
|
296
430
|
* `code === null` with `signal` set. This handler used to read only the code and
|
|
297
431
|
* coerce it — `resolve(exitCode ?? 0)` — so every signal death became a
|
|
298
432
|
* COMPLETED run with exit code 0. The parent then forwarded an empty stdout and
|
|
@@ -333,12 +467,12 @@ export type RunResolution = {
|
|
|
333
467
|
* kill), and only then a failure to start. A run whose kill was refused must
|
|
334
468
|
* never claim the watchdog was uninvolved.
|
|
335
469
|
*
|
|
336
|
-
* @param ending - What `
|
|
337
|
-
* @param ending.code - `
|
|
338
|
-
* @param ending.signal - `
|
|
470
|
+
* @param ending - What `exit` reported, plus what the supervisor did and saw
|
|
471
|
+
* @param ending.code - `exit`'s first argument
|
|
472
|
+
* @param ending.signal - `exit`'s second argument
|
|
339
473
|
* @param ending.killed - Whether the watchdog sent SIGKILL
|
|
340
474
|
* @param ending.spawnError - Set when the child never started at all
|
|
341
|
-
* @param ending.killFailure - Set when the watchdog's SIGKILL was
|
|
475
|
+
* @param ending.killFailure - Set when the watchdog's SIGKILL was refused, or did not end the child
|
|
342
476
|
* @returns What actually happened
|
|
343
477
|
*/
|
|
344
478
|
export declare function resolveChildEnding(ending: {
|
|
@@ -349,23 +483,20 @@ export declare function resolveChildEnding(ending: {
|
|
|
349
483
|
binary: string;
|
|
350
484
|
detail: string;
|
|
351
485
|
} | undefined;
|
|
352
|
-
killFailure?:
|
|
353
|
-
detail: string;
|
|
354
|
-
pid: number | undefined;
|
|
355
|
-
} | undefined;
|
|
486
|
+
killFailure?: KillFailure | undefined;
|
|
356
487
|
}): RunResolution;
|
|
357
488
|
/**
|
|
358
489
|
* Reconcile "how the process ended" with "what it left behind".
|
|
359
490
|
*
|
|
360
491
|
* ## 🚨 A completion that PUBLISHED NOTHING did not complete
|
|
361
492
|
*
|
|
362
|
-
* {@link resolveChildEnding} answers a question about the process — what `
|
|
493
|
+
* {@link resolveChildEnding} answers a question about the process — what `exit`
|
|
363
494
|
* reported, reconciled with what the supervisor did. This answers a DIFFERENT
|
|
364
495
|
* one, about the artifact, and the two disagree in exactly one place: a child
|
|
365
496
|
* that exited with a code and wrote no document.
|
|
366
497
|
*
|
|
367
|
-
* Every in-process path through `checkCommand` ends at `
|
|
368
|
-
* `
|
|
498
|
+
* Every in-process path through `checkCommand` ends at `endWithReport` or at
|
|
499
|
+
* `endWithRefusal`, and both write to stdout — a clean pass, a violation, a
|
|
369
500
|
* bricked config, a mistyped `--check`. There is no exit this command can take
|
|
370
501
|
* that legitimately publishes nothing. So an empty stdout is not a quiet run, it
|
|
371
502
|
* is a run that was cut off before it could say anything, and forwarding its
|
|
@@ -379,11 +510,10 @@ export declare function resolveChildEnding(ending: {
|
|
|
379
510
|
* ordering argument that has already been got wrong twice. It runs AFTER, on the
|
|
380
511
|
* one branch it can change, and it changes no other.
|
|
381
512
|
*
|
|
382
|
-
* ⚠️ **Blank, not unparseable.**
|
|
383
|
-
*
|
|
384
|
-
*
|
|
385
|
-
*
|
|
386
|
-
* limit of this test rather than an oversight.
|
|
513
|
+
* ⚠️ **Blank, not unparseable.** This asks only whether anything was written.
|
|
514
|
+
* Whether the bytes parse is asked next, by {@link readCompletedDocument}, which
|
|
515
|
+
* knows the format: a truncated document — an abort that landed mid-write — is
|
|
516
|
+
* the sibling `unparseable-output` death, and ends the same way.
|
|
387
517
|
*
|
|
388
518
|
* @param resolution - How the process ended
|
|
389
519
|
* @param stdout - Everything the child wrote to stdout
|
|
@@ -393,8 +523,7 @@ export declare function resolveSilentCompletion(resolution: RunResolution, stdou
|
|
|
393
523
|
/** How a supervised run ended. */
|
|
394
524
|
export type SupervisedRun = {
|
|
395
525
|
readonly outcome: 'completed';
|
|
396
|
-
readonly
|
|
397
|
-
readonly stdout: string;
|
|
526
|
+
readonly document: ForwardedDocument;
|
|
398
527
|
} | {
|
|
399
528
|
readonly outcome: 'killed';
|
|
400
529
|
readonly log: string;
|
|
@@ -408,15 +537,19 @@ export type SupervisedRun = {
|
|
|
408
537
|
/**
|
|
409
538
|
* Run `vat resources check` as a child, bounded by the budget.
|
|
410
539
|
*
|
|
411
|
-
* `stdio` is `['
|
|
412
|
-
*
|
|
413
|
-
*
|
|
540
|
+
* `stdio` is `['pipe', 'pipe', 'inherit']`. Its stdin is a pipe this process
|
|
541
|
+
* holds open and NEVER writes to or ends: it exists only so that the child reads
|
|
542
|
+
* end-of-file the moment this process is gone, however it went (see
|
|
543
|
+
* `endWhenSupervisorGone`). Node closes this end itself once the child has
|
|
544
|
+
* exited. The child's stdout is accumulated so the parent can forward the
|
|
545
|
+
* document verbatim, and its stderr is INHERITED so warnings and blob-stage
|
|
546
|
+
* refusals stream live exactly as they do today.
|
|
414
547
|
*
|
|
415
548
|
* ⚠️ Asynchronous `spawn`, never `spawnSync`. The parent's event loop is the
|
|
416
549
|
* thing holding the watchdog timer; a synchronous spawn would block it for
|
|
417
550
|
* precisely as long as the run it is supposed to be bounding.
|
|
418
551
|
*
|
|
419
|
-
* 🚨 There is an `error` listener as well as
|
|
552
|
+
* 🚨 There is an `error` listener as well as an `exit` one, and it is not
|
|
420
553
|
* optional politeness: without it an unspawnable binary is an unhandled `error`
|
|
421
554
|
* event, which Node turns into a stack dump instead of a report. It fails
|
|
422
555
|
* closed, so this is legibility — but a stack dump is not a report.
|
|
@@ -454,26 +587,137 @@ export type SupervisedRun = {
|
|
|
454
587
|
* contorted to make it testable; the branch ordering and the message
|
|
455
588
|
* composition are pure functions and are pinned as such.
|
|
456
589
|
*
|
|
590
|
+
* ⏱️ Every interval is read off `performance.now()`, the monotonic clock: a
|
|
591
|
+
* wall clock stepped by NTP or an operator would grow or shrink the budget.
|
|
592
|
+
*
|
|
457
593
|
* @param options - The run
|
|
458
|
-
* @param options.args - The child's argv after the node binary, `--
|
|
459
|
-
* @param options.
|
|
594
|
+
* @param options.args - The child's argv after the node binary, `--supervised-by` included
|
|
595
|
+
* @param options.log - The progress log both sides agreed on, and the guard {@link withProgressLog} holds over it
|
|
460
596
|
* @param options.budgetMs - How long silence is allowed to last
|
|
597
|
+
* @param options.format - The format the child was asked for, to read its document in
|
|
461
598
|
* @returns How the child ended, and what it left behind
|
|
462
599
|
*/
|
|
463
600
|
export declare function superviseCheck(options: {
|
|
464
601
|
args: readonly string[];
|
|
465
|
-
|
|
602
|
+
log: ProgressLog;
|
|
466
603
|
budgetMs: number;
|
|
604
|
+
format: 'yaml' | 'json';
|
|
467
605
|
}): Promise<SupervisedRun>;
|
|
468
606
|
/**
|
|
469
|
-
*
|
|
607
|
+
* The guard {@link withProgressLog} holds over one supervision: what {@link superviseCheck} tells it.
|
|
608
|
+
*/
|
|
609
|
+
export interface SupervisionGuard {
|
|
610
|
+
/** From now on, every ending of this process takes `child` down with it. */
|
|
611
|
+
watch(child: ChildProcess): void;
|
|
612
|
+
}
|
|
613
|
+
/** A progress log, and the guard over its whole life — one value, so neither travels without the other. */
|
|
614
|
+
export interface ProgressLog {
|
|
615
|
+
/** The log's path, alone in a directory minted for this run. */
|
|
616
|
+
readonly path: string;
|
|
617
|
+
/** The guard over the log's directory and the child that writes it. */
|
|
618
|
+
readonly guard: SupervisionGuard;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* While a supervision lives, make every way THIS process ends take the child and the progress
|
|
622
|
+
* directory with it.
|
|
623
|
+
*
|
|
624
|
+
* ## 🚨 The defect: a supervisor that ended without its child orphaned an unbounded run
|
|
625
|
+
*
|
|
626
|
+
* The bound is enforced by this process's timer. Anything that ends this process ends the timer —
|
|
627
|
+
* and the child it was bounding was reparented and kept running with nothing left to stop it: the
|
|
628
|
+
* exact unbounded hang the supervisor exists to abolish. Measured ways in: a SIGTERM, SIGHUP or
|
|
629
|
+
* SIGINT sent to this pid alone; an uncaught throw anywhere in this process (the last-resort handler
|
|
630
|
+
* ends it with `process.exit` — the poll's own throw is caught in {@link superviseCheck}, so this is
|
|
631
|
+
* the second line for it); and a kill the kernel refused, which settles the run while the child
|
|
632
|
+
* lives on.
|
|
633
|
+
*
|
|
634
|
+
* So for the supervision's WHOLE life — from before the progress directory is minted until after
|
|
635
|
+
* it is removed, see {@link withProgressLog}:
|
|
636
|
+
*
|
|
637
|
+
* - **`exit`** SIGKILLs the child (`CHECKS_CHILD_TREE`), once there is one and while it runs, and removes the progress directory, once there is one — every ending of this process that
|
|
638
|
+
* runs any of its code passes through it, a last-resort `process.exit` included, and
|
|
639
|
+
* `process.exit` runs no `finally`.
|
|
640
|
+
* - **Every `TERMINATING_SIGNALS` member**, through `handleTerminatingSignals`: does the same,
|
|
641
|
+
* synchronously, and RE-RAISES the signal. On POSIX this process then dies of it (status 128 + n),
|
|
642
|
+
* as a shell and a CI runner expect. On Windows, or where the signal cannot kill it (PID 1), it
|
|
643
|
+
* exits 2 with no document. A repeat with the first is swallowed. The child shares this
|
|
644
|
+
* process's group, so a terminal's Ctrl-C reaches it directly too and, with no handler of its
|
|
645
|
+
* own, ends it; this guard kills it all the same.
|
|
646
|
+
*
|
|
647
|
+
* The release waits for the child's `exit`, not for the run to settle, so a run settled with its
|
|
648
|
+
* child still alive (a refused kill, a poll that threw) still takes the child down however this
|
|
649
|
+
* process then ends.
|
|
650
|
+
*
|
|
651
|
+
* The module header gives why SIGKILL, and why the CHILD must never install a handler. This
|
|
652
|
+
* process may: its event loop is never blocked, which is what makes a handler fire at all.
|
|
653
|
+
*
|
|
654
|
+
* ## ⚠️ What no guard here reaches
|
|
655
|
+
*
|
|
656
|
+
* An ending that runs none of this process's code: SIGKILL, an OOM killer, and on Windows ANY
|
|
657
|
+
* outside kill — `process.kill(pid, <signal>)` there is `TerminateProcess`, which runs neither a
|
|
658
|
+
* signal handler nor the `exit` guard. On Windows the OS ends the child with this process (libuv's
|
|
659
|
+
* kill-on-close job object — see the module header). On POSIX the child covers those itself: it
|
|
660
|
+
* reads end-of-file on the stdin pipe this process held (`endWhenSupervisorGone`). A child blocked
|
|
661
|
+
* inside one SQLite statement reaches nothing until the statement returns.
|
|
662
|
+
*
|
|
663
|
+
* @returns The guard: `cover` names the progress log once it exists, `watch` the child once it is
|
|
664
|
+
* spawned, and `release` ends the guard — at once, or at the watched child's `exit`
|
|
665
|
+
*/
|
|
666
|
+
declare function guardSupervision(): SupervisionGuard & {
|
|
667
|
+
cover(logPath: string): void;
|
|
668
|
+
release(): void;
|
|
669
|
+
};
|
|
670
|
+
/**
|
|
671
|
+
* How often to look at the log.
|
|
672
|
+
*
|
|
673
|
+
* Derived from the budget rather than fixed, so `--budget 2` notices in 200 ms
|
|
674
|
+
* while `--budget 600` does not wake the event loop 12,000 times for nothing.
|
|
675
|
+
*
|
|
676
|
+
* @param budgetMs - The budget
|
|
677
|
+
* @returns The poll interval in milliseconds
|
|
678
|
+
*/
|
|
679
|
+
declare function pollIntervalMs(budgetMs: number): number;
|
|
680
|
+
/**
|
|
681
|
+
* Run `work` with a fresh progress log, and remove it however that ends — a signal included.
|
|
470
682
|
*
|
|
471
683
|
* ⚠️ Ephemeral, per run, and it carries NO format version — see
|
|
472
684
|
* `check-progress.ts`. It is written and read by one process pair within one run
|
|
473
685
|
* of one build, so the reader's own `.strict()` schema is the entire contract.
|
|
474
686
|
*
|
|
475
|
-
* @
|
|
476
|
-
*
|
|
687
|
+
* 🔑 The guard ({@link guardSupervision}) is installed BEFORE the directory is
|
|
688
|
+
* minted and released only AFTER it is removed, so a signal in either window —
|
|
689
|
+
* not only while the child runs — still removes it. One guard, one lifetime.
|
|
690
|
+
*
|
|
691
|
+
* @param work - Given the log
|
|
692
|
+
* @returns What `work` returned, with the log's directory as a `leftover` when the OS
|
|
693
|
+
* would not remove it (see `withTempDir`) — for the caller to report as a warning
|
|
477
694
|
*/
|
|
478
|
-
export declare function withProgressLog<T>(work: (
|
|
695
|
+
export declare function withProgressLog<T>(work: (log: ProgressLog) => Promise<T>): Promise<TempDirOutcome<T>>;
|
|
696
|
+
/**
|
|
697
|
+
* Read what a COMPLETED child wrote as `resources check`'s document, or name
|
|
698
|
+
* the death when it is not one — or when the child's exit disagrees with it.
|
|
699
|
+
*
|
|
700
|
+
* 🔑 The exit is compared with the one the document itself derives. The parent
|
|
701
|
+
* forwards the DOCUMENT's code, never the process's, so a child that wrote a
|
|
702
|
+
* clean report and then exited non-zero would otherwise be published as a pass.
|
|
703
|
+
*
|
|
704
|
+
* @param stdout - Everything the child wrote (known not to be blank)
|
|
705
|
+
* @param code - The child's exit code
|
|
706
|
+
* @param format - The format the child was asked for
|
|
707
|
+
* @returns The forwardable document, or the `unparseable-output` / `exit-disagrees` death
|
|
708
|
+
*/
|
|
709
|
+
export declare function readCompletedDocument(stdout: string, code: number, format: 'yaml' | 'json'): {
|
|
710
|
+
readonly document: ForwardedDocument;
|
|
711
|
+
} | {
|
|
712
|
+
readonly death: AbnormalDeath;
|
|
713
|
+
};
|
|
714
|
+
/** Test-facing seam: the pure decisions of this module, reached by its unit tests. */
|
|
715
|
+
export declare const __internal: {
|
|
716
|
+
pollIntervalMs: typeof pollIntervalMs;
|
|
717
|
+
guardSupervision: typeof guardSupervision;
|
|
718
|
+
KILL_ATTEMPTS_BEFORE_REPORTING: number;
|
|
719
|
+
KILL_POLLS_BEFORE_REPORTING_UNREAPED: number;
|
|
720
|
+
STDOUT_GRACE_AFTER_EXIT_MS: number;
|
|
721
|
+
};
|
|
722
|
+
export {};
|
|
479
723
|
//# sourceMappingURL=check-supervisor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-supervisor.d.ts","sourceRoot":"","sources":["../../../src/commands/resources/check-supervisor.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"check-supervisor.d.ts","sourceRoot":"","sources":["../../../src/commands/resources/check-supervisor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsHG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,oBAAoB,CAAC;AAK9D,OAAO,EAKL,KAAK,cAAc,EAEpB,MAAM,2BAA2B,CAAC;AAInC,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAI/F;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,i8CAqBN,CAAC;AAuCnC,iDAAiD;AACjD,MAAM,WAAW,aAAa;IAC5B,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,8DAA8D;IAC9D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MA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