@assethub/cli 0.1.14 → 0.1.15
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 +18 -4
- package/dist/execution.d.ts +3 -3
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +5 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +154 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ with `--graph`. Mesh IDs returned by search can be passed to `composer run`.
|
|
|
57
57
|
|
|
58
58
|
## Agent generation with canvas history
|
|
59
59
|
|
|
60
|
-
Canvas execution is available to
|
|
60
|
+
Canvas execution is available to authenticated users with access to the selected workspace. Run `assethub capabilities`
|
|
61
61
|
first. Image, mesh, parts split, and production analyze/execute/automation refuse to dispatch if canvas history is unavailable.
|
|
62
62
|
The current public API remains compatible with clients that omit `executionContext`.
|
|
63
63
|
|
|
@@ -441,6 +441,9 @@ assethub canvas use <canvas-id>
|
|
|
441
441
|
assethub composer models
|
|
442
442
|
assethub composer run --part <mesh-id> --part <mesh-id> --reference <image-id> --wait
|
|
443
443
|
assethub composer run --from-run <run-id> --transforms-json @transforms.json --wait
|
|
444
|
+
assethub composer refine --list-modes
|
|
445
|
+
assethub composer refine --from-run <run-id> --instruction "align the feet" \
|
|
446
|
+
--mode placement --max-rounds 2 --wait --download --out-dir ./refined
|
|
444
447
|
```
|
|
445
448
|
|
|
446
449
|
Selection reuses a valid API key for that workspace or creates one when permitted.
|
|
@@ -451,6 +454,16 @@ expired proof by logging in again. Explicit `--profile` uses its saved proof and
|
|
|
451
454
|
ignores environment credentials; an explicit `--api-key` can supply the workspace
|
|
452
455
|
key. Generation uses normal workspace credits.
|
|
453
456
|
|
|
457
|
+
`composer refine --from-run` accepts a `mesh.compose` or prior `mesh.refine` run
|
|
458
|
+
and uses that receipt's final `composition.transforms` and any replacement
|
|
459
|
+
`composition.parts` on the same canvas, preserving `parentRunId` lineage. If the
|
|
460
|
+
receipt has no actual transforms, provide `--transforms-json`; the CLI refuses to
|
|
461
|
+
silently restart from the original requested input. New requests can use
|
|
462
|
+
`--input-json` or `--part`/`--reference` with `--transforms-json`. Mode availability
|
|
463
|
+
and each mode's `--max-rounds` policy come from `composer refine --list-modes`.
|
|
464
|
+
Incomplete native results remain `needs_review` and return exit code 3, so inspect
|
|
465
|
+
the execution and its new geometry asset IDs before continuing.
|
|
466
|
+
|
|
454
467
|
Existing Production outputs can be inspected and downloaded without regenerating:
|
|
455
468
|
|
|
456
469
|
```sh
|
|
@@ -459,9 +472,10 @@ assethub graph export --canvas <canvas-id> --out ./graph.json
|
|
|
459
472
|
assethub graph lineage --canvas <canvas-id> --artifact <asset-id> --direction ancestors
|
|
460
473
|
```
|
|
461
474
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
475
|
+
Graph commands with `--canvas` cover recorded CLI/API executions and evaluations.
|
|
476
|
+
A canvas with only older UI activity can return an empty graph. Use `graph list`
|
|
477
|
+
and `graph show --graph <id>` for historical graphs, or `mesh list` to search
|
|
478
|
+
the workspace mesh library.
|
|
465
479
|
|
|
466
480
|
## Inspect available MCP operations
|
|
467
481
|
|
package/dist/execution.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type AssetHubClient, type CanvasExecution, type ExecutionContext, type ImageGenerationRequest, type MeshGenerationRequest, type MeshComposeRequest, type ProductionAnalyzeRequest, type ProductionExecuteRequest, type ProductionAutomationRequest } from '@assethub/api-client';
|
|
2
|
-
declare const operations: readonly ["image.generate", "mesh.generate", "mesh.compose", "production.analyze", "production.execute", "production.automation"];
|
|
1
|
+
import { type AssetHubClient, type CanvasExecution, type ExecutionContext, type ImageGenerationRequest, type MeshGenerationRequest, type MeshComposeRequest, type MeshRefineRequest, type ProductionAnalyzeRequest, type ProductionExecuteRequest, type ProductionAutomationRequest } from '@assethub/api-client';
|
|
2
|
+
declare const operations: readonly ["image.generate", "mesh.generate", "mesh.compose", "mesh.refine", "production.analyze", "production.execute", "production.automation"];
|
|
3
3
|
type Operation = (typeof operations)[number];
|
|
4
4
|
type SessionOptions = {
|
|
5
5
|
client: AssetHubClient;
|
|
@@ -22,7 +22,7 @@ export declare const openExecutionSession: (options: SessionOptions) => Promise<
|
|
|
22
22
|
create?: boolean;
|
|
23
23
|
}>;
|
|
24
24
|
type Session = Awaited<ReturnType<typeof openExecutionSession>>;
|
|
25
|
-
type RequestBody = ImageGenerationRequest | MeshGenerationRequest | Omit<MeshComposeRequest, 'executionContext'> | ProductionAnalyzeRequest | ProductionExecuteRequest | ProductionAutomationRequest;
|
|
25
|
+
type RequestBody = ImageGenerationRequest | MeshGenerationRequest | Omit<MeshComposeRequest, 'executionContext'> | Omit<MeshRefineRequest, 'executionContext'> | ProductionAnalyzeRequest | ProductionExecuteRequest | ProductionAutomationRequest;
|
|
26
26
|
export declare const hasRecordedOperation: (stateDir: string, operationId: string) => Promise<boolean>;
|
|
27
27
|
type SubmitOptions = {
|
|
28
28
|
operationId?: string;
|
package/dist/execution.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../src/execution.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EACjC,MAAM,sBAAsB,CAAA;AAG7B,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../src/execution.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,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U,CAAC,EAAE,CAAC,SAAS,EAAE,eAAe,KAAK,IAAI,CAAA;CAC7C,KACL,OAAO,CAAC,eAAe,CA2CzB,CAAA"}
|
package/dist/execution.js
CHANGED
|
@@ -8,6 +8,7 @@ const operations = [
|
|
|
8
8
|
'image.generate',
|
|
9
9
|
'mesh.generate',
|
|
10
10
|
'mesh.compose',
|
|
11
|
+
'mesh.refine',
|
|
11
12
|
'production.analyze',
|
|
12
13
|
'production.execute',
|
|
13
14
|
'production.automation',
|
|
@@ -83,7 +84,8 @@ const submitSaved = async (session, saved, retryDelayMs = 250) => {
|
|
|
83
84
|
activeExecution.execution = execution;
|
|
84
85
|
// An unacknowledged Composer receipt can precede a failed Trigger POST.
|
|
85
86
|
// Resume repeats its saved body/key; the server uses the same native key.
|
|
86
|
-
if (!(saved.operation === 'mesh.compose'
|
|
87
|
+
if (!((saved.operation === 'mesh.compose' ||
|
|
88
|
+
saved.operation === 'mesh.refine') &&
|
|
87
89
|
execution.status === 'queued' &&
|
|
88
90
|
execution.history.status === 'pending'))
|
|
89
91
|
return { execution };
|
|
@@ -99,6 +101,8 @@ const submitSaved = async (session, saved, retryDelayMs = 250) => {
|
|
|
99
101
|
return session.client.v2.generateMesh(saved.body, options);
|
|
100
102
|
case 'mesh.compose':
|
|
101
103
|
return session.client.v2.composeMesh(saved.body, options);
|
|
104
|
+
case 'mesh.refine':
|
|
105
|
+
return session.client.v2.refineMesh(saved.body, options);
|
|
102
106
|
case 'production.analyze':
|
|
103
107
|
return session.client.v1.analyzeProduction(saved.body, options);
|
|
104
108
|
case 'production.execute':
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { type AnimationRetargetRequest, type Intervention, type RigRequest } from '@assethub/api-client';
|
|
3
3
|
import { buildRunUploadPlan } from './runsUpload/buildRunUpload.js';
|
|
4
4
|
type Flags = Record<string, string | boolean | string[]>;
|
|
5
|
-
export declare const usage = "AssetHub CLI\n\nCLI and MCP are available to all AssetHub users. Workspace permissions and feature availability apply.\n\nUsage:\n assethub --version\n assethub doctor [--mcp] [--profile <name>] [--timeout-ms <n>]\n assethub mcp tools [tool-name] [--account] [--profile <name>] [--timeout-ms <n>]\n assethub mcp config --client cursor|codex [--account] [--base-url <url>]\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 login --access-token-stdin [--base-url <url>] [--profile <name>]\n assethub auth status [--profile <name>]\n assethub auth logout [--profile <name>]\n assethub workspace list|get\n assethub workspace create --name <name> [--operation-id <uuid>]\n assethub workspace use <workspace-id>\n assethub workspace members [--workspace <id>]\n assethub workspace invite --email <email> [--role user|admin] [--resend] [--workspace <id>]\n assethub workspace set-role <user-id> --role user|admin [--workspace <id>]\n assethub workspace remove-member <user-id> [--workspace <id>]\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 composer models\n assethub composer run --part <mesh-asset-id> [--part <mesh-asset-id>...] --reference <image-asset-id> [--model <id>] [--mode quick|quality] [--transforms-json <json|@file>] [--canvas <id>] [--wait]\n assethub composer run --input-json <json|@file> [--canvas <id>] [--operation-id <uuid>] [--wait] [--download --out-dir <dir>]\n assethub composer run --from-run <run-id> [--transforms-json <json|@file>] [--mode quick|quality] [--wait]\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 list [--cursor <cursor>] [--limit <n>]\n assethub graph show|export [--canvas <id> | --graph <id>] [--source generated|upload] [--artifact <node-id>] [--out <path>] [--allow-truncated]\n assethub graph lineage --artifact <node-id> [--canvas <id> | --graph <id>] [--source generated|upload] [--direction ancestors|descendants|both] [--depth <n>] [--out <path>]\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 mesh list [--query <text>] [--cursor <cursor>] [--limit <n>]\n assethub mesh get <mesh-asset-id>\n assethub mesh download <mesh-asset-id> --out-dir <directory>\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> Override the selected API origin. Default: https://app.assethub.io.\n --profile <name> Select this saved profile ahead of environment credentials and origin.\n --config <path> Auth config path. Defaults to ~/.assethub/config.json.\n --version Show installed package version.\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";
|
|
5
|
+
export declare const usage = "AssetHub CLI\n\nCLI and MCP are available to all AssetHub users. Workspace permissions and feature availability apply.\n\nUsage:\n assethub --version\n assethub doctor [--mcp] [--profile <name>] [--timeout-ms <n>]\n assethub mcp tools [tool-name] [--account] [--profile <name>] [--timeout-ms <n>]\n assethub mcp config --client cursor|codex [--account] [--base-url <url>]\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 login --access-token-stdin [--base-url <url>] [--profile <name>]\n assethub auth status [--profile <name>]\n assethub auth logout [--profile <name>]\n assethub workspace list|get\n assethub workspace create --name <name> [--operation-id <uuid>]\n assethub workspace use <workspace-id>\n assethub workspace members [--workspace <id>]\n assethub workspace invite --email <email> [--role user|admin] [--resend] [--workspace <id>]\n assethub workspace set-role <user-id> --role user|admin [--workspace <id>]\n assethub workspace remove-member <user-id> [--workspace <id>]\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 composer models\n assethub composer refine --list-modes\n assethub composer refine --from-run <run-id> --instruction <text> [--mode standard|thorough|placement|workshop|blender] [--max-rounds <n>] [--transforms-json <json|@file>] [--wait] [--download --out-dir <dir>]\n assethub composer refine --input-json <json|@file> [--canvas <id>] [--operation-id <uuid>] [--wait] [--download --out-dir <dir>]\n assethub composer run --part <mesh-asset-id> [--part <mesh-asset-id>...] --reference <image-asset-id> [--model <id>] [--mode quick|quality] [--transforms-json <json|@file>] [--canvas <id>] [--wait]\n assethub composer run --input-json <json|@file> [--canvas <id>] [--operation-id <uuid>] [--wait] [--download --out-dir <dir>]\n assethub composer run --from-run <run-id> [--transforms-json <json|@file>] [--mode quick|quality] [--wait]\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 list [--cursor <cursor>] [--limit <n>]\n assethub graph show|export [--canvas <id> | --graph <id>] [--source generated|upload] [--artifact <node-id>] [--out <path>] [--allow-truncated]\n assethub graph lineage --artifact <node-id> [--canvas <id> | --graph <id>] [--source generated|upload] [--direction ancestors|descendants|both] [--depth <n>] [--out <path>]\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 mesh list [--query <text>] [--cursor <cursor>] [--limit <n>]\n assethub mesh get <mesh-asset-id>\n assethub mesh download <mesh-asset-id> --out-dir <directory>\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> Override the selected API origin. Default: https://app.assethub.io.\n --profile <name> Select this saved profile ahead of environment credentials and origin.\n --config <path> Auth config path. Defaults to ~/.assethub/config.json.\n --version Show installed package version.\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
6
|
/**
|
|
7
7
|
* The `animate retarget` request, built from flags alone.
|
|
8
8
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAsBA,OAAO,EAIL,KAAK,wBAAwB,EAO7B,KAAK,YAAY,EAEjB,KAAK,UAAU,
|
|
1
|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T,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"}
|
package/dist/index.js
CHANGED
|
@@ -105,6 +105,9 @@ Usage:
|
|
|
105
105
|
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>]
|
|
106
106
|
assethub capabilities
|
|
107
107
|
assethub composer models
|
|
108
|
+
assethub composer refine --list-modes
|
|
109
|
+
assethub composer refine --from-run <run-id> --instruction <text> [--mode standard|thorough|placement|workshop|blender] [--max-rounds <n>] [--transforms-json <json|@file>] [--wait] [--download --out-dir <dir>]
|
|
110
|
+
assethub composer refine --input-json <json|@file> [--canvas <id>] [--operation-id <uuid>] [--wait] [--download --out-dir <dir>]
|
|
108
111
|
assethub composer run --part <mesh-asset-id> [--part <mesh-asset-id>...] --reference <image-asset-id> [--model <id>] [--mode quick|quality] [--transforms-json <json|@file>] [--canvas <id>] [--wait]
|
|
109
112
|
assethub composer run --input-json <json|@file> [--canvas <id>] [--operation-id <uuid>] [--wait] [--download --out-dir <dir>]
|
|
110
113
|
assethub composer run --from-run <run-id> [--transforms-json <json|@file>] [--mode quick|quality] [--wait]
|
|
@@ -1690,11 +1693,162 @@ const commandImage = async (subcommand, ctx) => {
|
|
|
1690
1693
|
input.sources = await Promise.all(input.sources.map(source => recordedSource(ctx, source)));
|
|
1691
1694
|
await printRecorded(ctx, await executeRecorded(session, 'image.generate', input, { ...executionOptions(ctx.flags), graphSource: graphInput?.graphSource }));
|
|
1692
1695
|
};
|
|
1696
|
+
const meshRefinementModes = [
|
|
1697
|
+
'standard',
|
|
1698
|
+
'thorough',
|
|
1699
|
+
'placement',
|
|
1700
|
+
'workshop',
|
|
1701
|
+
'blender',
|
|
1702
|
+
];
|
|
1703
|
+
const refinementTransforms = (value, flag) => {
|
|
1704
|
+
if (value == null || typeof value !== 'object' || Array.isArray(value))
|
|
1705
|
+
throw new Error(`${flag} must be an object keyed by part asset ID`);
|
|
1706
|
+
const result = {};
|
|
1707
|
+
for (const [assetId, transform] of Object.entries(value)) {
|
|
1708
|
+
if (!Array.isArray(transform) ||
|
|
1709
|
+
transform.length !== 10 ||
|
|
1710
|
+
transform.some(entry => typeof entry !== 'number' || !Number.isFinite(entry)))
|
|
1711
|
+
throw new Error(`${flag} must contain ten finite numbers for ${assetId}`);
|
|
1712
|
+
result[assetId] = transform;
|
|
1713
|
+
}
|
|
1714
|
+
if (Object.keys(result).length === 0)
|
|
1715
|
+
throw new Error(`${flag} must contain at least one part transform`);
|
|
1716
|
+
return result;
|
|
1717
|
+
};
|
|
1718
|
+
const refinementTransform = (value, flag) => {
|
|
1719
|
+
if (!Array.isArray(value) ||
|
|
1720
|
+
value.length !== 10 ||
|
|
1721
|
+
value.some(entry => typeof entry !== 'number' || !Number.isFinite(entry)))
|
|
1722
|
+
throw new Error(`${flag} must contain ten finite numbers`);
|
|
1723
|
+
return value;
|
|
1724
|
+
};
|
|
1725
|
+
const refinementModeInfo = (capabilities, mode) => {
|
|
1726
|
+
const info = capabilities.modes.find(item => item.id === mode);
|
|
1727
|
+
if (!info)
|
|
1728
|
+
throw new Error(`Unknown refinement mode: ${mode}`);
|
|
1729
|
+
if (!info.available)
|
|
1730
|
+
throw new Error(`Refinement mode ${mode} is unavailable${info.reason ? `: ${info.reason}` : ''}`);
|
|
1731
|
+
return info;
|
|
1732
|
+
};
|
|
1733
|
+
const commandComposerRefine = async (ctx) => {
|
|
1734
|
+
const capabilities = await ctx.client.v2.getMeshRefinementModes();
|
|
1735
|
+
if (hasFlag(ctx.flags, 'list-modes')) {
|
|
1736
|
+
print(capabilities);
|
|
1737
|
+
return;
|
|
1738
|
+
}
|
|
1739
|
+
const fromRun = getFlag(ctx.flags, 'from-run');
|
|
1740
|
+
const json = getFlag(ctx.flags, 'input-json');
|
|
1741
|
+
const parts = getFlagValues(ctx.flags, 'part');
|
|
1742
|
+
const reference = getFlag(ctx.flags, 'reference');
|
|
1743
|
+
if ((fromRun && (json || parts.length || reference)) ||
|
|
1744
|
+
(json && (parts.length || reference)))
|
|
1745
|
+
throw new Error('Choose --from-run, --input-json, or --part with --reference');
|
|
1746
|
+
const previous = fromRun ? await ctx.client.v2.getRun(fromRun) : undefined;
|
|
1747
|
+
if (previous &&
|
|
1748
|
+
previous.operation !== 'mesh.compose' &&
|
|
1749
|
+
previous.operation !== 'mesh.refine')
|
|
1750
|
+
throw new Error('--from-run must identify a mesh.compose or mesh.refine execution');
|
|
1751
|
+
if (previous && ['queued', 'running'].includes(previous.status))
|
|
1752
|
+
throw new Error('--from-run must identify a finished mesh.compose or mesh.refine checkpoint');
|
|
1753
|
+
const input = json
|
|
1754
|
+
? await readJsonArgument(json, '--input-json')
|
|
1755
|
+
: previous
|
|
1756
|
+
? {
|
|
1757
|
+
...(previous.requestedInput ?? previous.input),
|
|
1758
|
+
...(previous.operation === 'mesh.refine' &&
|
|
1759
|
+
(previous.requestedInput?.mode ?? previous.input.mode)
|
|
1760
|
+
? { mode: previous.requestedInput?.mode ?? previous.input.mode }
|
|
1761
|
+
: { mode: undefined }),
|
|
1762
|
+
parts: previous.composition?.parts ??
|
|
1763
|
+
previous.requestedInput?.parts ??
|
|
1764
|
+
previous.input.parts,
|
|
1765
|
+
transforms: previous.composition?.transforms,
|
|
1766
|
+
referenceTransform: previous.composition?.referenceTransform ??
|
|
1767
|
+
previous.requestedInput?.referenceTransform ??
|
|
1768
|
+
previous.input.referenceTransform,
|
|
1769
|
+
}
|
|
1770
|
+
: {
|
|
1771
|
+
parts: parts.map(assetId => ({
|
|
1772
|
+
assetId: assertFlagHasValue(assetId, '--part <asset-id>'),
|
|
1773
|
+
})),
|
|
1774
|
+
fullBodyImageAssetId: requireFlag(ctx.flags, 'reference'),
|
|
1775
|
+
};
|
|
1776
|
+
delete input.executionContext;
|
|
1777
|
+
if (!Array.isArray(input.parts) || input.parts.length === 0)
|
|
1778
|
+
throw new Error('Composer refinement requires parts[]');
|
|
1779
|
+
const refinementParts = input.parts.map((part, index) => {
|
|
1780
|
+
if (!part ||
|
|
1781
|
+
typeof part !== 'object' ||
|
|
1782
|
+
typeof part.assetId !== 'string' ||
|
|
1783
|
+
!part.assetId)
|
|
1784
|
+
throw new Error(`Composer refinement part ${index + 1} requires assetId`);
|
|
1785
|
+
return part;
|
|
1786
|
+
});
|
|
1787
|
+
if (typeof input.fullBodyImageAssetId !== 'string' ||
|
|
1788
|
+
input.fullBodyImageAssetId.length === 0)
|
|
1789
|
+
throw new Error('Composer refinement requires fullBodyImageAssetId');
|
|
1790
|
+
const instruction = getFlag(ctx.flags, 'instruction') ?? input.instruction;
|
|
1791
|
+
if (typeof instruction !== 'string' || !instruction.trim())
|
|
1792
|
+
throw new Error('Composer refinement requires --instruction');
|
|
1793
|
+
const mode = parseEnumFlag(ctx.flags, 'mode', meshRefinementModes) ??
|
|
1794
|
+
input.mode ??
|
|
1795
|
+
capabilities.defaultMode;
|
|
1796
|
+
if (!meshRefinementModes.includes(mode))
|
|
1797
|
+
throw new Error(`--mode must be one of: ${meshRefinementModes.join(', ')}`);
|
|
1798
|
+
const modeInfo = refinementModeInfo(capabilities, mode);
|
|
1799
|
+
const maxRoundsFlag = getFlag(ctx.flags, 'max-rounds');
|
|
1800
|
+
const inputMaxRounds = input.maxRounds;
|
|
1801
|
+
if (inputMaxRounds != null &&
|
|
1802
|
+
(typeof inputMaxRounds !== 'number' ||
|
|
1803
|
+
!Number.isInteger(inputMaxRounds) ||
|
|
1804
|
+
inputMaxRounds <= 0))
|
|
1805
|
+
throw new Error('maxRounds must be a positive integer');
|
|
1806
|
+
const maxRounds = maxRoundsFlag == null
|
|
1807
|
+
? inputMaxRounds
|
|
1808
|
+
: parsePositiveIntegerFlag(ctx.flags, 'max-rounds', 1);
|
|
1809
|
+
if (maxRounds != null && (!Number.isInteger(maxRounds) || maxRounds <= 0))
|
|
1810
|
+
throw new Error('--max-rounds must be a positive integer');
|
|
1811
|
+
if (maxRounds != null && maxRounds > modeInfo.maxRounds)
|
|
1812
|
+
throw new Error(`--max-rounds must be at most ${modeInfo.maxRounds} for ${mode}`);
|
|
1813
|
+
const transformsFlag = getFlag(ctx.flags, 'transforms-json');
|
|
1814
|
+
const transforms = transformsFlag
|
|
1815
|
+
? refinementTransforms(await readJsonArgument(transformsFlag, '--transforms-json'), '--transforms-json')
|
|
1816
|
+
: refinementTransforms(input.transforms, 'refinement transforms');
|
|
1817
|
+
const referenceTransform = input.referenceTransform == null
|
|
1818
|
+
? undefined
|
|
1819
|
+
: refinementTransform(input.referenceTransform, 'referenceTransform');
|
|
1820
|
+
const explicitCanvas = selectedCanvasId(ctx.flags);
|
|
1821
|
+
const canvasId = explicitCanvas ?? previous?.canvas.id;
|
|
1822
|
+
if (previous && canvasId !== previous.canvas.id)
|
|
1823
|
+
throw new Error('Refinement must use the original canvas to retain lineage');
|
|
1824
|
+
const session = await openExecutionSession({
|
|
1825
|
+
...stateOptions(ctx),
|
|
1826
|
+
canvasId,
|
|
1827
|
+
operation: 'mesh.refine',
|
|
1828
|
+
});
|
|
1829
|
+
const body = {
|
|
1830
|
+
parts: refinementParts,
|
|
1831
|
+
fullBodyImageAssetId: input.fullBodyImageAssetId,
|
|
1832
|
+
transforms,
|
|
1833
|
+
...(referenceTransform ? { referenceTransform } : {}),
|
|
1834
|
+
mode,
|
|
1835
|
+
instruction,
|
|
1836
|
+
...(maxRounds != null ? { maxRounds } : {}),
|
|
1837
|
+
};
|
|
1838
|
+
await printRecorded(ctx, await executeRecorded(session, 'mesh.refine', body, {
|
|
1839
|
+
...executionOptions(ctx.flags),
|
|
1840
|
+
...(previous ? { parentRunId: previous.runId } : {}),
|
|
1841
|
+
}));
|
|
1842
|
+
};
|
|
1693
1843
|
const commandComposer = async (subcommand, ctx) => {
|
|
1694
1844
|
if (subcommand === 'models') {
|
|
1695
1845
|
print(await ctx.client.v2.getMeshComposers());
|
|
1696
1846
|
return;
|
|
1697
1847
|
}
|
|
1848
|
+
if (subcommand === 'refine') {
|
|
1849
|
+
await commandComposerRefine(ctx);
|
|
1850
|
+
return;
|
|
1851
|
+
}
|
|
1698
1852
|
if (subcommand !== 'run')
|
|
1699
1853
|
throw new Error('Use composer models|run');
|
|
1700
1854
|
const fromRun = getFlag(ctx.flags, 'from-run');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assethub/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Command line interface for AssetHub.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@assethub/api-client": "^0.1.
|
|
33
|
+
"@assethub/api-client": "^0.1.8",
|
|
34
34
|
"@modelcontextprotocol/sdk": "^1.30.0"
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|