laminark 2.21.6

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 (40) hide show
  1. package/.claude-plugin/marketplace.json +15 -0
  2. package/README.md +182 -0
  3. package/package.json +63 -0
  4. package/plugin/.claude-plugin/plugin.json +13 -0
  5. package/plugin/.mcp.json +12 -0
  6. package/plugin/dist/analysis/worker.d.ts +1 -0
  7. package/plugin/dist/analysis/worker.js +233 -0
  8. package/plugin/dist/analysis/worker.js.map +1 -0
  9. package/plugin/dist/config-t8LZeB-u.mjs +90 -0
  10. package/plugin/dist/config-t8LZeB-u.mjs.map +1 -0
  11. package/plugin/dist/hooks/handler.d.ts +284 -0
  12. package/plugin/dist/hooks/handler.d.ts.map +1 -0
  13. package/plugin/dist/hooks/handler.js +2125 -0
  14. package/plugin/dist/hooks/handler.js.map +1 -0
  15. package/plugin/dist/index.d.ts +445 -0
  16. package/plugin/dist/index.d.ts.map +1 -0
  17. package/plugin/dist/index.js +5831 -0
  18. package/plugin/dist/index.js.map +1 -0
  19. package/plugin/dist/observations-Ch0nc47i.d.mts +170 -0
  20. package/plugin/dist/observations-Ch0nc47i.d.mts.map +1 -0
  21. package/plugin/dist/tool-registry-CZ3mJ4iR.mjs +2655 -0
  22. package/plugin/dist/tool-registry-CZ3mJ4iR.mjs.map +1 -0
  23. package/plugin/hooks/hooks.json +78 -0
  24. package/plugin/scripts/README.md +47 -0
  25. package/plugin/scripts/bump-version.sh +44 -0
  26. package/plugin/scripts/ensure-deps.sh +12 -0
  27. package/plugin/scripts/install.sh +63 -0
  28. package/plugin/scripts/local-install.sh +103 -0
  29. package/plugin/scripts/setup-tmpdir.sh +65 -0
  30. package/plugin/scripts/uninstall.sh +95 -0
  31. package/plugin/scripts/update.sh +88 -0
  32. package/plugin/scripts/verify-install.sh +43 -0
  33. package/plugin/ui/activity.js +185 -0
  34. package/plugin/ui/app.js +1642 -0
  35. package/plugin/ui/graph.js +2333 -0
  36. package/plugin/ui/help.js +228 -0
  37. package/plugin/ui/index.html +492 -0
  38. package/plugin/ui/settings.js +650 -0
  39. package/plugin/ui/styles.css +2910 -0
  40. package/plugin/ui/timeline.js +652 -0
@@ -0,0 +1,170 @@
1
+ import Database from "better-sqlite3";
2
+ import { z } from "zod";
3
+
4
+ //#region src/shared/types.d.ts
5
+ /**
6
+ * Observation -- the application-layer shape.
7
+ * Uses camelCase for idiomatic TypeScript.
8
+ * embedding is Float32Array (converted from Buffer during mapping).
9
+ */
10
+ type ObservationClassification = 'discovery' | 'problem' | 'solution' | 'noise';
11
+ type ObservationKind = 'change' | 'reference' | 'finding' | 'decision' | 'verification';
12
+ interface Observation {
13
+ rowid: number;
14
+ id: string;
15
+ projectHash: string;
16
+ content: string;
17
+ title: string | null;
18
+ source: string;
19
+ sessionId: string | null;
20
+ kind: ObservationKind;
21
+ embedding: Float32Array | null;
22
+ embeddingModel: string | null;
23
+ embeddingVersion: string | null;
24
+ classification: ObservationClassification | null;
25
+ classifiedAt: string | null;
26
+ createdAt: string;
27
+ updatedAt: string;
28
+ deletedAt: string | null;
29
+ }
30
+ /**
31
+ * ObservationInsert -- input for creating observations.
32
+ * Validated at runtime via Zod schema.
33
+ */
34
+ declare const ObservationInsertSchema: z.ZodObject<{
35
+ content: z.ZodString;
36
+ title: z.ZodDefault<z.ZodNullable<z.ZodString>>;
37
+ source: z.ZodDefault<z.ZodString>;
38
+ kind: z.ZodDefault<z.ZodString>;
39
+ sessionId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
40
+ embedding: z.ZodDefault<z.ZodNullable<z.ZodCustom<Float32Array<ArrayBuffer>, Float32Array<ArrayBuffer>>>>;
41
+ embeddingModel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
42
+ embeddingVersion: z.ZodDefault<z.ZodNullable<z.ZodString>>;
43
+ }, z.core.$strip>;
44
+ type ObservationInsert = z.input<typeof ObservationInsertSchema>;
45
+ interface Session {
46
+ id: string;
47
+ projectHash: string;
48
+ startedAt: string;
49
+ endedAt: string | null;
50
+ summary: string | null;
51
+ }
52
+ interface SearchResult {
53
+ observation: Observation;
54
+ score: number;
55
+ matchType: 'fts' | 'vector' | 'hybrid';
56
+ snippet: string;
57
+ }
58
+ interface DatabaseConfig {
59
+ dbPath: string;
60
+ busyTimeout: number;
61
+ }
62
+ //#endregion
63
+ //#region src/storage/observations.d.ts
64
+ /**
65
+ * Repository for observation CRUD operations.
66
+ *
67
+ * Every query is scoped to the projectHash provided at construction time.
68
+ * Callers cannot accidentally query the wrong project -- project isolation
69
+ * is baked into every prepared statement.
70
+ *
71
+ * All SQL statements are prepared once in the constructor and reused for
72
+ * every call (better-sqlite3 performance best practice).
73
+ */
74
+ declare class ObservationRepository {
75
+ private readonly db;
76
+ private readonly projectHash;
77
+ private readonly stmtInsert;
78
+ private readonly stmtGetById;
79
+ private readonly stmtGetByIdIncludingDeleted;
80
+ private readonly stmtSoftDelete;
81
+ private readonly stmtRestore;
82
+ private readonly stmtCount;
83
+ constructor(db: Database.Database, projectHash: string);
84
+ /**
85
+ * Creates a new observation scoped to this repository's project.
86
+ * Validates input with Zod at runtime.
87
+ */
88
+ create(input: ObservationInsert): Observation;
89
+ /**
90
+ * Gets an observation by ID, scoped to this project.
91
+ * Returns null if not found or soft-deleted.
92
+ */
93
+ getById(id: string): Observation | null;
94
+ /**
95
+ * Lists observations for this project, ordered by created_at DESC.
96
+ * Excludes soft-deleted observations.
97
+ */
98
+ list(options?: {
99
+ limit?: number;
100
+ offset?: number;
101
+ sessionId?: string;
102
+ since?: string;
103
+ kind?: string;
104
+ includeUnclassified?: boolean;
105
+ }): Observation[];
106
+ /**
107
+ * Updates an observation's content, embedding fields, or both.
108
+ * Always sets updated_at to current time.
109
+ * Scoped to this project; returns null if not found or soft-deleted.
110
+ */
111
+ update(id: string, updates: Partial<Pick<Observation, 'content' | 'embedding' | 'embeddingModel' | 'embeddingVersion'>>): Observation | null;
112
+ /**
113
+ * Soft-deletes an observation by setting deleted_at.
114
+ * Returns true if the observation was found and deleted.
115
+ */
116
+ softDelete(id: string): boolean;
117
+ /**
118
+ * Restores a soft-deleted observation by clearing deleted_at.
119
+ * Returns true if the observation was found and restored.
120
+ */
121
+ restore(id: string): boolean;
122
+ /**
123
+ * Updates the classification of an observation.
124
+ * Sets classified_at to current time. Returns true if found and updated.
125
+ */
126
+ updateClassification(id: string, classification: ObservationClassification): boolean;
127
+ /**
128
+ * Creates an observation with an initial classification (bypasses classifier).
129
+ * Used for explicit user saves that should be immediately visible.
130
+ */
131
+ createClassified(input: ObservationInsert, classification: ObservationClassification): Observation;
132
+ /**
133
+ * Fetches unclassified observations for the background classifier.
134
+ * Returns observations ordered by created_at ASC (oldest first).
135
+ */
136
+ listUnclassified(limit?: number): Observation[];
137
+ /**
138
+ * Fetches observations surrounding a given timestamp for classification context.
139
+ * Returns observations regardless of classification status.
140
+ */
141
+ listContext(aroundTime: string, windowSize?: number): Observation[];
142
+ /**
143
+ * Counts non-deleted observations for this project.
144
+ */
145
+ count(): number;
146
+ /**
147
+ * Gets an observation by ID, including soft-deleted observations.
148
+ * Used by the recall tool for restore operations (must find purged items).
149
+ */
150
+ getByIdIncludingDeleted(id: string): Observation | null;
151
+ /**
152
+ * Lists observations for this project, including soft-deleted ones.
153
+ * Used by recall with include_purged: true to show all items.
154
+ */
155
+ listIncludingDeleted(options?: {
156
+ limit?: number;
157
+ offset?: number;
158
+ }): Observation[];
159
+ /**
160
+ * Searches observations by title substring (partial match via LIKE).
161
+ * Optionally includes soft-deleted items.
162
+ */
163
+ getByTitle(title: string, options?: {
164
+ limit?: number;
165
+ includePurged?: boolean;
166
+ }): Observation[];
167
+ }
168
+ //#endregion
169
+ export { SearchResult as a, ObservationInsert as i, DatabaseConfig as n, Session as o, Observation as r, ObservationRepository as t };
170
+ //# sourceMappingURL=observations-Ch0nc47i.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observations-Ch0nc47i.d.mts","names":[],"sources":["../../src/shared/types.ts","../../src/storage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