@assethub/cli 0.1.5 → 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.
Files changed (50) hide show
  1. package/README.md +349 -5
  2. package/dist/autopilot.d.ts +13 -0
  3. package/dist/autopilot.d.ts.map +1 -0
  4. package/dist/autopilot.js +158 -0
  5. package/dist/canvas.d.ts +27 -0
  6. package/dist/canvas.d.ts.map +1 -0
  7. package/dist/canvas.js +82 -0
  8. package/dist/canvasAssetImport.d.ts +45 -0
  9. package/dist/canvasAssetImport.d.ts.map +1 -0
  10. package/dist/canvasAssetImport.js +154 -0
  11. package/dist/canvasComparison.d.ts +21 -0
  12. package/dist/canvasComparison.d.ts.map +1 -0
  13. package/dist/canvasComparison.js +58 -0
  14. package/dist/execution.d.ts +175 -0
  15. package/dist/execution.d.ts.map +1 -0
  16. package/dist/execution.js +234 -0
  17. package/dist/index.d.ts +94 -0
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1641 -192
  20. package/dist/projectSources.d.ts +65 -0
  21. package/dist/projectSources.d.ts.map +1 -0
  22. package/dist/projectSources.js +369 -0
  23. package/dist/projectSourcesWorkbook.d.ts +3 -0
  24. package/dist/projectSourcesWorkbook.d.ts.map +1 -0
  25. package/dist/projectSourcesWorkbook.js +143 -0
  26. package/dist/runsUpload/artifactGraphModel.d.ts +48 -0
  27. package/dist/runsUpload/artifactGraphModel.d.ts.map +1 -0
  28. package/dist/runsUpload/artifactGraphModel.js +127 -0
  29. package/dist/runsUpload/blobRefs.d.ts +13 -0
  30. package/dist/runsUpload/blobRefs.d.ts.map +1 -0
  31. package/dist/runsUpload/blobRefs.js +73 -0
  32. package/dist/runsUpload/buildRunUpload.d.ts +63 -0
  33. package/dist/runsUpload/buildRunUpload.d.ts.map +1 -0
  34. package/dist/runsUpload/buildRunUpload.js +428 -0
  35. package/dist/runsUpload/canonicalJson.d.ts +5 -0
  36. package/dist/runsUpload/canonicalJson.d.ts.map +1 -0
  37. package/dist/runsUpload/canonicalJson.js +108 -0
  38. package/dist/runsUpload/controlEndpoints.d.ts +63 -0
  39. package/dist/runsUpload/controlEndpoints.d.ts.map +1 -0
  40. package/dist/runsUpload/controlEndpoints.js +64 -0
  41. package/dist/runsUpload/graphFolder.d.ts +25 -0
  42. package/dist/runsUpload/graphFolder.d.ts.map +1 -0
  43. package/dist/runsUpload/graphFolder.js +147 -0
  44. package/dist/runsUpload/runUploadError.d.ts +23 -0
  45. package/dist/runsUpload/runUploadError.d.ts.map +1 -0
  46. package/dist/runsUpload/runUploadError.js +24 -0
  47. package/dist/runsUpload/uploadRun.d.ts +43 -0
  48. package/dist/runsUpload/uploadRun.d.ts.map +1 -0
  49. package/dist/runsUpload/uploadRun.js +217 -0
  50. package/package.json +11 -8
@@ -0,0 +1,45 @@
1
+ import type { Source } from '@assethub/api-client';
2
+ type DurableSource = Extract<Source, {
3
+ uploadId: string;
4
+ } | {
5
+ resourceId: string;
6
+ }>;
7
+ type ImportedAsset = {
8
+ assetId: string;
9
+ mediaType: 'image';
10
+ canvasId: number;
11
+ };
12
+ type ImportClient = {
13
+ v2: {
14
+ uploadFile: (input: {
15
+ file: Blob;
16
+ fileName: string;
17
+ mediaType: 'image';
18
+ }) => Promise<{
19
+ uploadId?: string;
20
+ }>;
21
+ importCanvasAsset: (canvasId: number, input: {
22
+ source: DurableSource;
23
+ name?: string;
24
+ }) => Promise<ImportedAsset>;
25
+ };
26
+ };
27
+ type ImportOptions = {
28
+ client: ImportClient;
29
+ baseUrl: string;
30
+ ownerId: string;
31
+ canvasId: number;
32
+ stateDir: string;
33
+ filePath?: string;
34
+ contentType?: string;
35
+ source?: DurableSource;
36
+ name?: string;
37
+ };
38
+ /** Keep staging/import receipts separate from paid generation operation state. */
39
+ export declare function importCanvasAssetWithState(options: ImportOptions): Promise<ImportedAsset & {
40
+ statePath: string;
41
+ sha256?: string;
42
+ uploadId?: string;
43
+ }>;
44
+ export {};
45
+ //# sourceMappingURL=canvas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AClF,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,aAAa,GACrB,OAAO,CACR,aAAa,GAAG;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAC,CACxE,CAwJA"}
@@ -0,0 +1,154 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { mkdir, open, readFile, unlink } from 'node:fs/promises';
3
+ import { basename, dirname, extname, join, resolve } from 'node:path';
4
+ import { readState, writeState } from './canvas.js';
5
+ const imageContentTypes = {
6
+ '.png': 'image/png',
7
+ '.jpg': 'image/jpeg',
8
+ '.jpeg': 'image/jpeg',
9
+ '.webp': 'image/webp',
10
+ '.gif': 'image/gif',
11
+ '.avif': 'image/avif',
12
+ '.bmp': 'image/bmp',
13
+ '.tif': 'image/tiff',
14
+ '.tiff': 'image/tiff',
15
+ };
16
+ /** Keep staging/import receipts separate from paid generation operation state. */
17
+ export async function importCanvasAssetWithState(options) {
18
+ if (!Number.isSafeInteger(options.canvasId) ||
19
+ options.canvasId <= 0 ||
20
+ !options.ownerId)
21
+ throw new Error('An owned canvas is required for image import');
22
+ if (Boolean(options.filePath) === Boolean(options.source))
23
+ throw new Error('Provide exactly one file, upload ID, or resource ID');
24
+ const name = options.name?.trim();
25
+ if (name !== undefined && (!name || name.length > 200))
26
+ throw new Error('Import name must be between 1 and 200 characters');
27
+ const bytes = options.filePath
28
+ ? await readFile(resolve(options.filePath))
29
+ : undefined;
30
+ const sha256 = bytes
31
+ ? createHash('sha256').update(bytes).digest('hex')
32
+ : undefined;
33
+ const sourceIdentity = sha256
34
+ ? `sha256:${sha256}`
35
+ : options.source?.uploadId
36
+ ? `upload:${options.source.uploadId}`
37
+ : options.source?.resourceId
38
+ ? `resource:${options.source.resourceId}`
39
+ : undefined;
40
+ if (!sourceIdentity)
41
+ throw new Error('Import source ID is required');
42
+ const scope = {
43
+ baseUrl: options.baseUrl.replace(/\/+$/, ''),
44
+ ownerId: options.ownerId,
45
+ canvasId: options.canvasId,
46
+ sourceIdentity,
47
+ };
48
+ const key = createHash('sha256').update(JSON.stringify(scope)).digest('hex');
49
+ const statePath = join(options.stateDir, 'canvas-imports', `${key}.json`);
50
+ const readReceipt = async () => {
51
+ const value = await readState(statePath);
52
+ if (value === undefined)
53
+ return undefined;
54
+ if (!value ||
55
+ typeof value !== 'object' ||
56
+ !('schemaVersion' in value) ||
57
+ value.schemaVersion !== 'assethub.canvas-import.v1' ||
58
+ !('baseUrl' in value) ||
59
+ value.baseUrl !== scope.baseUrl ||
60
+ !('ownerId' in value) ||
61
+ value.ownerId !== scope.ownerId ||
62
+ !('canvasId' in value) ||
63
+ value.canvasId !== scope.canvasId ||
64
+ !('sourceIdentity' in value) ||
65
+ value.sourceIdentity !== sourceIdentity)
66
+ throw new Error(`Invalid or differently scoped import receipt: ${statePath}`);
67
+ const saved = value;
68
+ if ((saved.uploadId !== undefined &&
69
+ (typeof saved.uploadId !== 'string' || !saved.uploadId)) ||
70
+ (saved.resourceId !== undefined &&
71
+ (typeof saved.resourceId !== 'string' || !saved.resourceId)) ||
72
+ (sha256 !== undefined && saved.sha256 !== sha256))
73
+ throw new Error(`Invalid import source in receipt: ${statePath}`);
74
+ if (name !== undefined && saved.name !== name)
75
+ throw new Error(`This source has an import receipt with a different name. Reuse its original name: ${statePath}`);
76
+ return saved;
77
+ };
78
+ let saved = await readReceipt();
79
+ if (!saved?.uploadId && !saved?.resourceId) {
80
+ await mkdir(dirname(statePath), { recursive: true, mode: 0o700 });
81
+ const lockPath = `${statePath}.upload-lock`;
82
+ const lock = await open(lockPath, 'wx', 0o600).catch(error => {
83
+ if (error &&
84
+ typeof error === 'object' &&
85
+ 'code' in error &&
86
+ error.code === 'EEXIST')
87
+ throw new Error(`An upload for this source is already in progress. Retry the same command after it finishes. If its process was terminated, verify the PID in ${lockPath} is stopped before removing that lock.`);
88
+ throw error;
89
+ });
90
+ try {
91
+ await lock.writeFile(JSON.stringify({ pid: process.pid }));
92
+ // Another process may have completed its upload between our initial read and lock acquisition.
93
+ saved = await readReceipt();
94
+ if (!saved?.uploadId && !saved?.resourceId) {
95
+ saved ??= {
96
+ schemaVersion: 'assethub.canvas-import.v1',
97
+ ...scope,
98
+ ...(sha256 ? { sha256 } : {}),
99
+ ...(name === undefined ? {} : { name }),
100
+ };
101
+ await writeState(statePath, saved);
102
+ if (bytes && options.filePath) {
103
+ const uploaded = await options.client.v2.uploadFile({
104
+ file: new Blob([bytes], {
105
+ type: options.contentType ??
106
+ imageContentTypes[extname(options.filePath).toLowerCase()] ??
107
+ 'application/octet-stream',
108
+ }),
109
+ fileName: basename(options.filePath),
110
+ mediaType: 'image',
111
+ });
112
+ if (!uploaded.uploadId)
113
+ throw new Error('Server did not return a durable upload ID');
114
+ saved.uploadId = uploaded.uploadId;
115
+ }
116
+ else if (options.source?.uploadId)
117
+ saved.uploadId = options.source.uploadId;
118
+ else if (options.source?.resourceId)
119
+ saved.resourceId = options.source.resourceId;
120
+ // Never call durable import before its upload identity has been persisted.
121
+ await writeState(statePath, saved);
122
+ }
123
+ }
124
+ finally {
125
+ await lock.close();
126
+ await unlink(lockPath);
127
+ }
128
+ }
129
+ const source = saved?.uploadId
130
+ ? { uploadId: saved.uploadId }
131
+ : saved?.resourceId
132
+ ? { resourceId: saved.resourceId }
133
+ : (() => {
134
+ throw new Error('Import receipt has no durable source');
135
+ })();
136
+ // Revalidate on the server even after a successful cached result. Promotion
137
+ // recognizes this same upload after staging cleanup and never creates a new asset.
138
+ const result = await options.client.v2.importCanvasAsset(options.canvasId, {
139
+ source,
140
+ name: saved.name,
141
+ });
142
+ if (result.canvasId !== options.canvasId ||
143
+ result.mediaType !== 'image' ||
144
+ !result.assetId ||
145
+ (saved.result && saved.result.assetId !== result.assetId))
146
+ throw new Error(`Server returned an inconsistent imported asset; inspect ${statePath}`);
147
+ await writeState(statePath, { ...saved, result });
148
+ return {
149
+ ...result,
150
+ statePath,
151
+ ...(sha256 ? { sha256 } : {}),
152
+ ...(saved.uploadId ? { uploadId: saved.uploadId } : {}),
153
+ };
154
+ }
@@ -0,0 +1,21 @@
1
+ import type { AssetHubClient } from '@assethub/api-client';
2
+ /** A portable review artifact; downloading uses signed URLs, never the API key. */
3
+ export declare function writeCanvasComparison(input: {
4
+ client: AssetHubClient;
5
+ canvasId: number;
6
+ sourceId: string;
7
+ assetId: string;
8
+ out: string;
9
+ title?: string;
10
+ }): Promise<{
11
+ canvasId: number;
12
+ canvasUrl: string;
13
+ reviewStatus: string;
14
+ images: {
15
+ assetId: string;
16
+ sha256: string;
17
+ }[];
18
+ path: string;
19
+ provenancePath: string;
20
+ }>;
21
+ //# sourceMappingURL=canvasComparison.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canvasComparison.d.ts","sourceRoot":"","sources":["../src/canvasComparison.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAA;AAWxD,mFAAmF;AACnF,wBAAsB,qBAAqB,CAAC,KAAK,EAAE;IACjD,MAAM,EAAE,cAAc,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;;;;;;;;;;GAuDA"}
@@ -0,0 +1,58 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { mkdir, writeFile } from 'node:fs/promises';
3
+ import { dirname, resolve } from 'node:path';
4
+ const escapeHtml = (value) => value.replace(/[&<>"']/g, character => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[character]);
5
+ /** A portable review artifact; downloading uses signed URLs, never the API key. */
6
+ export async function writeCanvasComparison(input) {
7
+ const canvas = await input.client.v2.getCanvas(input.canvasId);
8
+ const images = await Promise.all([input.sourceId, input.assetId].map(async (assetId) => {
9
+ const { url } = await input.client.v2.getAsset(assetId);
10
+ const response = await fetch(url, { signal: AbortSignal.timeout(60_000) });
11
+ if (!response.ok)
12
+ throw new Error(`Asset download failed: ${assetId} HTTP ${response.status}`);
13
+ const mime = response.headers.get('content-type')?.split(';')[0];
14
+ if (!mime ||
15
+ !['image/png', 'image/jpeg', 'image/webp', 'image/gif'].includes(mime))
16
+ throw new Error(`Comparison requires a raster image: ${assetId}`);
17
+ const reader = response.body?.getReader();
18
+ if (!reader)
19
+ throw new Error(`Empty asset response: ${assetId}`);
20
+ const chunks = [];
21
+ let size = 0;
22
+ try {
23
+ for (;;) {
24
+ const { done, value } = await reader.read();
25
+ if (done)
26
+ break;
27
+ size += value.byteLength;
28
+ if (size > 32 * 1024 * 1024)
29
+ throw new Error('Comparison image exceeds 32 MiB');
30
+ chunks.push(value);
31
+ }
32
+ }
33
+ finally {
34
+ await reader.cancel();
35
+ }
36
+ const bytes = Buffer.concat(chunks);
37
+ return {
38
+ assetId,
39
+ sha256: createHash('sha256').update(bytes).digest('hex'),
40
+ dataUrl: `data:${mime};base64,${bytes.toString('base64')}`,
41
+ };
42
+ }));
43
+ const title = input.title ?? 'Storyboard / generated image';
44
+ const provenance = {
45
+ canvasId: canvas.id,
46
+ canvasUrl: canvas.url,
47
+ reviewStatus: 'awaiting_creator_review',
48
+ images: images.map(({ dataUrl: _, ...image }) => image),
49
+ };
50
+ const html = `<!doctype html><html lang="ja"><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>${escapeHtml(title)}</title><style>body{margin:24px;background:#17191d;color:#fff;font:16px system-ui}main{display:grid;grid-template-columns:1fr 1fr;gap:20px}figure{margin:0}img{width:100%;height:70vh;object-fit:contain;background:#252830}figcaption{padding:12px 0}a{color:#a9cbff}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px}@media(max-width:700px){main{grid-template-columns:1fr}img{height:auto}}</style><h1>${escapeHtml(title)}</h1><p>Creator review pending · <a href="${escapeHtml(canvas.url)}">AssetHub canvas ${canvas.id}</a></p><main>${images.map((image, index) => `<figure><img alt="${index === 0 ? '元のVコンテ' : 'AI生成画像'}" src="${image.dataUrl}"><figcaption>${index === 0 ? '元のVコンテ' : 'AI生成画像'} · ${escapeHtml(image.assetId)}</figcaption></figure>`).join('')}</main><details><summary>Source provenance</summary><pre>${escapeHtml(JSON.stringify(provenance, null, 2))}</pre></details></html>`;
51
+ const path = resolve(input.out);
52
+ await mkdir(dirname(path), { recursive: true });
53
+ await writeFile(path, html, { mode: 0o600 });
54
+ await writeFile(`${path}.json`, `${JSON.stringify(provenance, null, 2)}\n`, {
55
+ mode: 0o600,
56
+ });
57
+ return { path, provenancePath: `${path}.json`, ...provenance };
58
+ }
@@ -0,0 +1,175 @@
1
+ import { type AssetHubClient, type CanvasExecution, type ExecutionContext, type ImageGenerationRequest, type MeshGenerationRequest, type ProductionAnalyzeRequest, type ProductionExecuteRequest, type ProductionAutomationRequest } from '@assethub/api-client';
2
+ declare const operations: readonly ["image.generate", "mesh.generate", "production.analyze", "production.execute", "production.automation"];
3
+ type Operation = (typeof operations)[number];
4
+ type SessionOptions = {
5
+ client: AssetHubClient;
6
+ stateDir: string;
7
+ cwd: string;
8
+ canvasId?: number;
9
+ operation?: Operation;
10
+ create?: boolean;
11
+ };
12
+ export declare const openExecutionSession: (options: SessionOptions) => Promise<{
13
+ canvas: import("@assethub/api-client").Canvas;
14
+ capabilities: import("@assethub/api-client").ApiCapabilities;
15
+ baseUrl: string;
16
+ ownerId: string;
17
+ client: AssetHubClient;
18
+ stateDir: string;
19
+ cwd: string;
20
+ canvasId?: number;
21
+ operation?: Operation;
22
+ create?: boolean;
23
+ }>;
24
+ type Session = Awaited<ReturnType<typeof openExecutionSession>>;
25
+ type RequestBody = ImageGenerationRequest | MeshGenerationRequest | ProductionAnalyzeRequest | ProductionExecuteRequest | ProductionAutomationRequest;
26
+ export declare const hasRecordedOperation: (stateDir: string, operationId: string) => Promise<boolean>;
27
+ type SubmitOptions = {
28
+ operationId?: string;
29
+ retryDelayMs?: number;
30
+ agent?: ExecutionContext['agent'];
31
+ parentRunId?: string;
32
+ source?: ExecutionContext['source'];
33
+ graphSource?: ExecutionContext['graphSource'];
34
+ };
35
+ export declare class CliExecutionError extends Error {
36
+ readonly exitCode: number;
37
+ readonly operationId?: string | undefined;
38
+ readonly execution?: CanvasExecution | undefined;
39
+ readonly runId: string | undefined;
40
+ constructor(message: string, exitCode?: number, operationId?: string | undefined, execution?: CanvasExecution | undefined, runId?: string | undefined);
41
+ }
42
+ /** Kept only for SIGINT reporting; interrupting the client never cancels server work. */
43
+ export declare const activeExecution: {
44
+ operationId?: string;
45
+ runId?: string;
46
+ execution?: CanvasExecution;
47
+ };
48
+ export declare const executeRecorded: (session: Session, operation: Operation, body: RequestBody, options?: SubmitOptions) => Promise<{
49
+ execution: CanvasExecution;
50
+ } | {
51
+ execution: CanvasExecution;
52
+ jobId: string;
53
+ imageGenId: string;
54
+ status: "queued";
55
+ modelId: string;
56
+ batchSize: number;
57
+ referenceImageCount: number;
58
+ aspectRatio?: string;
59
+ resolution?: number;
60
+ strength?: number;
61
+ } | {
62
+ execution: CanvasExecution;
63
+ jobId: string;
64
+ meshGenId: string;
65
+ status: "queued";
66
+ modelId: string;
67
+ inputMode: "image" | "multiview";
68
+ imageCount: number;
69
+ } | {
70
+ execution: CanvasExecution;
71
+ engine?: "artifact-graph";
72
+ graphId?: string;
73
+ orderId: string;
74
+ runId: string;
75
+ publicAccessToken: string;
76
+ agentVersion: string;
77
+ status: "analyzing" | "in_progress";
78
+ credits?: import("@assethub/api-client").CreditInfo;
79
+ } | {
80
+ execution: CanvasExecution;
81
+ orderId: string;
82
+ missionId: string;
83
+ runId: string;
84
+ publicAccessToken: string;
85
+ status: "executing";
86
+ agentVersion?: string | null;
87
+ tag?: string;
88
+ partExtractionMode?: import("@assethub/api-client").ProductionPartExtractionMode | null;
89
+ effectiveOptions: import("@assethub/api-client").ProductionEffectiveOptions;
90
+ confirmedParts?: string[];
91
+ credits?: import("@assethub/api-client").CreditInfo;
92
+ } | {
93
+ execution: CanvasExecution;
94
+ batchId: string;
95
+ agentVersion: string;
96
+ estimatedCostCredits: number;
97
+ images: Array<{
98
+ imageIndex: number;
99
+ orderId: string;
100
+ projectId: number;
101
+ url: string;
102
+ runId: string;
103
+ publicAccessToken: string;
104
+ }>;
105
+ }>;
106
+ export declare const resumeRecorded: (options: Omit<SessionOptions, "canvasId" | "operation"> & {
107
+ operationId: string;
108
+ retryDelayMs?: number;
109
+ expectedCanvasId?: number;
110
+ expectedBody?: Record<string, unknown>;
111
+ }) => Promise<{
112
+ execution: CanvasExecution;
113
+ } | {
114
+ execution: CanvasExecution;
115
+ jobId: string;
116
+ imageGenId: string;
117
+ status: "queued";
118
+ modelId: string;
119
+ batchSize: number;
120
+ referenceImageCount: number;
121
+ aspectRatio?: string;
122
+ resolution?: number;
123
+ strength?: number;
124
+ } | {
125
+ execution: CanvasExecution;
126
+ jobId: string;
127
+ meshGenId: string;
128
+ status: "queued";
129
+ modelId: string;
130
+ inputMode: "image" | "multiview";
131
+ imageCount: number;
132
+ } | {
133
+ execution: CanvasExecution;
134
+ engine?: "artifact-graph";
135
+ graphId?: string;
136
+ orderId: string;
137
+ runId: string;
138
+ publicAccessToken: string;
139
+ agentVersion: string;
140
+ status: "analyzing" | "in_progress";
141
+ credits?: import("@assethub/api-client").CreditInfo;
142
+ } | {
143
+ execution: CanvasExecution;
144
+ orderId: string;
145
+ missionId: string;
146
+ runId: string;
147
+ publicAccessToken: string;
148
+ status: "executing";
149
+ agentVersion?: string | null;
150
+ tag?: string;
151
+ partExtractionMode?: import("@assethub/api-client").ProductionPartExtractionMode | null;
152
+ effectiveOptions: import("@assethub/api-client").ProductionEffectiveOptions;
153
+ confirmedParts?: string[];
154
+ credits?: import("@assethub/api-client").CreditInfo;
155
+ } | {
156
+ execution: CanvasExecution;
157
+ batchId: string;
158
+ agentVersion: string;
159
+ estimatedCostCredits: number;
160
+ images: Array<{
161
+ imageIndex: number;
162
+ orderId: string;
163
+ projectId: number;
164
+ url: string;
165
+ runId: string;
166
+ publicAccessToken: string;
167
+ }>;
168
+ }>;
169
+ export declare const waitForExecution: (client: AssetHubClient, runId: string, options?: {
170
+ timeoutMs?: number;
171
+ intervalMs?: number;
172
+ onProgress?: (execution: CanvasExecution) => void;
173
+ }) => Promise<CanvasExecution>;
174
+ export {};
175
+ //# sourceMappingURL=execution.d.ts.map
@@ -0,0 +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,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EACjC,MAAM,sBAAsB,CAAA;AAG7B,QAAA,MAAM,UAAU,mHAMN,CAAA;AACV,KAAK,SAAS,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAA;AAC5C,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,cAAc,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AACD,eAAO,MAAM,oBAAoB,GAAU,SAAS,cAAc;;;;;YAPxD,cAAc;cACZ,MAAM;SACX,MAAM;eACA,MAAM;gBACL,SAAS;aACZ,OAAO;EAoBjB,CAAA;AACD,KAAK,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAA;AAC/D,KAAK,WAAW,GACZ,sBAAsB,GACtB,qBAAqB,GACrB,wBAAwB,GACxB,wBAAwB,GACxB,2BAA2B,CAAA;AAU/B,eAAO,MAAM,oBAAoB,GAC/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