@cbartens/bkit 0.0.0-stage → 5.0.0
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 +421 -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 +421 -0
- package/.bkit/core/.bkit/cloud.md +502 -0
- package/.bkit/core/.bkit/comparison.md +318 -0
- package/.bkit/core/.bkit/install.md +496 -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 +471 -0
- package/.bkit/core/.bkit/trackers.md +95 -0
- package/.bkit/core/.bkit/workflows.md +1546 -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 +247 -0
- package/.bkit/core/engine/checks/after/ci-yml.ts +739 -0
- package/.bkit/core/engine/checks/after/github.ts +424 -0
- package/.bkit/core/engine/checks/after/index.ts +556 -0
- package/.bkit/core/engine/checks/after/managed.ts +217 -0
- package/.bkit/core/engine/checks/after/tools.ts +427 -0
- package/.bkit/core/engine/checks/after/vercel.ts +101 -0
- package/.bkit/core/engine/checks/before/context-fetch.ts +429 -0
- package/.bkit/core/engine/checks/before/env.ts +201 -0
- package/.bkit/core/engine/checks/before/files.ts +202 -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 +871 -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 +247 -0
- package/.bkit/core/engine/commands/install/install.ts +528 -0
- package/.bkit/core/engine/commands/install/uninstall.ts +972 -0
- package/.bkit/core/engine/commands/install/upgrade.ts +1026 -0
- package/.bkit/core/engine/commands/launch.ts +139 -0
- package/.bkit/core/engine/commands/lib.ts +494 -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 +925 -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 +174 -0
- package/.bkit/core/engine/install/modules/codex.ts +219 -0
- package/.bkit/core/engine/install/modules/core.ts +600 -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/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 +642 -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 +108 -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 +438 -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 +92 -0
- package/.bkit/templates/.claude/hooks/bkit-cloud-bootstrap.sh +192 -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 +239 -0
- package/.bkit/templates/.github/workflows/bkit-ci.yml +1082 -0
- package/.bkit/templates/.github/workflows/bkit-cloud.yml +566 -0
- package/.bkit/templates/.github/workflows/bkit-renovate.yml +107 -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 +1486 -0
- package/LICENSE.md +161 -0
- package/README.md +185 -2
- package/dist/checks/after/auth.js +232 -0
- package/dist/checks/after/ci-yml.js +718 -0
- package/dist/checks/after/github.js +400 -0
- package/dist/checks/after/index.js +447 -0
- package/dist/checks/after/managed.js +187 -0
- package/dist/checks/after/tools.js +351 -0
- package/dist/checks/after/vercel.js +102 -0
- package/dist/checks/before/context-fetch.js +426 -0
- package/dist/checks/before/env.js +173 -0
- package/dist/checks/before/files.js +185 -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 +692 -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 +207 -0
- package/dist/commands/install/install.js +461 -0
- package/dist/commands/install/uninstall.js +815 -0
- package/dist/commands/install/upgrade.js +771 -0
- package/dist/commands/launch.js +118 -0
- package/dist/commands/lib.js +362 -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 +819 -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 +152 -0
- package/dist/install/modules/codex.js +193 -0
- package/dist/install/modules/core.js +511 -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/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,275 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Example. Copy into the repo and own it.
|
|
3
|
+
// bkit install does not write this file and does not overwrite a copy.
|
|
4
|
+
// bkit-insert-ignore.mjs — wrap every markdown table with `<!-- prettier-ignore -->` and strip
|
|
5
|
+
// fixed-width padding from cells and separators. Idempotent. See .bkit/templates.md § Prettier tables.
|
|
6
|
+
//
|
|
7
|
+
// node scripts/prettier/bkit-insert-ignore.mjs [--check] [path ...]
|
|
8
|
+
//
|
|
9
|
+
// Prettier aligns markdown tables with no config toggle; a table edit then rewrites every row and
|
|
10
|
+
// the diff hides the change. The per-table escape hatch is `<!-- prettier-ignore -->` directly
|
|
11
|
+
// above the table head, no blank line between.
|
|
12
|
+
//
|
|
13
|
+
// Default paths: `.agents`, `docs`, `README.md`. A directory walk skips `skills/` trees (vendored)
|
|
14
|
+
// and `docs/audits/` + `docs/plans/` (records, kept as written); a file named explicitly is always
|
|
15
|
+
// processed. Tables inside fenced code blocks (``` / ~~~) and tables already wrapped are skipped.
|
|
16
|
+
// `--check` writes nothing and exits 1 if any file would change — use it as a gate.
|
|
17
|
+
// Exit 1 also on table damage escaping cannot repair (see auditText), with or without --check.
|
|
18
|
+
|
|
19
|
+
import fs from "node:fs";
|
|
20
|
+
import path from "node:path";
|
|
21
|
+
import { fileURLToPath } from "node:url";
|
|
22
|
+
|
|
23
|
+
const SEPARATOR_CELL = /^:?-+:?$/;
|
|
24
|
+
// Column-delimiter pipes only: `\|` is literal cell content (GFM) and must not split the row —
|
|
25
|
+
// prettier preserves it, so we must too, else `a\|b` corrupts to `a\ | b`.
|
|
26
|
+
const UNESCAPED_PIPE = /(?<!\\)\|/g;
|
|
27
|
+
const INLINE_CODE = /`[^`\n]*`/g;
|
|
28
|
+
const DEFAULT_ROOTS = [".agents", "docs", "README.md"];
|
|
29
|
+
// Record trees: written once, never reformatted.
|
|
30
|
+
const RECORD_DIRS = ["docs/audits", "docs/plans"];
|
|
31
|
+
|
|
32
|
+
const stripNl = (line) => line.replace(/\n$/, "");
|
|
33
|
+
const leadingSpaces = (line) => /^ */.exec(line)[0];
|
|
34
|
+
|
|
35
|
+
export function splitCells(inner) {
|
|
36
|
+
return inner.split(UNESCAPED_PIPE).map((c) => c.trim());
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const innerOf = (line) => stripNl(line).trim().slice(1, -1);
|
|
40
|
+
|
|
41
|
+
export function isPipeRow(line) {
|
|
42
|
+
const s = line.trim();
|
|
43
|
+
return s.startsWith("|") && s.endsWith("|") && (s.match(/\|/g) ?? []).length >= 2;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function isSeparatorRow(line) {
|
|
47
|
+
const s = line.trim();
|
|
48
|
+
if (!s.startsWith("|") || !s.endsWith("|")) return false;
|
|
49
|
+
const cells = splitCells(s.slice(1, -1));
|
|
50
|
+
if (!cells.length) return false;
|
|
51
|
+
return cells.filter((c) => c !== "").every((c) => SEPARATOR_CELL.test(c));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function escapeCodeSpanPipes(line) {
|
|
55
|
+
return line.replace(INLINE_CODE, (span) => span.replace(UNESCAPED_PIPE, "\\|"));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Per GFM a pipe delimits a cell even inside a code span — `|| echo` in a cell is already TWO
|
|
59
|
+
// cells, and splitting then rejoining it rewrites it as ` | | echo`. Escape span pipes only when
|
|
60
|
+
// that lands the row exactly on the separator's column count: a span pipe that is already a live
|
|
61
|
+
// delimiter (older damage, or a deliberately split cell) stays. The separator's column count
|
|
62
|
+
// decides, so repeat runs make the same decision.
|
|
63
|
+
function maybeEscape(line, ncols) {
|
|
64
|
+
if (!isPipeRow(line) || !line.includes("`")) return line;
|
|
65
|
+
const escaped = escapeCodeSpanPipes(line);
|
|
66
|
+
if (escaped === line) return line;
|
|
67
|
+
return splitCells(innerOf(escaped)).length === ncols ? escaped : line;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function stripCellPadding(line) {
|
|
71
|
+
if (!isPipeRow(line)) return line;
|
|
72
|
+
const nl = line.endsWith("\n") ? "\n" : "";
|
|
73
|
+
const cells = splitCells(stripNl(line).trimEnd().trim().slice(1, -1));
|
|
74
|
+
return `${leadingSpaces(line)}| ${cells.join(" | ")} |${nl}`;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function normalizeSeparator(line) {
|
|
78
|
+
if (!isPipeRow(line)) return line;
|
|
79
|
+
const nl = line.endsWith("\n") ? "\n" : "";
|
|
80
|
+
const cells = splitCells(innerOf(line)).map((c) => {
|
|
81
|
+
const left = c.startsWith(":");
|
|
82
|
+
const right = c.endsWith(":");
|
|
83
|
+
return left && right ? ":---:" : right ? "---:" : left ? ":---" : "---";
|
|
84
|
+
});
|
|
85
|
+
return `${leadingSpaces(line)}| ${cells.join(" | ")} |${nl}`;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// ``` / ~~~ fences across a line walk. Shared by processText and auditText so they never disagree:
|
|
89
|
+
// a table inside a fence is illustrative text, neither rewritten nor reported.
|
|
90
|
+
class FenceTracker {
|
|
91
|
+
inFence = false;
|
|
92
|
+
marker = "";
|
|
93
|
+
|
|
94
|
+
// True when `line` opens, sits inside, or closes a fence.
|
|
95
|
+
feed(line) {
|
|
96
|
+
const s = line.trimStart();
|
|
97
|
+
if (!this.inFence) {
|
|
98
|
+
if (s.startsWith("```") || s.startsWith("~~~")) {
|
|
99
|
+
this.inFence = true;
|
|
100
|
+
this.marker = s.startsWith("```") ? "```" : "~~~";
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
if (s.startsWith(this.marker)) this.inFence = false;
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const linesWithEnds = (src) => src.match(/[^\n]*\n|[^\n]+$/g) ?? [];
|
|
111
|
+
|
|
112
|
+
export function processText(src) {
|
|
113
|
+
const lines = linesWithEnds(src);
|
|
114
|
+
const out = [];
|
|
115
|
+
const fence = new FenceTracker();
|
|
116
|
+
let i = 0;
|
|
117
|
+
while (i < lines.length) {
|
|
118
|
+
const line = lines[i];
|
|
119
|
+
if (fence.feed(line)) {
|
|
120
|
+
out.push(line);
|
|
121
|
+
i++;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const isTableHead = isPipeRow(line) && i + 1 < lines.length && isSeparatorRow(lines[i + 1]);
|
|
125
|
+
if (!isTableHead) {
|
|
126
|
+
out.push(line);
|
|
127
|
+
i++;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
// An existing prettier-ignore may sit above trailing blank lines.
|
|
131
|
+
let scan = out.length - 1;
|
|
132
|
+
while (scan >= 0 && out[scan].trim() === "") scan--;
|
|
133
|
+
if (!(scan >= 0 && out[scan].includes("<!-- prettier-ignore"))) {
|
|
134
|
+
// The comment sits directly above the head; keep one blank line above it when content precedes.
|
|
135
|
+
while (out.length && out.at(-1).trim() === "") out.pop();
|
|
136
|
+
if (out.length && stripNl(out.at(-1)).trim() !== "") out.push("\n");
|
|
137
|
+
out.push("<!-- prettier-ignore -->\n");
|
|
138
|
+
}
|
|
139
|
+
// Column count comes from the separator — the one row that cannot hold a code span.
|
|
140
|
+
const sep = lines[i + 1];
|
|
141
|
+
const ncols = splitCells(innerOf(sep)).length;
|
|
142
|
+
out.push(stripCellPadding(maybeEscape(line, ncols)), normalizeSeparator(sep));
|
|
143
|
+
let j = i + 2;
|
|
144
|
+
while (j < lines.length && isPipeRow(lines[j])) {
|
|
145
|
+
out.push(stripCellPadding(maybeEscape(lines[j], ncols)));
|
|
146
|
+
j++;
|
|
147
|
+
}
|
|
148
|
+
i = j;
|
|
149
|
+
}
|
|
150
|
+
return out.join("");
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Damage this script reports and does NOT touch. Escaping happens only inside an inline-code span
|
|
154
|
+
// (maybeEscape); a bare pipe in plain cell prose ("boundary=browser | network") is left for a
|
|
155
|
+
// human. GFM renders both silently wrong:
|
|
156
|
+
// truncated-row a body row has MORE cells than the separator; GFM drops the overflow.
|
|
157
|
+
// unrendered-table header cell count != separator; GFM renders the whole block as raw text.
|
|
158
|
+
// Run on the POST-format text, so nothing escaping already fixed is reported twice.
|
|
159
|
+
export function auditText(src) {
|
|
160
|
+
const lines = src.split("\n");
|
|
161
|
+
const fence = new FenceTracker();
|
|
162
|
+
const problems = [];
|
|
163
|
+
let i = 0;
|
|
164
|
+
while (i < lines.length) {
|
|
165
|
+
const line = lines[i];
|
|
166
|
+
if (fence.feed(line)) {
|
|
167
|
+
i++;
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (!(isPipeRow(line) && i + 1 < lines.length && isSeparatorRow(lines[i + 1]))) {
|
|
171
|
+
i++;
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
const ncols = splitCells(innerOf(lines[i + 1])).length;
|
|
175
|
+
const nhead = splitCells(innerOf(line)).length;
|
|
176
|
+
if (nhead !== ncols) {
|
|
177
|
+
problems.push([
|
|
178
|
+
i + 1,
|
|
179
|
+
"unrendered-table",
|
|
180
|
+
`header has ${nhead} columns, separator has ${ncols} — GFM renders this whole block as raw text, not a table`,
|
|
181
|
+
]);
|
|
182
|
+
}
|
|
183
|
+
let j = i + 2;
|
|
184
|
+
while (j < lines.length && isPipeRow(lines[j])) {
|
|
185
|
+
const ncells = splitCells(innerOf(lines[j])).length;
|
|
186
|
+
if (ncells > ncols) {
|
|
187
|
+
problems.push([
|
|
188
|
+
j + 1,
|
|
189
|
+
"truncated-row",
|
|
190
|
+
`${ncells} cells in a ${ncols}-column table — GFM drops the last ${ncells - ncols}. ` +
|
|
191
|
+
"If a pipe is cell content, escape it as \\|; otherwise the row carries more values " +
|
|
192
|
+
"than the header has columns.",
|
|
193
|
+
]);
|
|
194
|
+
}
|
|
195
|
+
j++;
|
|
196
|
+
}
|
|
197
|
+
i = j;
|
|
198
|
+
}
|
|
199
|
+
return problems;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Markdown files under the given roots. Walks skip `skills/` trees (third-party content: any file
|
|
203
|
+
// whose PARENT dirs include `skills`, so a file merely named skills.md is kept) and the record trees.
|
|
204
|
+
export function collectTargets(args, root = process.cwd()) {
|
|
205
|
+
const rel = (p) => path.relative(root, path.resolve(root, p)).split(path.sep).join("/");
|
|
206
|
+
const walked = (p) => {
|
|
207
|
+
const r = rel(p);
|
|
208
|
+
return (
|
|
209
|
+
!path.dirname(r).split("/").includes("skills") &&
|
|
210
|
+
!RECORD_DIRS.some((d) => r === d || r.startsWith(`${d}/`))
|
|
211
|
+
);
|
|
212
|
+
};
|
|
213
|
+
const files = [];
|
|
214
|
+
for (const arg of args.length ? args : DEFAULT_ROOTS) {
|
|
215
|
+
const abs = path.resolve(root, arg);
|
|
216
|
+
if (!fs.existsSync(abs)) continue;
|
|
217
|
+
const stat = fs.statSync(abs);
|
|
218
|
+
if (stat.isFile() && abs.endsWith(".md")) files.push(arg);
|
|
219
|
+
else if (stat.isDirectory()) {
|
|
220
|
+
for (const entry of fs.readdirSync(abs, { recursive: true, withFileTypes: true })) {
|
|
221
|
+
if (!entry.isFile() || !entry.name.endsWith(".md")) continue;
|
|
222
|
+
const file = path.join(entry.parentPath ?? entry.path, entry.name);
|
|
223
|
+
const shown = path.join(arg, path.relative(abs, file));
|
|
224
|
+
if (walked(shown)) files.push(shown);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return [...new Set(files)].sort();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export function main(argv, { root = process.cwd(), log = console.log } = {}) {
|
|
232
|
+
const checkOnly = argv.includes("--check");
|
|
233
|
+
const targets = collectTargets(
|
|
234
|
+
argv.filter((a) => !a.startsWith("-")),
|
|
235
|
+
root,
|
|
236
|
+
);
|
|
237
|
+
let changed = 0;
|
|
238
|
+
const unformatted = [];
|
|
239
|
+
const problems = [];
|
|
240
|
+
for (const file of targets) {
|
|
241
|
+
const abs = path.resolve(root, file);
|
|
242
|
+
const src = fs.readFileSync(abs, "utf8");
|
|
243
|
+
const next = processText(src);
|
|
244
|
+
if (next !== src) {
|
|
245
|
+
if (checkOnly) unformatted.push(file);
|
|
246
|
+
else {
|
|
247
|
+
fs.writeFileSync(abs, next);
|
|
248
|
+
changed++;
|
|
249
|
+
log(`updated: ${file}`);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
for (const p of auditText(next)) problems.push([file, ...p]);
|
|
253
|
+
}
|
|
254
|
+
if (checkOnly) {
|
|
255
|
+
for (const file of unformatted) log(`needs formatting: ${file}`);
|
|
256
|
+
log(`\n${unformatted.length}/${targets.length} files need formatting`);
|
|
257
|
+
} else {
|
|
258
|
+
log(`\n${changed}/${targets.length} files updated`);
|
|
259
|
+
}
|
|
260
|
+
if (problems.length) {
|
|
261
|
+
log(
|
|
262
|
+
`\n${problems.length} table defect(s) escaping cannot repair — a pipe in plain cell\n` +
|
|
263
|
+
"prose is indistinguishable from a column delimiter, so these need a human:\n",
|
|
264
|
+
);
|
|
265
|
+
for (const [file, lineNo, kind, detail] of problems) {
|
|
266
|
+
log(` ${file}:${lineNo} [${kind}]`);
|
|
267
|
+
log(` ${detail}`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return problems.length || unformatted.length ? 1 : 0;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === fs.realpathSync(process.argv[1])) {
|
|
274
|
+
process.exitCode = main(process.argv.slice(2));
|
|
275
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Example. Copy into the repo and own it.
|
|
2
|
+
// bkit install does not write this file and does not overwrite a copy.
|
|
3
|
+
// bkit-secrets.config.mjs — the only per-repo file in scripts/secrets/. Read by bkit-secrets.mjs.
|
|
4
|
+
// Replace the example rows below.
|
|
5
|
+
//
|
|
6
|
+
// Model: local gitignored env files are the source of truth; every store is made to match.
|
|
7
|
+
// listed for a store, non-empty in source → written there when it differs
|
|
8
|
+
// listed, empty / absent in source → deleted there
|
|
9
|
+
// live in a store, not listed for it → deleted there, unless protected
|
|
10
|
+
// Preview first: node scripts/secrets/bkit-secrets.mjs sync --dry-run
|
|
11
|
+
// Prove parity: node scripts/secrets/bkit-secrets.mjs drift
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
sources: {
|
|
15
|
+
// Checked first for every key (first non-empty wins). Env-agnostic keys only: a key here
|
|
16
|
+
// pins one value for preview and production alike, with no warning.
|
|
17
|
+
// .bkit/.env → agent / bkit tooling secrets only; app and stack credentials stay in app env files.
|
|
18
|
+
overlays: [".bkit/.env"],
|
|
19
|
+
preview: "apps/web/.env.preview",
|
|
20
|
+
// No production surface → delete this line; per-environment stores then sync preview only.
|
|
21
|
+
production: "apps/web/.env.production",
|
|
22
|
+
// `check` reference file. Default: .env.example beside `preview`.
|
|
23
|
+
// example: "apps/web/.env.example",
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
// Stores, synced in this order. Key = the name `secrets` rows use; `type` defaults to the key.
|
|
27
|
+
// Delete stores this repo does not use. `protect` = names this store keeps that no row lists.
|
|
28
|
+
stores: {
|
|
29
|
+
// Repo-wide Actions secrets; values from `preview`. Write-only: parity from the state file.
|
|
30
|
+
github: {},
|
|
31
|
+
// `project` (default .vercel/project.json), else VERCEL_ORG_ID + VERCEL_PROJECT_ID. Token: VERCEL_TOKEN, else `vercel login`.
|
|
32
|
+
vercel: {},
|
|
33
|
+
// `ref` = env key holding the project ref (default SUPABASE_PROJECT_ID); token SUPABASE_ACCESS_TOKEN.
|
|
34
|
+
// SUPABASE_* names are platform-reserved: never written, never deleted.
|
|
35
|
+
supabase: { protect: [] },
|
|
36
|
+
// `dir` = EAS-linked app; `visibility` default for rows without an option. Prefer sensitive:
|
|
37
|
+
// `secret` cannot be read back, so drift falls back to the last recorded push.
|
|
38
|
+
eas: { dir: "apps/mobile", visibility: "sensitive" },
|
|
39
|
+
// `project` = env key holding the GCP project (default GCP_PROJECT_ID). Last: a backup no deployment reads.
|
|
40
|
+
gcp: {},
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
// Never written, never deleted, in any store: platform-injected or integration-managed.
|
|
44
|
+
protected: ["VERCEL_OIDC_TOKEN"],
|
|
45
|
+
|
|
46
|
+
// May stay empty without a `check` warning.
|
|
47
|
+
optional: [],
|
|
48
|
+
|
|
49
|
+
// One row per secret, naming every store that holds a copy:
|
|
50
|
+
// NAME: "store" | ["store", ...] value from the env key NAME
|
|
51
|
+
// NAME: { to, from: "LOCAL_KEY" } store name differs from the env key
|
|
52
|
+
// NAME: { to, derive: "${APP_URL}/path" } value composed from other keys
|
|
53
|
+
// NAME: { to, manual: ["where it lives, how to update"] } copies no API reaches; listed on every run
|
|
54
|
+
// "eas:secret" per-store option (EAS visibility)
|
|
55
|
+
// Preview-only value: leave it out of the production env file; production stores then delete it.
|
|
56
|
+
secrets: {
|
|
57
|
+
DATABASE_URL: ["vercel", "gcp"],
|
|
58
|
+
EXAMPLE_API_KEY: ["vercel", "supabase", "gcp"],
|
|
59
|
+
VERCEL_TOKEN: "github",
|
|
60
|
+
VERCEL_ORG_ID: "github",
|
|
61
|
+
VERCEL_PROJECT_ID: "github",
|
|
62
|
+
// EXPO_TOKEN: ["github", "eas"],
|
|
63
|
+
// WEBHOOK_URL: { to: "supabase", derive: "${APP_URL}/api/webhooks/example" },
|
|
64
|
+
// STRIPE_WEBHOOK_SECRET: { to: "vercel", manual: ["Stripe Dashboard → Webhooks → signing secret (value originates there)"] },
|
|
65
|
+
},
|
|
66
|
+
};
|