@beeintel/batch-image 0.0.0-stage → 1.0.1
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/FONT-LICENSE.txt +93 -0
- package/README.md +184 -3
- package/dist/assets/11st-D7qGO5e4.webp +0 -0
- package/dist/assets/UPNG-CPfdwFSy.js +2298 -0
- package/dist/assets/adjust-card-B63b81iV.webp +0 -0
- package/dist/assets/adjust-final.worker-C2JbTvv5.js +6945 -0
- package/dist/assets/amazon-CjTtpZTq.webp +0 -0
- package/dist/assets/ascii_art-B4UGbtGs.webp +0 -0
- package/dist/assets/auction-j26eVUQO.webp +0 -0
- package/dist/assets/background-DGdZUdkL.webp +0 -0
- package/dist/assets/background-card-wK7DRpvM.png +0 -0
- package/dist/assets/body-CUFdRg8w.webp +0 -0
- package/dist/assets/bounded-cutout.worker-BZR6mbaI.js +9615 -0
- package/dist/assets/brand-mark-card-cFUeDeO2.webp +0 -0
- package/dist/assets/buyma-dAxYNjow.webp +0 -0
- package/dist/assets/codec.worker-7W6hmsm6.js +7349 -0
- package/dist/assets/contour_lines-C_CqrgV1.webp +0 -0
- package/dist/assets/creema-B1tWyCPx.webp +0 -0
- package/dist/assets/crop-final.worker-Owin7TvX.js +7035 -0
- package/dist/assets/cutout-CzMvV5An.webp +0 -0
- package/dist/assets/cutout-card-CN4gNFBz.png +0 -0
- package/dist/assets/cutout.worker-DyH6Prbn.js +3894 -0
- package/dist/assets/depop-CkVC5Fn1.webp +0 -0
- package/dist/assets/dewrinkle-kFzP6LqD.webp +0 -0
- package/dist/assets/dither-CcxmO2e6.webp +0 -0
- package/dist/assets/douyin-CP_HwBDF.webp +0 -0
- package/dist/assets/download.worker-DnGSB6P_.js +17779 -0
- package/dist/assets/duotone-Cdg_3fQf.webp +0 -0
- package/dist/assets/ebay-CxLfrRAf.webp +0 -0
- package/dist/assets/edit-Cv-txfZm.webp +0 -0
- package/dist/assets/effect.worker-qu1eCcII.js +9227 -0
- package/dist/assets/engraving-BENh1O2O.webp +0 -0
- package/dist/assets/etsy-CSvz9GpY.webp +0 -0
- package/dist/assets/expand-C60VE9nK.webp +0 -0
- package/dist/assets/facebook-Ca2nJJiQ.webp +0 -0
- package/dist/assets/film_stock-Bqauwcq4.webp +0 -0
- package/dist/assets/final.worker-BnzJ3N5C.js +7035 -0
- package/dist/assets/final.worker-Csc1zoYS.js +7054 -0
- package/dist/assets/final.worker-DzBFT9xk.js +6922 -0
- package/dist/assets/final.worker-XpgKnlaz.js +7217 -0
- package/dist/assets/flatlay-CPiVmlAa.webp +0 -0
- package/dist/assets/flatlay-fold-B-CRYy87.webp +0 -0
- package/dist/assets/flatlay-open-Dzas8okC.webp +0 -0
- package/dist/assets/g-market-DXuYK_JH.webp +0 -0
- package/dist/assets/ghost-BCEAx_Zx.webp +0 -0
- package/dist/assets/ghost-front-WFgA4sUo.webp +0 -0
- package/dist/assets/ghost-three-quarter-Rt8cXj34.webp +0 -0
- package/dist/assets/gif-CObOIITx.js +303 -0
- package/dist/assets/glass_tiles-3IXP-Hmg.webp +0 -0
- package/dist/assets/glitch_art-D1i3qben.webp +0 -0
- package/dist/assets/glitch_blur-C4q_9zyq.webp +0 -0
- package/dist/assets/glow-Bv9EHBU5.webp +0 -0
- package/dist/assets/gradient_map-BR-UVYMP.webp +0 -0
- package/dist/assets/halftone-CWdKu2_6.webp +0 -0
- package/dist/assets/holo_sticker-BQDikLg2.webp +0 -0
- package/dist/assets/idus-7diqRNPs.webp +0 -0
- package/dist/assets/imagetracer.worker-CgunQTPG.js +7096 -0
- package/dist/assets/instagram-Bf0IVidT.webp +0 -0
- package/dist/assets/kakao-talk-Df79L_Mv.webp +0 -0
- package/dist/assets/kaleidoscope-BxqMZuWo.webp +0 -0
- package/dist/assets/karrot-BXFPhDwt.webp +0 -0
- package/dist/assets/kaufland-BDDy6e0C.webp +0 -0
- package/dist/assets/lazada-ConR4e1O.webp +0 -0
- package/dist/assets/lens_flare-DgyiAv_j.webp +0 -0
- package/dist/assets/light_leak-kUdpoFuC.webp +0 -0
- package/dist/assets/line-Dr1j___B.webp +0 -0
- package/dist/assets/linkedin-4s_9Wh03.webp +0 -0
- package/dist/assets/lo_fi-DSdl3yY_.webp +0 -0
- package/dist/assets/logo-preparation.worker-D9oa7SME.js +420 -0
- package/dist/assets/mercado-libre-C8CskEiS.webp +0 -0
- package/dist/assets/mercari-jp-DHj7nz4O.webp +0 -0
- package/dist/assets/metadata.worker-B_9_BgN1.js +6456 -0
- package/dist/assets/mirror_collage-JtSKCeSh.webp +0 -0
- package/dist/assets/model-BbeF-fsf.webp +0 -0
- package/dist/assets/model-BjWhieit.webp +0 -0
- package/dist/assets/momo-BWXO_8Df.webp +0 -0
- package/dist/assets/motion_blur-B8YUHeSg.webp +0 -0
- package/dist/assets/naver-xQKL8lWg.webp +0 -0
- package/dist/assets/nuvemshop-DPt6rnA-.webp +0 -0
- package/dist/assets/olx-B87gp-Il.webp +0 -0
- package/dist/assets/orient-card-Da0ii6mX.webp +0 -0
- package/dist/assets/orient-final.worker-CdF5Y5zD.js +6909 -0
- package/dist/assets/orientation-preview.worker-B7uFzz3J.js +6865 -0
- package/dist/assets/ort.bundle.min-CreFV8V1.js +9311 -0
- package/dist/assets/ort.webgpu.bundle.min-CAudaHZO.js +9311 -0
- package/dist/assets/otto-market-DWZyNKJn.webp +0 -0
- package/dist/assets/paper_texture-CXphyIrs.webp +0 -0
- package/dist/assets/pinterest-ByZqih2J.webp +0 -0
- package/dist/assets/polish-DFy6LNG7.webp +0 -0
- package/dist/assets/poshmark-DnZi2vA1.webp +0 -0
- package/dist/assets/posterize-SpLVGq1s.webp +0 -0
- package/dist/assets/preview.worker-DcrCKKWl.js +380 -0
- package/dist/assets/qoo10-C1pq81Jx.webp +0 -0
- package/dist/assets/rakuten-ulYog1hL.webp +0 -0
- package/dist/assets/recolor-mBX7vdFT.webp +0 -0
- package/dist/assets/resize-DVEAl0Um.webp +0 -0
- package/dist/assets/runtime-0663b902fb3937883a34.wasm +0 -0
- package/dist/assets/runtime-355a5c80c7bfdf8737de.mjs +2817 -0
- package/dist/assets/runtime-49871f5a4409519797e1.wasm +0 -0
- package/dist/assets/runtime-74cf72f9a2b7befc115a.mjs +2817 -0
- package/dist/assets/shadow-card-DTZEH60r.png +0 -0
- package/dist/assets/shopee-Bxfei6sj.webp +0 -0
- package/dist/assets/shopify-wVaBafcF.webp +0 -0
- package/dist/assets/shopline-DMoaJ7Bh.webp +0 -0
- package/dist/assets/sparkle-CD5GSGip.webp +0 -0
- package/dist/assets/ssg-DQoFx5u5.webp +0 -0
- package/dist/assets/staging-CIc8pQJ6.webp +0 -0
- package/dist/assets/standard-cutout.worker-BYLzdpR-.js +1261 -0
- package/dist/assets/text-DQW2mBGp.webp +0 -0
- package/dist/assets/textured_glass-D2coxp7n.webp +0 -0
- package/dist/assets/tga-VGxWDes0.js +752 -0
- package/dist/assets/tilt_shift-BKs46yeX.webp +0 -0
- package/dist/assets/transformers.web-DB57cIO5.js +28891 -0
- package/dist/assets/tritone-CcR4qizk.webp +0 -0
- package/dist/assets/upscale-BrLadyUk.webp +0 -0
- package/dist/assets/upscale-creative-DnZnQufJ.webp +0 -0
- package/dist/assets/upscale-crisp-Ckdmbsnn.webp +0 -0
- package/dist/assets/vinted-1QDsxvC6.webp +0 -0
- package/dist/assets/watercolor-CV67zYNE.webp +0 -0
- package/dist/assets/watermark-CpPrxaT5.webp +0 -0
- package/dist/assets/wave_distortion-CV5jVfK4.webp +0 -0
- package/dist/assets/whatsapp-CWJxqzR6.webp +0 -0
- package/dist/assets/worker-DfrCFP3O.js +55 -0
- package/dist/assets/xerox_noise-CbbHY1S1.webp +0 -0
- package/dist/assets/youtube-DS12d5mi.webp +0 -0
- package/dist/assets/zalando-CenfWOwz.webp +0 -0
- package/dist/browser-adapter.d.ts +4 -0
- package/dist/browser-cutout-capability.d.ts +4 -0
- package/dist/browser-cutout-resources.d.ts +3 -0
- package/dist/browser-local-capabilities.d.ts +5 -0
- package/dist/capabilities.d.ts +18 -0
- package/dist/chunks/AdjustToolPanel-BELqYSUR.js +195 -0
- package/dist/chunks/BackgroundToolPanel-Dy_l8KFl.js +41 -0
- package/dist/chunks/BatchMaterials-niGKrga3.js +806 -0
- package/dist/chunks/BatchModeChoices-BRqn6zNI.js +111 -0
- package/dist/chunks/BatchOutputColorPicker-CCvmIF-b.js +75 -0
- package/dist/chunks/BatchReferenceFields-C4t7OSTw.js +316 -0
- package/dist/chunks/BeautifyToolPanel-Dc-ddaBC.js +215 -0
- package/dist/chunks/BrandMarkToolPanel-FKxXth_3.js +1179 -0
- package/dist/chunks/ContentTrimControl-BQfigZPq.js +297 -0
- package/dist/chunks/CropToolPanel-BhSuHkYm.js +218 -0
- package/dist/chunks/CutoutToolPanel-BfaZZSE_.js +73 -0
- package/dist/chunks/DisclosureToolPanel-B_oc5fld.js +76 -0
- package/dist/chunks/ExpandToolPanel-D_ZODTUZ.js +67 -0
- package/dist/chunks/ImageEffectsToolPanel-BRLPIt4q.js +966 -0
- package/dist/chunks/IpAuditToolPanel-DfY-mBSe.js +96 -0
- package/dist/chunks/ListingToolPanel-B9Yh3LBK.js +783 -0
- package/dist/chunks/MaterialSelectionPlate-DhioUjdW.js +30 -0
- package/dist/chunks/MetadataToolPanel-KVrtb3K0.js +104 -0
- package/dist/chunks/OrientToolPanel-BTrwaWBm.js +161 -0
- package/dist/chunks/PluginActionFooter.vue_vue_type_script_setup_true_lang-C2kJCYeA.js +102 -0
- package/dist/chunks/ResizeToolPanel-Ch_-WR74.js +1178 -0
- package/dist/chunks/RetouchToolPanel-BTS33Dsd.js +350 -0
- package/dist/chunks/ShadowToolPanel-DxJE4eyV.js +254 -0
- package/dist/chunks/SvgExportToolPanel-RHmuQARH.js +219 -0
- package/dist/chunks/TranslationToolPanel-B_qTA1hM.js +125 -0
- package/dist/chunks/UpscaleToolPanel-D0H-j2Tr.js +127 -0
- package/dist/chunks/engine-D-T-1RSx.js +69 -0
- package/dist/chunks/entry-DK9FjQZ_.js +42946 -0
- package/dist/chunks/gpu-CScw5MNG.js +231 -0
- package/dist/chunks/hosted-resources-COzZ7nZY.js +8196 -0
- package/dist/chunks/loader-circle-UFoEem2a.js +16 -0
- package/dist/chunks/motionFeatures-D4miwXxc.js +4405 -0
- package/dist/chunks/search-BjTSm1KS.js +18 -0
- package/dist/chunks/standard-cutout-vPpP6xBc.js +45 -0
- package/dist/chunks/static-logo-2F9ORZWc.js +34 -0
- package/dist/config.d.ts +66 -0
- package/dist/contracts.d.ts +272 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +13 -0
- package/dist/node/catalog.mjs +45 -0
- package/dist/node/cli.mjs +11 -0
- package/dist/node/index.d.mts +20 -0
- package/dist/node/index.mjs +2 -0
- package/dist/node/prepare.mjs +114 -0
- package/dist/node/vite.mjs +46 -0
- package/dist/processing.d.ts +1 -0
- package/dist/processing.js +12105 -0
- package/dist/remote-contracts.d.ts +114 -0
- package/dist/resource-contracts.d.ts +40 -0
- package/dist/resources/cutout/9ae2e5375a34fa413530954dc20d085d175faffc86108c13619220d0557f80bf.json +1 -0
- package/dist/resources/cutout/f119dabecc64bc436d3d08425dde96ec2598fd40541eba97d8d53a4e8bbdcaea.json +1 -0
- package/dist/resources/cutout/resources.json +195 -0
- package/dist/resources/cutout/sources.json +294 -0
- package/dist/resources.json +1191 -0
- package/dist/service-contracts.d.ts +43 -0
- package/dist/slots.d.ts +21 -0
- package/dist/style.css +1 -0
- package/dist/types/batch/api.d.ts +89 -0
- package/dist/types/batch/cutout-output.d.ts +2 -0
- package/dist/types/batch/features/background/engine.d.mts +12 -0
- package/dist/types/batch/features/basic-edit/contracts.d.ts +87 -0
- package/dist/types/batch/features/basic-edit/engine.d.mts +96 -0
- package/dist/types/batch/features/brand-mark/contracts.d.ts +84 -0
- package/dist/types/batch/features/brand-mark/engine.d.mts +68 -0
- package/dist/types/batch/features/export-compression/contracts.d.ts +44 -0
- package/dist/types/batch/features/export-compression/gifenc.d.ts +33 -0
- package/dist/types/batch/features/export-compression/plan.d.ts +45 -0
- package/dist/types/batch/features/export-compression/presentation.d.ts +70 -0
- package/dist/types/batch/features/export-compression/upng.d.ts +6 -0
- package/dist/types/batch/features/final-image/resize.d.mts +15 -0
- package/dist/types/batch/features/image-effects/contracts.d.ts +58 -0
- package/dist/types/batch/features/image-effects/gpu-pixel-runtime.d.ts +15 -0
- package/dist/types/batch/features/image-effects/photo-audit.d.ts +21 -0
- package/dist/types/batch/features/image-effects/photo-v7-cpu.d.ts +9 -0
- package/dist/types/batch/features/image-effects/profiles-v4.d.ts +157 -0
- package/dist/types/batch/features/image-effects/profiles-v5.d.ts +20 -0
- package/dist/types/batch/features/image-effects/profiles-v6.d.ts +14 -0
- package/dist/types/batch/features/image-effects/profiles-v7.d.ts +53 -0
- package/dist/types/batch/features/image-effects/profiles-v8.d.ts +113 -0
- package/dist/types/batch/features/image-effects/profiles-v9.d.ts +20 -0
- package/dist/types/batch/features/image-translation/params.d.ts +257 -0
- package/dist/types/batch/features/listing-remake/transport.d.ts +21 -0
- package/dist/types/batch/features/metadata/bytes.d.mts +13 -0
- package/dist/types/batch/features/metadata/containers.d.mts +20 -0
- package/dist/types/batch/features/metadata/declaration.d.mts +5 -0
- package/dist/types/batch/features/metadata/engine.d.mts +9 -0
- package/dist/types/batch/features/metadata/exchange.d.mts +48 -0
- package/dist/types/batch/features/shadow/contracts.d.ts +43 -0
- package/dist/types/batch/features/shadow/engine.d.mts +33 -0
- package/dist/types/batch/features/svg-export/download-contract.d.ts +33 -0
- package/dist/types/batch/features/svg-export/download-prepare.d.ts +2 -0
- package/dist/types/batch/features/svg-export/download.d.ts +7 -0
- package/dist/types/batch/features/svg-export/imagetracer.d.ts +6 -0
- package/dist/types/batch/features/svg-export/optimizer.d.ts +2 -0
- package/dist/types/batch/ids.d.ts +1 -0
- package/dist/types/batch/model.d.ts +317 -0
- package/dist/types/batch/public/config.d.ts +66 -0
- package/dist/types/batch/public/contracts.d.ts +272 -0
- package/dist/types/batch/public/remote-contracts.d.ts +114 -0
- package/dist/types/batch/public/resource-contracts.d.ts +40 -0
- package/dist/types/batch/public/service-contracts.d.ts +43 -0
- package/dist/types/batch/queue.d.ts +34 -0
- package/dist/types/batch/receipts.d.ts +85 -0
- package/dist/types/batch/retention.d.ts +13 -0
- package/dist/types/onnxruntime-web.d.ts +5 -0
- package/dist/types/plugins/cutout/core/hosted-resources.d.ts +11 -0
- package/dist/types/processing.d.ts +18 -0
- package/dist/types/shared/svg-security.d.mts +4 -0
- package/dist/types/workspace-worker.d.ts +2 -0
- package/package.json +95 -6
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { type AssetLifetime } from './retention';
|
|
2
|
+
import type { TranslationDetails } from './features/image-translation/params';
|
|
3
|
+
export { newId } from './ids';
|
|
4
|
+
export { createOperation, retryFailed } from './queue';
|
|
5
|
+
export declare const BATCH_LIMIT = 250;
|
|
6
|
+
export type Source = {
|
|
7
|
+
kind: 'external_url';
|
|
8
|
+
url: string;
|
|
9
|
+
expectedSha256?: string;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'asset';
|
|
12
|
+
assetId: string;
|
|
13
|
+
assetVersionId: string;
|
|
14
|
+
oss_url?: string;
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'local';
|
|
17
|
+
blobKey: string;
|
|
18
|
+
filename: string;
|
|
19
|
+
mime: string;
|
|
20
|
+
bytes: number;
|
|
21
|
+
uploadId?: string;
|
|
22
|
+
};
|
|
23
|
+
export type Asset = AssetLifetime & {
|
|
24
|
+
assetId: string;
|
|
25
|
+
assetVersionId: string;
|
|
26
|
+
sha256: string;
|
|
27
|
+
mime: string;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
bytes: number;
|
|
31
|
+
oss_url?: string;
|
|
32
|
+
orientation?: number;
|
|
33
|
+
};
|
|
34
|
+
export type Disclosure = {
|
|
35
|
+
method?: 'manual' | 'ai';
|
|
36
|
+
decision: 'YES' | 'NO' | 'REVIEW';
|
|
37
|
+
reason: string;
|
|
38
|
+
status: 'verified' | 'unchanged' | 'review';
|
|
39
|
+
verified: boolean;
|
|
40
|
+
keywordPresent: boolean;
|
|
41
|
+
fileSha256: string;
|
|
42
|
+
};
|
|
43
|
+
export type IpAnalysis = {
|
|
44
|
+
schemaVersion: 1;
|
|
45
|
+
inputSha256: string;
|
|
46
|
+
findings: {
|
|
47
|
+
id: string;
|
|
48
|
+
category: string;
|
|
49
|
+
evidence: string;
|
|
50
|
+
risk: number;
|
|
51
|
+
box: [number, number, number, number] | null;
|
|
52
|
+
suspectedIp?: string | null;
|
|
53
|
+
}[];
|
|
54
|
+
summary: string;
|
|
55
|
+
revisionRoute: 'NONE' | 'LOCAL_EDIT' | 'REGENERATE' | 'REVIEW_BEFORE_EDIT';
|
|
56
|
+
revisionPrompt: string;
|
|
57
|
+
};
|
|
58
|
+
export type LirDetails = {
|
|
59
|
+
productAssets: {
|
|
60
|
+
assetId: string;
|
|
61
|
+
assetVersionId: string;
|
|
62
|
+
sha256: string;
|
|
63
|
+
}[];
|
|
64
|
+
productAtlasSha256: string;
|
|
65
|
+
promptSha256: string;
|
|
66
|
+
segmentId: string;
|
|
67
|
+
referenceNumber: number;
|
|
68
|
+
};
|
|
69
|
+
export type WorkflowDetails = {
|
|
70
|
+
processingAudit?: import('./features/image-effects/photo-audit').PhotoProcessingAudit;
|
|
71
|
+
translation?: TranslationDetails;
|
|
72
|
+
lir?: LirDetails;
|
|
73
|
+
inputSha256?: string;
|
|
74
|
+
analysis?: IpAnalysis | null;
|
|
75
|
+
disclosure?: Disclosure | null;
|
|
76
|
+
needsReview?: boolean;
|
|
77
|
+
skipped?: boolean;
|
|
78
|
+
reasonCode?: 'already_target_language' | 'no_editable_text';
|
|
79
|
+
reason?: string;
|
|
80
|
+
autoRescreened?: boolean;
|
|
81
|
+
};
|
|
82
|
+
export type WorkflowResult = WorkflowDetails & ({
|
|
83
|
+
kind: 'image';
|
|
84
|
+
asset: Asset;
|
|
85
|
+
localSource?: Extract<Source, {
|
|
86
|
+
kind: 'local';
|
|
87
|
+
}>;
|
|
88
|
+
} | {
|
|
89
|
+
kind: 'analysis';
|
|
90
|
+
} | {
|
|
91
|
+
kind: 'export';
|
|
92
|
+
exportKind: 'svg';
|
|
93
|
+
asset: Asset;
|
|
94
|
+
});
|
|
95
|
+
export type TaskStep = {
|
|
96
|
+
name: string;
|
|
97
|
+
status: 'started' | 'waiting' | 'succeeded' | 'failed' | 'unknown';
|
|
98
|
+
error?: {
|
|
99
|
+
code: string;
|
|
100
|
+
message: string;
|
|
101
|
+
} | null;
|
|
102
|
+
};
|
|
103
|
+
export type Version = {
|
|
104
|
+
id: string;
|
|
105
|
+
source: Source;
|
|
106
|
+
asset?: Asset;
|
|
107
|
+
disclosure?: Disclosure;
|
|
108
|
+
createdAt: number;
|
|
109
|
+
parentVersionId?: string;
|
|
110
|
+
fromAttemptId?: string;
|
|
111
|
+
};
|
|
112
|
+
export type Item = {
|
|
113
|
+
id: string;
|
|
114
|
+
name: string;
|
|
115
|
+
groupId?: string;
|
|
116
|
+
versions: Version[];
|
|
117
|
+
currentVersionId: string;
|
|
118
|
+
redo: string[];
|
|
119
|
+
error?: string;
|
|
120
|
+
busyAttemptId?: string;
|
|
121
|
+
};
|
|
122
|
+
export type Group = {
|
|
123
|
+
id: string;
|
|
124
|
+
label: string;
|
|
125
|
+
itemIds: string[];
|
|
126
|
+
};
|
|
127
|
+
export type ToolId = 'resize' | 'background' | 'cutout' | 'ip_audit' | 'ai_disclosure' | 'expand' | 'adjust' | 'crop' | 'listing_remake' | 'orient' | 'shadow' | 'metadata_cleanup' | 'image_translation' | 'brand_mark' | 'retouch' | 'upscale' | 'beautify' | 'vectorize_svg' | 'image_effects';
|
|
128
|
+
export declare const isPythonTool: (toolId: ToolId) => boolean;
|
|
129
|
+
export type AttemptStatus = 'waiting_dependency' | 'blocked_dependency' | 'waiting_source' | 'ready_to_submit' | 'submitting' | 'submission_unknown' | 'accepted' | 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
130
|
+
export type Attempt = {
|
|
131
|
+
remoteAdmission?: 'accepted' | 'not_accepted' | 'unknown';
|
|
132
|
+
remotePlan?: import('./public/remote-contracts').WorkspaceRemotePlan;
|
|
133
|
+
remoteGenerated?: import('./public/remote-contracts').WorkspaceRemoteGenerated;
|
|
134
|
+
remotePublicationId?: string;
|
|
135
|
+
remoteWaitingStopped?: boolean;
|
|
136
|
+
remotePublicationStatus?: 'pending' | 'unknown' | 'published';
|
|
137
|
+
remoteReceipt?: import('./public/remote-contracts').WorkspaceRemoteReceipt;
|
|
138
|
+
localExecutionResult?: {
|
|
139
|
+
blobKey: string;
|
|
140
|
+
sha256: string;
|
|
141
|
+
mime: string;
|
|
142
|
+
bytes: number;
|
|
143
|
+
inputSha256: string;
|
|
144
|
+
reason?: string;
|
|
145
|
+
disclosure?: Disclosure;
|
|
146
|
+
};
|
|
147
|
+
automaticRecovery?: {
|
|
148
|
+
count: number;
|
|
149
|
+
notBefore: number;
|
|
150
|
+
};
|
|
151
|
+
timing?: {
|
|
152
|
+
startedAt: number;
|
|
153
|
+
lastProgressAt: number;
|
|
154
|
+
};
|
|
155
|
+
localSvgResult?: {
|
|
156
|
+
blobKey: string;
|
|
157
|
+
uploadId?: string;
|
|
158
|
+
sha256: string;
|
|
159
|
+
mime: 'image/svg+xml';
|
|
160
|
+
bytes: number;
|
|
161
|
+
inputSha256: string;
|
|
162
|
+
};
|
|
163
|
+
localMetadataResult?: {
|
|
164
|
+
blobKey: string;
|
|
165
|
+
uploadId?: string;
|
|
166
|
+
sha256: string;
|
|
167
|
+
mime: string;
|
|
168
|
+
bytes: number;
|
|
169
|
+
inputSha256: string;
|
|
170
|
+
reason: string;
|
|
171
|
+
};
|
|
172
|
+
localImageEffectResult?: {
|
|
173
|
+
blobKey: string;
|
|
174
|
+
uploadId?: string;
|
|
175
|
+
sha256: string;
|
|
176
|
+
mime: string;
|
|
177
|
+
bytes: number;
|
|
178
|
+
width: number;
|
|
179
|
+
height: number;
|
|
180
|
+
alpha: boolean;
|
|
181
|
+
inputSha256: string;
|
|
182
|
+
outputKind: 'image' | 'svg';
|
|
183
|
+
effectId: string;
|
|
184
|
+
effectVersion: import('./features/image-effects/contracts').ImageEffectVersion;
|
|
185
|
+
paramsDigest?: string;
|
|
186
|
+
processingAudit?: import('./features/image-effects/photo-audit').PhotoProcessingAudit;
|
|
187
|
+
};
|
|
188
|
+
submittedTask?: Record<string, unknown>;
|
|
189
|
+
retryActionId?: string;
|
|
190
|
+
submittedParams?: Record<string, unknown>;
|
|
191
|
+
lirSubmission?: Record<string, unknown>;
|
|
192
|
+
dependsOnOperationId?: string;
|
|
193
|
+
continuation?: 'skip' | 'cancel' | 'force';
|
|
194
|
+
forcedContinuation?: {
|
|
195
|
+
operationId: string;
|
|
196
|
+
versionId: string;
|
|
197
|
+
};
|
|
198
|
+
queueBlockReason?: 'missing_dependency' | 'upstream_failed' | 'upstream_unknown' | 'unapplied_result' | 'source_changed';
|
|
199
|
+
id: string;
|
|
200
|
+
operationId: string;
|
|
201
|
+
itemId: string;
|
|
202
|
+
inputVersionId: string;
|
|
203
|
+
clientRequestId: string;
|
|
204
|
+
submittedSource?: Exclude<Source, {
|
|
205
|
+
kind: 'local';
|
|
206
|
+
}>;
|
|
207
|
+
taskService?: 'node' | 'python-ai';
|
|
208
|
+
taskId?: string;
|
|
209
|
+
status: AttemptStatus;
|
|
210
|
+
statusVersion: number;
|
|
211
|
+
stage?: string;
|
|
212
|
+
localProgress?: {
|
|
213
|
+
stage: 'decode' | 'process' | 'encode';
|
|
214
|
+
completed: number;
|
|
215
|
+
total?: number;
|
|
216
|
+
};
|
|
217
|
+
retryOf?: string;
|
|
218
|
+
resumeFromTaskId?: string;
|
|
219
|
+
error?: string;
|
|
220
|
+
errorCode?: string;
|
|
221
|
+
retryable?: boolean;
|
|
222
|
+
applied?: boolean;
|
|
223
|
+
result?: Asset;
|
|
224
|
+
exportArtifact?: Asset;
|
|
225
|
+
details?: WorkflowDetails;
|
|
226
|
+
partialResult?: Asset;
|
|
227
|
+
steps?: TaskStep[];
|
|
228
|
+
performance?: {
|
|
229
|
+
latencyMs: number;
|
|
230
|
+
coldStart: boolean;
|
|
231
|
+
threads?: number;
|
|
232
|
+
backend: string;
|
|
233
|
+
engineVersion: string;
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
export type Operation = {
|
|
237
|
+
/** Original SVG draft versions, distinct from dependency-bound execution inputs. */
|
|
238
|
+
svgIntentInputVersionIds?: Readonly<Record<string, string>>;
|
|
239
|
+
lirSegments?: string[];
|
|
240
|
+
queueVersion?: 1;
|
|
241
|
+
id: string;
|
|
242
|
+
toolId: ToolId;
|
|
243
|
+
toolVersion: '1' | '2';
|
|
244
|
+
params: Record<string, unknown>;
|
|
245
|
+
itemIds: string[];
|
|
246
|
+
inputVersionIds: Record<string, string>;
|
|
247
|
+
createdAt: number;
|
|
248
|
+
attemptIds: string[];
|
|
249
|
+
skippedItemIds?: string[];
|
|
250
|
+
busySkippedItemIds?: string[];
|
|
251
|
+
};
|
|
252
|
+
export type VersionAction = {
|
|
253
|
+
id: string;
|
|
254
|
+
kind: 'operation' | 'restore' | 'replacement' | 'rollback' | 'delete';
|
|
255
|
+
removedItems?: {
|
|
256
|
+
index: number;
|
|
257
|
+
item: Item;
|
|
258
|
+
}[];
|
|
259
|
+
operationId?: string;
|
|
260
|
+
changes: {
|
|
261
|
+
itemId: string;
|
|
262
|
+
beforeVersionId: string;
|
|
263
|
+
afterVersionId: string;
|
|
264
|
+
}[];
|
|
265
|
+
createdAt: number;
|
|
266
|
+
};
|
|
267
|
+
export type Batch = {
|
|
268
|
+
workspaceView?: Record<string, unknown>;
|
|
269
|
+
expiredAt?: number;
|
|
270
|
+
archivedAt?: number;
|
|
271
|
+
clonedFromBatchId?: string;
|
|
272
|
+
schema: 1;
|
|
273
|
+
id: string;
|
|
274
|
+
name: string;
|
|
275
|
+
createdAt: number;
|
|
276
|
+
items: Item[];
|
|
277
|
+
groups: Group[];
|
|
278
|
+
operations: Operation[];
|
|
279
|
+
attempts: Attempt[];
|
|
280
|
+
selectedIds: string[];
|
|
281
|
+
paused: boolean;
|
|
282
|
+
activeOperationId?: string;
|
|
283
|
+
actionHistory?: VersionAction[];
|
|
284
|
+
actionCursor?: number;
|
|
285
|
+
};
|
|
286
|
+
export declare function newBatch(): Batch;
|
|
287
|
+
export declare function assetDisplaySize(asset: Asset): {
|
|
288
|
+
width: number;
|
|
289
|
+
height: number;
|
|
290
|
+
};
|
|
291
|
+
export declare function currentVersion(item: Item): Version;
|
|
292
|
+
export declare function recordVersionChange(batch: Batch, kind: VersionAction['kind'], itemId: string, beforeVersionId: string, afterVersionId: string, operationId?: string): void;
|
|
293
|
+
export declare function restoreVersionAsAction(batch: Batch, itemId: string, versionId: string): boolean;
|
|
294
|
+
/** A verified, locally stored version is distinct from a file awaiting upload. */
|
|
295
|
+
export declare function hasStoredLocalAsset(version: Version): boolean;
|
|
296
|
+
export declare function deleteItemsAsAction(batch: Batch, ids: string[]): boolean;
|
|
297
|
+
export declare function canTraverseAction(batch: Batch, direction: -1 | 1): boolean;
|
|
298
|
+
export declare const undoLastAction: (batch: Batch) => VersionAction;
|
|
299
|
+
export declare const redoLastAction: (batch: Batch) => VersionAction;
|
|
300
|
+
export declare function initializeActionHistory(batch: Batch): void;
|
|
301
|
+
export declare function addItems(batch: Batch, entries: {
|
|
302
|
+
name: string;
|
|
303
|
+
source: Source;
|
|
304
|
+
groupLabel?: string;
|
|
305
|
+
groupId?: string;
|
|
306
|
+
}[], mergeGroups?: boolean): void;
|
|
307
|
+
export declare function applyTaskResult(batch: Batch, attempt: Attempt, asset: Asset, localSource?: Extract<Source, {
|
|
308
|
+
kind: 'local';
|
|
309
|
+
}>): 'applied' | 'stale';
|
|
310
|
+
export declare function finishAttempt(batch: Batch, attempt: Attempt, status: 'failed' | 'cancelled', error?: string, errorCode?: string, retryable?: boolean): void;
|
|
311
|
+
export declare function applyWorkflowResult(batch: Batch, attempt: Attempt, result: WorkflowResult): 'applied' | 'stale';
|
|
312
|
+
export declare function undo(batch: Batch, itemId: string): boolean;
|
|
313
|
+
export declare function redo(batch: Batch, itemId: string): boolean;
|
|
314
|
+
export declare function undoOperation(batch: Batch, operationId: string): {
|
|
315
|
+
undone: number;
|
|
316
|
+
skipped: number;
|
|
317
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** An exact allowlist. New tools, entries and execution modes stay closed. */
|
|
2
|
+
export interface WorkspaceCapability {
|
|
3
|
+
toolId: string;
|
|
4
|
+
entryId?: string;
|
|
5
|
+
execution: 'local' | 'remote';
|
|
6
|
+
mode?: string;
|
|
7
|
+
}
|
|
8
|
+
export type WorkspaceResetAction = 'draft' | 'newBatch' | 'restoreVersion';
|
|
9
|
+
export interface WorkspaceResetRequest {
|
|
10
|
+
readonly action: WorkspaceResetAction;
|
|
11
|
+
/** full clears the tool draft; parameters preserves its selected assets/mode where supported. */
|
|
12
|
+
readonly intent?: 'full' | 'parameters';
|
|
13
|
+
readonly toolId?: string;
|
|
14
|
+
readonly entryId?: string;
|
|
15
|
+
readonly batchId: string;
|
|
16
|
+
}
|
|
17
|
+
export interface WorkspaceParameterDefault {
|
|
18
|
+
readonly schemaVersion: 1;
|
|
19
|
+
readonly toolId: string;
|
|
20
|
+
readonly entryId?: string;
|
|
21
|
+
/** Existing tool parameter schema. Asset/task identities are never accepted in defaults. */
|
|
22
|
+
readonly params: Readonly<Record<string, unknown>>;
|
|
23
|
+
}
|
|
24
|
+
export interface WorkspaceNavigationRequest {
|
|
25
|
+
readonly reason: 'busy' | 'history' | 'readonly';
|
|
26
|
+
readonly batchId: string;
|
|
27
|
+
readonly toolId?: string;
|
|
28
|
+
readonly entryId?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface WorkspaceConfig {
|
|
31
|
+
toolOptions?: {
|
|
32
|
+
translation?: {
|
|
33
|
+
targets: readonly {
|
|
34
|
+
code: string;
|
|
35
|
+
label: string;
|
|
36
|
+
}[];
|
|
37
|
+
};
|
|
38
|
+
expand?: {
|
|
39
|
+
prompt?: boolean;
|
|
40
|
+
ratios?: readonly string[];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
/** The host opens its route/container. The core never constructs a product URL. */
|
|
44
|
+
navigation?: {
|
|
45
|
+
openWorkspace(request: WorkspaceNavigationRequest): void | Promise<void>;
|
|
46
|
+
};
|
|
47
|
+
parameterDefaults?: readonly WorkspaceParameterDefault[];
|
|
48
|
+
capabilities?: readonly WorkspaceCapability[];
|
|
49
|
+
visibility?: {
|
|
50
|
+
brand?: boolean;
|
|
51
|
+
history?: boolean;
|
|
52
|
+
import?: boolean;
|
|
53
|
+
export?: boolean;
|
|
54
|
+
newBatch?: boolean;
|
|
55
|
+
draftReset?: boolean;
|
|
56
|
+
theme?: boolean;
|
|
57
|
+
language?: boolean;
|
|
58
|
+
/** 服务可用性诊断与重新检测入口;不影响实际执行能力检查。 */
|
|
59
|
+
serviceStatus?: boolean;
|
|
60
|
+
};
|
|
61
|
+
/** Host confirmation/reset policy. False or rejection preserves the original state. */
|
|
62
|
+
beforeReset?(request: WorkspaceResetRequest): boolean | Promise<boolean>;
|
|
63
|
+
}
|
|
64
|
+
/** V1 compatibility only: omitting config retains the original metadata tool.
|
|
65
|
+
* Passing an explicit {} closes it too. Every newly introduced tool stays closed. */
|
|
66
|
+
export declare const DEFAULT_WORKSPACE_CONFIG: WorkspaceConfig;
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import type { WorkspaceConfig } from './config';
|
|
2
|
+
import type { WorkspaceServices } from './service-contracts';
|
|
3
|
+
export * from './service-contracts';
|
|
4
|
+
/** Version 1 candidate surface. No product identity, authorization or wallet objects. */
|
|
5
|
+
export interface MetadataParameters {
|
|
6
|
+
version: 1;
|
|
7
|
+
removeGps: true;
|
|
8
|
+
removeDevice: true;
|
|
9
|
+
removeSerial: true;
|
|
10
|
+
removeTime: boolean;
|
|
11
|
+
removeAuthorComments: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface MetadataResult {
|
|
14
|
+
blob: Blob;
|
|
15
|
+
inputSha256: string;
|
|
16
|
+
outputSha256: string;
|
|
17
|
+
changed: boolean;
|
|
18
|
+
format: 'png' | 'jpeg' | 'webp';
|
|
19
|
+
removedCount: number;
|
|
20
|
+
removed: Record<'gps' | 'device' | 'serial' | 'time' | 'authorComments', number>;
|
|
21
|
+
}
|
|
22
|
+
export interface MetadataExecutor {
|
|
23
|
+
run(blob: Blob, params: MetadataParameters | {
|
|
24
|
+
execution: 'browser';
|
|
25
|
+
mode: 'declare';
|
|
26
|
+
}, expectedSha256?: string, signal?: AbortSignal): Promise<MetadataResult>;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
|
29
|
+
export interface WorkspaceFile {
|
|
30
|
+
name: string;
|
|
31
|
+
blob: Blob;
|
|
32
|
+
itemId: string;
|
|
33
|
+
versionId: string;
|
|
34
|
+
}
|
|
35
|
+
export interface WorkspaceAssetIdentity {
|
|
36
|
+
assetId: string;
|
|
37
|
+
assetVersionId: string;
|
|
38
|
+
sha256: string;
|
|
39
|
+
}
|
|
40
|
+
export interface WorkspaceAssetReference extends WorkspaceAssetIdentity {
|
|
41
|
+
mime: string;
|
|
42
|
+
bytes: number;
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}
|
|
46
|
+
export interface WorkspaceExternalSource {
|
|
47
|
+
readonly url: string;
|
|
48
|
+
readonly expectedSha256?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface WorkspaceExecutionPlan {
|
|
51
|
+
readonly clientRequestId: string;
|
|
52
|
+
readonly operationId: string;
|
|
53
|
+
readonly itemId: string;
|
|
54
|
+
readonly inputVersionId: string;
|
|
55
|
+
readonly inputSha256: string;
|
|
56
|
+
readonly toolId: string;
|
|
57
|
+
readonly toolVersion: '1' | '2';
|
|
58
|
+
readonly params: Readonly<Record<string, unknown>>;
|
|
59
|
+
}
|
|
60
|
+
export interface WorkspaceDisclosure {
|
|
61
|
+
method?: 'manual' | 'ai';
|
|
62
|
+
decision: 'YES' | 'NO' | 'REVIEW';
|
|
63
|
+
reason: string;
|
|
64
|
+
status: 'verified' | 'unchanged' | 'review';
|
|
65
|
+
verified: boolean;
|
|
66
|
+
keywordPresent: boolean;
|
|
67
|
+
fileSha256: string;
|
|
68
|
+
}
|
|
69
|
+
export type WorkspaceLocalResult = {
|
|
70
|
+
kind: 'image';
|
|
71
|
+
blob: Blob;
|
|
72
|
+
reason?: string;
|
|
73
|
+
disclosure?: WorkspaceDisclosure;
|
|
74
|
+
} | {
|
|
75
|
+
kind: 'analysis';
|
|
76
|
+
reason: string;
|
|
77
|
+
skipped?: boolean;
|
|
78
|
+
disclosure?: WorkspaceDisclosure;
|
|
79
|
+
};
|
|
80
|
+
export interface WorkspaceLocalExecutor {
|
|
81
|
+
run(plan: WorkspaceExecutionPlan, input: Blob, context: {
|
|
82
|
+
signal: AbortSignal;
|
|
83
|
+
readAsset(reference: WorkspaceAssetIdentity): Promise<Blob>;
|
|
84
|
+
progress(value: {
|
|
85
|
+
stage: 'decode' | 'process' | 'encode';
|
|
86
|
+
completed: number;
|
|
87
|
+
total?: number;
|
|
88
|
+
}): void;
|
|
89
|
+
}): Promise<WorkspaceLocalResult>;
|
|
90
|
+
dispose(): void;
|
|
91
|
+
}
|
|
92
|
+
export interface WorkspaceLocalCapability {
|
|
93
|
+
supports?(params: Readonly<Record<string, unknown>>): boolean;
|
|
94
|
+
createExecutor(): WorkspaceLocalExecutor;
|
|
95
|
+
}
|
|
96
|
+
import type { WorkspaceRemoteExecution, WorkspaceRemoteResultDetails } from './remote-contracts';
|
|
97
|
+
export * from './remote-contracts';
|
|
98
|
+
export interface WorkspacePageSession {
|
|
99
|
+
readonly active: boolean;
|
|
100
|
+
readonly batchId: string | undefined;
|
|
101
|
+
start(): Promise<void>;
|
|
102
|
+
bind(batchId: string): void;
|
|
103
|
+
stop(): void;
|
|
104
|
+
}
|
|
105
|
+
export interface BatchWorkspaceAdapter {
|
|
106
|
+
namespace: string;
|
|
107
|
+
/** SDK 页签绑定;需配合按项目读取的持久化,缺省保留旧的命名空间单写者契约。 */
|
|
108
|
+
pageSession?: () => WorkspacePageSession;
|
|
109
|
+
services?: WorkspaceServices;
|
|
110
|
+
coordination?: {
|
|
111
|
+
acquire(namespace: string): Promise<() => void | Promise<void>>;
|
|
112
|
+
};
|
|
113
|
+
assets: {
|
|
114
|
+
read(key: string): Promise<Blob | undefined>;
|
|
115
|
+
write(key: string, blob: Blob): Promise<void>;
|
|
116
|
+
remove(key: string): Promise<void>;
|
|
117
|
+
describe(blob: Blob): Promise<{
|
|
118
|
+
sha256: string;
|
|
119
|
+
width: number;
|
|
120
|
+
height: number;
|
|
121
|
+
}>;
|
|
122
|
+
/** Resolve a frozen identity without relying on mutable UI draft metadata. */
|
|
123
|
+
resolveReference?(identity: WorkspaceAssetIdentity, signal?: AbortSignal): Promise<WorkspaceAssetReference>;
|
|
124
|
+
readReference?(reference: WorkspaceAssetReference, signal?: AbortSignal): Promise<Blob>;
|
|
125
|
+
/** Explicit host-owned external IO. Frozen versions require an expected hash. */
|
|
126
|
+
readExternal?(source: WorkspaceExternalSource, signal?: AbortSignal): Promise<Blob>;
|
|
127
|
+
};
|
|
128
|
+
execution?: {
|
|
129
|
+
local?: Readonly<Record<string, WorkspaceLocalCapability>>;
|
|
130
|
+
remote?: WorkspaceRemoteExecution;
|
|
131
|
+
};
|
|
132
|
+
persistence: {
|
|
133
|
+
load(page?: {
|
|
134
|
+
batchId?: string;
|
|
135
|
+
}): Promise<unknown>;
|
|
136
|
+
save(snapshot: unknown): Promise<void>;
|
|
137
|
+
loadBatch?(batchId: string): Promise<unknown>;
|
|
138
|
+
list?(): Promise<unknown[]>;
|
|
139
|
+
removeBatch?(batchId: string): Promise<void>;
|
|
140
|
+
};
|
|
141
|
+
metadata: {
|
|
142
|
+
createExecutor(): MetadataExecutor;
|
|
143
|
+
};
|
|
144
|
+
download?(file: WorkspaceFile): Promise<void> | void;
|
|
145
|
+
}
|
|
146
|
+
export type WorkspaceCommand = {
|
|
147
|
+
type: 'updateConfig';
|
|
148
|
+
config: WorkspaceConfig;
|
|
149
|
+
display?: WorkspaceDisplay;
|
|
150
|
+
} | {
|
|
151
|
+
type: 'updateContext';
|
|
152
|
+
adapter: BatchWorkspaceAdapter;
|
|
153
|
+
revision: string;
|
|
154
|
+
display?: WorkspaceDisplay;
|
|
155
|
+
} | {
|
|
156
|
+
type: 'newBatch';
|
|
157
|
+
} | {
|
|
158
|
+
type: 'openBatch';
|
|
159
|
+
batchId: string;
|
|
160
|
+
} | {
|
|
161
|
+
type: 'restoreVersion';
|
|
162
|
+
itemId: string;
|
|
163
|
+
versionId: string;
|
|
164
|
+
} | {
|
|
165
|
+
type: 'resetDraft';
|
|
166
|
+
toolId: string;
|
|
167
|
+
entryId?: string;
|
|
168
|
+
} | {
|
|
169
|
+
type: 'runTool';
|
|
170
|
+
toolId: string;
|
|
171
|
+
params: Readonly<Record<string, unknown>>;
|
|
172
|
+
} | {
|
|
173
|
+
type: 'cancelAttempt';
|
|
174
|
+
attemptId: string;
|
|
175
|
+
} | {
|
|
176
|
+
type: 'queryAttempt' | 'stopWaiting' | 'resumeWaiting' | 'cancelRemote';
|
|
177
|
+
attemptId: string;
|
|
178
|
+
} | {
|
|
179
|
+
type: 'importFiles';
|
|
180
|
+
files: File[];
|
|
181
|
+
} | {
|
|
182
|
+
type: 'openTool';
|
|
183
|
+
toolId: string;
|
|
184
|
+
entryId?: string;
|
|
185
|
+
} | {
|
|
186
|
+
type: 'runMetadataCleanup';
|
|
187
|
+
removeTime?: boolean;
|
|
188
|
+
removeAuthorComments?: boolean;
|
|
189
|
+
} | {
|
|
190
|
+
type: 'select';
|
|
191
|
+
itemIds: string[];
|
|
192
|
+
} | {
|
|
193
|
+
type: 'exportCurrent';
|
|
194
|
+
itemIds?: string[];
|
|
195
|
+
};
|
|
196
|
+
export type WorkspaceCommandResult = {
|
|
197
|
+
status: 'completed';
|
|
198
|
+
operationId?: string;
|
|
199
|
+
files?: readonly WorkspaceFile[];
|
|
200
|
+
} | {
|
|
201
|
+
status: 'rejected';
|
|
202
|
+
code: string;
|
|
203
|
+
message: string;
|
|
204
|
+
};
|
|
205
|
+
export interface WorkspaceSnapshot {
|
|
206
|
+
readonly schemaVersion: 1;
|
|
207
|
+
readonly context: Readonly<{
|
|
208
|
+
namespace: string;
|
|
209
|
+
revision: string;
|
|
210
|
+
}>;
|
|
211
|
+
readonly writable: boolean;
|
|
212
|
+
readonly ready: boolean;
|
|
213
|
+
readonly batchId: string;
|
|
214
|
+
readonly selectedIds: readonly string[];
|
|
215
|
+
readonly items: readonly {
|
|
216
|
+
readonly id: string;
|
|
217
|
+
readonly name: string;
|
|
218
|
+
readonly currentVersionId: string;
|
|
219
|
+
readonly versions: readonly {
|
|
220
|
+
readonly id: string;
|
|
221
|
+
readonly sha256?: string;
|
|
222
|
+
readonly parentVersionId?: string;
|
|
223
|
+
}[];
|
|
224
|
+
}[];
|
|
225
|
+
readonly attempts: readonly {
|
|
226
|
+
readonly id: string;
|
|
227
|
+
readonly clientRequestId: string;
|
|
228
|
+
readonly operationId: string;
|
|
229
|
+
readonly itemId: string;
|
|
230
|
+
readonly taskId?: string;
|
|
231
|
+
readonly inputVersionId?: string;
|
|
232
|
+
readonly status: string;
|
|
233
|
+
readonly statusVersion: number;
|
|
234
|
+
readonly outcome?: Readonly<Omit<WorkspaceRemoteResultDetails, 'disclosure'>> & {
|
|
235
|
+
readonly disclosure?: Readonly<WorkspaceDisclosure> | null;
|
|
236
|
+
};
|
|
237
|
+
readonly admission?: 'accepted' | 'not_accepted' | 'unknown';
|
|
238
|
+
readonly remoteExecutionStatus?: string;
|
|
239
|
+
readonly publicationStatus?: 'pending' | 'unknown' | 'published';
|
|
240
|
+
readonly waitingStopped?: boolean;
|
|
241
|
+
readonly applied?: boolean;
|
|
242
|
+
readonly error?: string;
|
|
243
|
+
}[];
|
|
244
|
+
readonly operations: readonly {
|
|
245
|
+
readonly id: string;
|
|
246
|
+
readonly toolId: string;
|
|
247
|
+
readonly toolVersion: string;
|
|
248
|
+
readonly params: Readonly<Record<string, unknown>>;
|
|
249
|
+
}[];
|
|
250
|
+
}
|
|
251
|
+
export interface WorkspaceEvent {
|
|
252
|
+
readonly type: 'ready' | 'changed' | 'disposed' | 'error';
|
|
253
|
+
readonly snapshot: WorkspaceSnapshot;
|
|
254
|
+
readonly message?: string;
|
|
255
|
+
}
|
|
256
|
+
export interface BatchWorkspaceHandle {
|
|
257
|
+
command(command: WorkspaceCommand): Promise<WorkspaceCommandResult>;
|
|
258
|
+
snapshot(): WorkspaceSnapshot;
|
|
259
|
+
subscribe(listener: (event: WorkspaceEvent) => void): () => void;
|
|
260
|
+
dispose(): Promise<void>;
|
|
261
|
+
}
|
|
262
|
+
export interface BatchWorkspaceProps {
|
|
263
|
+
adapter: BatchWorkspaceAdapter;
|
|
264
|
+
config?: WorkspaceConfig;
|
|
265
|
+
display?: WorkspaceDisplay;
|
|
266
|
+
revision?: string;
|
|
267
|
+
onEvent?: (event: WorkspaceEvent) => void;
|
|
268
|
+
}
|
|
269
|
+
export interface WorkspaceDisplay {
|
|
270
|
+
locale?: 'en' | 'zh-CN' | 'ja' | 'ko' | 'ar' | 'es' | 'fr' | 'de';
|
|
271
|
+
theme?: 'light' | 'dark' | 'system';
|
|
272
|
+
}
|