@kevlns/v-cli 0.1.1-beta.1 → 0.2.0-beta.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/package.json CHANGED
@@ -1,23 +1,29 @@
1
1
  {
2
2
  "name": "@kevlns/v-cli",
3
- "version": "0.1.1-beta.1",
3
+ "version": "0.2.0-beta.2",
4
4
  "description": "kevlns 的个人工具箱 CLI(插件化架构,内置 + 本地插件)+ doctor/plugin/ts 命令",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "v-cli": "dist/cli.mjs"
8
8
  },
9
9
  "files": [
10
- "dist/"
10
+ "dist/",
11
+ "schemas/",
12
+ "AGENTS.md"
11
13
  ],
12
14
  "scripts": {
13
15
  "build": "tsup",
14
16
  "prepack": "npm run build",
15
17
  "test": "vitest run",
16
18
  "typecheck": "tsc --noEmit",
17
- "check": "npm run build && npm run typecheck && npm test"
19
+ "generate:agents": "node scripts/generate-agents.mjs",
20
+ "check:agents": "node scripts/generate-agents.mjs --check",
21
+ "pack:guard": "node scripts/pack-guard.mjs",
22
+ "test:package": "node scripts/test-package-install.mjs",
23
+ "check": "npm run build && npm run typecheck && npm test && npm run check:agents && npm run pack:guard"
18
24
  },
19
25
  "engines": {
20
- "node": ">=18"
26
+ "node": ">=20"
21
27
  },
22
28
  "license": "MIT",
23
29
  "author": "kevlns <936277610@qq.com>",
@@ -39,7 +45,9 @@
39
45
  "personal"
40
46
  ],
41
47
  "dependencies": {
42
- "commander": "^12.1.0"
48
+ "commander": "^12.1.0",
49
+ "@kevlns/xlmerge": "1.2.1-beta.2",
50
+ "@kevlns/u-cli-mod": "0.1.0-beta.2"
43
51
  },
44
52
  "devDependencies": {
45
53
  "@types/node": "^20.14.0",
@@ -0,0 +1,144 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://github.com/kevlns/v-cli/schemas/v-cli-plugin.schema.json",
4
+ "title": "v-cli plugin manifest",
5
+ "description": "官方插件清单(v-cli.plugin.json)契约,schemaVersion 1。v-cli 使用内置校验器(src/core/manifest.ts)执行等价规则;本文件供编辑器提示与文档使用。",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "required": [
9
+ "schemaVersion",
10
+ "package",
11
+ "command",
12
+ "bin",
13
+ "description",
14
+ "platforms",
15
+ "runtime",
16
+ "environment",
17
+ "agent"
18
+ ],
19
+ "properties": {
20
+ "schemaVersion": {
21
+ "const": 1,
22
+ "description": "清单契约版本。v-cli 0.2 仅支持 1;未知 major(>=2)会被拒绝。"
23
+ },
24
+ "package": {
25
+ "type": "string",
26
+ "pattern": "^@[a-zA-Z0-9][a-zA-Z0-9._~-]*/[a-zA-Z0-9][a-zA-Z0-9._~-]*$",
27
+ "description": "npm 包名(@scope/name),必须与 package.json 的 name 一致。"
28
+ },
29
+ "command": {
30
+ "type": "string",
31
+ "pattern": "^[a-z][a-z0-9-]*$",
32
+ "description": "v-cli 路由命令名。不可与内置命令(doctor/plugin/ts/agent/help)重名。"
33
+ },
34
+ "bin": {
35
+ "type": "string",
36
+ "description": "package.json bin 中的键名;由 v-cli 以子进程方式调用。"
37
+ },
38
+ "description": {
39
+ "type": "string",
40
+ "minLength": 1
41
+ },
42
+ "platforms": {
43
+ "type": "array",
44
+ "minItems": 1,
45
+ "uniqueItems": true,
46
+ "items": {
47
+ "type": "string",
48
+ "enum": ["darwin", "linux", "win32"]
49
+ }
50
+ },
51
+ "runtime": {
52
+ "type": "object",
53
+ "description": "运行时要求(node/python/os 等,自由形状)。"
54
+ },
55
+ "environment": {
56
+ "type": "array",
57
+ "items": {
58
+ "type": "object",
59
+ "required": ["name", "description"],
60
+ "properties": {
61
+ "name": { "type": "string", "minLength": 1 },
62
+ "description": { "type": "string", "minLength": 1 }
63
+ }
64
+ }
65
+ },
66
+ "agent": {
67
+ "type": "object",
68
+ "required": ["whenToUse", "globalOptions", "commands"],
69
+ "properties": {
70
+ "whenToUse": {
71
+ "type": "string",
72
+ "description": "给 AI agent 的判断条件:什么场景该调用本插件。"
73
+ },
74
+ "globalOptions": {
75
+ "type": "array",
76
+ "items": {
77
+ "type": "object",
78
+ "required": ["flags", "description"],
79
+ "properties": {
80
+ "flags": { "type": "string", "minLength": 1 },
81
+ "description": { "type": "string", "minLength": 1 }
82
+ }
83
+ }
84
+ },
85
+ "commands": {
86
+ "type": "array",
87
+ "items": {
88
+ "type": "object",
89
+ "required": ["path", "usage", "description", "arguments", "options", "output", "exitCodes", "safety"],
90
+ "properties": {
91
+ "path": {
92
+ "type": "array",
93
+ "minItems": 1,
94
+ "items": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$" }
95
+ },
96
+ "usage": { "type": "string", "minLength": 1 },
97
+ "description": { "type": "string", "minLength": 1 },
98
+ "arguments": {
99
+ "type": "array",
100
+ "items": {
101
+ "type": "object",
102
+ "required": ["name", "required", "description"],
103
+ "properties": {
104
+ "name": { "type": "string", "minLength": 1 },
105
+ "required": { "type": "boolean" },
106
+ "description": { "type": "string", "minLength": 1 }
107
+ }
108
+ }
109
+ },
110
+ "options": {
111
+ "type": "array",
112
+ "items": {
113
+ "type": "object",
114
+ "required": ["flags", "description"],
115
+ "properties": {
116
+ "flags": { "type": "string", "minLength": 1 },
117
+ "description": { "type": "string", "minLength": 1 }
118
+ }
119
+ }
120
+ },
121
+ "output": {
122
+ "type": "object",
123
+ "required": ["format", "description"],
124
+ "properties": {
125
+ "format": { "type": "string", "enum": ["json", "stdout", "text"] },
126
+ "description": { "type": "string", "minLength": 1 }
127
+ }
128
+ },
129
+ "exitCodes": {
130
+ "type": "object",
131
+ "description": "code -> 含义 映射。",
132
+ "additionalProperties": { "type": "string" }
133
+ },
134
+ "safety": {
135
+ "type": "array",
136
+ "items": { "type": "string" }
137
+ }
138
+ }
139
+ }
140
+ }
141
+ }
142
+ }
143
+ }
144
+ }