@visulima/vis-mcp 1.0.0-alpha.2 → 1.0.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,312 @@
1
+ ## @visulima/vis-mcp [1.0.0-alpha.20](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.19...@visulima/vis-mcp@1.0.0-alpha.20) (2026-06-04)
2
+
3
+
4
+ ### Dependencies
5
+
6
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.31
7
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.30
8
+
9
+ ## @visulima/vis-mcp [1.0.0-alpha.19](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.18...@visulima/vis-mcp@1.0.0-alpha.19) (2026-06-04)
10
+
11
+ ### Bug Fixes
12
+
13
+ * **vis-mcp:** 1 bug fix ([33cd25e](https://github.com/visulima/visulima/commit/33cd25ecbcea0185e4cab1e3d49ba0fd41206d67))
14
+
15
+
16
+ ### Dependencies
17
+
18
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.30
19
+ * **@visulima/path:** upgraded to 3.0.0-alpha.12
20
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.29
21
+
22
+ ## @visulima/vis-mcp [1.0.0-alpha.18](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.17...@visulima/vis-mcp@1.0.0-alpha.18) (2026-06-03)
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.28
28
+
29
+ ## @visulima/vis-mcp [1.0.0-alpha.17](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.16...@visulima/vis-mcp@1.0.0-alpha.17) (2026-06-02)
30
+
31
+ ### Features
32
+
33
+ * **vis:** lint + fmt orchestrator ([3a78ed7](https://github.com/visulima/visulima/commit/3a78ed709922e6a35648e0d0eb3f41cc49f89b7a))
34
+
35
+ ### Bug Fixes
36
+
37
+ * **tests:** revert unsafe vitest autofixes from the lint sweep ([378f27c](https://github.com/visulima/visulima/commit/378f27caa370f1d3188aef2ed36d46839abc88c4))
38
+
39
+ ### Miscellaneous Chores
40
+
41
+ * apply eslint + prettier autofixes across packages ([c1bb784](https://github.com/visulima/visulima/commit/c1bb7848a0d93d0dfe2960c77e3cda22239c79a0))
42
+
43
+ ### Tests
44
+
45
+ * **vis-mcp:** cover cli-failure catch paths, resolveVisBin fallback, and version/exec edge branches ([a46fa08](https://github.com/visulima/visulima/commit/a46fa08c991ceeab1e5d4ae575768581aba7bdec))
46
+
47
+
48
+ ### Dependencies
49
+
50
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.29
51
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.27
52
+
53
+ ## @visulima/vis-mcp [1.0.0-alpha.16](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.15...@visulima/vis-mcp@1.0.0-alpha.16) (2026-05-29)
54
+
55
+ ### Tests
56
+
57
+ * improve coverage across packages ([91bd6d3](https://github.com/visulima/visulima/commit/91bd6d3b61736e3c8bd1fc59b0b5955f76a5d323))
58
+
59
+
60
+ ### Dependencies
61
+
62
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.26
63
+
64
+ ## @visulima/vis-mcp [1.0.0-alpha.15](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.14...@visulima/vis-mcp@1.0.0-alpha.15) (2026-05-27)
65
+
66
+ ### Bug Fixes
67
+
68
+ * **storage-client:** percent-encode user fields in defaultFingerprint ([7c78a0f](https://github.com/visulima/visulima/commit/7c78a0f9512e2a673b941d80839e9f1e86b7b5d0))
69
+
70
+ ### Miscellaneous Chores
71
+
72
+ * sorted package.json ([b47c545](https://github.com/visulima/visulima/commit/b47c545591600fdab17d5cd3a3fbc68b61e199da))
73
+
74
+
75
+ ### Dependencies
76
+
77
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.28
78
+ * **@visulima/path:** upgraded to 3.0.0-alpha.11
79
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.25
80
+
81
+ ## @visulima/vis-mcp [1.0.0-alpha.14](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.13...@visulima/vis-mcp@1.0.0-alpha.14) (2026-05-26)
82
+
83
+ ### Miscellaneous Chores
84
+
85
+ * **ci-stability:** green CI across vis, native, lint, tests, attw ([#651](https://github.com/visulima/visulima/issues/651)) ([d4eb684](https://github.com/visulima/visulima/commit/d4eb684b5f75c818c9251048c605a0ed54a268e3))
86
+ * **repo:** apply eslint --fix and prettier --fix across packages ([#650](https://github.com/visulima/visulima/issues/650)) ([2e26a84](https://github.com/visulima/visulima/commit/2e26a84774f218f21345e9a8ecd68236b6542743)), closes [#620](https://github.com/visulima/visulima/issues/620)
87
+
88
+ ### Tests
89
+
90
+ * **repo:** cover bin entry points in dist integration suite ([7479ef1](https://github.com/visulima/visulima/commit/7479ef113cf5ccef25692619082afb1b6a0eecab))
91
+
92
+
93
+ ### Dependencies
94
+
95
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.26
96
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.24
97
+
98
+ ## @visulima/vis-mcp [1.0.0-alpha.13](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.12...@visulima/vis-mcp@1.0.0-alpha.13) (2026-05-20)
99
+
100
+
101
+ ### Dependencies
102
+
103
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.25
104
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.23
105
+
106
+ ## @visulima/vis-mcp [1.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.11...@visulima/vis-mcp@1.0.0-alpha.12) (2026-05-19)
107
+
108
+
109
+ ### Dependencies
110
+
111
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.24
112
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.22
113
+
114
+ ## @visulima/vis-mcp [1.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.10...@visulima/vis-mcp@1.0.0-alpha.11) (2026-05-16)
115
+
116
+
117
+ ### Dependencies
118
+
119
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.23
120
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.21
121
+
122
+ ## @visulima/vis-mcp [1.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.9...@visulima/vis-mcp@1.0.0-alpha.10) (2026-05-14)
123
+
124
+ ### ⚠ BREAKING CHANGES
125
+
126
+ * **vis:** the following security.* keys were renamed:
127
+ - security.minimumReleaseAge -> security.policies.first_seen.minutes
128
+ - security.minimumReleaseAgeExclude -> security.policies.first_seen.exclude
129
+ - security.trustPolicy -> security.policies.publisher_change.mode
130
+ - security.trustPolicyExclude -> security.policies.publisher_change.exclude
131
+ - security.trustPolicyIgnoreAfter -> security.policies.publisher_change.ignoreAfter
132
+ - security.allowBuilds -> security.policies.install_scripts.allow
133
+ - security.strictDepBuilds -> security.policies.install_scripts.strict
134
+ - security.socket.minimumScore -> security.policies.score.minimum
135
+ - security.socket.acceptedRisks -> security.acceptedRisks
136
+ - security.audit.failOn -> security.policies.vulnerability.failOn
137
+ - security.audit.usage -> security.policies.vulnerability.usage
138
+
139
+ AcceptedRisk now carries optional policies[] and expiresAt fields so
140
+ risks can be scoped per-policy and time-boxed. Native PM sync writers
141
+ keep emitting pnpm-native field names since pnpm owns that schema.
142
+
143
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
144
+
145
+ * chore(vis): address coderabbit review feedback
146
+
147
+ - Add JSDoc to exported items across hook builtins, advisories, audit, docker
148
+ - Document OSV `last_affected` inclusive-upper semantics with a focused test
149
+ - Annotate NAPI u64→u32 truncations with JS Number range rationale
150
+ - Switch vis-mcp tool payloads to zod schemas with `.catchall(z.unknown())`
151
+ so unknown CLI fields stay forward-compatible
152
+ - Fence RFC code blocks with explicit languages and tidy hook-command
153
+ formatting (multi-line type, implicit-return arrows)
154
+
155
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
156
+
157
+ * chore(vis): address second-round coderabbit feedback on policies rename
158
+
159
+ - Drift report labels now reference `security.policies.*` paths so the
160
+ hint matches the keys users edit
161
+ - `defineConfig` JSDoc examples use the new `security.policies` shape
162
+ - `mergeSecurityDefaults` deep-merges every defaulted sub-policy
163
+ generically; `mergeVisConfigs` deep-merges `policies` and
164
+ `acceptedRisks` so presets aren't clobbered
165
+ - Config-writer scopes its `allow:` match to follow an
166
+ `install_scripts:` opener
167
+ - JSDoc clarifications for `audit.advisories.source` default,
168
+ `acceptedRisks.expiresAt`/`acceptedScore` ranges, `malware.mode`
169
+ cross-field default, and the current `policies.score.minimum`
170
+ wiring gap
171
+
172
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
173
+
174
+ * chore(vis): finish coderabbit round-2 fixes — camelCase policies + wire score.minimum
175
+
176
+ - Rename `PolicyName` union to camelCase (`firstSeen`, `installScripts`,
177
+ `publisherChange`, `unexpectedDeps`). Updates every consumer in src/,
178
+ test fixtures, schemas, and docs. JSON schema regenerated.
179
+ - Add `types` mapping to the `#native` package.json import so TypeScript
180
+ resolves `index.d.ts` when consumers import the alias.
181
+ - Thread `socketOptions.minimumScore` through `audit`, `doctor`, `check`,
182
+ `update`, `add`, `formatSecurityOverview`, `formatSummary`, and
183
+ `applyFilter`. `buildSocketOptions` now resolves the effective minimum
184
+ once (from `security.policies.score.minimum` or
185
+ `DEFAULT_LOW_SCORE_THRESHOLD`) so every consumer sees the same value
186
+ instead of comparing scores against the hard-coded constant.
187
+ - Update the JSDoc on `policies.score.minimum` to reflect the new wiring.
188
+
189
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
190
+
191
+ * feat(vis): add Socket-style policy engine with 4 offline-clean policies
192
+
193
+ Introduce a unified `evaluatePolicies()` engine under `src/security/policies/`
194
+ with four offline-clean modules: license, install_scripts, vulnerability,
195
+ and unexpected_deps (baseline mode). Each policy emits PolicyDecisions
196
+ (block/warn/info) keyed by package, with per-policy accepted-risk scoping
197
+ and expiresAt support reused from the shared matcher.
198
+
199
+ Wires the engine into `vis audit`: a new `--policies <names>` flag
200
+ (comma-list, `all`, or `none`) narrows evaluation. Block-severity
201
+ decisions feed into `--exit-code` and `--fail-on`. JSON output gains
202
+ `policies[]` + `summary.policyBlocks`. SARIF and HTML formatters render
203
+ policy decisions alongside vulnerabilities; CSAF and CycloneDX-VEX are
204
+ intentionally left untouched (vuln-specific data models).
205
+
206
+ Adds `readNodeModulesManifests()` to walk `node_modules/` (including the
207
+ pnpm `.pnpm/` content-addressed store) and surface license + scripts +
208
+ maintainers metadata for the offline policies.
209
+
210
+ 33 new unit + integration tests; full vitest suite (3582/3582) green;
211
+ `tsc --noEmit` clean.
212
+
213
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
214
+
215
+ * fix(vis): close three audit policy gating gaps surfaced by CodeRabbit
216
+
217
+ - applyExitGate's fallthrough call to applyFailOnGate was dropping the
218
+ policyDecisions argument, so `vis audit --format sarif --fail-on high`
219
+ exited 0 when the only signal was a block-severity policy decision.
220
+ Forward the argument.
221
+ - Unknown --policies tokens were silently swallowed when format was
222
+ json/sarif/csaf/cyclonedx-vex, so a typoed CI invocation reduced
223
+ enforcement with no log. Always emit the warning to stderr and
224
+ surface the tokens in JSON output as `warnings[]`.
225
+ - Vulnerability-policy block decisions whose advisory was masked by
226
+ --severity used to exit 1 with no visible reason. Surface those
227
+ decisions in the human-readable "Policy Decisions" section so the
228
+ gate is always traceable.
229
+
230
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
231
+
232
+ * fix(vis): correct npm/yarn min-release-age native config writers
233
+
234
+ npm CLI types `min-release-age` as `Number` in days, not a duration string —
235
+ vis wrote `48h`/`15m`, which npm's parseInt would silently read as 48/15 days.
236
+ Write integer days rounded up so the native gate is never weaker than vis-config.
237
+
238
+ Yarn Berry silently treats day suffixes in `npmMinimalAgeGate` as minutes
239
+
240
+ ### Features
241
+
242
+ * **vis:** offline OSV scanner + unified security.policies ([#632](https://github.com/visulima/visulima/issues/632)) ([6461902](https://github.com/visulima/visulima/commit/646190243bf51bb6df172665d70fd501644e7bc3)), closes [#631](https://github.com/visulima/visulima/issues/631) [#631](https://github.com/visulima/visulima/issues/631) [yarnpkg/berry#6991](https://github.com/yarnpkg/berry/issues/6991)
243
+
244
+
245
+ ### Dependencies
246
+
247
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.22
248
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.20
249
+
250
+ ## @visulima/vis-mcp [1.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.8...@visulima/vis-mcp@1.0.0-alpha.9) (2026-05-11)
251
+
252
+
253
+ ### Dependencies
254
+
255
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.21
256
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.19
257
+
258
+ ## @visulima/vis-mcp [1.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.7...@visulima/vis-mcp@1.0.0-alpha.8) (2026-05-11)
259
+
260
+
261
+ ### Dependencies
262
+
263
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.20
264
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.18
265
+
266
+ ## @visulima/vis-mcp [1.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.6...@visulima/vis-mcp@1.0.0-alpha.7) (2026-05-10)
267
+
268
+
269
+ ### Dependencies
270
+
271
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.19
272
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.17
273
+
274
+ ## @visulima/vis-mcp [1.0.0-alpha.6](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.5...@visulima/vis-mcp@1.0.0-alpha.6) (2026-05-10)
275
+
276
+
277
+ ### Dependencies
278
+
279
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.18
280
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.16
281
+
282
+ ## @visulima/vis-mcp [1.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.4...@visulima/vis-mcp@1.0.0-alpha.5) (2026-05-07)
283
+
284
+
285
+ ### Dependencies
286
+
287
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.17
288
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.15
289
+
290
+ ## @visulima/vis-mcp [1.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.3...@visulima/vis-mcp@1.0.0-alpha.4) (2026-05-07)
291
+
292
+ ### Miscellaneous Chores
293
+
294
+ * **vis-mcp:** bump eslint-plugin-zod and sort package.json keys ([787abc4](https://github.com/visulima/visulima/commit/787abc46e1b637fdb8968a492cd923537e404fbe))
295
+
296
+
297
+ ### Dependencies
298
+
299
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.16
300
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.14
301
+
302
+ ## @visulima/vis-mcp [1.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.2...@visulima/vis-mcp@1.0.0-alpha.3) (2026-05-06)
303
+
304
+
305
+ ### Dependencies
306
+
307
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.15
308
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.13
309
+
1
310
  ## @visulima/vis-mcp [1.0.0-alpha.2](https://github.com/visulima/visulima/compare/@visulima/vis-mcp@1.0.0-alpha.1...@visulima/vis-mcp@1.0.0-alpha.2) (2026-05-06)
2
311
 
3
312
  ### Miscellaneous Chores
package/dist/bin.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{startMcpServer as t}from"./packem_shared/registerAllTools-BOmyhKCR.js";try{await t()}catch(r){process.stderr.write(`[vis-mcp] failed to start: ${r instanceof Error?r.message:String(r)}
3
- `),process.exit(1)}
2
+ var i=Object.defineProperty;var a=(r,t)=>i(r,"name",{value:t,configurable:!0});import{argv as e}from"node:process";import{fileURLToPath as o}from"node:url";import{startMcpServer as s}from"./packem_shared/registerAllTools-BJu525kf.js";var m=Object.defineProperty,c=a((r,t)=>m(r,"name",{value:t,configurable:!0}),"t");const n=c(async()=>{try{await s()}catch(r){process.stderr.write(`[vis-mcp] failed to start: ${r instanceof Error?r.message:String(r)}
3
+ `),process.exit(1)}},"main"),p=e[1]!==void 0&&o(import.meta.url)===e[1];p&&await n();export{n as main};
package/dist/index.d.ts CHANGED
@@ -81,6 +81,12 @@ declare const createMcpServer: (context: ToolContext) => Promise<{
81
81
  * the JSON-RPC stream. Logs go to stderr only.
82
82
  */
83
83
  declare const startMcpServer: () => Promise<void>;
84
+ declare const registerAdvisoryStatus: ({
85
+ server
86
+ }: ToolDeps, context: ToolContext) => void;
87
+ declare const registerAudit: ({
88
+ server
89
+ }: ToolDeps, context: ToolContext) => void;
84
90
  declare const registerCacheHash: ({
85
91
  server
86
92
  }: ToolDeps, context: ToolContext) => void;
@@ -90,15 +96,27 @@ declare const registerCacheWhy: ({
90
96
  declare const registerDescribeProject: ({
91
97
  server
92
98
  }: ToolDeps, context: ToolContext) => void;
99
+ declare const registerDescribeTemplate: ({
100
+ server
101
+ }: ToolDeps, context: ToolContext) => void;
102
+ declare const registerFmt: ({
103
+ server
104
+ }: ToolDeps, context: ToolContext) => void;
93
105
  declare const registerGetRunLogs: ({
94
106
  server
95
107
  }: ToolDeps, context: ToolContext) => void;
108
+ declare const registerLint: ({
109
+ server
110
+ }: ToolDeps, context: ToolContext) => void;
96
111
  declare const registerListProjects: ({
97
112
  server
98
113
  }: ToolDeps, context: ToolContext) => void;
99
114
  declare const registerListTargets: ({
100
115
  server
101
116
  }: ToolDeps, context: ToolContext) => void;
117
+ declare const registerListTemplates: ({
118
+ server
119
+ }: ToolDeps, context: ToolContext) => void;
102
120
  declare const isValidRunId: (value: string) => boolean;
103
121
  /**
104
122
  * Task IDs are `&lt;project>:&lt;target>`; both halves are package or npm-scope
@@ -106,4 +124,4 @@ declare const isValidRunId: (value: string) => boolean;
106
124
  * inert, but a leading `-` would be parsed as a CLI flag by the vis CLI.
107
125
  */
108
126
  declare const isValidTaskId: (value: string) => boolean;
109
- export { type ExecOptions, type ExecResult, type McpToolResponse, type ToolContext, type ToolDeps, createMcpServer, errorResponse, execVis, execVisJson, isValidRunId, isValidTaskId, okResponse, registerAllTools, registerCacheHash, registerCacheWhy, registerDescribeProject, registerGetRunLogs, registerListProjects, registerListTargets, startMcpServer };
127
+ export { type ExecOptions, type ExecResult, type McpToolResponse, type ToolContext, type ToolDeps, createMcpServer, errorResponse, execVis, execVisJson, isValidRunId, isValidTaskId, okResponse, registerAdvisoryStatus, registerAllTools, registerAudit, registerCacheHash, registerCacheWhy, registerDescribeProject, registerDescribeTemplate, registerFmt, registerGetRunLogs, registerLint, registerListProjects, registerListTargets, registerListTemplates, startMcpServer };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{execVis as o,execVisJson as s}from"./packem_shared/execVis-BzS_F-9x.js";import{errorResponse as i,okResponse as p}from"./packem_shared/okResponse-DdzqnveW.js";import{createMcpServer as c,registerAllTools as f,startMcpServer as m}from"./packem_shared/registerAllTools-BOmyhKCR.js";import{registerCacheHash as g}from"./packem_shared/registerCacheHash-CVckSIVO.js";import{registerCacheWhy as n}from"./packem_shared/registerCacheWhy-BfIjli7n.js";import{registerDescribeProject as h}from"./packem_shared/registerDescribeProject-Dhuzun-I.js";import{registerGetRunLogs as V}from"./packem_shared/registerGetRunLogs-BxkRfYZU.js";import{registerListProjects as T}from"./packem_shared/registerListProjects-C-AZj8RT.js";import{registerListTargets as k}from"./packem_shared/registerListTargets-Cq6bkF7O.js";import{isValidRunId as v,isValidTaskId as C}from"./packem_shared/isValidRunId-BKsKMWQf.js";export{c as createMcpServer,i as errorResponse,o as execVis,s as execVisJson,v as isValidRunId,C as isValidTaskId,p as okResponse,f as registerAllTools,g as registerCacheHash,n as registerCacheWhy,h as registerDescribeProject,V as registerGetRunLogs,T as registerListProjects,k as registerListTargets,m as startMcpServer};
1
+ import{execVis as t,execVisJson as o}from"./packem_shared/execVis-xKkBGVtU.js";import{errorResponse as i,okResponse as p}from"./packem_shared/okResponse-DdzqnveW.js";import{createMcpServer as x,registerAllTools as f,startMcpServer as g}from"./packem_shared/registerAllTools-BJu525kf.js";import{registerAdvisoryStatus as c}from"./packem_shared/registerAdvisoryStatus-C49m3wzN.js";import{registerAudit as d}from"./packem_shared/registerAudit-CxOquZ97.js";import{registerCacheHash as L}from"./packem_shared/registerCacheHash-DLWsJrko.js";import{registerCacheWhy as h}from"./packem_shared/registerCacheWhy-B8xDR5US.js";import{registerDescribeProject as R}from"./packem_shared/registerDescribeProject-B6aCBcmT.js";import{registerDescribeTemplate as v}from"./packem_shared/registerDescribeTemplate-DUso-ASt.js";import{registerFmt as S}from"./packem_shared/registerFmt-CRzEDH2d.js";import{registerGetRunLogs as j}from"./packem_shared/registerGetRunLogs-BxkRfYZU.js";import{registerLint as y}from"./packem_shared/registerLint-BhuCzD64.js";import{registerListProjects as D}from"./packem_shared/registerListProjects-DSpQ596w.js";import{registerListTargets as M}from"./packem_shared/registerListTargets-B1AHgnI3.js";import{registerListTemplates as F}from"./packem_shared/registerListTemplates-qsRGPfj0.js";import{isValidRunId as H,isValidTaskId as J}from"./packem_shared/isValidRunId-BKsKMWQf.js";export{x as createMcpServer,i as errorResponse,t as execVis,o as execVisJson,H as isValidRunId,J as isValidTaskId,p as okResponse,c as registerAdvisoryStatus,f as registerAllTools,d as registerAudit,L as registerCacheHash,h as registerCacheWhy,R as registerDescribeProject,v as registerDescribeTemplate,S as registerFmt,j as registerGetRunLogs,y as registerLint,D as registerListProjects,M as registerListTargets,F as registerListTemplates,g as startMcpServer};
@@ -0,0 +1,4 @@
1
+ var O=Object.defineProperty;var w=(i,t)=>O(i,"name",{value:t,configurable:!0});import{spawn as g}from"node:child_process";var $=Object.defineProperty,p=w((i,t)=>$(i,"name",{value:t,configurable:!0}),"a");const v=12e4,j=p(async(i,t,r={})=>{const s=r.timeoutMs??v,e={};for(const[a,n]of Object.entries(process.env))n!==void 0&&(e[a]=n);if(r.env)for(const[a,n]of Object.entries(r.env))n!==void 0&&(e[a]=n);e.NO_COLOR="1";const x={cwd:r.cwd??process.cwd(),env:e,stdio:["ignore","pipe","pipe"],windowsHide:!0};return await new Promise((a,n)=>{const o=g(process.execPath,[i,...t],x);let u="",m="",f=!1,d;const l=setTimeout(()=>{f=!0,o.kill("SIGTERM"),d=setTimeout(()=>o.kill("SIGKILL"),2e3),d.unref()},s);o.stdout?.setEncoding("utf8"),o.stdout?.on("data",c=>{u+=c}),o.stderr?.setEncoding("utf8"),o.stderr?.on("data",c=>{m+=c}),o.once("error",c=>{clearTimeout(l),d&&clearTimeout(d),n(c)}),o.once("close",c=>{clearTimeout(l),d&&clearTimeout(d),a({exitCode:c??-1,stderr:m,stdout:u,timedOut:f})})})},"execVis"),T=p(async(i,t,r={})=>{const s=await j(i,t,r);if(s.timedOut)throw new Error(`vis ${t.join(" ")} timed out after ${String(r.timeoutMs??v)}ms`);if(s.exitCode!==0){const e=s.stderr.trim().split(`
2
+ `).slice(-5).join(`
3
+ `);throw new Error(`vis ${t.join(" ")} exited with code ${String(s.exitCode)}${e?`
4
+ ${e}`:""}`)}try{return JSON.parse(s.stdout)}catch(e){throw new Error(`vis ${t.join(" ")} did not emit valid JSON: ${e instanceof Error?e.message:String(e)}`,{cause:e})}},"execVisJson");export{j as execVis,T as execVisJson};
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var a=(t,s)=>c(t,"name",{value:s,configurable:!0});import*as e from"zod";import{execVisJson as d}from"./execVis-xKkBGVtU.js";import{okResponse as u,errorResponse as m}from"./okResponse-DdzqnveW.js";var l=Object.defineProperty,v=a((t,s)=>l(t,"name",{value:s,configurable:!0}),"a");const h=e.object({advisoryCount:e.number(),lastSyncIso:e.string(),manifestEtag:e.string().nullable(),name:e.string()}),p=e.object({dbPath:e.string(),ecosystems:e.array(h),exists:e.boolean(),schemaVersion:e.number(),sizeBytes:e.number()}).catchall(e.unknown()),g=v(({server:t},s)=>{t.registerTool("advisory_status",{annotations:{readOnlyHint:!0},description:"Report the local OSV advisory DB freshness via `vis advisories status --format json`: DB path, schema version, per-ecosystem advisory counts, last sync timestamp, and ETag. Use this to detect whether the offline cache is stale before running an `audit` in offline mode.",inputSchema:{db:e.string().min(1).optional().describe("Override the cache DB path (default: <cache>/vis/advisories/db.sqlite).")}},async o=>{try{const r=["advisories","status","--format","json"];o.db!==void 0&&r.push("--db",o.db);const i=await d(s.visBin,r,{cwd:s.workspaceRoot}),n=p.parse(i);return u(n)}catch(r){return m(r)}})},"registerAdvisoryStatus");export{g as registerAdvisoryStatus};
@@ -0,0 +1,3 @@
1
+ var g=Object.defineProperty;var l=(r,e)=>g(r,"name",{value:e,configurable:!0});import{readFile as d}from"node:fs/promises";import{createRequire as v}from"node:module";import{resolve as f,dirname as u}from"node:path";import{pathToFileURL as w,fileURLToPath as S}from"node:url";import{McpServer as b}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as h}from"@modelcontextprotocol/sdk/server/stdio.js";import{findUp as y}from"@visulima/fs";import{registerAdvisoryStatus as k}from"./registerAdvisoryStatus-C49m3wzN.js";import{registerAudit as j}from"./registerAudit-CxOquZ97.js";import{registerCacheHash as I}from"./registerCacheHash-DLWsJrko.js";import{registerCacheWhy as M}from"./registerCacheWhy-B8xDR5US.js";import{registerDescribeProject as T}from"./registerDescribeProject-B6aCBcmT.js";import{registerDescribeTemplate as _}from"./registerDescribeTemplate-DUso-ASt.js";import{registerFmt as C}from"./registerFmt-CRzEDH2d.js";import{registerGetRunLogs as L}from"./registerGetRunLogs-BxkRfYZU.js";import{registerLint as P}from"./registerLint-BhuCzD64.js";import{registerListProjects as R}from"./registerListProjects-DSpQ596w.js";import{registerListTargets as V}from"./registerListTargets-B1AHgnI3.js";import{registerListTemplates as A}from"./registerListTemplates-qsRGPfj0.js";var O=Object.defineProperty,i=l((r,e)=>O(r,"name",{value:e,configurable:!0}),"s");const q=i(r=>{const e=process.env.VIS_MCP_VIS_BIN;if(e)return f(e);const t=[{label:r,require:v(w(`${r}/package.json`))},{label:"vis-mcp install location",require:v(import.meta.url)}],a=[];let n,o;for(const{label:c,require:s}of t)try{n=s.resolve("@visulima/vis/package.json"),o=s("@visulima/vis/package.json");break}catch(m){a.push({error:m,label:c})}if(!n||!o){const c=a.at(-1)?.error,s=a.map(m=>m.label).join(", ");throw new Error(`Cannot resolve \`@visulima/vis\` (tried: ${s}). Install it as a workspace dependency, or set VIS_MCP_VIS_BIN to a vis CLI path.`,{cause:c})}const p=typeof o.bin=="string"?o.bin:o.bin?.vis;if(!p)throw new Error("`@visulima/vis` is installed but does not declare a `vis` bin entry — install a current version.");return f(u(n),p)},"resolveVisBin"),B=i(async()=>{try{const r=await y("package.json",{cwd:u(S(import.meta.url))});return r?JSON.parse(await d(r,"utf8")).version??"0.0.0":"0.0.0"}catch(r){return process.stderr.write(`[vis-mcp] failed to read package.json: ${r instanceof Error?r.message:String(r)}
2
+ `),"0.0.0"}},"loadVersion"),E=i((r,e)=>{R(r,e),T(r,e),V(r,e),A(r,e),_(r,e),L(r,e),M(r,e),I(r,e),j(r,e),k(r,e),P(r,e),C(r,e)},"registerAllTools"),$=i(async r=>{const e=new b({name:"vis",version:await B()}),t={server:e};return E(t,r),{deps:t,server:e}},"createMcpServer"),sr=i(async()=>{const r=process.env.VIS_MCP_WORKSPACE_ROOT??process.cwd(),e={visBin:q(r),workspaceRoot:r},{server:t}=await $(e);await t.connect(new h),process.stderr.write(`[vis-mcp] ready (workspace: ${e.workspaceRoot})
3
+ `)},"startMcpServer");export{$ as createMcpServer,E as registerAllTools,sr as startMcpServer};
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var i=(s,r)=>c(s,"name",{value:r,configurable:!0});import*as e from"zod";import{execVisJson as l}from"./execVis-xKkBGVtU.js";import{okResponse as p,errorResponse as u}from"./okResponse-DdzqnveW.js";var d=Object.defineProperty,m=i((s,r)=>d(s,"name",{value:r,configurable:!0}),"a");const y=e.object({fixedVersions:e.array(e.string()).optional(),id:e.string(),severity:e.string(),summary:e.string().optional()}),h=e.object({acceptedRisk:e.unknown().optional(),name:e.string(),socketAlerts:e.array(e.unknown()).optional(),socketScore:e.number().nullable().optional(),version:e.string(),vulnerabilities:e.array(y)}),b=e.object({duplicates:e.array(e.object({name:e.string(),versionCount:e.number(),versions:e.array(e.string())})),packages:e.number(),results:e.array(h),summary:e.object({accepted:e.number(),duplicatePackages:e.number(),issues:e.number(),total:e.number()})}).catchall(e.unknown()),f=["low","medium","high","critical"],w=m(({server:s},r)=>{s.registerTool("audit",{annotations:{readOnlyHint:!0},description:"Audit installed packages for known vulnerabilities and supply-chain risk via `vis audit --format json`. Defaults to the local offline OSV cache when one exists, otherwise falls back to the live OSV API. Returns the parsed audit payload (results, duplicates, summary).",inputSchema:{ecosystem:e.string().optional().describe("Comma-separated OSV ecosystems to scan. Defaults to 'npm' (the only matcher wired today)."),offline:e.boolean().optional().describe("Force the local OSV cache. Errors if the cache is missing — run `vis advisories sync` first."),prodOnly:e.boolean().optional().describe("Skip devDependencies — scan the production graph only."),severity:e.enum(f).optional().describe("Minimum severity to report. Defaults to 'low'."),showAccepted:e.boolean().optional().describe("Include findings already on the workspace's accepted-risk list."),usage:e.boolean().optional().describe("Apply the reachability filter — only report vulnerabilities in statically-imported packages.")}},async o=>{try{const t=["audit","--format","json"];o.severity&&t.push("--severity",o.severity),o.offline&&t.push("--offline"),o.prodOnly&&t.push("--prod-only"),o.usage&&t.push("--usage"),o.ecosystem&&t.push("--ecosystem",o.ecosystem),o.showAccepted&&t.push("--show-accepted");const a=await l(r.visBin,t,{cwd:r.workspaceRoot}),n=b.parse(a);return p(n)}catch(t){return u(t)}})},"registerAudit");export{w as registerAudit};
@@ -1 +1 @@
1
- var d=Object.defineProperty;var s=(e,r)=>d(e,"name",{value:r,configurable:!0});import*as o from"zod";import{execVisJson as p}from"./execVis-BzS_F-9x.js";import{errorResponse as n,okResponse as u}from"./okResponse-DdzqnveW.js";import{isValidTaskId as h,isValidRunId as l}from"./isValidRunId-BKsKMWQf.js";var m=Object.defineProperty,f=s((e,r)=>m(e,"name",{value:r,configurable:!0}),"n");const b=f(({server:e},r)=>{e.registerTool("cache_hash",{annotations:{readOnlyHint:!0},description:"Print the recorded hash and per-input hash details for a task — the contributing inputs (command, nodes, runtime, implicitDeps) that produced it.",inputSchema:{runId:o.string().optional().describe("Run ID to inspect (default: latest)"),taskId:o.string().describe('Task ID like "@my/app:build"')}},async({runId:t,taskId:i})=>{if(!h(i))return n(new Error(`Invalid taskId "${i}". Expected "<project>:<target>".`));if(t!==void 0&&!l(t))return n(new Error(`Invalid runId "${t}". Expected filesystem-safe slug ([A-Za-z0-9_.-]).`));try{const a=["cache","hash",i,"--format=json"];t&&a.push("--run",t);const c=await p(r.visBin,a,{cwd:r.workspaceRoot});return u(c)}catch(a){return n(a)}})},"registerCacheHash");export{b as registerCacheHash};
1
+ var d=Object.defineProperty;var s=(e,r)=>d(e,"name",{value:r,configurable:!0});import*as o from"zod";import{execVisJson as p}from"./execVis-xKkBGVtU.js";import{errorResponse as n,okResponse as u}from"./okResponse-DdzqnveW.js";import{isValidTaskId as h,isValidRunId as l}from"./isValidRunId-BKsKMWQf.js";var m=Object.defineProperty,f=s((e,r)=>m(e,"name",{value:r,configurable:!0}),"n");const b=f(({server:e},r)=>{e.registerTool("cache_hash",{annotations:{readOnlyHint:!0},description:"Print the recorded hash and per-input hash details for a task — the contributing inputs (command, nodes, runtime, implicitDeps) that produced it.",inputSchema:{runId:o.string().optional().describe("Run ID to inspect (default: latest)"),taskId:o.string().describe('Task ID like "@my/app:build"')}},async({runId:t,taskId:i})=>{if(!h(i))return n(new Error(`Invalid taskId "${i}". Expected "<project>:<target>".`));if(t!==void 0&&!l(t))return n(new Error(`Invalid runId "${t}". Expected filesystem-safe slug ([A-Za-z0-9_.-]).`));try{const a=["cache","hash",i,"--format=json"];t&&a.push("--run",t);const c=await p(r.visBin,a,{cwd:r.workspaceRoot});return u(c)}catch(a){return n(a)}})},"registerCacheHash");export{b as registerCacheHash};
@@ -1 +1 @@
1
- var d=Object.defineProperty;var n=(r,e)=>d(r,"name",{value:e,configurable:!0});import*as o from"zod";import{execVisJson as p}from"./execVis-BzS_F-9x.js";import{errorResponse as i,okResponse as u}from"./okResponse-DdzqnveW.js";import{isValidTaskId as h,isValidRunId as l}from"./isValidRunId-BKsKMWQf.js";var m=Object.defineProperty,f=n((r,e)=>m(r,"name",{value:e,configurable:!0}),"i");const w=f(({server:r},e)=>{r.registerTool("cache_why",{annotations:{readOnlyHint:!0},description:"Explain why a task's cache hash rotated between runs. Diffs the task's hashDetails (command, nodes, runtime, implicitDeps) against the previous run to pinpoint what changed.",inputSchema:{runId:o.string().optional().describe("Run ID to inspect (default: latest)"),taskId:o.string().describe('Task ID like "@my/app:build"')}},async({runId:t,taskId:s})=>{if(!h(s))return i(new Error(`Invalid taskId "${s}". Expected "<project>:<target>".`));if(t!==void 0&&!l(t))return i(new Error(`Invalid runId "${t}". Expected filesystem-safe slug ([A-Za-z0-9_.-]).`));try{const a=["cache","why",s,"--format=json"];t&&a.push("--run",t);const c=await p(e.visBin,a,{cwd:e.workspaceRoot});return u(c)}catch(a){return i(a)}})},"registerCacheWhy");export{w as registerCacheWhy};
1
+ var d=Object.defineProperty;var n=(r,e)=>d(r,"name",{value:e,configurable:!0});import*as o from"zod";import{execVisJson as p}from"./execVis-xKkBGVtU.js";import{errorResponse as i,okResponse as u}from"./okResponse-DdzqnveW.js";import{isValidTaskId as h,isValidRunId as l}from"./isValidRunId-BKsKMWQf.js";var m=Object.defineProperty,f=n((r,e)=>m(r,"name",{value:e,configurable:!0}),"i");const w=f(({server:r},e)=>{r.registerTool("cache_why",{annotations:{readOnlyHint:!0},description:"Explain why a task's cache hash rotated between runs. Diffs the task's hashDetails (command, nodes, runtime, implicitDeps) against the previous run to pinpoint what changed.",inputSchema:{runId:o.string().optional().describe("Run ID to inspect (default: latest)"),taskId:o.string().describe('Task ID like "@my/app:build"')}},async({runId:t,taskId:a})=>{if(!h(a))return i(new Error(`Invalid taskId "${a}". Expected "<project>:<target>".`));if(t!==void 0&&!l(t))return i(new Error(`Invalid runId "${t}". Expected filesystem-safe slug ([A-Za-z0-9_.-]).`));try{const s=["cache","why",a,"--format=json"];t&&s.push("--run",t);const c=await p(e.visBin,s,{cwd:e.workspaceRoot});return u(c)}catch(s){return i(s)}})},"registerCacheWhy");export{w as registerCacheWhy};
@@ -1 +1 @@
1
- var i=Object.defineProperty;var a=(r,e)=>i(r,"name",{value:e,configurable:!0});import*as c from"zod";import{execVisJson as p}from"./execVis-BzS_F-9x.js";import{okResponse as l,errorResponse as s}from"./okResponse-DdzqnveW.js";var m=Object.defineProperty,g=a((r,e)=>m(r,"name",{value:e,configurable:!0}),"n");const b=g(({server:r},e)=>{r.registerTool("describe_project",{annotations:{readOnlyHint:!0},description:"Return full metadata for a single workspace project: language, layer, stack, type, tags, root path, and all targets.",inputSchema:{name:c.string().describe('Project name (e.g. "@visulima/cerebro")')}},async({name:o})=>{try{const t=(await p(e.visBin,["list","--json"],{cwd:e.workspaceRoot})).find(n=>n.name===o);return t?l(t):s(new Error(`No project named "${o}". Use list_projects to see available names.`))}catch(t){return s(t)}})},"registerDescribeProject");export{b as registerDescribeProject};
1
+ var i=Object.defineProperty;var a=(r,e)=>i(r,"name",{value:e,configurable:!0});import*as c from"zod";import{execVisJson as p}from"./execVis-xKkBGVtU.js";import{okResponse as l,errorResponse as s}from"./okResponse-DdzqnveW.js";var m=Object.defineProperty,g=a((r,e)=>m(r,"name",{value:e,configurable:!0}),"n");const b=g(({server:r},e)=>{r.registerTool("describe_project",{annotations:{readOnlyHint:!0},description:"Return full metadata for a single workspace project: language, layer, stack, type, tags, root path, and all targets.",inputSchema:{name:c.string().describe('Project name (e.g. "@visulima/cerebro")')}},async({name:o})=>{try{const t=(await p(e.visBin,["list","--json"],{cwd:e.workspaceRoot})).find(n=>n.name===o);return t?l(t):s(new Error(`No project named "${o}". Use list_projects to see available names.`))}catch(t){return s(t)}})},"registerDescribeProject");export{b as registerDescribeProject};
@@ -0,0 +1 @@
1
+ var s=Object.defineProperty;var a=(t,e)=>s(t,"name",{value:e,configurable:!0});import*as o from"zod";import{execVisJson as i}from"./execVis-xKkBGVtU.js";import{okResponse as c,errorResponse as m}from"./okResponse-DdzqnveW.js";var l=Object.defineProperty,p=a((t,e)=>l(t,"name",{value:e,configurable:!0}),"r");const g=p(({server:t},e)=>{t.registerTool("describe_template",{annotations:{readOnlyHint:!0},description:"Return full metadata for a scaffolding template: description, default destination, and the variable schema (name, type, default, required, prompt, enum values). Use this before suggesting a `vis generate` command so option values can be filled correctly.",inputSchema:{name:o.string().describe('Template name (e.g. "package", "component"). Use list_templates to see available names.')}},async({name:n})=>{try{const r=await i(e.visBin,["generate",n,"--describe","--json"],{cwd:e.workspaceRoot});return c(r)}catch(r){return m(r)}})},"registerDescribeTemplate");export{g as registerDescribeTemplate};
@@ -0,0 +1,4 @@
1
+ var m=Object.defineProperty;var l=(s,i)=>m(s,"name",{value:i,configurable:!0});import*as e from"zod";import{execVis as u}from"./execVis-xKkBGVtU.js";import{errorResponse as a,okResponse as f}from"./okResponse-DdzqnveW.js";var p=Object.defineProperty,h=l((s,i)=>p(s,"name",{value:i,configurable:!0}),"d");const g=e.object({adapter:e.string(),column:e.number().optional(),file:e.string(),fixable:e.boolean().optional(),line:e.number().optional(),message:e.string(),ruleId:e.string().optional(),severity:e.enum(["error","info","warning"])}).catchall(e.unknown()),v=e.object({adapter:e.string(),durationMs:e.number(),exitCode:e.number(),findingCount:e.number()}).catchall(e.unknown()),b=e.object({findings:e.array(g),mode:e.enum(["check","fix"]).optional(),runs:e.array(v)}).catchall(e.unknown()),x=h(({server:s},i)=>{s.registerTool("fmt",{annotations:{readOnlyHint:!0},description:"Run the vis fmt orchestrator in --check mode via `vis fmt --check --format json`. Auto-detects every installed formatter (oxfmt, biome, dprint, prettier, ruff-fmt, deno-fmt) and returns the merged { findings, runs } payload — each finding represents a file that would change. This tool never writes to disk; invoke `vis fmt` directly to apply the formatting.",inputSchema:{files:e.array(e.string()).optional().describe("Restrict the check to these files (relative to the workspace root). Empty/omitted = workspace-wide."),quiet:e.boolean().optional().describe("Suppress per-file logs (findings still flow through)."),since:e.string().optional().describe("Forward `--since <ref>` so only files changed vs `<ref>` are checked."),staged:e.boolean().optional().describe("Forward `--staged` so only files in the git index are checked.")}},async t=>{try{const r=["fmt","--check","--format","json"];t.quiet&&r.push("--quiet"),t.staged?r.push("--staged"):t.since!==void 0&&t.since.length>0&&r.push("--since",t.since),t.files&&t.files.length>0&&r.push(...t.files);const n=await u(i.visBin,r,{cwd:i.workspaceRoot});if(n.timedOut)return a(new Error("vis fmt timed out"));if(n.stdout.trim().length===0){const o=n.stderr.trim().split(`
2
+ `).slice(-5).join(`
3
+ `);return a(new Error(`vis fmt exited with code ${String(n.exitCode)} and no JSON output${o?`
4
+ ${o}`:""}`))}let c;try{c=JSON.parse(n.stdout)}catch(o){return a(new Error(`vis ${r.join(" ")} did not emit valid JSON: ${o instanceof Error?o.message:String(o)}`,{cause:o}))}const d=b.parse(c);return f({...d,exitCode:n.exitCode,mode:d.mode??"check"})}catch(r){return a(r)}})},"registerFmt");export{x as registerFmt};
@@ -0,0 +1,4 @@
1
+ var u=Object.defineProperty;var d=(s,r)=>u(s,"name",{value:r,configurable:!0});import*as e from"zod";import{execVis as p}from"./execVis-xKkBGVtU.js";import{errorResponse as a,okResponse as g}from"./okResponse-DdzqnveW.js";var m=Object.defineProperty,f=d((s,r)=>m(s,"name",{value:r,configurable:!0}),"d");const h=e.object({adapter:e.string(),column:e.number().optional(),endColumn:e.number().optional(),endLine:e.number().optional(),file:e.string(),fixable:e.boolean().optional(),line:e.number().optional(),message:e.string(),ruleId:e.string().optional(),severity:e.enum(["error","info","warning"])}).catchall(e.unknown()),b=e.object({adapter:e.string(),durationMs:e.number(),exitCode:e.number(),findingCount:e.number()}).catchall(e.unknown()),v=e.object({findings:e.array(h),runs:e.array(b)}).catchall(e.unknown()),k=f(({server:s},r)=>{s.registerTool("lint",{annotations:{readOnlyHint:!0},description:"Run the vis lint orchestrator in check-only mode via `vis lint --format json`. Auto-detects every installed linter (oxlint, biome, eslint, stylelint, ruff, markdownlint, shellcheck, deno-lint) and returns the merged { findings, runs } payload. This tool never applies fixes — invoke `vis lint --fix` directly for that.",inputSchema:{files:e.array(e.string()).optional().describe("Restrict the run to these files (relative to the workspace root). Empty/omitted = workspace-wide."),maxWarnings:e.int().nonnegative().optional().describe("Forward `--max-warnings N` to every adapter that supports it."),quiet:e.boolean().optional().describe("Suppress warning-severity findings (errors still flow through)."),since:e.string().optional().describe("Forward `--since <ref>` so only files changed vs `<ref>` are linted."),staged:e.boolean().optional().describe("Forward `--staged` so only files in the git index are linted.")}},async t=>{try{const i=["lint","--format","json"];t.quiet&&i.push("--quiet"),typeof t.maxWarnings=="number"&&i.push("--max-warnings",String(t.maxWarnings)),t.staged?i.push("--staged"):t.since!==void 0&&t.since.length>0&&i.push("--since",t.since),t.files&&t.files.length>0&&i.push(...t.files);const o=await p(r.visBin,i,{cwd:r.workspaceRoot});if(o.timedOut)return a(new Error("vis lint timed out"));if(o.stdout.trim().length===0){const n=o.stderr.trim().split(`
2
+ `).slice(-5).join(`
3
+ `);return a(new Error(`vis lint exited with code ${String(o.exitCode)} and no JSON output${n?`
4
+ ${n}`:""}`))}let l;try{l=JSON.parse(o.stdout)}catch(n){return a(new Error(`vis ${i.join(" ")} did not emit valid JSON: ${n instanceof Error?n.message:String(n)}`,{cause:n}))}const c=v.parse(l);return g({...c,exitCode:o.exitCode})}catch(i){return a(i)}})},"registerLint");export{k as registerLint};
@@ -1 +1 @@
1
- var n=Object.defineProperty;var i=(t,e)=>n(t,"name",{value:e,configurable:!0});import*as a from"zod";import{execVisJson as c}from"./execVis-BzS_F-9x.js";import{okResponse as p,errorResponse as l}from"./okResponse-DdzqnveW.js";var g=Object.defineProperty,u=i((t,e)=>g(t,"name",{value:e,configurable:!0}),"n");const f=u(({server:t},e)=>{t.registerTool("list_projects",{annotations:{readOnlyHint:!0},description:'List all workspace projects with their language, type, layer, tags, and target metadata. Optionally filter with a vis query string (e.g. "tag=frontend", "type=application").',inputSchema:{query:a.string().optional().describe('Filter projects by vis query string (e.g. "tag=frontend")')}},async({query:s})=>{try{const r=["list","--json"];s&&r.push("--query",s);const o=await c(e.visBin,r,{cwd:e.workspaceRoot});return p({count:o.length,projects:o})}catch(r){return l(r)}})},"registerListProjects");export{f as registerListProjects};
1
+ var n=Object.defineProperty;var i=(t,e)=>n(t,"name",{value:e,configurable:!0});import*as a from"zod";import{execVisJson as c}from"./execVis-xKkBGVtU.js";import{okResponse as p,errorResponse as l}from"./okResponse-DdzqnveW.js";var g=Object.defineProperty,u=i((t,e)=>g(t,"name",{value:e,configurable:!0}),"n");const f=u(({server:t},e)=>{t.registerTool("list_projects",{annotations:{readOnlyHint:!0},description:'List all workspace projects with their language, type, layer, tags, and target metadata. Optionally filter with a vis query string (e.g. "tag=frontend", "type=application").',inputSchema:{query:a.string().optional().describe('Filter projects by vis query string (e.g. "tag=frontend")')}},async({query:s})=>{try{const r=["list","--json"];s&&r.push("--query",s);const o=await c(e.visBin,r,{cwd:e.workspaceRoot});return p({count:o.length,projects:o})}catch(r){return l(r)}})},"registerListProjects");export{f as registerListProjects};
@@ -1 +1 @@
1
- var l=Object.defineProperty;var c=(t,e)=>l(t,"name",{value:e,configurable:!0});import*as g from"zod";import{execVisJson as m}from"./execVis-BzS_F-9x.js";import{errorResponse as p,okResponse as j}from"./okResponse-DdzqnveW.js";var u=Object.defineProperty,d=c((t,e)=>u(t,"name",{value:e,configurable:!0}),"c");const v=d(({server:t},e)=>{t.registerTool("list_targets",{annotations:{readOnlyHint:!0},description:"List per-target rows across the workspace: which targets each project exposes, with type, command, and description. Optionally narrow to a single project.",inputSchema:{project:g.string().optional().describe('Limit to one project (e.g. "@visulima/cerebro")')}},async({project:r})=>{try{const o=await m(e.visBin,["list","--targets","--json"],{cwd:e.workspaceRoot}),a=r?o.filter(s=>s.name===r):o;if(r&&a.length===0)return p(new Error(`No project named "${r}". Use list_projects to see available names.`));const n=a.flatMap(s=>(s.targets??[]).map(i=>({project:s.name,target:i.name,...i})));return j({count:n.length,targets:n})}catch(o){return p(o)}})},"registerListTargets");export{v as registerListTargets};
1
+ var l=Object.defineProperty;var c=(t,e)=>l(t,"name",{value:e,configurable:!0});import*as g from"zod";import{execVisJson as m}from"./execVis-xKkBGVtU.js";import{errorResponse as p,okResponse as j}from"./okResponse-DdzqnveW.js";var u=Object.defineProperty,d=c((t,e)=>u(t,"name",{value:e,configurable:!0}),"c");const v=d(({server:t},e)=>{t.registerTool("list_targets",{annotations:{readOnlyHint:!0},description:"List per-target rows across the workspace: which targets each project exposes, with type, command, and description. Optionally narrow to a single project.",inputSchema:{project:g.string().optional().describe('Limit to one project (e.g. "@visulima/cerebro")')}},async({project:r})=>{try{const o=await m(e.visBin,["list","--targets","--json"],{cwd:e.workspaceRoot}),a=r?o.filter(s=>s.name===r):o;if(r&&a.length===0)return p(new Error(`No project named "${r}". Use list_projects to see available names.`));const n=a.flatMap(s=>(s.targets??[]).map(i=>({...i,project:s.name,target:i.name})));return j({count:n.length,targets:n})}catch(o){return p(o)}})},"registerListTargets");export{v as registerListTargets};
@@ -0,0 +1 @@
1
+ var n=Object.defineProperty;var r=(t,e)=>n(t,"name",{value:e,configurable:!0});import{execVisJson as o}from"./execVis-xKkBGVtU.js";import{okResponse as i,errorResponse as a}from"./okResponse-DdzqnveW.js";var c=Object.defineProperty,p=r((t,e)=>c(t,"name",{value:e,configurable:!0}),"n");const u=p(({server:t},e)=>{t.registerTool("list_templates",{annotations:{readOnlyHint:!0},description:"List scaffolding templates discovered in the workspace (`.vis/templates/`, `.moon/templates/`, and `vis.config.ts` `generator.templates`). Each entry includes name, source, on-disk path, and one-line description.",inputSchema:{}},async()=>{try{const s=await o(e.visBin,["generate","--list","--json"],{cwd:e.workspaceRoot});return i({count:s.length,templates:s})}catch(s){return a(s)}})},"registerListTemplates");export{u as registerListTemplates};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/vis-mcp",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.20",
4
4
  "description": "MCP (Model Context Protocol) server for @visulima/vis — exposes vis tooling to AI agents over stdio",
5
5
  "keywords": [
6
6
  "agent",
@@ -14,14 +14,7 @@
14
14
  "visulima"
15
15
  ],
16
16
  "homepage": "https://visulima.com/packages/vis-mcp",
17
- "bugs": {
18
- "url": "https://github.com/visulima/visulima/issues"
19
- },
20
- "license": "MIT",
21
- "author": {
22
- "name": "Daniel Bannert",
23
- "email": "d.bannert@anolilab.de"
24
- },
17
+ "bugs": "https://github.com/visulima/visulima/issues",
25
18
  "repository": {
26
19
  "type": "git",
27
20
  "url": "git+https://github.com/visulima/visulima.git",
@@ -37,17 +30,13 @@
37
30
  "url": "https://anolilab.com/support"
38
31
  }
39
32
  ],
40
- "bin": {
41
- "vis-mcp": "./dist/bin.js"
33
+ "license": "MIT",
34
+ "author": {
35
+ "name": "Daniel Bannert",
36
+ "email": "d.bannert@anolilab.de"
42
37
  },
43
- "files": [
44
- "dist/**",
45
- "README.md",
46
- "CHANGELOG.md",
47
- "LICENSE.md"
48
- ],
49
- "type": "module",
50
38
  "sideEffects": false,
39
+ "type": "module",
51
40
  "exports": {
52
41
  ".": {
53
42
  "types": "./dist/index.d.ts",
@@ -55,20 +44,29 @@
55
44
  },
56
45
  "./package.json": "./package.json"
57
46
  },
58
- "publishConfig": {
59
- "access": "public",
60
- "provenance": true
47
+ "bin": {
48
+ "vis-mcp": "./dist/bin.js"
61
49
  },
50
+ "files": [
51
+ "dist/**",
52
+ "README.md",
53
+ "CHANGELOG.md",
54
+ "LICENSE.md"
55
+ ],
62
56
  "dependencies": {
63
57
  "@modelcontextprotocol/sdk": "^1.29.0",
64
- "@visulima/fs": "5.0.0-alpha.14",
65
- "@visulima/path": "3.0.0-alpha.10",
58
+ "@visulima/fs": "5.0.0-alpha.31",
59
+ "@visulima/path": "3.0.0-alpha.12",
66
60
  "zod": "4.4.3"
67
61
  },
68
62
  "peerDependencies": {
69
- "@visulima/vis": "1.0.0-alpha.12"
63
+ "@visulima/vis": "1.0.0-alpha.30"
70
64
  },
71
65
  "engines": {
72
66
  "node": "^22.14.0 || >=24.10.0"
67
+ },
68
+ "publishConfig": {
69
+ "access": "public",
70
+ "provenance": true
73
71
  }
74
72
  }
@@ -1,4 +0,0 @@
1
- var x=Object.defineProperty;var m=(i,e)=>x(i,"name",{value:e,configurable:!0});import{spawn as v}from"node:child_process";var g=Object.defineProperty,w=m((i,e)=>g(i,"name",{value:e,configurable:!0}),"c");const l=12e4,O=w(async(i,e,n={})=>{const o=n.timeoutMs??l,t={cwd:n.cwd??process.cwd(),env:{...process.env,...n.env,NO_COLOR:"1"},stdio:["ignore","pipe","pipe"],windowsHide:!0};return await new Promise((p,f)=>{const r=v(process.execPath,[i,...e],t);let c="",d="",a=!1;const u=setTimeout(()=>{a=!0,r.kill("SIGTERM"),setTimeout(()=>r.kill("SIGKILL"),2e3).unref()},o);r.stdout?.setEncoding("utf8"),r.stdout?.on("data",s=>{c+=s}),r.stderr?.setEncoding("utf8"),r.stderr?.on("data",s=>{d+=s}),r.once("error",s=>{clearTimeout(u),f(s)}),r.once("close",s=>{clearTimeout(u),p({exitCode:s??-1,stderr:d,stdout:c,timedOut:a})})})},"execVis"),S=w(async(i,e,n={})=>{const o=await O(i,e,n);if(o.timedOut)throw new Error(`vis ${e.join(" ")} timed out after ${String(n.timeoutMs??l)}ms`);if(o.exitCode!==0){const t=o.stderr.trim().split(`
2
- `).slice(-5).join(`
3
- `);throw new Error(`vis ${e.join(" ")} exited with code ${String(o.exitCode)}${t?`
4
- ${t}`:""}`)}try{return JSON.parse(o.stdout)}catch(t){throw new Error(`vis ${e.join(" ")} did not emit valid JSON: ${t instanceof Error?t.message:String(t)}`,{cause:t})}},"execVisJson");export{O as execVis,S as execVisJson};
@@ -1,3 +0,0 @@
1
- var u=Object.defineProperty;var i=(e,r)=>u(e,"name",{value:r,configurable:!0});import{readFile as f}from"node:fs/promises";import{createRequire as g}from"node:module";import{resolve as c,dirname as p}from"node:path";import{pathToFileURL as w,fileURLToPath as h}from"node:url";import{McpServer as y}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as b}from"@modelcontextprotocol/sdk/server/stdio.js";import{findUp as S}from"@visulima/fs";import{registerCacheHash as k}from"./registerCacheHash-CVckSIVO.js";import{registerCacheWhy as T}from"./registerCacheWhy-BfIjli7n.js";import{registerDescribeProject as R}from"./registerDescribeProject-Dhuzun-I.js";import*as _ from"zod";import{execVisJson as m}from"./execVis-BzS_F-9x.js";import{okResponse as l,errorResponse as v}from"./okResponse-DdzqnveW.js";import{registerGetRunLogs as j}from"./registerGetRunLogs-BxkRfYZU.js";import{registerListProjects as I}from"./registerListProjects-C-AZj8RT.js";import{registerListTargets as P}from"./registerListTargets-Cq6bkF7O.js";var L=Object.defineProperty,O=i((e,r)=>L(e,"name",{value:r,configurable:!0}),"r");const C=O(({server:e},r)=>{e.registerTool("describe_template",{annotations:{readOnlyHint:!0},description:"Return full metadata for a scaffolding template: description, default destination, and the variable schema (name, type, default, required, prompt, enum values). Use this before suggesting a `vis generate` command so option values can be filled correctly.",inputSchema:{name:_.string().describe('Template name (e.g. "package", "component"). Use list_templates to see available names.')}},async({name:t})=>{try{const s=await m(r.visBin,["generate",t,"--describe","--json"],{cwd:r.workspaceRoot});return l(s)}catch(s){return v(s)}})},"registerDescribeTemplate");var M=Object.defineProperty,V=i((e,r)=>M(e,"name",{value:r,configurable:!0}),"n");const B=V(({server:e},r)=>{e.registerTool("list_templates",{annotations:{readOnlyHint:!0},description:"List scaffolding templates discovered in the workspace (`.vis/templates/`, `.moon/templates/`, and `vis.config.ts` `generator.templates`). Each entry includes name, source, on-disk path, and one-line description.",inputSchema:{}},async()=>{try{const t=await m(r.visBin,["generate","--list","--json"],{cwd:r.workspaceRoot});return l({count:t.length,templates:t})}catch(t){return v(t)}})},"registerListTemplates");var E=Object.defineProperty,o=i((e,r)=>E(e,"name",{value:r,configurable:!0}),"s");const U=o(e=>{const r=process.env.VIS_MCP_VIS_BIN;if(r)return c(r);const t=g(w(`${e}/package.json`));let s,a;try{s=t.resolve("@visulima/vis/package.json"),a=t("@visulima/vis/package.json")}catch(d){throw new Error(`Cannot resolve \`@visulima/vis\` from ${e}. Install it as a workspace dependency, or set VIS_MCP_VIS_BIN to a vis CLI path.`,{cause:d})}const n=typeof a.bin=="string"?a.bin:a.bin?.vis;if(!n)throw new Error("`@visulima/vis` is installed but does not declare a `vis` bin entry — install a current version.");return c(p(s),n)},"resolveVisBin"),$=o(async()=>{try{const e=await S("package.json",{cwd:p(h(import.meta.url))});return e?JSON.parse(await f(e,"utf8")).version??"0.0.0":"0.0.0"}catch(e){return process.stderr.write(`[vis-mcp] failed to read package.json: ${e instanceof Error?e.message:String(e)}
2
- `),"0.0.0"}},"loadVersion"),A=o((e,r)=>{I(e,r),R(e,r),P(e,r),B(e,r),C(e,r),j(e,r),T(e,r),k(e,r)},"registerAllTools"),D=o(async e=>{const r=new y({name:"vis",version:await $()}),t={server:r};return A(t,e),{deps:t,server:r}},"createMcpServer"),te=o(async()=>{const e=process.env.VIS_MCP_WORKSPACE_ROOT??process.cwd(),r={visBin:U(e),workspaceRoot:e},{server:t}=await D(r);await t.connect(new b),process.stderr.write(`[vis-mcp] ready (workspace: ${r.workspaceRoot})
3
- `)},"startMcpServer");export{D as createMcpServer,A as registerAllTools,te as startMcpServer};