@meet-im/lxcli 0.0.13 → 0.0.14
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/dist/commands/generate-skills.js +5 -2
- package/dist/commands/services/kb/descriptions.js +1 -0
- package/dist/commands/services/kb/handler.js +9 -0
- package/dist/commands/services/kb/index.js +10 -0
- package/dist/commands/services/kb/params.js +3 -0
- package/dist/commands/services/kb/skill-metadata.js +1 -0
- package/package.json +1 -1
|
@@ -180,7 +180,7 @@ function renderSkillMd(method, version) {
|
|
|
180
180
|
const description = METHOD_DESCRIPTIONS[method];
|
|
181
181
|
const params = PARAM_DEFS[method] || [];
|
|
182
182
|
const metadata = METHOD_SKILL_METADATA[method];
|
|
183
|
-
const skillName = `lxcli-kb-${method}`;
|
|
183
|
+
const skillName = `lxcli-kb-${camelToKebab(method)}`;
|
|
184
184
|
const hasParams = params.length > 0;
|
|
185
185
|
// 快捷参数列表(显式配置,不从 required 自动推断)
|
|
186
186
|
const shortcutParams = METHOD_SHORTCUT_PARAMS[method] || [];
|
|
@@ -240,6 +240,9 @@ metadata:
|
|
|
240
240
|
}
|
|
241
241
|
return lines.join('\n');
|
|
242
242
|
}
|
|
243
|
+
function camelToKebab(str) {
|
|
244
|
+
return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
245
|
+
}
|
|
243
246
|
async function generateServiceSkills(skillsDir, serviceName, force) {
|
|
244
247
|
// 目前只支持 kb 服务
|
|
245
248
|
if (serviceName !== 'kb') {
|
|
@@ -249,7 +252,7 @@ async function generateServiceSkills(skillsDir, serviceName, force) {
|
|
|
249
252
|
const methods = Object.keys(PARAM_DEFS);
|
|
250
253
|
const version = await readPackageVersion();
|
|
251
254
|
for (const method of methods) {
|
|
252
|
-
const skillName = `lxcli-${serviceName}-${method}`;
|
|
255
|
+
const skillName = `lxcli-${serviceName}-${camelToKebab(method)}`;
|
|
253
256
|
const skillDir = path.join(skillsDir, skillName);
|
|
254
257
|
const skillPath = path.join(skillDir, 'SKILL.md');
|
|
255
258
|
// 检查是否已有 SKILL.md(非 --force 时跳过已有文件)
|
|
@@ -180,6 +180,14 @@ export function createKbAction(method) {
|
|
|
180
180
|
}
|
|
181
181
|
params = { project_id: projectId };
|
|
182
182
|
}
|
|
183
|
+
else if (method === 'getColumns' && options.project_id) {
|
|
184
|
+
const projectId = parseTaskId(options.project_id);
|
|
185
|
+
if (projectId === null) {
|
|
186
|
+
outputCliError('PARAM_INVALID', '--project_id must be a positive integer');
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
params = { project_id: projectId };
|
|
190
|
+
}
|
|
183
191
|
else if (method === 'getAllComments' && options.task_id) {
|
|
184
192
|
const taskId = parseTaskId(options.task_id);
|
|
185
193
|
if (taskId === null) {
|
|
@@ -261,6 +269,7 @@ export function createKbAction(method) {
|
|
|
261
269
|
searchSubtasks: '--project_id, --iteration_id, --user_id, --page',
|
|
262
270
|
getAllActiveIterations: '--project_id',
|
|
263
271
|
getAllCategories: '--project_id',
|
|
272
|
+
getColumns: '--project_id',
|
|
264
273
|
getAllComments: '--task_id',
|
|
265
274
|
createComment: '--task_id, --user_id and --content',
|
|
266
275
|
downloadProjectFile: '--project_id and --file_id',
|
|
@@ -103,6 +103,15 @@ const kbService = {
|
|
|
103
103
|
.option('--user <user>', 'Specify user')
|
|
104
104
|
.option('--gateway <url>', 'Override kanboard gateway')
|
|
105
105
|
.action(createKbAction('getAllComments'));
|
|
106
|
+
// getColumns 支持快捷参数 --project_id
|
|
107
|
+
cmd
|
|
108
|
+
.command('getColumns')
|
|
109
|
+
.description(METHOD_DESCRIPTIONS.getColumns)
|
|
110
|
+
.option('--params <json>', 'JSON/JSON5 params; CLI fills jsonrpc/method/id')
|
|
111
|
+
.option('--project_id <id>', 'Project ID (shortcut)')
|
|
112
|
+
.option('--user <user>', 'Specify user')
|
|
113
|
+
.option('--gateway <url>', 'Override kanboard gateway')
|
|
114
|
+
.action(createKbAction('getColumns'));
|
|
106
115
|
// createComment 支持快捷参数 --task_id / --user_id / --content
|
|
107
116
|
cmd
|
|
108
117
|
.command('createComment')
|
|
@@ -122,6 +131,7 @@ const kbService = {
|
|
|
122
131
|
item !== 'searchSubtasks' &&
|
|
123
132
|
item !== 'getAllActiveIterations' &&
|
|
124
133
|
item !== 'getAllCategories' &&
|
|
134
|
+
item !== 'getColumns' &&
|
|
125
135
|
item !== 'getAllComments' &&
|
|
126
136
|
item !== 'createComment' &&
|
|
127
137
|
item !== 'downloadProjectFile' &&
|
|
@@ -35,6 +35,9 @@ export const PARAM_DEFS = {
|
|
|
35
35
|
getAllCategories: [
|
|
36
36
|
{ name: 'project_id', type: 'integer', required: true, description: '项目 ID' },
|
|
37
37
|
],
|
|
38
|
+
getColumns: [
|
|
39
|
+
{ name: 'project_id', type: 'integer', required: true, description: '项目 ID' },
|
|
40
|
+
],
|
|
38
41
|
getAllComments: [
|
|
39
42
|
{ name: 'task_id', type: 'integer', required: true, description: '需求/bug ID' },
|
|
40
43
|
],
|
|
@@ -5,6 +5,7 @@ export const METHOD_SHORTCUT_PARAMS = {
|
|
|
5
5
|
searchSubtasks: ['project_id', 'iteration_id', 'user_id', 'page'],
|
|
6
6
|
getAllActiveIterations: ['project_id'],
|
|
7
7
|
getAllCategories: ['project_id'],
|
|
8
|
+
getColumns: ['project_id'],
|
|
8
9
|
getAllComments: ['task_id'],
|
|
9
10
|
createComment: ['task_id', 'user_id', 'content'],
|
|
10
11
|
createProjectFile: ['file', 'project_id'],
|