@openengio/cli 0.33.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
@@ -1,5 +1,32 @@
1
1
  # @openengio/cli
2
2
 
3
+ ## Link review and impact
4
+
5
+ `openeng links status <object> --project <id> --ref <ref>` prints the stable head, tracked
6
+ links, review and bounds states, clearing attribution and aggregate bounds. Review is `cleared`,
7
+ `suspect`, `unreviewed`, `not-visible` or `too-many-links`; a significant upstream change makes
8
+ a cleared link suspect. Bounds independently answer `in`, `out`, `none`, `no-value`,
9
+ `unit-mismatch` or `not-visible`. Aggregates carry coverage and hidden or missing counts.
10
+ Numeric bounds include their units. Text output from `objects-sdk readObject` also shows
11
+ property values with units, using one additional catalogue read; `--json` retains the wire result.
12
+
13
+ `openeng links clear <link> --version <v> --project <id> --ref <ref>` clears after review.
14
+ For 1 to 100 links, list the ids and repeat `--version` once per link in matching order, for
15
+ example `openeng links clear <link1> <link2> --version <v1> --version <v2> --project <id>
16
+ --ref <ref>`. Each opaque upstream version comes from status and is a precondition; the clear is
17
+ atomic. `upstream-changed` requires reading and reviewing again; `upstream-not-readable` requires
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. 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
22
+ clearing tool. An unknown outcome exits 5; recover by correlation before repeating a clear.
23
+
24
+ `openeng branches impact <ref> --base <base> --project <id>` prints review, bounds and aggregate
25
+ changes against the merge base, plus downstream reach to depth three and hidden counts. Both heads
26
+ are pinned. Added and removed states identify new and deleted links; `head-moved` and `over-bound`
27
+ refuse without partial output. All three commands support `--json` for the complete answer and
28
+ print refusals by name.
29
+
3
30
  `openeng` is the platform's command-line client. It signs a person in through the browser, stores the
4
31
  session, and calls the platform's host. It runs on Node 22 and has no argument-parser dependency
5
32
  (`node:util`'s `parseArgs` serves because every command takes the same few flags).
@@ -33,6 +60,8 @@ The installed package contains the bundled command and the skill. It carries no
33
60
  |---|---|---|
34
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`) |
35
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 |
36
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 |
37
66
  | `openeng org list` | lists the organisations the signed-in person holds a live grant in; needs no attachment | one |
38
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 |
@@ -57,7 +86,12 @@ The installed package contains the bundled command and the skill. It carries no
57
86
  | `openeng attachment add <object> <property> <file> --project <id> --ref <ref>` | stages, saves and prints the descriptor | four |
58
87
  | `openeng attachment get <object> <property> [--out <path>] --project <id> --ref <ref>` | downloads and prints the written path | one |
59
88
  | `openeng attachment list <object> --project <id> --ref <ref>` | prints attachment properties and descriptors | two |
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 |
90
+ | `openeng hosted-app list --project <id>` | lists the project's hosted apps | one |
91
+ | `openeng hosted-app versions <app key> --project <id>` | lists the app's versions, newest first | two |
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 |
60
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 |
61
95
  | `openeng rules list` | lists the selected project's or organisation's rules | one |
62
96
  | `openeng rules remove` | removes a rule by identifier | one |
63
97
  | `openeng org-refs create` | creates an organisation branch or baseline, optionally read-only | one |
@@ -71,10 +105,23 @@ The installed package contains the bundled command and the skill. It carries no
71
105
  | `openeng schema-update show` | reads the latest visible request, or no request | one |
72
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 |
73
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
+
74
111
  Attachments are top-level properties declared with kind `attachment`. Accepted file classes are
75
112
  `image` (PNG, JPEG, WebP, GIF), `pdf`, `step` (STEP), `mesh` (STL) and `text` (plain text and the
76
113
  admitted text-file extensions). Each body is limited to 26,214,400 bytes (25 MiB).
77
114
 
115
+ The hosted-app commands take `--project`, and `publish` also takes `--key`, an app key: lower-case
116
+ letters, digits and hyphens, at most 63 characters. The parser refuses any other value (exit 2), so
117
+ the flag cannot carry a token. `publish` reads the bundle file whole; the host bounds it at 4 MiB.
118
+ A refused publish, such as one by a person who may not publish into the project, prints the host's
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"`.
124
+
78
125
  All three attachment commands require explicit `--project` and `--ref` and an attached organisation.
79
126
  `add` uses the local file's basename, stages it, reads the object and catalogue, then saves; it prints
80
127
  the descriptor only after a succeeded save. `add` and `list` use the catalogue's latest version of
@@ -125,32 +172,48 @@ The boolean `--organisation` flag takes no value and uses the session's attached
125
172
  its calls have no selector. Both flags together, or neither, refuse before a host call (exit 2).
126
173
  The project forms are:
127
174
 
128
- - `openeng rules add --project <id> --pattern <pattern> --consequence <merge-only|locked-rows-only>`
129
- prints the rule's identifier, pattern and consequence. Repeating the same content returns the
130
- existing rule, including when the pattern differs only in letter case.
131
- - `openeng rules list --project <id>` prints each visible rule's identifier, pattern and
132
- consequence, or `no rules` when there are none.
133
- - `openeng rules remove --project <id> --rule-id <id>` prints the removed rule's identifier.
134
- An absent or unreadable identifier, or one from another project, answers `not-found`.
135
-
136
- Each command makes one host call, or two if the session first needs refreshing, and sends no
137
- idempotency key. Under `--json`, each success answers `{ scope, value }`: `scope` is the CLI's
138
- organisation and, for project forms, project; `value` holds the full rule for add, an array of rules for list, and
139
- `{ ruleId }` for remove. Organisation forms call `addOrganisationRule`, `listOrganisationRules`
140
- and `removeOrganisationRule` with the same inputs. Their full rule has `scope: "organisation"`
141
- and `projectId: null`; project rules keep `scope: "project"`. That scope stays inside `value`.
142
- Missing flags or a consequence other than the two spellings above refuse before any host call (exit 2).
143
- The host validates the pattern.
144
-
145
- A project rule's pattern is `main` or a branch or baseline under that project's identifier, exactly or ending
146
- in `/*` to match the prefix. A matching `merge-only` rule requires changes through a branch and
147
- merge. A `locked-rows-only` rule binds merge-only row locks while leaving unlocked rows direct.
148
- Adding or removing rules needs a person's `administer projects` capability on the selected
149
- project, or in the attached organisation for `--organisation`; both are audited. Listing needs
150
- `read`. Each command's `--help` has a capability line. A `not-permitted` refusal carries no
151
- capability; read that help line to find what the person needs. A change takes effect on the next
152
- request. A `protected` write refusal means to use the branch and review workflow.
153
- 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.
154
217
 
155
218
  ## Organisation branches and baselines, locks, agent ceilings and schema requests
156
219
 
@@ -212,7 +275,7 @@ Everyone with access to this project sees every document this Onshape account ca
212
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 |
213
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 |
214
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 |
215
- | `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 |
216
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 |
217
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 |
218
281
 
@@ -227,7 +290,7 @@ Everyone with access to this project sees every document this Onshape account ca
227
290
  --change-set <id> --project <mirror project id>` and accepts it with `openeng types draft accept
228
291
  --change-set <id> --revision <token>`. The change set identifier is in `create`'s answer, or in
229
292
  `openeng types draft current`. Until it is accepted, a run refuses with `types-not-approved`.
230
- 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.
231
294
  5. `openeng connector runs <connection>` until the run's state is `succeeded` or `failed`.
232
295
 
233
296
  ### Owned records
@@ -347,12 +410,37 @@ for, built when the process starts from those entries (`OBJECTS_ROUTE_ENTRIES`,
347
410
  - **Calls.** One host call; two when the session had expired. A streamed command holds one
348
411
  connection.
349
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
+
350
438
  ## Flags and environment
351
439
 
352
440
  Every command takes `--json`, which prints one JSON value on standard output in place of text.
353
441
  The flags a command reads, named in its usage above, are `--project`, `--pattern`, `--consequence`,
354
442
  `--rule-id`, `--name`, `--change-set`, `--revision`, `--from`, `--size`, `--idempotency-key`,
355
- `--rail-groups`, and, for
443
+ `--rail-groups`, `--key` (for `openeng hosted-app publish`), and, for
356
444
  `openeng connector create`, `--system`, `--stack`, `--company`, `--team`, `--owner` and `--label`; a
357
445
  command that needs one it was not given refuses before any call (exit 2).
358
446
 
@@ -441,8 +529,10 @@ built for that host. Otherwise it says the host did not read this `openeng`'s pr
441
529
  the version it read, or `none`. The catalogue explanation also prints. Under `--json`, the refusal
442
530
  carries the host's key as `host` and this client's version as `clientVersion`. The host's `versions`
443
531
  are unchanged: `versions.client` is the version the host read, or null, and `versions.host` is the
444
- host's version. The text also prints `Update with: npm install -g @openengio/cli@latest`, and JSON adds
445
- `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`.
446
536
 
447
537
  | exit code | meaning |
448
538
  |---|---|