@apexops/cli 0.10.0-next.4 → 0.10.0-next.5

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.
Files changed (30) hide show
  1. package/README.md +40 -0
  2. package/assets/client-projection-metadata/copilot-cli-agent-tools.json +8 -0
  3. package/assets/client-projections/github-copilot-cli/.github/agents/apex-architect.agent.md +9 -8
  4. package/assets/client-projections/github-copilot-cli/.github/agents/apex-planner.agent.md +7 -5
  5. package/assets/client-projections/github-copilot-cli/.github/agents/apex-requirements.agent.md +18 -11
  6. package/assets/client-projections/github-copilot-cli/.github/mcp.json +5 -0
  7. package/assets/client-projections/github-copilot-cli/.github/skills/apex-requirements/SKILL.md +7 -4
  8. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-architect.agent.md +9 -8
  9. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-planner.agent.md +7 -5
  10. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-requirements.agent.md +18 -11
  11. package/assets/client-projections/github-copilot-vscode/.github/agents/apex-reviewer.agent.md +9 -5
  12. package/assets/client-projections/github-copilot-vscode/.github/skills/apex-requirements/SKILL.md +7 -4
  13. package/assets/config/runtime-bundle.v1.json +7 -7
  14. package/assets/customizations/.github/agents/apex-architect.agent.md +9 -8
  15. package/assets/customizations/.github/agents/apex-planner.agent.md +7 -5
  16. package/assets/customizations/.github/agents/apex-requirements.agent.md +18 -11
  17. package/assets/customizations/.github/agents/apex-reviewer.agent.md +9 -5
  18. package/assets/customizations/.github/mcp.json +5 -0
  19. package/assets/customizations/.github/skills/apex-requirements/SKILL.md +7 -4
  20. package/assets/customizations/manifest.json +1 -1
  21. package/assets/manifest.json +50 -50
  22. package/dist/cli.d.ts +1 -0
  23. package/dist/cli.js +42 -2
  24. package/dist/mcp.js +58 -16
  25. package/dist/service.d.ts +41 -1
  26. package/dist/service.js +448 -40
  27. package/dist/state-transfer.js +23 -6
  28. package/dist/version.d.ts +1 -1
  29. package/dist/version.js +1 -1
  30. package/package.json +5 -5
@@ -11,17 +11,22 @@
11
11
  "capabilityStatus",
12
12
  "nextTask",
13
13
  "taskContext",
14
+ "readTaskInput",
14
15
  "recordInput",
15
16
  "projectCreate",
16
17
  "projectList",
17
18
  "projectUse",
18
19
  "projectDelete",
19
20
  "gateDecide",
21
+ "reviewDecide",
20
22
  "stageArtifact",
21
23
  "stageFile",
22
24
  "generateIac",
23
25
  "validateTask",
24
26
  "completeTask",
27
+ "requirementsComplete",
28
+ "architectureComplete",
29
+ "reviewComplete",
25
30
  "planComplete",
26
31
  "preview",
27
32
  "reconcile",
@@ -24,10 +24,13 @@ Use this skill only for an active requirements task.
24
24
  4. Submit that request only through `apex/recordInput`, preserving its request ID, expected journal head, and owner
25
25
  epoch.
26
26
  5. Call `apex/nextTask` again and repeat until it returns a requirements `task`; only then read `apex/taskContext`.
27
- 6. Treat the service-preferences round as a preference boundary. Capture retained, prohibited, and preferred services,
28
- SKU preferences, and environment overrides without selecting architecture, SKUs, or implementation details.
29
- 7. Stage the task-context-defined requirements output, complete the requirements task, and wait for the required review
30
- result before reporting that Gate 1 is ready. Only the kernel opens or evaluates Gate 1.
27
+ 6. Treat service questions in the workload panel as a preference boundary. Present the kernel recommendation, then
28
+ capture retained, prohibited, and preferred services, SKU preferences, and environment overrides without selecting
29
+ architecture, SKUs, or implementation details.
30
+ 7. Submit the task-context-defined output through `apex/requirementsComplete`, invoke the required Reviewer, and handle
31
+ `needs_review` through one native findings panel and `apex/reviewDecide`.
32
+ 8. After a clean or fully dispositioned review, ask for explicit Gate 1 approval. Call `apex/gateDecide` only after the
33
+ user chooses Proceed, then continue to Architecture in the same turn.
31
34
 
32
35
  The kernel catalog and its versioned input contracts are authoritative. Do not choose architecture, SKUs, or
33
36
  implementation details while gathering requirements.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.10.0-next.4",
2
+ "version": "0.10.0-next.5",
3
3
  "bundle": {
4
4
  "id": "apex-managed-workspace",
5
5
  "authority": "npm:@apexops/cli",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 1,
3
3
  "sources": {
4
- "customizations": "0.10.0-next.4",
4
+ "customizations": "0.10.0-next.5",
5
5
  "config": "1.0.0"
6
6
  },
7
7
  "composition": {
@@ -190,7 +190,7 @@
190
190
  "client-projections/github-copilot-cli/.github/skills/apex-terraform-test/references/test-design.md",
191
191
  "client-projections/github-copilot-cli/.github/skills/apex-workflow/SKILL.md"
192
192
  ],
193
- "digest": "f0890a928676c476f4de0e3260b65ab95cf89c34e45c5a8b66ff394ed88fdb09"
193
+ "digest": "87f5d74109a94f0014cb832441c4e02bb5b7c5ce97f7a43f80959e55b96052ec"
194
194
  },
195
195
  {
196
196
  "id": "github-copilot-vscode",
@@ -338,7 +338,7 @@
338
338
  "client-projections/github-copilot-vscode/.github/skills/apex-workflow/SKILL.md",
339
339
  "client-projections/github-copilot-vscode/.vscode/mcp.json"
340
340
  ],
341
- "digest": "2fc2af31e4f004f6ec5803f88c8d440896f960b45bed8af535d8e5b655a44e22"
341
+ "digest": "a6387c778c2f2fddbda8453960f113ec4522bca784a7aeaa0a113fa18e9da7db"
342
342
  }
343
343
  ],
344
344
  "files": [
@@ -378,8 +378,8 @@
378
378
  "path": "tools/registry/copilot-cli-agent-tools.json",
379
379
  "mapping": "copilot-cli-tool-inventory"
380
380
  },
381
- "sha256": "a6278e6ab4784d81f84b3b036a360e517e72844478b1ba74718b18903a268fdc",
382
- "bytes": 3094
381
+ "sha256": "e67b7d9ca1c28956c13e8817c5f8ae2173d2070f4855ff71098690516e40d1fc",
382
+ "bytes": 3310
383
383
  },
384
384
  {
385
385
  "path": "client-projections/github-copilot-cli/.github/agents/apex-architect.agent.md",
@@ -388,13 +388,13 @@
388
388
  "composition": "client-projections",
389
389
  "roleId": "architecture",
390
390
  "sourcePath": ".github/agents/apex-architect.agent.md",
391
- "sourceHash": "0620b04dc8a48db7f5af148044ed8d040079f887add3b16b3c0e9fdcc022cca0",
391
+ "sourceHash": "47e6edf792c88ea633cd3bc66c59fba00a3c13020f8771d3635d5e2cc3414e70",
392
392
  "clientId": "github-copilot-cli",
393
393
  "target": ".github/agents/apex-architect.agent.md",
394
394
  "adapterVersion": "1.1.0"
395
395
  },
396
- "sha256": "3d58237f0006a983daf33bb96049e006d4c1dfd301088d306bc16491b5569c74",
397
- "bytes": 5408
396
+ "sha256": "9c194b0877b6dabcb5a5775c1e719bf851ea194206a183a582200f645b74dfc8",
397
+ "bytes": 5362
398
398
  },
399
399
  {
400
400
  "path": "client-projections/github-copilot-cli/.github/agents/apex-operator.agent.md",
@@ -418,13 +418,13 @@
418
418
  "composition": "client-projections",
419
419
  "roleId": "planning",
420
420
  "sourcePath": ".github/agents/apex-planner.agent.md",
421
- "sourceHash": "9a6bb99cd4784f7afc84f49168933ff8ae0f234386a55ad962382272cb5083ec",
421
+ "sourceHash": "b33471f0ef586ace4847b9eecfd5363c1d8b269dd9eba460022498ff488c509c",
422
422
  "clientId": "github-copilot-cli",
423
423
  "target": ".github/agents/apex-planner.agent.md",
424
424
  "adapterVersion": "1.1.0"
425
425
  },
426
- "sha256": "92a748d52adf590387cd819f565172cd4a023390afb17337a571e6feb784de17",
427
- "bytes": 4724
426
+ "sha256": "e1e7a3790dc13628214ba19d5b28d1ab8a522fff07868e5c962a3ad985b690f5",
427
+ "bytes": 4868
428
428
  },
429
429
  {
430
430
  "path": "client-projections/github-copilot-cli/.github/agents/apex-requirements.agent.md",
@@ -433,13 +433,13 @@
433
433
  "composition": "client-projections",
434
434
  "roleId": "requirements",
435
435
  "sourcePath": ".github/agents/apex-requirements.agent.md",
436
- "sourceHash": "87ac351f363c7b782ebbdeda40f15d6e8a7faabc2f400ffadcb0bca4ce66b2f3",
436
+ "sourceHash": "4bb98532f4c277424689eab261779a33dd0790faf6764a8487848afb5ffb9225",
437
437
  "clientId": "github-copilot-cli",
438
438
  "target": ".github/agents/apex-requirements.agent.md",
439
439
  "adapterVersion": "1.1.0"
440
440
  },
441
- "sha256": "6843fcf9f5ff5f7a764eb9bc8253ab2baa06195ea20f1febcf38f366839639a9",
442
- "bytes": 5432
441
+ "sha256": "6bd816e8b228ca0fd5b46e55949495286316b5cc406d11f0cefd9cd5bf0b3b0d",
442
+ "bytes": 6044
443
443
  },
444
444
  {
445
445
  "path": "client-projections/github-copilot-cli/.github/agents/apex.agent.md",
@@ -773,10 +773,10 @@
773
773
  "target": ".github/mcp.json",
774
774
  "adapterVersion": "1.1.0",
775
775
  "sourcePath": ".github/mcp.json",
776
- "sourceHash": "dda22ba7b91f17796dc5bc723bdcd66a1ba5f9b971bddb080b21d68062d19a8c"
776
+ "sourceHash": "21d86c077f0f304e59433f7b7f5063948f60b41ec961f71d50eccf94c340fea9"
777
777
  },
778
- "sha256": "dda22ba7b91f17796dc5bc723bdcd66a1ba5f9b971bddb080b21d68062d19a8c",
779
- "bytes": 1396
778
+ "sha256": "21d86c077f0f304e59433f7b7f5063948f60b41ec961f71d50eccf94c340fea9",
779
+ "bytes": 1535
780
780
  },
781
781
  {
782
782
  "path": "client-projections/github-copilot-cli/.github/skills/apex-architecture/SKILL.md",
@@ -2089,10 +2089,10 @@
2089
2089
  "target": ".github/skills/apex-requirements/SKILL.md",
2090
2090
  "adapterVersion": "1.1.0",
2091
2091
  "sourcePath": ".github/skills/apex-requirements/SKILL.md",
2092
- "sourceHash": "846fd892c70658a956b6657eebc06557619f7483cf690acf0e2d18ad9c616884"
2092
+ "sourceHash": "0b5076218e79d165efaa2d4a00d5f6014804e6f04666d223947a4e8c9f9512f5"
2093
2093
  },
2094
- "sha256": "846fd892c70658a956b6657eebc06557619f7483cf690acf0e2d18ad9c616884",
2095
- "bytes": 2187
2094
+ "sha256": "0b5076218e79d165efaa2d4a00d5f6014804e6f04666d223947a4e8c9f9512f5",
2095
+ "bytes": 2418
2096
2096
  },
2097
2097
  {
2098
2098
  "path": "client-projections/github-copilot-cli/.github/skills/apex-terraform-import/SKILL.md",
@@ -2339,13 +2339,13 @@
2339
2339
  "composition": "client-projections",
2340
2340
  "roleId": "architecture",
2341
2341
  "sourcePath": ".github/agents/apex-architect.agent.md",
2342
- "sourceHash": "0620b04dc8a48db7f5af148044ed8d040079f887add3b16b3c0e9fdcc022cca0",
2342
+ "sourceHash": "47e6edf792c88ea633cd3bc66c59fba00a3c13020f8771d3635d5e2cc3414e70",
2343
2343
  "clientId": "github-copilot-vscode",
2344
2344
  "target": ".github/agents/apex-architect.agent.md",
2345
2345
  "adapterVersion": "1.1.0"
2346
2346
  },
2347
- "sha256": "d1cb288b989e3ad488e6ae26b0c1cb83b39692058bd6f12fbfe5215a016ad368",
2348
- "bytes": 5693
2347
+ "sha256": "f4e8363fd82309494f2d3a54371abd824e6862323c4db6f52c8b8fe657bf0745",
2348
+ "bytes": 5647
2349
2349
  },
2350
2350
  {
2351
2351
  "path": "client-projections/github-copilot-vscode/.github/agents/apex-codegen.agent.md",
@@ -2384,13 +2384,13 @@
2384
2384
  "composition": "client-projections",
2385
2385
  "roleId": "planning",
2386
2386
  "sourcePath": ".github/agents/apex-planner.agent.md",
2387
- "sourceHash": "9a6bb99cd4784f7afc84f49168933ff8ae0f234386a55ad962382272cb5083ec",
2387
+ "sourceHash": "b33471f0ef586ace4847b9eecfd5363c1d8b269dd9eba460022498ff488c509c",
2388
2388
  "clientId": "github-copilot-vscode",
2389
2389
  "target": ".github/agents/apex-planner.agent.md",
2390
2390
  "adapterVersion": "1.1.0"
2391
2391
  },
2392
- "sha256": "d62130949707e65501d62452a3cec09918781abed2bd266d64383d9e6717478e",
2393
- "bytes": 5032
2392
+ "sha256": "1133d3020cdf6b5a787df091730e9efa7de9076290dd760fe58864478d7fbec4",
2393
+ "bytes": 5176
2394
2394
  },
2395
2395
  {
2396
2396
  "path": "client-projections/github-copilot-vscode/.github/agents/apex-requirements.agent.md",
@@ -2399,13 +2399,13 @@
2399
2399
  "composition": "client-projections",
2400
2400
  "roleId": "requirements",
2401
2401
  "sourcePath": ".github/agents/apex-requirements.agent.md",
2402
- "sourceHash": "87ac351f363c7b782ebbdeda40f15d6e8a7faabc2f400ffadcb0bca4ce66b2f3",
2402
+ "sourceHash": "4bb98532f4c277424689eab261779a33dd0790faf6764a8487848afb5ffb9225",
2403
2403
  "clientId": "github-copilot-vscode",
2404
2404
  "target": ".github/agents/apex-requirements.agent.md",
2405
2405
  "adapterVersion": "1.1.0"
2406
2406
  },
2407
- "sha256": "e69cce296049d7f9ac411889e8c094cb4278957fb4d35520e9ebb4b24a036e61",
2408
- "bytes": 5736
2407
+ "sha256": "70e254ca0b7a8cef6f44fc93c5558d6983c6d0bee71b616dc467f5010a687165",
2408
+ "bytes": 6348
2409
2409
  },
2410
2410
  {
2411
2411
  "path": "client-projections/github-copilot-vscode/.github/agents/apex-reviewer.agent.md",
@@ -2414,13 +2414,13 @@
2414
2414
  "composition": "client-projections",
2415
2415
  "roleId": "review",
2416
2416
  "sourcePath": ".github/agents/apex-reviewer.agent.md",
2417
- "sourceHash": "b76a003f0147584974175f47e5d1a28d68c45f5153d12a8c5fa5e4552872ae13",
2417
+ "sourceHash": "aa2c8064d102f8e2e69eaccc15894455abfcc56892e61bde46d6ece0cbc3c7cd",
2418
2418
  "clientId": "github-copilot-vscode",
2419
2419
  "target": ".github/agents/apex-reviewer.agent.md",
2420
2420
  "adapterVersion": "1.1.0"
2421
2421
  },
2422
- "sha256": "55dbe78ed39469d87e6a223c3b986986f78a7f66d4058690bd69457e5e7da12d",
2423
- "bytes": 2635
2422
+ "sha256": "4be66c1a357ea492c20eaada3431c9b7184f33618bfd69f2725c0c83a2f3f8e7",
2423
+ "bytes": 2976
2424
2424
  },
2425
2425
  {
2426
2426
  "path": "client-projections/github-copilot-vscode/.github/agents/apex-validator.agent.md",
@@ -4071,10 +4071,10 @@
4071
4071
  "target": ".github/skills/apex-requirements/SKILL.md",
4072
4072
  "adapterVersion": "1.1.0",
4073
4073
  "sourcePath": ".github/skills/apex-requirements/SKILL.md",
4074
- "sourceHash": "846fd892c70658a956b6657eebc06557619f7483cf690acf0e2d18ad9c616884"
4074
+ "sourceHash": "0b5076218e79d165efaa2d4a00d5f6014804e6f04666d223947a4e8c9f9512f5"
4075
4075
  },
4076
- "sha256": "846fd892c70658a956b6657eebc06557619f7483cf690acf0e2d18ad9c616884",
4077
- "bytes": 2187
4076
+ "sha256": "0b5076218e79d165efaa2d4a00d5f6014804e6f04666d223947a4e8c9f9512f5",
4077
+ "bytes": 2418
4078
4078
  },
4079
4079
  {
4080
4080
  "path": "client-projections/github-copilot-vscode/.github/skills/apex-terraform-import/SKILL.md",
@@ -4385,7 +4385,7 @@
4385
4385
  "path": "config/runtime-bundle.v1.json",
4386
4386
  "mapping": "config"
4387
4387
  },
4388
- "sha256": "50c39bd12f0ac738fb2ac7b2dc63a761ccd4392dfc7cff57c991b43629473674",
4388
+ "sha256": "7f90c32650d60c10143c298896b404b204427c77a5a746a8778a9bdf1229fd30",
4389
4389
  "bytes": 2039
4390
4390
  },
4391
4391
  {
@@ -4415,8 +4415,8 @@
4415
4415
  "path": "customizations/.github/agents/apex-architect.agent.md",
4416
4416
  "mapping": "customizations"
4417
4417
  },
4418
- "sha256": "0620b04dc8a48db7f5af148044ed8d040079f887add3b16b3c0e9fdcc022cca0",
4419
- "bytes": 5509
4418
+ "sha256": "47e6edf792c88ea633cd3bc66c59fba00a3c13020f8771d3635d5e2cc3414e70",
4419
+ "bytes": 5463
4420
4420
  },
4421
4421
  {
4422
4422
  "path": "customizations/.github/agents/apex-codegen.agent.md",
@@ -4445,8 +4445,8 @@
4445
4445
  "path": "customizations/.github/agents/apex-planner.agent.md",
4446
4446
  "mapping": "customizations"
4447
4447
  },
4448
- "sha256": "9a6bb99cd4784f7afc84f49168933ff8ae0f234386a55ad962382272cb5083ec",
4449
- "bytes": 4848
4448
+ "sha256": "b33471f0ef586ace4847b9eecfd5363c1d8b269dd9eba460022498ff488c509c",
4449
+ "bytes": 4992
4450
4450
  },
4451
4451
  {
4452
4452
  "path": "customizations/.github/agents/apex-requirements.agent.md",
@@ -4455,8 +4455,8 @@
4455
4455
  "path": "customizations/.github/agents/apex-requirements.agent.md",
4456
4456
  "mapping": "customizations"
4457
4457
  },
4458
- "sha256": "87ac351f363c7b782ebbdeda40f15d6e8a7faabc2f400ffadcb0bca4ce66b2f3",
4459
- "bytes": 5552
4458
+ "sha256": "4bb98532f4c277424689eab261779a33dd0790faf6764a8487848afb5ffb9225",
4459
+ "bytes": 6164
4460
4460
  },
4461
4461
  {
4462
4462
  "path": "customizations/.github/agents/apex-reviewer.agent.md",
@@ -4465,8 +4465,8 @@
4465
4465
  "path": "customizations/.github/agents/apex-reviewer.agent.md",
4466
4466
  "mapping": "customizations"
4467
4467
  },
4468
- "sha256": "b76a003f0147584974175f47e5d1a28d68c45f5153d12a8c5fa5e4552872ae13",
4469
- "bytes": 2594
4468
+ "sha256": "aa2c8064d102f8e2e69eaccc15894455abfcc56892e61bde46d6ece0cbc3c7cd",
4469
+ "bytes": 2935
4470
4470
  },
4471
4471
  {
4472
4472
  "path": "customizations/.github/agents/apex-validator.agent.md",
@@ -4715,8 +4715,8 @@
4715
4715
  "path": "customizations/.github/mcp.json",
4716
4716
  "mapping": "customizations"
4717
4717
  },
4718
- "sha256": "dda22ba7b91f17796dc5bc723bdcd66a1ba5f9b971bddb080b21d68062d19a8c",
4719
- "bytes": 1396
4718
+ "sha256": "21d86c077f0f304e59433f7b7f5063948f60b41ec961f71d50eccf94c340fea9",
4719
+ "bytes": 1535
4720
4720
  },
4721
4721
  {
4722
4722
  "path": "customizations/.github/skills/apex-architecture/SKILL.md",
@@ -5655,8 +5655,8 @@
5655
5655
  "path": "customizations/.github/skills/apex-requirements/SKILL.md",
5656
5656
  "mapping": "customizations"
5657
5657
  },
5658
- "sha256": "846fd892c70658a956b6657eebc06557619f7483cf690acf0e2d18ad9c616884",
5659
- "bytes": 2187
5658
+ "sha256": "0b5076218e79d165efaa2d4a00d5f6014804e6f04666d223947a4e8c9f9512f5",
5659
+ "bytes": 2418
5660
5660
  },
5661
5661
  {
5662
5662
  "path": "customizations/.github/skills/apex-terraform-import/SKILL.md",
@@ -5855,13 +5855,13 @@
5855
5855
  "path": "customizations/manifest.json",
5856
5856
  "mapping": "customizations"
5857
5857
  },
5858
- "sha256": "f1a21469470732feaf9cfda73e6e6b74ba573555548cf08eb23a5f3e0a415ae7",
5858
+ "sha256": "c6f64975501baddd9d1712a7a5169b70ab61a4328fdcba9444c0b20800d05ade",
5859
5859
  "bytes": 14078
5860
5860
  }
5861
5861
  ],
5862
5862
  "lock": {
5863
5863
  "algorithm": "sha256",
5864
5864
  "canonicalization": "apex-bundled-assets-v1",
5865
- "digest": "20492f37396ff14048903cf57ebb86fe1177f22aca509d51d37b45a8afa1be93"
5865
+ "digest": "455ee4805ee6e1635feea04cd73745cd358679a791360ba7f6ae24180785a05d"
5866
5866
  }
5867
5867
  }
package/dist/cli.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  import { type ServiceOptions } from "./service.js";
3
3
  export declare function execute(argv: string[], root?: string, options?: ServiceOptions): Promise<unknown>;
4
+ export declare function formatHumanResult(args: string[], result: unknown): string;
4
5
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.js CHANGED
@@ -624,12 +624,14 @@ export async function execute(argv, root = process.cwd(), options = {}) {
624
624
  }
625
625
  async function main() {
626
626
  const json = process.argv.includes("--json");
627
+ const verbose = process.argv.includes("--verbose");
628
+ const args = process.argv.slice(2);
627
629
  try {
628
- const result = await execute(process.argv.slice(2));
630
+ const result = await execute(args);
629
631
  if (result !== undefined)
630
632
  process.stdout.write(json
631
633
  ? `${JSON.stringify({ ok: true, result })}\n`
632
- : `${typeof result === "string" ? result : JSON.stringify(result, null, 2)}\n`);
634
+ : `${verbose ? (typeof result === "string" ? result : JSON.stringify(result, null, 2)) : formatHumanResult(args, result)}\n`);
633
635
  }
634
636
  catch (error) {
635
637
  const normalized = normalizeError(error);
@@ -641,6 +643,44 @@ async function main() {
641
643
  process.exitCode = normalized.exitCode;
642
644
  }
643
645
  }
646
+ export function formatHumanResult(args, result) {
647
+ const command = args.find((argument) => !argument.startsWith("--"));
648
+ if (command === "status" && result !== null && typeof result === "object") {
649
+ const status = result;
650
+ const task = status.task ?? null;
651
+ const stage = task?.startsWith("requirements")
652
+ ? "Requirements"
653
+ : task?.startsWith("architecture") || task?.startsWith("governance")
654
+ ? "Architecture"
655
+ : task?.startsWith("plan")
656
+ ? "Planning"
657
+ : task?.startsWith("codegen") || task?.startsWith("validation")
658
+ ? "Build and validate"
659
+ : task?.startsWith("preview") || task?.startsWith("deploy") || task === "inventory"
660
+ ? "Operations"
661
+ : "Ready for next decision";
662
+ const blocker = status.blockers?.[0] ?? "None";
663
+ const next = task !== null ? `Continue ${stage}` : blocker !== "None" ? blocker : "Ask APEX to continue";
664
+ return [
665
+ `Project: ${status.run?.projectId ?? "unknown"} (${status.run?.environment ?? "unknown"})`,
666
+ `Stage: ${stage}`,
667
+ `Blocker: ${blocker}`,
668
+ `Next: ${next}`,
669
+ ].join("\n");
670
+ }
671
+ if (command === "doctor" && result !== null && typeof result === "object") {
672
+ const doctor = result;
673
+ const passed = doctor.checks?.filter(({ ok }) => ok).length ?? 0;
674
+ const total = doctor.checks?.length ?? 0;
675
+ const remaining = doctor.remedies?.length ?? 0;
676
+ return [
677
+ `Status: ${doctor.healthy ? "Ready" : "Setup incomplete"} (${passed}/${total} checks ready)`,
678
+ `Next: ${doctor.nextAction ?? "No action required"}`,
679
+ ...(remaining > 1 ? [`Later: ${remaining - 1} additional setup item${remaining === 2 ? "" : "s"}`] : []),
680
+ ].join("\n");
681
+ }
682
+ return typeof result === "string" ? result : JSON.stringify(result, null, 2);
683
+ }
644
684
  if (process.argv[1] !== undefined && (await realpath(process.argv[1])) === (await realpath(new URL(import.meta.url))))
645
685
  await main();
646
686
  //# sourceMappingURL=cli.js.map
package/dist/mcp.js CHANGED
@@ -5,6 +5,14 @@ import { ApexService, SUPPORTED_ARTIFACT_KINDS } from "./service.js";
5
5
  import { APEX_VERSION } from "./version.js";
6
6
  const artifactKind = z.enum(SUPPORTED_ARTIFACT_KINDS);
7
7
  const taskOutput = z.object({ kind: artifactKind, value: z.unknown(), summary: z.string().optional() });
8
+ const reviewFinding = z
9
+ .object({
10
+ id: z.string().min(1),
11
+ severity: z.enum(["critical", "high", "medium", "low", "info"]),
12
+ title: z.string().min(1),
13
+ detail: z.string().min(1),
14
+ })
15
+ .strict();
8
16
  const uniqueStrings = z
9
17
  .array(z.string().min(1))
10
18
  .min(1)
@@ -88,6 +96,21 @@ const gateDecisionInput = z
88
96
  confirm: z.literal(true),
89
97
  })
90
98
  .strict();
99
+ const reviewDecisionInput = z
100
+ .object({
101
+ reviewHash: z.string().regex(/^[0-9a-f]{64}$/),
102
+ decisions: z
103
+ .array(z
104
+ .object({
105
+ findingId: z.string().min(1),
106
+ action: z.enum(["revise", "accept-risk"]),
107
+ rationale: z.string().min(1),
108
+ expiresAt: z.string().datetime().optional(),
109
+ })
110
+ .strict())
111
+ .min(1),
112
+ })
113
+ .strict();
91
114
  const normalizeOutputs = (outputs) => outputs.map(({ kind, value, summary }) => ({
92
115
  kind,
93
116
  value,
@@ -109,6 +132,14 @@ export function createMcpServer(service) {
109
132
  description: "Read context only for the exact task.taskId returned by nextTask with status=task.",
110
133
  inputSchema: { taskId: z.string() },
111
134
  }, async ({ taskId }) => result(await service.taskContext(taskId)));
135
+ server.registerTool("readTaskInput", {
136
+ description: "Read a bounded chunk of the accepted source artifact for an active review task.",
137
+ inputSchema: {
138
+ taskId: z.string(),
139
+ offset: z.number().int().nonnegative().optional(),
140
+ limit: z.number().int().min(1).max(6_000).optional(),
141
+ },
142
+ }, async ({ taskId, offset, limit }) => result(await service.readTaskInput(taskId, offset, limit)));
112
143
  server.registerTool("recordInput", { description: "Record answers for the exact pending kernel input request", inputSchema: inputSubmission }, async (input) => result(await service.recordInput(input)));
113
144
  server.registerTool("projectCreate", {
114
145
  description: "Create and select a new project with its initial environment run",
@@ -124,6 +155,13 @@ export function createMcpServer(service) {
124
155
  description: "Record an explicitly confirmed human decision for Gate 1, 2, or 3 using the local OS username as actor. Gate 4 remains CLI-only.",
125
156
  inputSchema: gateDecisionInput,
126
157
  }, async ({ gate, decision }) => result(await service.decideInteractiveGate(gate, decision)));
158
+ server.registerTool("reviewDecide", {
159
+ description: "Resolve all current review findings atomically by requesting revision or accepting permitted time-bound risk.",
160
+ inputSchema: reviewDecisionInput,
161
+ }, async ({ reviewHash, decisions }) => result(await service.decideReview(reviewHash, decisions.map(({ expiresAt, ...decision }) => ({
162
+ ...decision,
163
+ ...(expiresAt === undefined ? {} : { expiresAt }),
164
+ })))));
127
165
  server.registerTool("stageArtifact", {
128
166
  inputSchema: {
129
167
  taskId: z.string(),
@@ -178,25 +216,29 @@ export function createMcpServer(service) {
178
216
  : { kind, value, ...(summary === undefined ? {} : { summary }) }
179
217
  : normalizeOutputs(outputs))));
180
218
  server.registerTool("completeTask", {
181
- description: "Complete a task atomically. Supply outputs[] for every task with multiple required output kinds.",
219
+ description: "Complete a task atomically with a nonempty outputs[] bundle.",
182
220
  inputSchema: {
183
221
  taskId: z.string(),
184
- kind: artifactKind.optional(),
185
- value: z.unknown().optional(),
186
- summary: z.string().optional(),
187
- outputs: z.array(taskOutput).optional(),
222
+ outputs: z.array(taskOutput).min(1),
188
223
  },
189
- }, async ({ taskId, kind, value, summary, outputs }) => {
190
- if (outputs !== undefined)
191
- return result(await service.completeTaskOutputs(taskId, normalizeOutputs(outputs)));
192
- if (kind === undefined)
193
- throw new Error("completeTask requires kind/value or outputs[]");
194
- const context = await service.taskContext(taskId);
195
- if (context.task.allowedOutputKinds.length > 1) {
196
- throw new Error("completeTask requires outputs[] when the task has multiple required output kinds");
197
- }
198
- return result(await service.completeTask(taskId, { kind, value, ...(summary === undefined ? {} : { summary }) }));
199
- });
224
+ }, async ({ taskId, outputs }) => result(await service.completeTaskOutputs(taskId, normalizeOutputs(outputs))));
225
+ server.registerTool("requirementsComplete", {
226
+ description: "Complete the active Requirements task atomically.",
227
+ inputSchema: { taskId: z.string(), requirements: z.unknown() },
228
+ }, async ({ taskId, requirements }) => result(await service.completeRequirements(taskId, requirements)));
229
+ server.registerTool("architectureComplete", {
230
+ description: "Complete the active Architecture task atomically with all required outputs.",
231
+ inputSchema: {
232
+ taskId: z.string(),
233
+ architecture: z.unknown(),
234
+ costEstimate: z.unknown(),
235
+ decisionManifest: z.unknown(),
236
+ },
237
+ }, async ({ taskId, architecture, costEstimate, decisionManifest }) => result(await service.completeArchitecture(taskId, architecture, costEstimate, decisionManifest)));
238
+ server.registerTool("reviewComplete", {
239
+ description: "Complete the active review task; APEX derives subject identity, hash, timestamp, and evidence binding.",
240
+ inputSchema: { taskId: z.string(), findings: z.array(reviewFinding) },
241
+ }, async ({ taskId, findings }) => result(await service.completeReview(taskId, findings)));
200
242
  server.registerTool("planComplete", {
201
243
  description: "Atomically complete a plan. Derives the canonical implementation intent hash for the binding; do not supply intentHash.",
202
244
  inputSchema: planCompletionInput,
package/dist/service.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type ApprovalEvidenceV1, type ArchitectureAvailabilityV1, type DeploymentPreviewV1, type EnvironmentInputsV1, type IacBindingV1, type InputRequestV1, type InputValueV1, type InputSubmissionV1, type ImprovementCategory, type ImprovementDecisionV1, type ImprovementObservationV1, type ImprovementPolicyV1, type ImprovementProposalV1, type ImprovementSource, type ImplementationIntentV1, type Operation, type ProjectId, type ResourceInventoryV1, type RunConfigV1, type RunId, type TaskEnvelopeV1 } from "@apexops/contracts";
1
+ import { type ApprovalEvidenceV1, type ArchitectureAvailabilityV1, type ArchitectureV1, type CostEstimateV1, type DeploymentPreviewV1, type EnvironmentInputsV1, type IacBindingV1, type InputRequestV1, type InputValueV1, type InputSubmissionV1, type ImprovementCategory, type ImprovementDecisionV1, type ImprovementObservationV1, type ImprovementPolicyV1, type ImprovementProposalV1, type ImprovementSource, type ImplementationIntentV1, type Operation, type ProjectId, type ResourceInventoryV1, type ReviewFindingsV1, type RequirementsV1, type RunConfigV1, type RunId, type WorkloadDecisionManifestV1, type TaskEnvelopeV1 } from "@apexops/contracts";
2
2
  import { type CapabilityPackInstallOptions, type IacProvider, type ProcessRunnerLike } from "@apexops/capabilities";
3
3
  import { type JsonValue } from "@apexops/kernel";
4
4
  import { type BundledClientProjection } from "./assets.js";
@@ -52,6 +52,12 @@ export interface ReviewResolution {
52
52
  expiresAt?: string;
53
53
  dependencyHash: string;
54
54
  }
55
+ export interface ReviewDecision {
56
+ findingId: string;
57
+ action: "revise" | "accept-risk";
58
+ rationale: string;
59
+ expiresAt?: string;
60
+ }
55
61
  export interface ServiceOptions {
56
62
  clock?: () => Date;
57
63
  idSource?: () => string;
@@ -618,6 +624,9 @@ export declare class ApexService {
618
624
  nextTask(): Promise<{
619
625
  status: "needs_input";
620
626
  request: InputRequestV1;
627
+ } | {
628
+ status: "needs_review";
629
+ review: Awaited<ReturnType<ApexService["pendingReview"]>>;
621
630
  } | {
622
631
  status: "task";
623
632
  task: TaskEnvelopeV1;
@@ -638,6 +647,13 @@ export declare class ApexService {
638
647
  status: string;
639
648
  blockers: string[];
640
649
  }>;
650
+ readTaskInput(taskId: string, offset?: number, limit?: number): Promise<{
651
+ subjectHash: string;
652
+ content: string;
653
+ offset: number;
654
+ nextOffset?: number;
655
+ outputTemplate?: unknown;
656
+ }>;
641
657
  stageArtifact(taskId: string, output: TaskOutput): Promise<StagedArtifact>;
642
658
  stageFile(taskId: string, relativePath: string, content: string | Uint8Array, expectedSha?: string): Promise<StagedFile>;
643
659
  generateIac(taskId: string, options?: GenerateIacOptions): Promise<{
@@ -658,10 +674,23 @@ export declare class ApexService {
658
674
  outputHashes: Partial<Record<ArtifactKind, string>>;
659
675
  summary: string;
660
676
  }>;
677
+ completeRequirements(taskId: string, requirements: RequirementsV1): Promise<{
678
+ outputHashes: Partial<Record<ArtifactKind, string>>;
679
+ summary: string;
680
+ }>;
681
+ completeArchitecture(taskId: string, architecture: ArchitectureV1, costEstimate: CostEstimateV1, decisionManifest: WorkloadDecisionManifestV1): Promise<{
682
+ outputHashes: Partial<Record<ArtifactKind, string>>;
683
+ summary: string;
684
+ }>;
685
+ completeReview(taskId: string, findings: Array<Pick<ReviewFindingsV1["findings"][number], "id" | "severity" | "title" | "detail">>): Promise<{
686
+ outputHashes: Partial<Record<ArtifactKind, string>>;
687
+ summary: string;
688
+ }>;
661
689
  completePlan(taskId: string, intent: ImplementationIntentV1, binding: Omit<IacBindingV1, "intentHash">, environmentInputs: EnvironmentInputsV1): Promise<{
662
690
  outputHashes: Partial<Record<ArtifactKind, string>>;
663
691
  summary: string;
664
692
  }>;
693
+ private assertTaskType;
665
694
  private acceptTaskOutputs;
666
695
  private renderRequirementsDocument;
667
696
  private requirementsReviewDirectory;
@@ -680,6 +709,11 @@ export declare class ApexService {
680
709
  private requirementsDocumentTemplateContent;
681
710
  cancelTask(taskId: string): Promise<void>;
682
711
  resolveReview(resolution: ReviewResolution): Promise<void>;
712
+ decideReview(reviewHash: string, decisions: ReviewDecision[]): Promise<{
713
+ status: "revision_requested" | "resolved";
714
+ }>;
715
+ private pendingReview;
716
+ private reviseReview;
683
717
  private assertReviewResolution;
684
718
  decideGateNumber(gateNumber: number, decision: "approved" | "rejected", actor: string, options?: GateDecisionOptions): Promise<ApprovalEvidenceV1>;
685
719
  decideInteractiveGate(gateNumber: 1 | 2 | 3, decision: "approved" | "rejected"): Promise<ApprovalEvidenceV1>;
@@ -754,8 +788,12 @@ export declare class ApexService {
754
788
  private architectureDecisionValues;
755
789
  private issueArchitectureDecision;
756
790
  private nextRequirementsIntakeRound;
791
+ private requirementsIntakeCatalog;
757
792
  private issueRequirementsInput;
758
793
  private requirementsIntakeQuestions;
794
+ private recommendedWorkloadPattern;
795
+ private workloadScalePrompt;
796
+ private recommendedServiceCandidates;
759
797
  private append;
760
798
  private journal;
761
799
  private runPath;
@@ -806,6 +844,8 @@ export declare class ApexService {
806
844
  private customizationSelection;
807
845
  private assertCleanInitialization;
808
846
  private createRuntimeLock;
847
+ private installRuntimeGeneration;
848
+ private runtimeRootForRun;
809
849
  private capabilityPacks;
810
850
  private runtimeLockChecks;
811
851
  private ensureLocalGitBoundary;