designmaker-cli 0.1.0

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 (154) hide show
  1. package/dist/commands/doctor.d.ts +1 -0
  2. package/dist/commands/doctor.js +26 -0
  3. package/dist/commands/doctor.js.map +1 -0
  4. package/dist/commands/import.d.ts +1 -0
  5. package/dist/commands/import.js +45 -0
  6. package/dist/commands/import.js.map +1 -0
  7. package/dist/commands/rebuild.d.ts +1 -0
  8. package/dist/commands/rebuild.js +32 -0
  9. package/dist/commands/rebuild.js.map +1 -0
  10. package/dist/commands/start.d.ts +1 -0
  11. package/dist/commands/start.js +103 -0
  12. package/dist/commands/start.js.map +1 -0
  13. package/dist/index.d.ts +2 -0
  14. package/dist/index.js +65 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/lib/ai/build-annotation-prompt.d.ts +6 -0
  17. package/dist/lib/ai/build-annotation-prompt.js +40 -0
  18. package/dist/lib/ai/build-annotation-prompt.js.map +1 -0
  19. package/dist/lib/ai/providers/index.d.ts +10 -0
  20. package/dist/lib/ai/providers/index.js +27 -0
  21. package/dist/lib/ai/providers/index.js.map +1 -0
  22. package/dist/lib/ai/providers/openai.d.ts +9 -0
  23. package/dist/lib/ai/providers/openai.js +77 -0
  24. package/dist/lib/ai/providers/openai.js.map +1 -0
  25. package/dist/lib/ai/providers/response-schema.d.ts +159 -0
  26. package/dist/lib/ai/providers/response-schema.js +21 -0
  27. package/dist/lib/ai/providers/response-schema.js.map +1 -0
  28. package/dist/lib/annotations/annotation-generator.d.ts +9 -0
  29. package/dist/lib/annotations/annotation-generator.js +90 -0
  30. package/dist/lib/annotations/annotation-generator.js.map +1 -0
  31. package/dist/lib/annotations/run-annotation-generation.d.ts +13 -0
  32. package/dist/lib/annotations/run-annotation-generation.js +52 -0
  33. package/dist/lib/annotations/run-annotation-generation.js.map +1 -0
  34. package/dist/lib/bundle/annotated-bundle.d.ts +15 -0
  35. package/dist/lib/bundle/annotated-bundle.js +63 -0
  36. package/dist/lib/bundle/annotated-bundle.js.map +1 -0
  37. package/dist/lib/bundle/shell-dist.d.ts +1 -0
  38. package/dist/lib/bundle/shell-dist.js +29 -0
  39. package/dist/lib/bundle/shell-dist.js.map +1 -0
  40. package/dist/lib/config.d.ts +13 -0
  41. package/dist/lib/config.js +84 -0
  42. package/dist/lib/config.js.map +1 -0
  43. package/dist/lib/doctor/doctor-checks.d.ts +12 -0
  44. package/dist/lib/doctor/doctor-checks.js +98 -0
  45. package/dist/lib/doctor/doctor-checks.js.map +1 -0
  46. package/dist/lib/env.d.ts +1 -0
  47. package/dist/lib/env.js +5 -0
  48. package/dist/lib/env.js.map +1 -0
  49. package/dist/lib/logger.d.ts +6 -0
  50. package/dist/lib/logger.js +15 -0
  51. package/dist/lib/logger.js.map +1 -0
  52. package/dist/lib/project/detect-artifacts.d.ts +1 -0
  53. package/dist/lib/project/detect-artifacts.js +10 -0
  54. package/dist/lib/project/detect-artifacts.js.map +1 -0
  55. package/dist/lib/project/detect-framework.d.ts +3 -0
  56. package/dist/lib/project/detect-framework.js +14 -0
  57. package/dist/lib/project/detect-framework.js.map +1 -0
  58. package/dist/lib/project/detect-package-manager.d.ts +3 -0
  59. package/dist/lib/project/detect-package-manager.js +33 -0
  60. package/dist/lib/project/detect-package-manager.js.map +1 -0
  61. package/dist/lib/project/detect-scripts.d.ts +6 -0
  62. package/dist/lib/project/detect-scripts.js +8 -0
  63. package/dist/lib/project/detect-scripts.js.map +1 -0
  64. package/dist/lib/project/package-json.d.ts +23 -0
  65. package/dist/lib/project/package-json.js +20 -0
  66. package/dist/lib/project/package-json.js.map +1 -0
  67. package/dist/lib/project/project-scan.d.ts +2 -0
  68. package/dist/lib/project/project-scan.js +35 -0
  69. package/dist/lib/project/project-scan.js.map +1 -0
  70. package/dist/lib/prompt/is-tty.d.ts +1 -0
  71. package/dist/lib/prompt/is-tty.js +5 -0
  72. package/dist/lib/prompt/is-tty.js.map +1 -0
  73. package/dist/lib/prototype/browser.d.ts +2 -0
  74. package/dist/lib/prototype/browser.js +5 -0
  75. package/dist/lib/prototype/browser.js.map +1 -0
  76. package/dist/lib/prototype/capture-all-pages.d.ts +13 -0
  77. package/dist/lib/prototype/capture-all-pages.js +22 -0
  78. package/dist/lib/prototype/capture-all-pages.js.map +1 -0
  79. package/dist/lib/prototype/dom-summary.d.ts +3 -0
  80. package/dist/lib/prototype/dom-summary.js +56 -0
  81. package/dist/lib/prototype/dom-summary.js.map +1 -0
  82. package/dist/lib/prototype/page-capture.d.ts +6 -0
  83. package/dist/lib/prototype/page-capture.js +36 -0
  84. package/dist/lib/prototype/page-capture.js.map +1 -0
  85. package/dist/lib/prototype/page-metadata.d.ts +7 -0
  86. package/dist/lib/prototype/page-metadata.js +9 -0
  87. package/dist/lib/prototype/page-metadata.js.map +1 -0
  88. package/dist/lib/prototype/prototype-session.d.ts +22 -0
  89. package/dist/lib/prototype/prototype-session.js +82 -0
  90. package/dist/lib/prototype/prototype-session.js.map +1 -0
  91. package/dist/lib/prototype/run-package-script.d.ts +2 -0
  92. package/dist/lib/prototype/run-package-script.js +21 -0
  93. package/dist/lib/prototype/run-package-script.js.map +1 -0
  94. package/dist/lib/prototype/start-static-preview.d.ts +5 -0
  95. package/dist/lib/prototype/start-static-preview.js +74 -0
  96. package/dist/lib/prototype/start-static-preview.js.map +1 -0
  97. package/dist/lib/prototype/startup-strategy.d.ts +7 -0
  98. package/dist/lib/prototype/startup-strategy.js +32 -0
  99. package/dist/lib/prototype/startup-strategy.js.map +1 -0
  100. package/dist/lib/prototype/visible-text.d.ts +2 -0
  101. package/dist/lib/prototype/visible-text.js +5 -0
  102. package/dist/lib/prototype/visible-text.js.map +1 -0
  103. package/dist/lib/prototype/wait-for-url.d.ts +1 -0
  104. package/dist/lib/prototype/wait-for-url.js +16 -0
  105. package/dist/lib/prototype/wait-for-url.js.map +1 -0
  106. package/dist/lib/requirements/parse-file.d.ts +1 -0
  107. package/dist/lib/requirements/parse-file.js +7 -0
  108. package/dist/lib/requirements/parse-file.js.map +1 -0
  109. package/dist/lib/requirements/parse-text.d.ts +1 -0
  110. package/dist/lib/requirements/parse-text.js +4 -0
  111. package/dist/lib/requirements/parse-text.js.map +1 -0
  112. package/dist/lib/requirements/requirements-discovery.d.ts +2 -0
  113. package/dist/lib/requirements/requirements-discovery.js +62 -0
  114. package/dist/lib/requirements/requirements-discovery.js.map +1 -0
  115. package/dist/lib/requirements/requirements-ranking.d.ts +1 -0
  116. package/dist/lib/requirements/requirements-ranking.js +41 -0
  117. package/dist/lib/requirements/requirements-ranking.js.map +1 -0
  118. package/dist/lib/routes/confirm-ai-routes.d.ts +10 -0
  119. package/dist/lib/routes/confirm-ai-routes.js +70 -0
  120. package/dist/lib/routes/confirm-ai-routes.js.map +1 -0
  121. package/dist/lib/routes/crawl-internal-links.d.ts +4 -0
  122. package/dist/lib/routes/crawl-internal-links.js +42 -0
  123. package/dist/lib/routes/crawl-internal-links.js.map +1 -0
  124. package/dist/lib/routes/normalize-route-path.d.ts +5 -0
  125. package/dist/lib/routes/normalize-route-path.js +52 -0
  126. package/dist/lib/routes/normalize-route-path.js.map +1 -0
  127. package/dist/lib/routes/resolve-capture-routes.d.ts +18 -0
  128. package/dist/lib/routes/resolve-capture-routes.js +47 -0
  129. package/dist/lib/routes/resolve-capture-routes.js.map +1 -0
  130. package/dist/lib/routes/routes-config.d.ts +21 -0
  131. package/dist/lib/routes/routes-config.js +31 -0
  132. package/dist/lib/routes/routes-config.js.map +1 -0
  133. package/dist/lib/workspace/paths.d.ts +8 -0
  134. package/dist/lib/workspace/paths.js +19 -0
  135. package/dist/lib/workspace/paths.js.map +1 -0
  136. package/dist/lib/workspace/read-json.d.ts +2 -0
  137. package/dist/lib/workspace/read-json.js +26 -0
  138. package/dist/lib/workspace/read-json.js.map +1 -0
  139. package/dist/lib/workspace/schema.d.ts +355 -0
  140. package/dist/lib/workspace/schema.js +71 -0
  141. package/dist/lib/workspace/schema.js.map +1 -0
  142. package/dist/lib/workspace/types.d.ts +81 -0
  143. package/dist/lib/workspace/types.js +2 -0
  144. package/dist/lib/workspace/types.js.map +1 -0
  145. package/dist/lib/workspace/workspace-store.d.ts +27 -0
  146. package/dist/lib/workspace/workspace-store.js +75 -0
  147. package/dist/lib/workspace/workspace-store.js.map +1 -0
  148. package/dist/lib/workspace/write-json.d.ts +1 -0
  149. package/dist/lib/workspace/write-json.js +10 -0
  150. package/dist/lib/workspace/write-json.js.map +1 -0
  151. package/package.json +34 -0
  152. package/templates/vercel.json +5 -0
  153. package/vendor/annotation-shell/annotation-shell.css +1 -0
  154. package/vendor/annotation-shell/annotation-shell.js +379 -0
@@ -0,0 +1,52 @@
1
+ export function normalizeRoutePath(input) {
2
+ const trimmed = input.trim();
3
+ if (!trimmed) {
4
+ return null;
5
+ }
6
+ if (/^(https?:|mailto:|javascript:|tel:|data:)/i.test(trimmed)) {
7
+ return null;
8
+ }
9
+ let path = trimmed;
10
+ if (!path.startsWith('/')) {
11
+ path = `/${path}`;
12
+ }
13
+ const hashIndex = path.indexOf('#');
14
+ if (hashIndex >= 0) {
15
+ path = path.slice(0, hashIndex);
16
+ }
17
+ const queryIndex = path.indexOf('?');
18
+ if (queryIndex >= 0) {
19
+ path = path.slice(0, queryIndex);
20
+ }
21
+ if (path.length > 1 && path.endsWith('/')) {
22
+ path = path.slice(0, -1);
23
+ }
24
+ if (path === '') {
25
+ return '/';
26
+ }
27
+ return path;
28
+ }
29
+ export function normalizeRouteList(routes, options = {}) {
30
+ const normalized = [];
31
+ const seen = new Set();
32
+ for (const route of routes) {
33
+ const path = normalizeRoutePath(route);
34
+ if (!path || seen.has(path)) {
35
+ continue;
36
+ }
37
+ seen.add(path);
38
+ normalized.push(path);
39
+ if (options.maxPages !== undefined && normalized.length >= options.maxPages) {
40
+ break;
41
+ }
42
+ }
43
+ return normalized.length > 0 ? normalized : ['/'];
44
+ }
45
+ export function assertAiRoutesSubset(routes, aiRoutes) {
46
+ const routeSet = new Set(routes);
47
+ const invalid = aiRoutes.filter((route) => !routeSet.has(route));
48
+ if (invalid.length > 0) {
49
+ throw new Error(`ai_routes 必须是 routes 的子集,无效项:${invalid.join(', ')}`);
50
+ }
51
+ }
52
+ //# sourceMappingURL=normalize-route-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-route-path.js","sourceRoot":"","sources":["../../../src/lib/routes/normalize-route-path.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,4CAA4C,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,IAAI,GAAG,OAAO,CAAC;IACnB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IACpB,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,SAAS,IAAI,CAAC,EAAE,CAAC;QACnB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAClC,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACrC,IAAI,UAAU,IAAI,CAAC,EAAE,CAAC;QACpB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1C,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QAChB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,MAAgB,EAChB,UAAiC,EAAE;IAEnC,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAE/B,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5B,SAAS;QACX,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACf,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACtB,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,IAAI,UAAU,CAAC,MAAM,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC5E,MAAM;QACR,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAAgB,EAAE,QAAkB;IACvE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IACjE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,gCAAgC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { Browser } from 'playwright';
2
+ import { type LoadedRoutesConfig } from './routes-config.js';
3
+ export interface ResolveCaptureRoutesOptions {
4
+ cwd: string;
5
+ workspace: string;
6
+ pages?: string[];
7
+ maxPages: number;
8
+ noCrawl: boolean;
9
+ yes: boolean;
10
+ browser?: Browser;
11
+ baseUrl?: string;
12
+ }
13
+ export interface ResolvedCaptureRoutes {
14
+ routes: string[];
15
+ routesConfig: LoadedRoutesConfig | null;
16
+ source: 'pages' | 'config' | 'crawl' | 'default';
17
+ }
18
+ export declare function resolveCaptureRoutes(options: ResolveCaptureRoutesOptions): Promise<ResolvedCaptureRoutes>;
@@ -0,0 +1,47 @@
1
+ import { logger } from '../logger.js';
2
+ import { isInteractiveTty } from '../prompt/is-tty.js';
3
+ import { crawlInternalLinks } from './crawl-internal-links.js';
4
+ import { normalizeRouteList } from './normalize-route-path.js';
5
+ import { loadRoutesConfig } from './routes-config.js';
6
+ export async function resolveCaptureRoutes(options) {
7
+ const routesConfig = await loadRoutesConfig(options.cwd, options.workspace);
8
+ if (options.pages && options.pages.length > 0) {
9
+ return {
10
+ routes: normalizeRouteList(options.pages, { maxPages: options.maxPages }),
11
+ routesConfig,
12
+ source: 'pages',
13
+ };
14
+ }
15
+ if (routesConfig?.routes) {
16
+ return {
17
+ routes: normalizeRouteList(routesConfig.routes, { maxPages: options.maxPages }),
18
+ routesConfig,
19
+ source: 'config',
20
+ };
21
+ }
22
+ const shouldCrawl = !options.noCrawl &&
23
+ (options.yes || isInteractiveTty()) &&
24
+ Boolean(options.browser && options.baseUrl);
25
+ if (shouldCrawl && options.browser && options.baseUrl) {
26
+ const crawled = await crawlInternalLinks(options.browser, options.baseUrl, {
27
+ maxPages: options.maxPages,
28
+ });
29
+ if (crawled.length > 1 || crawled[0] !== '/') {
30
+ logger.info(`链接爬取发现 ${crawled.length} 条路由:${crawled.join(', ')}`);
31
+ }
32
+ return {
33
+ routes: crawled,
34
+ routesConfig,
35
+ source: 'crawl',
36
+ };
37
+ }
38
+ if (!options.yes && !isInteractiveTty()) {
39
+ logger.info('非交互环境且未传 --yes,仅采集首页 /(与现网行为一致)。');
40
+ }
41
+ return {
42
+ routes: ['/'],
43
+ routesConfig,
44
+ source: 'default',
45
+ };
46
+ }
47
+ //# sourceMappingURL=resolve-capture-routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-capture-routes.js","sourceRoot":"","sources":["../../../src/lib/routes/resolve-capture-routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAA2B,MAAM,oBAAoB,CAAC;AAmB/E,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAoC;IAEpC,MAAM,YAAY,GAAG,MAAM,gBAAgB,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAE5E,IAAI,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9C,OAAO;YACL,MAAM,EAAE,kBAAkB,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;YACzE,YAAY;YACZ,MAAM,EAAE,OAAO;SAChB,CAAC;IACJ,CAAC;IAED,IAAI,YAAY,EAAE,MAAM,EAAE,CAAC;QACzB,OAAO;YACL,MAAM,EAAE,kBAAkB,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC;YAC/E,YAAY;YACZ,MAAM,EAAE,QAAQ;SACjB,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GACf,CAAC,OAAO,CAAC,OAAO;QAChB,CAAC,OAAO,CAAC,GAAG,IAAI,gBAAgB,EAAE,CAAC;QACnC,OAAO,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9C,IAAI,WAAW,IAAI,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;QACtD,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE;YACzE,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B,CAAC,CAAC;QACH,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YAC7C,MAAM,CAAC,IAAI,CAAC,UAAU,OAAO,CAAC,MAAM,QAAQ,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,OAAO;YACL,MAAM,EAAE,OAAO;YACf,YAAY;YACZ,MAAM,EAAE,OAAO;SAChB,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,gBAAgB,EAAE,EAAE,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IAClD,CAAC;IAED,OAAO;QACL,MAAM,EAAE,CAAC,GAAG,CAAC;QACb,YAAY;QACZ,MAAM,EAAE,SAAS;KAClB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ declare const routesConfigSchema: z.ZodObject<{
3
+ routes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
4
+ ai_routes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ routes?: string[] | undefined;
7
+ ai_routes?: string[] | undefined;
8
+ }, {
9
+ routes?: string[] | undefined;
10
+ ai_routes?: string[] | undefined;
11
+ }>;
12
+ export type RoutesConfig = z.infer<typeof routesConfigSchema>;
13
+ export interface LoadedRoutesConfig {
14
+ path: string;
15
+ config: RoutesConfig;
16
+ routes?: string[];
17
+ aiRoutes?: string[];
18
+ }
19
+ export declare function resolveRoutesConfigPaths(cwd: string, workspace: string): string[];
20
+ export declare function loadRoutesConfig(cwd: string, workspace: string): Promise<LoadedRoutesConfig | null>;
21
+ export {};
@@ -0,0 +1,31 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { readFile } from 'node:fs/promises';
3
+ import { join } from 'node:path';
4
+ import { z } from 'zod';
5
+ import { normalizeRouteList } from './normalize-route-path.js';
6
+ const routesConfigSchema = z.object({
7
+ routes: z.array(z.string()).optional(),
8
+ ai_routes: z.array(z.string()).optional(),
9
+ });
10
+ export function resolveRoutesConfigPaths(cwd, workspace) {
11
+ return [join(cwd, 'designmaker.routes.json'), join(workspace, 'designmaker.routes.json')];
12
+ }
13
+ export async function loadRoutesConfig(cwd, workspace) {
14
+ for (const path of resolveRoutesConfigPaths(cwd, workspace)) {
15
+ if (!existsSync(path)) {
16
+ continue;
17
+ }
18
+ const raw = await readFile(path, 'utf8');
19
+ const parsed = routesConfigSchema.parse(JSON.parse(raw));
20
+ const loaded = { path, config: parsed };
21
+ if (parsed.routes) {
22
+ loaded.routes = normalizeRouteList(parsed.routes);
23
+ }
24
+ if (parsed.ai_routes) {
25
+ loaded.aiRoutes = normalizeRouteList(parsed.ai_routes);
26
+ }
27
+ return loaded;
28
+ }
29
+ return null;
30
+ }
31
+ //# sourceMappingURL=routes-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes-config.js","sourceRoot":"","sources":["../../../src/lib/routes/routes-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC;AAWH,MAAM,UAAU,wBAAwB,CAAC,GAAW,EAAE,SAAiB;IACrE,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,yBAAyB,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,GAAW,EACX,SAAiB;IAEjB,KAAK,MAAM,IAAI,IAAI,wBAAwB,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,CAAC;QAC5D,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACtB,SAAS;QACX,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACzC,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACzD,MAAM,MAAM,GAAuB,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAE5D,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,MAAM,CAAC,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACpD,CAAC;QACD,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACrB,MAAM,CAAC,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACzD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { WorkspacePaths } from './types.js';
2
+ interface WorkspacePathOptions {
3
+ projectRoot: string;
4
+ workspaceRoot?: string;
5
+ outputDir?: string;
6
+ }
7
+ export declare function resolveWorkspacePaths(options: WorkspacePathOptions): WorkspacePaths;
8
+ export {};
@@ -0,0 +1,19 @@
1
+ import { resolve } from 'node:path';
2
+ export function resolveWorkspacePaths(options) {
3
+ const projectRoot = resolve(options.projectRoot);
4
+ const workspaceRoot = resolve(projectRoot, options.workspaceRoot ?? '.designmaker');
5
+ const outputDir = resolve(projectRoot, options.outputDir ?? `${workspaceRoot}/annotated-bundle`);
6
+ return {
7
+ projectRoot,
8
+ workspaceRoot,
9
+ outputDir,
10
+ workspaceJson: resolve(workspaceRoot, 'workspace.json'),
11
+ projectScanJson: resolve(workspaceRoot, 'project-scan.json'),
12
+ requirementsContextJson: resolve(workspaceRoot, 'requirements-context.json'),
13
+ annotationsSeedJson: resolve(workspaceRoot, 'annotations.seed.json'),
14
+ pageSnapshotsDir: resolve(workspaceRoot, 'page-snapshots'),
15
+ exportsDir: resolve(workspaceRoot, 'exports'),
16
+ annotatedBundleDir: outputDir,
17
+ };
18
+ }
19
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/lib/workspace/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,MAAM,UAAU,qBAAqB,CAAC,OAA6B;IACjE,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACjD,MAAM,aAAa,GAAG,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,aAAa,IAAI,cAAc,CAAC,CAAC;IACpF,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,IAAI,GAAG,aAAa,mBAAmB,CAAC,CAAC;IAEjG,OAAO;QACL,WAAW;QACX,aAAa;QACb,SAAS;QACT,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,gBAAgB,CAAC;QACvD,eAAe,EAAE,OAAO,CAAC,aAAa,EAAE,mBAAmB,CAAC;QAC5D,uBAAuB,EAAE,OAAO,CAAC,aAAa,EAAE,2BAA2B,CAAC;QAC5E,mBAAmB,EAAE,OAAO,CAAC,aAAa,EAAE,uBAAuB,CAAC;QACpE,gBAAgB,EAAE,OAAO,CAAC,aAAa,EAAE,gBAAgB,CAAC;QAC1D,UAAU,EAAE,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC;QAC7C,kBAAkB,EAAE,SAAS;KAC9B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { ZodSchema } from 'zod';
2
+ export declare function readJsonFile<T>(path: string, schema: ZodSchema<T>): Promise<T>;
@@ -0,0 +1,26 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ export async function readJsonFile(path, schema) {
3
+ let raw;
4
+ try {
5
+ raw = await readFile(path, 'utf8');
6
+ }
7
+ catch (error) {
8
+ throw new Error(`读取 JSON 失败:${path} (${formatError(error)})`);
9
+ }
10
+ let parsed;
11
+ try {
12
+ parsed = JSON.parse(raw);
13
+ }
14
+ catch (error) {
15
+ throw new Error(`JSON 格式非法:${path} (${formatError(error)})`);
16
+ }
17
+ const result = schema.safeParse(parsed);
18
+ if (!result.success) {
19
+ throw new Error(`JSON 结构不符合预期:${path}\n${result.error.message}`);
20
+ }
21
+ return result.data;
22
+ }
23
+ function formatError(error) {
24
+ return error instanceof Error ? error.message : String(error);
25
+ }
26
+ //# sourceMappingURL=read-json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-json.js","sourceRoot":"","sources":["../../../src/lib/workspace/read-json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,MAAM,CAAC,KAAK,UAAU,YAAY,CAAI,IAAY,EAAE,MAAoB;IACtE,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,cAAc,IAAI,KAAK,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChE,CAAC;IAED,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,aAAa,IAAI,KAAK,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACxC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,gBAAgB,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,355 @@
1
+ import { z } from 'zod';
2
+ export declare const workspaceMetadataSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ name: z.ZodString;
5
+ framework: z.ZodEnum<["react", "vue", "unknown"]>;
6
+ project_root: z.ZodString;
7
+ workspace_root: z.ZodString;
8
+ output_dir: z.ZodString;
9
+ entry_url: z.ZodNullable<z.ZodString>;
10
+ no_ai: z.ZodBoolean;
11
+ created_at: z.ZodString;
12
+ updated_at: z.ZodString;
13
+ }, "strip", z.ZodTypeAny, {
14
+ id: string;
15
+ name: string;
16
+ framework: "unknown" | "react" | "vue";
17
+ project_root: string;
18
+ workspace_root: string;
19
+ output_dir: string;
20
+ entry_url: string | null;
21
+ no_ai: boolean;
22
+ created_at: string;
23
+ updated_at: string;
24
+ }, {
25
+ id: string;
26
+ name: string;
27
+ framework: "unknown" | "react" | "vue";
28
+ project_root: string;
29
+ workspace_root: string;
30
+ output_dir: string;
31
+ entry_url: string | null;
32
+ no_ai: boolean;
33
+ created_at: string;
34
+ updated_at: string;
35
+ }>;
36
+ export declare const projectScanSchema: z.ZodObject<{
37
+ framework: z.ZodEnum<["react", "vue", "unknown"]>;
38
+ package_manager: z.ZodEnum<["pnpm", "npm", "yarn", "unknown"]>;
39
+ scripts: z.ZodRecord<z.ZodString, z.ZodString>;
40
+ artifact_dirs: z.ZodArray<z.ZodString, "many">;
41
+ build_script: z.ZodNullable<z.ZodString>;
42
+ startup_strategy: z.ZodNullable<z.ZodString>;
43
+ resolved_entry_url: z.ZodNullable<z.ZodString>;
44
+ }, "strip", z.ZodTypeAny, {
45
+ framework: "unknown" | "react" | "vue";
46
+ package_manager: "unknown" | "pnpm" | "npm" | "yarn";
47
+ scripts: Record<string, string>;
48
+ artifact_dirs: string[];
49
+ build_script: string | null;
50
+ startup_strategy: string | null;
51
+ resolved_entry_url: string | null;
52
+ }, {
53
+ framework: "unknown" | "react" | "vue";
54
+ package_manager: "unknown" | "pnpm" | "npm" | "yarn";
55
+ scripts: Record<string, string>;
56
+ artifact_dirs: string[];
57
+ build_script: string | null;
58
+ startup_strategy: string | null;
59
+ resolved_entry_url: string | null;
60
+ }>;
61
+ export declare const requirementsContextSchema: z.ZodObject<{
62
+ candidate_files: z.ZodArray<z.ZodString, "many">;
63
+ selected_files: z.ZodArray<z.ZodString, "many">;
64
+ combined_text: z.ZodString;
65
+ updated_at: z.ZodString;
66
+ }, "strip", z.ZodTypeAny, {
67
+ updated_at: string;
68
+ candidate_files: string[];
69
+ selected_files: string[];
70
+ combined_text: string;
71
+ }, {
72
+ updated_at: string;
73
+ candidate_files: string[];
74
+ selected_files: string[];
75
+ combined_text: string;
76
+ }>;
77
+ export declare const domSummaryItemSchema: z.ZodObject<{
78
+ tag: z.ZodString;
79
+ role: z.ZodNullable<z.ZodString>;
80
+ text: z.ZodString;
81
+ bounding_box: z.ZodObject<{
82
+ x: z.ZodNumber;
83
+ y: z.ZodNumber;
84
+ width: z.ZodNumber;
85
+ height: z.ZodNumber;
86
+ }, "strip", z.ZodTypeAny, {
87
+ x: number;
88
+ y: number;
89
+ width: number;
90
+ height: number;
91
+ }, {
92
+ x: number;
93
+ y: number;
94
+ width: number;
95
+ height: number;
96
+ }>;
97
+ selector_hint: z.ZodString;
98
+ }, "strip", z.ZodTypeAny, {
99
+ tag: string;
100
+ role: string | null;
101
+ text: string;
102
+ bounding_box: {
103
+ x: number;
104
+ y: number;
105
+ width: number;
106
+ height: number;
107
+ };
108
+ selector_hint: string;
109
+ }, {
110
+ tag: string;
111
+ role: string | null;
112
+ text: string;
113
+ bounding_box: {
114
+ x: number;
115
+ y: number;
116
+ width: number;
117
+ height: number;
118
+ };
119
+ selector_hint: string;
120
+ }>;
121
+ export declare const pageSnapshotSchema: z.ZodObject<{
122
+ page_key: z.ZodString;
123
+ url: z.ZodString;
124
+ title: z.ZodString;
125
+ screenshot_path: z.ZodString;
126
+ visible_text: z.ZodString;
127
+ dom_summary: z.ZodArray<z.ZodObject<{
128
+ tag: z.ZodString;
129
+ role: z.ZodNullable<z.ZodString>;
130
+ text: z.ZodString;
131
+ bounding_box: z.ZodObject<{
132
+ x: z.ZodNumber;
133
+ y: z.ZodNumber;
134
+ width: z.ZodNumber;
135
+ height: z.ZodNumber;
136
+ }, "strip", z.ZodTypeAny, {
137
+ x: number;
138
+ y: number;
139
+ width: number;
140
+ height: number;
141
+ }, {
142
+ x: number;
143
+ y: number;
144
+ width: number;
145
+ height: number;
146
+ }>;
147
+ selector_hint: z.ZodString;
148
+ }, "strip", z.ZodTypeAny, {
149
+ tag: string;
150
+ role: string | null;
151
+ text: string;
152
+ bounding_box: {
153
+ x: number;
154
+ y: number;
155
+ width: number;
156
+ height: number;
157
+ };
158
+ selector_hint: string;
159
+ }, {
160
+ tag: string;
161
+ role: string | null;
162
+ text: string;
163
+ bounding_box: {
164
+ x: number;
165
+ y: number;
166
+ width: number;
167
+ height: number;
168
+ };
169
+ selector_hint: string;
170
+ }>, "many">;
171
+ captured_at: z.ZodString;
172
+ }, "strip", z.ZodTypeAny, {
173
+ page_key: string;
174
+ url: string;
175
+ title: string;
176
+ screenshot_path: string;
177
+ visible_text: string;
178
+ dom_summary: {
179
+ tag: string;
180
+ role: string | null;
181
+ text: string;
182
+ bounding_box: {
183
+ x: number;
184
+ y: number;
185
+ width: number;
186
+ height: number;
187
+ };
188
+ selector_hint: string;
189
+ }[];
190
+ captured_at: string;
191
+ }, {
192
+ page_key: string;
193
+ url: string;
194
+ title: string;
195
+ screenshot_path: string;
196
+ visible_text: string;
197
+ dom_summary: {
198
+ tag: string;
199
+ role: string | null;
200
+ text: string;
201
+ bounding_box: {
202
+ x: number;
203
+ y: number;
204
+ width: number;
205
+ height: number;
206
+ };
207
+ selector_hint: string;
208
+ }[];
209
+ captured_at: string;
210
+ }>;
211
+ export declare const annotationSchema: z.ZodObject<{
212
+ id: z.ZodString;
213
+ page_key: z.ZodString;
214
+ title: z.ZodString;
215
+ description: z.ZodString;
216
+ business_rule: z.ZodString;
217
+ validation_rule: z.ZodString;
218
+ acceptance_criteria: z.ZodString;
219
+ source: z.ZodEnum<["ai", "manual"]>;
220
+ confidence: z.ZodNumber;
221
+ selector_hint: z.ZodString;
222
+ text_signature: z.ZodString;
223
+ anchor_x: z.ZodNumber;
224
+ anchor_y: z.ZodNumber;
225
+ anchor_w: z.ZodNumber;
226
+ anchor_h: z.ZodNumber;
227
+ hidden: z.ZodBoolean;
228
+ }, "strip", z.ZodTypeAny, {
229
+ id: string;
230
+ selector_hint: string;
231
+ page_key: string;
232
+ title: string;
233
+ description: string;
234
+ business_rule: string;
235
+ validation_rule: string;
236
+ acceptance_criteria: string;
237
+ source: "ai" | "manual";
238
+ confidence: number;
239
+ text_signature: string;
240
+ anchor_x: number;
241
+ anchor_y: number;
242
+ anchor_w: number;
243
+ anchor_h: number;
244
+ hidden: boolean;
245
+ }, {
246
+ id: string;
247
+ selector_hint: string;
248
+ page_key: string;
249
+ title: string;
250
+ description: string;
251
+ business_rule: string;
252
+ validation_rule: string;
253
+ acceptance_criteria: string;
254
+ source: "ai" | "manual";
255
+ confidence: number;
256
+ text_signature: string;
257
+ anchor_x: number;
258
+ anchor_y: number;
259
+ anchor_w: number;
260
+ anchor_h: number;
261
+ hidden: boolean;
262
+ }>;
263
+ export declare const annotationsSeedSchema: z.ZodObject<{
264
+ annotations: z.ZodArray<z.ZodObject<{
265
+ id: z.ZodString;
266
+ page_key: z.ZodString;
267
+ title: z.ZodString;
268
+ description: z.ZodString;
269
+ business_rule: z.ZodString;
270
+ validation_rule: z.ZodString;
271
+ acceptance_criteria: z.ZodString;
272
+ source: z.ZodEnum<["ai", "manual"]>;
273
+ confidence: z.ZodNumber;
274
+ selector_hint: z.ZodString;
275
+ text_signature: z.ZodString;
276
+ anchor_x: z.ZodNumber;
277
+ anchor_y: z.ZodNumber;
278
+ anchor_w: z.ZodNumber;
279
+ anchor_h: z.ZodNumber;
280
+ hidden: z.ZodBoolean;
281
+ }, "strip", z.ZodTypeAny, {
282
+ id: string;
283
+ selector_hint: string;
284
+ page_key: string;
285
+ title: string;
286
+ description: string;
287
+ business_rule: string;
288
+ validation_rule: string;
289
+ acceptance_criteria: string;
290
+ source: "ai" | "manual";
291
+ confidence: number;
292
+ text_signature: string;
293
+ anchor_x: number;
294
+ anchor_y: number;
295
+ anchor_w: number;
296
+ anchor_h: number;
297
+ hidden: boolean;
298
+ }, {
299
+ id: string;
300
+ selector_hint: string;
301
+ page_key: string;
302
+ title: string;
303
+ description: string;
304
+ business_rule: string;
305
+ validation_rule: string;
306
+ acceptance_criteria: string;
307
+ source: "ai" | "manual";
308
+ confidence: number;
309
+ text_signature: string;
310
+ anchor_x: number;
311
+ anchor_y: number;
312
+ anchor_w: number;
313
+ anchor_h: number;
314
+ hidden: boolean;
315
+ }>, "many">;
316
+ }, "strip", z.ZodTypeAny, {
317
+ annotations: {
318
+ id: string;
319
+ selector_hint: string;
320
+ page_key: string;
321
+ title: string;
322
+ description: string;
323
+ business_rule: string;
324
+ validation_rule: string;
325
+ acceptance_criteria: string;
326
+ source: "ai" | "manual";
327
+ confidence: number;
328
+ text_signature: string;
329
+ anchor_x: number;
330
+ anchor_y: number;
331
+ anchor_w: number;
332
+ anchor_h: number;
333
+ hidden: boolean;
334
+ }[];
335
+ }, {
336
+ annotations: {
337
+ id: string;
338
+ selector_hint: string;
339
+ page_key: string;
340
+ title: string;
341
+ description: string;
342
+ business_rule: string;
343
+ validation_rule: string;
344
+ acceptance_criteria: string;
345
+ source: "ai" | "manual";
346
+ confidence: number;
347
+ text_signature: string;
348
+ anchor_x: number;
349
+ anchor_y: number;
350
+ anchor_w: number;
351
+ anchor_h: number;
352
+ hidden: boolean;
353
+ }[];
354
+ }>;
355
+ export type WorkspaceMetadataInput = z.infer<typeof workspaceMetadataSchema>;
@@ -0,0 +1,71 @@
1
+ import { z } from 'zod';
2
+ export const workspaceMetadataSchema = z.object({
3
+ id: z.string().min(1),
4
+ name: z.string().min(1),
5
+ framework: z.enum(['react', 'vue', 'unknown']),
6
+ project_root: z.string().min(1),
7
+ workspace_root: z.string().min(1),
8
+ output_dir: z.string().min(1),
9
+ entry_url: z.string().url().nullable(),
10
+ no_ai: z.boolean(),
11
+ created_at: z.string().datetime(),
12
+ updated_at: z.string().datetime(),
13
+ });
14
+ export const projectScanSchema = z.object({
15
+ framework: z.enum(['react', 'vue', 'unknown']),
16
+ package_manager: z.enum(['pnpm', 'npm', 'yarn', 'unknown']),
17
+ scripts: z.record(z.string()),
18
+ artifact_dirs: z.array(z.string()),
19
+ build_script: z.string().nullable(),
20
+ startup_strategy: z.string().nullable(),
21
+ resolved_entry_url: z.string().url().nullable(),
22
+ });
23
+ export const requirementsContextSchema = z.object({
24
+ candidate_files: z.array(z.string()),
25
+ selected_files: z.array(z.string()),
26
+ combined_text: z.string(),
27
+ updated_at: z.string().datetime(),
28
+ });
29
+ export const domSummaryItemSchema = z.object({
30
+ tag: z.string(),
31
+ role: z.string().nullable(),
32
+ text: z.string(),
33
+ bounding_box: z.object({
34
+ x: z.number(),
35
+ y: z.number(),
36
+ width: z.number(),
37
+ height: z.number(),
38
+ }),
39
+ selector_hint: z.string(),
40
+ });
41
+ export const pageSnapshotSchema = z.object({
42
+ page_key: z.string(),
43
+ url: z.string().url(),
44
+ title: z.string(),
45
+ screenshot_path: z.string(),
46
+ visible_text: z.string(),
47
+ dom_summary: z.array(domSummaryItemSchema),
48
+ captured_at: z.string().datetime(),
49
+ });
50
+ export const annotationSchema = z.object({
51
+ id: z.string().min(1),
52
+ page_key: z.string().min(1),
53
+ title: z.string(),
54
+ description: z.string(),
55
+ business_rule: z.string(),
56
+ validation_rule: z.string(),
57
+ acceptance_criteria: z.string(),
58
+ source: z.enum(['ai', 'manual']),
59
+ confidence: z.number().min(0).max(1),
60
+ selector_hint: z.string(),
61
+ text_signature: z.string(),
62
+ anchor_x: z.number(),
63
+ anchor_y: z.number(),
64
+ anchor_w: z.number(),
65
+ anchor_h: z.number(),
66
+ hidden: z.boolean(),
67
+ });
68
+ export const annotationsSeedSchema = z.object({
69
+ annotations: z.array(annotationSchema),
70
+ });
71
+ //# sourceMappingURL=schema.js.map