@kisev/skills-opencode 2.1.0 → 2.2.1
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 +6 -5
- package/README.ru.md +5 -5
- package/dist/assets/agents/mapper.md +10 -1
- package/dist/assets/agents/worker.md +12 -1
- package/dist/assets/commands/agents-md.md +1 -1
- package/dist/assets/commands/askme.md +1 -1
- package/dist/assets/commands/ast-grep.md +1 -1
- package/dist/assets/commands/code-explain.md +1 -1
- package/dist/assets/commands/code-review.md +1 -1
- package/dist/assets/commands/commit-msg.md +1 -1
- package/dist/assets/commands/docs-prepare.md +1 -1
- package/dist/assets/commands/docs-review.md +1 -1
- package/dist/assets/commands/doit.md +1 -1
- package/dist/assets/commands/goal.md +1 -1
- package/dist/assets/commands/humanize.md +1 -1
- package/dist/assets/commands/lsp-report.md +1 -1
- package/dist/assets/commands/mattermost.md +1 -1
- package/dist/assets/commands/mr-prepare.md +1 -1
- package/dist/assets/commands/release-prepare.md +1 -1
- package/dist/assets/commands/release-review.md +1 -1
- package/dist/assets/commands/rtk.md +1 -1
- package/dist/assets/commands/skill-improve.md +1 -1
- package/dist/assets/commands/slides-prompts-prepare.md +1 -1
- package/dist/assets/commands/spec-manage.md +1 -1
- package/dist/assets/commands/stopit.md +1 -1
- package/dist/assets/commands/summary.md +1 -1
- package/dist/assets/commands/task-prepare.md +1 -1
- package/dist/assets/commands/task-review.md +1 -1
- package/dist/assets/commands/task-triage.md +1 -1
- package/dist/assets/commands/team-retro.md +1 -1
- package/dist/assets/commands/team-roadmap.md +1 -1
- package/dist/assets/commands/team-sprint-close.md +1 -1
- package/dist/assets/commands/team-sprint-start.md +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.js +1 -1
- package/dist/cli.js +101 -23
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/installer.js +246 -45
- package/dist/plugins/rtk.js +35 -13
- package/dist/plugins/rules-injector.d.ts +1 -1
- package/dist/plugins/rules-injector.js +61 -26
- package/dist/plugins/zed-bell.js +4 -2
- package/dist/registry.js +68 -14
- package/dist/routing.js +34 -2
- package/dist/runtime/state.js +6 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { AgentProfileError, applyAgentProfileChange, availableModels, availableModelVariants, FIXED_AGENT_ROLES, listAgentProfiles, previewAgentProfileChange, validateAgentName, validateModel, validateVariant, } from "./agent-profiles.js";
|
|
3
|
-
import { renderDoctor, renderInventory, renderPlan, renderReconcile, shellCommand, terminalSafe } from "./cli-output.js";
|
|
3
|
+
import { renderDoctor, renderInventory, renderPlan, renderReconcile, shellCommand, terminalSafe, } from "./cli-output.js";
|
|
4
4
|
import { collectDoctorFacts, doctorExitCode } from "./doctor.js";
|
|
5
5
|
import { CATALOG } from "./catalog.js";
|
|
6
|
-
import { apply, defaultSelection, InstallerError, normalizeSelection, PACKAGE_COMMANDS, preview, SELECTABLE_PLUGINS, SKILL_COMMANDS } from "./installer.js";
|
|
6
|
+
import { apply, defaultSelection, InstallerError, normalizeSelection, PACKAGE_COMMANDS, preview, SELECTABLE_PLUGINS, SKILL_COMMANDS, } from "./installer.js";
|
|
7
7
|
import { LifecycleError } from "./lifecycle.js";
|
|
8
8
|
import { applyReconcile, previewReconcile } from "./reconcile.js";
|
|
9
9
|
import { promptText, selectOption } from "./terminal-wizard.js";
|
|
@@ -66,7 +66,12 @@ function parseOptions(values, requireScope = true) {
|
|
|
66
66
|
if (!raw)
|
|
67
67
|
throw new InstallerError("invalid_input", `${value} requires a comma-separated value`);
|
|
68
68
|
const target = value === "--agents" ? "agents" : value === "--plugins" ? "plugins" : "commands";
|
|
69
|
-
const names = raw === "none"
|
|
69
|
+
const names = raw === "none"
|
|
70
|
+
? []
|
|
71
|
+
: raw
|
|
72
|
+
.split(",")
|
|
73
|
+
.map((item) => item.trim())
|
|
74
|
+
.filter(Boolean);
|
|
70
75
|
options.selectionFlag = true;
|
|
71
76
|
if (value === "--package-commands") {
|
|
72
77
|
options.commands = [...(options.commands ?? []), ...names];
|
|
@@ -125,7 +130,11 @@ async function interactiveInstallerSelection() {
|
|
|
125
130
|
];
|
|
126
131
|
const agents = await group("Fixed agents", defaultSelection().agents, 0);
|
|
127
132
|
const plugins = await group("Selectable plugins (none selected by default)", SELECTABLE_PLUGINS, 1);
|
|
128
|
-
return normalizeSelection({
|
|
133
|
+
return normalizeSelection({
|
|
134
|
+
commands,
|
|
135
|
+
agents: agents,
|
|
136
|
+
plugins: plugins,
|
|
137
|
+
});
|
|
129
138
|
}
|
|
130
139
|
function installerSelection(options) {
|
|
131
140
|
return normalizeSelection({
|
|
@@ -136,9 +145,12 @@ function installerSelection(options) {
|
|
|
136
145
|
}
|
|
137
146
|
function selectionArguments(selection) {
|
|
138
147
|
return [
|
|
139
|
-
"--commands",
|
|
140
|
-
|
|
141
|
-
"--
|
|
148
|
+
"--commands",
|
|
149
|
+
selection.commands.join(",") || "none",
|
|
150
|
+
"--agents",
|
|
151
|
+
selection.agents.join(",") || "none",
|
|
152
|
+
"--plugins",
|
|
153
|
+
selection.plugins.join(",") || "none",
|
|
142
154
|
];
|
|
143
155
|
}
|
|
144
156
|
function requireConfirmationMode(options) {
|
|
@@ -166,9 +178,10 @@ async function interactiveSelection(options, action = "model-set") {
|
|
|
166
178
|
const configurable = inventory.profiles.filter((item) => item.ownership !== "user-owned");
|
|
167
179
|
let name;
|
|
168
180
|
if (options.name) {
|
|
169
|
-
name =
|
|
170
|
-
|
|
171
|
-
|
|
181
|
+
name =
|
|
182
|
+
action === "critic-add" && !options.name.startsWith("critic-")
|
|
183
|
+
? validateAgentName(`critic-${options.name}`)
|
|
184
|
+
: validateAgentName(options.name);
|
|
172
185
|
}
|
|
173
186
|
else if (action === "critic-add") {
|
|
174
187
|
const raw = await promptText("Critic name (critic-<suffix>):");
|
|
@@ -261,7 +274,11 @@ async function interactiveSelection(options, action = "model-set") {
|
|
|
261
274
|
throw error;
|
|
262
275
|
}
|
|
263
276
|
showTarget(selectedModel, selectedVariant);
|
|
264
|
-
return {
|
|
277
|
+
return {
|
|
278
|
+
name,
|
|
279
|
+
model: selectedModel,
|
|
280
|
+
...(selectedVariant ? { variant: selectedVariant } : {}),
|
|
281
|
+
};
|
|
265
282
|
}
|
|
266
283
|
if (chosen === "Clear variant") {
|
|
267
284
|
if (!currentModel)
|
|
@@ -284,7 +301,10 @@ async function runProfile(request, options) {
|
|
|
284
301
|
if (options.json)
|
|
285
302
|
process.stdout.write(`${JSON.stringify({ status: "ok", applied: false, requires_restart: false, plan }, null, 2)}\n`);
|
|
286
303
|
else
|
|
287
|
-
process.stdout.write(renderPlan(plan, {
|
|
304
|
+
process.stdout.write(renderPlan(plan, {
|
|
305
|
+
applied: false,
|
|
306
|
+
confirmationCommand: shellCommand(profileConfirmationArguments(request, options.scope, plan.digest)),
|
|
307
|
+
}));
|
|
288
308
|
}
|
|
289
309
|
else {
|
|
290
310
|
const applied = await applyAgentProfileChange(request, options.scope, options.confirm);
|
|
@@ -299,7 +319,9 @@ function profileConfirmationArguments(request, scope, digest) {
|
|
|
299
319
|
return ["agent", "reconcile", "--scope", scope, "--confirm", digest];
|
|
300
320
|
if (request.action === "critic-remove")
|
|
301
321
|
return ["critic", "remove", request.name, "--scope", scope, "--confirm", digest];
|
|
302
|
-
const command = request.action === "critic-add"
|
|
322
|
+
const command = request.action === "critic-add"
|
|
323
|
+
? ["critic", "add", request.name]
|
|
324
|
+
: ["agent", "model-set", request.name];
|
|
303
325
|
command.push("--scope", scope, "--model", request.model);
|
|
304
326
|
if (request.variant)
|
|
305
327
|
command.push("--variant", request.variant);
|
|
@@ -324,7 +346,12 @@ async function run(arguments_) {
|
|
|
324
346
|
if (operation)
|
|
325
347
|
rest.unshift(operation);
|
|
326
348
|
const options = parseOptions(rest);
|
|
327
|
-
if (options.dryRun ||
|
|
349
|
+
if (options.dryRun ||
|
|
350
|
+
options.confirm ||
|
|
351
|
+
options.name ||
|
|
352
|
+
options.provider ||
|
|
353
|
+
options.model ||
|
|
354
|
+
options.variant !== undefined)
|
|
328
355
|
throw new InstallerError("invalid_input", "doctor accepts only --scope and --json");
|
|
329
356
|
const report = await collectDoctorFacts(options.scope);
|
|
330
357
|
if (options.json)
|
|
@@ -336,7 +363,13 @@ async function run(arguments_) {
|
|
|
336
363
|
}
|
|
337
364
|
if (domain === "capabilities") {
|
|
338
365
|
const options = parseOptions(rest, false);
|
|
339
|
-
if (options.dryRun ||
|
|
366
|
+
if (options.dryRun ||
|
|
367
|
+
options.confirm ||
|
|
368
|
+
options.name ||
|
|
369
|
+
options.provider ||
|
|
370
|
+
options.model ||
|
|
371
|
+
options.variant !== undefined ||
|
|
372
|
+
options.selectionFlag)
|
|
340
373
|
throw new InstallerError("invalid_input", "capabilities accepts only --scope and --json");
|
|
341
374
|
process.stdout.write(`${JSON.stringify({ schema_version: 1, status: "ok", ...CATALOG }, null, 2)}\n`);
|
|
342
375
|
return;
|
|
@@ -353,7 +386,18 @@ async function run(arguments_) {
|
|
|
353
386
|
if (options.json)
|
|
354
387
|
process.stdout.write(`${JSON.stringify({ status: "ok", applied: false, plan }, null, 2)}\n`);
|
|
355
388
|
else
|
|
356
|
-
process.stdout.write(renderReconcile(plan, {
|
|
389
|
+
process.stdout.write(renderReconcile(plan, {
|
|
390
|
+
applied: false,
|
|
391
|
+
confirmationCommand: plan.confirmable
|
|
392
|
+
? shellCommand([
|
|
393
|
+
"reconcile",
|
|
394
|
+
"--scope",
|
|
395
|
+
options.scope,
|
|
396
|
+
"--confirm",
|
|
397
|
+
plan.confirmation_digest ?? plan.digest,
|
|
398
|
+
])
|
|
399
|
+
: undefined,
|
|
400
|
+
}));
|
|
357
401
|
}
|
|
358
402
|
else {
|
|
359
403
|
const applied = await applyReconcile(options.scope, options.confirm);
|
|
@@ -373,10 +417,16 @@ async function run(arguments_) {
|
|
|
373
417
|
if (options.name || options.provider || options.model || options.variant !== undefined)
|
|
374
418
|
throw new InstallerError("invalid_input", "Installer accepts only scope and confirmation options");
|
|
375
419
|
const action = domain;
|
|
376
|
-
if (action === "install" &&
|
|
420
|
+
if (action === "install" &&
|
|
421
|
+
options.selectionFlag &&
|
|
422
|
+
(options.commands === undefined ||
|
|
423
|
+
options.agents === undefined ||
|
|
424
|
+
options.plugins === undefined))
|
|
377
425
|
throw new InstallerError("invalid_input", "Non-TTY install requires --commands, --agents, and --plugins");
|
|
378
426
|
const selection = action === "install"
|
|
379
|
-
? options.selectionFlag
|
|
427
|
+
? options.selectionFlag
|
|
428
|
+
? installerSelection(options)
|
|
429
|
+
: await interactiveInstallerSelection()
|
|
380
430
|
: undefined;
|
|
381
431
|
requireConfirmationMode(options);
|
|
382
432
|
if (options.dryRun) {
|
|
@@ -384,7 +434,17 @@ async function run(arguments_) {
|
|
|
384
434
|
if (options.json)
|
|
385
435
|
process.stdout.write(`${JSON.stringify({ status: "ok", applied: false, requires_restart: plan.requires_restart, plan }, null, 2)}\n`);
|
|
386
436
|
else
|
|
387
|
-
process.stdout.write(renderPlan(plan, {
|
|
437
|
+
process.stdout.write(renderPlan(plan, {
|
|
438
|
+
applied: false,
|
|
439
|
+
confirmationCommand: shellCommand([
|
|
440
|
+
action,
|
|
441
|
+
"--scope",
|
|
442
|
+
options.scope,
|
|
443
|
+
...selectionArguments(plan.selection),
|
|
444
|
+
"--confirm",
|
|
445
|
+
plan.digest,
|
|
446
|
+
]),
|
|
447
|
+
}));
|
|
388
448
|
}
|
|
389
449
|
else {
|
|
390
450
|
const plan = await apply(action, options.scope, options.confirm, process.cwd(), undefined, {}, selection);
|
|
@@ -397,7 +457,12 @@ async function run(arguments_) {
|
|
|
397
457
|
}
|
|
398
458
|
if (domain === "agent" && operation === "list") {
|
|
399
459
|
const options = parseOptions(rest);
|
|
400
|
-
if (options.dryRun ||
|
|
460
|
+
if (options.dryRun ||
|
|
461
|
+
options.confirm ||
|
|
462
|
+
options.name ||
|
|
463
|
+
options.provider ||
|
|
464
|
+
options.model ||
|
|
465
|
+
options.variant !== undefined)
|
|
401
466
|
throw new InstallerError("invalid_input", "agent list accepts only --scope");
|
|
402
467
|
const inventory = await listAgentProfiles(options.scope);
|
|
403
468
|
if (options.json)
|
|
@@ -410,7 +475,13 @@ async function run(arguments_) {
|
|
|
410
475
|
const options = parseOptions(rest);
|
|
411
476
|
requireConfirmationMode(options);
|
|
412
477
|
const selected = options.provider && options.model && options.name
|
|
413
|
-
? {
|
|
478
|
+
? {
|
|
479
|
+
name: validateAgentName(options.name),
|
|
480
|
+
model: exactModel(options),
|
|
481
|
+
...(validateVariant(options.variant)
|
|
482
|
+
? { variant: validateVariant(options.variant) }
|
|
483
|
+
: {}),
|
|
484
|
+
}
|
|
414
485
|
: await interactiveSelection(options, "model-set");
|
|
415
486
|
await runProfile({ action: "model-set", ...selected, variant: selected.variant ?? null }, options);
|
|
416
487
|
return;
|
|
@@ -440,7 +511,12 @@ async function run(arguments_) {
|
|
|
440
511
|
const model = exactModel(options);
|
|
441
512
|
if (!model) {
|
|
442
513
|
const selected = await interactiveSelection(options, "critic-add");
|
|
443
|
-
await runProfile({
|
|
514
|
+
await runProfile({
|
|
515
|
+
action: "critic-add",
|
|
516
|
+
name: selected.name,
|
|
517
|
+
model: selected.model,
|
|
518
|
+
variant: selected.variant ?? null,
|
|
519
|
+
}, options);
|
|
444
520
|
}
|
|
445
521
|
else {
|
|
446
522
|
await runProfile({ action: "critic-add", name, model, variant: options.variant ?? null }, options);
|
|
@@ -460,7 +536,9 @@ async function main() {
|
|
|
460
536
|
await run(process.argv.slice(2));
|
|
461
537
|
}
|
|
462
538
|
catch (error) {
|
|
463
|
-
const known = error instanceof LifecycleError
|
|
539
|
+
const known = error instanceof LifecycleError
|
|
540
|
+
? error
|
|
541
|
+
: new InstallerError("internal_error", error instanceof Error ? error.message : String(error));
|
|
464
542
|
if (process.argv.includes("--json"))
|
|
465
543
|
process.stdout.write(`${JSON.stringify({ status: "error", error: { code: known.code, message: known.message } })}\n`);
|
|
466
544
|
else
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type PluginInput } from "@opencode-ai/plugin";
|
|
|
2
2
|
import rulesInjector, { type RulesInjectorOptions } from "./plugins/rules-injector.js";
|
|
3
3
|
import rtk, { type RtkOptions } from "./plugins/rtk.js";
|
|
4
4
|
import zedBell, { type ZedBellOptions } from "./plugins/zed-bell.js";
|
|
5
|
-
export { rulesInjector, rtk, zedBell
|
|
5
|
+
export { rulesInjector, rtk, zedBell };
|
|
6
6
|
export type OpenCodeOptions = {
|
|
7
7
|
rulesInjector?: RulesInjectorOptions;
|
|
8
8
|
rtk?: RtkOptions;
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { applyReconcile, previewReconcile } from "./reconcile.js";
|
|
|
8
8
|
import { collectDoctorFacts } from "./doctor.js";
|
|
9
9
|
import { CATALOG } from "./catalog.js";
|
|
10
10
|
import { digest } from "./lifecycle.js";
|
|
11
|
-
export { rulesInjector, rtk, zedBell
|
|
11
|
+
export { rulesInjector, rtk, zedBell };
|
|
12
12
|
const plugin = (async (input) => {
|
|
13
13
|
const gate = new RoutingGate();
|
|
14
14
|
const hostInventory = async () => {
|