healthcloud-cli 3.7.13__tar.gz → 3.8.0__tar.gz

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 (97) hide show
  1. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/PKG-INFO +123 -26
  2. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/README.md +122 -25
  3. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/agents/commands.py +18 -5
  4. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/agents/operations.py +255 -43
  5. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/context.py +21 -0
  6. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/errors.py +3 -0
  7. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/group.py +1 -1
  8. healthcloud_cli-3.8.0/healthcloud_cli/ams/health_services/__init__.py +5 -0
  9. healthcloud_cli-3.8.0/healthcloud_cli/ams/health_services/commands.py +61 -0
  10. healthcloud_cli-3.8.0/healthcloud_cli/ams/health_services/group.py +18 -0
  11. healthcloud_cli-3.8.0/healthcloud_cli/ams/health_services/operations.py +82 -0
  12. healthcloud_cli-3.8.0/healthcloud_cli/ams/health_services/projections.py +18 -0
  13. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/registry.py +2 -0
  14. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/pyproject.toml +1 -1
  15. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/.gitignore +0 -0
  16. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/hatch_build.py +0 -0
  17. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/__init__.py +0 -0
  18. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/admins/__init__.py +0 -0
  19. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/admins/commands.py +0 -0
  20. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/admins/group.py +0 -0
  21. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/admins/operations.py +0 -0
  22. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/__init__.py +0 -0
  23. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/agents/__init__.py +0 -0
  24. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/agents/group.py +0 -0
  25. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/agents/projections.py +0 -0
  26. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/auth.py +0 -0
  27. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/commands.py +0 -0
  28. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/compatibility.py +0 -0
  29. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/data_sources/__init__.py +0 -0
  30. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/data_sources/commands.py +0 -0
  31. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/data_sources/group.py +0 -0
  32. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/data_sources/operations.py +0 -0
  33. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/data_sources/projections.py +0 -0
  34. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/departments/__init__.py +0 -0
  35. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/departments/commands.py +0 -0
  36. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/departments/group.py +0 -0
  37. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/departments/operations.py +0 -0
  38. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/departments/projections.py +0 -0
  39. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/domain_errors.py +0 -0
  40. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/guardrails/__init__.py +0 -0
  41. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/guardrails/commands.py +0 -0
  42. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/guardrails/group.py +0 -0
  43. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/guardrails/operations.py +0 -0
  44. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/guardrails/projections.py +0 -0
  45. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/organization/__init__.py +0 -0
  46. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/organization/commands.py +0 -0
  47. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/organization/group.py +0 -0
  48. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/organization/operations.py +0 -0
  49. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/organization/projections.py +0 -0
  50. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/output.py +0 -0
  51. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/policies/__init__.py +0 -0
  52. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/policies/commands.py +0 -0
  53. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/policies/group.py +0 -0
  54. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/policies/operations.py +0 -0
  55. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/policies/projections.py +0 -0
  56. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/pretty.py +0 -0
  57. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/results.py +0 -0
  58. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/session.py +0 -0
  59. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/sessions/__init__.py +0 -0
  60. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/sessions/commands.py +0 -0
  61. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/sessions/group.py +0 -0
  62. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/sessions/operations.py +0 -0
  63. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/sessions/projections.py +0 -0
  64. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/skills/__init__.py +0 -0
  65. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/skills/commands.py +0 -0
  66. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/skills/group.py +0 -0
  67. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/skills/operations.py +0 -0
  68. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/skills/projections.py +0 -0
  69. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/target.py +0 -0
  70. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/teams/__init__.py +0 -0
  71. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/teams/commands.py +0 -0
  72. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/teams/group.py +0 -0
  73. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/teams/operations.py +0 -0
  74. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/teams/projections.py +0 -0
  75. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/tools/__init__.py +0 -0
  76. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/tools/commands.py +0 -0
  77. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/tools/group.py +0 -0
  78. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/tools/operations.py +0 -0
  79. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/tools/projections.py +0 -0
  80. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/tuning.py +0 -0
  81. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/ui.py +0 -0
  82. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/ams/windows_files.py +0 -0
  83. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/cli.py +0 -0
  84. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/context.py +0 -0
  85. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/contracts/__init__.py +0 -0
  86. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/contracts/mcp-tools.manifest.json +0 -0
  87. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/main.py +0 -0
  88. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/manifest.py +0 -0
  89. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/output.py +0 -0
  90. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/params.py +0 -0
  91. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/tenants/__init__.py +0 -0
  92. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/tenants/commands.py +0 -0
  93. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/tenants/group.py +0 -0
  94. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/tenants/operations.py +0 -0
  95. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/healthcloud_cli/util.py +0 -0
  96. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/scripts/__init__.py +0 -0
  97. {healthcloud_cli-3.7.13 → healthcloud_cli-3.8.0}/scripts/bundle_manifest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: healthcloud-cli
3
- Version: 3.7.13
3
+ Version: 3.8.0
4
4
  Summary: Command-line interface for the HealthCloud MCP gateway, generated from the shared MCP tool manifest.
5
5
  Project-URL: Issues, https://github.com/healthcloudservices/healthcloud-services/issues
6
6
  Project-URL: Repository, https://github.com/healthcloudservices/healthcloud-services
@@ -22,7 +22,8 @@ Requires **Python 3.14 or newer**.
22
22
 
23
23
  `hc` is an SDK-backed CLI: the primary surface is `hc ams`, which reads and
24
24
  tunes one explicitly selected AMS tenant (catalog domains -- skills, policies,
25
- guardrails, teams, departments, organization, data-sources, tools -- plus
25
+ guardrails, teams, departments, organization, data-sources, health-services,
26
+ tools -- plus
26
27
  read-only agent operations). The `hc mcp` subtree is the gateway fallback and
27
28
  has exactly one subcommand per
28
29
  MCP tool -- generated dynamically at startup from a shared manifest across
@@ -732,8 +733,15 @@ Without `--confirm` the command is a **preview**: it reads the agent exactly onc
732
733
  local pre-checks, prints `preview: --confirm was not passed, so nothing has been
733
734
  sent.` followed by the reviewed diff, and exits 2 having sent no `PUT`. With
734
735
  `--confirm` the write path is unchanged: it re-reads before the single `PUT`, so
735
- a preview is never an approval token. The preview text is suppressed under
736
- `--output json`/`raw`, like the confirmed path's review.
736
+ a preview is never an approval token. Both renderings stay human: the preview
737
+ text is suppressed under `--output json`/`raw` because it accompanies a usage
738
+ refusal (which prints no envelope), and the **confirmed** review is suppressed
739
+ the same way, like the lifecycle review — in those modes the reviewed diff is
740
+ carried in the envelope under `data.changed` instead, so a scripted caller reads
741
+ the diff from the envelope and never from stderr. `agents delete` is the one
742
+ exception: its confirmed review prints in every mode, because it is the
743
+ acknowledgement of an irreversible hard delete rather than a reversible field
744
+ write.
737
745
 
738
746
  Pre-checks refuse with exit 1 and **no write**: no assignment option at all
739
747
  (exit 2), setting and clearing the same family together (exit 2), an agent
@@ -771,14 +779,27 @@ acknowledgement of the target and disclosure block it prints:
771
779
  ```bash
772
780
  uv run --frozen hc ams agents delete --environment dev --tenant-id TENANT_ID \
773
781
  --agent-id AGENT_ID --confirm
782
+ # the same acknowledgement, bound to the id being destroyed:
783
+ uv run --frozen hc ams agents delete --environment dev --tenant-id TENANT_ID \
784
+ --agent-id AGENT_ID --confirm AGENT_ID
774
785
  ```
775
786
 
787
+ `--confirm` is required. It accepts the bare flag or the `AGENT_ID` being
788
+ deleted; a value that does not match `--agent-id` is refused (exit 2) before any
789
+ request, so a replayed acknowledgement cannot destroy a different agent. The
790
+ refusal names both spellings. This binding belongs to `agents delete` only — the
791
+ lifecycle and assignment `--confirm` flags stay plain acknowledgements.
792
+
776
793
  Before the delete it reads the agent once and prints the resolved destructive
777
794
  target (`agent_id`, `name`, `type`, `status`, `active`, `config_version`) and the
778
- disclosure block to stderr, so the operator approves an actual record, not a
779
- phrase. The same disclosure is carried under `data.disclosure` in the envelope
780
- (`irreversible`, `generated_file`, `dependency_guard`, `restore`,
781
- `authorization`, `recovery_trail`), and it is the honest server contract:
795
+ disclosure block to stderr **in every output mode**, so a scripted
796
+ `--output json` caller approves the record and the disclosure it was actually
797
+ shown rather than a phrase it never saw. `--output pretty` renders the same block
798
+ unchanged; `--output raw` is refused for every AMS command, so `json` is the
799
+ machine mode this command renders in. The same disclosure is carried under
800
+ `data.disclosure` in the envelope (`irreversible`, `generated_file`,
801
+ `dependency_guard`, `restore`, `authorization`, `recovery_trail`,
802
+ `review_staleness`), and it is the honest server contract:
782
803
 
783
804
  - the delete is a **hard delete** of the agent row: no soft delete, no
784
805
  tombstone, no retention window and no undelete route;
@@ -792,13 +813,22 @@ tombstone, no retention window and no undelete route;
792
813
  `hc ams agents export` if you may need it;
793
814
  - the route needs an authenticated tenant user only: no admin/role check is
794
815
  applied;
816
+ - `--confirm` approves the **pre-read snapshot** printed above, not the row the
817
+ server destroys: the route has no `If-Match` or version precondition, so a
818
+ concurrent recreate or configuration change between that read and the
819
+ `DELETE` is not detected and a different record can go. A `404`, or a `2xx`
820
+ with no body, from the confirmation read is read as absence, and the error
821
+ body cannot distinguish absence from a mid-operation authorization or scope
822
+ change;
795
823
  - only a server audit row (`AuditAction.DELETE`) remains.
796
824
 
797
825
  The sequence is exactly one `GET /agents/{agent_id}`, exactly one
798
826
  `DELETE /agents/{agent_id}` (204, no body) and exactly one confirmation `GET`.
799
- Only a `404` from that confirmation read proves the row is gone: the envelope
800
- then reports `data.deleted: true`, `data.evidence.deleted.status: "confirmed"`
801
- with `confirmation: "not_found"` and `confirmation_status: 404`, plus
827
+ A `404` from that confirmation read proves the row is gone, and so does a `2xx`
828
+ with no body (see below); a `404` is the only answer that also pins the status.
829
+ The envelope then reports `data.deleted: true`,
830
+ `data.evidence.deleted.status: "confirmed"` with `confirmation: "not_found"`
831
+ and `confirmation_status: 404`, plus
802
832
  `data.evidence.side_effects` and `data.evidence.runtime` (both always
803
833
  `unverified`) and `data.mutation_replayed: false`. The command prints no promise
804
834
  of restore and has no `--force`, no `--dry-run`, no interactive prompt and no
@@ -808,17 +838,26 @@ version flag would advertise protection the server does not offer.
808
838
  Default `pretty` output prints the result as labelled lines next to the stderr
809
839
  disclosure: `agent_id`, `deleted: true`, `target`, `disclosure`, `evidence`
810
840
  (`deleted`/`side_effects`/`runtime`), `mutation_replayed: false`, and a closing
811
- `verification:` block. `--output json` prints the full envelope, unchanged. The
812
- reviewed target and disclosure above are still printed to stderr in `pretty`
813
- mode only; `--output json`/`raw` keep stderr machine-parsable.
841
+ `verification:` block. `--output json` prints the full envelope on stdout,
842
+ unchanged and on stdout alone. Because the review also goes to stderr in `json`
843
+ mode, a **failing** confirmed delete prints that review followed by the one
844
+ error envelope on stderr: parse `stdout` for the success envelope, and take the
845
+ envelope from the first `{` on stderr when the command failed. That recipe
846
+ holds by construction, not by luck: every server-supplied value the review
847
+ prints (`agent_id`, `name`, `type`, `status`, `active`, `config_version`) has
848
+ its braces escaped as `\u007b`/`\u007d`, so the review never contains a literal
849
+ `{` or `}` and the first `{` on stderr always begins the envelope — an agent
850
+ named `beta{"deleted":true}` cannot break a scripted caller's parse.
814
851
 
815
852
  Without `--confirm` the command is a **preview**: it reads the agent exactly once
816
853
  (the same one bounded `GET`), prints `preview: --confirm was not passed, so
817
854
  nothing has been sent.` plus the resolved destructive target and the whole
818
855
  disclosure block to stderr, and exits 2 having sent no `DELETE`. With `--confirm`
819
856
  the sequence above is unchanged: it re-reads before the single `DELETE`, so a
820
- preview is never an approval token. The preview text is suppressed under
821
- `--output json`/`raw`, like the confirmed path's review.
857
+ preview is never an approval token. The preview text *alone* is suppressed under
858
+ `--output json`/`raw` (it accompanies a usage refusal, which prints no envelope);
859
+ the confirmed path's review is not: it prints to stderr in every output mode, as
860
+ described above.
822
861
 
823
862
  Refusals claim nothing and send nothing extra: an agent outside the explicit
824
863
  tenant, the tenant identity mismatch and a delete target that no longer exists
@@ -826,18 +865,51 @@ are refused before the `DELETE` (the preview reports the same `not_found`); a `4
826
865
  schedules; a `404` from the `DELETE` is `not_found`; and a `405` is the server's
827
866
  refusal (`unsupported`). None of them is retried.
828
867
 
829
- A transport error or `5xx` from the `DELETE` is `outcome: "unknown"` with
830
- `mutation_replayed: false`, `verification.saved_state: "unknown"` and a
868
+ Every **other** non-2xx answer to the `DELETE` (`400`, `401`, `403`, `422`,
869
+ `429`, …) is a send-once refusal, never the generic runner failure: the envelope
870
+ is `outcome: "failed"` with `verification.saved_state: "failed"`, the category
871
+ comes from the status (`validation`, `authentication`, `authorization`,
872
+ `conflict` for the statuses the shared mapping covers; a status it does not map,
873
+ such as `429`, falls back to `transport` and is a known follow-up),
874
+ `data.evidence.deleted.confirmation` is `not_attempted` with
875
+ `confirmation_status: null` (no confirmation read was taken), and the message
876
+ says the delete was sent once, that nothing was replayed, and points at
877
+ `hc ams agents list`. It also carries the `reconciliation: {"status":
878
+ "not_read", …}` block: this command did not re-read the agent, so a scripted
879
+ caller can tell it apart from a read-shaped outcome.
880
+
881
+ A transport error, a `408` or a `5xx` from the `DELETE` is `outcome: "unknown"`
882
+ with `mutation_replayed: false`, `verification.saved_state: "unknown"` and a
831
883
  `reconciliation: {"status": "not_read", …}` block; nothing is replayed and the
832
884
  agent is never restored — run `hc ams agents list` before doing anything else.
833
885
  The same unknown outcome applies when the delete was accepted but the
834
- confirmation read could not be read. A confirmation read that still returns the
835
- agent (`200`) — or a `2xx` body that cannot be read as an agent — is
836
- `outcome: "failed"` with `data.deleted: false` and
837
- `verification.saved_state: "failed"`, never success. A confirmation read that
838
- answers 401/403 (or any other non-404, non-2xx status) observed nothing about
839
- the row, so `data.evidence.deleted.confirmation` is `unobserved` — the same
840
- three-way state as the guardrail delete — and never `still_present`.
886
+ confirmation read could not be read, and when `Ctrl-C` interrupts either the
887
+ `DELETE` or the confirmation `GET`: the interrupt is caught (never swallowed
888
+ silently), the command still exits non-zero, and it prints the unknown-outcome
889
+ envelope instead of a plain failure that pretends nothing was sent.
890
+
891
+ A confirmation read that still returns the agent is `outcome: "failed"` with
892
+ `data.deleted: false`, `confirmation: "still_present"` and
893
+ `verification.saved_state: "failed"`, never success. A `2xx` body that cannot
894
+ be read as an agent is also `failed`, but `confirmation` is `unobserved`, with
895
+ wording that says the route still answers this path rather than claiming the
896
+ agent is still present. A confirmation read that answers 401/403 (or any other
897
+ non-404, non-2xx status) observed nothing about the row, so `confirmation` is
898
+ likewise `unobserved` — the same state as the guardrail delete — and never
899
+ `still_present`. A `2xx` with a **null or empty body** is the opposite case:
900
+ this server uses a `200` null body to say the agent does not exist (the same
901
+ answer `hc ams agents get` reports as `not_found`), so it proves absence exactly
902
+ as a `404` does. The envelope is then `outcome: "succeeded"` with
903
+ `data.deleted: true` and `confirmation: "not_found"` — never a `404` invented to
904
+ match the wording.
905
+
906
+ In every one of those non-`404` cases `confirmation_status` is `null`, and not
907
+ only when the body is unreadable: the SDK returns `None` for **any** response
908
+ with no content, before it looks at the status, so a `204`, a `202` with no body
909
+ and a `200` with a null body are indistinguishable at the client. A body-bearing
910
+ `2xx` does not pin the code either — `200`, `201` and `202` all read back the
911
+ same way. Only the `404` path can state a status it really observed, so only
912
+ that path records one.
841
913
 
842
914
  Read-only department listing and inspection use the same explicit tenant-admin
843
915
  targeting. They emit one versioned JSON result on stdout; failures emit one
@@ -1694,9 +1766,34 @@ additional data. Data-source reads refuse target files, root credentials or base
1694
1766
  URLs, raw output, blank or dot-segment IDs, and installed SDKs without both
1695
1767
  data-source methods before tenant-admin login or catalog reads.
1696
1768
 
1769
+ Read-only health-service catalog listing and inspection are complete and
1770
+ unpaged. The bounded projection includes only the stable ID, name, and the
1771
+ server's created/updated timestamps:
1772
+
1773
+ ```bash
1774
+ uv run --frozen hc ams health-services list --environment dev --tenant-id TENANT_ID
1775
+ uv run --frozen hc ams health-services get --environment dev --tenant-id TENANT_ID \
1776
+ --service-id SERVICE_ID
1777
+ ```
1778
+
1779
+ When both target flags are omitted, these commands may use the matching saved
1780
+ tenant-admin session. Explicit flags must match that session. Health-service
1781
+ output never includes descriptions or arbitrary response fields, and does not
1782
+ imply booking, availability, pricing, scheduling, or that a service is offered
1783
+ to a patient. The CLI does not create, update, or delete health services. It
1784
+ makes exactly one catalog GET after tenant-admin login and does not paginate,
1785
+ retry, cache, truncate, join, or infer additional data. A `get` whose service ID
1786
+ is unknown in this tenant reports `not_found` and names the requested ID: a 404
1787
+ from the route, a null 2xx body, and a record whose tenant does not match the
1788
+ session all fail without an envelope claiming success (a foreign-tenant record is
1789
+ a `validation` identity refusal). Health-service reads refuse target files, root
1790
+ credentials or base URLs, raw output, blank or dot-segment IDs, and installed
1791
+ SDKs without both health-service methods before tenant-admin login or catalog
1792
+ reads.
1793
+
1697
1794
  ### AMS output modes
1698
1795
 
1699
- The read commands (`hc ams skills|tools|policies|guardrails|data-sources|teams|departments list|get`
1796
+ The read commands (`hc ams skills|tools|policies|guardrails|data-sources|health-services|teams|departments list|get`
1700
1797
  and `hc ams organization hierarchy`) render in two modes (`--output` on the root
1701
1798
  `hc` command; `pretty` is the default):
1702
1799
 
@@ -4,7 +4,8 @@ Requires **Python 3.14 or newer**.
4
4
 
5
5
  `hc` is an SDK-backed CLI: the primary surface is `hc ams`, which reads and
6
6
  tunes one explicitly selected AMS tenant (catalog domains -- skills, policies,
7
- guardrails, teams, departments, organization, data-sources, tools -- plus
7
+ guardrails, teams, departments, organization, data-sources, health-services,
8
+ tools -- plus
8
9
  read-only agent operations). The `hc mcp` subtree is the gateway fallback and
9
10
  has exactly one subcommand per
10
11
  MCP tool -- generated dynamically at startup from a shared manifest across
@@ -714,8 +715,15 @@ Without `--confirm` the command is a **preview**: it reads the agent exactly onc
714
715
  local pre-checks, prints `preview: --confirm was not passed, so nothing has been
715
716
  sent.` followed by the reviewed diff, and exits 2 having sent no `PUT`. With
716
717
  `--confirm` the write path is unchanged: it re-reads before the single `PUT`, so
717
- a preview is never an approval token. The preview text is suppressed under
718
- `--output json`/`raw`, like the confirmed path's review.
718
+ a preview is never an approval token. Both renderings stay human: the preview
719
+ text is suppressed under `--output json`/`raw` because it accompanies a usage
720
+ refusal (which prints no envelope), and the **confirmed** review is suppressed
721
+ the same way, like the lifecycle review — in those modes the reviewed diff is
722
+ carried in the envelope under `data.changed` instead, so a scripted caller reads
723
+ the diff from the envelope and never from stderr. `agents delete` is the one
724
+ exception: its confirmed review prints in every mode, because it is the
725
+ acknowledgement of an irreversible hard delete rather than a reversible field
726
+ write.
719
727
 
720
728
  Pre-checks refuse with exit 1 and **no write**: no assignment option at all
721
729
  (exit 2), setting and clearing the same family together (exit 2), an agent
@@ -753,14 +761,27 @@ acknowledgement of the target and disclosure block it prints:
753
761
  ```bash
754
762
  uv run --frozen hc ams agents delete --environment dev --tenant-id TENANT_ID \
755
763
  --agent-id AGENT_ID --confirm
764
+ # the same acknowledgement, bound to the id being destroyed:
765
+ uv run --frozen hc ams agents delete --environment dev --tenant-id TENANT_ID \
766
+ --agent-id AGENT_ID --confirm AGENT_ID
756
767
  ```
757
768
 
769
+ `--confirm` is required. It accepts the bare flag or the `AGENT_ID` being
770
+ deleted; a value that does not match `--agent-id` is refused (exit 2) before any
771
+ request, so a replayed acknowledgement cannot destroy a different agent. The
772
+ refusal names both spellings. This binding belongs to `agents delete` only — the
773
+ lifecycle and assignment `--confirm` flags stay plain acknowledgements.
774
+
758
775
  Before the delete it reads the agent once and prints the resolved destructive
759
776
  target (`agent_id`, `name`, `type`, `status`, `active`, `config_version`) and the
760
- disclosure block to stderr, so the operator approves an actual record, not a
761
- phrase. The same disclosure is carried under `data.disclosure` in the envelope
762
- (`irreversible`, `generated_file`, `dependency_guard`, `restore`,
763
- `authorization`, `recovery_trail`), and it is the honest server contract:
777
+ disclosure block to stderr **in every output mode**, so a scripted
778
+ `--output json` caller approves the record and the disclosure it was actually
779
+ shown rather than a phrase it never saw. `--output pretty` renders the same block
780
+ unchanged; `--output raw` is refused for every AMS command, so `json` is the
781
+ machine mode this command renders in. The same disclosure is carried under
782
+ `data.disclosure` in the envelope (`irreversible`, `generated_file`,
783
+ `dependency_guard`, `restore`, `authorization`, `recovery_trail`,
784
+ `review_staleness`), and it is the honest server contract:
764
785
 
765
786
  - the delete is a **hard delete** of the agent row: no soft delete, no
766
787
  tombstone, no retention window and no undelete route;
@@ -774,13 +795,22 @@ tombstone, no retention window and no undelete route;
774
795
  `hc ams agents export` if you may need it;
775
796
  - the route needs an authenticated tenant user only: no admin/role check is
776
797
  applied;
798
+ - `--confirm` approves the **pre-read snapshot** printed above, not the row the
799
+ server destroys: the route has no `If-Match` or version precondition, so a
800
+ concurrent recreate or configuration change between that read and the
801
+ `DELETE` is not detected and a different record can go. A `404`, or a `2xx`
802
+ with no body, from the confirmation read is read as absence, and the error
803
+ body cannot distinguish absence from a mid-operation authorization or scope
804
+ change;
777
805
  - only a server audit row (`AuditAction.DELETE`) remains.
778
806
 
779
807
  The sequence is exactly one `GET /agents/{agent_id}`, exactly one
780
808
  `DELETE /agents/{agent_id}` (204, no body) and exactly one confirmation `GET`.
781
- Only a `404` from that confirmation read proves the row is gone: the envelope
782
- then reports `data.deleted: true`, `data.evidence.deleted.status: "confirmed"`
783
- with `confirmation: "not_found"` and `confirmation_status: 404`, plus
809
+ A `404` from that confirmation read proves the row is gone, and so does a `2xx`
810
+ with no body (see below); a `404` is the only answer that also pins the status.
811
+ The envelope then reports `data.deleted: true`,
812
+ `data.evidence.deleted.status: "confirmed"` with `confirmation: "not_found"`
813
+ and `confirmation_status: 404`, plus
784
814
  `data.evidence.side_effects` and `data.evidence.runtime` (both always
785
815
  `unverified`) and `data.mutation_replayed: false`. The command prints no promise
786
816
  of restore and has no `--force`, no `--dry-run`, no interactive prompt and no
@@ -790,17 +820,26 @@ version flag would advertise protection the server does not offer.
790
820
  Default `pretty` output prints the result as labelled lines next to the stderr
791
821
  disclosure: `agent_id`, `deleted: true`, `target`, `disclosure`, `evidence`
792
822
  (`deleted`/`side_effects`/`runtime`), `mutation_replayed: false`, and a closing
793
- `verification:` block. `--output json` prints the full envelope, unchanged. The
794
- reviewed target and disclosure above are still printed to stderr in `pretty`
795
- mode only; `--output json`/`raw` keep stderr machine-parsable.
823
+ `verification:` block. `--output json` prints the full envelope on stdout,
824
+ unchanged and on stdout alone. Because the review also goes to stderr in `json`
825
+ mode, a **failing** confirmed delete prints that review followed by the one
826
+ error envelope on stderr: parse `stdout` for the success envelope, and take the
827
+ envelope from the first `{` on stderr when the command failed. That recipe
828
+ holds by construction, not by luck: every server-supplied value the review
829
+ prints (`agent_id`, `name`, `type`, `status`, `active`, `config_version`) has
830
+ its braces escaped as `\u007b`/`\u007d`, so the review never contains a literal
831
+ `{` or `}` and the first `{` on stderr always begins the envelope — an agent
832
+ named `beta{"deleted":true}` cannot break a scripted caller's parse.
796
833
 
797
834
  Without `--confirm` the command is a **preview**: it reads the agent exactly once
798
835
  (the same one bounded `GET`), prints `preview: --confirm was not passed, so
799
836
  nothing has been sent.` plus the resolved destructive target and the whole
800
837
  disclosure block to stderr, and exits 2 having sent no `DELETE`. With `--confirm`
801
838
  the sequence above is unchanged: it re-reads before the single `DELETE`, so a
802
- preview is never an approval token. The preview text is suppressed under
803
- `--output json`/`raw`, like the confirmed path's review.
839
+ preview is never an approval token. The preview text *alone* is suppressed under
840
+ `--output json`/`raw` (it accompanies a usage refusal, which prints no envelope);
841
+ the confirmed path's review is not: it prints to stderr in every output mode, as
842
+ described above.
804
843
 
805
844
  Refusals claim nothing and send nothing extra: an agent outside the explicit
806
845
  tenant, the tenant identity mismatch and a delete target that no longer exists
@@ -808,18 +847,51 @@ are refused before the `DELETE` (the preview reports the same `not_found`); a `4
808
847
  schedules; a `404` from the `DELETE` is `not_found`; and a `405` is the server's
809
848
  refusal (`unsupported`). None of them is retried.
810
849
 
811
- A transport error or `5xx` from the `DELETE` is `outcome: "unknown"` with
812
- `mutation_replayed: false`, `verification.saved_state: "unknown"` and a
850
+ Every **other** non-2xx answer to the `DELETE` (`400`, `401`, `403`, `422`,
851
+ `429`, …) is a send-once refusal, never the generic runner failure: the envelope
852
+ is `outcome: "failed"` with `verification.saved_state: "failed"`, the category
853
+ comes from the status (`validation`, `authentication`, `authorization`,
854
+ `conflict` for the statuses the shared mapping covers; a status it does not map,
855
+ such as `429`, falls back to `transport` and is a known follow-up),
856
+ `data.evidence.deleted.confirmation` is `not_attempted` with
857
+ `confirmation_status: null` (no confirmation read was taken), and the message
858
+ says the delete was sent once, that nothing was replayed, and points at
859
+ `hc ams agents list`. It also carries the `reconciliation: {"status":
860
+ "not_read", …}` block: this command did not re-read the agent, so a scripted
861
+ caller can tell it apart from a read-shaped outcome.
862
+
863
+ A transport error, a `408` or a `5xx` from the `DELETE` is `outcome: "unknown"`
864
+ with `mutation_replayed: false`, `verification.saved_state: "unknown"` and a
813
865
  `reconciliation: {"status": "not_read", …}` block; nothing is replayed and the
814
866
  agent is never restored — run `hc ams agents list` before doing anything else.
815
867
  The same unknown outcome applies when the delete was accepted but the
816
- confirmation read could not be read. A confirmation read that still returns the
817
- agent (`200`) — or a `2xx` body that cannot be read as an agent — is
818
- `outcome: "failed"` with `data.deleted: false` and
819
- `verification.saved_state: "failed"`, never success. A confirmation read that
820
- answers 401/403 (or any other non-404, non-2xx status) observed nothing about
821
- the row, so `data.evidence.deleted.confirmation` is `unobserved` — the same
822
- three-way state as the guardrail delete — and never `still_present`.
868
+ confirmation read could not be read, and when `Ctrl-C` interrupts either the
869
+ `DELETE` or the confirmation `GET`: the interrupt is caught (never swallowed
870
+ silently), the command still exits non-zero, and it prints the unknown-outcome
871
+ envelope instead of a plain failure that pretends nothing was sent.
872
+
873
+ A confirmation read that still returns the agent is `outcome: "failed"` with
874
+ `data.deleted: false`, `confirmation: "still_present"` and
875
+ `verification.saved_state: "failed"`, never success. A `2xx` body that cannot
876
+ be read as an agent is also `failed`, but `confirmation` is `unobserved`, with
877
+ wording that says the route still answers this path rather than claiming the
878
+ agent is still present. A confirmation read that answers 401/403 (or any other
879
+ non-404, non-2xx status) observed nothing about the row, so `confirmation` is
880
+ likewise `unobserved` — the same state as the guardrail delete — and never
881
+ `still_present`. A `2xx` with a **null or empty body** is the opposite case:
882
+ this server uses a `200` null body to say the agent does not exist (the same
883
+ answer `hc ams agents get` reports as `not_found`), so it proves absence exactly
884
+ as a `404` does. The envelope is then `outcome: "succeeded"` with
885
+ `data.deleted: true` and `confirmation: "not_found"` — never a `404` invented to
886
+ match the wording.
887
+
888
+ In every one of those non-`404` cases `confirmation_status` is `null`, and not
889
+ only when the body is unreadable: the SDK returns `None` for **any** response
890
+ with no content, before it looks at the status, so a `204`, a `202` with no body
891
+ and a `200` with a null body are indistinguishable at the client. A body-bearing
892
+ `2xx` does not pin the code either — `200`, `201` and `202` all read back the
893
+ same way. Only the `404` path can state a status it really observed, so only
894
+ that path records one.
823
895
 
824
896
  Read-only department listing and inspection use the same explicit tenant-admin
825
897
  targeting. They emit one versioned JSON result on stdout; failures emit one
@@ -1676,9 +1748,34 @@ additional data. Data-source reads refuse target files, root credentials or base
1676
1748
  URLs, raw output, blank or dot-segment IDs, and installed SDKs without both
1677
1749
  data-source methods before tenant-admin login or catalog reads.
1678
1750
 
1751
+ Read-only health-service catalog listing and inspection are complete and
1752
+ unpaged. The bounded projection includes only the stable ID, name, and the
1753
+ server's created/updated timestamps:
1754
+
1755
+ ```bash
1756
+ uv run --frozen hc ams health-services list --environment dev --tenant-id TENANT_ID
1757
+ uv run --frozen hc ams health-services get --environment dev --tenant-id TENANT_ID \
1758
+ --service-id SERVICE_ID
1759
+ ```
1760
+
1761
+ When both target flags are omitted, these commands may use the matching saved
1762
+ tenant-admin session. Explicit flags must match that session. Health-service
1763
+ output never includes descriptions or arbitrary response fields, and does not
1764
+ imply booking, availability, pricing, scheduling, or that a service is offered
1765
+ to a patient. The CLI does not create, update, or delete health services. It
1766
+ makes exactly one catalog GET after tenant-admin login and does not paginate,
1767
+ retry, cache, truncate, join, or infer additional data. A `get` whose service ID
1768
+ is unknown in this tenant reports `not_found` and names the requested ID: a 404
1769
+ from the route, a null 2xx body, and a record whose tenant does not match the
1770
+ session all fail without an envelope claiming success (a foreign-tenant record is
1771
+ a `validation` identity refusal). Health-service reads refuse target files, root
1772
+ credentials or base URLs, raw output, blank or dot-segment IDs, and installed
1773
+ SDKs without both health-service methods before tenant-admin login or catalog
1774
+ reads.
1775
+
1679
1776
  ### AMS output modes
1680
1777
 
1681
- The read commands (`hc ams skills|tools|policies|guardrails|data-sources|teams|departments list|get`
1778
+ The read commands (`hc ams skills|tools|policies|guardrails|data-sources|health-services|teams|departments list|get`
1682
1779
  and `hc ams organization hierarchy`) render in two modes (`--output` on the root
1683
1780
  `hc` command; `pretty` is the default):
1684
1781
 
@@ -26,6 +26,9 @@ from .operations import (
26
26
  LOGIN_HINT = "Not logged in; run `hc login` before changing an agent's lifecycle state."
27
27
  ASSIGNMENT_LOGIN_HINT = "Not logged in; run `hc login` before changing an agent's assignments."
28
28
  DELETE_LOGIN_HINT = "Not logged in; run `hc login` before deleting an agent."
29
+ # The bare `--confirm` spelling's value: distinct from every agent id, so the
30
+ # delete can accept `--confirm` or `--confirm AGENT_ID` from one option.
31
+ BARE_CONFIRM = "--confirm"
29
32
 
30
33
 
31
34
  def _environment(function):
@@ -167,15 +170,25 @@ def create_delete_command(dependencies: AmsDependencies) -> click.Command:
167
170
  @_agent
168
171
  @click.option(
169
172
  "--confirm",
170
- is_flag=True,
171
- default=False,
173
+ is_flag=False,
174
+ flag_value=BARE_CONFIRM,
175
+ default=None,
172
176
  help="Required acknowledgement of the printed target and disclosure block; without it the command "
173
- "prints both and sends nothing.",
177
+ "prints both and sends nothing. Pass it bare, or as the agent ID being deleted (`--confirm "
178
+ "AGENT_ID`); a value that does not match --agent-id is refused before any request.",
174
179
  )
175
180
  @pass_ams
176
- def command(invocation, environment: str | None, tenant_id: str | None, agent_id: str, confirm: bool) -> None:
181
+ def command(invocation, environment: str | None, tenant_id: str | None, agent_id: str, confirm: str | None) -> None:
177
182
  target_data = {"environment": environment, "tenant_id": tenant_id, "agent_id": agent_id}
178
- if not confirm:
183
+ if confirm is not None and confirm not in (BARE_CONFIRM, agent_id):
184
+ # Bound approval: a replayed flag cannot acknowledge one agent and
185
+ # destroy another. The bare spelling keeps working, and the refusal
186
+ # names both spellings.
187
+ raise click.UsageError(
188
+ f"--confirm '{confirm}' does not match --agent-id '{agent_id}'; nothing was sent. "
189
+ f"Acknowledge this delete with the bare `--confirm` flag or `--confirm {agent_id}`."
190
+ )
191
+ if confirm is None:
179
192
  _preview_then_refuse(
180
193
  invocation,
181
194
  "agents.delete",