coze_lab 0.1.32 → 0.1.33

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 (2) hide show
  1. package/index.js +14 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -5522,7 +5522,7 @@ function writeOpenClawHook(token, workspaceId, agentId, cloud) {
5522
5522
  if (isOpenClawAlreadyInjected(configPath, pluginDir, token, workspaceId, agentId, cloud)) {
5523
5523
  ok(`OpenClaw plugin already configured in ${configPath}`);
5524
5524
  info('OpenClaw gateway restart skipped (configuration unchanged).');
5525
- return { configPath, pluginDir, unchanged: true };
5525
+ return { configPath, pluginDir, unchanged: true, gatewayRestarted: false, gatewayRestartSkipped: true };
5526
5526
  }
5527
5527
 
5528
5528
  // 1. Write plugin files to ~/.cozeloop/openclaw-plugin/
@@ -5591,11 +5591,11 @@ function writeOpenClawHook(token, workspaceId, agentId, cloud) {
5591
5591
  info('Restarting OpenClaw gateway to apply hook changes...');
5592
5592
  execSync('openclaw gateway restart', { stdio: 'pipe' });
5593
5593
  ok('OpenClaw gateway restarted');
5594
+ return { configPath, pluginDir, gatewayRestarted: true };
5594
5595
  } catch (e) {
5595
5596
  warn(`gateway restart 失败,请手动执行: openclaw gateway restart(${e.message})`);
5597
+ return { configPath, pluginDir, gatewayRestarted: false, gatewayRestartError: e.message };
5596
5598
  }
5597
-
5598
- return { configPath, pluginDir };
5599
5599
  }
5600
5600
 
5601
5601
  // ─── 8. Auth — Device Code OAuth + token store ───────────────────────────────
@@ -6239,9 +6239,18 @@ function authStatus() {
6239
6239
  const NEXT_STEP = {
6240
6240
  'claude-code': 'Hook 已写入。Claude Code 会自动热重载 hooks,当前会话即刻生效,无需 /new 或重启。',
6241
6241
  'codex': 'Hook 已写入。Codex 在会话启动时加载 hook,当前会话不会即时生效;请重开 Codex 会话(已配置 SessionStart hook,新会话自动加载)。',
6242
- 'openclaw': 'OpenClaw gateway 已自动重启,trace 即刻生效。',
6243
6242
  };
6244
6243
 
6244
+ function openClawNextStep(written) {
6245
+ if (written?.gatewayRestarted) {
6246
+ return 'OpenClaw gateway 已自动重启,trace 即刻生效。';
6247
+ }
6248
+ if (written?.gatewayRestartSkipped) {
6249
+ return 'OpenClaw 配置未变化,gateway restart 已跳过。';
6250
+ }
6251
+ return 'OpenClaw gateway 未能自动重启;请手动执行 openclaw gateway restart 后生效。';
6252
+ }
6253
+
6245
6254
  async function main() {
6246
6255
  console.log('');
6247
6256
  info(`CozeLoop Onboard CLI starting... (coze_lab v${PACKAGE_VERSION})`);
@@ -6440,7 +6449,7 @@ async function main() {
6440
6449
  summaryLines.push(`Config: ~/.openclaw/openclaw.json`);
6441
6450
  }
6442
6451
  summaryLines.push('');
6443
- summaryLines.push(NEXT_STEP[agent]);
6452
+ summaryLines.push(agent === 'openclaw' ? openClawNextStep(written) : NEXT_STEP[agent]);
6444
6453
 
6445
6454
  // Enterprise policy note for Claude Code
6446
6455
  if (agent === 'claude-code') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coze_lab",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "Configure local AI agents (Claude Code, Codex, OpenClaw) to report traces to CozeLoop",
5
5
  "keywords": [
6
6
  "cozeloop",