@dalehkx/quote-cli 0.3.6 → 0.3.8
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 +1 -1
- package/skill/SKILL.md +1 -6
- package/skill/agents/openai.yaml +1 -1
- package/src/commands/install.mjs +21 -9
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cass-quote
|
|
3
|
-
description:
|
|
4
|
-
汽配询报价管理技能
|
|
5
|
-
支持账号注册/登录、创建询价单(多配件/VIN解析)、监听报价、比价分析。
|
|
6
|
-
Use when the user wants to create an inquiry (RFQ), manage quotations,
|
|
7
|
-
compare prices from suppliers, or confirm purchase orders.
|
|
8
|
-
Also use when the user mentions 询价、报价、比价、下单、刹车片、配件.
|
|
3
|
+
description: 汽配询报价管理技能,支持账号注册/登录、创建询价单(多配件/VIN解析)、监听报价、比价分析。Use when the user wants to create an inquiry (RFQ), manage quotations, compare prices from suppliers, or confirm purchase orders. Also use when the user mentions 询价、报价、比价、下单、刹车片、配件.
|
|
9
4
|
---
|
|
10
5
|
|
|
11
6
|
# Quote Skill
|
package/skill/agents/openai.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "询报价管理"
|
|
3
3
|
short_description: "创建询价、管理报价、比价下单"
|
|
4
|
-
default_prompt: "Use $quote
|
|
4
|
+
default_prompt: "Use $cass-quote to create a new inquiry for auto parts."
|
|
5
5
|
|
|
6
6
|
policy:
|
|
7
7
|
allow_implicit_invocation: true
|
package/src/commands/install.mjs
CHANGED
|
@@ -84,14 +84,13 @@ async function stepInstallCli() {
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
function
|
|
88
|
-
//
|
|
87
|
+
async function stepInstallSkill() {
|
|
88
|
+
// 找全局包内的 skill 目录
|
|
89
89
|
let skillSrc;
|
|
90
90
|
try {
|
|
91
91
|
const prefix = execFileSync('npm', ['prefix', '-g'], {
|
|
92
92
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
93
93
|
}).toString().trim();
|
|
94
|
-
// 尝试两种常见路径:标准 npm 和 Homebrew/nvm 等
|
|
95
94
|
const candidates = [
|
|
96
95
|
path.join(prefix, 'lib', 'node_modules', PKG, 'skill'),
|
|
97
96
|
path.join(prefix, 'node_modules', PKG, 'skill'),
|
|
@@ -104,9 +103,22 @@ function installSkill() {
|
|
|
104
103
|
return;
|
|
105
104
|
}
|
|
106
105
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
// playbooks 依赖 TTY(Ink 框架),非 TTY 环境直接跳过
|
|
107
|
+
if (process.stdin.isTTY) {
|
|
108
|
+
try {
|
|
109
|
+
execCmd('npx', ['-y', 'playbooks', 'add', 'skill', skillSrc, '-g', '-y'], {
|
|
110
|
+
stdio: 'inherit',
|
|
111
|
+
timeout: 60000,
|
|
112
|
+
});
|
|
113
|
+
console.log(' ✓ Skill 已安装到所有支持的 agent');
|
|
114
|
+
return;
|
|
115
|
+
} catch { /* 回退到手动复制 */ }
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// 回退:直接复制到 Claude Code
|
|
119
|
+
const claudeDest = path.join(os.homedir(), '.claude', 'skills', 'cass-quote');
|
|
120
|
+
copyDir(skillSrc, claudeDest);
|
|
121
|
+
console.log(` ✓ Skill 已安装到 Claude Code (${claudeDest})`);
|
|
110
122
|
}
|
|
111
123
|
|
|
112
124
|
function copyDir(src, dest) {
|
|
@@ -148,8 +160,8 @@ export function registerInstallCommand(program) {
|
|
|
148
160
|
console.log('1/3 CLI');
|
|
149
161
|
await stepInstallCli();
|
|
150
162
|
|
|
151
|
-
console.log('\n2/3 Skill
|
|
152
|
-
|
|
163
|
+
console.log('\n2/3 Skill(多 agent 集成)');
|
|
164
|
+
await stepInstallSkill();
|
|
153
165
|
|
|
154
166
|
if (!opts.skipLogin) {
|
|
155
167
|
console.log('\n3/3 登录');
|
|
@@ -157,6 +169,6 @@ export function registerInstallCommand(program) {
|
|
|
157
169
|
}
|
|
158
170
|
|
|
159
171
|
console.log('\n安装完成!');
|
|
160
|
-
console.log('
|
|
172
|
+
console.log(' 现在可以对你的 AI 工具说:「帮我创建一条询价单」\n');
|
|
161
173
|
});
|
|
162
174
|
}
|