dsh-molbio-tools 0.25.0 → 0.27.0

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/lib/client.js CHANGED
@@ -622,7 +622,21 @@ window.__ModuleLoader__.load({
622
622
  * correction on the duplex entropy. An ESTIMATE for primer design: it assumes
623
623
  * a non-self-complementary duplex and standard conditions.
624
624
  */
625
- function primerTm(seq, { naMm = 50, mgMm = 0, dntpMm = 0.8, primerNm = 500 } = {}) {
625
+ /**
626
+ * Full nearest-neighbour thermodynamics of one DNA duplex: enthalpy, entropy,
627
+ * the salt-corrected entropy, ΔG at 37 °C and the melting temperature.
628
+ *
629
+ * The salt/concentration model is the SAME one the primer tools use (von Ahsen
630
+ * et al. (2001) magnesium equivalence, SantaLucia (1998) entropy correction), so
631
+ * a Tm reported here is identical to molbio_primer_tm / molbio_primer_check for
632
+ * the same sequence and conditions. Returned values are unrounded except where
633
+ * noted; callers round for display.
634
+ *
635
+ * @param {string} seq canonical DNA (A/C/G/T), at least 4 bases.
636
+ * @param {{naMm?: number, mgMm?: number, dntpMm?: number, primerNm?: number}} [conditions]
637
+ * @returns {{dh_kcal: number, ds_cal: number, ds_salt_cal: number, delta_g37_kcal: number, tm_celsius: number, na_equivalent_mm: number}}
638
+ */
639
+ function duplexThermodynamics(seq, { naMm = 50, mgMm = 0, dntpMm = 0.8, primerNm = 500 } = {}) {
626
640
  const length = seq.length;
627
641
  if (length < 4) throw new MolbioInputError(`primer must be at least 4 bases for a NN Tm estimate (got ${length})`);
628
642
  const na = Math.max(0, naMm);
@@ -652,8 +666,26 @@ window.__ModuleLoader__.load({
652
666
  const tm = (dh * 1000) / denominator - 273.15;
653
667
  if (!Number.isFinite(tm) || tm <= 0 || tm > 200) throw new MolbioInputError('Tm computation did not converge for this input');
654
668
  return {
655
- tm_celsius: Math.round(tm * 100) / 100,
656
- na_equivalent_mm: Math.round(naEquivalent * 100) / 100,
669
+ dh_kcal: dh,
670
+ ds_cal: ds,
671
+ ds_salt_cal: saltCorrectedDs,
672
+ delta_g37_kcal: deltaG37(dh, saltCorrectedDs),
673
+ tm_celsius: tm,
674
+ na_equivalent_mm: naEquivalent,
675
+ };
676
+ }
677
+
678
+ /**
679
+ * Salt-adjusted nearest-neighbour melting temperature of one primer.
680
+ * Thin rounding wrapper over duplexThermodynamics — the primer tools keep their
681
+ * published output shape, and every value they report comes from the same model
682
+ * molbio_duplex_thermo exposes.
683
+ */
684
+ function primerTm(seq, opts = {}) {
685
+ const { tm_celsius, na_equivalent_mm } = duplexThermodynamics(seq, opts);
686
+ return {
687
+ tm_celsius: Math.round(tm_celsius * 100) / 100,
688
+ na_equivalent_mm: Math.round(na_equivalent_mm * 100) / 100,
657
689
  };
658
690
  }
659
691
 
@@ -1562,6 +1594,7 @@ window.__ModuleLoader__.load({
1562
1594
  exports.enzymeCuts = enzymeCuts;
1563
1595
  exports.enzymeCatalog = enzymeCatalog;
1564
1596
  exports.digest = digest;
1597
+ exports.duplexThermodynamics = duplexThermodynamics;
1565
1598
  exports.primerTm = primerTm;
1566
1599
  exports.findRuns = findRuns;
1567
1600
  exports.findRepeats = findRepeats;
@@ -10213,6 +10246,8 @@ window.__ModuleLoader__.load({
10213
10246
  const [query, setQuery] = useState('');
10214
10247
  const [tag, setTag] = useState('');
10215
10248
  const [selectedId, setSelectedId] = useState(null);
10249
+ const keyState = useNcbiKeyState();
10250
+ const keyView = ncbiKeyView(keyState);
10216
10251
 
10217
10252
  useEffect(() => {
10218
10253
  if (cwd === undefined) {
@@ -10319,6 +10354,14 @@ window.__ModuleLoader__.load({
10319
10354
 
10320
10355
  return h('div', { style: styles.root },
10321
10356
  h('div', { style: styles.side },
10357
+ h('div', {
10358
+ key: 'ncbi-key',
10359
+ 'data-molbio-key-badge': keyView.tone,
10360
+ title: keyState.message === '' ? keyView.label : keyState.message,
10361
+ style: keyStyles.badge(keyView.tone),
10362
+ },
10363
+ h('span', { style: keyStyles.badgeDot(keyView.tone) }),
10364
+ h('span', null, keyView.label)),
10322
10365
  search,
10323
10366
  tagRow,
10324
10367
  list),
@@ -10341,6 +10384,76 @@ window.__ModuleLoader__.load({
10341
10384
  return { phase: 'ready', ...credentialInfo(response, NCBI_KEY_REF), message: '' };
10342
10385
  }
10343
10386
 
10387
+ /**
10388
+ * The last known state of the PubMed key, shared by every surface that shows it.
10389
+ *
10390
+ * The detail section reads the credential store directly because `apply` gates
10391
+ * it behind `ctx.inject(['remote.credentials'])`. The papers tab body is
10392
+ * registered unconditionally — a deployment without the credentials namespace
10393
+ * still gets the tab — so it cannot read that namespace itself. This
10394
+ * module-level snapshot is written by the gated reader and by the detail
10395
+ * section's own reads, and the host's `credentials/reference-updated` event
10396
+ * refreshes it, so the badge appears (and disappears) the moment a key is saved
10397
+ * or removed anywhere, without reopening the tab.
10398
+ */
10399
+ const ncbiKeyStore = {
10400
+ // 'unavailable' until the gated reader publishes a real answer: a deployment
10401
+ // with no credentials namespace never gets one, and the badge must not sit on
10402
+ // "checking" forever there.
10403
+ state: { phase: 'unavailable', configured: false, writable: false, message: '' },
10404
+ listeners: new Set(),
10405
+ reload: undefined,
10406
+ };
10407
+
10408
+ /** Publish a key snapshot to every mounted surface. */
10409
+ function publishNcbiKey(next) {
10410
+ ncbiKeyStore.state = next;
10411
+ for (const listener of [...ncbiKeyStore.listeners]) listener(next);
10412
+ }
10413
+
10414
+ /** Subscribe a surface to snapshot changes; returns the unsubscribe function. */
10415
+ function subscribeNcbiKey(listener) {
10416
+ ncbiKeyStore.listeners.add(listener);
10417
+ return () => { ncbiKeyStore.listeners.delete(listener); };
10418
+ }
10419
+
10420
+ /** Tone and label for a PubMed-key snapshot (the badge is a plain div). */
10421
+ function ncbiKeyView(state) {
10422
+ const tone = state.phase === 'ready'
10423
+ ? (state.configured ? 'on' : 'off')
10424
+ : state.phase === 'pending' ? 'pending' : 'error';
10425
+ const label = state.phase === 'ready'
10426
+ ? (state.configured
10427
+ ? `PubMed API key configured${state.source === undefined ? '' : ` (source: ${state.source})`}`
10428
+ : 'PubMed API key not configured in the credential store — environment keys still apply')
10429
+ : state.phase === 'pending'
10430
+ ? 'Checking the PubMed API key…'
10431
+ : 'PubMed API key status unavailable';
10432
+ return { tone, label };
10433
+ }
10434
+
10435
+ /**
10436
+ * The live PubMed-key snapshot for a panel surface.
10437
+ *
10438
+ * The detail section's status line only exists while the Plugins page is open;
10439
+ * the papers tab shows this instead, so a configured key is visible where the
10440
+ * literature work actually happens. It never shows the value — only whether the
10441
+ * store reports one configured, and where it came from.
10442
+ */
10443
+ function useNcbiKeyState() {
10444
+ const [state, setState] = useState(ncbiKeyStore.state);
10445
+ useEffect(() => {
10446
+ const unsubscribe = subscribeNcbiKey(setState);
10447
+ // Catch a publish that landed between render and subscribe, and re-read on
10448
+ // mount: the tab can be opened long after the gate's first read, and a key
10449
+ // may have been added through Settings in the meantime.
10450
+ setState(ncbiKeyStore.state);
10451
+ if (typeof ncbiKeyStore.reload === 'function') ncbiKeyStore.reload();
10452
+ return unsubscribe;
10453
+ }, []);
10454
+ return state;
10455
+ }
10456
+
10344
10457
  const keyStyles = {
10345
10458
  section: { borderTop: '1px solid rgba(127, 127, 127, 0.28)', marginTop: 16, paddingTop: 12, display: 'grid', gap: 8 },
10346
10459
  title: { margin: 0, fontSize: 14 },
@@ -10349,6 +10462,26 @@ window.__ModuleLoader__.load({
10349
10462
  row: { display: 'flex', gap: 8, alignItems: 'center', flexWrap: 'wrap' },
10350
10463
  input: { flex: '1 1 240px', minWidth: 200, padding: '4px 8px' },
10351
10464
  message: { margin: 0, fontSize: 12 },
10465
+ badge: (tone) => ({
10466
+ display: 'inline-flex',
10467
+ alignItems: 'center',
10468
+ gap: '6px',
10469
+ margin: '8px 10px 0',
10470
+ padding: '3px 8px',
10471
+ borderRadius: '10px',
10472
+ fontSize: '11px',
10473
+ lineHeight: 1.4,
10474
+ border: `1px solid ${tone === 'on' ? 'rgba(46, 125, 50, 0.45)' : tone === 'error' ? 'rgba(192, 57, 43, 0.45)' : 'var(--dsh-border, #e3e6ea)'}`,
10475
+ background: tone === 'on' ? 'rgba(46, 125, 50, 0.10)' : 'transparent',
10476
+ color: 'inherit',
10477
+ }),
10478
+ badgeDot: (tone) => ({
10479
+ width: '7px',
10480
+ height: '7px',
10481
+ flex: '0 0 7px',
10482
+ borderRadius: '50%',
10483
+ background: tone === 'on' ? '#2e7d32' : tone === 'error' ? '#c0392b' : tone === 'pending' ? '#b58900' : '#9aa4ad',
10484
+ }),
10352
10485
  };
10353
10486
 
10354
10487
  /**
@@ -10369,7 +10502,14 @@ window.__ModuleLoader__.load({
10369
10502
  useEffect(() => {
10370
10503
  if (subjectToken === '') return undefined;
10371
10504
  let live = true;
10372
- const load = () => readNcbiKey(remote).then((next) => { if (live) setState(next); });
10505
+ // Publishing the read into the shared snapshot is what keeps the papers
10506
+ // tab's badge honest: this section can be unmounted and remounted, and the
10507
+ // badge must not go stale in between.
10508
+ const load = () => readNcbiKey(remote).then((next) => {
10509
+ if (!live) return;
10510
+ setState(next);
10511
+ publishNcbiKey(next);
10512
+ });
10373
10513
  load();
10374
10514
  // Another surface may rotate or clear the same reference (Settings, the
10375
10515
  // file watcher); follow the host event instead of showing a stale badge.
@@ -10400,13 +10540,15 @@ window.__ModuleLoader__.load({
10400
10540
  const failure = remoteFailure(response);
10401
10541
  setDraft('');
10402
10542
  const next = await readNcbiKey(remote);
10403
- setState(failure !== ''
10543
+ const nextState = failure !== ''
10404
10544
  ? { ...next, phase: 'error', message: failure }
10405
10545
  : next.phase === 'error'
10406
10546
  ? next
10407
10547
  : next.configured === true
10408
10548
  ? { ...next, message: 'Saved. The next PubMed call uses this key.' }
10409
- : { ...next, phase: 'error', message: 'The host accepted the write but still reports no key configured. Restart the profile and try again.' });
10549
+ : { ...next, phase: 'error', message: 'The host accepted the write but still reports no key configured. Restart the profile and try again.' };
10550
+ setState(nextState);
10551
+ publishNcbiKey(nextState);
10410
10552
  };
10411
10553
  const remove = async () => {
10412
10554
  if (remote?.credentials === undefined || typeof remote.credentials.unset !== 'function') {
@@ -10422,13 +10564,15 @@ window.__ModuleLoader__.load({
10422
10564
  }
10423
10565
  const failure = remoteFailure(response);
10424
10566
  const next = await readNcbiKey(remote);
10425
- setState(failure !== ''
10567
+ const nextState = failure !== ''
10426
10568
  ? { ...next, phase: 'error', message: failure }
10427
10569
  : next.phase === 'error'
10428
10570
  ? next
10429
10571
  : next.configured === false
10430
10572
  ? { ...next, message: 'Removed. PubMed search falls back to web search.' }
10431
- : { ...next, phase: 'error', message: 'The host still reports a key configured after Remove.' });
10573
+ : { ...next, phase: 'error', message: 'The host still reports a key configured after Remove.' };
10574
+ setState(nextState);
10575
+ publishNcbiKey(nextState);
10432
10576
  };
10433
10577
  const status = state.phase === 'loading'
10434
10578
  ? 'Checking the credential store…'
@@ -10441,7 +10585,9 @@ window.__ModuleLoader__.load({
10441
10585
  h('h4', { style: keyStyles.title }, 'PubMed API key'),
10442
10586
  h('p', { style: keyStyles.note },
10443
10587
  'Stored in the harness credential store. molbio_pubmed_search and molbio_pubmed_abstract use it for the official PubMed E-utilities API; without it they fall back to web search.'),
10444
- h('p', { 'data-molbio-key-status': state.phase, style: keyStyles.status }, status),
10588
+ h('div', { 'data-molbio-key-status': state.phase, style: { ...keyStyles.badge(ncbiKeyView(state).tone), margin: 0 } },
10589
+ h('span', { style: keyStyles.badgeDot(ncbiKeyView(state).tone) }),
10590
+ h('span', null, status)),
10445
10591
  h('div', { style: keyStyles.row },
10446
10592
  h('input', {
10447
10593
  type: 'password',
@@ -10564,6 +10710,20 @@ window.__ModuleLoader__.load({
10564
10710
  // namespace: the section simply never registers there.
10565
10711
  ctx.effect(() => {
10566
10712
  const gate = ctx.inject(['remote.credentials'], (keyCtx) => {
10713
+ // Keep the shared badge snapshot current: read once, then follow the host
10714
+ // event a Save/Remove (here or in Settings) emits for this reference.
10715
+ const load = () => readNcbiKey(keyCtx.remote).then(publishNcbiKey);
10716
+ keyCtx.effect(() => {
10717
+ ncbiKeyStore.reload = load;
10718
+ load();
10719
+ const off = typeof keyCtx.remote.$on === 'function'
10720
+ ? keyCtx.remote.$on('credentials/reference-updated', (ref) => { if (ref === NCBI_KEY_REF) load(); })
10721
+ : undefined;
10722
+ return () => {
10723
+ ncbiKeyStore.reload = undefined;
10724
+ if (typeof off === 'function') off();
10725
+ };
10726
+ }, 'molbio panel: NCBI key status');
10567
10727
  keyCtx.effect(() => keyCtx.slots.inject('plugins.detail.section', () => keyCtx.slots.register({
10568
10728
  name: 'plugins.detail.section',
10569
10729
  id: 'molbio-ncbi-key',
package/lib.mjs CHANGED
@@ -601,7 +601,21 @@ for (const pair of Object.keys(NN_DH)) {
601
601
  * correction on the duplex entropy. An ESTIMATE for primer design: it assumes
602
602
  * a non-self-complementary duplex and standard conditions.
603
603
  */
604
- export function primerTm(seq, { naMm = 50, mgMm = 0, dntpMm = 0.8, primerNm = 500 } = {}) {
604
+ /**
605
+ * Full nearest-neighbour thermodynamics of one DNA duplex: enthalpy, entropy,
606
+ * the salt-corrected entropy, ΔG at 37 °C and the melting temperature.
607
+ *
608
+ * The salt/concentration model is the SAME one the primer tools use (von Ahsen
609
+ * et al. (2001) magnesium equivalence, SantaLucia (1998) entropy correction), so
610
+ * a Tm reported here is identical to molbio_primer_tm / molbio_primer_check for
611
+ * the same sequence and conditions. Returned values are unrounded except where
612
+ * noted; callers round for display.
613
+ *
614
+ * @param {string} seq canonical DNA (A/C/G/T), at least 4 bases.
615
+ * @param {{naMm?: number, mgMm?: number, dntpMm?: number, primerNm?: number}} [conditions]
616
+ * @returns {{dh_kcal: number, ds_cal: number, ds_salt_cal: number, delta_g37_kcal: number, tm_celsius: number, na_equivalent_mm: number}}
617
+ */
618
+ export function duplexThermodynamics(seq, { naMm = 50, mgMm = 0, dntpMm = 0.8, primerNm = 500 } = {}) {
605
619
  const length = seq.length;
606
620
  if (length < 4) throw new MolbioInputError(`primer must be at least 4 bases for a NN Tm estimate (got ${length})`);
607
621
  const na = Math.max(0, naMm);
@@ -631,8 +645,26 @@ export function primerTm(seq, { naMm = 50, mgMm = 0, dntpMm = 0.8, primerNm = 50
631
645
  const tm = (dh * 1000) / denominator - 273.15;
632
646
  if (!Number.isFinite(tm) || tm <= 0 || tm > 200) throw new MolbioInputError('Tm computation did not converge for this input');
633
647
  return {
634
- tm_celsius: Math.round(tm * 100) / 100,
635
- na_equivalent_mm: Math.round(naEquivalent * 100) / 100,
648
+ dh_kcal: dh,
649
+ ds_cal: ds,
650
+ ds_salt_cal: saltCorrectedDs,
651
+ delta_g37_kcal: deltaG37(dh, saltCorrectedDs),
652
+ tm_celsius: tm,
653
+ na_equivalent_mm: naEquivalent,
654
+ };
655
+ }
656
+
657
+ /**
658
+ * Salt-adjusted nearest-neighbour melting temperature of one primer.
659
+ * Thin rounding wrapper over duplexThermodynamics — the primer tools keep their
660
+ * published output shape, and every value they report comes from the same model
661
+ * molbio_duplex_thermo exposes.
662
+ */
663
+ export function primerTm(seq, opts = {}) {
664
+ const { tm_celsius, na_equivalent_mm } = duplexThermodynamics(seq, opts);
665
+ return {
666
+ tm_celsius: Math.round(tm_celsius * 100) / 100,
667
+ na_equivalent_mm: Math.round(na_equivalent_mm * 100) / 100,
636
668
  };
637
669
  }
638
670
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-molbio-tools",
3
- "version": "0.25.0",
4
- "description": "Zero-dependency molecular-biology plugin bundle for the DeepSeek Harness: sequence analysis, primer design (incl. cross-intron qPCR primers, TaqMan hydrolysis/MGB probes with ordering CSV and multiplex compatibility), in-silico PCR, cloning simulation, SnapGene .dna parsing and plasmid maps, Sanger verification, protein tools (incl. helical wheel, hydropathy and charge-pH plots), methylation-aware restriction analysis with double-digest buffer checks, qPCR analysis and plotting, multiple sequence alignment that conserves every input residue, conservation analysis, sequence logos, codon-usage analysis, phylogenetic trees with bootstrap support, Newick I/O and long-name label wrapping, CpG-island/GC-skew composition analysis, k-mer dotplots, read-level FASTQ QC, vector/adapter contamination screening, FASTQ trimming/filtering, batch file analysis with CSV export, silent restriction-site mutagenesis, family-aware CRISPR gRNA design (SpCas9/SaCas9/Cas12a/Cas13) with off-target search, an opt-in hand-off that shows a generated plot to the model as an attached image, plus a browser-side right-sidebar panel (plasmid maps, sequence logos, and a rotatable realistic 3D ball-and-stick/space-filling preview of PDB/mmCIF/SDF structures drawn in the Web GUI) and a literature/protocol/experiment record system.",
3
+ "version": "0.27.0",
4
+ "description": "Zero-dependency molecular-biology plugin bundle for the DeepSeek Harness: sequence analysis, primer design (incl. cross-intron qPCR primers, TaqMan hydrolysis/MGB probes with ordering CSV and multiplex compatibility, duplex thermodynamics (ΔH/ΔS/ΔG37/Tm with hairpin and dimer checks)), in-silico PCR, cloning simulation, SnapGene .dna parsing and plasmid maps, Sanger verification, protein tools (incl. helical wheel, hydropathy and charge-pH plots), methylation-aware restriction analysis with double-digest buffer checks, qPCR analysis and plotting, multiple sequence alignment that conserves every input residue, conservation analysis, sequence logos, codon-usage analysis, phylogenetic trees with bootstrap support, Newick I/O and long-name label wrapping, CpG-island/GC-skew composition analysis, k-mer dotplots, read-level FASTQ QC, vector/adapter contamination screening, FASTQ trimming/filtering, batch file analysis with CSV export, silent restriction-site mutagenesis, family-aware CRISPR gRNA design (SpCas9/SaCas9/Cas12a/Cas13) with off-target search, an opt-in hand-off that shows a generated plot to the model as an attached image, plus a browser-side right-sidebar panel (plasmid maps, sequence logos, and a rotatable realistic 3D ball-and-stick/space-filling preview of PDB/mmCIF/SDF structures drawn in the Web GUI) and a literature/protocol/experiment record system.",
5
5
  "type": "module",
6
6
  "main": "index.mjs",
7
7
  "engines": {
@@ -45,6 +45,7 @@
45
45
  "files": [
46
46
  "index.mjs",
47
47
  "lib.mjs",
48
+ "thermo.mjs",
48
49
  "design.mjs",
49
50
  "genbank.mjs",
50
51
  "plasmid.mjs",
@@ -105,7 +106,11 @@
105
106
  "0.2.1-rc.3": "compatible",
106
107
  "0.2.1-rc.4": "unknown",
107
108
  "0.2.1-rc.5": "compatible",
108
- "0.2.2-rc.1": "compatible"
109
+ "0.2.2-rc.1": "compatible",
110
+ "0.2.2-rc.2": "compatible",
111
+ "0.2.2-rc.3": "compatible",
112
+ "0.2.2-rc.4": "unknown",
113
+ "0.2.2-rc.5": "compatible"
109
114
  }
110
115
  },
111
116
  "bundle": {
@@ -48,13 +48,19 @@
48
48
  # list carries no comments of its own, so none appear below; provenance and the
49
49
  # upgrade rules live in this header.
50
50
  #
51
- # Baseline: the `standard` preset of dsh 0.2.2-rc.1 (harness root
52
- # `%APPDATA%\npm\node_modules\@deepseek-ai\dsh`, file
53
- # `node_modules/@deepseek-ai/dsh-web-app/presets/standard.patch.yml`, whose
54
- # rows live under the `preset-standard` row's `config.plugins:`).
55
- #
56
- # 0.2.2-rc.1 is the FIRST row change since 0.2.1-rc.2 dropped the optional
57
- # subagent providers and `tool-ralph`. It folded `list_agents` into
51
+ # Baseline: the `standard` preset of dsh 0.2.2-rc.5 (the installed desktop
52
+ # runtime, `resources/app.asar` →
53
+ # `dsh/node_modules/@deepseek-ai/dsh-web-app/presets/standard.patch.yml`,
54
+ # 7286 B, sha256 e40bb192…; rows live under the `preset-standard` row's
55
+ # `config.plugins:`). rc.4 and rc.5 ship it byte-identical to rc.3 / rc.2, and
56
+ # rc.2 changed the preset in exactly three places, all absorbed verbatim below: a new
57
+ # `tool-office` row
58
+ # (`@deepseek-ai/dsh-tool-office`), `customSkillDirs` on `skill-filesystem`
59
+ # (the shipped `@deepseek-ai/dsh-agent-preset/skills` directory), and
60
+ # `interrupt: false` on `tool-subagent-control`.
61
+ #
62
+ # History: 0.2.2-rc.1 was the first row change since 0.2.1-rc.2 dropped the
63
+ # optional subagent providers and `tool-ralph`. It folded `list_agents` into
58
64
  # `@deepseek-ai/dsh-tool-subagent-control` (the `./list-agents` subpath export is
59
65
  # gone, so the `tool-subagent-list-agents` row was dropped here), renamed the
60
66
  # `tool-subagent` model-selection settings to `modelSelection` +
@@ -117,6 +123,9 @@
117
123
  name: '@deepseek-ai/dsh-tool-schedule'
118
124
  - id: skill-filesystem
119
125
  name: '@deepseek-ai/dsh-skill-filesystem'
126
+ config:
127
+ customSkillDirs:
128
+ - !!js process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:path').dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@deepseek-ai/dsh-agent-preset/package.json')), 'skills')
120
129
  - id: tool-skill
121
130
  name: '@deepseek-ai/dsh-tool-skill'
122
131
  - id: command-goal
@@ -169,6 +178,8 @@
169
178
  config:
170
179
  - id: tool-subagent-control
171
180
  name: '@deepseek-ai/dsh-tool-subagent-control'
181
+ config:
182
+ interrupt: false
172
183
  - id: tool-subagent
173
184
  name: '@deepseek-ai/dsh-tool-subagent'
174
185
  config:
@@ -200,6 +211,8 @@
200
211
  searchTimeoutMs: 60000
201
212
  - id: present
202
213
  name: '@deepseek-ai/dsh-tool-present'
214
+ - id: tool-office
215
+ name: '@deepseek-ai/dsh-tool-office'
203
216
  - id: tool-plugin-manager
204
217
  name: '@deepseek-ai/dsh-plugin-manager/tools'
205
218
  disabled: true
@@ -1,2 +1,2 @@
1
1
  name: Molecular Biology Lab
2
- description: 分子生物学专属模式:标准编码能力 + 64 个 molbio_* 工具(序列分析、引物设计(含跨内含子 qPCR、盐/浓度旋钮与目标位置偏好)、TaqMan 水解探针(含 MGB 与订购 CSV)与多重 PCR 互扰/退火温度/浓度建议、克隆模拟与选酶(含 Golden Gate)、酶目录查询、甲基化敏感位点与双酶切 buffer 兼容检查、多序列比对(每个输入残基都会进比对结果)、保守性分析与比对后处理(共识/缺口修剪/同一性矩阵/逐列覆盖度,含 sequence logo 图)、CRISPR gRNA 设计(SpCas9/SaCas9/Cas12a/Cas13,家族特定 PAM/PFS/种子)与脱靶搜索、SnapGene/GenBank 解析与质粒图谱、Sanger 测序验证、蛋白性质/电荷-pH 曲线/密码子优化/螺旋轮投影与疏水性图、qPCR 与绘图、虚拟凝胶、实验台分析(FASTQ 质控、密码子使用、系统发生树(长叶名自动折行)、in-silico PCR、CpG/GC 组成、序列 dotplot、载体/接头污染筛查、FASTQ 修剪/过滤、批量文件分析/CSV)、静默酶切位点突变设计——生成的 SVG 图片自动用系统默认应用打开,文献/协议/实验记录)。
2
+ description: 分子生物学专属模式:标准编码能力 + 65 个 molbio_* 工具(序列分析、引物设计(含跨内含子 qPCR、盐/浓度旋钮与目标位置偏好)、TaqMan 水解探针(含 MGB 与订购 CSV)与多重 PCR 互扰/退火温度/浓度建议、克隆模拟与选酶(含 Golden Gate)、酶目录查询、甲基化敏感位点与双酶切 buffer 兼容检查、多序列比对(每个输入残基都会进比对结果)、保守性分析与比对后处理(共识/缺口修剪/同一性矩阵/逐列覆盖度,含 sequence logo 图)、CRISPR gRNA 设计(SpCas9/SaCas9/Cas12a/Cas13,家族特定 PAM/PFS/种子)与脱靶搜索、SnapGene/GenBank 解析与质粒图谱、Sanger 测序验证、蛋白性质/电荷-pH 曲线/密码子优化/螺旋轮投影与疏水性图、qPCR 与绘图、虚拟凝胶、实验台分析(FASTQ 质控、密码子使用、系统发生树(长叶名自动折行)、in-silico PCR、CpG/GC 组成、序列 dotplot、载体/接头污染筛查、FASTQ 修剪/过滤、批量文件分析/CSV)、静默酶切位点突变设计——生成的 SVG 图片自动用系统默认应用打开,文献/协议/实验记录)。
package/test/client.mjs CHANGED
@@ -156,6 +156,7 @@ assert.deepEqual(effects, [
156
156
  'molbio panel: molbio_sequence_logo card',
157
157
  'molbio panel: molbio_grna_design card',
158
158
  'molbio panel: NCBI key section gate',
159
+ 'molbio panel: NCBI key status',
159
160
  'molbio panel: NCBI key section',
160
161
  ]);
161
162
  assert.deepEqual(injectedDeps, [['remote.credentials']], 'the key section waits for the credentials Remote namespace');
package/test/contract.mjs CHANGED
@@ -236,8 +236,16 @@ check('a session-scope tab body receives sessionId + useSessions (official prece
236
236
  /function [A-Za-z_$][\w$]*\(\{(?=[^}]*\buseTabInfo\b)(?=[^}]*\bsessionId\b)(?=[^}]*\buseSessions\b)/,
237
237
  'the official tab body receives useTabInfo + sessionId + useSessions from its props',
238
238
  );
239
- assert.ok(files.text.includes('useSessions((sessions) => sessions.byId[sessionId]?.cwd)'), 'and reads the workspace root exactly as the panel does');
240
- assert.ok(files.text.includes('"slots"') && files.text.includes('"sidebarRightTabs"'), 'and injects the same registries');
239
+ // The desktop distribution ships this bundle MINIFIED: `useSessions(sessions=>…)`
240
+ // (no parameter parentheses, no spaces) and template-literal registry names.
241
+ // Pin the CALL, not the npm build's spelling.
242
+ assert.match(
243
+ files.text,
244
+ /useSessions\(\s*\(?\s*sessions\s*\)?\s*=>\s*sessions\.byId\[sessionId\]\?\.cwd\s*\)/,
245
+ 'and reads the workspace root exactly as the panel does',
246
+ );
247
+ assert.match(files.text, /["'\x60]slots["'\x60]/, 'and injects the slot registry');
248
+ assert.match(files.text, /["'\x60]sidebarRightTabs["'\x60]/, 'and the right-sidebar tab registry');
241
249
  });
242
250
 
243
251
  check('the sessions root hook is provided by the session client package', () => {
@@ -250,7 +258,7 @@ check('the sessions root hook is provided by the session client package', () =>
250
258
  assert.ok(PROVIDE_ROOT_HOOKS.test(session.text), 'it contributes root hooks');
251
259
  assert.ok(PROVIDE_ROOT_SESSIONS.test(session.text), 'the root hook source is named `sessions`');
252
260
  // `sessions` -> `useSessions` under the rule asserted above.
253
- assert.ok(session.text.includes('installScope("session"'), 'and installs the session scope those props belong to');
261
+ assert.match(session.text, /installScope\(\s*["'\x60]session["'\x60]/, 'and installs the session scope those props belong to');
254
262
  });
255
263
 
256
264
  // The two assertions above read a MINIFIED bundle, so they must survive the
@@ -306,7 +314,7 @@ check('workspaceFiles exposes list / read / readBytes on the host Remote', () =>
306
314
 
307
315
  check('official client packages call the same workspaceFiles methods', () => {
308
316
  const files = clientBundle('@deepseek-ai/dsh-client-ui-sidebar-files');
309
- assert.ok(files.text.includes('remote.workspaceFiles.list(sessionId, path, signal)'), 'ui-sidebar-files calls list(sessionId, path, signal)');
317
+ assert.match(files.text, /workspaceFiles\.list\(\s*sessionId\s*,\s*path\s*,\s*signal\s*\)/, 'ui-sidebar-files calls list(sessionId, path, signal)');
310
318
  const docPreview = clientBundle('@deepseek-ai/dsh-client-ui-sidebar-documentpreview');
311
319
  if (docPreview !== undefined) {
312
320
  const usesRead = /workspaceFiles\.read(All|Bytes)?\(/.exec(docPreview.text);
@@ -499,7 +507,7 @@ check('the toolview card contract still holds (meta path + keyed seat)', () => {
499
507
  assert.ok(toolUi.text.includes('tool.call.toolview'), 'the toolview seat is still declared');
500
508
  const card = clientBundle('@deepseek-ai/dsh-client-ui-deliverables');
501
509
  assert.ok(card !== undefined && card.text.includes('tool.call.toolview'), 'a shipped package still registers a toolview');
502
- assert.ok(/key:\s*"present"/.test(card.text), 'keyed by the tool name');
510
+ assert.match(card.text, /key:\s*["'\x60]present["'\x60]/, 'keyed by the tool name');
503
511
 
504
512
  // This package's own side: the projection exists on exactly the tools the
505
513
  // bundle claims cards for (through the loop over MAP_TOOL_KEYS, so assert the
@@ -553,15 +561,15 @@ check('every seat claim waits for the declaration (slots.inject, not a bare regi
553
561
 
554
562
  const renderer = clientBundle('@deepseek-ai/dsh-client-ui-renderer');
555
563
  assert.ok(renderer !== undefined, 'ui-renderer is installed (it owns the client slots service)');
556
- assert.ok(renderer.text.includes('inject(key, callback)'), 'the slots service still exposes inject(key, callback)');
557
- assert.ok(renderer.text.includes('this._core.specDynamic(key)'), 'and runs the callback only once the seat is declared');
564
+ assert.match(renderer.text, /inject\(\s*key\s*,\s*callback\s*\)/, 'the slots service still exposes inject(key, callback)');
565
+ assert.match(renderer.text, /this\._core\.specDynamic\(\s*key\s*\)/, 'and runs the callback only once the seat is declared');
558
566
 
559
567
  // The shipped packages claim our very seats this way.
560
568
  const toolUi = clientBundle('@deepseek-ai/dsh-client-ui-tool');
561
- assert.ok(/slots\.inject\(\s*"tool\.call\.toolview"/.test(toolUi.text), 'ui-tool waits for tool.call.toolview');
569
+ assert.match(toolUi.text, /slots\.inject\(\s*["'\x60]tool\.call\.toolview["'\x60]/, 'ui-tool waits for tool.call.toolview');
562
570
  const preview = clientBundle('@deepseek-ai/dsh-client-ui-sidebar-documentpreview');
563
571
  if (preview !== undefined) {
564
- assert.ok(/slots\.inject\(\s*"sidebar\.right\.pane\.tab"/.test(preview.text), 'the document preview waits for the tab seat');
572
+ assert.match(preview.text, /slots\.inject\(\s*["'\x60]sidebar\.right\.pane\.tab["'\x60]/, 'the document preview waits for the tab seat');
565
573
  }
566
574
 
567
575
  // Our artifact: every `register` must sit inside a wait for that same seat.
@@ -25,11 +25,11 @@
25
25
  * Usage: node test/drift-probe.mjs [--dsh <harness root>]
26
26
  */
27
27
  import assert from 'node:assert/strict';
28
- import { existsSync } from 'node:fs';
28
+ import { existsSync, readFileSync } from 'node:fs';
29
29
  import { dirname, join, resolve } from 'node:path';
30
30
  import { fileURLToPath } from 'node:url';
31
31
 
32
- import { compositionDrift, toolCountDrift, presetPlugins, asPresetPatch, relativeSpecifiers, presetOrderDeclared, orderCollisions, specifierProblem } from './preset-health.mjs';
32
+ import { compositionDrift, toolCountDrift, presetPlugins, asPresetPatch, relativeSpecifiers, presetOrderDeclared, orderCollisions, specifierProblem, compatibilityProblems } from './preset-health.mjs';
33
33
  // The three helpers this probe used to carry its own copies of. Duplicating
34
34
  // `findHarnessRoot` was the worst of them: the probe could resolve a DIFFERENT
35
35
  // harness than `preset-health` validated against, so a mutation experiment could
@@ -253,6 +253,28 @@ check('an order collision with a shipped preset is caught, a free number is not'
253
253
  assert.match(collision[0], /order 2 is already taken by the shipped preset "ptc" \(ptc\.patch\.yml\)/, collision[0]);
254
254
  });
255
255
 
256
+ check('a manifest that does not declare the installed harness is caught', () => {
257
+ const version = JSON.parse(readFileSync(join(harnessRoot, 'package.json'), 'utf8')).version;
258
+ const real = JSON.parse(readFileSync(join(repoRoot, 'package.json'), 'utf8'));
259
+ const panel = JSON.parse(readFileSync(join(repoRoot, 'packages', 'molbio-panel', 'package.json'), 'utf8'));
260
+ assert.deepEqual(compatibilityProblems([real, panel], version), [], 'the shipped manifests declare the harness under test');
261
+ const absent = JSON.parse(JSON.stringify(real));
262
+ delete absent.dsh.compatibility.dshReleases[version];
263
+ assert.match(compatibilityProblems([absent], version).join('\n'), /declares dsh \S+ as absent/);
264
+ });
265
+
266
+ check('a manifest that downgrades the installed harness to unknown is caught', () => {
267
+ const version = JSON.parse(readFileSync(join(harnessRoot, 'package.json'), 'utf8')).version;
268
+ const real = JSON.parse(readFileSync(join(repoRoot, 'package.json'), 'utf8'));
269
+ const downgraded = JSON.parse(JSON.stringify(real));
270
+ downgraded.dsh.compatibility.dshReleases[version] = 'unknown';
271
+ assert.match(compatibilityProblems([downgraded], version).join('\n'), /as "unknown"/);
272
+ // A manifest from another package (the panel) is checked independently.
273
+ const panel = JSON.parse(readFileSync(join(repoRoot, 'packages', 'molbio-panel', 'package.json'), 'utf8'));
274
+ panel.dsh.compatibility.dshReleases[version] = 'compatible';
275
+ assert.deepEqual(compatibilityProblems([panel], version), []);
276
+ });
277
+
256
278
  console.log('');
257
279
  if (failed > 0) {
258
280
  console.error(`drift-probe FAILED: ${failed} check(s) — the preset drift guard is not doing its job`);
@@ -739,6 +739,42 @@ const library = {
739
739
  harness.unmount();
740
740
  }
741
741
 
742
+ // ── the persistent PubMed-key badge in the papers tab ──────────────────────
743
+
744
+ {
745
+ // A key present in the store: read it once through the detail section (that
746
+ // read publishes the shared snapshot), then open the papers tab. The badge
747
+ // must be there without reopening Plugins, and must never show the value.
748
+ const claim = slots.registrations.find((entry) => entry.registration.name === 'plugins.detail.section');
749
+ const subject = { kind: 'bundle', pkg: { name: 'dsh-molbio-tools' } };
750
+ const configured = {
751
+ async describe() {
752
+ return { ok: true, value: { NCBI_API_KEY: { configured: true, writable: true, source: 'file' } } };
753
+ },
754
+ };
755
+ // The tab's own mount re-reads through the gate's reload, so the injected
756
+ // Remote has to answer the same way as the snapshot published below.
757
+ ctx.remote.credentials = configured;
758
+ const wrapper = claim.component({ subject, remote: configured });
759
+ const sectionHarness = mount(wrapper.type);
760
+ globalThis.__molbioTestHooks = sectionHarness;
761
+ sectionHarness.setProps({ subject, remote: configured });
762
+ await sectionHarness.render();
763
+ await flush();
764
+ sectionHarness.unmount();
765
+
766
+ const files = remote({ [`${CWD}/${DEFAULT_LIBRARY_FILE}`]: JSON.stringify(library) });
767
+ globalThis.__molbioTestHooks = mount(PapersPanel);
768
+ const harness = globalThis.__molbioTestHooks;
769
+ harness.setProps({ sessionId: SESSION, remote: files, useSessions });
770
+ await harness.render();
771
+ const badge = elements(harness.tree, 'div').find((node) => node.props?.['data-molbio-key-badge'] !== undefined);
772
+ assert.ok(badge !== undefined, 'the papers tab carries a persistent PubMed key badge');
773
+ assert.equal(badge.props['data-molbio-key-badge'], 'on', 'a configured key turns the badge on');
774
+ assert.match(texts(badge).join(''), /PubMed API key configured \(source: file\)/, 'the badge names the state and its source, never the value');
775
+ harness.unmount();
776
+ }
777
+
742
778
  // ── effects are disposed on unmount ─────────────────────────────────────────
743
779
 
744
780
  {