@evalops/maestro 0.10.10 → 0.10.12
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/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +5 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/config.js +3 -2
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/evalops.d.ts +1 -1
- package/dist/cli/commands/evalops.d.ts.map +1 -1
- package/dist/cli/commands/evalops.js +28 -2
- package/dist/cli/commands/evalops.js.map +1 -1
- package/dist/cli/commands/init.d.ts +5 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +166 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +9 -1
- package/dist/cli/help.js.map +1 -1
- package/dist/cli.js +982 -293
- package/dist/evalops/agent-bootstrap.d.ts +73 -0
- package/dist/evalops/agent-bootstrap.d.ts.map +1 -0
- package/dist/evalops/agent-bootstrap.js +477 -0
- package/dist/evalops/agent-bootstrap.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +6 -1
- package/dist/main.js.map +1 -1
- package/dist/mcp/platform-plugin.d.ts.map +1 -1
- package/dist/mcp/platform-plugin.js +40 -6
- package/dist/mcp/platform-plugin.js.map +1 -1
- package/dist/models/builtin.d.ts.map +1 -1
- package/dist/models/builtin.js +2 -3
- package/dist/models/builtin.js.map +1 -1
- package/dist/oauth/evalops.d.ts.map +1 -1
- package/dist/oauth/evalops.js +3 -2
- package/dist/oauth/evalops.js.map +1 -1
- package/dist/platform/core-services.d.ts +1 -0
- package/dist/platform/core-services.d.ts.map +1 -1
- package/dist/platform/core-services.js +1 -0
- package/dist/platform/core-services.js.map +1 -1
- package/dist/providers/auth.d.ts +1 -1
- package/dist/providers/auth.d.ts.map +1 -1
- package/dist/providers/auth.js +30 -2
- package/dist/providers/auth.js.map +1 -1
- package/dist/providers/evalops-managed.d.ts +1 -0
- package/dist/providers/evalops-managed.d.ts.map +1 -1
- package/dist/providers/evalops-managed.js +1 -0
- package/dist/providers/evalops-managed.js.map +1 -1
- package/dist/version.json +2 -2
- package/node_modules/@evalops/contracts/package.json +1 -1
- package/node_modules/@evalops/tui/package.json +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { bootstrapEvalOpsAgent, } from "../../evalops/agent-bootstrap.js";
|
|
3
|
+
import { muted, sectionHeading } from "../../style/theme.js";
|
|
4
|
+
export function formatInitHelp() {
|
|
5
|
+
return `${sectionHeading("maestro init")}${muted(` maestro init Login, create or reuse an API key, and register this agent
|
|
6
|
+
maestro init --rotate-key Replace the stored agent MCP API key
|
|
7
|
+
maestro init --mcp-url <url> Override the EvalOps agent MCP endpoint
|
|
8
|
+
maestro init --json Emit machine-readable bootstrap output
|
|
9
|
+
|
|
10
|
+
Options
|
|
11
|
+
--agent-type <type> Agent type to register, defaults to maestro
|
|
12
|
+
--surface <surface> Surface to register, defaults to cli
|
|
13
|
+
--workspace, --workspace-id <id> Workspace to associate with the registration
|
|
14
|
+
--scope <scope[,scope...]> Registration scopes to request
|
|
15
|
+
--key-scope <scope[,scope...]> API key scopes to request
|
|
16
|
+
--expires-in-days <days> API key TTL in days
|
|
17
|
+
--force-login Re-run EvalOps OAuth before bootstrapping
|
|
18
|
+
--manifest-url <url> Override the agent MCP manifest URL
|
|
19
|
+
--ttl-seconds <seconds> Registration TTL in seconds`)}`;
|
|
20
|
+
}
|
|
21
|
+
function readValue(args, index, flag) {
|
|
22
|
+
const value = args[index + 1];
|
|
23
|
+
if (!value || value.startsWith("-")) {
|
|
24
|
+
throw new Error(`${flag} requires a value`);
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
function parsePositiveInteger(value, flag) {
|
|
29
|
+
const parsed = Number.parseInt(value, 10);
|
|
30
|
+
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
31
|
+
throw new Error(`${flag} must be a positive integer`);
|
|
32
|
+
}
|
|
33
|
+
return parsed;
|
|
34
|
+
}
|
|
35
|
+
function appendScopes(existing, value) {
|
|
36
|
+
return [
|
|
37
|
+
...(existing ?? []),
|
|
38
|
+
...value
|
|
39
|
+
.split(",")
|
|
40
|
+
.map((entry) => entry.trim())
|
|
41
|
+
.filter((entry) => entry.length > 0),
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
export function parseInitArgs(args) {
|
|
45
|
+
const options = {};
|
|
46
|
+
for (let i = 0; i < args.length; i++) {
|
|
47
|
+
const arg = args[i];
|
|
48
|
+
switch (arg) {
|
|
49
|
+
case "--agent-mcp-url":
|
|
50
|
+
case "--mcp-url":
|
|
51
|
+
options.mcpUrl = readValue(args, i, arg);
|
|
52
|
+
i++;
|
|
53
|
+
break;
|
|
54
|
+
case "--agent-type":
|
|
55
|
+
options.agentType = readValue(args, i, arg);
|
|
56
|
+
i++;
|
|
57
|
+
break;
|
|
58
|
+
case "--api-key-scope":
|
|
59
|
+
case "--key-scope":
|
|
60
|
+
options.apiKeyScopes = appendScopes(options.apiKeyScopes, readValue(args, i, arg));
|
|
61
|
+
i++;
|
|
62
|
+
break;
|
|
63
|
+
case "--expires-in-days":
|
|
64
|
+
options.expiresInDays = parsePositiveInteger(readValue(args, i, arg), arg);
|
|
65
|
+
i++;
|
|
66
|
+
break;
|
|
67
|
+
case "--force-login":
|
|
68
|
+
options.forceLogin = true;
|
|
69
|
+
break;
|
|
70
|
+
case "--json":
|
|
71
|
+
options.json = true;
|
|
72
|
+
break;
|
|
73
|
+
case "--key-name":
|
|
74
|
+
options.keyName = readValue(args, i, arg);
|
|
75
|
+
i++;
|
|
76
|
+
break;
|
|
77
|
+
case "--manifest-url":
|
|
78
|
+
options.manifestUrl = readValue(args, i, arg);
|
|
79
|
+
i++;
|
|
80
|
+
break;
|
|
81
|
+
case "--register-scope":
|
|
82
|
+
case "--scope":
|
|
83
|
+
options.registerScopes = appendScopes(options.registerScopes, readValue(args, i, arg));
|
|
84
|
+
i++;
|
|
85
|
+
break;
|
|
86
|
+
case "--rotate-key":
|
|
87
|
+
options.rotateKey = true;
|
|
88
|
+
break;
|
|
89
|
+
case "--surface":
|
|
90
|
+
options.surface = readValue(args, i, arg);
|
|
91
|
+
i++;
|
|
92
|
+
break;
|
|
93
|
+
case "--ttl-seconds":
|
|
94
|
+
options.ttlSeconds = parsePositiveInteger(readValue(args, i, arg), arg);
|
|
95
|
+
i++;
|
|
96
|
+
break;
|
|
97
|
+
case "--workspace":
|
|
98
|
+
case "--workspace-id":
|
|
99
|
+
options.workspaceId = readValue(args, i, arg);
|
|
100
|
+
i++;
|
|
101
|
+
break;
|
|
102
|
+
default:
|
|
103
|
+
if (arg?.startsWith("-")) {
|
|
104
|
+
throw new Error(`Unknown maestro init option: ${arg}`);
|
|
105
|
+
}
|
|
106
|
+
throw new Error(`Unexpected maestro init argument: ${arg}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return options;
|
|
110
|
+
}
|
|
111
|
+
export async function handleInitCommand(args = []) {
|
|
112
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
113
|
+
console.log(formatInitHelp());
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
let options;
|
|
117
|
+
try {
|
|
118
|
+
options = parseInitArgs(args);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
console.error(chalk.red(error instanceof Error ? error.message : String(error)));
|
|
122
|
+
process.exit(1);
|
|
123
|
+
}
|
|
124
|
+
if (!options.json) {
|
|
125
|
+
console.log(chalk.bold("Maestro EvalOps Init"));
|
|
126
|
+
}
|
|
127
|
+
const result = await bootstrapEvalOpsAgent(options, {
|
|
128
|
+
onAuthUrl: (url) => {
|
|
129
|
+
if (options.json) {
|
|
130
|
+
console.error("Open this URL in your browser to authenticate with EvalOps:");
|
|
131
|
+
console.error(url);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
console.log(chalk.yellow("Open this URL in your browser to authenticate with EvalOps:"));
|
|
135
|
+
console.log(chalk.underline(url));
|
|
136
|
+
},
|
|
137
|
+
onStatus: (status) => {
|
|
138
|
+
if (options.json) {
|
|
139
|
+
console.error(status.message);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
console.log(chalk.dim(status.message));
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
if (options.json) {
|
|
146
|
+
console.log(JSON.stringify(result, null, 2));
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
console.log(chalk.green("EvalOps agent bootstrap complete."));
|
|
150
|
+
console.log(chalk.dim(`MCP endpoint: ${result.endpoint}`));
|
|
151
|
+
if (result.organizationId) {
|
|
152
|
+
console.log(chalk.dim(`Organization: ${result.organizationId}`));
|
|
153
|
+
}
|
|
154
|
+
if (result.agentId) {
|
|
155
|
+
console.log(chalk.dim(`Agent: ${result.agentId}`));
|
|
156
|
+
}
|
|
157
|
+
if (result.runId) {
|
|
158
|
+
console.log(chalk.dim(`Run: ${result.runId}`));
|
|
159
|
+
}
|
|
160
|
+
if (result.keyPrefix) {
|
|
161
|
+
const keyMode = result.apiKeyCreated ? "created" : "reused";
|
|
162
|
+
console.log(chalk.dim(`API key ${keyMode}: ${result.keyPrefix}`));
|
|
163
|
+
}
|
|
164
|
+
console.log(chalk.dim("Stored EvalOps MCP credentials locally for future Maestro sessions."));
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEN,qBAAqB,GACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,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C;AACH,CAAC","sourcesContent":["import chalk from \"chalk\";\nimport {\n\ttype EvalOpsInitOptions,\n\tbootstrapEvalOpsAgent,\n} from \"../../evalops/agent-bootstrap.js\";\nimport { muted, sectionHeading } from \"../../style/theme.js\";\n\nexport function formatInitHelp(): string {\n\treturn `${sectionHeading(\"maestro init\")}${muted(\n\t\t` maestro init Login, create or reuse an API key, and register this agent\n maestro init --rotate-key Replace the stored agent MCP API key\n maestro init --mcp-url <url> Override the EvalOps agent MCP endpoint\n maestro init --json Emit machine-readable bootstrap output\n\nOptions\n --agent-type <type> Agent type to register, defaults to maestro\n --surface <surface> Surface to register, defaults to cli\n --workspace, --workspace-id <id> Workspace to associate with the registration\n --scope <scope[,scope...]> Registration scopes to request\n --key-scope <scope[,scope...]> API key scopes to request\n --expires-in-days <days> API key TTL in days\n --force-login Re-run EvalOps OAuth before bootstrapping\n --manifest-url <url> Override the agent MCP manifest URL\n --ttl-seconds <seconds> Registration TTL in seconds`,\n\t)}`;\n}\n\nfunction readValue(args: string[], index: number, flag: string): string {\n\tconst value = args[index + 1];\n\tif (!value || value.startsWith(\"-\")) {\n\t\tthrow new Error(`${flag} requires a value`);\n\t}\n\treturn value;\n}\n\nfunction parsePositiveInteger(value: string, flag: string): number {\n\tconst parsed = Number.parseInt(value, 10);\n\tif (!Number.isInteger(parsed) || parsed <= 0) {\n\t\tthrow new Error(`${flag} must be a positive integer`);\n\t}\n\treturn parsed;\n}\n\nfunction appendScopes(existing: string[] | undefined, value: string): string[] {\n\treturn [\n\t\t...(existing ?? []),\n\t\t...value\n\t\t\t.split(\",\")\n\t\t\t.map((entry) => entry.trim())\n\t\t\t.filter((entry) => entry.length > 0),\n\t];\n}\n\nexport function parseInitArgs(args: string[]): EvalOpsInitOptions {\n\tconst options: EvalOpsInitOptions = {};\n\tfor (let i = 0; i < args.length; i++) {\n\t\tconst arg = args[i];\n\t\tswitch (arg) {\n\t\t\tcase \"--agent-mcp-url\":\n\t\t\tcase \"--mcp-url\":\n\t\t\t\toptions.mcpUrl = readValue(args, i, arg);\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\t\t\tcase \"--agent-type\":\n\t\t\t\toptions.agentType = readValue(args, i, arg);\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\t\t\tcase \"--api-key-scope\":\n\t\t\tcase \"--key-scope\":\n\t\t\t\toptions.apiKeyScopes = appendScopes(\n\t\t\t\t\toptions.apiKeyScopes,\n\t\t\t\t\treadValue(args, i, arg),\n\t\t\t\t);\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\t\t\tcase \"--expires-in-days\":\n\t\t\t\toptions.expiresInDays = parsePositiveInteger(\n\t\t\t\t\treadValue(args, i, arg),\n\t\t\t\t\targ,\n\t\t\t\t);\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\t\t\tcase \"--force-login\":\n\t\t\t\toptions.forceLogin = true;\n\t\t\t\tbreak;\n\t\t\tcase \"--json\":\n\t\t\t\toptions.json = true;\n\t\t\t\tbreak;\n\t\t\tcase \"--key-name\":\n\t\t\t\toptions.keyName = readValue(args, i, arg);\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\t\t\tcase \"--manifest-url\":\n\t\t\t\toptions.manifestUrl = readValue(args, i, arg);\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\t\t\tcase \"--register-scope\":\n\t\t\tcase \"--scope\":\n\t\t\t\toptions.registerScopes = appendScopes(\n\t\t\t\t\toptions.registerScopes,\n\t\t\t\t\treadValue(args, i, arg),\n\t\t\t\t);\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\t\t\tcase \"--rotate-key\":\n\t\t\t\toptions.rotateKey = true;\n\t\t\t\tbreak;\n\t\t\tcase \"--surface\":\n\t\t\t\toptions.surface = readValue(args, i, arg);\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\t\t\tcase \"--ttl-seconds\":\n\t\t\t\toptions.ttlSeconds = parsePositiveInteger(readValue(args, i, arg), arg);\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\t\t\tcase \"--workspace\":\n\t\t\tcase \"--workspace-id\":\n\t\t\t\toptions.workspaceId = readValue(args, i, arg);\n\t\t\t\ti++;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif (arg?.startsWith(\"-\")) {\n\t\t\t\t\tthrow new Error(`Unknown maestro init option: ${arg}`);\n\t\t\t\t}\n\t\t\t\tthrow new Error(`Unexpected maestro init argument: ${arg}`);\n\t\t}\n\t}\n\treturn options;\n}\n\nexport async function handleInitCommand(args: string[] = []): Promise<void> {\n\tif (args.includes(\"--help\") || args.includes(\"-h\")) {\n\t\tconsole.log(formatInitHelp());\n\t\treturn;\n\t}\n\n\tlet options: EvalOpsInitOptions;\n\ttry {\n\t\toptions = parseInitArgs(args);\n\t} catch (error) {\n\t\tconsole.error(\n\t\t\tchalk.red(error instanceof Error ? error.message : String(error)),\n\t\t);\n\t\tprocess.exit(1);\n\t}\n\n\tif (!options.json) {\n\t\tconsole.log(chalk.bold(\"Maestro EvalOps Init\"));\n\t}\n\n\tconst result = await bootstrapEvalOpsAgent(options, {\n\t\tonAuthUrl: (url) => {\n\t\t\tif (options.json) {\n\t\t\t\tconsole.error(\n\t\t\t\t\t\"Open this URL in your browser to authenticate with EvalOps:\",\n\t\t\t\t);\n\t\t\t\tconsole.error(url);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconsole.log(\n\t\t\t\tchalk.yellow(\n\t\t\t\t\t\"Open this URL in your browser to authenticate with EvalOps:\",\n\t\t\t\t),\n\t\t\t);\n\t\t\tconsole.log(chalk.underline(url));\n\t\t},\n\t\tonStatus: (status) => {\n\t\t\tif (options.json) {\n\t\t\t\tconsole.error(status.message);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconsole.log(chalk.dim(status.message));\n\t\t},\n\t});\n\n\tif (options.json) {\n\t\tconsole.log(JSON.stringify(result, null, 2));\n\t\treturn;\n\t}\n\n\tconsole.log(chalk.green(\"EvalOps agent bootstrap complete.\"));\n\tconsole.log(chalk.dim(`MCP endpoint: ${result.endpoint}`));\n\tif (result.organizationId) {\n\t\tconsole.log(chalk.dim(`Organization: ${result.organizationId}`));\n\t}\n\tif (result.agentId) {\n\t\tconsole.log(chalk.dim(`Agent: ${result.agentId}`));\n\t}\n\tif (result.runId) {\n\t\tconsole.log(chalk.dim(`Run: ${result.runId}`));\n\t}\n\tif (result.keyPrefix) {\n\t\tconst keyMode = result.apiKeyCreated ? \"created\" : \"reused\";\n\t\tconsole.log(chalk.dim(`API key ${keyMode}: ${result.keyPrefix}`));\n\t}\n\tconsole.log(\n\t\tchalk.dim(\n\t\t\t\"Stored EvalOps MCP credentials locally for future Maestro sessions.\",\n\t\t),\n\t);\n}\n"]}
|
package/dist/cli/help.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,QAsNxC"}
|
package/dist/cli/help.js
CHANGED
|
@@ -86,7 +86,10 @@ export function printHelp(version) {
|
|
|
86
86
|
# Use Codex subscription models after \`maestro codex login\`
|
|
87
87
|
maestro --provider openai-codex --model gpt-5.5 "Plan this migration"
|
|
88
88
|
|
|
89
|
-
#
|
|
89
|
+
# Bootstrap EvalOps login, API key, and agent registration in one flow
|
|
90
|
+
maestro init
|
|
91
|
+
|
|
92
|
+
# Use EvalOps managed gateway models after \`maestro init\`
|
|
90
93
|
maestro --provider evalops --model gpt-4o-mini "Say hello in one sentence"
|
|
91
94
|
|
|
92
95
|
# Export a portable session log
|
|
@@ -165,6 +168,10 @@ export function printHelp(version) {
|
|
|
165
168
|
maestro remote attach <session-id> [--verify] [--print-env]
|
|
166
169
|
maestro remote extend <session-id> --ttl 2h
|
|
167
170
|
maestro remote stop <session-id> [--reason <text>]`)}`;
|
|
171
|
+
const initSection = `${sectionHeading("maestro init")}${muted(` maestro init Login, create or reuse an API key, and register this agent
|
|
172
|
+
maestro init --rotate-key Replace the stored agent MCP API key
|
|
173
|
+
maestro init --mcp-url <url> Override the EvalOps agent MCP endpoint
|
|
174
|
+
maestro init --json Emit machine-readable bootstrap output`)}`;
|
|
168
175
|
const hostedRunnerSection = `${sectionHeading("maestro hosted-runner")}${muted(` maestro hosted-runner --runner-session-id <id> --workspace-root <path> [--listen 0.0.0.0:8080]
|
|
169
176
|
|
|
170
177
|
Env mode:
|
|
@@ -202,6 +209,7 @@ export function printHelp(version) {
|
|
|
202
209
|
webSection,
|
|
203
210
|
portabilitySection,
|
|
204
211
|
memorySection,
|
|
212
|
+
initSection,
|
|
205
213
|
remoteSection,
|
|
206
214
|
hostedRunnerSection,
|
|
207
215
|
sessionsSection,
|
package/dist/cli/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACxC,MAAM,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,KAAK,CAC5C,IAAI,OAAO,gGAAgG,CAC3G,EAAE,CAAC;IACJ,MAAM,KAAK,GAAG,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,KAAK,CAC/C,iCAAiC,CACjC,EAAE,CAAC;IACJ,MAAM,OAAO,GAAG,GAAG,cAAc,CAAC,SAAS,CAAC,GAAG;QAC9C,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AAM,mBAAmB,GAAG,GAAG,cAAc,CAAC,uBAAuB,CAAC,GAAG,KAAK,CAC7E;;;8FAG4F,CAC5F,EAAE,CAAC;IACJ,MAAM,eAAe,GAAG,GAAG,cAAc,CAAC,kBAAkB,CAAC,GAAG,KAAK,CACpE;;mEAEiE,CACjE,EAAE,CAAC;IACJ,MAAM,iBAAiB,GAAG,GAAG,cAAc,CAAC,kBAAkB,CAAC,GAAG,KAAK,CACtE;;2CAEyC,CACzC,EAAE,CAAC;IACJ,MAAM,KAAK,GAAG,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG,KAAK,CACzD;;;;;;;;;;;;2FAYyF,CACzF,EAAE,CAAC;IAEJ,MAAM,gBAAgB,GAAG,GAAG,cAAc,CAAC,sBAAsB,CAAC,GAAG,KAAK,CACzE;;;mGAGiG,CACjG,EAAE,CAAC;IAEJ,OAAO,CAAC,GAAG,CACV;QACC,MAAM;QACN,KAAK;QACL,OAAO;QACP,QAAQ;QACR,GAAG;QACH,WAAW;QACX,UAAU;QACV,kBAAkB;QAClB,aAAa;QACb,aAAa;QACb,mBAAmB;QACnB,eAAe;QACf,iBAAiB;QACjB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,KAAK,CAChC,cAAc,EACd,qBAAqB,EACrB,MAAM,CACN,EAAE;QACH,gBAAgB;QAChB,KAAK;KACL,CAAC,IAAI,CAAC,MAAM,CAAC,CACd,CAAC;AACH,CAAC","sourcesContent":["/**\n * @fileoverview CLI Help Output Module\n *\n * This module generates and displays the `--help` output for the Maestro CLI.\n * It provides a comprehensive overview of:\n *\n * - **Usage syntax** and common invocation patterns\n * - **Command-line options** for provider, model, session management, etc.\n * - **Environment variables** for API keys and configuration\n * - **Available tools** and their capabilities\n * - **Subcommands** like `maestro exec` for headless execution\n * - **Session management** commands and workflows\n *\n * ## Styling\n *\n * The output uses the application's theme system for consistent terminal styling:\n * - `heading()` - Main title styling\n * - `sectionHeading()` - Section headers\n * - `muted()` - De-emphasized text for descriptions\n * - `badge()` - Highlighted tips and hints\n *\n * @module cli/help\n */\nimport { badge, heading, muted, sectionHeading } from \"../style/theme.js\";\n\n/**\n * Prints the complete CLI help message to stdout.\n *\n * This function is invoked when the user runs `maestro --help` or `maestro -h`.\n * It formats and displays all available options, commands, and usage examples\n * using the terminal theme for consistent styling.\n *\n * @param version - The current Maestro version string (e.g., \"1.2.3\")\n *\n * @example\n * ```typescript\n * import { printHelp } from \"./help.js\";\n * import { version } from \"../../package.json\";\n *\n * if (args.includes(\"--help\")) {\n * printHelp(version);\n * process.exit(0);\n * }\n * ```\n */\nexport function printHelp(version: string) {\n\tconst header = `${heading(\"Maestro\")} ${muted(\n\t\t`v${version} by EvalOps — AI coding assistant with read, list, search, diff, bash, edit, write, todo tools`,\n\t)}`;\n\tconst usage = `${sectionHeading(\"Usage\")}${muted(\n\t\t\"maestro [options] [messages...]\",\n\t)}`;\n\tconst options = `${sectionHeading(\"Options\")}${[\n\t\t\"--provider <name> Provider name (default: anthropic)\",\n\t\t\"-m, --model <id> Model ID (default: claude-sonnet-4-5)\",\n\t\t\"--task-budget <tokens> API-side Anthropic task budget in tokens\",\n\t\t\"--models <patterns> Comma-separated patterns for Ctrl+P model cycling\",\n\t\t\"--tools <names> Comma-separated tool names to enable (e.g., read,search,list,find)\",\n\t\t\"--api-key <key> API key (defaults to env vars)\",\n\t\t\"--system-prompt <text> System prompt (default: coding assistant prompt)\",\n\t\t\"--append-system-prompt <text> Append instructions to the system prompt\",\n\t\t\"--mode <mode> Output mode: text (default), json, or rpc\",\n\t\t\"--auth <mode> Credential mode: auto (default), api-key, claude\",\n\t\t\"--approval-mode <mode> Action approvals: prompt (default in TUI), auto, fail\",\n\t\t\"--sandbox <mode> Sandbox mode: docker, local, none (see docs/SAFETY.md)\",\n\t\t\"--port <n> Port for `maestro web` (defaults to PORT env or 8080)\",\n\t\t\"--continue, -c Continue previous session\",\n\t\t\"--resume, -r Select a session to resume\",\n\t\t\"--session <path> Use specific session file\",\n\t\t\"--no-session Don't save session (ephemeral)\",\n\t\t\"--safe-mode Enable extra safety restrictions\",\n\t\t\"--help, -h Show this help\",\n\t]\n\t\t.map((line) => ` ${muted(line)}`)\n\t\t.join(\"\\n\")}`;\n\tconst examples = `${sectionHeading(\"Examples\")}${muted(\n\t\t` # Interactive mode (no messages = interactive TUI)\n maestro\n\n # Single message\n maestro \"List all .ts files in src/\"\n\n # Multiple messages\n maestro \"Read package.json\" \"What dependencies do we have?\"\n\n # Continue previous session\n maestro --continue \"What did we discuss?\"\n\n # Use different model\n maestro --provider openai --model gpt-4o-mini \"Help me refactor this code\"\n\n # Use Codex subscription models after \\`maestro codex login\\`\n maestro --provider openai-codex --model gpt-5.5 \"Plan this migration\"\n\n # Use EvalOps managed gateway models after \\`maestro evalops login\\`\n maestro --provider evalops --model gpt-4o-mini \"Say hello in one sentence\"\n\n # Export a portable session log\n maestro export <session-id> ./session.jsonl --format jsonl\n\n # Export a portable JSON archive with secret redaction\n maestro export <session-id> ./session.json --format json --redact-secrets\n\n # Import a portable session log into this workspace\n maestro import ./session.json\n\n # Start a hosted EvalOps runner session and wait for attach readiness\n maestro remote start --workspace ws_123 --repo evalops/foo --branch main --ttl 90m --wait --verify\n\n # Run a single-session hosted runtime pod entrypoint\n maestro hosted-runner --runner-session-id mrs_abc --workspace-root /workspace --listen 0.0.0.0:8080\n\n # Show usage analytics for the last 7 days\n maestro stats\n\n # Show usage analytics for one session\n maestro stats --session <session-id>`,\n\t)}`;\n\tconst env = `${sectionHeading(\"Environment Variables:\")}${muted(\n\t\t` GEMINI_API_KEY - Google Gemini API key\n OPENAI_API_KEY - OpenAI API key\n OPENAI_CODEX_TOKEN - OpenAI Codex ChatGPT access token\n OPENAI_CODEX_ACCOUNT_ID - ChatGPT account id when using a raw Codex token\n ANTHROPIC_API_KEY - Anthropic API key\n CLAUDE_CODE_TOKEN - Claude Code access token for --auth claude\n ANTHROPIC_OAUTH_TOKEN - Alternate env for Claude Code bearer tokens\n MAESTRO_AGENT_DIR - Session storage directory (default: ~/.maestro/agent)\n MAESTRO_SANDBOX_MODE - Sandbox mode: docker, local, none (default: none)\n MAESTRO_CHANGELOG - Set to off/false/hide/hidden/skip/0 to hide startup changelog banner\n MAESTRO_TUI_MINIMAL - Set to 1/true to disable animations and reduce TUI effects (SSH-friendly)\n MAESTRO_TUI_TOOL_MAX_CHARS - Max chars shown per tool output panel (0 = unlimited)\n MAESTRO_TUI_TOOL_MAX_LINES - Max lines shown per tool output panel (0 = unlimited)\n MAESTRO_MEMORY_BASE - Durable memory service base URL\n MAESTRO_MEMORY_ACCESS_TOKEN - Override bearer token for durable memory service\n MAESTRO_MEMORY_TEAM_ID - Optional team scope for durable memory service\n MAESTRO_SHARED_MEMORY_BASE - Shared memory base URL (Cloudflare Durable Objects worker)\n MAESTRO_SHARED_MEMORY_API_KEY - API key for shared memory service\n MAESTRO_REMOTE_RUNNER_URL - Hosted runner control-plane URL (default: https://runner.evalops.dev)\n MAESTRO_REMOTE_RUNNER_TOKEN - Hosted runner bearer token override\n MAESTRO_REMOTE_RUNNER_ORG_ID - EvalOps organization id for hosted runner sessions\n MAESTRO_REMOTE_RUNNER_WORKSPACE_ID - EvalOps workspace id for hosted runner sessions\n CODING_AGENT_DIR - Legacy session directory override (fallback)`,\n\t)}`;\n\tconst execSection = `${sectionHeading(\"maestro exec\")}${muted(\n\t\t` maestro exec \"Summarize recent changes\" --json\n\n Flags:\n --json Stream JSONL thread/turn events\n --output-schema <file|json> Validate final assistant JSON against a schema\n --output-last-message <path> Write the final assistant message to disk\n --full-auto | --read-only Force approval policy (auto or fail)\n --sandbox <mode> Run in sandbox: docker, local, none\n --resume <sessionId> Resume a prior exec session by id\n --last Resume the most recent exec session`,\n\t)}`;\n\tconst webSection = `${sectionHeading(\"maestro web\")}${muted(\n\t\t` # Start the bundled web UI + API server\n maestro web\n\n # Use a custom port\n maestro web --port 3000`,\n\t)}`;\n\tconst portabilitySection = `${sectionHeading(\"Session Portability\")}${muted(\n\t\t` maestro export <session-id> [output-path] --format json|jsonl [--redact-secrets]\n maestro import <file.json|file.jsonl>\n\n Notes:\n - json preserves the full session in a portable wrapper object\n - jsonl preserves the append-only session log verbatim unless redaction is requested\n - --redact-secrets scrubs detected credentials from exported payloads\n - import restores the session into the current workspace session directory`,\n\t)}`;\n\tconst memorySection = `${sectionHeading(\"maestro memory\")}${muted(\n\t\t` maestro memory [status] Show shared memory service status\n maestro memory session <id> Show per-session metrics\n maestro memory audit <id> [n] Show recent sync audit entries\n maestro memory export <id> Export metrics log as JSONL\n maestro memory watch [id] [ms] Poll status/metrics continuously`,\n\t)}`;\n\tconst remoteSection = `${sectionHeading(\"maestro remote\")}${muted(\n\t\t` maestro remote start --workspace <id> --repo <repo> --branch <branch> [--ttl 90m] [--wait] [--verify]\n maestro remote list --workspace <id> [--state running]\n maestro remote attach <session-id> [--verify] [--print-env]\n maestro remote extend <session-id> --ttl 2h\n maestro remote stop <session-id> [--reason <text>]`,\n\t)}`;\n\tconst hostedRunnerSection = `${sectionHeading(\"maestro hosted-runner\")}${muted(\n\t\t` maestro hosted-runner --runner-session-id <id> --workspace-root <path> [--listen 0.0.0.0:8080]\n\n Env mode:\n MAESTRO_RUNNER_SESSION_ID=mrs_abc MAESTRO_WORKSPACE_ROOT=/workspace maestro hosted-runner`,\n\t)}`;\n\tconst sessionsSection = `${sectionHeading(\"Session Metadata\")}${muted(\n\t\t` /session favorite|unfavorite Toggle favorite for current session\n /session summary \"<text>\" Save a manual summary for current session\n /sessions summarize <id> Auto-summarize a saved session`,\n\t)}`;\n\tconst sessionsDiscovery = `${sectionHeading(\"Session Commands\")}${muted(\n\t\t` /session [info|favorite|unfavorite|summary \"<text>\"]\n /sessions [list|load <id>|favorite <id>|unfavorite <id>|summarize <id>]\n (Also available via TUI command palette)`,\n\t)}`;\n\tconst tools = `${sectionHeading(\"Available Tools\")}${muted(\n\t\t` read - Read file contents\n list - List files in a directory\n find - Fast file search using fd (glob patterns)\n search - Search files with ripgrep-style filtering\n parallel_ripgrep - Run multiple ripgrep patterns in parallel and merge line ranges\n diff - Show git diffs (workspace, staged, or ranges)\n bash - Execute bash commands\n edit - Edit files with find/replace\n write - Write files (creates/overwrites)\n todo - Create TodoWrite-style checklists\n\n Read-only tools: read,list,find,search,parallel_ripgrep,diff,status\n Example: maestro --tools read,list,find,search,parallel_ripgrep,diff \"Analyze this code\"`,\n\t)}`;\n\n\tconst frameworkSection = `${sectionHeading(\"Framework Preference\")}${muted(\n\t\t` /framework <id> Set default stack (fastapi, express, node)\n /framework <id> --workspace Set workspace-scoped default\n /framework list Show available options\n Precedence: policy (locked) > policy > env override > env default > workspace > user file > none`,\n\t)}`;\n\n\tconsole.log(\n\t\t[\n\t\t\theader,\n\t\t\tusage,\n\t\t\toptions,\n\t\t\texamples,\n\t\t\tenv,\n\t\t\texecSection,\n\t\t\twebSection,\n\t\t\tportabilitySection,\n\t\t\tmemorySection,\n\t\t\tremoteSection,\n\t\t\thostedRunnerSection,\n\t\t\tsessionsSection,\n\t\t\tsessionsDiscovery,\n\t\t\t`${sectionHeading(\"Tips\")}${badge(\n\t\t\t\t\"Need models?\",\n\t\t\t\t\"maestro models list\",\n\t\t\t\t\"info\",\n\t\t\t)}`,\n\t\t\tframeworkSection,\n\t\t\ttools,\n\t\t].join(\"\\n\\n\"),\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACxC,MAAM,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,KAAK,CAC5C,IAAI,OAAO,gGAAgG,CAC3G,EAAE,CAAC;IACJ,MAAM,KAAK,GAAG,GAAG,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;;;mEAIiE,CACjE,EAAE,CAAC;IACJ,MAAM,aAAa,GAAG,GAAG,cAAc,CAAC,gBAAgB,CAAC,GAAG,KAAK,CAChE;;;;qDAImD,CACnD,EAAE,CAAC;IACJ,MAAM,WAAW,GAAG,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG,KAAK,CAC5D;;;6EAG2E,CAC3E,EAAE,CAAC;IACJ,MAAM,mBAAmB,GAAG,GAAG,cAAc,CAAC,uBAAuB,CAAC,GAAG,KAAK,CAC7E;;;8FAG4F,CAC5F,EAAE,CAAC;IACJ,MAAM,eAAe,GAAG,GAAG,cAAc,CAAC,kBAAkB,CAAC,GAAG,KAAK,CACpE;;mEAEiE,CACjE,EAAE,CAAC;IACJ,MAAM,iBAAiB,GAAG,GAAG,cAAc,CAAC,kBAAkB,CAAC,GAAG,KAAK,CACtE;;2CAEyC,CACzC,EAAE,CAAC;IACJ,MAAM,KAAK,GAAG,GAAG,cAAc,CAAC,iBAAiB,CAAC,GAAG,KAAK,CACzD;;;;;;;;;;;;2FAYyF,CACzF,EAAE,CAAC;IAEJ,MAAM,gBAAgB,GAAG,GAAG,cAAc,CAAC,sBAAsB,CAAC,GAAG,KAAK,CACzE;;;mGAGiG,CACjG,EAAE,CAAC;IAEJ,OAAO,CAAC,GAAG,CACV;QACC,MAAM;QACN,KAAK;QACL,OAAO;QACP,QAAQ;QACR,GAAG;QACH,WAAW;QACX,UAAU;QACV,kBAAkB;QAClB,aAAa;QACb,WAAW;QACX,aAAa;QACb,mBAAmB;QACnB,eAAe;QACf,iBAAiB;QACjB,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG,KAAK,CAChC,cAAc,EACd,qBAAqB,EACrB,MAAM,CACN,EAAE;QACH,gBAAgB;QAChB,KAAK;KACL,CAAC,IAAI,CAAC,MAAM,CAAC,CACd,CAAC;AACH,CAAC","sourcesContent":["/**\n * @fileoverview CLI Help Output Module\n *\n * This module generates and displays the `--help` output for the Maestro CLI.\n * It provides a comprehensive overview of:\n *\n * - **Usage syntax** and common invocation patterns\n * - **Command-line options** for provider, model, session management, etc.\n * - **Environment variables** for API keys and configuration\n * - **Available tools** and their capabilities\n * - **Subcommands** like `maestro exec` for headless execution\n * - **Session management** commands and workflows\n *\n * ## Styling\n *\n * The output uses the application's theme system for consistent terminal styling:\n * - `heading()` - Main title styling\n * - `sectionHeading()` - Section headers\n * - `muted()` - De-emphasized text for descriptions\n * - `badge()` - Highlighted tips and hints\n *\n * @module cli/help\n */\nimport { badge, heading, muted, sectionHeading } from \"../style/theme.js\";\n\n/**\n * Prints the complete CLI help message to stdout.\n *\n * This function is invoked when the user runs `maestro --help` or `maestro -h`.\n * It formats and displays all available options, commands, and usage examples\n * using the terminal theme for consistent styling.\n *\n * @param version - The current Maestro version string (e.g., \"1.2.3\")\n *\n * @example\n * ```typescript\n * import { printHelp } from \"./help.js\";\n * import { version } from \"../../package.json\";\n *\n * if (args.includes(\"--help\")) {\n * printHelp(version);\n * process.exit(0);\n * }\n * ```\n */\nexport function printHelp(version: string) {\n\tconst header = `${heading(\"Maestro\")} ${muted(\n\t\t`v${version} by EvalOps — AI coding assistant with read, list, search, diff, bash, edit, write, todo tools`,\n\t)}`;\n\tconst usage = `${sectionHeading(\"Usage\")}${muted(\n\t\t\"maestro [options] [messages...]\",\n\t)}`;\n\tconst options = `${sectionHeading(\"Options\")}${[\n\t\t\"--provider <name> Provider name (default: anthropic)\",\n\t\t\"-m, --model <id> Model ID (default: claude-sonnet-4-5)\",\n\t\t\"--task-budget <tokens> API-side Anthropic task budget in tokens\",\n\t\t\"--models <patterns> Comma-separated patterns for Ctrl+P model cycling\",\n\t\t\"--tools <names> Comma-separated tool names to enable (e.g., read,search,list,find)\",\n\t\t\"--api-key <key> API key (defaults to env vars)\",\n\t\t\"--system-prompt <text> System prompt (default: coding assistant prompt)\",\n\t\t\"--append-system-prompt <text> Append instructions to the system prompt\",\n\t\t\"--mode <mode> Output mode: text (default), json, or rpc\",\n\t\t\"--auth <mode> Credential mode: auto (default), api-key, claude\",\n\t\t\"--approval-mode <mode> Action approvals: prompt (default in TUI), auto, fail\",\n\t\t\"--sandbox <mode> Sandbox mode: docker, local, none (see docs/SAFETY.md)\",\n\t\t\"--port <n> Port for `maestro web` (defaults to PORT env or 8080)\",\n\t\t\"--continue, -c Continue previous session\",\n\t\t\"--resume, -r Select a session to resume\",\n\t\t\"--session <path> Use specific session file\",\n\t\t\"--no-session Don't save session (ephemeral)\",\n\t\t\"--safe-mode Enable extra safety restrictions\",\n\t\t\"--help, -h Show this help\",\n\t]\n\t\t.map((line) => ` ${muted(line)}`)\n\t\t.join(\"\\n\")}`;\n\tconst examples = `${sectionHeading(\"Examples\")}${muted(\n\t\t` # Interactive mode (no messages = interactive TUI)\n maestro\n\n # Single message\n maestro \"List all .ts files in src/\"\n\n # Multiple messages\n maestro \"Read package.json\" \"What dependencies do we have?\"\n\n # Continue previous session\n maestro --continue \"What did we discuss?\"\n\n # Use different model\n maestro --provider openai --model gpt-4o-mini \"Help me refactor this code\"\n\n # Use Codex subscription models after \\`maestro codex login\\`\n maestro --provider openai-codex --model gpt-5.5 \"Plan this migration\"\n\n # Bootstrap EvalOps login, API key, and agent registration in one flow\n maestro init\n\n # Use EvalOps managed gateway models after \\`maestro init\\`\n maestro --provider evalops --model gpt-4o-mini \"Say hello in one sentence\"\n\n # Export a portable session log\n maestro export <session-id> ./session.jsonl --format jsonl\n\n # Export a portable JSON archive with secret redaction\n maestro export <session-id> ./session.json --format json --redact-secrets\n\n # Import a portable session log into this workspace\n maestro import ./session.json\n\n # Start a hosted EvalOps runner session and wait for attach readiness\n maestro remote start --workspace ws_123 --repo evalops/foo --branch main --ttl 90m --wait --verify\n\n # Run a single-session hosted runtime pod entrypoint\n maestro hosted-runner --runner-session-id mrs_abc --workspace-root /workspace --listen 0.0.0.0:8080\n\n # Show usage analytics for the last 7 days\n maestro stats\n\n # Show usage analytics for one session\n maestro stats --session <session-id>`,\n\t)}`;\n\tconst env = `${sectionHeading(\"Environment Variables:\")}${muted(\n\t\t` GEMINI_API_KEY - Google Gemini API key\n OPENAI_API_KEY - OpenAI API key\n OPENAI_CODEX_TOKEN - OpenAI Codex ChatGPT access token\n OPENAI_CODEX_ACCOUNT_ID - ChatGPT account id when using a raw Codex token\n ANTHROPIC_API_KEY - Anthropic API key\n CLAUDE_CODE_TOKEN - Claude Code access token for --auth claude\n ANTHROPIC_OAUTH_TOKEN - Alternate env for Claude Code bearer tokens\n MAESTRO_AGENT_DIR - Session storage directory (default: ~/.maestro/agent)\n MAESTRO_SANDBOX_MODE - Sandbox mode: docker, local, none (default: none)\n MAESTRO_CHANGELOG - Set to off/false/hide/hidden/skip/0 to hide startup changelog banner\n MAESTRO_TUI_MINIMAL - Set to 1/true to disable animations and reduce TUI effects (SSH-friendly)\n MAESTRO_TUI_TOOL_MAX_CHARS - Max chars shown per tool output panel (0 = unlimited)\n MAESTRO_TUI_TOOL_MAX_LINES - Max lines shown per tool output panel (0 = unlimited)\n MAESTRO_MEMORY_BASE - Durable memory service base URL\n MAESTRO_MEMORY_ACCESS_TOKEN - Override bearer token for durable memory service\n MAESTRO_MEMORY_TEAM_ID - Optional team scope for durable memory service\n MAESTRO_SHARED_MEMORY_BASE - Shared memory base URL (Cloudflare Durable Objects worker)\n MAESTRO_SHARED_MEMORY_API_KEY - API key for shared memory service\n MAESTRO_REMOTE_RUNNER_URL - Hosted runner control-plane URL (default: https://runner.evalops.dev)\n MAESTRO_REMOTE_RUNNER_TOKEN - Hosted runner bearer token override\n MAESTRO_REMOTE_RUNNER_ORG_ID - EvalOps organization id for hosted runner sessions\n MAESTRO_REMOTE_RUNNER_WORKSPACE_ID - EvalOps workspace id for hosted runner sessions\n CODING_AGENT_DIR - Legacy session directory override (fallback)`,\n\t)}`;\n\tconst execSection = `${sectionHeading(\"maestro exec\")}${muted(\n\t\t` maestro exec \"Summarize recent changes\" --json\n\n Flags:\n --json Stream JSONL thread/turn events\n --output-schema <file|json> Validate final assistant JSON against a schema\n --output-last-message <path> Write the final assistant message to disk\n --full-auto | --read-only Force approval policy (auto or fail)\n --sandbox <mode> Run in sandbox: docker, local, none\n --resume <sessionId> Resume a prior exec session by id\n --last Resume the most recent exec session`,\n\t)}`;\n\tconst webSection = `${sectionHeading(\"maestro web\")}${muted(\n\t\t` # Start the bundled web UI + API server\n maestro web\n\n # Use a custom port\n maestro web --port 3000`,\n\t)}`;\n\tconst portabilitySection = `${sectionHeading(\"Session Portability\")}${muted(\n\t\t` maestro export <session-id> [output-path] --format json|jsonl [--redact-secrets]\n maestro import <file.json|file.jsonl>\n\n Notes:\n - json preserves the full session in a portable wrapper object\n - jsonl preserves the append-only session log verbatim unless redaction is requested\n - --redact-secrets scrubs detected credentials from exported payloads\n - import restores the session into the current workspace session directory`,\n\t)}`;\n\tconst memorySection = `${sectionHeading(\"maestro memory\")}${muted(\n\t\t` maestro memory [status] Show shared memory service status\n maestro memory session <id> Show per-session metrics\n maestro memory audit <id> [n] Show recent sync audit entries\n maestro memory export <id> Export metrics log as JSONL\n maestro memory watch [id] [ms] Poll status/metrics continuously`,\n\t)}`;\n\tconst remoteSection = `${sectionHeading(\"maestro remote\")}${muted(\n\t\t` maestro remote start --workspace <id> --repo <repo> --branch <branch> [--ttl 90m] [--wait] [--verify]\n maestro remote list --workspace <id> [--state running]\n maestro remote attach <session-id> [--verify] [--print-env]\n maestro remote extend <session-id> --ttl 2h\n maestro remote stop <session-id> [--reason <text>]`,\n\t)}`;\n\tconst initSection = `${sectionHeading(\"maestro init\")}${muted(\n\t\t` maestro init Login, create or reuse an API key, and register this agent\n maestro init --rotate-key Replace the stored agent MCP API key\n maestro init --mcp-url <url> Override the EvalOps agent MCP endpoint\n maestro init --json Emit machine-readable bootstrap output`,\n\t)}`;\n\tconst hostedRunnerSection = `${sectionHeading(\"maestro hosted-runner\")}${muted(\n\t\t` maestro hosted-runner --runner-session-id <id> --workspace-root <path> [--listen 0.0.0.0:8080]\n\n Env mode:\n MAESTRO_RUNNER_SESSION_ID=mrs_abc MAESTRO_WORKSPACE_ROOT=/workspace maestro hosted-runner`,\n\t)}`;\n\tconst sessionsSection = `${sectionHeading(\"Session Metadata\")}${muted(\n\t\t` /session favorite|unfavorite Toggle favorite for current session\n /session summary \"<text>\" Save a manual summary for current session\n /sessions summarize <id> Auto-summarize a saved session`,\n\t)}`;\n\tconst sessionsDiscovery = `${sectionHeading(\"Session Commands\")}${muted(\n\t\t` /session [info|favorite|unfavorite|summary \"<text>\"]\n /sessions [list|load <id>|favorite <id>|unfavorite <id>|summarize <id>]\n (Also available via TUI command palette)`,\n\t)}`;\n\tconst tools = `${sectionHeading(\"Available Tools\")}${muted(\n\t\t` read - Read file contents\n list - List files in a directory\n find - Fast file search using fd (glob patterns)\n search - Search files with ripgrep-style filtering\n parallel_ripgrep - Run multiple ripgrep patterns in parallel and merge line ranges\n diff - Show git diffs (workspace, staged, or ranges)\n bash - Execute bash commands\n edit - Edit files with find/replace\n write - Write files (creates/overwrites)\n todo - Create TodoWrite-style checklists\n\n Read-only tools: read,list,find,search,parallel_ripgrep,diff,status\n Example: maestro --tools read,list,find,search,parallel_ripgrep,diff \"Analyze this code\"`,\n\t)}`;\n\n\tconst frameworkSection = `${sectionHeading(\"Framework Preference\")}${muted(\n\t\t` /framework <id> Set default stack (fastapi, express, node)\n /framework <id> --workspace Set workspace-scoped default\n /framework list Show available options\n Precedence: policy (locked) > policy > env override > env default > workspace > user file > none`,\n\t)}`;\n\n\tconsole.log(\n\t\t[\n\t\t\theader,\n\t\t\tusage,\n\t\t\toptions,\n\t\t\texamples,\n\t\t\tenv,\n\t\t\texecSection,\n\t\t\twebSection,\n\t\t\tportabilitySection,\n\t\t\tmemorySection,\n\t\t\tinitSection,\n\t\t\tremoteSection,\n\t\t\thostedRunnerSection,\n\t\t\tsessionsSection,\n\t\t\tsessionsDiscovery,\n\t\t\t`${sectionHeading(\"Tips\")}${badge(\n\t\t\t\t\"Need models?\",\n\t\t\t\t\"maestro models list\",\n\t\t\t\t\"info\",\n\t\t\t)}`,\n\t\t\tframeworkSection,\n\t\t\ttools,\n\t\t].join(\"\\n\\n\"),\n\t);\n}\n"]}
|