@openengio/cli 0.23.3 → 0.24.3
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 +100 -14
- package/bin/public/openeng.js +772 -115
- package/package.json +1 -1
- package/skill/build-ui/SKILL.md +4 -0
- package/skill/conventions/SKILL.md +62 -0
- package/skill/new-use-case/SKILL.md +4 -0
- package/skill/openeng/SKILL.md +128 -26
package/README.md
CHANGED
|
@@ -12,12 +12,6 @@ Install the public npm package:
|
|
|
12
12
|
npm install -g @openengio/cli
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
Upgrading from `@benjaminfh/oe2`: first run the earlier package's `logout` command, so its stored
|
|
16
|
-
session does not stay on this machine; then uninstall it and install `@openengio/cli`. The command
|
|
17
|
-
is now `openeng`, the environment variables are
|
|
18
|
-
`OPENENG_HOST`, `OPENENG_SIGN_IN_ORIGIN` and `OPENENG_SESSION_STORE`, and you sign in again once
|
|
19
|
-
with `openeng login`.
|
|
20
|
-
|
|
21
15
|
`openeng` has no host built in. The production host is `https://api.openeng.io`. Pass `--host
|
|
22
16
|
https://api.openeng.io` to a command, or set `OPENENG_HOST=https://api.openeng.io` once to make it the
|
|
23
17
|
default. An agent starts with `openeng skill`, which prints how to work with the platform.
|
|
@@ -47,7 +41,7 @@ The installed package contains the bundled command and the skill. It carries no
|
|
|
47
41
|
| `openeng org current` | prints the organisation the stored session is attached to, or none (`{ "organisation": null }` under `--json`); sends no request | none |
|
|
48
42
|
| `openeng projects list` | lists the projects the signed-in person may list | one |
|
|
49
43
|
| `openeng demo seed --project <id> [--size standard\|full]` | plays a generic open-cycle gas turbine plant into a project the person may list; `standard` is the default size, and a repeat completes what is left | one listing, one catalogue read, four to publish the types when they are not yet published, then one per object and edge |
|
|
50
|
-
| `openeng link <explore\|branch-diff\|project> --project <id> --ref <ref>`, `openeng link <ontology\|change-set> --ref <ref>`, `openeng link <object\|type\|proposal\|app> <identifier> --project <id> --ref <ref>`, `openeng link app-page <appKey> <pageKey> --project <id> --ref <ref>`, `openeng link app-draft <appKey> --ref <ref>`, `openeng link organisation-page <page>` | prints the address of a page of the web application: the host's web origin joined to the page's path, built for the attached organisation; `--json` answers `{ link }`; a flag the page does not read is refused (exit 2) before any call, and
|
|
44
|
+
| `openeng link <explore\|branch-diff\|project> --project <id> --ref <ref>`, `openeng link <ontology\|change-set> --ref <ref>`, `openeng link <object\|type\|proposal\|app> <identifier> --project <id> --ref <ref>`, `openeng link app-page <appKey> <pageKey> --project <id> --ref <ref>`, `openeng link app-draft <appKey> --ref <ref>`, `openeng link organisation-page <page>` | prints the address of a page of the web application: the host's web origin joined to the page's path, built for the attached organisation; `--json` answers `{ link }`; a flag the page does not read or a ref outside `main` and `<projectId>/<branch>` is refused (exit 2) before any call; a branch must match `--project` when given. The command reads the ref and the page's object, catalogue type, app page or proposal before printing, and refuses a missing subject with no address; a host with no web origin is refused too. `openeng link --help` prints every form | one `readWebOrigin`, plus a ref read for a branch or a project page on main, plus the subject read for object, type, app, app-page or proposal; the reads run in parallel |
|
|
51
45
|
| `openeng types draft open` | opens a change set on the attached organisation's namespace | one |
|
|
52
46
|
| `openeng projects create --name <text>` | creates a project in the organisation the session is attached to, under a minted idempotency key | one |
|
|
53
47
|
| `openeng types list --project <id>` | lists the project's published types | one |
|
|
@@ -59,12 +53,101 @@ The installed package contains the bundled command and the skill. It carries no
|
|
|
59
53
|
| `openeng types draft validate --change-set <id> --revision <token>` | the host's violations for that revision, printed with their count; exits 4 when there is one or more and 0 when there are none, so a script can gate `accept` on the exit code | one |
|
|
60
54
|
| `openeng types draft discard --change-set <id>` | discards the change set | one |
|
|
61
55
|
| `openeng types draft accept --change-set <id> --revision <token>` | publishes the change set's types at the revision the person reviewed, under a minted idempotency key | one |
|
|
56
|
+
| `openeng rules add` | adds a project or organisation ref rule | one |
|
|
57
|
+
| `openeng rules list` | lists the selected project's or organisation's rules | one |
|
|
58
|
+
| `openeng rules remove` | removes a rule by identifier | one |
|
|
59
|
+
| `openeng org-refs create` | creates an organisation ref, optionally read-only | one |
|
|
60
|
+
| `openeng org-refs list` | lists visible organisation refs | one |
|
|
61
|
+
| `openeng org-refs delete` | deletes a writable organisation ref | one |
|
|
62
|
+
| `openeng org-refs mark-read-only` | marks an organisation ref read-only | one |
|
|
63
|
+
| `openeng locks set` | sets or lifts an object's lock on a project ref | one |
|
|
64
|
+
| `openeng ceiling show` | reads a project's maximum agent role | one |
|
|
65
|
+
| `openeng ceiling set` | sets a project's maximum agent role | one |
|
|
66
|
+
| `openeng schema-update request` | records a schema update request | one |
|
|
67
|
+
| `openeng schema-update show` | reads the latest visible request, or no request | one |
|
|
62
68
|
| `openeng skill [<topic> \| playbook <name>]` | prints the main skill and lists topics, or prints one bundled topic; needs no host and no session | none |
|
|
63
69
|
|
|
64
70
|
An object type's `subscriptionRoles` field declares which roles it admits: owner, approver or watcher.
|
|
65
71
|
Owner is limited to one; approver and watcher may have optional maxima. Without the field, only
|
|
66
72
|
watchers are admitted.
|
|
67
73
|
|
|
74
|
+
## The rules commands
|
|
75
|
+
|
|
76
|
+
These commands use the Admin SDK. Choose exactly one of `--project <id>` and `--organisation`.
|
|
77
|
+
The boolean `--organisation` flag takes no value and uses the session's attached organisation;
|
|
78
|
+
its calls have no selector. Both flags together, or neither, refuse before a host call (exit 2).
|
|
79
|
+
The project forms are:
|
|
80
|
+
|
|
81
|
+
- `openeng rules add --project <id> --pattern <pattern> --consequence <merge-only|locked-rows-only>`
|
|
82
|
+
prints the rule's identifier, pattern and consequence. Repeating the same content returns the
|
|
83
|
+
existing rule, including when the pattern differs only in letter case.
|
|
84
|
+
- `openeng rules list --project <id>` prints each visible rule's identifier, pattern and
|
|
85
|
+
consequence, or `no rules` when there are none.
|
|
86
|
+
- `openeng rules remove --project <id> --rule-id <id>` prints the removed rule's identifier.
|
|
87
|
+
An absent or unreadable identifier, or one from another project, answers `not-found`.
|
|
88
|
+
|
|
89
|
+
Each command makes one host call, or two if the session first needs refreshing, and sends no
|
|
90
|
+
idempotency key. Under `--json`, each success answers `{ scope, value }`: `scope` is the CLI's
|
|
91
|
+
organisation and, for project forms, project; `value` holds the full rule for add, an array of rules for list, and
|
|
92
|
+
`{ ruleId }` for remove. Organisation forms call `addOrganisationRule`, `listOrganisationRules`
|
|
93
|
+
and `removeOrganisationRule` with the same inputs. Their full rule has `scope: "organisation"`
|
|
94
|
+
and `projectId: null`; project rules keep `scope: "project"`. That scope stays inside `value`.
|
|
95
|
+
Missing flags or a consequence other than the two spellings above refuse before any host call (exit 2).
|
|
96
|
+
The host validates the pattern.
|
|
97
|
+
|
|
98
|
+
A project rule's pattern is `main` or a ref under that project's identifier, exactly or ending
|
|
99
|
+
in `/*` to match the prefix. A matching `merge-only` rule requires changes through a branch and
|
|
100
|
+
merge. A `locked-rows-only` rule binds merge-only row locks while leaving unlocked rows direct.
|
|
101
|
+
Adding or removing rules needs a person's `administer projects` capability on the selected
|
|
102
|
+
project, or in the attached organisation for `--organisation`; both are audited. Listing needs
|
|
103
|
+
`read`. Each command's `--help` has a capability line. A `not-permitted` refusal carries no
|
|
104
|
+
capability; read that help line to find what the person needs. A change takes effect on the next
|
|
105
|
+
request. A `protected` write refusal means to use the branch and review workflow.
|
|
106
|
+
Agents must ask a person to manage rules.
|
|
107
|
+
|
|
108
|
+
## Organisation refs, locks, agent ceilings and schema requests
|
|
109
|
+
|
|
110
|
+
All these commands need an attached organisation, make one host call (plus a refresh when needed),
|
|
111
|
+
and send no idempotency key. Text output is described below; `--json` always returns `{ scope, value }`
|
|
112
|
+
with the full route response in `value`, including null. A host refusal uses the standard explanation
|
|
113
|
+
and next step. Changing rules, refs and locks is a person's action, never a way for an agent to bypass
|
|
114
|
+
protection.
|
|
115
|
+
|
|
116
|
+
Creating, deleting or marking organisation refs needs `administer projects` in the attached
|
|
117
|
+
organisation. Setting a ceiling needs `administer projects` on the selected project; setting
|
|
118
|
+
or lifting a lock needs `lock objects` there. Requesting a schema update needs `write ref` on
|
|
119
|
+
a branch's home project, or `administer projects` for an organisation ref. Rule and organisation-ref
|
|
120
|
+
lists and ceiling reads need `read`. Schema-update show reads only the caller's own requests in the
|
|
121
|
+
token's organisation, without requiring project read access. Each command's `--help` names its requirement.
|
|
122
|
+
A branch whose name contains `/` cannot request or show a schema update today.
|
|
123
|
+
|
|
124
|
+
- `openeng org-refs create --name <name> [--read-only]` calls `createOrganisationRef` and prints
|
|
125
|
+
`ref <name> read-only` or `ref <name> writable`. It creates from the organisation's trunk head.
|
|
126
|
+
The name is one non-reserved ref segment, such as `release-v1`; without the flag it is writable.
|
|
127
|
+
- `openeng org-refs list` calls `listOrganisationRefs` and prints each ref in that form, or `no refs`.
|
|
128
|
+
- `openeng org-refs delete --name <name>` calls `deleteOrganisationRef` and prints `deleted ref <name>`.
|
|
129
|
+
A read-only ref cannot be deleted.
|
|
130
|
+
- `openeng org-refs mark-read-only --name <name>` calls `markOrganisationRefReadOnly` and prints the
|
|
131
|
+
ref's name and read-only state. All four organisation-ref calls have no selector.
|
|
132
|
+
- `openeng locks set --project <id> --ref <ref> --object <objectId> --lock <none|merge-only|frozen>`
|
|
133
|
+
calls the Objects client's `setObjectLock` with selector `{ projectId, ref }` and input
|
|
134
|
+
`{ objectId, lock }`. It prints `object <objectId> lock <lock>`. `none` lifts the lock;
|
|
135
|
+
the lock also applies to the object's child edges.
|
|
136
|
+
- `openeng ceiling show --project <id>` calls `readAgentCeiling` and prints `ceiling <role>`.
|
|
137
|
+
- `openeng ceiling set --project <id> --ceiling <contributor|maintainer>` calls `setAgentCeiling`
|
|
138
|
+
and prints `ceiling <role>`. Both ceiling calls use a project selector.
|
|
139
|
+
- `openeng schema-update request --ref <ref>` calls the Branches client's `requestSchemaUpdate`
|
|
140
|
+
and prints `schema update <ref> <state>`. It records a request; execution is separate.
|
|
141
|
+
- `openeng schema-update show --ref <ref>` calls `readSchemaUpdateRequest` and prints that same
|
|
142
|
+
form, or `no request` for null. Schema calls have no selector and act in the attached organisation.
|
|
143
|
+
The ref is a project branch or a bare organisation ref name; `main` is refused by the host.
|
|
144
|
+
|
|
145
|
+
Missing required flags and unknown lock or ceiling spellings refuse before any call (exit 2).
|
|
146
|
+
For an uncertain outcome, rules, organisation refs, ceiling and schema requests name a read-only
|
|
147
|
+
command: list the rules or organisation refs, or show the ceiling or schema request. Inspect that
|
|
148
|
+
answer before acting again. The lock command instead names the same idempotent `openeng locks set`
|
|
149
|
+
command with the same arguments, which sets the same lock again.
|
|
150
|
+
|
|
68
151
|
## The connector commands
|
|
69
152
|
|
|
70
153
|
A connection imports an Onshape account's documents into a mirror project of its own. Every
|
|
@@ -100,11 +183,12 @@ Everyone with access to this project sees every document this Onshape account ca
|
|
|
100
183
|
4. `openeng connector run <connection>`, by a person who holds `merge` on the mirror project.
|
|
101
184
|
5. `openeng connector runs <connection>` until the run's state is `succeeded` or `failed`.
|
|
102
185
|
|
|
103
|
-
###
|
|
186
|
+
### Owned records
|
|
104
187
|
|
|
105
|
-
The
|
|
106
|
-
|
|
107
|
-
|
|
188
|
+
The connected system alone writes records of its owned types. A person's write is refused as
|
|
189
|
+
`owned`. People put their own information in separate rows and link those rows to the mirrored
|
|
190
|
+
records. The importer counts updates to mirrored properties as `overwritten`. If a mirrored
|
|
191
|
+
record is absent, the importer creates it with a new identifier and counts it as `created`.
|
|
108
192
|
|
|
109
193
|
## The attached organisation
|
|
110
194
|
|
|
@@ -126,8 +210,9 @@ reach; the stored organisation decides only what the CLI prints and whether it r
|
|
|
126
210
|
then ` · project: <id>` when `--project` or the selector's `projectId` named one, and
|
|
127
211
|
` · ref: <ref>` when the selector named one. No host call finds them.
|
|
128
212
|
- **`--json`.** The one value on standard output gains the same fields as `scope`:
|
|
129
|
-
`{ "organisation": { "id", "name" }, "project"?, "ref"? }`. An object value gains a `scope` key. A
|
|
213
|
+
`{ "organisation": { "id", "name" }, "project"?, "ref"? }`. An object value normally gains a `scope` key. A
|
|
130
214
|
value that is an array or null is wrapped as `{ "scope": {...}, "value": <the original> }`. A
|
|
215
|
+
rules command's success always uses that wrapper to preserve the rule's own `scope` field. A
|
|
131
216
|
failure the host did not answer carries no scope. A command with no scope has no `scope` field.
|
|
132
217
|
- **The hint.** Every `not-found` the host answers to a gated command prints, after the refusal,
|
|
133
218
|
"not found in organisation <name>: check that you are attached to the correct organisation (openeng org
|
|
@@ -218,8 +303,9 @@ for, built when the process starts from those entries (`OBJECTS_ROUTE_ENTRIES`,
|
|
|
218
303
|
## Flags and environment
|
|
219
304
|
|
|
220
305
|
Every command takes `--json`, which prints one JSON value on standard output in place of text.
|
|
221
|
-
The flags a command reads, named in its usage above, are `--project`, `--
|
|
222
|
-
|
|
306
|
+
The flags a command reads, named in its usage above, are `--project`, `--pattern`, `--consequence`,
|
|
307
|
+
`--rule-id`, `--name`, `--change-set`, `--revision`, `--from`, `--size`, `--idempotency-key`,
|
|
308
|
+
`--rail-groups`, and, for
|
|
223
309
|
`openeng connector create`, `--system`, `--stack`, `--company`, `--team`, `--owner` and `--label`; a
|
|
224
310
|
command that needs one it was not given refuses before any call (exit 2).
|
|
225
311
|
|