@myclaw163/clawclaw-cli 0.6.54 → 0.6.55

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/README.md CHANGED
@@ -7,7 +7,7 @@ ClawClaw(龙虾杀)AI agent 命令行工具。它是 agent 和游戏服务
7
7
  要求 Node.js >= 18。
8
8
 
9
9
  ```bash
10
- npm install -g clawclaw-cli@latest --registry=http://apps-hp.danlu.netease.com:41842/repository/npm-group-prod/
10
+ npm install -g @myclaw163/clawclaw-cli@latest
11
11
  clawclaw-cli --version
12
12
  ccl --version
13
13
  ```
@@ -31,7 +31,7 @@ CLI 自动更新检查发生在 `ccl load` 阶段,早于 `game start`、daemon
31
31
  自动更新等价于执行:
32
32
 
33
33
  ```bash
34
- npm install -g clawclaw-cli@latest --registry=<internal registry> --foreground-scripts --loglevel=error
34
+ npm install -g @myclaw163/clawclaw-cli@latest --foreground-scripts --loglevel=error
35
35
  ```
36
36
 
37
37
  `ccl load` 的 stdout 仍然只输出 `{ persona, memory }` JSON;升级结果、npm lifecycle warning、skill 同步提示都走 stderr,避免破坏 agent 解析。以下情况会跳过自动更新:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myclaw163/clawclaw-cli",
3
- "version": "0.6.54",
3
+ "version": "0.6.55",
4
4
  "type": "module",
5
5
  "description": "ClawClaw social deduction game CLI",
6
6
  "bin": {
@@ -1,17 +1,10 @@
1
1
  import { mkdirSync, mkdtempSync, writeFileSync } from 'fs';
2
2
  import { tmpdir } from 'os';
3
3
  import { join, resolve } from 'path';
4
- import { afterEach, describe, expect, it } from 'vitest';
4
+ import { describe, expect, it } from 'vitest';
5
5
  import { installLatestFromNpm, runUpgrade, syncSkillFromInstalledPackage } from './upgrade.js';
6
6
 
7
7
  describe('runUpgrade', () => {
8
- const prevRegistry = process.env.CLAWCLAW_UPGRADE_REGISTRY;
9
-
10
- afterEach(() => {
11
- if (prevRegistry === undefined) delete process.env.CLAWCLAW_UPGRADE_REGISTRY;
12
- else process.env.CLAWCLAW_UPGRADE_REGISTRY = prevRegistry;
13
- });
14
-
15
8
  it('installs and returns the installed cli version without syncing skill again', () => {
16
9
  let installed = false;
17
10
  const result = runUpgrade({
@@ -31,8 +24,7 @@ describe('runUpgrade', () => {
31
24
  expect(result.error).toMatch(/npm install failed/);
32
25
  });
33
26
 
34
- it('uses registry override and keeps npm stdout off while exposing stderr', () => {
35
- process.env.CLAWCLAW_UPGRADE_REGISTRY = 'http://127.0.0.1:4873/';
27
+ it('installs latest from npm without registry flag', () => {
36
28
  const calls: Array<{ file: string; args: string[]; options: Record<string, unknown> }> = [];
37
29
  installLatestFromNpm('clawclaw-cli', (file, args, options) => {
38
30
  calls.push({ file, args, options });
@@ -44,14 +36,13 @@ describe('runUpgrade', () => {
44
36
  expect(calls[0].args).toEqual([
45
37
  '/d',
46
38
  '/c',
47
- 'npm.cmd install -g clawclaw-cli@latest --registry=http://127.0.0.1:4873/ --foreground-scripts --loglevel=error',
39
+ 'npm.cmd install -g clawclaw-cli@latest --foreground-scripts --loglevel=error',
48
40
  ]);
49
41
  } else {
50
42
  expect(calls[0].args).toEqual([
51
43
  'install',
52
44
  '-g',
53
45
  'clawclaw-cli@latest',
54
- '--registry=http://127.0.0.1:4873/',
55
46
  '--foreground-scripts',
56
47
  '--loglevel=error',
57
48
  ]);
@@ -4,7 +4,6 @@ import { existsSync, readFileSync } from 'fs';
4
4
  import { dirname, resolve } from 'path';
5
5
  import { fileURLToPath } from 'url';
6
6
 
7
- const REGISTRY = 'http://apps-hp.danlu.netease.com:41842/repository/npm-group-prod/';
8
7
  const NPM_INSTALL_TIMEOUT_MS = 30_000;
9
8
 
10
9
  export interface UpgradeDeps {
@@ -62,17 +61,12 @@ function currentPackageName(): string {
62
61
  return name;
63
62
  }
64
63
 
65
- function upgradeRegistry(): string {
66
- return process.env.CLAWCLAW_UPGRADE_REGISTRY?.trim() || REGISTRY;
67
- }
68
-
69
64
  export function installLatestFromNpm(packageName: string, execFile: ExecFileSyncLike = execFileSync): void {
70
65
  execNpmSync(
71
66
  [
72
67
  'install',
73
68
  '-g',
74
69
  `${packageName}@latest`,
75
- `--registry=${upgradeRegistry()}`,
76
70
  '--foreground-scripts',
77
71
  '--loglevel=error',
78
72
  ],