@aswless_854771076/ai_short_studio_cli 0.1.0 → 0.1.2

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
@@ -3,7 +3,7 @@
3
3
  VVICAT 新链路无限画布的官方命令行客户端。要求 Node.js 22 或更高版本。
4
4
 
5
5
  ```bash
6
- npm install --global @vvicat/ai_short_studio_cli
6
+ npm install --global @aswless_854771076/ai_short_studio_cli
7
7
  ai-short-studio auth login --google \
8
8
  --base-url https://vvicat.example.com \
9
9
  --supabase-url https://your-project.supabase.co \
@@ -42,7 +42,7 @@ CLI 直接使用现有 `/api/projects`、`/api/canvas/node-types`、项目画布
42
42
 
43
43
  退出码:`0` 成功,`3` 未认证,`4` 不存在,`5` 禁止或冲突,`6` 参数错误,`7` 其他错误。
44
44
 
45
- 配套 Agent Skill 位于 `skills/using-vvicat-cli`,随 npm 包发布。
45
+ 配套 Agent Skill 位于 `skills/using-vvicat-cli`,随 npm 包发布。安装或更新 CLI 时会自动安装到 Codex Skill 目录;已被用户修改或非 CLI 托管的目录不会被覆盖。
46
46
 
47
47
  ```bash
48
48
  ai-short-studio skill install --target codex
@@ -50,7 +50,7 @@ ai-short-studio skill status --target codex
50
50
  ai-short-studio skill update --target codex
51
51
  ```
52
52
 
53
- 也可使用 `--target agents` 或 `--directory <path>`。CLI 会记录版本和 SHA-256;已安装 Skill 被用户修改后,更新默认停止,只有显式 `--force` 才覆盖。
53
+ 手动恢复或安装到其他 Agent 时,可使用 `--target agents` 或 `--directory <path>`。CLI 会记录版本和 SHA-256;已安装 Skill 被用户修改后,更新默认停止,只有显式 `--force` 才覆盖。自动安装可通过 `VVICAT_SKIP_SKILL_INSTALL=1` 跳过。
54
54
 
55
55
  ## 发布
56
56
 
@@ -66,6 +66,8 @@ npm run release
66
66
 
67
67
  Token 只从环境变量读取,不要放入参数、Git 或日志。
68
68
 
69
+ 未显式传入 `--version` 时,发布脚本会从包清单版本开始查询 npm,并自动选择第一个未占用的 patch 版本;例如 `0.1.1` 已存在时发布 `0.1.2`。显式传入 `--version` 时严格使用指定版本,版本已存在则幂等跳过。
70
+
69
71
  Docker 自动发布使用 `.env` 中的 `NPM_PUBLISH_PACKAGE_NAME` 选择目标;当前默认个人包为 `@aswless_854771076/ai_short_studio_cli`,获得组织权限后可改为 `@vvicat/ai_short_studio_cli`。`latest` 不会自动升级已安装的全局 CLI,手动更新使用:
70
72
 
71
73
  ```bash
@@ -22,3 +22,31 @@ export declare function installSkill(input: {
22
22
  installedVersion: string | null;
23
23
  modified: boolean;
24
24
  }>;
25
+ export declare function autoInstallSkill(target: string): Promise<{
26
+ target: string;
27
+ installed: boolean;
28
+ managed: boolean;
29
+ current: boolean;
30
+ packageVersion: string;
31
+ installedVersion: string | null;
32
+ modified: boolean;
33
+ action: "unchanged";
34
+ } | {
35
+ target: string;
36
+ installed: boolean;
37
+ managed: boolean;
38
+ current: boolean;
39
+ packageVersion: string;
40
+ installedVersion: string | null;
41
+ modified: boolean;
42
+ action: "skipped";
43
+ } | {
44
+ target: string;
45
+ installed: boolean;
46
+ managed: boolean;
47
+ current: boolean;
48
+ packageVersion: string;
49
+ installedVersion: string | null;
50
+ modified: boolean;
51
+ action: "updated" | "installed";
52
+ }>;
@@ -60,6 +60,14 @@ export async function installSkill(input) {
60
60
  }
61
61
  return skillStatus(input.target);
62
62
  }
63
+ export async function autoInstallSkill(target) {
64
+ const current = await skillStatus(target);
65
+ if (current.current)
66
+ return { action: 'unchanged', ...current };
67
+ if (current.installed && (!current.managed || current.modified))
68
+ return { action: 'skipped', ...current };
69
+ return { action: current.installed ? 'updated' : 'installed', ...await installSkill({ target }) };
70
+ }
63
71
  async function directoryChecksum(root) {
64
72
  const files = await filesBelow(root);
65
73
  const hash = createHash('sha256');
package/package.json CHANGED
@@ -1,16 +1,15 @@
1
1
  {
2
2
  "name": "@aswless_854771076/ai_short_studio_cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "VVICAT 无限画布项目命令行工具",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/854771076/waoowaoo.git",
9
+ "url": "git+https://codeup.aliyun.com/685a53a7323b2da0bd60070e/vvicat-ai-short-studio.git",
10
10
  "directory": "packages/ai_short_studio_cli"
11
11
  },
12
- "homepage": "https://github.com/854771076/waoowaoo#readme",
13
- "bugs": "https://github.com/854771076/waoowaoo/issues",
12
+ "homepage": "https://codeup.aliyun.com/685a53a7323b2da0bd60070e/vvicat-ai-short-studio",
14
13
  "publishConfig": {
15
14
  "access": "public"
16
15
  },
@@ -22,6 +21,7 @@
22
21
  "bin",
23
22
  "dist",
24
23
  "skills",
24
+ "scripts/postinstall.mjs",
25
25
  "README.md"
26
26
  ],
27
27
  "engines": {
@@ -29,6 +29,7 @@
29
29
  },
30
30
  "scripts": {
31
31
  "build": "node scripts/clean.mjs && tsc -p tsconfig.json",
32
+ "postinstall": "node scripts/postinstall.mjs",
32
33
  "prepack": "npm run build",
33
34
  "release:dry-run": "node scripts/publish.mjs --dry-run",
34
35
  "release:test": "node scripts/publish.mjs --name @aswless_854771076/ai_short_studio_cli --tag beta",
@@ -0,0 +1,22 @@
1
+ import { resolve } from 'node:path'
2
+ import { fileURLToPath } from 'node:url'
3
+
4
+ const packageRoot = fileURLToPath(new URL('../', import.meta.url))
5
+
6
+ export function shouldAutoInstallSkill(environment = process.env) {
7
+ if (environment.VVICAT_SKIP_SKILL_INSTALL === '1') return false
8
+ return !environment.INIT_CWD || resolve(environment.INIT_CWD) !== resolve(packageRoot)
9
+ }
10
+
11
+ export async function main(environment = process.env) {
12
+ if (!shouldAutoInstallSkill(environment)) return
13
+ try {
14
+ const { autoInstallSkill, defaultSkillTarget } = await import('../dist/skill/skill-manager.js')
15
+ const result = await autoInstallSkill(environment.VVICAT_SKILL_DIRECTORY || defaultSkillTarget('codex'))
16
+ process.stdout.write(`VVICAT Skill ${result.action}: ${result.target}\n`)
17
+ } catch (error) {
18
+ process.stderr.write(`VVICAT CLI 已安装,Skill 自动安装已跳过:${error instanceof Error ? error.message : String(error)}\n`)
19
+ }
20
+ }
21
+
22
+ if (process.argv[1] && fileURLToPath(import.meta.url) === resolve(process.argv[1])) await main()
@@ -21,7 +21,7 @@ description: Use when an agent needs to inspect or operate VVICAT infinite-canva
21
21
  ## 工作流
22
22
 
23
23
  1. 运行 `ai-short-studio auth status --json`。首次登录通过参数或 `VVICAT_BASE_URL`、`VVICAT_SUPABASE_URL`、`VVICAT_SUPABASE_PUBLISHABLE_KEY` 提供服务和 Supabase 公共配置,再运行 `ai-short-studio auth login --google`;非交互环境才通过 stdin 传密码。
24
- Skill 来自 CLI 安装,先运行 `ai-short-studio skill status --json`;`current` 为 false 时提示用户运行 `ai-short-studio skill update`。
24
+ npm 安装或更新 CLI 时会自动同步 Codex Skill。先运行 `ai-short-studio skill status --json`;`current` 为 false 时,说明自动同步可能因用户修改或非托管目录被跳过,再询问是否执行 `ai-short-studio skill update`。
25
25
  2. 完成上述初始化检查。确认目标项目是 `INFINITE_CANVAS`;创建测试项目时使用唯一前缀,并记录项目 ID。
26
26
  3. 严格按节点目录返回的 schema 和默认配置构造数据。
27
27
  4. 写入前运行 `ai-short-studio canvas get --project <id> --json` 获取当前结构;优先使用专用 node/edge 命令,批量变更才用 `canvas apply`。