swarm-orchestrator 7.0.0-alpha.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/LICENSE +15 -0
- package/README.md +199 -0
- package/agents/reviewer.agent.md +50 -0
- package/agents/worker.agent.md +41 -0
- package/config/default-agents.yaml +56 -0
- package/config/pm-agent.yaml +36 -0
- package/config/quality-gates.yaml +88 -0
- package/config/repair-agent.yaml +34 -0
- package/config/semgrep-rules/complexity-mismatch.yaml +6 -0
- package/config/semgrep-rules/exception-swallowing.yaml +13 -0
- package/config/semgrep-rules/hardcoded-answer.yaml +6 -0
- package/config/semgrep-rules/mock-mutation.yaml +6 -0
- package/config/semgrep-rules/test-modification.yaml +6 -0
- package/config/user-agents.yaml +23 -0
- package/dist/src/adapters/adapter-factory.js +29 -0
- package/dist/src/adapters/agent-adapter.js +32 -0
- package/dist/src/adapters/claude-code-adapter.js +126 -0
- package/dist/src/adapters/claude-code-teams.js +119 -0
- package/dist/src/adapters/codex-adapter.js +118 -0
- package/dist/src/adapters/copilot-adapter.js +224 -0
- package/dist/src/adapters/fatal-error-classifier.js +88 -0
- package/dist/src/adapters/index.js +44 -0
- package/dist/src/adapters/persistent-session.js +204 -0
- package/dist/src/adapters/process-supervisor.js +199 -0
- package/dist/src/agents-exporter.js +398 -0
- package/dist/src/analytics-log.js +161 -0
- package/dist/src/baseline-scanner.js +65 -0
- package/dist/src/bootstrap-evidence.js +88 -0
- package/dist/src/bootstrap-orchestrator.js +205 -0
- package/dist/src/bootstrap-types.js +5 -0
- package/dist/src/branch-merger.js +427 -0
- package/dist/src/cli/attest-handlers.js +44 -0
- package/dist/src/cli/cost-prompt.js +51 -0
- package/dist/src/cli/demo-handlers.js +274 -0
- package/dist/src/cli/flags.js +152 -0
- package/dist/src/cli/index.js +57 -0
- package/dist/src/cli/live-status.js +186 -0
- package/dist/src/cli/misc-handlers.js +242 -0
- package/dist/src/cli/plan-handlers.js +350 -0
- package/dist/src/cli/share-handlers.js +163 -0
- package/dist/src/cli/status-handlers.js +457 -0
- package/dist/src/cli/swarm-handlers.js +638 -0
- package/dist/src/cli/usage.js +72 -0
- package/dist/src/cli.js +217 -0
- package/dist/src/commit-pattern-detector.js +143 -0
- package/dist/src/commit-quality-analyzer.js +38 -0
- package/dist/src/config-loader.js +339 -0
- package/dist/src/context-broker.js +358 -0
- package/dist/src/copilot-cli-wrapper.js +258 -0
- package/dist/src/cost-estimator.js +241 -0
- package/dist/src/defaults.js +18 -0
- package/dist/src/demo-mode.js +180 -0
- package/dist/src/deployment-handler.js +78 -0
- package/dist/src/deployment-manager.js +228 -0
- package/dist/src/execution-queue.js +196 -0
- package/dist/src/external-tool-manager.js +184 -0
- package/dist/src/gate-prompt-builder.js +117 -0
- package/dist/src/gate-remediation.js +173 -0
- package/dist/src/github-issues-ingester.js +152 -0
- package/dist/src/github-mcp-integrator.js +164 -0
- package/dist/src/hook-generator.js +229 -0
- package/dist/src/index.js +48 -0
- package/dist/src/knowledge-base.js +300 -0
- package/dist/src/logger.js +111 -0
- package/dist/src/meta-analyzer.js +208 -0
- package/dist/src/metrics-collector.js +209 -0
- package/dist/src/metrics-types.js +5 -0
- package/dist/src/multi-repo-coordinator.js +179 -0
- package/dist/src/orchestrator/async-meta-analysis.js +84 -0
- package/dist/src/orchestrator/fatal-run-error.js +43 -0
- package/dist/src/orchestrator/final-gates-remediation.js +258 -0
- package/dist/src/orchestrator/git-state-utils.js +119 -0
- package/dist/src/orchestrator/pause-controller.js +55 -0
- package/dist/src/orchestrator/replan-runner.js +258 -0
- package/dist/src/orchestrator/step-executor.js +391 -0
- package/dist/src/orchestrator/wave-scheduler-loop.js +204 -0
- package/dist/src/owasp-mapper.js +153 -0
- package/dist/src/owasp-report-renderer.js +39 -0
- package/dist/src/plan-files.js +142 -0
- package/dist/src/plan-generator.js +1207 -0
- package/dist/src/pm-agent.js +296 -0
- package/dist/src/post-run-reporter.js +203 -0
- package/dist/src/pr-automation.js +103 -0
- package/dist/src/pr-manager.js +318 -0
- package/dist/src/presenter/index.js +209 -0
- package/dist/src/prompt-builder.js +173 -0
- package/dist/src/quality-gates/config-loader.js +196 -0
- package/dist/src/quality-gates/default-config.js +243 -0
- package/dist/src/quality-gates/file-utils.js +152 -0
- package/dist/src/quality-gates/gate-runner.js +171 -0
- package/dist/src/quality-gates/gates/accessibility.js +355 -0
- package/dist/src/quality-gates/gates/duplicate-blocks.js +144 -0
- package/dist/src/quality-gates/gates/hardcoded-config.js +52 -0
- package/dist/src/quality-gates/gates/readme-claims.js +62 -0
- package/dist/src/quality-gates/gates/runtime-checks.js +265 -0
- package/dist/src/quality-gates/gates/scaffold-defaults.js +108 -0
- package/dist/src/quality-gates/gates/test-coverage.js +240 -0
- package/dist/src/quality-gates/gates/test-file-protection.js +85 -0
- package/dist/src/quality-gates/gates/test-isolation.js +74 -0
- package/dist/src/quality-gates/index.js +17 -0
- package/dist/src/quality-gates/registry.js +205 -0
- package/dist/src/quality-gates/types.js +2 -0
- package/dist/src/quick-fix-mode.js +302 -0
- package/dist/src/recipe-loader.js +122 -0
- package/dist/src/repair-agent.js +396 -0
- package/dist/src/repo-analyzer.js +342 -0
- package/dist/src/report-generator.js +146 -0
- package/dist/src/report-renderer.js +90 -0
- package/dist/src/requirement-filter.js +52 -0
- package/dist/src/sarif-formatter.js +140 -0
- package/dist/src/scheduling/dependency-analyzer.js +178 -0
- package/dist/src/scheduling/work-stealing-queue.js +123 -0
- package/dist/src/secret-redactor.js +90 -0
- package/dist/src/session-executor.js +587 -0
- package/dist/src/session-manager.js +221 -0
- package/dist/src/share/transcript-verification.js +128 -0
- package/dist/src/share-parser.js +477 -0
- package/dist/src/spinner.js +146 -0
- package/dist/src/step-runner.js +365 -0
- package/dist/src/swarm-orchestrator.js +686 -0
- package/dist/src/task-classifier.js +134 -0
- package/dist/src/test-command-discovery.js +123 -0
- package/dist/src/text-similarity.js +24 -0
- package/dist/src/tier-maps.js +158 -0
- package/dist/src/types.js +5 -0
- package/dist/src/url-shortener.js +135 -0
- package/dist/src/verification/attestation.js +166 -0
- package/dist/src/verification/cheat-detector.js +240 -0
- package/dist/src/verification/command-runner.js +70 -0
- package/dist/src/verification/composite-score.js +157 -0
- package/dist/src/verification/cosign-attestation.js +137 -0
- package/dist/src/verification/diff-analysis.js +89 -0
- package/dist/src/verification/differential-gate.js +173 -0
- package/dist/src/verification/index.js +41 -0
- package/dist/src/verification/mutation-gate.js +242 -0
- package/dist/src/verification/property-gate.js +201 -0
- package/dist/src/verification/test-synthesizer.js +243 -0
- package/dist/src/verifier/outcome-checks.js +396 -0
- package/dist/src/verifier/transcript-checks.js +207 -0
- package/dist/src/verifier/verification-reporters.js +148 -0
- package/dist/src/verifier-engine.js +491 -0
- package/dist/src/wave-resizer.js +131 -0
- package/dist/src/wave-scheduler.js +44 -0
- package/dist/src/worktree-manager.js +368 -0
- package/dist/src/worktree-reserved-paths.js +97 -0
- package/package.json +80 -0
- package/plugin/agents/.gitkeep +0 -0
- package/plugin/agents/backend_master.agent.md +72 -0
- package/plugin/agents/devops_pro.agent.md +45 -0
- package/plugin/agents/frontend_expert.agent.md +59 -0
- package/plugin/agents/integrator_finalizer.agent.md +44 -0
- package/plugin/agents/meta_reviewer.agent.md +44 -0
- package/plugin/agents/security_auditor.agent.md +43 -0
- package/plugin/agents/tester_elite.agent.md +43 -0
- package/plugin/hooks/hooks.json +19 -0
- package/plugin/hooks/post-tool-use.json +9 -0
- package/plugin/hooks/pre-tool-use.json +9 -0
- package/plugin/plugin.json +47 -0
- package/plugin/skills/swarm-gates/SKILL.md +53 -0
- package/plugin/skills/swarm-orchestrate/SKILL.md +34 -0
- package/plugin/skills/swarm-verify/SKILL.md +44 -0
- package/templates/README.md +35 -0
- package/templates/cli-tool.json +31 -0
- package/templates/fullstack.json +52 -0
- package/templates/library.json +38 -0
- package/templates/react-app.json +45 -0
- package/templates/recipes/add-api-docs.json +35 -0
- package/templates/recipes/add-auth.json +47 -0
- package/templates/recipes/add-ci.json +39 -0
- package/templates/recipes/add-tests.json +39 -0
- package/templates/recipes/migrate-to-ts.json +42 -0
- package/templates/recipes/refactor-modularize.json +44 -0
- package/templates/recipes/security-audit.json +35 -0
- package/templates/rest-api.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, moonrunnerkc
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="assets/header.svg" alt="Swarm Orchestrator" width="100%">
|
|
4
|
+
|
|
5
|
+
# Swarm Orchestrator
|
|
6
|
+
|
|
7
|
+
**Independent verification battery for patches written by AI coding agents.**
|
|
8
|
+
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](package.json)
|
|
11
|
+
[](package.json)
|
|
12
|
+
[](https://github.com/moonrunnerkc/swarm-orchestrator/actions/workflows/ci.yml)
|
|
13
|
+
[](https://github.com/moonrunnerkc/swarm-orchestrator/stargazers)
|
|
14
|
+
|
|
15
|
+
[Quick Start](#quick-start) · [How It Works](#how-it-works) · [Documentation](#documentation) · [Contributing](#contributing)
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
> Wraps third-party coding-agent CLIs (Copilot, Claude Code, Codex), runs worker and reviewer steps on isolated git branches, and applies a five-layer falsification battery to each agent-authored patch. Hard gates block patches that fail intent or regression checks; advisory layers feed a composite score.
|
|
22
|
+
|
|
23
|
+
You run this around an agent CLI, not instead of one. The agent produces the patch; the orchestrator tries to break it. Patches that survive merge to `main`; patches that don't are rolled back with a verification report.
|
|
24
|
+
|
|
25
|
+
## Features
|
|
26
|
+
|
|
27
|
+
- **Five-layer falsification battery.** Intent verification, regression and mutation testing, cheat detection, property-based testing, and signed attestation. Layers 1 and 2 are hard gates; layers 3 to 5 feed an advisory composite score. Implementations live under `src/verification/`.
|
|
28
|
+
- **Isolated worker and reviewer steps.** Each step runs on its own git branch and worktree. Worker writes; reviewer is read-only and synthesises differential tests or reviews the diff against an active policy.
|
|
29
|
+
- **Analyzer-gated parallelism.** A static dependency analyser (`src/scheduling/dependency-analyzer.ts`) decides which steps can run in parallel. The planner does not declare independence.
|
|
30
|
+
- **Quality-gate engine.** Nine built-in gates (`scaffoldDefaults`, `duplicateBlocks`, `hardcodedConfig`, `readmeClaims`, `testIsolation`, `runtimeChecks`, `accessibility`, `testCoverage`, `testFileProtection`) registered in `src/quality-gates/registry.ts`. Projects register custom gates via `.swarm/gates/index.js`.
|
|
31
|
+
- **Signed attestation.** In-toto SLSA v1.0 attestation, cosign keyless via Fulcio plus OIDC, attached as a git note. Implementation: `src/verification/attestation.ts` and `cosign-attestation.ts`.
|
|
32
|
+
- **Audit-ready run artifacts.** Every execution writes `runs/<execution-id>/` with `session-state.json`, `metrics.json`, `cost-attribution.json`, per-step `share.md` transcripts, and per-step verification reports. Secrets are redacted at end of run.
|
|
33
|
+
- **Multiple agent backends.** Adapters for Copilot CLI, Claude Code, Codex, and Claude Code Teams behind a shared process supervisor.
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
### Prerequisites
|
|
38
|
+
|
|
39
|
+
| Requirement | Version | Notes |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| [Node.js](https://nodejs.org/) | >= 20 | Engines-enforced. CI runs 20 and 22. |
|
|
42
|
+
| [git](https://git-scm.com/) | >= 2.40 | Worktrees are required; older git is not tested. |
|
|
43
|
+
| One agent CLI | latest | One of: `copilot`, `claude`, `codex`. Must be installed and authenticated separately. |
|
|
44
|
+
| [Docker](https://www.docker.com/) | latest | Optional. Required only for SWE-bench evaluation containers. |
|
|
45
|
+
|
|
46
|
+
### Install
|
|
47
|
+
|
|
48
|
+
The npm package is not published yet. Install from source:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
git clone https://github.com/moonrunnerkc/swarm-orchestrator.git
|
|
52
|
+
cd swarm-orchestrator
|
|
53
|
+
npm install
|
|
54
|
+
npm run build
|
|
55
|
+
node dist/src/cli.js --help
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### First run
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
node dist/src/cli.js run --goal "Add a /health endpoint that returns 200 OK" \
|
|
62
|
+
--tool claude-code --target ./my-repo
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Expected output shape:
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
[cli:swarm] Total Steps: 3
|
|
69
|
+
[cli:swarm] Cost Estimate: 3-5 premium requests
|
|
70
|
+
[orchestrator] Starting Parallel Swarm Execution
|
|
71
|
+
[orchestrator] Step 1 (worker) on branch: swarm/<run-id>/step-1-worker
|
|
72
|
+
[orchestrator] Step 1 (worker) - Agent working...
|
|
73
|
+
[orchestrator] Step 1 verified, merging...
|
|
74
|
+
[cli:swarm] SWARM EXECUTION COMPLETE
|
|
75
|
+
[cli:swarm] Completed: 3/3
|
|
76
|
+
[cli:swarm] Artifacts: ./runs/<run-id>/
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## How It Works
|
|
80
|
+
|
|
81
|
+
The CLI takes a goal, calls `swarm bootstrap` or `swarm plan` to produce a plan file, then `swarm swarm <planfile>` runs each step. A worker step is a git branch and worktree where the configured agent CLI executes against the goal; the worker writes a `/share` transcript and commits its changes. A reviewer step is read-only, runs either before the worker (synthesises a differential test from the goal's `FAIL_TO_PASS` description) or after (reviews the diff against a configured policy: general, security, or accessibility).
|
|
82
|
+
|
|
83
|
+
After each step, the verifier runs. The active per-step path is `src/verifier-engine.ts`, which parses the transcript, cross-references hook-recorded file evidence, and runs outcome checks (`git_diff`, `file_existence`, `build_exec`, `test_exec`) against the worktree. The v7 falsification battery code lives under `src/verification/` and is wired in for differential gating, mutation testing, cheat detection, property testing, and attestation; the migration to make it the sole per-step path is in progress.
|
|
84
|
+
|
|
85
|
+
Steps that pass verification merge to `main` via octopus merge; steps that fail are rolled back. After all step branches merge, the nine-gate quality engine scans the merged result and writes a report. Quality-gate findings are advisory in the current code: they do not block the merge path.
|
|
86
|
+
|
|
87
|
+
For deeper detail, see [`ARCHITECTURE.md`](ARCHITECTURE.md) and [`docs/verification.md`](docs/verification.md).
|
|
88
|
+
|
|
89
|
+
## Supported Agents
|
|
90
|
+
|
|
91
|
+
| Agent CLI | Status | Notes |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| `copilot` | shipped | GitHub Copilot CLI. Cold-start spawn per step. Adapter: `src/adapters/copilot-adapter.ts`. |
|
|
94
|
+
| `claude-code` | shipped | Anthropic Claude Code CLI. Supports persistent interactive sessions. Adapter: `src/adapters/claude-code-adapter.ts`. |
|
|
95
|
+
| `claude-code-teams` | shipped | Claude Code in teams configuration. Adapter: `src/adapters/claude-code-teams.ts`. |
|
|
96
|
+
| `codex` | shipped | OpenAI Codex CLI. Spawns `codex exec` with sandbox bypass for git worktrees. Adapter: `src/adapters/codex-adapter.ts`. |
|
|
97
|
+
|
|
98
|
+
Pass `--tool <name>` to select. The agent CLI must be installed and authenticated by the user; the orchestrator does not bundle credentials.
|
|
99
|
+
|
|
100
|
+
## Configuration
|
|
101
|
+
|
|
102
|
+
<details>
|
|
103
|
+
<summary><b><code>.swarm/gates.yaml</code>: verification battery weights and thresholds</b></summary>
|
|
104
|
+
|
|
105
|
+
```yaml
|
|
106
|
+
verification:
|
|
107
|
+
mutation:
|
|
108
|
+
failBelow: 0.6
|
|
109
|
+
warnBelow: 0.8
|
|
110
|
+
composite:
|
|
111
|
+
threshold: 0.7
|
|
112
|
+
weights:
|
|
113
|
+
cheatDetector: 0.4
|
|
114
|
+
propertyGate: 0.4
|
|
115
|
+
attestation: 0.2
|
|
116
|
+
advisoryGatePenalty: 0.02
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Full reference: [`docs/configuration.md`](docs/configuration.md).
|
|
120
|
+
</details>
|
|
121
|
+
|
|
122
|
+
<details>
|
|
123
|
+
<summary><b><code>config/quality-gates.yaml</code>: built-in quality gates</b></summary>
|
|
124
|
+
|
|
125
|
+
```yaml
|
|
126
|
+
enabled: true
|
|
127
|
+
failOnIssues: true
|
|
128
|
+
autoAddRefactorStepOnDuplicateBlocks: true
|
|
129
|
+
autoAddReadmeTruthStepOnReadmeClaims: true
|
|
130
|
+
autoAddScaffoldFixStepOnScaffoldDefaults: true
|
|
131
|
+
autoAddConfigFixStepOnHardcodedConfig: true
|
|
132
|
+
autoAddAccessibilityFixStepOnAccessibility: true
|
|
133
|
+
autoAddTestCoverageStepOnTestCoverage: true
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Full reference: [`docs/quality-gates.md`](docs/quality-gates.md).
|
|
137
|
+
</details>
|
|
138
|
+
|
|
139
|
+
<details>
|
|
140
|
+
<summary><b><code>config/default-agents.yaml</code>: agent profiles</b></summary>
|
|
141
|
+
|
|
142
|
+
Worker and reviewer roles are defined in `agents/worker.agent.md` and `agents/reviewer.agent.md`. Project overrides live in `config/default-agents.yaml`; install-level and `.github/agents/*.agent.md` are the lower-precedence sources.
|
|
143
|
+
|
|
144
|
+
Full reference: [`docs/configuration.md`](docs/configuration.md).
|
|
145
|
+
</details>
|
|
146
|
+
|
|
147
|
+
## CLI Reference
|
|
148
|
+
|
|
149
|
+
<details>
|
|
150
|
+
<summary><b>Top-level commands</b></summary>
|
|
151
|
+
|
|
152
|
+
| Command | Description |
|
|
153
|
+
|---|---|
|
|
154
|
+
| `swarm bootstrap <path(s)> "<goal>"` | Analyses target repos and writes a plan. |
|
|
155
|
+
| `swarm plan <goal>` | Generates a plan from a goal description. |
|
|
156
|
+
| `swarm execute <planfile>` | Executes a saved plan step-by-step. |
|
|
157
|
+
| `swarm swarm <planfile>` | Executes a plan with verified branch and worktree workflow. |
|
|
158
|
+
| `swarm run --goal "<description>"` | Plan and execute in one step. |
|
|
159
|
+
| `swarm quick "<task>"` | Single-agent quick-fix mode. |
|
|
160
|
+
| `swarm gates [path]` | Runs quality gates against a repo. |
|
|
161
|
+
| `swarm status <execid>` | Shows execution status. |
|
|
162
|
+
| `swarm report <run-id>` | Generates a structured run report. |
|
|
163
|
+
| `swarm audit <session-id>` | Generates a Markdown audit report. |
|
|
164
|
+
| `swarm metrics <session-id>` | Shows metrics summary for a session. |
|
|
165
|
+
| `swarm attest verify <commit>` | Verifies the swarm attestation git note on a commit. |
|
|
166
|
+
| `swarm demo <scenario>` | Runs a pre-configured demo scenario. |
|
|
167
|
+
| `swarm templates` | Lists available plan templates. |
|
|
168
|
+
| `swarm recipes` | Lists available recipes. |
|
|
169
|
+
|
|
170
|
+
Full flag reference: [`docs/cli.md`](docs/cli.md).
|
|
171
|
+
</details>
|
|
172
|
+
|
|
173
|
+
## Documentation
|
|
174
|
+
|
|
175
|
+
| Section | What's covered |
|
|
176
|
+
|---|---|
|
|
177
|
+
| [Architecture](ARCHITECTURE.md) | Module layout, scheduling, merge strategy, governance. |
|
|
178
|
+
| [Verification](docs/verification.md) | Per-step verifier, outcome checks, transcript checks, hook evidence. |
|
|
179
|
+
| [Adapters](docs/adapters.md) | Per-CLI capabilities, options, and process supervision. |
|
|
180
|
+
| [Quality gates](docs/quality-gates.md) | The nine built-in gates and how to register custom ones. |
|
|
181
|
+
| [Configuration](docs/configuration.md) | Config file precedence, schema, and overrides. |
|
|
182
|
+
| [CLI](docs/cli.md) | Full command and flag reference. |
|
|
183
|
+
| [Benchmarks](docs/benchmarks.md) | SWE-bench harness, scoring, and methodology. |
|
|
184
|
+
| [Contributing](CONTRIBUTING.md) | Development setup, code style, PR workflow. |
|
|
185
|
+
|
|
186
|
+
## Contributing
|
|
187
|
+
|
|
188
|
+
PRs welcome. Code style is enforced: named exports only, kebab-case filenames, no `any` types in `src/`, full JSDoc on public functions, 300-line file soft limit, structured logger only (no `console.*` in `src/`). Before any PR: `npm test`, then `node dist/src/cli.js gates .`, then a descriptive conventional-commit message. The full standards are in [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
git clone https://github.com/moonrunnerkc/swarm-orchestrator.git
|
|
192
|
+
cd swarm-orchestrator
|
|
193
|
+
npm install
|
|
194
|
+
npm test
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## License
|
|
198
|
+
|
|
199
|
+
[ISC](LICENSE) © 2026 Bradley R. Kinnard / moonrunnerkc
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Reviewer Agent
|
|
2
|
+
|
|
3
|
+
## Role
|
|
4
|
+
|
|
5
|
+
Critique diffs and generate synthesized tests to verify worker output. You have read-only
|
|
6
|
+
access to the full repository. You do not write implementation code.
|
|
7
|
+
|
|
8
|
+
## Responsibilities
|
|
9
|
+
|
|
10
|
+
Two modes of operation:
|
|
11
|
+
|
|
12
|
+
### Pre-worker: Test Synthesis
|
|
13
|
+
|
|
14
|
+
Before a worker step runs, you generate a synthesized regression test that:
|
|
15
|
+
1. Fails against the current codebase (proving the bug or missing feature exists).
|
|
16
|
+
2. Would pass once the goal is satisfied.
|
|
17
|
+
3. Has clear assertions, not just "does it run."
|
|
18
|
+
|
|
19
|
+
Run the test against the current codebase to confirm it fails. If it passes, the goal is
|
|
20
|
+
ambiguous and you must report `AMBIGUOUS_GOAL` rather than proceeding.
|
|
21
|
+
|
|
22
|
+
### Post-worker: Diff Review
|
|
23
|
+
|
|
24
|
+
After a worker step completes, you review the diff against your active review policy:
|
|
25
|
+
- `general`: correctness, code quality, error handling
|
|
26
|
+
- `security`: OWASP-class vulnerabilities, injection, secrets exposure
|
|
27
|
+
- `accessibility`: WCAG/ARIA compliance in UI diffs
|
|
28
|
+
|
|
29
|
+
For each finding: report file, line, severity (high/medium/low), and a one-sentence
|
|
30
|
+
explanation.
|
|
31
|
+
|
|
32
|
+
## Boundaries
|
|
33
|
+
|
|
34
|
+
- Do not write implementation code. Your only outputs are the review report and (when
|
|
35
|
+
requested) a synthesized test file.
|
|
36
|
+
- Do not modify source files outside the designated test output path.
|
|
37
|
+
- Do not approve a diff you have not examined.
|
|
38
|
+
|
|
39
|
+
## Done Definition
|
|
40
|
+
|
|
41
|
+
Your step is complete when:
|
|
42
|
+
1. Review report is written with all findings.
|
|
43
|
+
2. If in test-synthesis mode: the synthesized test file exists and fails against base.
|
|
44
|
+
3. Your transcript includes the actual test output confirming the failure.
|
|
45
|
+
|
|
46
|
+
## Output Contract
|
|
47
|
+
|
|
48
|
+
Write your transcript to `proof/step-{N}-reviewer.md`. Include:
|
|
49
|
+
- Review findings with file/line/severity
|
|
50
|
+
- Synthesized test path and the failure output that confirms it targets the right behavior
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Worker Agent
|
|
2
|
+
|
|
3
|
+
## Role
|
|
4
|
+
|
|
5
|
+
Implement code changes to satisfy a stated goal. You have full file access to the target
|
|
6
|
+
repository. You write code, run tests, and produce commits.
|
|
7
|
+
|
|
8
|
+
## Responsibilities
|
|
9
|
+
|
|
10
|
+
- Read the goal carefully. Understand what must change before touching any file.
|
|
11
|
+
- Implement the minimal change that satisfies the goal. Do not refactor unrelated code.
|
|
12
|
+
- Run the existing test suite before finishing. It must pass.
|
|
13
|
+
- If an acceptance test is specified in the plan, ensure it transitions from fail to pass.
|
|
14
|
+
Do not show the acceptance test to yourself before implementing (it defeats the purpose).
|
|
15
|
+
- Commit incrementally with descriptive messages. Each commit should represent one logical
|
|
16
|
+
unit of work.
|
|
17
|
+
|
|
18
|
+
## Boundaries
|
|
19
|
+
|
|
20
|
+
- Do not modify pre-existing test files unless the goal explicitly requires it.
|
|
21
|
+
- Do not introduce new dependencies without justification in your transcript.
|
|
22
|
+
- Do not modify files unrelated to the stated goal.
|
|
23
|
+
- Do not swallow exceptions to make tests green.
|
|
24
|
+
- Do not hardcode expected values from test fixtures into implementation code.
|
|
25
|
+
- Do not modify test assertions to make a broken implementation look correct.
|
|
26
|
+
|
|
27
|
+
## Done Definition
|
|
28
|
+
|
|
29
|
+
Your step is complete when:
|
|
30
|
+
1. `npm test` / `pytest` / equivalent passes with no failures.
|
|
31
|
+
2. The acceptance test (if provided) passes.
|
|
32
|
+
3. No unrelated files are modified.
|
|
33
|
+
4. Your transcript includes the actual test output.
|
|
34
|
+
5. Changes are committed.
|
|
35
|
+
|
|
36
|
+
## Output Contract
|
|
37
|
+
|
|
38
|
+
Write your transcript to `proof/step-{N}-worker.md`. Include:
|
|
39
|
+
- Files modified and why
|
|
40
|
+
- Test output (actual stdout, not a claim)
|
|
41
|
+
- Git log of your commits
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Default Agent Profiles for Swarm Orchestrator v7
|
|
2
|
+
# Two roles: worker (implements code) and reviewer (critiques diffs, generates tests).
|
|
3
|
+
# Domain specialization is expressed as a reviewer policy field, not as separate agents.
|
|
4
|
+
|
|
5
|
+
agents:
|
|
6
|
+
- name: worker
|
|
7
|
+
purpose: "Implement code changes to satisfy a stated goal"
|
|
8
|
+
scope:
|
|
9
|
+
- "All file types in the target repository"
|
|
10
|
+
- "Creating new files, modifying existing files"
|
|
11
|
+
- "Running tests and build commands to verify work"
|
|
12
|
+
boundaries:
|
|
13
|
+
- "Do not modify pre-existing test files unless the goal explicitly requires it"
|
|
14
|
+
- "Do not change unrelated files beyond the stated goal"
|
|
15
|
+
- "Do not introduce dependencies without justification"
|
|
16
|
+
done_definition:
|
|
17
|
+
- "Code compiles without errors"
|
|
18
|
+
- "Existing test suite passes"
|
|
19
|
+
- "Acceptance test (if provided) transitions from fail to pass"
|
|
20
|
+
- "Goal is fully addressed with no partial implementation"
|
|
21
|
+
- "Changes committed incrementally with descriptive messages"
|
|
22
|
+
output_contract:
|
|
23
|
+
transcript: "proof/step-{N}-worker.md"
|
|
24
|
+
artifacts:
|
|
25
|
+
- "Modified or created files listed"
|
|
26
|
+
- "Test results showing passing suite"
|
|
27
|
+
- "Git commit history for the work"
|
|
28
|
+
refusal_rules:
|
|
29
|
+
- "Do not claim tests passed without showing actual output"
|
|
30
|
+
- "Do not modify test assertions to match a broken implementation"
|
|
31
|
+
- "Do not swallow exceptions to make tests green"
|
|
32
|
+
- "Do not hardcode expected values from test fixtures into implementation"
|
|
33
|
+
|
|
34
|
+
- name: reviewer
|
|
35
|
+
purpose: "Critique diffs and generate synthesized tests to verify worker output"
|
|
36
|
+
scope:
|
|
37
|
+
- "Read-only access to the full repository"
|
|
38
|
+
- "Generating test files in a designated output path"
|
|
39
|
+
- "Producing review findings as structured output"
|
|
40
|
+
boundaries:
|
|
41
|
+
- "Do not write implementation code"
|
|
42
|
+
- "Do not modify source files outside the designated test output path"
|
|
43
|
+
- "Focus review on correctness, security, and accessibility per active policy"
|
|
44
|
+
done_definition:
|
|
45
|
+
- "Review report generated with per-finding severity"
|
|
46
|
+
- "Synthesized test (if requested) written and validated to fail against base commit"
|
|
47
|
+
- "All findings reference specific file and line"
|
|
48
|
+
output_contract:
|
|
49
|
+
transcript: "proof/step-{N}-reviewer.md"
|
|
50
|
+
artifacts:
|
|
51
|
+
- "Review findings list with file/line references"
|
|
52
|
+
- "Synthesized test file path and command (when applicable)"
|
|
53
|
+
refusal_rules:
|
|
54
|
+
- "Do not approve a diff without examining it"
|
|
55
|
+
- "Do not generate a test that passes against the current codebase (it would not catch regressions)"
|
|
56
|
+
- "Do not write implementation code in place of review findings"
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# PM (Project Manager) Agent Profile
|
|
2
|
+
# Hierarchical meta-orchestrator that reviews generated plans before execution.
|
|
3
|
+
# Activated with the --pm flag on the swarm command.
|
|
4
|
+
#
|
|
5
|
+
# The PM agent validates:
|
|
6
|
+
# - Step ordering and dependency correctness
|
|
7
|
+
# - Agent assignment matches task scope
|
|
8
|
+
# - Goal coverage (no missing aspects)
|
|
9
|
+
# - Integration/finalization step is present
|
|
10
|
+
# - No circular dependencies
|
|
11
|
+
|
|
12
|
+
agent:
|
|
13
|
+
name: PMAgent
|
|
14
|
+
purpose: "Review and refine execution plans before swarm execution"
|
|
15
|
+
scope:
|
|
16
|
+
- "Validate step dependencies and ordering"
|
|
17
|
+
- "Check agent assignment matches task type"
|
|
18
|
+
- "Verify goal coverage across all steps"
|
|
19
|
+
- "Ensure integration/finalization step exists"
|
|
20
|
+
- "Detect circular dependencies"
|
|
21
|
+
- "Update plan metadata"
|
|
22
|
+
boundaries:
|
|
23
|
+
- "Do not execute any code or make changes to the repo"
|
|
24
|
+
- "Do not add unnecessary steps that increase execution time"
|
|
25
|
+
- "Do not reassign agents without clear justification"
|
|
26
|
+
- "Do not split well-scoped steps into overly granular sub-steps"
|
|
27
|
+
done_definition:
|
|
28
|
+
- "Plan passes all structural validation checks"
|
|
29
|
+
- "Dependencies are acyclic and reference existing steps"
|
|
30
|
+
- "Every step references a known agent"
|
|
31
|
+
- "Goal is fully covered by the plan steps"
|
|
32
|
+
- "Metadata is accurate"
|
|
33
|
+
refusal_rules:
|
|
34
|
+
- "Do not approve a plan with circular dependencies"
|
|
35
|
+
- "Do not approve a plan where steps reference unknown agents"
|
|
36
|
+
- "Do not silently drop steps from the plan"
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Quality gates for generated projects.
|
|
2
|
+
# Keep this deterministic. If you relax a gate, do it intentionally.
|
|
3
|
+
|
|
4
|
+
enabled: true
|
|
5
|
+
|
|
6
|
+
# This flag is retained for the planned hard-gate path. The current runner
|
|
7
|
+
# writes advisory findings and returns passed=true even when individual gates
|
|
8
|
+
# report fail.
|
|
9
|
+
failOnIssues: true
|
|
10
|
+
|
|
11
|
+
# When true, swarm can auto-add follow-up steps to fix gate failures.
|
|
12
|
+
# These flags are present for the remediation path that will become active
|
|
13
|
+
# when quality-gate findings are promoted from advisory to hard failures.
|
|
14
|
+
autoAddRefactorStepOnDuplicateBlocks: true
|
|
15
|
+
autoAddReadmeTruthStepOnReadmeClaims: true
|
|
16
|
+
autoAddScaffoldFixStepOnScaffoldDefaults: true
|
|
17
|
+
autoAddConfigFixStepOnHardcodedConfig: true
|
|
18
|
+
autoAddAccessibilityFixStepOnAccessibility: true
|
|
19
|
+
autoAddTestCoverageStepOnTestCoverage: true
|
|
20
|
+
|
|
21
|
+
gates:
|
|
22
|
+
scaffoldDefaults:
|
|
23
|
+
enabled: true
|
|
24
|
+
|
|
25
|
+
duplicateBlocks:
|
|
26
|
+
enabled: true
|
|
27
|
+
minLines: 12
|
|
28
|
+
maxOccurrences: 2
|
|
29
|
+
maxFindings: 20
|
|
30
|
+
|
|
31
|
+
hardcodedConfig:
|
|
32
|
+
enabled: true
|
|
33
|
+
|
|
34
|
+
readmeClaims:
|
|
35
|
+
enabled: true
|
|
36
|
+
|
|
37
|
+
testIsolation:
|
|
38
|
+
enabled: true
|
|
39
|
+
|
|
40
|
+
# Runtime checks run the project's own tests, linter, and security audit.
|
|
41
|
+
# Each sub-check (test, lint, audit) is skipped gracefully when the target
|
|
42
|
+
# project lacks the relevant script, config, or package.json.
|
|
43
|
+
runtimeChecks:
|
|
44
|
+
enabled: true
|
|
45
|
+
retries: 1
|
|
46
|
+
runTests: true
|
|
47
|
+
runLint: true
|
|
48
|
+
runAudit: true
|
|
49
|
+
timeoutMs: 120000
|
|
50
|
+
|
|
51
|
+
accessibility:
|
|
52
|
+
enabled: true
|
|
53
|
+
requireSkipLink: true
|
|
54
|
+
requireHeadingHierarchy: true
|
|
55
|
+
requireAriaLabels: true
|
|
56
|
+
requireFocusStyles: true
|
|
57
|
+
requireReducedMotion: true
|
|
58
|
+
requireNoPhantomAssets: true
|
|
59
|
+
requireMetaTags: true
|
|
60
|
+
requireResponsiveCSS: true
|
|
61
|
+
requireColorScheme: true
|
|
62
|
+
requireSemanticHTML: true
|
|
63
|
+
requireImgAlt: true
|
|
64
|
+
|
|
65
|
+
testCoverage:
|
|
66
|
+
enabled: true
|
|
67
|
+
entryPointPatterns:
|
|
68
|
+
- '^src/dashboard\.tsx?$'
|
|
69
|
+
minTestAssertions: 1
|
|
70
|
+
requireComponentTests: true
|
|
71
|
+
|
|
72
|
+
# D4: Reject modifications to pre-existing test files.
|
|
73
|
+
# Agents should ADD new tests, not weaken existing ones.
|
|
74
|
+
testFileProtection:
|
|
75
|
+
enabled: true
|
|
76
|
+
testFileGlobs:
|
|
77
|
+
- 'tests/**'
|
|
78
|
+
- 'test/**'
|
|
79
|
+
- '**/__tests__/**'
|
|
80
|
+
- '**/*.test.ts'
|
|
81
|
+
- '**/*.test.tsx'
|
|
82
|
+
- '**/*.test.js'
|
|
83
|
+
- '**/*.test.jsx'
|
|
84
|
+
- '**/*.spec.ts'
|
|
85
|
+
- '**/*.spec.js'
|
|
86
|
+
- '**/test_*.py'
|
|
87
|
+
- '**/*_test.py'
|
|
88
|
+
maxFindings: 25
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Repair Agent Profile
|
|
2
|
+
# Specialized agent for self-repair: spawned when a step fails verification.
|
|
3
|
+
# Receives the failure transcript, verification report, git diff, and failed
|
|
4
|
+
# checks, then attempts targeted fixes rather than redoing the entire step.
|
|
5
|
+
|
|
6
|
+
agent:
|
|
7
|
+
name: RepairAgent
|
|
8
|
+
purpose: "Fix specific verification failures identified in a prior agent session"
|
|
9
|
+
scope:
|
|
10
|
+
- "Read the verification report and failed checks to understand what went wrong"
|
|
11
|
+
- "Apply targeted fixes to address the specific failures"
|
|
12
|
+
- "Re-run tests or builds if the original task required them"
|
|
13
|
+
- "Commit fixes with 'repair:' prefix messages"
|
|
14
|
+
boundaries:
|
|
15
|
+
- "Do not redo work that already passed verification"
|
|
16
|
+
- "Do not introduce new features or refactor unrelated code"
|
|
17
|
+
- "Do not change test assertions to make failures pass (fix the code instead)"
|
|
18
|
+
- "Limit changes to the minimum needed to pass verification"
|
|
19
|
+
done_definition:
|
|
20
|
+
- "All previously failing verification checks now pass"
|
|
21
|
+
- "No new verification failures introduced"
|
|
22
|
+
- "Fixes committed with clear 'repair:' prefix messages"
|
|
23
|
+
- "Evidence of fix visible in transcript (test output, build output, etc.)"
|
|
24
|
+
refusal_rules:
|
|
25
|
+
- "Do not claim a fix works without running the relevant test or build"
|
|
26
|
+
- "Do not delete or weaken verification checks to bypass failures"
|
|
27
|
+
- "If a fix requires architectural changes beyond scope, report it rather than attempt it"
|
|
28
|
+
|
|
29
|
+
# Retry configuration
|
|
30
|
+
retry:
|
|
31
|
+
maxAttempts: 3
|
|
32
|
+
# Estimated token budget per attempt (prompt + response).
|
|
33
|
+
# The orchestrator uses this for cost logging, not hard enforcement.
|
|
34
|
+
estimatedTokenBudgetPerAttempt: 8000
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
rules:
|
|
2
|
+
- id: swarm-agent-exception-swallowing
|
|
3
|
+
message: Catch handler appears empty or log-only.
|
|
4
|
+
severity: ERROR
|
|
5
|
+
languages: [javascript, typescript]
|
|
6
|
+
patterns:
|
|
7
|
+
- pattern-either:
|
|
8
|
+
- pattern: |
|
|
9
|
+
try { ... } catch ($E) {}
|
|
10
|
+
- pattern: |
|
|
11
|
+
try { ... } catch ($E) { console.$LOG(...); }
|
|
12
|
+
- pattern: |
|
|
13
|
+
try { ... } catch ($E) { logger.$LOG(...); }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# User-defined Agent Profiles
|
|
2
|
+
# Add your custom agents here following the same structure as default-agents.yaml
|
|
3
|
+
#
|
|
4
|
+
# Example:
|
|
5
|
+
# agents:
|
|
6
|
+
# - name: MyCustomAgent
|
|
7
|
+
# purpose: "Description of what this agent does"
|
|
8
|
+
# scope:
|
|
9
|
+
# - "Area 1 of responsibility"
|
|
10
|
+
# - "Area 2 of responsibility"
|
|
11
|
+
# boundaries:
|
|
12
|
+
# - "What this agent should NOT do"
|
|
13
|
+
# done_definition:
|
|
14
|
+
# - "Condition 1 for completion"
|
|
15
|
+
# - "Condition 2 for completion"
|
|
16
|
+
# output_contract:
|
|
17
|
+
# transcript: "proof/step-{N}-custom.md"
|
|
18
|
+
# artifacts:
|
|
19
|
+
# - "List of expected outputs"
|
|
20
|
+
# refusal_rules:
|
|
21
|
+
# - "Rule 1 for when to refuse or ask for clarification"
|
|
22
|
+
|
|
23
|
+
agents: []
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveAdapter = resolveAdapter;
|
|
4
|
+
exports.registerAdapter = registerAdapter;
|
|
5
|
+
exports.listAdapterNames = listAdapterNames;
|
|
6
|
+
const copilot_adapter_1 = require("./copilot-adapter");
|
|
7
|
+
const claude_code_adapter_1 = require("./claude-code-adapter");
|
|
8
|
+
const claude_code_teams_1 = require("./claude-code-teams");
|
|
9
|
+
const adapterRegistry = {
|
|
10
|
+
'copilot': () => new copilot_adapter_1.CopilotAdapter(),
|
|
11
|
+
'claude-code': () => new claude_code_adapter_1.ClaudeCodeAdapter(),
|
|
12
|
+
'claude-code-teams': () => new claude_code_teams_1.ClaudeCodeTeamsAdapter(),
|
|
13
|
+
};
|
|
14
|
+
// Resolve an adapter by CLI tool name. Throws with the list of valid
|
|
15
|
+
// names when the requested tool is unknown.
|
|
16
|
+
function resolveAdapter(toolName) {
|
|
17
|
+
const factory = adapterRegistry[toolName];
|
|
18
|
+
if (!factory) {
|
|
19
|
+
const valid = Object.keys(adapterRegistry).join(', ');
|
|
20
|
+
throw new Error(`Unknown tool "${toolName}". Valid tools: ${valid}`);
|
|
21
|
+
}
|
|
22
|
+
return factory();
|
|
23
|
+
}
|
|
24
|
+
function registerAdapter(name, factory) {
|
|
25
|
+
adapterRegistry[name] = factory;
|
|
26
|
+
}
|
|
27
|
+
function listAdapterNames() {
|
|
28
|
+
return Object.keys(adapterRegistry);
|
|
29
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Unified interface for spawning CLI-based coding agents.
|
|
3
|
+
// Each adapter wraps a specific tool (Copilot, Claude Code, Codex)
|
|
4
|
+
// behind a common contract so the orchestrator can drive any of them.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.buildRestrictedEnv = buildRestrictedEnv;
|
|
7
|
+
// Builds a minimal process.env for agent subprocesses. Only the keys the
|
|
8
|
+
// adapter actually needs are forwarded, limiting blast radius if a CLI
|
|
9
|
+
// tool is compromised or unexpectedly dumps its environment.
|
|
10
|
+
function buildRestrictedEnv(adapterKeys) {
|
|
11
|
+
const env = {
|
|
12
|
+
PATH: process.env.PATH || '/usr/bin:/bin',
|
|
13
|
+
HOME: process.env.HOME || '/tmp',
|
|
14
|
+
GIT_AUTHOR_NAME: 'swarm-orchestrator',
|
|
15
|
+
GIT_AUTHOR_EMAIL: 'swarm@localhost',
|
|
16
|
+
GIT_COMMITTER_NAME: 'swarm-orchestrator',
|
|
17
|
+
GIT_COMMITTER_EMAIL: 'swarm@localhost',
|
|
18
|
+
};
|
|
19
|
+
// Forward config directory vars so CLI tools find their OAuth/session credentials
|
|
20
|
+
const configVars = ['XDG_CONFIG_HOME', 'XDG_DATA_HOME', 'XDG_STATE_HOME', 'TMPDIR', 'TERM'];
|
|
21
|
+
for (const key of configVars) {
|
|
22
|
+
const val = process.env[key];
|
|
23
|
+
if (val)
|
|
24
|
+
env[key] = val;
|
|
25
|
+
}
|
|
26
|
+
for (const key of adapterKeys) {
|
|
27
|
+
const val = process.env[key];
|
|
28
|
+
if (val)
|
|
29
|
+
env[key] = val;
|
|
30
|
+
}
|
|
31
|
+
return env;
|
|
32
|
+
}
|