@byokit/openclaw 0.16.3 → 0.16.4
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 +4 -0
- package/README.md +1 -1
- package/dist/engine.d.ts +2 -0
- package/dist/engine.js +12 -2
- package/dist/kit.js +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -387,7 +387,7 @@ streams, [`examples/openclaw-kit`](../../examples/openclaw-kit) for a whole app,
|
|
|
387
387
|
|
|
388
388
|
Subscription sign-ins are offered by default. API-billed routes remain in `kit.routes()` with `offer: false`;
|
|
389
389
|
apps can offer them when the app or person opts in, labelled API key (billed per use). Each `Route` carries `billing` (`subscription`, `api` or
|
|
390
|
-
`local`) so the app can label what is billed. Proxy routes, compatibility aliases, local runtimes stay off. Native Claude Code sign-in is offered by default. The
|
|
390
|
+
`local`) so the app can label what is billed. Proxy routes, compatibility aliases, local runtimes stay off. Native Claude Code sign-in is offered by default. The kit re-checks the installed Claude login at each setup detection and, once it is signed in, restarts the engine onto it. A plan key (OpenCode Go: `kit.addAccount(member, { authChoice: 'opencode-go' }, on)`) asks for `Plan key`; `paste` it and the engine live-tests it before `done`. A paired device starts the same sign-in with either `via` and pastes the key over the sealed link, which keeps it on the host. A run reaches the pinned engine's static Go models (default `opencode-go/deepseek-v4-pro`); the kit keeps OpenCode Go's `x-opencode-session` header on every request, the setup probe included. A live-only Go model such as Muse needs no app config: the kit registers the plan's live catalog with each model's API, so `run({ model: 'opencode-go/muse-spark-1.3-contributor' })` runs on the account (or with `auth: 'apiKey'` on a Go key); an app that sets `config.models.providers['opencode-go'].models` keeps its own list. A choice the pinned Gateway cannot set up has readiness `no_upstream_flow` and is never offered. Pass the accounts the app offers in `KitOptions.offered` (the provider, auth choice or alias each route carries, e.g. `'openrouter'`); the kit allow-lists the plugin of every route those name, so an opted-in sign-in is not blocked. An app can still name a plugin directly in `config.plugins.allow`, and pass the route's `choice` explicitly to `kit.signIn()`.
|
|
391
391
|
Offered provider plugins are allowed by default alongside the app's plugin ids. A route whose provider plugin ships outside the engine (Z.AI's GLM Coding Plan, for one) has readiness `needs_plugin` until the app calls `await kit.installPlugin(route.needs.plugin)`: it installs that plugin into the kit's own engine at exactly the engine's version and pinned npm integrity, keeps it allowed across restarts, and rejects `PluginInstallError` (`code` `version` or `integrity`) with nothing installed on a mismatch. Discovery never installs.
|
|
392
392
|
|
|
393
393
|
## API at a glance
|
package/dist/engine.d.ts
CHANGED
|
@@ -70,6 +70,8 @@ export declare class Engine {
|
|
|
70
70
|
/** The engine's own shutdown signal; aborted by stop() and replaced by the next start(). */
|
|
71
71
|
get stopSignal(): AbortSignal;
|
|
72
72
|
private installedClaudeSignedOut;
|
|
73
|
+
/** Re-select the installed login on setup detection; only a confirmed login switches away from fallback. */
|
|
74
|
+
refreshInstalledClaudeLogin(): Promise<boolean>;
|
|
73
75
|
/** The fallback Claude sign-in for a machine whose installed Claude Code is signed out: it signs into the engine's folder. */
|
|
74
76
|
nativeClaudeLogin(): ReturnType<typeof remoteCliHost>;
|
|
75
77
|
/** Whether a fallback sign-in would write a folder this engine's gateway does not read: it started on the person's
|
package/dist/engine.js
CHANGED
|
@@ -207,7 +207,7 @@ export class Engine {
|
|
|
207
207
|
putOnce(join(this.root, 'npmrc'), ''); // engine npm runs read this empty config, never the person's ~/.npmrc
|
|
208
208
|
this.sweepAccountOrphans();
|
|
209
209
|
if (this.o.spawnEngine)
|
|
210
|
-
this.claudeFallback = await this.installedClaudeSignedOut();
|
|
210
|
+
this.claudeFallback = (await this.installedClaudeSignedOut()) ?? false;
|
|
211
211
|
try {
|
|
212
212
|
await this.authStore.prepare();
|
|
213
213
|
this.credentialsLocked = false;
|
|
@@ -376,9 +376,19 @@ export class Engine {
|
|
|
376
376
|
return resolve(true);
|
|
377
377
|
}
|
|
378
378
|
this.o.log?.(`claude: sign-in status unknown, using the person's own login location (${String(error?.message ?? 'unparseable output').slice(0, 200)})`);
|
|
379
|
-
resolve(
|
|
379
|
+
resolve(undefined);
|
|
380
380
|
}));
|
|
381
381
|
}
|
|
382
|
+
/** Re-select the installed login on setup detection; only a confirmed login switches away from fallback. */
|
|
383
|
+
async refreshInstalledClaudeLogin() {
|
|
384
|
+
if (!this.o.spawnEngine || !this.claudeFallback)
|
|
385
|
+
return false;
|
|
386
|
+
const signedOut = await this.installedClaudeSignedOut();
|
|
387
|
+
if (signedOut !== false)
|
|
388
|
+
return false;
|
|
389
|
+
this.claudeFallback = false;
|
|
390
|
+
return true;
|
|
391
|
+
}
|
|
382
392
|
/** The fallback Claude sign-in for a machine whose installed Claude Code is signed out: it signs into the engine's folder. */
|
|
383
393
|
nativeClaudeLogin() {
|
|
384
394
|
if (this.claudeLogin)
|
package/dist/kit.js
CHANGED
|
@@ -997,7 +997,13 @@ export class OpenClawKit {
|
|
|
997
997
|
const transport = this.transport;
|
|
998
998
|
if (!transport || this.current.phase !== 'ready')
|
|
999
999
|
return () => Promise.reject(new Error('gateway not ready'));
|
|
1000
|
-
return (method, params, options) => {
|
|
1000
|
+
return async (method, params, options) => {
|
|
1001
|
+
// The gateway's own restart is in-process (OPENCLAW_NO_RESPAWN) and keeps CLAUDE_CONFIG_DIR: a new engine process drops it.
|
|
1002
|
+
if (method === 'openclaw.setup.detect' && await this.engine.refreshInstalledClaudeLogin()) {
|
|
1003
|
+
await this.stop();
|
|
1004
|
+
await this.start();
|
|
1005
|
+
return this.request()(method, params, options);
|
|
1006
|
+
}
|
|
1001
1007
|
const changesAuth = /^(models\.authLogout|openclaw\.setup\.(auth\.start|activate)|wizard\.(next|cancel)|config\.(apply|patch|set)|agents\.(create|update|delete)|secrets\.(reload|store\.(set|delete))|byokit\.keys)$/.test(method);
|
|
1002
1008
|
if (!changesAuth || (method === 'byokit.keys' && params?.action === 'ready'))
|
|
1003
1009
|
return transport.request(method, params, options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byokit/openclaw",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.4",
|
|
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",
|