@newpeak/barista-cli 0.1.130 → 0.1.132
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 +78 -63
- package/dist/commands/liberica/quality/create.d.ts.map +1 -1
- package/dist/commands/liberica/quality/create.js +32 -12
- package/dist/commands/liberica/quality/create.js.map +1 -1
- package/dist/commands/liberica/quality/get.js +1 -1
- package/dist/commands/liberica/quality/get.js.map +1 -1
- package/dist/commands/liberica/quality/list.js +4 -4
- package/dist/commands/liberica/quality/list.js.map +1 -1
- package/dist/commands/liberica/quality/update.d.ts.map +1 -1
- package/dist/commands/liberica/quality/update.js +19 -11
- package/dist/commands/liberica/quality/update.js.map +1 -1
- package/dist/commands/skills/index.d.ts +3 -0
- package/dist/commands/skills/index.d.ts.map +1 -0
- package/dist/commands/skills/index.js +252 -0
- package/dist/commands/skills/index.js.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/skills/barista-cli/scripts/generate.d.ts +12 -0
- package/dist/skills/barista-cli/scripts/generate.d.ts.map +1 -0
- package/dist/skills/barista-cli/scripts/generate.js +312 -0
- package/dist/skills/barista-cli/scripts/generate.js.map +1 -0
- package/dist/types/material-qc.d.ts +22 -13
- package/dist/types/material-qc.d.ts.map +1 -1
- package/package.json +4 -2
- package/skills/barista-cli/SKILL.md +193 -0
- package/skills/barista-cli/data/commands.json +2460 -0
- package/skills/barista-cli/data/commands.yaml +1587 -0
- package/skills/barista-cli/scripts/search.py +194 -0
- package/skills/barista-cli/skill.json +17 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import * as fs from 'node:fs';
|
|
4
|
+
import * as path from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
// Skill source directory (resolved from compiled dist/ back to package root)
|
|
9
|
+
function getSkillSourceDir() {
|
|
10
|
+
// When running from dist/commands/skills/index.js:
|
|
11
|
+
// __dirname = .../dist/commands/skills
|
|
12
|
+
// we need: .../skills/barista-cli
|
|
13
|
+
const candidates = [
|
|
14
|
+
path.resolve(__dirname, '../../../skills/barista-cli'), // from dist/
|
|
15
|
+
path.resolve(__dirname, '../../skills/barista-cli'), // from src/
|
|
16
|
+
path.resolve(process.cwd(), 'skills/barista-cli'), // from cwd
|
|
17
|
+
];
|
|
18
|
+
for (const dir of candidates) {
|
|
19
|
+
if (fs.existsSync(path.join(dir, 'SKILL.md')))
|
|
20
|
+
return dir;
|
|
21
|
+
}
|
|
22
|
+
// Fallback
|
|
23
|
+
return candidates[0];
|
|
24
|
+
}
|
|
25
|
+
const PLATFORMS = {
|
|
26
|
+
claude: { dir: '.claude/skills/barista-cli', filename: 'SKILL.md', globalDir: '~/.claude/skills/barista-cli' },
|
|
27
|
+
cursor: { dir: '.cursor/rules', filename: 'barista-cli.mdc', globalDir: '~/.cursor/rules' },
|
|
28
|
+
windsurf: { dir: '.windsurf/workflows', filename: 'barista-cli.md', globalDir: '~/.windsurf/workflows' },
|
|
29
|
+
trae: { dir: '.trae/skills/barista-cli', filename: 'SKILL.md', globalDir: '~/.trae/skills/barista-cli' },
|
|
30
|
+
opencode: { dir: '.opencode/skills/barista-cli', filename: 'SKILL.md', globalDir: '~/.config/opencode/skills/barista-cli' },
|
|
31
|
+
copilot: { dir: '.github/prompts', filename: 'barista-cli.prompt.md', globalDir: '~/.github/prompts' },
|
|
32
|
+
kiro: { dir: '.kiro/steering', filename: 'barista-cli.md', globalDir: '~/.kiro/steering' },
|
|
33
|
+
codex: { dir: '.codex/skills/barista-cli', filename: 'SKILL.md', globalDir: '~/.codex/skills/barista-cli' },
|
|
34
|
+
qoder: { dir: '.qoder/skills', filename: 'barista-cli.md', globalDir: '~/.qoder/skills' },
|
|
35
|
+
roocode: { dir: '.roo/rules', filename: 'barista-cli.md', globalDir: '~/.roo/rules' },
|
|
36
|
+
gemini: { dir: '.gemini/skills/barista-cli', filename: 'SKILL.md', globalDir: '~/.gemini/skills/barista-cli' },
|
|
37
|
+
continue: { dir: '.continue/skills', filename: 'barista-cli.md', globalDir: '~/.continue/skills' },
|
|
38
|
+
droid: { dir: '.factory/skills/barista-cli', filename: 'SKILL.md', globalDir: '~/.factory/skills/barista-cli' },
|
|
39
|
+
};
|
|
40
|
+
function installForPlatform(platform, global) {
|
|
41
|
+
const cfg = PLATFORMS[platform];
|
|
42
|
+
if (!cfg) {
|
|
43
|
+
console.error(chalk.red(`❌ Unknown platform: ${platform}`));
|
|
44
|
+
console.error(chalk.gray(` Available: ${Object.keys(PLATFORMS).join(', ')}`));
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
const sourceDir = getSkillSourceDir();
|
|
48
|
+
if (!fs.existsSync(path.join(sourceDir, 'SKILL.md'))) {
|
|
49
|
+
console.error(chalk.red('❌ Skill files not found. Run "npm run build" first.'));
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
// Determine target directory
|
|
53
|
+
const homeDir = process.env.HOME || process.env.USERPROFILE || '';
|
|
54
|
+
const baseDir = global && homeDir
|
|
55
|
+
? path.join(homeDir, cfg.globalDir.replace(/^~/, ''))
|
|
56
|
+
: path.join(process.cwd(), cfg.dir);
|
|
57
|
+
const targetDataDir = path.join(baseDir, 'data');
|
|
58
|
+
const targetScriptsDir = path.join(baseDir, 'scripts');
|
|
59
|
+
// Create directories
|
|
60
|
+
fs.mkdirSync(baseDir, { recursive: true });
|
|
61
|
+
fs.mkdirSync(targetDataDir, { recursive: true });
|
|
62
|
+
fs.mkdirSync(targetScriptsDir, { recursive: true });
|
|
63
|
+
// Copy files
|
|
64
|
+
const filesToCopy = [
|
|
65
|
+
['SKILL.md', path.join(baseDir, cfg.filename)],
|
|
66
|
+
['skill.json', path.join(baseDir, 'skill.json')],
|
|
67
|
+
['data/commands.yaml', path.join(targetDataDir, 'commands.yaml')],
|
|
68
|
+
['data/commands.json', path.join(targetDataDir, 'commands.json')],
|
|
69
|
+
['scripts/search.py', path.join(targetScriptsDir, 'search.py')],
|
|
70
|
+
];
|
|
71
|
+
let count = 0;
|
|
72
|
+
for (const [relSrc, dest] of filesToCopy) {
|
|
73
|
+
const srcFile = path.join(sourceDir, relSrc);
|
|
74
|
+
if (fs.existsSync(srcFile)) {
|
|
75
|
+
fs.cpSync(srcFile, dest, { recursive: true });
|
|
76
|
+
count++;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
console.log(chalk.green(`\n✅ Installed barista-cli skill for ${platform}`));
|
|
80
|
+
console.log(chalk.gray(` → ${baseDir}`));
|
|
81
|
+
console.log(chalk.gray(` (${count} files copied)`));
|
|
82
|
+
console.log();
|
|
83
|
+
if (platform === 'trae') {
|
|
84
|
+
console.log(chalk.yellow('⚠️ Trae: Switch to SOLO mode for skill auto-activation.'));
|
|
85
|
+
}
|
|
86
|
+
if (platform === 'opencode') {
|
|
87
|
+
console.log(chalk.gray('💡 OpenCode: Skills are auto-discovered from .opencode/skills/'));
|
|
88
|
+
}
|
|
89
|
+
console.log(chalk.gray('💡 The skill auto-activates when you ask about production management.'));
|
|
90
|
+
console.log(chalk.gray('💡 Or invoke: /barista-cli <your request>'));
|
|
91
|
+
console.log();
|
|
92
|
+
}
|
|
93
|
+
export function createSkillsCommand() {
|
|
94
|
+
const cmd = new Command('skills');
|
|
95
|
+
cmd.description('Manage Barista CLI AI skills');
|
|
96
|
+
// ── install ──
|
|
97
|
+
const installCmd = new Command('install');
|
|
98
|
+
installCmd.description('Install barista-cli skill for your AI assistant');
|
|
99
|
+
// List platforms as choices
|
|
100
|
+
const platformList = Object.keys(PLATFORMS).join(', ');
|
|
101
|
+
installCmd.option('--ai <platform>', `Target AI platform (${platformList})`);
|
|
102
|
+
installCmd.option('--global', 'Install globally (available for all projects)');
|
|
103
|
+
installCmd.option('-l, --list', 'List available platforms');
|
|
104
|
+
installCmd.action(async (options) => {
|
|
105
|
+
if (options.list) {
|
|
106
|
+
console.log(chalk.bold('\n🧩 Available AI Platforms\n'));
|
|
107
|
+
for (const [name, cfg] of Object.entries(PLATFORMS)) {
|
|
108
|
+
console.log(` ${chalk.cyan(name.padEnd(12))} ${chalk.gray(cfg.dir)}`);
|
|
109
|
+
}
|
|
110
|
+
console.log();
|
|
111
|
+
console.log(chalk.gray(' Install: barista skills install --ai <platform>'));
|
|
112
|
+
console.log(chalk.gray(' Global: barista skills install --ai <platform> --global'));
|
|
113
|
+
console.log();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (options.ai) {
|
|
117
|
+
installForPlatform(options.ai, !!options.global);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
// Interactive: ask which platform
|
|
121
|
+
const { default: inquirer } = await import('inquirer');
|
|
122
|
+
const { platform } = await inquirer.prompt([{
|
|
123
|
+
type: 'list',
|
|
124
|
+
name: 'platform',
|
|
125
|
+
message: 'Select your AI assistant:',
|
|
126
|
+
choices: Object.entries(PLATFORMS).map(([name, cfg]) => ({
|
|
127
|
+
name: `${name} (${cfg.dir})`,
|
|
128
|
+
value: name,
|
|
129
|
+
})),
|
|
130
|
+
}]);
|
|
131
|
+
const { scope } = await inquirer.prompt([{
|
|
132
|
+
type: 'list',
|
|
133
|
+
name: 'scope',
|
|
134
|
+
message: 'Install scope:',
|
|
135
|
+
choices: [
|
|
136
|
+
{ name: 'Project (this directory only)', value: false },
|
|
137
|
+
{ name: 'Global (all projects)', value: true },
|
|
138
|
+
],
|
|
139
|
+
}]);
|
|
140
|
+
installForPlatform(platform, scope);
|
|
141
|
+
});
|
|
142
|
+
cmd.addCommand(installCmd);
|
|
143
|
+
// ── query ──
|
|
144
|
+
const queryCmd = new Command('query');
|
|
145
|
+
queryCmd.description('Search for barista commands by intent');
|
|
146
|
+
queryCmd.argument('<intent>', 'Search query (user intent)');
|
|
147
|
+
queryCmd.option('--domain <domain>', 'Filter by service/module (e.g. liberica, arabica, liberica.purchase-orders)');
|
|
148
|
+
queryCmd.option('--json', 'Output as JSON');
|
|
149
|
+
queryCmd.action(async (intent, options) => {
|
|
150
|
+
// Load commands data
|
|
151
|
+
const dataDir = path.resolve(getSkillSourceDir(), 'data');
|
|
152
|
+
const jsonPath = path.join(dataDir, 'commands.json');
|
|
153
|
+
const yamlPath = path.join(dataDir, 'commands.yaml');
|
|
154
|
+
let data;
|
|
155
|
+
if (fs.existsSync(jsonPath)) {
|
|
156
|
+
data = JSON.parse(fs.readFileSync(jsonPath, 'utf-8'));
|
|
157
|
+
}
|
|
158
|
+
else if (fs.existsSync(yamlPath)) {
|
|
159
|
+
// Use yaml package (it's a dependency)
|
|
160
|
+
const { default: yaml } = await import('yaml');
|
|
161
|
+
data = yaml.parse(fs.readFileSync(yamlPath, 'utf-8'));
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
console.error(chalk.red('❌ Commands data not found. Run "npm run generate-skills-data" first.'));
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
// Flatten and search
|
|
168
|
+
const flat = [];
|
|
169
|
+
for (const service of ['global', 'liberica', 'arabica']) {
|
|
170
|
+
const svcData = data[service] || {};
|
|
171
|
+
for (const [modName, mod] of Object.entries(svcData)) {
|
|
172
|
+
for (const [cmdName, cmd] of Object.entries(mod.commands || {})) {
|
|
173
|
+
flat.push({
|
|
174
|
+
service,
|
|
175
|
+
module: modName,
|
|
176
|
+
group: mod.group,
|
|
177
|
+
action: cmdName,
|
|
178
|
+
description: cmd.description || '',
|
|
179
|
+
options: cmd.options || [],
|
|
180
|
+
keywords: `${modName} ${cmdName} ${mod.group} ${cmd.description || ''} ${service}`.toLowerCase(),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// Domain filter
|
|
186
|
+
const domain = options.domain || '';
|
|
187
|
+
const queryLower = intent.toLowerCase();
|
|
188
|
+
const queryWords = queryLower.split(/\s+/).filter((w) => w.length > 1);
|
|
189
|
+
const scored = [];
|
|
190
|
+
for (const entry of flat) {
|
|
191
|
+
// Domain filter
|
|
192
|
+
if (domain) {
|
|
193
|
+
const dl = domain.toLowerCase();
|
|
194
|
+
if (dl === 'liberica' && entry.service !== 'liberica')
|
|
195
|
+
continue;
|
|
196
|
+
if (dl === 'arabica' && entry.service !== 'arabica')
|
|
197
|
+
continue;
|
|
198
|
+
if (dl.startsWith('liberica.')) {
|
|
199
|
+
const mod = dl.slice(9);
|
|
200
|
+
if (entry.module !== mod && !entry.module.startsWith(mod + '/'))
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (dl.startsWith('arabica.')) {
|
|
204
|
+
const mod = dl.slice(8);
|
|
205
|
+
if (entry.module !== mod)
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// Score
|
|
210
|
+
let score = 0;
|
|
211
|
+
for (const word of queryWords) {
|
|
212
|
+
if (entry.keywords.includes(word))
|
|
213
|
+
score += 3;
|
|
214
|
+
else if (entry.keywords.split(' ').some((k) => k.includes(word)))
|
|
215
|
+
score += 1;
|
|
216
|
+
}
|
|
217
|
+
if (queryLower === entry.module)
|
|
218
|
+
score += 5;
|
|
219
|
+
if (queryLower === entry.action)
|
|
220
|
+
score += 3;
|
|
221
|
+
if (score > 0)
|
|
222
|
+
scored.push([-score, entry]);
|
|
223
|
+
}
|
|
224
|
+
scored.sort((a, b) => a[0] - b[0]);
|
|
225
|
+
const results = scored.slice(0, 10).map(([_, r]) => r);
|
|
226
|
+
if (options.json) {
|
|
227
|
+
console.log(JSON.stringify({ success: true, data: { items: results } }, null, 2));
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
if (results.length === 0) {
|
|
231
|
+
console.log(chalk.yellow('\n No matching commands found.\n'));
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
console.log();
|
|
235
|
+
let lastGroup = '';
|
|
236
|
+
for (const r of results) {
|
|
237
|
+
if (r.group !== lastGroup) {
|
|
238
|
+
if (lastGroup)
|
|
239
|
+
console.log();
|
|
240
|
+
console.log(chalk.bold(` ${r.group}:`));
|
|
241
|
+
lastGroup = r.group;
|
|
242
|
+
}
|
|
243
|
+
const opts = r.options.length > 0 ? ` [${r.options.join(', ')}]` : '';
|
|
244
|
+
const desc = r.description ? chalk.gray(` — ${r.description}`) : '';
|
|
245
|
+
console.log(` ${chalk.cyan(`barista ${r.service} ${r.module} ${r.action}`)}${opts}${desc}`);
|
|
246
|
+
}
|
|
247
|
+
console.log(chalk.gray(`\n (${results.length} commands found)\n`));
|
|
248
|
+
});
|
|
249
|
+
cmd.addCommand(queryCmd);
|
|
250
|
+
return cmd;
|
|
251
|
+
}
|
|
252
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/skills/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAE3C,6EAA6E;AAC7E,SAAS,iBAAiB;IACxB,mDAAmD;IACnD,yCAAyC;IACzC,oCAAoC;IACpC,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,6BAA6B,CAAC,EAAI,aAAa;QACvE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,0BAA0B,CAAC,EAAO,YAAY;QACtE,IAAI,CAA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AAG,CAAC,CAAC,KAAK,CAAC;YACtB,CAAC;YACD,MAAM,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACtE,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACpE,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;QACjG,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,OAAO,CAAC,MAAM,oBAAoB,CAAC,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAEzB,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { createContextCommand } from './commands/context.js';
|
|
|
6
6
|
import { createAuthCommand } from './commands/auth.js';
|
|
7
7
|
import { createLibericaCommand } from './commands/liberica/index.js';
|
|
8
8
|
import { createArabicaCommand } from './commands/arabica/index.js';
|
|
9
|
+
import { createSkillsCommand } from './commands/skills/index.js';
|
|
9
10
|
const require = createRequire(import.meta.url);
|
|
10
11
|
const { version } = require('../package.json');
|
|
11
12
|
async function main() {
|
|
@@ -23,6 +24,7 @@ async function main() {
|
|
|
23
24
|
program.addCommand(createAuthCommand());
|
|
24
25
|
program.addCommand(createLibericaCommand());
|
|
25
26
|
program.addCommand(createArabicaCommand());
|
|
27
|
+
program.addCommand(createSkillsCommand());
|
|
26
28
|
await program.parseAsync();
|
|
27
29
|
}
|
|
28
30
|
catch (error) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC;QAE3B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;QAC9B,OAAO;aACJ,IAAI,CAAC,SAAS,CAAC;aACf,WAAW,CAAC,6DAA6D,CAAC;aAC1E,OAAO,CAAC,OAAO,CAAC;aAChB,MAAM,CAAC,yBAAyB,EAAE,+CAA+C,CAAC;aAClF,MAAM,CAAC,uBAAuB,EAAE,8BAA8B,CAAC;aAC/D,MAAM,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;QAE1C,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC;QAC3C,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAC;QACxC,OAAO,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC;QAC3C,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;QAE1C,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* generate.ts — 从 src/commands/ 源码自动生成 skills 数据文件
|
|
4
|
+
*
|
|
5
|
+
* 扫描 src/commands/liberica/ 和 src/commands/arabica/ 下所有命令文件,
|
|
6
|
+
* 提取模块路径、命令名、描述、选项,输出结构化 YAML。
|
|
7
|
+
*
|
|
8
|
+
* 运行:npx tsx src/skills/barista-cli/scripts/generate.ts
|
|
9
|
+
* 在 build 前自动执行:npm run generate-skills-data
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../../src/skills/barista-cli/scripts/generate.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* generate.ts — 从 src/commands/ 源码自动生成 skills 数据文件
|
|
4
|
+
*
|
|
5
|
+
* 扫描 src/commands/liberica/ 和 src/commands/arabica/ 下所有命令文件,
|
|
6
|
+
* 提取模块路径、命令名、描述、选项,输出结构化 YAML。
|
|
7
|
+
*
|
|
8
|
+
* 运行:npx tsx src/skills/barista-cli/scripts/generate.ts
|
|
9
|
+
* 在 build 前自动执行:npm run generate-skills-data
|
|
10
|
+
*/
|
|
11
|
+
import * as fs from 'node:fs';
|
|
12
|
+
import * as path from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = path.dirname(__filename);
|
|
16
|
+
const PROJECT_ROOT = path.resolve(__dirname, '../../../../');
|
|
17
|
+
const COMMANDS_DIR = path.join(PROJECT_ROOT, 'src/commands');
|
|
18
|
+
const SRC_DATA_DIR = path.resolve(__dirname, '../data');
|
|
19
|
+
const SKILLS_DATA_DIR = path.resolve(PROJECT_ROOT, 'skills/barista-cli/data');
|
|
20
|
+
// ── 业务分组映射(新模块需要在此注册) ──
|
|
21
|
+
// 按服务分开,避免 key 冲突
|
|
22
|
+
const GROUP_MAP = {
|
|
23
|
+
liberica: {
|
|
24
|
+
auth: '认证',
|
|
25
|
+
employees: '基础资料', users: '基础资料',
|
|
26
|
+
clients: '基础资料', 'clients/tags': '基础资料', 'clients/invoice-header': '基础资料',
|
|
27
|
+
suppliers: '基础资料', materials: '基础资料', uoms: '基础资料',
|
|
28
|
+
currency: '基础资料', warehouses: '基础资料', 'warehouses/locations': '基础资料',
|
|
29
|
+
orgs: '基础资料', positions: '基础资料', roles: '基础资料',
|
|
30
|
+
'dict-types': '基础资料', dicts: '基础资料',
|
|
31
|
+
operations: '基础资料', calendar: '基础资料',
|
|
32
|
+
'work-centers': '基础资料', shifts: '基础资料',
|
|
33
|
+
'worker-groups': '基础资料', 'job-types': '基础资料',
|
|
34
|
+
equipment: '基础资料', mould: '基础资料',
|
|
35
|
+
'client-contacts': '联系人/价格', 'supplier-contacts': '联系人/价格',
|
|
36
|
+
'client-price': '联系人/价格', 'supplier-price': '联系人/价格',
|
|
37
|
+
'outsourcing-price': '联系人/价格',
|
|
38
|
+
'purchase-orders': '供应链', 'sales-orders': '供应链',
|
|
39
|
+
'sales-orders/delivery-notes': '供应链', 'sales-orders/forecasts': '供应链',
|
|
40
|
+
'outsourcing-orders': '供应链', quotations: '供应链',
|
|
41
|
+
stock: '库存', 'transfer-in-forms': '库存', 'transfer-out-forms': '库存',
|
|
42
|
+
'material-transfers': '库存', 'physical-inventory': '库存',
|
|
43
|
+
'physical-inventory/form': '库存',
|
|
44
|
+
'inventory-overage': '库存', 'inventory-shortage': '库存',
|
|
45
|
+
'stock-reservation': '库存',
|
|
46
|
+
'material-issue': '库存', 'material-return': '库存',
|
|
47
|
+
bom: '生产', routing: '生产', 'work-orders': '生产',
|
|
48
|
+
'actual-production': '生产', 'cutting-material': '生产',
|
|
49
|
+
'product-stock-in': '生产', 'product-stock-out': '生产',
|
|
50
|
+
'mes-result': '生产',
|
|
51
|
+
mrp: '计划', 'mrp/plan': '计划', 'mrp/task': '计划',
|
|
52
|
+
aps: '计划', 'plan-orders': '计划',
|
|
53
|
+
quality: '质量',
|
|
54
|
+
finance: '财务', 'finance/invoices': '财务', 'finance/proceeds': '财务',
|
|
55
|
+
'finance/cost': '财务', 'finance/management-fee': '财务',
|
|
56
|
+
'finance/production-cost': '财务',
|
|
57
|
+
hrs: 'HR', 'hrs/dossier': 'HR', 'hrs/salary': 'HR',
|
|
58
|
+
'hrs/bonus': 'HR', 'hrs/kpi': 'HR', 'hrs/objective': 'HR', 'hrs/skills': 'HR',
|
|
59
|
+
teams: '团队', 'teams/projects': '团队', 'teams/issues': '团队',
|
|
60
|
+
'teams/project-codes': '团队', 'teams/tasks': '团队', 'teams/work-logs': '团队',
|
|
61
|
+
issue: '其他', todo: '其他', 'replenish-orders': '其他',
|
|
62
|
+
},
|
|
63
|
+
arabica: {
|
|
64
|
+
auth: '认证', plans: '套餐', subscription: '订阅',
|
|
65
|
+
orders: '订单', invoices: '发票', enterprises: '企业', access: '访问',
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
// ── 模块显示名映射 ──
|
|
69
|
+
const DISPLAY_MAP = {
|
|
70
|
+
uoms: '计量单位', orgs: '组织架构',
|
|
71
|
+
'client-contacts': '客户联系人', 'supplier-contacts': '供应商联系人',
|
|
72
|
+
'client-price': '客户价格', 'supplier-price': '供应商价格',
|
|
73
|
+
'outsourcing-price': '外协价格',
|
|
74
|
+
'purchase-orders': '采购订单', 'sales-orders': '销售订单',
|
|
75
|
+
'outsourcing-orders': '外协订单',
|
|
76
|
+
'transfer-in-forms': '入库单', 'transfer-out-forms': '出库单',
|
|
77
|
+
'material-transfers': '物料移库',
|
|
78
|
+
'physical-inventory': '盘点', 'physical-inventory/form': '盘点表单',
|
|
79
|
+
'inventory-overage': '盘盈', 'inventory-shortage': '盘亏',
|
|
80
|
+
'stock-reservation': '库存预留',
|
|
81
|
+
'material-issue': '领料', 'material-return': '退料',
|
|
82
|
+
'cutting-material': '裁切投料',
|
|
83
|
+
'actual-production': '生产实绩',
|
|
84
|
+
'product-stock-in': '产品入库', 'product-stock-out': '产品出库',
|
|
85
|
+
'mes-result': 'MES 报工',
|
|
86
|
+
'plan-orders': '计划订单',
|
|
87
|
+
mrp: 'MRP 需求计划', aps: 'APS 排程',
|
|
88
|
+
quality: '质量检验',
|
|
89
|
+
'work-orders': '工单',
|
|
90
|
+
'work-centers': '工作中心', 'worker-groups': '工人班组',
|
|
91
|
+
'job-types': '工种',
|
|
92
|
+
'dict-types': '字典类型',
|
|
93
|
+
'replenish-orders': '补货订单',
|
|
94
|
+
quotations: '报价管理',
|
|
95
|
+
};
|
|
96
|
+
// ── 正则提取工具 ──
|
|
97
|
+
function extractDescription(content) {
|
|
98
|
+
const match = content.match(/\.description\('([^']*)'\)/);
|
|
99
|
+
return match ? match[1] : '';
|
|
100
|
+
}
|
|
101
|
+
function hasOption(content, opt) {
|
|
102
|
+
return content.includes(`'${opt}'`) || content.includes(`"${opt}"`);
|
|
103
|
+
}
|
|
104
|
+
// ── 全局命令(不在 liberica/arabica 目录下) ──
|
|
105
|
+
const GLOBAL_COMMANDS = {
|
|
106
|
+
context: {
|
|
107
|
+
description: 'Manage CLI context (environment, service, tenant)',
|
|
108
|
+
commands: {
|
|
109
|
+
show: 'Show current context',
|
|
110
|
+
'use-env': 'Switch environment (dev|test|prod-cn|prod-jp)',
|
|
111
|
+
'use-tenant': 'Switch tenant',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
auth: {
|
|
115
|
+
description: 'Manage authentication tokens',
|
|
116
|
+
commands: {
|
|
117
|
+
login: 'Login with token',
|
|
118
|
+
status: 'Check authentication status',
|
|
119
|
+
logout: 'Logout and clear token',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
skills: {
|
|
123
|
+
description: 'Manage Barista CLI AI skills',
|
|
124
|
+
commands: {
|
|
125
|
+
install: 'Install barista-cli skill for your AI assistant',
|
|
126
|
+
query: 'Search for barista commands by intent',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
// ── 扫描单个服务下的命令 ──
|
|
131
|
+
function scanService(serviceName, servicePath) {
|
|
132
|
+
const groupMap = GROUP_MAP[serviceName] || {};
|
|
133
|
+
const modules = {};
|
|
134
|
+
function walkDir(dirPath, baseModule) {
|
|
135
|
+
if (!fs.statSync(dirPath).isDirectory())
|
|
136
|
+
return;
|
|
137
|
+
const entries = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
138
|
+
const tsFiles = entries.filter(e => e.isFile() && e.name.endsWith('.ts') && e.name !== 'index.ts');
|
|
139
|
+
const subDirs = entries.filter(e => e.isDirectory() && e.name !== '__tests__' && e.name !== 'node_modules');
|
|
140
|
+
const hasIndex = entries.some(e => e.isFile() && e.name === 'index.ts');
|
|
141
|
+
// Read index.ts for module description
|
|
142
|
+
let moduleDesc = '';
|
|
143
|
+
if (hasIndex) {
|
|
144
|
+
const indexContent = fs.readFileSync(path.join(dirPath, 'index.ts'), 'utf-8');
|
|
145
|
+
moduleDesc = extractDescription(indexContent);
|
|
146
|
+
}
|
|
147
|
+
// If there are command files directly in this dir, add as a module
|
|
148
|
+
if (tsFiles.length > 0) {
|
|
149
|
+
const commands = {};
|
|
150
|
+
for (const file of tsFiles) {
|
|
151
|
+
const content = fs.readFileSync(path.join(dirPath, file.name), 'utf-8');
|
|
152
|
+
const cmdName = file.name.replace('.ts', '');
|
|
153
|
+
const desc = extractDescription(content);
|
|
154
|
+
commands[cmdName] = {};
|
|
155
|
+
if (desc)
|
|
156
|
+
commands[cmdName].description = desc;
|
|
157
|
+
// Detect standard options
|
|
158
|
+
if (hasOption(content, '--json'))
|
|
159
|
+
commands[cmdName].json = true;
|
|
160
|
+
if (hasOption(content, '--dry-run'))
|
|
161
|
+
commands[cmdName]['dry-run'] = true;
|
|
162
|
+
if (hasOption(content, '--force'))
|
|
163
|
+
commands[cmdName].force = true;
|
|
164
|
+
}
|
|
165
|
+
const moduleKey = baseModule || path.basename(dirPath);
|
|
166
|
+
const group = groupMap[moduleKey] || groupMap[moduleKey.split('/')[0]] || '其他';
|
|
167
|
+
modules[moduleKey] = {
|
|
168
|
+
group,
|
|
169
|
+
...(DISPLAY_MAP[moduleKey] ? { displayName: DISPLAY_MAP[moduleKey] } : {}),
|
|
170
|
+
...(moduleDesc ? { description: moduleDesc } : {}),
|
|
171
|
+
commands,
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
// Recurse into subdirectories
|
|
175
|
+
for (const subDir of subDirs) {
|
|
176
|
+
const subModule = baseModule ? `${baseModule}/${subDir.name}` : subDir.name;
|
|
177
|
+
walkDir(path.join(dirPath, subDir.name), subModule);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
walkDir(servicePath, '');
|
|
181
|
+
return modules;
|
|
182
|
+
}
|
|
183
|
+
// ── 主函数 ──
|
|
184
|
+
function main() {
|
|
185
|
+
console.log('🔍 Scanning commands...');
|
|
186
|
+
const libericaDir = path.join(COMMANDS_DIR, 'liberica');
|
|
187
|
+
const arabicaDir = path.join(COMMANDS_DIR, 'arabica');
|
|
188
|
+
if (!fs.existsSync(libericaDir)) {
|
|
189
|
+
console.error(`❌ Liberica commands directory not found: ${libericaDir}`);
|
|
190
|
+
process.exit(1);
|
|
191
|
+
}
|
|
192
|
+
if (!fs.existsSync(arabicaDir)) {
|
|
193
|
+
console.error(`❌ Arabica commands directory not found: ${arabicaDir}`);
|
|
194
|
+
process.exit(1);
|
|
195
|
+
}
|
|
196
|
+
const liberica = scanService('liberica', libericaDir);
|
|
197
|
+
const arabica = scanService('arabica', arabicaDir);
|
|
198
|
+
// Sort modules by group then name
|
|
199
|
+
function sortModules(modules) {
|
|
200
|
+
const groupOrder = ['认证', '基础资料', '联系人/价格', '供应链', '库存', '生产', '计划', '质量', '财务', 'HR', '团队', '其他', '套餐', '订阅', '订单', '发票', '企业', '访问'];
|
|
201
|
+
const sorted = {};
|
|
202
|
+
const entries = Object.entries(modules).sort((a, b) => {
|
|
203
|
+
const ga = groupOrder.indexOf(a[1].group);
|
|
204
|
+
const gb = groupOrder.indexOf(b[1].group);
|
|
205
|
+
if (ga !== gb)
|
|
206
|
+
return ga - gb;
|
|
207
|
+
return a[0].localeCompare(b[0]);
|
|
208
|
+
});
|
|
209
|
+
for (const [key, val] of entries) {
|
|
210
|
+
sorted[key] = val;
|
|
211
|
+
}
|
|
212
|
+
return sorted;
|
|
213
|
+
}
|
|
214
|
+
// Build global commands module
|
|
215
|
+
const globalModule = {};
|
|
216
|
+
for (const [modName, mod] of Object.entries(GLOBAL_COMMANDS)) {
|
|
217
|
+
const cmds = {};
|
|
218
|
+
for (const [cmdName, desc] of Object.entries(mod.commands)) {
|
|
219
|
+
cmds[cmdName] = {};
|
|
220
|
+
if (desc)
|
|
221
|
+
cmds[cmdName].description = desc;
|
|
222
|
+
}
|
|
223
|
+
globalModule[modName] = {
|
|
224
|
+
group: '全局',
|
|
225
|
+
description: mod.description,
|
|
226
|
+
commands: cmds,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
const data = {
|
|
230
|
+
_metadata: {
|
|
231
|
+
generatedAt: new Date().toISOString(),
|
|
232
|
+
source: 'src/commands/',
|
|
233
|
+
generator: 'src/skills/barista-cli/scripts/generate.ts',
|
|
234
|
+
},
|
|
235
|
+
global: sortModules(globalModule),
|
|
236
|
+
liberica: sortModules(liberica),
|
|
237
|
+
arabica: sortModules(arabica),
|
|
238
|
+
};
|
|
239
|
+
// Count stats
|
|
240
|
+
let libericaCmds = 0;
|
|
241
|
+
let arabicaCmds = 0;
|
|
242
|
+
let globalCmds = 0;
|
|
243
|
+
for (const mod of Object.values(liberica)) {
|
|
244
|
+
libericaCmds += Object.keys(mod.commands || {}).length;
|
|
245
|
+
}
|
|
246
|
+
for (const mod of Object.values(arabica)) {
|
|
247
|
+
arabicaCmds += Object.keys(mod.commands || {}).length;
|
|
248
|
+
}
|
|
249
|
+
for (const mod of Object.values(globalModule)) {
|
|
250
|
+
globalCmds += Object.keys(mod.commands || {}).length;
|
|
251
|
+
}
|
|
252
|
+
// Write output to both locations
|
|
253
|
+
for (const dir of [SRC_DATA_DIR, SKILLS_DATA_DIR]) {
|
|
254
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
255
|
+
}
|
|
256
|
+
// Write JSON to both locations
|
|
257
|
+
const jsonContent = JSON.stringify(data, null, 2);
|
|
258
|
+
for (const dir of [SRC_DATA_DIR, SKILLS_DATA_DIR]) {
|
|
259
|
+
fs.writeFileSync(path.join(dir, 'commands.json'), jsonContent, 'utf-8');
|
|
260
|
+
}
|
|
261
|
+
// Also write YAML format manually since it's simpler for AI to read
|
|
262
|
+
const yamlLines = [];
|
|
263
|
+
yamlLines.push('# ★ 自动生成。修改源码后重新生成:npm run generate-skills-data');
|
|
264
|
+
yamlLines.push('# ★ 生成时间: ' + new Date().toISOString());
|
|
265
|
+
yamlLines.push('');
|
|
266
|
+
for (const service of ['global', 'liberica', 'arabica']) {
|
|
267
|
+
yamlLines.push(`${service}:`);
|
|
268
|
+
const modules = data[service];
|
|
269
|
+
let currentGroup = '';
|
|
270
|
+
for (const [modName, mod] of Object.entries(modules)) {
|
|
271
|
+
if (mod.group !== currentGroup) {
|
|
272
|
+
currentGroup = mod.group;
|
|
273
|
+
yamlLines.push(` # ── ${currentGroup} ──`);
|
|
274
|
+
}
|
|
275
|
+
const display = mod.displayName || modName;
|
|
276
|
+
yamlLines.push(` ${modName}:`);
|
|
277
|
+
yamlLines.push(` group: "${mod.group}"`);
|
|
278
|
+
if (mod.description) {
|
|
279
|
+
yamlLines.push(` description: "${mod.description}"`);
|
|
280
|
+
}
|
|
281
|
+
yamlLines.push(` commands:`);
|
|
282
|
+
for (const [cmdName, cmd] of Object.entries(mod.commands)) {
|
|
283
|
+
yamlLines.push(` ${cmdName}:`);
|
|
284
|
+
if (cmd.description) {
|
|
285
|
+
yamlLines.push(` description: "${cmd.description}"`);
|
|
286
|
+
}
|
|
287
|
+
const flags = [];
|
|
288
|
+
if (cmd.json)
|
|
289
|
+
flags.push('--json');
|
|
290
|
+
if (cmd['dry-run'])
|
|
291
|
+
flags.push('--dry-run');
|
|
292
|
+
if (cmd.force)
|
|
293
|
+
flags.push('--force');
|
|
294
|
+
if (flags.length > 0) {
|
|
295
|
+
yamlLines.push(` options: [${flags.join(', ')}]`);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
const yamlContent = yamlLines.join('\n');
|
|
301
|
+
for (const dir of [SRC_DATA_DIR, SKILLS_DATA_DIR]) {
|
|
302
|
+
fs.writeFileSync(path.join(dir, 'commands.yaml'), yamlContent, 'utf-8');
|
|
303
|
+
}
|
|
304
|
+
console.log(`✅ Generated commands.yaml + commands.json`);
|
|
305
|
+
console.log(` Global: ${Object.keys(globalModule).length} modules, ${globalCmds} commands`);
|
|
306
|
+
console.log(` Liberica: ${Object.keys(liberica).length} modules, ${libericaCmds} commands`);
|
|
307
|
+
console.log(` Arabica: ${Object.keys(arabica).length} modules, ${arabicaCmds} commands`);
|
|
308
|
+
console.log(` → src/skills/barista-cli/data/`);
|
|
309
|
+
console.log(` → skills/barista-cli/data/`);
|
|
310
|
+
}
|
|
311
|
+
main();
|
|
312
|
+
//# sourceMappingURL=generate.js.map
|