@openengio/cli 0.36.0 → 0.37.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/README.md CHANGED
@@ -16,8 +16,9 @@ example `openeng links clear <link1> <link2> --version <v1> --version <v2> --pro
16
16
  --ref <ref>`. Each opaque upstream version comes from status and is a precondition; the clear is
17
17
  atomic. `upstream-changed` requires reading and reviewing again; `upstream-not-readable` requires
18
18
  upstream read access. Clearing records the person and time and leaves bounds unchanged. The edge's
19
- write rule governs clearing, with no organisation setting. User, run-apply, client and service
20
- tokens are admitted; run-explore and run-types are refused at admission. There is no object-agent
19
+ write rule governs clearing, with no organisation setting. The admitted actor classes are
20
+ person (a `user` token), `agent:apply` (an apply run token), `app:client` (a `client` token) and
21
+ service (a `service` token); `agent:explore` and `agent:types` are refused at admission. There is no object-agent
21
22
  clearing tool. An unknown outcome exits 5; recover by correlation before repeating a clear.
22
23
 
23
24
  `openeng branches impact <ref> --base <base> --project <id>` prints review, bounds and aggregate
@@ -59,6 +60,8 @@ The installed package contains the bundled command and the skill. It carries no
59
60
  |---|---|---|
60
61
  | `openeng login [--no-open]` | binds a loopback listener, opens the browser at the sign-in address (or prints it with `--no-open`), redeems the returned code once and stores the session | one (`redeem`) |
61
62
  | `openeng logout` | refreshes first when the access token has expired, calls `logout`, deletes the stored session whatever the host answered | one, two with an expired token |
63
+ | `openeng session status` | reads server-stored channel, mode and sign-in time | one |
64
+ | `openeng session human` | confirms human mode once for this session | challenge, poll, retry; one when already human |
62
65
  | `openeng whoami` | prints the principal, host, store and expiry of the stored session, and the client's protocol version (`protocolVersion` under `--json`); never a token | none |
63
66
  | `openeng org list` | lists the organisations the signed-in person holds a live grant in; needs no attachment | one |
64
67
  | `openeng org attach <id>` | attaches the session to the organisation, and stores the access token the host answers with the organisation's identifier and name, beside the session and under the same host key; needs no attachment | one |
@@ -83,11 +86,12 @@ The installed package contains the bundled command and the skill. It carries no
83
86
  | `openeng attachment add <object> <property> <file> --project <id> --ref <ref>` | stages, saves and prints the descriptor | four |
84
87
  | `openeng attachment get <object> <property> [--out <path>] --project <id> --ref <ref>` | downloads and prints the written path | one |
85
88
  | `openeng attachment list <object> --project <id> --ref <ref>` | prints attachment properties and descriptors | two |
86
- | `openeng hosted-app publish <bundle> --project <id> --key <app key>` | publishes the bundle file as the next version of the project's hosted app under the key, creating the app when the project has none; prints the version, its SHA-256 and size, and the one-wall warning for an app that holds the one-wall permission | three to four |
89
+ | `openeng hosted-app publish <bundle> --project <id> --key <app key>` | publishes the bundle file as the next version of the project's hosted app under the key, creating the app when the project has none; prints the version, its SHA-256 and size, and the reduced isolation warning for an app that holds the reduced isolation permission | three to four |
87
90
  | `openeng hosted-app list --project <id>` | lists the project's hosted apps | one |
88
91
  | `openeng hosted-app versions <app key> --project <id>` | lists the app's versions, newest first | two |
89
92
  | `openeng hosted-app revoke <app key \| app id \| version id> --project <id>` | revokes one version (an argument starting `hav_`) or the whole app by its key or an `app_` id; the next call under any launch of it is refused | one for an id, or two for an app key |
90
93
  | `openeng rules add` | adds a project or organisation branch rule | one |
94
+ | `openeng rules update` | changes a rule's settings in place | one, plus step-up when needed |
91
95
  | `openeng rules list` | lists the selected project's or organisation's rules | one |
92
96
  | `openeng rules remove` | removes a rule by identifier | one |
93
97
  | `openeng org-refs create` | creates an organisation branch or baseline, optionally read-only | one |
@@ -101,6 +105,9 @@ The installed package contains the bundled command and the skill. It carries no
101
105
  | `openeng schema-update show` | reads the latest visible request, or no request | one |
102
106
  | `openeng skill [<topic> \| playbook <name>]` | prints the main skill and lists topics, or prints one bundled topic; needs no host and no session | none |
103
107
 
108
+ Create the object first, then stage and save its attachment. Creation with a file is refused
109
+ as `invalid-properties` with `attachment-requires-object` at each offending property.
110
+
104
111
  Attachments are top-level properties declared with kind `attachment`. Accepted file classes are
105
112
  `image` (PNG, JPEG, WebP, GIF), `pdf`, `step` (STEP), `mesh` (STL) and `text` (plain text and the
106
113
  admitted text-file extensions). Each body is limited to 26,214,400 bytes (25 MiB).
@@ -109,10 +116,11 @@ The hosted-app commands take `--project`, and `publish` also takes `--key`, an a
109
116
  letters, digits and hyphens, at most 63 characters. The parser refuses any other value (exit 2), so
110
117
  the flag cannot carry a token. `publish` reads the bundle file whole; the host bounds it at 4 MiB.
111
118
  A refused publish, such as one by a person who may not publish into the project, prints the host's
112
- refusal and exits 4. An app that holds the one-wall permission makes `publish` print the one-wall
113
- warning after the version line, and `--json` carries `oneWall` and `warning` beside the version. A publisher who may not read the
114
- organisation's one-wall permissions still publishes: the command adds one line saying this account
115
- cannot read whether the app may send data out of the browser, and `--json` carries `"oneWall": "unknown"`.
119
+ refusal and exits 4. An app that holds the reduced isolation permission makes `publish` print the
120
+ reduced isolation warning after the version line (the lead, a blank line, then the detail), and `--json` carries `oneWall` and `warning`
121
+ beside the version. A publisher who may not read the organisation's reduced isolation permissions
122
+ still publishes: the command adds one line saying this account cannot read whether the app may send
123
+ data out of the browser, and `--json` carries `"oneWall": "unknown"`.
116
124
 
117
125
  All three attachment commands require explicit `--project` and `--ref` and an attached organisation.
118
126
  `add` uses the local file's basename, stages it, reads the object and catalogue, then saves; it prints
@@ -164,32 +172,48 @@ The boolean `--organisation` flag takes no value and uses the session's attached
164
172
  its calls have no selector. Both flags together, or neither, refuse before a host call (exit 2).
165
173
  The project forms are:
166
174
 
167
- - `openeng rules add --project <id> --pattern <pattern> --consequence <merge-only|locked-rows-only>`
168
- prints the rule's identifier, pattern and consequence. Repeating the same content returns the
169
- existing rule, including when the pattern differs only in letter case.
170
- - `openeng rules list --project <id>` prints each visible rule's identifier, pattern and
171
- consequence, or `no rules` when there are none.
172
- - `openeng rules remove --project <id> --rule-id <id>` prints the removed rule's identifier.
173
- An absent or unreadable identifier, or one from another project, answers `not-found`.
174
-
175
- Each command makes one host call, or two if the session first needs refreshing, and sends no
176
- idempotency key. Under `--json`, each success answers `{ scope, value }`: `scope` is the CLI's
177
- organisation and, for project forms, project; `value` holds the full rule for add, an array of rules for list, and
178
- `{ ruleId }` for remove. Organisation forms call `addOrganisationRule`, `listOrganisationRules`
179
- and `removeOrganisationRule` with the same inputs. Their full rule has `scope: "organisation"`
180
- and `projectId: null`; project rules keep `scope: "project"`. That scope stays inside `value`.
181
- Missing flags or a consequence other than the two spellings above refuse before any host call (exit 2).
182
- The host validates the pattern.
183
-
184
- A project rule's pattern is `main` or a branch or baseline under that project's identifier, exactly or ending
185
- in `/*` to match the prefix. A matching `merge-only` rule requires changes through a branch and
186
- merge. A `locked-rows-only` rule binds merge-only row locks while leaving unlocked rows direct.
187
- Adding or removing rules needs a person's `administer projects` capability on the selected
188
- project, or in the attached organisation for `--organisation`; both are audited. Listing needs
189
- `read`. Each command's `--help` has a capability line. A `not-permitted` refusal carries no
190
- capability; read that help line to find what the person needs. A change takes effect on the next
191
- request. A `protected` write refusal means to use the branch and review workflow.
192
- Agents must ask a person to manage rules.
175
+ - `openeng rules add --project <id> --extent <ref|rows> --pattern <pattern> [settings]` adds a rule.
176
+ - `openeng rules update --project <id> --rule-id <id> [settings]` changes settings in place.
177
+ - `openeng rules list --project <id>` prints visible identifiers, patterns and consequences.
178
+ - `openeng rules remove --project <id> --rule-id <id>` removes one rule by identifier.
179
+
180
+ Both add and update take these settings flags:
181
+
182
+ | flag | value |
183
+ |---|---|
184
+ | `--consequence` | `open`, `merge-only`, `locked-rows-only` |
185
+ | `--require-proposal` | `true` or `false` |
186
+ | `--required-approvals` | integer 0 to 10 |
187
+ | `--approver-min-role` | `contributor`, `maintainer`, `owner` or `null` |
188
+ | `--restrict-deletions` | `true` or `false`; true only for a project `ref` rule |
189
+ | `--approvers` | JSON array of person identifiers; `[]` clears the list |
190
+ | `--bypass` | JSON array of member objects; `[]` clears the list |
191
+
192
+ Bypass objects use `kind: "role"` with `roleKey`, `kind: "person"` with `personId`,
193
+ `kind: "service"` with `serviceIdentityId`, or `kind: "client"` with `clientId`.
194
+ An add defaults omitted settings to merge-only, a proposal, one approval, minimum Maintainer,
195
+ no named approvers, Owner/Maintainer bypass, and deletion restriction for project `ref` rules
196
+ only. An update keeps omitted settings and replaces each supplied list. It cannot change pattern
197
+ or extent. Every update, stronger or weaker, asks an agent-mode session for confirmation.
198
+
199
+ A project `ref` pattern is `<project>/` and a glob; `rows` may also name `main`. Organisation rules
200
+ use `ref` with `main` or a glob over one organisation ref. In a glob `*` stops at `/`, `**` is any
201
+ characters, `/` included, `?` is one character other than `/`, and `[]` is a set with ranges and no
202
+ negation: `^` and `!` are refused. `**` has no zero-directory form: `<project>/**/x` does not match `<project>/x`.
203
+ Matching is case-insensitive, and a glob is at most 255 characters.
204
+ A `rows` rule binds only its project's rows; `ref` binds every row on the matching ref.
205
+ The host answers `invalid-rule-pattern`, `invalid-rule-setting` or `unknown-rule-member` when
206
+ pattern, settings or membership do not fit. An absent or other owner's rule answers `not-found`.
207
+ A repeated rule add returns the existing rule without changing it. Changing a rule’s consequence
208
+ to one another rule on that pattern already has is refused `duplicate-rule`; the rule stays unchanged.
209
+
210
+ Commands make one host call, plus refresh or step-up calls when needed, and send no idempotency
211
+ key. Under `--json`, success answers `{ scope, value }`, with the full rule for add/update,
212
+ an array of full rules for list, and `{ ruleId }` for remove. Organisation forms use
213
+ `--organisation` and the corresponding organisation rule route; their rules have
214
+ `scope: "organisation"` and `projectId: null` inside `value`.
215
+ Changing rules needs a person's `administer projects` authority on the owner and writes an audit
216
+ record with settings before and after. Listing needs `read`. Agents must ask a person to manage rules.
193
217
 
194
218
  ## Organisation branches and baselines, locks, agent ceilings and schema requests
195
219
 
@@ -251,7 +275,7 @@ Everyone with access to this project sees every document this Onshape account ca
251
275
  | `openeng connector create --system onshape --stack <stack> --name <text> [--company <id>] [--team <id> \| --owner <id>] [--label <text>]` | creates the connection, its mirror project and its service identity, then drafts the connector's types as a change set in the same request; `--name` names the mirror project; `--stack` is the Onshape stack label, the host-name label joined to the suffix, as in `cad`; `--team` or `--owner` limits the import to that team's or owner's documents, and with neither the company's documents are imported, and `--company` is then required and must be the company's own identifier, not a user's, or the command is refused (exit 2) before any call; `--team` with `--owner` is refused (exit 2) before any call. The answer says whether the types were drafted, and if not, which rule stopped it; the connection exists either way | `administer projects` and `administer service identities` in the organisation, which the `owner` role holds |
252
276
  | `openeng connector set-credential <connection>` | asks for the Onshape access key and secret key at a terminal prompt with nothing echoed, has the host check them against Onshape, and stores them; no flag or environment variable carries a key, and with no terminal it refuses before any call. Backspace deletes a character, a paste of both keys with a line ending between them fills both prompts, and Control-C or Control-D cancels with a refusal that says no keys were set. Setting it again replaces the stored credential. It prints the Onshape account the key belongs to and the time it was set | `administer projects` in the organisation |
253
277
  | `openeng connector draft-types <connection>` | drafts the connector's types as a change set for a person to review, or answers that they are already approved or that a change set is open; use it for a connection whose drafting failed at create, and after a connector update | `administer types` in the organisation, and read on the mirror project |
254
- | `openeng connector run <connection>` | starts an import run and prints its identifier once its row has committed; the run refuses while the connector's types are not approved | `merge` on the mirror project |
278
+ | `openeng connector run <connection>` | starts an import run and prints its identifier once its row has committed; the run refuses while the connector's types are not approved | `write ref` on the mirror project |
255
279
  | `openeng connector runs <connection>` | lists the connection's runs, newest first: state, start and finish times, whether it was complete, the counts (created, updated, unchanged, withdrawn, carried, overwritten) and, for a failed run, its failure kind and fixed text | read on the mirror project |
256
280
  | `openeng connector revoke <connection>` | revokes the connection: its running runs end as failed and its service identity can no longer act | `administer projects` and `administer service identities` in the organisation |
257
281
 
@@ -266,7 +290,7 @@ Everyone with access to this project sees every document this Onshape account ca
266
290
  --change-set <id> --project <mirror project id>` and accepts it with `openeng types draft accept
267
291
  --change-set <id> --revision <token>`. The change set identifier is in `create`'s answer, or in
268
292
  `openeng types draft current`. Until it is accepted, a run refuses with `types-not-approved`.
269
- 4. `openeng connector run <connection>`, by a person who holds `merge` on the mirror project.
293
+ 4. `openeng connector run <connection>`, by a person who holds `write ref` on the mirror project.
270
294
  5. `openeng connector runs <connection>` until the run's state is `succeeded` or `failed`.
271
295
 
272
296
  ### Owned records
@@ -386,6 +410,31 @@ for, built when the process starts from those entries (`OBJECTS_ROUTE_ENTRIES`,
386
410
  - **Calls.** One host call; two when the session had expired. A streamed command holds one
387
411
  connection.
388
412
 
413
+ ## Actions held to the person's confirmation
414
+
415
+ The platform holds some actions (granting a role, inviting a person, merging, deleting a branch,
416
+ registering an application and others) to the person's own confirmation. When a command meets one,
417
+ `openeng` prints the address of the confirm page on the host's web application, to standard output
418
+ (standard error under `--json`), and a line on standard error saying it is waiting. It then polls
419
+ `readStepUpProof` under the person's own token every two seconds, for as long as the pending request
420
+ lives, and when the person has confirmed it sends the command again once, with the proof and the same
421
+ key. The proof is never printed. If nobody confirms before the time limit, it reports that the
422
+ action was refused because nobody
423
+ confirmed in time and exits 4, without sending the write again. Other proof-poll refusals keep their
424
+ actual meaning; a transport failure remains a transport failure. A host with no web application
425
+ answers the original challenge after a line explaining why no confirmation page can be offered.
426
+
427
+ `openeng session status` asks the server for `{ channel, mode, issuedAt }`, even when no organisation
428
+ is attached. Text output names the channel, mode and sign-in time. Local `whoami` stays an identity
429
+ read and cannot establish the session's mode.
430
+
431
+ A person at the terminal can run `openeng session human` to stop further challenges for the rest
432
+ of that CLI session. It uses the same confirm-address, poll and single-retry road, then prints the
433
+ server's stored state in the status format. Repeating it on an already-human session is a no-op.
434
+ A new CLI sign-in starts in agent mode. An unknown session becomes CLI/agent on ordinary action
435
+ confirmation; its next marked action asks again. Confirming human mode on an unknown session
436
+ classifies it and enters human mode in that one approval. Neither command stores a local mode.
437
+
389
438
  ## Flags and environment
390
439
 
391
440
  Every command takes `--json`, which prints one JSON value on standard output in place of text.
@@ -480,8 +529,10 @@ built for that host. Otherwise it says the host did not read this `openeng`'s pr
480
529
  the version it read, or `none`. The catalogue explanation also prints. Under `--json`, the refusal
481
530
  carries the host's key as `host` and this client's version as `clientVersion`. The host's `versions`
482
531
  are unchanged: `versions.client` is the version the host read, or null, and `versions.host` is the
483
- host's version. The text also prints `Update with: npm install -g @openengio/cli@latest`, and JSON adds
484
- `update: "npm install -g @openengio/cli@latest"`.
532
+ host's version. When the host is newer, the text also prints `Update with: npm install -g @openengio/cli@latest`
533
+ and names the version series that speaks the host's protocol (`0.<protocol>.x`). When the host is older, it says
534
+ the host has not been updated yet and prints the command that installs the `openeng` built for the host's
535
+ protocol (`npm install -g @openengio/cli@0.<protocol>`). JSON adds that command as `update`.
485
536
 
486
537
  | exit code | meaning |
487
538
  |---|---|