@oddington/cli 0.1.26 → 0.1.28

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 +110 -29
  2. package/dist/os.js +230 -196
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -22,6 +22,11 @@ Run `os --help` or add `--help` to any command for the full command list.
22
22
  Commands print readable output by default. Add `--json` when another program
23
23
  will consume the result.
24
24
 
25
+ Sign-in and session operations use `https://auth.oddington.ai`. Connection
26
+ management, repository targets, local app repository context, Dropbox authorization,
27
+ remote File-storage configuration and Routine deployment use `https://api.oddington.ai`. These addresses are fixed; workspace
28
+ configuration and `ODDINGTON_OS_ORIGIN` do not override them.
29
+
25
30
  ## Local apps
26
31
 
27
32
  From anywhere inside the app’s Git worktree, run:
@@ -324,6 +329,33 @@ and other CLI output never reveal saved credentials.
324
329
  `ODDINGTON_CONNECTION_CREDENTIAL`. Only run trusted code, and do not print or
325
330
  retain that value.
326
331
 
332
+ ## Deploy and roll back routines
333
+
334
+ From the installed routine's customer Git worktree, a signed-in workspace
335
+ member can run:
336
+
337
+ ```sh
338
+ os routine deploy invoice-import
339
+ os routine rollback invoice-import
340
+ ```
341
+
342
+ Deploy reads `routines/invoice-import/routine.json` and packages the exact
343
+ eligible current source, including eligible uncommitted changes, plus frozen
344
+ dependencies. The declaration must match every installed access grant. OS
345
+ builds and checks definitions, then activates only a compatible ready version;
346
+ a failure preserves the current active version. Deployment never invokes
347
+ business code or creates installation authority.
348
+
349
+ The command reports phases, bounded diagnostics, the opaque version, source
350
+ summary, runtime profile/features and capability names. Closing the CLI stops
351
+ inspection while accepted OS work continues. Repeat the identical command to
352
+ resume its deployment; source uploads and accepted seals recover lost replies.
353
+ Rollback selects the preceding compatible retained version on OS without a
354
+ rebuild. Both commands accept only the routine name and `--json` output option;
355
+ they accept no commit, module, image, command, credential or version selector.
356
+ JSON returns product facts without progress prose and uses the same exit status
357
+ as human output.
358
+
327
359
  ## Publish asks and digests
328
360
 
329
361
  A signed-in workspace member can publish an initial ask whose Questions have
@@ -382,31 +414,43 @@ login. For a manual run, a signed-in workspace member uses the installed
382
414
  routine's name. OS supplies only the connections declared by its installation:
383
415
 
384
416
  ```sh
385
- os routine run --workspace example --name invoice-import \
386
- -- node routines/invoice-import/run.ts
417
+ os routine run invoice-import --input input.json
418
+ os routine run invoice-import --input - --json
387
419
  ```
388
420
 
389
- OS resolves the active deployment, supplies temporary routine authority to the
390
- child, and revokes it when the process exits. A record read contains
391
- one authoritative commit and selected
392
- `{ ref, version, fields }` records in requested order. Keep versions opaque and
393
- save them with the reviewed records. A local checkout cannot supply this evidence.
421
+ OS matches the current Git worktree to exactly one authenticated installed
422
+ workspace/routine and resolves `routines/invoice-import/run.ts`. The entry exports
423
+ an inert `defineRoutine` definition from `@oddington/sdk`. No handler deployment
424
+ is required unless an authored item declares executable handlers. JSON input
425
+ is validated before business work; its file/stdin path is transport, not input.
426
+ Omitted input is `{}`. Each JSON value is bounded to 256 KiB.
394
427
 
395
- To inspect the same routine's work before publication, use `prepare`:
428
+ Before execution, the command names installed connections and explains that
429
+ local filesystem changes, model calls and provider effects happen immediately.
430
+ Only Record, File, Ask and Digest changes stay local for review. The child
431
+ receives temporary installed authority, which is revoked when execution ends.
432
+ Success reports concrete nonzero counts and the stable Run reference:
396
433
 
397
434
  ```sh
398
- os routine prepare --workspace example --name invoice-import \
399
- -- node routines/invoice-import/run.ts
400
435
  os routine publish
401
- os routine publish --run <prepared-run>
436
+ os routine publish <run>
437
+ os routine publish <run> --json
402
438
  ```
403
439
 
404
- The SDK calls stay the same. Declared records appear in the matched checkout;
405
- exact files, captured receipts and authored items stay in a private sealed run
406
- under the Git directory. The command prints its inspection location and run
407
- reference. Connections can still contact their providers. A failed child cannot
408
- publish. Inspect the files and bounded Git diff, then publish from the original
409
- root. With several ready runs, select one using `--run`.
440
+ Declared records appear in the matched checkout; exact files, captured receipts,
441
+ source/input and authored items stay in the private Run directory
442
+ `.git/oddington-prepared/<run>` (under the worktree's actual Git directory).
443
+ `execution.json` retains steps, optional result, redacted child output and known
444
+ effect evidence. `complete.json` seals successful intent. Inspect these files and
445
+ the bounded Git diff, then publish from the original root. Bare publish lists
446
+ ready references and refuses ambiguity. A failed or cancelled Run cannot publish;
447
+ earlier local/provider effects remain real. A successful Run with no OS changes
448
+ retains its evidence and says “Nothing needs to be sent to OS.”
449
+
450
+ `--json` emits one value on stdout; notices use stderr and child logs stay in
451
+ Run evidence. Run output includes `runId`, `state`, `placement`, `changes`,
452
+ `counts`, optional declared `result`, and `directory`. Publish output includes
453
+ the same Run reference, change state, confirmed receipts, Files, items and links.
410
454
 
411
455
  The SDK's `data.repository(name)` collection, selection and search calls also work in
412
456
  this mode, using only installed repository grants and the exact committed
@@ -418,15 +462,26 @@ unchanged; replaying an older publication cannot rewind it. For example,
418
462
  `general.records.search('acme overdue', { collections: ['invoices'], limit: 20 })`
419
463
  returns bounded full Records with guards usable in Changes, or empty matches
420
464
  with the searched version. Missing/incomplete search data fails retryably with
421
- `unavailable`, and a dead parent has no hosted fallback. Ordinary immediate
422
- `os routine run` continues to deliver search through the hosted service.
423
- A run that only reads or validates creates no prepared-run directory
424
- and reports completion without a publish instruction. Authentication and named
465
+ `unavailable`, and a dead parent has no hosted fallback. Authentication and named
425
466
  provider connections retain their normal network and authority requirements;
426
- preparation does not promise offline execution and may contact OS or providers.
427
- Execution location and File storage are independent of this publication choice.
428
- `os routine run --local` remains a deprecated compatibility alias for
429
- `os routine prepare` and prints the replacement command.
467
+ local execution may contact OS or providers.
468
+
469
+ Local execution requires native Node TypeScript stripping, a module
470
+ `routines/package.json`, a matching `engines.node`, and an installed SDK.
471
+ Before inspection, OS pins reachable ESM/CommonJS modules, runtime packages,
472
+ governing package metadata and literal `new URL` assets, up to 20,000 files /
473
+ 256 MiB. Unrelated routines, historical output, unused dependencies, caches and
474
+ logs are excluded. Reachable symlinks, native addons, computed loaders/assets
475
+ and unsupported exports refuse; execution never uses changing checkout code.
476
+ No dependency installation or package script runs. Run state is bounded to
477
+ 64 MiB; reports and redacted output each retain at most 10 MiB. Launcher ownership
478
+ renews every 20 seconds with a 90-second lease; execution retains the existing
479
+ 15-minute capability bound.
480
+
481
+ `routine prepare`, `run --local`, executable/argv selection, routine workspace,
482
+ name and working-root flags, and publish `--run` are retired. Remote execution,
483
+ deployment and schedules are unavailable in this release. `os run --connection`
484
+ remains the separate ad hoc command; app children still publish immediately.
430
485
 
431
486
  `changes.delete(record)` captures the selected `$ref` and `$version`. A mixed
432
487
  create/update/delete group prepares one guarded proposal; validation creates no
@@ -434,7 +489,7 @@ proposal or materialization. Local publication removes only declared Records,
434
489
  returns their captured identities in `deleted`, and advances subsequent run
435
490
  reads to the exact prepared version. Files and durable Source uses remain
436
491
  retained. Deleted paths are sealed as absent: recreating one before
437
- `os routine publish --run <prepared-run>` invalidates publication before effects.
492
+ `os routine publish <run>` invalidates publication before effects.
438
493
  Later publication rechecks the complete group at its captured base, applies one
439
494
  exact commit and waits for its exact hosted index. Interrupted Git or index
440
495
  acknowledgements resume that same proposal and preserve the inspected identities.
@@ -442,7 +497,7 @@ acknowledgements resume that same proposal and preserve the inspected identities
442
497
  Publication checks the whole run before effects, applies exact record history,
443
498
  retains files, then publishes Asks and Digests. It preserves unrelated local
444
499
  work. Changed prepared bytes, authority or unrelated remote movement require
445
- repair and a new preparation; publication never rebases inspected work.
500
+ repair and a new Run; publication never rebases inspected work.
446
501
  After interruption, repeat the same publish command with unchanged content.
447
502
  `publication.json` journals attempted operations and confirmed receipts
448
503
  separately from sealed intent. Fresh launches recover original commit, file and
@@ -489,8 +544,9 @@ or attach anything. CSV parsing hints (`csv.encoding`, `csv.delimiter`,
489
544
  `csv.headerRow`) are optional. OS derives the row count, size, digest, media type
490
545
  and verified PDF pages. Unsupported files remain preserved and downloadable.
491
546
 
492
- Set `workingRoot` in the SDK, `--working-root` on the file command or routine
493
- launcher, or `ODDINGTON_INBOX_WORKING_ROOT`. The default is the current directory:
547
+ Member-authored files may use `workingRoot` in the SDK, `--working-root` on the
548
+ file command, or `ODDINGTON_INBOX_WORKING_ROOT`. Named routine Runs receive
549
+ their resolved worktree root from OS. The file command defaults to the current directory:
494
550
 
495
551
  ```sh
496
552
  os files add --workspace <workspace> --working-root <local-root> --path <relative-file-path> --json
@@ -505,6 +561,31 @@ an item containing them.
505
561
  Resolution is an explicit guarded business outcome from a handler or the
506
562
  original publishing routine.
507
563
 
564
+ Delete an unused shared File as its signed-in creator:
565
+
566
+ ```sh
567
+ os files delete --workspace <workspace> --id <file-id> --yes --json
568
+ ```
569
+
570
+ `--yes` explicitly confirms removal of the original and every retained
571
+ enrichment. Without confirmation the command refuses before authentication or
572
+ deletion work. A Source or another independent use conflicts without changing
573
+ the File; delete that use through its owning capability first. Read access does
574
+ not allow deleting another member's or an installed routine's File.
575
+
576
+ The command uses the published SDK and the CLI member session. Configured
577
+ `ODDINGTON_FILES_ROOT` selects the existing managed local owner, including
578
+ uploaded-cache cleanup. Success means physical cleanup and durable completion;
579
+ repeating a completed command succeeds. Temporary failures remain retryable,
580
+ and a pending File stays inaccessible. R2 cleanup removes only the exact pinned
581
+ registered object and confirms absence; a changed identity fails with integrity.
582
+ Human output names the workspace and File ID. JSON success is one document:
583
+ `{"workspace":"playground","id":"<file-id>","status":"deleted"}`.
584
+ Failures exit nonzero with the bounded Files error category.
585
+ After interruption or a lost reply, repeat the same confirmed command and ID;
586
+ do not create a replacement File to recover deletion. A completed retry needs
587
+ no provider connection, but still requires current creator authority.
588
+
508
589
  ## Package boundary
509
590
 
510
591
  `@oddington/cli` contains the `os` executable and depends on the compatible