@oddington/cli 0.1.37 → 0.1.39

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 +34 -99
  2. package/dist/os.js +189 -167
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -45,80 +45,31 @@ From anywhere inside the app’s Git worktree, run:
45
45
  os app launch <name>
46
46
  ```
47
47
 
48
- Launch reads exactly `apps/<name>/app.json`, checks current membership in its
49
- declared workspace, runs the colocated package’s fixed `npm run build`, and
48
+ Launch reads exactly `apps/<name>/app.json`, resolves one member workspace from
49
+ the worktree's stable source identity, runs the colocated package’s fixed `npm run build`, and
50
50
  opens its confined public interface in your ordinary browser. Prepare the app’s
51
51
  documented dependencies separately; launch never installs them. Git, npm and
52
52
  the required Node version must be available. Missing declarations, dependencies,
53
53
  build output or membership stop launch with setup guidance.
54
54
 
55
- Each `routines` mapping must declare `routine`, `input`, and ordered public
56
- `steps`; `result` is optional. A mapping containing only `routine` is invalid.
57
- For example:
55
+ The declaration contains only stable app scope. For example:
58
56
 
59
57
  ```json
60
58
  {
61
59
  "name": "accounting",
62
- "workspace": "sample",
63
- "interface": { "root": "dist/interface" },
64
60
  "repositories": ["general"],
65
- "routines": {
66
- "reconcile": {
67
- "routine": "reconcile-records",
68
- "input": {
69
- "type": "object",
70
- "properties": {
71
- "includeArchived": { "type": "boolean" },
72
- "limit": { "type": "integer", "minimum": 1, "maximum": 100 }
73
- },
74
- "additionalProperties": false
75
- },
76
- "result": {
77
- "type": "object",
78
- "properties": { "processed": { "type": "integer" } },
79
- "required": ["processed"],
80
- "additionalProperties": false
81
- },
82
- "steps": [
83
- { "id": "read" },
84
- {
85
- "id": "write",
86
- "summary": {
87
- "type": "object",
88
- "properties": { "changed": { "type": "integer" } },
89
- "required": ["changed"],
90
- "additionalProperties": false
91
- }
92
- }
93
- ]
94
- }
95
- }
61
+ "routines": ["reconcile-records"]
96
62
  }
97
63
  ```
98
64
 
99
- Contracts use a closed V0 value-schema grammar. Each schema has a `type` of
100
- `object`, `array`, `boolean`, `string`, `integer`, `number`, or `file`, with only
101
- the fields supported by that type. Objects declare `properties` and
102
- `additionalProperties: false`; optional `required` lists contain unique declared
103
- property names. Property names start with a lowercase letter and contain only
104
- letters and numbers. Arrays declare `items` and `maxItems` from 1 to 64. Strings
105
- may declare `maxLength` from 0 to 4,096 and otherwise have a 4,096-character limit.
106
- Numbers may declare inclusive `minimum` and `maximum`; numbers must be finite,
107
- and integers and their bounds must be safe integers. A `file` value is a complete
108
- shared File descriptor, never a bare ID or operating-system path.
109
-
110
- Schemas nest at most eight nodes deep, and an operation's input, result and step
111
- summaries share a budget of 64 object properties. Encoded input and result each
112
- fit within 16 KiB of UTF-8 JSON. Declare one to 64 ordered steps with unique
113
- lowercase letter or number IDs separated by single hyphens. Each step has only
114
- `id` and an optional `summary` schema. Omitting a summary or result schema permits
115
- no corresponding value. Values are not coerced, schemas have no defaults, and
116
- an optional property stays absent rather than accepting `null`.
117
-
118
- Declare a closed empty object for input with no properties; an app without
119
- routine operations may use `"routines": {}`. Unsupported schema or process-control
120
- fields stop launch before build or hosting. Validation grants no routine or File
121
- authority, and opening the interface does not require local routine code.
65
+ Definitions are discovered by exported ID in confined `routines/*/routine.ts`,
66
+ independently of directory names. `os app build <name>` and launch use the same
67
+ preparation, generate the ignored `.os/app.d.ts` and `app-descriptor.json` pair,
68
+ then build fixed `dist/index.html`. Types infer input/defaults, result and step
69
+ detail from the definition. Browser assets embed only the safe structural
70
+ descriptor, never access declarations, source imports or live availability.
71
+ Unsupported input or invalid generation fails preparation without exposing a
72
+ partial pair. An app without routine operations uses `"routines": []`.
122
73
 
123
74
  The command prints the clean assigned IPv4 loopback URL and owns the host until
124
75
  Ctrl-C or termination. No root, workspace, command or port override is accepted;
@@ -140,44 +91,28 @@ The SDK retries renewal independently of Data reads. Confirmed renewal denial an
140
91
  shutdown end it immediately. An opener
141
92
  failure stops the host without printing a bootstrap secret.
142
93
 
143
- Launch supplies authenticated context and unchanged interface assets. The SDK's
144
- typed `app.routines.<key>.availability()` assesses only a retained declared
145
- binding, without starting code or creating a run. It reports ordered public
146
- step IDs when available, or `authority_unavailable` / `execution_unavailable`
147
- without steps. Customer-owned module augmentation supplies the property types;
148
- it grants no authority.
149
-
150
- Local readiness requires the mapped `routines/<routine>/run.ts` inside this
151
- worktree. Modern routines also require their private ESM package manifest,
152
- the shared frozen Bun workspace lock, Bun 1.3.14, compatible Node, the exact
153
- root authoring SDK 0.1.17 and the selected installed runtime graph. Launch uses
154
- the same OS-owned executable-unit builder as deployment. Legacy routines keep
155
- their existing module-root, Node TypeScript stripping and SDK requirements
156
- until a selected manifest explicitly cuts them over. The assessment never imports
157
- routine code, runs package scripts, installs dependencies or accepts browser
158
- path/runtime overrides. Missing code still permits app launch. Availability
159
- is fresh assessment, not a reservation or guarantee of later execution.
160
- Hosted bindings report execution unavailable without local fallback.
161
- `app.routines.<key>.run(input)` starts only that mapped installed routine as a
162
- fixed Node child. Its private `appRun.current()` input is immutable; declared
163
- steps and finish await host acceptance. Success requires accepted finish and
164
- zero exit. Shared effects publish immediately, without a preparation selector.
165
- Supplied File inputs reject execution unavailable before capability issuance;
166
- File-use transfer and a local browser Files adapter remain unsupported. Local
167
- Data uses the exact published index; warm reads make no synchronous hosted or
168
- CLI-store calls and neither initiate nor await browser-session renewal.
169
-
170
- The host owns children across refresh and tab closure. Exact-origin browser
171
- state permits `recover()` without a run selector while the host/session remains
172
- authorized. Successful credential rotation preserves admitted Data and routine
173
- work and the same bounded run ownership. Other tabs confirm and adopt the stored
174
- winner silently; an old credential cannot start new requests or erase that
175
- winner. `events()` reconnects in order; `cancel()` resolves after child
176
- termination and capability revocation. Host stop, local sign-out, expiry or
177
- authority loss ends active execution. At most four runs occupy authorization,
178
- execution or cleanup slots; event retention is bounded to 256 events / 1 MiB
179
- per run, with ten minutes of terminal grace and at most 16 terminal streams.
180
- Cancellation or later failure does not undo confirmed shared effects.
94
+ Launch supplies authenticated context and unchanged interface assets.
95
+ `app.listRoutines()` preserves declaration order, including unavailable entries.
96
+ `app.routines[id].describe()` combines structural metadata with current readiness
97
+ and read-only connection availability; starts recheck current source and complete
98
+ authority. Defaulted `run()` and authorized OS File descriptors use the same
99
+ local runner as CLI. There is no app-specific child lifecycle.
100
+
101
+ Run handles expose `current()`, connected `watch()`, retained `step(id)` and
102
+ explicit `publish()`. Successful local execution reports `not_needed`, `ready`,
103
+ `published` or publication `failed`; it never publishes automatically. Publication
104
+ uses the existing guarded publisher and preserves confirmed receipts. Routine
105
+ `runs.list()` returns at most 20 recent summaries; `runs.get(id)` opens retained
106
+ facts under newly checked authority. Older Runs are not pruned. History and step
107
+ detail survive refresh; interrupted execution has no restart recovery.
108
+
109
+ The host owns live work across refresh and tab closure. Credential renewal
110
+ preserves the logical session; replaced contexts invalidate old handles. Host
111
+ stop, sign-out, expiry or authority loss ends active work. At most four starts
112
+ occupy authorization/execution/cleanup slots. No browser command, path, workspace,
113
+ connection setting, replay cursor or cancellation API is exposed. Local Data
114
+ continues to use its exact published index. Browser File creation remains a
115
+ separate unsupported local adapter; existing authorized Files may be Run input.
181
116
 
182
117
  ## Connections
183
118