homegraph 1.5.1 → 1.5.2
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/LICENSE +21 -21
- package/README.md +305 -305
- package/dist/bin/homegraph.js +9 -9
- package/dist/db/index.js +36 -36
- package/dist/db/migrations.js +37 -37
- package/dist/db/queries.js +156 -156
- package/dist/db/schema.sql +203 -203
- package/dist/directory.js +5 -5
- package/dist/extraction/index.d.ts +1 -1
- package/dist/extraction/index.d.ts.map +1 -1
- package/dist/extraction/index.js +54 -43
- package/dist/extraction/index.js.map +1 -1
- package/dist/extraction/languages/arkts.d.ts +53 -6
- package/dist/extraction/languages/arkts.d.ts.map +1 -1
- package/dist/extraction/languages/arkts.js +565 -65
- package/dist/extraction/languages/arkts.js.map +1 -1
- package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/installer/instructions-template.js +9 -9
- package/dist/mcp/diff-impact.d.ts +131 -0
- package/dist/mcp/diff-impact.d.ts.map +1 -0
- package/dist/mcp/diff-impact.js +385 -0
- package/dist/mcp/diff-impact.js.map +1 -0
- package/dist/mcp/liveness-watchdog.js +51 -51
- package/dist/mcp/server-instructions.d.ts +1 -1
- package/dist/mcp/server-instructions.d.ts.map +1 -1
- package/dist/mcp/server-instructions.js +49 -47
- package/dist/mcp/server-instructions.js.map +1 -1
- package/dist/mcp/tools.d.ts +21 -5
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +305 -55
- package/dist/mcp/tools.js.map +1 -1
- package/dist/resolution/callback-synthesizer.d.ts +2 -1
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/dist/resolution/callback-synthesizer.js +153 -53
- package/dist/resolution/callback-synthesizer.js.map +1 -1
- package/dist/resolution/frameworks/arkts-entry.d.ts.map +1 -1
- package/dist/resolution/frameworks/arkts-entry.js +20 -9
- package/dist/resolution/frameworks/arkts-entry.js.map +1 -1
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +1 -1
- package/dist/resolution/index.js.map +1 -1
- package/dist/resolution/memory-budget.d.ts +33 -0
- package/dist/resolution/memory-budget.d.ts.map +1 -1
- package/dist/resolution/memory-budget.js +58 -0
- package/dist/resolution/memory-budget.js.map +1 -1
- package/dist/resolution/resolver-pool.d.ts +2 -0
- package/dist/resolution/resolver-pool.d.ts.map +1 -1
- package/dist/resolution/resolver-pool.js +4 -0
- package/dist/resolution/resolver-pool.js.map +1 -1
- package/dist/spec/db/commit-node.js +4 -4
- package/dist/spec/db/fragment-node.js +10 -10
- package/dist/spec/db/fts.js +8 -8
- package/dist/spec/db/relations.js +88 -88
- package/dist/spec/db/schema.js +6 -6
- package/dist/spec/db/schema.sql +121 -121
- package/dist/spec/db/spec-node.js +4 -4
- package/dist/spec/llm/prompts.js +53 -53
- package/dist/ui/shimmer-progress.d.ts.map +1 -1
- package/dist/ui/shimmer-progress.js +4 -1
- package/dist/ui/shimmer-progress.js.map +1 -1
- package/package.json +61 -62
- package/dist/extraction/languages/arkts-viewtree.d.ts +0 -22
- package/dist/extraction/languages/arkts-viewtree.d.ts.map +0 -1
- package/dist/extraction/languages/arkts-viewtree.js +0 -133
- package/dist/extraction/languages/arkts-viewtree.js.map +0 -1
- package/dist/reasoning/config.d.ts +0 -45
- package/dist/reasoning/config.d.ts.map +0 -1
- package/dist/reasoning/config.js +0 -171
- package/dist/reasoning/config.js.map +0 -1
- package/dist/reasoning/credentials.d.ts +0 -5
- package/dist/reasoning/credentials.d.ts.map +0 -1
- package/dist/reasoning/credentials.js +0 -83
- package/dist/reasoning/credentials.js.map +0 -1
- package/dist/reasoning/login.d.ts +0 -21
- package/dist/reasoning/login.d.ts.map +0 -1
- package/dist/reasoning/login.js +0 -85
- package/dist/reasoning/login.js.map +0 -1
- package/dist/reasoning/reasoner.d.ts +0 -43
- package/dist/reasoning/reasoner.d.ts.map +0 -1
- package/dist/reasoning/reasoner.js +0 -308
- package/dist/reasoning/reasoner.js.map +0 -1
- package/dist/spec/evolve/llm-client.d.ts +0 -50
- package/dist/spec/evolve/llm-client.d.ts.map +0 -1
- package/dist/spec/evolve/llm-client.js +0 -176
- package/dist/spec/evolve/llm-client.js.map +0 -1
- package/dist/spec/evolve/logic-checker.d.ts +0 -12
- package/dist/spec/evolve/logic-checker.d.ts.map +0 -1
- package/dist/spec/evolve/logic-checker.js +0 -24
- package/dist/spec/evolve/logic-checker.js.map +0 -1
- package/dist/spec/llm/index.d.ts +0 -3
- package/dist/spec/llm/index.d.ts.map +0 -1
- package/dist/spec/llm/index.js +0 -11
- package/dist/spec/llm/index.js.map +0 -1
- package/dist/spec/mining/diff-parser.d.ts +0 -33
- package/dist/spec/mining/diff-parser.d.ts.map +0 -1
- package/dist/spec/mining/diff-parser.js +0 -166
- package/dist/spec/mining/diff-parser.js.map +0 -1
- package/dist/spec/mining/git-scanner.d.ts +0 -103
- package/dist/spec/mining/git-scanner.d.ts.map +0 -1
- package/dist/spec/mining/git-scanner.js +0 -307
- package/dist/spec/mining/git-scanner.js.map +0 -1
- package/dist/spec/mining/pipeline.d.ts +0 -53
- package/dist/spec/mining/pipeline.d.ts.map +0 -1
- package/dist/spec/mining/pipeline.js +0 -178
- package/dist/spec/mining/pipeline.js.map +0 -1
- package/dist/spec/mining/scope-resolver.d.ts +0 -45
- package/dist/spec/mining/scope-resolver.d.ts.map +0 -1
- package/dist/spec/mining/scope-resolver.js +0 -103
- package/dist/spec/mining/scope-resolver.js.map +0 -1
- package/dist/spec/mining/spec-extractor.d.ts +0 -69
- package/dist/spec/mining/spec-extractor.d.ts.map +0 -1
- package/dist/spec/mining/spec-extractor.js +0 -369
- package/dist/spec/mining/spec-extractor.js.map +0 -1
- package/dist/spec/utils.d.ts +0 -167
- package/dist/spec/utils.d.ts.map +0 -1
- package/dist/spec/utils.js +0 -463
- package/dist/spec/utils.js.map +0 -1
- package/scripts/_tmp-cfwk-resolve.log +0 -0
- package/scripts/_tmp-cfwk-sig.log +0 -0
- package/scripts/_tmp-cfwk-vt.log +0 -0
- package/scripts/add-lang/bench.sh +0 -60
- package/scripts/add-lang/check-grammar.mjs +0 -75
- package/scripts/add-lang/dump-ast.mjs +0 -103
- package/scripts/add-lang/verify-extraction.mjs +0 -70
- package/scripts/agent-eval/ab-adoption.sh +0 -91
- package/scripts/agent-eval/ab-hook.sh +0 -86
- package/scripts/agent-eval/ab-impl.sh +0 -78
- package/scripts/agent-eval/ab-new-vs-baseline.sh +0 -102
- package/scripts/agent-eval/ab-sufficiency.sh +0 -78
- package/scripts/agent-eval/arms-F.sh +0 -21
- package/scripts/agent-eval/arms-matrix.sh +0 -37
- package/scripts/agent-eval/audit.sh +0 -68
- package/scripts/agent-eval/bench-readme.sh +0 -28
- package/scripts/agent-eval/bench-why-repo.sh +0 -22
- package/scripts/agent-eval/block-read-hook.sh +0 -19
- package/scripts/agent-eval/hook-settings.json +0 -15
- package/scripts/agent-eval/itrun.sh +0 -120
- package/scripts/agent-eval/offload-eval-3arm.sh +0 -72
- package/scripts/agent-eval/offload-eval-cost.mjs +0 -133
- package/scripts/agent-eval/offload-eval-effort.mjs +0 -108
- package/scripts/agent-eval/offload-eval-frontload-matrix.sh +0 -25
- package/scripts/agent-eval/offload-eval-frontload.sh +0 -47
- package/scripts/agent-eval/offload-eval-ground-truth.json +0 -18
- package/scripts/agent-eval/offload-eval-hook.mjs +0 -84
- package/scripts/agent-eval/offload-eval-judge.mjs +0 -103
- package/scripts/agent-eval/offload-eval-matrix.sh +0 -20
- package/scripts/agent-eval/offload-eval-metrics.mjs +0 -94
- package/scripts/agent-eval/offload-eval-refs1.sh +0 -50
- package/scripts/agent-eval/offload-eval-setup.sh +0 -24
- package/scripts/agent-eval/offload-eval-styles.sh +0 -72
- package/scripts/agent-eval/offload-eval-summarize.mjs +0 -68
- package/scripts/agent-eval/offload-eval.md +0 -76
- package/scripts/agent-eval/parse-arms.mjs +0 -116
- package/scripts/agent-eval/parse-bench-readme.mjs +0 -84
- package/scripts/agent-eval/parse-run.mjs +0 -45
- package/scripts/agent-eval/parse-session.mjs +0 -93
- package/scripts/agent-eval/probe-context.mjs +0 -21
- package/scripts/agent-eval/probe-explore.mjs +0 -40
- package/scripts/agent-eval/probe-node.mjs +0 -20
- package/scripts/agent-eval/probe-sweep.mjs +0 -119
- package/scripts/agent-eval/probe-trace.mjs +0 -20
- package/scripts/agent-eval/redirect-read-hook.sh +0 -38
- package/scripts/agent-eval/repro-concurrent-explore.mjs +0 -119
- package/scripts/agent-eval/repro-daemon-clients.mjs +0 -125
- package/scripts/agent-eval/run-agent.sh +0 -34
- package/scripts/agent-eval/run-all.sh +0 -75
- package/scripts/agent-eval/run-arms.sh +0 -56
- package/scripts/agent-eval/seq-matrix.mjs +0 -137
- package/scripts/bench-arkts-init-rss.log +0 -0
- package/scripts/build-bundle.sh +0 -123
- package/scripts/exp_boundary_eval/README.md +0 -247
- package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/deveco_arm.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/setup.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/setup.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/win_mcp_launcher.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/_test_mcp_chain.py +0 -78
- package/scripts/exp_boundary_eval/_test_stdin.py +0 -8
- package/scripts/exp_boundary_eval/_utils.py +0 -1116
- package/scripts/exp_boundary_eval/analyze.py +0 -1313
- package/scripts/exp_boundary_eval/deveco_arm.py +0 -519
- package/scripts/exp_boundary_eval/run_all.py +0 -378
- package/scripts/exp_boundary_eval/run_one.py +0 -165
- package/scripts/exp_boundary_eval/run_session.py +0 -158
- package/scripts/exp_boundary_eval/setup.py +0 -120
- package/scripts/exp_boundary_eval/win_mcp_launcher.py +0 -73
- package/scripts/exp_boundary_eval/win_mcp_stdio_wrap.js +0 -36
- package/scripts/exp_boundary_eval/win_node_launcher.py +0 -24
- package/scripts/extract-release-notes.mjs +0 -130
- package/scripts/local-install.sh +0 -41
- package/scripts/npm-sdk.js +0 -75
- package/scripts/npm-shim.js +0 -275
- package/scripts/ohos-sdk-publish.mjs +0 -133
- package/scripts/pack-npm.sh +0 -119
- package/scripts/prepare-release.mjs +0 -270
- package/scripts/probe-arkts-mem-why-run.log +0 -0
- package/scripts/probe-banner-livecard-ir.log +0 -0
- package/scripts/probe-cfwk-ast.stderr.log +0 -0
- package/scripts/probe-cfwk-ast.stdout.log +0 -0
- package/scripts/probe-cfwk-attr-shape.log +0 -0
- package/scripts/probe-cfwk-cfgdump.stderr.log +0 -0
- package/scripts/probe-cfwk-cfgdump.stdout.log +0 -0
- package/scripts/probe-cfwk-cvc.stderr.log +0 -0
- package/scripts/probe-cfwk-cvc.stdout.log +0 -0
- package/scripts/probe-cfwk-diag2.log +0 -0
- package/scripts/probe-cfwk-diag3.log +0 -0
- package/scripts/probe-cfwk-fedbg.stderr.log +0 -0
- package/scripts/probe-cfwk-fedbg.stdout.log +0 -0
- package/scripts/probe-cfwk-fileresult.log +0 -0
- package/scripts/probe-cfwk-fix.stderr.log +0 -0
- package/scripts/probe-cfwk-fix.stdout.log +0 -0
- package/scripts/probe-cfwk-fix2.stderr.log +0 -0
- package/scripts/probe-cfwk-fix2.stdout.log +0 -0
- package/scripts/probe-cfwk-fix3.stderr.log +0 -0
- package/scripts/probe-cfwk-fix3.stdout.log +0 -0
- package/scripts/probe-cfwk-foreach.log +0 -0
- package/scripts/probe-cfwk-getmethod-throw.log +0 -0
- package/scripts/probe-cfwk-hg-extract.log +0 -0
- package/scripts/probe-cfwk-pr1003-noprior.stderr.log +0 -0
- package/scripts/probe-cfwk-pr1003-noprior.stdout.log +0 -0
- package/scripts/probe-cfwk-pr1003.stderr.log +0 -0
- package/scripts/probe-cfwk-pr1003.stdout.log +0 -0
- package/scripts/probe-cfwk-preroot-noprior.stderr.log +0 -0
- package/scripts/probe-cfwk-preroot-noprior.stdout.log +0 -0
- package/scripts/probe-cfwk-preroot-prior.stderr.log +0 -0
- package/scripts/probe-cfwk-preroot-prior.stdout.log +0 -0
- package/scripts/probe-cfwk-preroot-skipstate.stderr.log +0 -0
- package/scripts/probe-cfwk-preroot-skipstate.stdout.log +0 -0
- package/scripts/probe-cfwk-resolve-sim.log +0 -0
- package/scripts/probe-cfwk-tree-shape.log +0 -0
- package/scripts/probe-cfwk-walk-abort.log +0 -0
- package/scripts/probe-cfwk.log +0 -0
- package/scripts/probe-force-index.log +0 -0
- package/scripts/probe-no-force-index.log +0 -0
- package/scripts/probe-samefile-ir.stderr.log +0 -0
- package/scripts/probe-samefile-ir.stdout.log +0 -224
- package/scripts/probe-sdk-vs-project.log +0 -0
- package/scripts/probe-viewtree-downgrade.log +0 -0
package/dist/spec/db/schema.sql
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
-- Commit4Spec Schema for HomeGraph
|
|
2
|
-
-- Version 2
|
|
3
|
-
--
|
|
4
|
-
-- Independent tables that coexist alongside HomeGraph's `nodes`/`edges`
|
|
5
|
-
-- core graph. These tables form a three-layer Spec→Commit→CodeFragment
|
|
6
|
-
-- relationship model — a higher-level semantic overlay on the code graph.
|
|
7
|
-
--
|
|
8
|
-
-- FTS5 uses a standalone virtual table (not external content) because
|
|
9
|
-
-- Spec text needs CJK character-level segmentation before indexing.
|
|
10
|
-
|
|
11
|
-
-- =============================================================================
|
|
12
|
-
-- Entity Tables
|
|
13
|
-
-- =============================================================================
|
|
14
|
-
|
|
15
|
-
CREATE TABLE IF NOT EXISTS spec_nodes (
|
|
16
|
-
id TEXT PRIMARY KEY,
|
|
17
|
-
title TEXT NOT NULL,
|
|
18
|
-
subtitles TEXT NOT NULL, -- JSON array of markdown heading + preview
|
|
19
|
-
status TEXT NOT NULL DEFAULT 'active', -- 'active' | 'deprecated'
|
|
20
|
-
version INTEGER NOT NULL DEFAULT 1,
|
|
21
|
-
file_path TEXT NOT NULL,
|
|
22
|
-
timestamp INTEGER NOT NULL -- Unix epoch milliseconds
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
CREATE TABLE IF NOT EXISTS commit_nodes (
|
|
26
|
-
hash TEXT PRIMARY KEY, -- Full 40-char commit hash
|
|
27
|
-
message TEXT NOT NULL, -- First line of commit message
|
|
28
|
-
author TEXT NOT NULL,
|
|
29
|
-
timestamp INTEGER NOT NULL -- Unix epoch milliseconds
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
CREATE TABLE IF NOT EXISTS code_fragment_nodes (
|
|
33
|
-
id TEXT PRIMARY KEY, -- 12-char hex UUID prefix
|
|
34
|
-
change_type TEXT NOT NULL, -- 'ADD' | 'MODIFY' | 'DELETE'
|
|
35
|
-
file_path TEXT NOT NULL,
|
|
36
|
-
start_line INTEGER NOT NULL,
|
|
37
|
-
end_line INTEGER NOT NULL,
|
|
38
|
-
code_diff TEXT NOT NULL -- Unified diff text
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
-- =============================================================================
|
|
42
|
-
-- Relation Tables
|
|
43
|
-
-- =============================================================================
|
|
44
|
-
|
|
45
|
-
CREATE TABLE IF NOT EXISTS spec_commit_relations (
|
|
46
|
-
spec_id TEXT NOT NULL,
|
|
47
|
-
commit_hash TEXT NOT NULL,
|
|
48
|
-
relation_type TEXT NOT NULL, -- 'GENERATE' | 'SUMMARIZED_FROM'
|
|
49
|
-
PRIMARY KEY (spec_id, commit_hash, relation_type),
|
|
50
|
-
FOREIGN KEY (spec_id) REFERENCES spec_nodes(id) ON DELETE CASCADE,
|
|
51
|
-
FOREIGN KEY (commit_hash) REFERENCES commit_nodes(hash) ON DELETE CASCADE
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
CREATE TABLE IF NOT EXISTS commit_fragment_relations (
|
|
55
|
-
commit_hash TEXT NOT NULL,
|
|
56
|
-
fragment_id TEXT NOT NULL,
|
|
57
|
-
relation_type TEXT NOT NULL,
|
|
58
|
-
PRIMARY KEY (commit_hash, fragment_id, relation_type),
|
|
59
|
-
FOREIGN KEY (commit_hash) REFERENCES commit_nodes(hash) ON DELETE CASCADE,
|
|
60
|
-
FOREIGN KEY (fragment_id) REFERENCES code_fragment_nodes(id) ON DELETE CASCADE
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
CREATE TABLE IF NOT EXISTS spec_spec_relations (
|
|
64
|
-
source_id TEXT NOT NULL,
|
|
65
|
-
target_id TEXT NOT NULL,
|
|
66
|
-
relation_type TEXT NOT NULL, -- 'SIMILAR_TO' | 'EVOLVED_FROM'
|
|
67
|
-
PRIMARY KEY (source_id, target_id, relation_type),
|
|
68
|
-
FOREIGN KEY (source_id) REFERENCES spec_nodes(id) ON DELETE CASCADE,
|
|
69
|
-
FOREIGN KEY (target_id) REFERENCES spec_nodes(id) ON DELETE CASCADE
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
-- =============================================================================
|
|
73
|
-
-- Full-Text Search (standalone — CJK-segmented on insert)
|
|
74
|
-
-- =============================================================================
|
|
75
|
-
|
|
76
|
-
CREATE VIRTUAL TABLE IF NOT EXISTS specs_fts USING fts5(
|
|
77
|
-
id,
|
|
78
|
-
title,
|
|
79
|
-
subtitles
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
-- NOTE: `runSpecMigrations` in schema.ts mirrors some of this DDL to patch
|
|
83
|
-
-- pre-existing databases. Keep the two in sync when adding migrations.
|
|
84
|
-
|
|
85
|
-
CREATE VIRTUAL TABLE IF NOT EXISTS code_fragments_fts USING fts5(
|
|
86
|
-
id,
|
|
87
|
-
file_path,
|
|
88
|
-
code_diff
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
-- =============================================================================
|
|
92
|
-
-- Indexes
|
|
93
|
-
-- =============================================================================
|
|
94
|
-
|
|
95
|
-
CREATE INDEX IF NOT EXISTS idx_spec_nodes_status ON spec_nodes(status);
|
|
96
|
-
CREATE INDEX IF NOT EXISTS idx_spec_nodes_file_path ON spec_nodes(file_path);
|
|
97
|
-
CREATE INDEX IF NOT EXISTS idx_commit_nodes_timestamp ON commit_nodes(timestamp);
|
|
98
|
-
CREATE INDEX IF NOT EXISTS idx_code_fragment_file_path ON code_fragment_nodes(file_path);
|
|
99
|
-
CREATE INDEX IF NOT EXISTS idx_code_fragment_path_lines ON code_fragment_nodes(file_path, start_line, end_line);
|
|
100
|
-
CREATE INDEX IF NOT EXISTS idx_scr_spec_id ON spec_commit_relations(spec_id);
|
|
101
|
-
CREATE INDEX IF NOT EXISTS idx_scr_commit_hash ON spec_commit_relations(commit_hash);
|
|
102
|
-
CREATE INDEX IF NOT EXISTS idx_cfr_commit_hash ON commit_fragment_relations(commit_hash);
|
|
103
|
-
CREATE INDEX IF NOT EXISTS idx_cfr_fragment_id ON commit_fragment_relations(fragment_id);
|
|
104
|
-
CREATE INDEX IF NOT EXISTS idx_ssr_source ON spec_spec_relations(source_id);
|
|
105
|
-
CREATE INDEX IF NOT EXISTS idx_ssr_target ON spec_spec_relations(target_id);
|
|
106
|
-
|
|
107
|
-
-- =============================================================================
|
|
108
|
-
-- Schema Version
|
|
109
|
-
-- =============================================================================
|
|
110
|
-
|
|
111
|
-
CREATE TABLE IF NOT EXISTS spec_schema_versions (
|
|
112
|
-
version INTEGER PRIMARY KEY,
|
|
113
|
-
applied_at INTEGER NOT NULL,
|
|
114
|
-
description TEXT
|
|
115
|
-
);
|
|
116
|
-
|
|
117
|
-
INSERT OR IGNORE INTO spec_schema_versions (version, applied_at, description)
|
|
118
|
-
VALUES (1, strftime('%s', 'now') * 1000, 'Initial Commit4Spec schema');
|
|
119
|
-
|
|
120
|
-
INSERT OR IGNORE INTO spec_schema_versions (version, applied_at, description)
|
|
121
|
-
VALUES (2, strftime('%s', 'now') * 1000, 'Add code_fragments_fts for content-based fragment search');
|
|
1
|
+
-- Commit4Spec Schema for HomeGraph
|
|
2
|
+
-- Version 2
|
|
3
|
+
--
|
|
4
|
+
-- Independent tables that coexist alongside HomeGraph's `nodes`/`edges`
|
|
5
|
+
-- core graph. These tables form a three-layer Spec→Commit→CodeFragment
|
|
6
|
+
-- relationship model — a higher-level semantic overlay on the code graph.
|
|
7
|
+
--
|
|
8
|
+
-- FTS5 uses a standalone virtual table (not external content) because
|
|
9
|
+
-- Spec text needs CJK character-level segmentation before indexing.
|
|
10
|
+
|
|
11
|
+
-- =============================================================================
|
|
12
|
+
-- Entity Tables
|
|
13
|
+
-- =============================================================================
|
|
14
|
+
|
|
15
|
+
CREATE TABLE IF NOT EXISTS spec_nodes (
|
|
16
|
+
id TEXT PRIMARY KEY,
|
|
17
|
+
title TEXT NOT NULL,
|
|
18
|
+
subtitles TEXT NOT NULL, -- JSON array of markdown heading + preview
|
|
19
|
+
status TEXT NOT NULL DEFAULT 'active', -- 'active' | 'deprecated'
|
|
20
|
+
version INTEGER NOT NULL DEFAULT 1,
|
|
21
|
+
file_path TEXT NOT NULL,
|
|
22
|
+
timestamp INTEGER NOT NULL -- Unix epoch milliseconds
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
CREATE TABLE IF NOT EXISTS commit_nodes (
|
|
26
|
+
hash TEXT PRIMARY KEY, -- Full 40-char commit hash
|
|
27
|
+
message TEXT NOT NULL, -- First line of commit message
|
|
28
|
+
author TEXT NOT NULL,
|
|
29
|
+
timestamp INTEGER NOT NULL -- Unix epoch milliseconds
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
CREATE TABLE IF NOT EXISTS code_fragment_nodes (
|
|
33
|
+
id TEXT PRIMARY KEY, -- 12-char hex UUID prefix
|
|
34
|
+
change_type TEXT NOT NULL, -- 'ADD' | 'MODIFY' | 'DELETE'
|
|
35
|
+
file_path TEXT NOT NULL,
|
|
36
|
+
start_line INTEGER NOT NULL,
|
|
37
|
+
end_line INTEGER NOT NULL,
|
|
38
|
+
code_diff TEXT NOT NULL -- Unified diff text
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
-- =============================================================================
|
|
42
|
+
-- Relation Tables
|
|
43
|
+
-- =============================================================================
|
|
44
|
+
|
|
45
|
+
CREATE TABLE IF NOT EXISTS spec_commit_relations (
|
|
46
|
+
spec_id TEXT NOT NULL,
|
|
47
|
+
commit_hash TEXT NOT NULL,
|
|
48
|
+
relation_type TEXT NOT NULL, -- 'GENERATE' | 'SUMMARIZED_FROM'
|
|
49
|
+
PRIMARY KEY (spec_id, commit_hash, relation_type),
|
|
50
|
+
FOREIGN KEY (spec_id) REFERENCES spec_nodes(id) ON DELETE CASCADE,
|
|
51
|
+
FOREIGN KEY (commit_hash) REFERENCES commit_nodes(hash) ON DELETE CASCADE
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
CREATE TABLE IF NOT EXISTS commit_fragment_relations (
|
|
55
|
+
commit_hash TEXT NOT NULL,
|
|
56
|
+
fragment_id TEXT NOT NULL,
|
|
57
|
+
relation_type TEXT NOT NULL,
|
|
58
|
+
PRIMARY KEY (commit_hash, fragment_id, relation_type),
|
|
59
|
+
FOREIGN KEY (commit_hash) REFERENCES commit_nodes(hash) ON DELETE CASCADE,
|
|
60
|
+
FOREIGN KEY (fragment_id) REFERENCES code_fragment_nodes(id) ON DELETE CASCADE
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
CREATE TABLE IF NOT EXISTS spec_spec_relations (
|
|
64
|
+
source_id TEXT NOT NULL,
|
|
65
|
+
target_id TEXT NOT NULL,
|
|
66
|
+
relation_type TEXT NOT NULL, -- 'SIMILAR_TO' | 'EVOLVED_FROM'
|
|
67
|
+
PRIMARY KEY (source_id, target_id, relation_type),
|
|
68
|
+
FOREIGN KEY (source_id) REFERENCES spec_nodes(id) ON DELETE CASCADE,
|
|
69
|
+
FOREIGN KEY (target_id) REFERENCES spec_nodes(id) ON DELETE CASCADE
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
-- =============================================================================
|
|
73
|
+
-- Full-Text Search (standalone — CJK-segmented on insert)
|
|
74
|
+
-- =============================================================================
|
|
75
|
+
|
|
76
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS specs_fts USING fts5(
|
|
77
|
+
id,
|
|
78
|
+
title,
|
|
79
|
+
subtitles
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
-- NOTE: `runSpecMigrations` in schema.ts mirrors some of this DDL to patch
|
|
83
|
+
-- pre-existing databases. Keep the two in sync when adding migrations.
|
|
84
|
+
|
|
85
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS code_fragments_fts USING fts5(
|
|
86
|
+
id,
|
|
87
|
+
file_path,
|
|
88
|
+
code_diff
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
-- =============================================================================
|
|
92
|
+
-- Indexes
|
|
93
|
+
-- =============================================================================
|
|
94
|
+
|
|
95
|
+
CREATE INDEX IF NOT EXISTS idx_spec_nodes_status ON spec_nodes(status);
|
|
96
|
+
CREATE INDEX IF NOT EXISTS idx_spec_nodes_file_path ON spec_nodes(file_path);
|
|
97
|
+
CREATE INDEX IF NOT EXISTS idx_commit_nodes_timestamp ON commit_nodes(timestamp);
|
|
98
|
+
CREATE INDEX IF NOT EXISTS idx_code_fragment_file_path ON code_fragment_nodes(file_path);
|
|
99
|
+
CREATE INDEX IF NOT EXISTS idx_code_fragment_path_lines ON code_fragment_nodes(file_path, start_line, end_line);
|
|
100
|
+
CREATE INDEX IF NOT EXISTS idx_scr_spec_id ON spec_commit_relations(spec_id);
|
|
101
|
+
CREATE INDEX IF NOT EXISTS idx_scr_commit_hash ON spec_commit_relations(commit_hash);
|
|
102
|
+
CREATE INDEX IF NOT EXISTS idx_cfr_commit_hash ON commit_fragment_relations(commit_hash);
|
|
103
|
+
CREATE INDEX IF NOT EXISTS idx_cfr_fragment_id ON commit_fragment_relations(fragment_id);
|
|
104
|
+
CREATE INDEX IF NOT EXISTS idx_ssr_source ON spec_spec_relations(source_id);
|
|
105
|
+
CREATE INDEX IF NOT EXISTS idx_ssr_target ON spec_spec_relations(target_id);
|
|
106
|
+
|
|
107
|
+
-- =============================================================================
|
|
108
|
+
-- Schema Version
|
|
109
|
+
-- =============================================================================
|
|
110
|
+
|
|
111
|
+
CREATE TABLE IF NOT EXISTS spec_schema_versions (
|
|
112
|
+
version INTEGER PRIMARY KEY,
|
|
113
|
+
applied_at INTEGER NOT NULL,
|
|
114
|
+
description TEXT
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
INSERT OR IGNORE INTO spec_schema_versions (version, applied_at, description)
|
|
118
|
+
VALUES (1, strftime('%s', 'now') * 1000, 'Initial Commit4Spec schema');
|
|
119
|
+
|
|
120
|
+
INSERT OR IGNORE INTO spec_schema_versions (version, applied_at, description)
|
|
121
|
+
VALUES (2, strftime('%s', 'now') * 1000, 'Add code_fragments_fts for content-based fragment search');
|
|
@@ -50,10 +50,10 @@ function rowToSpec(row) {
|
|
|
50
50
|
*/
|
|
51
51
|
function insertSpecNode(db, node) {
|
|
52
52
|
const subtitlesJson = JSON.stringify(node.subtitles);
|
|
53
|
-
db.prepare(`
|
|
54
|
-
INSERT OR REPLACE INTO spec_nodes
|
|
55
|
-
(id, title, subtitles, status, version, file_path, timestamp)
|
|
56
|
-
VALUES (@id, @title, @subtitles, @status, @version, @filePath, @timestamp)
|
|
53
|
+
db.prepare(`
|
|
54
|
+
INSERT OR REPLACE INTO spec_nodes
|
|
55
|
+
(id, title, subtitles, status, version, file_path, timestamp)
|
|
56
|
+
VALUES (@id, @title, @subtitles, @status, @version, @filePath, @timestamp)
|
|
57
57
|
`).run({
|
|
58
58
|
id: node.id,
|
|
59
59
|
title: node.title,
|
package/dist/spec/llm/prompts.js
CHANGED
|
@@ -13,43 +13,43 @@ const utils_1 = require("../utils");
|
|
|
13
13
|
// Spec generation prompt + template (mine pipeline)
|
|
14
14
|
// =============================================================================
|
|
15
15
|
/** Default markdown template for generated spec documents. */
|
|
16
|
-
exports.DEFAULT_SPEC_TEMPLATE = `# Spec: {{title}}
|
|
17
|
-
|
|
18
|
-
## Summary
|
|
19
|
-
{{summary}}
|
|
20
|
-
|
|
21
|
-
## Motivation
|
|
22
|
-
{{motivation}}
|
|
23
|
-
|
|
24
|
-
## Specification
|
|
25
|
-
|
|
26
|
-
### Functional Requirements
|
|
27
|
-
{{functional_requirements}}
|
|
28
|
-
|
|
29
|
-
### Acceptance Criteria (EARS format)
|
|
30
|
-
{{acceptance_criteria}}
|
|
31
|
-
|
|
32
|
-
## Implementation Notes
|
|
33
|
-
|
|
34
|
-
### Related Commits
|
|
35
|
-
{{commit_list}}
|
|
36
|
-
|
|
37
|
-
### Affected Files
|
|
38
|
-
{{file_list}}
|
|
39
|
-
|
|
40
|
-
### Key Symbols
|
|
41
|
-
{{symbol_list}}
|
|
16
|
+
exports.DEFAULT_SPEC_TEMPLATE = `# Spec: {{title}}
|
|
17
|
+
|
|
18
|
+
## Summary
|
|
19
|
+
{{summary}}
|
|
20
|
+
|
|
21
|
+
## Motivation
|
|
22
|
+
{{motivation}}
|
|
23
|
+
|
|
24
|
+
## Specification
|
|
25
|
+
|
|
26
|
+
### Functional Requirements
|
|
27
|
+
{{functional_requirements}}
|
|
28
|
+
|
|
29
|
+
### Acceptance Criteria (EARS format)
|
|
30
|
+
{{acceptance_criteria}}
|
|
31
|
+
|
|
32
|
+
## Implementation Notes
|
|
33
|
+
|
|
34
|
+
### Related Commits
|
|
35
|
+
{{commit_list}}
|
|
36
|
+
|
|
37
|
+
### Affected Files
|
|
38
|
+
{{file_list}}
|
|
39
|
+
|
|
40
|
+
### Key Symbols
|
|
41
|
+
{{symbol_list}}
|
|
42
42
|
`;
|
|
43
43
|
/** System prompt for LLM spec generation from a commit cluster. */
|
|
44
|
-
exports.SPEC_GENERATION_SYSTEM_PROMPT = `You are a technical documentation writer specializing in software design specifications. Given a cluster of related Git commits, generate a design specification in markdown format.
|
|
45
|
-
|
|
46
|
-
Guidelines:
|
|
47
|
-
- Focus on WHAT was built, not HOW it was implemented
|
|
48
|
-
- Use EARS (Easy Approach to Requirements Syntax) for acceptance criteria
|
|
49
|
-
- Be specific — reference real symbols, files, and commit messages
|
|
50
|
-
- Keep the spec concise but complete
|
|
51
|
-
- Output ONLY the spec document, no preamble or commentary
|
|
52
|
-
|
|
44
|
+
exports.SPEC_GENERATION_SYSTEM_PROMPT = `You are a technical documentation writer specializing in software design specifications. Given a cluster of related Git commits, generate a design specification in markdown format.
|
|
45
|
+
|
|
46
|
+
Guidelines:
|
|
47
|
+
- Focus on WHAT was built, not HOW it was implemented
|
|
48
|
+
- Use EARS (Easy Approach to Requirements Syntax) for acceptance criteria
|
|
49
|
+
- Be specific — reference real symbols, files, and commit messages
|
|
50
|
+
- Keep the spec concise but complete
|
|
51
|
+
- Output ONLY the spec document, no preamble or commentary
|
|
52
|
+
|
|
53
53
|
Output format — fill in the template exactly. Replace {{placeholders}} with real content. Do NOT include the placeholder braces in your output.`;
|
|
54
54
|
// =============================================================================
|
|
55
55
|
// Cluster spec evaluation prompt
|
|
@@ -58,24 +58,24 @@ Output format — fill in the template exactly. Replace {{placeholders}} with re
|
|
|
58
58
|
* (~16K tokens @ ~0.25 token/char). Exceedingly large spec documents are
|
|
59
59
|
* truncated to prevent context-window overflow. */
|
|
60
60
|
const MAX_SPEC_CONTENT_CHARS = 64000;
|
|
61
|
-
exports.SPEC_EVALUATION_CLUSTER_SYSTEM_PROMPT = `You are a technical documentation maintainer. Your task is to evaluate whether a GROUP of related git commits requires updating a software design specification.
|
|
62
|
-
|
|
63
|
-
Given the current content and a summary of multiple commits that affect this spec, determine:
|
|
64
|
-
1. Whether the spec needs to be updated (UPDATE), deprecated (DEPRECATE), or left unchanged (UNCHANGED).
|
|
65
|
-
2. If UPDATE: provide the new title, subtitles (as an array of heading-preview strings), and full rewritten spec_content that incorporates the changes from all commits.
|
|
66
|
-
3. If DEPRECATE: provide a brief explanation in the spec_content field.
|
|
67
|
-
|
|
68
|
-
Key considerations for batch evaluation:
|
|
69
|
-
- Multiple commits may partially overlap in their changes — synthesize the combined impact.
|
|
70
|
-
- Some commits may be bug fixes that revert earlier changes — look for the net effect.
|
|
71
|
-
- If the combined changes fundamentally alter the spec's scope, prefer DEPRECATE over UPDATE.
|
|
72
|
-
|
|
73
|
-
Response format (JSON):
|
|
74
|
-
{
|
|
75
|
-
"action": "UPDATE" | "DEPRECATE" | "UNCHANGED",
|
|
76
|
-
"title": "New spec title (for UPDATE)",
|
|
77
|
-
"subtitles": ["heading1 → heading2 - preview", ...],
|
|
78
|
-
"spec_content": "Full rewritten markdown content (for UPDATE) or deprecation reason (for DEPRECATE)"
|
|
61
|
+
exports.SPEC_EVALUATION_CLUSTER_SYSTEM_PROMPT = `You are a technical documentation maintainer. Your task is to evaluate whether a GROUP of related git commits requires updating a software design specification.
|
|
62
|
+
|
|
63
|
+
Given the current content and a summary of multiple commits that affect this spec, determine:
|
|
64
|
+
1. Whether the spec needs to be updated (UPDATE), deprecated (DEPRECATE), or left unchanged (UNCHANGED).
|
|
65
|
+
2. If UPDATE: provide the new title, subtitles (as an array of heading-preview strings), and full rewritten spec_content that incorporates the changes from all commits.
|
|
66
|
+
3. If DEPRECATE: provide a brief explanation in the spec_content field.
|
|
67
|
+
|
|
68
|
+
Key considerations for batch evaluation:
|
|
69
|
+
- Multiple commits may partially overlap in their changes — synthesize the combined impact.
|
|
70
|
+
- Some commits may be bug fixes that revert earlier changes — look for the net effect.
|
|
71
|
+
- If the combined changes fundamentally alter the spec's scope, prefer DEPRECATE over UPDATE.
|
|
72
|
+
|
|
73
|
+
Response format (JSON):
|
|
74
|
+
{
|
|
75
|
+
"action": "UPDATE" | "DEPRECATE" | "UNCHANGED",
|
|
76
|
+
"title": "New spec title (for UPDATE)",
|
|
77
|
+
"subtitles": ["heading1 → heading2 - preview", ...],
|
|
78
|
+
"spec_content": "Full rewritten markdown content (for UPDATE) or deprecation reason (for DEPRECATE)"
|
|
79
79
|
}`;
|
|
80
80
|
/**
|
|
81
81
|
* Build the user prompt for cluster-based spec evaluation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shimmer-progress.d.ts","sourceRoot":"","sources":["../../src/ui/shimmer-progress.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shimmer-progress.d.ts","sourceRoot":"","sources":["../../src/ui/shimmer-progress.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CAChC;AAeD,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,wBAAgB,qBAAqB,IAAI,eAAe,CA0DvD"}
|
|
@@ -40,6 +40,7 @@ const PHASE_NAMES = {
|
|
|
40
40
|
scanning: 'Scanning files',
|
|
41
41
|
parsing: 'Parsing code',
|
|
42
42
|
'arkts-batch': 'Parsing ArkTS',
|
|
43
|
+
'ohos-api': 'Building OHOS API db',
|
|
43
44
|
storing: 'Storing data',
|
|
44
45
|
resolving: 'Resolving refs',
|
|
45
46
|
};
|
|
@@ -64,7 +65,9 @@ function createShimmerProgress() {
|
|
|
64
65
|
onProgress(progress) {
|
|
65
66
|
const phaseName = progress.phase === 'arkts-batch'
|
|
66
67
|
? formatArkTSBatchMessage(progress)
|
|
67
|
-
:
|
|
68
|
+
: progress.phase === 'ohos-api' && progress.currentFile
|
|
69
|
+
? `${PHASE_NAMES['ohos-api']} (${progress.currentFile})`
|
|
70
|
+
: PHASE_NAMES[progress.phase] || progress.phase;
|
|
68
71
|
if (progress.phase !== lastPhase && lastPhase) {
|
|
69
72
|
worker.postMessage({ type: 'finish-phase' });
|
|
70
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shimmer-progress.js","sourceRoot":"","sources":["../../src/ui/shimmer-progress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"shimmer-progress.js","sourceRoot":"","sources":["../../src/ui/shimmer-progress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,sDA0DC;AAhGD,mDAAwC;AACxC,2CAA6B;AAE7B,MAAM,WAAW,GAA2B;IAC1C,QAAQ,EAAE,gBAAgB;IAC1B,OAAO,EAAE,cAAc;IACvB,aAAa,EAAE,eAAe;IAC9B,UAAU,EAAE,sBAAsB;IAClC,OAAO,EAAE,cAAc;IACvB,SAAS,EAAE,gBAAgB;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CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;wBAC3B,YAAY,CAAC,OAAO,CAAC,CAAC;wBACtB,MAAM,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;oBAC3C,CAAC;gBACH,CAAC,CAAC,CAAC;gBAEH,MAAM,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;YACvC,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,62 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "homegraph",
|
|
3
|
-
"version": "1.5.
|
|
4
|
-
"description": "Supercharge AI coding agents with semantic code intelligence — surgical context, fewer tool calls, faster answers. 100% local.",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"bin": {
|
|
8
|
-
"homegraph": "./dist/bin/homegraph.js"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist",
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"test": "vitest
|
|
22
|
-
"test:
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"commander": "^14.0.2",
|
|
37
|
-
"fast-string-width": "^3.0.2",
|
|
38
|
-
"fast-wrap-ansi": "^0.2.0",
|
|
39
|
-
"ignore": "^7.0.5",
|
|
40
|
-
"jsonc-parser": "^3.3.1",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"tree-sitter-wasms": "^0.1.11",
|
|
46
|
-
"web-tree-sitter": "^0.25.3"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"@types/
|
|
51
|
-
"@types/
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "homegraph",
|
|
3
|
+
"version": "1.5.2",
|
|
4
|
+
"description": "Supercharge AI coding agents with semantic code intelligence — surgical context, fewer tool calls, faster answers. 100% local.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"homegraph": "./dist/bin/homegraph.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc && npm run copy-assets && node -e \"require('fs').chmodSync('dist/bin/homegraph.js', 0o755)\"",
|
|
16
|
+
"preuninstall": "node dist/bin/uninstall.js",
|
|
17
|
+
"copy-assets": "node -e \"const fs=require('fs');fs.mkdirSync('dist/db',{recursive:true});fs.copyFileSync('src/db/schema.sql','dist/db/schema.sql');fs.mkdirSync('dist/spec/db',{recursive:true});fs.copyFileSync('src/spec/db/schema.sql','dist/spec/db/schema.sql');fs.mkdirSync('dist/extraction/wasm',{recursive:true});fs.readdirSync('src/extraction/wasm').filter(f=>f.endsWith('.wasm')).forEach(f=>fs.copyFileSync('src/extraction/wasm/'+f,'dist/extraction/wasm/'+f))\"",
|
|
18
|
+
"dev": "tsc --watch",
|
|
19
|
+
"cli": "npm run build && node dist/bin/homegraph.js",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"test:watch": "vitest",
|
|
22
|
+
"test:eval": "vitest run __tests__/evaluation/",
|
|
23
|
+
"eval": "npm run build && npx tsx __tests__/evaluation/runner.ts",
|
|
24
|
+
"clean": "node -e \"const fs=require('fs');fs.rmSync('dist',{recursive:true,force:true})\""
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"code-intelligence",
|
|
28
|
+
"knowledge-graph",
|
|
29
|
+
"static-analysis"
|
|
30
|
+
],
|
|
31
|
+
"author": "",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@clack/prompts": "^1.3.0",
|
|
35
|
+
"arkanalyzer": "^1.0.92",
|
|
36
|
+
"commander": "^14.0.2",
|
|
37
|
+
"fast-string-width": "^3.0.2",
|
|
38
|
+
"fast-wrap-ansi": "^0.2.0",
|
|
39
|
+
"ignore": "^7.0.5",
|
|
40
|
+
"jsonc-parser": "^3.3.1",
|
|
41
|
+
"node-sqlite3-wasm": "^0.8.30",
|
|
42
|
+
"openai": "^4.104.0",
|
|
43
|
+
"picomatch": "^4.0.3",
|
|
44
|
+
"sisteransi": "^1.0.5",
|
|
45
|
+
"tree-sitter-wasms": "^0.1.11",
|
|
46
|
+
"web-tree-sitter": "^0.25.3"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/better-sqlite3": "^7.6.0",
|
|
50
|
+
"@types/node": "^20.19.30",
|
|
51
|
+
"@types/picomatch": "^4.0.2",
|
|
52
|
+
"typescript": "^5.0.0",
|
|
53
|
+
"vitest": "^2.1.9"
|
|
54
|
+
},
|
|
55
|
+
"optionalDependencies": {
|
|
56
|
+
"better-sqlite3": "^12.4.1"
|
|
57
|
+
},
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=20.0.0 <25.0.0"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ingest ArkAnalyzer ViewTree into HomeGraph nodes/edges.
|
|
3
|
-
*
|
|
4
|
-
* Maps declarative UI structure (component tree, event bindings, state usage,
|
|
5
|
-
* prop transfer) to traversable graph edges — no custom runtime heuristics.
|
|
6
|
-
*/
|
|
7
|
-
import { ArkField, ArkMethod, type ArkClass, type Scene } from 'arkanalyzer';
|
|
8
|
-
import type { Edge, ExtractionResult, Language } from '../../types';
|
|
9
|
-
export interface ViewTreeIndexerContext {
|
|
10
|
-
rootDir: string;
|
|
11
|
-
scene: Scene;
|
|
12
|
-
language: Language;
|
|
13
|
-
methodToId: Map<ArkMethod, string>;
|
|
14
|
-
classToId: Map<ArkClass, string>;
|
|
15
|
-
fieldToId: Map<ArkField, string>;
|
|
16
|
-
nodeIds: Set<string>;
|
|
17
|
-
addEdge(result: ExtractionResult, source: string, target: string, kind: Edge['kind'], callerFile: string, via: string, line: number): void;
|
|
18
|
-
ensureMethodNode(method: ArkMethod, relativePath: string, result: ExtractionResult, parentId: string): string | null;
|
|
19
|
-
resolveClassNodeId(cls: ArkClass): string | null;
|
|
20
|
-
}
|
|
21
|
-
export declare function indexViewTreeForClass(ctx: ViewTreeIndexerContext, cls: ArkClass, result: ExtractionResult, relativePath: string): void;
|
|
22
|
-
//# sourceMappingURL=arkts-viewtree.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"arkts-viewtree.d.ts","sourceRoot":"","sources":["../../../src/extraction/languages/arkts-viewtree.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAIL,QAAQ,EACR,SAAS,EACT,KAAK,QAAQ,EACb,KAAK,KAAK,EAGX,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIpE,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACnC,SAAS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