@byokit/openclaw 0.15.1 → 0.16.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.16.1 (2026-10-17)
6
+
7
+ - Dependency update: pins @byokit/accounts 0.27.0.
8
+
9
+ ## 0.16.0 (2026-10-17)
10
+
11
+ - Dependency update: pins @byokit/accounts 0.26.0.
12
+
13
+ - FEAT: `addKey` on `opencode-go` says why a Go workspace listing could not be read. A `retry` `network` result now carries the optional `code` (`workspaces_unread`) and `message` (the accounts words to show), so the app can tell the user to check the connection instead of guessing. Other results are unchanged.
14
+
5
15
  ## 0.15.1 (2026-10-17)
6
16
 
7
17
  - Dependency update: pins @byokit/relay 0.8.1.
package/README.md CHANGED
@@ -162,8 +162,8 @@ An OpenCode Go plan login can act for several workspaces, and the Go gateway ref
162
162
  `x-opencode-org-id`. Without `orgId` the add lists the key's workspaces first (the console listing `@byokit/accounts` uses):
163
163
  one is used unasked; several resolve `{ status: 'needs_workspace', workspaces: [{ id, name }] }` with nothing saved, so show
164
164
  the pick (the names) and add again with `orgId: '<picked id>'`; a key the console refuses (a workspace-bound service key) adds
165
- with no workspace. A listing that could not be read (offline, a server error) resolves `{ status: 'retry', reason: 'network' }`
166
- and changes nothing. Workspace ids are row ids, never secrets. Another route refuses an `orgId` with `not_included`/`model`.
165
+ with no workspace. A listing that could not be read (offline, a server error) resolves `{ status: 'retry', reason: 'network', code: 'workspaces_unread', message }`
166
+ and changes nothing. The optional `code` and `message` on `retry` are set only for that typed listing failure; `message` is the words to show the user (never provider text). Workspace ids are row ids, never secrets. Another route refuses an `orgId` with `not_included`/`model`.
167
167
  A member that is not your own throws. `retry` means the engine may have taken the key but it was not kept
168
168
  sealed (for example a gateway restart ran late); no usable key was kept, so add it again. Failures never contain keys, key fragments, headers or raw engine diagnostics. Label the option **API key (billed per use)**. Select only `routes()` rows with
169
169
  `keyEntry: true`; API rows remain `offer: false`. Each route also carries its engine `revision`, `checked` date,
package/dist/keys.d.ts CHANGED
@@ -3,12 +3,18 @@ import type { RouteView } from './routes.ts';
3
3
  import type { Member, ModelInfo } from './types.ts';
4
4
  export type KeyFailureReason = 'auth' | 'billing' | 'empty' | 'model' | 'network' | 'engine' | 'inference' | 'busy';
5
5
  /** `needs_workspace`: the Go plan login acts for several workspaces (console orgs); show the pick and add again with
6
- * its `orgId`. Nothing was saved or sent to the engine. Ids are row ids, never secrets. */
6
+ * its `orgId`. Nothing was saved or sent to the engine. Ids are row ids, never secrets. `retry`'s `code` and `message`
7
+ * are set only for a typed `@byokit/accounts` listing failure (`workspaces_unread`); `message` is the words to show. */
7
8
  export type AddKeyResult = {
8
9
  status: 'ok';
9
10
  } | {
10
- status: 'invalid' | 'not_included' | 'retry';
11
+ status: 'invalid' | 'not_included';
11
12
  reason: KeyFailureReason;
13
+ } | {
14
+ status: 'retry';
15
+ reason: KeyFailureReason;
16
+ code?: string;
17
+ message?: string;
12
18
  } | {
13
19
  status: 'needs_workspace';
14
20
  workspaces: {
package/dist/keys.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { join } from 'node:path';
2
+ import { KeyRouteError } from '@byokit/accounts';
2
3
  import { openCodeWorkspaces } from '@byokit/accounts/opencode-go';
3
4
  import { activate } from './activation.js';
4
5
  import { keyAgentId, MEMBER_ID, KEY_PREFIX, untilListed } from './members.js';
@@ -104,8 +105,12 @@ export function createKeys(ctx) {
104
105
  try {
105
106
  workspaces = await openCodeWorkspaces(o.apiKey, (input, init) => fetch(input, { ...init, signal: init?.signal ? AbortSignal.any([init.signal, ac.signal]) : ac.signal }));
106
107
  }
107
- catch { // `workspaces_unread`: offline, timeout, a server error or a body that is no list
108
- return ac.signal.aborted ? failure('retry', 'busy') : failure('retry', 'network');
108
+ catch (error) { // `workspaces_unread`: offline, timeout, a server error or a body that is no list
109
+ if (ac.signal.aborted)
110
+ return failure('retry', 'busy');
111
+ if (!(error instanceof KeyRouteError))
112
+ return failure('retry', 'network');
113
+ return { status: 'retry', reason: 'network', code: error.code, message: error.message };
109
114
  }
110
115
  if (ac.signal.aborted)
111
116
  return failure('retry', 'busy');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byokit/openclaw",
3
- "version": "0.15.1",
3
+ "version": "0.16.1",
4
4
  "description": "The OpenClaw runtime kit: the pinned engine's full operator surface with plain-words helpers for members, sign-in, runs and approvals.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -60,7 +60,7 @@
60
60
  "prepack": "tsc -b && node ../../scripts/fix-words-dts.cjs"
61
61
  },
62
62
  "dependencies": {
63
- "@byokit/accounts": "0.25.1",
63
+ "@byokit/accounts": "0.27.0",
64
64
  "@byokit/pair": "0.10.3",
65
65
  "@byokit/relay": "0.8.1",
66
66
  "@byokit/discover": "0.8.4",