@byokit/ui 0.8.0 → 0.9.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/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - Dependency update: pins @byokit/accounts 0.24.3.
6
+
7
+ ## 0.9.0 (2026-10-17)
8
+
9
+ - Dependency update: pins @byokit/accounts 0.24.2.
10
+
11
+ - FEAT: The key card has a `workspace` state (`result: 'workspace'`, words "This key works for more than one
12
+ workspace. Pick the one to use."), so an app shows the workspace pick for a plan key that acts for several
13
+ workspaces (OpenCode Go) and submits again with the one picked.
14
+
5
15
  - Dependency update: pins @byokit/accounts 0.24.1.
6
16
 
7
17
  ## 0.8.0 (2026-10-16)
package/README.md CHANGED
@@ -208,7 +208,9 @@ const options = signInFor(view, { read: (row) => api.account(row.id), start: (ro
208
208
  ```
209
209
 
210
210
  A key route's `chosen.key` is the existing `keyView` card, labelled for its billing ("Key from your plan" or "Key
211
- (charged per use)"); submit the input straight to the kit and dispatch only `{ type: 'result', result }`.
211
+ (charged per use)"); submit the input straight to the kit and dispatch only `{ type: 'result', result }`. A key
212
+ that acts for several workspaces (`@byokit/accounts` `add` answers `workspaces`) dispatches `result: 'workspace'`:
213
+ list those workspaces, then `submit` again with the one picked.
212
214
  `useConnect({ routes, read, start?, cancel })` holds the step in React and returns the view with `pick`, `back`,
213
215
  `act` and `signIn`, the options to pass to `useSignIn` in a sheet keyed by `chosen.row.key`.
214
216
 
@@ -363,7 +365,7 @@ with the device client made once (`useMemo(() => herdrDevice(link), [link])`).
363
365
  Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](../../NOTICE).
364
366
 
365
367
  `@byokit/ui/kits` also exports `keyStep(state, action)` and `keyView(state, words)` for an explicit
366
- **API key (billed per use)** entry card. States are `entry`, `checking`, `ok`, `invalid`, `not_included`;
368
+ **API key (billed per use)** entry card. States are `entry`, `checking`, `workspace`, `ok`, `invalid`, `not_included`;
367
369
  actions are `submit`, `edit`, and `result` with the kit's add-key outcome. Supply the OpenClaw kit's `words`
368
370
  function for the label and sentences. These views never contain the entered key; submit it directly to the host
369
371
  and clear the input afterwards.
package/dist/key.d.ts CHANGED
@@ -1,14 +1,16 @@
1
- /** A key-entry card never holds a credential: the host submits the input directly to kit.addKey. */
2
- export type KeyState = 'entry' | 'checking' | 'ok' | 'invalid' | 'not_included';
1
+ /** A key-entry card never holds a credential: the host submits the input directly to kit.addKey.
2
+ * `workspace`: the key acts for several workspaces and nothing is saved yet; the host lists the kit's workspaces
3
+ * and submits again with the one picked. */
4
+ export type KeyState = 'entry' | 'checking' | 'workspace' | 'ok' | 'invalid' | 'not_included';
3
5
  export type KeyAction = {
4
6
  type: 'submit';
5
7
  } | {
6
8
  type: 'edit';
7
9
  } | {
8
10
  type: 'result';
9
- result: 'ok' | 'invalid' | 'not_included';
11
+ result: 'workspace' | 'ok' | 'invalid' | 'not_included';
10
12
  };
11
- export type KeyWords = (key: 'key.label' | 'key.entry' | 'key.checking' | 'key.ok' | 'key.invalid' | 'key.notIncluded') => string;
13
+ export type KeyWords = (key: 'key.label' | 'key.entry' | 'key.checking' | 'key.workspace' | 'key.ok' | 'key.invalid' | 'key.notIncluded') => string;
12
14
  export declare function keyStep(state: KeyState, action: KeyAction): KeyState;
13
15
  export declare function keyView(state: KeyState, words: KeyWords): {
14
16
  state: KeyState;
package/dist/key.js CHANGED
@@ -6,7 +6,7 @@ export function keyStep(state, action) {
6
6
  return state === 'checking' ? action.result : state;
7
7
  }
8
8
  export function keyView(state, words) {
9
- const keys = { entry: 'key.entry', checking: 'key.checking', ok: 'key.ok', invalid: 'key.invalid', not_included: 'key.notIncluded' };
9
+ const keys = { entry: 'key.entry', checking: 'key.checking', workspace: 'key.workspace', ok: 'key.ok', invalid: 'key.invalid', not_included: 'key.notIncluded' };
10
10
  return { state, label: words('key.label'), message: words(keys[state]), busy: state === 'checking',
11
11
  editable: state === 'entry' || state === 'invalid' };
12
12
  }
package/dist/words.json CHANGED
@@ -42,6 +42,7 @@
42
42
  "key.label.other": "Key",
43
43
  "key.entry": "Paste your key. It stays on this device.",
44
44
  "key.checking": "Checking your key…",
45
+ "key.workspace": "This key works for more than one workspace. Pick the one to use.",
45
46
  "key.ok": "Your key is ready. It is used only when you choose this option.",
46
47
  "key.invalid": "This key could not be saved. Check it and try again.",
47
48
  "key.notIncluded": "This option is not available here.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byokit/ui",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Headless sign-in, pairing and runtime-kit view state for any UI, plus plain-words copy.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -62,7 +62,7 @@
62
62
  }
63
63
  },
64
64
  "devDependencies": {
65
- "@byokit/accounts": "0.24.1",
65
+ "@byokit/accounts": "0.24.3",
66
66
  "@types/react": "^19.3.0",
67
67
  "@types/react-test-renderer": "^19.3.0",
68
68
  "react": "^19.3.0",