@vcp-dev/contracts 0.10.4 → 0.10.6

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.
@@ -340,6 +340,7 @@ export declare const LauncherPromptTemplateApplyRequestSchema: z.ZodObject<{
340
340
  pages: z.ZodArray<z.ZodObject<{
341
341
  id: z.ZodString;
342
342
  title: z.ZodString;
343
+ parent_page_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
343
344
  slug: z.ZodNullable<z.ZodString>;
344
345
  navigation: z.ZodObject<{
345
346
  order: z.ZodNumber;
@@ -561,6 +562,7 @@ export declare const LauncherPromptTemplateApplyResponseSchema: z.ZodObject<{
561
562
  pages: z.ZodArray<z.ZodObject<{
562
563
  id: z.ZodString;
563
564
  title: z.ZodString;
565
+ parent_page_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
564
566
  slug: z.ZodNullable<z.ZodString>;
565
567
  navigation: z.ZodObject<{
566
568
  order: z.ZodNumber;
@@ -125,8 +125,13 @@ export declare const AiImageGenerationPrecheckResponseSchema: z.ZodObject<{
125
125
  }, z.core.$strip>;
126
126
  export type AiImageGenerationPrecheckResponse = z.infer<typeof AiImageGenerationPrecheckResponseSchema>;
127
127
  export declare const GenerateAiImagesRequestSchema: z.ZodObject<{
128
+ pageName: z.ZodString;
129
+ pageType: z.ZodString;
130
+ sectionTitle: z.ZodString;
131
+ nearbyTitle: z.ZodString;
132
+ nearbyBody: z.ZodString;
128
133
  prompt: z.ZodString;
129
- quantity: z.ZodNumber;
134
+ aspectRatio: z.ZodString;
130
135
  }, z.core.$strip>;
131
136
  export type GenerateAiImagesRequest = z.infer<typeof GenerateAiImagesRequestSchema>;
132
137
  export declare const GeneratedAiImageResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -0,0 +1,19 @@
1
+ /**
2
+ * 单个导航标签的横向宽度预算。
3
+ *
4
+ * 首屏导航是一整行摊开的(chrome 的桌面导航在 lg 断点就全量显示),标签越长
5
+ * 越容易把品牌位和主按钮一起挤出屏幕。这里只量单个标签:整行是否放得下还取决
6
+ * 于页数、品牌名和 CTA 文案,由 chrome 侧决定。
7
+ *
8
+ * 这个预算量的是访客真正看到的导航标签,和 Step5 给出的 SEO 搜索意图不是同一
9
+ * 件事——意图要能被搜索到,标签只要能被点。标签不必等于意图。
10
+ */
11
+ export declare const MAX_NAV_LABEL_WIDTH = 16;
12
+ /** 估算导航标签占的横向宽度:CJK 字符按 2 个单位算,其余按 1 个。 */
13
+ export declare function estimateNavLabelWidth(label: string): number;
14
+ /**
15
+ * 导航标签的“撞名”归一化键:折叠宽度/大小写并去掉常见复数尾 s,用来判断两个
16
+ * 标签是不是同一个概念的不同写法(如 "Products" 与 "product")。只去一个尾
17
+ * s,且只在结果够长时去——避免把 "As" 这类本来就短的词也剃成 "a"。
18
+ */
19
+ export declare function navLabelCollisionKey(label: string): string;
@@ -7,12 +7,51 @@ export declare const PageTemplatePagePathSchema: z.ZodString;
7
7
  export type PageTemplatePagePath = z.infer<typeof PageTemplatePagePathSchema>;
8
8
  /** Narrow exception to ordinary public slug rules; ownership is still checked by the patch runtime. */
9
9
  export declare function isPageTemplateCandidateEntryPath(path: string): boolean;
10
- export declare const PageTemplateCreateRequestSchema: z.ZodObject<{
10
+ export declare const PageTemplateCreateItemSchema: z.ZodObject<{
11
11
  page_path: z.ZodString;
12
12
  template_id: z.ZodString;
13
13
  instruction: z.ZodString;
14
14
  }, z.core.$strict>;
15
+ export type PageTemplateCreateItem = z.infer<typeof PageTemplateCreateItemSchema>;
16
+ /** Frozen against the Workspace iteration budget; one batch is one run. */
17
+ export declare const PAGE_TEMPLATE_BATCH_MAX_ITEMS = 3;
18
+ /** Same trailing-slash normalization as Next route resolution; IDs stay raw. */
19
+ export declare function normalizePageTemplatePagePath(path: string): string;
20
+ export declare const PageTemplateCreateRequestSchema: z.ZodPipe<z.ZodObject<{
21
+ external_run_id: z.ZodString;
22
+ external_thread_id: z.ZodString;
23
+ items: z.ZodArray<z.ZodObject<{
24
+ page_path: z.ZodString;
25
+ template_id: z.ZodString;
26
+ instruction: z.ZodString;
27
+ }, z.core.$strict>>;
28
+ }, z.core.$strict>, z.ZodTransform<{
29
+ external_run_id: string;
30
+ external_thread_id: string;
31
+ items: {
32
+ page_path: string;
33
+ template_id: string;
34
+ instruction: string;
35
+ }[];
36
+ }, {
37
+ external_run_id: string;
38
+ external_thread_id: string;
39
+ items: {
40
+ page_path: string;
41
+ template_id: string;
42
+ instruction: string;
43
+ }[];
44
+ }>>;
15
45
  export type PageTemplateCreateRequest = z.infer<typeof PageTemplateCreateRequestSchema>;
46
+ /** Persisted server-owned input, never reconstructed from a model prompt. */
47
+ export declare const PageTemplateBatchManifestSchema: z.ZodObject<{
48
+ items: z.ZodArray<z.ZodObject<{
49
+ page_path: z.ZodString;
50
+ template_id: z.ZodString;
51
+ instruction: z.ZodString;
52
+ }, z.core.$strict>>;
53
+ }, z.core.$strict>;
54
+ export type PageTemplateBatchManifest = z.infer<typeof PageTemplateBatchManifestSchema>;
16
55
  export declare const PageTemplatePromoteRequestSchema: z.ZodObject<{
17
56
  page_path: z.ZodString;
18
57
  template_id: z.ZodString;
@@ -24,14 +63,68 @@ export declare const PageTemplateCleanupRequestSchema: z.ZodObject<{
24
63
  template_ids: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>;
25
64
  }, z.core.$strict>;
26
65
  export type PageTemplateCleanupRequest = z.infer<typeof PageTemplateCleanupRequestSchema>;
27
- export declare const PageTemplateCreateResponseSchema: z.ZodObject<{
28
- template_id: z.ZodString;
29
- status: z.ZodLiteral<"created">;
30
- ok: z.ZodLiteral<true>;
66
+ /** Same task envelope, with the strict Page Template scene reflected in OpenAPI too. */
67
+ export declare const PageTemplateTaskSchema: z.ZodObject<{
68
+ id: z.ZodUUID;
31
69
  site_id: z.ZodUUID;
32
- page_path: z.ZodString;
33
- route_id: z.ZodString;
34
- snapshot_id: z.ZodUUID;
70
+ vcp_run_id: z.ZodNullable<z.ZodUUID>;
71
+ vcp_thread_id: z.ZodNullable<z.ZodUUID>;
72
+ base_snapshot_id: z.ZodUUID;
73
+ snapshot_id: z.ZodNullable<z.ZodUUID>;
74
+ preview_url: z.ZodNullable<z.ZodString>;
75
+ summary: z.ZodNullable<z.ZodString>;
76
+ error_code: z.ZodNullable<z.ZodString>;
77
+ build_verified: z.ZodNullable<z.ZodBoolean>;
78
+ created_at: z.ZodString;
79
+ started_at: z.ZodNullable<z.ZodString>;
80
+ finished_at: z.ZodNullable<z.ZodString>;
81
+ execution_scene: z.ZodLiteral<"page_template_create">;
82
+ external_run_id: z.ZodString;
83
+ external_thread_id: z.ZodString;
84
+ callback_status: z.ZodNull;
85
+ status: z.ZodEnum<{
86
+ succeeded: "succeeded";
87
+ failed: "failed";
88
+ running: "running";
89
+ }>;
90
+ outcome: z.ZodNullable<z.ZodEnum<{
91
+ succeeded: "succeeded";
92
+ failed: "failed";
93
+ }>>;
94
+ degraded_reason: z.ZodNull;
95
+ }, z.core.$strict>;
96
+ export type PageTemplateTask = z.infer<typeof PageTemplateTaskSchema>;
97
+ /** Create returns the shared asynchronous task envelope (HTTP 202). */
98
+ export declare const PageTemplateCreateResponseSchema: z.ZodObject<{
99
+ task: z.ZodObject<{
100
+ id: z.ZodUUID;
101
+ site_id: z.ZodUUID;
102
+ vcp_run_id: z.ZodNullable<z.ZodUUID>;
103
+ vcp_thread_id: z.ZodNullable<z.ZodUUID>;
104
+ base_snapshot_id: z.ZodUUID;
105
+ snapshot_id: z.ZodNullable<z.ZodUUID>;
106
+ preview_url: z.ZodNullable<z.ZodString>;
107
+ summary: z.ZodNullable<z.ZodString>;
108
+ error_code: z.ZodNullable<z.ZodString>;
109
+ build_verified: z.ZodNullable<z.ZodBoolean>;
110
+ created_at: z.ZodString;
111
+ started_at: z.ZodNullable<z.ZodString>;
112
+ finished_at: z.ZodNullable<z.ZodString>;
113
+ execution_scene: z.ZodLiteral<"page_template_create">;
114
+ external_run_id: z.ZodString;
115
+ external_thread_id: z.ZodString;
116
+ callback_status: z.ZodNull;
117
+ status: z.ZodEnum<{
118
+ succeeded: "succeeded";
119
+ failed: "failed";
120
+ running: "running";
121
+ }>;
122
+ outcome: z.ZodNullable<z.ZodEnum<{
123
+ succeeded: "succeeded";
124
+ failed: "failed";
125
+ }>>;
126
+ degraded_reason: z.ZodNull;
127
+ }, z.core.$strict>;
35
128
  }, z.core.$strict>;
36
129
  export type PageTemplateCreateResponse = z.infer<typeof PageTemplateCreateResponseSchema>;
37
130
  export declare const PageTemplatePromoteResponseSchema: z.ZodObject<{
@@ -0,0 +1,285 @@
1
+ import { z } from "zod";
2
+ /** agent → api 的 fencing 头:落后的 lease owner 写入一律被拒。 */
3
+ export declare const INTERNAL_RUN_LEASE_OWNER_HEADER: "x-vcp-run-lease-owner";
4
+ export declare const WORKSPACE_RUN_LEASE_MS: number;
5
+ export declare const WORKSPACE_RUN_HEARTBEAT_INTERVAL_MS: number;
6
+ export declare const WORKSPACE_MAX_RESUME_COUNT = 3;
7
+ export declare const WORKSPACE_MAX_PAGE_ATTEMPTS = 2;
8
+ export declare const WORKSPACE_RUN_RESUME_EXHAUSTED_ERROR_CODE: "WORKSPACE_RUN_RESUME_EXHAUSTED";
9
+ export declare const WORKSPACE_CHECK_INCOMPLETE_ERROR_CODE: "WORKSPACE_CHECK_INCOMPLETE";
10
+ export declare const WORKSPACE_GENERATION_STOPPED_ERROR_CODE: "WORKSPACE_GENERATION_STOPPED";
11
+ export declare const WORKSPACE_FILL_IN_INTERRUPTED_ERROR_CODE: "WORKSPACE_FILL_IN_INTERRUPTED";
12
+ export declare const WORKSPACE_RUN_LEASE_SUPERSEDED_ERROR_CODE: "WORKSPACE_RUN_LEASE_SUPERSEDED";
13
+ /**
14
+ * 已终态的一轮不再收页面检查点:登记接口返回 409。只在内网写入路径出现,
15
+ * 不会作为 `run.failed` 的 error_code 给用户看,因此没有 ERROR_COPY 文案。
16
+ */
17
+ export declare const WORKSPACE_RUN_NOT_ACTIVE_ERROR_CODE: "WORKSPACE_RUN_NOT_ACTIVE";
18
+ /**
19
+ * 站点还没生成完(`status !== "workspace_ready"`)时拒绝启动补齐。
20
+ * 不复用 `SITE_PLANNING_LOCKED`:那个码的含义是"站点已生成、Step 2/3 被锁",
21
+ * 正好相反,前端按它提示会把用户指向错误的补救动作。
22
+ */
23
+ export declare const FILL_IN_NOT_AVAILABLE_ERROR_CODE: "FILL_IN_NOT_AVAILABLE";
24
+ export declare const FILL_IN_TARGET_NOT_OMITTED_ERROR_CODE: "FILL_IN_TARGET_NOT_OMITTED";
25
+ export declare const FILL_IN_TARGET_MODIFIED_ERROR_CODE: "FILL_IN_TARGET_MODIFIED";
26
+ /**
27
+ * 接续主体:创建 run 时把内网上下文工厂需要的输入持久化到运行行上,
28
+ * 接续器据此重建请求上下文(`tenant_id` 取运行行本身,不重复存)。
29
+ * 字段与 apps/api 的 `DevRequestContext` 同形,去掉 tenant_id。
30
+ */
31
+ export declare const WorkspaceRunResumePrincipalSchema: z.ZodObject<{
32
+ authMode: z.ZodEnum<{
33
+ "disabled-dev": "disabled-dev";
34
+ "internal-service": "internal-service";
35
+ oidc: "oidc";
36
+ }>;
37
+ user_id: z.ZodString;
38
+ external_user_id: z.ZodOptional<z.ZodString>;
39
+ email: z.ZodOptional<z.ZodString>;
40
+ display_name: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strict>;
42
+ export type WorkspaceRunResumePrincipal = z.infer<typeof WorkspaceRunResumePrincipalSchema>;
43
+ export declare const WorkspaceRunHeartbeatRequestSchema: z.ZodObject<{
44
+ run_id: z.ZodUUID;
45
+ lease_owner: z.ZodString;
46
+ lease_ms: z.ZodOptional<z.ZodNumber>;
47
+ }, z.core.$strict>;
48
+ export type WorkspaceRunHeartbeatRequest = z.infer<typeof WorkspaceRunHeartbeatRequestSchema>;
49
+ export declare const WorkspaceRunHeartbeatResponseSchema: z.ZodObject<{
50
+ status: z.ZodEnum<{
51
+ renewed: "renewed";
52
+ not_active: "not_active";
53
+ superseded: "superseded";
54
+ }>;
55
+ expires_at: z.ZodNullable<z.ZodString>;
56
+ stop_requested: z.ZodBoolean;
57
+ }, z.core.$strict>;
58
+ export type WorkspaceRunHeartbeatResponse = z.infer<typeof WorkspaceRunHeartbeatResponseSchema>;
59
+ /**
60
+ * 检查点对象是一份正规快照物化产物:`snapshot_id` 是独立的 uuid v7,
61
+ * 不复用站点快照 id,也不写进 snapshots 表;路径安全由
62
+ * `@vcp/snapshots` 的 `assertSafeSnapshotPath` 在写盘时保证。
63
+ */
64
+ export declare const WorkspacePageCheckpointSchema: z.ZodObject<{
65
+ run_id: z.ZodUUID;
66
+ page_id: z.ZodString;
67
+ attempt: z.ZodNumber;
68
+ snapshot_id: z.ZodUUID;
69
+ object_key: z.ZodString;
70
+ manifest_hash: z.ZodString;
71
+ file_paths: z.ZodArray<z.ZodString>;
72
+ created_at: z.ZodString;
73
+ }, z.core.$strict>;
74
+ export type WorkspacePageCheckpoint = z.infer<typeof WorkspacePageCheckpointSchema>;
75
+ export declare const RegisterWorkspacePageCheckpointRequestSchema: z.ZodObject<{
76
+ run_id: z.ZodUUID;
77
+ snapshot_id: z.ZodUUID;
78
+ page_id: z.ZodString;
79
+ attempt: z.ZodNumber;
80
+ object_key: z.ZodString;
81
+ manifest_hash: z.ZodString;
82
+ file_paths: z.ZodArray<z.ZodString>;
83
+ lease_owner: z.ZodString;
84
+ }, z.core.$strict>;
85
+ export type RegisterWorkspacePageCheckpointRequest = z.infer<typeof RegisterWorkspacePageCheckpointRequestSchema>;
86
+ export declare const ListWorkspacePageCheckpointsResponseSchema: z.ZodObject<{
87
+ checkpoints: z.ZodArray<z.ZodObject<{
88
+ run_id: z.ZodUUID;
89
+ page_id: z.ZodString;
90
+ attempt: z.ZodNumber;
91
+ snapshot_id: z.ZodUUID;
92
+ object_key: z.ZodString;
93
+ manifest_hash: z.ZodString;
94
+ file_paths: z.ZodArray<z.ZodString>;
95
+ created_at: z.ZodString;
96
+ }, z.core.$strict>>;
97
+ }, z.core.$strict>;
98
+ export type ListWorkspacePageCheckpointsResponse = z.infer<typeof ListWorkspacePageCheckpointsResponseSchema>;
99
+ export declare const FillInTargetSchema: z.ZodObject<{
100
+ kind: z.ZodEnum<{
101
+ page: "page";
102
+ component: "component";
103
+ shared: "shared";
104
+ }>;
105
+ target_id: z.ZodString;
106
+ }, z.core.$strict>;
107
+ export type FillInTarget = z.infer<typeof FillInTargetSchema>;
108
+ export declare const WorkspaceRunControlInputResponseSchema: z.ZodObject<{
109
+ run_id: z.ZodUUID;
110
+ site_id: z.ZodUUID;
111
+ tenant_id: z.ZodString;
112
+ run_kind: z.ZodEnum<{
113
+ landing_page: "landing_page";
114
+ initial_generation: "initial_generation";
115
+ iteration: "iteration";
116
+ fill_in: "fill_in";
117
+ }>;
118
+ status: z.ZodEnum<{
119
+ succeeded: "succeeded";
120
+ failed: "failed";
121
+ running: "running";
122
+ queued: "queued";
123
+ cancelled: "cancelled";
124
+ }>;
125
+ base_snapshot_id: z.ZodNullable<z.ZodUUID>;
126
+ lease_owner: z.ZodNullable<z.ZodString>;
127
+ resume_count: z.ZodNumber;
128
+ stop_requested: z.ZodBoolean;
129
+ reuse_from_run_id: z.ZodNullable<z.ZodUUID>;
130
+ source_run_id: z.ZodNullable<z.ZodUUID>;
131
+ fill_in_targets: z.ZodArray<z.ZodObject<{
132
+ kind: z.ZodEnum<{
133
+ page: "page";
134
+ component: "component";
135
+ shared: "shared";
136
+ }>;
137
+ target_id: z.ZodString;
138
+ }, z.core.$strict>>;
139
+ execution_scene: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
140
+ external_site_edit: "external_site_edit";
141
+ page_template_create: "page_template_create";
142
+ }>>>;
143
+ page_template_manifest: z.ZodOptional<z.ZodNullable<z.ZodObject<{
144
+ items: z.ZodArray<z.ZodObject<{
145
+ page_path: z.ZodString;
146
+ template_id: z.ZodString;
147
+ instruction: z.ZodString;
148
+ }, z.core.$strict>>;
149
+ }, z.core.$strict>>>;
150
+ }, z.core.$strict>;
151
+ export type WorkspaceRunControlInputResponse = z.infer<typeof WorkspaceRunControlInputResponseSchema>;
152
+ export declare const ClaimStaleWorkspaceRunsResponseSchema: z.ZodObject<{
153
+ runs: z.ZodArray<z.ZodObject<{
154
+ run_id: z.ZodUUID;
155
+ site_id: z.ZodUUID;
156
+ tenant_id: z.ZodString;
157
+ run_kind: z.ZodLiteral<"initial_generation">;
158
+ base_snapshot_id: z.ZodUUID;
159
+ sitemap_id: z.ZodUUID;
160
+ resume_count: z.ZodNumber;
161
+ lease_owner: z.ZodString;
162
+ stop_requested: z.ZodBoolean;
163
+ resume_principal: z.ZodObject<{
164
+ authMode: z.ZodEnum<{
165
+ "disabled-dev": "disabled-dev";
166
+ "internal-service": "internal-service";
167
+ oidc: "oidc";
168
+ }>;
169
+ user_id: z.ZodString;
170
+ external_user_id: z.ZodOptional<z.ZodString>;
171
+ email: z.ZodOptional<z.ZodString>;
172
+ display_name: z.ZodOptional<z.ZodString>;
173
+ }, z.core.$strict>;
174
+ }, z.core.$strict>>;
175
+ }, z.core.$strict>;
176
+ export type ClaimStaleWorkspaceRunsResponse = z.infer<typeof ClaimStaleWorkspaceRunsResponseSchema>;
177
+ export declare const StopWorkspaceGenerationRequestSchema: z.ZodObject<{
178
+ site_id: z.ZodUUID;
179
+ }, z.core.$strict>;
180
+ /**
181
+ * `requested` / `already_requested`:这一轮还活着(租约未过期),停止请求已写下,
182
+ * 由它自己保存好已完成的页面后收尾。
183
+ * `stopped`:这一轮已经没有活着的处理进程了(租约过期或从未续期)——没人会理会
184
+ * 停止标记,再软停就等于让站点锁一直挂着,因此当场补终态并释放站点锁。
185
+ * `no_active_run`:站点上没有首轮生成 / 补齐在途。
186
+ */
187
+ export declare const StopWorkspaceGenerationResponseSchema: z.ZodObject<{
188
+ status: z.ZodEnum<{
189
+ requested: "requested";
190
+ already_requested: "already_requested";
191
+ stopped: "stopped";
192
+ no_active_run: "no_active_run";
193
+ }>;
194
+ run_id: z.ZodNullable<z.ZodUUID>;
195
+ }, z.core.$strict>;
196
+ export type StopWorkspaceGenerationRequest = z.infer<typeof StopWorkspaceGenerationRequestSchema>;
197
+ export type StopWorkspaceGenerationResponse = z.infer<typeof StopWorkspaceGenerationResponseSchema>;
198
+ export declare const SiteGenerationLedgerResponseSchema: z.ZodObject<{
199
+ ledger: z.ZodNullable<z.ZodObject<{
200
+ schema_version: z.ZodLiteral<1>;
201
+ sitemap_id: z.ZodString;
202
+ confirmed_page_ids: z.ZodArray<z.ZodString>;
203
+ pages: z.ZodArray<z.ZodObject<{
204
+ page_id: z.ZodString;
205
+ slug: z.ZodString;
206
+ title: z.ZodString;
207
+ parent_page_id: z.ZodNullable<z.ZodString>;
208
+ result: z.ZodEnum<{
209
+ partial: "partial";
210
+ complete: "complete";
211
+ pending: "pending";
212
+ check_incomplete: "check_incomplete";
213
+ omitted: "omitted";
214
+ }>;
215
+ attempts: z.ZodNumber;
216
+ omissions: z.ZodArray<z.ZodObject<{
217
+ kind: z.ZodEnum<{
218
+ page: "page";
219
+ component: "component";
220
+ shared: "shared";
221
+ }>;
222
+ target_id: z.ZodString;
223
+ page_id: z.ZodNullable<z.ZodString>;
224
+ reason: z.ZodEnum<{
225
+ conflict: "conflict";
226
+ generation_failed: "generation_failed";
227
+ repair_exhausted: "repair_exhausted";
228
+ page_unusable: "page_unusable";
229
+ check_incomplete: "check_incomplete";
230
+ design_missing: "design_missing";
231
+ chrome_fallback: "chrome_fallback";
232
+ style_fallback: "style_fallback";
233
+ resume_exhausted: "resume_exhausted";
234
+ user_stopped: "user_stopped";
235
+ }>;
236
+ repair_attempts: z.ZodNumber;
237
+ message: z.ZodString;
238
+ filled: z.ZodOptional<z.ZodBoolean>;
239
+ }, z.core.$strict>>;
240
+ }, z.core.$strict>>;
241
+ shared: z.ZodArray<z.ZodObject<{
242
+ kind: z.ZodEnum<{
243
+ page: "page";
244
+ component: "component";
245
+ shared: "shared";
246
+ }>;
247
+ target_id: z.ZodString;
248
+ page_id: z.ZodNullable<z.ZodString>;
249
+ reason: z.ZodEnum<{
250
+ conflict: "conflict";
251
+ generation_failed: "generation_failed";
252
+ repair_exhausted: "repair_exhausted";
253
+ page_unusable: "page_unusable";
254
+ check_incomplete: "check_incomplete";
255
+ design_missing: "design_missing";
256
+ chrome_fallback: "chrome_fallback";
257
+ style_fallback: "style_fallback";
258
+ resume_exhausted: "resume_exhausted";
259
+ user_stopped: "user_stopped";
260
+ }>;
261
+ repair_attempts: z.ZodNumber;
262
+ message: z.ZodString;
263
+ filled: z.ZodOptional<z.ZodBoolean>;
264
+ }, z.core.$strict>>;
265
+ stopped_by_user: z.ZodBoolean;
266
+ resume_count: z.ZodNumber;
267
+ home_replaced_by: z.ZodNullable<z.ZodString>;
268
+ updated_at: z.ZodString;
269
+ }, z.core.$strict>>;
270
+ source_run_id: z.ZodNullable<z.ZodUUID>;
271
+ updated_at: z.ZodNullable<z.ZodString>;
272
+ }, z.core.$strict>;
273
+ export type SiteGenerationLedgerResponse = z.infer<typeof SiteGenerationLedgerResponseSchema>;
274
+ export declare const StartFillInRequestSchema: z.ZodObject<{
275
+ targets: z.ZodArray<z.ZodObject<{
276
+ kind: z.ZodEnum<{
277
+ page: "page";
278
+ component: "component";
279
+ shared: "shared";
280
+ }>;
281
+ target_id: z.ZodString;
282
+ }, z.core.$strict>>;
283
+ client_run_key: z.ZodString;
284
+ }, z.core.$strict>;
285
+ export type StartFillInRequest = z.infer<typeof StartFillInRequestSchema>;
@@ -72,8 +72,8 @@ export declare const SiteEditStylePropertySchema: z.ZodEnum<{
72
72
  color: "color";
73
73
  transform: "transform";
74
74
  cursor: "cursor";
75
- columns: "columns";
76
75
  position: "position";
76
+ columns: "columns";
77
77
  width: "width";
78
78
  height: "height";
79
79
  order: "order";
@@ -144,6 +144,7 @@ export declare const SiteEditDynamicDataSummarySchema: z.ZodObject<{
144
144
  "external-api": "external-api";
145
145
  "unknown-api": "unknown-api";
146
146
  }>>;
147
+ collections: z.ZodOptional<z.ZodArray<z.ZodString>>;
147
148
  primaryEndpoint: z.ZodOptional<z.ZodString>;
148
149
  primaryCollection: z.ZodOptional<z.ZodString>;
149
150
  primaryFieldPath: z.ZodOptional<z.ZodString>;
@@ -169,6 +170,7 @@ export declare const SiteEditRenderEntrySchema: z.ZodObject<{
169
170
  "external-api": "external-api";
170
171
  "unknown-api": "unknown-api";
171
172
  }>>;
173
+ collections: z.ZodOptional<z.ZodArray<z.ZodString>>;
172
174
  primaryEndpoint: z.ZodOptional<z.ZodString>;
173
175
  primaryCollection: z.ZodOptional<z.ZodString>;
174
176
  primaryFieldPath: z.ZodOptional<z.ZodString>;
@@ -223,6 +225,7 @@ export declare const SiteEditRenderDocumentSchema: z.ZodObject<{
223
225
  "external-api": "external-api";
224
226
  "unknown-api": "unknown-api";
225
227
  }>>;
228
+ collections: z.ZodOptional<z.ZodArray<z.ZodString>>;
226
229
  primaryEndpoint: z.ZodOptional<z.ZodString>;
227
230
  primaryCollection: z.ZodOptional<z.ZodString>;
228
231
  primaryFieldPath: z.ZodOptional<z.ZodString>;
@@ -460,8 +463,8 @@ export declare const SiteEditStyleModelSchema: z.ZodUnion<readonly [z.ZodRecord<
460
463
  color: "color";
461
464
  transform: "transform";
462
465
  cursor: "cursor";
463
- columns: "columns";
464
466
  position: "position";
467
+ columns: "columns";
465
468
  width: "width";
466
469
  height: "height";
467
470
  order: "order";
@@ -1107,6 +1110,7 @@ export declare const SiteEditObjectSummarySchema: z.ZodObject<{
1107
1110
  "external-api": "external-api";
1108
1111
  "unknown-api": "unknown-api";
1109
1112
  }>>;
1113
+ collections: z.ZodOptional<z.ZodArray<z.ZodString>>;
1110
1114
  primaryEndpoint: z.ZodOptional<z.ZodString>;
1111
1115
  primaryCollection: z.ZodOptional<z.ZodString>;
1112
1116
  primaryFieldPath: z.ZodOptional<z.ZodString>;
@@ -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.10.4";
8
+ export declare const CURRENT_EDIT_ENGINE_VERSION = "0.10.6";
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";
@@ -0,0 +1,82 @@
1
+ /**
2
+ * 两层页面结构的纯函数:展示顺序、统计与结构化校验。
3
+ *
4
+ * 与 index.ts 里的 zod 不变量分工:不变量守持久化边界并直接拒绝非法数据;
5
+ * 这里的函数给界面提示和服务端确认门用,返回带页面 id 的问题清单,
6
+ * 且额外覆盖 zod 不检查的“同一位置重名”与“首页被改名”。
7
+ */
8
+ export type SitemapStructurePageLike = {
9
+ id: string;
10
+ slug: string | null;
11
+ title: string;
12
+ parent_page_id?: string | null;
13
+ blocks: ReadonlyArray<unknown>;
14
+ };
15
+ /**
16
+ * 只做页面顺序判定的最小结构:isTopLevelPage / listChildPages /
17
+ * orderSitemapPagesForDisplay 的实现只读 id/slug/parent_page_id,不需要
18
+ * title/blocks。SitemapStructurePageLike 仍是两层结构契约的完整形状(
19
+ * countSitemapStructure / validateSitemapStructure 要用 title/blocks 计数与
20
+ * 校验),这里单独收窄一个类型,让只做排序判定的调用方(例如导航链接排序)
21
+ * 不必先把没有 blocks 的页面形状转成完整形状再传进来。
22
+ */
23
+ export type SitemapOrderingPageLike = {
24
+ id: string;
25
+ slug: string | null;
26
+ parent_page_id?: string | null;
27
+ };
28
+ export type SitemapStructureIssueCode = "missing_home" | "home_renamed" | "empty_title" | "self_parent" | "parent_not_found" | "home_has_parent" | "home_has_children" | "depth_exceeded" | "duplicate_sibling_title" | "reserved_slug";
29
+ export type SitemapStructureIssue = {
30
+ code: SitemapStructureIssueCode;
31
+ page_id: string | null;
32
+ message: string;
33
+ };
34
+ export declare function normalizeStructureTitle(title: string): string;
35
+ /** 首页文案兜底:只覆盖三种 CJK 语种并退英文,与 Sitemap 侧导航兜底口径一致。 */
36
+ export declare function homeLabelForLocale(locale: string | null | undefined): string;
37
+ /**
38
+ * “更多”文案兜底:与 homeLabelForLocale 同风格(按 BCP-47 前缀判断),给收纳
39
+ * 溢出顶层导航项的下拉入口用。覆盖比首页兜底更广的一组语种,其余(含
40
+ * null/undefined)一律退英文。
41
+ */
42
+ export declare function moreLabelForLocale(locale: string | null | undefined): string;
43
+ /**
44
+ * 首轮页头全覆盖:把每个页面的 `navigation.showInHeader` 钉成 true,只改这一
45
+ * 个字段。`null` 与 `false` 同等对待——两者都表示"当前不在页头"。已经是
46
+ * `true` 的页面原样返回(同一引用),不产生多余改动。
47
+ */
48
+ export declare function markAllPagesInHeader<T extends {
49
+ navigation: {
50
+ showInHeader: boolean | null;
51
+ };
52
+ }>(pages: readonly T[]): T[];
53
+ export declare function isTopLevelPage<T extends SitemapOrderingPageLike>(page: T, pages: ReadonlyArray<T>): boolean;
54
+ export declare function listChildPages<T extends SitemapOrderingPageLike>(pages: readonly T[], parentId: string): T[];
55
+ export declare function orderSitemapPagesForDisplay<T extends SitemapOrderingPageLike>(pages: readonly T[]): T[];
56
+ /**
57
+ * 把导航链接按页面的展示结构(首页、一级页、各自子页紧随其后)重新排列。
58
+ *
59
+ * 只重排「href 的 pathname 精确匹配某个页面 slug」的链接,顺序取
60
+ * `orderSitemapPagesForDisplay(pages)` 里该页面的位置——不是链接的原数组顺序,
61
+ * 也不是页面自己的 `navigation.order`。匹配不到页面的链接(外链、或指向已不
62
+ * 存在页面的死链)保持彼此原有的相对顺序,整体放在排好序的页面链接之后。
63
+ *
64
+ * 用途:resolver 补全新增子页的 slug 之后,一般的导航收敛逻辑只知道「这个
65
+ * 页面之前不在链接列表里」,只会把它追加到末尾,不知道父子结构;这个函数在
66
+ * 持久化前对最终 primaryLinks 做一次结构对齐,让子页紧跟父页。footerLinks
67
+ * 不需要这个处理——页脚本来就是按 order 手工挑选的子集,没有「子页必须紧随
68
+ * 父页」的展示要求。
69
+ */
70
+ export declare function orderNavigationLinksByStructure<L extends {
71
+ href: string;
72
+ }, P extends SitemapOrderingPageLike>(links: readonly L[], pages: readonly P[]): L[];
73
+ export declare function countSitemapStructure(pages: ReadonlyArray<SitemapStructurePageLike>): {
74
+ top_level_pages: number;
75
+ sub_pages: number;
76
+ total_pages: number;
77
+ content_items: number;
78
+ };
79
+ export declare function validateSitemapStructure(pages: ReadonlyArray<SitemapStructurePageLike>, options?: {
80
+ expectedHomeTitle?: string;
81
+ reservedSlugs?: readonly string[];
82
+ }): SitemapStructureIssue[];
@@ -12,6 +12,9 @@ export declare const Step5OutputLocaleSchema: z.ZodEnum<{
12
12
  export type Step5OutputLocale = z.infer<typeof Step5OutputLocaleSchema>;
13
13
  export declare const STEP5_STRATEGY_KEYS: readonly ["market", "persona", "product", "brand", "competition", "structure", "language", "keywords", "risk"];
14
14
  export declare const STEP5_STRATEGY_COUNT: 9;
15
+ export declare const STEP5_OPTIONAL_STRATEGY_KEYS: readonly ["keywords"];
16
+ export declare const STEP5_REQUIRED_STRATEGY_KEYS: ("product" | "keywords" | "market" | "language" | "persona" | "brand" | "competition" | "structure" | "risk")[];
17
+ export declare const STEP5_REQUIRED_STRATEGY_COUNT: number;
15
18
  export declare const Step5ActiveStrategyKeySchema: z.ZodEnum<{
16
19
  product: "product";
17
20
  keywords: "keywords";
@@ -24,6 +27,7 @@ export declare const Step5ActiveStrategyKeySchema: z.ZodEnum<{
24
27
  risk: "risk";
25
28
  }>;
26
29
  export type Step5ActiveStrategyKey = z.infer<typeof Step5ActiveStrategyKeySchema>;
30
+ export declare function isStep5RequiredStrategyKey(key: Step5ActiveStrategyKey): boolean;
27
31
  export declare const Step5StrategyKeySchema: z.ZodEnum<{
28
32
  product: "product";
29
33
  keywords: "keywords";