@mutagent/cli 0.2.22 → 0.2.23
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/bin/cli.js +38 -24
- package/package.json +1 -1
package/dist/bin/cli.js
CHANGED
|
@@ -19762,15 +19762,18 @@ var LEAVES = {
|
|
|
19762
19762
|
get: {
|
|
19763
19763
|
details: `Reads a revision's agentspec, parsed: id, kind, version, description,
|
|
19764
19764
|
criteria, tools, skills, harnesses, targets and instructions. Without --revision:
|
|
19765
|
-
the default slot's active revision, else the newest. A revision
|
|
19766
|
-
|
|
19765
|
+
the default slot's active revision, else the newest. A revision with no
|
|
19766
|
+
agentspec answers status absent (agent.md defines the agent; the spec is
|
|
19767
|
+
optional). A revision whose spec cannot be read answers status unreadable with
|
|
19768
|
+
the reason. Both exit 0: they are data.
|
|
19767
19769
|
--out writes the revision's raw agentspec.yaml bytes to a file; replacing an
|
|
19768
19770
|
existing file needs --force.
|
|
19769
19771
|
Examples:
|
|
19770
19772
|
mutagent agent spec get invoice-pricing --json
|
|
19771
19773
|
mutagent agent spec get invoice-pricing --out agentspec.yaml --force`,
|
|
19772
|
-
directive: ` Read-only on the platform. --json prints { slug, status, revision, path, spec }
|
|
19773
|
-
|
|
19774
|
+
directive: ` Read-only on the platform. --json prints { slug, status, revision, path, spec };
|
|
19775
|
+
{ status: "absent", path: null } when the revision has no agentspec (not an error);
|
|
19776
|
+
or { status: "unreadable", reason } when one is there but fails to read. With --out, 'written' names the file
|
|
19774
19777
|
and its digest. Replacing a file is destructive: confirm with the user before --force.`
|
|
19775
19778
|
},
|
|
19776
19779
|
diff: {
|
|
@@ -19826,29 +19829,40 @@ function parseRevision(value) {
|
|
|
19826
19829
|
usageError("--revision must be a revision such as v3 or 3.", "spec get");
|
|
19827
19830
|
return number;
|
|
19828
19831
|
}
|
|
19829
|
-
function
|
|
19832
|
+
function specCardLines(result) {
|
|
19830
19833
|
const where = `${String(result.slug)} v${String(result.revision)} ${typeof result.path === "string" ? result.path : "(no agentspec)"}`;
|
|
19834
|
+
if (result.status === "absent") {
|
|
19835
|
+
return [
|
|
19836
|
+
`${chalk2.bold(where)} ${chalk2.dim("no spec")}`,
|
|
19837
|
+
chalk2.dim(" agent.md defines this agent, so an agentspec is optional.")
|
|
19838
|
+
];
|
|
19839
|
+
}
|
|
19831
19840
|
if (result.status !== "readable") {
|
|
19832
|
-
|
|
19833
|
-
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
|
|
19837
|
-
|
|
19838
|
-
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19845
|
-
}
|
|
19846
|
-
|
|
19847
|
-
|
|
19848
|
-
|
|
19841
|
+
return [`${chalk2.bold(where)} ${chalk2.yellow("unreadable")}`, ` ${String(result.reason)}`];
|
|
19842
|
+
}
|
|
19843
|
+
const spec = result.spec;
|
|
19844
|
+
const lines = [
|
|
19845
|
+
`${chalk2.bold(where)} ${chalk2.dim(`profile ${spec.profile}`)}`,
|
|
19846
|
+
` id: ${spec.id} kind: ${spec.kind} version: ${spec.version || "(none)"}`
|
|
19847
|
+
];
|
|
19848
|
+
if (spec.description)
|
|
19849
|
+
lines.push(` ${spec.description}`);
|
|
19850
|
+
lines.push(` criteria (${String(spec.criteria.length)}):`);
|
|
19851
|
+
for (const c of spec.criteria)
|
|
19852
|
+
lines.push(` ${c.id || "-"} ${c.type ? `[${c.type}] ` : ""}${c.statement}`);
|
|
19853
|
+
for (const [label, values] of [["tools", spec.tools], ["skills", spec.skills], ["harnesses", spec.harnesses]]) {
|
|
19854
|
+
lines.push(` ${label}: ${values.length > 0 ? values.join(", ") : "-"}`);
|
|
19855
|
+
}
|
|
19856
|
+
lines.push(` targets: ${spec.targets.length > 0 ? spec.targets.map((t) => `${t.type}:${t.name}`).join(", ") : "-"}`);
|
|
19857
|
+
if (spec.instructions)
|
|
19858
|
+
lines.push(` instructions: ${spec.instructions.split(`
|
|
19849
19859
|
`)[0] ?? ""}${spec.instructions.includes(`
|
|
19850
19860
|
`) ? " …" : ""}`);
|
|
19851
|
-
|
|
19861
|
+
return lines;
|
|
19862
|
+
}
|
|
19863
|
+
function printCard(result) {
|
|
19864
|
+
for (const line of specCardLines(result))
|
|
19865
|
+
console.log(line);
|
|
19852
19866
|
const written = result.written;
|
|
19853
19867
|
if (written)
|
|
19854
19868
|
console.log(chalk2.green(`✓ Wrote ${written.file} (${String(written.bytes)} bytes)`));
|
|
@@ -37980,4 +37994,4 @@ if (process.env.CLI_VERSION) {
|
|
|
37980
37994
|
}
|
|
37981
37995
|
runCli(process.argv.slice(2), cliVersion);
|
|
37982
37996
|
|
|
37983
|
-
//# debugId=
|
|
37997
|
+
//# debugId=02AF2BDB9E29C77264756E2164756E21
|
package/package.json
CHANGED