@orchestraworks/cli 0.3.0 → 0.5.1

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 (47) hide show
  1. package/README.md +23 -1256
  2. package/dist/cli/core/banner.d.ts +10 -0
  3. package/dist/cli/core/banner.js +63 -0
  4. package/dist/cli/core/invocation.js +1 -1
  5. package/dist/cli/core/package-root.d.ts +3 -2
  6. package/dist/cli/core/package-root.js +4 -4
  7. package/dist/cli/core/skill-pointer.d.ts +7 -2
  8. package/dist/cli/core/skill-pointer.js +13 -3
  9. package/dist/cli/factory/init.d.ts +1 -1
  10. package/dist/cli/factory/init.js +41 -13
  11. package/dist/cli/main.js +5 -3
  12. package/dist/cli/skill-install-fs.d.ts +0 -2
  13. package/dist/cli/skill-install-fs.js +0 -2
  14. package/dist/cli/skill.js +20 -7
  15. package/docs/REFERENCE.md +1278 -0
  16. package/node_modules/@orchestraworks/client/package.json +1 -1
  17. package/package.json +7 -8
  18. package/skills/orchestra/SKILL.md +151 -110
  19. package/skills/orchestra-fdk/SKILL.md +327 -120
  20. package/skills/orchestra-fdk/references/authoring.md +26 -15
  21. package/skills/orchestra-fdk/references/environment.md +39 -24
  22. package/templates/bug-fix/tsconfig.json +12 -0
  23. package/templates/engineering-team/lib/setup.sh +16 -0
  24. package/templates/engineering-team/package.json +1 -1
  25. package/templates/todo-factory/package.json +1 -1
  26. package/node_modules/@orchestraworks/workflow-render/LICENSE +0 -202
  27. package/node_modules/@orchestraworks/workflow-render/dist/constants.d.ts +0 -98
  28. package/node_modules/@orchestraworks/workflow-render/dist/context.d.ts +0 -37
  29. package/node_modules/@orchestraworks/workflow-render/dist/geometry-core.d.ts +0 -40
  30. package/node_modules/@orchestraworks/workflow-render/dist/graph-digest.d.ts +0 -4
  31. package/node_modules/@orchestraworks/workflow-render/dist/grid.d.ts +0 -33
  32. package/node_modules/@orchestraworks/workflow-render/dist/heuristic.d.ts +0 -7
  33. package/node_modules/@orchestraworks/workflow-render/dist/identity.d.ts +0 -9
  34. package/node_modules/@orchestraworks/workflow-render/dist/index.d.ts +0 -24
  35. package/node_modules/@orchestraworks/workflow-render/dist/index.js +0 -1
  36. package/node_modules/@orchestraworks/workflow-render/dist/layout.d.ts +0 -6
  37. package/node_modules/@orchestraworks/workflow-render/dist/normalize.d.ts +0 -33
  38. package/node_modules/@orchestraworks/workflow-render/dist/place.d.ts +0 -81
  39. package/node_modules/@orchestraworks/workflow-render/dist/ports.d.ts +0 -15
  40. package/node_modules/@orchestraworks/workflow-render/dist/presence.d.ts +0 -6
  41. package/node_modules/@orchestraworks/workflow-render/dist/route-cells.d.ts +0 -15
  42. package/node_modules/@orchestraworks/workflow-render/dist/sha256.d.ts +0 -3
  43. package/node_modules/@orchestraworks/workflow-render/dist/svg.d.ts +0 -7
  44. package/node_modules/@orchestraworks/workflow-render/dist/text.d.ts +0 -14
  45. package/node_modules/@orchestraworks/workflow-render/dist/types.d.ts +0 -310
  46. package/node_modules/@orchestraworks/workflow-render/dist/verify.d.ts +0 -26
  47. package/node_modules/@orchestraworks/workflow-render/package.json +0 -42
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestraworks/client",
3
- "version": "0.3.0",
3
+ "version": "0.5.1",
4
4
  "description": "Orchestra public API TypeScript client",
5
5
  "author": "Living Computers",
6
6
  "repository": {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@orchestraworks/cli",
3
- "version": "0.3.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
- "description": "Orchestra: the orchestra CLI, and the FDK construct library for declaring a factory as code",
5
+ "description": "The Orchestra command line.",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Living Computers",
8
8
  "homepage": "https://orchestraworks.ai",
@@ -17,7 +17,8 @@
17
17
  "dist",
18
18
  "skills",
19
19
  "templates",
20
- "README.md"
20
+ "README.md",
21
+ "docs/REFERENCE.md"
21
22
  ],
22
23
  "main": "./dist/index.js",
23
24
  "types": "./dist/index.d.ts",
@@ -108,17 +109,15 @@
108
109
  },
109
110
  "dependencies": {
110
111
  "@agentclientprotocol/sdk": "1.3.0",
111
- "@orchestraworks/client": "0.3.0",
112
- "@orchestraworks/worker": "0.0.134",
113
- "@orchestraworks/workflow-render": "0.3.0",
112
+ "@orchestraworks/client": "0.5.1",
113
+ "@orchestraworks/worker": "0.0.136",
114
114
  "commander": "^14.0.0",
115
115
  "liquidjs": "^10.28.0"
116
116
  },
117
117
  "optionalDependencies": {
118
- "@orchestraworks/local": "0.0.134"
118
+ "@orchestraworks/local": "0.0.136"
119
119
  },
120
120
  "bundleDependencies": [
121
- "@orchestraworks/workflow-render",
122
121
  "@orchestraworks/client"
123
122
  ],
124
123
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: orchestra
3
- description: Use when you need to understand or explain an Orchestra concept - organization, role, agent, version, environment, machine, network rules, secret, model gateway and gateway key, session, pipeline, work item, workflow rules, trigger, skill, file, credit, plan, or the factory as code - or how the orchestra command line works, what the platform cannot do yet, and where an agent's knowledge belongs. A reference to read, not a list of steps.
3
+ description: Use when you need to understand or explain an Orchestra concept - organization, role, agent, version, environment, machine, network rules, secret, reaching a model (subscription, model gateway and gateway key, own key), session, pipeline, work item, workflow rules, trigger, skill, file, plan, or the factory as code - or how the orchestra command line works, what the platform cannot do yet, and where an agent's knowledge belongs. A reference to read, not a list of steps.
4
4
  ---
5
5
 
6
6
  # Orchestra: the ideas behind the platform
@@ -17,14 +17,14 @@ Sections:
17
17
  4. Environment, machine, size, image and setup script
18
18
  5. Network rules (egress)
19
19
  6. Secret
20
- 7. Model gateway and gateway key
20
+ 7. Reaching a model: subscription, model gateway or own key
21
21
  8. Session and turn
22
22
  9. Pipeline and stage
23
23
  10. Work item
24
24
  11. Workflow rules and the judge
25
25
  12. Trigger (listener)
26
26
  13. Skill and file
27
- 14. Credit and plan
27
+ 14. Plan
28
28
  15. The factory as code
29
29
  16. How the CLI works
30
30
  17. Connections
@@ -41,7 +41,7 @@ platform/.../service/project/ProjectReferenceService.kt:241-245 (project referen
41
41
  platform/.../workplane/service/WorkplaneWorkItemService.kt:206,556 (assignee confined to the item's project or
42
42
  the shared space). -->
43
43
 
44
- **What it's for.** The organization is the customer's account: everything they build and pay for sits in it.
44
+ **What it's for.** The organization is the customer's account: everything they build sits in it.
45
45
  Roles decide who may do what, so each person and each agent can do its own job and no more.
46
46
 
47
47
  **What it is.** A *member* is a person, an agent or a service account with a membership in the organization.
@@ -63,7 +63,7 @@ in a project may point at its own project or the shared space; a row in the shar
63
63
  shared space. So a shared agent takes items from every project, and an agent in a project takes items only
64
64
  from that project.
65
65
 
66
- **In the starter.** The organization has no project. Each of the four agents starts with `agent-worker`. The
66
+ **In the starter.** The organization has no project. Each of the five agents starts with `agent-worker`. The
67
67
  Manager Agent is then given `agent-manager`, because it works in every pipeline and changes the Engineer
68
68
  Agents.
69
69
 
@@ -89,8 +89,9 @@ model the harness calls, set in the agent's model settings.
89
89
  the model gateway when its model settings turn the gateway on (section 7). Work reaches it as sessions (section
90
90
  8), most often started by assigning it a work item (section 10).
91
91
 
92
- **In the starter.** The Manager Agent and Engineer Agent lg run `claude` on `claude-opus-5-5`. Engineer Agent md
93
- runs `codex` on `gpt-6.1-sol`, and Engineer Agent sm runs `codex` on `gpt-6-luna`.
92
+ **In the starter.** The Manager Agent, Engineer Agent lg and Engineer Agent bare run `claude` on
93
+ `claude-opus-5-5`. Engineer Agent md runs `codex` on `gpt-6.1-sol`, and Engineer Agent sm runs `codex` on
94
+ `gpt-6-luna`. Engineer Agent bare takes only the Bootstrap's baseline replays.
94
95
 
95
96
  **Cannot yet.**
96
97
  - Change an agent's harness after it is created. Make a new agent instead.
@@ -147,6 +148,9 @@ machine carries one agent.
147
148
  - *Ports.* Each declared port gets a *machine endpoint*, a web address that only signed-in members of the
148
149
  organization can open.
149
150
  - *Home.* A volume at `/home` keeps the agent's files when it moves to a new machine.
151
+ - *Working folder* (`workingDirectory`). Not released yet: a folder where the harness starts every
152
+ conversation. Today the agent clones or uses its code under `/work` in its own first turn, as the
153
+ starter's agents do.
150
154
  - *Lifetime.* A conversation lets go of its machine 5 minutes after its last turn, and a machine lives at
151
155
  most 2 hours, unless the environment sets other values.
152
156
 
@@ -154,9 +158,10 @@ machine carries one agent.
154
158
  disks reaches only machines made after the change. A change to the network rules is different: it reaches
155
159
  running machines too (section 5).
156
160
 
157
- **In the starter.** Four environments, one per agent: `manager-work-lg` and `engineer-work-lg` at 32 CPU,
158
- `engineer-work-md` at 16, `engineer-work-sm` at 2. Each uses the stock image, starts Docker in `lib/setup.sh`,
159
- and keeps Docker's data on its own disk.
161
+ **In the starter.** Four environments: `manager-work-lg` and `engineer-work-lg` at 32 CPU, `engineer-work-md`
162
+ at 16, `engineer-work-sm` at 2. Engineer Agent bare uses `engineer-work-lg` with Engineer Agent lg; each agent
163
+ still gets its own machines. Each uses the stock image, starts Docker in `lib/setup.sh`, and keeps Docker's
164
+ data on its own disk.
160
165
 
161
166
  **Can.**
162
167
  - Linux micro VMs at every size; full Linux VMs (2 to 8 CPU); Windows VMs (4 or 8 CPU).
@@ -238,52 +243,58 @@ terminal (`fromCommandLine`), or from a gateway key the platform mints (`fromGat
238
243
 
239
244
  **Cannot yet.** Read a value from a file on the developer's computer. Load the file into the shell first.
240
245
 
241
- ## 7. Model gateway and gateway key
242
-
243
- <!-- Sources, on develop at 19459f9ebb: docs/architecture/model-gateway.md:32-40 (gateway key; platform models
244
- billed to credit; own provider keys), :576-580 and :974-983 (the monthly cap is per key, compared at catalog
245
- rates before the markup; a guard against a runaway loop), :991 (/gateway-keys); egress.md:937-941 (the key
246
- reaches the gateway through an ordinary rule and a Secret);
247
- platform/.../service/CreditMeteringService.kt:43 (getKeySpendCached sums one key's month);
248
- platform/.../model/GatewayKey.kt:15-60 (monthlyCreditCap; monthToDateCreditSpend on each read; the cap check
249
- may lag minutes); console/src/features/models/GatewayKeysPanel.tsx:69, 544, 748 and
250
- console/src/app/navSections.ts:83 (Settings > Gateway keys sets the cap in dollars; a credit is $0.01; the
251
- console shows no per-key spend). Price: migrations/v3/2468/dml.sql (gateway fee 0.1, so platform tokens cost 1.1
252
- times list and own-key tokens 0.1 times list); it lands with that change. develop still holds 0.2
253
- (docs/architecture/commercial-plans-and-credits.md:114-120). Kit: cli/src/constructs/environment.ts:129 (default
254
- host models.orchestraworks.ai). -->
255
-
256
- **What it's for.** The model gateway is a hosted service that manages model spending in one place. Every agent's
257
- model calls go through it, so the organization pays one bill, from its credit, and sees what each gateway key
258
- spends. Each key can carry a monthly cap, a guard that stops a runaway agent loop from spending without limit.
259
- Today:
260
-
261
- - In the console, at **Settings > Gateway keys**, a person sets or lifts a key's monthly cap, in US dollars.
262
- - `orchestra gateway-keys get <key> --output json` shows the key's spend this month, `monthToDateCreditSpend`, in
263
- credits. A credit is $0.01. The console does not show per-key spend yet.
264
- - The cap is compared at the model's list price, before the 10%, and the gateway can notice a reached cap up to a
265
- few minutes late. The nightly charge is the final number.
266
-
267
- **What it is.** A *gateway key* is a key to `models.orchestraworks.ai`, stored as a secret. The network edge adds
268
- it to each model call, so no agent and no person sees it. The gateway swaps it for the AI provider's own key, so
269
- the customer brings no Anthropic or OpenAI key. Usage is charged to the organization's credit at the provider's
270
- list price plus 10%. Without the key, an agent's first message fails with "Invalid API key".
271
-
272
- The 10% price lands with a price change that has not reached the platform yet. Until then the charge is list
273
- price plus 20%.
274
-
275
- **How it relates.** The key reaches the gateway through an ordinary allow rule on the gateway's host, with the
276
- key's secret (sections 5 and 6). The agent turns the gateway on in its model settings (section 2).
277
-
278
- **In the starter.** One key, `model-gateway`, for the whole organization, with no cap. Every environment declares
279
- the gateway rule.
280
-
281
- **Can.** Bring the organization's own provider key instead, one per provider for the whole organization. Calls
282
- still go through the gateway and the gateway key stays. The provider bills the organization for the tokens, and
283
- Orchestra charges 10% of the list price for the gateway, from the same price change.
284
-
285
- **Cannot yet.** A gateway route without the rule on the environment. An environment declared in code keeps only
286
- what it declares, so the rule must be on every environment.
246
+ ## 7. Reaching a model: subscription, model gateway or own key
247
+
248
+ <!-- Sources, on develop at 0ddbb8568d: docs/architecture/model-gateway.md:32-40 (gateway key; own provider
249
+ keys), :576-580 and :974-983 (a per-key monthly cap), :991 (/gateway-keys); docs/architecture/egress.md:937-941
250
+ (the key reaches the gateway through an ordinary rule and a Secret); console/src/app/navSections.ts:83
251
+ (Settings › Gateway keys). Kit: cli/src/constructs/environment.ts:129 (default host models.orchestraworks.ai);
252
+ cli/docs/REFERENCE.md "Model traffic through the gateway" and "Gateway keys and bring-your-own provider keys";
253
+ cli/skills/orchestra-fdk/references/authoring.md "Secrets are recipes, never values" (the Claude sign-in
254
+ recipe). -->
255
+
256
+ **What it's for.** Every agent that runs a model needs a way to reach it. There are three options, and the
257
+ team uses the one that matches what it already has. Each agent's model settings and its environment's
258
+ network rules carry the option (sections 2 and 5).
259
+
260
+ **A Claude or Codex subscription.**
261
+
262
+ - *Claude.* `claude setup-token` prints a long-lived token. It is stored as a secret, and the network edge
263
+ adds it to each call to `api.anthropic.com`. The machine holds only a placeholder token and an empty API
264
+ key, so no agent and no person sees the real one. Never put the token in an environment's settings: they
265
+ are plain text.
266
+ - *Codex.* A personal access token, made by a ChatGPT Business or Enterprise member, or a separate ChatGPT
267
+ sign-in kept on a `/home` volume that every machine using it shares. A Codex sign-in stays off the model
268
+ gateway, which refuses its requests with `model_not_found`.
269
+
270
+ **An Orchestra account, through the model gateway.** The model gateway is a hosted service at
271
+ `models.orchestraworks.ai`. One endpoint reaches OpenAI, Anthropic and open models. A *gateway key* is a key
272
+ to it, stored as a secret. The network edge adds it to each model call, so no agent and no person sees it.
273
+ Without it, an agent's first message fails with "Invalid API key".
274
+
275
+ - *Routing.* `orchestra model-configs` sets which providers serve a model, and in which order, so a call
276
+ falls back to the next provider. `orchestra model-aliases` gives a model the organization's own name, such
277
+ as `default`, which one change points elsewhere.
278
+ - *A provider key through the gateway.* The organization can add its own key for one provider, a
279
+ `ModelProviderKey`, which the gateway then uses for that provider's calls. The gateway key stays.
280
+ - *A cap.* Each gateway key can carry a monthly cap, set in the console at **Settings › Gateway keys**.
281
+
282
+ **Their own provider API key.** The team's Anthropic or OpenAI API key is a secret that the network edge adds
283
+ to calls straight to the provider, with no gateway in between.
284
+
285
+ **How it relates.** Each option reaches the model through an ordinary allow rule that adds a secret (sections
286
+ 5 and 6). An agent on the model gateway turns it on in its model settings (section 2). An agent on a
287
+ subscription or its own key turns it off. For plan questions, send the person to **Settings › Plan & usage**
288
+ in the console.
289
+
290
+ **In the starter.** The code as written uses the model gateway: one key, `model-gateway`, and the gateway rule
291
+ on every environment. A subscription or an own key needs an edit, as the orchestra-fdk skill's step 6 says.
292
+
293
+ **Cannot yet.**
294
+ - A gateway route without the rule on the environment. An environment declared in code keeps only what it
295
+ declares, so the rule must be on every environment.
296
+ - Not released yet: the worker settings that put a Codex sign-in on a machine. Until they are, a `codex`
297
+ agent uses the model gateway or an OpenAI API key.
287
298
 
288
299
  ## 8. Session and turn
289
300
 
@@ -350,8 +361,8 @@ and a stage's conditions can read them.
350
361
  **How it relates.** An item's sessions are listed on it (section 8). An agent can be asked about an item without
351
362
  taking it over (`work-items message`). Rules and judges act on items (section 11).
352
363
 
353
- **In the starter.** Set up, Study and Experiment items in Onboarding. The Manager Agent creates Replay items and
354
- assigns them to Engineer Agents.
364
+ **In the starter.** The Set up and Bootstrap items in Onboarding. In the Bootstrap, the Manager Agent creates
365
+ Replay items and assigns them to Engineer Agent lg and Engineer Agent bare.
355
366
 
356
367
  **Cannot yet.** Declare items in the factory code. Create them with `orchestra work-items create`.
357
368
 
@@ -400,44 +411,40 @@ switching a listener on.
400
411
 
401
412
  ## 13. Skill and file
402
413
 
403
- <!-- Sources, on develop at 19459f9ebb: docs/architecture/agent-skills-and-runtime-manifest.md:53-60, 100-150 (a
414
+ <!-- Sources, on develop at 0ddbb8568d: docs/architecture/agent-skills-and-runtime-manifest.md:53-60, 100-150 (a
404
415
  File is stored bytes; a Skill is a set of files by reference with a root SKILL.md carrying name and
405
416
  description; an agent references up to 32 skills), :762-770 (global skills); docs/architecture/artifacts.md:36-44
406
417
  (File under everything). Kit: cli/src/constructs/skill.ts (declare a Skill in code); cli/src/cli/upload.ts
407
- (--file); platform/.../service/FileService.kt:163-165 (no projectId means the shared space). -->
418
+ (--file); platform/.../service/FileService.kt:163-165 (no projectId means the shared space);
419
+ platform/src/main/resources/catalog/skills/ (the platform's own skills, served as skill_<key>);
420
+ cli/src/constructs/skill.ts:111 (Skill.fromId). -->
408
421
 
409
422
  **What it is.** A *file* is stored content, text or any upload. A *skill* is a set of files with a root
410
423
  `SKILL.md` that has a `name` and a `description`: instructions an agent loads when it needs them. An agent lists
411
424
  the skills it uses, up to 32.
412
425
 
426
+ **Platform skills.** Orchestra's own skills have ids of the form `skill_<key>`, such as `skill_sf-report`.
427
+ An agent gets one only when its skills list names it: `skillIds` on the agent, or `Skill.fromId` in the kit.
428
+ Not released yet: managed skills that a new agent's list carries by default (`includeManagedSkills`).
429
+
413
430
  **How it relates.** An agent version records which skills an agent uses, not their text (section 3). Files also
414
431
  carry work between agents.
415
432
 
416
- **In the starter.** No skills are declared yet. The Manager Agent uploads each git bundle as a file, and the
417
- Engineer Agent answers with a patch file.
418
-
419
- ## 14. Credit and plan
420
-
421
- <!-- Sources, on develop at 19459f9ebb: docs/architecture/commercial-plans-and-credits.md:413-430 (two buckets:
422
- allowance resets monthly and floors at 0; purchased persists and may go negative; a burn draws allowance first),
423
- :95 (1 credit = $0.01), :157 (the starting grant goes to purchased), :221-240 (individual, scale, enterprise),
424
- :867-880 (balance and ledger reads); docs/architecture/model-gateway.md:32-40 (model use billed to credit). -->
433
+ **In the starter.** The Manager Agent uploads each git
434
+ bundle as a file, and the Engineer Agent answers with a patch file. The Bootstrap writes a codebase skill, and
435
+ commissioning adds it to the Engineer Agents.
425
436
 
426
- **What it's for.** Credit is one prepaid meter for everything the organization uses: machine time and model
427
- calls. The *plan* sets the price, the monthly allowance and the limits.
437
+ ## 14. Plan
428
438
 
429
- **What it is.** A credit is worth $0.01. An organization has two balances:
439
+ <!-- Sources, on develop at 0ddbb8568d: console/src/app/navSections.ts:149 (Settings › Plan & usage);
440
+ cli/docs/REFERENCE.md "Model traffic through the gateway" (no secrets or managed egress on the individual
441
+ plan). -->
430
442
 
431
- - *Allowance*: the plan's monthly credit. Use it or lose it: it resets each month and never goes below zero.
432
- - *Purchased*: credit bought, and a plan's one-time starting grant. It stays from month to month, and can go
433
- below zero.
443
+ The organization's *plan* sets its limits. There are three plans: `individual`, `scale` and `enterprise`. For
444
+ any plan question, send the person to **Settings › Plan & usage** in the console. Name no figure yourself.
434
445
 
435
- Use takes from the allowance first, then from purchased. There are three plans: `individual` (free to hold, no
436
- monthly allowance, a one-time 1,000-credit grant, one member), `scale` ($100 a month, which is 10,000 credits
437
- with five seats), and `enterprise` (quoted per customer).
438
-
439
- **How it relates.** Model calls through the gateway (section 7) and machine time (section 4) use credit. The
440
- organization's balance and its credit history, with the model of each charge, are on the organization.
446
+ **Cannot yet.** On the `individual` plan: store a secret, or add one at the network edge. An apply that
447
+ declares either stops with a plan error.
441
448
 
442
449
  ## 15. The factory as code
443
450
 
@@ -473,48 +480,81 @@ pipelines, workflows, triggers, skills, connections and projects.
473
480
  ## 16. How the CLI works
474
481
 
475
482
  <!-- Sources, on the kit's own branch: cli/src/cli/main.ts:60-160 (two jobs; nouns match API paths; standard
476
- verbs; --output json; --body @file.json; --file; values masked; approval defaults; orchestra api), cli/src/cli/core/
477
- auth.ts:1-45 (ORCHESTRA_API_TOKEN, then the login profile, then the machine's edge; default address
478
- api.orchestraworks.ai; ORCHESTRA_BASE_URL), cli/src/cli/core/profile.ts:39-52 (profiles in
479
- ~/.config/orchestra/config.json, "default"), cli/src/cli/core/invocation.ts:19 (--profile),
480
- cli/src/generated/cli-commands.json ("me get"). -->
483
+ verbs; --output json; --body @file.json; approval defaults; orchestra api), cli/src/cli/core/auth.ts:1-45
484
+ (ORCHESTRA_API_TOKEN, then the login profile, then the machine's edge; ORCHESTRA_BASE_URL),
485
+ cli/src/cli/core/profile.ts:39-52 (profiles in ~/.config/orchestra/config.json), cli/src/generated/cli-commands.json
486
+ (each command's answer), cli/src/cli/core/output.ts:94-113 and :143-145 (json prints the answer as it is),
487
+ cli/src/cli/core/errors.ts:287-296 and :366-370 (the json error, on stderr), cli/src/cli/core/login.ts:361-363 (a
488
+ pasted token keeps no refresh token); cli/docs/REFERENCE.md section 3 (one membership is selected for you). -->
481
489
 
482
490
  The `orchestra` command does two jobs. *Factory as code* (section 15) is where change happens. *Platform commands*
483
491
  read and probe what exists: observe with commands, change in code.
484
492
 
485
- - **Nouns and verbs.** `orchestra <noun> <verb>`. Nouns match the API's paths: `agents`, `work-items`, `sessions`,
486
- `gateway-keys`, `organization-memberships` and more. The usual verbs are `list`, `get`, `create`, `update` and
487
- `delete`. Commands keep their own verb, such as `work-items assign`, `work-items move` and
488
- `sessions interrupt`. `orchestra sessions wait <session id>` waits for a turn to end. `orchestra <noun> --help` lists a noun's
489
- verbs and flags.
490
- - **Output.** `--output json` on every platform command. The default is a table for people.
491
- - **Input.** `--body @file.json` sends a full request body. `--file <path>` uploads bytes on `files create`.
492
- - **Values.** Key values in answers print masked.
493
- - **Approval.** A platform command asks first only for key values and access changes.
494
- `--require-approval never` skips the question, only after the person approved.
495
- - **Sign-in.** `orchestra auth login --org <organization>` signs in through the browser and saves a *profile* in
496
- `~/.config/orchestra/config.json`. `--no-browser` asks for an API token at a hidden prompt instead. `--profile
497
- <name>` picks another saved profile. It signs in to `https://api.orchestraworks.ai` unless `ORCHESTRA_BASE_URL` or `--base-url` says otherwise.
498
- - **Who am I.** `orchestra me get` shows the signed-in user, and `orchestra organizations list` the organization.
493
+ The full list of commands and flags is the CLI's own help: `orchestra --help`, `orchestra <noun> --help` and
494
+ `orchestra <noun> <verb> --help`. The kit's reference, `docs/REFERENCE.md` in the installed package, explains
495
+ each part at length. What follows is only what a reader needs to run a command safely.
496
+
497
+ - **Nouns and verbs.** `orchestra <noun> <verb>`. Nouns match the API's paths, such as `agents`, `work-items`
498
+ and `sessions`. The usual verbs are `list`, `get`, `create`, `update` and `delete`; a command keeps its own
499
+ verb, such as `work-items assign`. `orchestra sessions wait <session id>` waits for a turn to end.
500
+ - **Output.** `--output json` prints the API's answer as it is on stdout, with key values masked. Read the field
501
+ you need from its place:
502
+ - A list answers a page: `{"data":[…],"page":1,"limit":20,"total":42}`. The rows are in `data`.
503
+ - `get`, `update` and most `create` verbs answer the resource itself.
504
+ - `sessions start` answers `{"session":{…},"firstItem":{…}}`, so the session id is `.session.id`.
505
+ - A create that shows a key once answers the resource beside the key, such as `gateway-keys create`,
506
+ `{"gatewayKey":{…},"token":"…"}`.
507
+ - An error prints `{"status":404,"message":"…"}` on stderr, and the command exits non-zero.
508
+ - **Approval.** A platform command asks first only for key values and access changes. `--require-approval
509
+ never` skips the question, only after the person approved.
510
+ - **Sign-in.** `orchestra auth login` signs in through the browser and saves a *profile* in
511
+ `~/.config/orchestra/config.json`. It selects the person's organization when they have one; with several,
512
+ name it: `orchestra auth login --org <organization>`. The browser sign-in renews itself. A token typed at the
513
+ `--no-browser` prompt cannot renew itself, so it suits a short run only.
499
514
  - **Scripts.** `ORCHESTRA_API_TOKEN` and `ORCHESTRA_BASE_URL` in the shell are used before the profile. On an
500
515
  Orchestra machine, the network edge signs the agent's calls, so it needs no token.
501
516
  - **Fallback.** `orchestra api <METHOD> </path>` makes a raw call when a typed command is missing.
502
517
 
518
+ A first look at an organization, in the order a new reader runs it:
519
+
520
+ ```bash
521
+ orchestra auth login --org <organization>
522
+ orchestra me get
523
+ orchestra agents list --output json
524
+ orchestra work-items list --output json
525
+ orchestra sessions wait <session id>
526
+ orchestra api GET /agents
527
+ ```
528
+
503
529
  **Writes outside the code.** A write command on something the code declares warns: the next apply sets it back.
504
530
 
505
531
  ## 17. Connections
506
532
 
507
- <!-- Sources, on develop at 19459f9ebb: cli/src/generated/providers.json (bitbucket, jira, jira-classic);
508
- docs/architecture/integrations.md:240, 275. -->
533
+ <!-- Sources, on develop at 0ddbb8568d: cli/src/generated/providers.json (fourteen providers and their authModes);
534
+ docs/architecture/integrations.md:240, 275; cli/docs/REFERENCE.md section 7, "Connections, triggers, and
535
+ workflows", "Bring your own OAuth app", "Per-user OAuth grants" and "Chat presence". -->
509
536
 
510
537
  A *connection* is an app the customer approves in the browser, instead of a personal token. It brings provider
511
- events to the platform and can add its credential at the network edge.
538
+ events to the platform and can add its credential at the network edge. These providers have one:
512
539
 
513
- - Bitbucket: the connection type exists, with OAuth, a stored token, or a webhook secret, and it receives every
514
- Bitbucket webhook event. Cannot yet: OAuth needs an OAuth consumer the organization registers first. Cannot
515
- yet: git over `bitbucket.org` through the connection; it adds its credential only on `api.bitbucket.org`, so
516
- git still needs the token rule.
517
- - Jira: a Jira Cloud app connection and a classic Jira connection exist, with issue events.
540
+ | Provider | Kind | How it signs in |
541
+ |---|---|---|
542
+ | GitHub | Code | GitHub App |
543
+ | GitLab, Bitbucket | Code | OAuth, a stored token, or a webhook secret |
544
+ | Azure DevOps | Code | OAuth or a stored token |
545
+ | Jira | Tracker | Jira Cloud app |
546
+ | Jira (classic), Linear | Tracker | OAuth, a stored token, or a webhook secret |
547
+ | Zendesk, Intercom | Customer support | OAuth, a stored token, or a webhook secret |
548
+ | Notion, Guru | Knowledge | OAuth, a stored token, or a webhook secret |
549
+ | Slack, Microsoft Teams | Chat | OAuth |
550
+ | Generic webhook | Any sender | A webhook secret |
551
+
552
+ How to declare one, its events and its network rules, the team's own OAuth app, per-person grants and chat:
553
+ the kit's reference, `docs/REFERENCE.md`, section 7, "Connections, triggers, and workflows".
554
+
555
+ - Cannot yet: Bitbucket OAuth without an OAuth consumer the organization registers first.
556
+ - Cannot yet: git over `bitbucket.org` through the Bitbucket connection. It adds its credential only on
557
+ `api.bitbucket.org`, so git still needs the token rule.
518
558
  - In the starter: none. For the first run, personal tokens are enough. Connections and listeners come later.
519
559
 
520
560
  ## 18. The team's own machines and network
@@ -568,8 +608,9 @@ What an agent knows lives in one of five places. Put each thing in its place.
568
608
 
569
609
  - **Agent instructions.** The agent's role, its limits, when to ask a person, and how to report. Change them
570
610
  rarely. Each change makes a new agent version.
571
- - **Platform skills.** Ours, the same for every customer: how to work on the Orchestra platform. They are
572
- attached to every agent. The customer's agents never edit them.
611
+ - **Platform skills.** Ours, the same for every customer, such as how to work on the Orchestra platform. An
612
+ agent uses one only when its skills list names it by id (section 13). The customer's agents never edit
613
+ them.
573
614
  - **Codebase skills.** How this codebase builds, tests and is reviewed. They live in the customer's repository,
574
615
  in `AGENTS.md` and `.agents/skills/`, change with the code, and are reviewed by their team. During a pilot they
575
616
  start as a skill in Orchestra, and the Manager Agent hands them over as a pull request.