design-brain-memory 0.2.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.
- package/README.md +167 -0
- package/dist/agentBrowser.d.ts +9 -0
- package/dist/agentBrowser.js +96 -0
- package/dist/agentBrowser.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +212 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands.d.ts +27 -0
- package/dist/commands.js +178 -0
- package/dist/commands.js.map +1 -0
- package/dist/extractFromImage.d.ts +7 -0
- package/dist/extractFromImage.js +72 -0
- package/dist/extractFromImage.js.map +1 -0
- package/dist/extractFromUrl.d.ts +13 -0
- package/dist/extractFromUrl.js +605 -0
- package/dist/extractFromUrl.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/interactive.d.ts +3 -0
- package/dist/interactive.js +42 -0
- package/dist/interactive.js.map +1 -0
- package/dist/llm.d.ts +33 -0
- package/dist/llm.js +250 -0
- package/dist/llm.js.map +1 -0
- package/dist/query.d.ts +25 -0
- package/dist/query.js +150 -0
- package/dist/query.js.map +1 -0
- package/dist/render.d.ts +2 -0
- package/dist/render.js +365 -0
- package/dist/render.js.map +1 -0
- package/dist/skillPrompt.d.ts +3 -0
- package/dist/skillPrompt.js +66 -0
- package/dist/skillPrompt.js.map +1 -0
- package/dist/store.d.ts +14 -0
- package/dist/store.js +69 -0
- package/dist/store.js.map +1 -0
- package/dist/svg.d.ts +5 -0
- package/dist/svg.js +162 -0
- package/dist/svg.js.map +1 -0
- package/dist/types.d.ts +175 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +9 -0
- package/dist/util.js +51 -0
- package/dist/util.js.map +1 -0
- package/package.json +53 -0
package/dist/svg.js
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { truncate } from './util.js';
|
|
2
|
+
function escapeXml(text) {
|
|
3
|
+
return text
|
|
4
|
+
.replace(/&/g, '&')
|
|
5
|
+
.replace(/</g, '<')
|
|
6
|
+
.replace(/>/g, '>')
|
|
7
|
+
.replace(/"/g, '"');
|
|
8
|
+
}
|
|
9
|
+
const SWATCH_SIZE = 60;
|
|
10
|
+
const SWATCH_GAP = 12;
|
|
11
|
+
const COLS = 5;
|
|
12
|
+
const MAX_COLORS = 20;
|
|
13
|
+
const FONT = 'system-ui, -apple-system, sans-serif';
|
|
14
|
+
export function generatePaletteSvg(colors, title) {
|
|
15
|
+
const items = colors.slice(0, MAX_COLORS);
|
|
16
|
+
if (items.length === 0) {
|
|
17
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 60">\n`
|
|
18
|
+
+ ` <text x="10" y="30" font-family="${FONT}" font-size="14" fill="#888">No colors captured</text>\n`
|
|
19
|
+
+ `</svg>`;
|
|
20
|
+
}
|
|
21
|
+
const maxCount = Math.max(...items.map((c) => c.count), 1);
|
|
22
|
+
const rows = Math.ceil(items.length / COLS);
|
|
23
|
+
const cellW = SWATCH_SIZE + SWATCH_GAP;
|
|
24
|
+
const rowH = SWATCH_SIZE + 60;
|
|
25
|
+
const width = COLS * cellW + SWATCH_GAP;
|
|
26
|
+
const height = 40 + rows * rowH + 10;
|
|
27
|
+
const rects = items.map((color, i) => {
|
|
28
|
+
const col = i % COLS;
|
|
29
|
+
const row = Math.floor(i / COLS);
|
|
30
|
+
const x = SWATCH_GAP + col * cellW;
|
|
31
|
+
const y = 40 + row * rowH;
|
|
32
|
+
const barW = Math.round((color.count / maxCount) * SWATCH_SIZE);
|
|
33
|
+
const hex = escapeXml(color.hex);
|
|
34
|
+
return [
|
|
35
|
+
` <rect x="${x}" y="${y}" width="${SWATCH_SIZE}" height="${SWATCH_SIZE}" fill="${hex}" rx="4"/>`,
|
|
36
|
+
` <text x="${x}" y="${y + SWATCH_SIZE + 14}" font-family="${FONT}" font-size="10" fill="#333">${hex}</text>`,
|
|
37
|
+
` <rect x="${x}" y="${y + SWATCH_SIZE + 20}" width="${SWATCH_SIZE}" height="6" fill="#eee" rx="2"/>`,
|
|
38
|
+
` <rect x="${x}" y="${y + SWATCH_SIZE + 20}" width="${barW}" height="6" fill="${hex}" rx="2"/>`,
|
|
39
|
+
` <text x="${x}" y="${y + SWATCH_SIZE + 40}" font-family="${FONT}" font-size="9" fill="#888">${color.count}</text>`,
|
|
40
|
+
].join('\n');
|
|
41
|
+
});
|
|
42
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${width} ${height}">\n`
|
|
43
|
+
+ ` <text x="${SWATCH_GAP}" y="24" font-family="${FONT}" font-size="16" font-weight="600" fill="#111">${escapeXml(title)} — Color Palette</text>\n`
|
|
44
|
+
+ rects.join('\n')
|
|
45
|
+
+ `\n</svg>`;
|
|
46
|
+
}
|
|
47
|
+
const COMP_GROUP_W = 220;
|
|
48
|
+
const COMP_ITEM_H = 52;
|
|
49
|
+
const COMP_GAP = 16;
|
|
50
|
+
export function generateComponentsSvg(components, title) {
|
|
51
|
+
if (components.length === 0) {
|
|
52
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 60">\n`
|
|
53
|
+
+ ` <text x="10" y="30" font-family="${FONT}" font-size="14" fill="#888">No components captured</text>\n`
|
|
54
|
+
+ `</svg>`;
|
|
55
|
+
}
|
|
56
|
+
const groups = new Map();
|
|
57
|
+
for (const comp of components) {
|
|
58
|
+
const list = groups.get(comp.kind) ?? [];
|
|
59
|
+
list.push(comp);
|
|
60
|
+
groups.set(comp.kind, list);
|
|
61
|
+
}
|
|
62
|
+
const sortedGroups = [...groups.entries()].sort((a, b) => b[1].length - a[1].length);
|
|
63
|
+
const colOffsets = [COMP_GAP, COMP_GROUP_W + COMP_GAP * 2];
|
|
64
|
+
const colHeights = [50, 50];
|
|
65
|
+
const groupSvgs = [];
|
|
66
|
+
for (const [kind, items] of sortedGroups) {
|
|
67
|
+
const col = colHeights[0] <= colHeights[1] ? 0 : 1;
|
|
68
|
+
const x = colOffsets[col];
|
|
69
|
+
let y = colHeights[col];
|
|
70
|
+
groupSvgs.push(` <text x="${x}" y="${y + 16}" font-family="${FONT}" font-size="13" font-weight="600" fill="#333">${escapeXml(kind)} (${items.length})</text>`);
|
|
71
|
+
y += 24;
|
|
72
|
+
const visible = items.slice(0, 8);
|
|
73
|
+
const boxH = visible.length * COMP_ITEM_H + 8;
|
|
74
|
+
groupSvgs.push(` <rect x="${x}" y="${y}" width="${COMP_GROUP_W}" height="${boxH}" fill="none" stroke="#ddd" rx="6"/>`);
|
|
75
|
+
for (let idx = 0; idx < visible.length; idx++) {
|
|
76
|
+
const item = visible[idx];
|
|
77
|
+
groupSvgs.push(` <text x="${x + 8}" y="${y + 18}" font-family="${FONT}" font-size="11" fill="#555"><${escapeXml(item.tag)}></text>`, ` <text x="${x + 8}" y="${y + 32}" font-family="monospace" font-size="10" fill="#888">${escapeXml(item.selector)}</text>`, ` <text x="${x + 8}" y="${y + 44}" font-family="${FONT}" font-size="10" fill="#aaa">${escapeXml(truncate(item.text || '-', 30))}</text>`);
|
|
78
|
+
y += COMP_ITEM_H;
|
|
79
|
+
if (idx < visible.length - 1) {
|
|
80
|
+
groupSvgs.push(` <line x1="${x + 8}" y1="${y}" x2="${x + COMP_GROUP_W - 8}" y2="${y}" stroke="#eee"/>`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
colHeights[col] = y + boxH / visible.length + COMP_GAP;
|
|
84
|
+
}
|
|
85
|
+
const height = Math.max(...colHeights) + 10;
|
|
86
|
+
const width = colOffsets[1] + COMP_GROUP_W + COMP_GAP;
|
|
87
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${width} ${height}">\n`
|
|
88
|
+
+ ` <text x="${COMP_GAP}" y="28" font-family="${FONT}" font-size="16" font-weight="600" fill="#111">${escapeXml(title)} — Component Inventory</text>\n`
|
|
89
|
+
+ groupSvgs.join('\n')
|
|
90
|
+
+ `\n</svg>`;
|
|
91
|
+
}
|
|
92
|
+
const TYPO_ROW_H = 36;
|
|
93
|
+
const TYPO_BAR_W = 60;
|
|
94
|
+
export function generateTypographySvg(tokens, title) {
|
|
95
|
+
if (tokens.length === 0) {
|
|
96
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 60">\n`
|
|
97
|
+
+ ` <text x="10" y="30" font-family="${FONT}" font-size="14" fill="#888">No typography captured</text>\n`
|
|
98
|
+
+ `</svg>`;
|
|
99
|
+
}
|
|
100
|
+
const families = new Map();
|
|
101
|
+
for (const token of tokens) {
|
|
102
|
+
const list = families.get(token.fontFamily) ?? [];
|
|
103
|
+
list.push(token);
|
|
104
|
+
families.set(token.fontFamily, list);
|
|
105
|
+
}
|
|
106
|
+
const maxCount = Math.max(...tokens.map((t) => t.count), 1);
|
|
107
|
+
const width = 600;
|
|
108
|
+
let y = 50;
|
|
109
|
+
const lines = [];
|
|
110
|
+
for (const [family, items] of families) {
|
|
111
|
+
lines.push(` <text x="12" y="${y}" font-family="${FONT}" font-size="14" font-weight="600" fill="#222">${escapeXml(family)}</text>`);
|
|
112
|
+
y += 6;
|
|
113
|
+
lines.push(` <line x1="12" y1="${y}" x2="${width - 12}" y2="${y}" stroke="#ddd"/>`);
|
|
114
|
+
y += 20;
|
|
115
|
+
for (const token of items.slice(0, 10)) {
|
|
116
|
+
const meta = `${escapeXml(token.fontSize)} / ${escapeXml(token.fontWeight)} / ${escapeXml(token.lineHeight)}`;
|
|
117
|
+
const barW = Math.round((token.count / maxCount) * TYPO_BAR_W);
|
|
118
|
+
lines.push(` <text x="12" y="${y}" font-family="${FONT}" font-size="11" fill="#555">${meta}</text>`, ` <rect x="240" y="${y - 8}" width="${TYPO_BAR_W}" height="8" fill="#eee" rx="2"/>`, ` <rect x="240" y="${y - 8}" width="${barW}" height="8" fill="#555" rx="2"/>`, ` <text x="310" y="${y}" font-family="${FONT}" font-size="9" fill="#888">${token.count}</text>`, ` <text x="350" y="${y}" font-family="${escapeXml(family)}, ${FONT}" font-size="12" fill="#333">Aa Bb Cc 123</text>`);
|
|
119
|
+
y += TYPO_ROW_H;
|
|
120
|
+
}
|
|
121
|
+
y += 12;
|
|
122
|
+
}
|
|
123
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${width} ${y + 10}">\n`
|
|
124
|
+
+ ` <text x="12" y="28" font-family="${FONT}" font-size="16" font-weight="600" fill="#111">${escapeXml(title)} — Typography Specimen</text>\n`
|
|
125
|
+
+ lines.join('\n')
|
|
126
|
+
+ `\n</svg>`;
|
|
127
|
+
}
|
|
128
|
+
const LAYOUT_W = 500;
|
|
129
|
+
const LAYOUT_PAD = 16;
|
|
130
|
+
const LAYOUT_ITEM_H = 56;
|
|
131
|
+
const ROLE_COLORS = {
|
|
132
|
+
banner: '#E3F2FD',
|
|
133
|
+
navigation: '#FFF3E0',
|
|
134
|
+
main: '#E8F5E9',
|
|
135
|
+
complementary: '#F3E5F5',
|
|
136
|
+
contentinfo: '#ECEFF1',
|
|
137
|
+
region: '#FFFDE7',
|
|
138
|
+
};
|
|
139
|
+
export function generateLayoutSvg(layout, title) {
|
|
140
|
+
if (layout.length === 0) {
|
|
141
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 60">\n`
|
|
142
|
+
+ ` <text x="10" y="30" font-family="${FONT}" font-size="14" fill="#888">No layout captured</text>\n`
|
|
143
|
+
+ `</svg>`;
|
|
144
|
+
}
|
|
145
|
+
const items = layout.slice(0, 12);
|
|
146
|
+
const nestedTags = new Set(['aside', 'section', 'article']);
|
|
147
|
+
let y = 50;
|
|
148
|
+
const lines = [];
|
|
149
|
+
for (const item of items) {
|
|
150
|
+
const isNested = nestedTags.has(item.tag);
|
|
151
|
+
const indent = isNested ? LAYOUT_PAD * 2 : LAYOUT_PAD;
|
|
152
|
+
const boxW = isNested ? LAYOUT_W - LAYOUT_PAD * 4 : LAYOUT_W - LAYOUT_PAD * 2;
|
|
153
|
+
const fill = ROLE_COLORS[item.role] ?? '#F5F5F5';
|
|
154
|
+
lines.push(` <rect x="${indent}" y="${y}" width="${boxW}" height="${LAYOUT_ITEM_H}" fill="${fill}" stroke="#ccc" rx="4"/>`, ` <text x="${indent + 8}" y="${y + 18}" font-family="${FONT}" font-size="11" font-weight="600" fill="#333"><${escapeXml(item.tag)}> ${escapeXml(item.selector)} [${escapeXml(item.role || '-')}]</text>`, ` <text x="${indent + 8}" y="${y + 36}" font-family="${FONT}" font-size="10" fill="#888">children: ${item.children}</text>`);
|
|
155
|
+
y += LAYOUT_ITEM_H + 8;
|
|
156
|
+
}
|
|
157
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${LAYOUT_W} ${y + 10}">\n`
|
|
158
|
+
+ ` <text x="${LAYOUT_PAD}" y="28" font-family="${FONT}" font-size="16" font-weight="600" fill="#111">${escapeXml(title)} — Layout Structure</text>\n`
|
|
159
|
+
+ lines.join('\n')
|
|
160
|
+
+ `\n</svg>`;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=svg.js.map
|
package/dist/svg.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../src/svg.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI;SACR,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC7B,CAAC;AAED,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,IAAI,GAAG,CAAC,CAAC;AACf,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,IAAI,GAAG,sCAAsC,CAAC;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AAC,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC,UAAU,EAC/M,cAAc,MAAM,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE,kBAAkB,IAAI,0CAA0C,IAAI,CAAC,QAAQ,SAAS,CAC7H,CAAC;QACF,CAAC,IAAI,aAAa,GAAG,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,wDAAwD,QAAQ,IAAI,CAAC,GAAG,EAAE,MAAM;UACnF,cAAc,UAAU,yBAAyB,IAAI,kDAAkD,SAAS,CAAC,KAAK,CAAC,8BAA8B;UACrJ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;UAChB,UAAU,CAAC;AACjB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
export type SourceType = 'url' | 'screenshot';
|
|
2
|
+
export interface ColorToken {
|
|
3
|
+
hex: string;
|
|
4
|
+
count: number;
|
|
5
|
+
samples: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface TypographyToken {
|
|
8
|
+
fontFamily: string;
|
|
9
|
+
fontSize: string;
|
|
10
|
+
fontWeight: string;
|
|
11
|
+
lineHeight: string;
|
|
12
|
+
count: number;
|
|
13
|
+
}
|
|
14
|
+
export interface ComponentToken {
|
|
15
|
+
kind: string;
|
|
16
|
+
tag: string;
|
|
17
|
+
selector: string;
|
|
18
|
+
text: string;
|
|
19
|
+
className: string;
|
|
20
|
+
styles: Record<string, string>;
|
|
21
|
+
}
|
|
22
|
+
export interface MotionToken {
|
|
23
|
+
selector: string;
|
|
24
|
+
transition: string;
|
|
25
|
+
animation: string;
|
|
26
|
+
transform: string;
|
|
27
|
+
}
|
|
28
|
+
export interface LayoutToken {
|
|
29
|
+
tag: string;
|
|
30
|
+
selector: string;
|
|
31
|
+
role: string;
|
|
32
|
+
children: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ResponsiveSnapshot {
|
|
35
|
+
label: string;
|
|
36
|
+
viewport: {
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
};
|
|
40
|
+
url?: string;
|
|
41
|
+
title?: string;
|
|
42
|
+
colorCount: number;
|
|
43
|
+
componentCount: number;
|
|
44
|
+
typographyCount: number;
|
|
45
|
+
}
|
|
46
|
+
export interface StateStyleToken {
|
|
47
|
+
selector: string;
|
|
48
|
+
state: 'hover' | 'focus' | 'active';
|
|
49
|
+
declarations: Record<string, string>;
|
|
50
|
+
}
|
|
51
|
+
export interface JourneyStep {
|
|
52
|
+
step: number;
|
|
53
|
+
action: string;
|
|
54
|
+
fromUrl?: string;
|
|
55
|
+
toUrl?: string;
|
|
56
|
+
title?: string;
|
|
57
|
+
summary?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface DesignAnalysis {
|
|
60
|
+
pageTitle?: string;
|
|
61
|
+
pageUrl?: string;
|
|
62
|
+
viewport?: {
|
|
63
|
+
width: number;
|
|
64
|
+
height: number;
|
|
65
|
+
};
|
|
66
|
+
colors: ColorToken[];
|
|
67
|
+
typography: TypographyToken[];
|
|
68
|
+
components: ComponentToken[];
|
|
69
|
+
motion: MotionToken[];
|
|
70
|
+
layout: LayoutToken[];
|
|
71
|
+
cssVariables: Record<string, string>;
|
|
72
|
+
accessibilitySnapshot?: string;
|
|
73
|
+
responsiveSnapshots?: ResponsiveSnapshot[];
|
|
74
|
+
stateStyles?: StateStyleToken[];
|
|
75
|
+
journey?: JourneyStep[];
|
|
76
|
+
}
|
|
77
|
+
export interface LlmConfig {
|
|
78
|
+
baseUrl: string;
|
|
79
|
+
apiKey: string;
|
|
80
|
+
model: string;
|
|
81
|
+
timeoutMs?: number;
|
|
82
|
+
}
|
|
83
|
+
export interface LlmEnrichment {
|
|
84
|
+
summary: string;
|
|
85
|
+
designPrinciples: string[];
|
|
86
|
+
componentPatterns: string[];
|
|
87
|
+
colorNarrative: string;
|
|
88
|
+
suggestedTags: string[];
|
|
89
|
+
layoutGuidance?: string[];
|
|
90
|
+
motionGuidance?: string[];
|
|
91
|
+
model: string;
|
|
92
|
+
baseUrl: string;
|
|
93
|
+
generatedAt: string;
|
|
94
|
+
}
|
|
95
|
+
export interface InspirationDiff {
|
|
96
|
+
previousId: string;
|
|
97
|
+
addedColors: string[];
|
|
98
|
+
removedColors: string[];
|
|
99
|
+
componentCountDelta: number;
|
|
100
|
+
motionCountDelta: number;
|
|
101
|
+
}
|
|
102
|
+
export interface InspirationRecord {
|
|
103
|
+
id: string;
|
|
104
|
+
name: string;
|
|
105
|
+
sourceType: SourceType;
|
|
106
|
+
url?: string;
|
|
107
|
+
originalImagePath?: string;
|
|
108
|
+
screenshotPath?: string;
|
|
109
|
+
capturedAt: string;
|
|
110
|
+
tags: string[];
|
|
111
|
+
notes?: string;
|
|
112
|
+
inspirationSummary?: string;
|
|
113
|
+
llmEnrichment?: LlmEnrichment;
|
|
114
|
+
fingerprint: string;
|
|
115
|
+
version: number;
|
|
116
|
+
supersedes?: string;
|
|
117
|
+
diffFromPrevious?: InspirationDiff;
|
|
118
|
+
analysis: DesignAnalysis;
|
|
119
|
+
}
|
|
120
|
+
export interface OutcomeRecord {
|
|
121
|
+
id: string;
|
|
122
|
+
title: string;
|
|
123
|
+
description: string;
|
|
124
|
+
inspiredBy: string[];
|
|
125
|
+
artifactUrl?: string;
|
|
126
|
+
createdAt: string;
|
|
127
|
+
tags: string[];
|
|
128
|
+
}
|
|
129
|
+
export interface ProjectRecord {
|
|
130
|
+
id: string;
|
|
131
|
+
name: string;
|
|
132
|
+
createdAt: string;
|
|
133
|
+
updatedAt: string;
|
|
134
|
+
description?: string;
|
|
135
|
+
inspirations: InspirationRecord[];
|
|
136
|
+
outcomes: OutcomeRecord[];
|
|
137
|
+
}
|
|
138
|
+
export interface DesignBrainDatabase {
|
|
139
|
+
version: 1;
|
|
140
|
+
createdAt: string;
|
|
141
|
+
updatedAt: string;
|
|
142
|
+
projects: ProjectRecord[];
|
|
143
|
+
}
|
|
144
|
+
export interface InitOptions {
|
|
145
|
+
rootDir: string;
|
|
146
|
+
}
|
|
147
|
+
export interface IngestOptions {
|
|
148
|
+
rootDir: string;
|
|
149
|
+
project: string;
|
|
150
|
+
projectName?: string;
|
|
151
|
+
projectDescription?: string;
|
|
152
|
+
url?: string;
|
|
153
|
+
screenshot?: string;
|
|
154
|
+
name?: string;
|
|
155
|
+
notes?: string;
|
|
156
|
+
inspirationSummary?: string;
|
|
157
|
+
tags: string[];
|
|
158
|
+
llm?: LlmConfig;
|
|
159
|
+
journeySteps?: number;
|
|
160
|
+
responsiveViewports?: Array<{
|
|
161
|
+
label: string;
|
|
162
|
+
width: number;
|
|
163
|
+
height: number;
|
|
164
|
+
}>;
|
|
165
|
+
skipVisuals?: boolean;
|
|
166
|
+
}
|
|
167
|
+
export interface OutcomeOptions {
|
|
168
|
+
rootDir: string;
|
|
169
|
+
project: string;
|
|
170
|
+
title: string;
|
|
171
|
+
description: string;
|
|
172
|
+
inspiredBy: string[];
|
|
173
|
+
artifactUrl?: string;
|
|
174
|
+
tags: string[];
|
|
175
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/dist/util.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function nowIso(): string;
|
|
2
|
+
export declare function slugify(value: string): string;
|
|
3
|
+
export declare function makeId(prefix: string, input: string): string;
|
|
4
|
+
export declare function unique<T>(items: T[]): T[];
|
|
5
|
+
export declare function relPath(from: string, to: string): string;
|
|
6
|
+
export declare function truncate(text: string, max?: number): string;
|
|
7
|
+
export declare function csvEscape(value: string): string;
|
|
8
|
+
export declare function stableHash(input: string): string;
|
|
9
|
+
export declare function normalizeUrl(input: string): string;
|
package/dist/util.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import crypto from 'node:crypto';
|
|
3
|
+
export function nowIso() {
|
|
4
|
+
return new Date().toISOString();
|
|
5
|
+
}
|
|
6
|
+
export function slugify(value) {
|
|
7
|
+
return value
|
|
8
|
+
.toLowerCase()
|
|
9
|
+
.trim()
|
|
10
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
11
|
+
.replace(/(^-|-$)/g, '')
|
|
12
|
+
.slice(0, 64);
|
|
13
|
+
}
|
|
14
|
+
export function makeId(prefix, input) {
|
|
15
|
+
const slug = slugify(input);
|
|
16
|
+
const hash = crypto.createHash('sha1').update(`${input}:${Date.now()}:${Math.random()}`).digest('hex').slice(0, 8);
|
|
17
|
+
return `${prefix}-${slug || 'item'}-${hash}`;
|
|
18
|
+
}
|
|
19
|
+
export function unique(items) {
|
|
20
|
+
return [...new Set(items)];
|
|
21
|
+
}
|
|
22
|
+
export function relPath(from, to) {
|
|
23
|
+
const relative = path.relative(from, to);
|
|
24
|
+
return relative.startsWith('.') ? relative : `./${relative}`;
|
|
25
|
+
}
|
|
26
|
+
export function truncate(text, max = 120) {
|
|
27
|
+
if (text.length <= max) {
|
|
28
|
+
return text;
|
|
29
|
+
}
|
|
30
|
+
return `${text.slice(0, max - 1)}...`;
|
|
31
|
+
}
|
|
32
|
+
export function csvEscape(value) {
|
|
33
|
+
if (value.includes(',') || value.includes('"') || value.includes('\n')) {
|
|
34
|
+
return `"${value.replace(/"/g, '""')}"`;
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
export function stableHash(input) {
|
|
39
|
+
return crypto.createHash('sha1').update(input).digest('hex');
|
|
40
|
+
}
|
|
41
|
+
export function normalizeUrl(input) {
|
|
42
|
+
try {
|
|
43
|
+
const parsed = new URL(input);
|
|
44
|
+
parsed.hash = '';
|
|
45
|
+
return parsed.toString();
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return input.trim();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=util.js.map
|
package/dist/util.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1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Q,EAAE,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,GAAG,GAAG,GAAG;IAC9C,IAAI,IAAI,CAAC,MAAM,IAAI,GAAG,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACvE,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC;IAC1C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QAC9B,MAAM,CAAC,IAAI,GAAG,EAAE,CAAC;QACjB,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "design-brain-memory",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Relational markdown design memory powered by Agent Browser CLI",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/design-brain/design-brain.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/design-brain/design-brain#readme",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/design-brain/design-brain/issues"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"bin": {
|
|
16
|
+
"design-brain-memory": "./dist/cli.js"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsc -p tsconfig.json",
|
|
23
|
+
"clean": "rm -rf dist",
|
|
24
|
+
"dev": "tsx src/cli.ts",
|
|
25
|
+
"test": "npm run build && node --test tests/*.test.mjs",
|
|
26
|
+
"pack:dry": "npm pack --dry-run"
|
|
27
|
+
},
|
|
28
|
+
"keywords": [
|
|
29
|
+
"design",
|
|
30
|
+
"design-system",
|
|
31
|
+
"second-brain",
|
|
32
|
+
"agent-browser",
|
|
33
|
+
"markdown"
|
|
34
|
+
],
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"commander": "^14.0.2",
|
|
41
|
+
"fs-extra": "^11.3.2",
|
|
42
|
+
"sharp": "^0.34.5"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/fs-extra": "^11.0.4",
|
|
46
|
+
"@types/node": "^24.10.1",
|
|
47
|
+
"tsx": "^4.20.6",
|
|
48
|
+
"typescript": "^5.9.3"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=20"
|
|
52
|
+
}
|
|
53
|
+
}
|