dsh-mcp-servers 1.0.260817

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.
@@ -0,0 +1,3 @@
1
+ - insert:
2
+ - id: mcp-servers
3
+ name: dsh-mcp-servers
@@ -0,0 +1,23 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import Schema from '@deepseek-ai/schemastery';
3
+ export declare const name = "mcp-servers";
4
+ export declare const inject: string[];
5
+ export interface McpServerConfig {
6
+ id: string;
7
+ enabled: boolean;
8
+ type: 'stdio' | 'http' | 'sse';
9
+ command?: string;
10
+ args?: string[];
11
+ env?: Record<string, string>;
12
+ url?: string;
13
+ headers?: Record<string, string>;
14
+ }
15
+ export interface Config {
16
+ servers: McpServerConfig[];
17
+ webdavUrl?: string;
18
+ webdavUser?: string;
19
+ webdavPass?: string;
20
+ webdavDaily?: boolean;
21
+ }
22
+ export declare const Config: Schema<Config>;
23
+ export declare function apply(ctx: Context): void;
package/dist/index.js ADDED
@@ -0,0 +1,473 @@
1
+ import Schema from '@deepseek-ai/schemastery';
2
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
3
+ import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
4
+ import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
5
+ import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
6
+ import { sanitizeSchema } from './sanitize.js';
7
+ export const name = 'mcp-servers';
8
+ export const inject = ['tools', 'settings'];
9
+ // 'mcp' as a nominal SettingsNamespace; the brand is type-only so a cast suffices.
10
+ const NS = 'mcp';
11
+ function sendJson(res, code, body) {
12
+ res.writeHead(code, { 'content-type': 'application/json' });
13
+ res.end(JSON.stringify(body));
14
+ }
15
+ function readJson(req) {
16
+ return new Promise((resolve, reject) => {
17
+ const chunks = [];
18
+ req.on('data', (c) => chunks.push(c));
19
+ req.on('end', () => {
20
+ try {
21
+ resolve(JSON.parse(Buffer.concat(chunks).toString('utf8') || '{}'));
22
+ }
23
+ catch (err) {
24
+ reject(err);
25
+ }
26
+ });
27
+ req.on('error', reject);
28
+ });
29
+ }
30
+ /** The config route carries env/headers that may hold tokens — loopback only. */
31
+ function isLoopback(req) {
32
+ const host = req.headers.host ?? '';
33
+ return /^(127\.0\.0\.1|localhost|\[::1\])(:\d+)?$/i.test(host);
34
+ }
35
+ /** Keep error surfaces readable (e.g. a Cloudflare challenge page dumped as the body). */
36
+ function shortErr(err) {
37
+ const msg = err instanceof Error ? err.message : String(err);
38
+ return msg.length > 160 ? msg.slice(0, 160) + '…' : msg;
39
+ }
40
+ function createTransport(server) {
41
+ if (server.type === 'stdio') {
42
+ return new StdioClientTransport({
43
+ command: server.command ?? '',
44
+ args: server.args ?? [],
45
+ env: server.env,
46
+ stderr: 'pipe',
47
+ });
48
+ }
49
+ if (server.type === 'sse') {
50
+ return new SSEClientTransport(new URL(server.url ?? ''), {
51
+ requestInit: { headers: server.headers },
52
+ });
53
+ }
54
+ return new StreamableHTTPClientTransport(new URL(server.url ?? ''), {
55
+ requestInit: { headers: server.headers },
56
+ });
57
+ }
58
+ /** Backup payload size bounds, mirroring dsh-market's WebDAV conventions. */
59
+ const MAX_DOWNLOAD_BYTES = 2 * 1024 * 1024;
60
+ const MAX_UPLOAD_BYTES = 64 * 1024;
61
+ /**
62
+ * One WebDAV round trip: https-only, Basic auth via header (credentials are
63
+ * never allowed in the URL), size-capped.
64
+ */
65
+ async function webdavRequest(url, username, password, method, body) {
66
+ const parsed = new URL(url);
67
+ if (parsed.protocol !== 'https:')
68
+ throw new Error('WebDAV requires an https:// URL');
69
+ if (parsed.username !== '' || parsed.password !== '')
70
+ throw new Error('credentials must be passed separately, not in the URL');
71
+ const headers = {};
72
+ if (username !== '')
73
+ headers.authorization = `Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`;
74
+ if (method === 'PUT')
75
+ headers['content-type'] = 'application/json';
76
+ // ponytail: body is capped after the fact rather than mid-stream; fine at these sizes.
77
+ const response = await fetch(parsed, { method, headers, body: method === 'PUT' ? body : undefined });
78
+ if (!response.ok)
79
+ throw new Error(`WebDAV ${method} failed: HTTP ${response.status}`);
80
+ const text = await response.text();
81
+ if (Buffer.byteLength(text) > MAX_DOWNLOAD_BYTES)
82
+ throw new Error('WebDAV response is too large');
83
+ return text;
84
+ }
85
+ // This schema is registered as the `mcp` settings namespace, so the Web UI
86
+ // settings page renders it automatically (schema-driven form). Edits land in
87
+ // the user settings document and the plugin reconnects live.
88
+ export const Config = Schema.object({
89
+ webdavUrl: Schema.string().description('WebDAV endpoint for backup sync (https only).'),
90
+ webdavUser: Schema.string().description('WebDAV username (optional).'),
91
+ webdavPass: Schema.string().role('secret').description('WebDAV password (stored locally, never sent to the browser).'),
92
+ webdavDaily: Schema.boolean().default(false).description('Push a backup to WebDAV every day at 12:00 PM.'),
93
+ servers: Schema.array(Schema.object({
94
+ id: Schema.string().required().description('Unique server id; also the tool-name prefix.'),
95
+ enabled: Schema.boolean().default(true),
96
+ type: Schema.union(['stdio', 'http', 'sse']).default('stdio'),
97
+ command: Schema.string().description('Executable to spawn for stdio servers.'),
98
+ args: Schema.array(Schema.string()).default([]),
99
+ env: Schema.dict(Schema.string()).default({}),
100
+ url: Schema.string().description('Endpoint URL for HTTP servers.'),
101
+ headers: Schema.dict(Schema.string()).default({}),
102
+ })).default([]),
103
+ }).description('Model Context Protocol servers exposed as Harness tools');
104
+ export function apply(ctx) {
105
+ ctx.logger?.info('[mcp-servers] loaded');
106
+ const scope = ctx.settings.register(NS, Config);
107
+ const connections = new Map();
108
+ const status = new Map();
109
+ let generation = 0;
110
+ let disposed = false;
111
+ // Per-server reconnect bookkeeping: only the dropped server is retried, so
112
+ // one flaky server never tears down (and re-registers) the whole fleet.
113
+ const pendingReconnects = new Map();
114
+ const reconnectAttempts = new Map();
115
+ const clearPending = () => {
116
+ for (const timer of pendingReconnects.values())
117
+ clearTimeout(timer);
118
+ pendingReconnects.clear();
119
+ };
120
+ const scheduleReconnect = (id) => {
121
+ if (disposed || pendingReconnects.has(id))
122
+ return;
123
+ // Exponential backoff so a flapping server doesn't hammer the host.
124
+ const attempts = reconnectAttempts.get(id) ?? 0;
125
+ const delay = Math.min(30000, 2000 * 2 ** attempts);
126
+ reconnectAttempts.set(id, attempts + 1);
127
+ pendingReconnects.set(id, setTimeout(() => {
128
+ pendingReconnects.delete(id);
129
+ if (!disposed)
130
+ void reconnectServer(id);
131
+ }, delay));
132
+ };
133
+ const reconnectServer = async (id) => {
134
+ const server = scope.get().servers.find((s) => s.id === id);
135
+ if (!server || !server.enabled || connections.has(id))
136
+ return;
137
+ try {
138
+ const conn = await connectServer(server);
139
+ if (disposed || connections.has(id)) {
140
+ for (const dispose of conn.disposers)
141
+ dispose();
142
+ await conn.client.close();
143
+ return;
144
+ }
145
+ connections.set(id, conn);
146
+ status.set(id, { ok: true });
147
+ reconnectAttempts.delete(id);
148
+ ctx.logger?.info(`[mcp] ${id}: reconnected, ${conn.toolCount} tools`);
149
+ }
150
+ catch (err) {
151
+ status.set(id, { ok: false, error: shortErr(err) });
152
+ scheduleReconnect(id);
153
+ }
154
+ };
155
+ const connectServer = async (server) => {
156
+ const client = new Client({ name: 'dsh-mcp', version: '1.0.0' });
157
+ await client.connect(createTransport(server));
158
+ const { tools } = await client.listTools();
159
+ const disposers = [];
160
+ for (const tool of tools) {
161
+ const fullName = `${server.id}_${tool.name}`;
162
+ const definition = {
163
+ name: fullName,
164
+ description: tool.description ?? `MCP tool ${tool.name} (server ${server.id})`,
165
+ parameters: sanitizeSchema(tool.inputSchema),
166
+ output: {
167
+ schema: {},
168
+ render: (_args, value) => [{ type: 'text', text: renderResult(value) }],
169
+ },
170
+ async execute(args, exec) {
171
+ return client.callTool({ name: tool.name, arguments: args }, undefined, { signal: exec.signal });
172
+ },
173
+ };
174
+ try {
175
+ disposers.push(ctx.tools.register(definition));
176
+ }
177
+ catch (err) {
178
+ // one bad schema must not drop the whole server; register the rest
179
+ ctx.logger?.warn(`[mcp] ${server.id}: skipped tool ${tool.name}: ${err instanceof Error ? err.message : err}`);
180
+ }
181
+ }
182
+ const conn = { client, disposers, toolCount: disposers.length, closing: false };
183
+ // Real-time status: a dropped transport (child process exit, network loss)
184
+ // unregisters the tools and marks the server down until the next start().
185
+ client.onclose = () => { if (!conn.closing)
186
+ onDisconnect(server.id, 'connection closed'); };
187
+ client.onerror = (err) => { if (!conn.closing)
188
+ onDisconnect(server.id, shortErr(err)); };
189
+ return conn;
190
+ };
191
+ const onDisconnect = (id, reason) => {
192
+ const conn = connections.get(id);
193
+ if (!conn)
194
+ return;
195
+ connections.delete(id);
196
+ conn.closing = true;
197
+ for (const dispose of conn.disposers) {
198
+ try {
199
+ dispose();
200
+ }
201
+ catch { /* already gone */ }
202
+ }
203
+ void conn.client.close().catch(() => { });
204
+ status.set(id, { ok: false, error: reason });
205
+ // The server may still be up (idle drop / transient blip) — bring it back.
206
+ scheduleReconnect(id);
207
+ };
208
+ const stopAll = async () => {
209
+ for (const conn of connections.values()) {
210
+ conn.closing = true;
211
+ for (const dispose of conn.disposers) {
212
+ try {
213
+ dispose();
214
+ }
215
+ catch { /* already gone */ }
216
+ }
217
+ try {
218
+ await conn.client.close();
219
+ }
220
+ catch { /* already closed */ }
221
+ }
222
+ connections.clear();
223
+ };
224
+ const start = async () => {
225
+ clearPending();
226
+ const gen = ++generation;
227
+ await stopAll();
228
+ if (gen !== generation)
229
+ return;
230
+ // Statuses are preserved across reconnects — stopAll flags intentional
231
+ // closes, so a single server's transient drop must not flash everyone red.
232
+ // Connect all servers concurrently; each awaits independently so one slow
233
+ // server (spawning npx, cold SSE handshake) doesn't delay the others.
234
+ await Promise.all(scope.get().servers.map(async (server) => {
235
+ if (gen !== generation)
236
+ return;
237
+ if (!server.enabled) {
238
+ status.set(server.id, { ok: false, error: 'disabled' });
239
+ return;
240
+ }
241
+ try {
242
+ const conn = await connectServer(server);
243
+ if (gen !== generation) {
244
+ for (const dispose of conn.disposers)
245
+ dispose();
246
+ await conn.client.close();
247
+ return;
248
+ }
249
+ connections.set(server.id, conn);
250
+ status.set(server.id, { ok: true });
251
+ reconnectAttempts.delete(server.id);
252
+ ctx.logger?.info(`[mcp] ${server.id}: registered ${conn.toolCount} tools`);
253
+ }
254
+ catch (err) {
255
+ status.set(server.id, { ok: false, error: shortErr(err) });
256
+ ctx.logger?.warn(`[mcp] ${server.id}: connect failed: ${shortErr(err)}`);
257
+ scheduleReconnect(server.id);
258
+ }
259
+ }));
260
+ };
261
+ // Daily WebDAV backup at 12:00 PM local time; reschedules itself on each run.
262
+ let dailyTimer = null;
263
+ const runDailyBackup = async () => {
264
+ const cfg = scope.get();
265
+ if (!cfg.webdavUrl)
266
+ return;
267
+ const payload = JSON.stringify({ version: 1, servers: cfg.servers });
268
+ if (Buffer.byteLength(payload) > MAX_UPLOAD_BYTES) {
269
+ ctx.logger?.warn('[mcp] daily backup too large, skipping');
270
+ return;
271
+ }
272
+ try {
273
+ await webdavRequest(cfg.webdavUrl, cfg.webdavUser ?? '', cfg.webdavPass ?? '', 'PUT', payload);
274
+ ctx.logger?.info('[mcp] daily backup pushed to WebDAV');
275
+ }
276
+ catch (err) {
277
+ ctx.logger?.warn(`[mcp] daily backup failed: ${shortErr(err)}`);
278
+ }
279
+ };
280
+ const scheduleDaily = () => {
281
+ if (dailyTimer)
282
+ clearTimeout(dailyTimer);
283
+ dailyTimer = null;
284
+ const cfg = scope.get();
285
+ if (!cfg.webdavDaily || !cfg.webdavUrl)
286
+ return;
287
+ const next = new Date();
288
+ next.setHours(12, 0, 0, 0);
289
+ if (next.getTime() <= Date.now())
290
+ next.setDate(next.getDate() + 1);
291
+ dailyTimer = setTimeout(() => { void runDailyBackup(); scheduleDaily(); }, next.getTime() - Date.now());
292
+ };
293
+ const startWithSchedule = async () => { await start(); scheduleDaily(); };
294
+ ctx.effect(() => {
295
+ void startWithSchedule();
296
+ const unwatch = scope.watch(() => { void startWithSchedule(); });
297
+ return () => {
298
+ disposed = true;
299
+ unwatch();
300
+ void stopAll();
301
+ if (dailyTimer)
302
+ clearTimeout(dailyTimer);
303
+ clearPending();
304
+ };
305
+ });
306
+ // HTTP routes for the settings-page form. webServer is optional (web
307
+ // profiles only), so acquire it lazily instead of failing CLI profiles.
308
+ ctx.inject(['webServer'], (hostCtx) => {
309
+ const webServer = hostCtx.webServer;
310
+ hostCtx.effect(() => {
311
+ const disposers = [
312
+ webServer.register({
313
+ kind: 'exact',
314
+ path: '/mcp-servers/config',
315
+ handler: (req, res) => {
316
+ if (!isLoopback(req)) {
317
+ sendJson(res, 403, { error: 'loopback only' });
318
+ return;
319
+ }
320
+ if (req.method === 'GET') {
321
+ const cfg = scope.get();
322
+ // webdavPass is a secret — never sent to the browser.
323
+ sendJson(res, 200, {
324
+ servers: cfg.servers,
325
+ status: Object.fromEntries(status),
326
+ webdavUrl: cfg.webdavUrl ?? '',
327
+ webdavUser: cfg.webdavUser ?? '',
328
+ webdavDaily: cfg.webdavDaily === true,
329
+ });
330
+ return;
331
+ }
332
+ if (req.method !== 'POST') {
333
+ sendJson(res, 405, { error: 'method not allowed' });
334
+ return;
335
+ }
336
+ readJson(req)
337
+ .then((body) => {
338
+ const patch = {};
339
+ if ('servers' in body) {
340
+ if (!Array.isArray(body.servers)) {
341
+ sendJson(res, 400, { error: 'expected { servers: [...] }' });
342
+ return;
343
+ }
344
+ patch.servers = body.servers;
345
+ }
346
+ if ('webdavUrl' in body) {
347
+ if (typeof body.webdavUrl !== 'string') {
348
+ sendJson(res, 400, { error: 'webdavUrl must be a string' });
349
+ return;
350
+ }
351
+ patch.webdavUrl = body.webdavUrl;
352
+ }
353
+ if ('webdavUser' in body) {
354
+ if (typeof body.webdavUser !== 'string') {
355
+ sendJson(res, 400, { error: 'webdavUser must be a string' });
356
+ return;
357
+ }
358
+ patch.webdavUser = body.webdavUser;
359
+ }
360
+ if ('webdavPass' in body) {
361
+ if (typeof body.webdavPass !== 'string') {
362
+ sendJson(res, 400, { error: 'webdavPass must be a string' });
363
+ return;
364
+ }
365
+ patch.webdavPass = body.webdavPass;
366
+ }
367
+ if ('webdavDaily' in body) {
368
+ if (typeof body.webdavDaily !== 'boolean') {
369
+ sendJson(res, 400, { error: 'webdavDaily must be a boolean' });
370
+ return;
371
+ }
372
+ patch.webdavDaily = body.webdavDaily;
373
+ }
374
+ if (Object.keys(patch).length === 0) {
375
+ sendJson(res, 400, { error: 'empty update' });
376
+ return;
377
+ }
378
+ return scope.update(patch);
379
+ })
380
+ .then(() => sendJson(res, 200, { ok: true }))
381
+ .catch((err) => sendJson(res, 500, { error: err instanceof Error ? err.message : String(err) }));
382
+ },
383
+ }),
384
+ webServer.register({
385
+ kind: 'exact',
386
+ path: '/mcp-servers/test',
387
+ handler: (req, res) => {
388
+ if (!isLoopback(req)) {
389
+ sendJson(res, 403, { error: 'loopback only' });
390
+ return;
391
+ }
392
+ if (req.method !== 'POST') {
393
+ sendJson(res, 405, { error: 'method not allowed' });
394
+ return;
395
+ }
396
+ readJson(req)
397
+ .then(async (body) => {
398
+ const server = body.server;
399
+ if (!server || typeof server !== 'object') {
400
+ sendJson(res, 400, { error: 'expected { server: {...} }' });
401
+ return;
402
+ }
403
+ // ponytail: test reconnects and lists tools; no registration.
404
+ const client = new Client({ name: 'dsh-mcp', version: '1.0.0' });
405
+ // Bound the test so a hanging spawn can't stall the HTTP
406
+ // response (npx cold-start downloads can be slow).
407
+ const timer = setTimeout(() => { void client.close().catch(() => { }); }, 30000);
408
+ try {
409
+ await client.connect(createTransport(server));
410
+ const { tools } = await client.listTools();
411
+ clearTimeout(timer);
412
+ sendJson(res, 200, { ok: true, tools: tools.length });
413
+ }
414
+ catch (err) {
415
+ clearTimeout(timer);
416
+ try {
417
+ await client.close();
418
+ }
419
+ catch { /* already gone */ }
420
+ sendJson(res, 200, { ok: false, error: shortErr(err) });
421
+ }
422
+ })
423
+ .catch((err) => sendJson(res, 500, { error: err instanceof Error ? err.message : String(err) }));
424
+ },
425
+ }),
426
+ webServer.register({
427
+ kind: 'exact',
428
+ path: '/mcp-servers/webdav',
429
+ handler: (req, res) => {
430
+ if (!isLoopback(req)) {
431
+ sendJson(res, 403, { error: 'loopback only' });
432
+ return;
433
+ }
434
+ if (req.method !== 'POST') {
435
+ sendJson(res, 405, { error: 'method not allowed' });
436
+ return;
437
+ }
438
+ readJson(req)
439
+ .then(async (body) => {
440
+ const { url, username, password, direction, body: payload } = body;
441
+ if (typeof url !== 'string' || (direction !== 'upload' && direction !== 'download')) {
442
+ sendJson(res, 400, { error: 'expected { url, direction: upload|download }' });
443
+ return;
444
+ }
445
+ const uploadBody = direction === 'upload' ? String(payload ?? '') : undefined;
446
+ if (uploadBody !== undefined && Buffer.byteLength(uploadBody) > MAX_UPLOAD_BYTES) {
447
+ sendJson(res, 400, { error: 'backup is too large' });
448
+ return;
449
+ }
450
+ const text = await webdavRequest(url, String(username ?? ''), String(password ?? ''), direction === 'upload' ? 'PUT' : 'GET', uploadBody);
451
+ sendJson(res, 200, { ok: true, body: direction === 'download' ? text : undefined });
452
+ })
453
+ .catch((err) => sendJson(res, 500, { error: err instanceof Error ? err.message : String(err) }));
454
+ },
455
+ }),
456
+ ];
457
+ return () => { for (const dispose of disposers)
458
+ dispose(); };
459
+ }, 'mcp-servers: http routes');
460
+ });
461
+ }
462
+ // ponytail: image/resource blocks collapse to text. If a UI wants rich blocks, render them per block type here.
463
+ function renderResult(value) {
464
+ const r = value;
465
+ if (!r || !Array.isArray(r.content))
466
+ return JSON.stringify(value);
467
+ const texts = r.content.filter((b) => b.type === 'text' && b.text).map((b) => b.text);
468
+ if (texts.length)
469
+ return texts.join('\n');
470
+ if (r.structuredContent !== undefined)
471
+ return JSON.stringify(r.structuredContent);
472
+ return JSON.stringify(value);
473
+ }
@@ -0,0 +1 @@
1
+ export declare function sanitizeSchema(schema: unknown): unknown;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * MCP input schemas are JSON Schema draft 2020-12; the Harness tool registry
3
+ * enforces a narrower subset (see the `JsonSchemaNode` reference). This
4
+ * whitelist-strips every node down to the supported keys so registration
5
+ * never rejects a schema the MCP server only annotated.
6
+ */
7
+ const SUPPORTED_KEYS = new Set([
8
+ 'type', 'oneOf', 'properties', 'required', 'additionalProperties',
9
+ 'items', 'enum', 'const', 'description', 'title', 'default', 'examples',
10
+ ]);
11
+ export function sanitizeSchema(schema) {
12
+ if (!schema || typeof schema !== 'object' || Array.isArray(schema))
13
+ return schema;
14
+ const out = {};
15
+ for (const [key, value] of Object.entries(schema)) {
16
+ if (!SUPPORTED_KEYS.has(key))
17
+ continue;
18
+ if (key === 'properties' && value && typeof value === 'object' && !Array.isArray(value)) {
19
+ const props = {};
20
+ for (const [k, v] of Object.entries(value))
21
+ props[k] = sanitizeSchema(v);
22
+ out.properties = props;
23
+ }
24
+ else if (key === 'items') {
25
+ out.items = sanitizeSchema(value);
26
+ }
27
+ else if (key === 'oneOf' && Array.isArray(value)) {
28
+ out.oneOf = value.map(sanitizeSchema);
29
+ }
30
+ else if (key === 'additionalProperties' && typeof value === 'boolean') {
31
+ // schema-form additionalProperties is not supported; drop it (stays open).
32
+ out[key] = value;
33
+ }
34
+ else if (key !== 'additionalProperties') {
35
+ out[key] = value;
36
+ }
37
+ }
38
+ return out;
39
+ }
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "dsh-mcp-servers",
3
+ "version": "1.0.260817",
4
+ "description": "DeepSeek Harness bundle: expose Model Context Protocol (MCP) servers as Harness tools",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./client": "./client/client.js",
15
+ "./cordis.patch.yml": "./cordis.patch.yml",
16
+ "./package.json": "./package.json"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "client",
21
+ "cordis.patch.yml",
22
+ "README.md",
23
+ "LICENSE"
24
+ ],
25
+ "scripts": {
26
+ "version": "node scripts/bump-version.mjs",
27
+ "build": "npm run version && tsc -p tsconfig.json && tsdown",
28
+ "prepare": "npm run version && tsc -p tsconfig.json && tsdown",
29
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit",
30
+ "check": "npm run typecheck && tsx test/sanitize.test.ts",
31
+ "pack": "npm pack",
32
+ "publish:npm": "npm publish"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public",
36
+ "registry": "https://registry.npmjs.org/"
37
+ },
38
+ "dsh": {
39
+ "bundle": {
40
+ "patch": "./cordis.patch.yml"
41
+ },
42
+ "client": {
43
+ "platform": "web",
44
+ "inject": [
45
+ "@deepseek-ai/dsh-client-runtime",
46
+ "@deepseek-ai/dsh-client-ui-slots",
47
+ "@deepseek-ai/dsh-client-ui-settings"
48
+ ]
49
+ }
50
+ },
51
+ "dependencies": {
52
+ "@deepseek-ai/schemastery": "^3.18.1",
53
+ "@modelcontextprotocol/sdk": "^1.30.0"
54
+ },
55
+ "devDependencies": {
56
+ "@deepseek-ai/cordis": "^4.0.1",
57
+ "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.6",
58
+ "@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
59
+ "@deepseek-ai/dsh-llm": "^0.0.1-rc.1",
60
+ "@deepseek-ai/dsh-settings": "^0.0.1-rc.1",
61
+ "@deepseek-ai/dsh-tools": "^0.0.1-rc.1",
62
+ "@types/node": "^20.0.0",
63
+ "@types/react": "^18.3.1",
64
+ "react": "^18.3.1",
65
+ "tsdown": "^0.22.14",
66
+ "tsx": "^4.0.0",
67
+ "typescript": "^5.0.0"
68
+ }
69
+ }