@cbartens/bkit 0.0.0-stage → 5.0.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/.bkit/README.md +417 -0
- package/.bkit/core/.agents/context.md +95 -0
- package/.bkit/core/.agents/docs.md +62 -0
- package/.bkit/core/.agents/rules.md +147 -0
- package/.bkit/core/.agents/skills.md +43 -0
- package/.bkit/core/.bkit/LICENSE.md +151 -0
- package/.bkit/core/.bkit/README.md +417 -0
- package/.bkit/core/.bkit/cloud.md +493 -0
- package/.bkit/core/.bkit/comparison.md +321 -0
- package/.bkit/core/.bkit/install.md +401 -0
- package/.bkit/core/.bkit/jsonl.md +497 -0
- package/.bkit/core/.bkit/prompts.md +474 -0
- package/.bkit/core/.bkit/providers.md +598 -0
- package/.bkit/core/.bkit/templates.md +470 -0
- package/.bkit/core/.bkit/trackers.md +95 -0
- package/.bkit/core/.bkit/workflows.md +1550 -0
- package/.bkit/core/.claude/hooks/bkit-gateguard.cjs +82 -0
- package/.bkit/core/.claude/hooks/bkit-guardrails.cjs +93 -0
- package/.bkit/core/.claude/hooks/bkit-preflight.sh +74 -0
- package/.bkit/core/.codex/hooks/bkit-gateguard.cjs +115 -0
- package/.bkit/core/.codex/hooks/bkit-guardrails.cjs +135 -0
- package/.bkit/core/.cursor/hooks/bkit-gateguard.cjs +111 -0
- package/.bkit/core/.cursor/hooks/bkit-guardrails.cjs +169 -0
- package/.bkit/core/.cursor/hooks/bkit-preflight.sh +63 -0
- package/.bkit/core/.opencode/plugin/bkit-gateguard.js +225 -0
- package/.bkit/core/AGENTS.md +77 -0
- package/.bkit/core/LICENSE.md +149 -0
- package/.bkit/core/docs/templates/bkit-audit-accessibility.md +272 -0
- package/.bkit/core/docs/templates/bkit-audit-adoption.md +223 -0
- package/.bkit/core/docs/templates/bkit-audit-agents.md +230 -0
- package/.bkit/core/docs/templates/bkit-audit-aio-seo.md +227 -0
- package/.bkit/core/docs/templates/bkit-audit-analytics.md +266 -0
- package/.bkit/core/docs/templates/bkit-audit-annotations.md +230 -0
- package/.bkit/core/docs/templates/bkit-audit-app-performance.md +270 -0
- package/.bkit/core/docs/templates/bkit-audit-app-store.md +254 -0
- package/.bkit/core/docs/templates/bkit-audit-architecture.md +221 -0
- package/.bkit/core/docs/templates/bkit-audit-ci-performance.md +241 -0
- package/.bkit/core/docs/templates/bkit-audit-config.md +230 -0
- package/.bkit/core/docs/templates/bkit-audit-cost.md +218 -0
- package/.bkit/core/docs/templates/bkit-audit-coverage.md +221 -0
- package/.bkit/core/docs/templates/bkit-audit-database.md +229 -0
- package/.bkit/core/docs/templates/bkit-audit-dead-code.md +251 -0
- package/.bkit/core/docs/templates/bkit-audit-deferrals.md +283 -0
- package/.bkit/core/docs/templates/bkit-audit-dependencies.md +268 -0
- package/.bkit/core/docs/templates/bkit-audit-documentation.md +280 -0
- package/.bkit/core/docs/templates/bkit-audit-duplication.md +253 -0
- package/.bkit/core/docs/templates/bkit-audit-failures.md +259 -0
- package/.bkit/core/docs/templates/bkit-audit-flakes.md +237 -0
- package/.bkit/core/docs/templates/bkit-audit-gates.md +250 -0
- package/.bkit/core/docs/templates/bkit-audit-issues.md +273 -0
- package/.bkit/core/docs/templates/bkit-audit-llm.md +239 -0
- package/.bkit/core/docs/templates/bkit-audit-logs.md +266 -0
- package/.bkit/core/docs/templates/bkit-audit-models.md +210 -0
- package/.bkit/core/docs/templates/bkit-audit-privacy.md +211 -0
- package/.bkit/core/docs/templates/bkit-audit-prompts.md +216 -0
- package/.bkit/core/docs/templates/bkit-audit-red-team.md +220 -0
- package/.bkit/core/docs/templates/bkit-audit-reliability.md +222 -0
- package/.bkit/core/docs/templates/bkit-audit-repo.md +224 -0
- package/.bkit/core/docs/templates/bkit-audit-security.md +274 -0
- package/.bkit/core/docs/templates/bkit-audit-slop.md +200 -0
- package/.bkit/core/docs/templates/bkit-audit-testing.md +270 -0
- package/.bkit/core/docs/templates/bkit-audit-usability.md +237 -0
- package/.bkit/core/docs/templates/bkit-plan.md +476 -0
- package/.bkit/core/engine/checks/after/auth.ts +149 -0
- package/.bkit/core/engine/checks/after/ci-yml.ts +701 -0
- package/.bkit/core/engine/checks/after/github.ts +424 -0
- package/.bkit/core/engine/checks/after/index.ts +530 -0
- package/.bkit/core/engine/checks/after/managed.ts +217 -0
- package/.bkit/core/engine/checks/after/suppression.ts +53 -0
- package/.bkit/core/engine/checks/after/tools.ts +427 -0
- package/.bkit/core/engine/checks/before/context-fetch.ts +429 -0
- package/.bkit/core/engine/checks/before/env.ts +187 -0
- package/.bkit/core/engine/checks/before/files.ts +204 -0
- package/.bkit/core/engine/checks/before/index.ts +206 -0
- package/.bkit/core/engine/checks/before/mcp.ts +127 -0
- package/.bkit/core/engine/checks/before/repo.ts +77 -0
- package/.bkit/core/engine/checks/before/version.ts +67 -0
- package/.bkit/core/engine/checks/status-holes.ts +479 -0
- package/.bkit/core/engine/cli.ts +867 -0
- package/.bkit/core/engine/commands/analysis.ts +550 -0
- package/.bkit/core/engine/commands/ci/ci.ts +483 -0
- package/.bkit/core/engine/commands/comply.ts +415 -0
- package/.bkit/core/engine/commands/harvest.ts +459 -0
- package/.bkit/core/engine/commands/install/check.ts +70 -0
- package/.bkit/core/engine/commands/install/doctor.ts +254 -0
- package/.bkit/core/engine/commands/install/install.ts +550 -0
- package/.bkit/core/engine/commands/install/uninstall.ts +995 -0
- package/.bkit/core/engine/commands/install/upgrade.ts +1037 -0
- package/.bkit/core/engine/commands/launch.ts +139 -0
- package/.bkit/core/engine/commands/lib.ts +495 -0
- package/.bkit/core/engine/commands/registry.ts +53 -0
- package/.bkit/core/engine/commands/setup/setup.ts +184 -0
- package/.bkit/core/engine/commands/telemetry.ts +32 -0
- package/.bkit/core/engine/commands/workflow/branches.ts +1514 -0
- package/.bkit/core/engine/commands/workflow/context.ts +961 -0
- package/.bkit/core/engine/commands/workflow/counters.ts +268 -0
- package/.bkit/core/engine/commands/workflow/fids.ts +243 -0
- package/.bkit/core/engine/commands/workflow/issues.ts +675 -0
- package/.bkit/core/engine/commands/workflow/ledgers.ts +575 -0
- package/.bkit/core/engine/commands/workflow/locks.ts +478 -0
- package/.bkit/core/engine/commands/workflow/prs.ts +1087 -0
- package/.bkit/core/engine/commands/workflow/repo.ts +220 -0
- package/.bkit/core/engine/commands/workflow/roadmap.ts +576 -0
- package/.bkit/core/engine/commands/workflow/runs.ts +2140 -0
- package/.bkit/core/engine/commands/workflow/runtime.ts +300 -0
- package/.bkit/core/engine/commands/workflow/skills.ts +118 -0
- package/.bkit/core/engine/commands/workflow/status.ts +455 -0
- package/.bkit/core/engine/commands/workflow/steps.ts +1300 -0
- package/.bkit/core/engine/commands/workflow/tests.ts +161 -0
- package/.bkit/core/engine/commands/workflow/workflows.ts +1573 -0
- package/.bkit/core/engine/commands/workflow/workstreams.ts +164 -0
- package/.bkit/core/engine/commands/workflow/worktrees.ts +534 -0
- package/.bkit/core/engine/install/cloud-env.ts +924 -0
- package/.bkit/core/engine/install/managed-block.ts +212 -0
- package/.bkit/core/engine/install/manifest.ts +448 -0
- package/.bkit/core/engine/install/modules/claude.ts +362 -0
- package/.bkit/core/engine/install/modules/cloud.ts +173 -0
- package/.bkit/core/engine/install/modules/codex.ts +219 -0
- package/.bkit/core/engine/install/modules/core.ts +620 -0
- package/.bkit/core/engine/install/modules/cursor.ts +231 -0
- package/.bkit/core/engine/install/modules/index.ts +242 -0
- package/.bkit/core/engine/install/modules/opencode.ts +573 -0
- package/.bkit/core/engine/install/payload-links.ts +150 -0
- package/.bkit/core/engine/install/placeholders.ts +108 -0
- package/.bkit/core/engine/install/template-copies.ts +119 -0
- package/.bkit/core/engine/install/version-file.ts +284 -0
- package/.bkit/core/engine/install/write.ts +467 -0
- package/.bkit/core/engine/ledgers/clamp-log.ts +32 -0
- package/.bkit/core/engine/ledgers/status.ts +213 -0
- package/.bkit/core/engine/ledgers/telemetry.ts +1143 -0
- package/.bkit/core/engine/render/hosts.ts +372 -0
- package/.bkit/core/engine/render/models.ts +323 -0
- package/.bkit/core/engine/render/parts.ts +38 -0
- package/.bkit/core/engine/render/trackers.ts +170 -0
- package/.bkit/core/engine/shared/egress.ts +345 -0
- package/.bkit/core/engine/shared/json.ts +16 -0
- package/.bkit/core/engine/shared/log-prefix.ts +9 -0
- package/.bkit/core/engine/shared/package-json.ts +29 -0
- package/.bkit/core/engine/shared/package-manager.ts +38 -0
- package/.bkit/core/engine/shared/package-roots.ts +163 -0
- package/.bkit/core/engine/shared/protected-paths.ts +164 -0
- package/.bkit/core/engine/shared/settings.ts +72 -0
- package/.bkit/core/engine/shared/timeouts.ts +20 -0
- package/.bkit/core/engine/tools/wording.ts +748 -0
- package/.bkit/core/hooks/gateguard-edit-payload.js +18 -0
- package/.bkit/core/hooks/gateguard-engine.js +193 -0
- package/.bkit/core/hooks/guardrails-shell.js +154 -0
- package/.bkit/core/hooks/guardrails-tiers.js +68 -0
- package/.bkit/core/hooks/preflight-linear.sh +73 -0
- package/.bkit/core/prompts/bkit-audit-generate.md +66 -0
- package/.bkit/core/prompts/bkit-build-challenge-1.md +79 -0
- package/.bkit/core/prompts/bkit-build-challenge-2.md +81 -0
- package/.bkit/core/prompts/bkit-build-challenge-reconcile.md +68 -0
- package/.bkit/core/prompts/bkit-build-challenge-remediate.md +70 -0
- package/.bkit/core/prompts/bkit-build-challenge-tests.md +73 -0
- package/.bkit/core/prompts/bkit-build-install-skills.md +67 -0
- package/.bkit/core/prompts/bkit-build-plan-current.md +75 -0
- package/.bkit/core/prompts/bkit-build-plan-execute.md +72 -0
- package/.bkit/core/prompts/bkit-build-plan-gaps-remediate.md +73 -0
- package/.bkit/core/prompts/bkit-build-plan-verify.md +88 -0
- package/.bkit/core/prompts/bkit-build-summary.md +93 -0
- package/.bkit/core/prompts/bkit-debug-abort-handover.md +90 -0
- package/.bkit/core/prompts/bkit-debug-failure-diagnose.md +151 -0
- package/.bkit/core/prompts/bkit-debug-failure-remediate.md +78 -0
- package/.bkit/core/prompts/bkit-debug-failure-soak.md +73 -0
- package/.bkit/core/prompts/bkit-debug-summary.md +95 -0
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-1.md +72 -0
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-2.md +72 -0
- package/.bkit/core/prompts/bkit-design-brainstorm-ideate-3.md +75 -0
- package/.bkit/core/prompts/bkit-design-generate.md +110 -0
- package/.bkit/core/prompts/bkit-design-organise.md +85 -0
- package/.bkit/core/prompts/bkit-design-review-1.md +121 -0
- package/.bkit/core/prompts/bkit-design-review-2.md +111 -0
- package/.bkit/core/prompts/bkit-design-spike.md +97 -0
- package/.bkit/core/prompts/bkit-design-summary.md +106 -0
- package/.bkit/core/prompts/bkit-design-update.md +66 -0
- package/.bkit/core/prompts/bkit-plan-complexity-check.md +66 -0
- package/.bkit/core/prompts/bkit-plan-complexity-split.md +87 -0
- package/.bkit/core/prompts/bkit-plan-generate.md +74 -0
- package/.bkit/core/prompts/bkit-plan-review-1.md +90 -0
- package/.bkit/core/prompts/bkit-plan-review-2.md +80 -0
- package/.bkit/core/prompts/bkit-plan-review-3.md +92 -0
- package/.bkit/core/prompts/bkit-plan-scope-check-1.md +84 -0
- package/.bkit/core/prompts/bkit-plan-scope-check-2.md +84 -0
- package/.bkit/core/prompts/bkit-plan-summary.md +106 -0
- package/.bkit/core/prompts/bkit-plan-update.md +68 -0
- package/.bkit/core/prompts/bkit-ship-conflict-resolve.md +90 -0
- package/.bkit/core/prompts/bkit-ship-deferred-sweep.md +94 -0
- package/.bkit/core/prompts/bkit-ship-summary.md +77 -0
- package/.bkit/core/prompts/bkit-ship-update-docs.md +71 -0
- package/.bkit/core/prompts/bkit-utility-compress-markdown.md +91 -0
- package/.bkit/core/prompts/bkit-utility-update-decisions.md +75 -0
- package/.bkit/core/prompts/bkit-utility-update-deferrals.md +76 -0
- package/.bkit/core/prompts/bkit-utility-update-documentation.md +61 -0
- package/.bkit/core/prompts/bkit-utility-update-failures.md +76 -0
- package/.bkit/core/prompts/bkit-utility-update-knowledge.md +75 -0
- package/.bkit/core/prompts/bkit-utility-update-roadmap.md +82 -0
- package/.bkit/core/workflows/bkit-auto.md +121 -0
- package/.bkit/core/workflows/bkit-build.md +802 -0
- package/.bkit/core/workflows/bkit-debug.md +649 -0
- package/.bkit/core/workflows/bkit-design.md +495 -0
- package/.bkit/core/workflows/bkit-plan.md +510 -0
- package/.bkit/core/workflows/bkit-ship.md +650 -0
- package/.bkit/shared/.bkit/.env.example +86 -0
- package/.bkit/shared/.claude/bkit-cloud.md +117 -0
- package/.bkit/shared/.claude/settings.json +88 -0
- package/.bkit/shared/.codex/hooks.json +26 -0
- package/.bkit/shared/.cursor/bkit-cloud.md +84 -0
- package/.bkit/shared/.cursor/hooks.json +26 -0
- package/.bkit/shared/.cursor/mcp.json +15 -0
- package/.bkit/shared/.cursor/rules/bkit-rules.mdc +12 -0
- package/.bkit/shared/.gitattributes +37 -0
- package/.bkit/shared/.mcp.json +16 -0
- package/.bkit/shared/.opencode/opencode.json +62 -0
- package/.bkit/shared/CLAUDE.md +11 -0
- package/.bkit/shared/LICENSE.md +22 -0
- package/.bkit/shared/docs/architecture.md +19 -0
- package/.bkit/shared/docs/data-schema.md +19 -0
- package/.bkit/shared/docs/deployments.md +433 -0
- package/.bkit/shared/docs/design.md +39 -0
- package/.bkit/shared/docs/noise.md +19 -0
- package/.bkit/shared/docs/observability.md +25 -0
- package/.bkit/shared/docs/security.md +42 -0
- package/.bkit/shared/docs/setup.md +30 -0
- package/.bkit/shared/docs/technology.md +18 -0
- package/.bkit/shared/docs/testing.md +413 -0
- package/.bkit/shared/gitignore +97 -0
- package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +187 -0
- package/.bkit/templates/.cursor/Dockerfile +68 -0
- package/.bkit/templates/.cursor/environment.json +6 -0
- package/.bkit/templates/.cursor/settings.json +11 -0
- package/.bkit/templates/.envrc +7 -0
- package/.bkit/templates/.github/dependabot.yml +52 -0
- package/.bkit/templates/.github/renovate.json5 +224 -0
- package/.bkit/templates/.github/workflows/bkit-ci.yml +1062 -0
- package/.bkit/templates/.github/workflows/bkit-cloud.yml +564 -0
- package/.bkit/templates/.github/workflows/bkit-renovate.yml +102 -0
- package/.bkit/templates/.graphifyignore +108 -0
- package/.bkit/templates/.husky/pre-commit +16 -0
- package/.bkit/templates/.husky/pre-push +91 -0
- package/.bkit/templates/.lintstagedrc.json +3 -0
- package/.bkit/templates/.prettierignore +41 -0
- package/.bkit/templates/.serena/project.yml +243 -0
- package/.bkit/templates/.vale/styles/House/Filler.yml +11 -0
- package/.bkit/templates/.vale/styles/House/Hedging.yml +12 -0
- package/.bkit/templates/.vale/styles/House/LLMSlop.yml +13 -0
- package/.bkit/templates/.vale/styles/House/Verbose.yml +12 -0
- package/.bkit/templates/.vale.ini +67 -0
- package/.bkit/templates/LICENSE.md +22 -0
- package/.bkit/templates/context/bkit-cloudrun.md +84 -0
- package/.bkit/templates/context/bkit-expo.md +186 -0
- package/.bkit/templates/context/bkit-github.md +79 -0
- package/.bkit/templates/context/bkit-inngest.md +45 -0
- package/.bkit/templates/context/bkit-maestro.md +76 -0
- package/.bkit/templates/context/bkit-playwright.md +62 -0
- package/.bkit/templates/context/bkit-resend.md +36 -0
- package/.bkit/templates/context/bkit-sentry.md +65 -0
- package/.bkit/templates/context/bkit-serena.md +33 -0
- package/.bkit/templates/context/bkit-stripe.md +36 -0
- package/.bkit/templates/context/bkit-supabase.md +59 -0
- package/.bkit/templates/context/bkit-tavily.md +49 -0
- package/.bkit/templates/context/bkit-vercel.md +64 -0
- package/.bkit/templates/docs/capabilities.md +72 -0
- package/.bkit/templates/scripts/ci/accepted-divergences.json +21 -0
- package/.bkit/templates/scripts/ci/check-accepted-divergences.mjs +152 -0
- package/.bkit/templates/scripts/ci/check-accepted-divergences.test.mjs +130 -0
- package/.bkit/templates/scripts/ci/lanes/resolve-push-base.mjs +98 -0
- package/.bkit/templates/scripts/ci/lanes/resolve-push-base.test.mjs +86 -0
- package/.bkit/templates/scripts/graphify/bkit-graph-drift-rules.json +23 -0
- package/.bkit/templates/scripts/graphify/bkit-graph-drift.py +208 -0
- package/.bkit/templates/scripts/graphify/bkit-graph-eager-rules.json +35 -0
- package/.bkit/templates/scripts/graphify/bkit-graph-eager.py +236 -0
- package/.bkit/templates/scripts/graphify/bkit-graph-external-rules.json +17 -0
- package/.bkit/templates/scripts/graphify/bkit-graph-imports.py +290 -0
- package/.bkit/templates/scripts/graphify/bkit-graph-pre-push.sh +19 -0
- package/.bkit/templates/scripts/graphify/bkit-graph-repair.py +120 -0
- package/.bkit/templates/scripts/graphify/bkit-graph-surface.py +232 -0
- package/.bkit/templates/scripts/graphify/bkit-graphify-graphml.py +36 -0
- package/.bkit/templates/scripts/graphify/bkit-graphify-rollup.py +927 -0
- package/.bkit/templates/scripts/graphify/bkit-graphify.sh +351 -0
- package/.bkit/templates/scripts/launchd/ai.bkit.launchd.plist +26 -0
- package/.bkit/templates/scripts/launchd/bkit-launchd-env.sh +53 -0
- package/.bkit/templates/scripts/launchd/launchd.env.example +13 -0
- package/.bkit/templates/scripts/prettier/bkit-insert-ignore.mjs +275 -0
- package/.bkit/templates/scripts/secrets/bkit-secrets.config.mjs +66 -0
- package/.bkit/templates/scripts/secrets/bkit-secrets.mjs +785 -0
- package/.bkit/templates/scripts/serena/bkit-serena-mcp.sh +30 -0
- package/.bkit/templates/scripts/serena/bkit-serena.mcp.json +9 -0
- package/.bkit/templates/scripts/slop/bkit-slop-type-suppression.mjs +286 -0
- package/.bkit/templates/slop-scan.config.json +120 -0
- package/CHANGELOG.md +1503 -0
- package/LICENSE.md +161 -0
- package/README.md +184 -2
- package/dist/checks/after/auth.js +140 -0
- package/dist/checks/after/ci-yml.js +681 -0
- package/dist/checks/after/github.js +400 -0
- package/dist/checks/after/index.js +431 -0
- package/dist/checks/after/managed.js +187 -0
- package/dist/checks/after/suppression.js +39 -0
- package/dist/checks/after/tools.js +351 -0
- package/dist/checks/before/context-fetch.js +426 -0
- package/dist/checks/before/env.js +163 -0
- package/dist/checks/before/files.js +187 -0
- package/dist/checks/before/index.js +162 -0
- package/dist/checks/before/mcp.js +111 -0
- package/dist/checks/before/repo.js +71 -0
- package/dist/checks/before/version.js +60 -0
- package/dist/checks/status-holes.js +393 -0
- package/dist/cli.js +688 -0
- package/dist/commands/analysis.js +325 -0
- package/dist/commands/ci/ci.js +438 -0
- package/dist/commands/comply.js +310 -0
- package/dist/commands/harvest.js +354 -0
- package/dist/commands/install/check.js +61 -0
- package/dist/commands/install/doctor.js +209 -0
- package/dist/commands/install/install.js +475 -0
- package/dist/commands/install/uninstall.js +839 -0
- package/dist/commands/install/upgrade.js +782 -0
- package/dist/commands/launch.js +118 -0
- package/dist/commands/lib.js +363 -0
- package/dist/commands/registry.js +50 -0
- package/dist/commands/setup/setup.js +158 -0
- package/dist/commands/telemetry.js +29 -0
- package/dist/commands/workflow/branches.js +1265 -0
- package/dist/commands/workflow/context.js +846 -0
- package/dist/commands/workflow/counters.js +227 -0
- package/dist/commands/workflow/fids.js +224 -0
- package/dist/commands/workflow/issues.js +585 -0
- package/dist/commands/workflow/ledgers.js +472 -0
- package/dist/commands/workflow/locks.js +364 -0
- package/dist/commands/workflow/prs.js +904 -0
- package/dist/commands/workflow/repo.js +199 -0
- package/dist/commands/workflow/roadmap.js +495 -0
- package/dist/commands/workflow/runs.js +1717 -0
- package/dist/commands/workflow/runtime.js +257 -0
- package/dist/commands/workflow/skills.js +110 -0
- package/dist/commands/workflow/status.js +392 -0
- package/dist/commands/workflow/steps.js +1093 -0
- package/dist/commands/workflow/tests.js +144 -0
- package/dist/commands/workflow/workflows.js +1342 -0
- package/dist/commands/workflow/workstreams.js +141 -0
- package/dist/commands/workflow/worktrees.js +473 -0
- package/dist/install/cloud-env.js +818 -0
- package/dist/install/managed-block.js +182 -0
- package/dist/install/manifest.js +376 -0
- package/dist/install/modules/claude.js +288 -0
- package/dist/install/modules/cloud.js +151 -0
- package/dist/install/modules/codex.js +193 -0
- package/dist/install/modules/core.js +531 -0
- package/dist/install/modules/cursor.js +186 -0
- package/dist/install/modules/index.js +152 -0
- package/dist/install/modules/opencode.js +504 -0
- package/dist/install/payload-links.js +119 -0
- package/dist/install/placeholders.js +87 -0
- package/dist/install/template-copies.js +106 -0
- package/dist/install/version-file.js +204 -0
- package/dist/install/write.js +342 -0
- package/dist/ledgers/clamp-log.js +27 -0
- package/dist/ledgers/status.js +156 -0
- package/dist/ledgers/telemetry.js +637 -0
- package/dist/render/hosts.js +339 -0
- package/dist/render/models.js +288 -0
- package/dist/render/parts.js +33 -0
- package/dist/render/trackers.js +135 -0
- package/dist/shared/egress.js +299 -0
- package/dist/shared/json.js +16 -0
- package/dist/shared/log-prefix.js +7 -0
- package/dist/shared/package-json.js +22 -0
- package/dist/shared/package-manager.js +32 -0
- package/dist/shared/package-roots.js +145 -0
- package/dist/shared/protected-paths.js +153 -0
- package/dist/shared/settings.js +44 -0
- package/dist/shared/timeouts.js +19 -0
- package/dist/tools/wording.js +680 -0
- package/package.json +101 -4
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
// bkit status route|meta|path|row — read and annotate a workflow's `status.jsonl`.
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
import { activeDoneSteps, appendLine, fold, lastDoneStepAllRuns, lastRun, nextStrategy, runOrStepField, statusTimestamp, } from "../../ledgers/status.js";
|
|
5
|
+
import { CommandError, EXIT, parseJson, statusLocation, } from "../lib.js";
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Shared with counters / steps
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
export const FILE_FLAG = {
|
|
10
|
+
name: "file",
|
|
11
|
+
type: "string",
|
|
12
|
+
required: true,
|
|
13
|
+
help: "path to status.jsonl (from `bkit status path`)",
|
|
14
|
+
};
|
|
15
|
+
export const WORKFLOW_FLAG = {
|
|
16
|
+
name: "workflow",
|
|
17
|
+
type: "string",
|
|
18
|
+
required: true,
|
|
19
|
+
help: "workflow name: design, plan, build, debug, ship",
|
|
20
|
+
};
|
|
21
|
+
export const STEP_FLAG = {
|
|
22
|
+
name: "step",
|
|
23
|
+
type: "string",
|
|
24
|
+
required: true,
|
|
25
|
+
help: "step name",
|
|
26
|
+
};
|
|
27
|
+
export const SUB_PLAN_FLAG = {
|
|
28
|
+
name: "sub-plan",
|
|
29
|
+
type: "string",
|
|
30
|
+
help: "only rows for this sub-plan (positive integer)",
|
|
31
|
+
};
|
|
32
|
+
/** Exit code: status.jsonl missing, unreadable, or not valid NDJSON. */
|
|
33
|
+
export const EXIT_NO_STATUS = 3;
|
|
34
|
+
/** Parse every line of `status.jsonl`. Missing, unreadable or malformed is an error, never "no rows". */
|
|
35
|
+
/** Every row of status.jsonl, whatever its type; exit 3 when the file is missing or a line is not JSON. */
|
|
36
|
+
export function readStatusRows(file) {
|
|
37
|
+
if (!fs.existsSync(file))
|
|
38
|
+
throw new CommandError(EXIT_NO_STATUS, `${file} does not exist`);
|
|
39
|
+
return fs
|
|
40
|
+
.readFileSync(file, "utf-8")
|
|
41
|
+
.split("\n")
|
|
42
|
+
.map((l) => l.trim())
|
|
43
|
+
.filter((l) => l !== "")
|
|
44
|
+
.map((l, i) => {
|
|
45
|
+
const parsed = parseJson(l);
|
|
46
|
+
if (!parsed.ok)
|
|
47
|
+
throw new CommandError(EXIT_NO_STATUS, `${file} line ${i + 1} is not JSON`);
|
|
48
|
+
if (typeof parsed.value !== "object" || parsed.value === null) {
|
|
49
|
+
throw new CommandError(EXIT_NO_STATUS, `${file} line ${i + 1} is not a JSON object`);
|
|
50
|
+
}
|
|
51
|
+
return parsed.value;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/** The rows as the fold reads them; the fold skips types it does not model. */
|
|
55
|
+
export const readStatusEvents = (file) => readStatusRows(file);
|
|
56
|
+
export const readRuns = (file) => fold(readStatusEvents(file));
|
|
57
|
+
/** `--file`, resolved against the command's working directory. */
|
|
58
|
+
export const statusFile = (ctx) => path.resolve(ctx.cwd, String(ctx.flags.file));
|
|
59
|
+
/** `--field key=value`: value parsed as JSON when it parses, else kept as a string. */
|
|
60
|
+
export function extraField(spec) {
|
|
61
|
+
const eq = spec.indexOf("=");
|
|
62
|
+
if (eq <= 0)
|
|
63
|
+
throw new CommandError(EXIT.USAGE, `--field ${spec}: expected key=value`);
|
|
64
|
+
const key = spec.slice(0, eq);
|
|
65
|
+
const raw = spec.slice(eq + 1);
|
|
66
|
+
if (!/^[a-z][a-zA-Z0-9_]*$/.test(key))
|
|
67
|
+
throw new CommandError(EXIT.USAGE, `--field key ${key} is not camelCase or snake_case`);
|
|
68
|
+
return [key, parseJsonOrString(raw)];
|
|
69
|
+
}
|
|
70
|
+
/** Not JSON: a plain-text value, kept as written. */
|
|
71
|
+
function parseJsonOrString(raw) {
|
|
72
|
+
const parsed = parseJson(raw);
|
|
73
|
+
return parsed.ok ? parsed.value : raw;
|
|
74
|
+
}
|
|
75
|
+
/** A non-negative-integer flag (0 allowed), or undefined when absent. */
|
|
76
|
+
export function nonNegativeInt(value, flag) {
|
|
77
|
+
if (value === undefined)
|
|
78
|
+
return undefined;
|
|
79
|
+
const s = String(value);
|
|
80
|
+
if (!/^(0|[1-9][0-9]*)$/.test(s))
|
|
81
|
+
throw new CommandError(EXIT.USAGE, `--${flag} must be a non-negative integer, got "${s}"`);
|
|
82
|
+
return Number(s);
|
|
83
|
+
}
|
|
84
|
+
/** A positive-integer flag, or undefined when absent. */
|
|
85
|
+
export function positiveInt(value, flag) {
|
|
86
|
+
if (value === undefined)
|
|
87
|
+
return undefined;
|
|
88
|
+
const s = String(value);
|
|
89
|
+
if (!/^[1-9][0-9]*$/.test(s))
|
|
90
|
+
throw new CommandError(EXIT.USAGE, `--${flag} must be a positive integer, got "${s}"`);
|
|
91
|
+
return Number(s);
|
|
92
|
+
}
|
|
93
|
+
export const str = (v) => (v === undefined ? undefined : String(v));
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
// route
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
const VERDICTS = ["PASS", "CONCERNS", "FAIL"];
|
|
98
|
+
const DEBUG_MODES = ["NORMAL", "SOAK"];
|
|
99
|
+
const PUSH_MODES = ["PR", "LOCAL"];
|
|
100
|
+
const STRATEGIES = ["STANDARD", "PIVOT", "FINAL"];
|
|
101
|
+
const ROUTE_FIELDS = ["verdict", "failures", "strategy", "debugMode", "pushMode"];
|
|
102
|
+
/** Exit code: a `--require`d field is missing or holds a value outside its set. */
|
|
103
|
+
export const EXIT_ROUTE_MISSING = 4;
|
|
104
|
+
function route(runs, workflow, step, subPlan) {
|
|
105
|
+
const out = {
|
|
106
|
+
verdict: null,
|
|
107
|
+
failures: null,
|
|
108
|
+
strategy: null,
|
|
109
|
+
nextStrategy: null,
|
|
110
|
+
debugMode: null,
|
|
111
|
+
pushMode: null,
|
|
112
|
+
debugAttempt: 0,
|
|
113
|
+
};
|
|
114
|
+
const problems = {};
|
|
115
|
+
if (step !== undefined) {
|
|
116
|
+
const last = activeDoneSteps(runs, workflow, { step, subPlan }).at(-1);
|
|
117
|
+
if (!last) {
|
|
118
|
+
problems.verdict = `no DONE ${step} row in the active ${workflow} run`;
|
|
119
|
+
problems.failures = problems.verdict;
|
|
120
|
+
}
|
|
121
|
+
else if (!VERDICTS.includes(String(last.verdict))) {
|
|
122
|
+
problems.verdict = `${step} verdict "${String(last.verdict ?? "")}" is not PASS|CONCERNS|FAIL`;
|
|
123
|
+
problems.failures = problems.verdict;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
out.verdict = last.verdict;
|
|
127
|
+
const failures = last.failures ?? 0;
|
|
128
|
+
if (Number.isInteger(failures) && failures >= 0)
|
|
129
|
+
out.failures = failures;
|
|
130
|
+
else
|
|
131
|
+
problems.failures = `${step} failures "${String(failures)}" is not a non-negative integer`;
|
|
132
|
+
}
|
|
133
|
+
const prior = lastDoneStepAllRuns(runs, workflow, { step, subPlan })?.strategy;
|
|
134
|
+
if (prior === undefined || STRATEGIES.includes(prior)) {
|
|
135
|
+
out.strategy = prior ?? null;
|
|
136
|
+
out.nextStrategy = nextStrategy(prior);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
problems.strategy = `${step} strategy "${String(prior)}" is not STANDARD|PIVOT|FINAL`;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
for (const [field, allowed] of [
|
|
143
|
+
["debugMode", DEBUG_MODES],
|
|
144
|
+
["pushMode", PUSH_MODES],
|
|
145
|
+
]) {
|
|
146
|
+
const value = runOrStepField(runs, workflow, field);
|
|
147
|
+
if (allowed.includes(value))
|
|
148
|
+
out[field] = value;
|
|
149
|
+
else
|
|
150
|
+
problems[field] =
|
|
151
|
+
value === "" ? `${field} not recorded` : `${field} "${value}" is not ${allowed.join("|")}`;
|
|
152
|
+
}
|
|
153
|
+
const attempt = Number(lastRun(runs, workflow)?.debugAttempt ?? 0);
|
|
154
|
+
out.debugAttempt = Number.isFinite(attempt) ? attempt : 0;
|
|
155
|
+
return { out, problems };
|
|
156
|
+
}
|
|
157
|
+
// ---------------------------------------------------------------------------
|
|
158
|
+
// meta
|
|
159
|
+
// ---------------------------------------------------------------------------
|
|
160
|
+
const META_FIELDS = {
|
|
161
|
+
"debug-mode": { key: "debugMode", check: (v) => oneOf(v, DEBUG_MODES, "--debug-mode") },
|
|
162
|
+
"push-mode": { key: "pushMode", check: (v) => oneOf(v, PUSH_MODES, "--push-mode") },
|
|
163
|
+
"debug-attempt": { key: "debugAttempt", check: (v) => positiveInt(v, "debug-attempt") },
|
|
164
|
+
"plan-source": { key: "planSource", check: (v) => oneOf(v, PLAN_SOURCES, "--plan-source") },
|
|
165
|
+
};
|
|
166
|
+
/** Row types the fold reads; each has its own verb (workflows start|fail|close, steps done, status meta). */
|
|
167
|
+
const FOLDED_TYPES = new Set([
|
|
168
|
+
"workflow-started",
|
|
169
|
+
"step-done",
|
|
170
|
+
"workflow-meta",
|
|
171
|
+
"workflow-done",
|
|
172
|
+
"workflow-failed",
|
|
173
|
+
]);
|
|
174
|
+
/** Markers that record the row's own time or a fact, not a value. */
|
|
175
|
+
const META_MARKS = {
|
|
176
|
+
"soak-entry": (at) => ({ soakEntryAt: at }),
|
|
177
|
+
"opened-pr": () => ({ openedPr: true }),
|
|
178
|
+
};
|
|
179
|
+
/** `brief` = the run had no plan file and works from its input file. */
|
|
180
|
+
const PLAN_SOURCES = ["brief", "plan"];
|
|
181
|
+
const camelFlag = (kebab) => kebab.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
182
|
+
function oneOf(v, allowed, flag) {
|
|
183
|
+
if (!allowed.includes(v))
|
|
184
|
+
throw new CommandError(EXIT.USAGE, `${flag} must be ${allowed.join("|")}`);
|
|
185
|
+
return v;
|
|
186
|
+
}
|
|
187
|
+
// ---------------------------------------------------------------------------
|
|
188
|
+
// Command
|
|
189
|
+
// ---------------------------------------------------------------------------
|
|
190
|
+
export const statusCommand = {
|
|
191
|
+
noun: "status",
|
|
192
|
+
summary: "Read and annotate a workflow's status.jsonl.",
|
|
193
|
+
verbs: {
|
|
194
|
+
path: {
|
|
195
|
+
summary: "Where this workflow's status.jsonl lives.",
|
|
196
|
+
flags: [
|
|
197
|
+
WORKFLOW_FLAG,
|
|
198
|
+
{ name: "fid", type: "string", required: true, help: "feature id" },
|
|
199
|
+
{ name: "month", type: "string", required: true, help: "month bucket, YYYYMM" },
|
|
200
|
+
{
|
|
201
|
+
name: "dev-pushes",
|
|
202
|
+
type: "boolean",
|
|
203
|
+
help: "ship only: this runtime pushes to dev (RUNTIME_DEVPUSHES=true)",
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
output: {
|
|
207
|
+
path: "absolute path to status.jsonl",
|
|
208
|
+
bookRoot: "root the workflow books its logs under",
|
|
209
|
+
exists: "whether the file exists yet",
|
|
210
|
+
},
|
|
211
|
+
run: (ctx) => {
|
|
212
|
+
const month = String(ctx.flags.month);
|
|
213
|
+
if (!/^[0-9]{6}$/.test(month))
|
|
214
|
+
throw new CommandError(EXIT.USAGE, "--month must be YYYYMM");
|
|
215
|
+
const loc = statusLocation({
|
|
216
|
+
cwd: ctx.cwd,
|
|
217
|
+
workflow: String(ctx.flags.workflow),
|
|
218
|
+
fid: String(ctx.flags.fid),
|
|
219
|
+
month,
|
|
220
|
+
devPushes: ctx.flags.devPushes === true,
|
|
221
|
+
});
|
|
222
|
+
ctx.emit({ ...loc, exists: fs.existsSync(loc.path) });
|
|
223
|
+
return EXIT.OK;
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
route: {
|
|
227
|
+
summary: "Routing state: last verdict / failures / strategy of a step, debug and push mode.",
|
|
228
|
+
flags: [
|
|
229
|
+
FILE_FLAG,
|
|
230
|
+
WORKFLOW_FLAG,
|
|
231
|
+
{
|
|
232
|
+
...STEP_FLAG,
|
|
233
|
+
required: false,
|
|
234
|
+
help: "step whose last DONE row gives verdict, failures, strategy",
|
|
235
|
+
},
|
|
236
|
+
SUB_PLAN_FLAG,
|
|
237
|
+
{
|
|
238
|
+
name: "require",
|
|
239
|
+
type: "string",
|
|
240
|
+
repeatable: true,
|
|
241
|
+
help: `fail unless this field is present and valid: ${ROUTE_FIELDS.join(", ")}`,
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "expect",
|
|
245
|
+
type: "string",
|
|
246
|
+
repeatable: true,
|
|
247
|
+
help: "field=value — fail (exit 4) unless the field holds this value, e.g. debugMode=NORMAL",
|
|
248
|
+
},
|
|
249
|
+
],
|
|
250
|
+
output: {
|
|
251
|
+
verdict: "PASS|CONCERNS|FAIL of the step's last DONE row in the active run, or null",
|
|
252
|
+
failures: "its failures (absent with a verdict = 0), or null",
|
|
253
|
+
strategy: "the step's last strategy across ALL runs, or null",
|
|
254
|
+
nextStrategy: "next rung: STANDARD, PIVOT, FINAL (null without --step)",
|
|
255
|
+
debugMode: "NORMAL|SOAK of the active run, or null",
|
|
256
|
+
pushMode: "PR|LOCAL of the active run, or null",
|
|
257
|
+
debugAttempt: "debugAttempt of the active run (0 when unset)",
|
|
258
|
+
},
|
|
259
|
+
exitCodes: {
|
|
260
|
+
[EXIT_NO_STATUS]: "status.jsonl missing, unreadable, or not valid NDJSON",
|
|
261
|
+
[EXIT_ROUTE_MISSING]: "a --require'd field is missing or invalid, or an --expect'ed value differs",
|
|
262
|
+
},
|
|
263
|
+
run: (ctx) => {
|
|
264
|
+
const step = str(ctx.flags.step);
|
|
265
|
+
const expected = (ctx.flags.expect ?? []).map((e) => {
|
|
266
|
+
const eq = e.indexOf("=");
|
|
267
|
+
if (eq <= 0 || !ROUTE_FIELDS.includes(e.slice(0, eq)))
|
|
268
|
+
throw new CommandError(EXIT.USAGE, `--expect ${e}: must be <${ROUTE_FIELDS.join("|")}>=<value>`);
|
|
269
|
+
return [e.slice(0, eq), e.slice(eq + 1)];
|
|
270
|
+
});
|
|
271
|
+
const required = [
|
|
272
|
+
...new Set([
|
|
273
|
+
...(ctx.flags.require ?? []),
|
|
274
|
+
...expected.map(([k]) => k),
|
|
275
|
+
]),
|
|
276
|
+
];
|
|
277
|
+
for (const r of required) {
|
|
278
|
+
if (!ROUTE_FIELDS.includes(r)) {
|
|
279
|
+
throw new CommandError(EXIT.USAGE, `--require ${r}: not one of ${ROUTE_FIELDS.join(", ")}`);
|
|
280
|
+
}
|
|
281
|
+
if (step === undefined && ["verdict", "failures", "strategy"].includes(r)) {
|
|
282
|
+
throw new CommandError(EXIT.USAGE, `--require ${r} needs --step`);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
const runs = readRuns(statusFile(ctx));
|
|
286
|
+
const { out, problems } = route(runs, String(ctx.flags.workflow), step, positiveInt(ctx.flags.subPlan, "sub-plan"));
|
|
287
|
+
ctx.emit(out);
|
|
288
|
+
const failed = required.filter((r) => problems[r] !== undefined);
|
|
289
|
+
for (const r of failed)
|
|
290
|
+
ctx.log(problems[r]);
|
|
291
|
+
const differ = expected.filter(([k, v]) => problems[k] === undefined &&
|
|
292
|
+
String(out[k]) !== v);
|
|
293
|
+
for (const [k, v] of differ)
|
|
294
|
+
ctx.log(`${k} is ${String(out[k])}, expected ${v}`);
|
|
295
|
+
return failed.length === 0 && differ.length === 0 ? EXIT.OK : EXIT_ROUTE_MISSING;
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
meta: {
|
|
299
|
+
summary: "Append a workflow-meta row (run-level routing state).",
|
|
300
|
+
flags: [
|
|
301
|
+
FILE_FLAG,
|
|
302
|
+
WORKFLOW_FLAG,
|
|
303
|
+
{ name: "debug-mode", type: "string", help: "NORMAL|SOAK" },
|
|
304
|
+
{ name: "push-mode", type: "string", help: "PR|LOCAL" },
|
|
305
|
+
{ name: "debug-attempt", type: "string", help: "positive integer" },
|
|
306
|
+
{ name: "plan-source", type: "string", help: "brief|plan" },
|
|
307
|
+
{
|
|
308
|
+
name: "soak-entry",
|
|
309
|
+
type: "boolean",
|
|
310
|
+
help: "record soakEntryAt (the soak budget counts from here)",
|
|
311
|
+
},
|
|
312
|
+
{ name: "opened-pr", type: "boolean", help: "record openedPr: this run opened the PR" },
|
|
313
|
+
],
|
|
314
|
+
output: { row: "the appended workflow-meta row" },
|
|
315
|
+
exitCodes: { [EXIT_NO_STATUS]: "status.jsonl does not exist (meta never starts a log)" },
|
|
316
|
+
run: (ctx) => {
|
|
317
|
+
const file = statusFile(ctx);
|
|
318
|
+
const at = statusTimestamp();
|
|
319
|
+
const fields = {};
|
|
320
|
+
for (const { key, check } of Object.values(META_FIELDS)) {
|
|
321
|
+
const v = str(ctx.flags[key]);
|
|
322
|
+
if (v !== undefined)
|
|
323
|
+
fields[key] = check(v);
|
|
324
|
+
}
|
|
325
|
+
for (const [flag, mark] of Object.entries(META_MARKS)) {
|
|
326
|
+
if (ctx.flags[camelFlag(flag)] === true)
|
|
327
|
+
Object.assign(fields, mark(at));
|
|
328
|
+
}
|
|
329
|
+
if (Object.keys(fields).length === 0) {
|
|
330
|
+
throw new CommandError(EXIT.USAGE, `give at least one of ${[...Object.keys(META_FIELDS), ...Object.keys(META_MARKS)]
|
|
331
|
+
.map((f) => `--${f}`)
|
|
332
|
+
.join(", ")}`);
|
|
333
|
+
}
|
|
334
|
+
if (!fs.existsSync(file))
|
|
335
|
+
throw new CommandError(EXIT_NO_STATUS, `${file} does not exist`);
|
|
336
|
+
const row = {
|
|
337
|
+
type: "workflow-meta",
|
|
338
|
+
workflow: String(ctx.flags.workflow),
|
|
339
|
+
at,
|
|
340
|
+
...fields,
|
|
341
|
+
};
|
|
342
|
+
fs.appendFileSync(file, appendLine(row));
|
|
343
|
+
ctx.emit({ row });
|
|
344
|
+
return EXIT.OK;
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
row: {
|
|
348
|
+
summary: "Append a typed audit row the fold does not model (ship's gate refusals, CI probes, merge CI).",
|
|
349
|
+
flags: [
|
|
350
|
+
FILE_FLAG,
|
|
351
|
+
WORKFLOW_FLAG,
|
|
352
|
+
{
|
|
353
|
+
name: "type",
|
|
354
|
+
type: "string",
|
|
355
|
+
required: true,
|
|
356
|
+
help: "row type, kebab-case (the folded types have their own verbs)",
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
name: "field",
|
|
360
|
+
type: "string",
|
|
361
|
+
repeatable: true,
|
|
362
|
+
help: "row field key=value (value parsed as JSON when it is JSON)",
|
|
363
|
+
},
|
|
364
|
+
],
|
|
365
|
+
output: { row: "the appended row" },
|
|
366
|
+
exitCodes: { [EXIT_NO_STATUS]: "status.jsonl does not exist (a row never starts a log)" },
|
|
367
|
+
run: (ctx) => {
|
|
368
|
+
const type = String(ctx.flags.type);
|
|
369
|
+
if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(type))
|
|
370
|
+
throw new CommandError(EXIT.USAGE, `--type ${type} is not kebab-case`);
|
|
371
|
+
if (FOLDED_TYPES.has(type))
|
|
372
|
+
throw new CommandError(EXIT.USAGE, `--type ${type} is folded; write it with its own verb`);
|
|
373
|
+
const fields = Object.fromEntries((ctx.flags.field ?? []).map(extraField));
|
|
374
|
+
const clash = ["type", "workflow", "at"].filter((k) => k in fields);
|
|
375
|
+
if (clash.length > 0)
|
|
376
|
+
throw new CommandError(EXIT.USAGE, `--field cannot set ${clash.join(", ")}`);
|
|
377
|
+
const file = statusFile(ctx);
|
|
378
|
+
if (!fs.existsSync(file))
|
|
379
|
+
throw new CommandError(EXIT_NO_STATUS, `${file} does not exist`);
|
|
380
|
+
const row = {
|
|
381
|
+
type,
|
|
382
|
+
workflow: String(ctx.flags.workflow),
|
|
383
|
+
at: statusTimestamp(),
|
|
384
|
+
...fields,
|
|
385
|
+
};
|
|
386
|
+
fs.appendFileSync(file, appendLine(row));
|
|
387
|
+
ctx.emit({ row });
|
|
388
|
+
return EXIT.OK;
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
};
|