@dharta/cli 0.6.77 → 0.6.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +215 -11
- package/dist/agent.js +3 -2
- package/dist/agent.js.map +1 -1
- package/dist/api-error.js +6 -6
- package/dist/api-error.js.map +1 -1
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +860 -149
- package/dist/cli.js.map +1 -1
- package/dist/command-tree.d.ts +3 -0
- package/dist/command-tree.js +10 -0
- package/dist/command-tree.js.map +1 -0
- package/dist/commands/agents.d.ts +54 -17
- package/dist/commands/agents.js +246 -136
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/analytics.js +6 -5
- package/dist/commands/analytics.js.map +1 -1
- package/dist/commands/api.js +71 -86
- package/dist/commands/api.js.map +1 -1
- package/dist/commands/appearance.js +5 -6
- package/dist/commands/appearance.js.map +1 -1
- package/dist/commands/artifact.js +7 -6
- package/dist/commands/artifact.js.map +1 -1
- package/dist/commands/audit-log.js +2 -1
- package/dist/commands/audit-log.js.map +1 -1
- package/dist/commands/auth.js +26 -6
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/caps.js +11 -15
- package/dist/commands/caps.js.map +1 -1
- package/dist/commands/deploy.js +25 -10
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.d.ts +10 -1
- package/dist/commands/dev.js +56 -25
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.js +60 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/embed-keys.js +4 -13
- package/dist/commands/embed-keys.js.map +1 -1
- package/dist/commands/env.js +4 -7
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/files.js +3 -4
- package/dist/commands/files.js.map +1 -1
- package/dist/commands/fleet.d.ts +129 -0
- package/dist/commands/fleet.js +408 -0
- package/dist/commands/fleet.js.map +1 -0
- package/dist/commands/genui.d.ts +2 -0
- package/dist/commands/genui.js +53 -0
- package/dist/commands/genui.js.map +1 -0
- package/dist/commands/git-credential.js +2 -3
- package/dist/commands/git-credential.js.map +1 -1
- package/dist/commands/kartas.d.ts +9 -0
- package/dist/commands/kartas.js +33 -11
- package/dist/commands/kartas.js.map +1 -1
- package/dist/commands/keys.d.ts +17 -18
- package/dist/commands/keys.js +108 -19
- package/dist/commands/keys.js.map +1 -1
- package/dist/commands/login.js +2 -1
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/members.d.ts +10 -0
- package/dist/commands/members.js +20 -6
- package/dist/commands/members.js.map +1 -1
- package/dist/commands/model-connections.d.ts +44 -0
- package/dist/commands/model-connections.js +435 -0
- package/dist/commands/model-connections.js.map +1 -0
- package/dist/commands/open.d.ts +2 -2
- package/dist/commands/open.js +4 -3
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/org.d.ts +9 -0
- package/dist/commands/org.js +42 -0
- package/dist/commands/org.js.map +1 -0
- package/dist/commands/organization.d.ts +16 -0
- package/dist/commands/organization.js +118 -0
- package/dist/commands/organization.js.map +1 -0
- package/dist/commands/parity.js +1 -3
- package/dist/commands/parity.js.map +1 -1
- package/dist/commands/repos.d.ts +4 -0
- package/dist/commands/repos.js +17 -0
- package/dist/commands/repos.js.map +1 -0
- package/dist/commands/rollback.js +2 -3
- package/dist/commands/rollback.js.map +1 -1
- package/dist/commands/schedules.js +26 -21
- package/dist/commands/schedules.js.map +1 -1
- package/dist/commands/scopes.js +8 -1
- package/dist/commands/scopes.js.map +1 -1
- package/dist/commands/sessions.js +9 -3
- package/dist/commands/sessions.js.map +1 -1
- package/dist/commands/setup.js +5 -4
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/update.d.ts +1 -0
- package/dist/commands/update.js +24 -11
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/webhooks.d.ts +4 -1
- package/dist/commands/webhooks.js +21 -16
- package/dist/commands/webhooks.js.map +1 -1
- package/dist/completions.js +24 -13
- package/dist/completions.js.map +1 -1
- package/dist/config.d.ts +12 -0
- package/dist/config.js +121 -7
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +2 -0
- package/dist/context.js +23 -7
- package/dist/context.js.map +1 -1
- package/dist/docs/cli-reference.d.ts +2 -0
- package/dist/docs/cli-reference.js +191 -0
- package/dist/docs/cli-reference.js.map +1 -0
- package/dist/exit-codes.d.ts +25 -0
- package/dist/exit-codes.js +107 -0
- package/dist/exit-codes.js.map +1 -0
- package/dist/genui.d.ts +178 -0
- package/dist/genui.js +1130 -0
- package/dist/genui.js.map +1 -0
- package/dist/harnesses.js +2 -1
- package/dist/harnesses.js.map +1 -1
- package/dist/jq.d.ts +4 -0
- package/dist/jq.js +91 -0
- package/dist/jq.js.map +1 -0
- package/dist/login-offer.js +6 -2
- package/dist/login-offer.js.map +1 -1
- package/dist/manifest.d.ts +12 -0
- package/dist/manifest.js +126 -0
- package/dist/manifest.js.map +1 -1
- package/dist/model-auth.d.ts +29 -0
- package/dist/model-auth.js +117 -0
- package/dist/model-auth.js.map +1 -0
- package/dist/model-settings.d.ts +23 -0
- package/dist/model-settings.js +186 -0
- package/dist/model-settings.js.map +1 -0
- package/dist/money.js +2 -1
- package/dist/money.js.map +1 -1
- package/dist/output.d.ts +6 -0
- package/dist/output.js +54 -0
- package/dist/output.js.map +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/dist/scaffold.js +2 -1
- package/dist/scaffold.js.map +1 -1
- package/dist/validators.js +17 -11
- package/dist/validators.js.map +1 -1
- package/dist/version-check.d.ts +1 -1
- package/dist/version-check.js +1 -1
- package/dist/version-check.js.map +1 -1
- package/node_modules/@dharta/contracts/LICENSE +21 -0
- package/node_modules/@dharta/contracts/README.md +45 -0
- package/node_modules/@dharta/contracts/artifact-runtime.json +750 -0
- package/node_modules/@dharta/contracts/dist/activity.d.ts +62 -0
- package/node_modules/@dharta/contracts/dist/activity.d.ts.map +1 -0
- package/node_modules/@dharta/contracts/dist/activity.js +178 -0
- package/node_modules/@dharta/contracts/dist/activity.js.map +1 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime-formats.d.ts +20 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime-formats.d.ts.map +1 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime-formats.js +53 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime-formats.js.map +1 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime-validators.generated.d.ts +37 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime-validators.generated.d.ts.map +1 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime-validators.generated.js +5107 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime-validators.generated.js.map +1 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime.d.ts +154 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime.d.ts.map +1 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime.generated.d.ts +1670 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime.generated.d.ts.map +1 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime.generated.js +1903 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime.generated.js.map +1 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime.js +377 -0
- package/node_modules/@dharta/contracts/dist/artifact-runtime.js.map +1 -0
- package/node_modules/@dharta/contracts/dist/index.d.ts +6 -0
- package/node_modules/@dharta/contracts/dist/index.d.ts.map +1 -0
- package/node_modules/@dharta/contracts/dist/index.js +6 -0
- package/node_modules/@dharta/contracts/dist/index.js.map +1 -0
- package/node_modules/@dharta/contracts/dist/model-auth.d.ts +31 -0
- package/node_modules/@dharta/contracts/dist/model-auth.d.ts.map +1 -0
- package/node_modules/@dharta/contracts/dist/model-auth.js +45 -0
- package/node_modules/@dharta/contracts/dist/model-auth.js.map +1 -0
- package/node_modules/@dharta/contracts/dist/tasks.d.ts +44 -0
- package/node_modules/@dharta/contracts/dist/tasks.d.ts.map +1 -0
- package/node_modules/@dharta/contracts/dist/tasks.js +127 -0
- package/node_modules/@dharta/contracts/dist/tasks.js.map +1 -0
- package/node_modules/@dharta/contracts/dist/wire-events.d.ts +71 -0
- package/node_modules/@dharta/contracts/dist/wire-events.d.ts.map +1 -0
- package/node_modules/@dharta/contracts/dist/wire-events.js +48 -0
- package/node_modules/@dharta/contracts/dist/wire-events.js.map +1 -0
- package/node_modules/@dharta/contracts/model-auth-capabilities-v1.json +168 -0
- package/node_modules/@dharta/contracts/model-auth-reasons-v1.json +38 -0
- package/node_modules/@dharta/contracts/package.json +44 -0
- package/node_modules/@dharta/contracts/src/activity.ts +215 -0
- package/node_modules/@dharta/contracts/src/artifact-runtime-formats.ts +54 -0
- package/node_modules/@dharta/contracts/src/artifact-runtime-validators.generated.ts +29 -0
- package/node_modules/@dharta/contracts/src/artifact-runtime.generated.ts +2093 -0
- package/node_modules/@dharta/contracts/src/artifact-runtime.ts +520 -0
- package/node_modules/@dharta/contracts/src/index.ts +5 -0
- package/node_modules/@dharta/contracts/src/model-auth.ts +82 -0
- package/node_modules/@dharta/contracts/src/tasks.ts +142 -0
- package/node_modules/@dharta/contracts/src/wire-events.ts +150 -0
- package/node_modules/@dharta/contracts/wire-events.json +29 -0
- package/node_modules/@dharta/sdk/LICENSE +1 -1
- package/node_modules/@dharta/sdk/README.md +22 -8
- package/node_modules/@dharta/sdk/dist/errors.d.ts +9 -7
- package/node_modules/@dharta/sdk/dist/errors.d.ts.map +1 -1
- package/node_modules/@dharta/sdk/dist/errors.js +36 -18
- package/node_modules/@dharta/sdk/dist/errors.js.map +1 -1
- package/node_modules/@dharta/sdk/dist/fleet.d.ts +69 -0
- package/node_modules/@dharta/sdk/dist/fleet.d.ts.map +1 -0
- package/node_modules/@dharta/sdk/dist/fleet.js +240 -0
- package/node_modules/@dharta/sdk/dist/fleet.js.map +1 -0
- package/node_modules/@dharta/sdk/dist/http.d.ts +6 -2
- package/node_modules/@dharta/sdk/dist/http.d.ts.map +1 -1
- package/node_modules/@dharta/sdk/dist/http.js +71 -12
- package/node_modules/@dharta/sdk/dist/http.js.map +1 -1
- package/node_modules/@dharta/sdk/dist/idempotency.d.ts +12 -0
- package/node_modules/@dharta/sdk/dist/idempotency.d.ts.map +1 -0
- package/node_modules/@dharta/sdk/dist/idempotency.js +72 -0
- package/node_modules/@dharta/sdk/dist/idempotency.js.map +1 -0
- package/node_modules/@dharta/sdk/dist/index.d.ts +20 -6
- package/node_modules/@dharta/sdk/dist/index.d.ts.map +1 -1
- package/node_modules/@dharta/sdk/dist/index.js +27 -4
- package/node_modules/@dharta/sdk/dist/index.js.map +1 -1
- package/node_modules/@dharta/sdk/dist/resources.d.ts +108 -13
- package/node_modules/@dharta/sdk/dist/resources.d.ts.map +1 -1
- package/node_modules/@dharta/sdk/dist/resources.js +403 -57
- package/node_modules/@dharta/sdk/dist/resources.js.map +1 -1
- package/node_modules/@dharta/sdk/dist/types.d.ts +436 -16
- package/node_modules/@dharta/sdk/dist/types.d.ts.map +1 -1
- package/node_modules/@dharta/sdk/dist/types.js +31 -2
- package/node_modules/@dharta/sdk/dist/types.js.map +1 -1
- package/node_modules/@dharta/sdk/package.json +9 -3
- package/node_modules/@dharta/sdk/src/errors.ts +41 -18
- package/node_modules/@dharta/sdk/src/fleet.ts +339 -0
- package/node_modules/@dharta/sdk/src/http.ts +110 -17
- package/node_modules/@dharta/sdk/src/idempotency.ts +101 -0
- package/node_modules/@dharta/sdk/src/index.ts +50 -11
- package/node_modules/@dharta/sdk/src/resources.ts +549 -68
- package/node_modules/@dharta/sdk/src/types.ts +629 -20
- package/package.json +16 -6
- package/src/agent.ts +3 -2
- package/src/api-error.ts +6 -5
- package/src/cli.ts +978 -163
- package/src/command-tree.ts +13 -0
- package/src/commands/agents.ts +365 -167
- package/src/commands/analytics.ts +6 -5
- package/src/commands/api.ts +73 -92
- package/src/commands/appearance.ts +5 -6
- package/src/commands/artifact.ts +7 -6
- package/src/commands/audit-log.ts +2 -1
- package/src/commands/auth.ts +25 -5
- package/src/commands/caps.ts +11 -15
- package/src/commands/deploy.ts +18 -4
- package/src/commands/dev.ts +86 -25
- package/src/commands/doctor.ts +69 -0
- package/src/commands/embed-keys.ts +4 -14
- package/src/commands/env.ts +4 -7
- package/src/commands/files.ts +3 -4
- package/src/commands/fleet.ts +672 -0
- package/src/commands/genui.ts +59 -0
- package/src/commands/git-credential.ts +2 -3
- package/src/commands/kartas.ts +45 -11
- package/src/commands/keys.ts +152 -35
- package/src/commands/login.ts +2 -1
- package/src/commands/members.ts +31 -6
- package/src/commands/model-connections.ts +547 -0
- package/src/commands/open.ts +5 -4
- package/src/commands/org.ts +57 -0
- package/src/commands/organization.ts +153 -0
- package/src/commands/parity.ts +1 -3
- package/src/commands/repos.ts +23 -0
- package/src/commands/rollback.ts +2 -3
- package/src/commands/schedules.ts +33 -22
- package/src/commands/scopes.ts +8 -1
- package/src/commands/sessions.ts +9 -3
- package/src/commands/setup.ts +5 -4
- package/src/commands/update.ts +28 -12
- package/src/commands/webhooks.ts +30 -19
- package/src/completions.ts +25 -13
- package/src/config.ts +141 -9
- package/src/context.ts +34 -7
- package/src/docs/cli-reference.ts +206 -0
- package/src/exit-codes.ts +122 -0
- package/src/genui.ts +1398 -0
- package/src/harnesses.ts +2 -1
- package/src/jq.ts +109 -0
- package/src/login-offer.ts +6 -2
- package/src/manifest.ts +134 -0
- package/src/model-auth.ts +173 -0
- package/src/model-settings.ts +222 -0
- package/src/money.ts +5 -1
- package/src/output.ts +60 -0
- package/src/runtime.ts +1 -1
- package/src/scaffold.ts +2 -1
- package/src/validators.ts +18 -11
- package/src/version-check.ts +1 -1
- package/dist/commands/model-keys.d.ts +0 -22
- package/dist/commands/model-keys.js +0 -222
- package/dist/commands/model-keys.js.map +0 -1
- package/src/commands/model-keys.ts +0 -278
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -47,17 +47,17 @@ shared runtime inputs inside it before deploying.
|
|
|
47
47
|
| `dharta login --with-token` | Read an API key from piped stdin instead (CI, air-gapped): `echo $DHARTA_API_KEY \| dharta login --with-token`. |
|
|
48
48
|
| `dharta auth status` | Show who you are, per profile (includes the `DHARTA_API_KEY` env credential when set). |
|
|
49
49
|
| `dharta auth token` | Print the active token, for piping. |
|
|
50
|
-
| `dharta auth logout [--profile <name>]` | Remove the stored credential (the key stays revocable on the dashboard). |
|
|
50
|
+
| `dharta auth logout [--profile <name>]` | Remove the stored credential (the key stays revocable on the dashboard). Removes the default profile unless `--profile` names another. |
|
|
51
51
|
| `dharta whoami` | Show the authenticated principal. |
|
|
52
52
|
| `dharta create [path] [--name <n>] [--template <key>] [--harness <type>] [--harness-version <version>]` | Scaffold a brand-new starter agent in a supported harness format (`claude-code`, `opencode`, `deepagents`, `goose`, or `codex-cli`): native template files plus a default `dharta.toml` (deploy off). Omit `--harness` for Claude Code. Local only. |
|
|
53
53
|
| `dharta setup [path] [--name <n>] [--enable\|--disable] [--method git\|folder] [--ci github] [--login]` | Configure exactly one existing agent folder and persist its deploy method. `name` is a 1-100 character display name; Dharta derives the org-unique deploy slug from it, and changing that slug targets a different agent. At an ambiguous repo root, interactive setup asks for one agent; rerun setup for each sibling. GitHub is optional per-agent automation pinned to the selected method, not a third transport; rerun setup and rotate that agent's CI secret when changing methods. Local only. |
|
|
54
|
-
| `dharta dev [path] [-m <msg>] [--user <id>] [--port <port>]` | Run the agent locally behind the consumer session API
|
|
54
|
+
| `dharta dev [path] --model-auth <api-key\|claude> [-m <msg>] [--user <id>] [--port <port>]` | Run the agent locally behind the consumer session API. `api-key` uses `ANTHROPIC_API_KEY`; `claude` checks the provider-owned login with `claude auth status`. Omit the selector only when exactly one method is ready. |
|
|
55
55
|
| `dharta dev --release vN [--env remote [--include-secrets]]` | Parity axes: run the exact built tree prod serves, and/or bind prod env vars instead of `.env` (`--include-secrets` needs `env:secrets:read`; audited). |
|
|
56
56
|
| `dharta deploy [slug] [--mode git\|folder] [--dir <path>] [--reconcile-source]` | Create and activate a new immutable release from exactly one agent folder. Its checked-in `deploy_method` selects committed git or working-tree upload; `--mode` is a one-run override. Git uses a per-agent deploy ref, so sibling agents never fan out implicitly. After inspecting intentionally divergent hosted history, `--reconcile-source` aligns only Dharta's hosted branch. |
|
|
57
57
|
| `dharta status` | Every agent in this repo (resolved from the git root, like `git status`) joined to its live release/version on the active profile - the "what's here" view. Works before the first deploy. |
|
|
58
58
|
| `dharta rollback [slug] --to vN` | Flip the agent's current release to a previous version (`releases:write`); slug is inferred from this folder when omitted. |
|
|
59
59
|
| `dharta logs [slug] [--tail] [--since <iso>]` | Stream agent logs via SSE (`--tail`) or poll with `--since`; slug is inferred from this folder when omitted. |
|
|
60
|
-
| `dharta open [target]` | Open the hosted chat page, `console`, or handoff targets: `billing`, `security`, `api-keys`, `model-
|
|
60
|
+
| `dharta open [target]` | Open the hosted chat page, `console`, or handoff targets: `billing`, `security`, `api-keys`, `model-connections`, `webhooks`, `connected-accounts`. Per-agent commands resolve the agent from `dharta.toml`: explicit `--agent`/`[path]`, the repo's sole agent, then the legacy `DHARTA_PROJECT` alias. |
|
|
61
61
|
| `dharta env list\|set NAME=value [--secret]\|unset NAME` | Manage the agent's prod env bindings (declare-or-bind; secret values are never shown). |
|
|
62
62
|
| `dharta env pull [--force] [--include-secrets]` | Hydrate `.env` from prod values (audited; secrets excluded unless `--include-secrets` uses `env:secrets:read`). |
|
|
63
63
|
| `dharta env diff` | Report drift between `.env`, prod bindings, and the `dharta.toml` `[env]` declarations. |
|
|
@@ -67,14 +67,15 @@ shared runtime inputs inside it before deploying.
|
|
|
67
67
|
| `dharta files ls <agent> <karta>` | List a karta's durable workspace files (path and size) via the owner read channel (requires a `workspace:read` key + the agent's `owners.api` grant). |
|
|
68
68
|
| `dharta files get <agent> <karta> <path> [-o <file>]` | Fetch one workspace file; writes bytes to `--out`, or streams them to stdout. |
|
|
69
69
|
| `dharta artifact put\|list\|remove` | Designate, inspect, or remove durable workspace work product through the release-declared artifact schema. This delegates to the pinned `dharta-runtime` helper and never publishes or shares an artifact. |
|
|
70
|
+
| `dharta genui build [dir]` | Compile the `[genui]` component sources into the release bundle and record its `bundle_sha256` in `dharta.toml`. Local only; see Generative UI below. |
|
|
71
|
+
| `dharta genui check [dir]` | Verify the declared bundle exists, matches its recorded digest, and would be accepted at deploy. `dharta dev` runs the same check as a warning and `dharta deploy` refuses on it. |
|
|
70
72
|
| `dharta send "<message>"` (alias `run`) | Send a one-shot message to the DEPLOYED agent and print its reply (prod smoke test; tool approvals auto-denied). |
|
|
71
73
|
| `dharta agent list\|show [slug]` | List all agents in your org, or show one + its recent releases (the agent in this folder if no slug). |
|
|
72
74
|
| `dharta agent sessions [slug]\|sessions show\|view <id> [slug]\|session <id> [slug]` | List transcript sessions for an agent, or view one transcript without leaving the `agent` namespace. |
|
|
73
75
|
| `dharta agent releases [slug]\|activate <version> [slug]` | List release history or activate an existing production release. |
|
|
74
76
|
| `dharta agent serving\|dashboard-edits\|workspace-inspectable on\|off [slug]` | Toggle serving, browser-console edits, and read-only workspace inspection. |
|
|
75
77
|
| `dharta agent workspace-access show\|set <path>=<on\|off> [slug]` | Show or set the workspace access grant matrix. Paths: `owners.git`, `owners.api`, `users.widget`, `users.agent_definition`. |
|
|
76
|
-
| `dharta agent model [slug] --
|
|
77
|
-
| `dharta agent model [slug] --connector-id <id> [--model <id>]` | Pin a BYOK connector from `dharta model-keys list`; omit `--source`. |
|
|
78
|
+
| `dharta agent model [slug] --connector <slug[,slug...]> [--model-ref <reference>]` | Set the connection order by slug and the model reference. Use `karta` for the platform connection. An empty `--connector` stores an empty order, so the agent inherits the organization's connections; an empty `--model-ref` clears the reference, so the connection's default model applies. |
|
|
78
79
|
| `dharta agent delete [slug]` | Archive an agent. |
|
|
79
80
|
| `dharta schedules list\|create [--run-now]\|pause\|resume\|run\|delete\|rm` | Manage recurring runs for an agent. `--run-now` queues a test run immediately after creation. |
|
|
80
81
|
| `dharta keys list\|create <name> [--scope ...]\|rename <id> <name>\|revoke <id>` | Manage API keys (plaintext shown exactly once on create). |
|
|
@@ -89,14 +90,18 @@ Additional command groups:
|
|
|
89
90
|
| --- | --- |
|
|
90
91
|
| `dharta audit-log` | Export audit events as a table, JSON, or CSV. |
|
|
91
92
|
| `dharta analytics agents\|users\|instances\|sessions\|models\|cost` | Usage and cost rollups with bounded ranges and JSON output. |
|
|
92
|
-
| `dharta api [METHOD] /path` | Authenticated passthrough
|
|
93
|
-
| `dharta
|
|
94
|
-
| `dharta
|
|
93
|
+
| `dharta api [METHOD] /path` | Authenticated passthrough to any public JSON API endpoint. Paths must start with `/api/`, `/me`, `/version`, `/api_keys`, `/model_connections`, or `/agent_templates`; the key's server-side scopes decide what the request may do. Unstable escape hatch - the curated commands are the stable contract. |
|
|
94
|
+
| `dharta models auth list\|create\|rotate\|models\|revoke` | Manage encrypted BYOK provider connectors. `create --slug <slug>` names the connector for `--connector` and model references, `rotate <id\|slug>` replaces its credential, and `models <id\|slug>` shows or replaces its enabled models and default. `rotate`, `models`, and `revoke <id\|slug>` each take the numeric id or the slug; an all-digit argument is always read as an id. |
|
|
95
|
+
| `dharta org model [set]` | Show or update the organization connector order, model reference, and portable model parameters that agents inherit. |
|
|
96
|
+
| `dharta org rename\|support-access\|transcript-access` | Rename the organization and set its support-access and API transcript-access posture. Owner-created keys only for the two toggles. |
|
|
97
|
+
| `dharta members list\|invite\|set-role\|remove\|revoke-invitation\|resend-invitation` | Manage organization members and the pending-invitation queue. |
|
|
98
|
+
| `dharta repos disconnect-github <slug>` | Stop a linked GitHub repository from producing releases. Live releases are untouched. |
|
|
95
99
|
| `dharta kartas list\|show\|configure\|grant\|set-role\|revoke` | Manage durable Dharta names, agent-scoped vanity URLs, access audience, and per-Karta member ACLs. |
|
|
96
100
|
| `dharta embed-keys list\|create\|rotate\|enable\|disable\|revoke\|enable-identity\|disable-identity` | Manage publishable widget embed keys and their verified-identity secret for an agent. |
|
|
97
101
|
| `dharta caps budget [set]\|set\|instance\|instance-set\|end-user\|end-user-set\|seat\|seat-set` | Inspect and update monthly budget, durable dharta caps, verified-user caps, and per-seat caps. |
|
|
98
102
|
| `dharta appearance get\|set` | Read or merge an agent's appearance JSON. |
|
|
99
103
|
| `dharta directories instances\|end-users\|users\|sessions` | Read agent-scoped durable kartas, verified users, and sessions. |
|
|
104
|
+
| `dharta fleet operations\|rollouts\|findings\|views\|analytics\|exports` | Run bulk fleet changes, drive rollouts, triage findings, manage saved views and charts, and export catalog rows. |
|
|
100
105
|
| `dharta webhooks list\|create\|update\|enable\|delete\|rm` | Manage webhook endpoints and one-time signing secrets. |
|
|
101
106
|
|
|
102
107
|
Every command that prints a result payload also takes `--json` for
|
|
@@ -106,6 +111,39 @@ it. `dharta open --json` prints the URL object without opening a browser, and
|
|
|
106
111
|
`dharta send --json` buffers the reply into one `{agent, session_id, reply}`
|
|
107
112
|
payload.
|
|
108
113
|
|
|
114
|
+
`--jq <expr>` filters that JSON through a jq compiled into the CLI, so no
|
|
115
|
+
separate install is needed. It implies `--json` and is rejected wherever
|
|
116
|
+
`--json` is:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
dharta agent list --jq '.[].slug'
|
|
120
|
+
dharta api /api/agents/support-bot --jq '.release.version'
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Each result prints on its own line, compact; a string result prints without
|
|
124
|
+
quotes. A filter that matches nothing prints nothing. A filter that does not
|
|
125
|
+
compile fails before the command does any work.
|
|
126
|
+
|
|
127
|
+
`--profile <name>` works on every command and picks which stored profile it
|
|
128
|
+
uses. Resolution order: `--profile`, then `DHARTA_PROFILE`, then the config's
|
|
129
|
+
`default_profile`.
|
|
130
|
+
|
|
131
|
+
### Exit codes
|
|
132
|
+
|
|
133
|
+
| Code | Meaning |
|
|
134
|
+
| --- | --- |
|
|
135
|
+
| 0 | Success. |
|
|
136
|
+
| 1 | General failure. |
|
|
137
|
+
| 2 | Usage error: unknown flag, bad value, missing argument, unknown profile. |
|
|
138
|
+
| 3 | Not authenticated (no stored credential, or a 401). |
|
|
139
|
+
| 4 | Forbidden (403), usually a missing scope. |
|
|
140
|
+
| 5 | Not found (404). |
|
|
141
|
+
| 6 | Validation failure (409 or 422). |
|
|
142
|
+
| 7 | The API host could not be reached. |
|
|
143
|
+
|
|
144
|
+
`dharta doctor` is the exception: it exits 1 for an unhealthy local setup,
|
|
145
|
+
which is a report rather than an error.
|
|
146
|
+
|
|
109
147
|
`dharta git-credential` is a hidden subcommand: the credential-helper protocol
|
|
110
148
|
endpoint that `dharta login` wires into git config.
|
|
111
149
|
|
|
@@ -122,12 +160,138 @@ base_url = "https://dharta.ai"
|
|
|
122
160
|
git_base_url = "https://git.dharta.ai"
|
|
123
161
|
```
|
|
124
162
|
|
|
125
|
-
- `--profile <name>` selects a non-default profile.
|
|
163
|
+
- `--profile <name>` selects a non-default profile, on any command. It also
|
|
164
|
+
names the profile `dharta login` writes and `dharta auth logout` removes.
|
|
165
|
+
`DHARTA_PROFILE` sets it for a whole shell. An explicit `--profile` outranks
|
|
166
|
+
both `DHARTA_API_KEY` and `DHARTA_BASE_URL`: a flag never silently talks to
|
|
167
|
+
whatever organization an exported key belongs to, and never sends the
|
|
168
|
+
profile's key to an exported host it was not issued for. `DHARTA_PROFILE`
|
|
169
|
+
does not, because both are ambient.
|
|
126
170
|
- `--base-url` / `--git-base-url` (on `login`) override the production hosts
|
|
127
171
|
for staging / self-hosted deployments.
|
|
128
172
|
- `DHARTA_API_KEY` overrides the stored credential everywhere (the CI path;
|
|
129
173
|
`DHARTA_BASE_URL` pairs with it).
|
|
130
174
|
|
|
175
|
+
## Generative UI (`dharta genui`)
|
|
176
|
+
|
|
177
|
+
An agent can render UI, not just text, in the embedded widget
|
|
178
|
+
([RFC 0056](../../docs/rfcs/0056-agent-driven-ui-rendering.md)). It is opt-in per
|
|
179
|
+
agent: add a `[genui]` section to `dharta.toml` and Dharta serves that agent's
|
|
180
|
+
component catalog to the widget. No section means no catalog and no token cost.
|
|
181
|
+
|
|
182
|
+
Every component declares a trust tier:
|
|
183
|
+
|
|
184
|
+
| Tier | What it is | Isolation | Needs a bundle |
|
|
185
|
+
| --- | --- | --- | --- |
|
|
186
|
+
| 1 | Declarative. Dharta renders the component with its own primitives. | none (no builder code) | no |
|
|
187
|
+
| 2 | Your JavaScript, run in a Web Worker with no DOM and no network. | Worker | yes |
|
|
188
|
+
| 3 | Your HTML, run in a sandboxed iframe. | iframe + per-component CSP | yes |
|
|
189
|
+
|
|
190
|
+
A Tier-1 component aliases one Dharta builtin: `Badge`, `Button`, `Card`,
|
|
191
|
+
`Checkbox`, `Column`, `Divider`, `Heading`, `Row`, `Select`, `Text`, `TextField`.
|
|
192
|
+
|
|
193
|
+
### Source layout
|
|
194
|
+
|
|
195
|
+
`dharta genui build` compiles one directory per component from
|
|
196
|
+
`[genui.build] source` (default `genui/components`). That key sits in its own
|
|
197
|
+
sub-table because it is a build-time CLI concern: the release contract never
|
|
198
|
+
reads it. Each directory is named exactly as the component is named in the
|
|
199
|
+
`components` array:
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
genui/components/
|
|
203
|
+
Card/
|
|
204
|
+
component.json { "tier": 1, "builtin": "Card" }
|
|
205
|
+
Pentagraph/
|
|
206
|
+
component.json { "tier": 2, "props_schema": {}, "events": {} }
|
|
207
|
+
worker.js the Web Worker source (tier 2)
|
|
208
|
+
Globe/
|
|
209
|
+
component.json { "tier": 3 }
|
|
210
|
+
index.html the sandboxed-iframe document (tier 3)
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
A component name may carry path segments, so `charts/Bar` is a legal name and
|
|
214
|
+
its sources live at `genui/components/charts/Bar/`. A directory holding a
|
|
215
|
+
`component.json` *is* a component, so anything below one belongs to that
|
|
216
|
+
component and is never scanned for others.
|
|
217
|
+
|
|
218
|
+
`component.json` keys:
|
|
219
|
+
|
|
220
|
+
- `tier` (required) - `1`, `2`, or `3`. Must equal the tier in `dharta.toml`;
|
|
221
|
+
the manifest is the trust declaration, so the build never reconciles the two
|
|
222
|
+
for you.
|
|
223
|
+
- `builtin` (tier 1 only) - the Dharta builtin this component aliases. Defaults
|
|
224
|
+
to the directory name. A component named after a builtin may only alias that
|
|
225
|
+
same builtin: `Card` renders as `Card`, never as `Badge`, because the widget
|
|
226
|
+
merges your catalog over the built-in one and the swap would reach every
|
|
227
|
+
surface in the transcript.
|
|
228
|
+
- `props_schema` (optional) - JSON Schema object for the component's props.
|
|
229
|
+
- `events` (optional) - an object of `{ "<event>": { "cadence": ... } }`, where
|
|
230
|
+
cadence is `agent_action`, `reference`, or `side_effect`, plus an optional
|
|
231
|
+
`context_schema` object. At most 64 events per component.
|
|
232
|
+
|
|
233
|
+
Every number in `component.json` reaches the bundle as a JavaScript double, so
|
|
234
|
+
the build writes `1` for `1.0` and `0` for `-0.0`. The value is unchanged - both
|
|
235
|
+
planes hold the same double - but the spelling you wrote is not preserved.
|
|
236
|
+
|
|
237
|
+
Two kinds of number a double cannot hold at all, and the build refuses both,
|
|
238
|
+
naming the file and the path to the number:
|
|
239
|
+
|
|
240
|
+
- an integer whose magnitude is above 9007199254740991, which arrives already
|
|
241
|
+
rounded to something you did not write;
|
|
242
|
+
- a float that overflows a double, such as `1e400`, which arrives as `Infinity`
|
|
243
|
+
and would be written into the bundle as `null`.
|
|
244
|
+
|
|
245
|
+
Write either as a string, or use a number a double can hold. Every float that
|
|
246
|
+
is a finite double, `1e-7` and `1.5e300` included, is written through unchanged.
|
|
247
|
+
|
|
248
|
+
### Build and check
|
|
249
|
+
|
|
250
|
+
```toml
|
|
251
|
+
# dharta.toml
|
|
252
|
+
[genui]
|
|
253
|
+
catalog_id = "support-bot-ui"
|
|
254
|
+
version = 1 # an integer; 1.0 is a float and is rejected
|
|
255
|
+
components = [{ name = "Card", tier = 1 }, { name = "Pentagraph", tier = 2 }]
|
|
256
|
+
bundle = "genui/bundle.json"
|
|
257
|
+
# bundle_sha256 is written by `dharta genui build` - do not hand-edit it
|
|
258
|
+
|
|
259
|
+
[genui.build]
|
|
260
|
+
source = "genui/components" # optional; this is the default
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
```sh
|
|
264
|
+
dharta genui build # writes genui/bundle.json, records bundle_sha256
|
|
265
|
+
dharta genui check # verifies the file, its digest, and its contents
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
The bundle is canonical JSON (sorted keys, compact separators, ASCII only), so
|
|
269
|
+
rebuilding unchanged sources produces byte-identical output and an unchanged
|
|
270
|
+
digest. Commit both the bundle and the digest: a release is accepted only when
|
|
271
|
+
the bundle's bytes hash to the recorded `bundle_sha256`.
|
|
272
|
+
|
|
273
|
+
A Tier-1-only catalog does not need a bundle at all. Leave `bundle` unset and
|
|
274
|
+
Dharta builds the catalog from the `components` array; `dharta genui build` then
|
|
275
|
+
says there is nothing to build and exits 0. It is still validated: because
|
|
276
|
+
Dharta synthesizes `{ builtin: <name> }` for each entry, a Tier-1 component
|
|
277
|
+
whose name is not one of the builtins above is rejected, bundle or no bundle.
|
|
278
|
+
|
|
279
|
+
`dharta genui check` runs in two more places, so a broken catalog cannot reach a
|
|
280
|
+
release: `dharta dev` reports it as a `[doctor]` warning at startup, and
|
|
281
|
+
`dharta deploy` refuses before it pushes or uploads anything, with the same
|
|
282
|
+
message the release validator would return.
|
|
283
|
+
|
|
284
|
+
Limits enforced locally and again at deploy: at most 128 components, 500 KiB of
|
|
285
|
+
worker source and 1 MiB of HTML per component, and 5 MiB for the whole bundle.
|
|
286
|
+
The bundle must be a real file: a symlink anywhere along its path is refused,
|
|
287
|
+
both when the build writes it and when anything reads it, because the release
|
|
288
|
+
validator opens it with `O_NOFOLLOW`.
|
|
289
|
+
|
|
290
|
+
Commit the bundle. `dharta deploy` ships a Git-filtered tree, so it checks the
|
|
291
|
+
bundle against the list of files this deploy will actually carry and refuses
|
|
292
|
+
when it is not among them. A file force-added under an ignore rule
|
|
293
|
+
(`git add -f genui/bundle.json`) counts as carried and passes.
|
|
294
|
+
|
|
131
295
|
## Runtime (`dharta dev`)
|
|
132
296
|
|
|
133
297
|
The harness adapters live in the Python `dharta-runtime` package,
|
|
@@ -151,10 +315,21 @@ Required scopes:
|
|
|
151
315
|
and open. Member listing still requires the key to have been created by a
|
|
152
316
|
current owner or admin.
|
|
153
317
|
- separately scoped keys - sensitive or tenant-admin commands such as
|
|
154
|
-
`audit-log`,
|
|
318
|
+
`audit-log`,
|
|
319
|
+
`members invite|set-role|remove|revoke-invitation|resend-invitation`,
|
|
320
|
+
`models auth create|rotate|models --enable|revoke`, `org model set`,
|
|
321
|
+
`org rename`, `org support-access`, `org transcript-access`,
|
|
322
|
+
`repos disconnect-github`,
|
|
155
323
|
`keys create|rename|revoke`, `agent workspace-inspectable`,
|
|
156
324
|
`agent workspace-access set`, `agent delete`, and `env pull --include-secrets`.
|
|
157
|
-
- `
|
|
325
|
+
- `dharta fleet` splits across two scopes. `fleet:write` covers the routine
|
|
326
|
+
side: previewing an operation, triaging findings, saved views, saved charts,
|
|
327
|
+
and exports. `fleet operations confirm|cancel|retry` and every
|
|
328
|
+
`fleet rollouts` verb need `fleet:operations:write`, a tenant-admin scope
|
|
329
|
+
whose keys must expire within 90 days, because they apply a frozen change set
|
|
330
|
+
to every selected target at once, or change what a running rollout does
|
|
331
|
+
next.
|
|
332
|
+
- `setup` and `genui` are local-only and need no auth.
|
|
158
333
|
|
|
159
334
|
## Tests
|
|
160
335
|
|
|
@@ -162,6 +337,35 @@ Required scopes:
|
|
|
162
337
|
npm test # vitest + msw, covers each command's happy path
|
|
163
338
|
```
|
|
164
339
|
|
|
340
|
+
### Cross-plane checks
|
|
341
|
+
|
|
342
|
+
The `[genui]` rules in `src/genui.ts` mirror the data plane's
|
|
343
|
+
`apps/dharta-python/src/dharta/genui/{manifest,bundle}.py`, which decide what a
|
|
344
|
+
release may carry. Two tests keep the mirror honest:
|
|
345
|
+
|
|
346
|
+
- `test/genui-crossplane.test.ts` reads those two Python files out of the
|
|
347
|
+
monorepo and pins every constant - the built-in list, the size limits, the
|
|
348
|
+
event cadences, the identifier pattern - against the real values. It is part
|
|
349
|
+
of this package's `npm test`, so CI runs it in the `test-ts` job, which is
|
|
350
|
+
triggered by a change under `sdks/` or under
|
|
351
|
+
`apps/dharta-python/src/dharta/genui/`. It fails, never skips, if either
|
|
352
|
+
Python file is missing.
|
|
353
|
+
- `test/crossvalidate/genui_crossvalidate.py` builds real agent folders, runs
|
|
354
|
+
the real CLI over them, and runs the real `parse_genui` and
|
|
355
|
+
`load_genui_bundle` over the same bytes. It needs an interpreter that can
|
|
356
|
+
import the data plane, so it is opt-in and local only: nothing in CI sets
|
|
357
|
+
`DHARTA_CROSSVALIDATE`, so run it yourself when you touch either side of the
|
|
358
|
+
mirror.
|
|
359
|
+
|
|
360
|
+
```sh
|
|
361
|
+
npm run build # the harness runs dist/cli.js
|
|
362
|
+
DHARTA_CROSSVALIDATE=1 npm test # or: npx vitest run test/genui-crossplane.test.ts
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
`DHARTA_PYTHON` picks the interpreter (default `python3`). When
|
|
366
|
+
`DHARTA_CROSSVALIDATE=1` is set the harness must run and pass: an interpreter
|
|
367
|
+
that cannot import `dharta.genui` is a test failure, not a skip.
|
|
368
|
+
|
|
165
369
|
The Rails-side controllers are tested under
|
|
166
370
|
`apps/dharta-web/test/controllers/api/` (e.g. `publishes_controller_test.rb`,
|
|
167
371
|
`rollbacks_controller_test.rb`).
|
package/dist/agent.js
CHANGED
|
@@ -6,6 +6,7 @@ import * as path from "node:path";
|
|
|
6
6
|
import { existsSync, statSync } from "node:fs";
|
|
7
7
|
import { findGitRoot, scanAgentFolders, describeFolder } from "./setup-scan.js";
|
|
8
8
|
import { normalizeNonBlank } from "./validators.js";
|
|
9
|
+
import { CliUsageError } from "./exit-codes.js";
|
|
9
10
|
const AGENT_SLUG_FORMAT = /^[a-z0-9][a-z0-9-]{0,62}$/;
|
|
10
11
|
const MAX_AGENT_NAME_CHARACTERS = 100;
|
|
11
12
|
// Resolve the agent slug a per-agent command operates on. Order (explicit
|
|
@@ -109,7 +110,7 @@ export function validateAgentSlug(value, label) {
|
|
|
109
110
|
const normalized = normalizeNonBlank(value, label);
|
|
110
111
|
if (!AGENT_SLUG_FORMAT.test(normalized)) {
|
|
111
112
|
const suggestion = slugSuggestion(normalized);
|
|
112
|
-
throw new
|
|
113
|
+
throw new CliUsageError(`${label} must be a valid agent slug: lowercase letters, digits, hyphens; max 63.` +
|
|
113
114
|
(suggestion ? ` Did you mean ${suggestion}?` : ""));
|
|
114
115
|
}
|
|
115
116
|
return normalized;
|
|
@@ -120,7 +121,7 @@ export function validateAgentSlug(value, label) {
|
|
|
120
121
|
export function validateAgentName(value, label = "agent name") {
|
|
121
122
|
const normalized = normalizeNonBlank(value, label);
|
|
122
123
|
if ([...normalized].length > MAX_AGENT_NAME_CHARACTERS) {
|
|
123
|
-
throw new
|
|
124
|
+
throw new CliUsageError(`${label} must be 1-${MAX_AGENT_NAME_CHARACTERS} characters.`);
|
|
124
125
|
}
|
|
125
126
|
return normalized;
|
|
126
127
|
}
|
package/dist/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,wEAAwE;AAExE,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,cAAc,EAAoB,MAAM,iBAAiB,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,wEAAwE;AAExE,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,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CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;AACxF,CAAC"}
|
package/dist/api-error.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// `err.status`/`err.body` shape (instead of the SDK's typed errorFor()
|
|
4
4
|
// hierarchy, which the CLI doesn't surface).
|
|
5
5
|
import { SENSITIVE_API_KEY_SCOPES } from "./commands/scopes.js";
|
|
6
|
+
import { CliApiError, CliNetworkError } from "./exit-codes.js";
|
|
6
7
|
export function cliFormatError(status, parsed) {
|
|
7
8
|
// Server messages already name fixes (e.g. the transcript-access 403 points
|
|
8
9
|
// at the settings page) - keep them verbatim. Rails sends `message`; the
|
|
@@ -33,15 +34,14 @@ export function cliFormatError(status, parsed) {
|
|
|
33
34
|
"Check the id or agent slug; for agent commands, run `dharta agent list`. " +
|
|
34
35
|
"Run `dharta auth status` to confirm the active host; DHARTA_BASE_URL must point at the Dharta control API.";
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return err;
|
|
37
|
+
// CliApiError, not a bare Error: `err.status` is what the exit-code
|
|
38
|
+
// taxonomy branches on, and a named class keeps that contract visible.
|
|
39
|
+
return new CliApiError(message, status, parsed);
|
|
40
40
|
}
|
|
41
41
|
export function cliFormatNetworkError(url, error) {
|
|
42
42
|
const origin = new URL(url).origin;
|
|
43
|
-
return new
|
|
44
|
-
"Check your network and DHARTA_BASE_URL, then try again.");
|
|
43
|
+
return new CliNetworkError(`Could not reach Dharta at ${origin} (${formatCause(error)}). ` +
|
|
44
|
+
"Check your network and DHARTA_BASE_URL, then try again.", url);
|
|
45
45
|
}
|
|
46
46
|
export async function cliFormatRawError(res) {
|
|
47
47
|
const text = await res.text();
|
package/dist/api-error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-error.js","sourceRoot":"","sources":["../src/api-error.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,2EAA2E;AAC3E,u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;AAED,SAAS,iBAAiB,CAAC,KAAa;IACtC,OAAO,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;AAC/F,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
+
export declare function isNonMutatingCommandPath(path: string): boolean;
|
|
3
4
|
export declare function buildProgram(): Command;
|
|
5
|
+
export declare const TOP_LEVEL_HELP_GROUPS: readonly [readonly ["Setup and auth", readonly ["login", "auth", "whoami", "create", "setup"]], readonly ["Local and deploy", readonly ["dev", "deploy", "status", "rollback", "logs"]], readonly ["Runtime operations", readonly ["open", "sessions", "session", "ps", "send", "files", "artifact", "schedules"]], readonly ["Agent configuration", readonly ["agent", "env", "appearance", "genui"]], readonly ["Management", readonly ["usage", "analytics", "directories", "fleet", "kartas", "caps", "embed-keys", "webhooks", "audit-log", "keys", "models", "org", "members", "repos", "api"]], readonly ["Utilities", readonly ["doctor", "update", "completion"]]];
|
|
4
6
|
export declare function main(argv: string[]): Promise<void>;
|
|
7
|
+
export declare function reportCliFailure(err: unknown, write?: (line: string) => void): number;
|
|
5
8
|
export declare function readStdin(): Promise<string>;
|