@luci-dev/format 0.0.0-stage → 0.5.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 (147) hide show
  1. package/LICENSE +21 -0
  2. package/dist/agents.d.ts +25 -0
  3. package/dist/agents.d.ts.map +1 -0
  4. package/dist/agents.js +36 -0
  5. package/dist/agents.js.map +1 -0
  6. package/dist/capture/baseline.d.ts +53 -0
  7. package/dist/capture/baseline.d.ts.map +1 -0
  8. package/dist/capture/baseline.js +400 -0
  9. package/dist/capture/baseline.js.map +1 -0
  10. package/dist/capture/check.d.ts +111 -0
  11. package/dist/capture/check.d.ts.map +1 -0
  12. package/dist/capture/check.js +327 -0
  13. package/dist/capture/check.js.map +1 -0
  14. package/dist/capture/collection.d.ts +2647 -0
  15. package/dist/capture/collection.d.ts.map +1 -0
  16. package/dist/capture/collection.js +103 -0
  17. package/dist/capture/collection.js.map +1 -0
  18. package/dist/capture/compare.d.ts +50 -0
  19. package/dist/capture/compare.d.ts.map +1 -0
  20. package/dist/capture/compare.js +167 -0
  21. package/dist/capture/compare.js.map +1 -0
  22. package/dist/capture/format.d.ts +59 -0
  23. package/dist/capture/format.d.ts.map +1 -0
  24. package/dist/capture/format.js +540 -0
  25. package/dist/capture/format.js.map +1 -0
  26. package/dist/capture/image.d.ts +42 -0
  27. package/dist/capture/image.d.ts.map +1 -0
  28. package/dist/capture/image.js +103 -0
  29. package/dist/capture/image.js.map +1 -0
  30. package/dist/capture/index.d.ts +18 -0
  31. package/dist/capture/index.d.ts.map +1 -0
  32. package/dist/capture/index.js +18 -0
  33. package/dist/capture/index.js.map +1 -0
  34. package/dist/capture/layout.d.ts +21 -0
  35. package/dist/capture/layout.d.ts.map +1 -0
  36. package/dist/capture/layout.js +131 -0
  37. package/dist/capture/layout.js.map +1 -0
  38. package/dist/capture/merge.d.ts +46 -0
  39. package/dist/capture/merge.d.ts.map +1 -0
  40. package/dist/capture/merge.js +251 -0
  41. package/dist/capture/merge.js.map +1 -0
  42. package/dist/capture/read.d.ts +91 -0
  43. package/dist/capture/read.d.ts.map +1 -0
  44. package/dist/capture/read.js +179 -0
  45. package/dist/capture/read.js.map +1 -0
  46. package/dist/capture/remap.d.ts +34 -0
  47. package/dist/capture/remap.d.ts.map +1 -0
  48. package/dist/capture/remap.js +227 -0
  49. package/dist/capture/remap.js.map +1 -0
  50. package/dist/capture/rule.d.ts +19 -0
  51. package/dist/capture/rule.d.ts.map +1 -0
  52. package/dist/capture/rule.js +39 -0
  53. package/dist/capture/rule.js.map +1 -0
  54. package/dist/capture/schema.d.ts +3020 -0
  55. package/dist/capture/schema.d.ts.map +1 -0
  56. package/dist/capture/schema.js +488 -0
  57. package/dist/capture/schema.js.map +1 -0
  58. package/dist/capture/spacingUnit.d.ts +32 -0
  59. package/dist/capture/spacingUnit.d.ts.map +1 -0
  60. package/dist/capture/spacingUnit.js +49 -0
  61. package/dist/capture/spacingUnit.js.map +1 -0
  62. package/dist/capture/stitch.d.ts +11 -0
  63. package/dist/capture/stitch.d.ts.map +1 -0
  64. package/dist/capture/stitch.js +382 -0
  65. package/dist/capture/stitch.js.map +1 -0
  66. package/dist/capture/tokensExport.d.ts +37 -0
  67. package/dist/capture/tokensExport.d.ts.map +1 -0
  68. package/dist/capture/tokensExport.js +355 -0
  69. package/dist/capture/tokensExport.js.map +1 -0
  70. package/dist/capture/values.d.ts +47 -0
  71. package/dist/capture/values.d.ts.map +1 -0
  72. package/dist/capture/values.js +155 -0
  73. package/dist/capture/values.js.map +1 -0
  74. package/dist/feedback/index.d.ts +7 -0
  75. package/dist/feedback/index.d.ts.map +1 -0
  76. package/dist/feedback/index.js +7 -0
  77. package/dist/feedback/index.js.map +1 -0
  78. package/dist/feedback/layoutPrompt.d.ts +26 -0
  79. package/dist/feedback/layoutPrompt.d.ts.map +1 -0
  80. package/dist/feedback/layoutPrompt.js +38 -0
  81. package/dist/feedback/layoutPrompt.js.map +1 -0
  82. package/dist/feedback/parts.d.ts +17 -0
  83. package/dist/feedback/parts.d.ts.map +1 -0
  84. package/dist/feedback/parts.js +50 -0
  85. package/dist/feedback/parts.js.map +1 -0
  86. package/dist/feedback/prompt.d.ts +13 -0
  87. package/dist/feedback/prompt.d.ts.map +1 -0
  88. package/dist/feedback/prompt.js +114 -0
  89. package/dist/feedback/prompt.js.map +1 -0
  90. package/dist/feedback/schema.d.ts +504 -0
  91. package/dist/feedback/schema.d.ts.map +1 -0
  92. package/dist/feedback/schema.js +236 -0
  93. package/dist/feedback/schema.js.map +1 -0
  94. package/dist/feedback/wireframePrompt.d.ts +9 -0
  95. package/dist/feedback/wireframePrompt.d.ts.map +1 -0
  96. package/dist/feedback/wireframePrompt.js +24 -0
  97. package/dist/feedback/wireframePrompt.js.map +1 -0
  98. package/dist/home.d.ts +13 -0
  99. package/dist/home.d.ts.map +1 -0
  100. package/dist/home.js +19 -0
  101. package/dist/home.js.map +1 -0
  102. package/dist/index.d.ts +13 -0
  103. package/dist/index.d.ts.map +1 -0
  104. package/dist/index.js +13 -0
  105. package/dist/index.js.map +1 -0
  106. package/dist/markdown/sections.d.ts +24 -0
  107. package/dist/markdown/sections.d.ts.map +1 -0
  108. package/dist/markdown/sections.js +58 -0
  109. package/dist/markdown/sections.js.map +1 -0
  110. package/dist/memory/activeTask.d.ts +25 -0
  111. package/dist/memory/activeTask.d.ts.map +1 -0
  112. package/dist/memory/activeTask.js +33 -0
  113. package/dist/memory/activeTask.js.map +1 -0
  114. package/dist/memory/brainJson.d.ts +44 -0
  115. package/dist/memory/brainJson.d.ts.map +1 -0
  116. package/dist/memory/brainJson.js +44 -0
  117. package/dist/memory/brainJson.js.map +1 -0
  118. package/dist/memory/decision.d.ts +30 -0
  119. package/dist/memory/decision.d.ts.map +1 -0
  120. package/dist/memory/decision.js +86 -0
  121. package/dist/memory/decision.js.map +1 -0
  122. package/dist/memory/layout.d.ts +41 -0
  123. package/dist/memory/layout.d.ts.map +1 -0
  124. package/dist/memory/layout.js +76 -0
  125. package/dist/memory/layout.js.map +1 -0
  126. package/dist/memory/proposed.d.ts +29 -0
  127. package/dist/memory/proposed.d.ts.map +1 -0
  128. package/dist/memory/proposed.js +63 -0
  129. package/dist/memory/proposed.js.map +1 -0
  130. package/dist/product.d.ts +17 -0
  131. package/dist/product.d.ts.map +1 -0
  132. package/dist/product.js +17 -0
  133. package/dist/product.js.map +1 -0
  134. package/dist/result.d.ts +17 -0
  135. package/dist/result.d.ts.map +1 -0
  136. package/dist/result.js +20 -0
  137. package/dist/result.js.map +1 -0
  138. package/dist/skills/contract.d.ts +137 -0
  139. package/dist/skills/contract.d.ts.map +1 -0
  140. package/dist/skills/contract.js +131 -0
  141. package/dist/skills/contract.js.map +1 -0
  142. package/dist/skills/frontmatter.d.ts +31 -0
  143. package/dist/skills/frontmatter.d.ts.map +1 -0
  144. package/dist/skills/frontmatter.js +214 -0
  145. package/dist/skills/frontmatter.js.map +1 -0
  146. package/package.json +31 -3
  147. package/README.md +0 -3
@@ -0,0 +1,26 @@
1
+ import type { LayoutChange, SourceLocation } from './schema.js';
2
+ export interface LayoutPromptElement {
3
+ /** "div (region)" */
4
+ element: string;
5
+ selector: string;
6
+ text?: string;
7
+ components?: readonly string[];
8
+ source?: SourceLocation;
9
+ changes: readonly LayoutChange[];
10
+ }
11
+ export interface LayoutPromptInput {
12
+ route: string;
13
+ /** The page component's file, when known. */
14
+ pageSource?: string;
15
+ viewport: {
16
+ width: number;
17
+ height: number;
18
+ };
19
+ /** What the person wrote about the whole plan. */
20
+ note?: string;
21
+ elements: readonly LayoutPromptElement[];
22
+ }
23
+ /** Said once when a plan inserts new parts. */
24
+ export declare const INSERT_HINT = "Inserted parts are new: reuse the named component when there is one; a saved capture (.luci/design/) is a reference to rebuild with the project's own components and tokens (luci-mcp get_capture reads it); a new block is a placeholder for what its label says.";
25
+ export declare function formatLayoutPrompt(input: LayoutPromptInput): string;
26
+ //# sourceMappingURL=layoutPrompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutPrompt.d.ts","sourceRoot":"","sources":["../../src/feedback/layoutPrompt.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;CAC1C;AAED,+CAA+C;AAC/C,eAAO,MAAM,WAAW,uQAAwQ,CAAC;AAKjS,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAyBnE"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * The Layout mode prompt (changed 13 Nov 2026): every layout change planned on one page, element by
3
+ * element, with exact steps and the person's note, ready to paste to an agent. Pure.
4
+ */
5
+ import { layoutChangeText, sourceText } from './prompt.js';
6
+ /** Said once when a plan inserts new parts. */
7
+ export const INSERT_HINT = 'Inserted parts are new: reuse the named component when there is one; a saved capture (.luci/design/) is a reference to rebuild with the project\'s own components and tokens (luci-mcp get_capture reads it); a new block is a placeholder for what its label says.';
8
+ const quote = (text) => `"${text.trim().replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\s*\n\s*/g, ' / ')}"`;
9
+ const short = (text, max = 120) => (text.length > max ? `${text.slice(0, max - 1)}…` : text);
10
+ export function formatLayoutPrompt(input) {
11
+ const elements = input.elements.filter(e => e.changes.length);
12
+ if (!elements.length)
13
+ throw new Error('No layout changes to put in a prompt.');
14
+ const count = elements.reduce((n, e) => n + e.changes.length, 0);
15
+ const out = [
16
+ `# Layout changes: ${input.route}, ${elements.length} element${elements.length === 1 ? '' : 's'}, ${count} change${count === 1 ? '' : 's'}`,
17
+ `Make every change below on ${input.route}${input.pageSource ? ` (${input.pageSource})` : ''}, in the code, with the project's own styles and tokens.`,
18
+ `They were planned in a ${input.viewport.width}px wide window: keep the layout working at other widths.`,
19
+ 'Sizes "as rendered" (width, height and their min and max) are the size on screen, border and padding included.'
20
+ ];
21
+ if (elements.some(e => e.changes.some(c => c.op === 'insert')))
22
+ out.push(INSERT_HINT);
23
+ if (input.note?.trim())
24
+ out.push('', `Note: ${quote(input.note)}`);
25
+ elements.forEach((e, i) => {
26
+ out.push('', `## ${i + 1}. ${e.element}${e.components?.length ? ` · ${e.components[e.components.length - 1]}` : ''}${e.source ? ` (${sourceText(e.source)})` : ''}`);
27
+ out.push(`selector: ${e.selector}`);
28
+ if (e.text)
29
+ out.push(`text: ${quote(short(e.text))}`);
30
+ if (e.components?.length)
31
+ out.push(`components: ${e.components.join(' > ')}`);
32
+ for (const c of e.changes)
33
+ out.push(`- ${layoutChangeText(c)}`);
34
+ });
35
+ out.push('', '## When done', `Report every element number (1 to ${elements.length}) as done, skipped or blocked, and name the route to open to verify it.`);
36
+ return `${out.join('\n')}\n`;
37
+ }
38
+ //# sourceMappingURL=layoutPrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layoutPrompt.js","sourceRoot":"","sources":["../../src/feedback/layoutPrompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAuB3D,+CAA+C;AAC/C,MAAM,CAAC,MAAM,WA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CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC9E,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO;YAAE,GAAG,CAAC,IAAI,CAAC,KAAK,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;IACH,GAAG,CAAC,IAAI,CACN,EAAE,EACF,cAAc,EACd,qCAAqC,QAAQ,CAAC,MAAM,yEAAyE,CAC9H,CAAC;IACF,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * New parts in prompts (Layout mode steps 2 and 3): what a part is, its planned size, and a sketched
3
+ * page as numbered lines. Pure.
4
+ */
5
+ import type { Part, Wireframe } from './schema.js';
6
+ /**
7
+ * "another `PlanCard` (src/components/PlanCard.jsx; one is at `main > section > div`)", "a new card
8
+ * grid". On a new page a component is "the `Nav` component" (there is no other one there).
9
+ */
10
+ export declare function partText(what: Part, onNewPage?: boolean): string;
11
+ /** "280px wide, 400px tall", "full width, 200px tall", "" when no size was set. */
12
+ export declare function sizeText(width?: string, height?: string): string;
13
+ /** A share of a row as a fraction: 6 of 12 -> "1/2", 4 of 12 -> "1/3", 12 of 12 -> "full width". */
14
+ export declare function shareText(span: number, total: number): string;
15
+ /** The sketched page, top to bottom: one numbered line per row; a row of several blocks lists them as 2a, 2b... */
16
+ export declare function wireframeLines(w: Wireframe, indent?: string): string[];
17
+ //# sourceMappingURL=parts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parts.d.ts","sourceRoot":"","sources":["../../src/feedback/parts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAInD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,UAAQ,GAAG,MAAM,CAQ9D;AAED,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAIhE;AAED,oGAAoG;AACpG,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAK7D;AAQD,mHAAmH;AACnH,wBAAgB,cAAc,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,SAAK,GAAG,MAAM,EAAE,CAalE"}
@@ -0,0 +1,50 @@
1
+ const quote = (text) => `"${text.trim().replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\s*\n\s*/g, ' / ')}"`;
2
+ /**
3
+ * "another `PlanCard` (src/components/PlanCard.jsx; one is at `main > section > div`)", "a new card
4
+ * grid". On a new page a component is "the `Nav` component" (there is no other one there).
5
+ */
6
+ export function partText(what, onNewPage = false) {
7
+ if (what.kind === 'component') {
8
+ const where = [what.file, what.example ? `one is at \`${what.example.selector}\`` : ''].filter(Boolean).join('; ');
9
+ const name = onNewPage ? `the \`${what.name}\` component` : `${what.example ? 'another' : 'a'} \`${what.name}\``;
10
+ return `${name}${where ? ` (${where})` : ''}`;
11
+ }
12
+ if (what.kind === 'capture')
13
+ return `a part like the saved capture ${quote(what.name)}${what.file ? ` (${what.file})` : ''}`;
14
+ return `a new ${what.name}`;
15
+ }
16
+ /** "280px wide, 400px tall", "full width, 200px tall", "" when no size was set. */
17
+ export function sizeText(width, height) {
18
+ const w = width === '100%' ? 'full width' : width ? `${width} wide` : '';
19
+ const h = height ? `${height} tall` : '';
20
+ return [w, h].filter(Boolean).join(', ');
21
+ }
22
+ /** A share of a row as a fraction: 6 of 12 -> "1/2", 4 of 12 -> "1/3", 12 of 12 -> "full width". */
23
+ export function shareText(span, total) {
24
+ if (span >= total)
25
+ return 'full width';
26
+ const gcd = (a, b) => (b ? gcd(b, a % b) : a);
27
+ const d = gcd(span, total);
28
+ return `${span / d}/${total / d} of the width`;
29
+ }
30
+ /** One block of a sketched page: "a new image slot: "Product screenshot"", or its label alone. */
31
+ function blockText(block) {
32
+ const what = block.what ? partText(block.what, true) : 'an area';
33
+ return `${what}${block.label ? `: ${quote(block.label)}` : ''}`;
34
+ }
35
+ /** The sketched page, top to bottom: one numbered line per row; a row of several blocks lists them as 2a, 2b... */
36
+ export function wireframeLines(w, indent = '') {
37
+ const out = [];
38
+ w.rows.forEach((row, i) => {
39
+ const n = i + 1;
40
+ const total = row.blocks.reduce((s, b) => s + b.span, 0);
41
+ if (row.blocks.length === 1) {
42
+ out.push(`${indent}${n}. Full width, about ${row.height} tall: ${blockText(row.blocks[0])}`);
43
+ return;
44
+ }
45
+ out.push(`${indent}${n}. A row of ${row.blocks.length} side by side, about ${row.height} tall:`);
46
+ row.blocks.forEach((b, j) => out.push(`${indent} - ${n}${String.fromCharCode(97 + j)}. ${shareText(b.span, total)}: ${blockText(b)}`));
47
+ });
48
+ return out;
49
+ }
50
+ //# sourceMappingURL=parts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parts.js","sourceRoot":"","sources":["../../src/feedback/parts.ts"],"names":[],"mappings":"AAMA,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC;AAE3H;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAU,EAAE,SAAS,GAAG,KAAK;IACpD,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,IAAI,CAAC,OAAO,CAAC,QAA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MAAM,UAAU,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAC;YAC9F,OAAO;QACT,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,CAAC,cAAc,GAAG,CAAC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAM,QAAQ,CAAC,CAAC;QACjG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,QAAQ,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3I,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { type DetailLevel, type FeedbackItem, type LayoutChange, type SourceLocation } from './schema.js';
2
+ export interface PromptOptions {
3
+ /** How much each item says about its element (default "standard"). */
4
+ detail?: DetailLevel;
5
+ }
6
+ export declare const sourceText: (s: SourceLocation) => string;
7
+ /** One planned layout change, as a step: "move it before `main > section:nth-of-type(3)` (section): 3rd of 4 -> 2nd". */
8
+ export declare function layoutChangeText(c: LayoutChange): string;
9
+ /** The prompt for these items (the caller picks which: pending ones, or all). Throws on an empty list. */
10
+ export declare function formatFeedbackPrompt(items: readonly FeedbackItem[], options?: PromptOptions): string;
11
+ /** Every item ID a text mentions ("[P2-A3]", "P1-A1"), once each, in order. */
12
+ export declare function refsIn(text: string): string[];
13
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/feedback/prompt.ts"],"names":[],"mappings":"AAMA,OAAO,EAAmB,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3H,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAMD,eAAO,MAAM,UAAU,MAAO,cAAc,WAA8E,CAAC;AAE3H,yHAAyH;AACzH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,CAqBxD;AAsCD,0GAA0G;AAC1G,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAkCxG;AAED,+EAA+E;AAC/E,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAE7C"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * The page-grouped prompt (FR24, FR27, FR28): one header with the count of pages and items, the
3
+ * items grouped by page (route and source file), each with its stable ID, and a closing request to
4
+ * report every ID page by page. Pure: the same items and options always give the same text.
5
+ */
6
+ import { partText, sizeText, wireframeLines } from './parts.js';
7
+ import { byRef, parseRef } from './schema.js';
8
+ const plural = (n, word) => `${n} ${word}${n === 1 ? '' : 's'}`;
9
+ /** A quoted string on one line: inner quotes escaped, line breaks kept as "\n"-free continuation. */
10
+ const quote = (text) => `"${text.trim().replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\s*\n\s*/g, ' / ')}"`;
11
+ const short = (text, max = 120) => (text.length > max ? `${text.slice(0, max - 1)}…` : text);
12
+ export const sourceText = (s) => `${s.file}${s.line ? `:${s.line}${s.column ? `:${s.column}` : ''}` : ''}`;
13
+ /** One planned layout change, as a step: "move it before `main > section:nth-of-type(3)` (section): 3rd of 4 -> 2nd". */
14
+ export function layoutChangeText(c) {
15
+ // Width and height are the size as rendered (border and padding included), as it was measured
16
+ if (c.op === 'set') {
17
+ if (c.property === 'grid-template-columns')
18
+ return `grid columns ${c.from} → ${c.to}`;
19
+ const rendered = /^(min-|max-)?(width|height)$/.test(c.property) && /px$/.test(c.to);
20
+ const kept = { left: 'right', right: 'left', up: 'bottom', down: 'top' };
21
+ const side = { left: 'the left', right: 'the right', up: 'the top', down: 'the bottom' };
22
+ const toward = { left: 'to the left', right: 'to the right', up: 'upward', down: 'downward' };
23
+ const grow = c.grow ? `, ${parseFloat(c.to) < parseFloat(c.from) ? `shrinking from ${side[c.grow]}` : `growing ${toward[c.grow]}`} (its ${kept[c.grow]} edge stays where it is)` : '';
24
+ return `${c.property}${rendered ? ' as rendered' : ''} ${c.from} → ${c.to}${c.token ? ` (${c.token})` : ''}${grow}`;
25
+ }
26
+ if (c.op === 'insert') {
27
+ const where = { before: 'before it', after: 'after it', start: 'inside it, at the start', end: 'inside it, at the end' }[c.position];
28
+ const size = sizeText(c.width, c.height);
29
+ return `insert ${partText(c.what)} ${where}${size ? `, ${size}${/px/.test(size) ? ' as rendered' : ''}` : ''}${c.label ? `: ${quote(c.label)}` : ''}`;
30
+ }
31
+ const ord = (n) => `${n}${n % 10 === 1 && n % 100 !== 11 ? 'st' : n % 10 === 2 && n % 100 !== 12 ? 'nd' : n % 10 === 3 && n % 100 !== 13 ? 'rd' : 'th'}`;
32
+ const where = c.position === 'first' ? 'to the start of its parent'
33
+ : c.position === 'last' ? 'to the end of its parent'
34
+ : `${c.position} ${c.sibling ? `\`${c.sibling.selector}\` (${c.sibling.element})` : 'its sibling'}`;
35
+ return `move it ${where}: ${ord(c.from)} of ${c.of} → ${ord(c.to)}`;
36
+ }
37
+ /** The page's source file: its own, else none (an item's file is the component, not the page). */
38
+ const pageSource = (items) => items.find(i => i.page.source)?.page.source;
39
+ function itemLines(item, detail) {
40
+ const t = item.target;
41
+ const lines = [`- [${item.ref}] ${item.intent}, ${item.priority}: ${quote(item.comment)}`];
42
+ lines.push(` selector: ${t.selector}`);
43
+ if (t.kind === 'text' && t.selectedText)
44
+ lines.push(` selected text: ${quote(short(t.selectedText))}`);
45
+ if (t.text)
46
+ lines.push(` text: ${quote(short(t.text))}`);
47
+ else if (!(t.kind === 'text' && t.selectedText))
48
+ lines.push(` element: ${t.element}`);
49
+ if (detail !== 'compact') {
50
+ if (t.source)
51
+ lines.push(` source: ${sourceText(t.source)}`);
52
+ if (t.components?.length)
53
+ lines.push(` components: ${t.components.join(' > ')}`);
54
+ }
55
+ if (item.layout) {
56
+ lines.push(` layout, planned in a ${item.layout.viewport.width}px wide window (keep it working at other widths):`);
57
+ for (const c of item.layout.changes)
58
+ lines.push(` - ${layoutChangeText(c)}`);
59
+ }
60
+ if (item.check) {
61
+ const c = item.check;
62
+ lines.push(` design check against ${c.design}: ${c.part}${c.state ? ` on ${c.state}` : ''}, ${c.property}: the design says ${c.expected}; built: ${c.actual}`);
63
+ }
64
+ if (item.wireframe) {
65
+ lines.push(` new page ${item.wireframe.route}, sketched in a ${item.wireframe.viewport.width}px wide window (create it with the project's own components; heights are rough), top to bottom:`);
66
+ lines.push(...wireframeLines(item.wireframe, ' '));
67
+ }
68
+ if (detail === 'detailed' && t.styles && Object.keys(t.styles).length) {
69
+ lines.push(` styles: ${Object.entries(t.styles).map(([k, v]) => `${k} ${v}`).join('; ')}`);
70
+ }
71
+ if (item.thread.length) {
72
+ // From the earlier agent sync: older notes may still hold a question and its answer
73
+ for (const m of item.thread)
74
+ lines.push(` ${m.from === 'agent' ? 'you asked' : 'answer'}: ${quote(m.text)}`);
75
+ }
76
+ return lines;
77
+ }
78
+ /** The prompt for these items (the caller picks which: pending ones, or all). Throws on an empty list. */
79
+ export function formatFeedbackPrompt(items, options = {}) {
80
+ if (!items.length)
81
+ throw new Error('No feedback items to put in a prompt.');
82
+ const detail = options.detail ?? 'standard';
83
+ const pages = new Map();
84
+ for (const item of byRef(items)) {
85
+ const page = parseRef(item.ref).page;
86
+ pages.set(page, [...(pages.get(page) ?? []), item]);
87
+ }
88
+ const count = pages.size;
89
+ const total = items.length;
90
+ const out = [
91
+ `# UI feedback: ${plural(count, 'page')}, ${plural(total, 'item')}`,
92
+ count > 1
93
+ ? `Apply every item below, on all ${count} pages. Do not stop after the first page.`
94
+ : 'Apply every item below.'
95
+ ];
96
+ let i = 0;
97
+ for (const [number, list] of pages) {
98
+ i++;
99
+ const first = list[0];
100
+ const source = pageSource(list);
101
+ // The ID keeps the page's number in the session; say so when this prompt numbers pages differently
102
+ const ids = number === i ? '' : ` (item IDs start with P${number})`;
103
+ out.push('', `## Page ${i} of ${count}: ${first.page.route}${source ? ` (${source})` : ''}${ids}`);
104
+ for (const item of list)
105
+ out.push(...itemLines(item, detail));
106
+ }
107
+ out.push('', '## When done', `Report every item ID as done, skipped or blocked, grouped by page,`, `and name the route to open to verify it.`, `End with the number of items done out of ${total}.`);
108
+ return `${out.join('\n')}\n`;
109
+ }
110
+ /** Every item ID a text mentions ("[P2-A3]", "P1-A1"), once each, in order. */
111
+ export function refsIn(text) {
112
+ return [...new Set([...text.matchAll(/\bP\d+-A\d+\b/g)].map(m => m[0]))];
113
+ }
114
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/feedback/prompt.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAA+E,MAAM,aAAa,CAAC;AAO3H,MAAM,MAAM,GAAG,CAAC,CAAS,EAAE,IAAY,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AAChF,qGAAqG;AACrG,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,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