@vcp-dev/contracts 0.6.3 → 0.6.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.
@@ -26,13 +26,13 @@ export declare const FormFieldDeclSchema: z.ZodObject<{
26
26
  }, z.core.$strip>;
27
27
  export type FormFieldDecl = z.infer<typeof FormFieldDeclSchema>;
28
28
  export declare const ConnectFormInputSchema: z.ZodObject<{
29
- form_hint: z.ZodString;
30
29
  mode: z.ZodEnum<{
31
30
  bind_existing: "bind_existing";
32
31
  provision: "provision";
33
32
  }>;
34
- component_slug: z.ZodOptional<z.ZodString>;
33
+ form_hint: z.ZodOptional<z.ZodString>;
35
34
  name: z.ZodOptional<z.ZodString>;
35
+ component_slug: z.ZodOptional<z.ZodString>;
36
36
  description: z.ZodOptional<z.ZodString>;
37
37
  fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
38
  name: z.ZodString;
@@ -68,7 +68,7 @@ export type ConnectFormResult = {
68
68
  form_name: string;
69
69
  /** 读回落定的表单字段(提交 data 的键 = name)。 */
70
70
  fields: ResolvedFormField[];
71
- /** 表单来源页 id(提交必带;null=CMS 未回,提交会被 cms 以 unknown_source_page 拒)。 */
71
+ /** 历史表单来源页 id,仅用于旧生成站点兼容;当前提交按 url_path 解析真实页面。 */
72
72
  source_page_id: number | null;
73
73
  /** LLM 要写的表单 view 组件路径(必须 "use client")。 */
74
74
  form_view: string;
@@ -92,7 +92,7 @@ export type ConnectFormResult = {
92
92
  }
93
93
  /**
94
94
  * 幂等命中:该表单的 scaffold 已存在于 base snapshot(此前 run 绑定过),
95
- * 本次零写入。LLM 收到后下一步:按实时重算的 form_contract 写 form view,
95
+ * 本次会补建或升级确定性提交基建。LLM 收到后下一步:按实时重算的 form_contract 写 form view,
96
96
  * 绝不重建 existing_files、绝不手写提交链路(与 connect_dynamic_collection
97
97
  * 的 already_bound 同款)。
98
98
  */
@@ -102,13 +102,13 @@ export type ConnectFormResult = {
102
102
  form_name: string;
103
103
  /** 实时读回落定的表单字段(提交 data 的键 = name)。 */
104
104
  fields: ResolvedFormField[];
105
- /** 表单来源页 id(提交必带;null=CMS 未回)。 */
105
+ /** 历史表单来源页 id,仅用于旧生成站点兼容。 */
106
106
  source_page_id: number | null;
107
107
  /** LLM 要写的表单 view 组件路径(必须 "use client")。 */
108
108
  form_view: string;
109
109
  /** 实时重算(与 bound 同源派生),不读旧产物。 */
110
110
  form_contract: string;
111
- /** 已存在的 scaffold 路径(容器 + 站点级基建),绝不可重建(再 create 必撞 ALREADY_EXISTS)。 */
111
+ /** 工具返回时已在 working set scaffold 路径,绝不可重建。 */
112
112
  existing_files: string[];
113
113
  }
114
114
  /** CMS 基础设施暂不可达(网络/5xx/530 瞬断),非「表单不存在」——稍后重试,勿换名猜测。 */
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ export declare const INSERT_NEW_COMPONENT_CATEGORY_GROUP_KEY: "insertNewComponent";
3
+ export declare const DESIGNER_COMPONENT_LIBRARY_ERROR_CODES: {
4
+ readonly categoryGroupMissing: "DESIGNER_COMPONENT_CATEGORY_GROUP_MISSING";
5
+ readonly unavailable: "DESIGNER_COMPONENT_LIBRARY_UNAVAILABLE";
6
+ readonly timeout: "DESIGNER_COMPONENT_LIBRARY_TIMEOUT";
7
+ readonly invalidResponse: "DESIGNER_COMPONENT_LIBRARY_INVALID_RESPONSE";
8
+ };
9
+ export interface DesignerComponentCategoryNode {
10
+ readonly id: string;
11
+ readonly key: string;
12
+ readonly name: string;
13
+ readonly children: readonly DesignerComponentCategoryNode[];
14
+ }
15
+ export declare const DesignerComponentCategoryNodeSchema: z.ZodType<DesignerComponentCategoryNode>;
16
+ export declare const DesignerComponentCategoriesDataSchema: z.ZodObject<{
17
+ category_group_key: z.ZodLiteral<"insertNewComponent">;
18
+ categories: z.ZodArray<z.ZodType<DesignerComponentCategoryNode, unknown, z.core.$ZodTypeInternals<DesignerComponentCategoryNode, unknown>>>;
19
+ }, z.core.$strict>;
20
+ export declare const DesignerComponentCatalogItemSchema: z.ZodObject<{
21
+ resource_id: z.ZodString;
22
+ name: z.ZodString;
23
+ description: z.ZodNullable<z.ZodString>;
24
+ thumbnail_url: z.ZodNullable<z.ZodString>;
25
+ resolved_version: z.ZodString;
26
+ category_id: z.ZodNullable<z.ZodString>;
27
+ }, z.core.$strict>;
28
+ export declare const DesignerComponentsDataSchema: z.ZodObject<{
29
+ category_group_key: z.ZodLiteral<"insertNewComponent">;
30
+ items: z.ZodArray<z.ZodObject<{
31
+ resource_id: z.ZodString;
32
+ name: z.ZodString;
33
+ description: z.ZodNullable<z.ZodString>;
34
+ thumbnail_url: z.ZodNullable<z.ZodString>;
35
+ resolved_version: z.ZodString;
36
+ category_id: z.ZodNullable<z.ZodString>;
37
+ }, z.core.$strict>>;
38
+ next_cursor: z.ZodNullable<z.ZodString>;
39
+ }, z.core.$strict>;
40
+ export declare const ListDesignerComponentsQuerySchema: z.ZodObject<{
41
+ category_id: z.ZodOptional<z.ZodString>;
42
+ include_descendants: z.ZodPipe<z.ZodOptional<z.ZodEnum<{
43
+ true: "true";
44
+ false: "false";
45
+ }>>, z.ZodTransform<boolean, "true" | "false" | undefined>>;
46
+ limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
47
+ cursor: z.ZodOptional<z.ZodString>;
48
+ }, z.core.$strict>;
49
+ export type DesignerComponentCategoriesData = z.infer<typeof DesignerComponentCategoriesDataSchema>;
50
+ export type DesignerComponentCatalogItem = z.infer<typeof DesignerComponentCatalogItemSchema>;
51
+ export type DesignerComponentsData = z.infer<typeof DesignerComponentsDataSchema>;
52
+ export type ListDesignerComponentsQuery = z.infer<typeof ListDesignerComponentsQuerySchema>;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  export * from "./deployment-runtime.js";
3
+ export * from "./designer-component-library.js";
3
4
  export { PAGE_SLUG_PATTERN, PAGE_SLUG_SEGMENT_PATTERN_SOURCE, canonicalizePageSlug, isCanonicalPageSlug, pageSlugToRouteFilePath, tryCanonicalizeAsciiPageSlug, } from "./page-slug.js";
4
5
  export * from "./site-edit-capability.js";
5
6
  export * from "./site-edit-class-name-source.js";
@@ -977,6 +978,32 @@ export declare const ApiResponseSchema: <T extends z.ZodTypeAny>(dataSchema: T)
977
978
  data: T;
978
979
  message: z.ZodString;
979
980
  }, z.core.$strip>;
981
+ export declare const ListDesignerComponentCategoriesResponseSchema: z.ZodObject<{
982
+ code: z.ZodNumber;
983
+ data: z.ZodObject<{
984
+ category_group_key: z.ZodLiteral<"insertNewComponent">;
985
+ categories: z.ZodArray<z.ZodType<import("./designer-component-library.js").DesignerComponentCategoryNode, unknown, z.core.$ZodTypeInternals<import("./designer-component-library.js").DesignerComponentCategoryNode, unknown>>>;
986
+ }, z.core.$strict>;
987
+ message: z.ZodString;
988
+ }, z.core.$strip>;
989
+ export type ListDesignerComponentCategoriesResponse = z.infer<typeof ListDesignerComponentCategoriesResponseSchema>;
990
+ export declare const ListDesignerComponentsResponseSchema: z.ZodObject<{
991
+ code: z.ZodNumber;
992
+ data: z.ZodObject<{
993
+ category_group_key: z.ZodLiteral<"insertNewComponent">;
994
+ items: z.ZodArray<z.ZodObject<{
995
+ resource_id: z.ZodString;
996
+ name: z.ZodString;
997
+ description: z.ZodNullable<z.ZodString>;
998
+ thumbnail_url: z.ZodNullable<z.ZodString>;
999
+ resolved_version: z.ZodString;
1000
+ category_id: z.ZodNullable<z.ZodString>;
1001
+ }, z.core.$strict>>;
1002
+ next_cursor: z.ZodNullable<z.ZodString>;
1003
+ }, z.core.$strict>;
1004
+ message: z.ZodString;
1005
+ }, z.core.$strip>;
1006
+ export type ListDesignerComponentsResponse = z.infer<typeof ListDesignerComponentsResponseSchema>;
980
1007
  export declare const ExternalSyncSiteResponseSchema: z.ZodObject<{
981
1008
  code: z.ZodNumber;
982
1009
  data: z.ZodObject<{
@@ -7153,6 +7180,7 @@ export declare const AgentEventTypeSchema: z.ZodEnum<{
7153
7180
  "workspace.design_plan.outcome": "workspace.design_plan.outcome";
7154
7181
  "workspace.suggestions": "workspace.suggestions";
7155
7182
  "file.changed": "file.changed";
7183
+ "snapshot.finalized": "snapshot.finalized";
7156
7184
  "preview.preparing": "preview.preparing";
7157
7185
  "preview.ready": "preview.ready";
7158
7186
  "preview.build.started": "preview.build.started";
@@ -8079,6 +8107,10 @@ export declare const AgentEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8079
8107
  snapshot_id: z.ZodString;
8080
8108
  manifest_hash: z.ZodString;
8081
8109
  at: z.ZodString;
8110
+ }, z.core.$strip>, z.ZodObject<{
8111
+ type: z.ZodLiteral<"snapshot.finalized">;
8112
+ snapshot_id: z.ZodString;
8113
+ at: z.ZodString;
8082
8114
  }, z.core.$strip>, z.ZodObject<{
8083
8115
  type: z.ZodLiteral<"preview.preparing">;
8084
8116
  at: z.ZodString;
@@ -8246,6 +8278,7 @@ export declare const AgentEventRecordSchema: z.ZodObject<{
8246
8278
  "workspace.design_plan.outcome": "workspace.design_plan.outcome";
8247
8279
  "workspace.suggestions": "workspace.suggestions";
8248
8280
  "file.changed": "file.changed";
8281
+ "snapshot.finalized": "snapshot.finalized";
8249
8282
  "preview.preparing": "preview.preparing";
8250
8283
  "preview.ready": "preview.ready";
8251
8284
  "preview.build.started": "preview.build.started";
@@ -8792,6 +8825,10 @@ export declare const AgentEventRecordSchema: z.ZodObject<{
8792
8825
  snapshot_id: z.ZodString;
8793
8826
  manifest_hash: z.ZodString;
8794
8827
  at: z.ZodString;
8828
+ }, z.core.$strip>, z.ZodObject<{
8829
+ type: z.ZodLiteral<"snapshot.finalized">;
8830
+ snapshot_id: z.ZodString;
8831
+ at: z.ZodString;
8795
8832
  }, z.core.$strip>, z.ZodObject<{
8796
8833
  type: z.ZodLiteral<"preview.preparing">;
8797
8834
  at: z.ZodString;
@@ -8956,6 +8993,7 @@ export declare const AppendAgentEventRequestSchema: z.ZodObject<{
8956
8993
  "workspace.design_plan.outcome": "workspace.design_plan.outcome";
8957
8994
  "workspace.suggestions": "workspace.suggestions";
8958
8995
  "file.changed": "file.changed";
8996
+ "snapshot.finalized": "snapshot.finalized";
8959
8997
  "preview.preparing": "preview.preparing";
8960
8998
  "preview.ready": "preview.ready";
8961
8999
  "preview.build.started": "preview.build.started";
@@ -9502,6 +9540,10 @@ export declare const AppendAgentEventRequestSchema: z.ZodObject<{
9502
9540
  snapshot_id: z.ZodString;
9503
9541
  manifest_hash: z.ZodString;
9504
9542
  at: z.ZodString;
9543
+ }, z.core.$strip>, z.ZodObject<{
9544
+ type: z.ZodLiteral<"snapshot.finalized">;
9545
+ snapshot_id: z.ZodString;
9546
+ at: z.ZodString;
9505
9547
  }, z.core.$strip>, z.ZodObject<{
9506
9548
  type: z.ZodLiteral<"preview.preparing">;
9507
9549
  at: z.ZodString;
@@ -9705,6 +9747,7 @@ export declare const AppendAgentEventResponseSchema: z.ZodDiscriminatedUnion<[z.
9705
9747
  "workspace.design_plan.outcome": "workspace.design_plan.outcome";
9706
9748
  "workspace.suggestions": "workspace.suggestions";
9707
9749
  "file.changed": "file.changed";
9750
+ "snapshot.finalized": "snapshot.finalized";
9708
9751
  "preview.preparing": "preview.preparing";
9709
9752
  "preview.ready": "preview.ready";
9710
9753
  "preview.build.started": "preview.build.started";
@@ -10251,6 +10294,10 @@ export declare const AppendAgentEventResponseSchema: z.ZodDiscriminatedUnion<[z.
10251
10294
  snapshot_id: z.ZodString;
10252
10295
  manifest_hash: z.ZodString;
10253
10296
  at: z.ZodString;
10297
+ }, z.core.$strip>, z.ZodObject<{
10298
+ type: z.ZodLiteral<"snapshot.finalized">;
10299
+ snapshot_id: z.ZodString;
10300
+ at: z.ZodString;
10254
10301
  }, z.core.$strip>, z.ZodObject<{
10255
10302
  type: z.ZodLiteral<"preview.preparing">;
10256
10303
  at: z.ZodString;
@@ -10455,6 +10502,7 @@ export declare const AppendAgentEventResponseSchema: z.ZodDiscriminatedUnion<[z.
10455
10502
  "workspace.design_plan.outcome": "workspace.design_plan.outcome";
10456
10503
  "workspace.suggestions": "workspace.suggestions";
10457
10504
  "file.changed": "file.changed";
10505
+ "snapshot.finalized": "snapshot.finalized";
10458
10506
  "preview.preparing": "preview.preparing";
10459
10507
  "preview.ready": "preview.ready";
10460
10508
  "preview.build.started": "preview.build.started";
@@ -11001,6 +11049,10 @@ export declare const AppendAgentEventResponseSchema: z.ZodDiscriminatedUnion<[z.
11001
11049
  snapshot_id: z.ZodString;
11002
11050
  manifest_hash: z.ZodString;
11003
11051
  at: z.ZodString;
11052
+ }, z.core.$strip>, z.ZodObject<{
11053
+ type: z.ZodLiteral<"snapshot.finalized">;
11054
+ snapshot_id: z.ZodString;
11055
+ at: z.ZodString;
11004
11056
  }, z.core.$strip>, z.ZodObject<{
11005
11057
  type: z.ZodLiteral<"preview.preparing">;
11006
11058
  at: z.ZodString;
@@ -11173,6 +11225,7 @@ export declare const ListAgentEventsResponseSchema: z.ZodObject<{
11173
11225
  "workspace.design_plan.outcome": "workspace.design_plan.outcome";
11174
11226
  "workspace.suggestions": "workspace.suggestions";
11175
11227
  "file.changed": "file.changed";
11228
+ "snapshot.finalized": "snapshot.finalized";
11176
11229
  "preview.preparing": "preview.preparing";
11177
11230
  "preview.ready": "preview.ready";
11178
11231
  "preview.build.started": "preview.build.started";
@@ -11719,6 +11772,10 @@ export declare const ListAgentEventsResponseSchema: z.ZodObject<{
11719
11772
  snapshot_id: z.ZodString;
11720
11773
  manifest_hash: z.ZodString;
11721
11774
  at: z.ZodString;
11775
+ }, z.core.$strip>, z.ZodObject<{
11776
+ type: z.ZodLiteral<"snapshot.finalized">;
11777
+ snapshot_id: z.ZodString;
11778
+ at: z.ZodString;
11722
11779
  }, z.core.$strip>, z.ZodObject<{
11723
11780
  type: z.ZodLiteral<"preview.preparing">;
11724
11781
  at: z.ZodString;
@@ -11926,6 +11983,23 @@ export declare const REST_API_ENDPOINTS: readonly [{
11926
11983
  readonly summary: "Get one tenant-scoped site.";
11927
11984
  readonly status: "implemented";
11928
11985
  readonly response_schema: "SiteRecordSchema";
11986
+ }, {
11987
+ readonly method: "GET";
11988
+ readonly path: "/sites/:site_id/designer/component-library/categories";
11989
+ readonly tag: "designer-component-library";
11990
+ readonly summary: "List the fixed insert-new-component category tree for a site.";
11991
+ readonly status: "implemented";
11992
+ readonly response_schema: "ListDesignerComponentCategoriesResponseSchema";
11993
+ readonly notes: readonly ["The server validates site ownership and fixes category_group_key to insertNewComponent."];
11994
+ }, {
11995
+ readonly method: "GET";
11996
+ readonly path: "/sites/:site_id/designer/component-library/resources";
11997
+ readonly tag: "designer-component-library";
11998
+ readonly summary: "List component resources from the fixed designer catalog group.";
11999
+ readonly status: "implemented";
12000
+ readonly query_schema: "ListDesignerComponentsQuerySchema";
12001
+ readonly response_schema: "ListDesignerComponentsResponseSchema";
12002
+ readonly notes: readonly ["The server fixes resource type to component and does not expose resource-platform secrets, internal hosts, or product-line selection."];
11929
12003
  }, {
11930
12004
  readonly method: "PATCH";
11931
12005
  readonly path: "/sites/:site_id";
@@ -12716,6 +12790,7 @@ export declare const WorkspaceWebSocketMessageTypeSchema: z.ZodEnum<{
12716
12790
  "server.patch.applied": "server.patch.applied";
12717
12791
  "server.sitemap.updated": "server.sitemap.updated";
12718
12792
  "server.snapshot.created": "server.snapshot.created";
12793
+ "server.snapshot.finalized": "server.snapshot.finalized";
12719
12794
  "server.preview.invalidated": "server.preview.invalidated";
12720
12795
  "server.run.finished": "server.run.finished";
12721
12796
  "server.run.failed": "server.run.failed";
@@ -13276,6 +13351,18 @@ export declare const WorkspaceServerMessageSchema: z.ZodDiscriminatedUnion<[z.Zo
13276
13351
  snapshot_id: z.ZodString;
13277
13352
  manifest_hash: z.ZodString;
13278
13353
  }, z.core.$strip>;
13354
+ }, z.core.$strip>, z.ZodObject<{
13355
+ id: z.ZodString;
13356
+ tenant_id: z.ZodString;
13357
+ site_id: z.ZodString;
13358
+ run_id: z.ZodOptional<z.ZodString>;
13359
+ correlation_id: z.ZodOptional<z.ZodString>;
13360
+ seq: z.ZodOptional<z.ZodNumber>;
13361
+ sent_at: z.ZodString;
13362
+ type: z.ZodLiteral<"server.snapshot.finalized">;
13363
+ payload: z.ZodObject<{
13364
+ snapshot_id: z.ZodString;
13365
+ }, z.core.$strip>;
13279
13366
  }, z.core.$strip>, z.ZodObject<{
13280
13367
  id: z.ZodString;
13281
13368
  tenant_id: z.ZodString;
@@ -13994,6 +14081,18 @@ export declare const WorkspaceWebSocketMessageSchema: z.ZodUnion<readonly [z.Zod
13994
14081
  snapshot_id: z.ZodString;
13995
14082
  manifest_hash: z.ZodString;
13996
14083
  }, z.core.$strip>;
14084
+ }, z.core.$strip>, z.ZodObject<{
14085
+ id: z.ZodString;
14086
+ tenant_id: z.ZodString;
14087
+ site_id: z.ZodString;
14088
+ run_id: z.ZodOptional<z.ZodString>;
14089
+ correlation_id: z.ZodOptional<z.ZodString>;
14090
+ seq: z.ZodOptional<z.ZodNumber>;
14091
+ sent_at: z.ZodString;
14092
+ type: z.ZodLiteral<"server.snapshot.finalized">;
14093
+ payload: z.ZodObject<{
14094
+ snapshot_id: z.ZodString;
14095
+ }, z.core.$strip>;
13997
14096
  }, z.core.$strip>, z.ZodObject<{
13998
14097
  id: z.ZodString;
13999
14098
  tenant_id: z.ZodString;