opencode-diane 0.0.5
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/CHANGELOG.md +180 -0
- package/LICENSE +21 -0
- package/README.md +206 -0
- package/WIKI.md +1430 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +1632 -0
- package/dist/ingest/adaptive.d.ts +47 -0
- package/dist/ingest/adaptive.js +182 -0
- package/dist/ingest/code-health.d.ts +58 -0
- package/dist/ingest/code-health.js +202 -0
- package/dist/ingest/code-map.d.ts +71 -0
- package/dist/ingest/code-map.js +670 -0
- package/dist/ingest/cross-refs.d.ts +59 -0
- package/dist/ingest/cross-refs.js +1207 -0
- package/dist/ingest/docs.d.ts +49 -0
- package/dist/ingest/docs.js +325 -0
- package/dist/ingest/git.d.ts +77 -0
- package/dist/ingest/git.js +390 -0
- package/dist/ingest/live-session.d.ts +101 -0
- package/dist/ingest/live-session.js +173 -0
- package/dist/ingest/project-notes.d.ts +28 -0
- package/dist/ingest/project-notes.js +102 -0
- package/dist/ingest/project.d.ts +35 -0
- package/dist/ingest/project.js +430 -0
- package/dist/ingest/session-snapshot.d.ts +63 -0
- package/dist/ingest/session-snapshot.js +94 -0
- package/dist/ingest/sessions.d.ts +29 -0
- package/dist/ingest/sessions.js +164 -0
- package/dist/ingest/tables.d.ts +52 -0
- package/dist/ingest/tables.js +360 -0
- package/dist/mining/skill-miner.d.ts +53 -0
- package/dist/mining/skill-miner.js +234 -0
- package/dist/search/bm25.d.ts +81 -0
- package/dist/search/bm25.js +334 -0
- package/dist/search/e5-embedder.d.ts +30 -0
- package/dist/search/e5-embedder.js +91 -0
- package/dist/search/embed-pass.d.ts +26 -0
- package/dist/search/embed-pass.js +43 -0
- package/dist/search/embedder.d.ts +58 -0
- package/dist/search/embedder.js +85 -0
- package/dist/search/inverted-index.d.ts +51 -0
- package/dist/search/inverted-index.js +139 -0
- package/dist/search/ppr.d.ts +44 -0
- package/dist/search/ppr.js +118 -0
- package/dist/search/tokenize.d.ts +26 -0
- package/dist/search/tokenize.js +98 -0
- package/dist/store/eviction.d.ts +16 -0
- package/dist/store/eviction.js +37 -0
- package/dist/store/repository.d.ts +222 -0
- package/dist/store/repository.js +420 -0
- package/dist/store/sqlite-store.d.ts +89 -0
- package/dist/store/sqlite-store.js +252 -0
- package/dist/store/vector-store.d.ts +66 -0
- package/dist/store/vector-store.js +160 -0
- package/dist/types.d.ts +385 -0
- package/dist/types.js +9 -0
- package/dist/utils/file-log.d.ts +87 -0
- package/dist/utils/file-log.js +215 -0
- package/dist/utils/peer-detection.d.ts +45 -0
- package/dist/utils/peer-detection.js +90 -0
- package/dist/utils/shell.d.ts +43 -0
- package/dist/utils/shell.js +110 -0
- package/dist/utils/usage-skill.d.ts +42 -0
- package/dist/utils/usage-skill.js +129 -0
- package/dist/utils/xlsx.d.ts +36 -0
- package/dist/utils/xlsx.js +270 -0
- package/grammars/tree-sitter-c.wasm +0 -0
- package/grammars/tree-sitter-c_sharp.wasm +0 -0
- package/grammars/tree-sitter-cpp.wasm +0 -0
- package/grammars/tree-sitter-css.wasm +0 -0
- package/grammars/tree-sitter-go.wasm +0 -0
- package/grammars/tree-sitter-html.wasm +0 -0
- package/grammars/tree-sitter-java.wasm +0 -0
- package/grammars/tree-sitter-javascript.wasm +0 -0
- package/grammars/tree-sitter-json.wasm +0 -0
- package/grammars/tree-sitter-php.wasm +0 -0
- package/grammars/tree-sitter-python.wasm +0 -0
- package/grammars/tree-sitter-rust.wasm +0 -0
- package/grammars/tree-sitter-typescript.wasm +0 -0
- package/package.json +80 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cross-refs.ts — grammar-agnostic edge discovery between files.
|
|
3
|
+
*
|
|
4
|
+
* The hard part isn't finding connections; the hard part is finding
|
|
5
|
+
* them with FEW false positives. Single-signal heuristics (regex
|
|
6
|
+
* "import" detection, free-text identifier mentions) all have
|
|
7
|
+
* meaningful FP rates that mislead the agent's navigation. This
|
|
8
|
+
* ingester uses MULTI-SIGNAL CORROBORATION:
|
|
9
|
+
*
|
|
10
|
+
* - Filesystem-grounded signals (path-resolves-to-existing-file)
|
|
11
|
+
* emit edges alone — the disk grounds them.
|
|
12
|
+
* - Lexical signals (identifier mention) only emit edges when
|
|
13
|
+
* corroborated by a SECOND orthogonal signal (rarity + import-
|
|
14
|
+
* line context, OR rarity + filename-class coupling).
|
|
15
|
+
*
|
|
16
|
+
* Four passes:
|
|
17
|
+
*
|
|
18
|
+
* 1. Definition extraction (language-keyed regex). Builds a map
|
|
19
|
+
* `identifier → Set<defining-file>`.
|
|
20
|
+
* 2. Import-path resolution. For each file, find import-like lines,
|
|
21
|
+
* try to resolve the named module/path to an actual file under
|
|
22
|
+
* the project root. Existing → edge.
|
|
23
|
+
* 3. Config path-strings. For .json/.yaml/.toml, walk string values
|
|
24
|
+
* and try to resolve them as relative file paths. Existing → edge.
|
|
25
|
+
* 4. Corroborated identifier mentions. Tokenise each file line by
|
|
26
|
+
* line; for tokens that are defined elsewhere AND rarity-gated,
|
|
27
|
+
* emit an edge only when *also* corroborated by either an
|
|
28
|
+
* import-line context or filename-class coupling.
|
|
29
|
+
*
|
|
30
|
+
* Edges with the same (source, target) pair are merged; the evidence
|
|
31
|
+
* list grows but only one memory is written per edge.
|
|
32
|
+
*
|
|
33
|
+
* **What this catches that code-map doesn't:** any cross-file
|
|
34
|
+
* connection in a language tree-sitter doesn't have a grammar for
|
|
35
|
+
* (Ruby, Pascal, Perl, Lua, Elixir, Erlang, Tcl, Nim, Zig, Swift,
|
|
36
|
+
* Kotlin, Scala, Haskell, OCaml, F#, Clojure, Pascal, VB, …), plus
|
|
37
|
+
* config-style cross-references in JSON/YAML/TOML files.
|
|
38
|
+
*
|
|
39
|
+
* **What it doesn't catch:** dynamic loads (`require(varName)`),
|
|
40
|
+
* reflection-based dispatch, anything where the connection only
|
|
41
|
+
* exists at runtime. Those are out of scope for any static technique.
|
|
42
|
+
*/
|
|
43
|
+
import type { MemoryRepository } from "../store/repository.js";
|
|
44
|
+
export interface CrossRefsIngestResult {
|
|
45
|
+
filesWalked: number;
|
|
46
|
+
definitionsExtracted: number;
|
|
47
|
+
edgesEmitted: number;
|
|
48
|
+
/** Breakdown by primary evidence type — for the analyse-logs view. */
|
|
49
|
+
byEvidence: Record<string, number>;
|
|
50
|
+
}
|
|
51
|
+
export interface CrossRefsOptions {
|
|
52
|
+
/** See `UserConfig.crossRefsRarityThreshold`. Defaults to 3. */
|
|
53
|
+
rarityThreshold?: number;
|
|
54
|
+
/** See `UserConfig.crossRefsMaxFiles`. Defaults to 2000. */
|
|
55
|
+
maxFiles?: number;
|
|
56
|
+
/** See `UserConfig.crossRefsMaxEdges`. Defaults to 10 000. */
|
|
57
|
+
maxEdges?: number;
|
|
58
|
+
}
|
|
59
|
+
export declare function ingestCrossRefs(repo: MemoryRepository, root: string, opts?: CrossRefsOptions): Promise<CrossRefsIngestResult>;
|