dsh-mcp-ops 0.1.4 → 0.1.5

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
@@ -24,17 +24,17 @@ DeepSeek Harness(dsh)插件:在设置页管理 MCP 服务。
24
24
  ## 安装说明
25
25
 
26
26
  ```sh
27
- # 已发布到 npm 仓库
28
- dsh plugin --profile web add dsh-mcp-ops
27
+ # 已发布到 npm 仓库(固定版本;不写 @<版本> 则装 latest)
28
+ dsh plugin --profile web add dsh-mcp-ops@0.1.5
29
29
 
30
30
  # 或本地 tarball(pnpm pack 的产物)
31
- dsh plugin --profile web add /path/to/dsh-mcp-ops-0.1.4.tgz
31
+ dsh plugin --profile web add /path/to/dsh-mcp-ops-0.1.5.tgz
32
32
 
33
33
  # 卸载
34
34
  dsh plugin --profile web remove dsh-mcp-ops
35
35
  ```
36
36
 
37
- **支持的 dsh 版本**:`0.2.1-rc.2`、`0.2.1-alpha.4`、`0.2.1-alpha.2`、`0.2.1-alpha.1`、`0.2.0-rc.2`(即 `0.2.0-rc.2` 起的全部 `0.2.x`)。
37
+ **支持的 dsh 版本**:`0.2.1-rc.3`、`0.2.1-rc.2`、`0.2.1-alpha.4`、`0.2.1-alpha.2`、`0.2.1-alpha.1`、`0.2.0-rc.2`(即 `0.2.0-rc.2` 起的全部 `0.2.x`)。
38
38
 
39
39
  本包声明了 `dsh.bundle`,官方流程会自动把依赖写进 profile 的 `package.json` 并登记进
40
40
  `dsh.profile.bundles`,包内的 `cordis.patch.yml` 作为 bundle 层自动应用 —— 不需要手工编辑任何
@@ -70,7 +70,7 @@ docs/ 详细设计与官方依赖落点
70
70
 
71
71
  ```sh
72
72
  pnpm run --config.verify-deps-before-run=false build && pnpm pack --pack-destination docker &&
73
- docker build --progress=plain -t founder/dsh-mcp-ops:0.1.4 -f docker/Dockerfile docker/ &&
73
+ docker build --progress=plain -t founder/dsh-mcp-ops:0.1.5 -f docker/Dockerfile docker/ &&
74
74
  HOME=/home/ubuntu docker compose -f docker/docker-compose.yaml --project-directory docker up -d --force-recreate
75
75
 
76
76
  node docker/verify.mjs # 容器端到端(装配终态 / 启动日志 / 服务侧 sync / locale 元数据 / 客户端产物)
@@ -99,8 +99,8 @@ npm publish --dry-run --registry=https://registry.npmjs.org/
99
99
  npm publish --registry=https://registry.npmjs.org/ --access public
100
100
 
101
101
  # 4) 发布后核对并打 tag
102
- npm view dsh-mcp-ops@0.1.4 --registry=https://registry.npmjs.org/
103
- git tag -a v0.1.4 -m "dsh-mcp-ops 0.1.4" && git push origin v0.1.4
102
+ npm view dsh-mcp-ops@0.1.5 --registry=https://registry.npmjs.org/
103
+ git tag -a v0.1.5 -m "dsh-mcp-ops 0.1.5" && git push origin v0.1.5
104
104
  ```
105
105
 
106
106
  72 小时内可 `npm unpublish dsh-mcp-ops@<版本>` 撤回;超时只能 `npm deprecate`。
package/lib/client.js CHANGED
@@ -678,6 +678,7 @@ __export(util_exports, {
678
678
  required: () => required,
679
679
  safeExtend: () => safeExtend,
680
680
  shallowClone: () => shallowClone,
681
+ sizeCaps: () => sizeCaps,
681
682
  slugify: () => slugify,
682
683
  stringifyPrimitive: () => stringifyPrimitive,
683
684
  toZod: () => toZod,
@@ -1197,6 +1198,18 @@ function prefixIssues(path, issues) {
1197
1198
  function unwrapMessage(message) {
1198
1199
  return typeof message === "string" ? message : message?.message;
1199
1200
  }
1201
+ function sizeCaps(defChecks) {
1202
+ const caps = [];
1203
+ for (const ch of defChecks ?? []) {
1204
+ const d = ch._zod.def;
1205
+ if (!/_(length|size)$|_equals$/.test(d.check))
1206
+ break;
1207
+ const max = d.maximum ?? d.length ?? d.size;
1208
+ if (max >= 0)
1209
+ caps.push([max, ch]);
1210
+ }
1211
+ return caps;
1212
+ }
1200
1213
  function attachSchema(issues, start, inst) {
1201
1214
  var _a3;
1202
1215
  for (let i = start; i < issues.length; i++) {
@@ -2617,7 +2630,7 @@ ${content.join("\n")}
2617
2630
  var version = {
2618
2631
  major: 4,
2619
2632
  minor: 6,
2620
- patch: 5
2633
+ patch: 7
2621
2634
  };
2622
2635
 
2623
2636
  // ../../../.local/lib/node_modules/zod/v4/core/schemas.js
@@ -3373,6 +3386,31 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
3373
3386
  return payload;
3374
3387
  };
3375
3388
  });
3389
+ function capSize(inst, size) {
3390
+ const caps = sizeCaps(inst._zod.def.checks);
3391
+ if (!caps.length)
3392
+ return;
3393
+ const cap = Math.min(...caps.map((c) => c[0]));
3394
+ const parse3 = inst._zod.parse;
3395
+ inst._zod.parse = (payload, ctx) => {
3396
+ const n = size(payload.value);
3397
+ if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
3398
+ for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
3399
+ if (n > max && ch._zod.def.when(payload)) {
3400
+ const start = payload.issues.length;
3401
+ ch._zod.check(payload);
3402
+ payload.issues[start].continue = false;
3403
+ attachSchema(payload.issues, start, inst);
3404
+ return payload;
3405
+ }
3406
+ }
3407
+ }
3408
+ return parse3(payload, ctx);
3409
+ };
3410
+ }
3411
+ var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
3412
+ var mapSize = (input2) => input2 instanceof Map ? input2.size : -1;
3413
+ var setSize = (input2) => input2 instanceof Set ? input2.size : -1;
3376
3414
  function handleArrayResult(result, final, index) {
3377
3415
  if (result.issues.length) {
3378
3416
  final.issues.push(...prefixIssues(index, result.issues));
@@ -3416,6 +3454,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
3416
3454
  }
3417
3455
  return payload;
3418
3456
  };
3457
+ capSize(inst, arraySize);
3419
3458
  });
3420
3459
  function handlePropertyResult(result, final, key, input2, optin, optout) {
3421
3460
  const isPresent = key in input2;
@@ -4372,6 +4411,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
4372
4411
  return Promise.all(proms).then(() => payload);
4373
4412
  return payload;
4374
4413
  };
4414
+ capSize(inst, mapSize);
4375
4415
  });
4376
4416
  function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
4377
4417
  if (keyResult.issues.length) {
@@ -4438,6 +4478,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
4438
4478
  return Promise.all(proms).then(() => payload);
4439
4479
  return payload;
4440
4480
  };
4481
+ capSize(inst, setSize);
4441
4482
  });
4442
4483
  function handleSetResult(result, final) {
4443
4484
  if (result.issues.length) {
@@ -13968,9 +14009,15 @@ function generateNullableCheck(doc, ctx, schema, accessor, buildsValue = true) {
13968
14009
  doc.write(`}`);
13969
14010
  return outputVar;
13970
14011
  }
14012
+ function generateSizeGate(doc, schema, size) {
14013
+ for (const [max, check2] of sizeCaps(schema._zod.def.checks)) {
14014
+ doc.write(`if (${size} > ${numericOperand(max, check2._zod.def.check)}) return INVALID;`);
14015
+ }
14016
+ }
13971
14017
  function generateArrayCheck(doc, ctx, schema, accessor, buildsValue = true) {
13972
14018
  const def = schema._zod.def;
13973
14019
  doc.write(`if (!Array.isArray(${accessor})) return INVALID;`);
14020
+ generateSizeGate(doc, schema, `${accessor}.length`);
13974
14021
  const outputVar = buildsValue ? newVar(ctx) : null;
13975
14022
  const iVar = newVar(ctx);
13976
14023
  const elemVar = newVar(ctx);
@@ -14370,6 +14417,7 @@ function literalPropertyKey(ctx, key) {
14370
14417
  function generateMapCheck(doc, ctx, schema, accessor) {
14371
14418
  const def = schema._zod.def;
14372
14419
  doc.write(`if (!(${accessor} instanceof Map)) return INVALID;`);
14420
+ generateSizeGate(doc, schema, `${accessor}.size`);
14373
14421
  const outputVar = newVar(ctx);
14374
14422
  const kVar = newVar(ctx);
14375
14423
  const valVar = newVar(ctx);
@@ -14386,6 +14434,7 @@ function generateMapCheck(doc, ctx, schema, accessor) {
14386
14434
  function generateSetCheck(doc, ctx, schema, accessor) {
14387
14435
  const def = schema._zod.def;
14388
14436
  doc.write(`if (!(${accessor} instanceof Set)) return INVALID;`);
14437
+ generateSizeGate(doc, schema, `${accessor}.size`);
14389
14438
  const outputVar = newVar(ctx);
14390
14439
  const valVar = newVar(ctx);
14391
14440
  doc.write(`const ${outputVar} = new Set();`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mcp-ops",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "MCP 服务管理:增删改查与启停、连接测试、工具按需检索与全量注入、进程级与服务级环境变量(含密钥);MCP service management: CRUD, connection tests, tool injection, environment variables and secrets",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",