@assistkick/create 1.32.0 → 1.33.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/package.json +1 -1
- package/templates/assistkick-product-system/package.json +3 -1
- package/templates/assistkick-product-system/packages/frontend/src/components/GraphLegend.tsx +10 -3
- package/templates/assistkick-product-system/packages/frontend/src/constants/graph.ts +8 -1
- package/templates/assistkick-product-system/packages/shared/db/migrate.ts +21 -2
- package/templates/assistkick-product-system/packages/shared/db/migrations/0003_solid_manta.sql +1 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/0003_snapshot.json +1836 -0
- package/templates/assistkick-product-system/packages/shared/db/migrations/meta/_journal.json +7 -0
- package/templates/assistkick-product-system/packages/shared/db/schema.ts +1 -0
- package/templates/assistkick-product-system/packages/shared/lib/constants.ts +12 -0
- package/templates/assistkick-product-system/packages/shared/lib/embedding_service.test.ts +75 -0
- package/templates/assistkick-product-system/packages/shared/lib/embedding_service.ts +100 -0
- package/templates/assistkick-product-system/packages/shared/lib/relevance_search.ts +50 -38
- package/templates/assistkick-product-system/packages/shared/package.json +1 -0
- package/templates/assistkick-product-system/packages/shared/tools/add_node.ts +11 -3
- package/templates/assistkick-product-system/packages/shared/tools/delete_note.ts +50 -0
- package/templates/assistkick-product-system/packages/shared/tools/save_note.ts +79 -0
- package/templates/assistkick-product-system/packages/shared/tools/search_nodes.ts +6 -1
- package/templates/assistkick-product-system/packages/shared/tools/search_notes.ts +99 -0
- package/templates/assistkick-product-system/packages/shared/tools/update_node.ts +15 -0
package/package.json
CHANGED
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
"remotion:render": "pnpm --filter @assistkick/video render"
|
|
18
18
|
},
|
|
19
19
|
"pnpm": {
|
|
20
|
-
"onlyBuiltDependencies": [
|
|
20
|
+
"onlyBuiltDependencies": [
|
|
21
|
+
"onnxruntime-node"
|
|
22
|
+
]
|
|
21
23
|
},
|
|
22
24
|
"devDependencies": {
|
|
23
25
|
"@libsql/client": "^0.17.0",
|
package/templates/assistkick-product-system/packages/frontend/src/components/GraphLegend.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useState, useCallback } from 'react';
|
|
2
|
-
import { NODE_COLORS, EDGE_COLORS, EDGE_LABELS, LEGEND_LABELS, NODE_SHAPES, nodeShapePath } from '../constants/graph';
|
|
1
|
+
import React, { useState, useCallback, useEffect } from 'react';
|
|
2
|
+
import { NODE_COLORS, EDGE_COLORS, EDGE_LABELS, LEGEND_LABELS, NODE_SHAPES, nodeShapePath, DEFAULT_HIDDEN_TYPES } from '../constants/graph';
|
|
3
3
|
|
|
4
4
|
interface GraphLegendProps {
|
|
5
5
|
visible: boolean;
|
|
@@ -8,12 +8,19 @@ interface GraphLegendProps {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function GraphLegend({ visible, onTypeToggle, onSearchChange }: GraphLegendProps) {
|
|
11
|
-
const [hiddenTypes, setHiddenTypes] = useState<Set<string>>(new Set());
|
|
11
|
+
const [hiddenTypes, setHiddenTypes] = useState<Set<string>>(() => new Set(DEFAULT_HIDDEN_TYPES));
|
|
12
12
|
const [edgesCollapsed, setEdgesCollapsed] = useState(() => {
|
|
13
13
|
const stored = localStorage.getItem('legend-edges-collapsed');
|
|
14
14
|
return stored === null ? true : stored === 'true';
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
+
// Apply default hidden types on mount
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (hiddenTypes.size > 0) {
|
|
20
|
+
onTypeToggle(hiddenTypes);
|
|
21
|
+
}
|
|
22
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
23
|
+
|
|
17
24
|
const handleTypeClick = useCallback((type: string) => {
|
|
18
25
|
setHiddenTypes(prev => {
|
|
19
26
|
const next = new Set(prev);
|
|
@@ -16,6 +16,7 @@ export const NODE_COLORS: Record<string, string> = {
|
|
|
16
16
|
flow: '#66d9e8',
|
|
17
17
|
assumption: '#adb5bd',
|
|
18
18
|
open_question: '#ffe066',
|
|
19
|
+
note: '#a9e34b',
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
export const EDGE_LABELS: Record<string, string> = {
|
|
@@ -60,6 +61,7 @@ export const TYPE_LABELS: Record<string, string> = {
|
|
|
60
61
|
flow: 'FLOW',
|
|
61
62
|
assumption: 'ASMP',
|
|
62
63
|
open_question: 'OQ',
|
|
64
|
+
note: 'NOTE',
|
|
63
65
|
};
|
|
64
66
|
|
|
65
67
|
export const LEGEND_LABELS: Record<string, string> = {
|
|
@@ -76,6 +78,7 @@ export const LEGEND_LABELS: Record<string, string> = {
|
|
|
76
78
|
flow: 'Flow',
|
|
77
79
|
assumption: 'Assumption',
|
|
78
80
|
open_question: 'Open Question',
|
|
81
|
+
note: 'Note',
|
|
79
82
|
};
|
|
80
83
|
|
|
81
84
|
export const NODE_SHAPES: Record<string, string> = {
|
|
@@ -92,6 +95,7 @@ export const NODE_SHAPES: Record<string, string> = {
|
|
|
92
95
|
flow: 'arrow',
|
|
93
96
|
assumption: 'triangle-down',
|
|
94
97
|
open_question: 'octagon',
|
|
98
|
+
note: 'circle',
|
|
95
99
|
};
|
|
96
100
|
|
|
97
101
|
export const nodeShapePath = (shape: string, r: number): string => {
|
|
@@ -174,9 +178,12 @@ export const nodeShapePath = (shape: string, r: number): string => {
|
|
|
174
178
|
export const ALL_NODE_TYPES = [
|
|
175
179
|
'feature', 'epic', 'component', 'data_entity', 'decision', 'tech_choice',
|
|
176
180
|
'non_functional_requirement', 'design_token', 'design_pattern',
|
|
177
|
-
'user_role', 'flow', 'assumption', 'open_question',
|
|
181
|
+
'user_role', 'flow', 'assumption', 'open_question', 'note',
|
|
178
182
|
];
|
|
179
183
|
|
|
184
|
+
/** Node types hidden by default in graph visualization. */
|
|
185
|
+
export const DEFAULT_HIDDEN_TYPES = new Set(['note']);
|
|
186
|
+
|
|
180
187
|
export const COLUMNS = [
|
|
181
188
|
{ id: 'backlog', label: 'Backlog' },
|
|
182
189
|
{ id: 'todo', label: 'Todo' },
|
|
@@ -256,6 +256,16 @@ async function seedDefaults() {
|
|
|
256
256
|
return seeded;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
+
/**
|
|
260
|
+
* Backfill embeddings for all nodes that don't have one yet.
|
|
261
|
+
* Uses the embedding service to compute vectors locally.
|
|
262
|
+
*/
|
|
263
|
+
async function backfillEmbeddings() {
|
|
264
|
+
const { backfillEmbeddings: runBackfill } = await import('../lib/embedding_service.js');
|
|
265
|
+
const count = await runBackfill((msg) => console.log(msg));
|
|
266
|
+
return count;
|
|
267
|
+
}
|
|
268
|
+
|
|
259
269
|
async function main() {
|
|
260
270
|
console.log('Running migrations...');
|
|
261
271
|
await migrate(db, { migrationsFolder: './db/migrations' });
|
|
@@ -273,12 +283,21 @@ async function main() {
|
|
|
273
283
|
const seeded = await seedDefaults();
|
|
274
284
|
console.log(`Seed complete — ${seeded} default agent(s) present.`);
|
|
275
285
|
|
|
286
|
+
console.log('Backfilling embeddings...');
|
|
287
|
+
const embedded = await backfillEmbeddings();
|
|
288
|
+
if (embedded > 0) {
|
|
289
|
+
console.log(`Embedding backfill complete — embedded ${embedded} node(s).`);
|
|
290
|
+
} else {
|
|
291
|
+
console.log('Embedding backfill complete — all nodes have embeddings.');
|
|
292
|
+
}
|
|
293
|
+
|
|
276
294
|
client.close();
|
|
277
|
-
|
|
295
|
+
// Allow onnxruntime native cleanup to complete before exit
|
|
296
|
+
setTimeout(() => process.exit(0), 100);
|
|
278
297
|
}
|
|
279
298
|
|
|
280
299
|
main().catch((err) => {
|
|
281
300
|
console.error('Migration failed:', err);
|
|
282
301
|
client.close();
|
|
283
|
-
process.exit(1);
|
|
302
|
+
setTimeout(() => process.exit(1), 100);
|
|
284
303
|
});
|
package/templates/assistkick-product-system/packages/shared/db/migrations/0003_solid_manta.sql
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE `nodes` ADD `embedding` text;
|