aihand 0.0.1 → 0.1.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.
Files changed (113) hide show
  1. package/README.md +152 -2
  2. package/dist/chunk-2NTK7H4W.js +10 -0
  3. package/dist/chunk-3X4FTHLC.cjs +369 -0
  4. package/dist/chunk-BXVNR4E2.js +399 -0
  5. package/dist/chunk-C7DGE6MY.cjs +1456 -0
  6. package/dist/chunk-DUUCVLC3.cjs +254 -0
  7. package/dist/chunk-FAHI53KO.cjs +125 -0
  8. package/dist/chunk-G7KVJ7NF.js +369 -0
  9. package/dist/chunk-GNEUSRGP.js +52 -0
  10. package/dist/chunk-IGNEAOLT.cjs +130 -0
  11. package/dist/chunk-IS5XFUDB.js +125 -0
  12. package/dist/chunk-JLYC76XL.js +2448 -0
  13. package/dist/chunk-KQOABC2O.cjs +52 -0
  14. package/dist/chunk-OVMK33AC.cjs +104 -0
  15. package/dist/chunk-OWYK2IGV.js +250 -0
  16. package/dist/chunk-PQSQN4CN.js +126 -0
  17. package/dist/chunk-QF6AG3M5.cjs +410 -0
  18. package/dist/chunk-QSAMLXML.js +1456 -0
  19. package/dist/chunk-VEKYRKPF.cjs +399 -0
  20. package/dist/chunk-Y6H7W7PI.cjs +2451 -0
  21. package/dist/chunk-YKSYW77R.js +410 -0
  22. package/dist/chunk-Z2Y65YOY.cjs +7 -0
  23. package/dist/chunk-ZJQRNIK7.js +104 -0
  24. package/dist/cli-3J7EYI6G.cjs +651 -0
  25. package/dist/cli-FIJLKAGI.js +649 -0
  26. package/dist/cli-JQEIE7RQ.js +120 -0
  27. package/dist/cli-K3OS2QQH.cjs +122 -0
  28. package/dist/cli-OSYG6LJD.cjs +89 -0
  29. package/dist/cli-TXRW5PG6.js +89 -0
  30. package/dist/cli.cjs +81 -0
  31. package/dist/cli.js +81 -0
  32. package/dist/config-5KEQLN6L.cjs +13 -0
  33. package/dist/config-PJPYKDLQ.js +13 -0
  34. package/dist/graph-IH56SCPK.js +8 -0
  35. package/dist/graph-ZUXXCJ5A.cjs +8 -0
  36. package/dist/index.cjs +481 -0
  37. package/dist/index.d.cts +461 -0
  38. package/dist/index.d.ts +461 -0
  39. package/dist/index.js +479 -0
  40. package/dist/locate-5XFSXJ5J.cjs +15 -0
  41. package/dist/locate-NKSUGL3A.js +15 -0
  42. package/dist/refactor-5FWSZIBN.cjs +19 -0
  43. package/dist/refactor-BOB3SZSA.js +19 -0
  44. package/dist/scan-4R7GQG2W.cjs +9 -0
  45. package/dist/scan-VF54GAAX.js +9 -0
  46. package/dist/ui/probe/server.cjs +505 -0
  47. package/dist/ui/probe/server.js +507 -0
  48. package/dist/vite.cjs +12 -0
  49. package/dist/vite.d.cts +12 -0
  50. package/dist/vite.d.ts +12 -0
  51. package/dist/vite.js +12 -0
  52. package/package.json +82 -9
  53. package/src/cli.ts +107 -0
  54. package/src/index.ts +54 -0
  55. package/src/read/cli.ts +650 -0
  56. package/src/read/compact.ts +286 -0
  57. package/src/read/config.ts +62 -0
  58. package/src/read/graph.ts +182 -0
  59. package/src/read/index.ts +12 -0
  60. package/src/read/inject.ts +121 -0
  61. package/src/read/locate.ts +104 -0
  62. package/src/read/panel.ts +335 -0
  63. package/src/read/pipeline.ts +78 -0
  64. package/src/read/refactor.ts +576 -0
  65. package/src/read/render.ts +1118 -0
  66. package/src/read/scan.ts +61 -0
  67. package/src/read/seam.ts +0 -0
  68. package/src/read/security.ts +171 -0
  69. package/src/read/signals.ts +333 -0
  70. package/src/read/state.ts +71 -0
  71. package/src/read/stategraph.ts +205 -0
  72. package/src/read/types.ts +162 -0
  73. package/src/read/vite.ts +77 -0
  74. package/src/ui/babel/line-profiler.ts +197 -0
  75. package/src/ui/babel/source-loc.ts +68 -0
  76. package/src/ui/bridge/cdp-bridge.ts +138 -0
  77. package/src/ui/bridge/compile-probe.ts +80 -0
  78. package/src/ui/bridge/transport.ts +26 -0
  79. package/src/ui/bridge/vite-bridge.ts +116 -0
  80. package/src/ui/client/client-patch.ts +899 -0
  81. package/src/ui/client/client.ts +2562 -0
  82. package/src/ui/core/action.ts +747 -0
  83. package/src/ui/core/candidates.ts +348 -0
  84. package/src/ui/core/canvas.ts +305 -0
  85. package/src/ui/core/check.ts +34 -0
  86. package/src/ui/core/compact.ts +314 -0
  87. package/src/ui/core/detail.ts +244 -0
  88. package/src/ui/core/diff.ts +253 -0
  89. package/src/ui/core/emit.ts +198 -0
  90. package/src/ui/core/knob-exec.ts +137 -0
  91. package/src/ui/core/perf.ts +254 -0
  92. package/src/ui/core/types.ts +164 -0
  93. package/src/ui/core/util.ts +221 -0
  94. package/src/ui/index.ts +5 -0
  95. package/src/ui/probe/cli.ts +139 -0
  96. package/src/ui/probe/server.ts +468 -0
  97. package/src/ui/self/act.ts +47 -0
  98. package/src/ui/self/discover.ts +101 -0
  99. package/src/ui/self/grow.ts +121 -0
  100. package/src/ui/self/install.ts +100 -0
  101. package/src/ui/self/probe.ts +105 -0
  102. package/src/ui/self/screen-hook.ts +44 -0
  103. package/src/ui/self/self.ts +48 -0
  104. package/src/ui/self/store-refs.ts +123 -0
  105. package/src/ui/self/store-schema.ts +65 -0
  106. package/src/ui/self/synth.ts +37 -0
  107. package/src/ui/server/cli.ts +102 -0
  108. package/src/ui/server/dispatch.ts +276 -0
  109. package/src/ui/server/help-text.ts +237 -0
  110. package/src/ui/server/knob-schema.ts +87 -0
  111. package/src/ui/server/plugin.ts +1151 -0
  112. package/src/vite.ts +39 -0
  113. package/index.js +0 -2
@@ -0,0 +1,461 @@
1
+ export { RepodexPluginOptions, aihand } from './vite.js';
2
+ import { Parser, Language, Tree } from 'web-tree-sitter';
3
+ import { Project, VariableDeclaration } from 'ts-morph';
4
+ import { PluginObj } from '@babel/core';
5
+ import 'vite';
6
+
7
+ declare const SEPARATOR = "\u22EE----";
8
+ declare const IMPORT_QUERY = "\n(import_statement\n source: (string (string_fragment) @source))\n";
9
+ declare const TS_QUERY = "\n(export_statement (function_declaration)) @fn\n(export_statement (lexical_declaration (variable_declarator value: (arrow_function)))) @fn\n(export_statement (generator_function_declaration)) @fn\n(type_alias_declaration) @internal_type\n(export_statement (type_alias_declaration)) @type\n(interface_declaration) @internal_type\n(export_statement (interface_declaration)) @type\n(enum_declaration) @internal_type\n(export_statement (enum_declaration)) @type\n(class_declaration) @class\n(export_statement (class_declaration)) @class\n(export_statement value: (assignment_expression)) @export_val\n(export_statement (lexical_declaration)) @export_val\n(export_statement source: (string)) @reexport\n(comment) @comment\n";
10
+ declare function getLang(ext: string, wasmDir?: string): Promise<Language | null>;
11
+ declare function cleanFnSignature(text: string): string;
12
+ interface CompactFlags {
13
+ skipNoParamFn?: boolean;
14
+ }
15
+ declare function compact(code: string, parser: Parser, lang: Language, flags?: CompactFlags, existingTree?: Tree): string;
16
+ declare function extractImports(code: string, parser: Parser, lang: Language, existingTree?: Tree): string[];
17
+
18
+ interface SymbolNode {
19
+ uid: string;
20
+ name: string;
21
+ kind: 'function' | 'method' | 'class';
22
+ filePath: string;
23
+ startLine: number;
24
+ endLine: number;
25
+ }
26
+ interface CallGraph {
27
+ symbols: Record<string, SymbolNode>;
28
+ out: Record<string, string[]>;
29
+ in: Record<string, string[]>;
30
+ }
31
+ declare function buildCallGraph(filePaths: string[], contents?: Map<string, string>): Promise<CallGraph>;
32
+
33
+ type FileDetailLevel = 'tree' | 'compact' | 'full';
34
+ /** read module: the codemap that gets injected into CLAUDE.md/AGENTS.md. */
35
+ interface ReadOptions {
36
+ include?: string[];
37
+ ignore?: string[];
38
+ /** Per-glob detail level overrides. Unmatched files default to 'compact'. */
39
+ fileDetailLevel?: Record<string, FileDetailLevel>;
40
+ /** Detail level used when injecting into target files (default: tree) */
41
+ injectDetailLevel?: FileDetailLevel;
42
+ /** Files to inject the codemap into (default: CLAUDE.md, AGENTS.md) */
43
+ injectTargetFiles?: string[];
44
+ /** Include zero-parameter function signatures (default: false) */
45
+ showNoParamFn?: boolean;
46
+ /** Non-code file count per directory in file tree that triggers folding (default: 8) */
47
+ treeFoldThreshold?: number;
48
+ /** Inject the one-line `aihand` dev-tool pointer into target files (default: true) */
49
+ injectDevToolInstructions?: boolean;
50
+ /** Inject the full codemap (panel/state/tree). false → Overview + a pointer to `aihand read --stdout`, so the map isn't resident every session (default: true) */
51
+ injectCodemap?: boolean;
52
+ /** Max tokens to inject. Enables smart allocation via git recency + import centrality. (default: 5000) */
53
+ maxTokens?: number;
54
+ }
55
+ type ModuleSwitch<O> = boolean | O;
56
+ /** runtime module: the browser probe + store discovery. */
57
+ interface RuntimeOptions {
58
+ /** Reactive fingerprint field the store factory injects into its return type — the
59
+ * construction-agnostic store criterion (a binding `const X = factory(...)` is a store iff
60
+ * `X`'s type has this property), so discovery never hardcodes the factory name `create`.
61
+ * MobX (this repo) → `_loading`; zustand → `getState`; valtio → its proxy symbol. (default: '_loading') */
62
+ storeMarker?: string;
63
+ }
64
+ interface AidevConfig {
65
+ /** Codemap injection into CLAUDE.md/AGENTS.md. */
66
+ read?: ModuleSwitch<ReadOptions>;
67
+ /** AST refactor commands (move-file/rename/move-symbol). Stateless → plain on/off. */
68
+ refactor?: boolean;
69
+ /** Runtime browser probe + knob projection — inspect & drive the running app.
70
+ * Store discovery is automatic (scans read.include, grows every binding whose type carries
71
+ * the reactive marker); the only knob is `storeMarker` for non-MobX factories. */
72
+ runtime?: ModuleSwitch<RuntimeOptions>;
73
+ }
74
+ interface ResolvedRead extends Required<ReadOptions> {
75
+ enabled: boolean;
76
+ }
77
+ interface Config {
78
+ read: ResolvedRead;
79
+ refactor: {
80
+ enabled: boolean;
81
+ };
82
+ runtime: {
83
+ enabled: boolean;
84
+ } & Required<RuntimeOptions>;
85
+ }
86
+ declare const DEFAULT_CONFIG: Config;
87
+ interface RepodexData {
88
+ overview: string;
89
+ panel?: string;
90
+ state?: string;
91
+ tree: string;
92
+ signatures: string;
93
+ full?: string;
94
+ }
95
+ interface FileBlock {
96
+ path: string;
97
+ level: FileDetailLevel;
98
+ content: string;
99
+ /** Resolved relative import specifiers (TS/JS files only, used for import graph) */
100
+ imports?: string[];
101
+ }
102
+ declare function defineConfig(config: AidevConfig): AidevConfig;
103
+ /**
104
+ * Config template body (between `defineConfig({` and `})`) shared by initConfig and README.
105
+ * Three module switches are the main surface; tuning knobs live inside `read: {...}`.
106
+ */
107
+ declare function configTemplate(): string;
108
+
109
+ type EnsureMarkersResult = 'created' | 'marked' | 'skipped';
110
+ declare function ensureMarkers(filePath: string): EnsureMarkersResult;
111
+ declare function injectFile(config: Config, data: RepodexData, filePath: string): boolean;
112
+ declare function injectAll(config: Config, data: RepodexData, files?: string[]): string[];
113
+
114
+ declare function symbolAtLine(g: CallGraph, file: string, line: number): SymbolNode | undefined;
115
+ declare function parseInspPath(p: string): {
116
+ file: string;
117
+ line: number;
118
+ };
119
+ interface LocateResult {
120
+ symbol: SymbolNode;
121
+ callers: SymbolNode[];
122
+ callees: SymbolNode[];
123
+ }
124
+ declare function locate(g: CallGraph, file: string, line: number): LocateResult | null;
125
+ declare function renderLocate(r: LocateResult, json?: boolean): string;
126
+ declare function sourcePanelHtml(r: LocateResult, esc?: (s: string) => string): string;
127
+
128
+ interface Transition {
129
+ field: string;
130
+ to: string;
131
+ args?: string;
132
+ }
133
+ interface Knob {
134
+ label: string | null;
135
+ tag: string;
136
+ event: string;
137
+ transitions: Transition[];
138
+ store: string;
139
+ filePath: string;
140
+ line: number;
141
+ }
142
+ declare function extractKnobs(filePath: string, code: string, lang: Language): Knob[];
143
+ declare function fmtTransitions(ts: Transition[]): string;
144
+ declare function buildPanel(filePaths: string[], contents?: Map<string, string>): Promise<Knob[]>;
145
+
146
+ interface RuntimeKnob {
147
+ label: string;
148
+ files: string[];
149
+ tag: string;
150
+ }
151
+ interface LiveKnob extends Knob {
152
+ live: boolean;
153
+ }
154
+ declare function fileOfInspPath(inspPath: string): string;
155
+ declare function joinPanel(staticKnobs: Knob[], runtime: RuntimeKnob[]): LiveKnob[];
156
+ declare function fetchRuntimeKnobs(port: number): Promise<RuntimeKnob[]>;
157
+
158
+ interface StateField {
159
+ name: string;
160
+ init: string;
161
+ domain: string[] | null;
162
+ }
163
+ interface StoreState {
164
+ store: string;
165
+ filePath: string;
166
+ fields: StateField[];
167
+ }
168
+ declare function buildState(paths?: string[], marker?: string): Promise<StoreState[]>;
169
+ declare function formatState(states: StoreState[]): string;
170
+
171
+ interface Field {
172
+ name: string;
173
+ type: string;
174
+ domain: string[];
175
+ line: number;
176
+ }
177
+ interface Grown {
178
+ store: string;
179
+ anchor: string;
180
+ fields: Field[];
181
+ }
182
+ declare function grow(code: string, file: string): Promise<Grown[]>;
183
+
184
+ interface StateNode extends Grown {
185
+ refs: number;
186
+ files: number;
187
+ rank: number;
188
+ }
189
+ declare function openProject(cwd?: string): Promise<Project>;
190
+ declare function classify(v: VariableDeclaration, marker?: string): 'state' | 'view' | null;
191
+ interface StoreFieldRaw {
192
+ name: string;
193
+ init: string;
194
+ type: string;
195
+ domain: string[];
196
+ line: number;
197
+ }
198
+ declare function extractStoreFields(v: VariableDeclaration, marker?: string): StoreFieldRaw[];
199
+ declare function growFromDecl(v: VariableDeclaration, file: string, marker?: string): Grown;
200
+ declare function buildStateGraph(project: Project, fileFor?: (absPath: string) => string, marker?: string): {
201
+ nodes: StateNode[];
202
+ };
203
+
204
+ /** Pre-compile fileDetailLevel patterns into a fast per-path classifier. */
205
+ declare function buildClassifier(detail: Record<string, FileDetailLevel>, defaultLevel?: FileDetailLevel): (path: string) => FileDetailLevel;
206
+ declare function buildBlocks(paths: string[], config: Config, wasmDir?: string, classifyFn?: (path: string) => FileDetailLevel, contents?: Map<string, string>): Promise<FileBlock[]>;
207
+ interface TreeOptions {
208
+ /** When a Signatures section already lists every path, drop filenames here — show dir + count. */
209
+ skeletonOnly?: boolean;
210
+ /** Files/dir headers that fit the token budget and stay expanded. Empty/undefined = expand all. */
211
+ kept?: Set<string>;
212
+ /** Dir prefixes whose whole subtree collapsed to a `name/ (N files, M dirs)` summary line. */
213
+ collapsedDirs?: Set<string>;
214
+ /** Paths the control panel references (knob/state filePaths) → marked ★ "关键" and never folded away. */
215
+ starred?: Set<string>;
216
+ }
217
+ declare function formatTree(paths: string[], foldThreshold?: number, opts?: TreeOptions): string;
218
+ declare function formatXml(blocks: FileBlock[], levels?: Map<string, FileDetailLevel>): string;
219
+
220
+ declare function scan(config: Config): string[];
221
+
222
+ interface SecretMatch {
223
+ path: string;
224
+ line: number;
225
+ pattern: string;
226
+ }
227
+ declare function scanSecrets(blocks: FileBlock[]): SecretMatch[];
228
+
229
+ /** Score files by how recently they were committed: 2 = last 5, 1 = last 20, 0 = beyond */
230
+ declare function computeRecency(files: string[], cwd?: string): Map<string, number>;
231
+ /** Build a reverse import graph: file → Set of files that import it */
232
+ declare function buildImportGraph(blocks: FileBlock[], cwd?: string): Map<string, Set<string>>;
233
+ /** Score files by import in-degree: 2 = 20+ importers, 1 = 5–19, 0 = <5 */
234
+ declare function computeCentrality(files: string[], graph: Map<string, Set<string>>): Map<string, number>;
235
+ interface ExpandResult {
236
+ /** Paths (files + dir headers) that fit within budget and stay expanded. */
237
+ kept: Set<string>;
238
+ /** Directory prefixes whose whole subtree collapsed to a one-line summary. */
239
+ collapsedDirs: Set<string>;
240
+ }
241
+ /**
242
+ * Top-down expansion: walk the tree breadth-first by signal, charging each kept node's
243
+ * tokens, until the budget runs out. Nodes never reached stay folded — a collapsed dir
244
+ * renders as `dir/ (N files, M dirs)`, leftover files under a kept dir fold to `.ext ×N`.
245
+ *
246
+ * Dir signal = max(subtree file scores), so a single hot file keeps its whole dir reachable.
247
+ * score(file) = recency + centrality (0–4), same scale as allocate().
248
+ */
249
+ declare function expandByBudget(paths: string[], scores: Map<string, number>, contentTokens: Map<string, number>, budget: number, treeEntryTokens?: number): ExpandResult;
250
+ interface AllocationResult {
251
+ levels: Map<string, FileDetailLevel>;
252
+ totalBefore: number;
253
+ totalAfter: number;
254
+ downgraded: number;
255
+ /** Tokens still over budget after compact→tree. >0 means the tree must collapse subtrees. */
256
+ deficit: number;
257
+ /** file → recency+centrality (0–4), reused by expandByBudget for top-down collapse. */
258
+ scores: Map<string, number>;
259
+ /** file → tokens to keep its content visible, reused by expandByBudget. */
260
+ contentTokens: Map<string, number>;
261
+ treeEntryTokens: number;
262
+ }
263
+ /**
264
+ * Given scored blocks and a token budget, downgrade low-scoring files compact → tree
265
+ * until content fits. What's still over budget surfaces as `deficit` — the tree side
266
+ * (expandByBudget) then collapses whole low-signal subtrees instead of dropping files.
267
+ */
268
+ declare function allocate(blocks: FileBlock[], recency: Map<string, number>, centrality: Map<string, number>, budget: number, pinned?: Set<string>, isTreeDisplay?: (path: string) => boolean): AllocationResult;
269
+
270
+ declare function moveFile(src: string, dest: string, dry?: boolean): Promise<void>;
271
+ declare function moveSymbol(from: string, name: string, to: string, dry?: boolean): Promise<void>;
272
+ declare function renameSymbol(file: string, oldName: string, newName: string, dry?: boolean): Promise<void>;
273
+
274
+ /**
275
+ * Babel plugin: wrap statements with __line(label, () => ...) for line-level profiling.
276
+ *
277
+ * Only wraps statements that have measurable cost:
278
+ * - VariableDeclaration with initializer
279
+ * - ExpressionStatement (function calls, assignments)
280
+ * - ReturnStatement with argument
281
+ *
282
+ * Skips:
283
+ * - import/export (module syntax)
284
+ * - control flow (if/for/while/switch) — their bodies get wrapped, not the structure
285
+ * - empty statements, type declarations
286
+ */
287
+ declare function lineProfilerPlugin(): PluginObj;
288
+
289
+ interface LogEntry$1 {
290
+ level: 'error' | 'warn' | 'info' | 'debug' | 'log';
291
+ text: string;
292
+ timestamp?: number;
293
+ source?: string;
294
+ }
295
+ interface NetworkRequest {
296
+ method: string;
297
+ url: string;
298
+ status: number;
299
+ duration: number;
300
+ resourceType: string;
301
+ requestHeaders?: Record<string, string>;
302
+ responseHeaders?: Record<string, string>;
303
+ requestBody?: string;
304
+ requestSample?: string;
305
+ responseBody?: string;
306
+ responseSample?: string;
307
+ failed?: boolean;
308
+ failureText?: string;
309
+ }
310
+ interface ErrorEntry {
311
+ message: string;
312
+ stack?: string;
313
+ source?: string;
314
+ line?: number;
315
+ column?: number;
316
+ }
317
+ interface ActionEntry {
318
+ type: string;
319
+ target: string;
320
+ value?: string;
321
+ trusted: boolean;
322
+ view?: string;
323
+ modal?: string;
324
+ focus?: string;
325
+ ts: number;
326
+ tab?: string;
327
+ }
328
+ interface RawState {
329
+ tab?: string;
330
+ url: string;
331
+ title?: string;
332
+ visible?: boolean;
333
+ ui: string;
334
+ console: LogEntry$1[];
335
+ network: NetworkRequest[];
336
+ errors: ErrorEntry[];
337
+ actions?: ActionEntry[];
338
+ actionsDropped?: number;
339
+ state: Record<string, unknown>;
340
+ performance?: PerformanceData;
341
+ timestamp: number;
342
+ }
343
+ interface PerfStat {
344
+ total: number;
345
+ n: number;
346
+ max: number;
347
+ }
348
+ interface PerfBucketData {
349
+ name: string;
350
+ components: Record<string, PerfStat>;
351
+ frames: {
352
+ total: number;
353
+ long: number;
354
+ max: number;
355
+ samples: number[];
356
+ };
357
+ lines: Record<string, PerfStat>;
358
+ }
359
+ interface PerformanceData {
360
+ windowMs: number;
361
+ hiddenFrames: number;
362
+ mobxPatched: boolean;
363
+ buckets: PerfBucketData[];
364
+ longtasks: {
365
+ count: number;
366
+ max: number;
367
+ };
368
+ }
369
+ interface CompactState {
370
+ url: string;
371
+ ui: string;
372
+ console: string;
373
+ network: string;
374
+ errors: string;
375
+ state: string;
376
+ performance?: string;
377
+ timestamp: number;
378
+ counts: {
379
+ console: number;
380
+ network: number;
381
+ errors: number;
382
+ state: number;
383
+ };
384
+ }
385
+ interface Assertion {
386
+ name: string;
387
+ pass: boolean;
388
+ detail?: string;
389
+ }
390
+ interface CheckResult {
391
+ pass: boolean;
392
+ assertions: Assertion[];
393
+ }
394
+ interface DiffResult {
395
+ newErrors: LogEntry$1[];
396
+ newExceptions: ErrorEntry[];
397
+ newFailedRequests: NetworkRequest[];
398
+ uiGone: boolean;
399
+ clean: boolean;
400
+ }
401
+
402
+ declare function check(raw: RawState): CheckResult;
403
+
404
+ declare function diffState(prev: RawState | null, curr: RawState): DiffResult;
405
+
406
+ declare function emitSummary(raw: RawState): string;
407
+ declare function emitCheck(result: CheckResult): string;
408
+ declare function emitDiff(diff: DiffResult): string;
409
+
410
+ interface Self {
411
+ view: string;
412
+ modal: string | null;
413
+ focus: string | null;
414
+ state: Record<string, unknown>;
415
+ anchor: string;
416
+ }
417
+ declare function screen(self: Self): Self;
418
+ interface LogEntry {
419
+ channel: 'console' | 'fetch' | 'xhr' | 'sse' | 'error';
420
+ detail: string;
421
+ ts: number;
422
+ }
423
+ declare function log(seq: LogEntry[], entry: LogEntry): LogEntry[];
424
+
425
+ declare function act(before: Self, after: Self): string[];
426
+
427
+ declare function discover(roots: string | string[], marker?: string): Promise<Grown[]>;
428
+
429
+ interface Sink {
430
+ seq: LogEntry[];
431
+ now: () => number;
432
+ }
433
+ declare function installSelfLog(win: Window & typeof globalThis, sink: Sink): () => void;
434
+
435
+ type Snapshot = Record<string, unknown>;
436
+ declare function synth(schema: Grown, snapshot: Snapshot): Self;
437
+
438
+ interface StoreSnap {
439
+ schema: Grown;
440
+ snapshot: Snapshot;
441
+ }
442
+ interface ScreenHook {
443
+ view: string;
444
+ domain: Record<string, unknown>;
445
+ }
446
+ declare function screenHook(stores: StoreSnap[]): ScreenHook;
447
+
448
+ interface Options {
449
+ roots: string | string[];
450
+ storeMarker?: string;
451
+ }
452
+ declare function storeSchema(options: Options): {
453
+ name: string;
454
+ resolveId(id: string): string | undefined;
455
+ load(id: string): Promise<string | undefined>;
456
+ handleHotUpdate(ctx: {
457
+ file: string;
458
+ }): void;
459
+ };
460
+
461
+ export { type AidevConfig, type CallGraph, type CheckResult, type CompactState, type Config, DEFAULT_CONFIG, type DiffResult, type Field, type FileBlock, type FileDetailLevel, type Grown, IMPORT_QUERY, type Knob, type LiveKnob, type LocateResult, type LogEntry, type ModuleSwitch, type RawState, type ReadOptions, type RepodexData, type RuntimeKnob, type RuntimeOptions, SEPARATOR, type ScreenHook, type Self, type Sink, type Snapshot, type StateField, type StateNode, type StoreFieldRaw, type StoreSnap, type StoreState, type SymbolNode, TS_QUERY, type Transition, act, allocate, buildBlocks, buildCallGraph, buildClassifier, buildImportGraph, buildPanel, buildState, buildStateGraph, check, classify, cleanFnSignature, compact, computeCentrality, computeRecency, configTemplate, defineConfig, diffState, discover, emitCheck, emitDiff, emitSummary, ensureMarkers, expandByBudget, extractImports, extractKnobs, extractStoreFields, fetchRuntimeKnobs, fileOfInspPath, fmtTransitions, formatState, formatTree, formatXml, getLang, grow, growFromDecl, injectAll, injectFile, installSelfLog, joinPanel, lineProfilerPlugin, locate, log, moveFile, moveSymbol, openProject, parseInspPath, renameSymbol, renderLocate, scan, scanSecrets, screen, screenHook, sourcePanelHtml, storeSchema, symbolAtLine, synth };