@beyondwork/wb-cli 0.1.44 → 0.1.46

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publisher": "beyondwork",
4
4
  "displayName": "Beyond Work",
5
5
  "description": "Tool for interacting with Beyond Work workblocks from VS Code and CLI.",
6
- "version": "0.1.44",
6
+ "version": "0.1.46",
7
7
  "vsce": {
8
8
  "baseContentUrl": "https://github.com/bwllaming/code/blob/HEAD/src/vscode/beyondwork",
9
9
  "baseImagesUrl": "https://github.com/bwllaming/code/raw/HEAD/src/vscode/beyondwork"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: bw-workblock
3
- description: Create or edit a Beyond Work workblock that lives on a tenant, from a coding agent session, with `wb-cli`. Use whenever the user asks to create, change, fix, extend, inspect, run or validate a workblock on a tenant, names a Studio URL (https://<tenant>/w/studio/detail/<id> or /w/studio/s/<id>) or a workblock id, wants a change pushed to a workblock version, or has several agents build one workblock and combine their work. Covers credentials, create/clone/checkout/pull/push, validation, unit tests, runs, version branches (which Studio calls versions), merging and resolving conflicts, publishing to another branch, and where the authoring knowledge (skills, docs) lands in the checkout.
3
+ description: Create or edit a Beyond Work workblock that lives on a tenant, from a coding agent session, with `wb-cli`. Use whenever the user asks to create, change, fix, extend, inspect, run or validate a workblock on a tenant, names a Studio URL (https://<tenant>/w/studio/detail/<id> or /w/studio/s/<id>), a Space URL (https://<tenant>/w/spaces/<space>) or a workblock id, wants a Space's menu changed or a workblock added to a Space, wants a change pushed to a workblock version, or has several agents build one workblock and combine their work. Covers credentials, create/clone/checkout/pull/push, validation, unit tests, runs, version branches (which Studio calls versions), merging and resolving conflicts, publishing to another branch, Spaces, and where the authoring knowledge (skills, docs) lands in the checkout.
4
4
  ---
5
5
 
6
6
  # bw-workblock
@@ -64,7 +64,9 @@ so that the user can deploy it from Studio.
64
64
  4. **Edit.** A test is an entry under the module's `tests:` (`name`, `type: pytest`) plus
65
65
  `<module>/tests/<name>.py`. A task's code reaches a test as a pytest fixture, not as a module to
66
66
  import: `def test_x(flag_gaps): assert flag_gaps.flag(...)` gets task "Flag Gaps", the parameter
67
- being the task name in lower case with spaces replaced by underscores. A new module, task or test
67
+ being the task name in lower case with spaces replaced by underscores. A test of TypeScript tasks
68
+ has `type: bun` and the file `<module>/tests/<name>.test.ts`. It imports `describe`, `test` and
69
+ `expect` from `bun:test`, and a task asset as `@tasks/<task folder>/main.ts`. A new module, task or test
68
70
  needs no `id` line, because wb-cli derives the id from its name. Never copy the `id` of another
69
71
  entry. A file no manifest entry claims is not pushed. Change only what the request asks for: no
70
72
  fixes to nearby tasks, no tidying of files you did not need to touch, and no tasks beyond the
@@ -104,21 +106,40 @@ so that the user can deploy it from Studio.
104
106
  a host it lists every tenant in `~/.config/beyondwork/credentials.json`, with the user each one
105
107
  belongs to and whether it is a sign-in or an API token. You never handle a credential: do not open the credentials file, source an
106
108
  environment file that holds one, ask for it, or put it in a command, because your transcript and the
107
- shell history are kept. When a tenant has no credential, or wb-cli reports that the sign-in expired
108
- or was revoked, ask the user to run `wb-cli login <host>` in their own terminal. `login` waits for a
109
- person to sign in in a browser, so do not run it yourself. On a tenant that no person signs in to,
110
- such as a devenv tenant, pipe an API token from a tool that already holds it into
111
- `wb-cli add-tenant <host>`, because the token then reaches neither your transcript nor a command
112
- line.
109
+ shell history are kept.
113
110
 
114
- ## Local Git and platform history
111
+ When the tenant has no credential, or wb-cli reports that the sign-in expired or was revoked, start
112
+ the sign-in at once. Do not ask the user first.
113
+
114
+ 1. Run `wb-cli login --no-browser <host>` in the background. It prints a sign-in link, then waits
115
+ five minutes for the user to click the link and sign in in their browser. `--no-browser` stops
116
+ `login` from opening a browser on this machine, so the user always signs in from the link.
117
+ 2. The user does not see the command's output. End your reply with the full link, and ask the user
118
+ only to click it. After the sign-in, the browser goes to the port in the link's `redirect_uri`
119
+ on this machine. If the user's browser runs on another machine, name that port: the user must
120
+ forward it.
121
+ 3. Continue the task when `login` returns with "Signed in to <host> as <user>".
122
+
123
+ On a tenant that no person signs in to, such as a devenv tenant, pipe an API token from a tool that
124
+ already holds it into `wb-cli add-tenant <host>`, because the token then reaches neither your
125
+ transcript nor a command line.
126
+
127
+ ## Git history
128
+
129
+ `wb-cli clone` and `wb-cli pull` bring the real commits of the branch into the checkout, with the
130
+ platform's commit IDs, authors, dates and messages. `git log`, `git log -p -- <path>`, `git blame` and
131
+ `git show` work as in any repository. Git shows a message that Studio stores beside a commit under
132
+ `Notes (wb-cli):` in `git log` and `git show`, not in `git blame`.
133
+
134
+ The newest commit is wb-cli's: it folds the platform's manifests into this checkout's one
135
+ `manifest.yaml`, so `git show HEAD` lists every manifest. For the history of a manifest, name its
136
+ platform path: `<module>/manifest.yaml` or `<module>/<task>/manifest.yaml`.
115
137
 
116
- wb-cli records local Git snapshots of the authoring files when it clones, pulls, merges, or pushes.
117
- These snapshots have their own commit IDs and history, separate from the platform's commits.
118
138
  `git status` lists local edits, including new files; `git diff HEAD` shows edits to tracked files.
119
- `git log -p` shows changes between local snapshots.
120
- Use `wb-cli log [<branch>]` for platform commit IDs and the messages that authors supplied.
121
- Local Git commit IDs cannot be used as platform commit references.
139
+ `wb-cli push` saves every edit as one platform commit with the message you give it, whether or not
140
+ you ran `git commit`. `git push` has no remote. A push adds wb-cli's own commits on top, and the next
141
+ `wb-cli pull` puts the checkout on the platform's commit. `wb-cli log <branch>` lists the commits of
142
+ another branch.
122
143
 
123
144
  ## Pushes and refusals
124
145
 
@@ -178,7 +199,27 @@ The building blocks:
178
199
  - **`main`.** Publish to the target version branch, then report its Studio URL and the checks you ran. The
179
200
  user deploys it from Studio; `wb-cli push --to main` is refused.
180
201
 
181
- ## Spaces and `wb-cli use`
202
+ ## Spaces
203
+
204
+ A Space is a team's menu on a tenant: a rail of groups, each holding entries. An entry shows one
205
+ module of a workblock. It holds `workblock_id`, `module_id`, a display `name`, and an optional `path`,
206
+ a route in the module's UI. `https://<tenant>/w/spaces/<slug-or-id>` opens a Space, and
207
+ `…/app/<module-id>` opens one of its entries.
208
+
209
+ `clone` and `branches` accept the link of an entry and print the workblock's Studio URL. `clone` checks
210
+ out the branch that the Space runs for you. Continue with the loop from there.
211
+
212
+ `wb-cli api list_spaces --tenant <host>` and `wb-cli api get_space '{"slug":"<slug-or-id>"}' --tenant
213
+ <host>` read Spaces. To change a Space, edit the object that `get_space` returns and send all of it to
214
+ `wb-cli api upsert_space - --tenant <host>`. This changes no workblock, so it needs no checkout and no
215
+ version branch. The rail orders groups and entries by `sort_order`, not by their place in the JSON.
216
+ An `icon` is a Lucide icon name.
217
+
218
+ To add a workblock, read `id` and `modules[].id` from its `manifest.yaml` after `wb-cli push`. Add
219
+ only modules that show something: a task UI, or the chat of an agent module. An entry shows a blank
220
+ "Workblock is not running" page when its module shows neither or is not on the branch that the Space
221
+ runs, so a new workblock stays blank in the Space until the user deploys it from Studio or you select
222
+ its version branch with `wb-cli use`, as the next paragraph describes. Report that.
182
223
 
183
224
  A Space module, like any run that you start outside a Studio workspace, runs the branch of the
184
225
  workblock that you chose with `wb-cli use`: `main` or a version branch. It is `main` until you
@@ -187,6 +228,11 @@ it with `wb-cli push --to <name>`, run `wb-cli use <name>` in the checkout, and
187
228
  choice applies only to you: each user makes their own, and a Space cannot name a version branch for
188
229
  a module. `wb-cli use` without a name prints your choice. Run `wb-cli use main` when you are done.
189
230
 
231
+ The `viewer` and `editor` relations of a Space give no access to its workblocks. To open an entry, a
232
+ person also needs start access to the workblock: `starter`, `editor` or `owner`, directly or through a
233
+ group. `permissions_grant` sets these relations. Grant only what the request asks for, and report who
234
+ still lacks access.
235
+
190
236
  ## Other platform requests
191
237
 
192
238
  `wb-cli api <verb> '<json>'` sends one request of the platform's WebSocket API as your user, for