coze_lab 0.1.33 → 0.1.34

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 +6 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -5505,7 +5505,7 @@ function isOpenClawAlreadyInjected(configPath, pluginDir, token, workspaceId, ag
5505
5505
  return JSON.stringify(existing) === JSON.stringify(desired);
5506
5506
  }
5507
5507
 
5508
- function writeOpenClawHook(token, workspaceId, agentId, cloud) {
5508
+ function writeOpenClawHook(token, workspaceId, agentId, cloud, force) {
5509
5509
  const home = resolveHomeDir(cloud);
5510
5510
  const configPath = path.join(home, '.openclaw', 'openclaw.json');
5511
5511
  const pluginDir = path.join(home, '.cozeloop', 'openclaw-plugin');
@@ -5519,11 +5519,14 @@ function writeOpenClawHook(token, workspaceId, agentId, cloud) {
5519
5519
  ]);
5520
5520
  }
5521
5521
 
5522
- if (isOpenClawAlreadyInjected(configPath, pluginDir, token, workspaceId, agentId, cloud)) {
5522
+ if (!force && 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
5525
  return { configPath, pluginDir, unchanged: true, gatewayRestarted: false, gatewayRestartSkipped: true };
5526
5526
  }
5527
+ if (force) {
5528
+ info('OpenClaw force mode enabled; rewriting plugin files and reinstalling.');
5529
+ }
5527
5530
 
5528
5531
  // 1. Write plugin files to ~/.cozeloop/openclaw-plugin/
5529
5532
  ensureDir(pluginDir);
@@ -6424,7 +6427,7 @@ async function main() {
6424
6427
  written = writeCodexHook(token, WORKSPACE_ID, pythonCmd, codexHome, args.cloud);
6425
6428
  } else {
6426
6429
  // openclaw:云端用 traceAgentIds allowlist 做 per-agent 放行。
6427
- written = writeOpenClawHook(token, WORKSPACE_ID, args.agentId, args.cloud) || {};
6430
+ written = writeOpenClawHook(token, WORKSPACE_ID, args.agentId, args.cloud, args.force) || {};
6428
6431
  }
6429
6432
  // 走到这里说明 detectAgent / 环境检查 / 写 hook 配置全部成功 → 注入成功。
6430
6433
  cloudResult.inject = 'ok';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coze_lab",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "description": "Configure local AI agents (Claude Code, Codex, OpenClaw) to report traces to CozeLoop",
5
5
  "keywords": [
6
6
  "cozeloop",