@sylphx/cli 0.18.0 → 0.19.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,117 @@
1
1
  # @sylphx/cli
2
2
 
3
+ ## 0.19.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 11cdd87: Declare `typeid-js` as a runtime dependency of `@sylphx/contract` and republish the SDK/CLI graph so globally installed CLI packages can load contract schemas without missing dependency failures.
8
+ - Updated dependencies [11cdd87]
9
+ - @sylphx/sdk@0.21.1
10
+
11
+ ## 0.19.0
12
+
13
+ ### Minor Changes
14
+
15
+ - a558ae8: Add the Agent Resource Graph public surface: contract schemas and the
16
+ Management-plane project graph endpoint, typed management client access, and the
17
+ `sylphx agent-resources graph` CLI command for read-only resource awareness.
18
+ - b25943a: Add `sylphx deploy --force` and a machine-readable deployment `skipReason` (#2941).
19
+
20
+ A genuinely-new merged commit could be deduped to `status=skipped` (no build/rollout) with no override and no explanation. The deploy skip contract now skips only when every targeted service is already running the resolved commit; any other state builds and rolls out, `--force` always builds, and a skipped deployment carries a machine-readable `skipReason` surfaced via the management API + CLI.
21
+
22
+ - ce8e00e: Add the `sylphx device-sessions` command group for driving interactive Android device sessions (ADR-2560): `create` (boots a session and, with `--wait`, polls to `ready`), `list`, `get`, `install <id> <apk-uri>`, `input <id> tap|swipe|key|text …`, `launch`, `screenshot` (saves the inline PNG or prints the hosted URL, `--open` to view), `logcat`, and `rm`. Every subcommand supports `--json`, `--project`/`--org` scoping, and RFC 7807 error rendering, mirroring the `sandbox` and `mobile-device-tests` groups. The control-plane endpoints are consumed through the `ApiService` `authedFetch` passthrough — the runtime/contract are unchanged.
23
+ - 8655c00: Distributed Batch Compute — the public Distributed Run surface (PR #2822, ADR
24
+ distributed-batch-compute, ADR-040 successor). Fan one logical job out to N
25
+ indexed shards with a single call: the platform owns sharding, gang start
26
+ (all shards admitted together or none), the per-org concurrent-shard budget,
27
+ and the aggregate + per-shard rollup. `parallelism` defaults to `1`, so the
28
+ existing single-shard `run()` path is the N=1 case and stays byte-identical on
29
+ the wire (zero breaking change).
30
+
31
+ - `@sylphx/contract`: the `DistributedRun` read model and create surface —
32
+ `parallelism` (1..256), `completionMode` (`Indexed` / `NonIndexed`),
33
+ gang-scheduling, per-shard status (`DistributedRunShard`), and the
34
+ aggregate roll-up. The `GET /runs/:id?view=distributed` additive superset of
35
+ the single-shard read model. Adds the larger `2xlarge` / `mem-2xlarge`
36
+ machine tiers to `MachineSize`.
37
+ - `@sylphx/sdk`: `RunsClient.runDistributed()` (a strict superset of
38
+ `RunsClient.run()`), `runDistributedFromId()`, the `DistributedRunHandle`
39
+ (`wait` / `status` / `shards` / `logs` / `cancel`), and the
40
+ `CreateDistributedRunOptions` / `DistributedRun` / `DistributedRunShard`
41
+ types. Replaces hand-rolled client-side `Promise.all` fan-out.
42
+ - `@sylphx/cli`: `sylphx run --parallelism` submits a distributed run with a
43
+ `--follow` aggregate + per-shard status table, and `sylphx runs`
44
+ (`list` / `get` / `logs --shard` / `cancel`) drives the read model. The CLI
45
+ dogfoods the public SDK `RunsClient` through `packages/cli/src/services/runs.ts`.
46
+
47
+ - 38d1888: Add the operator-only `POST /operator/env-services/admit-built-artifact` contract, Management SDK method, `platform:envservicesbuiltartifacts:admit` scope, and `sylphx admin env-services admit-built-artifact` CLI command. The command admits a digest-pinned managed-registry image into the ADR-070 `builds -> artifacts -> deployments -> environment_services` pointer chain for audited control-plane bootstrap and disaster recovery.
48
+ - 28b8da3: Add the audited managed-resource requeue operator surface: contract schemas and
49
+ `POST /operator/resources/:id/requeue`, typed management SDK access, and the
50
+ `sylphx admin resources requeue` CLI command. The operation accepts only rows
51
+ parked at `reconcile_status='failed'`, clears failed-attempt metadata, bumps
52
+ generation, wakes the controller, and preserves controller-only Kubernetes
53
+ manifest ownership.
54
+ - 266c3c2: Materialize manifest `[env]` into the runtime container (#2938).
55
+
56
+ `sylphx deploy` now publishes the manifest and pins the exact published version into the deploy trigger (`manifestVersion`), so the server captures that version's effective `[env]` into each environment's desired state and the reconciler materializes it into the runtime container. Capture is env-scoped (never the project-global latest row) and fenced with the rollout side effect — atomic with the desired-pointer promotion on an image deploy, and before build dispatch on a build deploy. The contract exposes the manifest `[env]` value / `from_secret` / `from_resource` schema and the managed-key guard.
57
+
58
+ - 978b924: Allow direct and distributed Runs to resolve their image from a same-environment
59
+ service deployment via `imageFromService` / `--image-from-service`, so customers
60
+ can submit batch jobs against their own built service images without scraping
61
+ registry tags or using a privileged platform-only path.
62
+ - 3508a03: Expose a bounded `backoffLimitPerIndex` retry budget for opportunistic distributed Runs. Customers can now submit `parallelism > 1`, `gangScheduling: false` workloads that tolerate low-priority shard preemptions without a private platform workaround; SDK and CLI helpers forward the public field.
63
+ - 282b22b: Extend operator env-service built-artifact admission so same-service,
64
+ same-digest built artifacts with existing build provenance can repair stale
65
+ `sourceRef` pullspec drift. The management contract and SDK now return
66
+ `sourceRefRepaired`, and the CLI surfaces the repair outcome.
67
+ - 4aa3c84: Add Workspace Compute sandbox management schemas and endpoints to the public
68
+ contract. The Management SDK now consumes those contract-backed sandbox paths
69
+ and types, while the CLI adds safe structured `sandbox create/list/info` output
70
+ that reports `tokenPresent` without printing runtime token material.
71
+ The operator env desired-spec contract also gains audited `sandboxWarmPool`
72
+ controls so warm-pool capacity can be enabled without raw database edits.
73
+ - 9036d89: Add `sylphx dev` — a local BaaS emulator for minute-zero, zero-signup offline development (ADR-2753). The command prints the verified quickstart for standing up the real `apps/runtime` BaaS against a local Postgres + Valkey (`docker-compose.dev.yml`), applying the schema declaratively from the Drizzle SSOT, seeding a real dev project with `pk_dev_`/`sk_dev_` keys via the canonical credential helpers, and pointing the SDK at `http://localhost:<port>/v1` using the runtime's built-in `x-project-ref` local-routing header. `--print-connection` emits only the connection block for scripting an app's `.env`. Local-only and additive: it never requires `sylphx login` and changes no existing command. Surfaces the emulator cannot faithfully provide locally (storage, email delivery, cluster-backed sandboxes/runs) return labelled errors rather than silent fakes — the fidelity contract and the staged expand path (one-command supervisor, a published runtime-emulator image for zero-checkout `npx @sylphx/cli dev`) are recorded in the ADR.
74
+
75
+ ### Patch Changes
76
+
77
+ - d7a7864: Improve `sylphx link` and `sylphx tokens` UX: surface actionable recovery hints on the empty/no-result paths (point to `sylphx init` / the console URL / `sylphx tokens create`) instead of dead-ending.
78
+ - ee1d5b8: Gate the remaining destructive CLI commands behind confirmation (burn-down of ADR-2692's KNOWN_UNGATED list): `consent delete`, `webhooks delete`, `session-replay delete`, `realtime channels delete`, `rate-limits strategies delete`, and `admin branch-databases destroy` now require confirmation (skip with `--yes`). Every destructive `delete`/`destroy` command in the CLI is now confirmation-gated; the CI guard's allowlist is empty.
79
+ - 7ed8a8a: Gate destructive CLI commands behind a confirmation prompt. `sylphx secrets delete` and `sylphx oidc delete` previously issued an irreversible delete with no "are you sure?" — a typo could permanently destroy a secret (and all its versions) or a trust policy. Both now require confirmation (skip with `--yes` for CI/automation), matching the rest of the CLI. A CI guard pins the contract for every `delete`/`destroy` command.
80
+ - e511c3b: Rebuild and publish the CLI with the manifest contract that accepts web-service
81
+ `path_prefixes`, so deploy preflight validates canonical multi-service
82
+ `sylphx.toml` files without requiring the operator recovery `--skip-manifest`
83
+ escape hatch.
84
+ - 98007d6: Annotate the in-memory `Blob.arrayBuffer()` read in `user export download` as
85
+ `effect-promise-ok` and narrow the `ConfigService` import to a type-only import.
86
+ No runtime behaviour change; satisfies the new Effect-promise-defect guard.
87
+ - 0c963eb: Fix silent false-success on `sylphx projects create`/`delete`. The Management SDK mis-handled two response envelopes: `projects.create` returned the `CreateProjectResult` wrapper (`{ app: Project }`) instead of the project, so callers read `id`/`name`/`slug` off `undefined` (`✓ Created project undefined`, and `init`/`deploy` failed downstream); and `projects.delete` discarded its `DeleteProjectResult` (`{ deleted, queued, warnings }`) as `void`, so the CLI always printed `✓ Deleted` even when teardown was only queued (reconciler-managed, async). `create` now unwraps `.app` (mirroring `list`'s `.data` unwrap) and `delete` returns the result; the CLI reports deleted vs queued-for-teardown and surfaces warnings.
88
+ - 26dbbfd: Fix `sylphx init --git` so it actually connects the repo and deploys from the
89
+ right branch. The CLI now detects the repository's default branch (`origin/HEAD`,
90
+ falling back to the checked-out branch) and forwards it as `gitBranch` on create,
91
+ and the server persists `gitRepository`/`gitBranch` onto the new project's
92
+ production environment. Previously `init --git` left the environment
93
+ disconnected (`githubRepo` null, branch defaulted to `main`), so a `master`-default
94
+ repo skipped its first deploy with `gitCommit: null`. Refs #2832 (Bug 3).
95
+ - Updated dependencies [b69dce8]
96
+ - Updated dependencies [52c0603]
97
+ - Updated dependencies [7da22e1]
98
+ - Updated dependencies [f341b4d]
99
+ - Updated dependencies [4ad6c9b]
100
+ - Updated dependencies [f4e9bba]
101
+ - Updated dependencies [3e92be2]
102
+ - Updated dependencies [f46ea60]
103
+ - Updated dependencies [8655c00]
104
+ - Updated dependencies [caadd02]
105
+ - Updated dependencies [7d07023]
106
+ - Updated dependencies [0ae1b77]
107
+ - Updated dependencies [978b924]
108
+ - Updated dependencies [3508a03]
109
+ - Updated dependencies [2b3f711]
110
+ - Updated dependencies [9207a0f]
111
+ - Updated dependencies [986739d]
112
+ - Updated dependencies [f317b83]
113
+ - @sylphx/sdk@0.21.0
114
+
3
115
  ## 0.18.0
4
116
 
5
117
  ### Minor Changes
package/README.md CHANGED
@@ -222,6 +222,8 @@ The home config is private operator state only. It does not store per-directory
222
222
  | `sylphx logs` | Inspect bounded runtime logs for a linked or explicit project; add `--follow` for SSE or `--type=build` for deploy logs |
223
223
  | `sylphx tail` | Follow runtime logs with structured formatting; accepts the same filters as `logs` |
224
224
  | `sylphx run-cmd` | Run a local command with remote env from a linked or explicit project |
225
+ | `sylphx run` | Submit a direct batch run, or a distributed run with `--parallelism`; uses the app server connection URL (`--url` or `SYLPHX_SECRET_URL`) |
226
+ | `sylphx runs` | List, inspect, fetch shard logs for, or cancel submitted direct/distributed runs |
225
227
 
226
228
  When `sylphx.toml` exists in the working directory, `sylphx deploy` validates
227
229
  and publishes that manifest before triggering the deployment. This is the path
@@ -236,6 +238,39 @@ manifest publication, so any local `sylphx.toml` changes that have not already
236
238
  been persisted, including migration command changes, are not part of that
237
239
  deployment.
238
240
 
241
+ ### Direct and distributed runs
242
+
243
+ `sylphx run` submits language-agnostic container batch work to the public BaaS
244
+ Run plane. Pass exactly one image source:
245
+
246
+ - `--image <oci-ref>` for an explicit image from a connected registry.
247
+ - `--image-from-service <name>` to resolve the image from the named service's
248
+ current successful deployment in the same project environment.
249
+
250
+ For distributed work, set `--parallelism N`. The platform injects
251
+ `SYLPHX_SHARD_INDEX` and `SYLPHX_SHARD_COUNT` into every shard. Use
252
+ `--opportunistic` to run on low-priority spare fleet capacity
253
+ (`gangScheduling=false`), and `--backoff-limit-per-index N` to give each shard a
254
+ bounded retry budget after preemption.
255
+
256
+ ```bash
257
+ export SYLPHX_SECRET_URL='sylphx://sk_...@pale-tore-0lgrqz.api.sylphx.com'
258
+
259
+ sylphx run \
260
+ --image-from-service trainer \
261
+ --command python --command -m --command trainer.shard \
262
+ --parallelism 8 \
263
+ --opportunistic \
264
+ --backoff-limit-per-index 12 \
265
+ --env TRAINER_UNIVERSE_SIZE=800 \
266
+ --follow
267
+
268
+ sylphx runs list
269
+ sylphx runs get worker_abc123 --parallelism 8
270
+ sylphx runs logs worker_abc123 --parallelism 8 --shard 3
271
+ sylphx runs cancel worker_abc123 --yes
272
+ ```
273
+
239
274
  ### Preview capacity and service build context
240
275
 
241
276
  Project preview capacity is a public project-level override. It controls how
@@ -272,7 +307,9 @@ sylphx services update web \
272
307
  | `sylphx storage` | Manage object storage buckets for a linked or explicit project (Ceph S3) |
273
308
  | `sylphx volumes` | Manage persistent volumes for a linked or explicit project (Rook-Ceph RWO/RWX) |
274
309
  | `sylphx workspaces` | Manage Platform workspace handles for a linked or explicit project |
310
+ | `sylphx agent-resources` | Inspect the project Agent Resource Graph across Platform-owned resources |
275
311
  | `sylphx mobile-device-tests` | Create, list, poll, and cancel managed Android/iOS device-runtime test requests |
312
+ | `sylphx device-sessions` | Drive an interactive Android device session — boot, install, tap/swipe/key/text, screenshot, launch, logcat, terminate |
276
313
  | `sylphx resources` | Bind / unbind shared resources for a linked or explicit project |
277
314
  | `sylphx services` | List + deploy service blueprints |
278
315
  | `sylphx config` | Per-environment app config for a linked or explicit project |
@@ -302,6 +339,28 @@ sylphx mobile-device-tests get mdt_abc123
302
339
  sylphx mobile-device-tests cancel mdt_abc123
303
340
  ```
304
341
 
342
+ A **device session** is the interactive counterpart: a long-lived Android device
343
+ you drive in real time — boot once, then install, screenshot, and send input
344
+ until you tear it down. The agent perceives the device through `screenshot` and
345
+ acts through `input`, exactly like computer-use. See
346
+ [docs/how-to/drive-android-device-session.md](../../docs/how-to/drive-android-device-session.md)
347
+ for the full loop with CLI and curl examples.
348
+
349
+ ```bash
350
+ # Boot a device and block until it is ready (prints the dvs_ id).
351
+ sylphx device-sessions create --project=proj_abc123 --wait
352
+
353
+ # Install, launch, see the screen, then act on it.
354
+ sylphx device-sessions install dvs_abc123 https://example.com/app-debug.apk
355
+ sylphx device-sessions launch dvs_abc123
356
+ sylphx device-sessions screenshot dvs_abc123 -o screen.png --open
357
+ sylphx device-sessions input dvs_abc123 tap 540 1200
358
+ sylphx device-sessions input dvs_abc123 text "hello world"
359
+
360
+ sylphx device-sessions list --project=proj_abc123
361
+ sylphx device-sessions rm dvs_abc123 --yes
362
+ ```
363
+
305
364
  ### Integration primitives
306
365
 
307
366
  | Command | Purpose |