@actiondock/mcp 2.5.1 → 2.6.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/dist/adapter.js CHANGED
@@ -190,8 +190,14 @@ export async function resolveTarget(options) {
190
190
  rootDir: projectRoot,
191
191
  });
192
192
  }
193
- catch {
194
- // 优雅降级:未安装 @actiondock/runtime-node 时回退 core 默认平台
193
+ catch (err) {
194
+ // 仅「模块不存在」类错误允许降级回退 core 默认平台;
195
+ // 其余异常(加载后初始化失败等)原样上抛,避免吞没真实故障
196
+ const isModuleMissing = err?.code === "ERR_MODULE_NOT_FOUND" ||
197
+ /Cannot find (?:package|module)/i.test(String(err?.message || ""));
198
+ if (!isModuleMissing) {
199
+ throw err;
200
+ }
195
201
  }
196
202
  }
197
203
  for (const pkg of packages) {
@@ -212,6 +218,9 @@ export async function resolveTarget(options) {
212
218
  hostOptions: {
213
219
  autoLoadCurrentProject: packages.length === 0,
214
220
  },
221
+ // MCP 服务进程是长驻执行宿主,声明数据目录持有者身份,
222
+ // 打开时收割遗留孤儿运行记录
223
+ recoverOrphans: true,
215
224
  customHome: options.customHome,
216
225
  dataDir: options.dataDir,
217
226
  platform,
@@ -416,8 +425,9 @@ export async function createActionDockMcpServer(options = {}) {
416
425
  });
417
426
  }
418
427
  }
419
- catch {
420
- // 忽略规程获取或注册异常
428
+ catch (err) {
429
+ // 规程获取或注册失败不中断适配器启动,但输出诊断行保留排障线索
430
+ console.error(`[actiondock-mcp] Failed to register playbook resources/prompts: ${err?.message || String(err)}`);
421
431
  }
422
432
  // 服务生命周期:默认 close 仅关闭 MCP 服务本身,不级联 target——
423
433
  // SDK 传输层(HTTP 每请求 / stdio 探测回落)会销毁工厂产物,若 close 级联会误杀共享 target;
@@ -96,8 +96,9 @@ export function registerTasksExtension(server, target) {
96
96
  limit = Math.min(Math.max(params.limit, 1), MAX_TASK_LIST_LIMIT);
97
97
  }
98
98
  const actionId = params.actionId;
99
+ // limit 单处截断:下推到 target.listRuns 的 limit 参数,此处不再重复 slice
99
100
  const runs = await target.listRuns({ limit, actionId });
100
101
  const ordered = [...runs].sort((a, b) => toTimeMillis(b.startedAt) - toTimeMillis(a.startedAt));
101
- return { tasks: ordered.slice(0, limit).map(toMcpTaskPayload) };
102
+ return { tasks: ordered.map(toMcpTaskPayload) };
102
103
  });
103
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actiondock/mcp",
3
- "version": "2.5.1",
3
+ "version": "2.6.0",
4
4
  "description": "ActionDock MCP Adapter for exposing Actions as Model Context Protocol (MCP) Tools",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -29,12 +29,12 @@
29
29
  "test": "node ../../scripts/run-tests.ts"
30
30
  },
31
31
  "dependencies": {
32
- "@actiondock/core": "^2.5.1",
33
- "@actiondock/sdk": "^2.5.1",
32
+ "@actiondock/core": "^2.6.0",
33
+ "@actiondock/sdk": "^2.6.0",
34
34
  "@modelcontextprotocol/server": "^2.0.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@actiondock/runtime-node": "^2.5.1"
37
+ "@actiondock/runtime-node": "^2.6.0"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "@actiondock/runtime-node": {