@llm-dev-ops/agentics-cli 1.4.6 → 1.4.8
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/adapters/base-adapter.d.ts +117 -0
- package/dist/adapters/base-adapter.d.ts.map +1 -1
- package/dist/adapters/base-adapter.js +143 -0
- package/dist/adapters/base-adapter.js.map +1 -1
- package/dist/auth/identity-resolver.d.ts +21 -0
- package/dist/auth/identity-resolver.d.ts.map +1 -0
- package/dist/auth/identity-resolver.js +68 -0
- package/dist/auth/identity-resolver.js.map +1 -0
- package/dist/auth/index.d.ts +2 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +2 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/role-permissions.d.ts +12 -0
- package/dist/auth/role-permissions.d.ts.map +1 -0
- package/dist/auth/role-permissions.js +43 -0
- package/dist/auth/role-permissions.js.map +1 -0
- package/dist/cli/index.js +139 -134
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/erp.d.ts.map +1 -1
- package/dist/commands/erp.js +62 -0
- package/dist/commands/erp.js.map +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +25 -0
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logout.d.ts.map +1 -1
- package/dist/commands/logout.js +4 -1
- package/dist/commands/logout.js.map +1 -1
- package/dist/commands/plan.d.ts.map +1 -1
- package/dist/commands/plan.js +6 -5
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/simulate.d.ts.map +1 -1
- package/dist/commands/simulate.js +57 -1
- package/dist/commands/simulate.js.map +1 -1
- package/dist/commands/whoami.d.ts +4 -0
- package/dist/commands/whoami.d.ts.map +1 -1
- package/dist/commands/whoami.js +22 -5
- package/dist/commands/whoami.js.map +1 -1
- package/dist/contracts/adr-002-operational-enforcement.d.ts +684 -0
- package/dist/contracts/adr-002-operational-enforcement.d.ts.map +1 -0
- package/dist/contracts/adr-002-operational-enforcement.js +671 -0
- package/dist/contracts/adr-002-operational-enforcement.js.map +1 -0
- package/dist/contracts/adr-003-governance-architecture.d.ts +766 -0
- package/dist/contracts/adr-003-governance-architecture.d.ts.map +1 -0
- package/dist/contracts/adr-003-governance-architecture.js +773 -0
- package/dist/contracts/adr-003-governance-architecture.js.map +1 -0
- package/dist/contracts/adr-004-enterprise-integration-memory.d.ts +1150 -0
- package/dist/contracts/adr-004-enterprise-integration-memory.d.ts.map +1 -0
- package/dist/contracts/adr-004-enterprise-integration-memory.js +1158 -0
- package/dist/contracts/adr-004-enterprise-integration-memory.js.map +1 -0
- package/dist/contracts/adr-005-system-coherence-drift-self-governance.d.ts +1393 -0
- package/dist/contracts/adr-005-system-coherence-drift-self-governance.d.ts.map +1 -0
- package/dist/contracts/adr-005-system-coherence-drift-self-governance.js +1371 -0
- package/dist/contracts/adr-005-system-coherence-drift-self-governance.js.map +1 -0
- package/dist/contracts/adr-006-claude-code-synthesis-runner.d.ts +196 -0
- package/dist/contracts/adr-006-claude-code-synthesis-runner.d.ts.map +1 -0
- package/dist/contracts/adr-006-claude-code-synthesis-runner.js +177 -0
- package/dist/contracts/adr-006-claude-code-synthesis-runner.js.map +1 -0
- package/dist/contracts/adr-007-subcommand-synthesis-router.d.ts +273 -0
- package/dist/contracts/adr-007-subcommand-synthesis-router.d.ts.map +1 -0
- package/dist/contracts/adr-007-subcommand-synthesis-router.js +226 -0
- package/dist/contracts/adr-007-subcommand-synthesis-router.js.map +1 -0
- package/dist/contracts/adr-008-synthesis-artifact-persistence.d.ts +323 -0
- package/dist/contracts/adr-008-synthesis-artifact-persistence.d.ts.map +1 -0
- package/dist/contracts/adr-008-synthesis-artifact-persistence.js +184 -0
- package/dist/contracts/adr-008-synthesis-artifact-persistence.js.map +1 -0
- package/dist/contracts/adr-command-semantics.d.ts +150 -0
- package/dist/contracts/adr-command-semantics.d.ts.map +1 -0
- package/dist/contracts/adr-command-semantics.js +984 -0
- package/dist/contracts/adr-command-semantics.js.map +1 -0
- package/dist/contracts/index.d.ts +5 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +16 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/enterprise/index.d.ts +16 -0
- package/dist/enterprise/index.d.ts.map +1 -0
- package/dist/enterprise/index.js +17 -0
- package/dist/enterprise/index.js.map +1 -0
- package/dist/enterprise/integration-registry.d.ts +73 -0
- package/dist/enterprise/integration-registry.d.ts.map +1 -0
- package/dist/enterprise/integration-registry.js +252 -0
- package/dist/enterprise/integration-registry.js.map +1 -0
- package/dist/enterprise/lineage.d.ts +73 -0
- package/dist/enterprise/lineage.d.ts.map +1 -0
- package/dist/enterprise/lineage.js +218 -0
- package/dist/enterprise/lineage.js.map +1 -0
- package/dist/gates/argument-guard.d.ts +39 -0
- package/dist/gates/argument-guard.d.ts.map +1 -0
- package/dist/gates/argument-guard.js +180 -0
- package/dist/gates/argument-guard.js.map +1 -0
- package/dist/gates/index.d.ts +5 -0
- package/dist/gates/index.d.ts.map +1 -1
- package/dist/gates/index.js +7 -0
- package/dist/gates/index.js.map +1 -1
- package/dist/gates/lineage-gate.d.ts +55 -0
- package/dist/gates/lineage-gate.d.ts.map +1 -0
- package/dist/gates/lineage-gate.js +127 -0
- package/dist/gates/lineage-gate.js.map +1 -0
- package/dist/mcp/mcp-server.d.ts +35 -0
- package/dist/mcp/mcp-server.d.ts.map +1 -0
- package/dist/mcp/mcp-server.js +692 -0
- package/dist/mcp/mcp-server.js.map +1 -0
- package/dist/modules/help-renderer.d.ts +25 -0
- package/dist/modules/help-renderer.d.ts.map +1 -0
- package/dist/modules/help-renderer.js +163 -0
- package/dist/modules/help-renderer.js.map +1 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/index.js +1 -0
- package/dist/modules/index.js.map +1 -1
- package/dist/runtime/claude-code-runner.d.ts +93 -0
- package/dist/runtime/claude-code-runner.d.ts.map +1 -0
- package/dist/runtime/claude-code-runner.js +588 -0
- package/dist/runtime/claude-code-runner.js.map +1 -0
- package/dist/runtime/index.d.ts +5 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +5 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +16 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/routes/identity.d.ts +9 -0
- package/dist/server/routes/identity.d.ts.map +1 -0
- package/dist/server/routes/identity.js +100 -0
- package/dist/server/routes/identity.js.map +1 -0
- package/dist/server/routes/index.d.ts +2 -0
- package/dist/server/routes/index.d.ts.map +1 -1
- package/dist/server/routes/index.js +2 -0
- package/dist/server/routes/index.js.map +1 -1
- package/dist/server/routes/lineage.d.ts +15 -0
- package/dist/server/routes/lineage.d.ts.map +1 -0
- package/dist/server/routes/lineage.js +128 -0
- package/dist/server/routes/lineage.js.map +1 -0
- package/dist/synthesis/artifact-writer.d.ts +62 -0
- package/dist/synthesis/artifact-writer.d.ts.map +1 -0
- package/dist/synthesis/artifact-writer.js +603 -0
- package/dist/synthesis/artifact-writer.js.map +1 -0
- package/dist/synthesis/index.d.ts +7 -0
- package/dist/synthesis/index.d.ts.map +1 -0
- package/dist/synthesis/index.js +7 -0
- package/dist/synthesis/index.js.map +1 -0
- package/dist/synthesis/prompts/index.d.ts +50 -0
- package/dist/synthesis/prompts/index.d.ts.map +1 -0
- package/dist/synthesis/prompts/index.js +502 -0
- package/dist/synthesis/prompts/index.js.map +1 -0
- package/dist/synthesis/router.d.ts +70 -0
- package/dist/synthesis/router.d.ts.map +1 -0
- package/dist/synthesis/router.js +346 -0
- package/dist/synthesis/router.js.map +1 -0
- package/dist/types/index.d.ts +132 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/identity-store.d.ts +31 -0
- package/dist/utils/identity-store.d.ts.map +1 -0
- package/dist/utils/identity-store.js +97 -0
- package/dist/utils/identity-store.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR-008: Synthesis Artifact Persistence & Platform Handoff
|
|
3
|
+
*
|
|
4
|
+
* STATUS: Proposed
|
|
5
|
+
* DATE: 2026-02-07
|
|
6
|
+
* AUTHORS: Platform Engineering
|
|
7
|
+
* DEPENDS-ON: ADR-006 (Runner), ADR-007 (Router), ADR-004 (Enterprise Integration)
|
|
8
|
+
*
|
|
9
|
+
* ============================================================================
|
|
10
|
+
* CONTEXT
|
|
11
|
+
* ============================================================================
|
|
12
|
+
*
|
|
13
|
+
* After Claude Code synthesis produces a contract-validated JSON object
|
|
14
|
+
* (ADR-006 + ADR-007), two things must happen:
|
|
15
|
+
*
|
|
16
|
+
* 1. The result must be handed off to the platform (agentics-dev-platform)
|
|
17
|
+
* for execution, persistence, and governance tracking.
|
|
18
|
+
*
|
|
19
|
+
* 2. Local artifacts must be written for `agentics inspect` to read,
|
|
20
|
+
* providing an offline audit trail.
|
|
21
|
+
*
|
|
22
|
+
* Currently, artifacts are stored by the Ruvector-backed platform adapters
|
|
23
|
+
* (src/adapters/base-adapter.ts:643-1089) and local CRUD files live in
|
|
24
|
+
* .agentics/{command}s/ (e.g., .agentics/simulations/). The executive
|
|
25
|
+
* synthesis tool writes a decision-summary.md but nothing else.
|
|
26
|
+
*
|
|
27
|
+
* This ADR defines the persistence contract for synthesis runs.
|
|
28
|
+
*
|
|
29
|
+
* ============================================================================
|
|
30
|
+
* DECISION
|
|
31
|
+
* ============================================================================
|
|
32
|
+
*
|
|
33
|
+
* 1. A new module `src/synthesis/artifact-writer.ts` handles local persistence.
|
|
34
|
+
*
|
|
35
|
+
* 2. After every successful synthesis + platform handoff, the following
|
|
36
|
+
* artifacts are written:
|
|
37
|
+
*
|
|
38
|
+
* ```
|
|
39
|
+
* ~/.agentics/runs/<run-id>/
|
|
40
|
+
* ├── manifest.json # Run metadata (IDs, timing, command, schema)
|
|
41
|
+
* ├── claude_output.json # Raw Claude Code output (validated JSON)
|
|
42
|
+
* ├── platform_receipt.json # Platform API response (IDs, status)
|
|
43
|
+
* └── prompt.txt # The exact prompt sent to Claude Code
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* 3. The manifest.json structure:
|
|
47
|
+
* ```typescript
|
|
48
|
+
* interface RunManifest {
|
|
49
|
+
* run_id: string;
|
|
50
|
+
* plan_id?: string; // If a plan was created
|
|
51
|
+
* deploy_id?: string; // If a deployment was created
|
|
52
|
+
* command: string;
|
|
53
|
+
* subcommand: string;
|
|
54
|
+
* synthesis_class: SynthesisClass;
|
|
55
|
+
* contract_schema: string;
|
|
56
|
+
* model: string;
|
|
57
|
+
* duration_ms: number;
|
|
58
|
+
* created_at: string;
|
|
59
|
+
* seed: number;
|
|
60
|
+
* user_id: string;
|
|
61
|
+
* org_id: string;
|
|
62
|
+
* trace_id: string;
|
|
63
|
+
* artifacts: string[]; // Relative paths to sibling files
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* 4. Platform handoff flow:
|
|
68
|
+
* a. Synthesis router returns SynthesisResult<T>
|
|
69
|
+
* b. The command handler passes the data to the existing platform adapter
|
|
70
|
+
* (PlannerAdapter, RunnerAdapter, etc.)
|
|
71
|
+
* c. The platform responds with IDs and status
|
|
72
|
+
* d. Artifact writer persists all three files atomically
|
|
73
|
+
* e. IDs are printed to stdout
|
|
74
|
+
*
|
|
75
|
+
* 5. The artifact writer is idempotent: writing the same run-id twice
|
|
76
|
+
* overwrites the previous artifacts (latest wins).
|
|
77
|
+
*
|
|
78
|
+
* 6. `agentics inspect run <run-id>` will be enhanced to read from
|
|
79
|
+
* `~/.agentics/runs/<run-id>/manifest.json` when the run is not
|
|
80
|
+
* found in the platform (offline inspection).
|
|
81
|
+
*
|
|
82
|
+
* ============================================================================
|
|
83
|
+
* ID GENERATION
|
|
84
|
+
* ============================================================================
|
|
85
|
+
*
|
|
86
|
+
* Every synthesis run produces:
|
|
87
|
+
* - run_id: `run-{uuid}` — unique per invocation
|
|
88
|
+
* - plan_id: `plan-{uuid}` — if the command creates a plan
|
|
89
|
+
* - deploy_id: `deploy-{uuid}` — if the command creates a deployment
|
|
90
|
+
*
|
|
91
|
+
* These are generated BEFORE calling Claude Code (so they can be embedded
|
|
92
|
+
* in the prompt for determinism) and then used as the canonical identifiers
|
|
93
|
+
* throughout the pipeline.
|
|
94
|
+
*
|
|
95
|
+
* ============================================================================
|
|
96
|
+
* STORAGE PATH
|
|
97
|
+
* ============================================================================
|
|
98
|
+
*
|
|
99
|
+
* Base directory: `~/.agentics/runs/`
|
|
100
|
+
* Override: `AGENTICS_RUNS_DIR` environment variable
|
|
101
|
+
*
|
|
102
|
+
* This is separate from the existing `.agentics/simulations/` and
|
|
103
|
+
* `.agentics/plans/` directories, which store CRUD records. The `runs/`
|
|
104
|
+
* directory stores synthesis-specific artifacts.
|
|
105
|
+
*
|
|
106
|
+
* ============================================================================
|
|
107
|
+
* FILE PERMISSIONS
|
|
108
|
+
* ============================================================================
|
|
109
|
+
*
|
|
110
|
+
* All files written with mode 0o600 (owner read/write only), matching
|
|
111
|
+
* the existing credentials.ts pattern (src/utils/credentials.ts:38-39).
|
|
112
|
+
*
|
|
113
|
+
* ============================================================================
|
|
114
|
+
* PLATFORM RECEIPT
|
|
115
|
+
* ============================================================================
|
|
116
|
+
*
|
|
117
|
+
* The platform_receipt.json captures the downstream response:
|
|
118
|
+
*
|
|
119
|
+
* ```typescript
|
|
120
|
+
* interface PlatformReceipt {
|
|
121
|
+
* success: boolean;
|
|
122
|
+
* platform_id: string; // ID assigned by platform
|
|
123
|
+
* platform_type: string; // e.g., "PlanReference", "SimulationReference"
|
|
124
|
+
* status: string; // e.g., "created", "queued", "completed"
|
|
125
|
+
* timestamp: string;
|
|
126
|
+
* trace_id: string;
|
|
127
|
+
* error?: string; // If platform call failed
|
|
128
|
+
* }
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* ============================================================================
|
|
132
|
+
* WIRING INTO CLI DISPATCH
|
|
133
|
+
* ============================================================================
|
|
134
|
+
*
|
|
135
|
+
* The integration modifies the command handlers in src/cli/index.ts.
|
|
136
|
+
* For each decision-grade subcommand:
|
|
137
|
+
*
|
|
138
|
+
* ```
|
|
139
|
+
* BEFORE (current):
|
|
140
|
+
* parse args → validate gates → call command executor → print output
|
|
141
|
+
* → fire-and-forget synthesis
|
|
142
|
+
*
|
|
143
|
+
* AFTER (ADR-008):
|
|
144
|
+
* parse args → validate gates → synthesis router (Claude Code)
|
|
145
|
+
* → call command executor (with synthesis data)
|
|
146
|
+
* → persist artifacts
|
|
147
|
+
* → print IDs to stdout
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* The key change: synthesis happens BEFORE the platform call, not after.
|
|
151
|
+
* Claude Code produces the structured plan/intent/config, which is then
|
|
152
|
+
* sent to the platform for execution.
|
|
153
|
+
*
|
|
154
|
+
* ============================================================================
|
|
155
|
+
* ALTERNATIVES CONSIDERED
|
|
156
|
+
* ============================================================================
|
|
157
|
+
*
|
|
158
|
+
* A. Store artifacts in the platform only (no local files):
|
|
159
|
+
* Rejected — offline inspection is a hard requirement. Users must be
|
|
160
|
+
* able to audit synthesis results without platform connectivity.
|
|
161
|
+
*
|
|
162
|
+
* B. Store artifacts in the existing .agentics/{command}s/ directories:
|
|
163
|
+
* Rejected — synthesis artifacts are cross-cutting (a simulation run
|
|
164
|
+
* may reference a plan). A dedicated `runs/` directory with run-id
|
|
165
|
+
* as the organizing key is cleaner.
|
|
166
|
+
*
|
|
167
|
+
* C. Use a SQLite database for local storage:
|
|
168
|
+
* Rejected — JSON files are simpler, greppable, and don't require
|
|
169
|
+
* additional dependencies. The volume is low (one run per command).
|
|
170
|
+
*
|
|
171
|
+
* ============================================================================
|
|
172
|
+
* CONSEQUENCES
|
|
173
|
+
* ============================================================================
|
|
174
|
+
*
|
|
175
|
+
* - Every synthesis run is fully auditable locally
|
|
176
|
+
* - The prompt sent to Claude Code is preserved for debugging
|
|
177
|
+
* - Platform receipts provide end-to-end traceability
|
|
178
|
+
* - `agentics inspect run <run-id>` works offline
|
|
179
|
+
* - The runs/ directory grows linearly; no automatic cleanup (user manages)
|
|
180
|
+
* - New decision-grade subcommands automatically get artifact persistence
|
|
181
|
+
* if they follow the synthesis router integration pattern
|
|
182
|
+
*/
|
|
183
|
+
export {};
|
|
184
|
+
//# sourceMappingURL=adr-008-synthesis-artifact-persistence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adr-008-synthesis-artifact-persistence.js","sourceRoot":"","sources":["../../src/contracts/adr-008-synthesis-artifact-persistence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqLG"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR-001: Command Argument Semantics & Synthesis Governance
|
|
3
|
+
*
|
|
4
|
+
* STATUS: Accepted
|
|
5
|
+
* DATE: 2026-01-28
|
|
6
|
+
* AUTHORS: Platform Engineering
|
|
7
|
+
*
|
|
8
|
+
* ============================================================================
|
|
9
|
+
* CONTEXT
|
|
10
|
+
* ============================================================================
|
|
11
|
+
*
|
|
12
|
+
* The Agentics CLI is an enterprise orchestration tool, not a chat interface.
|
|
13
|
+
* Natural language seeds synthesis; IDs resolve persisted manifests.
|
|
14
|
+
* These are categorically different argument types with non-overlapping semantics.
|
|
15
|
+
*
|
|
16
|
+
* Without formal governance:
|
|
17
|
+
* - Users accidentally pass descriptions where IDs are required
|
|
18
|
+
* - Synthesis triggers on read-only or irreversible commands
|
|
19
|
+
* - Help output is ambiguous about what each command expects
|
|
20
|
+
* - Tests cannot be mechanically derived from command specifications
|
|
21
|
+
*
|
|
22
|
+
* ============================================================================
|
|
23
|
+
* DECISION
|
|
24
|
+
* ============================================================================
|
|
25
|
+
*
|
|
26
|
+
* 1. All CLI arguments are formally classified into three types:
|
|
27
|
+
* ID, NATURAL_LANGUAGE, and SELECTOR.
|
|
28
|
+
*
|
|
29
|
+
* 2. Each command+subcommand declares its exact argument contract.
|
|
30
|
+
*
|
|
31
|
+
* 3. A synthesis governance matrix classifies every command as:
|
|
32
|
+
* SYNTHESIS_REQUIRED, SYNTHESIS_FORBIDDEN, or COMMITMENT_GRADE.
|
|
33
|
+
*
|
|
34
|
+
* 4. Runtime validation middleware enforces these contracts before dispatch.
|
|
35
|
+
*
|
|
36
|
+
* 5. Help output, tests, and error messages are all derived from this ADR.
|
|
37
|
+
*
|
|
38
|
+
* ============================================================================
|
|
39
|
+
* ALTERNATIVES CONSIDERED
|
|
40
|
+
* ============================================================================
|
|
41
|
+
*
|
|
42
|
+
* A. Loose validation with runtime inference:
|
|
43
|
+
* Rejected — violates determinism and enterprise-grade predictability.
|
|
44
|
+
*
|
|
45
|
+
* B. Per-command ad-hoc validation:
|
|
46
|
+
* Rejected — leads to inconsistency, untestable, help drift.
|
|
47
|
+
*
|
|
48
|
+
* C. External YAML/JSON config:
|
|
49
|
+
* Rejected — TypeScript provides compile-time safety and co-location
|
|
50
|
+
* with the code it governs.
|
|
51
|
+
*
|
|
52
|
+
* ============================================================================
|
|
53
|
+
* CONSEQUENCES
|
|
54
|
+
* ============================================================================
|
|
55
|
+
*
|
|
56
|
+
* - Every command has one unambiguous semantic meaning
|
|
57
|
+
* - Users cannot accidentally misuse IDs vs natural language
|
|
58
|
+
* - Synthesis is impossible where unsafe
|
|
59
|
+
* - Validation, tests, and help all derive from this file
|
|
60
|
+
* - New commands must register here before they compile
|
|
61
|
+
*
|
|
62
|
+
* ============================================================================
|
|
63
|
+
* CLAUDE-CODE PARITY STATEMENT
|
|
64
|
+
* ============================================================================
|
|
65
|
+
*
|
|
66
|
+
* The Agentics CLI mirrors claude-flow + claude-code behavior:
|
|
67
|
+
* - Deterministic: same inputs always produce same dispatch path
|
|
68
|
+
* - Explicit: no inference, no guessing, no auto-correction
|
|
69
|
+
* - Enterprise-grade: fail fast with instructional errors
|
|
70
|
+
* - Composable: commands are pipeline stages, not chat turns
|
|
71
|
+
*/
|
|
72
|
+
/**
|
|
73
|
+
* The three argument classes. No other classification exists.
|
|
74
|
+
*/
|
|
75
|
+
export type ArgumentType = 'ID' | 'NATURAL_LANGUAGE' | 'SELECTOR';
|
|
76
|
+
/**
|
|
77
|
+
* Synthesis governance classification for each command.
|
|
78
|
+
*/
|
|
79
|
+
export type SynthesisClass = 'SYNTHESIS_REQUIRED' | 'SYNTHESIS_FORBIDDEN' | 'COMMITMENT_GRADE';
|
|
80
|
+
/**
|
|
81
|
+
* Argument specification for a single positional argument.
|
|
82
|
+
*/
|
|
83
|
+
export interface ArgumentSpec {
|
|
84
|
+
/** Name used in help output */
|
|
85
|
+
readonly name: string;
|
|
86
|
+
/** Argument type classification */
|
|
87
|
+
readonly type: ArgumentType;
|
|
88
|
+
/** Whether this argument must be provided */
|
|
89
|
+
readonly required: boolean;
|
|
90
|
+
/** Human-readable description for help */
|
|
91
|
+
readonly description: string;
|
|
92
|
+
/** Example value for help output */
|
|
93
|
+
readonly example: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Complete command specification — the atomic unit of the ADR.
|
|
97
|
+
*/
|
|
98
|
+
export interface CommandSpec {
|
|
99
|
+
/** Full command path, e.g. "simulate create" */
|
|
100
|
+
readonly command: string;
|
|
101
|
+
/** Primary command name */
|
|
102
|
+
readonly primary: string;
|
|
103
|
+
/** Subcommand name, if any */
|
|
104
|
+
readonly subcommand?: string;
|
|
105
|
+
/** One-line description */
|
|
106
|
+
readonly description: string;
|
|
107
|
+
/** Synthesis governance class */
|
|
108
|
+
readonly synthesis: SynthesisClass;
|
|
109
|
+
/** Ordered positional arguments */
|
|
110
|
+
readonly args: readonly ArgumentSpec[];
|
|
111
|
+
/** Whether this command is irreversible */
|
|
112
|
+
readonly irreversible: boolean;
|
|
113
|
+
/** Whether this command requires confirmation (--force or interactive) */
|
|
114
|
+
readonly requiresConfirmation: boolean;
|
|
115
|
+
}
|
|
116
|
+
export declare const COMMAND_REGISTRY: readonly CommandSpec[];
|
|
117
|
+
/**
|
|
118
|
+
* ADR schema version. Must be bumped when:
|
|
119
|
+
* - MAJOR: argument contracts change in a breaking way
|
|
120
|
+
* - MINOR: new commands are added
|
|
121
|
+
* - PATCH: help text, examples, or descriptions are corrected
|
|
122
|
+
*/
|
|
123
|
+
export declare const ADR_SCHEMA_VERSION: "1.0.0";
|
|
124
|
+
/**
|
|
125
|
+
* Look up a command specification by primary + subcommand.
|
|
126
|
+
* Returns undefined if not registered (which is itself an error).
|
|
127
|
+
*/
|
|
128
|
+
export declare function lookupCommand(primary: string, subcommand?: string): CommandSpec | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Get all commands for a primary command.
|
|
131
|
+
*/
|
|
132
|
+
export declare function getSubcommands(primary: string): readonly CommandSpec[];
|
|
133
|
+
/**
|
|
134
|
+
* Check if a command allows synthesis.
|
|
135
|
+
*/
|
|
136
|
+
export declare function isSynthesisAllowed(primary: string, subcommand?: string): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Check if a command is commitment-grade (irreversible + requires confirmation).
|
|
139
|
+
*/
|
|
140
|
+
export declare function isCommitmentGrade(primary: string, subcommand?: string): boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Classify a raw string argument into its detected type.
|
|
143
|
+
*/
|
|
144
|
+
export declare function classifyArgument(value: string): ArgumentType;
|
|
145
|
+
/**
|
|
146
|
+
* Validate that a given argument matches its expected type.
|
|
147
|
+
* Returns null if valid, or an error message if invalid.
|
|
148
|
+
*/
|
|
149
|
+
export declare function validateArgument(value: string, expected: ArgumentSpec): string | null;
|
|
150
|
+
//# sourceMappingURL=adr-command-semantics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adr-command-semantics.d.ts","sourceRoot":"","sources":["../../src/contracts/adr-command-semantics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AAMH;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,kBAAkB,GAAG,UAAU,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,oBAAoB,GACpB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,mCAAmC;IACnC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,0CAA0C;IAC1C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,oCAAoC;IACpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,2BAA2B;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,8BAA8B;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,2BAA2B;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,iCAAiC;IACjC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;IACnC,mCAAmC;IACnC,QAAQ,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,CAAC;IACvC,2CAA2C;IAC3C,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;CACxC;AAMD,eAAO,MAAM,gBAAgB,EAAE,SAAS,WAAW,EAi0BzC,CAAC;AAMX;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAG,OAAgB,CAAC;AAMnD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAU3F;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,WAAW,EAAE,CAEtE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAIhF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAI/E;AAUD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CA0B5D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,CAgBrF"}
|