@opencodehub/cli 0.1.0
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 +202 -0
- package/README.md +85 -0
- package/dist/agent-context.d.ts +54 -0
- package/dist/agent-context.d.ts.map +1 -0
- package/dist/agent-context.js +122 -0
- package/dist/agent-context.js.map +1 -0
- package/dist/cobol-proleap-setup.d.ts +77 -0
- package/dist/cobol-proleap-setup.d.ts.map +1 -0
- package/dist/cobol-proleap-setup.js +289 -0
- package/dist/cobol-proleap-setup.js.map +1 -0
- package/dist/commands/analyze.d.ts +234 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +1096 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/augment.d.ts +48 -0
- package/dist/commands/augment.d.ts.map +1 -0
- package/dist/commands/augment.js +249 -0
- package/dist/commands/augment.js.map +1 -0
- package/dist/commands/baseline.d.ts +68 -0
- package/dist/commands/baseline.d.ts.map +1 -0
- package/dist/commands/baseline.js +110 -0
- package/dist/commands/baseline.js.map +1 -0
- package/dist/commands/bench.d.ts +54 -0
- package/dist/commands/bench.d.ts.map +1 -0
- package/dist/commands/bench.js +283 -0
- package/dist/commands/bench.js.map +1 -0
- package/dist/commands/ci-init.d.ts +37 -0
- package/dist/commands/ci-init.d.ts.map +1 -0
- package/dist/commands/ci-init.js +115 -0
- package/dist/commands/ci-init.js.map +1 -0
- package/dist/commands/clean.d.ts +13 -0
- package/dist/commands/clean.d.ts.map +1 -0
- package/dist/commands/clean.js +38 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/code-pack.d.ts +105 -0
- package/dist/commands/code-pack.d.ts.map +1 -0
- package/dist/commands/code-pack.js +187 -0
- package/dist/commands/code-pack.js.map +1 -0
- package/dist/commands/context.d.ts +30 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +237 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/detect-changes.d.ts +26 -0
- package/dist/commands/detect-changes.d.ts.map +1 -0
- package/dist/commands/detect-changes.js +73 -0
- package/dist/commands/detect-changes.js.map +1 -0
- package/dist/commands/doctor.d.ts +52 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +472 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/find-enclosing-symbol.d.ts +67 -0
- package/dist/commands/find-enclosing-symbol.d.ts.map +1 -0
- package/dist/commands/find-enclosing-symbol.js +106 -0
- package/dist/commands/find-enclosing-symbol.js.map +1 -0
- package/dist/commands/group.d.ts +123 -0
- package/dist/commands/group.d.ts.map +1 -0
- package/dist/commands/group.js +448 -0
- package/dist/commands/group.js.map +1 -0
- package/dist/commands/impact.d.ts +23 -0
- package/dist/commands/impact.d.ts.map +1 -0
- package/dist/commands/impact.js +91 -0
- package/dist/commands/impact.js.map +1 -0
- package/dist/commands/index-repo.d.ts +39 -0
- package/dist/commands/index-repo.d.ts.map +1 -0
- package/dist/commands/index-repo.js +148 -0
- package/dist/commands/index-repo.js.map +1 -0
- package/dist/commands/ingest-sarif.d.ts +64 -0
- package/dist/commands/ingest-sarif.d.ts.map +1 -0
- package/dist/commands/ingest-sarif.js +381 -0
- package/dist/commands/ingest-sarif.js.map +1 -0
- package/dist/commands/init.d.ts +75 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +315 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +17 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +79 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/mcp.d.ts +8 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +28 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/open-store.d.ts +25 -0
- package/dist/commands/open-store.d.ts.map +1 -0
- package/dist/commands/open-store.js +47 -0
- package/dist/commands/open-store.js.map +1 -0
- package/dist/commands/pack.d.ts +35 -0
- package/dist/commands/pack.d.ts.map +1 -0
- package/dist/commands/pack.js +83 -0
- package/dist/commands/pack.js.map +1 -0
- package/dist/commands/query.d.ts +85 -0
- package/dist/commands/query.d.ts.map +1 -0
- package/dist/commands/query.js +309 -0
- package/dist/commands/query.js.map +1 -0
- package/dist/commands/scan.d.ts +81 -0
- package/dist/commands/scan.d.ts.map +1 -0
- package/dist/commands/scan.js +407 -0
- package/dist/commands/scan.js.map +1 -0
- package/dist/commands/setup.d.ts +178 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +370 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/sql.d.ts +19 -0
- package/dist/commands/sql.d.ts.map +1 -0
- package/dist/commands/sql.js +51 -0
- package/dist/commands/sql.js.map +1 -0
- package/dist/commands/status.d.ts +13 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +66 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/verdict-render.d.ts +33 -0
- package/dist/commands/verdict-render.d.ts.map +1 -0
- package/dist/commands/verdict-render.js +123 -0
- package/dist/commands/verdict-render.js.map +1 -0
- package/dist/commands/verdict.d.ts +61 -0
- package/dist/commands/verdict.d.ts.map +1 -0
- package/dist/commands/verdict.js +146 -0
- package/dist/commands/verdict.js.map +1 -0
- package/dist/commands/wiki.d.ts +26 -0
- package/dist/commands/wiki.d.ts.map +1 -0
- package/dist/commands/wiki.js +74 -0
- package/dist/commands/wiki.js.map +1 -0
- package/dist/editors/claude-code.d.ts +23 -0
- package/dist/editors/claude-code.d.ts.map +1 -0
- package/dist/editors/claude-code.js +58 -0
- package/dist/editors/claude-code.js.map +1 -0
- package/dist/editors/codex.d.ts +22 -0
- package/dist/editors/codex.d.ts.map +1 -0
- package/dist/editors/codex.js +59 -0
- package/dist/editors/codex.js.map +1 -0
- package/dist/editors/cursor.d.ts +13 -0
- package/dist/editors/cursor.d.ts.map +1 -0
- package/dist/editors/cursor.js +21 -0
- package/dist/editors/cursor.js.map +1 -0
- package/dist/editors/index.d.ts +12 -0
- package/dist/editors/index.d.ts.map +1 -0
- package/dist/editors/index.js +11 -0
- package/dist/editors/index.js.map +1 -0
- package/dist/editors/opencode.d.ts +23 -0
- package/dist/editors/opencode.d.ts.map +1 -0
- package/dist/editors/opencode.js +61 -0
- package/dist/editors/opencode.js.map +1 -0
- package/dist/editors/types.d.ts +33 -0
- package/dist/editors/types.d.ts.map +1 -0
- package/dist/editors/types.js +19 -0
- package/dist/editors/types.js.map +1 -0
- package/dist/editors/windows-wrap.d.ts +19 -0
- package/dist/editors/windows-wrap.d.ts.map +1 -0
- package/dist/editors/windows-wrap.js +28 -0
- package/dist/editors/windows-wrap.js.map +1 -0
- package/dist/editors/windsurf.d.ts +12 -0
- package/dist/editors/windsurf.d.ts.map +1 -0
- package/dist/editors/windsurf.js +21 -0
- package/dist/editors/windsurf.js.map +1 -0
- package/dist/embedder-downloader.d.ts +87 -0
- package/dist/embedder-downloader.d.ts.map +1 -0
- package/dist/embedder-downloader.js +261 -0
- package/dist/embedder-downloader.js.map +1 -0
- package/dist/fs-atomic.d.ts +22 -0
- package/dist/fs-atomic.d.ts.map +1 -0
- package/dist/fs-atomic.js +28 -0
- package/dist/fs-atomic.js.map +1 -0
- package/dist/groups.d.ts +64 -0
- package/dist/groups.d.ts.map +1 -0
- package/dist/groups.js +172 -0
- package/dist/groups.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +703 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/is-indexed.d.ts +20 -0
- package/dist/lib/is-indexed.d.ts.map +1 -0
- package/dist/lib/is-indexed.js +35 -0
- package/dist/lib/is-indexed.js.map +1 -0
- package/dist/registry.d.ts +64 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +145 -0
- package/dist/registry.js.map +1 -0
- package/dist/scip-downloader.d.ts +138 -0
- package/dist/scip-downloader.d.ts.map +1 -0
- package/dist/scip-downloader.js +372 -0
- package/dist/scip-downloader.js.map +1 -0
- package/dist/scip-pins.d.ts +99 -0
- package/dist/scip-pins.d.ts.map +1 -0
- package/dist/scip-pins.js +195 -0
- package/dist/scip-pins.js.map +1 -0
- package/dist/skills-gen.d.ts +47 -0
- package/dist/skills-gen.d.ts.map +1 -0
- package/dist/skills-gen.js +292 -0
- package/dist/skills-gen.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pinned external SCIP adapter binaries.
|
|
3
|
+
*
|
|
4
|
+
* This is the single source of truth for every downloadable SCIP indexer we
|
|
5
|
+
* ship via `codehub setup --scip=<tool>`. Each entry carries:
|
|
6
|
+
*
|
|
7
|
+
* - `tool`: the indexer family.
|
|
8
|
+
* - `version`: upstream release tag (no `v` prefix).
|
|
9
|
+
* - `platforms[]`: per-platform download metadata. Each lists the target
|
|
10
|
+
* `{os, arch}`, the direct release URL, the expected SHA256
|
|
11
|
+
* digest, and (optionally) the binary's executable name on
|
|
12
|
+
* disk.
|
|
13
|
+
*
|
|
14
|
+
* Some pins ship PLACEHOLDER SHA256 hashes (64 zeros) for standalone
|
|
15
|
+
* binaries until each adapter's first-install smoke test computes and
|
|
16
|
+
* substitutes the real digest against the upstream release asset. The
|
|
17
|
+
* `placeholder: true` flag is the canonical "do NOT trust this hash at
|
|
18
|
+
* runtime" marker — `installScipTool()` refuses to run when the selected pin
|
|
19
|
+
* has `placeholder: true` unless the caller sets `opts.allowPlaceholder`
|
|
20
|
+
* (reserved for adapter first-install smoke tests).
|
|
21
|
+
*
|
|
22
|
+
* `scip-kotlin` ships a real SHA256 computed against Maven Central: upstream
|
|
23
|
+
* publishes the plugin as a Maven Central JAR
|
|
24
|
+
* (`com.sourcegraph:semanticdb-kotlinc:0.6.0`) whose SHA256 is stable and
|
|
25
|
+
* publicly verifiable — no first-install smoke test needed.
|
|
26
|
+
*
|
|
27
|
+
* `scip-dotnet` is the odd one out: upstream does NOT ship a self-contained
|
|
28
|
+
* release binary, so its install path goes through
|
|
29
|
+
* `dotnet tool install --global scip-dotnet`. Its entry therefore carries an
|
|
30
|
+
* empty `platforms` array and a sentinel `installerKind: "dotnet-tool"`. The
|
|
31
|
+
* downloader dispatches on that kind and skips the fetch/verify path entirely.
|
|
32
|
+
*/
|
|
33
|
+
/** PLACEHOLDER HASH — compute at implementation time. */
|
|
34
|
+
const PLACEHOLDER_SHA256 = "0".repeat(64);
|
|
35
|
+
/**
|
|
36
|
+
* scip-clang v0.4.0 — Sourcegraph C/C++ indexer, released 2026-02-23.
|
|
37
|
+
* Releases: `github.com/sourcegraph/scip-clang/releases/tag/v0.4.0`.
|
|
38
|
+
*
|
|
39
|
+
* Upstream ships release assets for exactly two `{arch, os}` pairs at
|
|
40
|
+
* v0.4.0 (per `api.github.com/repos/sourcegraph/scip-clang/releases/tags/v0.4.0`):
|
|
41
|
+
*
|
|
42
|
+
* - x86_64-linux — scip-clang-x86_64-linux
|
|
43
|
+
* - arm64-darwin — scip-clang-arm64-darwin
|
|
44
|
+
*
|
|
45
|
+
* The matching SCIP-CLANG README Supported Platforms section states plainly:
|
|
46
|
+
* "Binary releases are available for x86_64 Linux (glibc 2.16 or newer) and
|
|
47
|
+
* arm64 macOS." x86_64-darwin and aarch64-linux are NOT shipped; the two
|
|
48
|
+
* unavailable rows stay in the pin marked `platformUnavailable: true` so the
|
|
49
|
+
* gap is documented rather than silently omitted.
|
|
50
|
+
*/
|
|
51
|
+
const SCIP_CLANG_PIN = {
|
|
52
|
+
tool: "clang",
|
|
53
|
+
version: "0.4.0",
|
|
54
|
+
installerKind: "download",
|
|
55
|
+
placeholder: false,
|
|
56
|
+
binName: "scip-clang",
|
|
57
|
+
platforms: [
|
|
58
|
+
{
|
|
59
|
+
os: "linux",
|
|
60
|
+
arch: "x64",
|
|
61
|
+
url: "https://github.com/sourcegraph/scip-clang/releases/download/v0.4.0/scip-clang-x86_64-linux",
|
|
62
|
+
// Verified 2026-05-05 via `curl -sL <url> | sha256sum` against the
|
|
63
|
+
// upstream release asset (149 MB binary).
|
|
64
|
+
sha256: "06fd18c576f979a726c651594644ec4a35db4f471f2160b3f72eb89fa6001784",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
os: "linux",
|
|
68
|
+
arch: "arm64",
|
|
69
|
+
url: "https://github.com/sourcegraph/scip-clang/releases/download/v0.4.0/scip-clang-aarch64-linux",
|
|
70
|
+
// Upstream does NOT ship a linux-arm64 binary at v0.4.0 (asset URL 404s).
|
|
71
|
+
sha256: PLACEHOLDER_SHA256,
|
|
72
|
+
platformUnavailable: true,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
os: "darwin",
|
|
76
|
+
arch: "x64",
|
|
77
|
+
url: "https://github.com/sourcegraph/scip-clang/releases/download/v0.4.0/scip-clang-x86_64-darwin",
|
|
78
|
+
// Upstream does NOT ship a darwin-x64 binary at v0.4.0 (asset URL 404s).
|
|
79
|
+
sha256: PLACEHOLDER_SHA256,
|
|
80
|
+
platformUnavailable: true,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
os: "darwin",
|
|
84
|
+
arch: "arm64",
|
|
85
|
+
url: "https://github.com/sourcegraph/scip-clang/releases/download/v0.4.0/scip-clang-arm64-darwin",
|
|
86
|
+
// Verified 2026-05-05 via `curl -sL <url> | sha256sum` against the
|
|
87
|
+
// upstream release asset (71 MB binary).
|
|
88
|
+
sha256: "ff042fbc8a029f09f4b69fc7692e290e21c52923593207ee52d4e7439473ec64",
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* scip-ruby v0.4.7 — Sourcegraph Ruby indexer, released 2025-11-07.
|
|
94
|
+
* Releases: `github.com/sourcegraph/scip-ruby/releases/tag/scip-ruby-v0.4.7`.
|
|
95
|
+
*
|
|
96
|
+
* Upstream publishes self-contained executables for ONLY two platforms
|
|
97
|
+
* (per the v0.4.7 README: "we have gems and binaries available for x86_64
|
|
98
|
+
* Linux and arm64 macOS"):
|
|
99
|
+
*
|
|
100
|
+
* - linux-x64: `scip-ruby-x86_64-linux`
|
|
101
|
+
* - darwin-arm64: `scip-ruby-arm64-darwin`
|
|
102
|
+
*
|
|
103
|
+
* There are NO standalone linux-arm64 or darwin-x64 release binaries for
|
|
104
|
+
* v0.4.7. Users on those platforms fall back to the RubyGems install path
|
|
105
|
+
* (`gem install scip-ruby`), which is outside this downloader's scope.
|
|
106
|
+
* `resolvePlatformPin()` raises `UnsupportedPlatformError` on a missing
|
|
107
|
+
* `{os, arch}` — the CLI surfaces that as a clear install hint.
|
|
108
|
+
*
|
|
109
|
+
* SHA-256 digests verified against the GitHub Release API's `digest` field
|
|
110
|
+
* (2026-05-05) and independently confirmed with `curl -sL | sha256sum`.
|
|
111
|
+
*/
|
|
112
|
+
const SCIP_RUBY_PIN = {
|
|
113
|
+
tool: "ruby",
|
|
114
|
+
version: "0.4.7",
|
|
115
|
+
installerKind: "download",
|
|
116
|
+
placeholder: false,
|
|
117
|
+
binName: "scip-ruby",
|
|
118
|
+
platforms: [
|
|
119
|
+
{
|
|
120
|
+
os: "linux",
|
|
121
|
+
arch: "x64",
|
|
122
|
+
url: "https://github.com/sourcegraph/scip-ruby/releases/download/scip-ruby-v0.4.7/scip-ruby-x86_64-linux",
|
|
123
|
+
sha256: "a068c7c3b2042b9eac563ce77ce35dcaca666b418530b1db9f932a3dbc7175dd",
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
os: "darwin",
|
|
127
|
+
arch: "arm64",
|
|
128
|
+
url: "https://github.com/sourcegraph/scip-ruby/releases/download/scip-ruby-v0.4.7/scip-ruby-arm64-darwin",
|
|
129
|
+
sha256: "6a2bcda64ed385f0e99e92f9c5693296dc38325e4ed5ca91cd8e4b686ba14fb1",
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* scip-dotnet v0.2.12 — installed via `dotnet tool install --global scip-dotnet`.
|
|
135
|
+
* Upstream does NOT ship a self-contained release binary; the installer needs
|
|
136
|
+
* .NET SDK 8 or later on PATH.
|
|
137
|
+
*/
|
|
138
|
+
const SCIP_DOTNET_PIN = {
|
|
139
|
+
tool: "dotnet",
|
|
140
|
+
version: "0.2.12",
|
|
141
|
+
installerKind: "dotnet-tool",
|
|
142
|
+
placeholder: false,
|
|
143
|
+
binName: "scip-dotnet",
|
|
144
|
+
platforms: [],
|
|
145
|
+
minDotnetMajor: 8,
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* scip-kotlin v0.6.0 — released 2025-09-08, "Kotlin 2.2" release.
|
|
149
|
+
* Published as a **Maven Central JAR** (`com.sourcegraph:semanticdb-kotlinc:0.6.0`),
|
|
150
|
+
* NOT as GitHub release binaries. The GitHub release
|
|
151
|
+
* (`github.com/sourcegraph/scip-kotlin/releases/tag/v0.6.0`) ships zero assets.
|
|
152
|
+
*
|
|
153
|
+
* scip-kotlin is a **kotlinc compiler plugin** (not a self-contained CLI):
|
|
154
|
+
* the user invokes `kotlinc -Xplugin=<jar> ...` to emit SemanticDB files,
|
|
155
|
+
* then `scip-java index-semanticdb <targetroot>` converts the SemanticDB
|
|
156
|
+
* output into a `.scip` index. v0.6.0 requires Kotlin 2.2+ on PATH.
|
|
157
|
+
*
|
|
158
|
+
* The plugin is a JVM artifact — the same JAR works on every platform. We
|
|
159
|
+
* record four platform entries all pointing at the same Maven Central URL +
|
|
160
|
+
* SHA256 so the downloader's platform-detection path stays uniform across
|
|
161
|
+
* every SCIP tool (see `resolvePlatformPin` in `scip-downloader.ts`).
|
|
162
|
+
* `binName` is the JAR filename inside `~/.codehub/bin/` — the adapter
|
|
163
|
+
* references it by absolute path when invoking `kotlinc -Xplugin=<path>`.
|
|
164
|
+
*
|
|
165
|
+
* SHA256 computed against Maven Central at implementation time.
|
|
166
|
+
*/
|
|
167
|
+
const SCIP_KOTLIN_JAR_SHA256 = "bd6abb49d95a909c48dbf1bc2ce27f5ebcd871952f2f5683edb72a806db9b8ba";
|
|
168
|
+
const SCIP_KOTLIN_JAR_URL = "https://repo1.maven.org/maven2/com/sourcegraph/semanticdb-kotlinc/0.6.0/semanticdb-kotlinc-0.6.0.jar";
|
|
169
|
+
const SCIP_KOTLIN_PIN = {
|
|
170
|
+
tool: "kotlin",
|
|
171
|
+
version: "0.6.0",
|
|
172
|
+
installerKind: "download",
|
|
173
|
+
placeholder: false,
|
|
174
|
+
binName: "semanticdb-kotlinc-0.6.0.jar",
|
|
175
|
+
platforms: [
|
|
176
|
+
{ os: "linux", arch: "x64", url: SCIP_KOTLIN_JAR_URL, sha256: SCIP_KOTLIN_JAR_SHA256 },
|
|
177
|
+
{ os: "linux", arch: "arm64", url: SCIP_KOTLIN_JAR_URL, sha256: SCIP_KOTLIN_JAR_SHA256 },
|
|
178
|
+
{ os: "darwin", arch: "x64", url: SCIP_KOTLIN_JAR_URL, sha256: SCIP_KOTLIN_JAR_SHA256 },
|
|
179
|
+
{ os: "darwin", arch: "arm64", url: SCIP_KOTLIN_JAR_URL, sha256: SCIP_KOTLIN_JAR_SHA256 },
|
|
180
|
+
],
|
|
181
|
+
};
|
|
182
|
+
/** Single source of truth. Keep insertion order stable for `--scip=all`. */
|
|
183
|
+
export const SCIP_PINS = {
|
|
184
|
+
clang: SCIP_CLANG_PIN,
|
|
185
|
+
ruby: SCIP_RUBY_PIN,
|
|
186
|
+
dotnet: SCIP_DOTNET_PIN,
|
|
187
|
+
kotlin: SCIP_KOTLIN_PIN,
|
|
188
|
+
};
|
|
189
|
+
/** Ordered list used by `--scip=all`. */
|
|
190
|
+
export const SCIP_TOOL_ORDER = ["clang", "ruby", "dotnet", "kotlin"];
|
|
191
|
+
/** True when `value` is a known SCIP tool name. Used to validate CLI input. */
|
|
192
|
+
export function isScipTool(value) {
|
|
193
|
+
return value === "clang" || value === "ruby" || value === "dotnet" || value === "kotlin";
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=scip-pins.js.map
|
|
@@ -0,0 +1 @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S,GAA4C;IAChE,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,eAAe;CACxB,CAAC;AAEF,yCAAyC;AACzC,MAAM,CAAC,MAAM,eAAe,GAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAE1F,+EAA+E;AAC/E,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,QAAQ,CAAC;AAC3F,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-community SKILL.md generator.
|
|
3
|
+
*
|
|
4
|
+
* Walks `Community` nodes with `symbolCount >= 5` and emits one SKILL.md per
|
|
5
|
+
* cluster under `<repo>/.codehub/skills/<slug>/SKILL.md`. Each file carries a
|
|
6
|
+
* tiny YAML frontmatter (Claude Code skill format) plus a Markdown body listing
|
|
7
|
+
* the cluster label, size, entry points, and a member table (capped at 50).
|
|
8
|
+
*
|
|
9
|
+
* Entry-point rule: members that are also an `entryPointId` on any Process
|
|
10
|
+
* node win — these are the real heads of execution flows. If no such members
|
|
11
|
+
* exist for a community, fall back to the top-5 members by outgoing CALLS
|
|
12
|
+
* degree (most-callers-outbound acts as a proxy for "orchestrator").
|
|
13
|
+
*
|
|
14
|
+
* Slug collisions (two communities with the same keyword label) are resolved
|
|
15
|
+
* by appending `-2`, `-3`, … to the second and later occurrences.
|
|
16
|
+
*
|
|
17
|
+
* This function never aborts analyze. Any per-skill write failure (read-only
|
|
18
|
+
* filesystem, permission denied, disk full) is logged and skipped — we return
|
|
19
|
+
* the count of SKILL.md files successfully emitted.
|
|
20
|
+
*/
|
|
21
|
+
import type { IGraphStore } from "@opencodehub/storage";
|
|
22
|
+
/**
|
|
23
|
+
* Minimal store surface used by the generator. Aliased to {@link IGraphStore}
|
|
24
|
+
* so cli/skills-gen always operates through the typed-finder surface — no
|
|
25
|
+
* raw SQL escape hatch. Tests can supply a partial mock that implements just
|
|
26
|
+
* the four finders this generator calls.
|
|
27
|
+
*/
|
|
28
|
+
export type SkillsGenStore = Pick<IGraphStore, "listNodesByKind" | "listNodes" | "listNodesByEntryPoint" | "listEdgesByType">;
|
|
29
|
+
export interface SkillsGenOptions {
|
|
30
|
+
/** Minimum `symbolCount` for a community to be written out. Default 5. */
|
|
31
|
+
readonly minSymbolCount?: number;
|
|
32
|
+
/** Cap the member table to this many rows. Default 50. */
|
|
33
|
+
readonly maxMembers?: number;
|
|
34
|
+
/** Logger for per-skill failures. Defaults to `console.warn`. */
|
|
35
|
+
readonly log?: (message: string) => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Generate SKILL.md files for every significant community in the store.
|
|
39
|
+
*
|
|
40
|
+
* @returns number of SKILL.md files successfully written
|
|
41
|
+
*/
|
|
42
|
+
export declare function generateSkills(store: SkillsGenStore, repoPath: string, opts?: SkillsGenOptions): Promise<number>;
|
|
43
|
+
/** Lowercase, hyphen-separated, ASCII-only slug — capped at 60 chars. */
|
|
44
|
+
export declare function sanitizeSlug(label: string): string;
|
|
45
|
+
export declare function skillsOutputDir(repoPath: string): string;
|
|
46
|
+
export declare function skillFilePath(repoPath: string, slug: string): string;
|
|
47
|
+
//# sourceMappingURL=skills-gen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-gen.d.ts","sourceRoot":"","sources":["../src/skills-gen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,WAAW,EACX,iBAAiB,GAAG,WAAW,GAAG,uBAAuB,GAAG,iBAAiB,CAC9E,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,0DAA0D;IAC1D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAsBD;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,MAAM,CAAC,CA6CjB;AAyND,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOlD;AAyBD,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExD;AAID,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpE"}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-community SKILL.md generator.
|
|
3
|
+
*
|
|
4
|
+
* Walks `Community` nodes with `symbolCount >= 5` and emits one SKILL.md per
|
|
5
|
+
* cluster under `<repo>/.codehub/skills/<slug>/SKILL.md`. Each file carries a
|
|
6
|
+
* tiny YAML frontmatter (Claude Code skill format) plus a Markdown body listing
|
|
7
|
+
* the cluster label, size, entry points, and a member table (capped at 50).
|
|
8
|
+
*
|
|
9
|
+
* Entry-point rule: members that are also an `entryPointId` on any Process
|
|
10
|
+
* node win — these are the real heads of execution flows. If no such members
|
|
11
|
+
* exist for a community, fall back to the top-5 members by outgoing CALLS
|
|
12
|
+
* degree (most-callers-outbound acts as a proxy for "orchestrator").
|
|
13
|
+
*
|
|
14
|
+
* Slug collisions (two communities with the same keyword label) are resolved
|
|
15
|
+
* by appending `-2`, `-3`, … to the second and later occurrences.
|
|
16
|
+
*
|
|
17
|
+
* This function never aborts analyze. Any per-skill write failure (read-only
|
|
18
|
+
* filesystem, permission denied, disk full) is logged and skipped — we return
|
|
19
|
+
* the count of SKILL.md files successfully emitted.
|
|
20
|
+
*/
|
|
21
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
22
|
+
import { join } from "node:path";
|
|
23
|
+
const DEFAULT_MIN_SYMBOLS = 5;
|
|
24
|
+
const DEFAULT_MAX_MEMBERS = 50;
|
|
25
|
+
const DEFAULT_ENTRY_POINT_LIMIT = 5;
|
|
26
|
+
/**
|
|
27
|
+
* Generate SKILL.md files for every significant community in the store.
|
|
28
|
+
*
|
|
29
|
+
* @returns number of SKILL.md files successfully written
|
|
30
|
+
*/
|
|
31
|
+
export async function generateSkills(store, repoPath, opts = {}) {
|
|
32
|
+
const minSymbols = opts.minSymbolCount ?? DEFAULT_MIN_SYMBOLS;
|
|
33
|
+
const maxMembers = opts.maxMembers ?? DEFAULT_MAX_MEMBERS;
|
|
34
|
+
const log = opts.log ?? ((m) => console.warn(m));
|
|
35
|
+
const communities = await fetchCommunities(store, minSymbols);
|
|
36
|
+
if (communities.length === 0)
|
|
37
|
+
return 0;
|
|
38
|
+
// Pre-compute the set of Process `entryPointId`s so we can flag Community
|
|
39
|
+
// members that are heads of a detected execution flow. A single round-trip
|
|
40
|
+
// keeps the cost flat regardless of how many communities we walk.
|
|
41
|
+
const entryPointIds = await fetchProcessEntryPointIds(store);
|
|
42
|
+
const skillsDir = join(repoPath, ".codehub", "skills");
|
|
43
|
+
const usedSlugs = new Set();
|
|
44
|
+
let emitted = 0;
|
|
45
|
+
for (const community of communities) {
|
|
46
|
+
try {
|
|
47
|
+
const members = await fetchMembers(store, community.id);
|
|
48
|
+
if (members.length === 0)
|
|
49
|
+
continue;
|
|
50
|
+
const entryPoints = await selectEntryPoints(store, members, entryPointIds);
|
|
51
|
+
const slug = uniqueSlug(labelForCommunity(community), usedSlugs);
|
|
52
|
+
usedSlugs.add(slug);
|
|
53
|
+
const body = renderSkillMarkdown({
|
|
54
|
+
slug,
|
|
55
|
+
community,
|
|
56
|
+
members: members.slice(0, maxMembers),
|
|
57
|
+
totalMembers: members.length,
|
|
58
|
+
entryPoints,
|
|
59
|
+
});
|
|
60
|
+
const skillDir = join(skillsDir, slug);
|
|
61
|
+
const skillFile = join(skillDir, "SKILL.md");
|
|
62
|
+
await mkdir(skillDir, { recursive: true });
|
|
63
|
+
await writeFile(skillFile, body, "utf8");
|
|
64
|
+
emitted += 1;
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
log(`codehub analyze: failed to write SKILL.md for ${community.id}: ${errorMessage(err)}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return emitted;
|
|
71
|
+
}
|
|
72
|
+
// ----------------------------------------------------------------------------
|
|
73
|
+
// Store-facing queries
|
|
74
|
+
// ----------------------------------------------------------------------------
|
|
75
|
+
async function fetchCommunities(store, minSymbols) {
|
|
76
|
+
// `listNodesByKind('Community')` returns the typed `CommunityNode` shape
|
|
77
|
+
// with `symbolCount`, `inferredLabel`, and `keywords` already rehydrated.
|
|
78
|
+
// Filter + sort in TS — the typed finder only paginates on `(id ASC)`,
|
|
79
|
+
// not on a derived metric like `symbolCount`. `symbolCount` is optional
|
|
80
|
+
// on `CommunityNode` so we coerce missing values to 0 (treating an
|
|
81
|
+
// un-populated community as below the minimum).
|
|
82
|
+
const all = (await store.listNodesByKind("Community"));
|
|
83
|
+
const filtered = all
|
|
84
|
+
.map((c) => ({ c, count: c.symbolCount ?? 0 }))
|
|
85
|
+
.filter(({ count }) => count >= minSymbols)
|
|
86
|
+
.sort((a, b) => {
|
|
87
|
+
if (a.count !== b.count)
|
|
88
|
+
return b.count - a.count;
|
|
89
|
+
return a.c.id < b.c.id ? -1 : a.c.id > b.c.id ? 1 : 0;
|
|
90
|
+
});
|
|
91
|
+
const out = [];
|
|
92
|
+
for (const { c, count } of filtered) {
|
|
93
|
+
if (c.id.length === 0 || !Number.isFinite(count))
|
|
94
|
+
continue;
|
|
95
|
+
const label = typeof c.inferredLabel === "string" && c.inferredLabel.length > 0
|
|
96
|
+
? c.inferredLabel
|
|
97
|
+
: undefined;
|
|
98
|
+
out.push({
|
|
99
|
+
id: c.id,
|
|
100
|
+
name: c.name,
|
|
101
|
+
symbolCount: count,
|
|
102
|
+
inferredLabel: label,
|
|
103
|
+
keywords: c.keywords ?? [],
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
async function fetchMembers(store, communityId) {
|
|
109
|
+
// MEMBER_OF edges have the symbol on `from` and the Community on `to`.
|
|
110
|
+
const edges = await store.listEdgesByType("MEMBER_OF", { toIds: [communityId] });
|
|
111
|
+
if (edges.length === 0)
|
|
112
|
+
return [];
|
|
113
|
+
const fromIds = Array.from(new Set(edges.map((e) => e.from)));
|
|
114
|
+
const nodes = await store.listNodes({ ids: fromIds });
|
|
115
|
+
const rows = [];
|
|
116
|
+
for (const n of nodes) {
|
|
117
|
+
const startLineRaw = n.startLine;
|
|
118
|
+
const startLine = typeof startLineRaw === "number" && Number.isFinite(startLineRaw) ? startLineRaw : undefined;
|
|
119
|
+
rows.push({
|
|
120
|
+
id: n.id,
|
|
121
|
+
name: n.name,
|
|
122
|
+
kind: n.kind,
|
|
123
|
+
filePath: n.filePath,
|
|
124
|
+
startLine,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// Match prior `ORDER BY n.name ASC, n.id ASC`.
|
|
128
|
+
rows.sort((a, b) => {
|
|
129
|
+
if (a.name !== b.name)
|
|
130
|
+
return a.name < b.name ? -1 : 1;
|
|
131
|
+
return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
132
|
+
});
|
|
133
|
+
return rows;
|
|
134
|
+
}
|
|
135
|
+
async function fetchProcessEntryPointIds(store) {
|
|
136
|
+
const processes = await store.listNodesByKind("Process");
|
|
137
|
+
const out = new Set();
|
|
138
|
+
for (const p of processes) {
|
|
139
|
+
const entryPointId = p.entryPointId;
|
|
140
|
+
if (typeof entryPointId === "string" && entryPointId.length > 0)
|
|
141
|
+
out.add(entryPointId);
|
|
142
|
+
}
|
|
143
|
+
return out;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Fetch the top-K members of a community by outgoing CALLS degree. Used as a
|
|
147
|
+
* fallback when no community members are process heads. Computes the
|
|
148
|
+
* `GROUP BY from_id COUNT(*)` aggregate in TS over the typed-finder edges
|
|
149
|
+
* — the legacy SQL pushed it down to DuckDB, but `listEdgesByType` already
|
|
150
|
+
* narrows to one type so the reduction is bounded by community size.
|
|
151
|
+
*/
|
|
152
|
+
async function fetchTopCallersByOutDegree(store, memberIds, limit) {
|
|
153
|
+
if (memberIds.length === 0)
|
|
154
|
+
return new Map();
|
|
155
|
+
const ids = memberIds;
|
|
156
|
+
const edges = await store.listEdgesByType("CALLS", { fromIds: ids });
|
|
157
|
+
const counts = new Map();
|
|
158
|
+
for (const e of edges)
|
|
159
|
+
counts.set(e.from, (counts.get(e.from) ?? 0) + 1);
|
|
160
|
+
// Match prior `ORDER BY out_degree DESC, from_id ASC LIMIT ?`.
|
|
161
|
+
const sorted = Array.from(counts.entries()).sort((a, b) => {
|
|
162
|
+
if (a[1] !== b[1])
|
|
163
|
+
return b[1] - a[1];
|
|
164
|
+
return a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0;
|
|
165
|
+
});
|
|
166
|
+
return new Map(sorted.slice(0, limit));
|
|
167
|
+
}
|
|
168
|
+
async function selectEntryPoints(store, members, processEntryPointIds) {
|
|
169
|
+
// Preferred: members that are the head of a Process. Preserves the name
|
|
170
|
+
// ordering from `fetchMembers` so the output is deterministic.
|
|
171
|
+
const processHeads = members.filter((m) => processEntryPointIds.has(m.id));
|
|
172
|
+
if (processHeads.length > 0)
|
|
173
|
+
return processHeads.slice(0, DEFAULT_ENTRY_POINT_LIMIT);
|
|
174
|
+
// Fallback: top-K by outgoing CALLS degree.
|
|
175
|
+
const degrees = await fetchTopCallersByOutDegree(store, members.map((m) => m.id), DEFAULT_ENTRY_POINT_LIMIT);
|
|
176
|
+
if (degrees.size === 0)
|
|
177
|
+
return members.slice(0, DEFAULT_ENTRY_POINT_LIMIT);
|
|
178
|
+
const byId = new Map(members.map((m) => [m.id, m]));
|
|
179
|
+
const ranked = [];
|
|
180
|
+
// Iterate degrees in insertion order (already DESC by out_degree, ASC by id
|
|
181
|
+
// from the SQL) so the resulting list is deterministic.
|
|
182
|
+
for (const id of degrees.keys()) {
|
|
183
|
+
const m = byId.get(id);
|
|
184
|
+
if (m !== undefined)
|
|
185
|
+
ranked.push(m);
|
|
186
|
+
}
|
|
187
|
+
return ranked.slice(0, DEFAULT_ENTRY_POINT_LIMIT);
|
|
188
|
+
}
|
|
189
|
+
function renderSkillMarkdown(input) {
|
|
190
|
+
const { slug, community, members, totalMembers, entryPoints } = input;
|
|
191
|
+
const label = labelForCommunity(community);
|
|
192
|
+
const description = buildDescription(label, community.keywords);
|
|
193
|
+
const fileCount = new Set(members.map((m) => m.filePath).filter((f) => f.length > 0)).size;
|
|
194
|
+
const lines = [];
|
|
195
|
+
lines.push("---");
|
|
196
|
+
lines.push(`name: ${slug}`);
|
|
197
|
+
lines.push(`description: ${description}`);
|
|
198
|
+
lines.push("---");
|
|
199
|
+
lines.push("");
|
|
200
|
+
lines.push(`# ${label}`);
|
|
201
|
+
lines.push("");
|
|
202
|
+
lines.push(`This cluster contains ${community.symbolCount} ${pluralize(community.symbolCount, "symbol", "symbols")} ` +
|
|
203
|
+
`in ${fileCount} ${pluralize(fileCount, "file", "files")}.`);
|
|
204
|
+
lines.push("");
|
|
205
|
+
lines.push("## Entry points");
|
|
206
|
+
lines.push("");
|
|
207
|
+
if (entryPoints.length === 0) {
|
|
208
|
+
lines.push("- (no entry points detected)");
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
for (const ep of entryPoints) {
|
|
212
|
+
const location = formatLocation(ep.filePath, ep.startLine);
|
|
213
|
+
lines.push(`- \`${ep.name}\` — ${location}`);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
lines.push("");
|
|
217
|
+
lines.push("## Members");
|
|
218
|
+
lines.push("");
|
|
219
|
+
lines.push("| Name | Kind | File:Line |");
|
|
220
|
+
lines.push("|---|---|---|");
|
|
221
|
+
for (const m of members) {
|
|
222
|
+
lines.push(`| \`${m.name}\` | ${m.kind} | ${formatLocation(m.filePath, m.startLine)} |`);
|
|
223
|
+
}
|
|
224
|
+
if (totalMembers > members.length) {
|
|
225
|
+
lines.push("");
|
|
226
|
+
lines.push(`_(+${totalMembers - members.length} more members omitted)_`);
|
|
227
|
+
}
|
|
228
|
+
lines.push("");
|
|
229
|
+
return lines.join("\n");
|
|
230
|
+
}
|
|
231
|
+
function buildDescription(label, keywords) {
|
|
232
|
+
const base = `${label}.`;
|
|
233
|
+
if (keywords.length === 0)
|
|
234
|
+
return base;
|
|
235
|
+
return `${base} ${keywords.slice(0, 5).join(", ")}.`;
|
|
236
|
+
}
|
|
237
|
+
function formatLocation(filePath, startLine) {
|
|
238
|
+
const path = filePath.length > 0 ? filePath : "<unknown>";
|
|
239
|
+
return startLine !== undefined ? `${path}:${startLine}` : path;
|
|
240
|
+
}
|
|
241
|
+
// ----------------------------------------------------------------------------
|
|
242
|
+
// Slug + label helpers
|
|
243
|
+
// ----------------------------------------------------------------------------
|
|
244
|
+
function labelForCommunity(community) {
|
|
245
|
+
if (community.inferredLabel !== undefined && community.inferredLabel.length > 0) {
|
|
246
|
+
return community.inferredLabel;
|
|
247
|
+
}
|
|
248
|
+
if (community.keywords.length > 0) {
|
|
249
|
+
return community.keywords.slice(0, 3).join("-");
|
|
250
|
+
}
|
|
251
|
+
return community.name.length > 0 ? community.name : community.id;
|
|
252
|
+
}
|
|
253
|
+
/** Lowercase, hyphen-separated, ASCII-only slug — capped at 60 chars. */
|
|
254
|
+
export function sanitizeSlug(label) {
|
|
255
|
+
const slug = label
|
|
256
|
+
.toLowerCase()
|
|
257
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
258
|
+
.replace(/^-+|-+$/g, "")
|
|
259
|
+
.slice(0, 60);
|
|
260
|
+
return slug.length > 0 ? slug : "community";
|
|
261
|
+
}
|
|
262
|
+
function uniqueSlug(label, used) {
|
|
263
|
+
const base = sanitizeSlug(label);
|
|
264
|
+
if (!used.has(base))
|
|
265
|
+
return base;
|
|
266
|
+
let counter = 2;
|
|
267
|
+
while (used.has(`${base}-${counter}`))
|
|
268
|
+
counter += 1;
|
|
269
|
+
return `${base}-${counter}`;
|
|
270
|
+
}
|
|
271
|
+
// ----------------------------------------------------------------------------
|
|
272
|
+
// Misc
|
|
273
|
+
// ----------------------------------------------------------------------------
|
|
274
|
+
function pluralize(n, singular, plural) {
|
|
275
|
+
return n === 1 ? singular : plural;
|
|
276
|
+
}
|
|
277
|
+
function errorMessage(err) {
|
|
278
|
+
if (err instanceof Error)
|
|
279
|
+
return err.message;
|
|
280
|
+
return String(err);
|
|
281
|
+
}
|
|
282
|
+
// Re-export for callers that only want the directory root (matches the path
|
|
283
|
+
// analyze.ts constructs so both sides stay in sync).
|
|
284
|
+
export function skillsOutputDir(repoPath) {
|
|
285
|
+
return join(repoPath, ".codehub", "skills");
|
|
286
|
+
}
|
|
287
|
+
// Convenience helper — returns the absolute path of a single SKILL.md for a
|
|
288
|
+
// given slug so downstream callers don't re-do the join.
|
|
289
|
+
export function skillFilePath(repoPath, slug) {
|
|
290
|
+
return join(skillsOutputDir(repoPath), slug, "SKILL.md");
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=skills-gen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-gen.js","sourceRoot":"","sources":["../src/skills-gen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAw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E,MAAc;IAC5D,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;AACrC,CAAC;AAED,SAAS,YAAY,CAAC,GAAY;IAChC,IAAI,GAAG,YAAY,KAAK;QAAE,OAAO,GAAG,CAAC,OAAO,CAAC;IAC7C,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AAED,4EAA4E;AAC5E,qDAAqD;AACrD,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,OAAO,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AAC9C,CAAC;AAED,4EAA4E;AAC5E,yDAAyD;AACzD,MAAM,UAAU,aAAa,CAAC,QAAgB,EAAE,IAAY;IAC1D,OAAO,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;AAC3D,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opencodehub/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "OpenCodeHub — codehub CLI (analyze, setup, mcp, list, status, clean, query, context, impact, sql)",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/theagenticguy/opencodehub.git",
|
|
9
|
+
"directory": "packages/cli"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/theagenticguy/opencodehub#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/theagenticguy/opencodehub/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"bin": {
|
|
19
|
+
"codehub": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist/**/*.js",
|
|
23
|
+
"!dist/**/*.test.js",
|
|
24
|
+
"dist/**/*.d.ts",
|
|
25
|
+
"!dist/**/*.test.d.ts",
|
|
26
|
+
"dist/**/*.js.map",
|
|
27
|
+
"!dist/**/*.test.js.map",
|
|
28
|
+
"dist/**/*.d.ts.map",
|
|
29
|
+
"!dist/**/*.test.d.ts.map"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@iarna/toml": "2.2.5",
|
|
33
|
+
"cli-table3": "0.6.5",
|
|
34
|
+
"commander": "14.0.3",
|
|
35
|
+
"envinfo": "7.21.0",
|
|
36
|
+
"listr2": "10.2.1",
|
|
37
|
+
"write-file-atomic": "8.0.0",
|
|
38
|
+
"yaml": "2.8.4",
|
|
39
|
+
"@opencodehub/analysis": "0.1.0",
|
|
40
|
+
"@opencodehub/core-types": "0.1.0",
|
|
41
|
+
"@opencodehub/embedder": "0.1.0",
|
|
42
|
+
"@opencodehub/ingestion": "0.1.0",
|
|
43
|
+
"@opencodehub/mcp": "0.1.0",
|
|
44
|
+
"@opencodehub/sarif": "0.1.0",
|
|
45
|
+
"@opencodehub/pack": "0.1.0",
|
|
46
|
+
"@opencodehub/policy": "0.1.0",
|
|
47
|
+
"@opencodehub/scanners": "0.1.0",
|
|
48
|
+
"@opencodehub/search": "0.1.0",
|
|
49
|
+
"@opencodehub/storage": "0.1.0",
|
|
50
|
+
"@opencodehub/wiki": "0.1.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/node": "25.6.2",
|
|
54
|
+
"@types/write-file-atomic": "4.0.3",
|
|
55
|
+
"typescript": "6.0.3"
|
|
56
|
+
},
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public"
|
|
59
|
+
},
|
|
60
|
+
"keywords": [
|
|
61
|
+
"opencodehub",
|
|
62
|
+
"code-intelligence",
|
|
63
|
+
"mcp",
|
|
64
|
+
"model-context-protocol",
|
|
65
|
+
"ai",
|
|
66
|
+
"code-graph",
|
|
67
|
+
"static-analysis",
|
|
68
|
+
"cli",
|
|
69
|
+
"codehub",
|
|
70
|
+
"developer-tools",
|
|
71
|
+
"code-analysis"
|
|
72
|
+
],
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=22.0.0"
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"build": "tsc -b && node scripts/copy-ci-templates.mjs && node scripts/copy-plugin-assets.mjs",
|
|
78
|
+
"test": "node --test './dist/**/*.test.js'",
|
|
79
|
+
"clean": "rm -rf dist *.tsbuildinfo"
|
|
80
|
+
}
|
|
81
|
+
}
|