@martini-film/cli 0.1.0 → 0.3.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 +49 -28
- package/dist/api.js +38 -14
- package/dist/api.js.map +1 -1
- package/dist/approve.js +83 -0
- package/dist/approve.js.map +1 -0
- package/dist/args.js +33 -12
- package/dist/args.js.map +1 -1
- package/dist/cli.js +202 -64
- package/dist/cli.js.map +1 -1
- package/dist/commands/assets.js +255 -46
- package/dist/commands/assets.js.map +1 -1
- package/dist/commands/context.js +42 -8
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/files.js +135 -95
- package/dist/commands/files.js.map +1 -1
- package/dist/commands/login.js +171 -30
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/tools.js +73 -12
- package/dist/commands/tools.js.map +1 -1
- package/dist/config.js +10 -19
- package/dist/config.js.map +1 -1
- package/dist/generated/manifest.json +18393 -5431
- package/dist/help.js +203 -18
- package/dist/help.js.map +1 -1
- package/dist/host.js +0 -6
- package/dist/host.js.map +1 -1
- package/dist/manifest.js +9 -10
- package/dist/manifest.js.map +1 -1
- package/dist/output.js +149 -20
- package/dist/output.js.map +1 -1
- package/dist/schema.js +103 -30
- package/dist/schema.js.map +1 -1
- package/dist/wait.js +211 -29
- package/dist/wait.js.map +1 -1
- package/package.json +1 -1
package/dist/help.js
CHANGED
|
@@ -1,22 +1,41 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `--help` is written for the model that reads it: every command on one screen
|
|
3
|
-
* grouped by noun, every flag with its type and whether it is required, the
|
|
4
|
-
* tool's own description (already written for agents), and one example. Limits
|
|
5
|
-
* live in the descriptions the registry ships, so they are never restated here.
|
|
6
|
-
*/
|
|
7
1
|
import { CLI_VERSION } from './api.js';
|
|
2
|
+
import { approvalSupport } from './approve.js';
|
|
8
3
|
import { groupTools } from './manifest.js';
|
|
9
|
-
import { flagSpecs } from './schema.js';
|
|
4
|
+
import { flagSpecs, kebab } from './schema.js';
|
|
5
|
+
export const SUPERSEDED_BY_COMPOUND = {
|
|
6
|
+
upload_assets_prepare: 'upload',
|
|
7
|
+
upload_assets_complete: 'upload',
|
|
8
|
+
upload_asset_from_base64: 'upload',
|
|
9
|
+
get_asset_download_url: 'download',
|
|
10
|
+
};
|
|
11
|
+
const CONTEXT_PROPERTIES = ['projectId', 'canvasId', 'runId'];
|
|
10
12
|
export const GLOBAL_FLAGS = [
|
|
11
|
-
[
|
|
13
|
+
[
|
|
14
|
+
'--fields a,b.c',
|
|
15
|
+
'keep only these dotted paths of the result (on the server; in the CLI after a wait or when a segment is * — assets.*.status steps into an id-keyed map); a tool argument named like a global flag is spelled --tool-<name> (--tool-fields)',
|
|
16
|
+
],
|
|
17
|
+
['--out-dir <dir>', 'write each media block to its own file'],
|
|
12
18
|
['--out <path>', 'write the result (or media bytes) to a file; print one summary line'],
|
|
13
|
-
[
|
|
19
|
+
[
|
|
20
|
+
'--args <object|@file>',
|
|
21
|
+
'pass the whole arguments object as JSON instead of flags (tools only; --json is an alias unless the tool has an argument named json)',
|
|
22
|
+
],
|
|
14
23
|
[
|
|
15
24
|
'--wait / --no-wait',
|
|
16
25
|
'block until produced assets, renders, or runs settle (default on for single-item generation)',
|
|
17
26
|
],
|
|
18
|
-
[
|
|
19
|
-
|
|
27
|
+
[
|
|
28
|
+
'--timeout <seconds>',
|
|
29
|
+
'how long --wait waits before exiting 4 with the result and the pending ids (default MARTINI_WAIT_TIMEOUT_SECONDS when set — a Martini workflow run sets it to its step limit — else 50)',
|
|
30
|
+
],
|
|
31
|
+
[
|
|
32
|
+
'--approve --max-olives <n>',
|
|
33
|
+
'on a tool that quotes first (generate_nodes, upscale_assets, enhance_draft): take the quote, refuse over the cap, else approve it in the same command',
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
'--project / --canvas / --run <id>',
|
|
37
|
+
'context defaults for projectId / canvasId / runId (--project-id, --canvas-id, --run-id mean the same); --no-context sends only what you typed',
|
|
38
|
+
],
|
|
20
39
|
[
|
|
21
40
|
'--api-key / --api-url / --profile',
|
|
22
41
|
'credential and endpoint overrides (else env, .martini/config.json, ~/.config/martini/config.json)',
|
|
@@ -34,10 +53,23 @@ export function renderHelp(manifest, compounds) {
|
|
|
34
53
|
lines.push(` ${command.name.padEnd(28)} ${command.summary}`);
|
|
35
54
|
lines.push('');
|
|
36
55
|
lines.push(`Tools (${manifest.tools.length}; each MCP tool is a command with flags derived from its arguments):`);
|
|
37
|
-
|
|
56
|
+
const listed = manifest.tools.filter(tool => !SUPERSEDED_BY_COMPOUND[tool.name]);
|
|
57
|
+
for (const { group, tools } of groupTools(listed)) {
|
|
38
58
|
lines.push(` ${group}:`);
|
|
39
59
|
lines.push(` ${tools.map(tool => tool.name).join(' ')}`);
|
|
40
60
|
}
|
|
61
|
+
const superseded = new Map();
|
|
62
|
+
for (const tool of manifest.tools) {
|
|
63
|
+
const compound = SUPERSEDED_BY_COMPOUND[tool.name];
|
|
64
|
+
if (compound)
|
|
65
|
+
superseded.set(compound, [...(superseded.get(compound) ?? []), tool.name].sort());
|
|
66
|
+
}
|
|
67
|
+
if (superseded.size > 0) {
|
|
68
|
+
lines.push(' covered by a compound command (prefer it; the tools stay callable):');
|
|
69
|
+
for (const [compound, names] of [...superseded.entries()].sort(([a], [b]) => a.localeCompare(b))) {
|
|
70
|
+
lines.push(` ${compound} ← ${names.join(' ')}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
41
73
|
lines.push('');
|
|
42
74
|
lines.push('Global flags:');
|
|
43
75
|
for (const [flag, description] of GLOBAL_FLAGS)
|
|
@@ -50,15 +82,31 @@ export function renderHelp(manifest, compounds) {
|
|
|
50
82
|
}
|
|
51
83
|
function describeFlag(spec) {
|
|
52
84
|
const type = spec.kind === 'array'
|
|
53
|
-
? `${spec.items ?? 'string'}[] (
|
|
85
|
+
? `${spec.items ?? 'string'}[] (values after the flag, a repeated flag, or a JSON list)`
|
|
54
86
|
: spec.kind === 'object' || spec.kind === 'json'
|
|
55
|
-
?
|
|
87
|
+
? spec.acceptsString
|
|
88
|
+
? 'JSON or text'
|
|
89
|
+
: 'JSON'
|
|
56
90
|
: spec.kind;
|
|
57
|
-
const parts = [
|
|
58
|
-
|
|
59
|
-
|
|
91
|
+
const parts = [
|
|
92
|
+
`--${spec.flag}`.padEnd(30),
|
|
93
|
+
`${type}${spec.required ? ', required' : ''}${spec.nullable ? ' (or null)' : ''}`,
|
|
94
|
+
];
|
|
95
|
+
const values = spec.enum ?? spec.itemEnum;
|
|
96
|
+
if (values)
|
|
97
|
+
parts.push(`${spec.itemEnum ? 'each ' : ''}one of: ${values.map(value => JSON.stringify(value)).join(', ')}`);
|
|
60
98
|
return parts.join(' ');
|
|
61
99
|
}
|
|
100
|
+
function shadowNote(tool, spec, shadows) {
|
|
101
|
+
const scalar = (kind) => kind === 'number' || kind === 'integer' ? '1' : kind === 'boolean' ? 'true' : kind === 'string' ? '"…"' : '{…}';
|
|
102
|
+
const sample = spec.kind === 'array' ? `[${scalar(spec.items === 'json' ? 'string' : spec.items)}]` : scalar(spec.kind);
|
|
103
|
+
const row = GLOBAL_FLAGS.find(([label]) => label.split(/[\s/]+/).includes(`--${shadows}`));
|
|
104
|
+
const role = row ? ` (${row[1].split(/ \(|;/)[0]})` : '';
|
|
105
|
+
return [
|
|
106
|
+
...wrap(`The tool's own "${spec.property}" argument. --${shadows} is the CLI's global flag on every command${role}, so give this one as --${spec.flag}, or inside --args:`, 96).split('\n'),
|
|
107
|
+
` martini ${tool.name} --args '{"${spec.property}": ${sample}}'`,
|
|
108
|
+
];
|
|
109
|
+
}
|
|
62
110
|
export function renderToolHelp(tool) {
|
|
63
111
|
const specs = flagSpecs(tool);
|
|
64
112
|
const lines = [];
|
|
@@ -72,6 +120,10 @@ export function renderToolHelp(tool) {
|
|
|
72
120
|
tool.deprecated ? `deprecated${tool.deprecated.supersededBy ? `, use ${tool.deprecated.supersededBy}` : ''}` : null,
|
|
73
121
|
].filter(Boolean);
|
|
74
122
|
lines.push(`Kind: ${facts.join('; ')}`);
|
|
123
|
+
const compound = SUPERSEDED_BY_COMPOUND[tool.name];
|
|
124
|
+
if (compound) {
|
|
125
|
+
lines.push(`Prefer: martini ${compound} — it does this step and the ones around it in one command (martini ${compound} --help).`);
|
|
126
|
+
}
|
|
75
127
|
lines.push('');
|
|
76
128
|
lines.push('Flags:');
|
|
77
129
|
if (specs.length === 0)
|
|
@@ -80,12 +132,145 @@ export function renderToolHelp(tool) {
|
|
|
80
132
|
lines.push(` ${describeFlag(spec)}`);
|
|
81
133
|
if (spec.description)
|
|
82
134
|
lines.push(` ${wrap(spec.description, 96).split('\n').join('\n ')}`);
|
|
135
|
+
if (spec.shadows)
|
|
136
|
+
for (const line of shadowNote(tool, spec, spec.shadows))
|
|
137
|
+
lines.push(` ${line}`);
|
|
138
|
+
}
|
|
139
|
+
const properties = tool.inputSchema.properties ?? {};
|
|
140
|
+
const contextual = CONTEXT_PROPERTIES.filter(property => property in properties);
|
|
141
|
+
if (contextual.length > 0) {
|
|
142
|
+
lines.push('');
|
|
143
|
+
lines.push(wrap(`Context: ${contextual.map(property => `--${kebabOf(property)}`).join(' / ')} may be omitted; the value then comes from ${contextual
|
|
144
|
+
.map(property => `--${property.replace(/Id$/, '')}`)
|
|
145
|
+
.join(' / ')}, ${contextual.map(property => `MARTINI_${property.replace(/Id$/, '').toUpperCase()}_ID`).join(' / ')}, or .martini/config.json (a Martini workflow run provides one).`, 100));
|
|
146
|
+
}
|
|
147
|
+
const approval = approvalSupport(tool);
|
|
148
|
+
if (approval) {
|
|
149
|
+
lines.push('');
|
|
150
|
+
lines.push(wrap(approval.kind === 'quote'
|
|
151
|
+
? `Approval: without --${kebab(approval.argument)} the tool answers a quote (approvalNeeded: true, planHash, totalEstimatedOlives) and starts nothing. --approve --max-olives <n> takes the quote, refuses when the total is over the cap (PLAN_OVER_BUDGET, nothing started), and otherwise re-calls with the quote's planHash${approval.echoesBatchRequestId ? ', batchRequestId,' : ''} and the approval in one command; the result carries approvedPlan.`
|
|
152
|
+
: `Approval: --${kebab(approval.argument)} records that the plan was approved; there is no server quote, so --approve attests and --max-olives cannot apply here (for a capped batch: create_nodes, then generate_nodes --approve --max-olives <n>).`, 100));
|
|
153
|
+
}
|
|
154
|
+
if (tool.outputSchema) {
|
|
155
|
+
lines.push('');
|
|
156
|
+
lines.push('Result fields (use with --fields; the tool may return more):');
|
|
157
|
+
for (const line of resultFieldLines(tool.outputSchema))
|
|
158
|
+
lines.push(` ${line}`);
|
|
83
159
|
}
|
|
84
160
|
lines.push('');
|
|
85
161
|
lines.push('Example:');
|
|
86
162
|
lines.push(` ${exampleFor(tool, specs)}`);
|
|
87
163
|
lines.push('');
|
|
88
|
-
|
|
164
|
+
const owner = 'json' in (tool.inputSchema.properties ?? {});
|
|
165
|
+
lines.push(owner
|
|
166
|
+
? 'The whole arguments object can also be given as JSON: --args \'{"...": ...}\' or --args @args.json (this tool owns --json).'
|
|
167
|
+
: 'Any argument can also be given as JSON: --args \'{"...": ...}\' or --args @args.json (--json is an alias).');
|
|
168
|
+
return lines.join('\n') + '\n';
|
|
169
|
+
}
|
|
170
|
+
const RESULT_FIELD_DEPTH = 3;
|
|
171
|
+
export function resultFieldLines(schema) {
|
|
172
|
+
const rows = [];
|
|
173
|
+
const visit = (node, path, depth) => {
|
|
174
|
+
const properties = node.properties ?? {};
|
|
175
|
+
for (const [name, raw] of Object.entries(properties)) {
|
|
176
|
+
const field = raw ?? {};
|
|
177
|
+
const here = path ? `${path}.${name}` : name;
|
|
178
|
+
const { kind, inner, mapped } = fieldKind(field);
|
|
179
|
+
rows.push([mapped ? `${here}.*` : here, kind, describeField(field)]);
|
|
180
|
+
if (inner && depth < RESULT_FIELD_DEPTH)
|
|
181
|
+
visit(inner, mapped ? `${here}.*` : here, depth + 1);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
visit(schema, '', 1);
|
|
185
|
+
const width = Math.min(40, Math.max(...rows.map(([path]) => path.length), 10));
|
|
186
|
+
return rows.map(([path, kind, text]) => `${path.padEnd(width)} ${kind.padEnd(10)}${text ? ` ${text}` : ''}`);
|
|
187
|
+
}
|
|
188
|
+
function fieldKind(field) {
|
|
189
|
+
const type = Array.isArray(field.type) ? field.type.filter(t => t !== 'null').join('|') : field.type;
|
|
190
|
+
const nullable = Array.isArray(field.type) && field.type.includes('null');
|
|
191
|
+
const suffix = nullable ? '?' : '';
|
|
192
|
+
if (type === 'array') {
|
|
193
|
+
const items = field.items ?? {};
|
|
194
|
+
const itemType = Array.isArray(items.type) ? items.type.filter(t => t !== 'null')[0] : items.type;
|
|
195
|
+
if (itemType === 'object')
|
|
196
|
+
return { kind: `object[]${suffix}`, inner: items };
|
|
197
|
+
return { kind: `${itemType ?? 'any'}[]${suffix}` };
|
|
198
|
+
}
|
|
199
|
+
if (type === 'object') {
|
|
200
|
+
if (field.properties && Object.keys(field.properties).length > 0)
|
|
201
|
+
return { kind: `object${suffix}`, inner: field };
|
|
202
|
+
const values = field.additionalProperties;
|
|
203
|
+
if (values && typeof values === 'object' && values.properties)
|
|
204
|
+
return { kind: `map${suffix}`, inner: values, mapped: true };
|
|
205
|
+
return { kind: `object${suffix}` };
|
|
206
|
+
}
|
|
207
|
+
if (type)
|
|
208
|
+
return { kind: `${type}${suffix}` };
|
|
209
|
+
const variants = field.anyOf ?? field.oneOf;
|
|
210
|
+
if (variants?.length) {
|
|
211
|
+
const nonNull = variants.filter(variant => variant.type !== 'null');
|
|
212
|
+
const optional = nonNull.length < variants.length ? '?' : '';
|
|
213
|
+
if (nonNull.length === 1) {
|
|
214
|
+
const inner = fieldKind(nonNull[0]);
|
|
215
|
+
return { ...inner, kind: `${inner.kind}${optional}` };
|
|
216
|
+
}
|
|
217
|
+
const kinds = new Set(nonNull.map(variant => fieldKind(variant).kind));
|
|
218
|
+
return { kind: `${[...kinds].join('|')}${optional}` };
|
|
219
|
+
}
|
|
220
|
+
return { kind: 'any' };
|
|
221
|
+
}
|
|
222
|
+
function describeField(field) {
|
|
223
|
+
const parts = [];
|
|
224
|
+
if (field.enum)
|
|
225
|
+
parts.push(field.enum.map(value => JSON.stringify(value)).join(' | '));
|
|
226
|
+
if (field.description)
|
|
227
|
+
parts.push(field.description);
|
|
228
|
+
const text = parts.join(' — ');
|
|
229
|
+
return text.length > 90 ? `${text.slice(0, 87)}…` : text;
|
|
230
|
+
}
|
|
231
|
+
function kebabOf(property) {
|
|
232
|
+
return property.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
233
|
+
}
|
|
234
|
+
function describeCompoundFlag(flag) {
|
|
235
|
+
const label = `--${flag.flag}${flag.value ? ` ${flag.value}` : ''}`;
|
|
236
|
+
const parts = [label.padEnd(30), `${flag.kind}${flag.required ? ', required' : ''}`];
|
|
237
|
+
if (flag.enum)
|
|
238
|
+
parts.push(`one of: ${flag.enum.join(', ')}`);
|
|
239
|
+
return parts.join(' ');
|
|
240
|
+
}
|
|
241
|
+
export function renderCompoundHelp(command) {
|
|
242
|
+
const lines = [];
|
|
243
|
+
lines.push(`martini ${command.name} — ${command.summary}`);
|
|
244
|
+
lines.push('');
|
|
245
|
+
lines.push(`Usage: ${command.usage}`);
|
|
246
|
+
lines.push('');
|
|
247
|
+
if (command.details) {
|
|
248
|
+
lines.push(wrap(command.details, 100));
|
|
249
|
+
lines.push('');
|
|
250
|
+
}
|
|
251
|
+
if (command.positionals?.length) {
|
|
252
|
+
lines.push('Arguments:');
|
|
253
|
+
for (const positional of command.positionals) {
|
|
254
|
+
const label = `${positional.name}${positional.variadic ? '…' : ''}`;
|
|
255
|
+
lines.push(` ${label.padEnd(30)} ${positional.description}${positional.required ? ' (required)' : ''}`);
|
|
256
|
+
}
|
|
257
|
+
lines.push('');
|
|
258
|
+
}
|
|
259
|
+
lines.push('Flags:');
|
|
260
|
+
if (!command.flags?.length)
|
|
261
|
+
lines.push(' (none beyond the global flags)');
|
|
262
|
+
for (const flag of command.flags ?? []) {
|
|
263
|
+
lines.push(` ${describeCompoundFlag(flag)}`);
|
|
264
|
+
lines.push(` ${wrap(flag.description, 96).split('\n').join('\n ')}`);
|
|
265
|
+
}
|
|
266
|
+
lines.push('');
|
|
267
|
+
if (command.examples?.length) {
|
|
268
|
+
lines.push('Examples:');
|
|
269
|
+
for (const example of command.examples)
|
|
270
|
+
lines.push(` ${example}`);
|
|
271
|
+
lines.push('');
|
|
272
|
+
}
|
|
273
|
+
lines.push('Global flags apply too: --project / --canvas (or --project-id / --canvas-id), --fields, --out, --wait / --no-wait, --timeout, --quiet, --api-key, --profile.');
|
|
89
274
|
return lines.join('\n') + '\n';
|
|
90
275
|
}
|
|
91
276
|
export function exampleFor(tool, specs = flagSpecs(tool)) {
|
package/dist/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,UAAU,EAA4B,MAAM,eAAe,CAAA;AACpE,OAAO,EAAE,SAAS,EAAiB,MAAM,aAAa,CAAA;AAQtD,MAAM,CAAC,MAAM,YAAY,GAA4B;IACnD,CAAC,gBAAgB,EAAE,oEAAoE,CAAC;IACxF,CAAC,cAAc,EAAE,qEAAqE,CAAC;IACvF,CAAC,uBAAuB,EAAE,0DAA0D,CAAC;IACrF;QACE,oBAAoB;QACpB,8FAA8F;KAC/F;IACD,CAAC,qBAAqB,EAAE,0EAA0E,CAAC;IACnG,CAAC,mCAAmC,EAAE,mDAAmD,CAAC;IAC1F;QACE,mCAAmC;QACnC,mGAAmG;KACpG;IACD,CAAC,SAAS,EAAE,0BAA0B,CAAC;CACxC,CAAA;AAED,MAAM,UAAU,UAAU,CAAC,QAAkB,EAAE,SAAgC;IAC7E,MAAM,KAAK,GAAa,EAAE,CAAA;IAC1B,KAAK,CAAC,IAAI,CAAC,WAAW,WAAW,2CAA2C,CAAC,CAAA;IAC7E,KAAK,CAA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AG,GAAG,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5D,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;YACnB,OAAO,GAAG,IAAI,CAAA;QAChB,CAAC;aAAM,CAAC;YACN,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;QACjD,CAAC;IACH,CAAC;IACD,IAAI,OAAO;QAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
package/dist/host.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Which agent the CLI is running inside, read from the environment the host
|
|
3
|
-
* sets. Carried in the User-Agent (`martini-cli/0.1.0 (claude-code)`) so a
|
|
4
|
-
* tool call from the CLI under Claude Code is distinguishable from one Claude
|
|
5
|
-
* Code made over MCP. Unknown hosts yield null; nothing is guessed.
|
|
6
|
-
*/
|
|
7
1
|
const HOST_ENV_MARKERS = [
|
|
8
2
|
['CLAUDECODE', 'claude-code'],
|
|
9
3
|
['CLAUDE_CODE', 'claude-code'],
|
package/dist/host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAOA,MAAM,gBAAgB,GAA4B;IAChD,CAAC,YAAY,EAAE,aAAa,CAAC;IAC7B,CAAC,aAAa,EAAE,aAAa,CAAC;IAC9B,CAAC,cAAc,EAAE,QAAQ,CAAC;IAC1B,CAAC,iBAAiB,EAAE,QAAQ,CAAC;IAC7B,CAAC,eAAe,EAAE,OAAO,CAAC;IAC1B,CAAC,UAAU,EAAE,OAAO,CAAC;IACrB,CAAC,YAAY,EAAE,YAAY,CAAC;IAC5B,CAAC,UAAU,EAAE,UAAU,CAAC;IACxB,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAC9B,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;CACvC,CAAA;AAED,MAAM,UAAU,eAAe,CAAC,MAAyB,OAAO,CAAC,GAAG;IAClE,IAAI,GAAG,CAAC,kBAAkB;QAAE,OAAO,GAAG,CAAC,kBAAkB,CAAA;IACzD,KAAK,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,gBAAgB,EAAE,CAAC;QAChD,IAAI,GAAG,CAAC,QAAQ,CAAC;YAAE,OAAO,IAAI,CAAA;IAChC,CAAC;IACD,IAAI,GAAG,CAAC,YAAY,IAAI,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC;QAAE,OAAO,QAAQ,CAAA;IACzE,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/manifest.js
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The tool manifest the CLI is generated from: `src/generated/manifest.json`,
|
|
3
|
-
* exported from the backend registry with `pnpm --dir backend run export:tool-manifest`
|
|
4
|
-
* and drift-tested there against the live registry. Every entry becomes a
|
|
5
|
-
* command with the tool's name; the JSON Schema becomes its flags.
|
|
6
|
-
*/
|
|
7
1
|
import manifestJson from './generated/manifest.json' with { type: 'json' };
|
|
8
|
-
/** Imported, not read at runtime, so the compiled single-file binary embeds it. */
|
|
9
2
|
export function loadManifest() {
|
|
10
3
|
return manifestJson;
|
|
11
4
|
}
|
|
12
5
|
export function findTool(name, manifest = loadManifest()) {
|
|
13
6
|
return manifest.tools.find(tool => tool.name === name);
|
|
14
7
|
}
|
|
15
|
-
/** Tools grouped for `--help`, by the noun their name is about. */
|
|
16
8
|
export function groupTools(tools) {
|
|
17
9
|
const groups = new Map();
|
|
18
10
|
for (const tool of tools) {
|
|
@@ -26,16 +18,23 @@ export function groupTools(tools) {
|
|
|
26
18
|
.map(([group, list]) => ({ group, tools: list.sort((a, b) => a.name.localeCompare(b.name)) }));
|
|
27
19
|
}
|
|
28
20
|
const GROUP_KEYWORDS = [
|
|
21
|
+
[/^get_board_overview$/, 'projects'],
|
|
22
|
+
[/^get_jobs$|^wait_for_jobs$/, 'generation'],
|
|
23
|
+
[/^analyze_video_audio$/, 'assets'],
|
|
24
|
+
[/variation_stack/, 'canvas'],
|
|
29
25
|
[/timeline|checkpoint|render|export_timeline|artifact|audio_report/, 'timeline'],
|
|
30
26
|
[/project_file|json_file|file_input/, 'files'],
|
|
31
|
-
[
|
|
27
|
+
[
|
|
28
|
+
/workflow|run\b|_run$|actions?\b|^(pause|resume|approve|cancel|list)_run|^(promote|submit)_kit_candidate$/,
|
|
29
|
+
'workflows',
|
|
30
|
+
],
|
|
32
31
|
[/upload|storage|download/, 'uploads'],
|
|
33
32
|
[/library|subject|collection/, 'library'],
|
|
34
33
|
[/model|voice|upscale_presets/, 'models'],
|
|
35
34
|
[/generate|draft|upscale|enhance|blender|camera/, 'generation'],
|
|
36
35
|
[/bin|node|canvas|text_note|variable|layout|move_|duplicate|delete|metadata|labels|color/, 'canvas'],
|
|
37
36
|
[/comment/, 'comments'],
|
|
38
|
-
[/asset|inspect|frame|crop|
|
|
37
|
+
[/asset|inspect|frame|crop|^adjust_image$|view_|analyze_video/, 'assets'],
|
|
39
38
|
[/support/, 'support'],
|
|
40
39
|
[/project/, 'projects'],
|
|
41
40
|
];
|
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAOA,OAAO,YAAY,MAAM,2BAA2B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAmD1E,MAAM,UAAU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IACnC,CAAC,iBAAiB,EAAE,QAAQ,CAAC;IAC7B,CAAC,kEAAkE,EAAE,UAAU,CAAC;IAChF,CAAC,mCAAmC,EAAE,OAAO,CAAC;IAC9C;QACE,0GAA0G;QAC1G,WAAW;KACZ;IACD,CAAC,yBAAyB,EAAE,SAAS,CAAC;IACtC,CAAC,4BAA4B,EAAE,SAAS,CAAC;IACzC,CAAC,6BAA6B,EAAE,QAAQ,CAAC;IACzC,CAAC,+CAA+C,EAAE,YAAY,CAAC;IAC/D,CAAC,wFAAwF,EAAE,QAAQ,CAAC;IACpG,CAAC,SAAS,EAAE,UAAU,CAAC;IACvB,CAAC,6DAA6D,EAAE,QAAQ,CAAC;IACzE,CAAC,SAAS,EAAE,SAAS,CAAC;IACtB,CAAC,SAAS,EAAE,UAAU,CAAC;CACxB,CAAA;AAED,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,cAAc;QAAE,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,KAAK,CAAA;IACnF,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
package/dist/output.js
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The output and exit contract (docs/plans/agent-cli.md, decision 4).
|
|
3
|
-
*
|
|
4
|
-
* stdout carries results only: compact JSON when it is a pipe (an agent is
|
|
5
|
-
* reading), indented JSON on a terminal. `--out <path>` writes the result to a
|
|
6
|
-
* file and prints one summary line instead. Errors are one JSON object on
|
|
7
|
-
* stderr: `{ "error": { "code", "message", "hint" } }`, never mixed into stdout.
|
|
8
|
-
*
|
|
9
|
-
* Exit codes: 0 ok · 1 tool error · 2 usage · 3 auth · 4 not ready / timeout ·
|
|
10
|
-
* 5 insufficient credits.
|
|
11
|
-
*/
|
|
12
1
|
import { writeFileSync } from 'node:fs';
|
|
13
2
|
import { CliApiError } from './api.js';
|
|
14
3
|
import { ArgumentError } from './schema.js';
|
|
4
|
+
import { WaitTimeoutError } from './wait.js';
|
|
15
5
|
export const EXIT = {
|
|
16
6
|
ok: 0,
|
|
17
7
|
toolError: 1,
|
|
@@ -24,6 +14,10 @@ function write(options, text) {
|
|
|
24
14
|
;
|
|
25
15
|
(options.stdout ?? (line => process.stdout.write(line)))(text);
|
|
26
16
|
}
|
|
17
|
+
function writeError(options, text) {
|
|
18
|
+
;
|
|
19
|
+
(options.stderr ?? (line => process.stderr.write(line)))(text);
|
|
20
|
+
}
|
|
27
21
|
export function printResult(value, options = {}) {
|
|
28
22
|
if (options.out) {
|
|
29
23
|
const text = typeof value === 'string' ? value : JSON.stringify(value, null, 2) + '\n';
|
|
@@ -39,7 +33,40 @@ export function printResult(value, options = {}) {
|
|
|
39
33
|
return;
|
|
40
34
|
}
|
|
41
35
|
const tty = options.isTTY ?? Boolean(process.stdout.isTTY);
|
|
42
|
-
|
|
36
|
+
const printable = withoutMediaBytes(value);
|
|
37
|
+
write(options, (tty ? JSON.stringify(printable, null, 2) : JSON.stringify(printable)) + '\n');
|
|
38
|
+
}
|
|
39
|
+
export const MEDIA_BYTES_HINT = 'The bytes are not printed. Write them with --out <path> plus --raw (a result with one media block) or --out-dir <dir> (every block, read-only tools); --out <path> alone writes this JSON with the base64 kept.';
|
|
40
|
+
function isMediaBlock(block) {
|
|
41
|
+
return block !== null && typeof block === 'object' && typeof block.data === 'string';
|
|
42
|
+
}
|
|
43
|
+
function withoutMediaBytes(value) {
|
|
44
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
45
|
+
return value;
|
|
46
|
+
const media = value.media;
|
|
47
|
+
if (!Array.isArray(media) || !media.some(isMediaBlock))
|
|
48
|
+
return value;
|
|
49
|
+
return {
|
|
50
|
+
...value,
|
|
51
|
+
media: media.map(block => isMediaBlock(block)
|
|
52
|
+
? {
|
|
53
|
+
...block,
|
|
54
|
+
data: {
|
|
55
|
+
omitted: true,
|
|
56
|
+
mimeType: typeof block.mimeType === 'string' ? block.mimeType : null,
|
|
57
|
+
bytes: Buffer.from(block.data, 'base64').byteLength,
|
|
58
|
+
hint: MEDIA_BYTES_HINT,
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
: block),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export function assertRawDestination(options) {
|
|
65
|
+
if (options.out)
|
|
66
|
+
return;
|
|
67
|
+
if (options.isTTY ?? Boolean(process.stdout.isTTY)) {
|
|
68
|
+
throw new ArgumentError('--raw writes binary media bytes and stdout is a terminal. Add --out <path>, or pipe stdout to a file or program.');
|
|
69
|
+
}
|
|
43
70
|
}
|
|
44
71
|
export function printBytes(bytes, options) {
|
|
45
72
|
if (options.out) {
|
|
@@ -48,9 +75,87 @@ export function printBytes(bytes, options) {
|
|
|
48
75
|
write(options, `${bytes.byteLength} bytes${options.contentType ? ` (${options.contentType})` : ''} → ${options.out}\n`);
|
|
49
76
|
return;
|
|
50
77
|
}
|
|
78
|
+
assertRawDestination(options);
|
|
51
79
|
process.stdout.write(bytes);
|
|
52
80
|
}
|
|
53
|
-
|
|
81
|
+
export function printWarning(code, message, options = {}) {
|
|
82
|
+
if (options.quiet)
|
|
83
|
+
return;
|
|
84
|
+
writeError(options, JSON.stringify({ warning: { code, message } }) + '\n');
|
|
85
|
+
}
|
|
86
|
+
export function warnNoFieldsMatched(result, fields, options = {}, knownFields = []) {
|
|
87
|
+
if (fields.length === 0 || options.quiet)
|
|
88
|
+
return;
|
|
89
|
+
const empty = result !== null && typeof result === 'object' && Object.keys(result).length === 0;
|
|
90
|
+
if (!empty)
|
|
91
|
+
return;
|
|
92
|
+
const shape = knownFields.length
|
|
93
|
+
? `The result's top-level fields are: ${knownFields.join(', ')} (martini <tool> --help lists the nested ones).`
|
|
94
|
+
: 'Run once without --fields to see the shape.';
|
|
95
|
+
writeError(options, JSON.stringify({
|
|
96
|
+
warning: {
|
|
97
|
+
code: 'NO_FIELDS_MATCHED',
|
|
98
|
+
message: `--fields ${fields.join(',')} matched nothing in the result. Paths are dotted and case-sensitive (asset.imageUrl, nodes.nodeId). ${shape}`,
|
|
99
|
+
},
|
|
100
|
+
}) + '\n');
|
|
101
|
+
}
|
|
102
|
+
export function selectFields(value, paths) {
|
|
103
|
+
if (paths.length === 0)
|
|
104
|
+
return value;
|
|
105
|
+
let result;
|
|
106
|
+
for (const path of paths) {
|
|
107
|
+
const projected = project(value, path.split('.'));
|
|
108
|
+
if (projected !== undefined)
|
|
109
|
+
result = merge(result, projected);
|
|
110
|
+
}
|
|
111
|
+
return result ?? (Array.isArray(value) ? [] : {});
|
|
112
|
+
}
|
|
113
|
+
function project(value, segments) {
|
|
114
|
+
if (segments.length === 0)
|
|
115
|
+
return value;
|
|
116
|
+
if (Array.isArray(value))
|
|
117
|
+
return value.map(item => project(item, segments));
|
|
118
|
+
if (value && typeof value === 'object') {
|
|
119
|
+
const [head, ...rest] = segments;
|
|
120
|
+
if (!head)
|
|
121
|
+
return undefined;
|
|
122
|
+
if (head === '*') {
|
|
123
|
+
const out = {};
|
|
124
|
+
for (const [key, item] of Object.entries(value)) {
|
|
125
|
+
const inner = project(item, rest);
|
|
126
|
+
if (inner !== undefined)
|
|
127
|
+
out[key] = inner;
|
|
128
|
+
}
|
|
129
|
+
return Object.keys(out).length ? out : undefined;
|
|
130
|
+
}
|
|
131
|
+
if (!Object.prototype.hasOwnProperty.call(value, head))
|
|
132
|
+
return undefined;
|
|
133
|
+
const inner = project(value[head], rest);
|
|
134
|
+
return inner === undefined ? undefined : { [head]: inner };
|
|
135
|
+
}
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
function merge(a, b) {
|
|
139
|
+
if (a === undefined)
|
|
140
|
+
return b;
|
|
141
|
+
if (b === undefined)
|
|
142
|
+
return a;
|
|
143
|
+
if (Array.isArray(a) && Array.isArray(b))
|
|
144
|
+
return a.map((item, index) => merge(item, b[index]));
|
|
145
|
+
if (a && b && typeof a === 'object' && typeof b === 'object' && !Array.isArray(a) && !Array.isArray(b)) {
|
|
146
|
+
const out = { ...a };
|
|
147
|
+
for (const [key, value] of Object.entries(b)) {
|
|
148
|
+
Object.defineProperty(out, key, {
|
|
149
|
+
value: merge(out[key], value),
|
|
150
|
+
enumerable: true,
|
|
151
|
+
configurable: true,
|
|
152
|
+
writable: true,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return out;
|
|
156
|
+
}
|
|
157
|
+
return b;
|
|
158
|
+
}
|
|
54
159
|
export function summarize(value) {
|
|
55
160
|
if (value === null || value === undefined)
|
|
56
161
|
return 'empty result';
|
|
@@ -77,7 +182,10 @@ export function exitCodeFor(error) {
|
|
|
77
182
|
if (error.code === 'INSUFFICIENT_CREDITS' || error.code === 'INSUFFICIENT_OLIVES' || error.status === 402) {
|
|
78
183
|
return EXIT.insufficientCredits;
|
|
79
184
|
}
|
|
80
|
-
if (/_NOT_READY$/.test(error.code) ||
|
|
185
|
+
if (/_NOT_READY$/.test(error.code) ||
|
|
186
|
+
error.code === 'TIMEOUT' ||
|
|
187
|
+
error.code === 'RUN_NOT_ACTIVE' ||
|
|
188
|
+
error.code === 'LOGIN_PENDING')
|
|
81
189
|
return EXIT.notReady;
|
|
82
190
|
if (error.code === 'INVALID_ARGUMENTS' || error.code === 'INVALID_REQUEST' || error.code === 'TOOL_NOT_FOUND') {
|
|
83
191
|
return EXIT.usage;
|
|
@@ -86,21 +194,38 @@ export function exitCodeFor(error) {
|
|
|
86
194
|
}
|
|
87
195
|
return EXIT.toolError;
|
|
88
196
|
}
|
|
89
|
-
|
|
197
|
+
const RUN_CREDENTIAL_GONE_HINT = 'This execution’s run credential is expired or revoked. Stop and report it; do not run martini login. Retrying or resuming the run provisions a new one.';
|
|
198
|
+
export function hintFor(error, context = {}) {
|
|
199
|
+
if (error instanceof WaitTimeoutError) {
|
|
200
|
+
return `Still running; nothing was lost. Resume with: ${error.resumeCommand()} — give --timeout the seconds your shell step allows (a video generation takes minutes).`;
|
|
201
|
+
}
|
|
90
202
|
if (error instanceof CliApiError) {
|
|
91
203
|
switch (error.code) {
|
|
92
204
|
case 'NO_API_KEY':
|
|
93
|
-
return
|
|
205
|
+
return context.inRun
|
|
206
|
+
? 'This execution’s credential is not selected: MARTINI_CONFIG_FILE and MARTINI_PROFILE must be set by the run. Stop and report it; do not run martini login.'
|
|
207
|
+
: 'Run martini login (laptops) or set MARTINI_API_KEY (scripts). Inside a Martini workflow run the CLI is already signed in; do not run martini login there.';
|
|
94
208
|
case 'API_KEY_EXPIRED':
|
|
95
|
-
|
|
209
|
+
case 'API_KEY_REVOKED':
|
|
210
|
+
return context.inRun ? RUN_CREDENTIAL_GONE_HINT : 'Run martini login again to mint a fresh key.';
|
|
211
|
+
case 'RUN_KEY_NOT_ALLOWED':
|
|
212
|
+
return 'Run keys reach Martini only through the tool commands; this route is not available inside a workflow run.';
|
|
213
|
+
case 'LOGIN_PENDING':
|
|
214
|
+
return 'Approve the code in the browser, then run martini login again; the pairing is kept until it expires.';
|
|
215
|
+
case 'CLI_UPDATE_REQUIRED':
|
|
216
|
+
return 'Update the CLI (npm i -g @martini-film/cli@latest), then run martini login again; the approval is kept until it expires.';
|
|
96
217
|
case 'INVALID_ARGUMENTS':
|
|
97
218
|
return error.tool ? `Run martini ${error.tool} --help for the flags and their types.` : undefined;
|
|
98
219
|
case 'TOOL_NOT_FOUND':
|
|
99
220
|
return 'Run martini tools to list what this key can call.';
|
|
100
221
|
case 'RUN_NOT_ACTIVE':
|
|
101
|
-
return
|
|
222
|
+
return context.inRun
|
|
223
|
+
? 'No live session is bound to this credential (the run paused, ended, or moved). Stop and report it; a resumed run provisions a new one.'
|
|
224
|
+
: 'Run keys work only while their workflow run is executing.';
|
|
102
225
|
case 'INSUFFICIENT_CREDITS':
|
|
103
226
|
return 'Top up olives in Martini, or lower the batch.';
|
|
227
|
+
case 'FFPROBE_MISSING':
|
|
228
|
+
return 'Install ffmpeg (it ships ffprobe) and make sure it is on PATH.';
|
|
104
229
|
default:
|
|
105
230
|
if (/_NOT_READY$/.test(error.code))
|
|
106
231
|
return 'Wait for status completed: martini wait <asset-id>, or pass --wait.';
|
|
@@ -118,11 +243,15 @@ export function printError(error, options = {}) {
|
|
|
118
243
|
code: error instanceof CliApiError ? error.code : error instanceof ArgumentError ? 'USAGE' : 'CLI_ERROR',
|
|
119
244
|
message: error instanceof Error ? error.message : String(error),
|
|
120
245
|
...(error instanceof CliApiError && error.tool ? { tool: error.tool } : {}),
|
|
121
|
-
...(
|
|
246
|
+
...(error instanceof WaitTimeoutError ? { pending: error.pending } : {}),
|
|
247
|
+
...(error instanceof WaitTimeoutError && error.settled.length ? { settled: error.settled } : {}),
|
|
248
|
+
...(hintFor(error, { inRun: options.inRun ?? false })
|
|
249
|
+
? { hint: hintFor(error, { inRun: options.inRun ?? false }) }
|
|
250
|
+
: {}),
|
|
122
251
|
exitCode: code,
|
|
123
252
|
},
|
|
124
253
|
};
|
|
125
|
-
(options
|
|
254
|
+
writeError(options, JSON.stringify(payload) + '\n');
|
|
126
255
|
return code;
|
|
127
256
|
}
|
|
128
257
|
//# sourceMappingURL=output.js.map
|