@symbo.ls/mcp 1.0.25 → 1.0.27

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/README.md CHANGED
@@ -105,16 +105,50 @@ No API keys required for documentation tools. Project management tools require a
105
105
  pip install symbols-mcp
106
106
  ```
107
107
 
108
- Or with `uv`:
108
+ Or with `uv` (no install needed):
109
109
 
110
110
  ```bash
111
111
  uvx symbols-mcp
112
112
  ```
113
113
 
114
+ Or via npm:
115
+
116
+ ```bash
117
+ npx @symbo.ls/mcp
118
+ ```
119
+
114
120
  ## Configuration
115
121
 
116
- Add to your MCP client config (e.g. `mcp.json`):
122
+ ### Recommended (auto-updates on every launch)
117
123
 
124
+ ```json
125
+ {
126
+ "mcpServers": {
127
+ "symbols": {
128
+ "command": "uvx",
129
+ "args": ["--refresh", "symbols-mcp"]
130
+ }
131
+ }
132
+ }
133
+ ```
134
+
135
+ The `--refresh` flag checks PyPI for a newer version each time the server starts. Adds ~1-2s to startup but ensures you always have the latest rules and documentation.
136
+
137
+ ### Alternative configs
138
+
139
+ **npm (also auto-updates):**
140
+ ```json
141
+ {
142
+ "mcpServers": {
143
+ "symbols": {
144
+ "command": "npx",
145
+ "args": ["-y", "@symbo.ls/mcp"]
146
+ }
147
+ }
148
+ }
149
+ ```
150
+
151
+ **Pinned version (manual updates):**
118
152
  ```json
119
153
  {
120
154
  "mcpServers": {
@@ -126,6 +160,19 @@ Add to your MCP client config (e.g. `mcp.json`):
126
160
  }
127
161
  ```
128
162
 
163
+ ### Manual update
164
+
165
+ ```bash
166
+ # pip
167
+ pip install --upgrade symbols-mcp
168
+
169
+ # uv (clear cache and re-run)
170
+ uv cache clean symbols-mcp && uvx symbols-mcp
171
+
172
+ # npm
173
+ npm update -g @symbo.ls/mcp
174
+ ```
175
+
129
176
  ### Transport modes
130
177
 
131
178
  By default, the server runs over **stdio**. For SSE transport:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symbo.ls/mcp",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "Symbols.app MCP — docs, code generation, publishing, CLI/SDK reference",
5
5
  "mcpName": "io.github.symbo-ls/symbols-mcp",
6
6
  "files": [
@@ -6,8 +6,6 @@ Follow this protocol exactly. Execute each phase in order. Do not skip steps.
6
6
 
7
7
  ## 1. Install the MCP Server
8
8
 
9
- Run the following command to install:
10
-
11
9
  ```bash
12
10
  pip install symbols-mcp
13
11
  ```
@@ -16,14 +14,14 @@ pip install symbols-mcp
16
14
 
17
15
  ## 2. Configure the MCP Server
18
16
 
19
- Add this configuration to your MCP settings:
17
+ Add this configuration to your MCP settings (uses `--refresh` to auto-update on every launch):
20
18
 
21
19
  ```json
22
20
  {
23
21
  "mcpServers": {
24
22
  "symbols": {
25
23
  "command": "uvx",
26
- "args": ["symbols-mcp"]
24
+ "args": ["--refresh", "symbols-mcp"]
27
25
  }
28
26
  }
29
27
  }
@@ -8,12 +8,9 @@ These are the **recommended default design system values** for all newly created
8
8
 
9
9
  ```js
10
10
  export default {
11
- '@default': {
12
- base: 16,
13
- ratio: 1.25,
14
- range: [-5, 12],
15
- subSequence: true,
16
- },
11
+ base: 16,
12
+ ratio: 1.25,
13
+ subSequence: true,
17
14
  }
18
15
  ```
19
16
 
@@ -25,16 +22,13 @@ export default {
25
22
 
26
23
  ```js
27
24
  export default {
28
- '@default': {
29
- base: 16,
30
- ratio: 1.25,
31
- range: [-5, 12],
32
- subSequence: true,
33
- },
25
+ base: 16,
26
+ ratio: 1.618,
27
+ subSequence: true,
34
28
  }
35
29
  ```
36
30
 
37
- Uses the same scale as typography. Tokens: `A` = 20px, `B` = 25px, `Z` = 16px, etc.
31
+ Golden ratio (1.618) for spacing. Tokens: `A` = 16px, `B` = 26px, `C` = 42px, etc.
38
32
 
39
33
  ---
40
34
 
@@ -285,18 +285,32 @@ Title: { fontWeight: 700 }
285
285
 
286
286
  Golden Ratio scale (1.618 default). Applies to `padding`, `margin`, `gap`, `width`, `height`, `boxSize`, `borderRadius`/`round`, `inset`, `top`, `left`, `right`, `bottom`, etc.
287
287
 
288
- | Token | Approx value | Use |
288
+ ### Token stepping system
289
+
290
+ Each letter is a major step. Sub-numbers are minor increments between letters. The sequence flows continuously — each sub-step is one tone increase:
291
+
292
+ ```
293
+ ... X < X1 < X2 < Z < Z1 < Z2 < A < A1 < A2 < A3 < B < B1 < B2 < B3 < C ...
294
+ ```
295
+
296
+ How many sub-steps exist between letters depends on the range — smaller ranges (W, X) have only 1-2 sub-steps, larger ranges (A, B, C) have up to 3.
297
+
298
+ **To increase slightly:** go up one sub-step (e.g. `A` → `A1`, or `B2` → `B3`)
299
+ **To increase moderately:** go up one letter (e.g. `A` → `B`)
300
+ **To decrease:** reverse direction (e.g. `B` → `A3`, or `A` → `Z2`)
301
+
302
+ | Token range | Approx px | Use |
289
303
  |---|---|---|
290
- | `W`-`W2` | 2-4 px | Micro gaps, offsets |
291
- | `X`-`X2` | 4-6 px | Icon padding, tight gaps |
292
- | `Z`-`Z2` | 10-16 px | Compact padding |
293
- | `A`-`A2` | 16-26 px | Default padding, gutters |
294
- | `B`-`B2` | 26-42 px | Section padding |
295
- | `C`-`C2` | 42-68 px | Container padding, avatar sizes |
296
- | `D`-`D2` | 68-110 px | Large sections |
297
- | `E`-`F` | 110-178 px | Hero padding, max-widths |
298
-
299
- Sub-sequence rules: `W` and `X` only have `W`, `W1`, `W2` and `X`, `X1`, `X2`. Sub-tokens like `W4`, `X4` do NOT exist. Sub-steps `3` and `4` (e.g. `A3`, `A4`, `B3`, `B4`) only appear from `A` and above.
304
+ | `W`-`W2` | 2-4 | Micro gaps, offsets |
305
+ | `X`-`X2` | 4-6 | Icon padding, tight gaps |
306
+ | `Z`-`Z2` | 10-16 | Compact padding |
307
+ | `A`-`A3` | 16-26 | Default padding, gutters |
308
+ | `B`-`B3` | 26-42 | Section padding |
309
+ | `C`-`C3` | 42-68 | Container padding, avatar sizes |
310
+ | `D`-`D3` | 68-110 | Large sections |
311
+ | `E`-`F` | 110-178 | Hero padding, max-widths |
312
+
313
+ Typography tokens use the same letter system for `fontSize`.
300
314
 
301
315
  ### Shorthand spacing
302
316
 
@@ -402,7 +402,8 @@ npm i -g @symbo.ls/cli
402
402
 
403
403
  | Goal | Command |
404
404
  |------|---------|
405
- | Local-only (fastest) | `smbls create <project-name> && cd <project-name> && npm start` |
405
+ | Default (with `system/default` library) | `smbls create <project-name> && cd <project-name> && npm start` |
406
+ | Blank (no shared libraries) | `smbls create <project-name> --blank-shared-libraries && cd <project-name> && npm start` |
406
407
  | Platform-linked (collaboration + remote preview) | `smbls project create <project-name> --create-new && cd <project-name> && npm start` |
407
408
 
408
409
  ### Authentication
@@ -1230,6 +1230,24 @@ color: { blue50: '#eff6ff', blue100: '#dbeafe', blue200: '#bfdbfe', blue300: '#9
1230
1230
 
1231
1231
  ---
1232
1232
 
1233
+ ## Rule 46 — Fetched shared libraries are READONLY — override locally instead
1234
+
1235
+ When shared libraries are fetched from the platform (`smbls fetch`/`smbls sync`), both `sharedLibraries.js` and the `.symbols_local/libs/` folders are strictly **readonly** — they are overwritten on every fetch/sync. Never edit fetched library files. To override shared library components, define them in your local project files — the app always wins at runtime.
1236
+
1237
+ `sharedLibraries.js` can be manually edited when custom-linking to local folders (advanced use case). But fetched libraries must never be modified.
1238
+
1239
+ ```js
1240
+ // ❌ WRONG — editing fetched .symbols_local/libs/ files
1241
+ // These are overwritten on every fetch/sync
1242
+
1243
+ // ✅ CORRECT — override in local components/
1244
+ // If shared library has Button with theme: 'primary',
1245
+ // define your own Button in components/Button.js to override it
1246
+ export const Button = { theme: 'dialog', padding: 'Z A' }
1247
+ ```
1248
+
1249
+ ---
1250
+
1233
1251
  ## Rule 44 — Never chain CSS selectors — use nesting instead
1234
1252
 
1235
1253
  Media queries (`@dark`, `@mobileL`) and pseudo-classes (`:hover`, `:active`) must be nested as separate objects, never chained into a single key string.
@@ -1,6 +1,25 @@
1
1
  # sharedLibraries
2
2
 
3
- sharedLibraries is a mechanism in the Symbols framework that allows projects to inherit components, functions, methods, state, designSystem, pages, files, snippets, and dependencies from external library projects. Libraries are merged into the consuming app's context at runtime — no manual re-exports needed.
3
+ sharedLibraries allows projects to inherit components, functions, methods, state, designSystem, pages, files, snippets, and dependencies from external library projects. Libraries are merged into the consuming app's context at runtime — no manual re-exports needed.
4
+
5
+ **CRITICAL: When shared libraries are fetched from the platform, both `sharedLibraries.js` and `.symbols_local/libs/` folders are strictly READONLY — they are overwritten on every `smbls fetch`/`smbls sync`.** To override shared library components, define them in your local project files (app always wins).
6
+
7
+ `sharedLibraries.js` can be manually edited for custom linking to local folders (advanced use case), but fetched content must never be modified.
8
+
9
+ ---
10
+
11
+ ## Key Format: `owner/key`
12
+
13
+ All shared library identifiers use the `owner/key` format. Default owner is `system`.
14
+
15
+ | Input | Normalized |
16
+ |---|---|
17
+ | `system/default` | `system/default` |
18
+ | `default` | `system/default` |
19
+ | `default.symbo.ls` | `system/default` (deprecated) |
20
+ | `myorg/mylib` | `myorg/mylib` |
21
+
22
+ The `.symbo.ls` suffix is deprecated and stripped automatically.
4
23
 
5
24
  ---
6
25
 
@@ -11,41 +30,45 @@ sharedLibraries is a mechanism in the Symbols framework that allows projects to
11
30
  Three supported formats:
12
31
 
13
32
  ```json
14
- // Array of strings (library keys)
15
- "sharedLibraries": ["brand", "shared"]
33
+ // Array of strings (owner/key or bare key)
34
+ "sharedLibraries": ["system/default", "system/landing"]
16
35
 
17
36
  // Object with key:version
18
- "sharedLibraries": { "brand": "1.0.0", "shared": "latest" }
37
+ "sharedLibraries": { "system/default": "1.0.0" }
19
38
 
20
- // Object with key:config (used in editor)
21
- "sharedLibraries": {
22
- "brand": { "version": "1.0.0", "destDir": "../brand" },
23
- "shared": { "destDir": "../shared" }
24
- }
39
+ // Object with key:config
40
+ "sharedLibraries": { "system/default": { "version": "1.0.0", "destDir": "./custom" } }
25
41
  ```
26
42
 
27
- All formats are normalized by the CLI (`cli/helpers/symbolsConfig.js:246-268`) to: `[{ key, version, destDir }]`
43
+ All formats normalize keys to `owner/key` via `normalizeLibraryKey()`.
28
44
 
29
- ### sharedLibraries.js
45
+ ### sharedLibraries.js (auto-generated on fetch/sync)
30
46
 
31
- Each package has a `sharedLibraries.js` that imports other packages' `context.js` and exports them as an array:
47
+ The CLI generates this file automatically after `smbls fetch`/`smbls sync`:
32
48
 
33
49
  ```js
34
- import brand from '../brand/context.js'
35
- import shared from '../shared/context.js'
50
+ import systemDefault from '../.symbols_local/libs/system--default/context.js'
36
51
 
37
- export default [brand, shared]
52
+ export default [systemDefault]
38
53
  ```
39
54
 
40
- For remote libraries fetched from the platform:
55
+ This file is overwritten on every fetch/sync. To customize behavior, override components/state/designSystem in your local project files instead.
41
56
 
42
- ```js
43
- import platformSymboLs from '../.symbols_local/libs/platform.symbo.ls/context.js'
44
- import docsSymboLs from '../.symbols_local/libs/docs.symbo.ls/context.js'
57
+ ### File Structure After Fetch
45
58
 
46
- export default [platformSymboLs, docsSymboLs]
59
+ Directory names use `owner--key` format (double dash separator):
60
+
61
+ ```
62
+ .symbols_local/libs/
63
+ system--default/ # owner--key directory convention
64
+ context.js
65
+ components/
66
+ designSystem/
67
+ ...
47
68
  ```
48
69
 
70
+ The `owner--key` directory convention matches mermaid hosting URLs (`key--owner.preview.symbols.app`).
71
+
49
72
  ### context.js
50
73
 
51
74
  The `sharedLibraries` array is included in the context export:
@@ -82,29 +105,31 @@ This runs early in context initialization, **before** designSystem, state, compo
82
105
 
83
106
  ### Merge Logic
84
107
 
85
- `smbls/src/prepare.js:240-251`:
108
+ `smbls/src/prepare.js`:
86
109
 
87
110
  ```js
88
111
  export const prepareSharedLibs = (context) => {
89
112
  const sharedLibraries = context.sharedLibraries
90
113
  for (let i = 0; i < sharedLibraries.length; i++) {
91
114
  const sharedLib = sharedLibraries[i]
92
- if (context.type === 'template') {
93
- overwriteShallow(context.designSystem, sharedLib.designSystem)
94
- deepMerge(context, sharedLib, ['designSystem'], 1)
95
- } else {
96
- deepMerge(context, sharedLib, [], 1)
115
+ for (const key in sharedLib) {
116
+ if (isObject(sharedLib[key]) && isObject(context[key])) {
117
+ if (key === 'designSystem') {
118
+ deepDefaults(context[key], sharedLib[key])
119
+ } else {
120
+ for (const k in sharedLib[key]) {
121
+ if (!(k in context[key])) context[key][k] = sharedLib[key][k]
122
+ }
123
+ }
124
+ } else if (!(key in context)) {
125
+ context[key] = sharedLib[key]
126
+ }
97
127
  }
98
128
  }
99
129
  }
100
130
  ```
101
131
 
102
- **Two strategies:**
103
-
104
- | App Type | designSystem | Everything Else |
105
- |----------|-------------|-----------------|
106
- | **template** | `overwriteShallow` — library completely replaces template's designSystem | `deepMerge` with designSystem excluded |
107
- | **regular** | `deepMerge` (app wins) | `deepMerge` (app wins) |
132
+ **The app ALWAYS wins.** Shared libraries only fill in missing keys (`!(k in context[key])`). designSystem uses `deepDefaults` which fills nested gaps while preserving all local values.
108
133
 
109
134
  ### deepMerge Behavior
110
135
 
@@ -184,56 +209,36 @@ So the final component resolution is: **App > Shared Libraries > UIKit**
184
209
 
185
210
  ## CLI Integration
186
211
 
187
- ### Scaffolding (`cli/bin/fs.js:231-345`)
212
+ ### Project Creation
188
213
 
189
- `scaffoldSharedLibraries()`:
190
- 1. Reads `sharedLibraries` from project JSON
191
- 2. Creates each library as a full project folder via frank's `toFS()`
192
- 3. Default location: `.symbols_local/libs/`
193
- 4. Generates `sharedLibraries.js` with import statements
194
-
195
- ### Fetch (`cli/bin/fetch.js`)
196
-
197
- When fetching from the platform:
198
- - Pulls full project data including `sharedLibraries` array
199
- - Each library is a complete Symbols project object
200
- - Extracts version info and stores in lock file
214
+ ```bash
215
+ smbls create my-app # Default: adds system/default + fetches
216
+ smbls create my-app --blank-shared-libraries # Blank: no shared libraries, skips fetch
217
+ ```
201
218
 
202
- ### toJSON (`frank/toJSON.js:170-183`)
219
+ When creating with default libraries:
220
+ 1. Project is created on the platform
221
+ 2. `system/default` library is attached via API
222
+ 3. Local files are scaffolded
223
+ 4. `smbls fetch` runs to pull library data into `.symbols_local/libs/`
203
224
 
204
- Context modules list includes sharedLibraries:
225
+ ### Library Management
205
226
 
206
- ```js
207
- const CONTEXT_MODULES = [
208
- { name: 'state', path: './state.js', style: 'default' },
209
- { name: 'dependencies', path: './dependencies.js', style: 'default' },
210
- { name: 'sharedLibraries', path: './sharedLibraries.js', style: 'default' },
211
- { name: 'components', path: './components/index.js', style: 'namespace' },
212
- { name: 'snippets', path: './snippets/index.js', style: 'namespace' },
213
- { name: 'pages', path: './pages/index.js', style: 'default' },
214
- { name: 'functions', path: './functions/index.js', style: 'namespace' },
215
- { name: 'methods', path: './methods/index.js', style: 'namespace' },
216
- { name: 'designSystem', path: './designSystem/index.js', style: 'default' },
217
- { name: 'files', path: './files/index.js', style: 'default' },
218
- { name: 'config', path: './config.js', style: 'default' }
219
- ]
227
+ ```bash
228
+ smbls project libs available # List all available libraries (shows owner/key)
229
+ smbls project libs list # List libraries linked to current project
230
+ smbls project libs add system/default # Add by owner/key
231
+ smbls project libs add default # Bare key → system/default
232
+ smbls project libs remove default # Remove library
220
233
  ```
221
234
 
222
- ### Validation (`cli/bin/validate-domql-runner.js:323-342`)
223
-
224
- `mergeSharedLibraries()` merges all library exports for DOMQL validation:
235
+ ### Scaffolding
225
236
 
226
- ```js
227
- function mergeSharedLibraries(sharedLibraries) {
228
- const merged = { pages: {}, components: {}, functions: {}, methods: {}, snippets: {} }
229
- for (const lib of libs) {
230
- if (isPlainObject(lib?.pages)) Object.assign(merged.pages, lib.pages)
231
- if (isPlainObject(lib?.components)) Object.assign(merged.components, lib.components)
232
- // ...
233
- }
234
- return merged
235
- }
236
- ```
237
+ `scaffoldSharedLibraries()` in `cli/bin/fs.js`:
238
+ 1. Reads `sharedLibraries` from project JSON
239
+ 2. Creates each library as a full project folder via frank's `toFS()`
240
+ 3. Default location: `.symbols_local/libs/`
241
+ 4. Auto-generates `sharedLibraries.js` with import statements (overwritten every time)
237
242
 
238
243
  ---
239
244
 
@@ -289,12 +294,13 @@ prepareContext() {
289
294
 
290
295
  ## Key Takeaways
291
296
 
292
- 1. **No re-exports needed** — components/functions from a shared library are automatically available in the consuming app's context
293
- 2. **App always wins** — app's own definitions take precedence over shared libraries
294
- 3. **Order matters** — first library in the array has priority over later ones for filling undefined slots
295
- 4. **Templates are special** — designSystem is fully overwritten (shallow) rather than deep-merged
296
- 5. **Methods are protected**METHODS_EXL prevents shared libraries from overwriting element methods and internal references
297
- 6. **No circular detection** JavaScript's ESM module system prevents infinite loops naturally; circular deps resolve as undefined values
297
+ 1. **Fetched shared libraries are readonly** — `sharedLibraries.js` and `.symbols_local/libs/` are overwritten on fetch/sync. Manual editing only for custom local linking.
298
+ 2. **App always wins** — local project definitions take precedence over shared libraries
299
+ 3. **Override by defining locally** — to change a shared library component, define it in your local `components/` with the same name
300
+ 4. **Order matters** — first library in the array has priority over later ones for filling undefined slots
301
+ 5. **Key format is `owner/key`** bare keys default to `system/` owner
302
+ 6. **`smbls create` defaults to `system/default`** use `--blank-shared-libraries` for no libraries
303
+ 7. **Methods are protected** — METHODS_EXL prevents shared libraries from overwriting element methods and internal references
298
304
 
299
305
  ---
300
306
 
@@ -307,6 +313,7 @@ prepareContext() {
307
313
  | deepMerge | `smbls/packages/utils/object.js` | 61-76 |
308
314
  | overwriteShallow | `smbls/packages/utils/object.js` | 431-439 |
309
315
  | METHODS_EXL | `smbls/packages/utils/keys.js` | 147-152 |
316
+ | Key normalization | `smbls/packages/cli/helpers/libraryKeyUtils.js` | — |
310
317
  | Config normalization | `smbls/packages/cli/helpers/symbolsConfig.js` | 246-268 |
311
318
  | FS scaffolding | `smbls/packages/cli/bin/fs.js` | 231-345 |
312
319
  | Context modules | `smbls/packages/frank/toJSON.js` | 170-183 |