@mutagent/cli 0.2.122 → 0.2.124
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 +99 -12
- package/package.json +2 -2
package/dist/bin/cli.js
CHANGED
|
@@ -19907,7 +19907,7 @@ var PROVIDER_CATALOG = [
|
|
|
19907
19907
|
modelPolicy: {
|
|
19908
19908
|
mode: "floor",
|
|
19909
19909
|
floor: "5.5",
|
|
19910
|
-
knownMembers: ["gpt-
|
|
19910
|
+
knownMembers: ["gpt-6-astra", "gpt-6.1-sol", "gpt-6-luna"],
|
|
19911
19911
|
summary: "GPT models at or above 5.5. FR-CORE-008 states the floor and then enumerates the members current at writing; the floor is the rule, the enumeration is the snapshot."
|
|
19912
19912
|
},
|
|
19913
19913
|
description: "GPT models served directly by OpenAI."
|
|
@@ -19920,13 +19920,17 @@ var PROVIDER_CATALOG = [
|
|
|
19920
19920
|
modelPolicy: {
|
|
19921
19921
|
mode: "explicit",
|
|
19922
19922
|
models: [
|
|
19923
|
+
"claude-opus-5-5",
|
|
19924
|
+
"claude-fable-5-1",
|
|
19925
|
+
"claude-sonnet-5-5",
|
|
19926
|
+
"claude-haiku-5-5",
|
|
19923
19927
|
"claude-opus-5",
|
|
19924
19928
|
"claude-sonnet-5",
|
|
19925
19929
|
"claude-fable-5",
|
|
19926
19930
|
"claude-opus-4-8",
|
|
19927
19931
|
"claude-haiku-4-5"
|
|
19928
19932
|
],
|
|
19929
|
-
summary: "The Claude 5
|
|
19933
|
+
summary: "The current Claude family (Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5), plus Opus 5, Sonnet 5, Fable 5, Opus 4.8 and Haiku 4.5."
|
|
19930
19934
|
},
|
|
19931
19935
|
description: "Claude models served directly by Anthropic."
|
|
19932
19936
|
},
|
|
@@ -22123,7 +22127,10 @@ before the first use.
|
|
|
22123
22127
|
name, targets, components) and wait for the user's yes. Never run \`factory add\`
|
|
22124
22128
|
without it. Then register:
|
|
22125
22129
|
\`mutagent factory add <agentspec-file> --json\`. The file's git remote, path and
|
|
22126
|
-
HEAD commit are read from its checkout and recorded as v1.
|
|
22130
|
+
HEAD commit are read from its checkout and recorded as v1. When the spec sets
|
|
22131
|
+
\`spec.traceSource\` (a trace-source id from \`mutagent integrations sources list\`),
|
|
22132
|
+
the entry's trace source is set to it; \`traceSourceUpdate\` reports the outcome, and
|
|
22133
|
+
a refusal there (its \`code\`) leaves the entry registered: tell the user the code.
|
|
22127
22134
|
4. **Show the result.** Render \`_directive.renderedCard\` verbatim, then
|
|
22128
22135
|
\`mutagent factory show <id> --json\` to show the targets and the spec version.
|
|
22129
22136
|
5. **Record the spec stage**: \`mutagent factory stage record --stage spec --state succeeded --spec-version <n> --json\`
|
|
@@ -22256,7 +22263,10 @@ the version this checkout last wrote (\`spec get --out\`) or pushed. Read
|
|
|
22256
22263
|
2. **Validate.** \`mutagent factory spec push <id> <file> --dry-run --json\`.
|
|
22257
22264
|
3. **Confirm with the user**, then push with a reason:
|
|
22258
22265
|
\`mutagent factory spec push <id> <file> --message "<why>" --json\`.
|
|
22259
|
-
The git commit defaults to HEAD when the file is tracked and unmodified.
|
|
22266
|
+
The git commit defaults to HEAD when the file is tracked and unmodified. A
|
|
22267
|
+
\`spec.traceSource\` that differs from the entry's is then set on the entry
|
|
22268
|
+
(\`traceSourceUpdate\`); if that step is refused (in a sandbox: \`PERMISSION_DENIED\`),
|
|
22269
|
+
the push still stands: report the code, do not push again.
|
|
22260
22270
|
4. Show \`_directive.renderedCard\` verbatim: it names the new version.
|
|
22261
22271
|
|
|
22262
22272
|
Targets and components update from the spec; there is no separate update command.
|
|
@@ -27414,6 +27424,7 @@ import { factoryListFactoryEntries } from "@mutagent/sdk/funcs/factory-list-fact
|
|
|
27414
27424
|
import { factoryListFactorySpecVersions } from "@mutagent/sdk/funcs/factory-list-factory-spec-versions.js";
|
|
27415
27425
|
import { factoryListFactoryStageRuns } from "@mutagent/sdk/funcs/factory-list-factory-stage-runs.js";
|
|
27416
27426
|
import { factoryPushFactorySpec } from "@mutagent/sdk/funcs/factory-push-factory-spec.js";
|
|
27427
|
+
import { factorySetFactoryEntryTraceSource } from "@mutagent/sdk/funcs/factory-set-factory-entry-trace-source.js";
|
|
27417
27428
|
|
|
27418
27429
|
// src/lib/platform-sdk.ts
|
|
27419
27430
|
import { HTTPClient as HTTPClient3, Mutagent as Mutagent3 } from "@mutagent/sdk";
|
|
@@ -27657,6 +27668,7 @@ var factoryApi = {
|
|
|
27657
27668
|
specVersions: (c, id, query, help) => sdkJson(c, (sdk) => factoryListFactorySpecVersions(sdk, { id, ...query }), help),
|
|
27658
27669
|
specVersion: (c, id, version, help) => sdkJson(c, (sdk) => factoryGetFactorySpecVersion(sdk, { id, version, raw: true }), help),
|
|
27659
27670
|
pushSpec: (c, id, body, ifMatch, help) => sdkJson(c, (sdk) => factoryPushFactorySpec(sdk, { id, ...ifMatch === undefined ? {} : { ifMatch }, body }), help),
|
|
27671
|
+
setTraceSource: (c, id, traceSource, help) => sdkJson(c, (sdk) => factorySetFactoryEntryTraceSource(sdk, { id, body: { traceSource } }), help),
|
|
27660
27672
|
sync: (c, id, query, help) => sdkJson(c, (sdk) => factoryGetFactorySyncState(sdk, { id, ...query }), help),
|
|
27661
27673
|
createStageRun: (c, id, body, help) => sdkJson(c, (sdk) => factoryCreateFactoryStageRun(sdk, { id, body: stageRunBody(body) }), help),
|
|
27662
27674
|
listStageRuns: (c, id, query, help) => sdkJson(c, (sdk) => factoryListFactoryStageRuns(sdk, { id, ...query }), help),
|
|
@@ -36784,6 +36796,56 @@ import { Command as Command30 } from "commander";
|
|
|
36784
36796
|
import chalk66 from "chalk";
|
|
36785
36797
|
init_errors();
|
|
36786
36798
|
|
|
36799
|
+
// src/lib/factory-trace-source.ts
|
|
36800
|
+
init_errors();
|
|
36801
|
+
function specTraceSource(spec) {
|
|
36802
|
+
const value = spec.parsed.spec?.traceSource;
|
|
36803
|
+
return typeof value === "string" ? value : undefined;
|
|
36804
|
+
}
|
|
36805
|
+
async function applySpecTraceSource(conn, entryId, wanted, current, opts) {
|
|
36806
|
+
if (wanted === undefined)
|
|
36807
|
+
return;
|
|
36808
|
+
let previous;
|
|
36809
|
+
try {
|
|
36810
|
+
previous = await current();
|
|
36811
|
+
if (previous === wanted)
|
|
36812
|
+
return { state: "unchanged", traceSource: wanted, previous };
|
|
36813
|
+
if (opts.dryRun)
|
|
36814
|
+
return { state: "would-set", traceSource: wanted, previous };
|
|
36815
|
+
const answer = await factoryApi.setTraceSource(conn, entryId, wanted, opts.help);
|
|
36816
|
+
return { state: "set", traceSource: answer.traceSource ?? wanted, previous };
|
|
36817
|
+
} catch (error) {
|
|
36818
|
+
if (!(error instanceof MutagentError))
|
|
36819
|
+
throw error;
|
|
36820
|
+
return {
|
|
36821
|
+
state: "refused",
|
|
36822
|
+
traceSource: wanted,
|
|
36823
|
+
...previous === undefined ? {} : { previous },
|
|
36824
|
+
code: error.code,
|
|
36825
|
+
error: error.message,
|
|
36826
|
+
...error.suggestion === undefined ? {} : { suggestedAction: error.suggestion }
|
|
36827
|
+
};
|
|
36828
|
+
}
|
|
36829
|
+
}
|
|
36830
|
+
function describeTraceSourceUpdate(update, written) {
|
|
36831
|
+
const was = update.previous === undefined ? "" : ` (was ${update.previous ?? "the Mutagent store"})`;
|
|
36832
|
+
switch (update.state) {
|
|
36833
|
+
case "set":
|
|
36834
|
+
return { warn: false, text: `Trace source set to ${update.traceSource}${was}` };
|
|
36835
|
+
case "unchanged":
|
|
36836
|
+
return { warn: false, text: `Trace source is already ${update.traceSource}` };
|
|
36837
|
+
case "would-set":
|
|
36838
|
+
return { warn: false, text: `Would set the trace source to ${update.traceSource}${was}; nothing was sent` };
|
|
36839
|
+
case "refused":
|
|
36840
|
+
return { warn: true, text: `${written} stands; setting the trace source to ${update.traceSource} was refused: ${update.code ?? "ERROR"}: ${update.error ?? ""}` };
|
|
36841
|
+
}
|
|
36842
|
+
}
|
|
36843
|
+
function traceSourceTips(update) {
|
|
36844
|
+
if (update?.state !== "refused")
|
|
36845
|
+
return [];
|
|
36846
|
+
return [`Trace source not set (${update.code ?? "ERROR"}); the spec write stands.${update.suggestedAction === undefined ? "" : ` ${update.suggestedAction}`}`];
|
|
36847
|
+
}
|
|
36848
|
+
|
|
36787
36849
|
// src/lib/factory-local.ts
|
|
36788
36850
|
init_dist();
|
|
36789
36851
|
init_errors();
|
|
@@ -37738,7 +37800,8 @@ var SpecSchema = closed({
|
|
|
37738
37800
|
workflow: Type.Optional(WorkflowBodySchema),
|
|
37739
37801
|
targets: Type.Array(TargetSchema),
|
|
37740
37802
|
evaluation: EvaluationSchema,
|
|
37741
|
-
decisionsRef: Type.Optional(Str())
|
|
37803
|
+
decisionsRef: Type.Optional(Str()),
|
|
37804
|
+
traceSource: Type.Optional(Str())
|
|
37742
37805
|
});
|
|
37743
37806
|
var agentSpecRootProps = {
|
|
37744
37807
|
apiVersion: Type.Literal(AGENTSPEC_API_VERSION),
|
|
@@ -38493,7 +38556,8 @@ function registerAdd2(factory) {
|
|
|
38493
38556
|
"The spec is validated here (AgentSpec 0.3.0) before anything is sent. A system's",
|
|
38494
38557
|
"spec.multiAgent.members[].specRef files are read for their metadata.id, resolved from",
|
|
38495
38558
|
"the spec file's folder (stdin and --spec: the working directory). The git remote, path",
|
|
38496
|
-
"and HEAD commit are read from the file's checkout."
|
|
38559
|
+
"and HEAD commit are read from the file's checkout. spec.traceSource, when set, is then set on",
|
|
38560
|
+
"the entry; a refusal of that step is reported in traceSourceUpdate by its code, and the entry stays."
|
|
38497
38561
|
],
|
|
38498
38562
|
examples: [
|
|
38499
38563
|
"mutagent factory add agents/invoice-pricing/agentspec.yaml --json",
|
|
@@ -38525,17 +38589,27 @@ function registerAdd2(factory) {
|
|
|
38525
38589
|
const id = result.entry.id;
|
|
38526
38590
|
if (!result.dryRun && result.entry.specVersion !== null)
|
|
38527
38591
|
writeBase(checkoutRoot(spec.input.file), id, result.entry.specVersion.id, spec.input.file);
|
|
38592
|
+
const traceSourceUpdate = await applySpecTraceSource(conn, id, specTraceSource(spec), () => Promise.resolve(result.entry.traceSource ?? null), { dryRun: result.dryRun, help: "mutagent factory add --help" });
|
|
38593
|
+
const entry = traceSourceUpdate?.state === "set" ? { ...result.entry, traceSource: traceSourceUpdate.traceSource } : result.entry;
|
|
38528
38594
|
const links = factoryLinks(conn.endpoint, id);
|
|
38529
38595
|
const tips = [
|
|
38530
38596
|
`Next spec change: mutagent factory spec push ${arg(id)} <file>`,
|
|
38531
|
-
`Record work on it: mutagent factory stage record ${arg(id)} --stage <s> --state <s
|
|
38597
|
+
`Record work on it: mutagent factory stage record ${arg(id)} --stage <s> --state <s>`,
|
|
38598
|
+
...traceSourceTips(traceSourceUpdate)
|
|
38532
38599
|
];
|
|
38533
38600
|
if (isJson) {
|
|
38534
|
-
output.output({ success: true, dryRun: result.dryRun, entry:
|
|
38601
|
+
output.output({ success: true, dryRun: result.dryRun, entry, ...traceSourceUpdate === undefined ? {} : { traceSourceUpdate }, _links: links, _directive: { tips } });
|
|
38535
38602
|
return;
|
|
38536
38603
|
}
|
|
38537
38604
|
output.success(result.dryRun ? `Valid: would register ${id} (${result.entry.kind}); nothing was written` : `Registered ${id} (${result.entry.kind}), spec v${String(result.entry.specVersion?.id ?? 1)}`);
|
|
38538
38605
|
console.log(` ${links.ui}`);
|
|
38606
|
+
if (traceSourceUpdate !== undefined) {
|
|
38607
|
+
const line = describeTraceSourceUpdate(traceSourceUpdate, `The registration of ${id}`);
|
|
38608
|
+
if (line.warn)
|
|
38609
|
+
output.warn(line.text);
|
|
38610
|
+
else
|
|
38611
|
+
output.info(line.text);
|
|
38612
|
+
}
|
|
38539
38613
|
for (const tip of tips)
|
|
38540
38614
|
output.info(tip);
|
|
38541
38615
|
});
|
|
@@ -38801,7 +38875,11 @@ function registerStatus(spec) {
|
|
|
38801
38875
|
}
|
|
38802
38876
|
function registerPush(spec) {
|
|
38803
38877
|
spec.command("push").description("Validate an agentspec and record it as the entry's next spec version").argument("[id]", "The entry id; must equal the file's metadata.id (in a sandbox with only the file: the bound entry)").argument("[agentspec-file]", "Path, or - for stdin (not with --spec)").option("--spec <yaml>", "Raw YAML text instead of a file").option("--base <n>", "The spec version this file was made from (default: the one recorded in this checkout)").option("--git-commit <sha>", "Commit the file came from (default: HEAD, when the file is tracked and unmodified)").option("--message <text>", "Why it changed").option("--dry-run", "Validate only; nothing is written").addHelpText("after", leafHelp({
|
|
38804
|
-
notes: [
|
|
38878
|
+
notes: [
|
|
38879
|
+
"Components (spec.multiAgent.members[]), their pins and targets[] update from the spec; the git location comes from the checkout.",
|
|
38880
|
+
"spec.traceSource, when it differs from the entry's, is then set on the entry; a refusal of that step",
|
|
38881
|
+
"(e.g. PERMISSION_DENIED in a sandbox) is reported in traceSourceUpdate by its code, and the push stands."
|
|
38882
|
+
],
|
|
38805
38883
|
examples: [
|
|
38806
38884
|
'mutagent factory spec push support-triage agents/support-triage/agentspec.yaml --message "Add refund-agent v3" --json',
|
|
38807
38885
|
"mutagent factory spec push invoice-pricing agentspec.yaml --base 6 --json",
|
|
@@ -38845,9 +38923,11 @@ function registerPush(spec) {
|
|
|
38845
38923
|
const version = result.specVersion.id;
|
|
38846
38924
|
if (!result.dryRun)
|
|
38847
38925
|
writeBase(root, entryId, version, spec.input.file);
|
|
38848
|
-
const
|
|
38926
|
+
const help = "mutagent factory spec push --help";
|
|
38927
|
+
const traceSourceUpdate = await applySpecTraceSource(conn, entryId, specTraceSource(spec), async () => (await factoryApi.getEntry(conn, entryId, help)).traceSource, { dryRun: result.dryRun, help });
|
|
38928
|
+
const tips = [`Stage runs and reports you record next resolve to v${String(version)}`, ...traceSourceTips(traceSourceUpdate)];
|
|
38849
38929
|
if (isJson) {
|
|
38850
|
-
output.output({ success: true, ...result, sync: result.dryRun ? "unchanged" : "in-sync", _links: factoryLinks(conn.endpoint, entryId), _directive: { tips } });
|
|
38930
|
+
output.output({ success: true, ...result, sync: result.dryRun ? "unchanged" : "in-sync", ...traceSourceUpdate === undefined ? {} : { traceSourceUpdate }, _links: factoryLinks(conn.endpoint, entryId), _directive: { tips } });
|
|
38851
38931
|
return;
|
|
38852
38932
|
}
|
|
38853
38933
|
if (result.dryRun)
|
|
@@ -38858,6 +38938,13 @@ function registerPush(spec) {
|
|
|
38858
38938
|
output.success(`Pushed ${entryId} v${String(version)} (base v${String(base)})`);
|
|
38859
38939
|
for (const change of result.components.changed)
|
|
38860
38940
|
output.info(`Pin moved: ${change.id} v${String(change.pinned.from ?? "—")} → v${String(change.pinned.to)}`);
|
|
38941
|
+
if (traceSourceUpdate !== undefined) {
|
|
38942
|
+
const line = describeTraceSourceUpdate(traceSourceUpdate, `The push (v${String(version)})`);
|
|
38943
|
+
if (line.warn)
|
|
38944
|
+
output.warn(line.text);
|
|
38945
|
+
else
|
|
38946
|
+
output.info(line.text);
|
|
38947
|
+
}
|
|
38861
38948
|
});
|
|
38862
38949
|
});
|
|
38863
38950
|
}
|
|
@@ -40491,4 +40578,4 @@ if (process.env.CLI_VERSION) {
|
|
|
40491
40578
|
}
|
|
40492
40579
|
runCli(process.argv.slice(2), cliVersion);
|
|
40493
40580
|
|
|
40494
|
-
//# debugId=
|
|
40581
|
+
//# debugId=EC8D8A955FE754FB64756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mutagent/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.124",
|
|
4
4
|
"description": "Bun-native CLI for the MutagenT AI platform - auth, provider config, and lifecycle-tool installer for AI-native workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@inquirer/prompts": "^8.7.2",
|
|
48
|
-
"@mutagent/sdk": "0.8.
|
|
48
|
+
"@mutagent/sdk": "0.8.64",
|
|
49
49
|
"@sinclair/typebox": "^0.34.0",
|
|
50
50
|
"chalk": "^5.3.0",
|
|
51
51
|
"commander": "^12.1.0",
|