@h1r-ai/croche-cli 0.6.1 → 0.7.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  **Croche SDK License** (version 1, beta)
2
2
 
3
- Applies to `@h1r-ai/croche`, `@h1r-ai/croche-react-native`, `@h1r-ai/croche-cli`,
3
+ Applies to `@h1r-ai/croche`, `@h1r-ai/croche-image-node`, `@h1r-ai/croche-react-native`, `@h1r-ai/croche-cli`,
4
4
  the Croche Android library (AAR), and the `CrocheRuntime` Swift package.
5
5
 
6
6
  Copyright (c) 2026 H1R AI. All rights reserved.
package/README.md CHANGED
@@ -106,7 +106,7 @@ The bundled frontend gets the matching origin automatically with `--remote`.
106
106
 
107
107
  Simulator connections use loopback. For a real Android device, use
108
108
  `adb reverse tcp:8791 tcp:8791` for the approved loopback path. Real-iOS LAN
109
- ingest/debug-key verification is a separate opt-in and is **not implemented by
109
+ ingest/development-key verification is a separate opt-in and is **not implemented by
110
110
  this remote-viewer option**.
111
111
 
112
112
  The CLI stores private credentials in mode-0600 files under the OS user state
@@ -214,16 +214,16 @@ issuance and revocation are available only in web Studio.
214
214
  ## App credentials, attestation and usage
215
215
 
216
216
  Inspect credential metadata, attestation and usage with the account key.
217
- The coding agent can issue and revoke debug keys with the CLI. Server credentials and attestation changes stay in web Studio.
217
+ The coding agent can issue and revoke development keys with the CLI. Server credentials and attestation changes stay in web Studio.
218
218
 
219
219
  ```sh
220
- # Simulators, emulators and your own devices: a debug key, used as `debugKey` in debug
220
+ # Simulators, emulators and your own devices: a development key, used as `developmentKey` in debug
221
221
  # builds only. Calls use your weekly development allowance, never Runtime Credit.
222
- croche debug-keys create --project PROJECT_ID
223
- # Writes CROCHE_DEBUG_KEY to ./.env without printing it. Use --dotenv-file PATH to choose
222
+ croche development-keys create --project PROJECT_ID
223
+ # Writes CROCHE_DEVELOPMENT_KEY to ./.env without printing it. Use --dotenv-file PATH to choose
224
224
  # the destination. Existing values require --force; tracked files are refused.
225
- croche debug-keys list --project PROJECT_ID
226
- croche debug-keys revoke --project PROJECT_ID KEY_ID
225
+ croche development-keys list --project PROJECT_ID
226
+ croche development-keys revoke --project PROJECT_ID KEY_ID
227
227
 
228
228
  # A web app's own backend (one Runtime per end user): a server key, kept on the server.
229
229
  croche keys server list PROJECT_ID
@@ -232,7 +232,7 @@ croche keys server list PROJECT_ID
232
232
  croche attestation get PROJECT_ID
233
233
 
234
234
  # What each end user and each agent cost, and what is left to spend.
235
- croche projects usage PROJECT_ID --period week # week | month (default) | all
235
+ croche projects usage PROJECT_ID --period week # week | month (default) | UTC YYYY-MM
236
236
  ```
237
237
 
238
238
  If `croche ... --env-file ...` exits 9, use `--dotenv-file` for the CLI destination. Node’s own `node --env-file=.env app.mjs` still loads the file into your app.
@@ -306,14 +306,71 @@ Local broker control commands keep `data.request`, including `request_id` and
306
306
  `data.request.result.agents`, `.history`, or `.tools`. `runtime result` uses the
307
307
  same shape when inspecting that request; it does not flatten correlation fields.
308
308
 
309
+ ### CLI HTTP contract
310
+
311
+ Studio requests go to the configured Croche Cloud API origin with
312
+ `Authorization: Bearer <Account key>` (a `dk_` account key). Writes with a
313
+ body use JSON. Access is scoped to the authenticated account and its projects.
314
+ The table lists the request fields the CLI sends and the raw JSON responses it
315
+ reads. Successful responses are HTTP 200 unless noted. The frozen fields below
316
+ describe the CLI's output, including any renaming and wrapping.
317
+
318
+ Project reads include `key_format` (`legacy` or `current`). A legacy key also includes
319
+ `key_hint`: “Old project key format. Rotate project key in Studio before you ship a 0.7 app; after that, rotating resets Croche data on devices when they update.”
320
+
321
+ | Method | Route | Request | Response |
322
+ | --- | --- | --- | --- |
323
+ | GET | `/api/studio/account` | — | `{account}` |
324
+ | GET | `/api/studio/projects` | — | `{projects}` |
325
+ | POST | `/api/studio/projects` | `{name}` | 201 `{project}` |
326
+ | GET | `/api/studio/projects/{project}` | — | `{project}` |
327
+ | PATCH | `/api/studio/projects/{project}` | `{name?, runtime_policy?: {routing}}`, at least one | `{project}` |
328
+ | GET | `/api/studio/projects/{project}/operations` | Optional `limit` (1–500), `status`, `type`, `q` | `{operations, has_more, next_cursor}`, cursor is `{started_at, operation_id}` or null |
329
+ | GET | `/api/studio/projects/{project}/cost` | Optional `purpose`, production (default) or development; `month` is UTC YYYY-MM (current month by default) | `{cost}` |
330
+ | GET | `/api/studio/projects/{project}/usage` | `period` is week, month or UTC YYYY-MM; CLI defaults to month | `{usage}` |
331
+ | GET | `/api/studio/projects/{project}/attestation` | — | `{attestation}`, excludes the decryption key |
332
+ | GET | `/api/studio/projects/{project}/runtimes` | `limit=100`, then `before` and `before_id` from `next_cursor` | `{runtimes, has_more, next_cursor}`; the command returns one complete list |
333
+ | GET | `/api/studio/projects/{project}/server-keys` | — | `{server_keys}` |
334
+ | GET | `/api/studio/projects/{project}/debug-tokens` | — | `{debug_tokens}` |
335
+ | POST | `/api/studio/projects/{project}/debug-tokens` | `{name}` | 201 `{debug_token, secret}`, the Development key is returned once |
336
+ | DELETE | `/api/studio/projects/{project}/debug-tokens/{key}` | — | `{debug_token}` |
337
+ | GET | `/api/studio/projects/{project}/config/bases` | — | `{bases}` with `revision_id`, `document_known`, `installs_7d` and `unknown_count` per base |
338
+ | PUT | `/api/studio/projects/{project}/config/bases/{base}` | `{version: 1, document}`, bundled config identified by its SHA-256 revision | `{version: 1, base_revision}` |
339
+ | GET | `/api/studio/projects/{project}/config/draft` | `base` query | `{draft}`, null when absent, otherwise includes `revision_id`, `base_revision` and `document` |
340
+ | PUT | `/api/studio/projects/{project}/config/draft` | `base` query and `{document, base_revision, base_revision_id, note?}`, null head for the first save | `{revision_id, base_revision, created}` |
341
+ | GET | `/api/studio/projects/{project}/config/versions` | `base` query | `{versions}` |
342
+ | GET | `/api/studio/projects/{project}/config/revisions/{revision}` | — | `{revision}` including `document` |
343
+ | GET | `/api/studio/projects/{project}/config/effective` | `base` query | `{base, patch_revision, revision_id, document}`, null patch when the base is effective |
344
+ | GET | `/api/probe` | No body, local debugger pairing Bearer token | `{ok: true, paused, limits, pid?}` |
345
+ | POST | `/api/shutdown` | No body, local debugger pairing Bearer token | `{ok: true, stopping: true}` |
346
+ | POST | `/api/debug/codes` | No body, local debugger pairing Bearer token | `{code, expires_at, studioUrl}`, single use for 10 minutes |
347
+
348
+ Cloud refusals use `{error: {code, message, details?}}`. Invalid or revoked
349
+ credentials return 401 `unauthorized`. Account access or authority refusals
350
+ return 403 (`account_disabled`, `invite_required` or `human_session_required`).
351
+ Missing projects or resources return 404 `not_found`. A conflicting
352
+ draft save returns 409 `draft_conflict` with the current head in `details.head`.
353
+ An unknown base returns 409 `unknown_base`. Invalid request fields and filters
354
+ return 400 with the applicable code. Project and Development-key quotas return 429
355
+ `project_limit` and `debug_token_limit`, respectively. The CLI
356
+ uses exit 3 for 401/403, exit 1 for other Cloud refusals and exit 4 for transport
357
+ failures without retry. Login maps its account-route 401 to `invalid_credentials`.
358
+
359
+ The debugger routes use the bundled loopback collector and its pairing token.
360
+ Code issuance and shutdown refuse a browser `Origin`. Refusals return
361
+ `{error: string}`: 401 for missing or invalid credentials, 403 for a disallowed
362
+ host or cross-site request, and 404 when shutdown is unavailable. The CLI
363
+ reports a failed link request as `studio_link_unavailable`.
364
+
309
365
  <!-- studio-cli-json:start -->
310
366
  ### Frozen Cloud JSON fields
311
367
 
312
368
  The hackathon CLI freezes the field paths and JSON types below, from
313
369
  [studio-cli-json.json](../../vectors/studio-cli-json.json). Additions are free;
314
370
  renames/removals require a new path alongside the old one, except a retirement the founder
315
- approves before 1.0 (2026-10-25: `routing.quantizations`, removed directly). `[]` means every
316
- array member; `|null` marks a nullable value. Empty lists have no members.
371
+ approves before 1.0 (2026-10-25: `routing.quantizations`, removed directly; 2026-11-21 02:05:31Z,
372
+ grants and adjustments deleted: `runtime_policy.max_single_adjustment_usd`, removed directly).
373
+ `[]` means every array member; `|null` marks a nullable value. Empty lists have no members.
317
374
  Config content follows the project-config grammar, so its application fields
318
375
  are not required on every document. Local `debug`, `control` and `runtime`
319
376
  commands use their separate local protocols and are outside this Cloud freeze.
@@ -329,31 +386,31 @@ uses `prefix`; project `public_key` is returned only in project views.
329
386
 
330
387
  | Shape | Relative paths and JSON types |
331
388
  | --- | --- |
332
- | `project` | `id`: string; `name`: string; `created_at`: string; `public_key`: string; `status`: string; `app_access_enabled`: boolean; `budget`: object; `budget.limit_usd`: number; `budget.period`: string; `budget.used_usd`: number; `runtime_policy`: object; `runtime_policy.default_user_allowance_usd`: number; `runtime_policy.host_budget_control_enabled`: boolean; `runtime_policy.max_user_allowance_usd`: number; `runtime_policy.max_single_adjustment_usd`: number; `runtime_policy.attestation`: string; `allowed_models`: array; `allowed_models[]`: string |
333
- | `account` | `access`: string; `id`: string; `name`: string; `email`: string; `admin`: boolean; `plan`: object\|null; `credit_balance_usd`: number; `outstanding_key_limits_usd`: number; `spent_usd`: number |
389
+ | `project` | `id`: string; `name`: string; `created_at`: string; `public_key`: string; `key_format`: string; `status`: string; `app_access_enabled`: boolean; `budget`: object; `budget.limit_usd`: number; `budget.period`: string; `budget.used_usd`: number; `runtime_policy`: object; `runtime_policy.default_user_allowance_usd`: number; `runtime_policy.host_budget_control_enabled`: boolean; `runtime_policy.max_user_allowance_usd`: number; `runtime_policy.attestation`: string; `allowed_models`: array; `allowed_models[]`: string |
390
+ | `account` | `access`: string; `id`: string; `name`: string; `email`: string; `admin`: boolean; `plan`: object\|null; `credit_balance_usd`: number; `outstanding_key_limits_usd`: number\|null |
334
391
  | `plan` | `plan_id`: string; `name`: string; `ends_at`: string |
335
392
  | `routing` | `mode`: string; `providers`: array; `providers[]`: string |
336
393
  | `key_metadata` | `id`: string; `name`: string; `prefix`: string; `created_at`: string; `last_used_at`: string\|null; `revoked_at`: string\|null; `installations`: number |
337
394
  | `development_key` | `follow_draft`: boolean; `warning`: string\|null |
338
395
  | `server_key` | `spent_usd`: number |
339
- | `cost` | `project_id`: string; `currency`: string; `period`: string; `purpose`: string; `charged_cost_usd`: number\|null; `known_charged_cost_usd`: number; `unknown_operations`: number; `operations`: number |
396
+ | `cost` | `project_id`: string; `currency`: string; `period`: string; `purpose`: string; `charged_cost_usd`: number\|null; `known_charged_cost_usd`: number; `unknown_operations`: number; `operations`: number; `month`: string; `posted_cost_usd`: number\|null; `summary_status`: string |
340
397
  | `development_usage` | `scope`: string; `week_start`: string; `calls`: number; `unknown_calls`: number; `known_percent`: number\|null; `used_percent`: number\|null; `remaining_percent`: number\|null |
341
398
  | `usage` | `project_id`: string; `period`: string; `since`: string\|null; `project`: object; `project.limit_usd`: number; `project.used_usd`: number; `project.remaining_usd`: number; `project.period_start`: string; `development`: object; `by_user`: array; `by_agent`: array |
342
399
  | `usage_row` | `calls`: number; `runtime_usd`: number; `subscription_calls`: number; `subscription_percent`: number\|null; `unsettled_calls`: number; `prompt_tokens`: number; `cached_tokens`: number; `completion_tokens`: number; `last_call_at`: string |
343
400
  | `operation` | `agent_instance_id`: string\|null; `operation_id`: string; `project_id`: string; `operation_type`: string; `name`: string; `status`: string; `model`: string\|null; `provider`: string\|null; `error_code`: string\|null; `parent_operation_id`: string\|null; `cost_status`: string; `duration_ms`: number; `started_at`: string; `user_id`: string; `agent_id`: string; `runtime_instance_id`: string; `session_id`: string; `turn_id`: string; `generation_id`: string\|null; `billed_to`: string; `access_path`: string; `charged_cost_usd`: number\|null; `installation_id`: string\|null |
344
401
  | `operation_metadata` | `prompt_tokens`: number; `cached_tokens`: number; `completion_tokens`: number; `ttft_ms`: number; `gateway_status`: number; `streamed`: boolean; `purpose`: string; `finish_reason`: string |
345
- | `runtime` | `runtime_instance_id`: string; `user_id`: string; `user`: string; `attested_by`: string; `access_path`: string; `attestation_outcome`: string\|null; `attestation_reason`: string\|null; `attestation_platform`: string\|null; `app_version`: string\|null; `sdk`: string; `sdk_version`: string; `status`: string; `last_seen_at`: string; `spent_usd`: number |
346
- | `ios` | `team_id`: string; `bundle_id`: string; `allow_development`: boolean |
402
+ | `runtime` | `runtime_instance_id`: string; `user_id`: string; `user`: string; `attested_by`: string; `access_path`: string; `attestation_outcome`: string\|null; `attestation_reason`: string\|null; `attestation_platform`: string\|null; `app_version`: string\|null; `sdk`: string; `sdk_version`: string; `status`: string; `last_seen_at`: string |
403
+ | `ios` | `team_id`: string; `bundle_id`: string; `allow_development`: boolean; `recent_failures`: array; `recent_failures[].reason`: string; `recent_failures[].installs`: number; `recent_failures[].last_at`: string |
347
404
  | `android` | `package_name`: string; `certificate_sha256`: array; `certificate_sha256[]`: string; `verification_key`: string; `decryption_key_set`: boolean; `recent_failures`: array; `recent_failures[].reason`: string; `recent_failures[].installs`: number; `recent_failures[].last_at`: string |
348
405
  | `unverified_path` | `enabled`: boolean; `limit_usd`: number; `key_status`: string; `spent_usd`: number; `spent_this_period_usd`: number; `remaining_usd`: number; `installs`: number; `unknown_cost_calls`: number |
349
406
  | `draft` | `revision_id`: string; `schema`: number; `document`: object; `document.schema`: number; `updated_by`: string; `updated_at`: string; `document.base`: string; `document.set`: object; `document.unset`: array |
350
407
  | `version` | `project_id`: string; `version`: number; `revision_id`: string; `kind`: string; `from_version`: number\|null; `note`: string\|null; `released_by`: string; `released_at`: string; `applied_7d`: number |
351
408
  | `unverified_install` | `installation_id`: string; `attestation_outcome`: string\|null; `attestation_reason`: string\|null; `platform`: string\|null; `sdk`: string; `sdk_version`: string; `app_version`: string\|null |
352
- | `debug_key` | `warning`: string\|null |
409
+ | `issued_development_key` | `warning`: string\|null |
353
410
 
354
411
  | Command / variant | Frozen paths (relative to the JSON envelope) |
355
412
  | --- | --- |
356
- | `auth whoami` / account | `ok`: boolean; `data`: object; `data.account`: object; `data.credential.source`: string; `data.credential.prefix`: string; `data.account` → `account`; `data.account.plan` → `plan` |
413
+ | `auth whoami` / account | `ok`: boolean; `data`: object; `data.account`: object; `data.credential.source`: string; `data.credential.prefix`: string; `data.cloud_url`: string; `data.account` → `account`; `data.account.plan` → `plan` |
357
414
  | `projects list` / projects-list | `ok`: boolean; `data`: object; `data.projects`: array; `data.projects[]` → `project` |
358
415
  | `projects create` / project-create | `ok`: boolean; `data`: object; `data.project`: object; `data.project` → `project` |
359
416
  | `projects get` / project-get | `ok`: boolean; `data`: object; `data.project`: object; `data.project` → `project` |
@@ -363,11 +420,11 @@ uses `prefix`; project `public_key` is returned only in project views.
363
420
  | `projects operations` / operation-production-cost | `ok`: boolean; `data`: object; `data.operations`: array; `data.has_more`: boolean; `data.next_cursor`: object\|null; `data.operations[].provider_cost_usd`: number\|null; `data.operations[]` → `operation`; `data.operations[]` → `operation_metadata` |
364
421
  | `projects operations` / operations-unverified-failure | `ok`: boolean; `data`: object; `data.operations`: array; `data.has_more`: boolean; `data.next_cursor`: object\|null; `data.operations[].unverified`: object\|null; `data.operations[].error_detail_code`: string; `data.operations[]` → `operation`; `data.operations[]` → `operation_metadata`; `data.operations[].unverified` → `unverified_install` |
365
422
  | `projects cost` / cost-unresolved | `ok`: boolean; `data`: object; `data.cost`: object; `data.cost.charged_cost_usd`: null; `data.cost` → `cost` |
366
- | `keys development list` / development-keys | `ok`: boolean; `data`: object; `data.debug_keys`: array; `data.debug_keys[]` → `key_metadata`; `data.debug_keys[]` → `development_key` |
423
+ | `keys development list` / development-keys | `ok`: boolean; `data`: object; `data.development_keys`: array; `data.development_keys[]` → `key_metadata`; `data.development_keys[]` → `development_key` |
367
424
  | `keys server list` / server-keys | `ok`: boolean; `data`: object; `data.server_keys`: array; `data.server_keys[]` → `key_metadata`; `data.server_keys[]` → `server_key` |
368
425
  | `projects usage` / usage-week | `ok`: boolean; `data`: object; `data.usage`: object; `data.usage.by_user[].user_id`: string; `data.usage.by_user[].user`: string; `data.usage.by_agent[].agent_id`: string; `data.usage` → `usage`; `data.usage.development` → `development_usage`; `data.usage.by_user[]` → `usage_row`; `data.usage.by_agent[]` → `usage_row` |
369
426
  | `projects usage` / usage-month | `ok`: boolean; `data`: object; `data.usage`: object; `data.usage.by_user[].user_id`: string; `data.usage.by_user[].user`: string; `data.usage.by_agent[].agent_id`: string; `data.usage` → `usage`; `data.usage.development` → `development_usage`; `data.usage.by_user[]` → `usage_row`; `data.usage.by_agent[]` → `usage_row` |
370
- | `projects usage` / usage-all | `ok`: boolean; `data`: object; `data.usage`: object; `data.usage.by_user[].user_id`: string; `data.usage.by_user[].user`: string; `data.usage.by_agent[].agent_id`: string; `data.usage` → `usage`; `data.usage.development` → `development_usage`; `data.usage.by_user[]` → `usage_row`; `data.usage.by_agent[]` → `usage_row` |
427
+ | `projects usage` / usage-past-month | `ok`: boolean; `data`: object; `data.usage`: object; `data.usage.by_user[].user_id`: string; `data.usage.by_user[].user`: string; `data.usage.by_agent[].agent_id`: string; `data.usage` → `usage`; `data.usage.development` → `development_usage`; `data.usage.by_user[]` → `usage_row`; `data.usage.by_agent[]` → `usage_row` |
371
428
  | `attestation get` / attestation | `ok`: boolean; `data`: object; `data.attestation`: object; `data.attestation.ios`: object\|null; `data.attestation.android`: object\|null; `data.attestation.unverified_path`: object; `data.attestation.ios` → `ios`; `data.attestation.android` → `android`; `data.attestation.unverified_path` → `unverified_path` |
372
429
  | `runtimes list` / runtimes | `ok`: boolean; `data`: object; `data.runtimes`: array; `data.runtimes[]` → `runtime` |
373
430
  | `config get` / config-get-draft | `ok`: boolean; `data`: object; `data.config.schema`: number; `data.config.base`: string; `data.config.set`: object; `data.config.unset`: array; `data.config`: object |
@@ -377,9 +434,9 @@ uses `prefix`; project `public_key` is returned only in project views.
377
434
  | `config get` / config-get-version-output | `ok`: boolean; `data`: object; `data.config.file`: string; `data.config.revision_id`: string\|null; `data.config.version`: number; `data.config`: object |
378
435
  | `config save` / config-save | `ok`: boolean; `data`: object; `data.config.revision_id`: string; `data.config.created`: boolean; `data.config`: object |
379
436
  | `config list` / config-list | `ok`: boolean; `data`: object; `data.versions`: array; `data.draft`: object\|null; `data.versions[]` → `version`; `data.draft` → `draft` |
380
- | `auth whoami` / account-no-plan | `ok`: boolean; `data`: object; `data.account`: object; `data.account.plan`: null; `data.credential.source`: string; `data.credential.prefix`: string; `data.account` → `account` |
437
+ | `auth whoami` / account-no-plan | `ok`: boolean; `data`: object; `data.account`: object; `data.account.plan`: null; `data.credential.source`: string; `data.credential.prefix`: string; `data.cloud_url`: string; `data.account` → `account` |
381
438
  | `projects operations` / empty-operations | `ok`: boolean; `data`: object; `data.operations`: array; `data.has_more`: boolean; `data.next_cursor`: null |
382
- | `keys development list` / empty-development-keys | `ok`: boolean; `data`: object; `data.debug_keys`: array |
439
+ | `keys development list` / empty-development-keys | `ok`: boolean; `data`: object; `data.development_keys`: array |
383
440
  | `keys server list` / empty-server-keys | `ok`: boolean; `data`: object; `data.server_keys`: array |
384
441
  | `runtimes list` / empty-runtimes | `ok`: boolean; `data`: object; `data.runtimes`: array |
385
442
  | `projects cost` / cost-known | `ok`: boolean; `data`: object; `data.cost`: object; `data.cost.charged_cost_usd`: number; `data.cost` → `cost` |
@@ -389,9 +446,9 @@ uses `prefix`; project `public_key` is returned only in project views.
389
446
  | `config get` / empty-config-output | `ok`: boolean; `data`: object; `data.config.file`: string; `data.config.revision_id`: null; `data.config`: object |
390
447
  | `config list` / empty-config-list | `ok`: boolean; `data`: object; `data.versions`: array; `data.draft`: null |
391
448
  | `projects list` / empty-projects-list | `ok`: boolean; `data`: object; `data.projects`: array |
392
- | `debug-keys create` / debug-keys-create | `ok`: boolean; `data`: object; `data.debug_key`: object; `data.dotenv_file`: string; `data.debug_key` → `key_metadata`; `data.debug_key` → `debug_key` |
393
- | `debug-keys list` / debug-keys-list | `ok`: boolean; `data`: object; `data.debug_keys`: array; `data.debug_keys[]` → `key_metadata`; `data.debug_keys[]` → `debug_key` |
394
- | `debug-keys revoke` / debug-keys-revoke | `ok`: boolean; `data`: object; `data.debug_key`: object; `data.debug_key` → `key_metadata`; `data.debug_key` → `debug_key` |
449
+ | `development-keys create` / development-keys-create | `ok`: boolean; `data`: object; `data.development_key`: object; `data.dotenv_file`: string; `data.development_key` → `key_metadata`; `data.development_key` → `issued_development_key` |
450
+ | `development-keys list` / development-keys-list | `ok`: boolean; `data`: object; `data.development_keys`: array; `data.development_keys[]` → `key_metadata`; `data.development_keys[]` → `issued_development_key` |
451
+ | `development-keys revoke` / development-keys-revoke | `ok`: boolean; `data`: object; `data.development_key`: object; `data.development_key` → `key_metadata`; `data.development_key` → `issued_development_key` |
395
452
 
396
453
  | Refusal / exit class | Frozen paths |
397
454
  | --- | --- |
@@ -457,54 +514,56 @@ From this repository, run `npm run test --workspace @h1r-ai/croche-cli`, `npm ru
457
514
 
458
515
  ## Author configuration as files
459
516
 
460
- Build and split configuration offline, without credentials or a Cloud request:
517
+ Build and split configuration offline, without credentials or a Croche Cloud request.
518
+ Upload the resulting base when you want to edit it in Studio:
461
519
 
462
520
  ```sh
463
521
  croche config build ./config --output snapshot.json
464
522
  croche config split snapshot.json --output ./config-copy
465
- croche config save snapshot.json
523
+ croche config push-base snapshot.json --project YOUR_PROJECT_ID
524
+ ```
525
+
526
+ The authoring root contains `project.json`, with the same format 7 envelope
527
+ as the built bundle. Agents can be inline or explicit file references:
528
+
529
+ ```json
530
+ {
531
+ "schema": 7,
532
+ "project": {
533
+ "defaults": {"model": "openai/gpt-4o-mini"},
534
+ "languages": {"default": "en", "supported": ["en", "fr"]}
535
+ },
536
+ "agents": {"helper": {"$file": "agents/helper.json"}}
537
+ }
466
538
  ```
467
539
 
468
- The authoring root contains `project.json`, using the same `{schema, config}`
469
- document envelope as a saved snapshot. Agent layers can be inline or explicit
470
- file references:
540
+ `agents/helper.json` contains an agent configuration. A chat agent can use
541
+ text files for its wording and memory policy:
471
542
 
472
543
  ```json
473
544
  {
474
- "schema": 6,
475
- "config": {
476
- "instructions": {"$file": "text/en/instructions.txt"},
477
- "languages": {"fr": {"instructions": {"$file": "text/fr/instructions.txt"}}},
478
- "agents": {"helper": {"$file": "agents/helper.json"}}
479
- }
545
+ "instructions": {"$file": "text/en/instructions.txt"},
546
+ "languages": {"fr": {"instructions": {"$file": "text/fr/instructions.txt"}}}
480
547
  }
481
548
  ```
482
549
 
483
- `agents/helper.json` contains one config layer. References in agent files are
484
- relative to the authoring root too. Text references work in `instructions`,
485
- `markerGuide`, `toolGuide`, and `memory.policy`, including their agent/language
486
- layers and mode `toolGuide`. Each reference object contains only `$file`.
487
- References must remain inside the root: absolute paths, `.`/`..` segments,
488
- backslashes, and symlinks that escape the root are refused. Text is UTF-8;
489
- line endings, a text BOM and final newlines are preserved.
490
-
491
- Only referenced files are read; application code and unreferenced files are
492
- never scanned or executed. Configuration still follows Cloud's existing schema:
493
- unknown fields are refused with a source file and JSON-pointer error, never
494
- silently dropped. Opaque JSON is preserved only where today's closed grammar
495
- explicitly permits it. Application-layer override fields are not part of the snapshot.
496
- Errors identify the source file and JSON pointer.
497
-
498
- The compiler owns `requires`; do not write it in authoring files. It infers any
499
- required capabilities from the shared registry, omitting the field when empty.
500
- Split/build and numbered version exports preserve the snapshot requirements.
550
+ Paths in both JSON files are relative to the authoring root. Chat agent text
551
+ references work in `instructions`, `toolGuide`, `wikiGuide`
552
+ and `memory.policy`. Language overrides support the three wording fields.
553
+ Each reference object contains only `$file`. References must stay inside the
554
+ root. Absolute paths, `.`/`..` segments, backslashes, and escaping symlinks
555
+ are refused. Text is UTF-8 and preserves line endings, a text BOM, and final newlines.
556
+
557
+ The CLI reads only the referenced files. Build, split and push-base use
558
+ the same Core bundle validation as Croche Cloud. Errors identify the source file
559
+ and JSON pointer. Use `config save` for a patch against an uploaded base.
501
560
 
502
561
  Build writes the canonical snapshot document without adding release metadata or
503
562
  an id field. Its `revision_id` result is `sha256:` plus the hash of those UTF-8
504
563
  bytes, identical to Cloud's revision id. Split produces `project.json`, agent
505
564
  files and text files; rebuilding them preserves that id. Generated filenames are
506
565
  bounded numbered names (`agents/000001.json`, `text/000001.txt`), independent of
507
- agent, mode and language ids. `manifest.json` maps these names to config pointers
566
+ agent and language ids. `manifest.json` maps these names to config pointers
508
567
  and agent ids for navigation. Agent files emitted by split contain `{id, config}`;
509
568
  build reads their ids from JSON and checks them against the `project.json` keys,
510
569
  never deriving an id from a filename. Hand-authored plain agent layers are also
@@ -568,6 +627,9 @@ Saved credentials live in `croche/credentials.json` beneath `$XDG_CONFIG_HOME`
568
627
  and credential files are created 0600, with atomic replacement.
569
628
  `CROCHE_ACCOUNT_KEY` overrides the saved key. The retired `CROCHE_DEVELOPER_KEY` name is ignored; use `CROCHE_ACCOUNT_KEY` or the saved login. `croche auth whoami --json`
570
629
  shows the account, credential source (`env` or `stored`), and prefix only.
630
+ It also reports the request origin as `data.cloud_url` (for example,
631
+ `https://api.croche.ai` or `https://api.dev.croche.ai`). Without `--json`,
632
+ `croche auth whoami` prints this origin on a `Cloud:` line.
571
633
  `croche logout` removes the saved credential; an environment key remains set.
572
634
 
573
635
  Upload a bundled config as an immutable Cloud base using your account credential: