aw-spec-cli 0.1.5 → 0.1.7
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/assets/.agents/agent.json +1 -1
- package/assets/.agents/skills/{aw-spec-orch → appweaver}/SKILL.md +10 -10
- package/assets/.agents/skills/{aw-spec-orch-demo → appweaver-demo}/SKILL.md +9 -9
- package/assets/.claude/agent.json +1 -1
- package/assets/.claude/skills/{aw-spec-orch → appweaver}/SKILL.md +10 -10
- package/assets/.claude/skills/{aw-spec-orch-demo → appweaver-demo}/SKILL.md +9 -9
- package/assets/.kilocode/agent.json +1 -1
- package/assets/.kilocode/workflows/{aw-spec-orch-demo.md → appweaver-demo.md} +9 -9
- package/assets/.kilocode/workflows/{aw-spec-orch.md → appweaver.md} +10 -10
- package/assets/docs/pharma-constitution.my-ref.md +86 -0
- package/dist/utils/paths.js +1 -1
- package/dist/utils/paths.js.map +1 -1
- package/package.json +1 -1
- package/assets/.aw-spec/DESIGN-FORMAT.md +0 -151
- package/assets/.aw-spec/ORCH-DIALECT.md +0 -156
- package/assets/.aw-spec/RULE-PARTITION.md +0 -126
- package/assets/.aw-spec/domain.json +0 -3
- package/assets/.aw-spec/extensions/.registry +0 -19
- package/assets/.aw-spec/extensions/agent-context/README.md +0 -57
- package/assets/.aw-spec/extensions/agent-context/agent-context-config.yml +0 -4
- package/assets/.aw-spec/extensions/agent-context/commands/aw-spec.agent-context.update.md +0 -26
- package/assets/.aw-spec/extensions/agent-context/extension.yml +0 -37
- package/assets/.aw-spec/extensions/agent-context/scripts/bash/update-agent-context.sh +0 -201
- package/assets/.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +0 -237
- package/assets/.aw-spec/extensions.yml +0 -16
- package/assets/.aw-spec/feature.json +0 -3
- package/assets/.aw-spec/init-options.json +0 -9
- package/assets/.aw-spec/integration.json +0 -15
- package/assets/.aw-spec/integrations/aw-spec.manifest.json +0 -9
- package/assets/.aw-spec/interpreter/run-skill.py +0 -1158
- package/assets/.aw-spec/memory/constitution.md +0 -50
- package/assets/.aw-spec/orchestrator/AGENT-PROFILE.md +0 -94
- package/assets/.aw-spec/orchestrator/README.md +0 -300
- package/assets/.aw-spec/orchestrator/adapters/claude_agent_sdk.py +0 -74
- package/assets/.aw-spec/orchestrator/adapters/google_antigravity.py +0 -74
- package/assets/.aw-spec/orchestrator/modules/delta-design.orch.yaml +0 -105
- package/assets/.aw-spec/orchestrator/modules/delta-spec.orch.yaml +0 -79
- package/assets/.aw-spec/orchestrator/modules/domain-select.orch.yaml +0 -81
- package/assets/.aw-spec/orchestrator/modules/tech-select.orch.yaml +0 -75
- package/assets/.aw-spec/orchestrator/orchestrator.py +0 -1721
- package/assets/.aw-spec/orchestrator/rev-templates/ai-rules.reference.md +0 -40
- package/assets/.aw-spec/orchestrator/rev-templates/comandrulemap.skeleton.md +0 -59
- package/assets/.aw-spec/orchestrator/rev-templates/commandtechrulemap.skeleton.md +0 -97
- package/assets/.aw-spec/orchestrator/rev-templates/domain-constitution.skeleton.md +0 -61
- package/assets/.aw-spec/orchestrator/rev-templates/domain-requirements.skeleton.md +0 -48
- package/assets/.aw-spec/orchestrator/rev-templates/domain-rule-file.skeleton.md +0 -39
- package/assets/.aw-spec/orchestrator/rev-templates/technical-constitution.skeleton.md +0 -106
- package/assets/.aw-spec/orchestrator/rev-templates/technical-rule-file.skeleton.md +0 -54
- package/assets/.aw-spec/orchestrator/workflows/_smoke.orch.yaml +0 -160
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-add-component.orch.yaml +0 -244
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-adopt.orch.yaml +0 -775
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +0 -248
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +0 -261
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +0 -425
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-build.orch.yaml +0 -188
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-characterize.orch.yaml +0 -474
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-close-delta.orch.yaml +0 -181
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-constitution.orch.yaml +0 -284
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml +0 -103
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +0 -69
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-deploy.orch.yaml +0 -85
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-design.orch.yaml +0 -382
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +0 -382
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-foundation.orch.yaml +0 -246
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +0 -231
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement.orch.yaml +0 -258
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-inventory.orch.yaml +0 -236
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-onboard.orch.yaml +0 -949
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-parity.orch.yaml +0 -293
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-run.orch.yaml +0 -177
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-domain.orch.yaml +0 -79
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-feature.orch.yaml +0 -128
- package/assets/.aw-spec/orchestrator/workflows/aw-spec-specify.orch.yaml +0 -412
- package/assets/.aw-spec/scripts/bash/aw-inventory.sh +0 -14
- package/assets/.aw-spec/scripts/bash/aw-parity.sh +0 -13
- package/assets/.aw-spec/scripts/bash/aw-rev-constitution.sh +0 -13
- package/assets/.aw-spec/scripts/bash/aw-spec-actions.sh +0 -1899
- package/assets/.aw-spec/scripts/bash/aw-xref.sh +0 -15
- package/assets/.aw-spec/scripts/bash/common.sh +0 -533
- package/assets/.aw-spec/scripts/powershell/aw-inventory.ps1 +0 -14
- package/assets/.aw-spec/scripts/powershell/aw-parity.ps1 +0 -13
- package/assets/.aw-spec/scripts/powershell/aw-rev-constitution.ps1 +0 -13
- package/assets/.aw-spec/scripts/powershell/aw-spec-actions.ps1 +0 -1563
- package/assets/.aw-spec/scripts/powershell/aw-xref.ps1 +0 -15
- package/assets/.aw-spec/scripts/python/aw-inventory.py +0 -683
- package/assets/.aw-spec/scripts/python/aw-parity.py +0 -380
- package/assets/.aw-spec/scripts/python/aw-rev-constitution.py +0 -312
- package/assets/.aw-spec/scripts/python/aw-xref.py +0 -1330
- package/assets/.aw-spec/scripts/python/validate_okf.py +0 -349
- package/assets/.aw-spec/templates/constitution-domain-template.md +0 -75
- package/assets/.aw-spec/templates/constitution-technical-template.md +0 -70
- package/assets/.aw-spec/templates/delta-design-template.md +0 -69
- package/assets/.aw-spec/templates/delta-spec-template.md +0 -60
- package/assets/.aw-spec/templates/design-template.md +0 -383
- package/assets/.aw-spec/templates/okf-concept-template.md +0 -103
- package/assets/.aw-spec/templates/parity-manifest-template.json +0 -49
- package/assets/.aw-spec/templates/source-map-template.md +0 -85
- package/assets/.aw-spec/templates/spec-template.md +0 -252
- package/assets/docs/ModularMonolith/ModularMonolith.Reference.pack.txt +0 -25248
- package/assets/docs/ModularMonolith/ModularMonolith.pack.txt +0 -5726
- package/assets/docs/ModularMonolith/pack-foundation.ps1 +0 -145
- package/assets/docs/ModularMonolith/pack-foundation.sh +0 -196
- package/assets/docs/ModularMonolith/pack-reference-foundation.ps1 +0 -157
- package/assets/docs/ModularMonolith/pack-reference-foundation.sh +0 -209
- package/assets/docs/ModularMonolith/unpack-foundation.ps1 +0 -126
- package/assets/docs/ModularMonolith/unpack-foundation.sh +0 -217
- package/assets/docs/ModularMonolith/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/ModularMonolith/unpack-reference-foundation.sh +0 -218
- package/assets/docs/README.md +0 -106
- package/assets/docs/VerticalSlice/PACKAGING.md +0 -185
- package/assets/docs/VerticalSlice/VerticalSlice.Reference.pack.txt +0 -19318
- package/assets/docs/VerticalSlice/VerticalSlice.pack.txt +0 -2833
- package/assets/docs/VerticalSlice/pack-foundation.ps1 +0 -145
- package/assets/docs/VerticalSlice/pack-foundation.sh +0 -196
- package/assets/docs/VerticalSlice/pack-reference-foundation.ps1 +0 -157
- package/assets/docs/VerticalSlice/pack-reference-foundation.sh +0 -209
- package/assets/docs/VerticalSlice/unpack-foundation.ps1 +0 -126
- package/assets/docs/VerticalSlice/unpack-foundation.sh +0 -217
- package/assets/docs/VerticalSlice/unpack-reference-foundation.ps1 +0 -129
- package/assets/docs/VerticalSlice/unpack-reference-foundation.sh +0 -218
- package/assets/docs/architecture/clean-architecture.md +0 -71
- package/assets/docs/architecture/cqrs.md +0 -141
- package/assets/docs/architecture/eventing.md +0 -83
- package/assets/docs/architecture/folder-structure.md +0 -61
- package/assets/docs/architecture/modular-monolith.md +0 -47
- package/assets/docs/architecture/persistence.md +0 -269
- package/assets/docs/architecture/testing.md +0 -55
- package/assets/docs/architecture/vertical-slices.md +0 -201
- package/assets/docs/components/Email/README.md +0 -119
- package/assets/docs/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +0 -84
- package/assets/docs/components/Email/integration.md +0 -300
- package/assets/docs/components/Jobs/README.md +0 -113
- package/assets/docs/components/Jobs/integration.md +0 -259
- package/assets/docs/components/QrGenerator/README.md +0 -85
- package/assets/docs/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +0 -57
- package/assets/docs/components/QrGenerator/integration.md +0 -230
- package/assets/docs/components/README.md +0 -74
- package/assets/docs/domain/domain-driven-design.md +0 -212
- package/assets/docs/domainspecs/healthcare/ai-rules.domain.md +0 -34
- package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +0 -17
- package/assets/docs/domainspecs/healthcare/auditing.domain.md +0 -97
- package/assets/docs/domainspecs/healthcare/authorization.domain.md +0 -26
- package/assets/docs/domainspecs/healthcare/clinical-terms.md +0 -20
- package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +0 -26
- package/assets/docs/domainspecs/healthcare/comandrulemap.md +0 -100
- package/assets/docs/domainspecs/healthcare/commandtechrulemap.md +0 -119
- package/assets/docs/domainspecs/healthcare/consent.md +0 -19
- package/assets/docs/domainspecs/healthcare/cqrs.domain.md +0 -12
- package/assets/docs/domainspecs/healthcare/data-classification.domain.md +0 -28
- package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +0 -11
- package/assets/docs/domainspecs/healthcare/dicom.md +0 -15
- package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +0 -28
- package/assets/docs/domainspecs/healthcare/domain-requirements.md +0 -55
- package/assets/docs/domainspecs/healthcare/eventing.domain.md +0 -18
- package/assets/docs/domainspecs/healthcare/fhir.md +0 -36
- package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +0 -23
- package/assets/docs/domainspecs/healthcare/hipaa.md +0 -34
- package/assets/docs/domainspecs/healthcare/hl7.md +0 -15
- package/assets/docs/domainspecs/healthcare/integration-terms.md +0 -21
- package/assets/docs/domainspecs/healthcare/persistence.domain.md +0 -20
- package/assets/docs/domainspecs/healthcare/terminology.md +0 -30
- package/assets/docs/domainspecs/healthcare/testing.domain.md +0 -15
- package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +0 -18
- package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +0 -12
- package/assets/docs/domainspecs/pharma/ai-rules.domain.md +0 -32
- package/assets/docs/domainspecs/pharma/api-versioning.domain.md +0 -20
- package/assets/docs/domainspecs/pharma/atc.md +0 -22
- package/assets/docs/domainspecs/pharma/auditing.domain.md +0 -90
- package/assets/docs/domainspecs/pharma/authorization.domain.md +0 -25
- package/assets/docs/domainspecs/pharma/coding-standards.domain.md +0 -28
- package/assets/docs/domainspecs/pharma/comandrulemap.md +0 -108
- package/assets/docs/domainspecs/pharma/commandtechrulemap.md +0 -119
- package/assets/docs/domainspecs/pharma/cqrs.domain.md +0 -16
- package/assets/docs/domainspecs/pharma/data-classification.domain.md +0 -24
- package/assets/docs/domainspecs/pharma/data-provenance.md +0 -21
- package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +0 -11
- package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +0 -36
- package/assets/docs/domainspecs/pharma/domain-requirements.md +0 -99
- package/assets/docs/domainspecs/pharma/eventing.domain.md +0 -18
- package/assets/docs/domainspecs/pharma/fhir.md +0 -31
- package/assets/docs/domainspecs/pharma/folder-structure.domain.md +0 -24
- package/assets/docs/domainspecs/pharma/hl7.md +0 -17
- package/assets/docs/domainspecs/pharma/idmp.md +0 -26
- package/assets/docs/domainspecs/pharma/integration-terms.md +0 -21
- package/assets/docs/domainspecs/pharma/ndc.md +0 -28
- package/assets/docs/domainspecs/pharma/persistence.domain.md +0 -23
- package/assets/docs/domainspecs/pharma/pharma-terms.md +0 -27
- package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +0 -30
- package/assets/docs/domainspecs/pharma/regulatory-compliance.md +0 -19
- package/assets/docs/domainspecs/pharma/terminology.md +0 -32
- package/assets/docs/domainspecs/pharma/testing.domain.md +0 -19
- package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +0 -17
- package/assets/docs/domainspecs/pharma/zero-trust.domain.md +0 -12
- package/assets/docs/glossary/ai-rules.md +0 -59
- package/assets/docs/governance/api-versioning.md +0 -99
- package/assets/docs/governance/coding-standards.md +0 -87
- package/assets/docs/governance/dependency-policy.md +0 -40
- package/assets/docs/interop/ihe-conformance.md +0 -31
- package/assets/docs/requirement-spec.txt +0 -27
- package/assets/docs/security/auditing.md +0 -160
- package/assets/docs/security/authorization-matrix.md +0 -14
- package/assets/docs/security/authorization.md +0 -87
- package/assets/docs/security/data-classification.md +0 -38
- package/assets/docs/security/zero-trust.md +0 -76
- package/assets/docs/technology-constitution.md +0 -172
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
# [PROJECT_NAME] Constitution
|
|
2
|
-
<!-- Example: Spec Constitution, TaskFlow Constitution, etc. -->
|
|
3
|
-
|
|
4
|
-
## Core Principles
|
|
5
|
-
|
|
6
|
-
### [PRINCIPLE_1_NAME]
|
|
7
|
-
<!-- Example: I. Library-First -->
|
|
8
|
-
[PRINCIPLE_1_DESCRIPTION]
|
|
9
|
-
<!-- Example: Every feature starts as a standalone library; Libraries must be self-contained, independently testable, documented; Clear purpose required - no organizational-only libraries -->
|
|
10
|
-
|
|
11
|
-
### [PRINCIPLE_2_NAME]
|
|
12
|
-
<!-- Example: II. CLI Interface -->
|
|
13
|
-
[PRINCIPLE_2_DESCRIPTION]
|
|
14
|
-
<!-- Example: Every library exposes functionality via CLI; Text in/out protocol: stdin/args → stdout, errors → stderr; Support JSON + human-readable formats -->
|
|
15
|
-
|
|
16
|
-
### [PRINCIPLE_3_NAME]
|
|
17
|
-
<!-- Example: III. Test-First (NON-NEGOTIABLE) -->
|
|
18
|
-
[PRINCIPLE_3_DESCRIPTION]
|
|
19
|
-
<!-- Example: TDD mandatory: Tests written → User approved → Tests fail → Then implement; Red-Green-Refactor cycle strictly enforced -->
|
|
20
|
-
|
|
21
|
-
### [PRINCIPLE_4_NAME]
|
|
22
|
-
<!-- Example: IV. Integration Testing -->
|
|
23
|
-
[PRINCIPLE_4_DESCRIPTION]
|
|
24
|
-
<!-- Example: Focus areas requiring integration tests: New library contract tests, Contract changes, Inter-service communication, Shared schemas -->
|
|
25
|
-
|
|
26
|
-
### [PRINCIPLE_5_NAME]
|
|
27
|
-
<!-- Example: V. Observability, VI. Versioning & Breaking Changes, VII. Simplicity -->
|
|
28
|
-
[PRINCIPLE_5_DESCRIPTION]
|
|
29
|
-
<!-- Example: Text I/O ensures debuggability; Structured logging required; Or: MAJOR.MINOR.BUILD format; Or: Start simple, YAGNI principles -->
|
|
30
|
-
|
|
31
|
-
## [SECTION_2_NAME]
|
|
32
|
-
<!-- Example: Additional Constraints, Security Requirements, Performance Standards, etc. -->
|
|
33
|
-
|
|
34
|
-
[SECTION_2_CONTENT]
|
|
35
|
-
<!-- Example: Technology stack requirements, compliance standards, deployment policies, etc. -->
|
|
36
|
-
|
|
37
|
-
## [SECTION_3_NAME]
|
|
38
|
-
<!-- Example: Development Workflow, Review Process, Quality Gates, etc. -->
|
|
39
|
-
|
|
40
|
-
[SECTION_3_CONTENT]
|
|
41
|
-
<!-- Example: Code review requirements, testing gates, deployment approval process, etc. -->
|
|
42
|
-
|
|
43
|
-
## Governance
|
|
44
|
-
<!-- Example: Constitution supersedes all other practices; Amendments require documentation, approval, migration plan -->
|
|
45
|
-
|
|
46
|
-
[GOVERNANCE_RULES]
|
|
47
|
-
<!-- Example: All PRs/reviews must verify compliance; Complexity must be justified; Use [GUIDANCE_FILE] for runtime development guidance -->
|
|
48
|
-
|
|
49
|
-
**Version**: [CONSTITUTION_VERSION] | **Ratified**: [RATIFICATION_DATE] | **Last Amended**: [LAST_AMENDED_DATE]
|
|
50
|
-
<!-- Example: Version: 2.1.1 | Ratified: 2025-06-13 | Last Amended: 2025-07-16 -->
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
# Agent transport profile schema
|
|
2
|
-
|
|
3
|
-
The orchestrator engine (`orchestrator.py`) is **agent-agnostic**. It never names
|
|
4
|
-
Claude, Gemini, or Kilo. Each agent supplies a small JSON **profile** that maps
|
|
5
|
-
the engine's neutral knobs onto that agent's real headless CLI flags. Each
|
|
6
|
-
profile lives **once at its agent's root**, shared by every orchestrator skill
|
|
7
|
-
for that agent; the engine that consumes it is the *general* file in `.aw-spec/`.
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
.aw-spec/orchestrator/orchestrator.py ← general engine (reads a profile)
|
|
11
|
-
.aw-spec/orchestrator/adapters/*.py ← shared SDK adapters (one per SDK, not per agent)
|
|
12
|
-
.claude/agent.json ← Claude Code profile (claude -p / claude-agent-sdk)
|
|
13
|
-
.agents/agent.json ← Antigravity profile (agy -p / google-antigravity)
|
|
14
|
-
.kilocode/agent.json ← Kilo Code profile (delegates to claude)
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
The launcher passes its profile with `--agent-profile <path>` (which implies
|
|
18
|
-
`--transport real`).
|
|
19
|
-
|
|
20
|
-
## Fields
|
|
21
|
-
|
|
22
|
-
| Field | Meaning |
|
|
23
|
-
|---|---|
|
|
24
|
-
| `name` | label shown in the banner/logs |
|
|
25
|
-
| `runtime` / `note` | free-text documentation (ignored by the engine) |
|
|
26
|
-
| `bin` | the CLI executable (e.g. `claude`, `gemini`) |
|
|
27
|
-
| `args` | always-on args prepended to every call |
|
|
28
|
-
| `model_flag` | flag for `--model` (e.g. `--model`, `-m`); omit to ignore model |
|
|
29
|
-
| `system` | how the interpreter's system block is injected: `{ "flag": "--system-prompt" }` to pass it as a flag, or `"prepend"` to fold it into the prompt (for CLIs with no system flag, e.g. gemini) |
|
|
30
|
-
| `user` | how the user block is delivered: `{ "mode": "stdin" }` or `{ "mode": "arg", "flag": "-p" }` |
|
|
31
|
-
| `tools_flag` | flag for the tools allowlist (e.g. `--tools`), or `null` if the CLI governs tools another way (gemini → `--approval-mode`) |
|
|
32
|
-
| `approval` | map from the neutral permission mode (`acceptEdits`, `bypassPermissions`, `default`, `readonly`) to that CLI's args |
|
|
33
|
-
| `isolation` | map from `--isolation` (`bare`, `fresh`) to that CLI's args (e.g. `--bare`, or `["--setting-sources", ""]`) |
|
|
34
|
-
| `budget_flag` | optional flag for a per-call spend cap (`--max-budget-usd`); omit if unsupported |
|
|
35
|
-
| `result_keys` | keys to look for in the CLI's JSON output that hold the final text (first match wins); falls back to raw stdout |
|
|
36
|
-
| `sdk` | how the `sdk` / `sdk-apply` strategies run an isolated generation via that agent's SDK (see below) |
|
|
37
|
-
|
|
38
|
-
## The `sdk` block
|
|
39
|
-
|
|
40
|
-
The `sdk`/`sdk-apply` strategies never name an SDK in the engine — the profile
|
|
41
|
-
declares everything:
|
|
42
|
-
|
|
43
|
-
| Field | Meaning |
|
|
44
|
-
|---|---|
|
|
45
|
-
| `type` | label for humans/tooling (the engine does not branch on it) |
|
|
46
|
-
| `package` | the pip package to install when the module isn't importable (`--sdk-install` or `auto_install: true` triggers `python -m pip install <package>`) |
|
|
47
|
-
| `module` | the Python module the engine imports (e.g. `claude_agent_sdk`, `google.antigravity`) |
|
|
48
|
-
| `adapter` | **required** — path (relative to this profile file) to a Python file exporting `generate(request) -> str` that owns this SDK's calling convention; may be sync or async. Shared adapters live in `.aw-spec/orchestrator/adapters/`, one per SDK, so profiles whose SDKs match reference the same file (e.g. `"../.aw-spec/orchestrator/adapters/claude_agent_sdk.py"`). The engine ships no SDK code of its own, so a profile without an adapter cannot run the `sdk`/`sdk-apply` strategies |
|
|
49
|
-
| `auto_install` | `true` to always install the missing package without needing `--sdk-install` |
|
|
50
|
-
|
|
51
|
-
`module`, `package`, and `adapter` are all required — the engine has no
|
|
52
|
-
default agent, so a developer who only has one agent root (e.g. only
|
|
53
|
-
`.agents/`) never depends on another agent's files being present. A missing
|
|
54
|
-
or broken field/adapter stops the run with a message naming exactly what to
|
|
55
|
-
fix.
|
|
56
|
-
|
|
57
|
-
The adapter's `request` dict carries `system`, `user`, `tools`,
|
|
58
|
-
`permission_mode`, `model`, and the full `sdk` block (for adapter-specific
|
|
59
|
-
options). Adapters are keyed by SDK, not by agent:
|
|
60
|
-
`adapters/google_antigravity.py` maps the neutral permission modes onto
|
|
61
|
-
Antigravity policies and drives `Agent` / `LocalAgentConfig` (used by
|
|
62
|
-
`.agents`), while `adapters/claude_agent_sdk.py` drives `query` /
|
|
63
|
-
`ClaudeAgentOptions` (shared by `.claude` and `.kilocode`, whose SDK is the
|
|
64
|
-
same) — none of which the engine knows about; it only follows the profile's
|
|
65
|
-
`sdk.adapter` pointer.
|
|
66
|
-
|
|
67
|
-
## How the engine builds the command
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
[bin] + args
|
|
71
|
-
+ (model_flag model) if model_flag and --model
|
|
72
|
-
+ (system.flag system) if system is a {flag}
|
|
73
|
-
+ (tools_flag tools) if tools_flag
|
|
74
|
-
+ approval[permission_mode | default]
|
|
75
|
-
+ isolation[--isolation]
|
|
76
|
-
+ (budget_flag budget) if budget_flag and --budget
|
|
77
|
-
+ (user.flag prompt) if user.mode == "arg"
|
|
78
|
-
stdin = prompt if user.mode == "stdin"
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
When `system` is `"prepend"`, the system block is folded into the prompt
|
|
82
|
-
(`system + "\n\n---\n\n" + user`) instead of passed as a flag.
|
|
83
|
-
|
|
84
|
-
## Adding a new agent
|
|
85
|
-
|
|
86
|
-
1. Drop an `agent.json` at that agent's root (`.<agent>/agent.json`) describing its CLI.
|
|
87
|
-
2. Add a launcher in that agent's native format that calls
|
|
88
|
-
`orchestrator.py … --agent-profile .<agent>/agent.json`.
|
|
89
|
-
3. For the `sdk`/`sdk-apply` strategies, add an `sdk` block and point
|
|
90
|
-
`sdk.adapter` at the matching adapter in `.aw-spec/orchestrator/adapters/`
|
|
91
|
-
— or drop a new adapter there first if that SDK has none yet.
|
|
92
|
-
|
|
93
|
-
No engine change required. Verify with `--dry-run` (prints the exact command
|
|
94
|
-
without executing).
|
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
# aw-orchestrator (prototype)
|
|
2
|
-
|
|
3
|
-
A reference runtime for the architecture you sketched: **the Python interpreter
|
|
4
|
-
owns 100% of context assembly; a _fresh_ agent does the execution with tools;
|
|
5
|
-
control returns to the interpreter, which reviews and continues.**
|
|
6
|
-
|
|
7
|
-
It is **agent-agnostic**: the same engine + workflows drive Claude Code,
|
|
8
|
-
Antigravity (Gemini), or Kilo Code. The engine never names an agent — each agent
|
|
9
|
-
supplies a small transport **profile**.
|
|
10
|
-
|
|
11
|
-
This engine is now the **only** pipeline that ships. The earlier declarative tier
|
|
12
|
-
(`aw-spec-decl-*` skills, `aw-spec.declarative/v1`) was **retired 2026-08-03**.
|
|
13
|
-
|
|
14
|
-
> **`.aw-spec/interpreter/run-skill.py` deliberately SURVIVES that retirement.**
|
|
15
|
-
> It is no longer an entry point — nothing launches it — but `orchestrator.py`
|
|
16
|
-
> imports it at load time for its YAML loader (`load_yaml`, orchestrator.py ~L112).
|
|
17
|
-
> **Deleting it breaks every workflow in this directory.** Fold the loader in before
|
|
18
|
-
> removing the file.
|
|
19
|
-
|
|
20
|
-
## General vs. agent-specific (file layout)
|
|
21
|
-
|
|
22
|
-
The transport **profile lives once at each agent's root** (`.claude/agent.json`,
|
|
23
|
-
`.agents/agent.json`, `.kilocode/agent.json`), so every orchestrator skill for
|
|
24
|
-
that agent shares it — no per-skill duplication. Only the thin launcher is
|
|
25
|
-
per-skill.
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
.aw-spec/orchestrator/ ← GENERAL (shared by all agents)
|
|
29
|
-
orchestrator.py engine (profile-driven; no agent hardcoded)
|
|
30
|
-
workflows/aw-spec-demo.orch.yaml demo workflow (run: /aw-spec-orch demo)
|
|
31
|
-
AGENT-PROFILE.md the transport-profile schema
|
|
32
|
-
README.md
|
|
33
|
-
|
|
34
|
-
.claude/agent.json ← Claude Code profile (all its skills share this)
|
|
35
|
-
.claude/skills/aw-spec-orch-demo/SKILL.md ← Claude Code launcher
|
|
36
|
-
.agents/agent.json ← Antigravity profile
|
|
37
|
-
.agents/skills/aw-spec-orch-demo/SKILL.md ← Antigravity launcher
|
|
38
|
-
.kilocode/agent.json ← Kilo Code profile
|
|
39
|
-
.kilocode/workflows/aw-spec-orch-demo.md ← Kilo Code launcher
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Your diagram → this code
|
|
43
|
-
|
|
44
|
-
| Diagram box | Where it lives |
|
|
45
|
-
|---|---|
|
|
46
|
-
| Agent skill launches the runtime | the per-agent launcher runs `orchestrator.py … --agent-profile <profile>` |
|
|
47
|
-
| Python Workflow / Interpreter Runtime | `orchestrator.py` — `Orchestrator.run()` |
|
|
48
|
-
| **Builds Complete Context** | `build_context` → `_assemble_system()` + `_assemble_user()` |
|
|
49
|
-
| **Invoke (fresh generation)** | `agent_generate` → `_run_fresh()` → the profile's CLI |
|
|
50
|
-
| Agent uses tools (Edit, Bash…) | tools/approval flags from the profile |
|
|
51
|
-
| **Return structured result** | trailing ```` ```json {…} ```` block → `_extract_json()` → bound via `outputs:` |
|
|
52
|
-
| Interpreter continues next step | `_run_steps()` / `_run_loop()` |
|
|
53
|
-
| **Review the current output** | `agent_review` → a second fresh, read-only generation |
|
|
54
|
-
| …continues | the `revise` loop in `workflows/aw-spec-demo.orch.yaml` |
|
|
55
|
-
|
|
56
|
-
## Why this overrides the launching agent's own context (your R6)
|
|
57
|
-
|
|
58
|
-
Generation does **not** happen inside the launching agent's conversation. Each
|
|
59
|
-
`agent_generate` / `agent_review` shells out to a **separate** process described
|
|
60
|
-
by the profile. For the Claude Code profile that is:
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
claude -p --bare \
|
|
64
|
-
--system-prompt "<interpreter-authored standards>" \
|
|
65
|
-
--output-format json --tools "Read,Write,Edit,Bash" \
|
|
66
|
-
--permission-mode acceptEdits --no-session-persistence
|
|
67
|
-
< <interpreter-authored task on stdin>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
- `-p` → a brand-new conversation; the caller's transcript is **not** inherited.
|
|
71
|
-
- `--bare` → no CLAUDE.md / auto-memory / hooks; the only context is what we pass.
|
|
72
|
-
- `--system-prompt` + stdin → the interpreter owns the system and user blocks.
|
|
73
|
-
|
|
74
|
-
So every model request sees **exactly** the interpreter's payload — nothing from
|
|
75
|
-
the launching agent. (The Gemini profile achieves the same isolation differently;
|
|
76
|
-
see below.)
|
|
77
|
-
|
|
78
|
-
## Run it
|
|
79
|
-
|
|
80
|
-
Safe (default) — **no model calls**. Prints the exact payloads the fresh agent
|
|
81
|
-
would receive (proof of isolation), simulates the writes, runs the whole loop:
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
python3 .aw-spec/orchestrator/orchestrator.py .aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml # mock
|
|
85
|
-
python3 .aw-spec/orchestrator/orchestrator.py .aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml --show-full
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
For real — pass an agent profile (implies `--transport real`):
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
# Claude Code
|
|
92
|
-
python3 .aw-spec/orchestrator/orchestrator.py .aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml \
|
|
93
|
-
--agent-profile .claude/agent.json --isolation bare --model opus
|
|
94
|
-
|
|
95
|
-
# Antigravity (Gemini)
|
|
96
|
-
python3 .aw-spec/orchestrator/orchestrator.py .aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml \
|
|
97
|
-
--agent-profile .agents/agent.json --isolation fresh --model gemini-2.5-pro
|
|
98
|
-
|
|
99
|
-
# Kilo Code (delegates generation to claude -p)
|
|
100
|
-
python3 .aw-spec/orchestrator/orchestrator.py .aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml \
|
|
101
|
-
--agent-profile .kilocode/agent.json --isolation fresh --model opus
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Add `--dry-run` to print the exact command a profile would run **without
|
|
105
|
-
executing it**. Output lands in `.aw-spec/orchestrator/.demo-out/` (safe to delete).
|
|
106
|
-
|
|
107
|
-
## Execution strategies — `--strategy`, per-step `strategy:`
|
|
108
|
-
|
|
109
|
-
The interpreter assembles **100% of every payload in all strategies**; they
|
|
110
|
-
differ only in *who executes it* and *who applies the file changes*. The
|
|
111
|
-
developer picks per command (launcher passes `--strategy`) and can override
|
|
112
|
-
per step in the workflow YAML (`strategy:` on `agent_generate`/`agent_review`).
|
|
113
|
-
|
|
114
|
-
| `--strategy` | Who generates | Who applies | Instances | Isolation (R6) |
|
|
115
|
-
|---|---|---|---|---|
|
|
116
|
-
| `sdk` | isolated SDK instance | SDK instance (tools) | 1 | guaranteed |
|
|
117
|
-
| `sdk-apply` | isolated SDK instance (read-only) | **invoking agent** (suspend/resume) | 1 + you | generation clean; apply local |
|
|
118
|
-
| `spawn` | fresh CLI process (profile) | same process | N cold | guaranteed |
|
|
119
|
-
| `agent` | invoking agent (suspend/resume) | invoking agent | **0** | best-effort |
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
# Strategy 1 — SDK generates + implements (needs: pip install claude-agent-sdk)
|
|
123
|
-
python3 .aw-spec/orchestrator/orchestrator.py <wf.yaml> --strategy sdk --model opus
|
|
124
|
-
|
|
125
|
-
# Strategy 2 — SDK generates read-only; YOU apply the artifact (suspend kind=apply)
|
|
126
|
-
python3 .aw-spec/orchestrator/orchestrator.py <wf.yaml> --strategy sdk-apply \
|
|
127
|
-
--checkpoint <state.json>
|
|
128
|
-
|
|
129
|
-
# Strategy 3 — the original profile transport
|
|
130
|
-
python3 .aw-spec/orchestrator/orchestrator.py <wf.yaml> --strategy spawn \
|
|
131
|
-
--agent-profile .claude/agent.json
|
|
132
|
-
|
|
133
|
-
# Strategy 4 — zero new instances (the checkpoint section below)
|
|
134
|
-
python3 .aw-spec/orchestrator/orchestrator.py <wf.yaml> --strategy agent \
|
|
135
|
-
--checkpoint <state.json>
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
Rules: `spawn` needs `--agent-profile`; `agent` and `sdk-apply` need
|
|
139
|
-
`--checkpoint`. Omitting `--strategy` keeps the legacy behavior
|
|
140
|
-
(`--agent-profile` → spawn, `--checkpoint` → agent, neither → mock). The
|
|
141
|
-
loop + checkpoint machinery is strategy-independent — every completed
|
|
142
|
-
generation is written to the replay cache, so **mixed-strategy workflows
|
|
143
|
-
survive suspend/resume** (an `sdk` result is not re-generated when an `agent`
|
|
144
|
-
or `apply` step later suspends the run). The state file persists
|
|
145
|
-
strategy/model, so resuming with a bare `--checkpoint` continues the original
|
|
146
|
-
run correctly. In `sdk-apply`, `agent_review` steps degrade to a plain
|
|
147
|
-
read-only `sdk` call (reviews have no apply phase). The `claude-agent-sdk`
|
|
148
|
-
import is lazy — strategies `spawn`/`agent`/mock keep the engine stdlib-only.
|
|
149
|
-
|
|
150
|
-
## Checkpoint transport — zero additional instances (the run-skill.py method)
|
|
151
|
-
|
|
152
|
-
If spawning a second agent instance is impossible or unwanted, `--checkpoint`
|
|
153
|
-
ports run-skill.py's **suspend/resume** method into this engine:
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
python3 .aw-spec/orchestrator/orchestrator.py .aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml \
|
|
157
|
-
--checkpoint .aw-spec/orchestrator/.demo-out/demo.state.json --json
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
At each `agent_generate` / `agent_review` the interpreter writes the fully
|
|
161
|
-
assembled payload to `<state>.system.md` / `<state>.user.md`, persists its
|
|
162
|
-
state (`vars` seeds + a loop-aware **replay cache**), prints the pending
|
|
163
|
-
request, and **exits with code 2** — which releases the invoking agent from
|
|
164
|
-
the Bash call. The agent fulfills the request **in its own conversation**
|
|
165
|
-
(instructed to use ONLY the payload files), writes its reply — ending with the
|
|
166
|
-
required ```` ```json ```` fence — to `<state>.response.md`, and re-runs the
|
|
167
|
-
same command. Completed steps replay from the cache, so the run continues
|
|
168
|
-
exactly where it suspended; on a terminal end the state file and sidecars are
|
|
169
|
-
deleted. Launcher: the `aw-spec-orch-demo` skill/workflow handles this via its
|
|
170
|
-
`sdk-apply` / `agent` strategies (step 3, the suspend/resume loop). The same
|
|
171
|
-
loop works for any agent that can run bash and read/write files — including
|
|
172
|
-
Kilo Code, natively, with no `claude` CLI.
|
|
173
|
-
|
|
174
|
-
**The trade-off, stated plainly:** the interpreter keeps 100% ownership of
|
|
175
|
-
what goes *into* each payload, but the request executes inside the invoking
|
|
176
|
-
agent's conversation — its system prompt and accumulated transcript ride
|
|
177
|
-
along, and payloads pile up across steps. Payload ownership is preserved;
|
|
178
|
-
**context isolation (R6) is not.**
|
|
179
|
-
|
|
180
|
-
**`--checkpoint` + `--agent-profile` combine freely** (D1): mixing them as a
|
|
181
|
-
*generation* transport still makes no sense (a step generates via the profile
|
|
182
|
-
OR via the invoker, chosen by `--strategy`), but the checkpoint is also the
|
|
183
|
-
**interaction channel** — `ask` / `user_select` / `dispatch_hooks` suspend
|
|
184
|
-
through it under EVERY strategy so the launching agent can relay to the human.
|
|
185
|
-
Converted `aw-spec-*` workflows therefore always run with `--checkpoint`,
|
|
186
|
-
whatever the strategy. The full `pending.kind` protocol (`agent_generate`,
|
|
187
|
-
`agent_review`/`agent_query`, `apply`, `author`, `ask`, `select`, `hook`) is
|
|
188
|
-
documented in `.aw-spec/ORCH-DIALECT.md`.
|
|
189
|
-
|
|
190
|
-
| | profile transports (`--agent-profile`) | checkpoint (`--checkpoint`) |
|
|
191
|
-
|---|---|---|
|
|
192
|
-
| Agent instances | +1 fresh process per generation | **0** — the invoker generates |
|
|
193
|
-
| Model request contains | ONLY the interpreter's payload | payload **+ the invoker's context** |
|
|
194
|
-
| R6 (context override) | guaranteed by construction | best-effort (instructions only) |
|
|
195
|
-
| Extra auth / CLI needed | yes (`claude`/`gemini` + key for `--bare`) | none |
|
|
196
|
-
| Permission prompts / HITL | none (headless) | the agent's native ones |
|
|
197
|
-
|
|
198
|
-
## The three agents
|
|
199
|
-
|
|
200
|
-
| Agent | Folder | Fresh-generation CLI | System block | Tools | Isolation |
|
|
201
|
-
|---|---|---|---|---|---|
|
|
202
|
-
| Claude Code | `.claude/` | `claude -p` | `--system-prompt` | `--tools` | `--bare` (needs `ANTHROPIC_API_KEY`) / `--setting-sources ""` |
|
|
203
|
-
| Antigravity | `.agents/` | `gemini -p` | folded into prompt (no system flag) | `--approval-mode` | best-effort (no `--bare` equivalent) |
|
|
204
|
-
| Kilo Code | `.kilocode/` | `claude -p` (no native headless CLI) | `--system-prompt` | `--tools` | `--bare` / `--setting-sources ""` |
|
|
205
|
-
|
|
206
|
-
Adding a fourth agent = drop an `agent.json` + a launcher in its folder; no
|
|
207
|
-
engine change. See `AGENT-PROFILE.md` for the schema.
|
|
208
|
-
|
|
209
|
-
## Invoking from an agent (the top of your diagram)
|
|
210
|
-
|
|
211
|
-
You don't run this by hand — each agent's skill/workflow launches it, and the
|
|
212
|
-
agent's *only* job is to run the orchestrator and relay the JSON. It **never
|
|
213
|
-
generates**; its conversation **never** enters a model request.
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
User → /aw-spec-orch-demo → (agent runs) orchestrator.py --agent-profile <its profile>
|
|
217
|
-
→ interpreter builds context → spawns a fresh CLI per step (isolated)
|
|
218
|
-
→ interpreter reviews + continues → agent reports final JSON
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
Contrast the retired `aw-spec-decl-*` launchers, which ran `run-skill.py --llm agent`
|
|
222
|
-
and then asked the *same* agent to fulfill `pending_generation` in its own context —
|
|
223
|
-
the context leak this design removes, and one reason that tier was retired.
|
|
224
|
-
|
|
225
|
-
## Workflow vocabulary (prototype)
|
|
226
|
-
|
|
227
|
-
- `set` — set vars (`vars: {k: v}`).
|
|
228
|
-
- `build_context` — declare the envelope for the next request: `system:` files
|
|
229
|
-
(→ system prompt) and `context:` files (→ user message). Optional entries
|
|
230
|
-
`{ path: …, optional: true }` are tolerated when missing. `context_from: <var>`
|
|
231
|
-
appends a var holding a list of paths (e.g. files a prior generation wrote).
|
|
232
|
-
- `agent_generate` — fresh generation with write tools. `task:` is the
|
|
233
|
-
instruction; **the interpreter does not specify output paths** — the fresh
|
|
234
|
-
runtime/LLM decides them (per the loaded folder-structure standards) and
|
|
235
|
-
reports them in the result's `files[]`. Bind with
|
|
236
|
-
`outputs: [{ name: gen_files, from: "$.files" }]`.
|
|
237
|
-
- `agent_review` — fresh, read-only generation. `review_of_var: <var>` reviews
|
|
238
|
-
the files a prior generation reported (or `review_of:` for a static list);
|
|
239
|
-
returns `{pass, issues}`.
|
|
240
|
-
- `loop` (`while:` + `max_iterations:`) with `break` (+ `condition:`) — the
|
|
241
|
-
review→revise cycle.
|
|
242
|
-
|
|
243
|
-
The engine now implements the FULL dialect the `aw-spec-*` conversions need on
|
|
244
|
-
top of these demo actions: `execute_script`, `verify_context`,
|
|
245
|
-
`load_standards` (sticky system prefix), `agent_author` (interpreter-owned
|
|
246
|
-
`output_target`, read-only generation), `agent_query` (generic structured
|
|
247
|
-
JSON), `ask`/`user_select` (HITL via checkpoint), `dispatch_hooks`, `include`
|
|
248
|
-
(shared modules), foreach loops (`over:`/`as:`), `inputs:`/`--input`, and
|
|
249
|
-
`--validate`. See `.aw-spec/ORCH-DIALECT.md` for the complete reference;
|
|
250
|
-
shared per-skill workflows live in `workflows/`, shared modules in `modules/`,
|
|
251
|
-
and each root's parametric `/aw-spec-orch <skill> [strategy] [input…]`
|
|
252
|
-
launcher runs them.
|
|
253
|
-
|
|
254
|
-
## How this differed from `run-skill.py` (historical — that tier is retired)
|
|
255
|
-
|
|
256
|
-
| | `run-skill.py` (retired tier) | `orchestrator.py` (ships) |
|
|
257
|
-
|---|---|---|
|
|
258
|
-
| Context handed over | file **paths** (agent/checkpoint) | fully **assembled content** |
|
|
259
|
-
| Where generation runs | inside the caller's conversation | a **fresh**, profile-driven process — or the caller, via `--checkpoint` |
|
|
260
|
-
| Caller's context leaks in | yes (agent/checkpoint mode) | **no** with a profile; yes with `--checkpoint` (by design) |
|
|
261
|
-
| Multi-agent | per-agent launchers | per-agent launchers **+ transport profiles** |
|
|
262
|
-
| Deterministic scripts/gates/hooks | rich (scaffolding, domain gate, …) | ported (`execute_script`, `verify_context`, `dispatch_hooks`, `include`, HITL — see `ORCH-DIALECT.md`) |
|
|
263
|
-
|
|
264
|
-
That intended path — fold this mechanism back into `run-skill.py` — is now moot:
|
|
265
|
-
the declarative tier was retired instead, and this engine won. What remains of
|
|
266
|
-
`run-skill.py` is its YAML loader, which `orchestrator.py` imports (see the note
|
|
267
|
-
at the top of this file).
|
|
268
|
-
|
|
269
|
-
## Not yet (deliberately)
|
|
270
|
-
|
|
271
|
-
- Structured output parsed from a trailing JSON fence (one retry on fresh
|
|
272
|
-
strategies), not enforced via a schema.
|
|
273
|
-
- Gemini isolation is best-effort (no `--bare` equivalent); a `GEMINI.md` in the
|
|
274
|
-
working directory would still load.
|
|
275
|
-
- No provider-side prompt-cache warming; `load_standards` keeps the system
|
|
276
|
-
prefix byte-stable across steps so a provider cache CAN hit, but nothing
|
|
277
|
-
primes it.
|
|
278
|
-
- No session context ledger for the `agent` strategy (run-skill's
|
|
279
|
-
cross-command dedup); fresh strategies don't need one.
|
|
280
|
-
|
|
281
|
-
(The deterministic dispatcher — scripts, gates, hooks, domain-select, includes,
|
|
282
|
-
HITL — IS now ported; see `.aw-spec/ORCH-DIALECT.md`.)
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
# spawn (Strategy 3) — demo skill
|
|
286
|
-
python3 .aw-spec/orchestrator/orchestrator.py .aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml \
|
|
287
|
-
--strategy spawn --agent-profile .claude/agent.json --isolation bare --json
|
|
288
|
-
|
|
289
|
-
# sdk (Strategy 1) — demo skill
|
|
290
|
-
python3 .aw-spec/orchestrator/orchestrator.py .aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml \
|
|
291
|
-
--strategy sdk --agent-profile .claude/agent.json --model opus --json
|
|
292
|
-
|
|
293
|
-
# sdk-apply (Strategy 2) — demo skill, then follow the suspend/resume loop
|
|
294
|
-
python3 .aw-spec/orchestrator/orchestrator.py .aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml \
|
|
295
|
-
--strategy sdk-apply --agent-profile .claude/agent.json \
|
|
296
|
-
--checkpoint .aw-spec/orchestrator/.demo-out/demo.state.json --json
|
|
297
|
-
|
|
298
|
-
# agent (Strategy 4) — demo skill, then follow the suspend/resume loop
|
|
299
|
-
python3 .aw-spec/orchestrator/orchestrator.py .aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml \
|
|
300
|
-
--strategy agent --checkpoint .aw-spec/orchestrator/.demo-out/demo.state.json --json
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"""claude-agent-sdk adapter — a shared SDK adapter, loaded by the
|
|
2
|
-
aw-orchestrator engine when an agent profile's `sdk.adapter` points here
|
|
3
|
-
(both .claude/agent.json and .kilocode/agent.json do). Adapters live in this
|
|
4
|
-
library keyed by SDK, not by agent: everything claude-agent-sdk-specific is
|
|
5
|
-
HERE, the engine ships no SDK code of its own, and each profile declares
|
|
6
|
-
which adapter drives its SDK.
|
|
7
|
-
|
|
8
|
-
Contract (see orchestrator.py `_run_sdk`):
|
|
9
|
-
generate(request) -> str # the model's final reply text
|
|
10
|
-
request keys:
|
|
11
|
-
system interpreter-assembled system block (standards + rules)
|
|
12
|
-
user interpreter-assembled user block (context + task)
|
|
13
|
-
tools comma-separated tool allowlist for the fresh session
|
|
14
|
-
permission_mode neutral mode: readonly | acceptEdits |
|
|
15
|
-
bypassPermissions | default
|
|
16
|
-
model model name or None
|
|
17
|
-
sdk the profile's full sdk block (for adapter options)
|
|
18
|
-
generate may be sync or async — the engine handles both.
|
|
19
|
-
"""
|
|
20
|
-
import os
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def _dotenv_get(name):
|
|
24
|
-
"""Look up one key in ./.env then ~/.env (workspace wins); None if absent."""
|
|
25
|
-
for env_path in (os.path.join(os.getcwd(), ".env"), os.path.expanduser("~/.env")):
|
|
26
|
-
if not os.path.exists(env_path):
|
|
27
|
-
continue
|
|
28
|
-
with open(env_path, "r", encoding="utf-8") as fh:
|
|
29
|
-
for line in fh:
|
|
30
|
-
line = line.strip()
|
|
31
|
-
if line and not line.startswith("#") and "=" in line:
|
|
32
|
-
k, v = line.split("=", 1)
|
|
33
|
-
if k.strip() == name:
|
|
34
|
-
return v.strip().strip("'\"")
|
|
35
|
-
return None
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# the SDK authenticates via ANTHROPIC_API_KEY (unless the claude CLI login is
|
|
39
|
-
# available); a value exported in the shell always wins — the .env lookup only
|
|
40
|
-
# fills the gap when nothing is exported
|
|
41
|
-
_key = _dotenv_get("ANTHROPIC_API_KEY")
|
|
42
|
-
if _key:
|
|
43
|
-
os.environ.setdefault("ANTHROPIC_API_KEY", _key)
|
|
44
|
-
|
|
45
|
-
from claude_agent_sdk import ClaudeAgentOptions, query
|
|
46
|
-
|
|
47
|
-
# neutral permission modes → SDK modes ('readonly' is the workflow's notion,
|
|
48
|
-
# not an SDK mode — read-only is enforced by the tools allowlist)
|
|
49
|
-
_PERMISSION_MAP = {"acceptEdits": "acceptEdits",
|
|
50
|
-
"bypassPermissions": "bypassPermissions",
|
|
51
|
-
"default": "default", "readonly": "default"}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
async def generate(request):
|
|
55
|
-
kwargs = dict(
|
|
56
|
-
system_prompt=request["system"],
|
|
57
|
-
allowed_tools=[t.strip() for t in (request.get("tools") or "").split(",")
|
|
58
|
-
if t.strip()],
|
|
59
|
-
permission_mode=_PERMISSION_MAP.get(request["permission_mode"], "default"),
|
|
60
|
-
setting_sources=[], # isolation: no CLAUDE.md / settings / hooks
|
|
61
|
-
)
|
|
62
|
-
if request.get("model"):
|
|
63
|
-
kwargs["model"] = request["model"]
|
|
64
|
-
options = ClaudeAgentOptions(**kwargs)
|
|
65
|
-
raw, texts = "", []
|
|
66
|
-
async for msg in query(prompt=request["user"], options=options):
|
|
67
|
-
r = getattr(msg, "result", None)
|
|
68
|
-
if isinstance(r, str) and r:
|
|
69
|
-
raw = r # ResultMessage: the final reply text
|
|
70
|
-
for blk in getattr(msg, "content", None) or []:
|
|
71
|
-
t = getattr(blk, "text", None)
|
|
72
|
-
if t:
|
|
73
|
-
texts.append(t)
|
|
74
|
-
return raw or "\n".join(texts)
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"""google-antigravity adapter — a shared SDK adapter, loaded by the
|
|
2
|
-
aw-orchestrator engine when an agent profile's `sdk.adapter` points here
|
|
3
|
-
(.agents/agent.json does). Adapters live in this library keyed by SDK, not
|
|
4
|
-
by agent: everything google-antigravity-specific is HERE, the engine ships
|
|
5
|
-
no SDK code of its own, and each profile declares which adapter drives its
|
|
6
|
-
SDK.
|
|
7
|
-
|
|
8
|
-
Contract (see orchestrator.py `_run_sdk`):
|
|
9
|
-
generate(request) -> str # the model's final reply text
|
|
10
|
-
request keys:
|
|
11
|
-
system interpreter-assembled system block (standards + rules)
|
|
12
|
-
user interpreter-assembled user block (context + task)
|
|
13
|
-
tools the workflow's neutral tools list (informational here;
|
|
14
|
-
Antigravity governs capability via policies instead)
|
|
15
|
-
permission_mode neutral mode: readonly | acceptEdits |
|
|
16
|
-
bypassPermissions | default
|
|
17
|
-
model model name or None
|
|
18
|
-
sdk the profile's full sdk block (for adapter options)
|
|
19
|
-
generate may be sync or async — the engine handles both.
|
|
20
|
-
"""
|
|
21
|
-
import os
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def _dotenv_get(name):
|
|
25
|
-
"""Look up one key in ./.env then ~/.env (workspace wins); None if absent."""
|
|
26
|
-
for env_path in (os.path.join(os.getcwd(), ".env"), os.path.expanduser("~/.env")):
|
|
27
|
-
if not os.path.exists(env_path):
|
|
28
|
-
continue
|
|
29
|
-
with open(env_path, "r", encoding="utf-8") as fh:
|
|
30
|
-
for line in fh:
|
|
31
|
-
line = line.strip()
|
|
32
|
-
if line and not line.startswith("#") and "=" in line:
|
|
33
|
-
k, v = line.split("=", 1)
|
|
34
|
-
if k.strip() == name:
|
|
35
|
-
return v.strip().strip("'\"")
|
|
36
|
-
return None
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
# the SDK authenticates via GEMINI_API_KEY; a value exported in the shell
|
|
40
|
-
# always wins — the .env lookup only fills the gap when nothing is exported
|
|
41
|
-
_key = _dotenv_get("GEMINI_API_KEY")
|
|
42
|
-
if _key:
|
|
43
|
-
os.environ.setdefault("GEMINI_API_KEY", _key)
|
|
44
|
-
|
|
45
|
-
from google.antigravity import Agent, LocalAgentConfig
|
|
46
|
-
from google.antigravity.hooks import policy
|
|
47
|
-
|
|
48
|
-
# tools an isolated reviewer may use when the workflow asks for readonly
|
|
49
|
-
_READONLY_TOOLS = ("view_file", "list_directory", "search_directory",
|
|
50
|
-
"find_file", "finish", "ask_question")
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
def _policies(permission_mode):
|
|
54
|
-
"""Neutral permission modes → Antigravity policy chains."""
|
|
55
|
-
if permission_mode == "readonly":
|
|
56
|
-
return [policy.deny_all()] + [policy.allow(t) for t in _READONLY_TOOLS]
|
|
57
|
-
if permission_mode == "bypassPermissions":
|
|
58
|
-
return [policy.allow_all()]
|
|
59
|
-
# acceptEdits / default: edits proceed, shell commands need confirmation
|
|
60
|
-
return [policy.confirm_run_command()]
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
async def generate(request):
|
|
64
|
-
config = LocalAgentConfig(
|
|
65
|
-
system_instructions=request["system"],
|
|
66
|
-
policies=_policies(request["permission_mode"]),
|
|
67
|
-
# a fresh SDK session has no workspace by default; grant the project
|
|
68
|
-
# root so the isolated generation can read/write the files it decides
|
|
69
|
-
workspaces=[os.getcwd()],
|
|
70
|
-
model=request.get("model") or None,
|
|
71
|
-
)
|
|
72
|
-
async with Agent(config=config) as agent:
|
|
73
|
-
response = await agent.chat(request["user"])
|
|
74
|
-
return await response.text()
|