homegraph 1.4.1 → 1.5.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.
- package/LICENSE +21 -21
- package/README.md +305 -268
- package/dist/bin/command-supervision.d.ts.map +1 -1
- package/dist/bin/command-supervision.js +7 -4
- package/dist/bin/command-supervision.js.map +1 -1
- package/dist/bin/homegraph.js +304 -81
- package/dist/bin/homegraph.js.map +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +32 -11
- package/dist/context/index.js.map +1 -1
- package/dist/db/index.d.ts +143 -1
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +305 -28
- package/dist/db/index.js.map +1 -1
- package/dist/db/migrations.js +37 -37
- package/dist/db/queries.d.ts +43 -4
- package/dist/db/queries.d.ts.map +1 -1
- package/dist/db/queries.js +294 -170
- package/dist/db/queries.js.map +1 -1
- package/dist/db/schema.sql +203 -203
- package/dist/db/sqlite-adapter.d.ts +24 -17
- package/dist/db/sqlite-adapter.d.ts.map +1 -1
- package/dist/db/sqlite-adapter.js +292 -36
- package/dist/db/sqlite-adapter.js.map +1 -1
- package/dist/db/wal-valve.d.ts +15 -2
- package/dist/db/wal-valve.d.ts.map +1 -1
- package/dist/db/wal-valve.js +88 -6
- package/dist/db/wal-valve.js.map +1 -1
- package/dist/directory.js +5 -5
- package/dist/extraction/arkts-batch-worker.js +3 -2
- package/dist/extraction/arkts-batch-worker.js.map +1 -1
- package/dist/extraction/default-ignore.d.ts +39 -0
- package/dist/extraction/default-ignore.d.ts.map +1 -0
- package/dist/extraction/default-ignore.js +221 -0
- package/dist/extraction/default-ignore.js.map +1 -0
- package/dist/extraction/index.d.ts +9 -10
- package/dist/extraction/index.d.ts.map +1 -1
- package/dist/extraction/index.js +227 -323
- package/dist/extraction/index.js.map +1 -1
- package/dist/extraction/languages/arkts-viewtree.d.ts +2 -4
- package/dist/extraction/languages/arkts-viewtree.d.ts.map +1 -1
- package/dist/extraction/languages/arkts-viewtree.js +6 -21
- package/dist/extraction/languages/arkts-viewtree.js.map +1 -1
- package/dist/extraction/languages/arkts.d.ts +100 -6
- package/dist/extraction/languages/arkts.d.ts.map +1 -1
- package/dist/extraction/languages/arkts.js +1777 -173
- package/dist/extraction/languages/arkts.js.map +1 -1
- package/dist/extraction/store-worker.d.ts +20 -0
- package/dist/extraction/store-worker.d.ts.map +1 -0
- package/dist/extraction/store-worker.js +102 -0
- package/dist/extraction/store-worker.js.map +1 -0
- package/dist/extraction/store-writer.d.ts +48 -0
- package/dist/extraction/store-writer.d.ts.map +1 -0
- package/dist/extraction/store-writer.js +167 -0
- package/dist/extraction/store-writer.js.map +1 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/dist/extraction/tree-sitter.js +47 -0
- package/dist/extraction/tree-sitter.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/extraction/wasm-runtime-flags.d.ts +14 -4
- package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
- package/dist/extraction/wasm-runtime-flags.js +55 -7
- package/dist/extraction/wasm-runtime-flags.js.map +1 -1
- package/dist/index.d.ts +16 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +135 -97
- package/dist/index.js.map +1 -1
- package/dist/installer/instructions-template.js +9 -9
- package/dist/mcp/liveness-watchdog.d.ts +18 -0
- package/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/dist/mcp/liveness-watchdog.js +185 -73
- package/dist/mcp/liveness-watchdog.js.map +1 -1
- package/dist/mcp/query-worker.d.ts +2 -2
- package/dist/mcp/query-worker.js +2 -2
- package/dist/mcp/server-instructions.js +47 -47
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +42 -26
- package/dist/mcp/tools.js.map +1 -1
- package/dist/reasoning/reasoner.js +32 -32
- package/dist/resolution/callback-synthesizer.d.ts +52 -16
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/dist/resolution/callback-synthesizer.js +234 -180
- package/dist/resolution/callback-synthesizer.js.map +1 -1
- package/dist/resolution/cooperative-yield.d.ts +10 -2
- package/dist/resolution/cooperative-yield.d.ts.map +1 -1
- package/dist/resolution/cooperative-yield.js +6 -4
- package/dist/resolution/cooperative-yield.js.map +1 -1
- package/dist/resolution/frameworks/go.d.ts.map +1 -1
- package/dist/resolution/frameworks/go.js +29 -6
- package/dist/resolution/frameworks/go.js.map +1 -1
- package/dist/resolution/import-resolver.d.ts +2 -3
- package/dist/resolution/import-resolver.d.ts.map +1 -1
- package/dist/resolution/import-resolver.js +166 -7
- package/dist/resolution/import-resolver.js.map +1 -1
- package/dist/resolution/index.d.ts +87 -2
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +739 -131
- package/dist/resolution/index.js.map +1 -1
- package/dist/resolution/memory-budget.d.ts +48 -0
- package/dist/resolution/memory-budget.d.ts.map +1 -0
- package/dist/resolution/memory-budget.js +162 -0
- package/dist/resolution/memory-budget.js.map +1 -0
- package/dist/resolution/name-matcher.d.ts +12 -1
- package/dist/resolution/name-matcher.d.ts.map +1 -1
- package/dist/resolution/name-matcher.js +439 -97
- package/dist/resolution/name-matcher.js.map +1 -1
- package/dist/resolution/resolver-pool.d.ts +106 -0
- package/dist/resolution/resolver-pool.d.ts.map +1 -0
- package/dist/resolution/resolver-pool.js +344 -0
- package/dist/resolution/resolver-pool.js.map +1 -0
- package/dist/resolution/resolver-worker.d.ts +17 -0
- package/dist/resolution/resolver-worker.d.ts.map +1 -0
- package/dist/resolution/resolver-worker.js +141 -0
- package/dist/resolution/resolver-worker.js.map +1 -0
- package/dist/resolution/types.d.ts +3 -0
- package/dist/resolution/types.d.ts.map +1 -1
- package/dist/spec/build/diff-parser.d.ts +55 -0
- package/dist/spec/build/diff-parser.d.ts.map +1 -0
- package/dist/spec/build/diff-parser.js +205 -0
- package/dist/spec/build/diff-parser.js.map +1 -0
- package/dist/spec/build/pipeline.d.ts +54 -0
- package/dist/spec/build/pipeline.d.ts.map +1 -0
- package/dist/spec/build/pipeline.js +170 -0
- package/dist/spec/build/pipeline.js.map +1 -0
- package/dist/spec/build/scan.d.ts +48 -0
- package/dist/spec/build/scan.d.ts.map +1 -0
- package/dist/spec/build/scan.js +89 -0
- package/dist/spec/build/scan.js.map +1 -0
- package/dist/spec/build/scope-resolver.d.ts +50 -0
- package/dist/spec/build/scope-resolver.d.ts.map +1 -0
- package/dist/spec/build/scope-resolver.js +105 -0
- package/dist/spec/build/scope-resolver.js.map +1 -0
- package/dist/spec/build/spec-extractor.d.ts +74 -0
- package/dist/spec/build/spec-extractor.d.ts.map +1 -0
- package/dist/spec/build/spec-extractor.js +344 -0
- package/dist/spec/build/spec-extractor.js.map +1 -0
- package/dist/spec/config.d.ts +35 -1
- package/dist/spec/config.d.ts.map +1 -1
- package/dist/spec/config.js +30 -5
- package/dist/spec/config.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.d.ts.map +1 -1
- package/dist/spec/db/fts.js +27 -58
- package/dist/spec/db/fts.js.map +1 -1
- package/dist/spec/db/index.d.ts +5 -3
- package/dist/spec/db/index.d.ts.map +1 -1
- package/dist/spec/db/index.js +16 -1
- package/dist/spec/db/index.js.map +1 -1
- package/dist/spec/db/persist.d.ts +45 -0
- package/dist/spec/db/persist.d.ts.map +1 -0
- package/dist/spec/db/persist.js +66 -0
- package/dist/spec/db/persist.js.map +1 -0
- package/dist/spec/db/relations.d.ts +80 -1
- package/dist/spec/db/relations.d.ts.map +1 -1
- package/dist/spec/db/relations.js +218 -47
- package/dist/spec/db/relations.js.map +1 -1
- package/dist/spec/db/schema.d.ts +4 -0
- package/dist/spec/db/schema.d.ts.map +1 -1
- package/dist/spec/db/schema.js +10 -6
- package/dist/spec/db/schema.js.map +1 -1
- package/dist/spec/db/schema.sql +121 -117
- package/dist/spec/db/spec-node.d.ts +5 -0
- package/dist/spec/db/spec-node.d.ts.map +1 -1
- package/dist/spec/db/spec-node.js +15 -9
- package/dist/spec/db/spec-node.js.map +1 -1
- package/dist/spec/db/sql-utils.d.ts +11 -0
- package/dist/spec/db/sql-utils.d.ts.map +1 -0
- package/dist/spec/db/sql-utils.js +19 -0
- package/dist/spec/db/sql-utils.js.map +1 -0
- package/dist/spec/evolve/cluster-context.d.ts +30 -0
- package/dist/spec/evolve/cluster-context.d.ts.map +1 -0
- package/dist/spec/evolve/cluster-context.js +78 -0
- package/dist/spec/evolve/cluster-context.js.map +1 -0
- package/dist/spec/evolve/commit-spec-analyzer.d.ts +51 -0
- package/dist/spec/evolve/commit-spec-analyzer.d.ts.map +1 -0
- package/dist/spec/evolve/commit-spec-analyzer.js +88 -0
- package/dist/spec/evolve/commit-spec-analyzer.js.map +1 -0
- package/dist/spec/evolve/commit-spec-persister.d.ts +53 -0
- package/dist/spec/evolve/commit-spec-persister.d.ts.map +1 -0
- package/dist/spec/evolve/commit-spec-persister.js +93 -0
- package/dist/spec/evolve/commit-spec-persister.js.map +1 -0
- package/dist/spec/evolve/impact-locator.d.ts +23 -7
- package/dist/spec/evolve/impact-locator.d.ts.map +1 -1
- package/dist/spec/evolve/impact-locator.js +58 -14
- package/dist/spec/evolve/impact-locator.js.map +1 -1
- package/dist/spec/evolve/pipeline.d.ts +62 -25
- package/dist/spec/evolve/pipeline.d.ts.map +1 -1
- package/dist/spec/evolve/pipeline.js +436 -457
- package/dist/spec/evolve/pipeline.js.map +1 -1
- package/dist/spec/evolve/spec-rewriter.d.ts +13 -13
- package/dist/spec/evolve/spec-rewriter.d.ts.map +1 -1
- package/dist/spec/evolve/spec-rewriter.js +45 -45
- package/dist/spec/evolve/spec-rewriter.js.map +1 -1
- package/dist/spec/git/commits.d.ts +85 -0
- package/dist/spec/git/commits.d.ts.map +1 -0
- package/dist/spec/git/commits.js +218 -0
- package/dist/spec/git/commits.js.map +1 -0
- package/dist/spec/git/exec.d.ts +13 -0
- package/dist/spec/git/exec.d.ts.map +1 -0
- package/dist/spec/git/exec.js +19 -0
- package/dist/spec/git/exec.js.map +1 -0
- package/dist/spec/git/index.d.ts +9 -0
- package/dist/spec/git/index.d.ts.map +1 -0
- package/dist/spec/git/index.js +22 -0
- package/dist/spec/git/index.js.map +1 -0
- package/dist/spec/graph/index.d.ts +8 -0
- package/dist/spec/graph/index.d.ts.map +1 -0
- package/dist/spec/graph/index.js +17 -0
- package/dist/spec/graph/index.js.map +1 -0
- package/dist/spec/graph/queries.d.ts +6 -35
- package/dist/spec/graph/queries.d.ts.map +1 -1
- package/dist/spec/graph/queries.js +71 -248
- package/dist/spec/graph/queries.js.map +1 -1
- package/dist/spec/llm/agent-client.d.ts +59 -0
- package/dist/spec/llm/agent-client.d.ts.map +1 -0
- package/dist/spec/llm/agent-client.js +213 -0
- package/dist/spec/llm/agent-client.js.map +1 -0
- package/dist/spec/llm/agents/claude-code.d.ts +32 -0
- package/dist/spec/llm/agents/claude-code.d.ts.map +1 -0
- package/dist/spec/llm/agents/claude-code.js +125 -0
- package/dist/spec/llm/agents/claude-code.js.map +1 -0
- package/dist/spec/llm/agents/codex.d.ts +32 -0
- package/dist/spec/llm/agents/codex.d.ts.map +1 -0
- package/dist/spec/llm/agents/codex.js +145 -0
- package/dist/spec/llm/agents/codex.js.map +1 -0
- package/dist/spec/llm/agents/detect-utils.d.ts +28 -0
- package/dist/spec/llm/agents/detect-utils.d.ts.map +1 -0
- package/dist/spec/llm/agents/detect-utils.js +91 -0
- package/dist/spec/llm/agents/detect-utils.js.map +1 -0
- package/dist/spec/llm/agents/deveco-code.d.ts +33 -0
- package/dist/spec/llm/agents/deveco-code.d.ts.map +1 -0
- package/dist/spec/llm/agents/deveco-code.js +165 -0
- package/dist/spec/llm/agents/deveco-code.js.map +1 -0
- package/dist/spec/llm/agents/index.d.ts +31 -0
- package/dist/spec/llm/agents/index.d.ts.map +1 -0
- package/dist/spec/llm/agents/index.js +65 -0
- package/dist/spec/llm/agents/index.js.map +1 -0
- package/dist/spec/llm/agents/types.d.ts +76 -0
- package/dist/spec/llm/agents/types.d.ts.map +1 -0
- package/dist/spec/llm/agents/types.js +15 -0
- package/dist/spec/llm/agents/types.js.map +1 -0
- package/dist/spec/llm/client.d.ts +31 -11
- package/dist/spec/llm/client.d.ts.map +1 -1
- package/dist/spec/llm/client.js +143 -81
- package/dist/spec/llm/client.js.map +1 -1
- package/dist/spec/llm/factory.d.ts +41 -0
- package/dist/spec/llm/factory.d.ts.map +1 -0
- package/dist/spec/llm/factory.js +80 -0
- package/dist/spec/llm/factory.js.map +1 -0
- package/dist/spec/llm/prompts.d.ts +24 -8
- package/dist/spec/llm/prompts.d.ts.map +1 -1
- package/dist/spec/llm/prompts.js +112 -62
- package/dist/spec/llm/prompts.js.map +1 -1
- package/dist/spec/llm/retry.d.ts +53 -0
- package/dist/spec/llm/retry.d.ts.map +1 -0
- package/dist/spec/llm/retry.js +153 -0
- package/dist/spec/llm/retry.js.map +1 -0
- package/dist/spec/mine/clustering/features.d.ts +38 -0
- package/dist/spec/mine/clustering/features.d.ts.map +1 -0
- package/dist/spec/mine/clustering/features.js +108 -0
- package/dist/spec/mine/clustering/features.js.map +1 -0
- package/dist/spec/mine/clustering/index.d.ts +62 -0
- package/dist/spec/mine/clustering/index.d.ts.map +1 -0
- package/dist/spec/mine/clustering/index.js +259 -0
- package/dist/spec/mine/clustering/index.js.map +1 -0
- package/dist/spec/mine/clustering/leiden.d.ts +61 -0
- package/dist/spec/mine/clustering/leiden.d.ts.map +1 -0
- package/dist/spec/mine/clustering/leiden.js +489 -0
- package/dist/spec/mine/clustering/leiden.js.map +1 -0
- package/dist/spec/mine/clustering/text-similarity.d.ts +22 -0
- package/dist/spec/mine/clustering/text-similarity.d.ts.map +1 -0
- package/dist/spec/mine/clustering/text-similarity.js +98 -0
- package/dist/spec/mine/clustering/text-similarity.js.map +1 -0
- package/dist/spec/mine/generator.d.ts +54 -0
- package/dist/spec/mine/generator.d.ts.map +1 -0
- package/dist/spec/mine/generator.js +267 -0
- package/dist/spec/mine/generator.js.map +1 -0
- package/dist/spec/mine/persist.d.ts +37 -0
- package/dist/spec/mine/persist.d.ts.map +1 -0
- package/dist/spec/mine/persist.js +170 -0
- package/dist/spec/mine/persist.js.map +1 -0
- package/dist/spec/mine/pipeline.d.ts +41 -0
- package/dist/spec/mine/pipeline.d.ts.map +1 -0
- package/dist/spec/mine/pipeline.js +236 -0
- package/dist/spec/mine/pipeline.js.map +1 -0
- package/dist/spec/mine/scanner.d.ts +59 -0
- package/dist/spec/mine/scanner.d.ts.map +1 -0
- package/dist/spec/mine/scanner.js +383 -0
- package/dist/spec/mine/scanner.js.map +1 -0
- package/dist/spec/types.d.ts +32 -0
- package/dist/spec/types.d.ts.map +1 -1
- package/dist/spec/ui/index.d.ts +9 -0
- package/dist/spec/ui/index.d.ts.map +1 -0
- package/dist/spec/ui/index.js +16 -0
- package/dist/spec/ui/index.js.map +1 -0
- package/dist/spec/ui/progress-handler.d.ts +33 -0
- package/dist/spec/ui/progress-handler.d.ts.map +1 -0
- package/dist/spec/ui/progress-handler.js +132 -0
- package/dist/spec/ui/progress-handler.js.map +1 -0
- package/dist/spec/ui/progress.d.ts +24 -0
- package/dist/spec/ui/progress.d.ts.map +1 -0
- package/dist/spec/ui/progress.js +13 -0
- package/dist/spec/ui/progress.js.map +1 -0
- package/dist/spec/utils/fs.d.ts +45 -0
- package/dist/spec/utils/fs.d.ts.map +1 -0
- package/dist/spec/utils/fs.js +163 -0
- package/dist/spec/utils/fs.js.map +1 -0
- package/dist/spec/utils/index.d.ts +12 -0
- package/dist/spec/utils/index.d.ts.map +1 -0
- package/dist/spec/utils/index.js +26 -0
- package/dist/spec/utils/index.js.map +1 -0
- package/dist/spec/utils/meta.d.ts +32 -0
- package/dist/spec/utils/meta.d.ts.map +1 -0
- package/dist/spec/utils/meta.js +122 -0
- package/dist/spec/utils/meta.js.map +1 -0
- package/dist/spec/utils/truncate.d.ts +86 -0
- package/dist/spec/utils/truncate.d.ts.map +1 -0
- package/dist/spec/utils/truncate.js +172 -0
- package/dist/spec/utils/truncate.js.map +1 -0
- package/dist/sync/watcher.d.ts +25 -1
- package/dist/sync/watcher.d.ts.map +1 -1
- package/dist/sync/watcher.js +76 -3
- package/dist/sync/watcher.js.map +1 -1
- package/dist/telemetry/index.js +3 -3
- package/dist/telemetry/index.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +62 -58
- 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 +60 -60
- package/scripts/add-lang/check-grammar.mjs +75 -75
- package/scripts/add-lang/dump-ast.mjs +103 -103
- package/scripts/add-lang/verify-extraction.mjs +70 -70
- package/scripts/agent-eval/ab-adoption.sh +91 -91
- package/scripts/agent-eval/ab-hook.sh +86 -86
- package/scripts/agent-eval/ab-impl.sh +78 -78
- package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -102
- package/scripts/agent-eval/ab-sufficiency.sh +78 -78
- package/scripts/agent-eval/arms-F.sh +21 -21
- package/scripts/agent-eval/arms-matrix.sh +37 -37
- package/scripts/agent-eval/audit.sh +68 -68
- package/scripts/agent-eval/bench-readme.sh +28 -28
- package/scripts/agent-eval/bench-why-repo.sh +22 -22
- package/scripts/agent-eval/block-read-hook.sh +19 -19
- package/scripts/agent-eval/hook-settings.json +15 -15
- package/scripts/agent-eval/itrun.sh +120 -120
- package/scripts/agent-eval/offload-eval-3arm.sh +72 -72
- package/scripts/agent-eval/offload-eval-cost.mjs +133 -133
- package/scripts/agent-eval/offload-eval-effort.mjs +108 -108
- package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -25
- package/scripts/agent-eval/offload-eval-frontload.sh +47 -47
- package/scripts/agent-eval/offload-eval-ground-truth.json +18 -18
- package/scripts/agent-eval/offload-eval-hook.mjs +84 -84
- package/scripts/agent-eval/offload-eval-judge.mjs +103 -103
- package/scripts/agent-eval/offload-eval-matrix.sh +20 -20
- package/scripts/agent-eval/offload-eval-metrics.mjs +94 -94
- package/scripts/agent-eval/offload-eval-refs1.sh +50 -50
- package/scripts/agent-eval/offload-eval-setup.sh +24 -24
- package/scripts/agent-eval/offload-eval-styles.sh +71 -71
- package/scripts/agent-eval/offload-eval-summarize.mjs +68 -68
- package/scripts/agent-eval/offload-eval.md +76 -76
- package/scripts/agent-eval/parse-arms.mjs +116 -116
- package/scripts/agent-eval/parse-bench-readme.mjs +84 -84
- package/scripts/agent-eval/parse-run.mjs +45 -45
- package/scripts/agent-eval/parse-session.mjs +93 -93
- package/scripts/agent-eval/probe-context.mjs +21 -21
- package/scripts/agent-eval/probe-explore.mjs +40 -40
- package/scripts/agent-eval/probe-node.mjs +20 -20
- package/scripts/agent-eval/probe-sweep.mjs +119 -119
- package/scripts/agent-eval/probe-trace.mjs +20 -20
- package/scripts/agent-eval/redirect-read-hook.sh +38 -38
- package/scripts/agent-eval/repro-concurrent-explore.mjs +119 -119
- package/scripts/agent-eval/repro-daemon-clients.mjs +125 -125
- package/scripts/agent-eval/run-agent.sh +34 -34
- package/scripts/agent-eval/run-all.sh +75 -75
- package/scripts/agent-eval/run-arms.sh +56 -56
- package/scripts/agent-eval/seq-matrix.mjs +137 -137
- package/scripts/bench-arkts-init-rss.log +0 -0
- package/scripts/build-bundle.sh +123 -123
- package/scripts/exp_boundary_eval/README.md +247 -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 +78 -78
- package/scripts/exp_boundary_eval/_test_stdin.py +8 -8
- package/scripts/exp_boundary_eval/_utils.py +1116 -1116
- package/scripts/exp_boundary_eval/analyze.py +1313 -1313
- package/scripts/exp_boundary_eval/deveco_arm.py +519 -519
- package/scripts/exp_boundary_eval/run_all.py +378 -378
- package/scripts/exp_boundary_eval/run_one.py +165 -165
- package/scripts/exp_boundary_eval/run_session.py +158 -158
- package/scripts/exp_boundary_eval/setup.py +120 -120
- package/scripts/exp_boundary_eval/win_mcp_launcher.py +73 -73
- package/scripts/exp_boundary_eval/win_mcp_stdio_wrap.js +36 -36
- package/scripts/exp_boundary_eval/win_node_launcher.py +24 -24
- package/scripts/extract-release-notes.mjs +130 -130
- package/scripts/local-install.sh +41 -41
- package/scripts/npm-sdk.js +75 -75
- package/scripts/npm-shim.js +275 -275
- package/scripts/ohos-sdk-publish.mjs +133 -133
- package/scripts/pack-npm.sh +119 -119
- package/scripts/prepare-release.mjs +270 -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 +224 -0
- package/scripts/probe-sdk-vs-project.log +0 -0
- package/scripts/probe-viewtree-downgrade.log +0 -0
- package/dist/arkts/ohos-api-index.d.ts +0 -15
- package/dist/arkts/ohos-api-index.d.ts.map +0 -1
- package/dist/arkts/ohos-api-index.js +0 -190
- package/dist/arkts/ohos-api-index.js.map +0 -1
- package/dist/arkts/ohos-sdk-input.d.ts +0 -36
- package/dist/arkts/ohos-sdk-input.d.ts.map +0 -1
- package/dist/arkts/ohos-sdk-input.js +0 -214
- package/dist/arkts/ohos-sdk-input.js.map +0 -1
- package/dist/extraction/languages/arkts-state-decorators.d.ts +0 -13
- package/dist/extraction/languages/arkts-state-decorators.d.ts.map +0 -1
- package/dist/extraction/languages/arkts-state-decorators.js +0 -26
- package/dist/extraction/languages/arkts-state-decorators.js.map +0 -1
- package/dist/extraction/languages/ohos-api-consumer.d.ts +0 -34
- package/dist/extraction/languages/ohos-api-consumer.d.ts.map +0 -1
- package/dist/extraction/languages/ohos-api-consumer.js +0 -283
- package/dist/extraction/languages/ohos-api-consumer.js.map +0 -1
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Prepare a clean repo for an experiment run. Agent-aware."""
|
|
3
|
-
|
|
4
|
-
import os
|
|
5
|
-
import subprocess
|
|
6
|
-
import sys
|
|
7
|
-
from datetime import datetime, timezone
|
|
8
|
-
from pathlib import Path
|
|
9
|
-
from typing import Optional, Tuple
|
|
10
|
-
|
|
11
|
-
from _utils import (append_run_log, error, generate_session_id,
|
|
12
|
-
get_agent, get_agent_version, git_output, git_ok, log,
|
|
13
|
-
shell_ok, verify_agent_binary, write_json)
|
|
14
|
-
from deveco_arm import git_clean_repo, write_deveco_project_config
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def prepare_environment(exp_id: str, clean_mode: str = "full",
|
|
18
|
-
agent_name: str = "",
|
|
19
|
-
state_dir: Optional[Path] = None) -> Tuple[str, str]:
|
|
20
|
-
"""Prepare repo. Returns (session_id, agent_name)."""
|
|
21
|
-
clone_path = os.environ.get("REPO_CLONE", "")
|
|
22
|
-
is_clone = bool(clone_path and Path(clone_path).is_dir())
|
|
23
|
-
local_repo = os.environ.get("REPO_PATH", "")
|
|
24
|
-
if is_clone:
|
|
25
|
-
repo_root = Path(clone_path)
|
|
26
|
-
elif local_repo and Path(local_repo).is_dir():
|
|
27
|
-
repo_root = Path(local_repo)
|
|
28
|
-
else:
|
|
29
|
-
error("No repo available. Clone via run_all.py or set REPO_PATH / REPO_CLONE.")
|
|
30
|
-
sys.exit(1)
|
|
31
|
-
|
|
32
|
-
if state_dir is not None:
|
|
33
|
-
_state_dir = state_dir
|
|
34
|
-
else:
|
|
35
|
-
from _utils import LOG_DIR
|
|
36
|
-
_state_dir = LOG_DIR
|
|
37
|
-
|
|
38
|
-
if is_clone:
|
|
39
|
-
log(f"Using cloned repo: {repo_root}")
|
|
40
|
-
else:
|
|
41
|
-
log(f"Using local repo: {repo_root}")
|
|
42
|
-
|
|
43
|
-
os.chdir(repo_root)
|
|
44
|
-
|
|
45
|
-
# Agent config
|
|
46
|
-
agent = get_agent(agent_name)
|
|
47
|
-
binary = agent["binary"]
|
|
48
|
-
|
|
49
|
-
# Step 1: Clean repo
|
|
50
|
-
arm = os.environ.get("EVAL_ARM", "baseline")
|
|
51
|
-
if clean_mode == "full":
|
|
52
|
-
log("Restoring repo to clean state...")
|
|
53
|
-
branch = os.environ.get("BRANCH", "weekly_20260601")
|
|
54
|
-
shell_ok(f"git checkout {branch}")
|
|
55
|
-
git_ok(["checkout", "."], cwd=repo_root)
|
|
56
|
-
git_clean_repo(repo_root, arm)
|
|
57
|
-
|
|
58
|
-
current_branch = git_output(["branch", "--show-current"], cwd=repo_root)
|
|
59
|
-
commit = git_output(["rev-parse", "--short", "HEAD"], cwd=repo_root)
|
|
60
|
-
log(f"Branch: {current_branch} | Commit: {commit}")
|
|
61
|
-
|
|
62
|
-
# Step 1b: DevEco A/B project config (.deveco/deveco.jsonc)
|
|
63
|
-
if agent.get("binary") == "deveco":
|
|
64
|
-
write_deveco_project_config(repo_root, arm)
|
|
65
|
-
|
|
66
|
-
# Step 1c: Index rebuilt once at homegraph suite start (run_all / prebuild).
|
|
67
|
-
# Per-experiment git reset restores the same commit — no second index here.
|
|
68
|
-
# Step 2: Clear CLAUDE.md
|
|
69
|
-
claude_md = repo_root / "CLAUDE.md"
|
|
70
|
-
if claude_md.exists() and claude_md.stat().st_size > 0:
|
|
71
|
-
backup_dir = _state_dir / "claude_md_backups"
|
|
72
|
-
backup_dir.mkdir(parents=True, exist_ok=True)
|
|
73
|
-
ts = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
74
|
-
backup_path = backup_dir / f"CLAUDE.md.{ts}"
|
|
75
|
-
backup_path.write_text(claude_md.read_text())
|
|
76
|
-
log(f"Backed up CLAUDE.md → {backup_path}")
|
|
77
|
-
with open(claude_md, "w") as f:
|
|
78
|
-
f.write("")
|
|
79
|
-
log("Cleared CLAUDE.md")
|
|
80
|
-
|
|
81
|
-
for f in [".cursorrules", ".cursor/rules"]:
|
|
82
|
-
p = repo_root / f
|
|
83
|
-
if p.exists():
|
|
84
|
-
p.unlink()
|
|
85
|
-
|
|
86
|
-
# Step 3: Session ID
|
|
87
|
-
session_id = generate_session_id()
|
|
88
|
-
(_state_dir / f"session_{exp_id}.txt").write_text(session_id)
|
|
89
|
-
log(f"Session ID: {session_id}")
|
|
90
|
-
|
|
91
|
-
# Step 4: Verify agent binary
|
|
92
|
-
ok, resolved, err_msg = verify_agent_binary(agent)
|
|
93
|
-
if not ok:
|
|
94
|
-
error(err_msg)
|
|
95
|
-
sys.exit(1)
|
|
96
|
-
binary = resolved
|
|
97
|
-
agent_ver = get_agent_version(agent)
|
|
98
|
-
log(f"Agent: {agent['name']} ({binary}) v{agent_ver}")
|
|
99
|
-
|
|
100
|
-
# Step 5: Record state
|
|
101
|
-
write_json(_state_dir / exp_id / "state.json", {
|
|
102
|
-
"experiment_id": exp_id, "session_id": session_id,
|
|
103
|
-
"started_at": datetime.now(timezone.utc).isoformat(),
|
|
104
|
-
"clean_mode": clean_mode, "agent": agent["name"],
|
|
105
|
-
"agent_version": agent_ver, "repo_root": str(repo_root),
|
|
106
|
-
"git_branch": git_output(["branch", "--show-current"], cwd=repo_root),
|
|
107
|
-
"git_commit": git_output(["rev-parse", "HEAD"], cwd=repo_root),
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
append_run_log(_state_dir, f"Setup complete for {exp_id}: session={session_id}, agent={agent['name']}")
|
|
111
|
-
log("Setup complete.")
|
|
112
|
-
return session_id, agent["name"]
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
if __name__ == "__main__":
|
|
116
|
-
exp_id = sys.argv[1] if len(sys.argv) > 1 else "all"
|
|
117
|
-
clean_mode = sys.argv[2] if len(sys.argv) > 2 else "full"
|
|
118
|
-
agent_name = sys.argv[3] if len(sys.argv) > 3 else ""
|
|
119
|
-
sid, _ = prepare_environment(exp_id, clean_mode, agent_name)
|
|
120
|
-
print(sid)
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Prepare a clean repo for an experiment run. Agent-aware."""
|
|
3
|
+
|
|
4
|
+
import os
|
|
5
|
+
import subprocess
|
|
6
|
+
import sys
|
|
7
|
+
from datetime import datetime, timezone
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import Optional, Tuple
|
|
10
|
+
|
|
11
|
+
from _utils import (append_run_log, error, generate_session_id,
|
|
12
|
+
get_agent, get_agent_version, git_output, git_ok, log,
|
|
13
|
+
shell_ok, verify_agent_binary, write_json)
|
|
14
|
+
from deveco_arm import git_clean_repo, write_deveco_project_config
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def prepare_environment(exp_id: str, clean_mode: str = "full",
|
|
18
|
+
agent_name: str = "",
|
|
19
|
+
state_dir: Optional[Path] = None) -> Tuple[str, str]:
|
|
20
|
+
"""Prepare repo. Returns (session_id, agent_name)."""
|
|
21
|
+
clone_path = os.environ.get("REPO_CLONE", "")
|
|
22
|
+
is_clone = bool(clone_path and Path(clone_path).is_dir())
|
|
23
|
+
local_repo = os.environ.get("REPO_PATH", "")
|
|
24
|
+
if is_clone:
|
|
25
|
+
repo_root = Path(clone_path)
|
|
26
|
+
elif local_repo and Path(local_repo).is_dir():
|
|
27
|
+
repo_root = Path(local_repo)
|
|
28
|
+
else:
|
|
29
|
+
error("No repo available. Clone via run_all.py or set REPO_PATH / REPO_CLONE.")
|
|
30
|
+
sys.exit(1)
|
|
31
|
+
|
|
32
|
+
if state_dir is not None:
|
|
33
|
+
_state_dir = state_dir
|
|
34
|
+
else:
|
|
35
|
+
from _utils import LOG_DIR
|
|
36
|
+
_state_dir = LOG_DIR
|
|
37
|
+
|
|
38
|
+
if is_clone:
|
|
39
|
+
log(f"Using cloned repo: {repo_root}")
|
|
40
|
+
else:
|
|
41
|
+
log(f"Using local repo: {repo_root}")
|
|
42
|
+
|
|
43
|
+
os.chdir(repo_root)
|
|
44
|
+
|
|
45
|
+
# Agent config
|
|
46
|
+
agent = get_agent(agent_name)
|
|
47
|
+
binary = agent["binary"]
|
|
48
|
+
|
|
49
|
+
# Step 1: Clean repo
|
|
50
|
+
arm = os.environ.get("EVAL_ARM", "baseline")
|
|
51
|
+
if clean_mode == "full":
|
|
52
|
+
log("Restoring repo to clean state...")
|
|
53
|
+
branch = os.environ.get("BRANCH", "weekly_20260601")
|
|
54
|
+
shell_ok(f"git checkout {branch}")
|
|
55
|
+
git_ok(["checkout", "."], cwd=repo_root)
|
|
56
|
+
git_clean_repo(repo_root, arm)
|
|
57
|
+
|
|
58
|
+
current_branch = git_output(["branch", "--show-current"], cwd=repo_root)
|
|
59
|
+
commit = git_output(["rev-parse", "--short", "HEAD"], cwd=repo_root)
|
|
60
|
+
log(f"Branch: {current_branch} | Commit: {commit}")
|
|
61
|
+
|
|
62
|
+
# Step 1b: DevEco A/B project config (.deveco/deveco.jsonc)
|
|
63
|
+
if agent.get("binary") == "deveco":
|
|
64
|
+
write_deveco_project_config(repo_root, arm)
|
|
65
|
+
|
|
66
|
+
# Step 1c: Index rebuilt once at homegraph suite start (run_all / prebuild).
|
|
67
|
+
# Per-experiment git reset restores the same commit — no second index here.
|
|
68
|
+
# Step 2: Clear CLAUDE.md
|
|
69
|
+
claude_md = repo_root / "CLAUDE.md"
|
|
70
|
+
if claude_md.exists() and claude_md.stat().st_size > 0:
|
|
71
|
+
backup_dir = _state_dir / "claude_md_backups"
|
|
72
|
+
backup_dir.mkdir(parents=True, exist_ok=True)
|
|
73
|
+
ts = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
74
|
+
backup_path = backup_dir / f"CLAUDE.md.{ts}"
|
|
75
|
+
backup_path.write_text(claude_md.read_text())
|
|
76
|
+
log(f"Backed up CLAUDE.md → {backup_path}")
|
|
77
|
+
with open(claude_md, "w") as f:
|
|
78
|
+
f.write("")
|
|
79
|
+
log("Cleared CLAUDE.md")
|
|
80
|
+
|
|
81
|
+
for f in [".cursorrules", ".cursor/rules"]:
|
|
82
|
+
p = repo_root / f
|
|
83
|
+
if p.exists():
|
|
84
|
+
p.unlink()
|
|
85
|
+
|
|
86
|
+
# Step 3: Session ID
|
|
87
|
+
session_id = generate_session_id()
|
|
88
|
+
(_state_dir / f"session_{exp_id}.txt").write_text(session_id)
|
|
89
|
+
log(f"Session ID: {session_id}")
|
|
90
|
+
|
|
91
|
+
# Step 4: Verify agent binary
|
|
92
|
+
ok, resolved, err_msg = verify_agent_binary(agent)
|
|
93
|
+
if not ok:
|
|
94
|
+
error(err_msg)
|
|
95
|
+
sys.exit(1)
|
|
96
|
+
binary = resolved
|
|
97
|
+
agent_ver = get_agent_version(agent)
|
|
98
|
+
log(f"Agent: {agent['name']} ({binary}) v{agent_ver}")
|
|
99
|
+
|
|
100
|
+
# Step 5: Record state
|
|
101
|
+
write_json(_state_dir / exp_id / "state.json", {
|
|
102
|
+
"experiment_id": exp_id, "session_id": session_id,
|
|
103
|
+
"started_at": datetime.now(timezone.utc).isoformat(),
|
|
104
|
+
"clean_mode": clean_mode, "agent": agent["name"],
|
|
105
|
+
"agent_version": agent_ver, "repo_root": str(repo_root),
|
|
106
|
+
"git_branch": git_output(["branch", "--show-current"], cwd=repo_root),
|
|
107
|
+
"git_commit": git_output(["rev-parse", "HEAD"], cwd=repo_root),
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
append_run_log(_state_dir, f"Setup complete for {exp_id}: session={session_id}, agent={agent['name']}")
|
|
111
|
+
log("Setup complete.")
|
|
112
|
+
return session_id, agent["name"]
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
if __name__ == "__main__":
|
|
116
|
+
exp_id = sys.argv[1] if len(sys.argv) > 1 else "all"
|
|
117
|
+
clean_mode = sys.argv[2] if len(sys.argv) > 2 else "full"
|
|
118
|
+
agent_name = sys.argv[3] if len(sys.argv) > 3 else ""
|
|
119
|
+
sid, _ = prepare_environment(exp_id, clean_mode, agent_name)
|
|
120
|
+
print(sid)
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Windows MCP entry: pythonw (no window) → hidden node child; stdio inherited from DevEco."""
|
|
3
|
-
|
|
4
|
-
from __future__ import annotations
|
|
5
|
-
|
|
6
|
-
import os
|
|
7
|
-
import shutil
|
|
8
|
-
import subprocess
|
|
9
|
-
import sys
|
|
10
|
-
|
|
11
|
-
_CREATE_NO_WINDOW = getattr(subprocess, "CREATE_NO_WINDOW", 0x08000000)
|
|
12
|
-
|
|
13
|
-
# Applied here so MCP works even if DevEco ignores deveco.jsonc "environment".
|
|
14
|
-
_MCP_ENV_DEFAULTS = {
|
|
15
|
-
"HOMEGRAPH_NO_DAEMON": "1",
|
|
16
|
-
"HOMEGRAPH_NO_WATCHDOG": "1",
|
|
17
|
-
"HOMEGRAPH_WASM_RELAUNCHED": "1",
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def _resolve_node() -> str:
|
|
22
|
-
env_node = os.environ.get("HOMEGRAPH_NODE", "").strip()
|
|
23
|
-
if env_node:
|
|
24
|
-
return env_node
|
|
25
|
-
found = shutil.which("node")
|
|
26
|
-
if not found:
|
|
27
|
-
print("node not found on PATH", file=sys.stderr)
|
|
28
|
-
sys.exit(127)
|
|
29
|
-
return found
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def _node_argv(raw: list[str]) -> list[str]:
|
|
33
|
-
"""Ensure --liftoff-only is on the node command line (before homegraph.js)."""
|
|
34
|
-
node = _resolve_node()
|
|
35
|
-
args = list(raw)
|
|
36
|
-
if "--liftoff-only" not in args:
|
|
37
|
-
args.insert(0, "--liftoff-only")
|
|
38
|
-
return [node, *args]
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def _hidden_call(argv: list[str], env: dict) -> int:
|
|
42
|
-
si = subprocess.STARTUPINFO()
|
|
43
|
-
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
|
44
|
-
si.wShowWindow = 0
|
|
45
|
-
return subprocess.call(
|
|
46
|
-
argv,
|
|
47
|
-
env=env,
|
|
48
|
-
stdin=sys.stdin,
|
|
49
|
-
stdout=sys.stdout,
|
|
50
|
-
stderr=sys.stderr,
|
|
51
|
-
creationflags=_CREATE_NO_WINDOW,
|
|
52
|
-
startupinfo=si,
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def main() -> int:
|
|
57
|
-
if len(sys.argv) < 2:
|
|
58
|
-
print(
|
|
59
|
-
"usage: win_mcp_launcher.py [--liftoff-only] [--stack-size=N] homegraph.js …",
|
|
60
|
-
file=sys.stderr,
|
|
61
|
-
)
|
|
62
|
-
return 2
|
|
63
|
-
env = os.environ.copy()
|
|
64
|
-
for key, val in _MCP_ENV_DEFAULTS.items():
|
|
65
|
-
env.setdefault(key, val)
|
|
66
|
-
argv = _node_argv(sys.argv[1:])
|
|
67
|
-
if os.name == "nt":
|
|
68
|
-
return _hidden_call(argv, env)
|
|
69
|
-
return subprocess.call(argv, env=env)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if __name__ == "__main__":
|
|
73
|
-
raise SystemExit(main())
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Windows MCP entry: pythonw (no window) → hidden node child; stdio inherited from DevEco."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
import shutil
|
|
8
|
+
import subprocess
|
|
9
|
+
import sys
|
|
10
|
+
|
|
11
|
+
_CREATE_NO_WINDOW = getattr(subprocess, "CREATE_NO_WINDOW", 0x08000000)
|
|
12
|
+
|
|
13
|
+
# Applied here so MCP works even if DevEco ignores deveco.jsonc "environment".
|
|
14
|
+
_MCP_ENV_DEFAULTS = {
|
|
15
|
+
"HOMEGRAPH_NO_DAEMON": "1",
|
|
16
|
+
"HOMEGRAPH_NO_WATCHDOG": "1",
|
|
17
|
+
"HOMEGRAPH_WASM_RELAUNCHED": "1",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _resolve_node() -> str:
|
|
22
|
+
env_node = os.environ.get("HOMEGRAPH_NODE", "").strip()
|
|
23
|
+
if env_node:
|
|
24
|
+
return env_node
|
|
25
|
+
found = shutil.which("node")
|
|
26
|
+
if not found:
|
|
27
|
+
print("node not found on PATH", file=sys.stderr)
|
|
28
|
+
sys.exit(127)
|
|
29
|
+
return found
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _node_argv(raw: list[str]) -> list[str]:
|
|
33
|
+
"""Ensure --liftoff-only is on the node command line (before homegraph.js)."""
|
|
34
|
+
node = _resolve_node()
|
|
35
|
+
args = list(raw)
|
|
36
|
+
if "--liftoff-only" not in args:
|
|
37
|
+
args.insert(0, "--liftoff-only")
|
|
38
|
+
return [node, *args]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _hidden_call(argv: list[str], env: dict) -> int:
|
|
42
|
+
si = subprocess.STARTUPINFO()
|
|
43
|
+
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
|
44
|
+
si.wShowWindow = 0
|
|
45
|
+
return subprocess.call(
|
|
46
|
+
argv,
|
|
47
|
+
env=env,
|
|
48
|
+
stdin=sys.stdin,
|
|
49
|
+
stdout=sys.stdout,
|
|
50
|
+
stderr=sys.stderr,
|
|
51
|
+
creationflags=_CREATE_NO_WINDOW,
|
|
52
|
+
startupinfo=si,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def main() -> int:
|
|
57
|
+
if len(sys.argv) < 2:
|
|
58
|
+
print(
|
|
59
|
+
"usage: win_mcp_launcher.py [--liftoff-only] [--stack-size=N] homegraph.js …",
|
|
60
|
+
file=sys.stderr,
|
|
61
|
+
)
|
|
62
|
+
return 2
|
|
63
|
+
env = os.environ.copy()
|
|
64
|
+
for key, val in _MCP_ENV_DEFAULTS.items():
|
|
65
|
+
env.setdefault(key, val)
|
|
66
|
+
argv = _node_argv(sys.argv[1:])
|
|
67
|
+
if os.name == "nt":
|
|
68
|
+
return _hidden_call(argv, env)
|
|
69
|
+
return subprocess.call(argv, env=env)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
if __name__ == "__main__":
|
|
73
|
+
raise SystemExit(main())
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Windows MCP launcher: spawn homegraph with windowsHide while keeping stdio
|
|
4
|
-
* connected to DevEco (pythonw + Python subprocess breaks JSON-RPC pipes).
|
|
5
|
-
*
|
|
6
|
-
* Usage: node win_mcp_stdio_wrap.js [--stack-size=N] homegraph.js serve --mcp --path <repo>
|
|
7
|
-
*/
|
|
8
|
-
'use strict';
|
|
9
|
-
|
|
10
|
-
const cp = require('child_process');
|
|
11
|
-
|
|
12
|
-
const node = process.env.HOMEGRAPH_NODE || process.execPath;
|
|
13
|
-
const args = process.argv.slice(2);
|
|
14
|
-
if (args.length === 0) {
|
|
15
|
-
process.stderr.write('usage: node win_mcp_stdio_wrap.js [--stack-size=N] homegraph.js …\n');
|
|
16
|
-
process.exit(2);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const child = cp.spawn(node, args, {
|
|
20
|
-
stdio: 'inherit',
|
|
21
|
-
windowsHide: true,
|
|
22
|
-
env: process.env,
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
child.on('error', (err) => {
|
|
26
|
-
process.stderr.write(String(err) + '\n');
|
|
27
|
-
process.exit(1);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
child.on('exit', (code, signal) => {
|
|
31
|
-
if (signal) {
|
|
32
|
-
process.kill(process.pid, signal);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
process.exit(code ?? 1);
|
|
36
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Windows MCP launcher: spawn homegraph with windowsHide while keeping stdio
|
|
4
|
+
* connected to DevEco (pythonw + Python subprocess breaks JSON-RPC pipes).
|
|
5
|
+
*
|
|
6
|
+
* Usage: node win_mcp_stdio_wrap.js [--stack-size=N] homegraph.js serve --mcp --path <repo>
|
|
7
|
+
*/
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
const cp = require('child_process');
|
|
11
|
+
|
|
12
|
+
const node = process.env.HOMEGRAPH_NODE || process.execPath;
|
|
13
|
+
const args = process.argv.slice(2);
|
|
14
|
+
if (args.length === 0) {
|
|
15
|
+
process.stderr.write('usage: node win_mcp_stdio_wrap.js [--stack-size=N] homegraph.js …\n');
|
|
16
|
+
process.exit(2);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const child = cp.spawn(node, args, {
|
|
20
|
+
stdio: 'inherit',
|
|
21
|
+
windowsHide: true,
|
|
22
|
+
env: process.env,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
child.on('error', (err) => {
|
|
26
|
+
process.stderr.write(String(err) + '\n');
|
|
27
|
+
process.exit(1);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
child.on('exit', (code, signal) => {
|
|
31
|
+
if (signal) {
|
|
32
|
+
process.kill(process.pid, signal);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
process.exit(code ?? 1);
|
|
36
|
+
});
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Windows: run node without a console window; inherit stdio (MCP / homegraph CLI)."""
|
|
3
|
-
|
|
4
|
-
from __future__ import annotations
|
|
5
|
-
|
|
6
|
-
import os
|
|
7
|
-
import subprocess
|
|
8
|
-
import sys
|
|
9
|
-
|
|
10
|
-
_CREATE_NO_WINDOW = getattr(subprocess, "CREATE_NO_WINDOW", 0x08000000)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def main() -> int:
|
|
14
|
-
if len(sys.argv) < 2:
|
|
15
|
-
print("usage: win_node_launcher.py [--stack-size=N] script.js …", file=sys.stderr)
|
|
16
|
-
return 2
|
|
17
|
-
node = os.environ.get("HOMEGRAPH_NODE", "node")
|
|
18
|
-
cmd = [node, *sys.argv[1:]]
|
|
19
|
-
flags = _CREATE_NO_WINDOW if os.name == "nt" else 0
|
|
20
|
-
return subprocess.call(cmd, creationflags=flags)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if __name__ == "__main__":
|
|
24
|
-
raise SystemExit(main())
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Windows: run node without a console window; inherit stdio (MCP / homegraph CLI)."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
import subprocess
|
|
8
|
+
import sys
|
|
9
|
+
|
|
10
|
+
_CREATE_NO_WINDOW = getattr(subprocess, "CREATE_NO_WINDOW", 0x08000000)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def main() -> int:
|
|
14
|
+
if len(sys.argv) < 2:
|
|
15
|
+
print("usage: win_node_launcher.py [--stack-size=N] script.js …", file=sys.stderr)
|
|
16
|
+
return 2
|
|
17
|
+
node = os.environ.get("HOMEGRAPH_NODE", "node")
|
|
18
|
+
cmd = [node, *sys.argv[1:]]
|
|
19
|
+
flags = _CREATE_NO_WINDOW if os.name == "nt" else 0
|
|
20
|
+
return subprocess.call(cmd, creationflags=flags)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
if __name__ == "__main__":
|
|
24
|
+
raise SystemExit(main())
|