@kisev/agentomatic 12.0.1-dev.126.g020f34744898 → 12.0.1-dev.127.g96b4fdeed7cd

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.
Files changed (2) hide show
  1. package/dist/command-cli.js +49 -54
  2. package/package.json +2 -2
@@ -51,20 +51,13 @@ const commands = {
51
51
  description: "Remove owned components; disconnect the plugin by default; retain models and npm dependency unless selected.",
52
52
  options: ["disconnect", "removeDependency"],
53
53
  },
54
- agent: { description: "List agents or manage additional critics.", options: [] },
55
- "agent list": {
56
- description: "Show installed and saved profiles, models, ownership, collisions, and drift.",
54
+ agent: {
55
+ description: "Read-only agent overview: profiles, models, ownership, collisions, and drift (mutations: configure agent).",
57
56
  options: [],
58
57
  },
59
- "agent add-critic": {
60
- description: "Add critic-<name> interactively or with an explicit model.",
61
- options: ["provider", "model", "variant"],
62
- name: true,
63
- },
64
- "agent remove": {
65
- description: "Remove an additional critic; fixed roles cannot be removed here.",
58
+ "agent list": {
59
+ description: "Show installed and saved profiles, models, ownership, collisions, and drift.",
66
60
  options: [],
67
- name: true,
68
61
  },
69
62
  maintenance: {
70
63
  description: "Clean up retired files, repair selected components, or recover an interrupted transaction.",
@@ -89,6 +82,15 @@ const commands = {
89
82
  };
90
83
  const mutationOptions = new Set(["dryRun", "yes"]);
91
84
  const observations = new Set(["status", "doctor", "agent list", "catalog"]);
85
+ // Mutations were unified into configure agent; removed commands answer with a
86
+ // one-line pointer to it.
87
+ const removedCommands = {
88
+ "agent add-critic": "Removed command; agentomatic configure agent is the single mutation point for agent models and critics",
89
+ "agent remove": "Removed command; agentomatic configure agent is the single mutation point for agent models and critics",
90
+ };
91
+ function failRemoved(topic) {
92
+ return fail("invalid_input", removedCommands[topic]);
93
+ }
92
94
  function fail(code, message) {
93
95
  throw new InstallerError(code, message);
94
96
  }
@@ -125,6 +127,8 @@ async function promptCriticName() {
125
127
  }
126
128
  }
127
129
  function help(topic = "") {
130
+ if (topic && removedCommands[topic])
131
+ failRemoved(topic);
128
132
  if (topic && !commands[topic])
129
133
  fail("invalid_input", `Unknown command: ${topic}`);
130
134
  const visible = topic
@@ -177,7 +181,7 @@ function help(topic = "") {
177
181
  "Use status to inspect the installation, doctor to diagnose problems, and maintenance for explicit recovery.",
178
182
  "",
179
183
  "Examples:",
180
- ` ${shellCommand([...(topic ? topic.split(" ") : ["install"]), ...(commands[topic]?.name ? [topic === "agent remove" ? "critic-security" : "critic"] : []), ...(observations.has(topic) || ["agent", "maintenance"].includes(topic) ? [] : ["--dry-run"])])}`,
184
+ ` ${shellCommand([...(topic ? topic.split(" ") : ["install"]), ...(commands[topic]?.name ? ["critic"] : []), ...(observations.has(topic) || ["agent", "maintenance"].includes(topic) ? [] : ["--dry-run"])])}`,
181
185
  "Documentation: https://github.com/kisev/skills/blob/main/docs/how-to/opencode-integration.md",
182
186
  "",
183
187
  ].join("\n");
@@ -689,20 +693,18 @@ async function profileChange(options, request) {
689
693
  if (!options.json) {
690
694
  const args = request.changes
691
695
  ? ["configure", "critics"]
692
- : request.action === "critic-remove"
693
- ? ["agent", "remove", request.name]
694
- : [
695
- request.action === "critic-add" ? "agent" : "configure",
696
- request.action === "critic-add" ? "add-critic" : "agent",
697
- request.name,
698
- "--model",
699
- request.model,
700
- ...(request.variant
701
- ? ["--variant", request.variant]
702
- : request.action === "model-set"
703
- ? ["--clear-variant"]
704
- : []),
705
- ];
696
+ : [
697
+ "configure",
698
+ "agent",
699
+ request.name,
700
+ "--model",
701
+ request.model,
702
+ ...(request.variant
703
+ ? ["--variant", request.variant]
704
+ : request.action === "model-set"
705
+ ? ["--clear-variant"]
706
+ : []),
707
+ ];
706
708
  process.stdout.write(renderPlan(plan, {
707
709
  applied: false,
708
710
  applyHint: applyHint([...args, ...scopeArguments(options.scope)]),
@@ -830,12 +832,16 @@ async function run(args) {
830
832
  return;
831
833
  }
832
834
  if (args.includes("--help") || args.includes("-h")) {
835
+ if (removedCommands[topic])
836
+ failRemoved(topic);
833
837
  if (!commands[topic])
834
838
  fail("invalid_input", `Unknown command: ${topic}`);
835
839
  parse(topic, args.filter((arg) => !["--help", "-h"].includes(arg)));
836
840
  process.stdout.write(help(topic));
837
841
  return;
838
842
  }
843
+ if (removedCommands[topic])
844
+ failRemoved(topic);
839
845
  if (!commands[topic]) {
840
846
  const match = [...new Set(Object.keys(commands).map((key) => key.split(" ", 1)[0]))].find((root) => root.startsWith(topic) || topic.startsWith(root));
841
847
  fail("invalid_input", `Unknown command: ${topic}.${match ? ` Did you mean '${match}'?` : ""} Use install, configure, status, doctor, uninstall, agent, maintenance, or catalog.`);
@@ -904,12 +910,11 @@ async function run(args) {
904
910
  process.exitCode = doctorExitCode(report);
905
911
  return;
906
912
  }
907
- if (topic === "configure critics" ||
908
- topic === "configure agent" ||
909
- topic === "agent add-critic") {
913
+ if (topic === "configure critics" || topic === "configure agent") {
910
914
  const inventory = await listAgentProfiles(options.scope);
911
- // configure critics is an alias; a nameless configure agent opens the same staged editor.
912
- if (topic === "configure critics" || (topic === "configure agent" && !options.name)) {
915
+ // configure critics is an alias; a nameless configure agent opens the staged
916
+ // editor - the single mutation point for models, additions, and removals.
917
+ if (!options.name) {
913
918
  requireApply(options);
914
919
  if (!options.json)
915
920
  process.stdout.write(renderCriticsTable(inventory));
@@ -926,30 +931,20 @@ async function run(args) {
926
931
  await profileChange(options, { action: "model-set", changes });
927
932
  return;
928
933
  }
929
- let name = options.name;
930
- if (!name) {
931
- if (topic === "agent add-critic")
932
- name = await promptCriticName();
933
- else {
934
- const names = inventory.profiles
935
- .filter((profile) => profile.ownership !== "user-owned")
936
- .map((profile) => profile.name);
937
- name = names[value(await selectOption("Agent", names))];
938
- }
934
+ const name = options.name;
935
+ const existing = inventory.profiles.find((profile) => profile.name === name);
936
+ if (!existing && !name.startsWith("critic-")) {
937
+ fail("invalid_input", `Unknown agent profile: ${name}`);
939
938
  }
940
- if (topic === "agent add-critic" && !name.startsWith("critic-"))
941
- name = `critic-${name}`;
942
- const request = await modelSelection(options, name, inventory.profiles.find((profile) => profile.name === name));
943
- await profileChange(options, {
944
- ...request,
945
- action: topic === "agent add-critic" ? "critic-add" : "model-set",
946
- });
947
- return;
948
- }
949
- if (topic === "agent remove") {
950
- if (!options.name)
951
- fail("invalid_input", "agent remove requires an additional critic name");
952
- await profileChange(options, { action: "critic-remove", name: options.name });
939
+ if (!existing) {
940
+ // configure agent on a fresh critic-<name> adds the critic: one command
941
+ // covers model-set for existing profiles and critic-add for new critics.
942
+ const request = await modelSelection(options, name, undefined);
943
+ await profileChange(options, { ...request, action: "critic-add" });
944
+ return;
945
+ }
946
+ const request = await modelSelection(options, name, existing);
947
+ await profileChange(options, { ...request, action: "model-set" });
953
948
  return;
954
949
  }
955
950
  if (topic === "maintenance recover") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kisev/agentomatic",
3
- "version": "12.0.1-dev.126.g020f34744898",
3
+ "version": "12.0.1-dev.127.g96b4fdeed7cd",
4
4
  "description": "OpenCode integration and opt-in installer for portable Agent Skills.",
5
5
  "homepage": "https://github.com/kisev/skills#readme",
6
6
  "bugs": {
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@clack/prompts": "^1.8.1",
53
- "@kisev/safe-fs": "12.0.1-dev.126.g020f34744898",
53
+ "@kisev/safe-fs": "12.0.1-dev.127.g96b4fdeed7cd",
54
54
  "commander": "15.0.0",
55
55
  "zod": "4.1.8"
56
56
  },