@czi-sds/mcp 0.20.0 → 0.20.1
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.
|
@@ -611,7 +611,9 @@ export default App;
|
|
|
611
611
|
|
|
612
612
|
### Selection and stats
|
|
613
613
|
|
|
614
|
-
Selection
|
|
614
|
+
Selection works out of the box: clicking a residue zooms in on it, and clicking empty space zooms back out, with no state on your side. Every way of making one - clicking a residue, dragging across the sequence, clicking a chain's caption - is reported through `onSelectionChange`, and clicking empty space reports `null`.
|
|
615
|
+
|
|
616
|
+
Passing `selection` takes it over, the same way `hiddenChains` takes over visibility. A click then moves the camera only once you echo `onSelectionChange` back through `selection`, and setting `null` zooms back out. Pass `null` for nothing selected rather than leaving it undefined, which hands the selection back to the viewer.
|
|
615
617
|
|
|
616
618
|
A `StructureSelection` says what is selected in either of two ways, which combine: `residues` is a list of 0-based indices, and `chains` names whole chains by `chainId`. A drag across the sequence comes back as `residues`, a chain caption as `chains`, so a whole-chain selection survives the round trip at its original size rather than as the hundreds of indices it stands for. The camera frames whatever the selection covers, so a range or a chain is fitted to the view rather than approached as a point.
|
|
617
619
|
|
|
@@ -1442,7 +1444,7 @@ export default App;
|
|
|
1442
1444
|
|
|
1443
1445
|
The viewer reads the active SDS theme for its hover and selection colors and for the sequence panel, and picks a light or dark canvas background to match. Two props override those backgrounds independently: `backgroundColor` for the 3D canvas and `sequenceViewerBackgroundColor` for the sequence panel.
|
|
1444
1446
|
|
|
1445
|
-
The two accept different formats. Mol\* needs the canvas color as a concrete `#RRGGBB` value, so `backgroundColor` is limited to hex. The sequence panel is styled with CSS, so `sequenceViewerBackgroundColor` takes any CSS color. It paints the panel, the
|
|
1447
|
+
The two accept different formats. Mol\* needs the canvas color as a concrete `#RRGGBB` value, so `backgroundColor` is limited to hex. The sequence panel is styled with CSS, so `sequenceViewerBackgroundColor` takes any CSS color. It paints the panel, the fades that mask residues scrolling past its top and bottom edges, and the "no structure available" state, so the panel stays one color throughout.
|
|
1446
1448
|
|
|
1447
1449
|
## Downloading an image
|
|
1448
1450
|
|
|
@@ -1500,7 +1502,7 @@ The full set of settings is documented by Mol* rather than here, since it is Mol
|
|
|
1500
1502
|
- [Canvas3D props](https://molstar.org/docs/plugin/canvas3d/) - `renderer`, `camera`, `postprocessing`, `trackball`, `marking`, and lighting.
|
|
1501
1503
|
- [Plugin config](https://molstar.org/docs/plugin/config/) - the `PluginConfig` items the `config` list takes.
|
|
1502
1504
|
|
|
1503
|
-
Two things to know about how it is applied. List-valued keys - `behaviors`, `config`, `actions`, `animations`, `customFormats`, `customParamEditors` - are appended to rather than replaced. For `config` that is what makes an override work, since Mol* reads the list in order and a later entry wins. It also means a behavior cannot be taken away: the viewer removes Mol*'s click-to-zoom camera so that
|
|
1505
|
+
Two things to know about how it is applied. List-valued keys - `behaviors`, `config`, `actions`, `animations`, `customFormats`, `customParamEditors` - are appended to rather than replaced. For `config` that is what makes an override work, since Mol* reads the list in order and a later entry wins. It also means a behavior cannot be taken away: the viewer removes Mol*'s click-to-zoom camera so that the selection alone drives the camera, and that stays removed.
|
|
1504
1506
|
|
|
1505
1507
|
And it is read once, when the plugin is created - except for `canvas3d`, which is re-applied whenever it changes. Creating the plugin throws away the camera, so the rest is deliberately not reactive; pass a `key` to remount the viewer if you need to change it.
|
|
1506
1508
|
|
|
@@ -1508,29 +1510,29 @@ And it is read once, when the plugin is created - except for `canvas3d`, which i
|
|
|
1508
1510
|
|
|
1509
1511
|
The viewer spreads any remaining props onto its root div, so standard HTML attributes such as `className`, `id`, and `data-testid` work as usual.
|
|
1510
1512
|
|
|
1511
|
-
| Name | Type | Default | Description
|
|
1512
|
-
| ------------------------------- | ----------------------------- | ------------ |
|
|
1513
|
-
| `structure` | `string` | - (required) | The structure to render, as raw PDB or mmCIF (PDBx) text.
|
|
1514
|
-
| `plddt` | `number[] \| null` | - | Per-residue pLDDT confidence on a 0-1 scale, in chain order. When supplied, the structure is colored by confidence unless `residueOverlay` takes over. Residues past the end of the array fall back to mid confidence.
|
|
1515
|
-
| `residueOverlay` | `ResidueValueOverlay \| null` | - | Per-residue values painted over the structure, replacing pLDDT coloring while set. See the table below for its shape.
|
|
1516
|
-
| `selection` | `StructureSelection \| null` |
|
|
1517
|
-
| `hiddenChains` | `string[]` | - | Chains hidden from the 3D view, by `chainId`. Leave undefined to let the chain legend's toggles own visibility; passing it takes that over, and the toggles then only report through `onChainVisibilityChange`.
|
|
1518
|
-
| `chainColors` | `Record<string, string>` | - | Color per chain, by `chainId`, as `#RRGGBB`. Chains left out fall back to the viewer's palette. Only visible while chain coloring is what is on screen, which is when neither `plddt` nor `residueOverlay` is set.
|
|
1519
|
-
| `showChainLegend` | `boolean` | `true` | Show the chain legend, which lists each chain with its color and a visibility toggle. Ignored on a single-chain structure, where there is nothing to tell apart or hide.
|
|
1520
|
-
| `disableChainHighlightOnHover` | `boolean` | `false` | Stop other chains from dimming in the 3D view while a chain's name is pointed at, in the legend or above its grid in the sequence panel. Turn it off where the movement is more distracting than the answer is useful.
|
|
1521
|
-
| `download` | `StructureDownload \| null` | - | Adds a capture button beneath the reset-camera control, which downloads a PNG of the structure. Omit for no button. See _Downloading an image_ above.
|
|
1522
|
-
| `molstarSpec` | `Partial<PluginUISpec>` | - | Mol* plugin spec laid over the viewer's own, which is how the whole of Mol*'s configuration is reachable without a prop here for each setting. Anything named wins; list-valued keys are appended to. Read once at creation, except `canvas3d`, which is re-applied when it changes. See _Configuring Mol\*_ above.
|
|
1523
|
-
| `stats` | `(StructureStat \| null)[]` | - | Up to three whole-structure stats shown along the bottom. A `null` entry reserves its column without rendering anything, so the columns never shift as values come and go.
|
|
1524
|
-
| `backgroundColor` | `string` | - | Canvas background, as `#RRGGBB`. Defaults to the SDS theme's base background, so the canvas follows the surrounding page in both modes.
|
|
1525
|
-
| `sequenceViewerBackgroundColor` | `string` | - | Sequence panel background, as any CSS color. Defaults to the SDS theme's primary surface, so the panel follows the surrounding page in both modes.
|
|
1526
|
-
| `showAxes` | `boolean` | `true` | Show the orientation axes widget and the reset-camera button.
|
|
1527
|
-
| `showSequenceViewer` | `boolean` | `true` | Show the sequence panel pinned along the bottom of the viewer.
|
|
1528
|
-
| `showLegend` | `boolean` | `true` | Show the stats and color scale legend overlaid on the viewer.
|
|
1529
|
-
| `onResidueClick` | `function` | - | `(residue: ResidueRef) => void`. Called with the residue under the pointer: `index` (0-based, across the whole structure), `compId`, `chainId`, `seqId` and `insCode`. What the click _selected_ comes through `onSelectionChange`, which a drag makes a range.
|
|
1530
|
-
| `onResidueHover` | `function` | - | `(residue: ResidueRef \| null) => void`. Called as the pointer moves over residues, and with `null` when it leaves the structure.
|
|
1531
|
-
| `onSelectionChange` | `function` | - | `(selection: StructureSelection \| null) => void`. Called with the new selection whenever the user makes one - clicking a residue, dragging across the sequence, clicking a chain caption - and with `null` when they click empty space to clear it. A whole-chain selection arrives as `{ chains: [id] }` rather than as every index on it. |
|
|
1532
|
-
| `onChainsChange` | `function` | - | `(chains: ChainRef[]) => void`. Called with the chains found in the structure, whenever a structure is loaded. Fires with `[]` when the structure holds none.
|
|
1533
|
-
| `onChainVisibilityChange` | `function` | - | `(hiddenChains: string[]) => void`. Called with the chains now hidden when a visibility toggle is used. Fires whether or not `hiddenChains` is controlled, so a consumer can follow the viewer's own state without owning it.
|
|
1513
|
+
| Name | Type | Default | Description |
|
|
1514
|
+
| ------------------------------- | ----------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1515
|
+
| `structure` | `string` | - (required) | The structure to render, as raw PDB or mmCIF (PDBx) text. |
|
|
1516
|
+
| `plddt` | `number[] \| null` | - | Per-residue pLDDT confidence on a 0-1 scale, in chain order. When supplied, the structure is colored by confidence unless `residueOverlay` takes over. Residues past the end of the array fall back to mid confidence. |
|
|
1517
|
+
| `residueOverlay` | `ResidueValueOverlay \| null` | - | Per-residue values painted over the structure, replacing pLDDT coloring while set. See the table below for its shape. |
|
|
1518
|
+
| `selection` | `StructureSelection \| null` | - | What is selected. Leave undefined to let the viewer own it, so a click zooms in on a residue with no state on your side; passing it takes that over, and a click then moves the camera only once `onSelectionChange` is echoed back. Either way the camera frames whatever it covers, and clearing it zooms back out. Residues are drawn in ball-and-stick; a whole chain dims the chains around it instead. See the table below for its shape. |
|
|
1519
|
+
| `hiddenChains` | `string[]` | - | Chains hidden from the 3D view, by `chainId`. Leave undefined to let the chain legend's toggles own visibility; passing it takes that over, and the toggles then only report through `onChainVisibilityChange`. |
|
|
1520
|
+
| `chainColors` | `Record<string, string>` | - | Color per chain, by `chainId`, as `#RRGGBB`. Chains left out fall back to the viewer's palette. Only visible while chain coloring is what is on screen, which is when neither `plddt` nor `residueOverlay` is set. |
|
|
1521
|
+
| `showChainLegend` | `boolean` | `true` | Show the chain legend, which lists each chain with its color and a visibility toggle. Ignored on a single-chain structure, where there is nothing to tell apart or hide. |
|
|
1522
|
+
| `disableChainHighlightOnHover` | `boolean` | `false` | Stop other chains from dimming in the 3D view while a chain's name is pointed at, in the legend or above its grid in the sequence panel. Turn it off where the movement is more distracting than the answer is useful. |
|
|
1523
|
+
| `download` | `StructureDownload \| null` | - | Adds a capture button beneath the reset-camera control, which downloads a PNG of the structure. Omit for no button. See _Downloading an image_ above. |
|
|
1524
|
+
| `molstarSpec` | `Partial<PluginUISpec>` | - | Mol* plugin spec laid over the viewer's own, which is how the whole of Mol*'s configuration is reachable without a prop here for each setting. Anything named wins; list-valued keys are appended to. Read once at creation, except `canvas3d`, which is re-applied when it changes. See _Configuring Mol\*_ above. |
|
|
1525
|
+
| `stats` | `(StructureStat \| null)[]` | - | Up to three whole-structure stats shown along the bottom. A `null` entry reserves its column without rendering anything, so the columns never shift as values come and go. |
|
|
1526
|
+
| `backgroundColor` | `string` | - | Canvas background, as `#RRGGBB`. Defaults to the SDS theme's base background, so the canvas follows the surrounding page in both modes. |
|
|
1527
|
+
| `sequenceViewerBackgroundColor` | `string` | - | Sequence panel background, as any CSS color. Defaults to the SDS theme's primary surface, so the panel follows the surrounding page in both modes. |
|
|
1528
|
+
| `showAxes` | `boolean` | `true` | Show the orientation axes widget and the reset-camera button. |
|
|
1529
|
+
| `showSequenceViewer` | `boolean` | `true` | Show the sequence panel pinned along the bottom of the viewer. |
|
|
1530
|
+
| `showLegend` | `boolean` | `true` | Show the stats and color scale legend overlaid on the viewer. |
|
|
1531
|
+
| `onResidueClick` | `function` | - | `(residue: ResidueRef) => void`. Called with the residue under the pointer: `index` (0-based, across the whole structure), `compId`, `chainId`, `seqId` and `insCode`. What the click _selected_ comes through `onSelectionChange`, which a drag makes a range. |
|
|
1532
|
+
| `onResidueHover` | `function` | - | `(residue: ResidueRef \| null) => void`. Called as the pointer moves over residues, and with `null` when it leaves the structure. |
|
|
1533
|
+
| `onSelectionChange` | `function` | - | `(selection: StructureSelection \| null) => void`. Called with the new selection whenever the user makes one - clicking a residue, dragging across the sequence, clicking a chain caption - and with `null` when they click empty space to clear it. A whole-chain selection arrives as `{ chains: [id] }` rather than as every index on it. Fires whether or not `selection` is controlled, so a consumer can follow the viewer's own selection without owning it. |
|
|
1534
|
+
| `onChainsChange` | `function` | - | `(chains: ChainRef[]) => void`. Called with the chains found in the structure, whenever a structure is loaded. Fires with `[]` when the structure holds none. |
|
|
1535
|
+
| `onChainVisibilityChange` | `function` | - | `(hiddenChains: string[]) => void`. Called with the chains now hidden when a visibility toggle is used. Fires whether or not `hiddenChains` is controlled, so a consumer can follow the viewer's own state without owning it. |
|
|
1534
1536
|
|
|
1535
1537
|
### StructureSelection
|
|
1536
1538
|
|
|
@@ -94,8 +94,7 @@
|
|
|
94
94
|
"type": "ResidueValueOverlay | null"
|
|
95
95
|
},
|
|
96
96
|
"selection": {
|
|
97
|
-
"
|
|
98
|
-
"description": "What is selected, or null when nothing is. Controlled: the camera frames\nwhatever the selection covers, and clearing it zooms back out to the\ndefault view.\n\nResidues are drawn in ball-and-stick over the cartoon; whole chains are\nleft as they are and the chains around them dim, the same as hovering a\nchain's name.",
|
|
97
|
+
"description": "What is selected, or null when nothing is. Leave undefined to let the\nviewer own the selection, so clicking a residue zooms in on it with no\nstate on the consumer's side; passing it takes that over, and a click then\nmoves the camera only once `onSelectionChange` is echoed back here.\n\nEither way the camera frames whatever the selection covers, and clearing\nit zooms back out to the default view. Residues are drawn in\nball-and-stick over the cartoon; whole chains are left as they are and the\nchains around them dim, the same as hovering a chain's name.",
|
|
99
98
|
"isRequired": false,
|
|
100
99
|
"type": "StructureSelection | null"
|
|
101
100
|
},
|
|
@@ -110,7 +109,7 @@
|
|
|
110
109
|
"type": "(residue: ResidueRef | null) => void"
|
|
111
110
|
},
|
|
112
111
|
"onSelectionChange": {
|
|
113
|
-
"description": "Called with the new selection whenever the user makes one - clicking a\nresidue, dragging across the sequence, clicking a chain caption - and with\n`null` when they click empty space to clear it.\n\nA whole-chain selection arrives as `{ chains: [id] }` rather than as every\nindex on it, so echoing it straight back into `selection` costs nothing.",
|
|
112
|
+
"description": "Called with the new selection whenever the user makes one - clicking a\nresidue, dragging across the sequence, clicking a chain caption - and with\n`null` when they click empty space to clear it.\n\nA whole-chain selection arrives as `{ chains: [id] }` rather than as every\nindex on it, so echoing it straight back into `selection` costs nothing.\nFires whether or not `selection` is controlled, so a consumer can follow\nthe viewer's own selection without owning it.",
|
|
114
113
|
"isRequired": false,
|
|
115
114
|
"type": "(selection: StructureSelection | null) => void"
|
|
116
115
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@czi-sds/mcp",
|
|
3
3
|
"description": "The official MCP server for SDS",
|
|
4
|
-
"version": "0.20.
|
|
4
|
+
"version": "0.20.1",
|
|
5
5
|
"main": "dist/stdio.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"turndown": "^7.2.4",
|
|
67
67
|
"typescript": "^5.9.2"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "52f0027db4ead40a4a311a27aefd762ed8823d47"
|
|
70
70
|
}
|