@mono-agent/agent-app 0.12.0 → 0.13.0
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 +33 -7
- package/dist/adapter-send-tools.d.ts.map +1 -1
- package/dist/adapter-send-tools.js +126 -34
- package/dist/adapter-send-tools.js.map +1 -1
- package/dist/app-controller-lifecycle.d.ts.map +1 -1
- package/dist/app-controller-lifecycle.js +2 -6
- package/dist/app-controller-lifecycle.js.map +1 -1
- package/dist/app-controller-maintenance.d.ts.map +1 -1
- package/dist/app-controller-maintenance.js +2 -1
- package/dist/app-controller-maintenance.js.map +1 -1
- package/dist/app-controller-memory-health.d.ts +1 -1
- package/dist/app-controller-memory-health.d.ts.map +1 -1
- package/dist/app-controller-memory-health.js +5 -1
- package/dist/app-controller-memory-health.js.map +1 -1
- package/dist/app-controller-responder.d.ts.map +1 -1
- package/dist/app-controller-responder.js +8 -3
- package/dist/app-controller-responder.js.map +1 -1
- package/dist/app-controller-traceability.d.ts.map +1 -1
- package/dist/app-controller-traceability.js +15 -1
- package/dist/app-controller-traceability.js.map +1 -1
- package/dist/app-controller.d.ts +14 -1
- package/dist/app-controller.d.ts.map +1 -1
- package/dist/app-controller.js +61 -9
- package/dist/app-controller.js.map +1 -1
- package/dist/audit-runs.d.ts.map +1 -1
- package/dist/audit-runs.js +12 -2
- package/dist/audit-runs.js.map +1 -1
- package/dist/background-runtime.d.ts +26 -0
- package/dist/background-runtime.d.ts.map +1 -1
- package/dist/background-runtime.js +874 -46
- package/dist/background-runtime.js.map +1 -1
- package/dist/background.d.ts +10 -2
- package/dist/background.d.ts.map +1 -1
- package/dist/background.js +193 -38
- package/dist/background.js.map +1 -1
- package/dist/channel-drivers/live.d.ts +3 -2
- package/dist/channel-drivers/live.d.ts.map +1 -1
- package/dist/channel-drivers/live.js +3 -2
- package/dist/channel-drivers/live.js.map +1 -1
- package/dist/channel-drivers/slack.d.ts.map +1 -1
- package/dist/channel-drivers/slack.js +6 -0
- package/dist/channel-drivers/slack.js.map +1 -1
- package/dist/channel-drivers/telegram.d.ts.map +1 -1
- package/dist/channel-drivers/telegram.js +20 -4
- package/dist/channel-drivers/telegram.js.map +1 -1
- package/dist/channel-runtime-controls.d.ts +23 -0
- package/dist/channel-runtime-controls.d.ts.map +1 -0
- package/dist/channel-runtime-controls.js +63 -0
- package/dist/channel-runtime-controls.js.map +1 -0
- package/dist/channel-status-display.d.ts +15 -0
- package/dist/channel-status-display.d.ts.map +1 -0
- package/dist/channel-status-display.js +48 -0
- package/dist/channel-status-display.js.map +1 -0
- package/dist/cli-args.d.ts +17 -22
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +107 -75
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-background-command.d.ts +1 -0
- package/dist/cli-background-command.d.ts.map +1 -1
- package/dist/cli-background-command.js +72 -16
- package/dist/cli-background-command.js.map +1 -1
- package/dist/cli-commands.d.ts +2 -2
- package/dist/cli-commands.d.ts.map +1 -1
- package/dist/cli-commands.js +35 -53
- package/dist/cli-commands.js.map +1 -1
- package/dist/cli-help.d.ts +19 -1
- package/dist/cli-help.d.ts.map +1 -1
- package/dist/cli-help.js +209 -67
- package/dist/cli-help.js.map +1 -1
- package/dist/cli-init-command.d.ts.map +1 -1
- package/dist/cli-init-command.js +4 -18
- package/dist/cli-init-command.js.map +1 -1
- package/dist/cli-install-skill-command.d.ts.map +1 -1
- package/dist/cli-install-skill-command.js +32 -3
- package/dist/cli-install-skill-command.js.map +1 -1
- package/dist/cli-runs-command.d.ts +13 -0
- package/dist/cli-runs-command.d.ts.map +1 -0
- package/dist/cli-runs-command.js +70 -0
- package/dist/cli-runs-command.js.map +1 -0
- package/dist/cli-sandbox-command.d.ts +1 -1
- package/dist/cli-sandbox-command.d.ts.map +1 -1
- package/dist/cli-sandbox-command.js +14 -2
- package/dist/cli-sandbox-command.js.map +1 -1
- package/dist/cli-validate-config-command.d.ts +24 -5
- package/dist/cli-validate-config-command.d.ts.map +1 -1
- package/dist/cli-validate-config-command.js +120 -41
- package/dist/cli-validate-config-command.js.map +1 -1
- package/dist/config-reference.js +1 -1
- package/dist/docs-mcp-pairing.d.ts +35 -0
- package/dist/docs-mcp-pairing.d.ts.map +1 -0
- package/dist/docs-mcp-pairing.js +311 -0
- package/dist/docs-mcp-pairing.js.map +1 -0
- package/dist/doctor.d.ts +6 -0
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +3 -3
- package/dist/doctor.js.map +1 -1
- package/dist/install-skill.d.ts +2 -0
- package/dist/install-skill.d.ts.map +1 -1
- package/dist/install-skill.js +10 -4
- package/dist/install-skill.js.map +1 -1
- package/dist/interaction-bridge.d.ts +2 -0
- package/dist/interaction-bridge.d.ts.map +1 -1
- package/dist/interaction-bridge.js +46 -1
- package/dist/interaction-bridge.js.map +1 -1
- package/dist/launchd.d.ts +2 -0
- package/dist/launchd.d.ts.map +1 -1
- package/dist/launchd.js +2 -0
- package/dist/launchd.js.map +1 -1
- package/dist/managed-runtime-publication.d.ts +22 -0
- package/dist/managed-runtime-publication.d.ts.map +1 -0
- package/dist/managed-runtime-publication.js +91 -0
- package/dist/managed-runtime-publication.js.map +1 -0
- package/dist/managed-startup.d.ts +8 -0
- package/dist/managed-startup.d.ts.map +1 -0
- package/dist/managed-startup.js +12 -0
- package/dist/managed-startup.js.map +1 -0
- package/dist/memory-retrieval.d.ts.map +1 -1
- package/dist/memory-retrieval.js +31 -18
- package/dist/memory-retrieval.js.map +1 -1
- package/dist/metrics.d.ts.map +1 -1
- package/dist/metrics.js +12 -2
- package/dist/metrics.js.map +1 -1
- package/dist/posted-reply-history.d.ts.map +1 -1
- package/dist/posted-reply-history.js +7 -0
- package/dist/posted-reply-history.js.map +1 -1
- package/dist/request-model-override.d.ts +2 -2
- package/dist/request-model-override.js +8 -4
- package/dist/request-model-override.js.map +1 -1
- package/dist/run-history.d.ts.map +1 -1
- package/dist/run-history.js +35 -22
- package/dist/run-history.js.map +1 -1
- package/dist/runtime-provenance.d.ts.map +1 -1
- package/dist/runtime-provenance.js +10 -5
- package/dist/runtime-provenance.js.map +1 -1
- package/dist/tui-command.d.ts.map +1 -1
- package/dist/tui-command.js +2 -1
- package/dist/tui-command.js.map +1 -1
- package/dist/wizard/from-flags.d.ts +0 -1
- package/dist/wizard/from-flags.d.ts.map +1 -1
- package/dist/wizard/from-flags.js +1 -8
- package/dist/wizard/from-flags.js.map +1 -1
- package/dist/wizard/index.d.ts +1 -1
- package/dist/wizard/index.d.ts.map +1 -1
- package/dist/wizard/index.js +1 -1
- package/dist/wizard/index.js.map +1 -1
- package/dist/wizard/presets.d.ts +3 -12
- package/dist/wizard/presets.d.ts.map +1 -1
- package/dist/wizard/presets.js +3 -15
- package/dist/wizard/presets.js.map +1 -1
- package/package.json +15 -16
- package/schema/mono-agent.config.schema.json +2 -2
- package/skills/mono-agent-composer/SKILL.md +13 -5
- package/skills/mono-agent-composer/agents/openai.yaml +1 -1
- package/skills/mono-agent-composer/references/config-blueprint.md +17 -9
- package/skills/mono-agent-composer/references/discovery-questions.md +8 -5
- package/skills/mono-agent-composer/references/feature-coverage.md +9 -8
- package/skills/mono-agent-composer/references/package-map.md +10 -4
- package/skills/mono-agent-composer/references/playbooks.md +5 -5
- package/skills/mono-agent-composer/references/validation.md +4 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { MonoAgentConfig } from "@mono-agent/config";
|
|
2
|
+
export interface ChannelRuntimeEffortOption {
|
|
3
|
+
readonly value: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ChannelRuntimeModelOption {
|
|
7
|
+
readonly value: string;
|
|
8
|
+
readonly label: string;
|
|
9
|
+
readonly efforts: readonly ChannelRuntimeEffortOption[];
|
|
10
|
+
}
|
|
11
|
+
export interface ChannelRuntimeControls {
|
|
12
|
+
readonly defaultModel: string;
|
|
13
|
+
readonly defaultEffort?: string;
|
|
14
|
+
readonly models: readonly ChannelRuntimeModelOption[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Build the display-ready runtime catalog shared by native channel controls.
|
|
18
|
+
* Adapters still own their interaction/state behavior; the host owns which
|
|
19
|
+
* configured routes are safe to expose and which effort values each route can
|
|
20
|
+
* actually accept.
|
|
21
|
+
*/
|
|
22
|
+
export declare function buildChannelRuntimeControls(coreConfig: MonoAgentConfig): ChannelRuntimeControls;
|
|
23
|
+
//# sourceMappingURL=channel-runtime-controls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-runtime-controls.d.ts","sourceRoot":"","sources":["../src/channel-runtime-controls.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAY1D,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,SAAS,0BAA0B,EAAE,CAAC;CACzD;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,SAAS,yBAAyB,EAAE,CAAC;CACvD;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,eAAe,GAAG,sBAAsB,CA6B/F"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { EFFORT_LEVELS } from "@mono-agent/config";
|
|
2
|
+
import { modelReferenceKey, resolveModelEffortLevels, } from "@mono-agent/runtime-adapter";
|
|
3
|
+
import { configuredRuntimeFallbackModels, configuredRuntimeModels, } from "./runtime-routes.js";
|
|
4
|
+
/**
|
|
5
|
+
* Build the display-ready runtime catalog shared by native channel controls.
|
|
6
|
+
* Adapters still own their interaction/state behavior; the host owns which
|
|
7
|
+
* configured routes are safe to expose and which effort values each route can
|
|
8
|
+
* actually accept.
|
|
9
|
+
*/
|
|
10
|
+
export function buildChannelRuntimeControls(coreConfig) {
|
|
11
|
+
const refs = [];
|
|
12
|
+
const seen = new Set();
|
|
13
|
+
for (const ref of configuredRuntimeModels(coreConfig.runtime)) {
|
|
14
|
+
const value = modelReferenceKey(ref);
|
|
15
|
+
if (seen.has(value)) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
seen.add(value);
|
|
19
|
+
refs.push(ref);
|
|
20
|
+
}
|
|
21
|
+
const directOpenCodeInFallbacks = configuredRuntimeFallbackModels(coreConfig.runtime)
|
|
22
|
+
.some((ref) => ref.sdk === "opencode");
|
|
23
|
+
return {
|
|
24
|
+
defaultModel: modelReferenceKey(coreConfig.runtime.model),
|
|
25
|
+
...(coreConfig.runtime.effort === undefined ? {} : { defaultEffort: coreConfig.runtime.effort }),
|
|
26
|
+
models: refs.map((ref) => {
|
|
27
|
+
const value = modelReferenceKey(ref);
|
|
28
|
+
return {
|
|
29
|
+
value,
|
|
30
|
+
label: value,
|
|
31
|
+
efforts: channelEffortOptions(ref, coreConfig.providers?.local, ref.sdk === "opencode" || directOpenCodeInFallbacks),
|
|
32
|
+
};
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function channelEffortOptions(ref, localProviders, directOpenCodeInResultingChain) {
|
|
37
|
+
if (directOpenCodeInResultingChain) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
const resolved = resolveModelEffortLevels(ref, localProviders);
|
|
41
|
+
if (!resolved.reasoning || resolved.reasoningMode === "none") {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
if (resolved.reasoningMode === "toggle") {
|
|
45
|
+
return [
|
|
46
|
+
{ value: "high", label: "Thinking on" },
|
|
47
|
+
{ value: "none", label: "Thinking off" },
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
const allowed = new Set(EFFORT_LEVELS);
|
|
51
|
+
const values = resolved.effortLevels ?? EFFORT_LEVELS;
|
|
52
|
+
return [...new Set(values)]
|
|
53
|
+
.filter((value) => allowed.has(value))
|
|
54
|
+
.map((value) => ({ value, label: channelEffortLabel(value) }));
|
|
55
|
+
}
|
|
56
|
+
function channelEffortLabel(value) {
|
|
57
|
+
if (value === "xhigh")
|
|
58
|
+
return "Extra high";
|
|
59
|
+
if (value === "max")
|
|
60
|
+
return "Maximum";
|
|
61
|
+
return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=channel-runtime-controls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-runtime-controls.js","sourceRoot":"","sources":["../src/channel-runtime-controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACL,+BAA+B,EAC/B,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAmB7B;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CAAC,UAA2B;IACrE,MAAM,IAAI,GAA4B,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,KAAK,MAAM,GAAG,IAAI,uBAAuB,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9D,MAAM,KAAK,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACpB,SAAS;QACX,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAChB,IAAI,CAAC,IAAI,CA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,EAAE;YACvC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE;SACzC,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAS,aAAa,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,IAAI,aAAa,CAAC;IACtD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;SACxB,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;SACrC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACvC,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,YAAY,CAAC;IAC3C,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,SAAS,CAAC;IACtC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface HumanChannelStatus {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly kind: string;
|
|
4
|
+
readonly text: string;
|
|
5
|
+
}
|
|
6
|
+
export interface HumanChannelSection {
|
|
7
|
+
readonly title: "channels" | "operator";
|
|
8
|
+
readonly lines: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Keep transport ids stable in config/JSON while giving humans the product
|
|
12
|
+
* name and purpose they actually interact with.
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatHumanChannelSections(entries: readonly HumanChannelStatus[]): readonly HumanChannelSection[];
|
|
15
|
+
//# sourceMappingURL=channel-status-display.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-status-display.d.ts","sourceRoot":"","sources":["../src/channel-status-display.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAID;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,SAAS,kBAAkB,EAAE,GACrC,SAAS,mBAAmB,EAAE,CAoBhC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as ui from "./ui.js";
|
|
2
|
+
const OPERATOR_CHANNEL_IDS = new Set(["tui", "live"]);
|
|
3
|
+
/**
|
|
4
|
+
* Keep transport ids stable in config/JSON while giving humans the product
|
|
5
|
+
* name and purpose they actually interact with.
|
|
6
|
+
*/
|
|
7
|
+
export function formatHumanChannelSections(entries) {
|
|
8
|
+
const sections = [];
|
|
9
|
+
for (const title of ["channels", "operator"]) {
|
|
10
|
+
const selected = entries.filter(({ id }) => OPERATOR_CHANNEL_IDS.has(id) === (title === "operator"));
|
|
11
|
+
if (selected.length === 0)
|
|
12
|
+
continue;
|
|
13
|
+
const lines = selected
|
|
14
|
+
.filter(({ kind }) => kind !== "disabled")
|
|
15
|
+
.map((entry) => formatHumanChannelLine(entry));
|
|
16
|
+
const disabled = selected
|
|
17
|
+
.filter(({ kind }) => kind === "disabled")
|
|
18
|
+
.map(({ id }) => displayChannelId(id));
|
|
19
|
+
if (disabled.length > 0) {
|
|
20
|
+
lines.push(` ${ui.channelBadge("disabled")}${ui.style.bold("disabled".padEnd(11))} ${disabled.join(", ")}`);
|
|
21
|
+
}
|
|
22
|
+
sections.push({ title, lines });
|
|
23
|
+
}
|
|
24
|
+
return sections;
|
|
25
|
+
}
|
|
26
|
+
function formatHumanChannelLine(entry) {
|
|
27
|
+
const id = displayChannelId(entry.id);
|
|
28
|
+
return ` ${ui.channelBadge(entry.kind)}${ui.style.bold(id.padEnd(11))} ${describeOperatorPurpose(entry)}`;
|
|
29
|
+
}
|
|
30
|
+
function displayChannelId(id) {
|
|
31
|
+
return id === "tui" ? "gui" : id;
|
|
32
|
+
}
|
|
33
|
+
function describeOperatorPurpose(entry) {
|
|
34
|
+
const purpose = entry.id === "tui"
|
|
35
|
+
? "TUI + Web"
|
|
36
|
+
: entry.id === "live"
|
|
37
|
+
? "read-only events"
|
|
38
|
+
: undefined;
|
|
39
|
+
if (purpose === undefined || entry.kind !== "running")
|
|
40
|
+
return entry.text;
|
|
41
|
+
if (entry.text === "running")
|
|
42
|
+
return `running (${purpose})`;
|
|
43
|
+
if (entry.text.startsWith("running (") && entry.text.endsWith(")")) {
|
|
44
|
+
return `running (${purpose}; ${entry.text.slice("running (".length, -1)})`;
|
|
45
|
+
}
|
|
46
|
+
return entry.text;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=channel-status-display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel-status-display.js","sourceRoot":"","sources":["../src/channel-status-display.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAa9B,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAEtD;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,OAAsC;IAEtC,MAAM,QAAQ,GAA0B,EAAE,CAAC;IAC3C,KAAK,MAAM,KAAK,IAAI,CAAC,UAAU,EAAE,UAAU,CAAU,EAAE,CAAC;QACtD,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CA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CAAC,EAAE,CAAC,CAAC,IAAI,uBAAuB,CAAC,KAAK,CAAC,EAAE,CAAC;AAC7G,CAAC;AAED,SAAS,gBAAgB,CAAC,EAAU;IAClC,OAAO,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACnC,CAAC;AAED,SAAS,uBAAuB,CAAC,KAAyB;IACxD,MAAM,OAAO,GAAG,KAAK,CAAC,EAAE,KAAK,KAAK;QAChC,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,KAAK,CAAC,EAAE,KAAK,MAAM;YACnB,CAAC,CAAC,kBAAkB;YACpB,CAAC,CAAC,SAAS,CAAC;IAChB,IAAI,OAAO,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC,IAAI,CAAC;IACzE,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,YAAY,OAAO,GAAG,CAAC;IAC5D,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACnE,OAAO,YAAY,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IAC7E,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC"}
|
package/dist/cli-args.d.ts
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import type { EffortLevel, RouteSafetyMode } from "@mono-agent/config";
|
|
2
2
|
import type { InstallSkillTarget } from "./install-skill.js";
|
|
3
3
|
import type { CodexLoginMode } from "./provider-setup.js";
|
|
4
|
-
declare const KNOWN_COMMANDS: readonly ["init", "setup", "validate", "doctor", "auth", "sandbox", "config", "
|
|
5
|
-
|
|
4
|
+
declare const KNOWN_COMMANDS: readonly ["init", "setup", "validate", "doctor", "auth", "sandbox", "config", "presets", "start", "restart", "stop", "status", "logs", "tui", "web", "install-skill", "backfill", "runs", "audit-runs", "metrics", "memory", "continuations", "__launchd-log-maintenance"];
|
|
5
|
+
export declare const REMOVED_COMMANDS: Map<string, string>;
|
|
6
|
+
type CliCommand = Exclude<(typeof KNOWN_COMMANDS)[number], "doctor" | "setup" | "audit-runs" | "metrics"> | "help" | "version";
|
|
6
7
|
export interface ParsedCliArgs {
|
|
7
8
|
readonly command: CliCommand;
|
|
8
9
|
readonly configPath?: string;
|
|
9
10
|
readonly name?: string;
|
|
10
11
|
readonly model?: string;
|
|
11
|
-
/** @deprecated Removed in v2.0.0; use repeated `--fallback` entries. */
|
|
12
|
-
readonly fallbackModels?: readonly string[];
|
|
13
12
|
readonly fallbacks?: readonly CliFallbackArg[];
|
|
14
13
|
readonly routeSafety?: RouteSafetyMode;
|
|
15
14
|
readonly effort?: string;
|
|
16
15
|
readonly memory?: "lite" | "journal" | "bujo";
|
|
17
16
|
/** init/validate: build/check against this preset id. */
|
|
18
17
|
readonly preset?: string;
|
|
19
|
-
/** @deprecated Removed in v2.0.0; use `--preset`. */
|
|
20
|
-
readonly recipe?: string;
|
|
21
18
|
/** init: additional channels to enable on top of the preset/default config. */
|
|
22
19
|
readonly withChannels?: readonly string[];
|
|
23
20
|
/** init: skip the interactive wizard and write the default/preset scaffold. */
|
|
@@ -35,8 +32,12 @@ export interface ParsedCliArgs {
|
|
|
35
32
|
readonly envFile?: string;
|
|
36
33
|
/** Internal owner-private launchd transport; never a public start option. */
|
|
37
34
|
readonly expectedBackgroundSnapshot?: string;
|
|
35
|
+
/** Internal finalized-runtime proof; never a public start option. */
|
|
36
|
+
readonly expectedManagedRuntimeLaunch?: string;
|
|
38
37
|
readonly target?: InstallSkillTarget;
|
|
39
38
|
readonly force: boolean;
|
|
39
|
+
/** restart: canonical spelling that clears pi sessions + active conversation history. */
|
|
40
|
+
readonly clearSessions?: boolean;
|
|
40
41
|
/** start: run the blocking foreground worker instead of backgrounding. */
|
|
41
42
|
readonly foreground: boolean;
|
|
42
43
|
/** logs: keep streaming new output (tail -F). */
|
|
@@ -53,13 +54,13 @@ export interface ParsedCliArgs {
|
|
|
53
54
|
readonly until?: string;
|
|
54
55
|
/** backfill: map + serialize but do not POST. */
|
|
55
56
|
readonly dryRun: boolean;
|
|
56
|
-
/**
|
|
57
|
+
/** runs/backfill: include memory-run artifacts. */
|
|
57
58
|
readonly includeMemory: boolean;
|
|
58
|
-
/**
|
|
59
|
+
/** runs: read this artifact directory directly. */
|
|
59
60
|
readonly artifactDir?: string;
|
|
60
|
-
/**
|
|
61
|
+
/** runs report: group totals by this summary dimension. */
|
|
61
62
|
readonly groupBy?: "model" | "channel" | "failureKind";
|
|
62
|
-
/** validate/audit
|
|
63
|
+
/** validate/runs audit: resolve config, env, artifacts, and checks relative to this consumer folder. */
|
|
63
64
|
readonly consumerPath?: string;
|
|
64
65
|
/** tui: connect to this running agent (label or sourceId) directly. */
|
|
65
66
|
readonly agent?: string;
|
|
@@ -75,9 +76,11 @@ export interface ParsedCliArgs {
|
|
|
75
76
|
readonly check?: boolean;
|
|
76
77
|
/** install-skill --project: safely update unchanged managed copies. */
|
|
77
78
|
readonly update?: boolean;
|
|
78
|
-
/**
|
|
79
|
+
/** install-skill: copy the skill without pairing the version-matched documentation MCP. */
|
|
80
|
+
readonly noDocsMcp?: boolean;
|
|
81
|
+
/** runs audit: override the stale-running cutoff interval. */
|
|
79
82
|
readonly staleAfterMs?: number;
|
|
80
|
-
/**
|
|
83
|
+
/** runs: print the full machine-readable report. */
|
|
81
84
|
readonly json?: boolean;
|
|
82
85
|
/** memory audit: fail closed on degraded or unknown health. */
|
|
83
86
|
readonly strict?: boolean;
|
|
@@ -93,20 +96,12 @@ export interface ParsedCliArgs {
|
|
|
93
96
|
readonly planPath?: string;
|
|
94
97
|
/** memory forget restore: owner-private backup directory. */
|
|
95
98
|
readonly backupPath?: string;
|
|
96
|
-
/** web
|
|
99
|
+
/** web: bind host (defaults to 0.0.0.0). */
|
|
97
100
|
readonly host?: string;
|
|
98
|
-
/** web
|
|
101
|
+
/** web: bind port (defaults to 5050). */
|
|
99
102
|
readonly port?: number;
|
|
100
103
|
/** web: narrow the default LAN bind to 127.0.0.1. */
|
|
101
104
|
readonly loopback?: boolean;
|
|
102
|
-
/** sessions: `--no-open` sets this false to suppress the browser launch. */
|
|
103
|
-
readonly open?: boolean;
|
|
104
|
-
/** sessions: `--allow-non-loopback` permits a non-loopback bind. */
|
|
105
|
-
readonly allowNonLoopback?: boolean;
|
|
106
|
-
/** sessions: reveal a configured auth token only to an interactive terminal. */
|
|
107
|
-
readonly showAuthUrl?: boolean;
|
|
108
|
-
/** sessions: `--max-runs` caps the per-instance in-memory working set (default 200). */
|
|
109
|
-
readonly maxRunsPerInstance?: number;
|
|
110
105
|
}
|
|
111
106
|
interface CliFallbackArg {
|
|
112
107
|
readonly model: string;
|
package/dist/cli-args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,QAAA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,QAAA,MAAM,cAAc,4QAA0E,CAAC;AAyB/F,eAAO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EAAE,WAAW,CAAC;CAC/B;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,aAAa,CA6hBnE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOpD"}
|
package/dist/cli-args.js
CHANGED
|
@@ -1,30 +1,71 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
2
|
import { EFFORT_LEVELS, MAX_AGENT_NAME_LENGTH, } from "@mono-agent/config";
|
|
3
3
|
import { INTERNAL_LAUNCHD_LOG_MAINTENANCE_COMMAND } from "./launchd.js";
|
|
4
|
-
const PUBLIC_COMMANDS = ["init", "setup", "validate", "doctor", "auth", "sandbox", "config", "
|
|
4
|
+
const PUBLIC_COMMANDS = ["init", "setup", "validate", "doctor", "auth", "sandbox", "config", "presets", "start", "restart", "stop", "status", "logs", "tui", "web", "install-skill", "backfill", "runs", "audit-runs", "metrics", "memory", "continuations"];
|
|
5
5
|
const KNOWN_COMMANDS = [...PUBLIC_COMMANDS, INTERNAL_LAUNCHD_LOG_MAINTENANCE_COMMAND];
|
|
6
|
+
// Canonical (post-normalization) commands that emit a `--json` envelope. This is
|
|
7
|
+
// an allowlist so future commands fail closed until they opt in explicitly. The
|
|
8
|
+
// `install-skill`/`sandbox` entries carry an extra subcommand guard below.
|
|
9
|
+
const JSON_CAPABLE_COMMANDS = [
|
|
10
|
+
"validate",
|
|
11
|
+
"config",
|
|
12
|
+
"presets",
|
|
13
|
+
"status",
|
|
14
|
+
"sandbox",
|
|
15
|
+
"install-skill",
|
|
16
|
+
"runs",
|
|
17
|
+
"memory",
|
|
18
|
+
"continuations",
|
|
19
|
+
];
|
|
20
|
+
// Human-facing list for the rejection message: the two subcommand-gated surfaces
|
|
21
|
+
// are qualified so the error points at the exact invocation that accepts `--json`.
|
|
22
|
+
const JSON_CAPABLE_COMMANDS_DISPLAY = "validate, config, presets, status, sandbox status, install-skill --project --check, runs, memory, continuations";
|
|
23
|
+
// Commands removed outright before the KNOWN_COMMANDS gate. Parsing throws with the
|
|
24
|
+
// replacement, and runCli maps that parse error to exit code 2 (usage-error).
|
|
25
|
+
// `renderHelpTopic` reuses these so `help <removed>` prints the same pointer.
|
|
26
|
+
export const REMOVED_COMMANDS = new Map([
|
|
27
|
+
["recipes", "`recipes` was removed; use `mono-agent presets`."],
|
|
28
|
+
["sessions", "`sessions` was removed; use `mono-agent tui` (recorded-run replay) or `mono-agent web` (live console)."],
|
|
29
|
+
]);
|
|
6
30
|
export function parseCliArgs(argv) {
|
|
7
31
|
const [command, ...rest] = argv;
|
|
8
|
-
|
|
32
|
+
// `--help`/`-h` and a bare invocation render the plain grouped summary (no topic).
|
|
33
|
+
if (command === undefined || command === "--help" || command === "-h") {
|
|
9
34
|
return { command: "help", positionals: [], force: false, foreground: false, follow: false, all: false, dryRun: false, includeMemory: false };
|
|
10
35
|
}
|
|
36
|
+
// `help <topic>` keeps the remaining tokens as positionals so the command
|
|
37
|
+
// handler can render `help <command>` / `help notes` detail views.
|
|
38
|
+
if (command === "help") {
|
|
39
|
+
return { command: "help", positionals: [...rest], force: false, foreground: false, follow: false, all: false, dryRun: false, includeMemory: false };
|
|
40
|
+
}
|
|
11
41
|
if (command === "version" || command === "--version" || command === "-v") {
|
|
12
42
|
return { command: "version", positionals: [], force: false, foreground: false, follow: false, all: false, dryRun: false, includeMemory: false };
|
|
13
43
|
}
|
|
44
|
+
const removed = REMOVED_COMMANDS.get(command);
|
|
45
|
+
if (removed !== undefined) {
|
|
46
|
+
throw new Error(removed);
|
|
47
|
+
}
|
|
14
48
|
if (!KNOWN_COMMANDS.includes(command)) {
|
|
15
49
|
throw new Error(`Unknown command \`${command}\`. Expected ${PUBLIC_COMMANDS.join(", ")}.`);
|
|
16
50
|
}
|
|
17
|
-
// `doctor`/`setup
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
51
|
+
// `doctor`/`setup` are aliases; normalize here so every downstream path
|
|
52
|
+
// (routing, env-file resolution, --consumer) applies unchanged. `doctor` →
|
|
53
|
+
// `validate`, `setup` → `init`. No sunset is set for either.
|
|
54
|
+
//
|
|
55
|
+
// `audit-runs`/`metrics` are deprecated forwarding aliases for the merged
|
|
56
|
+
// `runs` command: `audit-runs` → `runs` with a leading `audit` mode positional,
|
|
57
|
+
// `metrics` → `runs` with a leading `report` mode positional. The injected mode
|
|
58
|
+
// is prepended after the flag loop so user-supplied positionals are preserved,
|
|
59
|
+
// and the dispatcher routes on `positionals[0]`. writeCliDeprecationHints keys
|
|
60
|
+
// the sunset hint off the original argv token (lost after this normalization).
|
|
21
61
|
const cmd = (command === "doctor"
|
|
22
62
|
? "validate"
|
|
23
63
|
: command === "setup"
|
|
24
64
|
? "init"
|
|
25
|
-
: command === "
|
|
26
|
-
? "
|
|
65
|
+
: command === "audit-runs" || command === "metrics"
|
|
66
|
+
? "runs"
|
|
27
67
|
: command);
|
|
68
|
+
const injectedRunsMode = command === "audit-runs" ? "audit" : command === "metrics" ? "report" : undefined;
|
|
28
69
|
if (cmd === INTERNAL_LAUNCHD_LOG_MAINTENANCE_COMMAND
|
|
29
70
|
&& !(rest.length === 2
|
|
30
71
|
&& rest[0] === "--config"
|
|
@@ -36,14 +77,12 @@ export function parseCliArgs(argv) {
|
|
|
36
77
|
let configPath;
|
|
37
78
|
let name;
|
|
38
79
|
let model;
|
|
39
|
-
let fallbackModels;
|
|
40
80
|
const fallbacks = [];
|
|
41
81
|
let canAssignFallbackEffort = false;
|
|
42
82
|
let routeSafety;
|
|
43
83
|
let effort;
|
|
44
84
|
let memory;
|
|
45
85
|
let preset;
|
|
46
|
-
let recipe;
|
|
47
86
|
let withChannels;
|
|
48
87
|
let yes = false;
|
|
49
88
|
let auth = false;
|
|
@@ -53,8 +92,10 @@ export function parseCliArgs(argv) {
|
|
|
53
92
|
const positionals = [];
|
|
54
93
|
let envFile;
|
|
55
94
|
let expectedBackgroundSnapshot;
|
|
95
|
+
let expectedManagedRuntimeLaunch;
|
|
56
96
|
let target;
|
|
57
97
|
let force = false;
|
|
98
|
+
let clearSessions = false;
|
|
58
99
|
let foreground = false;
|
|
59
100
|
let follow = false;
|
|
60
101
|
let lines;
|
|
@@ -74,6 +115,7 @@ export function parseCliArgs(argv) {
|
|
|
74
115
|
let project = false;
|
|
75
116
|
let check = false;
|
|
76
117
|
let update = false;
|
|
118
|
+
let noDocsMcp = false;
|
|
77
119
|
let staleAfterMs;
|
|
78
120
|
let json = false;
|
|
79
121
|
let strict = false;
|
|
@@ -86,10 +128,6 @@ export function parseCliArgs(argv) {
|
|
|
86
128
|
let host;
|
|
87
129
|
let port;
|
|
88
130
|
let loopback = false;
|
|
89
|
-
let open;
|
|
90
|
-
let allowNonLoopback;
|
|
91
|
-
let showAuthUrl;
|
|
92
|
-
let maxRunsPerInstance;
|
|
93
131
|
for (let i = 0; i < rest.length; i += 1) {
|
|
94
132
|
const flag = rest[i];
|
|
95
133
|
if (flag !== "--fallback-effort")
|
|
@@ -154,6 +192,9 @@ export function parseCliArgs(argv) {
|
|
|
154
192
|
case "--update":
|
|
155
193
|
update = true;
|
|
156
194
|
break;
|
|
195
|
+
case "--no-docs-mcp":
|
|
196
|
+
noDocsMcp = true;
|
|
197
|
+
break;
|
|
157
198
|
case "--stale-after-ms": {
|
|
158
199
|
const raw = requireValue(rest, ++i, flag);
|
|
159
200
|
const parsed = Number(raw);
|
|
@@ -211,24 +252,6 @@ export function parseCliArgs(argv) {
|
|
|
211
252
|
case "--loopback":
|
|
212
253
|
loopback = true;
|
|
213
254
|
break;
|
|
214
|
-
case "--no-open":
|
|
215
|
-
open = false;
|
|
216
|
-
break;
|
|
217
|
-
case "--allow-non-loopback":
|
|
218
|
-
allowNonLoopback = true;
|
|
219
|
-
break;
|
|
220
|
-
case "--show-auth-url":
|
|
221
|
-
showAuthUrl = true;
|
|
222
|
-
break;
|
|
223
|
-
case "--max-runs": {
|
|
224
|
-
const raw = requireValue(rest, ++i, flag);
|
|
225
|
-
const parsed = Number(raw);
|
|
226
|
-
if (!Number.isInteger(parsed) || parsed < 1) {
|
|
227
|
-
throw new Error("--max-runs must be a positive integer.");
|
|
228
|
-
}
|
|
229
|
-
maxRunsPerInstance = parsed;
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
232
255
|
case "--model":
|
|
233
256
|
model = requireValue(rest, ++i, flag);
|
|
234
257
|
break;
|
|
@@ -241,13 +264,10 @@ export function parseCliArgs(argv) {
|
|
|
241
264
|
}
|
|
242
265
|
break;
|
|
243
266
|
case "--fallback-models":
|
|
244
|
-
//
|
|
245
|
-
// and
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
.map((entry) => entry.trim())
|
|
249
|
-
.filter((entry) => entry.length > 0);
|
|
250
|
-
break;
|
|
267
|
+
// Removed CLI spelling. The similarly named JSON `runtime.fallbackModels`
|
|
268
|
+
// and `MONO_AGENT_FALLBACK_MODELS` compatibility inputs are separate and
|
|
269
|
+
// remain supported; only this CLI flag is gone.
|
|
270
|
+
throw new Error("`--fallback-models` was removed; repeat `--fallback <ref>` instead.");
|
|
251
271
|
case "--fallback": {
|
|
252
272
|
const fallbackModel = requireValue(rest, ++i, flag).trim();
|
|
253
273
|
if (fallbacks.some((entry) => entry.model === fallbackModel)) {
|
|
@@ -303,9 +323,8 @@ export function parseCliArgs(argv) {
|
|
|
303
323
|
preset = requireValue(rest, ++i, flag);
|
|
304
324
|
break;
|
|
305
325
|
case "--recipe":
|
|
306
|
-
//
|
|
307
|
-
|
|
308
|
-
break;
|
|
326
|
+
// Removed init/validate alias.
|
|
327
|
+
throw new Error("`--recipe` was removed; use `--preset <id>`.");
|
|
309
328
|
case "--yes":
|
|
310
329
|
yes = true;
|
|
311
330
|
break;
|
|
@@ -338,6 +357,9 @@ export function parseCliArgs(argv) {
|
|
|
338
357
|
case "--expected-background-snapshot":
|
|
339
358
|
expectedBackgroundSnapshot = requireValue(rest, ++i, flag);
|
|
340
359
|
break;
|
|
360
|
+
case "--expected-managed-runtime-launch":
|
|
361
|
+
expectedManagedRuntimeLaunch = requireValue(rest, ++i, flag);
|
|
362
|
+
break;
|
|
341
363
|
case "--target": {
|
|
342
364
|
const raw = requireValue(rest, ++i, flag);
|
|
343
365
|
if (raw !== "claude" && raw !== "codex" && raw !== "both") {
|
|
@@ -349,19 +371,23 @@ export function parseCliArgs(argv) {
|
|
|
349
371
|
case "--force":
|
|
350
372
|
force = true;
|
|
351
373
|
break;
|
|
374
|
+
case "--clear-sessions":
|
|
375
|
+
clearSessions = true;
|
|
376
|
+
break;
|
|
352
377
|
case "--foreground":
|
|
353
378
|
foreground = true;
|
|
354
379
|
break;
|
|
355
380
|
case "--follow":
|
|
356
381
|
follow = true;
|
|
357
382
|
break;
|
|
358
|
-
// `-f`
|
|
383
|
+
// `-f` means `--follow` on logs only. Its former `start` meaning
|
|
384
|
+
// (`--foreground`) is gone: `-f` on anything else is a usage error.
|
|
359
385
|
case "-f":
|
|
360
386
|
if (isLogs) {
|
|
361
387
|
follow = true;
|
|
362
388
|
}
|
|
363
389
|
else {
|
|
364
|
-
foreground
|
|
390
|
+
throw new Error("`-f` means `--follow` on `logs`; use `--foreground` with `start`.");
|
|
365
391
|
}
|
|
366
392
|
break;
|
|
367
393
|
case "--lines": {
|
|
@@ -380,13 +406,19 @@ export function parseCliArgs(argv) {
|
|
|
380
406
|
if (flag.startsWith("--")) {
|
|
381
407
|
throw new Error(`Unknown flag \`${flag}\` for \`mono-agent ${command}\`.`);
|
|
382
408
|
}
|
|
383
|
-
// Non-flag tokens are positional arguments (e.g. `
|
|
409
|
+
// Non-flag tokens are positional arguments (e.g. `presets show <id>`).
|
|
384
410
|
positionals.push(flag);
|
|
385
411
|
break;
|
|
386
412
|
}
|
|
387
413
|
}
|
|
388
|
-
|
|
389
|
-
|
|
414
|
+
// Prepend the forwarding-alias mode so `audit-runs`/`metrics` reach the `runs`
|
|
415
|
+
// dispatcher as `runs audit`/`runs report` without clobbering any positionals a
|
|
416
|
+
// user typed after the legacy command name.
|
|
417
|
+
if (injectedRunsMode !== undefined) {
|
|
418
|
+
positionals.unshift(injectedRunsMode);
|
|
419
|
+
}
|
|
420
|
+
if (consumerPath !== undefined && cmd !== "validate" && cmd !== "runs") {
|
|
421
|
+
throw new Error("--consumer is only supported for `mono-agent validate` and `mono-agent runs`.");
|
|
390
422
|
}
|
|
391
423
|
if ((local || configure) && cmd !== "tui") {
|
|
392
424
|
throw new Error("--local and --configure are only supported for `mono-agent tui`.");
|
|
@@ -403,27 +435,17 @@ export function parseCliArgs(argv) {
|
|
|
403
435
|
if (check && update) {
|
|
404
436
|
throw new Error("Choose either --check or --update for project skills.");
|
|
405
437
|
}
|
|
406
|
-
if (
|
|
407
|
-
|
|
408
|
-
|| loopback
|
|
409
|
-
|| open !== undefined
|
|
410
|
-
|| allowNonLoopback !== undefined
|
|
411
|
-
|| showAuthUrl !== undefined
|
|
412
|
-
|| maxRunsPerInstance !== undefined) &&
|
|
413
|
-
cmd !== "web" && cmd !== "sessions") {
|
|
414
|
-
throw new Error("--host and --port are only supported for `mono-agent web` or `mono-agent sessions`; --loopback is web-only; Session Recorder flags are sessions-only.");
|
|
415
|
-
}
|
|
416
|
-
if (loopback && cmd !== "web") {
|
|
417
|
-
throw new Error("--loopback is only supported for `mono-agent web`.");
|
|
438
|
+
if (noDocsMcp && cmd !== "install-skill") {
|
|
439
|
+
throw new Error("--no-docs-mcp is only supported for `mono-agent install-skill`.");
|
|
418
440
|
}
|
|
419
|
-
if ((
|
|
420
|
-
throw new Error("--
|
|
441
|
+
if ((host !== undefined || port !== undefined || loopback) && cmd !== "web") {
|
|
442
|
+
throw new Error("--host, --port, and --loopback are only supported for `mono-agent web`.");
|
|
421
443
|
}
|
|
422
444
|
if (cmd === "web" && (configPath !== undefined || envFile !== undefined)) {
|
|
423
|
-
throw new Error("The machine-wide `mono-agent web` console does not load an agent --config or --env-file
|
|
445
|
+
throw new Error("The machine-wide `mono-agent web` console does not load an agent --config or --env-file.");
|
|
424
446
|
}
|
|
425
|
-
if (includeMemory && cmd !== "
|
|
426
|
-
throw new Error("--include-memory is only supported for `mono-agent
|
|
447
|
+
if (includeMemory && cmd !== "runs" && cmd !== "backfill") {
|
|
448
|
+
throw new Error("--include-memory is only supported for `mono-agent runs` and `mono-agent backfill`.");
|
|
427
449
|
}
|
|
428
450
|
if (limit !== undefined && cmd !== "memory" && cmd !== "continuations") {
|
|
429
451
|
throw new Error("--limit is only supported for `mono-agent memory` and `mono-agent continuations list`.");
|
|
@@ -453,13 +475,26 @@ export function parseCliArgs(argv) {
|
|
|
453
475
|
if (codexAuthMode !== undefined && cmd !== "init" && cmd !== "auth") {
|
|
454
476
|
throw new Error("--codex-auth is only supported for `mono-agent init` and `mono-agent auth login codex`.");
|
|
455
477
|
}
|
|
456
|
-
if (
|
|
457
|
-
throw new Error("
|
|
478
|
+
if (clearSessions && cmd !== "restart") {
|
|
479
|
+
throw new Error("--clear-sessions is only supported for `mono-agent restart`.");
|
|
480
|
+
}
|
|
481
|
+
// `--json` is uniform on the read/status surfaces only. Reject it on the
|
|
482
|
+
// lifecycle/interactive commands (init, auth, start, stop, restart, logs, tui,
|
|
483
|
+
// web, backfill) rather than silently ignoring it. `doctor`/`setup`/
|
|
484
|
+
// `audit-runs`/`metrics` already normalized to their canonical `cmd` above.
|
|
485
|
+
if (json && !JSON_CAPABLE_COMMANDS.includes(cmd)) {
|
|
486
|
+
throw new Error(`--json is not supported for \`mono-agent ${cmd}\`; it is available on ${JSON_CAPABLE_COMMANDS_DISPLAY}.`);
|
|
487
|
+
}
|
|
488
|
+
// `install-skill` exposes JSON only for its read-only drift check.
|
|
489
|
+
if (json && cmd === "install-skill" && !(project && check)) {
|
|
490
|
+
throw new Error("--json is only supported for `mono-agent install-skill --project --check`.");
|
|
458
491
|
}
|
|
459
|
-
|
|
460
|
-
|
|
492
|
+
// `sandbox setup`/`sandbox check` are interactive/side-effecting; only the
|
|
493
|
+
// read-only `sandbox status` emits JSON.
|
|
494
|
+
if (json && cmd === "sandbox" && (positionals[0] === "setup" || positionals[0] === "check")) {
|
|
495
|
+
throw new Error("--json is only supported for `mono-agent sandbox status`, not setup or check.");
|
|
461
496
|
}
|
|
462
|
-
const selectedFallbackModels =
|
|
497
|
+
const selectedFallbackModels = fallbacks.map((fallback) => fallback.model);
|
|
463
498
|
if (model !== undefined && selectedFallbackModels.includes(model)) {
|
|
464
499
|
throw new Error(`Primary --model \`${model}\` cannot also be a fallback.`);
|
|
465
500
|
}
|
|
@@ -468,13 +503,11 @@ export function parseCliArgs(argv) {
|
|
|
468
503
|
...(configPath === undefined ? {} : { configPath }),
|
|
469
504
|
...(name === undefined ? {} : { name }),
|
|
470
505
|
...(model === undefined ? {} : { model }),
|
|
471
|
-
...(fallbackModels === undefined ? {} : { fallbackModels }),
|
|
472
506
|
...(fallbacks.length === 0 ? {} : { fallbacks }),
|
|
473
507
|
...(routeSafety === undefined ? {} : { routeSafety }),
|
|
474
508
|
...(effort === undefined ? {} : { effort }),
|
|
475
509
|
...(memory === undefined ? {} : { memory }),
|
|
476
510
|
...(preset === undefined ? {} : { preset }),
|
|
477
|
-
...(recipe === undefined ? {} : { recipe }),
|
|
478
511
|
...(withChannels === undefined ? {} : { withChannels }),
|
|
479
512
|
...(yes ? { yes } : {}),
|
|
480
513
|
...(auth ? { auth } : {}),
|
|
@@ -484,8 +517,10 @@ export function parseCliArgs(argv) {
|
|
|
484
517
|
positionals,
|
|
485
518
|
...(envFile === undefined ? {} : { envFile }),
|
|
486
519
|
...(expectedBackgroundSnapshot === undefined ? {} : { expectedBackgroundSnapshot }),
|
|
520
|
+
...(expectedManagedRuntimeLaunch === undefined ? {} : { expectedManagedRuntimeLaunch }),
|
|
487
521
|
...(target === undefined ? {} : { target }),
|
|
488
522
|
force,
|
|
523
|
+
...(clearSessions ? { clearSessions } : {}),
|
|
489
524
|
foreground,
|
|
490
525
|
follow,
|
|
491
526
|
...(lines === undefined ? {} : { lines }),
|
|
@@ -514,13 +549,10 @@ export function parseCliArgs(argv) {
|
|
|
514
549
|
...(project ? { project } : {}),
|
|
515
550
|
...(check ? { check } : {}),
|
|
516
551
|
...(update ? { update } : {}),
|
|
552
|
+
...(noDocsMcp ? { noDocsMcp } : {}),
|
|
517
553
|
...(host === undefined ? {} : { host }),
|
|
518
554
|
...(port === undefined ? {} : { port }),
|
|
519
555
|
...(loopback ? { loopback } : {}),
|
|
520
|
-
...(open === undefined ? {} : { open }),
|
|
521
|
-
...(allowNonLoopback === undefined ? {} : { allowNonLoopback }),
|
|
522
|
-
...(showAuthUrl === undefined ? {} : { showAuthUrl }),
|
|
523
|
-
...(maxRunsPerInstance === undefined ? {} : { maxRunsPerInstance }),
|
|
524
556
|
};
|
|
525
557
|
}
|
|
526
558
|
/**
|