dorfl 0.0.0 → 0.1.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/dist/advance-ci-template.d.ts +73 -0
- package/dist/advance-ci-template.d.ts.map +1 -0
- package/dist/advance-ci-template.js +104 -0
- package/dist/advance-ci-template.js.map +1 -0
- package/dist/advance-classify.d.ts +132 -0
- package/dist/advance-classify.d.ts.map +1 -0
- package/dist/advance-classify.js +120 -0
- package/dist/advance-classify.js.map +1 -0
- package/dist/advance-drivers.d.ts +182 -0
- package/dist/advance-drivers.d.ts.map +1 -0
- package/dist/advance-drivers.js +231 -0
- package/dist/advance-drivers.js.map +1 -0
- package/dist/advance-isolated.d.ts +156 -0
- package/dist/advance-isolated.d.ts.map +1 -0
- package/dist/advance-isolated.js +256 -0
- package/dist/advance-isolated.js.map +1 -0
- package/dist/advance-lifecycle-template.d.ts +107 -0
- package/dist/advance-lifecycle-template.d.ts.map +1 -0
- package/dist/advance-lifecycle-template.js +668 -0
- package/dist/advance-lifecycle-template.js.map +1 -0
- package/dist/advance-loop-driver.d.ts +325 -0
- package/dist/advance-loop-driver.d.ts.map +1 -0
- package/dist/advance-loop-driver.js +437 -0
- package/dist/advance-loop-driver.js.map +1 -0
- package/dist/advance-treeless-publish.d.ts +108 -0
- package/dist/advance-treeless-publish.d.ts.map +1 -0
- package/dist/advance-treeless-publish.js +71 -0
- package/dist/advance-treeless-publish.js.map +1 -0
- package/dist/advance.d.ts +340 -0
- package/dist/advance.d.ts.map +1 -0
- package/dist/advance.js +1122 -0
- package/dist/advance.js.map +1 -0
- package/dist/advancing-lock.d.ts +294 -0
- package/dist/advancing-lock.d.ts.map +1 -0
- package/dist/advancing-lock.js +594 -0
- package/dist/advancing-lock.js.map +1 -0
- package/dist/agent-launch.d.ts +79 -0
- package/dist/agent-launch.d.ts.map +1 -0
- package/dist/agent-launch.js +61 -0
- package/dist/agent-launch.js.map +1 -0
- package/dist/agent-stop.d.ts +149 -0
- package/dist/agent-stop.d.ts.map +1 -0
- package/dist/agent-stop.js +307 -0
- package/dist/agent-stop.js.map +1 -0
- package/dist/apply-decide.d.ts +127 -0
- package/dist/apply-decide.d.ts.map +1 -0
- package/dist/apply-decide.js +176 -0
- package/dist/apply-decide.js.map +1 -0
- package/dist/apply-merge-action.d.ts +206 -0
- package/dist/apply-merge-action.d.ts.map +1 -0
- package/dist/apply-merge-action.js +307 -0
- package/dist/apply-merge-action.js.map +1 -0
- package/dist/apply-persist.d.ts +174 -0
- package/dist/apply-persist.d.ts.map +1 -0
- package/dist/apply-persist.js +359 -0
- package/dist/apply-persist.js.map +1 -0
- package/dist/arbiter.d.ts +120 -0
- package/dist/arbiter.d.ts.map +1 -0
- package/dist/arbiter.js +255 -0
- package/dist/arbiter.js.map +1 -0
- package/dist/brand.d.ts +70 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/brand.js +84 -0
- package/dist/brand.js.map +1 -0
- package/dist/buildable-body.d.ts +132 -0
- package/dist/buildable-body.d.ts.map +1 -0
- package/dist/buildable-body.js +131 -0
- package/dist/buildable-body.js.map +1 -0
- package/dist/categorise.d.ts +66 -0
- package/dist/categorise.d.ts.map +1 -0
- package/dist/categorise.js +106 -0
- package/dist/categorise.js.map +1 -0
- package/dist/claim-cas.d.ts +117 -0
- package/dist/claim-cas.d.ts.map +1 -0
- package/dist/claim-cas.js +312 -0
- package/dist/claim-cas.js.map +1 -0
- package/dist/cli-spinner.d.ts +112 -0
- package/dist/cli-spinner.d.ts.map +1 -0
- package/dist/cli-spinner.js +157 -0
- package/dist/cli-spinner.js.map +1 -0
- package/dist/cli.d.ts +11 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +3094 -0
- package/dist/cli.js.map +1 -0
- package/dist/close-job-template.d.ts +70 -0
- package/dist/close-job-template.d.ts.map +1 -0
- package/dist/close-job-template.js +180 -0
- package/dist/close-job-template.js.map +1 -0
- package/dist/close-job.d.ts +95 -0
- package/dist/close-job.d.ts.map +1 -0
- package/dist/close-job.js +226 -0
- package/dist/close-job.js.map +1 -0
- package/dist/complete.d.ts +361 -0
- package/dist/complete.d.ts.map +1 -0
- package/dist/complete.js +885 -0
- package/dist/complete.js.map +1 -0
- package/dist/concurrency.d.ts +68 -0
- package/dist/concurrency.d.ts.map +1 -0
- package/dist/concurrency.js +112 -0
- package/dist/concurrency.js.map +1 -0
- package/dist/config-override.d.ts +76 -0
- package/dist/config-override.d.ts.map +1 -0
- package/dist/config-override.js +50 -0
- package/dist/config-override.js.map +1 -0
- package/dist/config.d.ts +668 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +241 -0
- package/dist/config.js.map +1 -0
- package/dist/continue-branch.d.ts +249 -0
- package/dist/continue-branch.d.ts.map +1 -0
- package/dist/continue-branch.js +389 -0
- package/dist/continue-branch.js.map +1 -0
- package/dist/cwd-section.d.ts +186 -0
- package/dist/cwd-section.d.ts.map +1 -0
- package/dist/cwd-section.js +209 -0
- package/dist/cwd-section.js.map +1 -0
- package/dist/decision-engine.d.ts +170 -0
- package/dist/decision-engine.d.ts.map +1 -0
- package/dist/decision-engine.js +136 -0
- package/dist/decision-engine.js.map +1 -0
- package/dist/detect.d.ts +17 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +118 -0
- package/dist/detect.js.map +1 -0
- package/dist/do-autopick.d.ts +85 -0
- package/dist/do-autopick.d.ts.map +1 -0
- package/dist/do-autopick.js +112 -0
- package/dist/do-autopick.js.map +1 -0
- package/dist/do-config.d.ts +312 -0
- package/dist/do-config.d.ts.map +1 -0
- package/dist/do-config.js +358 -0
- package/dist/do-config.js.map +1 -0
- package/dist/do-remote-auto.d.ts +75 -0
- package/dist/do-remote-auto.d.ts.map +1 -0
- package/dist/do-remote-auto.js +111 -0
- package/dist/do-remote-auto.js.map +1 -0
- package/dist/do.d.ts +621 -0
- package/dist/do.d.ts.map +1 -0
- package/dist/do.js +1882 -0
- package/dist/do.js.map +1 -0
- package/dist/drop-source.d.ts +96 -0
- package/dist/drop-source.d.ts.map +1 -0
- package/dist/drop-source.js +91 -0
- package/dist/drop-source.js.map +1 -0
- package/dist/eligibility.d.ts +46 -0
- package/dist/eligibility.d.ts.map +1 -0
- package/dist/eligibility.js +34 -0
- package/dist/eligibility.js.map +1 -0
- package/dist/env-config.d.ts +51 -0
- package/dist/env-config.d.ts.map +1 -0
- package/dist/env-config.js +272 -0
- package/dist/env-config.js.map +1 -0
- package/dist/failure-cause.d.ts +70 -0
- package/dist/failure-cause.d.ts.map +1 -0
- package/dist/failure-cause.js +126 -0
- package/dist/failure-cause.js.map +1 -0
- package/dist/format.d.ts +43 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +256 -0
- package/dist/format.js.map +1 -0
- package/dist/frontmatter.d.ts +215 -0
- package/dist/frontmatter.d.ts.map +1 -0
- package/dist/frontmatter.js +345 -0
- package/dist/frontmatter.js.map +1 -0
- package/dist/gate-readiness.d.ts +84 -0
- package/dist/gate-readiness.d.ts.map +1 -0
- package/dist/gate-readiness.js +103 -0
- package/dist/gate-readiness.js.map +1 -0
- package/dist/gc.d.ts +165 -0
- package/dist/gc.d.ts.map +1 -0
- package/dist/gc.js +313 -0
- package/dist/gc.js.map +1 -0
- package/dist/gh-failure.d.ts +42 -0
- package/dist/gh-failure.d.ts.map +1 -0
- package/dist/gh-failure.js +49 -0
- package/dist/gh-failure.js.map +1 -0
- package/dist/git.d.ts +75 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +130 -0
- package/dist/git.js.map +1 -0
- package/dist/github.d.ts +187 -0
- package/dist/github.d.ts.map +1 -0
- package/dist/github.js +343 -0
- package/dist/github.js.map +1 -0
- package/dist/harness.d.ts +242 -0
- package/dist/harness.d.ts.map +1 -0
- package/dist/harness.js +157 -0
- package/dist/harness.js.map +1 -0
- package/dist/identity.d.ts +167 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +231 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +147 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +76 -0
- package/dist/index.js.map +1 -0
- package/dist/install-ci-branch-protection.d.ts +147 -0
- package/dist/install-ci-branch-protection.d.ts.map +1 -0
- package/dist/install-ci-branch-protection.js +166 -0
- package/dist/install-ci-branch-protection.js.map +1 -0
- package/dist/install-ci-capabilities/advance-lifecycle.d.ts +15 -0
- package/dist/install-ci-capabilities/advance-lifecycle.d.ts.map +1 -0
- package/dist/install-ci-capabilities/advance-lifecycle.js +28 -0
- package/dist/install-ci-capabilities/advance-lifecycle.js.map +1 -0
- package/dist/install-ci-capabilities/close-job.d.ts +13 -0
- package/dist/install-ci-capabilities/close-job.d.ts.map +1 -0
- package/dist/install-ci-capabilities/close-job.js +26 -0
- package/dist/install-ci-capabilities/close-job.js.map +1 -0
- package/dist/install-ci-capabilities/example-noop.d.ts +16 -0
- package/dist/install-ci-capabilities/example-noop.d.ts.map +1 -0
- package/dist/install-ci-capabilities/example-noop.js +23 -0
- package/dist/install-ci-capabilities/example-noop.js.map +1 -0
- package/dist/install-ci-capabilities/intake.d.ts +15 -0
- package/dist/install-ci-capabilities/intake.d.ts.map +1 -0
- package/dist/install-ci-capabilities/intake.js +28 -0
- package/dist/install-ci-capabilities/intake.js.map +1 -0
- package/dist/install-ci-capabilities/verify.d.ts +14 -0
- package/dist/install-ci-capabilities/verify.d.ts.map +1 -0
- package/dist/install-ci-capabilities/verify.js +27 -0
- package/dist/install-ci-capabilities/verify.js.map +1 -0
- package/dist/install-ci-core.d.ts +446 -0
- package/dist/install-ci-core.d.ts.map +1 -0
- package/dist/install-ci-core.js +760 -0
- package/dist/install-ci-core.js.map +1 -0
- package/dist/install-ci-github.d.ts +167 -0
- package/dist/install-ci-github.d.ts.map +1 -0
- package/dist/install-ci-github.js +315 -0
- package/dist/install-ci-github.js.map +1 -0
- package/dist/install-ci.d.ts +105 -0
- package/dist/install-ci.d.ts.map +1 -0
- package/dist/install-ci.js +363 -0
- package/dist/install-ci.js.map +1 -0
- package/dist/intake-event.d.ts +88 -0
- package/dist/intake-event.d.ts.map +1 -0
- package/dist/intake-event.js +66 -0
- package/dist/intake-event.js.map +1 -0
- package/dist/intake-marker.d.ts +95 -0
- package/dist/intake-marker.d.ts.map +1 -0
- package/dist/intake-marker.js +127 -0
- package/dist/intake-marker.js.map +1 -0
- package/dist/intake-triage.d.ts +48 -0
- package/dist/intake-triage.d.ts.map +1 -0
- package/dist/intake-triage.js +95 -0
- package/dist/intake-triage.js.map +1 -0
- package/dist/intake-trigger-template.d.ts +185 -0
- package/dist/intake-trigger-template.d.ts.map +1 -0
- package/dist/intake-trigger-template.js +449 -0
- package/dist/intake-trigger-template.js.map +1 -0
- package/dist/intake.d.ts +569 -0
- package/dist/intake.d.ts.map +1 -0
- package/dist/intake.js +1628 -0
- package/dist/intake.js.map +1 -0
- package/dist/integration-core.d.ts +539 -0
- package/dist/integration-core.d.ts.map +1 -0
- package/dist/integration-core.js +2195 -0
- package/dist/integration-core.js.map +1 -0
- package/dist/integrator.d.ts +343 -0
- package/dist/integrator.d.ts.map +1 -0
- package/dist/integrator.js +400 -0
- package/dist/integrator.js.map +1 -0
- package/dist/isolation.d.ts +219 -0
- package/dist/isolation.d.ts.map +1 -0
- package/dist/isolation.js +261 -0
- package/dist/isolation.js.map +1 -0
- package/dist/issue-provider.d.ts +349 -0
- package/dist/issue-provider.d.ts.map +1 -0
- package/dist/issue-provider.js +360 -0
- package/dist/issue-provider.js.map +1 -0
- package/dist/item-lock.d.ts +626 -0
- package/dist/item-lock.d.ts.map +1 -0
- package/dist/item-lock.js +1381 -0
- package/dist/item-lock.js.map +1 -0
- package/dist/item-path.d.ts +49 -0
- package/dist/item-path.d.ts.map +1 -0
- package/dist/item-path.js +66 -0
- package/dist/item-path.js.map +1 -0
- package/dist/ledger-lint.d.ts +129 -0
- package/dist/ledger-lint.d.ts.map +1 -0
- package/dist/ledger-lint.js +249 -0
- package/dist/ledger-lint.js.map +1 -0
- package/dist/ledger-read.d.ts +357 -0
- package/dist/ledger-read.d.ts.map +1 -0
- package/dist/ledger-read.js +442 -0
- package/dist/ledger-read.js.map +1 -0
- package/dist/ledger-write.d.ts +330 -0
- package/dist/ledger-write.d.ts.map +1 -0
- package/dist/ledger-write.js +411 -0
- package/dist/ledger-write.js.map +1 -0
- package/dist/lifecycle-gather.d.ts +30 -0
- package/dist/lifecycle-gather.d.ts.map +1 -0
- package/dist/lifecycle-gather.js +205 -0
- package/dist/lifecycle-gather.js.map +1 -0
- package/dist/lifecycle-pools.d.ts +180 -0
- package/dist/lifecycle-pools.d.ts.map +1 -0
- package/dist/lifecycle-pools.js +78 -0
- package/dist/lifecycle-pools.js.map +1 -0
- package/dist/merge-question-surfacer.d.ts +166 -0
- package/dist/merge-question-surfacer.d.ts.map +1 -0
- package/dist/merge-question-surfacer.js +297 -0
- package/dist/merge-question-surfacer.js.map +1 -0
- package/dist/mint-adr.d.ts +126 -0
- package/dist/mint-adr.d.ts.map +1 -0
- package/dist/mint-adr.js +257 -0
- package/dist/mint-adr.js.map +1 -0
- package/dist/mirror-pool-scan.d.ts +125 -0
- package/dist/mirror-pool-scan.d.ts.map +1 -0
- package/dist/mirror-pool-scan.js +104 -0
- package/dist/mirror-pool-scan.js.map +1 -0
- package/dist/needs-attention.d.ts +341 -0
- package/dist/needs-attention.d.ts.map +1 -0
- package/dist/needs-attention.js +900 -0
- package/dist/needs-attention.js.map +1 -0
- package/dist/orphan-sidecar.d.ts +79 -0
- package/dist/orphan-sidecar.d.ts.map +1 -0
- package/dist/orphan-sidecar.js +71 -0
- package/dist/orphan-sidecar.js.map +1 -0
- package/dist/output.d.ts +48 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +66 -0
- package/dist/output.js.map +1 -0
- package/dist/pi-harness.d.ts +179 -0
- package/dist/pi-harness.d.ts.map +1 -0
- package/dist/pi-harness.js +342 -0
- package/dist/pi-harness.js.map +1 -0
- package/dist/placement.d.ts +99 -0
- package/dist/placement.d.ts.map +1 -0
- package/dist/placement.js +67 -0
- package/dist/placement.js.map +1 -0
- package/dist/prd-to-spec.d.ts +315 -0
- package/dist/prd-to-spec.d.ts.map +1 -0
- package/dist/prd-to-spec.js +684 -0
- package/dist/prd-to-spec.js.map +1 -0
- package/dist/prepare.d.ts +121 -0
- package/dist/prepare.d.ts.map +1 -0
- package/dist/prepare.js +140 -0
- package/dist/prepare.js.map +1 -0
- package/dist/prompt.d.ts +360 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +499 -0
- package/dist/prompt.js.map +1 -0
- package/dist/protocol/ADR-FORMAT.md +47 -0
- package/dist/protocol/CLAIM-PROTOCOL.md +217 -0
- package/dist/protocol/REVIEW-PROTOCOL.md +119 -0
- package/dist/protocol/SURFACE-PROTOCOL.md +121 -0
- package/dist/protocol/TASKING-PROTOCOL.md +122 -0
- package/dist/protocol/WORK-CONTRACT.md +276 -0
- package/dist/protocol/spec-template.md +71 -0
- package/dist/protocol/task-template.md +65 -0
- package/dist/readiness.d.ts +66 -0
- package/dist/readiness.d.ts.map +1 -0
- package/dist/readiness.js +36 -0
- package/dist/readiness.js.map +1 -0
- package/dist/reap-branches.d.ts +102 -0
- package/dist/reap-branches.d.ts.map +1 -0
- package/dist/reap-branches.js +149 -0
- package/dist/reap-branches.js.map +1 -0
- package/dist/recover-isolated.d.ts +72 -0
- package/dist/recover-isolated.d.ts.map +1 -0
- package/dist/recover-isolated.js +188 -0
- package/dist/recover-isolated.js.map +1 -0
- package/dist/registry.d.ts +172 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +296 -0
- package/dist/registry.js.map +1 -0
- package/dist/repo-config.d.ts +201 -0
- package/dist/repo-config.d.ts.map +1 -0
- package/dist/repo-config.js +414 -0
- package/dist/repo-config.js.map +1 -0
- package/dist/repo-key.d.ts +20 -0
- package/dist/repo-key.d.ts.map +1 -0
- package/dist/repo-key.js +68 -0
- package/dist/repo-key.js.map +1 -0
- package/dist/repo-mirror.d.ts +177 -0
- package/dist/repo-mirror.d.ts.map +1 -0
- package/dist/repo-mirror.js +271 -0
- package/dist/repo-mirror.js.map +1 -0
- package/dist/retry-backoff.d.ts +90 -0
- package/dist/retry-backoff.d.ts.map +1 -0
- package/dist/retry-backoff.js +98 -0
- package/dist/retry-backoff.js.map +1 -0
- package/dist/review-gate.d.ts +173 -0
- package/dist/review-gate.d.ts.map +1 -0
- package/dist/review-gate.js +261 -0
- package/dist/review-gate.js.map +1 -0
- package/dist/review-verdict.d.ts +149 -0
- package/dist/review-verdict.d.ts.map +1 -0
- package/dist/review-verdict.js +332 -0
- package/dist/review-verdict.js.map +1 -0
- package/dist/run.d.ts +221 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +963 -0
- package/dist/run.js.map +1 -0
- package/dist/scan.d.ts +308 -0
- package/dist/scan.d.ts.map +1 -0
- package/dist/scan.js +374 -0
- package/dist/scan.js.map +1 -0
- package/dist/select-order.d.ts +75 -0
- package/dist/select-order.d.ts.map +1 -0
- package/dist/select-order.js +108 -0
- package/dist/select-order.js.map +1 -0
- package/dist/select-priority.d.ts +188 -0
- package/dist/select-priority.d.ts.map +1 -0
- package/dist/select-priority.js +80 -0
- package/dist/select-priority.js.map +1 -0
- package/dist/select.d.ts +25 -0
- package/dist/select.d.ts.map +1 -0
- package/dist/select.js +43 -0
- package/dist/select.js.map +1 -0
- package/dist/session-path.d.ts +36 -0
- package/dist/session-path.d.ts.map +1 -0
- package/dist/session-path.js +129 -0
- package/dist/session-path.js.map +1 -0
- package/dist/sidecar-apply.d.ts +83 -0
- package/dist/sidecar-apply.d.ts.map +1 -0
- package/dist/sidecar-apply.js +111 -0
- package/dist/sidecar-apply.js.map +1 -0
- package/dist/sidecar.d.ts +245 -0
- package/dist/sidecar.d.ts.map +1 -0
- package/dist/sidecar.js +481 -0
- package/dist/sidecar.js.map +1 -0
- package/dist/slug-namespace.d.ts +204 -0
- package/dist/slug-namespace.d.ts.map +1 -0
- package/dist/slug-namespace.js +229 -0
- package/dist/slug-namespace.js.map +1 -0
- package/dist/spec-complete.d.ts +44 -0
- package/dist/spec-complete.d.ts.map +1 -0
- package/dist/spec-complete.js +69 -0
- package/dist/spec-complete.js.map +1 -0
- package/dist/start.d.ts +97 -0
- package/dist/start.d.ts.map +1 -0
- package/dist/start.js +633 -0
- package/dist/start.js.map +1 -0
- package/dist/status.d.ts +199 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +228 -0
- package/dist/status.js.map +1 -0
- package/dist/surface-gate.d.ts +162 -0
- package/dist/surface-gate.d.ts.map +1 -0
- package/dist/surface-gate.js +206 -0
- package/dist/surface-gate.js.map +1 -0
- package/dist/surface-persist.d.ts +86 -0
- package/dist/surface-persist.d.ts.map +1 -0
- package/dist/surface-persist.js +129 -0
- package/dist/surface-persist.js.map +1 -0
- package/dist/tasker-review-loop.d.ts +249 -0
- package/dist/tasker-review-loop.d.ts.map +1 -0
- package/dist/tasker-review-loop.js +369 -0
- package/dist/tasker-review-loop.js.map +1 -0
- package/dist/tasking-eligibility.d.ts +74 -0
- package/dist/tasking-eligibility.d.ts.map +1 -0
- package/dist/tasking-eligibility.js +52 -0
- package/dist/tasking-eligibility.js.map +1 -0
- package/dist/tasking-lock.d.ts +111 -0
- package/dist/tasking-lock.d.ts.map +1 -0
- package/dist/tasking-lock.js +256 -0
- package/dist/tasking-lock.js.map +1 -0
- package/dist/tasking.d.ts +275 -0
- package/dist/tasking.d.ts.map +1 -0
- package/dist/tasking.js +952 -0
- package/dist/tasking.js.map +1 -0
- package/dist/triage-gate.d.ts +127 -0
- package/dist/triage-gate.d.ts.map +1 -0
- package/dist/triage-gate.js +139 -0
- package/dist/triage-gate.js.map +1 -0
- package/dist/triage-persist.d.ts +163 -0
- package/dist/triage-persist.d.ts.map +1 -0
- package/dist/triage-persist.js +387 -0
- package/dist/triage-persist.js.map +1 -0
- package/dist/verdict-json.d.ts +32 -0
- package/dist/verdict-json.d.ts.map +1 -0
- package/dist/verdict-json.js +74 -0
- package/dist/verdict-json.js.map +1 -0
- package/dist/verify-workflow-template.d.ts +60 -0
- package/dist/verify-workflow-template.d.ts.map +1 -0
- package/dist/verify-workflow-template.js +126 -0
- package/dist/verify-workflow-template.js.map +1 -0
- package/dist/verify.d.ts +60 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +62 -0
- package/dist/verify.js.map +1 -0
- package/dist/watch-session.d.ts +112 -0
- package/dist/watch-session.d.ts.map +1 -0
- package/dist/watch-session.js +347 -0
- package/dist/watch-session.js.map +1 -0
- package/dist/work-layout.d.ts +198 -0
- package/dist/work-layout.d.ts.map +1 -0
- package/dist/work-layout.js +217 -0
- package/dist/work-layout.js.map +1 -0
- package/dist/work-on.d.ts +154 -0
- package/dist/work-on.d.ts.map +1 -0
- package/dist/work-on.js +387 -0
- package/dist/work-on.js.map +1 -0
- package/dist/workspace.d.ts +224 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +325 -0
- package/dist/workspace.js.map +1 -0
- package/package.json +46 -2
- package/src/advance-ci-template.ts +203 -0
- package/src/advance-classify.ts +197 -0
- package/src/advance-drivers.ts +414 -0
- package/src/advance-isolated.ts +432 -0
- package/src/advance-lifecycle-template.ts +791 -0
- package/src/advance-loop-driver.ts +745 -0
- package/src/advance-treeless-publish.ts +177 -0
- package/src/advance.ts +1564 -0
- package/src/advancing-lock.ts +988 -0
- package/src/agent-launch.ts +137 -0
- package/src/agent-stop.ts +361 -0
- package/src/apply-decide.ts +242 -0
- package/src/apply-merge-action.ts +502 -0
- package/src/apply-persist.ts +518 -0
- package/src/arbiter.ts +372 -0
- package/src/brand.ts +111 -0
- package/src/buildable-body.ts +196 -0
- package/src/categorise.ts +158 -0
- package/src/claim-cas.ts +513 -0
- package/src/cli-spinner.ts +225 -0
- package/src/cli.ts +4369 -0
- package/src/close-job-template.ts +236 -0
- package/src/close-job.ts +319 -0
- package/src/complete.ts +1379 -0
- package/src/concurrency.ts +151 -0
- package/src/config-override.ts +116 -0
- package/src/config.ts +883 -0
- package/src/continue-branch.ts +542 -0
- package/src/cwd-section.ts +392 -0
- package/src/decision-engine.ts +272 -0
- package/src/detect.ts +124 -0
- package/src/do-autopick.ts +223 -0
- package/src/do-config.ts +589 -0
- package/src/do-remote-auto.ts +197 -0
- package/src/do.ts +2623 -0
- package/src/drop-source.ts +194 -0
- package/src/eligibility.ts +79 -0
- package/src/env-config.ts +305 -0
- package/src/failure-cause.ts +142 -0
- package/src/format.ts +313 -0
- package/src/frontmatter.ts +485 -0
- package/src/gate-readiness.ts +147 -0
- package/src/gc.ts +510 -0
- package/src/gh-failure.ts +53 -0
- package/src/git.ts +186 -0
- package/src/github.ts +468 -0
- package/src/harness.ts +355 -0
- package/src/identity.ts +322 -0
- package/src/index.ts +785 -0
- package/src/install-ci-branch-protection.ts +255 -0
- package/src/install-ci-capabilities/advance-lifecycle.ts +34 -0
- package/src/install-ci-capabilities/close-job.ts +32 -0
- package/src/install-ci-capabilities/example-noop.ts +24 -0
- package/src/install-ci-capabilities/intake.ts +34 -0
- package/src/install-ci-capabilities/verify.ts +33 -0
- package/src/install-ci-core.ts +1088 -0
- package/src/install-ci-github.ts +376 -0
- package/src/install-ci.ts +552 -0
- package/src/intake-event.ts +102 -0
- package/src/intake-marker.ts +195 -0
- package/src/intake-triage.ts +138 -0
- package/src/intake-trigger-template.ts +591 -0
- package/src/intake.ts +2445 -0
- package/src/integration-core.ts +3065 -0
- package/src/integrator.ts +771 -0
- package/src/isolation.ts +484 -0
- package/src/issue-provider.ts +733 -0
- package/src/item-lock.ts +1858 -0
- package/src/item-path.ts +75 -0
- package/src/ledger-lint.ts +332 -0
- package/src/ledger-read.ts +924 -0
- package/src/ledger-write.ts +865 -0
- package/src/lifecycle-gather.ts +298 -0
- package/src/lifecycle-pools.ts +250 -0
- package/src/merge-question-surfacer.ts +496 -0
- package/src/mint-adr.ts +362 -0
- package/src/mirror-pool-scan.ts +240 -0
- package/src/needs-attention.ts +1506 -0
- package/src/orphan-sidecar.ts +150 -0
- package/src/output.ts +89 -0
- package/src/pi-harness.ts +403 -0
- package/src/placement.ts +131 -0
- package/src/prd-to-spec.ts +1023 -0
- package/src/prepare.ts +230 -0
- package/src/prompt.ts +760 -0
- package/src/readiness.ts +98 -0
- package/src/reap-branches.ts +278 -0
- package/src/recover-isolated.ts +276 -0
- package/src/registry.ts +475 -0
- package/src/repo-config.ts +550 -0
- package/src/repo-key.ts +74 -0
- package/src/repo-mirror.ts +367 -0
- package/src/retry-backoff.ts +130 -0
- package/src/review-gate.ts +389 -0
- package/src/review-verdict.ts +422 -0
- package/src/run.ts +1430 -0
- package/src/scan.ts +611 -0
- package/src/select-order.ts +143 -0
- package/src/select-priority.ts +266 -0
- package/src/select.ts +62 -0
- package/src/session-path.ts +153 -0
- package/src/sidecar-apply.ts +216 -0
- package/src/sidecar.ts +700 -0
- package/src/slug-namespace.ts +367 -0
- package/src/spec-complete.ts +118 -0
- package/src/start.ts +974 -0
- package/src/status.ts +441 -0
- package/src/surface-gate.ts +337 -0
- package/src/surface-persist.ts +241 -0
- package/src/tasker-review-loop.ts +671 -0
- package/src/tasking-eligibility.ts +114 -0
- package/src/tasking-lock.ts +416 -0
- package/src/tasking.ts +1438 -0
- package/src/triage-gate.ts +248 -0
- package/src/triage-persist.ts +570 -0
- package/src/verdict-json.ts +73 -0
- package/src/verify-workflow-template.ts +159 -0
- package/src/verify.ts +123 -0
- package/src/watch-session.ts +397 -0
- package/src/work-layout.ts +262 -0
- package/src/work-on.ts +660 -0
- package/src/workspace.ts +502 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { run, runAsync, localMainDivergence } from './git.js';
|
|
2
|
+
import { isParticipatingRepo } from './detect.js';
|
|
3
|
+
import { scanRepoPaths } from './scan.js';
|
|
4
|
+
import { arbiterStatus } from './arbiter.js';
|
|
5
|
+
import { listMirrors } from './registry.js';
|
|
6
|
+
import { encodeRepoKey, mirrorPath } from './repo-mirror.js';
|
|
7
|
+
import { heldTaskSlugsStrict, listItemLockEntries } from './item-lock.js';
|
|
8
|
+
/** True iff the working repo has a git remote with name `remote`. The held-lock
|
|
9
|
+
* read targets the COORDINATION arbiter (default `origin`); we only attempt it
|
|
10
|
+
* when that remote actually exists, so a repo with no coordination remote keeps
|
|
11
|
+
* the empty held set rather than failing on a `git remote get-url` miss. */
|
|
12
|
+
function remoteExists(cwd, remote, env) {
|
|
13
|
+
return run('git', ['remote', 'get-url', remote], cwd, { env }).status === 0;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The FETCH-FREE pre-check that decides whether a DEFAULT `scan`/`status` should
|
|
17
|
+
* pay for the cwd section at all. It does NO network I/O: it reads whether the cwd
|
|
18
|
+
* participates (local `readdirSync`) and resolves the cwd's arbiter URL via the
|
|
19
|
+
* fetch-free {@link arbiterStatus} (a local `git remote get-url`), then asks the
|
|
20
|
+
* fetch-free {@link resolveRegistration} (local {@link listMirrors} key match)
|
|
21
|
+
* whether that URL is already a registered mirror.
|
|
22
|
+
*
|
|
23
|
+
* The CLI gates on this BEFORE calling {@link resolveCwdSection}: a participating
|
|
24
|
+
* cwd that is ALSO registered is skipped (the registry already covers it, and the
|
|
25
|
+
* cwd read would only re-fetch the same arbiter), while a participating cwd with
|
|
26
|
+
* NO mirror is resolved + shown standalone so a mirror-less repo you are standing
|
|
27
|
+
* in is never invisible. `--here` bypasses this gate (it ALWAYS resolves the cwd,
|
|
28
|
+
* and only the cwd).
|
|
29
|
+
*/
|
|
30
|
+
export function cwdSectionDisposition(input) {
|
|
31
|
+
if (!isParticipatingRepo(input.cwd)) {
|
|
32
|
+
return { participating: false, alsoRegistered: false };
|
|
33
|
+
}
|
|
34
|
+
// Fetch-free: arbiterStatus reads the local remote config only (no fetch).
|
|
35
|
+
const status = arbiterStatus({
|
|
36
|
+
cwd: input.cwd,
|
|
37
|
+
remote: input.arbiterRemote,
|
|
38
|
+
env: input.env,
|
|
39
|
+
});
|
|
40
|
+
const { alsoRegistered } = resolveRegistration({
|
|
41
|
+
arbiterUrl: status.url,
|
|
42
|
+
config: input.config,
|
|
43
|
+
env: input.env,
|
|
44
|
+
});
|
|
45
|
+
return { participating: true, alsoRegistered };
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Resolve the cwd-local section for `scan`/`status`. Returns
|
|
49
|
+
* `{participating: false}` when the cwd is NOT a participating repo (the callers
|
|
50
|
+
* then render only the registry view, unchanged). When participating it:
|
|
51
|
+
*
|
|
52
|
+
* 1. FETCHES the cwd repo's arbiter first (warn + fall back to last-known on
|
|
53
|
+
* failure — never errors), then computes the divergence vs `<arbiter>/main`;
|
|
54
|
+
* 2. reads the COORDINATION arbiter's HELD-LOCK set (the remote where
|
|
55
|
+
* `refs/dorfl/lock/*` live, default `origin`; fail-closed: throws when that
|
|
56
|
+
* remote exists but is unreachable) to SUBTRACT in-flight items from the pool;
|
|
57
|
+
* 3. reads the cwd's `work/` lifecycle from the LOCAL WORKING TREE
|
|
58
|
+
* (`scanRepoPaths([cwd])`) with that held set subtracted;
|
|
59
|
+
* 4. de-dups against the registry (is the cwd's arbiter URL a registered
|
|
60
|
+
* mirror?).
|
|
61
|
+
*
|
|
62
|
+
* It MUTATES nothing but the arbiter fetch (a read refresh, same as the registry
|
|
63
|
+
* fetch-first); it never claims/moves/integrates.
|
|
64
|
+
*/
|
|
65
|
+
export async function resolveCwdSection(options) {
|
|
66
|
+
const { cwd, config, warn, env } = options;
|
|
67
|
+
if (!isParticipatingRepo(cwd)) {
|
|
68
|
+
return { path: cwd, participating: false };
|
|
69
|
+
}
|
|
70
|
+
// 1. The cwd repo's arbiter + fetch-first divergence. We resolve the arbiter
|
|
71
|
+
// via the SAME `arbiterStatus` the dashboard's arbiter section uses; if it
|
|
72
|
+
// is configured we fetch it BEFORE diffing (the local tree is the least
|
|
73
|
+
// authoritative view) — warn + fall back to last-known on failure. Resolved
|
|
74
|
+
// FIRST (before the pool read) so the held-lock subtraction below reads that
|
|
75
|
+
// same arbiter's lock refs.
|
|
76
|
+
const arbiter = await resolveCwdArbiter({
|
|
77
|
+
cwd,
|
|
78
|
+
remote: options.arbiterRemote,
|
|
79
|
+
warn,
|
|
80
|
+
env,
|
|
81
|
+
});
|
|
82
|
+
// 2. The held-lock set to SUBTRACT from the cwd pool (the SELECTION fix). The
|
|
83
|
+
// lock refs live on the COORDINATION arbiter (`refs/dorfl/lock/*`) — the SAME
|
|
84
|
+
// remote `claim`/`do` use, default `origin` — NOT the `arbiter`-named
|
|
85
|
+
// DIVERGENCE remote resolved above (this repo has no `arbiter` remote; its
|
|
86
|
+
// arbiter IS `origin`). So we read the held set from the coordination remote
|
|
87
|
+
// and FAIL CLOSED on a read fault (`heldTaskSlugsStrict` throws): an offline /
|
|
88
|
+
// unreachable arbiter makes the eligible pool UNKNOWN, and we must NOT emit a
|
|
89
|
+
// confident-but-wrong pool (which CI would enumerate into doomed claim legs).
|
|
90
|
+
// A repo with NO coordination remote configured has nothing to subtract and
|
|
91
|
+
// nothing to fail against — it keeps the empty set.
|
|
92
|
+
const lockRemote = options.lockArbiterRemote ?? 'origin';
|
|
93
|
+
const hasLockRemote = remoteExists(cwd, lockRemote, env);
|
|
94
|
+
const heldSlugs = hasLockRemote
|
|
95
|
+
? await heldTaskSlugsStrict(cwd, lockRemote, env)
|
|
96
|
+
: new Set();
|
|
97
|
+
// 3. The cwd's `work/` lifecycle from the LOCAL WORKING TREE (not a mirror ref),
|
|
98
|
+
// with the arbiter-read held set SUBTRACTED so in-flight (lock-held) items are
|
|
99
|
+
// not reported eligible. Thread the per-machine override so the cwd section's
|
|
100
|
+
// eligibility matches what `do`/`advance` autopick will actually select.
|
|
101
|
+
const localReport = scanRepoPaths([cwd], config, heldSlugs, options.override);
|
|
102
|
+
const repo = localReport.repos[0];
|
|
103
|
+
// 3b. The PER-ITEM LOCK in-flight SURFACE for the cwd (prd
|
|
104
|
+
// `ledger-status-per-item-lock-refs` US #8). The subtraction above removes a
|
|
105
|
+
// held slug from the eligible `items[]` pool; on its OWN that leaves a
|
|
106
|
+
// held/stuck cwd item in a BLIND SPOT — gone from every bucket with nothing
|
|
107
|
+
// explaining why (the regression this fixes). The registry/mirror `scan`
|
|
108
|
+
// attaches `lockHeld` to each `RepoReport` so a held item still shows up
|
|
109
|
+
// in-progress/stuck; the cwd `RepoReport` from `scanRepoPaths` did not. So we
|
|
110
|
+
// read the SAME held lock entries (action × state + reason/questions) via the
|
|
111
|
+
// SAME `listItemLockEntries` primitive the mirror path uses (NOT a second
|
|
112
|
+
// reader) and attach them, making `.cwd.repo.lockHeld` symmetric with
|
|
113
|
+
// `.repos[].lockHeld`.
|
|
114
|
+
//
|
|
115
|
+
// This is a SURFACE only, and it is INTENTIONALLY graceful (best-effort,
|
|
116
|
+
// empty on any fault — exactly as `listItemLockEntries` is on the mirror
|
|
117
|
+
// side): a read fault degrades to "no in-flight locks shown", it must NOT
|
|
118
|
+
// fail the section. The SELECTION subtraction above stays STRICT
|
|
119
|
+
// (`heldTaskSlugsStrict`, fail-closed) — the two reads have deliberately
|
|
120
|
+
// different fault models (selection fails closed; the surface degrades).
|
|
121
|
+
// Read from the SAME coordination remote the subtraction used. A repo with no
|
|
122
|
+
// coordination remote has no lock refs to read — empty surface.
|
|
123
|
+
if (repo !== undefined && hasLockRemote) {
|
|
124
|
+
const lockHeld = await listItemLockEntries(cwd, lockRemote, env);
|
|
125
|
+
if (lockHeld.length > 0) {
|
|
126
|
+
repo.lockHeld = lockHeld;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// 4. De-dup: is the cwd's arbiter URL a registered hub mirror? Compare the
|
|
130
|
+
// cwd's mirror KEY (from its arbiter URL) against the registry's keys.
|
|
131
|
+
const { alsoRegistered, registeredMirrorPath } = resolveRegistration({
|
|
132
|
+
arbiterUrl: arbiter?.url,
|
|
133
|
+
config,
|
|
134
|
+
env,
|
|
135
|
+
});
|
|
136
|
+
return {
|
|
137
|
+
path: cwd,
|
|
138
|
+
participating: true,
|
|
139
|
+
repo,
|
|
140
|
+
totalItems: localReport.totalItems,
|
|
141
|
+
totalEligible: localReport.totalEligible,
|
|
142
|
+
alsoRegistered,
|
|
143
|
+
...(registeredMirrorPath !== undefined ? { registeredMirrorPath } : {}),
|
|
144
|
+
...(arbiter !== undefined ? { arbiter } : {}),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Resolve the cwd repo's arbiter + divergence. Reuses `arbiterStatus` to find
|
|
149
|
+
* the arbiter remote/URL, FETCHES its `main` first (warn + fall back to
|
|
150
|
+
* last-known on failure — NEVER errors, ADR §5/§6), then reads the divergence of
|
|
151
|
+
* local `main` vs `<arbiter>/main` in both directions. Returns `undefined` when
|
|
152
|
+
* no arbiter remote is configured (no divergence line to show).
|
|
153
|
+
*/
|
|
154
|
+
async function resolveCwdArbiter(input) {
|
|
155
|
+
const { cwd, env } = input;
|
|
156
|
+
const status = arbiterStatus({ cwd, remote: input.remote, env });
|
|
157
|
+
if (!status.configured) {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
const remote = status.remote;
|
|
161
|
+
// Fetch-first ALSO for the cwd (the maintainer's explicit ask): refresh the
|
|
162
|
+
// arbiter's `main` before diffing, reusing scan-status-fetch-first's
|
|
163
|
+
// fetch+warn+fallback. A failed fetch is NOT fatal — warn + last-known.
|
|
164
|
+
let fetched = false;
|
|
165
|
+
const fetch = await runAsync('git', ['fetch', '--quiet', remote], cwd, { env });
|
|
166
|
+
if (fetch.status === 0) {
|
|
167
|
+
fetched = true;
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
input.warn?.(`could not fetch the cwd repo's arbiter '${remote}'; ` +
|
|
171
|
+
'computing local divergence from last-known (offline). ' +
|
|
172
|
+
fetch.stderr.trim());
|
|
173
|
+
}
|
|
174
|
+
const { ahead, behind } = await localMainDivergence(cwd, remote, env);
|
|
175
|
+
return {
|
|
176
|
+
remote,
|
|
177
|
+
configured: true,
|
|
178
|
+
url: status.url,
|
|
179
|
+
fetched,
|
|
180
|
+
ahead,
|
|
181
|
+
behind,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* De-dup helper: is the cwd repo (identified by its arbiter URL) ALSO registered
|
|
186
|
+
* in the registry? The registry keys a mirror off its arbiter URL via
|
|
187
|
+
* `encodeRepoKey`/`mirrorPath`, so we encode the cwd's arbiter URL the same way
|
|
188
|
+
* and look for a matching registered mirror (by key, robust to the lossy URL).
|
|
189
|
+
* Returns whether it is registered + the matching mirror path (so the registry
|
|
190
|
+
* view can drop that row). With no arbiter URL there is nothing to match.
|
|
191
|
+
*/
|
|
192
|
+
function resolveRegistration(input) {
|
|
193
|
+
const { arbiterUrl, config, env } = input;
|
|
194
|
+
if (arbiterUrl === undefined || arbiterUrl.trim() === '') {
|
|
195
|
+
return { alsoRegistered: false };
|
|
196
|
+
}
|
|
197
|
+
const cwdKey = encodeRepoKey(arbiterUrl);
|
|
198
|
+
const cwdMirrorPath = mirrorPath(config.workspacesDir, arbiterUrl);
|
|
199
|
+
for (const mirror of listMirrors({
|
|
200
|
+
workspacesDir: config.workspacesDir,
|
|
201
|
+
env,
|
|
202
|
+
})) {
|
|
203
|
+
if (mirror.key === cwdKey || mirror.path === cwdMirrorPath) {
|
|
204
|
+
return { alsoRegistered: true, registeredMirrorPath: mirror.path };
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return { alsoRegistered: false };
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=cwd-section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cwd-section.js","sourceRoot":"","sources":["../src/cwd-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAE,QAAQ,EAAE,mBAAmB,EAAC,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EAAC,aAAa,EAAkB,MAAM,WAAW,CAAC;AACzD,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;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aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,GAAG;KACH,CAAC,EAAE,CAAC;QACJ,IAAI,MAAM,CAAC,GAAG,KAAK,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;YAC5D,OAAO,EAAC,cAAc,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,CAAC,IAAI,EAAC,CAAC;QAClE,CAAC;IACF,CAAC;IACD,OAAO,EAAC,cAAc,EAAE,KAAK,EAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* **The SHARED decision engine** (prd
|
|
3
|
+
* `agentic-question-resolution-retire-disposition-vocabulary` US #9, decision 3 +
|
|
4
|
+
* 13/14; task `decision-engine-shared-decide-seam`): the GENERALISED
|
|
5
|
+
* `decide(input, allowedOutcomes) → verdict` core every question-resolution
|
|
6
|
+
* decision is built on. It is the same `prompt → VERDICT → dispatch` shape
|
|
7
|
+
* `intake` already has, lifted into ONE outcome-AGNOSTIC engine so intake and the
|
|
8
|
+
* advance-apply rung share the machinery WITHOUT being forced to identical
|
|
9
|
+
* verdicts or inputs.
|
|
10
|
+
*
|
|
11
|
+
* Two things are parameters, NOT hard-coded into the engine:
|
|
12
|
+
*
|
|
13
|
+
* - **the INPUT-ADAPTER** ({@link DecisionDecider}'s `TInput`): each caller's
|
|
14
|
+
* front door reads a DIFFERENT thing (intake reads an issue + its comment
|
|
15
|
+
* thread; advance-apply reads an answered sidecar + its source item). The engine
|
|
16
|
+
* never knows that shape — it threads the caller's `input` opaquely to the
|
|
17
|
+
* injected decider, so the adapter boundary sits OUTSIDE the engine (decision 3:
|
|
18
|
+
* "the INPUT adapter differs per front door and is NOT forced to be shared").
|
|
19
|
+
* - **the ALLOWED-OUTCOME SET** ({@link decide}'s `allowedOutcomes`): each caller
|
|
20
|
+
* passes the SUBSET of {@link DecisionOutcome} it permits — advance-apply allows
|
|
21
|
+
* `{task | prd | adr | delete | ask}`, intake keeps its own `{task | prd | ask |
|
|
22
|
+
* bounce}` (intake is NOT refactored onto this engine here — decision 13). The
|
|
23
|
+
* engine never hard-codes which outcomes a caller permits; it only VALIDATES the
|
|
24
|
+
* returned verdict against the set and rejects (loudly) one outside it
|
|
25
|
+
* (decision 14: "the engine stays outcome-AGNOSTIC", so `adr` can be added to a
|
|
26
|
+
* caller later WITHOUT re-architecting).
|
|
27
|
+
*
|
|
28
|
+
* This module is the PURE engine + its types ONLY — no fs, no git, no seam ops, no
|
|
29
|
+
* wiring into `sidecar.ts` / `apply-persist.ts` / `intake.ts`. The keystone apply
|
|
30
|
+
* task (`agentic-apply-retire-disposition-vocabulary`) consumes it next; intake
|
|
31
|
+
* adopting `adr` is a separate decision (the engine being agnostic means it CAN
|
|
32
|
+
* be added later).
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* The SUPERSET of outcomes the engine knows — a "verdict" is what an agent
|
|
36
|
+
* decides to DO with an input (the analogue of intake's {@link IntakeOutcome}):
|
|
37
|
+
*
|
|
38
|
+
* - **task** — mint a self-contained task from the input.
|
|
39
|
+
* - **spec** — mint a spec from the input.
|
|
40
|
+
* - **adr** — mint an adr from the input (NO caller wires this yet; the keystone's
|
|
41
|
+
* allowed set will, and `agentic-apply-mint-adr-route` adds the route — decision
|
|
42
|
+
* 14 keeps the engine agnostic so this is added without re-architecting).
|
|
43
|
+
* - **delete** — delete the SOURCE the input is about (a direct, git-recoverable
|
|
44
|
+
* removal — decision 12).
|
|
45
|
+
* - **ask** — ask the operator a follow-up (re-pause; the conversation
|
|
46
|
+
* accumulates — decision 5).
|
|
47
|
+
*
|
|
48
|
+
* No caller is forced to allow ALL of these: each passes its own SUBSET to
|
|
49
|
+
* {@link decide}. The engine is agnostic to which subset a caller permits.
|
|
50
|
+
*/
|
|
51
|
+
export type DecisionOutcome = 'task' | 'spec' | 'adr' | 'delete' | 'ask';
|
|
52
|
+
/**
|
|
53
|
+
* The VERDICT the decider returns — the chosen {@link DecisionOutcome} plus the
|
|
54
|
+
* DRAFTED content for that outcome (the analogue of {@link IntakeVerdict}). Every
|
|
55
|
+
* content field is OPTIONAL on the shape: a given verdict only fills the channels
|
|
56
|
+
* its outcome consumes (a `task` fills the task channels, an `ask` fills
|
|
57
|
+
* `question`, a `delete` may carry only a `reason`). The dispatching CALLER
|
|
58
|
+
* decides which channels it requires for each outcome it allows — the engine only
|
|
59
|
+
* guards the `outcome` discriminator against the allowed set, never the content
|
|
60
|
+
* (it stays outcome-agnostic).
|
|
61
|
+
*/
|
|
62
|
+
export interface DecisionVerdict {
|
|
63
|
+
/** Which outcome the decider chose for the input. */
|
|
64
|
+
outcome: DecisionOutcome;
|
|
65
|
+
/** The drafted task's content-derived slug (`task` outcome). */
|
|
66
|
+
taskSlug?: string;
|
|
67
|
+
/** The drafted task's `title:` (`task` outcome). */
|
|
68
|
+
taskTitle?: string;
|
|
69
|
+
/**
|
|
70
|
+
* The drafted task BODY (`task` outcome) — the markdown AFTER the frontmatter.
|
|
71
|
+
* The dispatching caller writes the frontmatter; the agent never writes
|
|
72
|
+
* git-visible files (the in-band boundary intake already follows).
|
|
73
|
+
*/
|
|
74
|
+
taskBody?: string;
|
|
75
|
+
/** The drafted spec's content-derived slug (`spec` outcome). */
|
|
76
|
+
specSlug?: string;
|
|
77
|
+
/** The drafted spec's `title:` (`spec` outcome). */
|
|
78
|
+
specTitle?: string;
|
|
79
|
+
/** The drafted spec BODY (`spec` outcome) — the markdown AFTER the frontmatter. */
|
|
80
|
+
specBody?: string;
|
|
81
|
+
/** The drafted adr's content-derived slug (`adr` outcome). */
|
|
82
|
+
adrSlug?: string;
|
|
83
|
+
/** The drafted adr's `title:` (`adr` outcome). */
|
|
84
|
+
adrTitle?: string;
|
|
85
|
+
/** The drafted adr BODY (`adr` outcome) — the markdown AFTER the frontmatter. */
|
|
86
|
+
adrBody?: string;
|
|
87
|
+
/**
|
|
88
|
+
* The reason the source should be deleted (`delete` outcome) — the caller
|
|
89
|
+
* carries it into the revertible deletion's commit message (decision 12: the
|
|
90
|
+
* delete is git-recoverable, the reason in the commit message).
|
|
91
|
+
*/
|
|
92
|
+
deleteReason?: string;
|
|
93
|
+
/**
|
|
94
|
+
* The drafted follow-up question(s) (`ask` outcome) — the caller appends them
|
|
95
|
+
* to the conversation and re-pauses (decision 5: reuse the existing
|
|
96
|
+
* append/re-pause loop).
|
|
97
|
+
*/
|
|
98
|
+
question?: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The DECISION step: given the caller's `input` (whatever its input-adapter
|
|
102
|
+
* shaped), return a {@link DecisionVerdict}. This is the INJECTED, STUBBABLE seam
|
|
103
|
+
* — exactly like intake's `IntakeDecider`: production wires a harness/agent; tests
|
|
104
|
+
* inject a CANNED verdict (no model, no network). The engine is generic over
|
|
105
|
+
* `TInput` so the adapter boundary sits in the CALLER, never in the engine.
|
|
106
|
+
*/
|
|
107
|
+
export type DecisionDecider<TInput> = (input: TInput) => Promise<DecisionVerdict>;
|
|
108
|
+
/**
|
|
109
|
+
* Thrown when a returned verdict's `outcome` is OUTSIDE the caller's
|
|
110
|
+
* `allowedOutcomes`. The engine NEVER silently coerces an out-of-set verdict — a
|
|
111
|
+
* caller that does not allow `adr` can never receive an `adr` verdict; it gets
|
|
112
|
+
* this loud rejection instead (the allowed-outcome guard).
|
|
113
|
+
*/
|
|
114
|
+
export declare class DisallowedOutcomeError extends Error {
|
|
115
|
+
/** The outcome the decider returned that was not permitted. */
|
|
116
|
+
readonly outcome: DecisionOutcome;
|
|
117
|
+
/** The set the caller allowed (the SUBSET it passed to {@link decide}). */
|
|
118
|
+
readonly allowed: readonly DecisionOutcome[];
|
|
119
|
+
constructor(outcome: DecisionOutcome, allowed: readonly DecisionOutcome[]);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Thrown when `allowedOutcomes` itself is EMPTY — a caller that allows no outcome
|
|
123
|
+
* can never receive a valid verdict, so this is a programming error caught up
|
|
124
|
+
* front rather than surfaced as a confusing per-verdict rejection.
|
|
125
|
+
*/
|
|
126
|
+
export declare class EmptyAllowedOutcomesError extends Error {
|
|
127
|
+
constructor();
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* **The engine core.** Run the injected `decide`r over the caller's `input`, then
|
|
131
|
+
* VALIDATE the returned verdict's `outcome` against `allowedOutcomes` — the
|
|
132
|
+
* caller's permitted SUBSET of {@link DecisionOutcome}. Returns the verdict
|
|
133
|
+
* verbatim when it is in the set; throws {@link DisallowedOutcomeError} (loudly)
|
|
134
|
+
* when it is not. Throws {@link EmptyAllowedOutcomesError} when the set is empty.
|
|
135
|
+
*
|
|
136
|
+
* The engine is outcome-AGNOSTIC: it hard-codes NO caller's outcomes and inspects
|
|
137
|
+
* ONLY the `outcome` discriminator (never the per-outcome content channels — those
|
|
138
|
+
* are the dispatching caller's concern). The INPUT-ADAPTER boundary sits in the
|
|
139
|
+
* caller: `input` is threaded opaquely to the decider, so the engine never knows
|
|
140
|
+
* its shape.
|
|
141
|
+
*
|
|
142
|
+
* @param input the caller's adapter-shaped input (issue thread, answered sidecar
|
|
143
|
+
* + source item, …) — opaque to the engine.
|
|
144
|
+
* @param decide the INJECTED decision seam (tests pass a canned verdict; prod a
|
|
145
|
+
* harness-backed one).
|
|
146
|
+
* @param allowedOutcomes the caller's permitted subset (an array or any
|
|
147
|
+
* iterable). Order is preserved in the rejection message.
|
|
148
|
+
*/
|
|
149
|
+
export declare function decide<TInput>(input: TInput, decide: DecisionDecider<TInput>, allowedOutcomes: Iterable<DecisionOutcome>): Promise<DecisionVerdict>;
|
|
150
|
+
/**
|
|
151
|
+
* Parse a decider's emitted VERDICT out of its (possibly prose-wrapped / fenced)
|
|
152
|
+
* textual output into a {@link DecisionVerdict} — the PRODUCTION-WIRE helper a
|
|
153
|
+
* harness-backed {@link DecisionDecider} uses to recover the verdict an agent
|
|
154
|
+
* emitted, modeled 1:1 on intake's `parseIntakeVerdict`. It pulls the first JSON
|
|
155
|
+
* object carrying an `"outcome"` field via the SHARED {@link extractJsonObjectSpan}
|
|
156
|
+
* (the same extractor every prompt→verdict→dispatch seam in this package uses —
|
|
157
|
+
* NOT a forked copy), `JSON.parse`s it, and validates the shape:
|
|
158
|
+
* `outcome ∈ {task,spec,adr,delete,ask}`.
|
|
159
|
+
*
|
|
160
|
+
* This validates the verdict is a WELL-FORMED member of the SUPERSET; the
|
|
161
|
+
* caller-specific allowed-outcome guard ({@link decide}) then rejects one outside
|
|
162
|
+
* the caller's SUBSET. The two checks are distinct: shape here, policy there.
|
|
163
|
+
*
|
|
164
|
+
* THROWS a clear error on: no JSON object present, invalid JSON, or an `outcome`
|
|
165
|
+
* not in the superset. A harness-backed decider lets the throw propagate so the
|
|
166
|
+
* caller maps it onto its own agent-failed path (a malformed verdict degrades
|
|
167
|
+
* honestly, never a crash and never a silent dispatch).
|
|
168
|
+
*/
|
|
169
|
+
export declare function parseDecisionVerdict(output: string): DecisionVerdict;
|
|
170
|
+
//# sourceMappingURL=decision-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-engine.d.ts","sourceRoot":"","sources":["../src/decision-engine.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH;;;;;;;;;;;;;;;;GAgBG;AAKH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEzE;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC/B,qDAAqD;IACrD,OAAO,EAAE,eAAe,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,SAA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omes`. The engine NEVER silently coerces an out-of-set verdict — a
|
|
5
|
+
* caller that does not allow `adr` can never receive an `adr` verdict; it gets
|
|
6
|
+
* this loud rejection instead (the allowed-outcome guard).
|
|
7
|
+
*/
|
|
8
|
+
export class DisallowedOutcomeError extends Error {
|
|
9
|
+
/** The outcome the decider returned that was not permitted. */
|
|
10
|
+
outcome;
|
|
11
|
+
/** The set the caller allowed (the SUBSET it passed to {@link decide}). */
|
|
12
|
+
allowed;
|
|
13
|
+
constructor(outcome, allowed) {
|
|
14
|
+
super(`decision verdict 'outcome' ${JSON.stringify(outcome)} is not in the ` +
|
|
15
|
+
`caller's allowed set {${allowed.join(' | ')}}; the engine rejects an ` +
|
|
16
|
+
`out-of-set verdict rather than coercing it.`);
|
|
17
|
+
this.name = 'DisallowedOutcomeError';
|
|
18
|
+
this.outcome = outcome;
|
|
19
|
+
this.allowed = allowed;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Thrown when `allowedOutcomes` itself is EMPTY — a caller that allows no outcome
|
|
24
|
+
* can never receive a valid verdict, so this is a programming error caught up
|
|
25
|
+
* front rather than surfaced as a confusing per-verdict rejection.
|
|
26
|
+
*/
|
|
27
|
+
export class EmptyAllowedOutcomesError extends Error {
|
|
28
|
+
constructor() {
|
|
29
|
+
super('decide() was called with an EMPTY allowedOutcomes set; a caller must ' +
|
|
30
|
+
'allow at least one outcome.');
|
|
31
|
+
this.name = 'EmptyAllowedOutcomesError';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* **The engine core.** Run the injected `decide`r over the caller's `input`, then
|
|
36
|
+
* VALIDATE the returned verdict's `outcome` against `allowedOutcomes` — the
|
|
37
|
+
* caller's permitted SUBSET of {@link DecisionOutcome}. Returns the verdict
|
|
38
|
+
* verbatim when it is in the set; throws {@link DisallowedOutcomeError} (loudly)
|
|
39
|
+
* when it is not. Throws {@link EmptyAllowedOutcomesError} when the set is empty.
|
|
40
|
+
*
|
|
41
|
+
* The engine is outcome-AGNOSTIC: it hard-codes NO caller's outcomes and inspects
|
|
42
|
+
* ONLY the `outcome` discriminator (never the per-outcome content channels — those
|
|
43
|
+
* are the dispatching caller's concern). The INPUT-ADAPTER boundary sits in the
|
|
44
|
+
* caller: `input` is threaded opaquely to the decider, so the engine never knows
|
|
45
|
+
* its shape.
|
|
46
|
+
*
|
|
47
|
+
* @param input the caller's adapter-shaped input (issue thread, answered sidecar
|
|
48
|
+
* + source item, …) — opaque to the engine.
|
|
49
|
+
* @param decide the INJECTED decision seam (tests pass a canned verdict; prod a
|
|
50
|
+
* harness-backed one).
|
|
51
|
+
* @param allowedOutcomes the caller's permitted subset (an array or any
|
|
52
|
+
* iterable). Order is preserved in the rejection message.
|
|
53
|
+
*/
|
|
54
|
+
export async function decide(input, decide, allowedOutcomes) {
|
|
55
|
+
const allowed = [...allowedOutcomes];
|
|
56
|
+
if (allowed.length === 0) {
|
|
57
|
+
throw new EmptyAllowedOutcomesError();
|
|
58
|
+
}
|
|
59
|
+
const allowedSet = new Set(allowed);
|
|
60
|
+
const verdict = await decide(input);
|
|
61
|
+
if (!allowedSet.has(verdict.outcome)) {
|
|
62
|
+
throw new DisallowedOutcomeError(verdict.outcome, allowed);
|
|
63
|
+
}
|
|
64
|
+
return verdict;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Parse a decider's emitted VERDICT out of its (possibly prose-wrapped / fenced)
|
|
68
|
+
* textual output into a {@link DecisionVerdict} — the PRODUCTION-WIRE helper a
|
|
69
|
+
* harness-backed {@link DecisionDecider} uses to recover the verdict an agent
|
|
70
|
+
* emitted, modeled 1:1 on intake's `parseIntakeVerdict`. It pulls the first JSON
|
|
71
|
+
* object carrying an `"outcome"` field via the SHARED {@link extractJsonObjectSpan}
|
|
72
|
+
* (the same extractor every prompt→verdict→dispatch seam in this package uses —
|
|
73
|
+
* NOT a forked copy), `JSON.parse`s it, and validates the shape:
|
|
74
|
+
* `outcome ∈ {task,spec,adr,delete,ask}`.
|
|
75
|
+
*
|
|
76
|
+
* This validates the verdict is a WELL-FORMED member of the SUPERSET; the
|
|
77
|
+
* caller-specific allowed-outcome guard ({@link decide}) then rejects one outside
|
|
78
|
+
* the caller's SUBSET. The two checks are distinct: shape here, policy there.
|
|
79
|
+
*
|
|
80
|
+
* THROWS a clear error on: no JSON object present, invalid JSON, or an `outcome`
|
|
81
|
+
* not in the superset. A harness-backed decider lets the throw propagate so the
|
|
82
|
+
* caller maps it onto its own agent-failed path (a malformed verdict degrades
|
|
83
|
+
* honestly, never a crash and never a silent dispatch).
|
|
84
|
+
*/
|
|
85
|
+
export function parseDecisionVerdict(output) {
|
|
86
|
+
const span = extractJsonObjectSpan(output, 'outcome');
|
|
87
|
+
if (span === undefined) {
|
|
88
|
+
throw new Error('decision agent produced no parseable {outcome, …} verdict.');
|
|
89
|
+
}
|
|
90
|
+
let parsed;
|
|
91
|
+
try {
|
|
92
|
+
parsed = JSON.parse(output.slice(span.start, span.end));
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
throw new Error(`decision verdict was not valid JSON: ${err.message}`);
|
|
96
|
+
}
|
|
97
|
+
if (typeof parsed !== 'object' || parsed === null) {
|
|
98
|
+
throw new Error('decision verdict was not an object.');
|
|
99
|
+
}
|
|
100
|
+
const obj = parsed;
|
|
101
|
+
const outcome = obj.outcome;
|
|
102
|
+
if (outcome !== 'task' &&
|
|
103
|
+
outcome !== 'spec' &&
|
|
104
|
+
outcome !== 'adr' &&
|
|
105
|
+
outcome !== 'delete' &&
|
|
106
|
+
outcome !== 'ask') {
|
|
107
|
+
throw new Error(`decision verdict 'outcome' was not one of task|spec|adr|delete|ask (got ` +
|
|
108
|
+
`${JSON.stringify(outcome)}).`);
|
|
109
|
+
}
|
|
110
|
+
// Map the per-outcome fields onto the verdict shape, keeping ONLY the strings
|
|
111
|
+
// the dispatcher consumes (a missing optional stays absent). Every field is
|
|
112
|
+
// optional on the type, so each outcome's content is carried verbatim when
|
|
113
|
+
// present — the engine never demands a channel (it stays outcome-agnostic).
|
|
114
|
+
const str = (v) => typeof v === 'string' ? v : undefined;
|
|
115
|
+
return {
|
|
116
|
+
outcome,
|
|
117
|
+
...(str(obj.taskSlug) !== undefined ? { taskSlug: str(obj.taskSlug) } : {}),
|
|
118
|
+
...(str(obj.taskTitle) !== undefined
|
|
119
|
+
? { taskTitle: str(obj.taskTitle) }
|
|
120
|
+
: {}),
|
|
121
|
+
...(str(obj.taskBody) !== undefined ? { taskBody: str(obj.taskBody) } : {}),
|
|
122
|
+
...(str(obj.specSlug) !== undefined ? { specSlug: str(obj.specSlug) } : {}),
|
|
123
|
+
...(str(obj.specTitle) !== undefined
|
|
124
|
+
? { specTitle: str(obj.specTitle) }
|
|
125
|
+
: {}),
|
|
126
|
+
...(str(obj.specBody) !== undefined ? { specBody: str(obj.specBody) } : {}),
|
|
127
|
+
...(str(obj.adrSlug) !== undefined ? { adrSlug: str(obj.adrSlug) } : {}),
|
|
128
|
+
...(str(obj.adrTitle) !== undefined ? { adrTitle: str(obj.adrTitle) } : {}),
|
|
129
|
+
...(str(obj.adrBody) !== undefined ? { adrBody: str(obj.adrBody) } : {}),
|
|
130
|
+
...(str(obj.deleteReason) !== undefined
|
|
131
|
+
? { deleteReason: str(obj.deleteReason) }
|
|
132
|
+
: {}),
|
|
133
|
+
...(str(obj.question) !== undefined ? { question: str(obj.question) } : {}),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=decision-engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decision-engine.js","sourceRoot":"","sources":["../src/decision-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAuHxD;;;;;GAKG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAChD,+DAA+D;IACtD,OAAO,CAAkB;IAClC,2EAA2E;IAClE,OAAO,CAA6B;IAC7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AAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACzE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAC,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,SAAS;YACtC,CAAC,CAAC,EAAC,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,EAAC;YACvC,CAAC,CAAC,EAAE,CAAC;QACN,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACzE,CAAC;AACH,CAAC"}
|
package/dist/detect.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A repo participates iff any of its lifecycle-bearing `work/` pools
|
|
3
|
+
* ({@link PARTICIPATING_POOLS}) contains at least one `.md` file. This is the
|
|
4
|
+
* predicate `remote find` (ADR §1) filters on AND the fetch-free gate
|
|
5
|
+
* `scan`/`status` use before resolving the (expensive) cwd section.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isParticipatingRepo(repoPath: string): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Find every `work/`-participating repo under `folder` (recursively), pruning
|
|
10
|
+
* `node_modules`/dotdirs and not descending into a participating repo. The
|
|
11
|
+
* returned list is deduplicated and sorted (deterministic). This is the
|
|
12
|
+
* discovery primitive behind `remote find <folder>` (ADR §1): the caller filters
|
|
13
|
+
* on {@link isParticipatingRepo} and toggle-adds the chosen ones via `remote
|
|
14
|
+
* add`. A non-existent / non-directory `folder` yields `[]` (never throws).
|
|
15
|
+
*/
|
|
16
|
+
export declare function findParticipatingRepos(folder: string): string[];
|
|
17
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAyCA;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE7D;AAoDD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAc/D"}
|