@dalehkx/quote-cli 0.3.6 → 0.3.7
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/agents/openai.yaml +1 -1
- package/src/commands/install.mjs +15 -9
package/package.json
CHANGED
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,16 @@ function installSkill() {
|
|
|
104
103
|
return;
|
|
105
104
|
}
|
|
106
105
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
// 优先用 playbooks 安装到所有 agent,失败则回退到仅复制 Claude Code
|
|
107
|
+
try {
|
|
108
|
+
execCmd('npx', ['-y', 'playbooks', 'add', 'skill', skillSrc, '-g', '-y'], { stdio: 'inherit', timeout: 60000 });
|
|
109
|
+
console.log(' ✓ Skill 已安装到所有支持的 agent');
|
|
110
|
+
} catch {
|
|
111
|
+
// playbooks 不可用,直接复制到 Claude Code
|
|
112
|
+
const claudeDest = path.join(os.homedir(), '.claude', 'skills', 'cass-quote');
|
|
113
|
+
copyDir(skillSrc, claudeDest);
|
|
114
|
+
console.log(` ✓ Skill 已安装到 Claude Code (${claudeDest})`);
|
|
115
|
+
}
|
|
110
116
|
}
|
|
111
117
|
|
|
112
118
|
function copyDir(src, dest) {
|
|
@@ -148,8 +154,8 @@ export function registerInstallCommand(program) {
|
|
|
148
154
|
console.log('1/3 CLI');
|
|
149
155
|
await stepInstallCli();
|
|
150
156
|
|
|
151
|
-
console.log('\n2/3 Skill
|
|
152
|
-
|
|
157
|
+
console.log('\n2/3 Skill(多 agent 集成)');
|
|
158
|
+
await stepInstallSkill();
|
|
153
159
|
|
|
154
160
|
if (!opts.skipLogin) {
|
|
155
161
|
console.log('\n3/3 登录');
|
|
@@ -157,6 +163,6 @@ export function registerInstallCommand(program) {
|
|
|
157
163
|
}
|
|
158
164
|
|
|
159
165
|
console.log('\n安装完成!');
|
|
160
|
-
console.log('
|
|
166
|
+
console.log(' 现在可以对你的 AI 工具说:「帮我创建一条询价单」\n');
|
|
161
167
|
});
|
|
162
168
|
}
|