@assethub/cli 0.1.6 → 0.1.7
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 +349 -5
- package/dist/autopilot.d.ts +13 -0
- package/dist/autopilot.d.ts.map +1 -0
- package/dist/autopilot.js +158 -0
- package/dist/canvas.d.ts +27 -0
- package/dist/canvas.d.ts.map +1 -0
- package/dist/canvas.js +82 -0
- package/dist/canvasAssetImport.d.ts +45 -0
- package/dist/canvasAssetImport.d.ts.map +1 -0
- package/dist/canvasAssetImport.js +154 -0
- package/dist/canvasComparison.d.ts +21 -0
- package/dist/canvasComparison.d.ts.map +1 -0
- package/dist/canvasComparison.js +58 -0
- package/dist/execution.d.ts +175 -0
- package/dist/execution.d.ts.map +1 -0
- package/dist/execution.js +234 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1579 -189
- package/dist/projectSources.d.ts +65 -0
- package/dist/projectSources.d.ts.map +1 -0
- package/dist/projectSources.js +369 -0
- package/dist/projectSourcesWorkbook.d.ts +3 -0
- package/dist/projectSourcesWorkbook.d.ts.map +1 -0
- package/dist/projectSourcesWorkbook.js +143 -0
- package/dist/runsUpload/artifactGraphModel.d.ts +48 -0
- package/dist/runsUpload/artifactGraphModel.d.ts.map +1 -0
- package/dist/runsUpload/artifactGraphModel.js +127 -0
- package/dist/runsUpload/blobRefs.d.ts +13 -0
- package/dist/runsUpload/blobRefs.d.ts.map +1 -0
- package/dist/runsUpload/blobRefs.js +73 -0
- package/dist/runsUpload/buildRunUpload.d.ts +63 -0
- package/dist/runsUpload/buildRunUpload.d.ts.map +1 -0
- package/dist/runsUpload/buildRunUpload.js +428 -0
- package/dist/runsUpload/canonicalJson.d.ts +5 -0
- package/dist/runsUpload/canonicalJson.d.ts.map +1 -0
- package/dist/runsUpload/canonicalJson.js +108 -0
- package/dist/runsUpload/controlEndpoints.d.ts +63 -0
- package/dist/runsUpload/controlEndpoints.d.ts.map +1 -0
- package/dist/runsUpload/controlEndpoints.js +64 -0
- package/dist/runsUpload/graphFolder.d.ts +25 -0
- package/dist/runsUpload/graphFolder.d.ts.map +1 -0
- package/dist/runsUpload/graphFolder.js +147 -0
- package/dist/runsUpload/runUploadError.d.ts +23 -0
- package/dist/runsUpload/runUploadError.d.ts.map +1 -0
- package/dist/runsUpload/runUploadError.js +24 -0
- package/dist/runsUpload/uploadRun.d.ts +43 -0
- package/dist/runsUpload/uploadRun.d.ts.map +1 -0
- package/dist/runsUpload/uploadRun.js +217 -0
- package/package.json +11 -8
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
5
|
+
import { AssetHubApiError, } from '@assethub/api-client';
|
|
6
|
+
import { readState, resolveCanvasSelection, writeState } from './canvas.js';
|
|
7
|
+
const operations = [
|
|
8
|
+
'image.generate',
|
|
9
|
+
'mesh.generate',
|
|
10
|
+
'production.analyze',
|
|
11
|
+
'production.execute',
|
|
12
|
+
'production.automation',
|
|
13
|
+
];
|
|
14
|
+
export const openExecutionSession = async (options) => {
|
|
15
|
+
const capabilities = await options.client.v2.getCapabilities();
|
|
16
|
+
if (capabilities.executionContext.status !== 'available' ||
|
|
17
|
+
(options.operation &&
|
|
18
|
+
!capabilities.executionContext.operations.includes(options.operation))) {
|
|
19
|
+
throw new Error(`Canvas execution history unavailable: ${capabilities.executionContext.reason ?? options.operation ?? 'disabled'}`);
|
|
20
|
+
}
|
|
21
|
+
const scope = {
|
|
22
|
+
...options,
|
|
23
|
+
baseUrl: options.client.baseUrl,
|
|
24
|
+
ownerId: capabilities.ownerId,
|
|
25
|
+
};
|
|
26
|
+
const canvas = await resolveCanvasSelection(scope);
|
|
27
|
+
return { ...scope, canvas, capabilities };
|
|
28
|
+
};
|
|
29
|
+
export const hasRecordedOperation = async (stateDir, operationId) => (await loadOperation(operationPath(stateDir, operationId))) !== undefined;
|
|
30
|
+
export class CliExecutionError extends Error {
|
|
31
|
+
exitCode;
|
|
32
|
+
operationId;
|
|
33
|
+
execution;
|
|
34
|
+
runId;
|
|
35
|
+
constructor(message, exitCode = 1, operationId, execution, runId = execution?.runId) {
|
|
36
|
+
super(message);
|
|
37
|
+
this.exitCode = exitCode;
|
|
38
|
+
this.operationId = operationId;
|
|
39
|
+
this.execution = execution;
|
|
40
|
+
this.runId = runId;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** Kept only for SIGINT reporting; interrupting the client never cancels server work. */
|
|
44
|
+
export const activeExecution = {};
|
|
45
|
+
const operationPath = (stateDir, id) => {
|
|
46
|
+
if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(id))
|
|
47
|
+
throw new Error('Operation ID must be a UUID');
|
|
48
|
+
return join(stateDir, 'operations', `${id}.json`);
|
|
49
|
+
};
|
|
50
|
+
const loadOperation = async (path) => {
|
|
51
|
+
const saved = await readState(path);
|
|
52
|
+
if (saved === undefined)
|
|
53
|
+
return undefined;
|
|
54
|
+
if (!saved ||
|
|
55
|
+
typeof saved !== 'object' ||
|
|
56
|
+
!('operation' in saved) ||
|
|
57
|
+
!operations.includes(saved.operation) ||
|
|
58
|
+
!('body' in saved) ||
|
|
59
|
+
!saved.body ||
|
|
60
|
+
typeof saved.body !== 'object' ||
|
|
61
|
+
!('executionContext' in saved.body) ||
|
|
62
|
+
!saved.body.executionContext ||
|
|
63
|
+
typeof saved.body.executionContext !== 'object' ||
|
|
64
|
+
!('canvasId' in saved.body.executionContext) ||
|
|
65
|
+
!Number.isSafeInteger(saved.body.executionContext.canvasId) ||
|
|
66
|
+
!('operationId' in saved) ||
|
|
67
|
+
typeof saved.operationId !== 'string' ||
|
|
68
|
+
!('baseUrl' in saved) ||
|
|
69
|
+
typeof saved.baseUrl !== 'string' ||
|
|
70
|
+
!('ownerId' in saved) ||
|
|
71
|
+
typeof saved.ownerId !== 'string')
|
|
72
|
+
throw new Error('Invalid saved operation');
|
|
73
|
+
return saved;
|
|
74
|
+
};
|
|
75
|
+
const submitSaved = async (session, saved, retryDelayMs = 250) => {
|
|
76
|
+
activeExecution.operationId = saved.operationId;
|
|
77
|
+
activeExecution.execution = undefined;
|
|
78
|
+
activeExecution.runId = saved.runId;
|
|
79
|
+
try {
|
|
80
|
+
if (saved.runId) {
|
|
81
|
+
const execution = await session.client.v2.getRun(saved.runId);
|
|
82
|
+
activeExecution.execution = execution;
|
|
83
|
+
return { execution };
|
|
84
|
+
}
|
|
85
|
+
for (let attempt = 0;; attempt++) {
|
|
86
|
+
try {
|
|
87
|
+
const options = { idempotencyKey: saved.operationId };
|
|
88
|
+
const queued = await (async () => {
|
|
89
|
+
switch (saved.operation) {
|
|
90
|
+
case 'image.generate':
|
|
91
|
+
return session.client.v2.generateImage(saved.body, options);
|
|
92
|
+
case 'mesh.generate':
|
|
93
|
+
return session.client.v2.generateMesh(saved.body, options);
|
|
94
|
+
case 'production.analyze':
|
|
95
|
+
return session.client.v1.analyzeProduction(saved.body, options);
|
|
96
|
+
case 'production.execute':
|
|
97
|
+
return session.client.v1.executeProduction(saved.body, options);
|
|
98
|
+
case 'production.automation':
|
|
99
|
+
return session.client.v1.runProductionAutomation(saved.body, options);
|
|
100
|
+
}
|
|
101
|
+
})();
|
|
102
|
+
if (!queued.execution)
|
|
103
|
+
throw new CliExecutionError('Server omitted the canvas execution receipt; resume with the same operation ID', 1, saved.operationId);
|
|
104
|
+
activeExecution.runId = queued.execution.runId;
|
|
105
|
+
activeExecution.execution = queued.execution;
|
|
106
|
+
saved.runId = queued.execution.runId;
|
|
107
|
+
await writeState(operationPath(session.stateDir, saved.operationId), saved);
|
|
108
|
+
return { ...queued, execution: queued.execution };
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
const retryable = error instanceof TypeError ||
|
|
112
|
+
(error instanceof AssetHubApiError &&
|
|
113
|
+
([429, 502, 503, 504].includes(error.status) ||
|
|
114
|
+
error.code === 'IDEMPOTENCY_IN_PROGRESS'));
|
|
115
|
+
if (!retryable || attempt >= 2)
|
|
116
|
+
throw error;
|
|
117
|
+
await delay(retryDelayMs * 2 ** attempt);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (error instanceof AssetHubApiError &&
|
|
123
|
+
error.code === 'EXECUTION_RECOVERY_REQUIRED' &&
|
|
124
|
+
error.runId) {
|
|
125
|
+
saved.runId = error.runId;
|
|
126
|
+
activeExecution.runId = error.runId;
|
|
127
|
+
await writeState(operationPath(session.stateDir, saved.operationId), saved);
|
|
128
|
+
activeExecution.execution = await session.client.v2
|
|
129
|
+
.getRun(error.runId, { signal: AbortSignal.timeout(5_000) })
|
|
130
|
+
.catch(() => undefined);
|
|
131
|
+
throw new CliExecutionError(error.message, 3, saved.operationId, activeExecution.execution, error.runId);
|
|
132
|
+
}
|
|
133
|
+
throw new CliExecutionError(error instanceof Error ? error.message : String(error), error instanceof AssetHubApiError &&
|
|
134
|
+
(error.status < 500 ||
|
|
135
|
+
['CANVAS_EXECUTION_UNAVAILABLE', 'EVALUATOR_UNAVAILABLE'].includes(error.code))
|
|
136
|
+
? 2
|
|
137
|
+
: 1, saved.operationId, activeExecution.execution);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
export const executeRecorded = async (session, operation, body, options = {}) => {
|
|
141
|
+
if (!session.capabilities.executionContext.operations.includes(operation))
|
|
142
|
+
throw new CliExecutionError(`Canvas execution history unavailable: ${operation}`, 2);
|
|
143
|
+
const operationId = options.operationId ?? randomUUID();
|
|
144
|
+
const path = operationPath(session.stateDir, operationId);
|
|
145
|
+
const saved = JSON.parse(JSON.stringify({
|
|
146
|
+
operation,
|
|
147
|
+
operationId,
|
|
148
|
+
baseUrl: session.baseUrl,
|
|
149
|
+
ownerId: session.ownerId,
|
|
150
|
+
body: {
|
|
151
|
+
...body,
|
|
152
|
+
executionContext: {
|
|
153
|
+
canvasId: session.canvas.id,
|
|
154
|
+
clientOperationId: operationId,
|
|
155
|
+
source: options.source ?? 'cli',
|
|
156
|
+
agent: options.agent,
|
|
157
|
+
parentRunId: options.parentRunId,
|
|
158
|
+
graphSource: options.graphSource,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
}));
|
|
162
|
+
await mkdir(dirname(path), { recursive: true, mode: 0o700 });
|
|
163
|
+
try {
|
|
164
|
+
// Exclusive creation prevents concurrent use of one key with different inputs.
|
|
165
|
+
await writeFile(path, JSON.stringify(saved), { mode: 0o600, flag: 'wx' });
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
if (!error ||
|
|
169
|
+
typeof error !== 'object' ||
|
|
170
|
+
!('code' in error) ||
|
|
171
|
+
error.code !== 'EEXIST')
|
|
172
|
+
throw error;
|
|
173
|
+
const previous = await loadOperation(path);
|
|
174
|
+
if (!previous ||
|
|
175
|
+
JSON.stringify({ ...previous, runId: undefined }) !== JSON.stringify(saved)) {
|
|
176
|
+
throw new CliExecutionError('Operation ID already belongs to different inputs; use runs resume or a new operation ID', 1, operationId);
|
|
177
|
+
}
|
|
178
|
+
return submitSaved(session, previous, options.retryDelayMs);
|
|
179
|
+
}
|
|
180
|
+
return submitSaved(session, saved, options.retryDelayMs);
|
|
181
|
+
};
|
|
182
|
+
export const resumeRecorded = async (options) => {
|
|
183
|
+
const saved = await loadOperation(operationPath(options.stateDir, options.operationId));
|
|
184
|
+
if (!saved || saved.operationId !== options.operationId)
|
|
185
|
+
throw new Error('Saved operation not found');
|
|
186
|
+
if (saved.baseUrl !== options.client.baseUrl)
|
|
187
|
+
throw new Error('Saved operation belongs to a different API origin');
|
|
188
|
+
if (options.expectedCanvasId !== undefined &&
|
|
189
|
+
saved.body.executionContext.canvasId !== options.expectedCanvasId)
|
|
190
|
+
throw new Error('Saved operation belongs to a different canvas');
|
|
191
|
+
for (const [key, value] of Object.entries(options.expectedBody ?? {})) {
|
|
192
|
+
if (JSON.stringify(saved.body[key]) !== JSON.stringify(value))
|
|
193
|
+
throw new CliExecutionError('Operation ID already belongs to different inputs; use runs resume or a new operation ID', 2, saved.operationId);
|
|
194
|
+
}
|
|
195
|
+
const session = await openExecutionSession({
|
|
196
|
+
...options,
|
|
197
|
+
canvasId: saved.body.executionContext.canvasId,
|
|
198
|
+
operation: saved.operation,
|
|
199
|
+
});
|
|
200
|
+
if (session.ownerId !== saved.ownerId)
|
|
201
|
+
throw new Error('Saved operation belongs to a different organization');
|
|
202
|
+
return submitSaved(session, saved, options.retryDelayMs);
|
|
203
|
+
};
|
|
204
|
+
export const waitForExecution = async (client, runId, options = {}) => {
|
|
205
|
+
if (activeExecution.execution?.runId !== runId) {
|
|
206
|
+
activeExecution.execution = undefined;
|
|
207
|
+
activeExecution.operationId = undefined;
|
|
208
|
+
}
|
|
209
|
+
activeExecution.runId = runId;
|
|
210
|
+
const deadline = Date.now() + (options.timeoutMs ?? 900_000);
|
|
211
|
+
const timeout = () => new CliExecutionError(`Wait timed out; server execution continues. Use runs watch ${runId}.`, 3, activeExecution.operationId, activeExecution.execution, runId);
|
|
212
|
+
while (true) {
|
|
213
|
+
const signal = AbortSignal.timeout(Math.max(1, deadline - Date.now()));
|
|
214
|
+
let execution;
|
|
215
|
+
try {
|
|
216
|
+
execution = await client.v2.getRun(runId, { signal });
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
if (signal.aborted)
|
|
220
|
+
throw timeout();
|
|
221
|
+
throw new CliExecutionError(error instanceof Error ? error.message : String(error), error instanceof AssetHubApiError && error.status < 500 ? 2 : 1, activeExecution.operationId, activeExecution.execution, runId);
|
|
222
|
+
}
|
|
223
|
+
activeExecution.execution = execution;
|
|
224
|
+
options.onProgress?.(execution);
|
|
225
|
+
if (execution.status === 'needs_review')
|
|
226
|
+
return execution;
|
|
227
|
+
if (!['queued', 'running'].includes(execution.status) &&
|
|
228
|
+
execution.history.status === 'recorded')
|
|
229
|
+
return execution;
|
|
230
|
+
if (Date.now() >= deadline)
|
|
231
|
+
throw timeout();
|
|
232
|
+
await delay(Math.min(options.intervalMs ?? 5_000, Math.max(0, deadline - Date.now())));
|
|
233
|
+
}
|
|
234
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,97 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { type AnimationRetargetRequest, type Intervention, type RigRequest } from '@assethub/api-client';
|
|
3
|
+
import { buildRunUploadPlan } from './runsUpload/buildRunUpload.js';
|
|
4
|
+
type Flags = Record<string, string | boolean | string[]>;
|
|
5
|
+
export declare const usage = "AssetHub CLI\n\nInternal preview: canvas/context/layout and moodboards require workspace feature access.\n\nUsage:\n assethub auth login --api-key <key> [--base-url <url>] [--profile <name>]\n assethub auth login --api-key-stdin [--base-url <url>] [--profile <name>]\n assethub auth status [--profile <name>]\n assethub auth logout [--profile <name>]\n assethub workspace prepare|sync|analyze|verify --internal --manifest <json> --state <json>\n assethub workspace self-check --internal\n assethub workspace context put --internal --org <uuid> --actor <uuid> --canvas <id> --file <json> [--if-version <n>] [--order <uuid>]\n assethub workspace context get --internal --org <uuid> --actor <uuid> --canvas <id> [--out <json>] [--order <uuid>]\n assethub project ingest <source-dir> --out-dir <directory> [--exclude-dir <relative-path>...]\n assethub language text|vision --input-json @<json> --operation-id <uuid> [--out <json>]\n assethub canvas import --canvas <id> --file <image> [--name <name>]\n assethub canvas context get --canvas <id> [--out <json>]\n assethub canvas context put --canvas <id> --file <json> [--if-version <n>]\n assethub canvas layout --canvas <id> --input-json @<json>\n assethub canvas compare --canvas <id> --source-id <asset-id> --asset-id <asset-id> --out <html>\n assethub moodboard create --input-json @<json> [--operation-id <uuid>]\n assethub moodboard list|get|update|archive [<board-id>] [--input-json @<json>]\n assethub moodboard analyze <board-id> [--revision <uuid>] [--wait]\n assethub image generate --canvas <id> --context <id> [--context-version <n>] [--context-source <key>] [--moodboard-revision <uuid>] --prompt <text> --wait\n assethub models list [--domain <domain>] [--ids-only] [--limit <n>]\n assethub models get <model-id>\n assethub files import <url> --media-type image|mesh\n assethub files upload <file> --media-type image|mesh\n assethub source create (--file <path> | --source-url <url> | --source-id <id> | --stdin | --stdin-base64 | --stdin-data-uri | --stdin-json | --source-json <json|@file|@-> | --data-uri <uri> | --clipboard) --media-type image|mesh [--file-name <name>] [--content-type <type>]\n assethub capabilities\n assethub canvas create [--name <name>] [--operation-id <uuid>]\n assethub canvas list [--cursor <cursor>] [--limit <n>]\n assethub canvas get|use|open [<id>]\n assethub runs list [--canvas <id>] [--cursor <cursor>] [--limit <n>]\n assethub runs get|watch <run-id> [--timeout-ms <n>]\n assethub runs resume <operation-id> [--wait]\n assethub graph show|export [--canvas <id>] [--artifact <node-id>] [--out <path>] [--allow-truncated]\n assethub graph lineage --artifact <node-id> [--canvas <id>] [--direction ancestors|descendants|both] [--depth <n>]\n assethub evaluate list\n assethub evaluations submit --artifact <asset-id> --report <json|file|@file|@-> [--agent <name>] [--canvas <id>] [--reference <asset-id>...] [--run <run-id>] [--operation-id <uuid>] [--require-pass]\n assethub evaluations list [--canvas <id>] [--artifact <asset-id>]\n assethub evaluations get <evaluation-id>\n assethub image generate --input-json <json|@file|@-> [--canvas <id>] [--operation-id <uuid>] [--agent <name>] [--derived-from-run <run-id>] [--from-node <graphId/nodeId> --graph-revision <rev>] [--wait]\n assethub mesh generate --input-json <json|@file|@-> [--canvas <id>] [--operation-id <uuid>] [--agent <name>] [--derived-from-run <run-id>] [--from-node <graphId/nodeId> --graph-revision <rev>] [--wait]\n assethub image generate --prompt <text> [--file <path> | --source-url <url> | --stdin | --stdin-base64 | --stdin-data-uri | --stdin-json | --source-json <json|@file|@-> | --data-uri <uri> | --clipboard] [--file-name <name>] [--content-type <type>] [--model-id <id>] [--batch-size <n>] [--wait] [--download --out-dir <dir>] [--canvas <id>] [--operation-id <uuid>] [--api-version v2]\n assethub image generate --prompt <text> --source-resource-id <id> --api-version v2 [--model-id <id>] [--batch-size <n>] [--wait]\n assethub mesh generate (--file <path> | --source-url <url> | --source-resource-id <id> | --file-ref-json <json> | --stdin | --stdin-base64 | --stdin-data-uri | --stdin-json | --source-json <json|@file|@-> | --data-uri <uri>) [--file-name <name>] [--content-type <type>] [--model-id <id>] [--name <name>] [--wait] [--download --out-dir <dir>]\n assethub mesh retopo (--source-resource-id <id> | --source-url <url> | --file-ref-json <json> | --stdin | --stdin-base64 | --stdin-data-uri | --stdin-json | --source-json <json|@file|@-> | --data-uri <uri>) --model-id <id> [--file-name <name>] [--content-type <type>] [--wait] [--download --out-dir <dir>]\n assethub rig check (--file <path> | --source-url <url> | --source-resource-id <id> | --file-ref-json <json> | --stdin | --stdin-base64 | --stdin-data-uri | --stdin-json | --source-json <json|@file|@-> | --data-uri <uri>) [--name <name>] [--wait] [--download --out-dir <dir>]\n assethub rig create (--file <path> | --source-url <url> | --source-resource-id <id> | --file-ref-json <json> | --stdin | --stdin-base64 | --stdin-data-uri | --stdin-json | --source-json <json|@file|@-> | --data-uri <uri>) [--model v1.0-20240301|v2.5-20260210] [--rig-type biped|quadruped|hexapod|octopod|avian|serpentine|aquatic] [--spec tripo|mixamo] [--out-format glb|fbx] [--name <name>] [--wait] [--download --out-dir <dir>]\n assethub animate presets [--model v1.0-20240301|v2.5-20260210] [--rig-type <type>]\n assethub animate retarget --resource-id <id> --animation <preset-id> [--animation <preset-id>... up to 5 total] [--out-format glb|fbx] [--bake-animation true|false] [--export-with-geometry true|false] [--animate-in-place true|false] [--name <name>] [--wait] [--download --out-dir <dir>]\n assethub jobs get <job-id> [--download --out-dir <dir>]\n assethub jobs watch <job-id> [--interval-ms <ms>] [--timeout-ms <ms>] [--download --out-dir <dir>]\n assethub production analyze (--file <path> | --source-url <url> | --source-id <id> | --image-url <url> | --file-ref-json <json> | --stdin | --stdin-base64 | --stdin-data-uri | --stdin-json | --source-json <json|@file|@-> | --data-uri <uri> | --clipboard) [--file-name <name>] [--content-type <type>] [--part-extractor <name>] [--name <name>] [--wait] [--download --out-dir <dir>]\n assethub production agents\n assethub production automation --input-json <json|@file|@-> [--canvas <id>] [--operation-id <uuid>] [--wait]\n assethub production status <order-id> [--wait] [--download --out-dir <dir>]\n assethub production execute --order-id <id> --mission-id <id> --task-id <id> [--task-id <id>...] [--part-extractor <name>] [--part-extraction-mode fast|high_quality] [--wait] [--download --out-dir <dir>]\n assethub production run --order-id <id> --mission-id <id> [--run-mode full_auto|approval] [--task-id <id>...] [--part-extractor <name>] [--part-extraction-mode fast|high_quality] [--allowed-model-id <id>...] [--max-iterations <n>] [--max-cost-credits <n>] [--wait] [--download --out-dir <dir>]\n assethub production watch <order-id> [--interval-ms <ms>] [--timeout-ms <ms>] [--download --out-dir <dir>]\n assethub production intervene <order-id> (--exclude <target-id> | --include <target-id> | --add-part <name> | --rename <target-id>=<name> | --reject <target-id>[=<reason>] | --regenerate <target-id>=<mode> | --set-param <key>=<value> | --ops-json <json|@file|@->)... [--idempotency-key <key>]\n assethub production interventions <order-id>\n assethub runs upload <path> [--graph-id <id>] [--stream-id <id>] [--rev <n>] [--description <text>] [--tag <tag>...] [--skip-register] [--dry-run]\n assethub parts split (--file <path> | --source-url <url> | --source-id <id> | --image-url <url> | --file-ref-json <json> | --stdin | --stdin-base64 | --stdin-data-uri | --stdin-json | --source-json <json|@file|@-> | --data-uri <uri> | --clipboard | --order-id <id>) [--file-name <name>] [--content-type <type>] [--part-extractor <name>] [--wait] [--task-id <id>...] [--mission-id <id>] [--all-ready] [--download --out-dir <dir>]\n assethub parts compare (--file <path> | --source-url <url> | --source-id <id> | --image-url <url> | --file-ref-json <json> | --stdin | --stdin-base64 | --stdin-data-uri | --stdin-json | --source-json <json|@file|@-> | --data-uri <uri> | --clipboard) [--file-name <name>] [--content-type <type>] [--preprocess-prompt <text>] [--preprocess-model-id <id>] [--fail-on-preprocess-error] [--part-extractor <name>] [--wait] [--task-id <id>...] [--mission-id <id>] [--all-ready] [--download --out-dir <dir>]\n assethub autopilot [<image>] --demo [--yolo] [--json] [--max-regen <n>] [--stall-rounds <n>] [--tie-epsilon <x>] [--multiview 2-view|4-view|6-view] [--ab-mode serial|cross] [--credit-budget <n>]\n\nGlobal options:\n --api-key <key> Overrides saved auth and ASSETHUB_API_KEY.\n --base-url <url> Defaults to ASSETHUB_API_BASE_URL, saved auth, or https://app.assethub.io.\n --profile <name> Saved auth profile name. Defaults to default.\n --config <path> Auth config path. Defaults to ~/.assethub/config.json.\n --help Show help.\n\nExamples:\n ASSETHUB_API_KEY=ah_live_xxx assethub models list\n assethub auth login --api-key-stdin\n assethub models list --ids-only\n assethub files upload ./input.png --media-type image\n assethub source create --file ./input.png --media-type image\n pbpaste | assethub source create --stdin-data-uri --media-type image\n assethub source create --clipboard --media-type image --file-name clipboard.png\n printf '{\"image_url\":{\"url\":\"data:image/png;base64,...\"}}' | assethub parts split --stdin-json --part-extractor \"V1.5\" --wait\n base64 -i ./input.png | assethub parts split --stdin-base64 --file-name input.png --content-type image/png --part-extractor \"V1.5\" --wait\n cat ./input.png | assethub parts split --stdin --file-name input.png --part-extractor \"V1.5\" --wait\n assethub image generate --prompt \"stylized prop concept\" --wait\n assethub mesh generate --file ./input.png --wait\n assethub animate presets --rig-type biped\n assethub rig create --source-resource-id mesh_x --rig-type biped --wait\n assethub animate retarget --resource-id rig_x --animation preset:idle --wait\n assethub production analyze --file ./input.png --part-extractor \"V1.5\" --wait\n assethub production run --order-id ord_x --mission-id ms_x --run-mode full_auto --max-cost-credits 200 --wait\n assethub production watch ord_x\n assethub production intervene ord_x --exclude 7 --rename 3=\"left wing\" --idempotency-key review-2026-07-29\n assethub production interventions ord_x\n assethub runs upload ./out/pluffy-run-2026-07-30 --dry-run\n assethub runs upload ./out/pluffy-run-2026-07-30 --tag pluffy --description \"V3 humanoid, 18 parts\"\n assethub parts split --file ./input.png --part-extractor \"V1.5\" --wait --all-ready\n assethub parts compare --file ./input.png --preprocess-prompt \"clean white background, centered product photo\" --part-extractor \"V1.5\" --wait --all-ready\n";
|
|
6
|
+
/**
|
|
7
|
+
* The `animate retarget` request, built from flags alone.
|
|
8
|
+
*
|
|
9
|
+
* Split out of the command — like `parseRunsUploadArgs` — so the parts worth
|
|
10
|
+
* testing (the required/at-most-five guards and the single-vs-plural field
|
|
11
|
+
* choice) need no client or network.
|
|
12
|
+
*/
|
|
13
|
+
export declare const buildAnimationRetargetRequest: (flags: Flags) => AnimationRetargetRequest;
|
|
14
|
+
/**
|
|
15
|
+
* Everything `rig create` sends apart from the source, which needs a client to
|
|
16
|
+
* resolve. Separated for the same reason as `buildAnimationRetargetRequest`:
|
|
17
|
+
* the flag validation is the part worth testing.
|
|
18
|
+
*/
|
|
19
|
+
export declare const buildRigCreateOptions: (flags: Flags) => Omit<RigRequest, "source">;
|
|
20
|
+
/**
|
|
21
|
+
* Builds an intervention batch from the raw argument slice.
|
|
22
|
+
*
|
|
23
|
+
* Raw argv rather than the parsed `Flags` record on purpose: that record is
|
|
24
|
+
* keyed by flag name, so it can report every `--exclude` but not whether one of
|
|
25
|
+
* them preceded an `--add-part`. The batch's order becomes the log's `seq`
|
|
26
|
+
* order, which is the order the operator made the decisions in, so it has to
|
|
27
|
+
* survive parsing.
|
|
28
|
+
*
|
|
29
|
+
* Repeated `--set-param` flags merge into ONE `params.set` op, emitted at the
|
|
30
|
+
* position of the first of them. Two parameters set in the same invocation are
|
|
31
|
+
* one decision; writing them as two log rows would make the log claim the
|
|
32
|
+
* operator changed their mind halfway through.
|
|
33
|
+
*
|
|
34
|
+
* Values are not validated against the contract's key set. The CLI carries no
|
|
35
|
+
* zod and must not carry a second copy of the contract either -- an unknown
|
|
36
|
+
* param key is the server's 400 to give, from the one place the contract is
|
|
37
|
+
* enforced. Only the shape this function itself has to parse is checked here.
|
|
38
|
+
*/
|
|
39
|
+
export declare const interventionOpsFromArgs: (args: readonly string[]) => Intervention[];
|
|
40
|
+
export type RunsUploadArgs = {
|
|
41
|
+
folderPath: string;
|
|
42
|
+
graphId: string | undefined;
|
|
43
|
+
streamId: string | undefined;
|
|
44
|
+
rev: number | undefined;
|
|
45
|
+
description: string;
|
|
46
|
+
tags: string[];
|
|
47
|
+
dryRun: boolean;
|
|
48
|
+
skipRegister: boolean;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Everything `runs upload` decides from argv, split out from the command so the
|
|
52
|
+
* subcommand routing and flag handling are testable without a filesystem, an
|
|
53
|
+
* API key, or a network.
|
|
54
|
+
*/
|
|
55
|
+
export declare const parseRunsUploadArgs: (subcommand: string | undefined, positionals: string[], flags: Flags) => RunsUploadArgs;
|
|
56
|
+
type RunUploadPlanLike = Pick<Awaited<ReturnType<typeof buildRunUploadPlan>>, 'graphId' | 'streamId' | 'rev' | 'graphHash' | 'counts' | 'sizes' | 'blobs' | 'warnings'>;
|
|
57
|
+
export declare const runsUploadSummary: (runFolder: string, plan: RunUploadPlanLike) => {
|
|
58
|
+
runFolder: string;
|
|
59
|
+
graphId: string;
|
|
60
|
+
streamId: string;
|
|
61
|
+
rev: number;
|
|
62
|
+
graphHash: string;
|
|
63
|
+
counts: {
|
|
64
|
+
nodes: number;
|
|
65
|
+
edges: number;
|
|
66
|
+
blobs: number;
|
|
67
|
+
blobBytes: number;
|
|
68
|
+
};
|
|
69
|
+
snapshotSize: string;
|
|
70
|
+
blobBytes: string;
|
|
71
|
+
};
|
|
72
|
+
export declare const runsUploadDryRunReport: (summary: ReturnType<typeof runsUploadSummary>, plan: RunUploadPlanLike, baseUrl: string) => {
|
|
73
|
+
warnings: string[];
|
|
74
|
+
blobs: {
|
|
75
|
+
blobKey: string;
|
|
76
|
+
name: string;
|
|
77
|
+
mime: string;
|
|
78
|
+
size: number;
|
|
79
|
+
}[];
|
|
80
|
+
wouldUpload: string;
|
|
81
|
+
runFolder: string;
|
|
82
|
+
graphId: string;
|
|
83
|
+
streamId: string;
|
|
84
|
+
rev: number;
|
|
85
|
+
graphHash: string;
|
|
86
|
+
counts: {
|
|
87
|
+
nodes: number;
|
|
88
|
+
edges: number;
|
|
89
|
+
blobs: number;
|
|
90
|
+
blobBytes: number;
|
|
91
|
+
};
|
|
92
|
+
snapshotSize: string;
|
|
93
|
+
blobBytes: string;
|
|
94
|
+
dryRun: boolean;
|
|
95
|
+
};
|
|
2
96
|
export {};
|
|
3
97
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAqBA,OAAO,EAEL,KAAK,wBAAwB,EAO7B,KAAK,YAAY,EAEjB,KAAK,UAAU,EAWhB,MAAM,sBAAsB,CAAA;AAa7B,OAAO,EAAC,kBAAkB,EAAc,MAAM,gCAAgC,CAAA;AAI9E,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,CAAA;AA0HxD,eAAO,MAAM,KAAK,80VAoGjB,CAAA;AAy0DD;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,GACxC,OAAO,KAAK,KACX,wBA0BF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,OAAO,KAAK,KACX,IAAI,CAAC,UAAU,EAAE,QAAQ,CAM1B,CAAA;AA6fF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,SAAS,MAAM,EAAE,KACtB,YAAY,EAuGd,CAAA;AA8oCD,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,MAAM,EAAE,OAAO,CAAA;IACf,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,YAAY,MAAM,GAAG,SAAS,EAC9B,aAAa,MAAM,EAAE,EACrB,OAAO,KAAK,KACX,cAoBF,CAAA;AAED,KAAK,iBAAiB,GAAG,IAAI,CAC3B,OAAO,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,EAC5C,SAAS,GACT,UAAU,GACV,KAAK,GACL,WAAW,GACX,QAAQ,GACR,OAAO,GACP,OAAO,GACP,UAAU,CACb,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,WAAW,MAAM,EACjB,MAAM,iBAAiB;;;;;;;;;;;;;;CAUvB,CAAA;AAEF,eAAO,MAAM,sBAAsB,GACjC,SAAS,UAAU,CAAC,OAAO,iBAAiB,CAAC,EAC7C,MAAM,iBAAiB,EACvB,SAAS,MAAM;;;;;;;;;;;;;;;;;;;;;;;CAYf,CAAA"}
|