@supacloud/cli 0.57.0 → 0.58.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.
Files changed (3) hide show
  1. package/README.md +137 -0
  2. package/dist/index.js +14436 -3516
  3. package/package.json +10 -5
package/README.md CHANGED
@@ -207,6 +207,122 @@ release has been activated. Production uploads and activations require the
207
207
  normal exact `--confirm-production <ref>` value, and
208
208
  `SUPACLOUD_READ_ONLY=true` blocks both mutations.
209
209
 
210
+ ### Immutable application releases
211
+
212
+ Store a compiler-built HTTP/Worker application as one immutable release:
213
+
214
+ ```bash
215
+ supacloud-cli applications upload_release --ref abc123 --id reviews \
216
+ --manifest_path ./generated/delivery/delivery.manifest.json
217
+ supacloud-cli applications list_releases --ref abc123 --id reviews --limit 50
218
+ supacloud-cli applications get_release --ref abc123 --id reviews --release_id <sha256>
219
+ supacloud-cli applications get_runtime --ref abc123 --id reviews --environment_id test
220
+ ```
221
+
222
+ Upload verifies executable objects, transfers their inventory with multipart
223
+ form data, and checks the returned application-bound release identity. It does
224
+ not activate HTTP/Worker processes or execute migrations. Lists use release-ID
225
+ ordering; pass `--cursor <next_cursor>` for the next page. An unknown upload
226
+ outcome includes the expected release ID so `get_release` can verify it.
227
+ Uploads follow the existing read-only and exact production-confirmation rules.
228
+ `get_runtime` observes the current activation without starting it. A null
229
+ readiness result means no active release has been recorded. A non-null report
230
+ binds readiness to the environment, release, activation and target processes;
231
+ it does not claim that every business dependency or transaction has been tested.
232
+
233
+ ### Versioned application configuration
234
+
235
+ Configuration revisions bind a complete target inventory to one application
236
+ environment. Saving a revision does not allocate ports, start processes, change
237
+ traffic or migrate data:
238
+
239
+ ```bash
240
+ supacloud-cli applications get_configuration --ref abc123 --id reviews --environment_id test
241
+ supacloud-cli applications put_configuration --ref abc123 --id reviews --environment_id test \
242
+ --configuration_path ./application.test.json
243
+ supacloud-cli applications get_configuration --ref abc123 --id reviews --environment_id test \
244
+ --configuration_id <uuid>
245
+ ```
246
+
247
+ Example configuration write file:
248
+
249
+ ```json
250
+ {
251
+ "configuration_id": "01234567-89ab-4def-8123-456789abcdef",
252
+ "expected_configuration_id": null,
253
+ "configuration": {
254
+ "bun_version": "1.4.2",
255
+ "targets": [
256
+ {
257
+ "name": "api",
258
+ "kind": "http",
259
+ "hosts": ["reviews.example.test"],
260
+ "environment": { "LOG_LEVEL": "info" }
261
+ },
262
+ { "name": "jobs", "kind": "worker", "hosts": [], "environment": {} }
263
+ ]
264
+ }
265
+ }
266
+ ```
267
+
268
+ Generate a new UUIDv4 for each new revision. Use the current configuration ID
269
+ as `expected_configuration_id`, or `null` for an environment without a saved
270
+ configuration. The file replaces the entire configuration; omitted variables
271
+ are not carried over. HTTP targets require lowercase exact hosts; Worker
272
+ targets have no hosts. Runtime-owned variables such as `PORT` cannot be supplied.
273
+
274
+ The control plane encrypts values with its configured secret-encryption key.
275
+ API and CLI reads return names only; keep local files with values out of version
276
+ control. An identical retry with the same revision ID returns the original
277
+ receipt and never moves a newer head backward. A changed request using the same
278
+ ID or a stale expected revision returns a conflict. An unknown result preserves
279
+ the revision ID for `get_configuration` verification; the CLI does not replay
280
+ the write automatically. Reads without an ID show the current head.
281
+
282
+ Writes follow the normal read-only and exact production-confirmation policy.
283
+ Programmatic `activateConfigured` selects an explicit configuration revision,
284
+ checks its target inventory against the release and retains that revision ID
285
+ in activation state/runtime feedback. It now obtains persistent server-selected
286
+ ports rather than accepting caller ports. Allocation is bound to the release,
287
+ activation, environment, Bun version and configuration revision; a retry retains
288
+ the same ports. The default single-host pool is `20000-29999`, configurable with
289
+ `SUPACLOUD_APPLICATION_PORT_RANGE`. Existing configured platform pools,
290
+ persisted tenant port overrides and current loopback listeners are excluded.
291
+
292
+ Reservations do not expire automatically and are not deleted with project
293
+ metadata. Exhaustion is an explicit error; reusing a port still requires a
294
+ verified stopped/unrouted retirement path. Manual low-level runtimes and other
295
+ daemons must stay outside this application pool because their lifecycle does
296
+ not participate in its reservations. The public activation write API remains
297
+ unavailable pending compatibility and recovery integration.
298
+
299
+ Composed hosts can register `POST .../environments/:environmentId/activations`
300
+ and `POST .../activations/:activationId/reconcile` by supplying an
301
+ `ApplicationDeploymentService` with its required compatibility verifier.
302
+ The default Management API instance does not yet enable these endpoints.
303
+ For an explicitly composed test host:
304
+
305
+ ```bash
306
+ supacloud-cli applications activate_release --ref abc123 --id reviews --environment_id test \
307
+ --release_id <release-sha256> --configuration_id <configuration-uuid> \
308
+ --activation_id <new-uuid> --expected_activation_id absent
309
+ supacloud-cli applications reconcile_activation --ref abc123 --id reviews --environment_id test \
310
+ --release_id <release-sha256> --activation_id <same-uuid>
311
+ supacloud-cli applications retire_activation --ref abc123 --id reviews --environment_id test \
312
+ --activation_id <stopped-and-unrouted-uuid>
313
+ ```
314
+
315
+ Retirement is addressed by activation ID, not release ID. Supplying `release_id`
316
+ to `retire_activation` is rejected locally before any request is sent.
317
+
318
+ For upgrades or explicit application rollback, supply the currently active
319
+ activation UUID instead of `absent`. Both actions are writes. The CLI checks
320
+ receipt identity and preserves the requested activation ID on unknown outcomes;
321
+ it does not retry writes. Reconciliation only confirms already committed state,
322
+ not an interrupted early-stage activation, and does not replay runtime effects.
323
+ Retirement requires the composed host's stopped/unrouted verifier and keeps the
324
+ activation ID as an audit tombstone; the CLI does not retry unknown outcomes.
325
+
210
326
  ### Verified release controls
211
327
 
212
328
  `release` is an official CLI entry point for verified Management API controls
@@ -409,6 +525,27 @@ drift, and statement-count mismatches instead of treating them as an empty
409
525
  ledger. `database list_migrations` remains available with its legacy SQL-backed,
410
526
  human-readable behavior.
411
527
 
528
+ `database delivery_migration_plan` compares one immutable target's declared SQL
529
+ with the separate read-only `/database/migrations/inventory` endpoint:
530
+
531
+ ```bash
532
+ supacloud-cli database delivery_migration_plan --ref abc123 \
533
+ --delivery_manifest /archive/delivery/delivery.manifest.json --delivery_target api
534
+ ```
535
+
536
+ The entire target inventory is verified before the API request, without loading
537
+ current application source. Output contains hashes and statuses, not SQL.
538
+ `ledger-match` means the version, name and normalized single-statement-array
539
+ checksum match; raw SQL SHA-256 is reported separately. Baseline markers are not
540
+ execution evidence. Name/checksum conflicts and out-of-order pending migrations
541
+ return errors. Operator provisioning always requires separate verification.
542
+ `ledgerCompatible` reports only identity/order checks: it does not prove old/new
543
+ application compatibility, authorize migration execution, or validate deployment.
544
+ This command never applies SQL, repairs a ledger, or activates an application.
545
+ The server endpoint performs only ledger reads, unlike the older migration-list
546
+ endpoint which may initialize or reconcile metadata. Older servers without the
547
+ read-only endpoint fail closed; the command never falls back to the older GET.
548
+
412
549
  Bucket list/get output includes the metadata `revision`. Update and delete reject
413
550
  stale revisions with HTTP 409. Delete additionally requires `require_empty=true`;
414
551
  it never empties a bucket. Mutation receipts bind `project_ref`, `bucket_id`,