healthcloud-cli 3.3.0__tar.gz → 3.5.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 (83) hide show
  1. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/.gitignore +5 -0
  2. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/PKG-INFO +256 -16
  3. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/README.md +255 -15
  4. healthcloud_cli-3.5.0/healthcloud_cli/ams/agents/commands.py +92 -0
  5. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/agents/operations.py +43 -20
  6. healthcloud_cli-3.5.0/healthcloud_cli/ams/auth.py +91 -0
  7. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/compatibility.py +6 -4
  8. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/context.py +112 -1
  9. healthcloud_cli-3.5.0/healthcloud_cli/ams/data_sources/__init__.py +5 -0
  10. healthcloud_cli-3.5.0/healthcloud_cli/ams/data_sources/commands.py +61 -0
  11. healthcloud_cli-3.5.0/healthcloud_cli/ams/data_sources/group.py +18 -0
  12. healthcloud_cli-3.5.0/healthcloud_cli/ams/data_sources/operations.py +71 -0
  13. healthcloud_cli-3.5.0/healthcloud_cli/ams/data_sources/projections.py +12 -0
  14. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/departments/commands.py +9 -7
  15. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/departments/operations.py +2 -0
  16. healthcloud_cli-3.5.0/healthcloud_cli/ams/errors.py +215 -0
  17. healthcloud_cli-3.5.0/healthcloud_cli/ams/guardrails/__init__.py +5 -0
  18. healthcloud_cli-3.5.0/healthcloud_cli/ams/guardrails/commands.py +57 -0
  19. healthcloud_cli-3.5.0/healthcloud_cli/ams/guardrails/group.py +18 -0
  20. healthcloud_cli-3.5.0/healthcloud_cli/ams/guardrails/operations.py +70 -0
  21. healthcloud_cli-3.5.0/healthcloud_cli/ams/guardrails/projections.py +18 -0
  22. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/organization/commands.py +6 -5
  23. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/organization/operations.py +1 -0
  24. healthcloud_cli-3.5.0/healthcloud_cli/ams/policies/__init__.py +5 -0
  25. healthcloud_cli-3.5.0/healthcloud_cli/ams/policies/commands.py +57 -0
  26. healthcloud_cli-3.5.0/healthcloud_cli/ams/policies/group.py +18 -0
  27. healthcloud_cli-3.5.0/healthcloud_cli/ams/policies/operations.py +68 -0
  28. healthcloud_cli-3.5.0/healthcloud_cli/ams/policies/projections.py +21 -0
  29. healthcloud_cli-3.5.0/healthcloud_cli/ams/pretty.py +133 -0
  30. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/registry.py +10 -0
  31. healthcloud_cli-3.5.0/healthcloud_cli/ams/results.py +42 -0
  32. healthcloud_cli-3.5.0/healthcloud_cli/ams/session.py +347 -0
  33. healthcloud_cli-3.5.0/healthcloud_cli/ams/skills/__init__.py +5 -0
  34. healthcloud_cli-3.5.0/healthcloud_cli/ams/skills/commands.py +57 -0
  35. healthcloud_cli-3.5.0/healthcloud_cli/ams/skills/group.py +18 -0
  36. healthcloud_cli-3.5.0/healthcloud_cli/ams/skills/operations.py +68 -0
  37. healthcloud_cli-3.5.0/healthcloud_cli/ams/skills/projections.py +19 -0
  38. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/teams/commands.py +9 -7
  39. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/teams/operations.py +2 -1
  40. healthcloud_cli-3.5.0/healthcloud_cli/ams/tools/__init__.py +5 -0
  41. healthcloud_cli-3.5.0/healthcloud_cli/ams/tools/commands.py +57 -0
  42. healthcloud_cli-3.5.0/healthcloud_cli/ams/tools/group.py +18 -0
  43. healthcloud_cli-3.5.0/healthcloud_cli/ams/tools/operations.py +66 -0
  44. healthcloud_cli-3.5.0/healthcloud_cli/ams/tools/projections.py +21 -0
  45. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/windows_files.py +51 -2
  46. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/cli.py +164 -1
  47. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/pyproject.toml +1 -1
  48. healthcloud_cli-3.3.0/healthcloud_cli/ams/agents/commands.py +0 -83
  49. healthcloud_cli-3.3.0/healthcloud_cli/ams/auth.py +0 -53
  50. healthcloud_cli-3.3.0/healthcloud_cli/ams/errors.py +0 -87
  51. healthcloud_cli-3.3.0/healthcloud_cli/ams/results.py +0 -31
  52. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/hatch_build.py +0 -0
  53. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/__init__.py +0 -0
  54. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/__init__.py +0 -0
  55. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/agents/__init__.py +0 -0
  56. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/agents/group.py +0 -0
  57. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/agents/projections.py +0 -0
  58. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/commands.py +0 -0
  59. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/departments/__init__.py +0 -0
  60. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/departments/group.py +0 -0
  61. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/departments/projections.py +0 -0
  62. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/domain_errors.py +0 -0
  63. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/group.py +0 -0
  64. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/organization/__init__.py +0 -0
  65. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/organization/group.py +0 -0
  66. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/organization/projections.py +0 -0
  67. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/output.py +0 -0
  68. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/target.py +0 -0
  69. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/teams/__init__.py +0 -0
  70. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/teams/group.py +0 -0
  71. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/teams/projections.py +0 -0
  72. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/tuning.py +0 -0
  73. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/ams/ui.py +0 -0
  74. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/context.py +0 -0
  75. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/contracts/__init__.py +0 -0
  76. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/contracts/mcp-tools.manifest.json +0 -0
  77. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/main.py +0 -0
  78. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/manifest.py +0 -0
  79. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/output.py +0 -0
  80. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/params.py +0 -0
  81. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/healthcloud_cli/util.py +0 -0
  82. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/scripts/__init__.py +0 -0
  83. {healthcloud_cli-3.3.0 → healthcloud_cli-3.5.0}/scripts/bundle_manifest.py +0 -0
@@ -255,3 +255,8 @@ packages/pip-tenantadmin/README.md
255
255
 
256
256
  # Live SDK test assets stay in the archived SDK history, outside this source import.
257
257
  integration-tests/shared/test-assets/
258
+
259
+ # Ralph loop runtime state
260
+ .ralph/
261
+ /PROMPT.md
262
+ .blind-peer-review/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: healthcloud-cli
3
- Version: 3.3.0
3
+ Version: 3.5.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
@@ -69,10 +69,10 @@ _HC_COMPLETE=bash_complete COMP_WORDS="hc ams inspect --o" COMP_CWORD=3 uv run -
69
69
  ```
70
70
 
71
71
  Operational validation starts only when Click invokes an AMS leaf callback.
72
- `discover` then validates its explicit environment and tenant arguments; the
73
- other leaves require `--target-file` and apply the existing root, target, and
74
- authentication checks described below. Deferring preflight does not relax
75
- those safety requirements.
72
+ `discover`, `agents`, `departments`, `teams`, `organization`, `skills`, and `policies` then
73
+ validate their explicit environment and tenant arguments; the remaining leaves
74
+ require `--target-file`. All apply the root, target, and authentication checks
75
+ described below. Deferring preflight does not relax those safety requirements.
76
76
 
77
77
  The bundled tool manifest (`healthcloud_cli/contracts/mcp-tools.manifest.json`)
78
78
  is a copy of `packages/cli/contracts/mcp-tools.manifest.json`. Re-sync it
@@ -280,20 +280,87 @@ uv sync --frozen --extra dev
280
280
  uv run --frozen hc ams --help
281
281
  ```
282
282
 
283
- Bootstrap candidate IDs with the public SDK discovery endpoint. Both flags are
284
- required; no MCP defaults, admin login, or automatic candidate selection are used:
283
+ Create one private tenant-admin session before interactive AMS work, inspect its
284
+ non-secret binding, and remove it when finished:
285
+
286
+ ```bash
287
+ uv run --frozen hc login --environment dev --tenant-id TENANT_ID
288
+ uv run --frozen hc login --status
289
+ uv run --frozen hc logout
290
+ ```
291
+
292
+ `hc login` reads `HC_AMS_ADMIN_EMAIL` and `HC_AMS_ADMIN_PASSWORD` when present,
293
+ otherwise it prompts (with hidden password input). It stores only the email,
294
+ tenant/environment binding, access/refresh tokens and expiry in the strict
295
+ owner-only `~/.healthcloud/cli/ams-session.json`; it never stores the password.
296
+
297
+ For CI and agents, log in non-interactively: pass `--email` and pipe the password
298
+ to `--password-stdin` (read as exactly one stdin line, never echoed, never a
299
+ flag value — there is no `--password` option):
300
+
301
+ ```bash
302
+ printf '%s\n' "$HC_AMS_ADMIN_PASSWORD" | \
303
+ uv run --frozen hc login --environment dev --tenant-id TENANT_ID \
304
+ --email "$HC_AMS_ADMIN_EMAIL" --password-stdin
305
+ ```
306
+
307
+ `--email` beats `HC_AMS_ADMIN_EMAIL` and `--password-stdin` beats
308
+ `HC_AMS_ADMIN_PASSWORD`. With `--password-stdin`, the piped line is always the
309
+ password: it is read before any prompt, so it can never be consumed as the
310
+ email, and the email must come from `--email`, `HC_AMS_ADMIN_EMAIL` or (only on
311
+ an interactive terminal) the email prompt. When stdin is not an interactive
312
+ terminal and neither `--password-stdin` nor `HC_AMS_ADMIN_PASSWORD` supplies the
313
+ password, `hc login` refuses with that guidance instead of attempting a hidden
314
+ prompt (no `GetPassWarning`, no echoed password); a missing email on a
315
+ non-interactive stdin (or a process with no stdin stream at all) is refused the
316
+ same way, naming `--email`/`--password-stdin`; every refusal happens before any
317
+ login request. `--status` cannot be combined with `--email` or `--password-stdin`.
318
+ Even on an interactive terminal, `--password-stdin` suppresses terminal echo
319
+ while the single line is read and restores it afterwards; a stdin stream that is
320
+ closed or errors mid-read is refused cleanly (exit 2, never a traceback).
321
+ AMS commands may omit both target flags while this session is present, except
322
+ that a `prod` session still needs `--environment prod` on every command. Explicit
323
+ flags and target files must match it exactly. A session within 60 seconds of
324
+ expiry is refreshed once before the operation, under a lock so concurrent
325
+ commands never spend the same refresh token (a second command waits up to 30 seconds, then stops), and
326
+ atomically replaced. Refresh
327
+ failure stops without an AMS call or password fallback and asks for a new login.
328
+ If the refreshed session cannot be saved, the current command still finishes and
329
+ prints a warning to run `hc login` again.
330
+
331
+ `~/.healthcloud` and `~/.healthcloud/cli` must be directories you own with mode
332
+ 700; the CLI creates them that way, and refuses (naming the directory and the
333
+ `chmod 700` fix) if an existing one is shared. `hc logout` deletes the local file
334
+ only and reports `"server_session_revoked": false`: issued tokens stay valid
335
+ until they expire.
336
+
337
+ Bootstrap candidate IDs with the public SDK discovery endpoint. Without a saved
338
+ session both flags are required; a saved session supplies both together. No MCP
339
+ defaults, admin login, or automatic candidate selection are used:
285
340
 
286
341
  ```bash
287
342
  uv run --frozen hc ams discover --environment dev --tenant-id TENANT_ID
288
343
  ```
289
344
 
290
- Read-only agent listing, inspection and export also take explicit flags instead
291
- of a target file, and log in as tenant admin (`HC_AMS_ADMIN_EMAIL` /
292
- `HC_AMS_ADMIN_PASSWORD`). Stdout carries bounded metadata only; `adapter` shows
345
+ Read-only agent listing, inspection and export take flags instead of a target
346
+ file; both may be omitted together when a matching saved session exists. Without
347
+ one, they log in as tenant admin using `HC_AMS_ADMIN_EMAIL` /
348
+ `HC_AMS_ADMIN_PASSWORD`. They emit the same versioned result envelope as the
349
+ other read domains (`operation`, `outcome`, `schema_version`, `target`, `data`;
350
+ no `verification` block on reads); failures emit one categorized JSON error
351
+ envelope on stderr with the same categories (not found, target mismatch,
352
+ refusal, logged out), not the plain-text `Error: …` lines of earlier releases.
353
+ `agents list` carries bounded projections under `data.agents` plus a `page`
354
+ block; `agents get` carries the bounded projection under `data.agent`. The
355
+ legacy top-level `{"agents": …, "environment": …, "tenant_id": …}` shape is
356
+ intentionally replaced by this envelope — scripts must read the new shape.
357
+ Stdout carries bounded metadata only; `adapter` shows
293
358
  whether an agent runs from the `file` or `db` config adapter (`unknown` when the
294
359
  server does not say). `export` first re-checks the agent/tenant identity, then
295
360
  saves the server's own JSON/YAML export byte-for-byte to a new owner-only `--out`
296
- file, refusing (and leaving no file) when the body is not valid UTF-8. `export`
361
+ file (exact bytes preserved), refusing (and leaving no file) when the body is
362
+ not valid UTF-8; its stdout reports the envelope with the file `path`, `format`
363
+ and `sha256` under `data` and the `agent_id` in `target`. `export`
297
364
  needs an AMS build that serves `/agents/{agent_id}/configuration/export`; that
298
365
  route is not yet deployed to dev:
299
366
 
@@ -304,6 +371,23 @@ uv run --frozen hc ams agents export --environment dev --tenant-id TENANT_ID --a
304
371
  --format yaml --out agent.yaml
305
372
  ```
306
373
 
374
+ For example, `hc ams agents list` succeeds with (formatted for readability):
375
+
376
+ ```json
377
+ {"schema_version": 1, "operation": "agents.list", "outcome": "succeeded",
378
+ "target": {"environment": "dev", "tenant_id": "TENANT_ID"},
379
+ "data": {"agents": [{"id": "AGENT_ID", "name": "…", "adapter": "file", "…": "…"}],
380
+ "page": {"kind": "unpaged", "returned_count": 1, "continuation": null}}}
381
+ ```
382
+
383
+ and a missing `--agent-id` fails with one envelope on stderr and exit 1:
384
+
385
+ ```json
386
+ {"schema_version": 1, "operation": "agents.get", "outcome": "failed",
387
+ "target": {"environment": "dev", "tenant_id": "TENANT_ID", "agent_id": "AGENT_ID"},
388
+ "error": {"category": "not_found", "message": "Agent 'AGENT_ID' was not found."}}
389
+ ```
390
+
307
391
  Read-only department listing and inspection use the same explicit tenant-admin
308
392
  targeting. They emit one versioned JSON result on stdout; failures emit one
309
393
  categorized JSON result on stderr. Department descriptions, creator identities,
@@ -335,6 +419,162 @@ or inferring missing relationships:
335
419
  uv run --frozen hc ams organization hierarchy --environment dev --tenant-id TENANT_ID
336
420
  ```
337
421
 
422
+ Read-only skill catalog listing and inspection are complete and unpaged. The
423
+ bounded projection includes only skill IDs, names, tool IDs, and audit timestamps;
424
+ it omits descriptions, tenant identity, creator identity, arbitrary response
425
+ fields, and tool details. Tool-ID order is preserved:
426
+
427
+ ```bash
428
+ uv run --frozen hc ams skills list --environment dev --tenant-id TENANT_ID
429
+ uv run --frozen hc ams skills get --environment dev --tenant-id TENANT_ID --skill-id SKILL_ID
430
+ ```
431
+
432
+ The CLI does not create, update, delete, or assign skills. Skill commands do not
433
+ read guardrails. They make exactly one catalog GET after tenant-admin login
434
+ and does not paginate, retry, cache, join, or infer additional catalog data.
435
+ Skill reads refuse target files, root credentials or base URLs, raw output,
436
+ blank or dot-segment skill IDs, and installed SDKs that do not provide both
437
+ skill list and get methods. These local refusals happen before tenant-admin login
438
+ or catalog reads.
439
+
440
+ Read-only policy catalog listing and inspection are complete and unpaged. The
441
+ bounded projection includes only policy IDs, names, department IDs, guardrail
442
+ IDs, active status, and audit timestamps. It never emits protected policy
443
+ content, descriptions, tenant or creator identity, arbitrary response fields,
444
+ or joined department/guardrail details. Guardrail-ID order is preserved:
445
+
446
+ ```bash
447
+ uv run --frozen hc ams policies list --environment dev --tenant-id TENANT_ID
448
+ uv run --frozen hc ams policies get --environment dev --tenant-id TENANT_ID --policy-id POLICY_ID
449
+ ```
450
+
451
+ The CLI does not export protected policy content; create, update, delete, or
452
+ assign policies; or join guardrail records. It makes exactly one catalog GET after
453
+ tenant-admin login and does not paginate, retry, cache, join, or infer referenced
454
+ resources. Policy reads refuse target files, root credentials or base URLs, raw
455
+ output, blank or dot-segment policy IDs, and installed SDKs without both policy
456
+ methods before tenant-admin login or catalog reads. Successful reads make no
457
+ assignment, deployment, serving, enforcement, or effectiveness claim.
458
+
459
+ Read-only guardrail catalog listing and inspection are complete and unpaged.
460
+ The bounded projection includes only guardrail IDs, names, and audit timestamps.
461
+ It never emits protected rules, descriptions, tenant or creator identity,
462
+ arbitrary response fields, or joined policy/agent details:
463
+
464
+ ```bash
465
+ uv run --frozen hc ams guardrails list --environment dev --tenant-id TENANT_ID
466
+ uv run --frozen hc ams guardrails get --environment dev --tenant-id TENANT_ID \
467
+ --guardrail-id GUARDRAIL_ID
468
+ ```
469
+
470
+ The CLI does not export rules; create, update, delete, assign, deploy, or enforce
471
+ guardrails; or claim they are active or effective. It makes exactly one catalog
472
+ GET after tenant-admin login and does not paginate, retry, cache, join, or infer
473
+ additional data. Guardrail reads refuse target files, root credentials or base
474
+ URLs, raw output, blank or dot-segment guardrail IDs, and installed SDKs without
475
+ both guardrail methods before tenant-admin login or catalog reads.
476
+
477
+ Read-only tool catalog listing and inspection are complete and unpaged. The
478
+ bounded projection includes only IDs, names, read-only and confirmation flags,
479
+ agent types, required scopes, audit events, and activity labels:
480
+
481
+ ```bash
482
+ uv run --frozen hc ams tools list --environment dev --tenant-id TENANT_ID
483
+ uv run --frozen hc ams tools get --environment dev --tenant-id TENANT_ID \
484
+ --tool-id TOOL_ID
485
+ ```
486
+
487
+ When both target flags are omitted, these commands may use the matching saved
488
+ tenant-admin session. Explicit flags must match that session. Tool output never
489
+ includes descriptions, parameters, input schemas, PIP or connector routing, or
490
+ arbitrary response fields. The CLI does not execute, assign, create, update, or
491
+ delete tools; join agents or skills; or claim assignment, availability,
492
+ authorization, deployment, serving, or runtime effectiveness. It makes exactly
493
+ one catalog GET after tenant-admin login and does not paginate, retry, cache,
494
+ join, or infer additional data. Tool reads refuse target files, root credentials
495
+ or base URLs, raw output, blank or dot-segment IDs, and installed SDKs without
496
+ both tool methods before tenant-admin login or catalog reads.
497
+
498
+ Read-only data-source catalog listing and inspection are complete and unpaged.
499
+ The bounded projection includes only stable IDs and names:
500
+
501
+ ```bash
502
+ uv run --frozen hc ams data-sources list --environment dev --tenant-id TENANT_ID
503
+ uv run --frozen hc ams data-sources get --environment dev --tenant-id TENANT_ID \
504
+ --data-source-id DATA_SOURCE_ID
505
+ ```
506
+
507
+ When both target flags are omitted, these commands may use the matching saved
508
+ tenant-admin session. Explicit flags must match that session. Data-source output
509
+ never includes descriptions or arbitrary response fields and does not imply
510
+ access, patient consent, record availability, assignment, authorization, or
511
+ runtime effectiveness. The CLI does not create, update, delete, assign, access
512
+ records through, or execute data sources. It makes exactly one catalog GET after
513
+ tenant-admin login and does not paginate, retry, cache, truncate, join, or infer
514
+ additional data. Data-source reads refuse target files, root credentials or base
515
+ URLs, raw output, blank or dot-segment IDs, and installed SDKs without both
516
+ data-source methods before tenant-admin login or catalog reads.
517
+
518
+ ### AMS output modes
519
+
520
+ The read commands (`hc ams skills|tools|policies|guardrails|data-sources|teams|departments list|get`
521
+ and `hc ams organization hierarchy`) render in two modes (`--output` on the root
522
+ `hc` command; `pretty` is the default):
523
+
524
+ - **`pretty`** (default): a compact human view. Lists print an `ID`/`NAME`
525
+ table with an entry count; a single record prints `key: value` lines; the
526
+ organization hierarchy prints an indented tree. Each failed AMS command
527
+ prints one stderr line, `error: <message> (<category>)` (flag/argument
528
+ usage errors from Click print Click's standard usage message instead).
529
+ - **`json`**: the stable result envelope (below) on stdout. When stdout is not
530
+ a terminal, the envelope is printed as one compact line; on a terminal it is
531
+ indented. Errors keep the structured JSON envelope on stderr.
532
+
533
+ The JSON envelope carries `schema_version`, `operation`, `target`, `outcome`,
534
+ and either `data` (succeeded) or `error: {category, message}` (failed). On
535
+ read-only operations the envelope no longer includes the `verification` block:
536
+ every field there is `not_applicable` on a read, so it was boilerplate. If a
537
+ future mutating operation reintroduces it, `verification` reappears only with
538
+ non-`not_applicable` content. Everything else about the envelope — field names,
539
+ ordering semantics, categories — is unchanged and stays parseable.
540
+
541
+ `--raw`/`--output raw` stays refused for AMS (`Raw output is refused for AMS.`),
542
+ and refusals keep the JSON error envelope on stderr.
543
+
544
+ ```bash
545
+ hc ams skills list --environment dev --tenant-id TENANT_ID # pretty table
546
+ hc ams skills get --environment dev --tenant-id TENANT_ID --skill-id SKILL_ID # key: value
547
+ hc --output json ams skills list --environment dev --tenant-id TENANT_ID # compact envelope
548
+ hc --output json ams skills list --environment dev --tenant-id TENANT_ID | jq .data
549
+ ```
550
+
551
+ ### What `hc ams` errors report
552
+
553
+ In `json` and `raw` modes each failed AMS command prints one JSON object on stderr with
554
+ an `error.category` and a message naming the real cause; in `pretty` mode the
555
+ same message is exactly one stderr line, `error: <message> (<category>)`:
556
+
557
+ - Local refusals keep their specific message and exit `1` with category
558
+ `validation`: `Raw output is refused for AMS.`, `AMS target does not match the
559
+ saved session; stopped before authentication.`, identity mismatches
560
+ (`Skill/tenant identity mismatch; stopped.`), and dot-segment ID refusals.
561
+ - No saved session and no target flags: category `authentication` with
562
+ `Not logged in; run \`hc login --environment <env> --tenant-id <tenant>\`.`
563
+ - A `get` whose requested ID does not exist (HTTP 404): category `not_found`
564
+ naming the ID, e.g. `Skill 'nosuch' was not found.` (a 404 on `list` stays
565
+ `validation`; departments keeps its legacy contract for all read statuses).
566
+ - HTTP 401/403 map to `authentication`/`authorization`; 409 to `conflict`;
567
+ network failures to `transport`; local output failures to `local_io`.
568
+ - Any unexpected internal error is category `internal` with a generic message;
569
+ it is never labeled `validation` and never leaks exception details.
570
+
571
+ ```bash
572
+ hc --raw ams skills list --environment dev --tenant-id TENANT_ID # validation: raw refused
573
+ hc ams skills list --tenant-id OTHER_TENANT # validation: target mismatch
574
+ hc ams skills list # authentication: not logged in
575
+ hc ams skills get --skill-id NOSUCH # not_found: names the ID
576
+ ```
577
+
338
578
  Every other command requires an explicit local, non-secret target JSON file.
339
579
  Only the canonical HTTPS AMS origin for that environment is accepted; custom
340
580
  origins require separately verified support. Target and nested qualification keys
@@ -403,11 +643,11 @@ configuration and recheck it before apply and selected-field restore. This is an
403
643
  operator prerequisite: the current CLI does not automatically attest deployment
404
644
  or all-writer coverage, and the record adds no server authorization boundary.
405
645
 
406
- Credentials enter only through `HC_AMS_ADMIN_EMAIL` and `HC_AMS_ADMIN_PASSWORD`
407
- in the current process, intended for composition with the existing
408
- `onepassword-env` wrapper. Each invocation logs in through `HCTenantAdminSDK`;
409
- tokens remain private in memory. There is no token cache, fallback identity,
410
- secret argument, resolved env file, or browser credential bridge. Root MCP
646
+ For CI and scripts with no saved session, credentials may still enter through
647
+ `HC_AMS_ADMIN_EMAIL` and `HC_AMS_ADMIN_PASSWORD` in the current process, intended
648
+ for composition with the existing `onepassword-env` wrapper; that compatibility
649
+ path logs in once per invocation. There is no fallback identity, secret argument,
650
+ arbitrary token import, resolved env file, keychain, or browser credential bridge. Root MCP
411
651
  `--access-token`, `--base-url`, their environment equivalents, and token/base-URL
412
652
  profiles are refused for AMS. Root profile environment values do not select AMS.
413
653
 
@@ -51,10 +51,10 @@ _HC_COMPLETE=bash_complete COMP_WORDS="hc ams inspect --o" COMP_CWORD=3 uv run -
51
51
  ```
52
52
 
53
53
  Operational validation starts only when Click invokes an AMS leaf callback.
54
- `discover` then validates its explicit environment and tenant arguments; the
55
- other leaves require `--target-file` and apply the existing root, target, and
56
- authentication checks described below. Deferring preflight does not relax
57
- those safety requirements.
54
+ `discover`, `agents`, `departments`, `teams`, `organization`, `skills`, and `policies` then
55
+ validate their explicit environment and tenant arguments; the remaining leaves
56
+ require `--target-file`. All apply the root, target, and authentication checks
57
+ described below. Deferring preflight does not relax those safety requirements.
58
58
 
59
59
  The bundled tool manifest (`healthcloud_cli/contracts/mcp-tools.manifest.json`)
60
60
  is a copy of `packages/cli/contracts/mcp-tools.manifest.json`. Re-sync it
@@ -262,20 +262,87 @@ uv sync --frozen --extra dev
262
262
  uv run --frozen hc ams --help
263
263
  ```
264
264
 
265
- Bootstrap candidate IDs with the public SDK discovery endpoint. Both flags are
266
- required; no MCP defaults, admin login, or automatic candidate selection are used:
265
+ Create one private tenant-admin session before interactive AMS work, inspect its
266
+ non-secret binding, and remove it when finished:
267
+
268
+ ```bash
269
+ uv run --frozen hc login --environment dev --tenant-id TENANT_ID
270
+ uv run --frozen hc login --status
271
+ uv run --frozen hc logout
272
+ ```
273
+
274
+ `hc login` reads `HC_AMS_ADMIN_EMAIL` and `HC_AMS_ADMIN_PASSWORD` when present,
275
+ otherwise it prompts (with hidden password input). It stores only the email,
276
+ tenant/environment binding, access/refresh tokens and expiry in the strict
277
+ owner-only `~/.healthcloud/cli/ams-session.json`; it never stores the password.
278
+
279
+ For CI and agents, log in non-interactively: pass `--email` and pipe the password
280
+ to `--password-stdin` (read as exactly one stdin line, never echoed, never a
281
+ flag value — there is no `--password` option):
282
+
283
+ ```bash
284
+ printf '%s\n' "$HC_AMS_ADMIN_PASSWORD" | \
285
+ uv run --frozen hc login --environment dev --tenant-id TENANT_ID \
286
+ --email "$HC_AMS_ADMIN_EMAIL" --password-stdin
287
+ ```
288
+
289
+ `--email` beats `HC_AMS_ADMIN_EMAIL` and `--password-stdin` beats
290
+ `HC_AMS_ADMIN_PASSWORD`. With `--password-stdin`, the piped line is always the
291
+ password: it is read before any prompt, so it can never be consumed as the
292
+ email, and the email must come from `--email`, `HC_AMS_ADMIN_EMAIL` or (only on
293
+ an interactive terminal) the email prompt. When stdin is not an interactive
294
+ terminal and neither `--password-stdin` nor `HC_AMS_ADMIN_PASSWORD` supplies the
295
+ password, `hc login` refuses with that guidance instead of attempting a hidden
296
+ prompt (no `GetPassWarning`, no echoed password); a missing email on a
297
+ non-interactive stdin (or a process with no stdin stream at all) is refused the
298
+ same way, naming `--email`/`--password-stdin`; every refusal happens before any
299
+ login request. `--status` cannot be combined with `--email` or `--password-stdin`.
300
+ Even on an interactive terminal, `--password-stdin` suppresses terminal echo
301
+ while the single line is read and restores it afterwards; a stdin stream that is
302
+ closed or errors mid-read is refused cleanly (exit 2, never a traceback).
303
+ AMS commands may omit both target flags while this session is present, except
304
+ that a `prod` session still needs `--environment prod` on every command. Explicit
305
+ flags and target files must match it exactly. A session within 60 seconds of
306
+ expiry is refreshed once before the operation, under a lock so concurrent
307
+ commands never spend the same refresh token (a second command waits up to 30 seconds, then stops), and
308
+ atomically replaced. Refresh
309
+ failure stops without an AMS call or password fallback and asks for a new login.
310
+ If the refreshed session cannot be saved, the current command still finishes and
311
+ prints a warning to run `hc login` again.
312
+
313
+ `~/.healthcloud` and `~/.healthcloud/cli` must be directories you own with mode
314
+ 700; the CLI creates them that way, and refuses (naming the directory and the
315
+ `chmod 700` fix) if an existing one is shared. `hc logout` deletes the local file
316
+ only and reports `"server_session_revoked": false`: issued tokens stay valid
317
+ until they expire.
318
+
319
+ Bootstrap candidate IDs with the public SDK discovery endpoint. Without a saved
320
+ session both flags are required; a saved session supplies both together. No MCP
321
+ defaults, admin login, or automatic candidate selection are used:
267
322
 
268
323
  ```bash
269
324
  uv run --frozen hc ams discover --environment dev --tenant-id TENANT_ID
270
325
  ```
271
326
 
272
- Read-only agent listing, inspection and export also take explicit flags instead
273
- of a target file, and log in as tenant admin (`HC_AMS_ADMIN_EMAIL` /
274
- `HC_AMS_ADMIN_PASSWORD`). Stdout carries bounded metadata only; `adapter` shows
327
+ Read-only agent listing, inspection and export take flags instead of a target
328
+ file; both may be omitted together when a matching saved session exists. Without
329
+ one, they log in as tenant admin using `HC_AMS_ADMIN_EMAIL` /
330
+ `HC_AMS_ADMIN_PASSWORD`. They emit the same versioned result envelope as the
331
+ other read domains (`operation`, `outcome`, `schema_version`, `target`, `data`;
332
+ no `verification` block on reads); failures emit one categorized JSON error
333
+ envelope on stderr with the same categories (not found, target mismatch,
334
+ refusal, logged out), not the plain-text `Error: …` lines of earlier releases.
335
+ `agents list` carries bounded projections under `data.agents` plus a `page`
336
+ block; `agents get` carries the bounded projection under `data.agent`. The
337
+ legacy top-level `{"agents": …, "environment": …, "tenant_id": …}` shape is
338
+ intentionally replaced by this envelope — scripts must read the new shape.
339
+ Stdout carries bounded metadata only; `adapter` shows
275
340
  whether an agent runs from the `file` or `db` config adapter (`unknown` when the
276
341
  server does not say). `export` first re-checks the agent/tenant identity, then
277
342
  saves the server's own JSON/YAML export byte-for-byte to a new owner-only `--out`
278
- file, refusing (and leaving no file) when the body is not valid UTF-8. `export`
343
+ file (exact bytes preserved), refusing (and leaving no file) when the body is
344
+ not valid UTF-8; its stdout reports the envelope with the file `path`, `format`
345
+ and `sha256` under `data` and the `agent_id` in `target`. `export`
279
346
  needs an AMS build that serves `/agents/{agent_id}/configuration/export`; that
280
347
  route is not yet deployed to dev:
281
348
 
@@ -286,6 +353,23 @@ uv run --frozen hc ams agents export --environment dev --tenant-id TENANT_ID --a
286
353
  --format yaml --out agent.yaml
287
354
  ```
288
355
 
356
+ For example, `hc ams agents list` succeeds with (formatted for readability):
357
+
358
+ ```json
359
+ {"schema_version": 1, "operation": "agents.list", "outcome": "succeeded",
360
+ "target": {"environment": "dev", "tenant_id": "TENANT_ID"},
361
+ "data": {"agents": [{"id": "AGENT_ID", "name": "…", "adapter": "file", "…": "…"}],
362
+ "page": {"kind": "unpaged", "returned_count": 1, "continuation": null}}}
363
+ ```
364
+
365
+ and a missing `--agent-id` fails with one envelope on stderr and exit 1:
366
+
367
+ ```json
368
+ {"schema_version": 1, "operation": "agents.get", "outcome": "failed",
369
+ "target": {"environment": "dev", "tenant_id": "TENANT_ID", "agent_id": "AGENT_ID"},
370
+ "error": {"category": "not_found", "message": "Agent 'AGENT_ID' was not found."}}
371
+ ```
372
+
289
373
  Read-only department listing and inspection use the same explicit tenant-admin
290
374
  targeting. They emit one versioned JSON result on stdout; failures emit one
291
375
  categorized JSON result on stderr. Department descriptions, creator identities,
@@ -317,6 +401,162 @@ or inferring missing relationships:
317
401
  uv run --frozen hc ams organization hierarchy --environment dev --tenant-id TENANT_ID
318
402
  ```
319
403
 
404
+ Read-only skill catalog listing and inspection are complete and unpaged. The
405
+ bounded projection includes only skill IDs, names, tool IDs, and audit timestamps;
406
+ it omits descriptions, tenant identity, creator identity, arbitrary response
407
+ fields, and tool details. Tool-ID order is preserved:
408
+
409
+ ```bash
410
+ uv run --frozen hc ams skills list --environment dev --tenant-id TENANT_ID
411
+ uv run --frozen hc ams skills get --environment dev --tenant-id TENANT_ID --skill-id SKILL_ID
412
+ ```
413
+
414
+ The CLI does not create, update, delete, or assign skills. Skill commands do not
415
+ read guardrails. They make exactly one catalog GET after tenant-admin login
416
+ and does not paginate, retry, cache, join, or infer additional catalog data.
417
+ Skill reads refuse target files, root credentials or base URLs, raw output,
418
+ blank or dot-segment skill IDs, and installed SDKs that do not provide both
419
+ skill list and get methods. These local refusals happen before tenant-admin login
420
+ or catalog reads.
421
+
422
+ Read-only policy catalog listing and inspection are complete and unpaged. The
423
+ bounded projection includes only policy IDs, names, department IDs, guardrail
424
+ IDs, active status, and audit timestamps. It never emits protected policy
425
+ content, descriptions, tenant or creator identity, arbitrary response fields,
426
+ or joined department/guardrail details. Guardrail-ID order is preserved:
427
+
428
+ ```bash
429
+ uv run --frozen hc ams policies list --environment dev --tenant-id TENANT_ID
430
+ uv run --frozen hc ams policies get --environment dev --tenant-id TENANT_ID --policy-id POLICY_ID
431
+ ```
432
+
433
+ The CLI does not export protected policy content; create, update, delete, or
434
+ assign policies; or join guardrail records. It makes exactly one catalog GET after
435
+ tenant-admin login and does not paginate, retry, cache, join, or infer referenced
436
+ resources. Policy reads refuse target files, root credentials or base URLs, raw
437
+ output, blank or dot-segment policy IDs, and installed SDKs without both policy
438
+ methods before tenant-admin login or catalog reads. Successful reads make no
439
+ assignment, deployment, serving, enforcement, or effectiveness claim.
440
+
441
+ Read-only guardrail catalog listing and inspection are complete and unpaged.
442
+ The bounded projection includes only guardrail IDs, names, and audit timestamps.
443
+ It never emits protected rules, descriptions, tenant or creator identity,
444
+ arbitrary response fields, or joined policy/agent details:
445
+
446
+ ```bash
447
+ uv run --frozen hc ams guardrails list --environment dev --tenant-id TENANT_ID
448
+ uv run --frozen hc ams guardrails get --environment dev --tenant-id TENANT_ID \
449
+ --guardrail-id GUARDRAIL_ID
450
+ ```
451
+
452
+ The CLI does not export rules; create, update, delete, assign, deploy, or enforce
453
+ guardrails; or claim they are active or effective. It makes exactly one catalog
454
+ GET after tenant-admin login and does not paginate, retry, cache, join, or infer
455
+ additional data. Guardrail reads refuse target files, root credentials or base
456
+ URLs, raw output, blank or dot-segment guardrail IDs, and installed SDKs without
457
+ both guardrail methods before tenant-admin login or catalog reads.
458
+
459
+ Read-only tool catalog listing and inspection are complete and unpaged. The
460
+ bounded projection includes only IDs, names, read-only and confirmation flags,
461
+ agent types, required scopes, audit events, and activity labels:
462
+
463
+ ```bash
464
+ uv run --frozen hc ams tools list --environment dev --tenant-id TENANT_ID
465
+ uv run --frozen hc ams tools get --environment dev --tenant-id TENANT_ID \
466
+ --tool-id TOOL_ID
467
+ ```
468
+
469
+ When both target flags are omitted, these commands may use the matching saved
470
+ tenant-admin session. Explicit flags must match that session. Tool output never
471
+ includes descriptions, parameters, input schemas, PIP or connector routing, or
472
+ arbitrary response fields. The CLI does not execute, assign, create, update, or
473
+ delete tools; join agents or skills; or claim assignment, availability,
474
+ authorization, deployment, serving, or runtime effectiveness. It makes exactly
475
+ one catalog GET after tenant-admin login and does not paginate, retry, cache,
476
+ join, or infer additional data. Tool reads refuse target files, root credentials
477
+ or base URLs, raw output, blank or dot-segment IDs, and installed SDKs without
478
+ both tool methods before tenant-admin login or catalog reads.
479
+
480
+ Read-only data-source catalog listing and inspection are complete and unpaged.
481
+ The bounded projection includes only stable IDs and names:
482
+
483
+ ```bash
484
+ uv run --frozen hc ams data-sources list --environment dev --tenant-id TENANT_ID
485
+ uv run --frozen hc ams data-sources get --environment dev --tenant-id TENANT_ID \
486
+ --data-source-id DATA_SOURCE_ID
487
+ ```
488
+
489
+ When both target flags are omitted, these commands may use the matching saved
490
+ tenant-admin session. Explicit flags must match that session. Data-source output
491
+ never includes descriptions or arbitrary response fields and does not imply
492
+ access, patient consent, record availability, assignment, authorization, or
493
+ runtime effectiveness. The CLI does not create, update, delete, assign, access
494
+ records through, or execute data sources. It makes exactly one catalog GET after
495
+ tenant-admin login and does not paginate, retry, cache, truncate, join, or infer
496
+ additional data. Data-source reads refuse target files, root credentials or base
497
+ URLs, raw output, blank or dot-segment IDs, and installed SDKs without both
498
+ data-source methods before tenant-admin login or catalog reads.
499
+
500
+ ### AMS output modes
501
+
502
+ The read commands (`hc ams skills|tools|policies|guardrails|data-sources|teams|departments list|get`
503
+ and `hc ams organization hierarchy`) render in two modes (`--output` on the root
504
+ `hc` command; `pretty` is the default):
505
+
506
+ - **`pretty`** (default): a compact human view. Lists print an `ID`/`NAME`
507
+ table with an entry count; a single record prints `key: value` lines; the
508
+ organization hierarchy prints an indented tree. Each failed AMS command
509
+ prints one stderr line, `error: <message> (<category>)` (flag/argument
510
+ usage errors from Click print Click's standard usage message instead).
511
+ - **`json`**: the stable result envelope (below) on stdout. When stdout is not
512
+ a terminal, the envelope is printed as one compact line; on a terminal it is
513
+ indented. Errors keep the structured JSON envelope on stderr.
514
+
515
+ The JSON envelope carries `schema_version`, `operation`, `target`, `outcome`,
516
+ and either `data` (succeeded) or `error: {category, message}` (failed). On
517
+ read-only operations the envelope no longer includes the `verification` block:
518
+ every field there is `not_applicable` on a read, so it was boilerplate. If a
519
+ future mutating operation reintroduces it, `verification` reappears only with
520
+ non-`not_applicable` content. Everything else about the envelope — field names,
521
+ ordering semantics, categories — is unchanged and stays parseable.
522
+
523
+ `--raw`/`--output raw` stays refused for AMS (`Raw output is refused for AMS.`),
524
+ and refusals keep the JSON error envelope on stderr.
525
+
526
+ ```bash
527
+ hc ams skills list --environment dev --tenant-id TENANT_ID # pretty table
528
+ hc ams skills get --environment dev --tenant-id TENANT_ID --skill-id SKILL_ID # key: value
529
+ hc --output json ams skills list --environment dev --tenant-id TENANT_ID # compact envelope
530
+ hc --output json ams skills list --environment dev --tenant-id TENANT_ID | jq .data
531
+ ```
532
+
533
+ ### What `hc ams` errors report
534
+
535
+ In `json` and `raw` modes each failed AMS command prints one JSON object on stderr with
536
+ an `error.category` and a message naming the real cause; in `pretty` mode the
537
+ same message is exactly one stderr line, `error: <message> (<category>)`:
538
+
539
+ - Local refusals keep their specific message and exit `1` with category
540
+ `validation`: `Raw output is refused for AMS.`, `AMS target does not match the
541
+ saved session; stopped before authentication.`, identity mismatches
542
+ (`Skill/tenant identity mismatch; stopped.`), and dot-segment ID refusals.
543
+ - No saved session and no target flags: category `authentication` with
544
+ `Not logged in; run \`hc login --environment <env> --tenant-id <tenant>\`.`
545
+ - A `get` whose requested ID does not exist (HTTP 404): category `not_found`
546
+ naming the ID, e.g. `Skill 'nosuch' was not found.` (a 404 on `list` stays
547
+ `validation`; departments keeps its legacy contract for all read statuses).
548
+ - HTTP 401/403 map to `authentication`/`authorization`; 409 to `conflict`;
549
+ network failures to `transport`; local output failures to `local_io`.
550
+ - Any unexpected internal error is category `internal` with a generic message;
551
+ it is never labeled `validation` and never leaks exception details.
552
+
553
+ ```bash
554
+ hc --raw ams skills list --environment dev --tenant-id TENANT_ID # validation: raw refused
555
+ hc ams skills list --tenant-id OTHER_TENANT # validation: target mismatch
556
+ hc ams skills list # authentication: not logged in
557
+ hc ams skills get --skill-id NOSUCH # not_found: names the ID
558
+ ```
559
+
320
560
  Every other command requires an explicit local, non-secret target JSON file.
321
561
  Only the canonical HTTPS AMS origin for that environment is accepted; custom
322
562
  origins require separately verified support. Target and nested qualification keys
@@ -385,11 +625,11 @@ configuration and recheck it before apply and selected-field restore. This is an
385
625
  operator prerequisite: the current CLI does not automatically attest deployment
386
626
  or all-writer coverage, and the record adds no server authorization boundary.
387
627
 
388
- Credentials enter only through `HC_AMS_ADMIN_EMAIL` and `HC_AMS_ADMIN_PASSWORD`
389
- in the current process, intended for composition with the existing
390
- `onepassword-env` wrapper. Each invocation logs in through `HCTenantAdminSDK`;
391
- tokens remain private in memory. There is no token cache, fallback identity,
392
- secret argument, resolved env file, or browser credential bridge. Root MCP
628
+ For CI and scripts with no saved session, credentials may still enter through
629
+ `HC_AMS_ADMIN_EMAIL` and `HC_AMS_ADMIN_PASSWORD` in the current process, intended
630
+ for composition with the existing `onepassword-env` wrapper; that compatibility
631
+ path logs in once per invocation. There is no fallback identity, secret argument,
632
+ arbitrary token import, resolved env file, keychain, or browser credential bridge. Root MCP
393
633
  `--access-token`, `--base-url`, their environment equivalents, and token/base-URL
394
634
  profiles are refused for AMS. Root profile environment values do not select AMS.
395
635