@luci-dev/format 0.0.0-stage → 0.5.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.
- package/LICENSE +21 -0
- package/dist/agents.d.ts +25 -0
- package/dist/agents.d.ts.map +1 -0
- package/dist/agents.js +36 -0
- package/dist/agents.js.map +1 -0
- package/dist/capture/baseline.d.ts +53 -0
- package/dist/capture/baseline.d.ts.map +1 -0
- package/dist/capture/baseline.js +400 -0
- package/dist/capture/baseline.js.map +1 -0
- package/dist/capture/check.d.ts +111 -0
- package/dist/capture/check.d.ts.map +1 -0
- package/dist/capture/check.js +327 -0
- package/dist/capture/check.js.map +1 -0
- package/dist/capture/collection.d.ts +2647 -0
- package/dist/capture/collection.d.ts.map +1 -0
- package/dist/capture/collection.js +103 -0
- package/dist/capture/collection.js.map +1 -0
- package/dist/capture/compare.d.ts +50 -0
- package/dist/capture/compare.d.ts.map +1 -0
- package/dist/capture/compare.js +167 -0
- package/dist/capture/compare.js.map +1 -0
- package/dist/capture/format.d.ts +59 -0
- package/dist/capture/format.d.ts.map +1 -0
- package/dist/capture/format.js +540 -0
- package/dist/capture/format.js.map +1 -0
- package/dist/capture/image.d.ts +42 -0
- package/dist/capture/image.d.ts.map +1 -0
- package/dist/capture/image.js +103 -0
- package/dist/capture/image.js.map +1 -0
- package/dist/capture/index.d.ts +18 -0
- package/dist/capture/index.d.ts.map +1 -0
- package/dist/capture/index.js +18 -0
- package/dist/capture/index.js.map +1 -0
- package/dist/capture/layout.d.ts +21 -0
- package/dist/capture/layout.d.ts.map +1 -0
- package/dist/capture/layout.js +131 -0
- package/dist/capture/layout.js.map +1 -0
- package/dist/capture/merge.d.ts +46 -0
- package/dist/capture/merge.d.ts.map +1 -0
- package/dist/capture/merge.js +251 -0
- package/dist/capture/merge.js.map +1 -0
- package/dist/capture/read.d.ts +91 -0
- package/dist/capture/read.d.ts.map +1 -0
- package/dist/capture/read.js +179 -0
- package/dist/capture/read.js.map +1 -0
- package/dist/capture/remap.d.ts +34 -0
- package/dist/capture/remap.d.ts.map +1 -0
- package/dist/capture/remap.js +227 -0
- package/dist/capture/remap.js.map +1 -0
- package/dist/capture/rule.d.ts +19 -0
- package/dist/capture/rule.d.ts.map +1 -0
- package/dist/capture/rule.js +39 -0
- package/dist/capture/rule.js.map +1 -0
- package/dist/capture/schema.d.ts +3020 -0
- package/dist/capture/schema.d.ts.map +1 -0
- package/dist/capture/schema.js +488 -0
- package/dist/capture/schema.js.map +1 -0
- package/dist/capture/spacingUnit.d.ts +32 -0
- package/dist/capture/spacingUnit.d.ts.map +1 -0
- package/dist/capture/spacingUnit.js +49 -0
- package/dist/capture/spacingUnit.js.map +1 -0
- package/dist/capture/stitch.d.ts +11 -0
- package/dist/capture/stitch.d.ts.map +1 -0
- package/dist/capture/stitch.js +382 -0
- package/dist/capture/stitch.js.map +1 -0
- package/dist/capture/tokensExport.d.ts +37 -0
- package/dist/capture/tokensExport.d.ts.map +1 -0
- package/dist/capture/tokensExport.js +355 -0
- package/dist/capture/tokensExport.js.map +1 -0
- package/dist/capture/values.d.ts +47 -0
- package/dist/capture/values.d.ts.map +1 -0
- package/dist/capture/values.js +155 -0
- package/dist/capture/values.js.map +1 -0
- package/dist/feedback/index.d.ts +7 -0
- package/dist/feedback/index.d.ts.map +1 -0
- package/dist/feedback/index.js +7 -0
- package/dist/feedback/index.js.map +1 -0
- package/dist/feedback/layoutPrompt.d.ts +26 -0
- package/dist/feedback/layoutPrompt.d.ts.map +1 -0
- package/dist/feedback/layoutPrompt.js +38 -0
- package/dist/feedback/layoutPrompt.js.map +1 -0
- package/dist/feedback/parts.d.ts +17 -0
- package/dist/feedback/parts.d.ts.map +1 -0
- package/dist/feedback/parts.js +50 -0
- package/dist/feedback/parts.js.map +1 -0
- package/dist/feedback/prompt.d.ts +13 -0
- package/dist/feedback/prompt.d.ts.map +1 -0
- package/dist/feedback/prompt.js +114 -0
- package/dist/feedback/prompt.js.map +1 -0
- package/dist/feedback/schema.d.ts +504 -0
- package/dist/feedback/schema.d.ts.map +1 -0
- package/dist/feedback/schema.js +236 -0
- package/dist/feedback/schema.js.map +1 -0
- package/dist/feedback/wireframePrompt.d.ts +9 -0
- package/dist/feedback/wireframePrompt.d.ts.map +1 -0
- package/dist/feedback/wireframePrompt.js +24 -0
- package/dist/feedback/wireframePrompt.js.map +1 -0
- package/dist/home.d.ts +13 -0
- package/dist/home.d.ts.map +1 -0
- package/dist/home.js +19 -0
- package/dist/home.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/markdown/sections.d.ts +24 -0
- package/dist/markdown/sections.d.ts.map +1 -0
- package/dist/markdown/sections.js +58 -0
- package/dist/markdown/sections.js.map +1 -0
- package/dist/memory/activeTask.d.ts +25 -0
- package/dist/memory/activeTask.d.ts.map +1 -0
- package/dist/memory/activeTask.js +33 -0
- package/dist/memory/activeTask.js.map +1 -0
- package/dist/memory/brainJson.d.ts +44 -0
- package/dist/memory/brainJson.d.ts.map +1 -0
- package/dist/memory/brainJson.js +44 -0
- package/dist/memory/brainJson.js.map +1 -0
- package/dist/memory/decision.d.ts +30 -0
- package/dist/memory/decision.d.ts.map +1 -0
- package/dist/memory/decision.js +86 -0
- package/dist/memory/decision.js.map +1 -0
- package/dist/memory/layout.d.ts +41 -0
- package/dist/memory/layout.d.ts.map +1 -0
- package/dist/memory/layout.js +76 -0
- package/dist/memory/layout.js.map +1 -0
- package/dist/memory/proposed.d.ts +29 -0
- package/dist/memory/proposed.d.ts.map +1 -0
- package/dist/memory/proposed.js +63 -0
- package/dist/memory/proposed.js.map +1 -0
- package/dist/product.d.ts +17 -0
- package/dist/product.d.ts.map +1 -0
- package/dist/product.js +17 -0
- package/dist/product.js.map +1 -0
- package/dist/result.d.ts +17 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +20 -0
- package/dist/result.js.map +1 -0
- package/dist/skills/contract.d.ts +137 -0
- package/dist/skills/contract.d.ts.map +1 -0
- package/dist/skills/contract.js +131 -0
- package/dist/skills/contract.js.map +1 -0
- package/dist/skills/frontmatter.d.ts +31 -0
- package/dist/skills/frontmatter.d.ts.map +1 -0
- package/dist/skills/frontmatter.js +214 -0
- package/dist/skills/frontmatter.js.map +1 -0
- package/package.json +31 -3
- package/README.md +0 -3
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feedback items (FR23-FR30): notes a person pins on elements of a running app, for an agent to
|
|
3
|
+
* apply. One item per note, stored per project (not per page) so a session spans pages (FR26).
|
|
4
|
+
* Each item keeps a stable ID, `P<page>-A<n>`: the page is numbered in the order its route was
|
|
5
|
+
* first annotated in the session, the item in the order it was added on that page (FR27).
|
|
6
|
+
* See docs/format/feedback.md. Browser-safe: no Node imports.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from 'zod';
|
|
9
|
+
/** What the person wants: fix a bug, change a design, ask something, or confirm it is right. */
|
|
10
|
+
export const FEEDBACK_INTENTS = ['fix', 'change', 'question', 'approve'];
|
|
11
|
+
export const FEEDBACK_PRIORITIES = ['high', 'medium', 'low'];
|
|
12
|
+
/**
|
|
13
|
+
* Where a note is, set by the person (changed 13 Nov 2026: no agent writes statuses any more):
|
|
14
|
+
* `pending` (new), `sent` (copied in a prompt) or `resolved` (the person marked it done).
|
|
15
|
+
* `acknowledged`, `question` and `dismissed` come from the earlier agent sync and are still read
|
|
16
|
+
* (as copied, copied and done) so older notes keep working.
|
|
17
|
+
*/
|
|
18
|
+
export const FEEDBACK_STATUSES = ['pending', 'sent', 'acknowledged', 'question', 'resolved', 'dismissed'];
|
|
19
|
+
/** The statuses Luci sets now. */
|
|
20
|
+
export const PERSON_STATUSES = ['pending', 'sent', 'resolved'];
|
|
21
|
+
/** How much the prompt says about each element: selector and text; + source and components; + styles. */
|
|
22
|
+
export const DETAIL_LEVELS = ['compact', 'standard', 'detailed'];
|
|
23
|
+
export const FEEDBACK_REF = /^P(\d+)-A(\d+)$/;
|
|
24
|
+
const isoDateTime = z.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/, 'an ISO time in UTC, e.g. 2026-11-13T09:30:00.000Z');
|
|
25
|
+
/** A place in the project's code: a path relative to the project (or as the browser saw it), with line and column when known. */
|
|
26
|
+
export const sourceLocationSchema = z.object({
|
|
27
|
+
file: z.string().min(1),
|
|
28
|
+
line: z.number().int().positive().optional(),
|
|
29
|
+
column: z.number().int().positive().optional()
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Properties Layout mode changes: size, spacing (each side), the element as a flex or grid
|
|
33
|
+
* container, and its place in a flex or grid parent. `padding` (all sides) is from the first
|
|
34
|
+
* version and is still read.
|
|
35
|
+
*/
|
|
36
|
+
export const LAYOUT_PROPERTIES = [
|
|
37
|
+
'width', 'height', 'min-width', 'max-width', 'min-height', 'max-height',
|
|
38
|
+
'margin-top', 'margin-right', 'margin-bottom', 'margin-left',
|
|
39
|
+
'padding-top', 'padding-right', 'padding-bottom', 'padding-left', 'padding',
|
|
40
|
+
'display', 'flex-direction', 'flex-wrap', 'justify-content', 'align-items', 'gap', 'row-gap', 'column-gap', 'grid-template-columns',
|
|
41
|
+
'align-self', 'flex-grow', 'flex-shrink'
|
|
42
|
+
];
|
|
43
|
+
/**
|
|
44
|
+
* Generic blocks Layout mode can insert and sketch a new page with (added 13 Nov 2026): parts most
|
|
45
|
+
* pages are made of, for when the app has no component of that kind yet.
|
|
46
|
+
*/
|
|
47
|
+
export const LAYOUT_BLOCKS = ['section', 'heading', 'text', 'button', 'image slot', 'card', 'card grid', 'navigation', 'footer', 'form field'];
|
|
48
|
+
/**
|
|
49
|
+
* What a new part is (Layout mode steps 2 and 3): one of the app's own components (by name, with
|
|
50
|
+
* its file and one on the page now), a saved design capture (a reference in .luci/design/), or a
|
|
51
|
+
* generic block.
|
|
52
|
+
*/
|
|
53
|
+
export const partSchema = z.object({
|
|
54
|
+
kind: z.enum(['component', 'capture', 'block']),
|
|
55
|
+
/** "PlanCard", the capture's name ("Card"), or a block ("card grid"). */
|
|
56
|
+
name: z.string().trim().min(1),
|
|
57
|
+
/** The component's source file, or the capture's path in the project (.luci/design/...). */
|
|
58
|
+
file: z.string().min(1).optional(),
|
|
59
|
+
/** One of this component on the page now: its selector and name. */
|
|
60
|
+
example: z.object({ selector: z.string().min(1), element: z.string().min(1) }).optional()
|
|
61
|
+
});
|
|
62
|
+
/** A planned size: px as rendered (border and padding included), or "100%" for the full width. */
|
|
63
|
+
const plannedSize = z.string().regex(/^(\d+(\.\d+)?px|100%)$/, 'px as rendered, or 100%');
|
|
64
|
+
/**
|
|
65
|
+
* One planned layout change (Layout mode, added 13 Nov 2026): a move among the element's siblings,
|
|
66
|
+
* one property from its current value to the planned one (snapped to the page's spacing scale, with
|
|
67
|
+
* the custom property that has that value when the page has one), or a new part inserted before,
|
|
68
|
+
* after or inside the element.
|
|
69
|
+
*/
|
|
70
|
+
export const layoutChangeSchema = z.discriminatedUnion('op', [
|
|
71
|
+
z.object({
|
|
72
|
+
op: z.literal('move'),
|
|
73
|
+
/** The sibling it goes before or after (its selector and name), or the start or end of its parent. */
|
|
74
|
+
position: z.enum(['before', 'after', 'first', 'last']),
|
|
75
|
+
sibling: z.object({ selector: z.string().min(1), element: z.string().min(1) }).optional(),
|
|
76
|
+
/** Its place among its siblings, 1-based, before and after. */
|
|
77
|
+
from: z.number().int().positive(),
|
|
78
|
+
to: z.number().int().positive(),
|
|
79
|
+
of: z.number().int().positive()
|
|
80
|
+
}),
|
|
81
|
+
z.object({
|
|
82
|
+
op: z.literal('set'),
|
|
83
|
+
property: z.enum(LAYOUT_PROPERTIES),
|
|
84
|
+
from: z.string().min(1),
|
|
85
|
+
to: z.string().min(1),
|
|
86
|
+
token: z.string().regex(/^--[\w-]+$/).optional(),
|
|
87
|
+
/**
|
|
88
|
+
* Width or height changed with a handle: the side it grew or shrank on, the other edge staying
|
|
89
|
+
* where it was on screen (added 13 Nov 2026). "left" for the left handle, "up" for the top one.
|
|
90
|
+
*/
|
|
91
|
+
grow: z.enum(['left', 'right', 'up', 'down']).optional()
|
|
92
|
+
}),
|
|
93
|
+
z.object({
|
|
94
|
+
op: z.literal('insert'),
|
|
95
|
+
what: partSchema,
|
|
96
|
+
/** Before or after the element (a sibling), or inside it at the start or the end. */
|
|
97
|
+
position: z.enum(['before', 'after', 'start', 'end']),
|
|
98
|
+
width: plannedSize.optional(),
|
|
99
|
+
height: plannedSize.optional(),
|
|
100
|
+
/** What goes in it, in the person's words. */
|
|
101
|
+
label: z.string().trim().min(1).optional()
|
|
102
|
+
})
|
|
103
|
+
]);
|
|
104
|
+
const viewportSchema = z.object({ width: z.number().int().positive(), height: z.number().int().positive() });
|
|
105
|
+
export const layoutSchema = z.object({
|
|
106
|
+
/** The window width it was planned at: the agent asks or decides for other widths. */
|
|
107
|
+
viewport: viewportSchema,
|
|
108
|
+
changes: z.array(layoutChangeSchema).min(1)
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* A new page sketched in Layout mode (step 3, added 13 Nov 2026): rows from top to bottom, each
|
|
112
|
+
* split into blocks side by side. A block's share of its row is its span over the row's spans.
|
|
113
|
+
*/
|
|
114
|
+
export const wireframeSchema = z.object({
|
|
115
|
+
/** The new page's route ("/enterprise"). */
|
|
116
|
+
route: z.string().regex(/^\//, 'a route, starting with /'),
|
|
117
|
+
viewport: viewportSchema,
|
|
118
|
+
rows: z.array(z.object({
|
|
119
|
+
/** Rough height as drawn, in px. */
|
|
120
|
+
height: z.string().regex(/^\d+(\.\d+)?px$/),
|
|
121
|
+
blocks: z.array(z.object({
|
|
122
|
+
/** What it is; nothing chosen is an area the label describes. */
|
|
123
|
+
what: partSchema.optional(),
|
|
124
|
+
/** What goes in it, in the person's words. */
|
|
125
|
+
label: z.string().trim().min(1).optional(),
|
|
126
|
+
span: z.number().int().min(1).max(12)
|
|
127
|
+
})).min(1).max(12)
|
|
128
|
+
})).min(1)
|
|
129
|
+
});
|
|
130
|
+
/**
|
|
131
|
+
* A difference found by a design check (v0.3, added 14 Nov 2026): the built component compared with
|
|
132
|
+
* its design file. One item per difference; the comment says it in words, this says it exactly.
|
|
133
|
+
*/
|
|
134
|
+
export const designCheckSchema = z.object({
|
|
135
|
+
/** The design file: its path in the project (.luci/design/...) or its file name. */
|
|
136
|
+
design: z.string().min(1),
|
|
137
|
+
/** The part, as the design file names it ("container", "label", "icon"). */
|
|
138
|
+
part: z.string().min(1),
|
|
139
|
+
/** For a change in a state. */
|
|
140
|
+
state: z.enum(['hover', 'focus', 'focus-visible', 'active', 'disabled']).optional(),
|
|
141
|
+
/** The CSS property, "transition <property>", "part", or an accessibility check ("text contrast"). */
|
|
142
|
+
property: z.string().min(1),
|
|
143
|
+
/** As the design file writes it, with its token; "not set", "none" or "no change" when it has none. */
|
|
144
|
+
expected: z.string().min(1),
|
|
145
|
+
/** As Luci measured it on the built component. */
|
|
146
|
+
actual: z.string().min(1)
|
|
147
|
+
});
|
|
148
|
+
export const feedbackItemSchema = z.object({
|
|
149
|
+
/** The item's own id (its file name); never shown to agents. */
|
|
150
|
+
id: z.string().regex(/^[A-Za-z0-9_-]{6,64}$/, 'letters, digits, "-" and "_"'),
|
|
151
|
+
/** The stable ID agents report on: "P2-A3". */
|
|
152
|
+
ref: z.string().regex(FEEDBACK_REF, 'P<page>-A<n>, e.g. P2-A3'),
|
|
153
|
+
page: z.object({
|
|
154
|
+
/** The page's address, as the browser had it. */
|
|
155
|
+
url: z.string().min(1),
|
|
156
|
+
/** The route: the path, plus a "#/..." fragment for hash routers ("/pricing", "/#/settings"). */
|
|
157
|
+
route: z.string().min(1),
|
|
158
|
+
title: z.string().optional(),
|
|
159
|
+
/** The file of the page's own component, when a framework adapter found it ("src/pages/Pricing.tsx"). */
|
|
160
|
+
source: z.string().min(1).optional()
|
|
161
|
+
}),
|
|
162
|
+
target: z.object({
|
|
163
|
+
/** An element clicked, or text selected inside it. */
|
|
164
|
+
kind: z.enum(['element', 'text']),
|
|
165
|
+
/** A selector that finds the element (from tags and positions, ids when stable). */
|
|
166
|
+
selector: z.string().min(1),
|
|
167
|
+
/** The element named from tag and role: "button", "h2 (heading)". */
|
|
168
|
+
element: z.string().min(1),
|
|
169
|
+
/** The element's visible text, shortened. */
|
|
170
|
+
text: z.string().optional(),
|
|
171
|
+
/** The text the person selected (kind "text"). */
|
|
172
|
+
selectedText: z.string().optional(),
|
|
173
|
+
/** React (or another framework's) components around the element, outermost first, and where its JSX is written. */
|
|
174
|
+
components: z.array(z.string().min(1)).optional(),
|
|
175
|
+
source: sourceLocationSchema.optional(),
|
|
176
|
+
/** A few computed styles, for the "detailed" level. */
|
|
177
|
+
styles: z.record(z.string(), z.string()).optional(),
|
|
178
|
+
/** Where the element was on the page (document px), to place the marker again after a reload. */
|
|
179
|
+
rect: z.object({ x: z.number(), y: z.number(), width: z.number().nonnegative(), height: z.number().nonnegative() }).optional()
|
|
180
|
+
}),
|
|
181
|
+
comment: z.string().trim().min(1),
|
|
182
|
+
/** A layout change planned in Layout mode, on the target element. */
|
|
183
|
+
layout: layoutSchema.optional(),
|
|
184
|
+
/** A new page sketched in Layout mode (the target is the page it was sketched on). */
|
|
185
|
+
wireframe: wireframeSchema.optional(),
|
|
186
|
+
/** A difference from a design check: what the design says and what was built. */
|
|
187
|
+
check: designCheckSchema.optional(),
|
|
188
|
+
intent: z.enum(FEEDBACK_INTENTS),
|
|
189
|
+
priority: z.enum(FEEDBACK_PRIORITIES),
|
|
190
|
+
status: z.enum(FEEDBACK_STATUSES),
|
|
191
|
+
createdAt: isoDateTime,
|
|
192
|
+
updatedAt: isoDateTime,
|
|
193
|
+
/** When it was last put in a copied prompt (FR29). */
|
|
194
|
+
sentAt: isoDateTime.optional(),
|
|
195
|
+
/** The agent's questions and the person's answers, and status notes (FR30). */
|
|
196
|
+
thread: z.array(z.object({ from: z.enum(['agent', 'person']), text: z.string().trim().min(1), at: isoDateTime })).default([]),
|
|
197
|
+
/** What the agent did (resolved) or why not (dismissed). */
|
|
198
|
+
resolution: z.string().trim().min(1).optional()
|
|
199
|
+
});
|
|
200
|
+
/** The parts of a ref: P2-A3 -> { page: 2, n: 3 }. */
|
|
201
|
+
export function parseRef(ref) {
|
|
202
|
+
const m = FEEDBACK_REF.exec(ref);
|
|
203
|
+
return m ? { page: Number(m[1]), n: Number(m[2]) } : null;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* The route of an address: its path, plus the fragment when it holds a route ("#/settings").
|
|
207
|
+
* "http://localhost:5173/pricing?plan=pro" -> "/pricing".
|
|
208
|
+
*/
|
|
209
|
+
export function routeOf(url) {
|
|
210
|
+
try {
|
|
211
|
+
const u = new URL(url);
|
|
212
|
+
return `${u.pathname || '/'}${u.hash.startsWith('#/') ? u.hash : ''}`;
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
return url || '/';
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* The ref for a new item on a route: the route keeps the page number it already has in the
|
|
220
|
+
* session (any item on it), else gets the next one; the item gets the next number on that page.
|
|
221
|
+
*/
|
|
222
|
+
export function nextRef(items, route) {
|
|
223
|
+
const parsed = items.map(i => ({ route: i.page.route, ...parseRef(i.ref) })).filter(i => Number.isFinite(i.page));
|
|
224
|
+
const onRoute = parsed.find(i => i.route === route);
|
|
225
|
+
const page = onRoute ? onRoute.page : Math.max(0, ...parsed.map(i => i.page)) + 1;
|
|
226
|
+
const n = Math.max(0, ...parsed.filter(i => i.page === page).map(i => i.n)) + 1;
|
|
227
|
+
return `P${page}-A${n}`;
|
|
228
|
+
}
|
|
229
|
+
/** Items in prompt order: by page number, then item number. */
|
|
230
|
+
export function byRef(items) {
|
|
231
|
+
const key = (i) => parseRef(i.ref) ?? { page: Infinity, n: Infinity };
|
|
232
|
+
return [...items].sort((a, b) => key(a).page - key(b).page || key(a).n - key(b).n);
|
|
233
|
+
}
|
|
234
|
+
/** Statuses an agent still has to act on. */
|
|
235
|
+
export const OPEN_STATUSES = ['pending', 'sent', 'acknowledged', 'question'];
|
|
236
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/feedback/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,gGAAgG;AAChG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAU,CAAC;AAClF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAC;AACtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,CAAU,CAAC;AACnH,kCAAkC;AAClC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAU,CAAC;AACxE,yGAAyG;AACzG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,CAAU,CAAC;AAO1E,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAC9C,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,gDAAgD,EAAE,mDAAmD,CAAC,CAAC;AAE5I,iIAAiI;AACjI,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC5C,MAAM,EAAE,CAAC,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AC,EAAE,QAAQ,EAAE,CAAC;IACzE,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC;AAED,6CAA6C;AAC7C,MAAM,CAAC,MAAM,aAAa,GAA8B,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Wireframe } from './schema.js';
|
|
2
|
+
export interface WireframePromptInput {
|
|
3
|
+
wireframe: Wireframe;
|
|
4
|
+
/** The route it was sketched on, when that helps ("next to /pricing"). */
|
|
5
|
+
sketchedOn?: string;
|
|
6
|
+
note?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function formatWireframePrompt(input: WireframePromptInput): string;
|
|
9
|
+
//# sourceMappingURL=wireframePrompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireframePrompt.d.ts","sourceRoot":"","sources":["../../src/feedback/wireframePrompt.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,SAAS,CAAC;IACrB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAID,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAiBzE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The new-page prompt (Layout mode step 3, added 13 Nov 2026): a page sketched as rows of blocks,
|
|
3
|
+
* as numbered parts top to bottom, ready to paste to an agent. Pure.
|
|
4
|
+
*/
|
|
5
|
+
import { INSERT_HINT } from './layoutPrompt.js';
|
|
6
|
+
import { wireframeLines } from './parts.js';
|
|
7
|
+
const quote = (text) => `"${text.trim().replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\s*\n\s*/g, ' / ')}"`;
|
|
8
|
+
export function formatWireframePrompt(input) {
|
|
9
|
+
const w = input.wireframe;
|
|
10
|
+
const parts = w.rows.length;
|
|
11
|
+
const out = [
|
|
12
|
+
`# New page: ${w.route}, ${parts} part${parts === 1 ? '' : 's'}`,
|
|
13
|
+
`Create the page ${w.route} in this project and add it to the app's routing, with the project's own components, styles and tokens.`,
|
|
14
|
+
`It was sketched in a ${w.viewport.width}px wide window${input.sketchedOn ? `, over ${input.sketchedOn}` : ''}: keep it working at other widths. Heights are rough: let the content decide.`
|
|
15
|
+
];
|
|
16
|
+
if (w.rows.some(r => r.blocks.some(b => b.what)))
|
|
17
|
+
out.push(INSERT_HINT);
|
|
18
|
+
if (input.note?.trim())
|
|
19
|
+
out.push('', `Note: ${quote(input.note)}`);
|
|
20
|
+
out.push('', '## The page, top to bottom', ...wireframeLines(w));
|
|
21
|
+
out.push('', '## When done', `Report every part (1 to ${parts}) as done, skipped or blocked, and name the route to open to verify it.`);
|
|
22
|
+
return `${out.join('\n')}\n`;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=wireframePrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireframePrompt.js","sourceRoot":"","sources":["../../src/feedback/wireframePrompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAU5C,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAA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AAC;AAC/B,CAAC"}
|
package/dist/home.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Luci's per-user folder. Defaults to ~/.luci; set LUCI_HOME to move it, for
|
|
3
|
+
* example into a synced folder, to share one Global Brain across machines.
|
|
4
|
+
* Computes a path only; nothing is read or written.
|
|
5
|
+
*/
|
|
6
|
+
export declare function luciHome(): string;
|
|
7
|
+
/** The user's Global Brain: cross-project preferences and decisions. */
|
|
8
|
+
export declare const userBrainDir: () => string;
|
|
9
|
+
/** The user's personal skill library: skills added with `luci skills add`. */
|
|
10
|
+
export declare const userSkillsDir: () => string;
|
|
11
|
+
/** Pinned and blocked skills, part of the Global Brain. */
|
|
12
|
+
export declare const skillPreferencesFile: () => string;
|
|
13
|
+
//# sourceMappingURL=home.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../src/home.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,MAAM,CAGjC;AAED,wEAAwE;AACxE,eAAO,MAAM,YAAY,cAAuC,CAAC;AAEjE,8EAA8E;AAC9E,eAAO,MAAM,aAAa,cAAwC,CAAC;AAEnE,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,cAA4D,CAAC"}
|
package/dist/home.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import os from 'node:os';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { PRODUCT } from './product.js';
|
|
4
|
+
/**
|
|
5
|
+
* Luci's per-user folder. Defaults to ~/.luci; set LUCI_HOME to move it, for
|
|
6
|
+
* example into a synced folder, to share one Global Brain across machines.
|
|
7
|
+
* Computes a path only; nothing is read or written.
|
|
8
|
+
*/
|
|
9
|
+
export function luciHome() {
|
|
10
|
+
const env = process.env[PRODUCT.homeEnv];
|
|
11
|
+
return env ? path.resolve(env) : path.join(os.homedir(), PRODUCT.homeDir);
|
|
12
|
+
}
|
|
13
|
+
/** The user's Global Brain: cross-project preferences and decisions. */
|
|
14
|
+
export const userBrainDir = () => path.join(luciHome(), 'brain');
|
|
15
|
+
/** The user's personal skill library: skills added with `luci skills add`. */
|
|
16
|
+
export const userSkillsDir = () => path.join(luciHome(), 'skills');
|
|
17
|
+
/** Pinned and blocked skills, part of the Global Brain. */
|
|
18
|
+
export const skillPreferencesFile = () => path.join(userBrainDir(), 'skill-preferences.json');
|
|
19
|
+
//# sourceMappingURL=home.js.map
|
package/dist/home.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"home.js","sourceRoot":"","sources":["../src/home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;;GAIG;AACH,MAAM,UAAU,QAAQ;IACtB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AAC5E,CAAC;AAED,wEAAwE;AACxE,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;AAEjE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,CAAC;AAEnE,2DAA2D;AAC3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,wBAAwB,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { PRODUCT } from './product.js';
|
|
2
|
+
export { luciHome, userBrainDir, userSkillsDir, skillPreferencesFile } from './home.js';
|
|
3
|
+
export { type AgentId, AGENT_MARKER_PREFIX, AGENT_END_MARKER, AGENT_FILES, AGENT_LABELS, AGENT_NAMES, DEFAULT_AGENTS, agentStartMarker } from './agents.js';
|
|
4
|
+
export { type ParseResult, ok, fail, stripBom, normalizeText, parseJsonText } from './result.js';
|
|
5
|
+
export { type SectionRange, findSection, setSection, appendToSection, sectionBody, refreshSections } from './markdown/sections.js';
|
|
6
|
+
export { LAYOUT_VERSION, MEMORY_FILES, TEMPLATE_FILES, TEMPLATE_DIRS, AUTO_DETECTED, CONFIRMED, PROJECT_RULES_HEADING, PROJECT_GOAL_HEADING, LOCAL_GITIGNORE, PRECEDENCE, BRAIN_JSON_FILES } from './memory/layout.js';
|
|
7
|
+
export { type BrainJson, type ProjectCommands, brainJsonSchema, commandsSchema, parseBrainJson, formatBrainJson } from './memory/brainJson.js';
|
|
8
|
+
export { type Decision, decisionSchema, decisionFileName, parseDecision, formatDecision } from './memory/decision.js';
|
|
9
|
+
export { type Proposal, PROPOSAL_TARGETS, proposalSchema, parseProposal, formatProposal } from './memory/proposed.js';
|
|
10
|
+
export { type FrontmatterValue, type FrontmatterMap, type ParsedFrontmatter, parseFrontmatter, stringifyFrontmatter, fmString, fmMap } from './skills/frontmatter.js';
|
|
11
|
+
export { type LicenseCategory, type SkillSource, type SkillContract, type LockEntry, type SkillLock, type SkillPack, LSS_VERSION, SKILL_FILE, CONTRACT_FILE, LOCK_FILE, CATALOG_FILE, META, AGENT_SKILLS_FIELDS, LICENSE_CATEGORIES, PERMISSIONS, CONTRACT_FIELD_TYPES, skillSourceSchema, skillContractSchema, lockEntrySchema, skillLockSchema, packSchema, parseSkillContract, formatSkillContract, parseSkillLock, formatSkillLock } from './skills/contract.js';
|
|
12
|
+
export { type ActiveTaskHeader, type TaskStatus, TASK_STATUSES, activeTaskHeaderSchema, parseActiveTaskHeader } from './memory/activeTask.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,EAAE,KAAK,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5J,OAAO,EAAE,KAAK,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjG,OAAO,EACL,KAAK,YAAY,EACjB,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtH,OAAO,EAAE,KAAK,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,oBAAoB,EACpB,QAAQ,EACR,KAAK,EACN,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACd,WAAW,EACX,UAAU,EACV,aAAa,EACb,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export { PRODUCT } from './product.js';
|
|
2
|
+
export { luciHome, userBrainDir, userSkillsDir, skillPreferencesFile } from './home.js';
|
|
3
|
+
export { AGENT_MARKER_PREFIX, AGENT_END_MARKER, AGENT_FILES, AGENT_LABELS, AGENT_NAMES, DEFAULT_AGENTS, agentStartMarker } from './agents.js';
|
|
4
|
+
export { ok, fail, stripBom, normalizeText, parseJsonText } from './result.js';
|
|
5
|
+
export { findSection, setSection, appendToSection, sectionBody, refreshSections } from './markdown/sections.js';
|
|
6
|
+
export { LAYOUT_VERSION, MEMORY_FILES, TEMPLATE_FILES, TEMPLATE_DIRS, AUTO_DETECTED, CONFIRMED, PROJECT_RULES_HEADING, PROJECT_GOAL_HEADING, LOCAL_GITIGNORE, PRECEDENCE, BRAIN_JSON_FILES } from './memory/layout.js';
|
|
7
|
+
export { brainJsonSchema, commandsSchema, parseBrainJson, formatBrainJson } from './memory/brainJson.js';
|
|
8
|
+
export { decisionSchema, decisionFileName, parseDecision, formatDecision } from './memory/decision.js';
|
|
9
|
+
export { PROPOSAL_TARGETS, proposalSchema, parseProposal, formatProposal } from './memory/proposed.js';
|
|
10
|
+
export { parseFrontmatter, stringifyFrontmatter, fmString, fmMap } from './skills/frontmatter.js';
|
|
11
|
+
export { LSS_VERSION, SKILL_FILE, CONTRACT_FILE, LOCK_FILE, CATALOG_FILE, META, AGENT_SKILLS_FIELDS, LICENSE_CATEGORIES, PERMISSIONS, CONTRACT_FIELD_TYPES, skillSourceSchema, skillContractSchema, lockEntrySchema, skillLockSchema, packSchema, parseSkillContract, formatSkillContract, parseSkillLock, formatSkillLock } from './skills/contract.js';
|
|
12
|
+
export { TASK_STATUSES, activeTaskHeaderSchema, parseActiveTaskHeader } from './memory/activeTask.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,EAAgB,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5J,OAAO,EAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjG,OAAO,EAEL,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,SAAS,EACT,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,UAAU,EACV,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAGL,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAiB,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtH,OAAO,EAAiB,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtH,OAAO,EAIL,gBAAgB,EAChB,oBAAoB,EACpB,QAAQ,EACR,KAAK,EACN,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAOL,WAAW,EACX,UAAU,EACV,aAAa,EACb,SAAS,EACT,YAAY,EACZ,IAAI,EACJ,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Small helpers for editing "## heading" sections of Markdown files people also edit. */
|
|
2
|
+
export interface SectionRange {
|
|
3
|
+
/** Index of the heading line. */
|
|
4
|
+
start: number;
|
|
5
|
+
/** Index after the last body line (exclusive). */
|
|
6
|
+
end: number;
|
|
7
|
+
}
|
|
8
|
+
/** Find the line range of a "## heading" section, or null. */
|
|
9
|
+
export declare function findSection(lines: readonly string[], heading: string): SectionRange | null;
|
|
10
|
+
/** Replace the body of a "## heading" section, or append the section if it is missing. */
|
|
11
|
+
export declare function setSection(content: string, heading: string, body: string): string;
|
|
12
|
+
/** Add lines to the end of a "## heading" section, creating the section if it is missing. */
|
|
13
|
+
export declare function appendToSection(content: string, heading: string, newLines: readonly string[]): string;
|
|
14
|
+
/** The body text of a section, or '' when missing. */
|
|
15
|
+
export declare function sectionBody(content: string, heading: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Rewrite only the sections that exist with exactly these headings (e.g. "## Stack (auto-detected)").
|
|
18
|
+
* A section someone renamed (e.g. to "(confirmed)") or deleted is left alone.
|
|
19
|
+
*/
|
|
20
|
+
export declare function refreshSections(content: string, sections: Readonly<Record<string, string>>): {
|
|
21
|
+
content: string;
|
|
22
|
+
changed: string[];
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=sections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../src/markdown/sections.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;CACb;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAM1F;AAED,0FAA0F;AAC1F,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAOjF;AAED,6FAA6F;AAC7F,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CASrG;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAIpE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACzC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAWxC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Small helpers for editing "## heading" sections of Markdown files people also edit. */
|
|
2
|
+
/** Find the line range of a "## heading" section, or null. */
|
|
3
|
+
export function findSection(lines, heading) {
|
|
4
|
+
const start = lines.findIndex(l => l.trim() === heading);
|
|
5
|
+
if (start === -1)
|
|
6
|
+
return null;
|
|
7
|
+
let end = lines.findIndex((l, i) => i > start && l.startsWith('## '));
|
|
8
|
+
if (end === -1)
|
|
9
|
+
end = lines.length;
|
|
10
|
+
return { start, end };
|
|
11
|
+
}
|
|
12
|
+
/** Replace the body of a "## heading" section, or append the section if it is missing. */
|
|
13
|
+
export function setSection(content, heading, body) {
|
|
14
|
+
const lines = content.replace(/\r\n/g, '\n').replace(/\s+$/, '').split('\n');
|
|
15
|
+
const section = findSection(lines, heading);
|
|
16
|
+
const block = [heading, ...body.split('\n'), ''];
|
|
17
|
+
if (!section)
|
|
18
|
+
return `${lines.join('\n')}\n\n${block.join('\n')}`;
|
|
19
|
+
lines.splice(section.start, section.end - section.start, ...block);
|
|
20
|
+
return `${lines.join('\n').replace(/\s+$/, '')}\n`;
|
|
21
|
+
}
|
|
22
|
+
/** Add lines to the end of a "## heading" section, creating the section if it is missing. */
|
|
23
|
+
export function appendToSection(content, heading, newLines) {
|
|
24
|
+
const lines = content.replace(/\r\n/g, '\n').replace(/\s+$/, '').split('\n');
|
|
25
|
+
const section = findSection(lines, heading);
|
|
26
|
+
if (!section)
|
|
27
|
+
return `${lines.join('\n')}\n\n${heading}\n${newLines.join('\n')}\n`;
|
|
28
|
+
let insertAt = section.end;
|
|
29
|
+
while (insertAt > section.start + 1 && lines[insertAt - 1]?.trim() === '')
|
|
30
|
+
insertAt--;
|
|
31
|
+
lines.splice(insertAt, 0, ...newLines);
|
|
32
|
+
return `${lines.join('\n').replace(/\s+$/, '')}\n`;
|
|
33
|
+
}
|
|
34
|
+
/** The body text of a section, or '' when missing. */
|
|
35
|
+
export function sectionBody(content, heading) {
|
|
36
|
+
const lines = content.replace(/\r\n/g, '\n').split('\n');
|
|
37
|
+
const section = findSection(lines, heading);
|
|
38
|
+
return section ? lines.slice(section.start + 1, section.end).join('\n').trim() : '';
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Rewrite only the sections that exist with exactly these headings (e.g. "## Stack (auto-detected)").
|
|
42
|
+
* A section someone renamed (e.g. to "(confirmed)") or deleted is left alone.
|
|
43
|
+
*/
|
|
44
|
+
export function refreshSections(content, sections) {
|
|
45
|
+
let out = content;
|
|
46
|
+
const changed = [];
|
|
47
|
+
for (const [heading, body] of Object.entries(sections)) {
|
|
48
|
+
const lines = out.replace(/\r\n/g, '\n').split('\n');
|
|
49
|
+
if (!findSection(lines, heading))
|
|
50
|
+
continue;
|
|
51
|
+
const next = setSection(out, heading, body);
|
|
52
|
+
if (next.replace(/\s+$/, '') !== out.replace(/\r\n/g, '\n').replace(/\s+$/, ''))
|
|
53
|
+
changed.push(heading);
|
|
54
|
+
out = next;
|
|
55
|
+
}
|
|
56
|
+
return { content: out, changed };
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=sections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sections.js","sourceRoot":"","sources":["../../src/markdown/sections.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAS1F,8DAA8D;AAC9D,MAAM,UAAU,WAAW,CAAC,KAAwB,EAAE,OAAe;IACnE,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,OAAO,CAAC,CAAC;IACzD,IAAI,KAAK,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9B,IAAI,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,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M,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC;YAAE,SAAS;QAC3C,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5C,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;YAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvG,GAAG,GAAG,IAAI,CAAC;IACb,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The header of .luci/local/active-task.md: the fields Luci reads to decide whether
|
|
3
|
+
* a task is current. The rest of the file is written by the task commands (M3).
|
|
4
|
+
*
|
|
5
|
+
* - **Task**: <what is being done>
|
|
6
|
+
* - **Status**: active | done (YYYY-MM-DD) | replaced (YYYY-MM-DD)
|
|
7
|
+
* - **Started**: YYYY-MM-DD
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { type ParseResult } from '../result.js';
|
|
11
|
+
export declare const TASK_STATUSES: readonly ['active', 'done', 'replaced'];
|
|
12
|
+
export declare const activeTaskHeaderSchema: z.ZodObject<{
|
|
13
|
+
task: z.ZodNullable<z.ZodString>;
|
|
14
|
+
status: z.ZodEnum<{
|
|
15
|
+
active: "active";
|
|
16
|
+
done: "done";
|
|
17
|
+
replaced: "replaced";
|
|
18
|
+
}>;
|
|
19
|
+
started: z.ZodNullable<z.ZodISODate>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type ActiveTaskHeader = z.infer<typeof activeTaskHeaderSchema>;
|
|
22
|
+
export type TaskStatus = ActiveTaskHeader['status'];
|
|
23
|
+
/** A missing Status means active, as in the prototype. Only the first word of Status counts. */
|
|
24
|
+
export declare function parseActiveTaskHeader(text: string): ParseResult<ActiveTaskHeader>;
|
|
25
|
+
//# sourceMappingURL=activeTask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activeTask.d.ts","sourceRoot":"","sources":["../../src/memory/activeTask.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEzE,eAAO,MAAM,aAAa,YAAI,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAU,CAAC;AAErE,eAAO,MAAM,sBAAsB;;;;;;;;iBAIjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AAOpD,gGAAgG;AAChG,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,gBAAgB,CAAC,CASjF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The header of .luci/local/active-task.md: the fields Luci reads to decide whether
|
|
3
|
+
* a task is current. The rest of the file is written by the task commands (M3).
|
|
4
|
+
*
|
|
5
|
+
* - **Task**: <what is being done>
|
|
6
|
+
* - **Status**: active | done (YYYY-MM-DD) | replaced (YYYY-MM-DD)
|
|
7
|
+
* - **Started**: YYYY-MM-DD
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { fail, normalizeText, ok } from '../result.js';
|
|
11
|
+
export const TASK_STATUSES = ['active', 'done', 'replaced'];
|
|
12
|
+
export const activeTaskHeaderSchema = z.object({
|
|
13
|
+
task: z.string().trim().min(1).nullable(),
|
|
14
|
+
status: z.enum(TASK_STATUSES),
|
|
15
|
+
started: z.iso.date().nullable()
|
|
16
|
+
});
|
|
17
|
+
function field(text, name) {
|
|
18
|
+
const m = new RegExp(`^- \\*\\*${name}\\*\\*: (.+)$`, 'm').exec(text);
|
|
19
|
+
return m?.[1]?.trim() || null;
|
|
20
|
+
}
|
|
21
|
+
/** A missing Status means active, as in the prototype. Only the first word of Status counts. */
|
|
22
|
+
export function parseActiveTaskHeader(text) {
|
|
23
|
+
const content = normalizeText(text);
|
|
24
|
+
const result = activeTaskHeaderSchema.safeParse({
|
|
25
|
+
task: field(content, 'Task'),
|
|
26
|
+
status: (field(content, 'Status') ?? 'active').split(/\s/)[0]?.toLowerCase(),
|
|
27
|
+
started: field(content, 'Started')
|
|
28
|
+
});
|
|
29
|
+
if (!result.success)
|
|
30
|
+
return fail(`active task header is not valid:\n${z.prettifyError(result.error)}`);
|
|
31
|
+
return ok(result.data);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=activeTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activeTask.js","sourceRoot":"","sources":["../../src/memory/activeTask.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAoB,MAAM,cAAc,CAAC;AAEzE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAU,CAAC;AAErE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAA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able<z.ZodString>;
|
|
5
|
+
build: z.ZodNullable<z.ZodString>;
|
|
6
|
+
test: z.ZodNullable<z.ZodString>;
|
|
7
|
+
lint: z.ZodNullable<z.ZodString>;
|
|
8
|
+
typecheck: z.ZodNullable<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare const brainJsonSchema: z.ZodObject<{
|
|
11
|
+
layout: z.ZodLiteral<1>;
|
|
12
|
+
generatedBy: z.ZodString;
|
|
13
|
+
project: z.ZodObject<{
|
|
14
|
+
name: z.ZodString;
|
|
15
|
+
framework: z.ZodString;
|
|
16
|
+
languages: z.ZodArray<z.ZodString>;
|
|
17
|
+
packageManager: z.ZodString;
|
|
18
|
+
hasUi: z.ZodBoolean;
|
|
19
|
+
uiLibraries: z.ZodArray<z.ZodString>;
|
|
20
|
+
testing: z.ZodArray<z.ZodString>;
|
|
21
|
+
commands: z.ZodObject<{
|
|
22
|
+
dev: z.ZodNullable<z.ZodString>;
|
|
23
|
+
build: z.ZodNullable<z.ZodString>;
|
|
24
|
+
test: z.ZodNullable<z.ZodString>;
|
|
25
|
+
lint: z.ZodNullable<z.ZodString>;
|
|
26
|
+
typecheck: z.ZodNullable<z.ZodString>;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
packages: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
path: z.ZodString;
|
|
31
|
+
kind: z.ZodString;
|
|
32
|
+
framework: z.ZodString;
|
|
33
|
+
}, z.core.$strip>>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
precedence: z.ZodArray<z.ZodString>;
|
|
36
|
+
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
37
|
+
}, z.core.$loose>;
|
|
38
|
+
export type BrainJson = z.infer<typeof brainJsonSchema>;
|
|
39
|
+
export type ProjectCommands = z.infer<typeof commandsSchema>;
|
|
40
|
+
/** Parse .luci/brain.json. Keys someone added at the top level are kept. */
|
|
41
|
+
export declare function parseBrainJson(text: string): ParseResult<BrainJson>;
|
|
42
|
+
/** The file text for brain.json: validated, known keys first, two-space indent, trailing newline. */
|
|
43
|
+
export declare function formatBrainJson(value: BrainJson): string;
|
|
44
|
+
//# sourceMappingURL=brainJson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brainJson.d.ts","sourceRoot":"","sources":["../../src/memory/brainJson.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAIzE,eAAO,MAAM,cAAc;;;;;;iBAMzB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiB1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE7D,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC,CAMnE;AAED,qGAAqG;AACrG,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAExD"}
|