@vcp-dev/contracts 0.9.3 → 0.9.5

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.
@@ -22,6 +22,7 @@ export declare const SnapshotIdSchema: z.ZodUUID;
22
22
  export declare const SiteVersionIdSchema: z.ZodUUID;
23
23
  export declare const AgentRunIdSchema: z.ZodUUID;
24
24
  export declare const AgentEventIdSchema: z.ZodUUID;
25
+ export declare const AgentThreadIdSchema: z.ZodUUID;
25
26
  export declare const SandboxSessionIdSchema: z.ZodUUID;
26
27
  export declare const DeploymentIdSchema: z.ZodUUID;
27
28
  export declare const DeploymentJobIdSchema: z.ZodUUID;
@@ -100,6 +100,81 @@ export declare const UploadMediaLibraryAssetResponseSchema: z.ZodObject<{
100
100
  }, z.core.$strip>;
101
101
  }, z.core.$strip>;
102
102
  export type UploadMediaLibraryAssetResponse = z.infer<typeof UploadMediaLibraryAssetResponseSchema>;
103
+ export declare const AI_IMAGE_GENERATION_MAX_QUANTITY = 4;
104
+ export declare const AI_IMAGE_GENERATION_ENTITLEMENT = "site.image_generation.max";
105
+ export declare const AiImageGenerationPrecheckRequestSchema: z.ZodObject<{
106
+ quantity: z.ZodNumber;
107
+ }, z.core.$strip>;
108
+ export type AiImageGenerationPrecheckRequest = z.infer<typeof AiImageGenerationPrecheckRequestSchema>;
109
+ export declare const AiImageGenerationQuotaSchema: z.ZodObject<{
110
+ available: z.ZodBoolean;
111
+ remaining: z.ZodNullable<z.ZodNumber>;
112
+ unlimited: z.ZodBoolean;
113
+ max_quantity: z.ZodNumber;
114
+ }, z.core.$strip>;
115
+ export type AiImageGenerationQuota = z.infer<typeof AiImageGenerationQuotaSchema>;
116
+ export declare const AiImageGenerationPrecheckResponseSchema: z.ZodObject<{
117
+ code: z.ZodLiteral<0>;
118
+ message: z.ZodString;
119
+ data: z.ZodObject<{
120
+ available: z.ZodBoolean;
121
+ remaining: z.ZodNullable<z.ZodNumber>;
122
+ unlimited: z.ZodBoolean;
123
+ max_quantity: z.ZodNumber;
124
+ }, z.core.$strip>;
125
+ }, z.core.$strip>;
126
+ export type AiImageGenerationPrecheckResponse = z.infer<typeof AiImageGenerationPrecheckResponseSchema>;
127
+ export declare const GenerateAiImagesRequestSchema: z.ZodObject<{
128
+ prompt: z.ZodString;
129
+ quantity: z.ZodNumber;
130
+ }, z.core.$strip>;
131
+ export type GenerateAiImagesRequest = z.infer<typeof GenerateAiImagesRequestSchema>;
132
+ export declare const GeneratedAiImageResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
133
+ index: z.ZodNumber;
134
+ ok: z.ZodLiteral<true>;
135
+ url: z.ZodURL;
136
+ request_id: z.ZodString;
137
+ }, z.core.$strip>, z.ZodObject<{
138
+ index: z.ZodNumber;
139
+ ok: z.ZodLiteral<false>;
140
+ error: z.ZodEnum<{
141
+ quota: "quota";
142
+ generate: "generate";
143
+ network: "network";
144
+ }>;
145
+ message: z.ZodString;
146
+ request_id: z.ZodNullable<z.ZodString>;
147
+ }, z.core.$strip>], "ok">;
148
+ export type GeneratedAiImageResult = z.infer<typeof GeneratedAiImageResultSchema>;
149
+ export declare const GenerateAiImagesResponseSchema: z.ZodObject<{
150
+ code: z.ZodLiteral<0>;
151
+ message: z.ZodString;
152
+ data: z.ZodObject<{
153
+ quota: z.ZodObject<{
154
+ available: z.ZodBoolean;
155
+ remaining: z.ZodNullable<z.ZodNumber>;
156
+ unlimited: z.ZodBoolean;
157
+ max_quantity: z.ZodNumber;
158
+ }, z.core.$strip>;
159
+ items: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
160
+ index: z.ZodNumber;
161
+ ok: z.ZodLiteral<true>;
162
+ url: z.ZodURL;
163
+ request_id: z.ZodString;
164
+ }, z.core.$strip>, z.ZodObject<{
165
+ index: z.ZodNumber;
166
+ ok: z.ZodLiteral<false>;
167
+ error: z.ZodEnum<{
168
+ quota: "quota";
169
+ generate: "generate";
170
+ network: "network";
171
+ }>;
172
+ message: z.ZodString;
173
+ request_id: z.ZodNullable<z.ZodString>;
174
+ }, z.core.$strip>], "ok">>;
175
+ }, z.core.$strip>;
176
+ }, z.core.$strip>;
177
+ export type GenerateAiImagesResponse = z.infer<typeof GenerateAiImagesResponseSchema>;
103
178
  export declare const UnsplashMediaAssetSchema: z.ZodObject<{
104
179
  provider_id: z.ZodString;
105
180
  url: z.ZodString;
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * 主站被名下子站挡住时的两个 409 错误码。
4
+ *
5
+ * 删除不做级联、一次只删一个站(方案 §6.1):主站名下还有子站时,主站既不能
6
+ * 归档也不能彻底删除,用户必须先把子站逐个删完。两个码的判定范围**刻意不同**:
7
+ *
8
+ * - `SITE_HAS_ACTIVE_SUBSITES`(归档):只看未归档子站。归档一个还有活动子站的
9
+ * 主站,会留下「父站已从列表消失、子站仍挂在该路径上」的孤儿态。
10
+ * - `SITE_HAS_SUBSITES`(VCP 本地彻底删除,planned):看**全部**子站行,含已归档的。
11
+ * 该能力由云平台编排、VCP 只做本地清理(ADR-0022),入口尚未确定,**不要**据此
12
+ * 假设 VCP 会有一个 purge 路由。
13
+ * 这不是口径不一致,而是 FK 的硬结果——`sites.parent_site_id` 自引用外键是
14
+ * `no action`,只要还有一行归档子站指着主站,删主站行就会撞 FK 违例。
15
+ */
16
+ export declare const SITE_HAS_ACTIVE_SUBSITES_ERROR_CODE: "SITE_HAS_ACTIVE_SUBSITES";
17
+ export declare const SITE_HAS_SUBSITES_ERROR_CODE: "SITE_HAS_SUBSITES";
18
+ /**
19
+ * 阻塞项的单条形态。**必须带 `name` 与 `mount_path`**:只回 site_id 的话,
20
+ * 用户读到的仍然是一句「删不了」,不知道该先去删哪个站。
21
+ */
22
+ export declare const BlockingSubsiteSchema: z.ZodObject<{
23
+ site_id: z.ZodUUID;
24
+ name: z.ZodString;
25
+ mount_path: z.ZodString;
26
+ archived_at: z.ZodNullable<z.ZodString>;
27
+ }, z.core.$strip>;
28
+ export type BlockingSubsite = z.infer<typeof BlockingSubsiteSchema>;
29
+ /** 两个错误码共用的 `error.details` 形状。 */
30
+ export declare const SiteDeletionBlockedDetailsSchema: z.ZodObject<{
31
+ subsites: z.ZodArray<z.ZodObject<{
32
+ site_id: z.ZodUUID;
33
+ name: z.ZodString;
34
+ mount_path: z.ZodString;
35
+ archived_at: z.ZodNullable<z.ZodString>;
36
+ }, z.core.$strip>>;
37
+ }, z.core.$strip>;
38
+ export type SiteDeletionBlockedDetails = z.infer<typeof SiteDeletionBlockedDetailsSchema>;
@@ -215,5 +215,11 @@ export type SiteEditSourceLocation = z.infer<typeof SiteEditSourceLocationSchema
215
215
  export declare function isSiteEditSourcePath(path: string): boolean;
216
216
  export declare function isSiteEditTextSourcePath(path: string): boolean;
217
217
  export declare function isSiteEditSourceDirectoryPath(path: string): boolean;
218
+ /**
219
+ * 站点设计说明文档(根级 `design.md` / `DESIGN.md`)。它由后端从 DesignPlan
220
+ * 确定性物化,不是用户手写的源码:既受删除保护,也不在工作台代码 tab 的
221
+ * 源码树里暴露。
222
+ */
223
+ export declare function isSiteEditDesignDocumentPath(path: string): boolean;
218
224
  export declare function getSiteEditSourceDeleteProtectionReason(path: string): SiteEditSourceDeleteProtectionReason | null;
219
225
  export declare function isSiteEditSourceDeleteProtectedPath(path: string): boolean;
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * 由 release-edit-engine-packages.ts 在 bump 版本时自动更新。
7
7
  */
8
- export declare const CURRENT_EDIT_ENGINE_VERSION = "0.9.3";
8
+ export declare const CURRENT_EDIT_ENGINE_VERSION = "0.9.5";
9
9
  export declare const EDIT_ENGINE_VERSION_HEADER = "x-vcp-edit-engine-version";
10
10
  export declare const EDIT_ENGINE_VERSION_SOURCE_HEADER = "x-vcp-edit-engine-version-source";
11
11
  export type EditEngineVersionSource = "explicit" | "fallback_current" | "system_current";
@@ -28,6 +28,13 @@ export declare const CheckSitePublishDomainDataSchema: z.ZodObject<{
28
28
  pending: "pending";
29
29
  running: "running";
30
30
  }>;
31
+ repair_task_code: z.ZodNullable<z.ZodString>;
32
+ repair_task_status: z.ZodEnum<{
33
+ failed: "failed";
34
+ succeeded: "succeeded";
35
+ pending: "pending";
36
+ running: "running";
37
+ }>;
31
38
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
32
39
  domain_hostname: z.ZodNullable<z.ZodString>;
33
40
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -142,6 +149,13 @@ export declare const CheckSitePublishDomainResponseSchema: z.ZodObject<{
142
149
  pending: "pending";
143
150
  running: "running";
144
151
  }>;
152
+ repair_task_code: z.ZodNullable<z.ZodString>;
153
+ repair_task_status: z.ZodEnum<{
154
+ failed: "failed";
155
+ succeeded: "succeeded";
156
+ pending: "pending";
157
+ running: "running";
158
+ }>;
145
159
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
146
160
  domain_hostname: z.ZodNullable<z.ZodString>;
147
161
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -260,6 +274,13 @@ export declare const ConfirmSitePublishDomainRemediationDataSchema: z.ZodObject<
260
274
  pending: "pending";
261
275
  running: "running";
262
276
  }>;
277
+ repair_task_code: z.ZodNullable<z.ZodString>;
278
+ repair_task_status: z.ZodEnum<{
279
+ failed: "failed";
280
+ succeeded: "succeeded";
281
+ pending: "pending";
282
+ running: "running";
283
+ }>;
263
284
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
264
285
  domain_hostname: z.ZodNullable<z.ZodString>;
265
286
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -374,6 +395,13 @@ export declare const ConfirmSitePublishDomainRemediationResponseSchema: z.ZodObj
374
395
  pending: "pending";
375
396
  running: "running";
376
397
  }>;
398
+ repair_task_code: z.ZodNullable<z.ZodString>;
399
+ repair_task_status: z.ZodEnum<{
400
+ failed: "failed";
401
+ succeeded: "succeeded";
402
+ pending: "pending";
403
+ running: "running";
404
+ }>;
377
405
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
378
406
  domain_hostname: z.ZodNullable<z.ZodString>;
379
407
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -488,6 +516,13 @@ export declare const GetSitePublishDomainOperationDataSchema: z.ZodObject<{
488
516
  pending: "pending";
489
517
  running: "running";
490
518
  }>;
519
+ repair_task_code: z.ZodNullable<z.ZodString>;
520
+ repair_task_status: z.ZodEnum<{
521
+ failed: "failed";
522
+ succeeded: "succeeded";
523
+ pending: "pending";
524
+ running: "running";
525
+ }>;
491
526
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
492
527
  domain_hostname: z.ZodNullable<z.ZodString>;
493
528
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -602,6 +637,13 @@ export declare const GetSitePublishDomainOperationResponseSchema: z.ZodObject<{
602
637
  pending: "pending";
603
638
  running: "running";
604
639
  }>;
640
+ repair_task_code: z.ZodNullable<z.ZodString>;
641
+ repair_task_status: z.ZodEnum<{
642
+ failed: "failed";
643
+ succeeded: "succeeded";
644
+ pending: "pending";
645
+ running: "running";
646
+ }>;
605
647
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
606
648
  domain_hostname: z.ZodNullable<z.ZodString>;
607
649
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -717,6 +759,13 @@ export declare const ReconcileSitePublishDomainOperationDataSchema: z.ZodObject<
717
759
  pending: "pending";
718
760
  running: "running";
719
761
  }>;
762
+ repair_task_code: z.ZodNullable<z.ZodString>;
763
+ repair_task_status: z.ZodEnum<{
764
+ failed: "failed";
765
+ succeeded: "succeeded";
766
+ pending: "pending";
767
+ running: "running";
768
+ }>;
720
769
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
721
770
  domain_hostname: z.ZodNullable<z.ZodString>;
722
771
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -831,6 +880,13 @@ export declare const ReconcileSitePublishDomainOperationResponseSchema: z.ZodObj
831
880
  pending: "pending";
832
881
  running: "running";
833
882
  }>;
883
+ repair_task_code: z.ZodNullable<z.ZodString>;
884
+ repair_task_status: z.ZodEnum<{
885
+ failed: "failed";
886
+ succeeded: "succeeded";
887
+ pending: "pending";
888
+ running: "running";
889
+ }>;
834
890
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
835
891
  domain_hostname: z.ZodNullable<z.ZodString>;
836
892
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -1036,6 +1092,13 @@ export declare const SitePublishDomainCheckDataSchema: z.ZodObject<{
1036
1092
  pending: "pending";
1037
1093
  running: "running";
1038
1094
  }>;
1095
+ repair_task_code: z.ZodNullable<z.ZodString>;
1096
+ repair_task_status: z.ZodEnum<{
1097
+ failed: "failed";
1098
+ succeeded: "succeeded";
1099
+ pending: "pending";
1100
+ running: "running";
1101
+ }>;
1039
1102
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
1040
1103
  domain_hostname: z.ZodNullable<z.ZodString>;
1041
1104
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -1150,6 +1213,13 @@ export declare const SitePublishDomainCheckResponseSchema: z.ZodObject<{
1150
1213
  pending: "pending";
1151
1214
  running: "running";
1152
1215
  }>;
1216
+ repair_task_code: z.ZodNullable<z.ZodString>;
1217
+ repair_task_status: z.ZodEnum<{
1218
+ failed: "failed";
1219
+ succeeded: "succeeded";
1220
+ pending: "pending";
1221
+ running: "running";
1222
+ }>;
1153
1223
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
1154
1224
  domain_hostname: z.ZodNullable<z.ZodString>;
1155
1225
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -1264,6 +1334,13 @@ export declare const SitePublishDomainOperationDataSchema: z.ZodObject<{
1264
1334
  pending: "pending";
1265
1335
  running: "running";
1266
1336
  }>;
1337
+ repair_task_code: z.ZodNullable<z.ZodString>;
1338
+ repair_task_status: z.ZodEnum<{
1339
+ failed: "failed";
1340
+ succeeded: "succeeded";
1341
+ pending: "pending";
1342
+ running: "running";
1343
+ }>;
1267
1344
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
1268
1345
  domain_hostname: z.ZodNullable<z.ZodString>;
1269
1346
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -1378,6 +1455,13 @@ export declare const SitePublishDomainOperationResponseSchema: z.ZodObject<{
1378
1455
  pending: "pending";
1379
1456
  running: "running";
1380
1457
  }>;
1458
+ repair_task_code: z.ZodNullable<z.ZodString>;
1459
+ repair_task_status: z.ZodEnum<{
1460
+ failed: "failed";
1461
+ succeeded: "succeeded";
1462
+ pending: "pending";
1463
+ running: "running";
1464
+ }>;
1381
1465
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
1382
1466
  domain_hostname: z.ZodNullable<z.ZodString>;
1383
1467
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -1494,6 +1578,13 @@ export declare const SitePublishDomainReconcileOperationResponseSchema: z.ZodObj
1494
1578
  pending: "pending";
1495
1579
  running: "running";
1496
1580
  }>;
1581
+ repair_task_code: z.ZodNullable<z.ZodString>;
1582
+ repair_task_status: z.ZodEnum<{
1583
+ failed: "failed";
1584
+ succeeded: "succeeded";
1585
+ pending: "pending";
1586
+ running: "running";
1587
+ }>;
1497
1588
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
1498
1589
  domain_hostname: z.ZodNullable<z.ZodString>;
1499
1590
  domain_operation_type: z.ZodNullable<z.ZodEnum<{
@@ -1614,6 +1705,13 @@ export declare const SitePublishDomainRemediationConfirmResponseSchema: z.ZodObj
1614
1705
  pending: "pending";
1615
1706
  running: "running";
1616
1707
  }>;
1708
+ repair_task_code: z.ZodNullable<z.ZodString>;
1709
+ repair_task_status: z.ZodEnum<{
1710
+ failed: "failed";
1711
+ succeeded: "succeeded";
1712
+ pending: "pending";
1713
+ running: "running";
1714
+ }>;
1617
1715
  publish_deployment_id: z.ZodNullable<z.ZodUUID>;
1618
1716
  domain_hostname: z.ZodNullable<z.ZodString>;
1619
1717
  domain_operation_type: z.ZodNullable<z.ZodEnum<{