@actiondock/core 2.7.0 → 2.8.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.
Files changed (236) hide show
  1. package/README.md +61 -68
  2. package/dist/catalog/action-catalog.d.ts +56 -0
  3. package/dist/catalog/action-catalog.js +202 -0
  4. package/dist/catalog/discovery.d.ts +60 -0
  5. package/dist/catalog/discovery.js +119 -0
  6. package/dist/catalog/graph.d.ts +190 -0
  7. package/dist/catalog/graph.js +589 -0
  8. package/dist/catalog/index.d.ts +5 -5
  9. package/dist/catalog/index.js +5 -5
  10. package/dist/catalog/resolve-action.d.ts +43 -0
  11. package/dist/catalog/resolve-action.js +119 -0
  12. package/dist/catalog/resolve-playbook.d.ts +26 -0
  13. package/dist/catalog/resolve-playbook.js +114 -0
  14. package/dist/doctor/checks/project.js +27 -8
  15. package/dist/doctor/checks/registry.js +2 -2
  16. package/dist/doctor/checks/runtime.js +34 -1
  17. package/dist/errors.d.ts +102 -10
  18. package/dist/errors.js +103 -10
  19. package/dist/execution/service.d.ts +18 -16
  20. package/dist/execution/service.js +183 -252
  21. package/dist/execution/types.d.ts +25 -69
  22. package/dist/execution/types.js +2 -1
  23. package/dist/filter/intent.d.ts +8 -9
  24. package/dist/filter/intent.js +49 -10
  25. package/dist/graph/index.d.ts +4 -0
  26. package/dist/graph/index.js +4 -0
  27. package/dist/host/host.d.ts +74 -32
  28. package/dist/host/host.js +585 -336
  29. package/dist/host/routing.d.ts +15 -48
  30. package/dist/host/routing.js +90 -153
  31. package/dist/host/types.d.ts +50 -17
  32. package/dist/index.d.ts +21 -24
  33. package/dist/index.js +19 -23
  34. package/dist/input/advice.d.ts +5 -1
  35. package/dist/input/advice.js +163 -214
  36. package/dist/input/describe.d.ts +1 -1
  37. package/dist/input/flat-errors.d.ts +5 -6
  38. package/dist/input/flat-errors.js +6 -6
  39. package/dist/input/flat-materializer.js +42 -44
  40. package/dist/invocation/index.d.ts +2 -0
  41. package/dist/invocation/index.js +2 -0
  42. package/dist/invocation/policy.d.ts +157 -0
  43. package/dist/invocation/policy.js +231 -0
  44. package/dist/invocation/types.d.ts +172 -0
  45. package/dist/invocation/types.js +97 -0
  46. package/dist/ipc/diagnostic.d.ts +0 -12
  47. package/dist/ipc/diagnostic.js +0 -21
  48. package/dist/ipc/host.d.ts +4 -4
  49. package/dist/ipc/host.js +44 -47
  50. package/dist/ipc/index.d.ts +1 -1
  51. package/dist/ipc/index.js +1 -1
  52. package/dist/ipc/service.d.ts +40 -0
  53. package/dist/ipc/service.js +349 -0
  54. package/dist/ipc/types.d.ts +21 -15
  55. package/dist/node/index.d.ts +1 -0
  56. package/dist/node/index.js +1 -0
  57. package/dist/node/module-loader.d.ts +63 -0
  58. package/dist/node/module-loader.js +112 -0
  59. package/dist/package/index.d.ts +23 -0
  60. package/dist/package/index.js +18 -0
  61. package/dist/{app/app.d.ts → package/runtime.d.ts} +41 -20
  62. package/dist/{app/app.js → package/runtime.js} +140 -95
  63. package/dist/{app → package}/static-index.js +58 -41
  64. package/dist/package/storage-view.d.ts +13 -0
  65. package/dist/package/storage-view.js +22 -0
  66. package/dist/{app → package}/types.d.ts +76 -57
  67. package/dist/package/types.js +22 -0
  68. package/dist/platform/index.d.ts +1 -1
  69. package/dist/platform/index.js +1 -1
  70. package/dist/platform/node.d.ts +48 -0
  71. package/dist/platform/node.js +96 -0
  72. package/dist/platform/types.d.ts +0 -9
  73. package/dist/process/control-arbiter.d.ts +2 -1
  74. package/dist/process/control-arbiter.js +1 -2
  75. package/dist/process/driver.d.ts +9 -8
  76. package/dist/process/driver.js +11 -22
  77. package/dist/process/index.d.ts +2 -0
  78. package/dist/process/index.js +2 -0
  79. package/dist/process/managed-record.d.ts +2 -2
  80. package/dist/process/process-driver.d.ts +109 -0
  81. package/dist/process/process-driver.js +650 -0
  82. package/dist/process/process-executor.d.ts +47 -0
  83. package/dist/process/process-executor.js +296 -0
  84. package/dist/process/process-manager.js +48 -26
  85. package/dist/process/run-executor.js +12 -12
  86. package/dist/profile/client-actions.js +2 -2
  87. package/dist/profile/client-health.js +2 -2
  88. package/dist/profile/client-query.js +5 -6
  89. package/dist/profile/client-transport.d.ts +19 -17
  90. package/dist/profile/client-transport.js +47 -80
  91. package/dist/profile/client.d.ts +2 -2
  92. package/dist/profile/client.js +1 -1
  93. package/dist/profile/index.d.ts +1 -0
  94. package/dist/profile/index.js +1 -0
  95. package/dist/profile/manager.d.ts +5 -0
  96. package/dist/profile/manager.js +41 -6
  97. package/dist/project/closure.js +2 -2
  98. package/dist/project/index.d.ts +8 -1
  99. package/dist/project/index.js +10 -1
  100. package/dist/project/init.js +2 -2
  101. package/dist/project/loader.d.ts +1 -1
  102. package/dist/project/loader.js +26 -29
  103. package/dist/project/transactions.js +5 -10
  104. package/dist/registry/index.d.ts +3 -1
  105. package/dist/registry/index.js +2 -1
  106. package/dist/registry/lock.d.ts +28 -7
  107. package/dist/registry/lock.js +136 -16
  108. package/dist/registry/registry.d.ts +1 -5
  109. package/dist/registry/registry.js +1 -53
  110. package/dist/registry/scan.d.ts +0 -15
  111. package/dist/registry/scan.js +0 -59
  112. package/dist/registry/store.d.ts +42 -0
  113. package/dist/registry/store.js +43 -0
  114. package/dist/registry/types.d.ts +0 -24
  115. package/dist/runtime/action-collection.d.ts +1 -1
  116. package/dist/runtime/action-registry.d.ts +0 -4
  117. package/dist/runtime/action-registry.js +0 -7
  118. package/dist/runtime/context.js +5 -11
  119. package/dist/runtime/events.js +3 -6
  120. package/dist/runtime/identity.d.ts +22 -0
  121. package/dist/runtime/identity.js +10 -0
  122. package/dist/runtime/index.d.ts +1 -2
  123. package/dist/runtime/index.js +1 -2
  124. package/dist/runtime/module-loader.d.ts +2 -34
  125. package/dist/runtime/module-loader.js +1 -16
  126. package/dist/runtime/process.d.ts +6 -24
  127. package/dist/runtime/process.js +1 -118
  128. package/dist/runtime/run-persistence.js +2 -5
  129. package/dist/runtime/runner.d.ts +33 -93
  130. package/dist/runtime/runner.js +132 -364
  131. package/dist/runtime/standalone.d.ts +23 -8
  132. package/dist/runtime/standalone.js +100 -147
  133. package/dist/server/body.d.ts +16 -8
  134. package/dist/server/body.js +33 -16
  135. package/dist/server/dispatcher.d.ts +6 -10
  136. package/dist/server/dispatcher.js +24 -32
  137. package/dist/server/http-server.d.ts +87 -0
  138. package/dist/server/http-server.js +304 -0
  139. package/dist/server/index.d.ts +11 -0
  140. package/dist/server/index.js +10 -0
  141. package/dist/server/mcp-endpoint.d.ts +61 -0
  142. package/dist/server/mcp-endpoint.js +118 -0
  143. package/dist/server/routes/actions.js +34 -28
  144. package/dist/server/routes/common.d.ts +10 -14
  145. package/dist/server/routes/common.js +32 -56
  146. package/dist/server/routes/config.js +54 -64
  147. package/dist/server/routes/doctor.d.ts +1 -1
  148. package/dist/server/routes/doctor.js +10 -18
  149. package/dist/server/routes/health.d.ts +1 -1
  150. package/dist/server/routes/health.js +2 -3
  151. package/dist/server/routes/info.d.ts +2 -2
  152. package/dist/server/routes/info.js +12 -13
  153. package/dist/server/routes/playbooks.js +16 -29
  154. package/dist/server/routes/runs.js +95 -117
  155. package/dist/server/routes/state.js +63 -62
  156. package/dist/server/server.d.ts +2 -2
  157. package/dist/server/server.js +43 -227
  158. package/dist/server/types.d.ts +8 -19
  159. package/dist/service/factory.d.ts +12 -0
  160. package/dist/service/factory.js +85 -0
  161. package/dist/{target → service}/index.d.ts +1 -1
  162. package/dist/{target → service}/index.js +1 -1
  163. package/dist/service/local.d.ts +27 -0
  164. package/dist/service/local.js +138 -0
  165. package/dist/{target → service}/remote-errors.d.ts +3 -6
  166. package/dist/service/remote-errors.js +38 -0
  167. package/dist/{target → service}/remote-polling.d.ts +2 -2
  168. package/dist/{target → service}/remote-polling.js +8 -8
  169. package/dist/service/remote.d.ts +34 -0
  170. package/dist/service/remote.js +634 -0
  171. package/dist/service/sse-stream.d.ts +24 -0
  172. package/dist/service/sse-stream.js +139 -0
  173. package/dist/service/types.d.ts +272 -0
  174. package/dist/service/types.js +32 -0
  175. package/dist/storage/data-dir-lock.js +10 -5
  176. package/dist/storage/driver.d.ts +2 -1
  177. package/dist/storage/driver.js +3 -52
  178. package/dist/storage/index.d.ts +1 -0
  179. package/dist/storage/index.js +1 -0
  180. package/dist/storage/lock-core.d.ts +2 -6
  181. package/dist/storage/lock-core.js +4 -17
  182. package/dist/storage/params.d.ts +2 -8
  183. package/dist/storage/params.js +2 -8
  184. package/dist/storage/sqlite-driver.d.ts +40 -0
  185. package/dist/storage/sqlite-driver.js +116 -0
  186. package/dist/storage/sqlite.js +21 -6
  187. package/dist/storage/types.d.ts +4 -4
  188. package/dist/storage/types.js +2 -2
  189. package/dist/utils/index.d.ts +53 -0
  190. package/dist/utils/index.js +99 -4
  191. package/dist/utils/process.d.ts +10 -0
  192. package/dist/utils/process.js +21 -0
  193. package/dist/version.d.ts +1 -1
  194. package/dist/version.js +1 -1
  195. package/package.json +41 -3
  196. package/dist/app/index.d.ts +0 -2
  197. package/dist/app/index.js +0 -2
  198. package/dist/app/types.js +0 -1
  199. package/dist/catalog/action-index.d.ts +0 -9
  200. package/dist/catalog/action-index.js +0 -95
  201. package/dist/catalog/action-resolver.d.ts +0 -20
  202. package/dist/catalog/action-resolver.js +0 -95
  203. package/dist/catalog/location-registry.d.ts +0 -15
  204. package/dist/catalog/location-registry.js +0 -138
  205. package/dist/catalog/package-catalog.d.ts +0 -7
  206. package/dist/catalog/package-catalog.js +0 -77
  207. package/dist/catalog/types.d.ts +0 -68
  208. package/dist/catalog/types.js +0 -1
  209. package/dist/export/index.d.ts +0 -1
  210. package/dist/export/index.js +0 -1
  211. package/dist/export/templates.d.ts +0 -71
  212. package/dist/export/templates.js +0 -635
  213. package/dist/ipc/target.d.ts +0 -74
  214. package/dist/ipc/target.js +0 -365
  215. package/dist/platform/default.d.ts +0 -38
  216. package/dist/platform/default.js +0 -78
  217. package/dist/project/resolver.d.ts +0 -116
  218. package/dist/project/resolver.js +0 -376
  219. package/dist/registry/resolve.d.ts +0 -62
  220. package/dist/registry/resolve.js +0 -195
  221. package/dist/runtime/execution-manager.d.ts +0 -48
  222. package/dist/runtime/execution-manager.js +0 -66
  223. package/dist/runtime/package-runner-factory.d.ts +0 -82
  224. package/dist/runtime/package-runner-factory.js +0 -186
  225. package/dist/target/local.d.ts +0 -53
  226. package/dist/target/local.js +0 -349
  227. package/dist/target/remote-errors.js +0 -51
  228. package/dist/target/remote.d.ts +0 -86
  229. package/dist/target/remote.js +0 -818
  230. package/dist/target/target.d.ts +0 -6
  231. package/dist/target/target.js +0 -37
  232. package/dist/target/types.d.ts +0 -261
  233. package/dist/target/types.js +0 -35
  234. /package/dist/{app → package}/static-index.d.ts +0 -0
  235. /package/dist/{target → service}/sse-parser.d.ts +0 -0
  236. /package/dist/{target → service}/sse-parser.js +0 -0
@@ -0,0 +1,138 @@
1
+ import { parseActionRef } from "../catalog/resolve-action.js";
2
+ import { CloseTimeoutError, } from "./types.js";
3
+ /**
4
+ * 本地 ActionDockService 实现。
5
+ * 遵循标准 Service Ports 体系,面向 ActionDockHost 协调中枢提供结构化服务端口,
6
+ * 严禁暴露 unwrap 穿透到内部领域对象。
7
+ */
8
+ export class LocalActionDockService {
9
+ host;
10
+ discovery;
11
+ execution;
12
+ runs;
13
+ events;
14
+ management;
15
+ constructor(host, options) {
16
+ this.host = host;
17
+ const self = this;
18
+ this.discovery = {
19
+ async listPackages() {
20
+ return self.host.info();
21
+ },
22
+ async listActions(opts) {
23
+ return self.host.listActions(opts);
24
+ },
25
+ async describeAction(ref) {
26
+ return self.host.describeAction(ref);
27
+ },
28
+ async listPlaybooks(opts) {
29
+ return self.host.listPlaybooks(opts);
30
+ },
31
+ async describePlaybook(id) {
32
+ return self.host.describePlaybook(id);
33
+ },
34
+ };
35
+ this.execution = {
36
+ async run(ref, input, opts) {
37
+ const actionRef = typeof ref === "string" ? parseActionRef(ref) : ref;
38
+ const cleanOpts = {
39
+ signal: opts?.signal,
40
+ timeoutMs: opts?.timeoutMs,
41
+ config: opts?.config,
42
+ requestId: opts?.requestId,
43
+ };
44
+ return self.host.runAction(actionRef, (input ?? {}), cleanOpts);
45
+ },
46
+ async start(ref, input, opts) {
47
+ const actionRef = typeof ref === "string" ? parseActionRef(ref) : ref;
48
+ const cleanOpts = {
49
+ signal: opts?.signal,
50
+ timeoutMs: opts?.timeoutMs,
51
+ config: opts?.config,
52
+ requestId: opts?.requestId,
53
+ };
54
+ return self.host.startAction(actionRef, (input ?? {}), cleanOpts);
55
+ },
56
+ };
57
+ this.runs = {
58
+ async list(query) {
59
+ return self.host.listRuns(query);
60
+ },
61
+ async get(runId) {
62
+ return self.host.getRun(runId);
63
+ },
64
+ async cancel(runId, reason) {
65
+ return self.host.cancelRun(runId, reason);
66
+ },
67
+ async clear(opts) {
68
+ return self.host.clearRuns(opts);
69
+ },
70
+ };
71
+ this.events = {
72
+ events(runId, opts) {
73
+ return self.host.events(runId, opts);
74
+ },
75
+ };
76
+ if (options?.enableManagement !== false) {
77
+ this.management = {
78
+ config: {
79
+ async get(packageId, key) {
80
+ return self.host.getConfig(packageId, key);
81
+ },
82
+ async set(packageId, key, value) {
83
+ return self.host.setConfig(packageId, key, value);
84
+ },
85
+ async delete(packageId, key) {
86
+ return self.host.deleteConfig(packageId, key);
87
+ },
88
+ async list(packageId) {
89
+ return self.host.listConfig(packageId);
90
+ },
91
+ },
92
+ state: {
93
+ async get(packageId, actionId, key, opts) {
94
+ return self.host.getState(packageId, actionId, key, opts);
95
+ },
96
+ async set(packageId, actionId, key, value, opts) {
97
+ return self.host.setState(packageId, actionId, key, value, opts);
98
+ },
99
+ async delete(packageId, actionId, key, opts) {
100
+ return self.host.deleteState(packageId, actionId, key, opts);
101
+ },
102
+ async list(packageId, actionId, opts) {
103
+ return self.host.listStateKeys(packageId, actionId, opts);
104
+ },
105
+ async clear(packageId, actionId, opts) {
106
+ return self.host.clearState(packageId, actionId, opts);
107
+ },
108
+ async listEntries(packageId, opts) {
109
+ return self.host.listStateEntries(packageId, opts);
110
+ },
111
+ },
112
+ };
113
+ }
114
+ }
115
+ async info() {
116
+ return this.discovery.listPackages();
117
+ }
118
+ async close(options) {
119
+ const timeout = options?.timeoutMs ?? options?.graceMs;
120
+ if (timeout && timeout > 0) {
121
+ let timer;
122
+ const timeoutPromise = new Promise((_, reject) => {
123
+ timer = setTimeout(() => {
124
+ reject(new CloseTimeoutError(`Service close operation timed out after ${timeout}ms`));
125
+ }, timeout);
126
+ });
127
+ try {
128
+ await Promise.race([this.host.close(options), timeoutPromise]);
129
+ }
130
+ finally {
131
+ if (timer)
132
+ clearTimeout(timer);
133
+ }
134
+ return;
135
+ }
136
+ return this.host.close(options);
137
+ }
138
+ }
@@ -2,20 +2,17 @@
2
2
  * 远端通信错误翻译层。
3
3
  *
4
4
  * 职责单一:将 profile/client 传输层抛出的底层异常翻译为统一的
5
- * TargetError 结构化异常,供 RemoteActionDockTarget 各操作边界复用;
5
+ * 结构化异常,供 RemoteActionDockService 各操作边界复用;
6
6
  * 优先读取传输层透传的结构化错误码,无法识别时原样透传。
7
7
  */
8
8
  /**
9
- * 将远端通信异常包装翻译为统一的 TargetError。
9
+ * 将远端通信异常包装翻译为统一的异常。
10
10
  *
11
11
  * 无法识别的异常按防御与透明原则原样抛出,严禁静默吞没。
12
12
  */
13
13
  export declare function wrapRemoteError(err: any): never;
14
14
  /**
15
15
  * 判定远端状态键访问异常是否为键不存在。
16
- *
17
- * 优先读取传输层透传的结构化错误码(fetchRemoteJson 会将响应体 error.code
18
- * 附加到抛出异常的 code 字段),仅当旧版服务器未透传 code 时回退到
19
- * HTTP 状态与消息文本兼容嗅探。
16
+ * 读取结构化错误码与 HTTP 状态码。
20
17
  */
21
18
  export declare function isRemoteStateKeyNotFound(err: any): boolean;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * 远端通信错误翻译层。
3
+ *
4
+ * 职责单一:将 profile/client 传输层抛出的底层异常翻译为统一的
5
+ * 结构化异常,供 RemoteActionDockService 各操作边界复用;
6
+ * 优先读取传输层透传的结构化错误码,无法识别时原样透传。
7
+ */
8
+ import { CAPABILITY_UNAVAILABLE, STATE_KEY_NOT_FOUND } from "../errors.js";
9
+ import { PROTOCOL_UNSUPPORTED, SERVICE_RESULT_UNKNOWN, ServiceError, } from "./types.js";
10
+ /**
11
+ * 将远端通信异常包装翻译为统一的异常。
12
+ *
13
+ * 无法识别的异常按防御与透明原则原样抛出,严禁静默吞没。
14
+ */
15
+ export function wrapRemoteError(err) {
16
+ const code = err?.code || "";
17
+ if (code === "CAPABILITY_UNAVAILABLE" ||
18
+ code === "TARGET_CAPABILITY_UNAVAILABLE") {
19
+ throw new ServiceError(CAPABILITY_UNAVAILABLE, `CAPABILITY_UNAVAILABLE: Management APIs are not enabled on remote service`, { originalMessage: err?.message });
20
+ }
21
+ if (code === "PROTOCOL_UNSUPPORTED" ||
22
+ code === "TARGET_PROTOCOL_UNSUPPORTED") {
23
+ throw new ServiceError(PROTOCOL_UNSUPPORTED, `PROTOCOL_UNSUPPORTED: ${err?.message || ""}`, { originalMessage: err?.message });
24
+ }
25
+ if (code === "SERVICE_RESULT_UNKNOWN" ||
26
+ code === "TARGET_RESULT_UNKNOWN" ||
27
+ code === "RESULT_UNKNOWN") {
28
+ throw new ServiceError(SERVICE_RESULT_UNKNOWN, `SERVICE_RESULT_UNKNOWN: ${err?.message || ""}`, { originalMessage: err?.message });
29
+ }
30
+ throw err;
31
+ }
32
+ /**
33
+ * 判定远端状态键访问异常是否为键不存在。
34
+ * 读取结构化错误码与 HTTP 状态码。
35
+ */
36
+ export function isRemoteStateKeyNotFound(err) {
37
+ return err?.code === STATE_KEY_NOT_FOUND || err?.code === "NOT_FOUND" || err?.status === 404;
38
+ }
@@ -7,8 +7,8 @@
7
7
  */
8
8
  import type { ExecutionResult, RunRecord } from "@actiondock/sdk";
9
9
  /**
10
- * 轮询依赖上下文:由 RemoteActionDockTarget 门面注入自身能力,
11
- * 保持本模块与门面实现解耦(子模块不得反向依赖 remote.ts)。
10
+ * 轮询依赖上下文:由 RemoteActionDockService 门面注入自身能力,
11
+ * 保持本模块与门面实现解耦。
12
12
  */
13
13
  export interface RunPollingContext {
14
14
  /** 轮询等待基准底线超时时间(毫秒,默认 60000ms) */
@@ -5,9 +5,9 @@
5
5
  * 运行详情直至终态、取消或超时上限;并将终态运行记录翻译为统一
6
6
  * ExecutionResult 结构。不感知 SSE 通道与门面生命周期。
7
7
  */
8
- import { ACTION_CANCELLED, EXECUTION_FAILED, TIMEOUT } from "../errors.js";
8
+ import { ACTION_CANCELLED, EXECUTION_FAILED, RUN_INTERRUPTED, TIMEOUT } from "../errors.js";
9
9
  import { isTerminalRunStatus } from "../storage/types.js";
10
- import { TARGET_CLOSED } from "./types.js";
10
+ import { SERVICE_CLOSED } from "./types.js";
11
11
  /**
12
12
  * 将终态运行记录翻译为统一 ExecutionResult 结构。
13
13
  */
@@ -20,7 +20,7 @@ export function formatTerminalRunResult(run, runId) {
20
20
  ok: false,
21
21
  runId,
22
22
  error: run.error || {
23
- code: "RUN_INTERRUPTED",
23
+ code: RUN_INTERRUPTED,
24
24
  message: `Run '${runId}' was interrupted`,
25
25
  },
26
26
  };
@@ -55,8 +55,8 @@ export async function pollRunCompletion(ctx, runId, signal, timeoutMs, startTime
55
55
  ok: false,
56
56
  runId,
57
57
  error: {
58
- code: TARGET_CLOSED,
59
- message: "RemoteActionDockTarget is closed",
58
+ code: SERVICE_CLOSED,
59
+ message: "RemoteActionDockService is closed",
60
60
  },
61
61
  };
62
62
  }
@@ -77,13 +77,13 @@ export async function pollRunCompletion(ctx, runId, signal, timeoutMs, startTime
77
77
  }
78
78
  }
79
79
  catch (err) {
80
- if (err?.code === TARGET_CLOSED || ctx.isClosed()) {
80
+ if (err?.code === SERVICE_CLOSED || ctx.isClosed()) {
81
81
  return {
82
82
  ok: false,
83
83
  runId,
84
84
  error: {
85
- code: TARGET_CLOSED,
86
- message: "RemoteActionDockTarget is closed",
85
+ code: SERVICE_CLOSED,
86
+ message: "RemoteActionDockService is closed",
87
87
  },
88
88
  };
89
89
  }
@@ -0,0 +1,34 @@
1
+ import type { PackageInfo } from "../package/types.js";
2
+ import { type RemoteServiceOptions } from "./types.js";
3
+ import type { ActionDockService, ConfigPort, ConnectActionDockOptions, DiscoveryPort, EventsPort, ExecutionPort, RunsPort, StatePort } from "./types.js";
4
+ /**
5
+ * 远程 ActionDockService 端口实现。
6
+ * 封装与远端 ActionDock 服务的 HTTP / SSE 协议交互,
7
+ * 遵循统一的 Service Ports 契约。
8
+ */
9
+ export declare class RemoteActionDockService implements ActionDockService {
10
+ readonly serverUrl: string;
11
+ readonly token?: string;
12
+ readonly timeoutMs?: number;
13
+ readonly baseTimeoutMs: number;
14
+ readonly allowInsecureHttp?: boolean;
15
+ readonly insecure?: boolean;
16
+ readonly dispatcher?: unknown;
17
+ private isClosed;
18
+ readonly discovery: DiscoveryPort;
19
+ readonly execution: ExecutionPort;
20
+ readonly runs: RunsPort;
21
+ readonly events: EventsPort;
22
+ readonly management?: {
23
+ config: ConfigPort;
24
+ state: StatePort;
25
+ };
26
+ constructor(options: ConnectActionDockOptions | RemoteServiceOptions);
27
+ private assertNotClosed;
28
+ info(): Promise<PackageInfo[]>;
29
+ private waitForRunCompletion;
30
+ close(_options?: {
31
+ timeoutMs?: number;
32
+ graceMs?: number;
33
+ }): Promise<void>;
34
+ }