@visulima/vis-mcp 1.0.0-alpha.1 → 1.0.0-alpha.10

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,203 @@
1
+ ## @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)
2
+
3
+ ### ⚠ BREAKING CHANGES
4
+
5
+ * **vis:** the following security.* keys were renamed:
6
+ - security.minimumReleaseAge -> security.policies.first_seen.minutes
7
+ - security.minimumReleaseAgeExclude -> security.policies.first_seen.exclude
8
+ - security.trustPolicy -> security.policies.publisher_change.mode
9
+ - security.trustPolicyExclude -> security.policies.publisher_change.exclude
10
+ - security.trustPolicyIgnoreAfter -> security.policies.publisher_change.ignoreAfter
11
+ - security.allowBuilds -> security.policies.install_scripts.allow
12
+ - security.strictDepBuilds -> security.policies.install_scripts.strict
13
+ - security.socket.minimumScore -> security.policies.score.minimum
14
+ - security.socket.acceptedRisks -> security.acceptedRisks
15
+ - security.audit.failOn -> security.policies.vulnerability.failOn
16
+ - security.audit.usage -> security.policies.vulnerability.usage
17
+
18
+ AcceptedRisk now carries optional policies[] and expiresAt fields so
19
+ risks can be scoped per-policy and time-boxed. Native PM sync writers
20
+ keep emitting pnpm-native field names since pnpm owns that schema.
21
+
22
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
23
+
24
+ * chore(vis): address coderabbit review feedback
25
+
26
+ - Add JSDoc to exported items across hook builtins, advisories, audit, docker
27
+ - Document OSV `last_affected` inclusive-upper semantics with a focused test
28
+ - Annotate NAPI u64→u32 truncations with JS Number range rationale
29
+ - Switch vis-mcp tool payloads to zod schemas with `.catchall(z.unknown())`
30
+ so unknown CLI fields stay forward-compatible
31
+ - Fence RFC code blocks with explicit languages and tidy hook-command
32
+ formatting (multi-line type, implicit-return arrows)
33
+
34
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
35
+
36
+ * chore(vis): address second-round coderabbit feedback on policies rename
37
+
38
+ - Drift report labels now reference `security.policies.*` paths so the
39
+ hint matches the keys users edit
40
+ - `defineConfig` JSDoc examples use the new `security.policies` shape
41
+ - `mergeSecurityDefaults` deep-merges every defaulted sub-policy
42
+ generically; `mergeVisConfigs` deep-merges `policies` and
43
+ `acceptedRisks` so presets aren't clobbered
44
+ - Config-writer scopes its `allow:` match to follow an
45
+ `install_scripts:` opener
46
+ - JSDoc clarifications for `audit.advisories.source` default,
47
+ `acceptedRisks.expiresAt`/`acceptedScore` ranges, `malware.mode`
48
+ cross-field default, and the current `policies.score.minimum`
49
+ wiring gap
50
+
51
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
52
+
53
+ * chore(vis): finish coderabbit round-2 fixes — camelCase policies + wire score.minimum
54
+
55
+ - Rename `PolicyName` union to camelCase (`firstSeen`, `installScripts`,
56
+ `publisherChange`, `unexpectedDeps`). Updates every consumer in src/,
57
+ test fixtures, schemas, and docs. JSON schema regenerated.
58
+ - Add `types` mapping to the `#native` package.json import so TypeScript
59
+ resolves `index.d.ts` when consumers import the alias.
60
+ - Thread `socketOptions.minimumScore` through `audit`, `doctor`, `check`,
61
+ `update`, `add`, `formatSecurityOverview`, `formatSummary`, and
62
+ `applyFilter`. `buildSocketOptions` now resolves the effective minimum
63
+ once (from `security.policies.score.minimum` or
64
+ `DEFAULT_LOW_SCORE_THRESHOLD`) so every consumer sees the same value
65
+ instead of comparing scores against the hard-coded constant.
66
+ - Update the JSDoc on `policies.score.minimum` to reflect the new wiring.
67
+
68
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
69
+
70
+ * feat(vis): add Socket-style policy engine with 4 offline-clean policies
71
+
72
+ Introduce a unified `evaluatePolicies()` engine under `src/security/policies/`
73
+ with four offline-clean modules: license, install_scripts, vulnerability,
74
+ and unexpected_deps (baseline mode). Each policy emits PolicyDecisions
75
+ (block/warn/info) keyed by package, with per-policy accepted-risk scoping
76
+ and expiresAt support reused from the shared matcher.
77
+
78
+ Wires the engine into `vis audit`: a new `--policies <names>` flag
79
+ (comma-list, `all`, or `none`) narrows evaluation. Block-severity
80
+ decisions feed into `--exit-code` and `--fail-on`. JSON output gains
81
+ `policies[]` + `summary.policyBlocks`. SARIF and HTML formatters render
82
+ policy decisions alongside vulnerabilities; CSAF and CycloneDX-VEX are
83
+ intentionally left untouched (vuln-specific data models).
84
+
85
+ Adds `readNodeModulesManifests()` to walk `node_modules/` (including the
86
+ pnpm `.pnpm/` content-addressed store) and surface license + scripts +
87
+ maintainers metadata for the offline policies.
88
+
89
+ 33 new unit + integration tests; full vitest suite (3582/3582) green;
90
+ `tsc --noEmit` clean.
91
+
92
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
93
+
94
+ * fix(vis): close three audit policy gating gaps surfaced by CodeRabbit
95
+
96
+ - applyExitGate's fallthrough call to applyFailOnGate was dropping the
97
+ policyDecisions argument, so `vis audit --format sarif --fail-on high`
98
+ exited 0 when the only signal was a block-severity policy decision.
99
+ Forward the argument.
100
+ - Unknown --policies tokens were silently swallowed when format was
101
+ json/sarif/csaf/cyclonedx-vex, so a typoed CI invocation reduced
102
+ enforcement with no log. Always emit the warning to stderr and
103
+ surface the tokens in JSON output as `warnings[]`.
104
+ - Vulnerability-policy block decisions whose advisory was masked by
105
+ --severity used to exit 1 with no visible reason. Surface those
106
+ decisions in the human-readable "Policy Decisions" section so the
107
+ gate is always traceable.
108
+
109
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
110
+
111
+ * fix(vis): correct npm/yarn min-release-age native config writers
112
+
113
+ npm CLI types `min-release-age` as `Number` in days, not a duration string —
114
+ vis wrote `48h`/`15m`, which npm's parseInt would silently read as 48/15 days.
115
+ Write integer days rounded up so the native gate is never weaker than vis-config.
116
+
117
+ Yarn Berry silently treats day suffixes in `npmMinimalAgeGate` as minutes
118
+
119
+ ### Features
120
+
121
+ * **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)
122
+
123
+
124
+ ### Dependencies
125
+
126
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.22
127
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.20
128
+
129
+ ## @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)
130
+
131
+
132
+ ### Dependencies
133
+
134
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.21
135
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.19
136
+
137
+ ## @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)
138
+
139
+
140
+ ### Dependencies
141
+
142
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.20
143
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.18
144
+
145
+ ## @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)
146
+
147
+
148
+ ### Dependencies
149
+
150
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.19
151
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.17
152
+
153
+ ## @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)
154
+
155
+
156
+ ### Dependencies
157
+
158
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.18
159
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.16
160
+
161
+ ## @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)
162
+
163
+
164
+ ### Dependencies
165
+
166
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.17
167
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.15
168
+
169
+ ## @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)
170
+
171
+ ### Miscellaneous Chores
172
+
173
+ * **vis-mcp:** bump eslint-plugin-zod and sort package.json keys ([787abc4](https://github.com/visulima/visulima/commit/787abc46e1b637fdb8968a492cd923537e404fbe))
174
+
175
+
176
+ ### Dependencies
177
+
178
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.16
179
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.14
180
+
181
+ ## @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)
182
+
183
+
184
+ ### Dependencies
185
+
186
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.15
187
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.13
188
+
189
+ ## @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)
190
+
191
+ ### Miscellaneous Chores
192
+
193
+ * **vis-mcp:** housekeeping cleanup ([947eff5](https://github.com/visulima/visulima/commit/947eff503b5e170194f7f8e21bea2ab82b0786bf))
194
+
195
+
196
+ ### Dependencies
197
+
198
+ * **@visulima/fs:** upgraded to 5.0.0-alpha.14
199
+ * **@visulima/vis:** upgraded to 1.0.0-alpha.12
200
+
1
201
  ## @visulima/vis-mcp 1.0.0-alpha.1 (2026-05-04)
2
202
 
3
203
  ### Features
package/README.md CHANGED
@@ -87,16 +87,16 @@ Add the server to `~/Library/Application Support/Claude/claude_desktop_config.js
87
87
 
88
88
  All eight tools are read-only. The agent prepares commands; a human runs them.
89
89
 
90
- | Tool | What it does |
91
- | ------------------- | ------------------------------------------------------------------------------------------------------ |
92
- | `list_projects` | List all workspace projects, optionally filtered by a vis query string. |
93
- | `describe_project` | Return full metadata for one project (language, layer, stack, targets). |
94
- | `list_targets` | Flatten projects into per-target rows; optionally narrow to one project. |
95
- | `list_templates` | List scaffolding templates discovered in the workspace, with source and one-line description. |
96
- | `describe_template` | Return template metadata: description, default destination, and the variable schema for `vis generate`.|
97
- | `get_run_logs` | Read a run summary from `.task-runner/`; optionally filter to one task. |
98
- | `cache_why` | Diff a task's hash inputs against the previous run to explain a rotation. |
99
- | `cache_hash` | Print the recorded hash and per-input hash details for a task. |
90
+ | Tool | What it does |
91
+ | ------------------- | ------------------------------------------------------------------------------------------------------- |
92
+ | `list_projects` | List all workspace projects, optionally filtered by a vis query string. |
93
+ | `describe_project` | Return full metadata for one project (language, layer, stack, targets). |
94
+ | `list_targets` | Flatten projects into per-target rows; optionally narrow to one project. |
95
+ | `list_templates` | List scaffolding templates discovered in the workspace, with source and one-line description. |
96
+ | `describe_template` | Return template metadata: description, default destination, and the variable schema for `vis generate`. |
97
+ | `get_run_logs` | Read a run summary from `.task-runner/`; optionally filter to one task. |
98
+ | `cache_why` | Diff a task's hash inputs against the previous run to explain a rotation. |
99
+ | `cache_hash` | Print the recorded hash and per-input hash details for a task. |
100
100
 
101
101
  ## Related
102
102
 
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)}
2
+ import{startMcpServer as t}from"./packem_shared/registerAllTools-BIzixHAA.js";try{await t()}catch(r){process.stderr.write(`[vis-mcp] failed to start: ${r instanceof Error?r.message:String(r)}
3
3
  `),process.exit(1)}
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 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-BIzixHAA.js";import{registerCacheHash as g}from"./packem_shared/registerCacheHash-CVckSIVO.js";import{registerCacheWhy as n}from"./packem_shared/registerCacheWhy-CMzL-Pg3.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};
@@ -0,0 +1,3 @@
1
+ var y=Object.defineProperty;var n=(t,r)=>y(t,"name",{value:r,configurable:!0});import{readFile as g}from"node:fs/promises";import{createRequire as f}from"node:module";import{resolve as u,dirname as d}from"node:path";import{pathToFileURL as h,fileURLToPath as b}from"node:url";import{McpServer as w}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as k}from"@modelcontextprotocol/sdk/server/stdio.js";import{findUp as S}from"@visulima/fs";import*as e from"zod";import{execVisJson as l}from"./execVis-BzS_F-9x.js";import{okResponse as p,errorResponse as m}from"./okResponse-DdzqnveW.js";import{registerCacheHash as j}from"./registerCacheHash-CVckSIVO.js";import{registerCacheWhy as O}from"./registerCacheWhy-CMzL-Pg3.js";import{registerDescribeProject as R}from"./registerDescribeProject-Dhuzun-I.js";import{registerGetRunLogs as T}from"./registerGetRunLogs-BxkRfYZU.js";import{registerListProjects as P}from"./registerListProjects-C-AZj8RT.js";import{registerListTargets as V}from"./registerListTargets-Cq6bkF7O.js";var A=Object.defineProperty,_=n((t,r)=>A(t,"name",{value:r,configurable:!0}),"a$1");const B=e.object({advisoryCount:e.number(),lastSyncIso:e.string(),manifestEtag:e.string().nullable(),name:e.string()}),I=e.object({dbPath:e.string(),ecosystems:e.array(B),exists:e.boolean(),schemaVersion:e.number(),sizeBytes:e.number()}).catchall(e.unknown()),C=_(({server:t},r)=>{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 s=>{try{const a=["advisories","status","--format","json"];s.db!==void 0&&a.push("--db",s.db);const o=await l(r.visBin,a,{cwd:r.workspaceRoot}),i=I.parse(o);return p(i)}catch(a){return m(a)}})},"registerAdvisoryStatus");var D=Object.defineProperty,L=n((t,r)=>D(t,"name",{value:r,configurable:!0}),"a");const M=e.object({fixedVersions:e.array(e.string()).optional(),id:e.string(),severity:e.string(),summary:e.string().optional()}),E=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(M)}),$=e.object({duplicates:e.array(e.object({name:e.string(),versionCount:e.number(),versions:e.array(e.string())})),packages:e.number(),results:e.array(E),summary:e.object({accepted:e.number(),duplicatePackages:e.number(),issues:e.number(),total:e.number()})}).catchall(e.unknown()),U=["low","medium","high","critical"],x=L(({server:t},r)=>{t.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(U).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 s=>{try{const a=["audit","--format","json"];s.severity&&a.push("--severity",s.severity),s.offline&&a.push("--offline"),s.prodOnly&&a.push("--prod-only"),s.usage&&a.push("--usage"),s.ecosystem&&a.push("--ecosystem",s.ecosystem),s.showAccepted&&a.push("--show-accepted");const o=await l(r.visBin,a,{cwd:r.workspaceRoot}),i=$.parse(o);return p(i)}catch(a){return m(a)}})},"registerAudit");var H=Object.defineProperty,q=n((t,r)=>H(t,"name",{value:r,configurable:!0}),"r");const F=q(({server:t},r)=>{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:e.string().describe('Template name (e.g. "package", "component"). Use list_templates to see available names.')}},async({name:s})=>{try{const a=await l(r.visBin,["generate",s,"--describe","--json"],{cwd:r.workspaceRoot});return p(a)}catch(a){return m(a)}})},"registerDescribeTemplate");var N=Object.defineProperty,J=n((t,r)=>N(t,"name",{value:r,configurable:!0}),"n");const W=J(({server:t},r)=>{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 l(r.visBin,["generate","--list","--json"],{cwd:r.workspaceRoot});return p({count:s.length,templates:s})}catch(s){return m(s)}})},"registerListTemplates");var z=Object.defineProperty,c=n((t,r)=>z(t,"name",{value:r,configurable:!0}),"s");const G=c(t=>{const r=process.env.VIS_MCP_VIS_BIN;if(r)return u(r);const s=f(h(`${t}/package.json`));let a,o;try{a=s.resolve("@visulima/vis/package.json"),o=s("@visulima/vis/package.json")}catch(v){throw new Error(`Cannot resolve \`@visulima/vis\` from ${t}. Install it as a workspace dependency, or set VIS_MCP_VIS_BIN to a vis CLI path.`,{cause:v})}const i=typeof o.bin=="string"?o.bin:o.bin?.vis;if(!i)throw new Error("`@visulima/vis` is installed but does not declare a `vis` bin entry — install a current version.");return u(d(a),i)},"resolveVisBin"),K=c(async()=>{try{const t=await S("package.json",{cwd:d(b(import.meta.url))});return t?JSON.parse(await g(t,"utf8")).version??"0.0.0":"0.0.0"}catch(t){return process.stderr.write(`[vis-mcp] failed to read package.json: ${t instanceof Error?t.message:String(t)}
2
+ `),"0.0.0"}},"loadVersion"),Q=c((t,r)=>{P(t,r),R(t,r),V(t,r),W(t,r),F(t,r),T(t,r),O(t,r),j(t,r),x(t,r),C(t,r)},"registerAllTools"),X=c(async t=>{const r=new w({name:"vis",version:await K()}),s={server:r};return Q(s,t),{deps:s,server:r}},"createMcpServer"),ve=c(async()=>{const t=process.env.VIS_MCP_WORKSPACE_ROOT??process.cwd(),r={visBin:G(t),workspaceRoot:t},{server:s}=await X(r);await s.connect(new k),process.stderr.write(`[vis-mcp] ready (workspace: ${r.workspaceRoot})
3
+ `)},"startMcpServer");export{X as createMcpServer,Q as registerAllTools,ve as startMcpServer};
@@ -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-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: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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/vis-mcp",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.10",
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",
@@ -57,12 +57,12 @@
57
57
  ],
58
58
  "dependencies": {
59
59
  "@modelcontextprotocol/sdk": "^1.29.0",
60
- "@visulima/fs": "5.0.0-alpha.13",
60
+ "@visulima/fs": "5.0.0-alpha.22",
61
61
  "@visulima/path": "3.0.0-alpha.10",
62
62
  "zod": "4.4.3"
63
63
  },
64
64
  "peerDependencies": {
65
- "@visulima/vis": "1.0.0-alpha.11"
65
+ "@visulima/vis": "1.0.0-alpha.20"
66
66
  },
67
67
  "engines": {
68
68
  "node": "^22.14.0 || >=24.10.0"
@@ -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};