Skip to content

Commit 559696a

Browse files
committed
Initial MCP
1 parent 6acd628 commit 559696a

367 files changed

Lines changed: 76534 additions & 171 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/mcp-initial-beta.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@salt-ds/cli": minor
3+
"@salt-ds/mcp": minor
4+
---
5+
6+
Publish the initial beta release of the public Salt AI tooling packages.
7+
8+
- `@salt-ds/mcp` packages the canonical Salt Design System MCP server with the beta five-tool workflow surface for repo-aware Salt context, create, review, migrate, and upgrade guidance.
9+
- `@salt-ds/cli` packages the workflow CLI fallback and support surface with `init`, `info`, `create`, `review`, `migrate`, `upgrade`, `doctor`, and `runtime inspect`.
10+
11+
Treat both packages as beta while the workflow contract, generated registry artifacts, and consumer setup continue to settle.

.github/workflows/test.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,29 @@ jobs:
9292
cache: "yarn"
9393
- name: Install dependencies
9494
run: yarn
95+
- name: Generate site snapshot inputs
96+
run: yarn workspace @salt-ds/site gen:snapshot
9597
- run: yarn run test
98+
consumer-smoke:
99+
runs-on: ubuntu-latest
100+
steps:
101+
- name: Checkout
102+
uses: actions/checkout@v6
103+
- name: Use Node.js
104+
uses: actions/setup-node@v6
105+
with:
106+
node-version: "24"
107+
cache: "yarn"
108+
- name: Install dependencies
109+
run: yarn
110+
- name: Consumer smoke test
111+
run: yarn smoke:consumer
96112
cypress-tests:
97113
strategy:
98114
fail-fast: false
99115
matrix:
100116
react: [16, 17, 18]
101117
runs-on: ubuntu-latest
102-
container:
103-
image: cypress/browsers:node-22.14.0-chrome-133.0.6943.126-1-ff-135.0.1-edge-133.0.3065.82-1
104-
options: --user 1001
105118
steps:
106119
- name: Checkout
107120
uses: actions/checkout@v6

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,7 @@ yarn-error.log*
4848
/docs/css/salt-lab.css
4949
/docs/css/salt-countries.css
5050
/docs/css/salt-embla-carousel.css
51+
52+
# MCP registry
53+
54+
/packages/mcp/generated

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"lint:style:theme": "yarn stylelint -f verbose \"packages/theme/css/**/*.css\"",
4141
"storybook": "storybook dev -p 6006",
4242
"build-storybook": "yarn build:ag-grid-theme && yarn bundle:css && storybook build --stats-json",
43+
"smoke:consumer": "node ./scripts/consumerRepoSmoke.mjs",
4344
"typecheck": "tsc --noEmit",
4445
"chromatic": "chromatic"
4546
},

packages/cli/README.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# @salt-ds/cli
2+
3+
Salt Design System workflow CLI package.
4+
5+
Use this package as the published fallback/support transport behind `salt-ds` when MCP is blocked or when you need direct manual support/debug access.
6+
7+
Install options:
8+
9+
```sh
10+
npx -y @salt-ds/cli@latest info . --json
11+
npm install -g @salt-ds/cli
12+
```
13+
14+
After global install, use the `salt-ds` binary directly.
15+
16+
Primary workflow commands:
17+
18+
- `salt-ds init [rootDir]`
19+
- supports `--json`
20+
- supports `--output <path>`
21+
- supports `--registry-dir <path>`
22+
- supports `--project <name>`
23+
- supports `--conventions-pack [<package[#export]>]`
24+
- bootstraps `.salt/team.json` plus repo-local instructions for a new or newly-adopting repo without changing the workflow model
25+
- can optionally scaffold a starter `.salt/stack.json` for repos using a shared conventions pack
26+
- `salt-ds info [rootDir]`
27+
- supports `--json`
28+
- supports `--output <path>`
29+
- supports `--registry-dir <path>`
30+
- reports detected repo context, declared Salt policy, runtime signals, and workflow capabilities
31+
- `salt-ds create <query>`
32+
- supports `--json`
33+
- supports `--output <path>`
34+
- supports `--registry-dir <path>`
35+
- supports `--include-starter-code`
36+
- creates Salt-first UI recommendations for new or existing repos without colliding with normal project build commands
37+
- `salt-ds review [target ...]`
38+
- supports `--url <url>`
39+
- supports `--migration-report <path>`
40+
- supports `--json`
41+
- supports `--output <path>`
42+
- supports `--registry-dir <path>`
43+
- supports `--timeout <ms>`
44+
- supports `--mode <auto|browser|fetched-html>`
45+
- supports `--output-dir <path>`
46+
- supports `--no-screenshot`
47+
- runs source-first Salt review for existing Salt code and can attach runtime evidence in the same pass when `--url` is provided
48+
- returns structured `confidence`, `raiseConfidence`, and `fixCandidates` in JSON output so the agent can judge whether to edit, inspect further, or ask follow-up questions without the CLI mutating files directly
49+
- can load a saved migration report to verify preserved landmarks, action hierarchy, and other migration-contract checks during `review --url`
50+
- `salt-ds migrate <query>`
51+
- supports `--url <url>`
52+
- supports `--json`
53+
- supports `--output <path>`
54+
- supports `--registry-dir <path>`
55+
- supports `--include-starter-code`
56+
- supports `--timeout <ms>`
57+
- supports `--mode <auto|browser|fetched-html>`
58+
- supports `--output-dir <path>`
59+
- supports `--no-screenshot`
60+
- translates non-Salt UI intent into Salt-first targets and implementation guidance
61+
- returns a familiarity contract, migration scope, post-migration verification guidance, delta categories, confidence signals, and optional runtime-scoping evidence so the agent can preserve important experience anchors without cloning the old visual system
62+
- `salt-ds upgrade`
63+
- supports `--package <name>`
64+
- supports `--component <name>`
65+
- supports `--from-version <version>`
66+
- supports `--to-version <version>`
67+
- supports `--include-deprecations`
68+
- supports `--json`
69+
- supports `--output <path>`
70+
- supports `--registry-dir <path>`
71+
- compares Salt versions and turns the result into upgrade-oriented workflow output
72+
73+
Support commands:
74+
75+
- `salt-ds doctor [rootDir]`
76+
- supports `--json`
77+
- supports `--output <path>`
78+
- supports `--bundle` and `--bundle-dir <path>`
79+
- supports `--storybook-url <url>` and `--app-url <url>`
80+
- supports `--check-detected-targets`
81+
- supports `--timeout <ms>`
82+
- can probe runtime target reachability for explicit or detected local targets
83+
- validates layered Salt policy sources from `.salt/stack.json`, including package-backed shared conventions packs
84+
- can write a support bundle containing the doctor report plus manifest, Salt config, and policy-layer summaries
85+
- `salt-ds runtime inspect <url>`
86+
- supports `--json`
87+
- supports `--output <path>`
88+
- supports `--output-dir <path>`
89+
- supports `--timeout <ms>`
90+
- supports `--mode <auto|browser|fetched-html>`
91+
- supports `--no-screenshot`
92+
- tries browser-session inspection by default, including screenshots, console and page errors, computed layout evidence, bounding boxes, and flex/grid ancestry when a browser runtime is available
93+
- falls back to `fetched-html` mode when browser-session inspection is unavailable, so consumers can still get structure, landmark, and accessible-name evidence even though computed layout evidence is unavailable
94+
95+
Canonical Salt grounding now happens inside the public workflow commands and MCP tools. There is no second manual semantic CLI surface.
96+
97+
The intended model is:
98+
99+
- `salt-ds + MCP` when MCP is available
100+
- `salt-ds + CLI` when MCP is blocked
101+
- manual CLI use stays workflow-first
102+
- `review --url`, `doctor`, and `runtime inspect` are support and evidence tools, not the main consumer story
103+
104+
Example workflow-oriented usage:
105+
106+
```sh
107+
salt-ds init . --json
108+
salt-ds init . --conventions-pack @acme/salt-conventions#markets --json
109+
salt-ds info . --json
110+
salt-ds create "Link to another page from a toolbar action" --json
111+
salt-ds review src --json
112+
salt-ds review src --url http://127.0.0.1:3000/ --migration-report migration-plan.json --json
113+
salt-ds review src --url http://127.0.0.1:6006/?path=/story/example --json
114+
salt-ds migrate "Translate this external UI toolbar into Salt" --json
115+
salt-ds migrate "Translate this external UI toolbar into Salt" --url http://127.0.0.1:6006/legacy-toolbar --json --mode fetched-html
116+
salt-ds upgrade --package @salt-ds/core --from-version 1.1.0 --json
117+
```
118+
119+
Support-only examples:
120+
121+
```sh
122+
salt-ds doctor . --check-detected-targets --bundle
123+
salt-ds runtime inspect http://127.0.0.1:6006/?path=/story/example --json --output .salt-support/runtime-report.json
124+
```
125+
126+
Interpreting runtime evidence:
127+
128+
- `browser-session`
129+
- stronger local evidence for screenshots, runtime/page errors, hydrated titles, landmarks, roles, rendered structure, and computed layout evidence such as boxes, centering clues, and flex/grid ancestry
130+
- `fetched-html`
131+
- narrower fallback evidence for status, title, landmarks, roles, and coarse structure when browser-session inspection is unavailable
132+
- does not include computed layout evidence
133+
- neither mode should be treated as canonical Salt policy; they are evidence inputs for create, review, migration, and support workflows

packages/cli/bin/salt-ds.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env node
2+
3+
const path = require("node:path");
4+
5+
function loadCliModule() {
6+
const candidatePaths = [
7+
path.resolve(__dirname, "../dist-cjs/cli/src/index.js"),
8+
path.resolve(
9+
__dirname,
10+
"../../../dist/salt-ds-cli/dist-cjs/cli/src/index.js",
11+
),
12+
];
13+
14+
for (const candidatePath of candidatePaths) {
15+
try {
16+
return require(candidatePath);
17+
} catch (error) {
18+
if (error && error.code === "MODULE_NOT_FOUND") {
19+
continue;
20+
}
21+
throw error;
22+
}
23+
}
24+
25+
throw new Error(
26+
"Could not locate the built Salt DS CLI entrypoint. Run `yarn workspace @salt-ds/cli build` first.",
27+
);
28+
}
29+
30+
const { runCli } = loadCliModule();
31+
32+
runCli(process.argv.slice(2))
33+
.then((exitCode) => {
34+
process.exit(exitCode);
35+
})
36+
.catch((error) => {
37+
console.error("salt-ds cli error:", error);
38+
process.exit(1);
39+
});

packages/cli/package.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "@salt-ds/cli",
3+
"version": "0.0.0",
4+
"license": "Apache-2.0",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/jpmorganchase/salt-ds.git",
8+
"directory": "packages/mcp"
9+
},
10+
"bugs": "https://github.com/jpmorganchase/salt-ds/issues",
11+
"main": "src/index.ts",
12+
"sideEffects": false,
13+
"files": [
14+
"bin"
15+
],
16+
"publishBinEntrypoints": {
17+
"bin/salt-ds.js": {
18+
"requirePath": "../dist-cjs/cli/src/index.js",
19+
"errorPrefix": "salt-ds cli error:"
20+
}
21+
},
22+
"publishScriptExcludes": [
23+
"build",
24+
"doctor",
25+
"prepack"
26+
],
27+
"bin": {
28+
"salt-ds": "bin/salt-ds.js"
29+
},
30+
"generateTypings": false,
31+
"publishEntryPath": "cli/src/index.js",
32+
"scripts": {
33+
"build": "yarn node ../../scripts/build.mjs",
34+
"doctor": "node ./bin/salt-ds.js doctor",
35+
"prepack": "yarn build"
36+
},
37+
"publishConfig": {
38+
"directory": "../../dist/salt-ds-cli",
39+
"provenance": true
40+
}
41+
}

0 commit comments

Comments
 (0)