@vcp-dev/contracts 0.6.11 → 0.7.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.
Files changed (71) hide show
  1. package/README.md +5 -4
  2. package/dist/business-facts.d.ts +23 -0
  3. package/dist/cms-page-directory.d.ts +40 -4
  4. package/dist/colorway-distinctness.js +1 -1
  5. package/dist/connect-dynamic-collection.d.ts +6 -6
  6. package/dist/connect-form.d.ts +6 -6
  7. package/dist/conversion-hints.d.ts +38 -0
  8. package/dist/crawler-task-service.d.ts +244 -2
  9. package/dist/custom-domain.d.ts +119 -239
  10. package/dist/customer-materials.d.ts +5 -5
  11. package/dist/deployment-lifecycle.d.ts +45 -0
  12. package/dist/design-tokens.d.ts +1 -0
  13. package/dist/design-tokens.js +1 -1
  14. package/dist/e2b-preview-proxy.d.ts +5 -0
  15. package/dist/external-site-edit.d.ts +9 -0
  16. package/dist/firecrawl-internal.d.ts +19 -0
  17. package/dist/font-catalog.d.ts +5 -2
  18. package/dist/form-design.d.ts +54 -12
  19. package/dist/google-search-console.d.ts +1 -0
  20. package/dist/index.d.ts +3129 -818
  21. package/dist/index.js +1 -1
  22. package/dist/industry-classification.d.ts +43 -0
  23. package/dist/input-context-bundle.d.ts +10 -0
  24. package/dist/internal-entity-id.d.ts +1 -0
  25. package/dist/knowledge-category.d.ts +20 -0
  26. package/dist/knowledge-source-readiness.d.ts +94 -0
  27. package/dist/launcher-prompt-templates.d.ts +117 -14
  28. package/dist/migration-products.d.ts +45 -0
  29. package/dist/page-slug.d.ts +2 -0
  30. package/dist/page-template.d.ts +95 -0
  31. package/dist/site-build.d.ts +564 -0
  32. package/dist/site-design-presets.d.ts +20 -0
  33. package/dist/site-edit-capability.d.ts +13 -1
  34. package/dist/site-edit-class-name-source.d.ts +40 -8
  35. package/dist/site-edit-command-result.d.ts +15 -4
  36. package/dist/site-edit-composition.d.ts +13 -0
  37. package/dist/site-edit-event.d.ts +68 -14
  38. package/dist/site-edit-history-status.d.ts +193 -0
  39. package/dist/site-edit-operation.d.ts +152 -51
  40. package/dist/site-edit-page-composition.d.ts +101 -22
  41. package/dist/site-edit-patch-plan.d.ts +49 -3
  42. package/dist/site-edit-render-document.d.ts +54 -8
  43. package/dist/site-edit-session.d.ts +5 -2
  44. package/dist/site-edit-source.d.ts +60 -11
  45. package/dist/site-edit-version.d.ts +1 -1
  46. package/dist/site-extra-requirement.d.ts +39 -0
  47. package/dist/site-locale.d.ts +20 -0
  48. package/dist/site-localization-fields.d.ts +196 -0
  49. package/dist/site-localization-scope.d.ts +95 -0
  50. package/dist/site-preview.d.ts +15 -0
  51. package/dist/site-publish-domain.d.ts +680 -0
  52. package/dist/site-publish-workflow.d.ts +612 -0
  53. package/dist/site-workflow-completions.d.ts +163 -0
  54. package/dist/site-workflow.d.ts +231 -211
  55. package/dist/sitemap-navigation.d.ts +4 -1
  56. package/dist/step2-page-selection.d.ts +88 -0
  57. package/dist/step2-site-initialization.d.ts +321 -30
  58. package/dist/step3-digital-employee-analysis.d.ts +177 -211
  59. package/dist/step4-diagnosis.d.ts +72 -4
  60. package/dist/step5-strategy.d.ts +5901 -172
  61. package/dist/step6-design.d.ts +779 -464
  62. package/dist/subsite-localization-input.d.ts +121 -0
  63. package/dist/subsite-mount-path.d.ts +23 -0
  64. package/dist/subsite-sync-diff.d.ts +76 -0
  65. package/dist/subsite-visible-text-export.d.ts +34 -0
  66. package/dist/template-upgrade-observability.d.ts +2 -2
  67. package/dist/theme-presets.d.ts +56 -1
  68. package/dist/workspace-design-apply.d.ts +5 -0
  69. package/dist/workspace-resource-operation.d.ts +58 -24
  70. package/package.json +1 -1
  71. package/dist/publish-quality.d.ts +0 -92
@@ -0,0 +1,121 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * 子站本地化的**上游可传入参**合同:术语表与站点信息。
4
+ *
5
+ * 两项都可选,两项都遵循同一条取向:**服务不猜上游本该给的东西**。子站编排链路
6
+ * 上只有调用方知道「这个品牌词该译成什么」「这个站是做什么的」,服务端能做的只是
7
+ * 从主站已有数据里尽力还原一份兜底;传了就用传的,没传才走兜底。
8
+ *
9
+ * 三个使用点共用本文件:`apps/api` 公网入口(subsites.controller)、
10
+ * 该入口组装的入队 payload(subsites.service)、以及 `services/subsite-service`
11
+ * 侧对 payload 的读取。口径只此一份。
12
+ */
13
+ /** 单条术语表条目的长度上限。原文与译文都是短语,超长即为误用。 */
14
+ export declare const SUBSITE_GLOSSARY_ENTRY_MAX_CHARS = 200;
15
+ /**
16
+ * 术语表条目数上限。术语表随**每一个**翻译批次一起发出去(不是每站一次),
17
+ * 条数直接乘进每批的输入 token,因此必须有上界。
18
+ */
19
+ export declare const SUBSITE_GLOSSARY_MAX_ENTRIES = 200;
20
+ /**
21
+ * 术语表条目的形态:`"原文:译文"`,半角冒号分隔,取第一个冒号为分隔点
22
+ * (译文里可以再出现冒号)。
23
+ *
24
+ * ✓ 实测(dev 翻译服务,2026-08-16):术语表是**以指令方式交给模型**的,不是
25
+ * 字符串替换——同一批 6 条含品牌词的中文,不带术语表时译名在
26
+ * `SANY Heavy Industry` 与 `Sany Heavy Industry` 之间三三分裂;带上
27
+ * `三一重工:SANY` 后 6/6 全部落在 `SANY`。这正是「一个品牌名在产出站里裂成三种
28
+ * 写法」这条缺陷的修法。
29
+ *
30
+ * 返回 `null` 表示形态不合格(没有冒号、冒号在首位、或某一侧只有空白)。
31
+ */
32
+ export declare function splitSubsiteGlossaryEntry(entry: string): {
33
+ readonly source: string;
34
+ readonly target: string;
35
+ } | null;
36
+ /**
37
+ * 单条术语表条目。**刻意不做 transform**:schema effect 会让 `z.toJSONSchema`
38
+ * 抛错,连带炸掉 OpenAPI 文档生成(与 `SubsiteMountPathSchema` 同一条约束)。
39
+ * refine 只校验不改值,条目原样进入翻译请求体。
40
+ */
41
+ export declare const SubsiteGlossaryEntrySchema: z.ZodString;
42
+ export declare const SubsiteGlossariesSchema: z.ZodArray<z.ZodString>;
43
+ /**
44
+ * 翻译服务的站点上下文。
45
+ *
46
+ * **只有 `website_name` 必填**,行业与一句话简介可缺。✓ 实测(dev,2026-08-16):
47
+ * 该服务对 `site_info` 既不强制存在、也不要求三项齐全——完全不带 `site_info`
48
+ * 与只带 `website_name` 都返回 200 且译文正常。因此「凑不齐三项」不是中止本地化
49
+ * 的正当理由:缺的字段省略掉,照常翻译,把不完整记成可观测的降级信号。
50
+ */
51
+ export declare const SubsiteSiteInfoSchema: z.ZodObject<{
52
+ website_name: z.ZodString;
53
+ website_industry: z.ZodOptional<z.ZodString>;
54
+ website_description: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$strip>;
56
+ export type SubsiteSiteInfo = z.infer<typeof SubsiteSiteInfoSchema>;
57
+ /**
58
+ * 配色本地化档位。
59
+ *
60
+ * **只约束颜色与明暗底面,不约束图片**:`fonts_only` 档下用户在 `note` 里写的
61
+ * 换图诉求仍然生效。档位这个词容易被读成「什么都不变」,界面提示语必须写明这一点。
62
+ *
63
+ * 只有两档,却覆盖三级优先级:锁定色值不是第三种模式,而是在 `regional` 档下
64
+ * 按槽施加的约束(见 `SubsitePaletteSeedsSchema`)。
65
+ */
66
+ export declare const SubsitePaletteModeSchema: z.ZodEnum<{
67
+ regional: "regional";
68
+ fonts_only: "fonts_only";
69
+ }>;
70
+ export type SubsitePaletteMode = z.infer<typeof SubsitePaletteModeSchema>;
71
+ /**
72
+ * 用户锁定的色值。只接受 `#rrggbb`——界面给的是取色器,出来就是十六进制;
73
+ * 模型面 schema 允许 CSS 颜色名是给模型的宽容度,用户输入不需要那份宽容。
74
+ *
75
+ * **刻意不做 transform**:schema effect 会让 `z.toJSONSchema` 抛错,连带炸掉
76
+ * OpenAPI 文档生成(与 `SubsiteGlossaryEntrySchema` 同一条约束)。
77
+ */
78
+ export declare const SubsiteHexColorSchema: z.ZodString;
79
+ /**
80
+ * 四个角色与 `DesignColorSeeds` 一一对应,不自造一套命名。**逐槽可选**:
81
+ * 填了的槽服务端强制覆盖模型产出,空槽交给模型按目标地区补齐。
82
+ */
83
+ export declare const SubsitePaletteSeedsSchema: z.ZodObject<{
84
+ primary: z.ZodOptional<z.ZodString>;
85
+ accent: z.ZodOptional<z.ZodString>;
86
+ foreground: z.ZodOptional<z.ZodString>;
87
+ neutral: z.ZodOptional<z.ZodString>;
88
+ }, z.core.$strip>;
89
+ export type SubsitePaletteSeeds = z.infer<typeof SubsitePaletteSeedsSchema>;
90
+ /** 风格补充说明的长度上限。整段进用户提示词,必须有上界。 */
91
+ export declare const SUBSITE_PALETTE_NOTE_MAX_CHARS = 600;
92
+ export declare const SubsitePaletteLocalizationSchema: z.ZodObject<{
93
+ mode: z.ZodDefault<z.ZodEnum<{
94
+ regional: "regional";
95
+ fonts_only: "fonts_only";
96
+ }>>;
97
+ seeds: z.ZodOptional<z.ZodObject<{
98
+ primary: z.ZodOptional<z.ZodString>;
99
+ accent: z.ZodOptional<z.ZodString>;
100
+ foreground: z.ZodOptional<z.ZodString>;
101
+ neutral: z.ZodOptional<z.ZodString>;
102
+ }, z.core.$strip>>;
103
+ note: z.ZodOptional<z.ZodString>;
104
+ }, z.core.$strip>;
105
+ export type SubsitePaletteLocalization = z.infer<typeof SubsitePaletteLocalizationSchema>;
106
+ /**
107
+ * 缺省档位。
108
+ *
109
+ * 存在的理由是一个容易踩的 zod 行为:上游把整个 `palette` 声明成 `.optional()`
110
+ * 之后,字段整体缺席时解析结果是 `undefined`,内层 `mode` 的 `.default()`
111
+ * **根本没机会触发**。若不在服务端显式补这一格,`undefined` 会一路传到底,
112
+ * 而下游每一层都得自己猜「空了算哪档」——同样的请求会产出不同结果。
113
+ */
114
+ export declare const DEFAULT_SUBSITE_PALETTE: SubsitePaletteLocalization;
115
+ /**
116
+ * 是否锁了至少一个色值槽。
117
+ *
118
+ * 两个使用点共用:公网入口据此拒绝「只改字体 + 又锁了色值」这种矛盾输入;
119
+ * 决策侧据此决定要不要逐槽压掉模型的颜色产出。
120
+ */
121
+ export declare function hasLockedSeeds(seeds: SubsitePaletteSeeds | undefined): boolean;
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * 子站挂载路径合同(设计 5.3 约束 3):单层、小写、带前导斜杠、不带尾斜杠,
4
+ * 形如 `/fr`。三个校验点——apps/api 公网入口(subsites.controller)、
5
+ * apps/api 内部回写(internal-subsites.controller)、subsite-service 入队
6
+ * (subsite-jobs.controller)——共用本文件,口径只此一份。
7
+ */
8
+ export declare const SUBSITE_MOUNT_PATH_PATTERN: RegExp;
9
+ /**
10
+ * 设计 5.4 保留段清单:主站基础设施占用的一级路径,不得作为 `mount_path`。
11
+ * `_next` / `robots.txt` / `sitemap.xml` / `.well-known` 当前已被字符集正则
12
+ * 天然挡掉(下划线与点号不在集合内),仍全量列出——保留段语义不依赖正则的
13
+ * 具体收紧程度,正则将来放宽(如允许点号后缀)时清单继续兜底。
14
+ */
15
+ export declare const SUBSITE_RESERVED_MOUNT_SEGMENTS: readonly ["api", "_next", "assets", "static", "robots.txt", "sitemap.xml", ".well-known"];
16
+ /** 传入不带前导斜杠的一级段(如 `api`)。 */
17
+ export declare function isReservedSubsiteMountSegment(segment: string): boolean;
18
+ /**
19
+ * 唯一的 `mount_path` 校验 schema:形态正则 + 保留段拦截。
20
+ * 刻意不做 transform(schema effect 会让 `z.toJSONSchema` 抛错,
21
+ * 连带炸掉 OpenAPI 文档生成),refine 仅校验不改值。
22
+ */
23
+ export declare const SubsiteMountPathSchema: z.ZodString;
@@ -0,0 +1,76 @@
1
+ import { z } from "zod";
2
+ /** 一份快照在 store 上的定位坐标。**没有 store 根**:那是被调用方自己的挂载点。 */
3
+ declare const SnapshotRefSchema: z.ZodObject<{
4
+ snapshot_id: z.ZodString;
5
+ object_key: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export type SubsiteSyncDiffSnapshotRef = z.infer<typeof SnapshotRefSchema>;
8
+ /**
9
+ * 请求体。`base` 是子站当前快照(差集的被减数),`target` 是主站目标快照
10
+ * (已发布优先,未发布回落 current)——两者都由 apps/api 在带 `tenant_id` 过滤的
11
+ * where 下解析出来,是「跨租户 object key 不可能出现」这条保证的唯一来源。
12
+ *
13
+ * 刻意**不接受** `sync_enabled`:那是主库 `sites` 上的用户开关,subsite-service
14
+ * 不读主库、对它没有任何裁决权。让它在这条通道上来回一趟只会让人误以为编排服务
15
+ * 参与了那个判断。开关状态由 apps/api 自己补进对外响应。
16
+ */
17
+ export declare const SubsiteSyncDiffComputeRequestSchema: z.ZodObject<{
18
+ tenant_id: z.ZodString;
19
+ parent_site_id: z.ZodString;
20
+ subsite_site_id: z.ZodString;
21
+ base: z.ZodObject<{
22
+ snapshot_id: z.ZodString;
23
+ object_key: z.ZodString;
24
+ }, z.core.$strip>;
25
+ target: z.ZodObject<{
26
+ snapshot_id: z.ZodString;
27
+ object_key: z.ZodString;
28
+ }, z.core.$strip>;
29
+ }, z.core.$strip>;
30
+ export type SubsiteSyncDiffComputeRequest = z.infer<typeof SubsiteSyncDiffComputeRequestSchema>;
31
+ /**
32
+ * 响应体。**绝不回带 `object_key`、store 绝对路径或内部堆栈**:调用方(apps/api)
33
+ * 那两个值本来就是自己传进去的,回显它们只会平白多一条把挂载点形状泄漏出去的路。
34
+ *
35
+ * `hash_diverged_count` / `child_only_count` 是原始读数,只出计数不出路径清单
36
+ * ——子站文件是主站文件的译文,同路径 hash 天然不同,把它当「主站改了 N 页」展示
37
+ * 是 100% 误报(口径见 apps/api 的 `SubsiteSyncDiffResponseSchema` 描述)。
38
+ */
39
+ export declare const SubsiteSyncDiffComputeResponseSchema: z.ZodObject<{
40
+ subsite_site_id: z.ZodString;
41
+ pending_pages: z.ZodArray<z.ZodString>;
42
+ hash_diverged_count: z.ZodNumber;
43
+ child_only_count: z.ZodNumber;
44
+ base_snapshot_id: z.ZodString;
45
+ target_snapshot_id: z.ZodString;
46
+ }, z.core.$strip>;
47
+ export type SubsiteSyncDiffComputeResponse = z.infer<typeof SubsiteSyncDiffComputeResponseSchema>;
48
+ /**
49
+ * 编排服务在读不出清单时返回的结构化错误码。
50
+ *
51
+ * **缺失或不可读的清单永远是错误,绝不退化成 `pending_pages: []`**——调用方拿到
52
+ * 一个空清单必须能确定那就是「真没有待同步页面」。`side` 让 apps/api 把失败归回
53
+ * 子站侧还是主站侧,两侧的既有错误码因此一个字都不用改。
54
+ */
55
+ export declare const SubsiteSyncDiffErrorCodeSchema: z.ZodEnum<{
56
+ SUBSITE_DIFF_REQUEST_INVALID: "SUBSITE_DIFF_REQUEST_INVALID";
57
+ SUBSITE_DIFF_STORE_NOT_CONFIGURED: "SUBSITE_DIFF_STORE_NOT_CONFIGURED";
58
+ SUBSITE_DIFF_MANIFEST_MISSING: "SUBSITE_DIFF_MANIFEST_MISSING";
59
+ SUBSITE_DIFF_MANIFEST_INVALID: "SUBSITE_DIFF_MANIFEST_INVALID";
60
+ }>;
61
+ export type SubsiteSyncDiffErrorCode = z.infer<typeof SubsiteSyncDiffErrorCodeSchema>;
62
+ export declare const SubsiteSyncDiffErrorResponseSchema: z.ZodObject<{
63
+ error_code: z.ZodEnum<{
64
+ SUBSITE_DIFF_REQUEST_INVALID: "SUBSITE_DIFF_REQUEST_INVALID";
65
+ SUBSITE_DIFF_STORE_NOT_CONFIGURED: "SUBSITE_DIFF_STORE_NOT_CONFIGURED";
66
+ SUBSITE_DIFF_MANIFEST_MISSING: "SUBSITE_DIFF_MANIFEST_MISSING";
67
+ SUBSITE_DIFF_MANIFEST_INVALID: "SUBSITE_DIFF_MANIFEST_INVALID";
68
+ }>;
69
+ message: z.ZodString;
70
+ side: z.ZodOptional<z.ZodEnum<{
71
+ target: "target";
72
+ base: "base";
73
+ }>>;
74
+ }, z.core.$strip>;
75
+ export type SubsiteSyncDiffErrorResponse = z.infer<typeof SubsiteSyncDiffErrorResponseSchema>;
76
+ export {};
@@ -0,0 +1,34 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * apps/api 调用 subsite-service 导出站点静态可见文本时的内部合同。
4
+ * tenant_id 是主库 text 主键(例如 tenant_dev),不是 UUID。
5
+ */
6
+ export declare const SubsiteVisibleTextExportRequestSchema: z.ZodObject<{
7
+ tenant_id: z.ZodString;
8
+ site_id: z.ZodUUID;
9
+ snapshot_id: z.ZodUUID;
10
+ manifest_hash: z.ZodString;
11
+ object_key: z.ZodString;
12
+ page_slug: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strip>;
14
+ export type SubsiteVisibleTextExportRequest = z.infer<typeof SubsiteVisibleTextExportRequestSchema>;
15
+ /** 内部服务返回 Markdown 正文及可审计计数;公网接口只下载 markdown 字段。 */
16
+ export declare const SubsiteVisibleTextExportResponseSchema: z.ZodObject<{
17
+ site_id: z.ZodUUID;
18
+ snapshot_id: z.ZodUUID;
19
+ unit_count: z.ZodNumber;
20
+ file_count: z.ZodNumber;
21
+ markdown: z.ZodString;
22
+ page_slug: z.ZodOptional<z.ZodString>;
23
+ page_file: z.ZodOptional<z.ZodString>;
24
+ entries: z.ZodOptional<z.ZodArray<z.ZodObject<{
25
+ id: z.ZodString;
26
+ file_path: z.ZodString;
27
+ line: z.ZodNullable<z.ZodNumber>;
28
+ kind: z.ZodString;
29
+ text: z.ZodString;
30
+ media_key: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>>>;
32
+ }, z.core.$strip>;
33
+ export type SubsiteVisibleTextEntry = NonNullable<z.infer<typeof SubsiteVisibleTextExportResponseSchema>["entries"]>[number];
34
+ export type SubsiteVisibleTextExportResponse = z.infer<typeof SubsiteVisibleTextExportResponseSchema>;
@@ -19,8 +19,8 @@ export declare const TemplateUpgradeValidationStageSchema: z.ZodEnum<{
19
19
  }>;
20
20
  export type TemplateUpgradeValidationStage = z.infer<typeof TemplateUpgradeValidationStageSchema>;
21
21
  export declare const TemplateUpgradeCasOutcomeSchema: z.ZodEnum<{
22
- not_attempted: "not_attempted";
23
22
  promoted: "promoted";
23
+ not_attempted: "not_attempted";
24
24
  aborted: "aborted";
25
25
  }>;
26
26
  export type TemplateUpgradeCasOutcome = z.infer<typeof TemplateUpgradeCasOutcomeSchema>;
@@ -50,8 +50,8 @@ export declare const RecordTemplateUpgradeEventRequestSchema: z.ZodObject<{
50
50
  validation: "validation";
51
51
  }>>;
52
52
  cas_outcome: z.ZodNullable<z.ZodEnum<{
53
- not_attempted: "not_attempted";
54
53
  promoted: "promoted";
54
+ not_attempted: "not_attempted";
55
55
  aborted: "aborted";
56
56
  }>>;
57
57
  }, z.core.$strict>;
@@ -6,13 +6,68 @@
6
6
  * resources (workspace ns, keyed by preset id) and switch with the locale;
7
7
  * the preset itself only holds stable data (id + seeds), never a label.
8
8
  */
9
- export type ThemePresetId = "ocean" | "forest" | "clay" | "violet" | "graphite" | "crimson";
9
+ import type { SiteDesignRadiusId } from "./site-design-presets.js";
10
+ export declare const THEME_PRESET_IDS: readonly ["ocean", "forest", "clay", "violet", "graphite", "crimson"];
11
+ export type ThemePresetId = (typeof THEME_PRESET_IDS)[number];
12
+ /**
13
+ * 旧 Step6 AI 目录的主题 id(`ai-*`)。生成式主题卡上线后不再有新推荐使用
14
+ * 这些 id,仅保留给存量 selection 行与历史推荐读取兼容(schema 并集的一员)。
15
+ */
16
+ export declare const STEP6_AI_THEME_IDS: readonly ["ai-forest", "ai-navy", "ai-steel"];
17
+ export type Step6AiThemeId = (typeof STEP6_AI_THEME_IDS)[number];
18
+ /**
19
+ * 生成式主题卡 id:API 侧按卡片内容确定性派生(见 step6-design.service 的
20
+ * 拼接序列化),形状 `gen-` + 8 位小写 hex。内容相同则 id 相同。
21
+ */
22
+ export declare const STEP6_GENERATED_THEME_ID_PATTERN: RegExp;
23
+ export type Step6GeneratedThemeId = `gen-${string}`;
24
+ export type SiteDesignThemeId = ThemePresetId | Step6AiThemeId | Step6GeneratedThemeId;
10
25
  export interface ThemePreset {
11
26
  /** Stable identity; the i18n display name keys off this. */
12
27
  id: ThemePresetId;
13
28
  colorSeeds: {
14
29
  primary: string;
15
30
  accent: string;
31
+ foreground: string;
16
32
  };
33
+ surfaceMode: "light" | "dark";
34
+ /**
35
+ * 该主题的默认圆角档位。用户在 Step6 换主题时随之带出,
36
+ * 之后仍可单独调整;调整过就不再被换主题覆盖。
37
+ */
38
+ radius: SiteDesignRadiusId;
17
39
  }
40
+ export interface Step6AiThemePreset {
41
+ /**
42
+ * 旧目录 id(`ai-*`)。新推荐不再使用——生成卡用 `gen-*` id、fallback 卡也按
43
+ * 内容派生 `gen-*` id。保留该字段只为记录每套 fallback 内容对应的旧目录身份,
44
+ * 并让 `getSiteDesignThemeRadius` 能回答存量 `ai-*` 选择的圆角回退。
45
+ */
46
+ id: Step6AiThemeId;
47
+ name: string;
48
+ description: string;
49
+ /** fallback 卡的原因文案(为什么这套适合作为默认兜底)。 */
50
+ fallbackReason: string;
51
+ colorSeeds: {
52
+ primary: string;
53
+ accent: string;
54
+ foreground: string;
55
+ };
56
+ surfaceMode: "light" | "dark";
57
+ radius: SiteDesignRadiusId;
58
+ }
59
+ /**
60
+ * Step6 设计推荐的 deterministic fallback 内容:模型生成连续失败时,API 侧用
61
+ * 这三套人工调过的锚点造卡(`buildStep6FallbackThemeCards`),保证「卡必达」。
62
+ * 不再是模型排序的目录——生成式方案里颜色由模型按站点现场 authoring。
63
+ */
64
+ export declare const STEP6_AI_THEME_PRESETS: readonly Step6AiThemePreset[];
18
65
  export declare const THEME_PRESETS: readonly ThemePreset[];
66
+ export declare function getThemePreset(id: ThemePresetId): ThemePreset;
67
+ /**
68
+ * 主题(含存量 `ai-*` 候选)对应的默认圆角档位。id 不认识时返回 undefined,
69
+ * 由调用方决定回退,避免在合同层吞掉未知主题。生成卡(`gen-*`)自带 radius,
70
+ * 不走这里。入参放宽为 string:zod 的 regex schema 推断类型是 string,
71
+ * 本函数只做查表,不认识就 undefined。
72
+ */
73
+ export declare function getSiteDesignThemeRadius(id: string): SiteDesignRadiusId | undefined;
@@ -4,7 +4,12 @@ export declare const WorkspaceDesignApplyRequestSchema: z.ZodObject<{
4
4
  colorSeeds: z.ZodOptional<z.ZodObject<{
5
5
  primary: z.ZodString;
6
6
  accent: z.ZodString;
7
+ foreground: z.ZodOptional<z.ZodString>;
7
8
  }, z.core.$strict>>;
9
+ surfaceMode: z.ZodOptional<z.ZodEnum<{
10
+ light: "light";
11
+ dark: "dark";
12
+ }>>;
8
13
  fonts: z.ZodOptional<z.ZodObject<{
9
14
  heading: z.ZodString;
10
15
  body: z.ZodString;
@@ -35,7 +35,10 @@ export declare const WorkspaceResourceOperationTransientInputSchema: z.ZodObject
35
35
  id: z.ZodString;
36
36
  siteId: z.ZodUUID;
37
37
  baseSnapshotId: z.ZodUUID;
38
- routeId: z.ZodOptional<z.ZodString>;
38
+ composition: z.ZodObject<{
39
+ routeId: z.ZodString;
40
+ templateId: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strict>;
39
42
  kind: z.ZodEnum<{
40
43
  "insert-child": "insert-child";
41
44
  "update-text": "update-text";
@@ -52,20 +55,26 @@ export declare const WorkspaceResourceOperationTransientInputSchema: z.ZodObject
52
55
  target: z.ZodDiscriminatedUnion<[z.ZodObject<{
53
56
  kind: z.ZodLiteral<"node">;
54
57
  key: z.ZodString;
55
- }, z.core.$strip>, z.ZodObject<{
58
+ }, z.core.$strict>, z.ZodObject<{
56
59
  kind: z.ZodLiteral<"page-unit">;
57
- routeId: z.ZodString;
60
+ composition: z.ZodObject<{
61
+ routeId: z.ZodString;
62
+ templateId: z.ZodOptional<z.ZodString>;
63
+ }, z.core.$strict>;
58
64
  placementUnitKey: z.ZodString;
59
65
  }, z.core.$strict>, z.ZodObject<{
60
66
  kind: z.ZodLiteral<"route">;
61
- routeId: z.ZodString;
62
- }, z.core.$strip>, z.ZodObject<{
67
+ composition: z.ZodObject<{
68
+ routeId: z.ZodString;
69
+ templateId: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strict>;
71
+ }, z.core.$strict>, z.ZodObject<{
63
72
  kind: z.ZodLiteral<"source-file">;
64
73
  path: z.ZodString;
65
- }, z.core.$strip>, z.ZodObject<{
74
+ }, z.core.$strict>, z.ZodObject<{
66
75
  kind: z.ZodLiteral<"source-batch">;
67
76
  paths: z.ZodArray<z.ZodString>;
68
- }, z.core.$strip>, z.ZodObject<{
77
+ }, z.core.$strict>, z.ZodObject<{
69
78
  kind: z.ZodLiteral<"project">;
70
79
  }, z.core.$strict>], "kind">;
71
80
  documentVersion: z.ZodNumber;
@@ -144,7 +153,10 @@ export declare const WorkspaceResourceOperationTransientInputSchema: z.ZodObject
144
153
  kind: z.ZodLiteral<"page-composition">;
145
154
  placementKey: z.ZodString;
146
155
  documentVersion: z.ZodNumber;
147
- routeId: z.ZodString;
156
+ composition: z.ZodObject<{
157
+ routeId: z.ZodString;
158
+ templateId: z.ZodOptional<z.ZodString>;
159
+ }, z.core.$strict>;
148
160
  placementUnitKey: z.ZodString;
149
161
  relation: z.ZodEnum<{
150
162
  before: "before";
@@ -156,6 +168,10 @@ export declare const WorkspaceResourceOperationTransientInputSchema: z.ZodObject
156
168
  kind: z.ZodLiteral<"page-composition">;
157
169
  placementKey: z.ZodString;
158
170
  documentVersion: z.ZodNumber;
171
+ composition: z.ZodObject<{
172
+ routeId: z.ZodString;
173
+ templateId: z.ZodOptional<z.ZodString>;
174
+ }, z.core.$strict>;
159
175
  }, z.core.$strict>]>;
160
176
  }, z.core.$strip>, z.ZodObject<{
161
177
  kind: z.ZodLiteral<"move-node">;
@@ -175,7 +191,10 @@ export declare const WorkspaceResourceOperationTransientInputSchema: z.ZodObject
175
191
  kind: z.ZodLiteral<"page-composition">;
176
192
  placementKey: z.ZodString;
177
193
  documentVersion: z.ZodNumber;
178
- routeId: z.ZodString;
194
+ composition: z.ZodObject<{
195
+ routeId: z.ZodString;
196
+ templateId: z.ZodOptional<z.ZodString>;
197
+ }, z.core.$strict>;
179
198
  placementUnitKey: z.ZodString;
180
199
  relation: z.ZodEnum<{
181
200
  before: "before";
@@ -187,7 +206,6 @@ export declare const WorkspaceResourceOperationTransientInputSchema: z.ZodObject
187
206
  preserveBindings: z.ZodOptional<z.ZodBoolean>;
188
207
  }, z.core.$strip>, z.ZodObject<{
189
208
  kind: z.ZodLiteral<"set-class-name-source">;
190
- routeId: z.ZodOptional<z.ZodString>;
191
209
  filePath: z.ZodString;
192
210
  expectedVersion: z.ZodObject<{
193
211
  documentVersion: z.ZodNumber;
@@ -228,7 +246,6 @@ export declare const WorkspaceResourceOperationTransientInputSchema: z.ZodObject
228
246
  }, z.core.$strip>, z.ZodObject<{
229
247
  kind: z.ZodLiteral<"apply-style-draft">;
230
248
  className: z.ZodOptional<z.ZodObject<{
231
- routeId: z.ZodOptional<z.ZodString>;
232
249
  filePath: z.ZodString;
233
250
  expectedVersion: z.ZodObject<{
234
251
  documentVersion: z.ZodNumber;
@@ -350,7 +367,7 @@ export declare const WorkspaceResourceOperationTransientInputSchema: z.ZodObject
350
367
  kind: z.ZodLiteral<"delete-page-source">;
351
368
  expectedUrlPath: z.ZodString;
352
369
  }, z.core.$strict>], "kind">;
353
- }, z.core.$strip>;
370
+ }, z.core.$strict>;
354
371
  navigation_selection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
355
372
  kind: z.ZodLiteral<"none">;
356
373
  }, z.core.$strict>, z.ZodObject<{
@@ -391,7 +408,10 @@ export declare const WorkspaceResourceOperationClientMessageSchema: z.ZodObject<
391
408
  id: z.ZodString;
392
409
  siteId: z.ZodUUID;
393
410
  baseSnapshotId: z.ZodUUID;
394
- routeId: z.ZodOptional<z.ZodString>;
411
+ composition: z.ZodObject<{
412
+ routeId: z.ZodString;
413
+ templateId: z.ZodOptional<z.ZodString>;
414
+ }, z.core.$strict>;
395
415
  kind: z.ZodEnum<{
396
416
  "insert-child": "insert-child";
397
417
  "update-text": "update-text";
@@ -408,20 +428,26 @@ export declare const WorkspaceResourceOperationClientMessageSchema: z.ZodObject<
408
428
  target: z.ZodDiscriminatedUnion<[z.ZodObject<{
409
429
  kind: z.ZodLiteral<"node">;
410
430
  key: z.ZodString;
411
- }, z.core.$strip>, z.ZodObject<{
431
+ }, z.core.$strict>, z.ZodObject<{
412
432
  kind: z.ZodLiteral<"page-unit">;
413
- routeId: z.ZodString;
433
+ composition: z.ZodObject<{
434
+ routeId: z.ZodString;
435
+ templateId: z.ZodOptional<z.ZodString>;
436
+ }, z.core.$strict>;
414
437
  placementUnitKey: z.ZodString;
415
438
  }, z.core.$strict>, z.ZodObject<{
416
439
  kind: z.ZodLiteral<"route">;
417
- routeId: z.ZodString;
418
- }, z.core.$strip>, z.ZodObject<{
440
+ composition: z.ZodObject<{
441
+ routeId: z.ZodString;
442
+ templateId: z.ZodOptional<z.ZodString>;
443
+ }, z.core.$strict>;
444
+ }, z.core.$strict>, z.ZodObject<{
419
445
  kind: z.ZodLiteral<"source-file">;
420
446
  path: z.ZodString;
421
- }, z.core.$strip>, z.ZodObject<{
447
+ }, z.core.$strict>, z.ZodObject<{
422
448
  kind: z.ZodLiteral<"source-batch">;
423
449
  paths: z.ZodArray<z.ZodString>;
424
- }, z.core.$strip>, z.ZodObject<{
450
+ }, z.core.$strict>, z.ZodObject<{
425
451
  kind: z.ZodLiteral<"project">;
426
452
  }, z.core.$strict>], "kind">;
427
453
  documentVersion: z.ZodNumber;
@@ -500,7 +526,10 @@ export declare const WorkspaceResourceOperationClientMessageSchema: z.ZodObject<
500
526
  kind: z.ZodLiteral<"page-composition">;
501
527
  placementKey: z.ZodString;
502
528
  documentVersion: z.ZodNumber;
503
- routeId: z.ZodString;
529
+ composition: z.ZodObject<{
530
+ routeId: z.ZodString;
531
+ templateId: z.ZodOptional<z.ZodString>;
532
+ }, z.core.$strict>;
504
533
  placementUnitKey: z.ZodString;
505
534
  relation: z.ZodEnum<{
506
535
  before: "before";
@@ -512,6 +541,10 @@ export declare const WorkspaceResourceOperationClientMessageSchema: z.ZodObject<
512
541
  kind: z.ZodLiteral<"page-composition">;
513
542
  placementKey: z.ZodString;
514
543
  documentVersion: z.ZodNumber;
544
+ composition: z.ZodObject<{
545
+ routeId: z.ZodString;
546
+ templateId: z.ZodOptional<z.ZodString>;
547
+ }, z.core.$strict>;
515
548
  }, z.core.$strict>]>;
516
549
  }, z.core.$strip>, z.ZodObject<{
517
550
  kind: z.ZodLiteral<"move-node">;
@@ -531,7 +564,10 @@ export declare const WorkspaceResourceOperationClientMessageSchema: z.ZodObject<
531
564
  kind: z.ZodLiteral<"page-composition">;
532
565
  placementKey: z.ZodString;
533
566
  documentVersion: z.ZodNumber;
534
- routeId: z.ZodString;
567
+ composition: z.ZodObject<{
568
+ routeId: z.ZodString;
569
+ templateId: z.ZodOptional<z.ZodString>;
570
+ }, z.core.$strict>;
535
571
  placementUnitKey: z.ZodString;
536
572
  relation: z.ZodEnum<{
537
573
  before: "before";
@@ -543,7 +579,6 @@ export declare const WorkspaceResourceOperationClientMessageSchema: z.ZodObject<
543
579
  preserveBindings: z.ZodOptional<z.ZodBoolean>;
544
580
  }, z.core.$strip>, z.ZodObject<{
545
581
  kind: z.ZodLiteral<"set-class-name-source">;
546
- routeId: z.ZodOptional<z.ZodString>;
547
582
  filePath: z.ZodString;
548
583
  expectedVersion: z.ZodObject<{
549
584
  documentVersion: z.ZodNumber;
@@ -584,7 +619,6 @@ export declare const WorkspaceResourceOperationClientMessageSchema: z.ZodObject<
584
619
  }, z.core.$strip>, z.ZodObject<{
585
620
  kind: z.ZodLiteral<"apply-style-draft">;
586
621
  className: z.ZodOptional<z.ZodObject<{
587
- routeId: z.ZodOptional<z.ZodString>;
588
622
  filePath: z.ZodString;
589
623
  expectedVersion: z.ZodObject<{
590
624
  documentVersion: z.ZodNumber;
@@ -706,7 +740,7 @@ export declare const WorkspaceResourceOperationClientMessageSchema: z.ZodObject<
706
740
  kind: z.ZodLiteral<"delete-page-source">;
707
741
  expectedUrlPath: z.ZodString;
708
742
  }, z.core.$strict>], "kind">;
709
- }, z.core.$strip>;
743
+ }, z.core.$strict>;
710
744
  navigation_selection: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
711
745
  kind: z.ZodLiteral<"none">;
712
746
  }, z.core.$strict>, z.ZodObject<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcp-dev/contracts",
3
- "version": "0.6.11",
3
+ "version": "0.7.1",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {