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,133 +1,133 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Build and optionally publish homegraph-ohos-api-db-<version> (one npm package per API version).
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* node scripts/ohos-sdk-publish.mjs <zip-or-dir> [version] [--dry-run] [--no-publish]
|
|
7
|
-
*/
|
|
8
|
-
import * as fs from 'fs';
|
|
9
|
-
import * as path from 'path';
|
|
10
|
-
import { fileURLToPath } from 'url';
|
|
11
|
-
import {
|
|
12
|
-
resolveOhosSdkInput,
|
|
13
|
-
ohosApiDbFilename,
|
|
14
|
-
ohosApiDbPackageName,
|
|
15
|
-
indexOhosApiDb,
|
|
16
|
-
} from '../dist/extraction/languages/arkts.js';
|
|
17
|
-
|
|
18
|
-
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
19
|
-
|
|
20
|
-
function parseArgs(argv) {
|
|
21
|
-
const positional = [];
|
|
22
|
-
const flags = new Set();
|
|
23
|
-
for (let i = 2; i < argv.length; i++) {
|
|
24
|
-
const arg = argv[i];
|
|
25
|
-
if (arg.startsWith('--')) flags.add(arg);
|
|
26
|
-
else positional.push(arg);
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
input: positional[0] ?? '',
|
|
30
|
-
version: positional[1] ?? '',
|
|
31
|
-
dryRun: flags.has('--dry-run'),
|
|
32
|
-
noPublish: flags.has('--no-publish'),
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function buildNpmPackage(version, dbPath, outDir) {
|
|
37
|
-
const dbName = ohosApiDbFilename(version);
|
|
38
|
-
const pkgName = ohosApiDbPackageName(version);
|
|
39
|
-
fs.rmSync(outDir, { recursive: true, force: true });
|
|
40
|
-
fs.mkdirSync(path.join(outDir, 'scripts'), { recursive: true });
|
|
41
|
-
fs.copyFileSync(dbPath, path.join(outDir, dbName));
|
|
42
|
-
|
|
43
|
-
const postinstall = `#!/usr/bin/env node
|
|
44
|
-
'use strict';
|
|
45
|
-
const fs = require('fs');
|
|
46
|
-
const path = require('path');
|
|
47
|
-
const os = require('os');
|
|
48
|
-
const dbName = ${JSON.stringify(dbName)};
|
|
49
|
-
const src = path.join(__dirname, '..', dbName);
|
|
50
|
-
const dest = path.join(os.homedir(), '.homegraph', 'api', dbName);
|
|
51
|
-
if (!fs.existsSync(src)) process.exit(0);
|
|
52
|
-
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
53
|
-
fs.copyFileSync(src, dest);
|
|
54
|
-
`;
|
|
55
|
-
fs.writeFileSync(path.join(outDir, 'scripts', 'postinstall.js'), postinstall, { mode: 0o755 });
|
|
56
|
-
fs.writeFileSync(
|
|
57
|
-
path.join(outDir, 'package.json'),
|
|
58
|
-
JSON.stringify(
|
|
59
|
-
{
|
|
60
|
-
name: pkgName,
|
|
61
|
-
version: '1.0.0',
|
|
62
|
-
description: `Prebuilt HomeGraph OHOS API database for SDK ${version}`,
|
|
63
|
-
license: 'MIT',
|
|
64
|
-
files: [dbName, 'scripts/postinstall.js'],
|
|
65
|
-
scripts: { postinstall: 'node scripts/postinstall.js' },
|
|
66
|
-
homegraph: { ohosApiVersion: version, dbFile: dbName },
|
|
67
|
-
},
|
|
68
|
-
null,
|
|
69
|
-
2
|
|
70
|
-
) + '\n'
|
|
71
|
-
);
|
|
72
|
-
return pkgName;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const { input, version, dryRun, noPublish } = parseArgs(process.argv);
|
|
76
|
-
if (!input) {
|
|
77
|
-
console.error('Usage: node scripts/ohos-sdk-publish.mjs <zip-or-dir> [version] [--dry-run] [--no-publish]');
|
|
78
|
-
process.exit(1);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (!fs.existsSync(path.join(ROOT, 'dist/extraction/languages/arkts.js'))) {
|
|
82
|
-
console.error('[ohos-sdk-publish] dist not built — run npm run build first');
|
|
83
|
-
process.exit(1);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const resolved = resolveOhosSdkInput({
|
|
87
|
-
inputPath: path.resolve(input),
|
|
88
|
-
versionOverride: version || undefined,
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
const dbPath = path.join(
|
|
92
|
-
fs.mkdtempSync(path.join(path.dirname(resolved.sdkHome), '.hg-ohos-pack-')),
|
|
93
|
-
ohosApiDbFilename(resolved.version)
|
|
94
|
-
);
|
|
95
|
-
const pkgDir = path.join(path.dirname(dbPath), 'npm-package');
|
|
96
|
-
|
|
97
|
-
try {
|
|
98
|
-
process.stderr.write(`[ohos-sdk-publish] indexing ${resolved.version} …\n`);
|
|
99
|
-
const result = await indexOhosApiDb({
|
|
100
|
-
sdkHome: resolved.sdkHome,
|
|
101
|
-
version: resolved.version,
|
|
102
|
-
outputPath: dbPath,
|
|
103
|
-
onProgress: (p) => {
|
|
104
|
-
if (p.phase === 'arkts-batch') {
|
|
105
|
-
const label = p.subphase === 'scene' ? 'Scene' : 'Persist';
|
|
106
|
-
process.stderr.write(`\r${label}: ${p.current}/${p.total}`.padEnd(40));
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
});
|
|
110
|
-
process.stderr.write('\n');
|
|
111
|
-
if (!result.success) {
|
|
112
|
-
for (const err of result.errors.filter((e) => e.severity === 'error')) console.error(err.message);
|
|
113
|
-
process.exit(1);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const pkgName = buildNpmPackage(resolved.version, dbPath, pkgDir);
|
|
117
|
-
console.log(`[ohos-sdk-publish] package: ${pkgName} → ${pkgDir} (${result.nodesCreated} nodes)`);
|
|
118
|
-
|
|
119
|
-
if (dryRun || noPublish) {
|
|
120
|
-
console.log('[ohos-sdk-publish] skipping npm publish');
|
|
121
|
-
process.exit(0);
|
|
122
|
-
}
|
|
123
|
-
if (!process.env.NPM_TOKEN) {
|
|
124
|
-
console.error('[ohos-sdk-publish] NPM_TOKEN not set — package built, not published');
|
|
125
|
-
process.exit(0);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const { execFileSync } = await import('child_process');
|
|
129
|
-
execFileSync('npm', ['publish', '--access', 'public'], { cwd: pkgDir, stdio: 'inherit' });
|
|
130
|
-
console.log(`[ohos-sdk-publish] published ${pkgName}`);
|
|
131
|
-
} finally {
|
|
132
|
-
resolved.cleanup?.();
|
|
133
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Build and optionally publish homegraph-ohos-api-db-<version> (one npm package per API version).
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* node scripts/ohos-sdk-publish.mjs <zip-or-dir> [version] [--dry-run] [--no-publish]
|
|
7
|
+
*/
|
|
8
|
+
import * as fs from 'fs';
|
|
9
|
+
import * as path from 'path';
|
|
10
|
+
import { fileURLToPath } from 'url';
|
|
11
|
+
import {
|
|
12
|
+
resolveOhosSdkInput,
|
|
13
|
+
ohosApiDbFilename,
|
|
14
|
+
ohosApiDbPackageName,
|
|
15
|
+
indexOhosApiDb,
|
|
16
|
+
} from '../dist/extraction/languages/arkts.js';
|
|
17
|
+
|
|
18
|
+
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
19
|
+
|
|
20
|
+
function parseArgs(argv) {
|
|
21
|
+
const positional = [];
|
|
22
|
+
const flags = new Set();
|
|
23
|
+
for (let i = 2; i < argv.length; i++) {
|
|
24
|
+
const arg = argv[i];
|
|
25
|
+
if (arg.startsWith('--')) flags.add(arg);
|
|
26
|
+
else positional.push(arg);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
input: positional[0] ?? '',
|
|
30
|
+
version: positional[1] ?? '',
|
|
31
|
+
dryRun: flags.has('--dry-run'),
|
|
32
|
+
noPublish: flags.has('--no-publish'),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function buildNpmPackage(version, dbPath, outDir) {
|
|
37
|
+
const dbName = ohosApiDbFilename(version);
|
|
38
|
+
const pkgName = ohosApiDbPackageName(version);
|
|
39
|
+
fs.rmSync(outDir, { recursive: true, force: true });
|
|
40
|
+
fs.mkdirSync(path.join(outDir, 'scripts'), { recursive: true });
|
|
41
|
+
fs.copyFileSync(dbPath, path.join(outDir, dbName));
|
|
42
|
+
|
|
43
|
+
const postinstall = `#!/usr/bin/env node
|
|
44
|
+
'use strict';
|
|
45
|
+
const fs = require('fs');
|
|
46
|
+
const path = require('path');
|
|
47
|
+
const os = require('os');
|
|
48
|
+
const dbName = ${JSON.stringify(dbName)};
|
|
49
|
+
const src = path.join(__dirname, '..', dbName);
|
|
50
|
+
const dest = path.join(os.homedir(), '.homegraph', 'api', dbName);
|
|
51
|
+
if (!fs.existsSync(src)) process.exit(0);
|
|
52
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
53
|
+
fs.copyFileSync(src, dest);
|
|
54
|
+
`;
|
|
55
|
+
fs.writeFileSync(path.join(outDir, 'scripts', 'postinstall.js'), postinstall, { mode: 0o755 });
|
|
56
|
+
fs.writeFileSync(
|
|
57
|
+
path.join(outDir, 'package.json'),
|
|
58
|
+
JSON.stringify(
|
|
59
|
+
{
|
|
60
|
+
name: pkgName,
|
|
61
|
+
version: '1.0.0',
|
|
62
|
+
description: `Prebuilt HomeGraph OHOS API database for SDK ${version}`,
|
|
63
|
+
license: 'MIT',
|
|
64
|
+
files: [dbName, 'scripts/postinstall.js'],
|
|
65
|
+
scripts: { postinstall: 'node scripts/postinstall.js' },
|
|
66
|
+
homegraph: { ohosApiVersion: version, dbFile: dbName },
|
|
67
|
+
},
|
|
68
|
+
null,
|
|
69
|
+
2
|
|
70
|
+
) + '\n'
|
|
71
|
+
);
|
|
72
|
+
return pkgName;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const { input, version, dryRun, noPublish } = parseArgs(process.argv);
|
|
76
|
+
if (!input) {
|
|
77
|
+
console.error('Usage: node scripts/ohos-sdk-publish.mjs <zip-or-dir> [version] [--dry-run] [--no-publish]');
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (!fs.existsSync(path.join(ROOT, 'dist/extraction/languages/arkts.js'))) {
|
|
82
|
+
console.error('[ohos-sdk-publish] dist not built — run npm run build first');
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const resolved = resolveOhosSdkInput({
|
|
87
|
+
inputPath: path.resolve(input),
|
|
88
|
+
versionOverride: version || undefined,
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const dbPath = path.join(
|
|
92
|
+
fs.mkdtempSync(path.join(path.dirname(resolved.sdkHome), '.hg-ohos-pack-')),
|
|
93
|
+
ohosApiDbFilename(resolved.version)
|
|
94
|
+
);
|
|
95
|
+
const pkgDir = path.join(path.dirname(dbPath), 'npm-package');
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
process.stderr.write(`[ohos-sdk-publish] indexing ${resolved.version} …\n`);
|
|
99
|
+
const result = await indexOhosApiDb({
|
|
100
|
+
sdkHome: resolved.sdkHome,
|
|
101
|
+
version: resolved.version,
|
|
102
|
+
outputPath: dbPath,
|
|
103
|
+
onProgress: (p) => {
|
|
104
|
+
if (p.phase === 'arkts-batch') {
|
|
105
|
+
const label = p.subphase === 'scene' ? 'Scene' : 'Persist';
|
|
106
|
+
process.stderr.write(`\r${label}: ${p.current}/${p.total}`.padEnd(40));
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
process.stderr.write('\n');
|
|
111
|
+
if (!result.success) {
|
|
112
|
+
for (const err of result.errors.filter((e) => e.severity === 'error')) console.error(err.message);
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const pkgName = buildNpmPackage(resolved.version, dbPath, pkgDir);
|
|
117
|
+
console.log(`[ohos-sdk-publish] package: ${pkgName} → ${pkgDir} (${result.nodesCreated} nodes)`);
|
|
118
|
+
|
|
119
|
+
if (dryRun || noPublish) {
|
|
120
|
+
console.log('[ohos-sdk-publish] skipping npm publish');
|
|
121
|
+
process.exit(0);
|
|
122
|
+
}
|
|
123
|
+
if (!process.env.NPM_TOKEN) {
|
|
124
|
+
console.error('[ohos-sdk-publish] NPM_TOKEN not set — package built, not published');
|
|
125
|
+
process.exit(0);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const { execFileSync } = await import('child_process');
|
|
129
|
+
execFileSync('npm', ['publish', '--access', 'public'], { cwd: pkgDir, stdio: 'inherit' });
|
|
130
|
+
console.log(`[ohos-sdk-publish] published ${pkgName}`);
|
|
131
|
+
} finally {
|
|
132
|
+
resolved.cleanup?.();
|
|
133
|
+
}
|
package/scripts/pack-npm.sh
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# Assemble the npm thin-installer packages from built bundles (esbuild pattern).
|
|
4
|
-
#
|
|
5
|
-
# Produces, under release/npm/:
|
|
6
|
-
# homegraph-<target>/ one per built bundle — the vendored Node + app, tagged
|
|
7
|
-
# with os/cpu so npm installs only the matching one.
|
|
8
|
-
# main/ the homegraph shim package: a tiny bin
|
|
9
|
-
# that execs the matching platform bundle, with every
|
|
10
|
-
# platform package in optionalDependencies.
|
|
11
|
-
#
|
|
12
|
-
# The release pipeline then `npm publish`es each dir. This does NOT touch the
|
|
13
|
-
# repo's package.json — the dev/from-source path keeps working; the *published*
|
|
14
|
-
# main package's shape is generated here.
|
|
15
|
-
#
|
|
16
|
-
# Prereq: run build-bundle.sh for each target first (release/homegraph-*.tar.gz).
|
|
17
|
-
# Usage: scripts/pack-npm.sh [version] (default: version from package.json)
|
|
18
|
-
set -euo pipefail
|
|
19
|
-
|
|
20
|
-
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
21
|
-
VERSION="${1:-$(node -p "require('$ROOT/package.json').version")}"
|
|
22
|
-
SCOPE="@colbymchenry"
|
|
23
|
-
REL="$ROOT/release"
|
|
24
|
-
NPM="$REL/npm"
|
|
25
|
-
|
|
26
|
-
rm -rf "$NPM"
|
|
27
|
-
mkdir -p "$NPM/main"
|
|
28
|
-
|
|
29
|
-
shopt -s nullglob
|
|
30
|
-
archives=("$REL"/homegraph-*.tar.gz "$REL"/homegraph-*.zip)
|
|
31
|
-
[ ${#archives[@]} -gt 0 ] || { echo "[pack-npm] no bundles in $REL — run build-bundle.sh first" >&2; exit 1; }
|
|
32
|
-
|
|
33
|
-
targets=()
|
|
34
|
-
for archive in "${archives[@]}"; do
|
|
35
|
-
fname="$(basename "$archive")"
|
|
36
|
-
case "$fname" in
|
|
37
|
-
*.tar.gz) base="${fname%.tar.gz}" ;; # homegraph-<target>
|
|
38
|
-
*.zip) base="${fname%.zip}" ;;
|
|
39
|
-
esac
|
|
40
|
-
target="${base#homegraph-}" # <target>, e.g. darwin-arm64 / win32-x64
|
|
41
|
-
os="${target%-*}" # darwin | linux | win32
|
|
42
|
-
arch="${target##*-}" # arm64 | x64
|
|
43
|
-
pkgdir="$NPM/$base"
|
|
44
|
-
mkdir -p "$pkgdir"
|
|
45
|
-
case "$fname" in
|
|
46
|
-
*.zip)
|
|
47
|
-
tmpx="$(mktemp -d)"
|
|
48
|
-
unzip -q "$archive" -d "$tmpx"
|
|
49
|
-
mv "$tmpx/homegraph-${target}"/* "$pkgdir"/
|
|
50
|
-
rm -rf "$tmpx"
|
|
51
|
-
nodefile="node.exe"
|
|
52
|
-
;;
|
|
53
|
-
*)
|
|
54
|
-
tar -xzf "$archive" -C "$pkgdir" --strip-components=1
|
|
55
|
-
nodefile="node"
|
|
56
|
-
;;
|
|
57
|
-
esac
|
|
58
|
-
VERSION="$VERSION" SCOPE="$SCOPE" TARGET="$target" OSV="$os" ARCHV="$arch" NODEFILE="$nodefile" \
|
|
59
|
-
node -e '
|
|
60
|
-
const fs=require("fs");
|
|
61
|
-
fs.writeFileSync(process.argv[1], JSON.stringify({
|
|
62
|
-
name: `${process.env.SCOPE}/homegraph-${process.env.TARGET}`,
|
|
63
|
-
version: process.env.VERSION,
|
|
64
|
-
description: `HomeGraph self-contained bundle for ${process.env.TARGET}`,
|
|
65
|
-
os: [process.env.OSV], cpu: [process.env.ARCHV],
|
|
66
|
-
files: [process.env.NODEFILE, "lib", "bin"],
|
|
67
|
-
license: "MIT"
|
|
68
|
-
}, null, 2) + "\n");
|
|
69
|
-
' "$pkgdir/package.json"
|
|
70
|
-
targets+=("$target")
|
|
71
|
-
echo "[pack-npm] ${SCOPE}/homegraph-${target}@${VERSION}"
|
|
72
|
-
done
|
|
73
|
-
|
|
74
|
-
# Main shim package.
|
|
75
|
-
# npm-shim.js CLI/MCP launcher (execs the bundled Node) — the `bin`.
|
|
76
|
-
# npm-sdk.js programmatic/embedded entry (#354): re-exports the installed
|
|
77
|
-
# platform bundle's compiled library — the `main`.
|
|
78
|
-
# dist/ the .d.ts tree only (types). The runtime .js stays in the
|
|
79
|
-
# per-platform bundle so its deps aren't duplicated here.
|
|
80
|
-
cp "$ROOT/scripts/npm-shim.js" "$NPM/main/npm-shim.js"
|
|
81
|
-
cp "$ROOT/scripts/npm-sdk.js" "$NPM/main/npm-sdk.js"
|
|
82
|
-
[ -f "$ROOT/README.md" ] && cp "$ROOT/README.md" "$NPM/main/README.md"
|
|
83
|
-
|
|
84
|
-
# Ship the type declarations so `types`/`exports.types` resolve. Built from this
|
|
85
|
-
# same release, so they can't skew from the runtime npm-sdk.js re-exports.
|
|
86
|
-
[ -f "$ROOT/dist/index.d.ts" ] || ( echo "[pack-npm] building dist for .d.ts" >&2 && cd "$ROOT" && npm run build >/dev/null )
|
|
87
|
-
ROOT="$ROOT" DEST="$NPM/main" node -e '
|
|
88
|
-
const fs=require("fs"), path=require("path");
|
|
89
|
-
const src=path.join(process.env.ROOT,"dist"), dest=path.join(process.env.DEST,"dist");
|
|
90
|
-
fs.cpSync(src, dest, { recursive:true, filter(s){
|
|
91
|
-
try { return fs.statSync(s).isDirectory() || s.endsWith(".d.ts"); } catch (e) { return false; }
|
|
92
|
-
}});
|
|
93
|
-
'
|
|
94
|
-
|
|
95
|
-
VERSION="$VERSION" SCOPE="$SCOPE" TARGETS="${targets[*]}" \
|
|
96
|
-
node -e '
|
|
97
|
-
const fs=require("fs");
|
|
98
|
-
const opt={};
|
|
99
|
-
for (const t of process.env.TARGETS.split(/\s+/).filter(Boolean))
|
|
100
|
-
opt[`${process.env.SCOPE}/homegraph-${t}`]=process.env.VERSION;
|
|
101
|
-
fs.writeFileSync(process.argv[1], JSON.stringify({
|
|
102
|
-
name: `${process.env.SCOPE}/homegraph`,
|
|
103
|
-
version: process.env.VERSION,
|
|
104
|
-
description: "Local-first code intelligence for AI agents (MCP). Self-contained — bundles its own runtime.",
|
|
105
|
-
bin: { homegraph: "npm-shim.js" },
|
|
106
|
-
main: "npm-sdk.js",
|
|
107
|
-
types: "dist/index.d.ts",
|
|
108
|
-
exports: {
|
|
109
|
-
".": { types: "./dist/index.d.ts", default: "./npm-sdk.js" },
|
|
110
|
-
"./package.json": "./package.json"
|
|
111
|
-
},
|
|
112
|
-
optionalDependencies: opt,
|
|
113
|
-
files: ["npm-shim.js","npm-sdk.js","dist","README.md"],
|
|
114
|
-
license: "MIT"
|
|
115
|
-
}, null, 2) + "\n");
|
|
116
|
-
' "$NPM/main/package.json"
|
|
117
|
-
|
|
118
|
-
echo "[pack-npm] ${SCOPE}/homegraph@${VERSION} (${#targets[@]} platform packages in optionalDependencies)"
|
|
119
|
-
echo "[pack-npm] output: $NPM"
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# Assemble the npm thin-installer packages from built bundles (esbuild pattern).
|
|
4
|
+
#
|
|
5
|
+
# Produces, under release/npm/:
|
|
6
|
+
# homegraph-<target>/ one per built bundle — the vendored Node + app, tagged
|
|
7
|
+
# with os/cpu so npm installs only the matching one.
|
|
8
|
+
# main/ the homegraph shim package: a tiny bin
|
|
9
|
+
# that execs the matching platform bundle, with every
|
|
10
|
+
# platform package in optionalDependencies.
|
|
11
|
+
#
|
|
12
|
+
# The release pipeline then `npm publish`es each dir. This does NOT touch the
|
|
13
|
+
# repo's package.json — the dev/from-source path keeps working; the *published*
|
|
14
|
+
# main package's shape is generated here.
|
|
15
|
+
#
|
|
16
|
+
# Prereq: run build-bundle.sh for each target first (release/homegraph-*.tar.gz).
|
|
17
|
+
# Usage: scripts/pack-npm.sh [version] (default: version from package.json)
|
|
18
|
+
set -euo pipefail
|
|
19
|
+
|
|
20
|
+
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
21
|
+
VERSION="${1:-$(node -p "require('$ROOT/package.json').version")}"
|
|
22
|
+
SCOPE="@colbymchenry"
|
|
23
|
+
REL="$ROOT/release"
|
|
24
|
+
NPM="$REL/npm"
|
|
25
|
+
|
|
26
|
+
rm -rf "$NPM"
|
|
27
|
+
mkdir -p "$NPM/main"
|
|
28
|
+
|
|
29
|
+
shopt -s nullglob
|
|
30
|
+
archives=("$REL"/homegraph-*.tar.gz "$REL"/homegraph-*.zip)
|
|
31
|
+
[ ${#archives[@]} -gt 0 ] || { echo "[pack-npm] no bundles in $REL — run build-bundle.sh first" >&2; exit 1; }
|
|
32
|
+
|
|
33
|
+
targets=()
|
|
34
|
+
for archive in "${archives[@]}"; do
|
|
35
|
+
fname="$(basename "$archive")"
|
|
36
|
+
case "$fname" in
|
|
37
|
+
*.tar.gz) base="${fname%.tar.gz}" ;; # homegraph-<target>
|
|
38
|
+
*.zip) base="${fname%.zip}" ;;
|
|
39
|
+
esac
|
|
40
|
+
target="${base#homegraph-}" # <target>, e.g. darwin-arm64 / win32-x64
|
|
41
|
+
os="${target%-*}" # darwin | linux | win32
|
|
42
|
+
arch="${target##*-}" # arm64 | x64
|
|
43
|
+
pkgdir="$NPM/$base"
|
|
44
|
+
mkdir -p "$pkgdir"
|
|
45
|
+
case "$fname" in
|
|
46
|
+
*.zip)
|
|
47
|
+
tmpx="$(mktemp -d)"
|
|
48
|
+
unzip -q "$archive" -d "$tmpx"
|
|
49
|
+
mv "$tmpx/homegraph-${target}"/* "$pkgdir"/
|
|
50
|
+
rm -rf "$tmpx"
|
|
51
|
+
nodefile="node.exe"
|
|
52
|
+
;;
|
|
53
|
+
*)
|
|
54
|
+
tar -xzf "$archive" -C "$pkgdir" --strip-components=1
|
|
55
|
+
nodefile="node"
|
|
56
|
+
;;
|
|
57
|
+
esac
|
|
58
|
+
VERSION="$VERSION" SCOPE="$SCOPE" TARGET="$target" OSV="$os" ARCHV="$arch" NODEFILE="$nodefile" \
|
|
59
|
+
node -e '
|
|
60
|
+
const fs=require("fs");
|
|
61
|
+
fs.writeFileSync(process.argv[1], JSON.stringify({
|
|
62
|
+
name: `${process.env.SCOPE}/homegraph-${process.env.TARGET}`,
|
|
63
|
+
version: process.env.VERSION,
|
|
64
|
+
description: `HomeGraph self-contained bundle for ${process.env.TARGET}`,
|
|
65
|
+
os: [process.env.OSV], cpu: [process.env.ARCHV],
|
|
66
|
+
files: [process.env.NODEFILE, "lib", "bin"],
|
|
67
|
+
license: "MIT"
|
|
68
|
+
}, null, 2) + "\n");
|
|
69
|
+
' "$pkgdir/package.json"
|
|
70
|
+
targets+=("$target")
|
|
71
|
+
echo "[pack-npm] ${SCOPE}/homegraph-${target}@${VERSION}"
|
|
72
|
+
done
|
|
73
|
+
|
|
74
|
+
# Main shim package.
|
|
75
|
+
# npm-shim.js CLI/MCP launcher (execs the bundled Node) — the `bin`.
|
|
76
|
+
# npm-sdk.js programmatic/embedded entry (#354): re-exports the installed
|
|
77
|
+
# platform bundle's compiled library — the `main`.
|
|
78
|
+
# dist/ the .d.ts tree only (types). The runtime .js stays in the
|
|
79
|
+
# per-platform bundle so its deps aren't duplicated here.
|
|
80
|
+
cp "$ROOT/scripts/npm-shim.js" "$NPM/main/npm-shim.js"
|
|
81
|
+
cp "$ROOT/scripts/npm-sdk.js" "$NPM/main/npm-sdk.js"
|
|
82
|
+
[ -f "$ROOT/README.md" ] && cp "$ROOT/README.md" "$NPM/main/README.md"
|
|
83
|
+
|
|
84
|
+
# Ship the type declarations so `types`/`exports.types` resolve. Built from this
|
|
85
|
+
# same release, so they can't skew from the runtime npm-sdk.js re-exports.
|
|
86
|
+
[ -f "$ROOT/dist/index.d.ts" ] || ( echo "[pack-npm] building dist for .d.ts" >&2 && cd "$ROOT" && npm run build >/dev/null )
|
|
87
|
+
ROOT="$ROOT" DEST="$NPM/main" node -e '
|
|
88
|
+
const fs=require("fs"), path=require("path");
|
|
89
|
+
const src=path.join(process.env.ROOT,"dist"), dest=path.join(process.env.DEST,"dist");
|
|
90
|
+
fs.cpSync(src, dest, { recursive:true, filter(s){
|
|
91
|
+
try { return fs.statSync(s).isDirectory() || s.endsWith(".d.ts"); } catch (e) { return false; }
|
|
92
|
+
}});
|
|
93
|
+
'
|
|
94
|
+
|
|
95
|
+
VERSION="$VERSION" SCOPE="$SCOPE" TARGETS="${targets[*]}" \
|
|
96
|
+
node -e '
|
|
97
|
+
const fs=require("fs");
|
|
98
|
+
const opt={};
|
|
99
|
+
for (const t of process.env.TARGETS.split(/\s+/).filter(Boolean))
|
|
100
|
+
opt[`${process.env.SCOPE}/homegraph-${t}`]=process.env.VERSION;
|
|
101
|
+
fs.writeFileSync(process.argv[1], JSON.stringify({
|
|
102
|
+
name: `${process.env.SCOPE}/homegraph`,
|
|
103
|
+
version: process.env.VERSION,
|
|
104
|
+
description: "Local-first code intelligence for AI agents (MCP). Self-contained — bundles its own runtime.",
|
|
105
|
+
bin: { homegraph: "npm-shim.js" },
|
|
106
|
+
main: "npm-sdk.js",
|
|
107
|
+
types: "dist/index.d.ts",
|
|
108
|
+
exports: {
|
|
109
|
+
".": { types: "./dist/index.d.ts", default: "./npm-sdk.js" },
|
|
110
|
+
"./package.json": "./package.json"
|
|
111
|
+
},
|
|
112
|
+
optionalDependencies: opt,
|
|
113
|
+
files: ["npm-shim.js","npm-sdk.js","dist","README.md"],
|
|
114
|
+
license: "MIT"
|
|
115
|
+
}, null, 2) + "\n");
|
|
116
|
+
' "$NPM/main/package.json"
|
|
117
|
+
|
|
118
|
+
echo "[pack-npm] ${SCOPE}/homegraph@${VERSION} (${#targets[@]} platform packages in optionalDependencies)"
|
|
119
|
+
echo "[pack-npm] output: $NPM"
|