@mininglamp-oss/octo-runtime 1.1.9 → 1.1.10

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 (111) hide show
  1. package/README.md +1 -1
  2. package/{node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-configuration.d.ts → apps/cli/dist/adapter-configuration.d.ts} +1 -0
  3. package/{node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-configuration.js → apps/cli/dist/adapter-configuration.js} +1 -0
  4. package/apps/cli/dist/adapter-configurations.d.ts +1 -1
  5. package/apps/cli/dist/adapter-configurations.js +1 -1
  6. package/apps/cli/dist/adapters.d.ts +7 -0
  7. package/apps/cli/dist/adapters.js +51 -0
  8. package/apps/cli/dist/build-info.json +2 -2
  9. package/apps/cli/dist/help.js +1 -1
  10. package/apps/cli/dist/index.js +4 -0
  11. package/apps/cli/dist/main.d.ts +2 -0
  12. package/apps/cli/dist/main.js +10 -12
  13. package/apps/cli/dist/manifest.json +0 -5
  14. package/apps/cli/dist/output.js +2 -7
  15. package/apps/cli/dist/playboard-interrupt.d.ts +6 -0
  16. package/apps/cli/dist/playboard-interrupt.js +86 -0
  17. package/apps/cli/dist/playboard.d.ts +2 -0
  18. package/apps/cli/dist/playboard.js +9 -10
  19. package/dist/public/executor-kernel.d.ts +0 -1
  20. package/dist/public/executor-kernel.js +0 -1
  21. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
  22. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  23. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  24. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  25. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  26. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  27. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
  28. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
  29. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  30. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  31. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  32. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  33. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
  34. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
  35. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  36. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/reasoning.js +1 -2
  37. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +1 -1
  38. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +12 -30
  39. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
  40. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configuration.d.ts +3 -0
  41. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configuration.js +125 -0
  42. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.d.ts +1 -1
  43. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.js +1 -1
  44. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.d.ts +7 -0
  45. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.js +51 -0
  46. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
  47. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +1 -1
  48. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/index.js +4 -0
  49. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.d.ts +2 -0
  50. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +10 -12
  51. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +0 -5
  52. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +2 -7
  53. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard-interrupt.d.ts +6 -0
  54. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard-interrupt.js +86 -0
  55. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.d.ts +2 -0
  56. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +9 -10
  57. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +23 -24
  58. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
  59. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +3 -3
  60. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +26 -7
  61. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  62. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.d.ts +2 -0
  63. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.js +2 -0
  64. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/execution-source.d.ts +17 -0
  65. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/execution-source.js +21 -0
  66. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.d.ts +9 -9
  67. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.js +1 -1
  68. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.d.ts +1 -6
  69. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.js +2 -6
  70. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.d.ts +14 -13
  71. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +84 -187
  72. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +5 -8
  73. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +45 -38
  74. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.d.ts +5 -1
  75. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +15 -3
  76. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +4 -12
  77. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
  78. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
  79. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/assets/{index-BVxePruX.js → index-BLMf2Etg.js} +1 -3
  80. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/index.html +1 -1
  81. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
  82. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
  83. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +0 -15
  84. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  85. package/package.json +26 -28
  86. package/packages/octo-runtime-protocol/schema/protocol.schema.json +1 -37
  87. package/apps/cli/dist/worker.d.ts +0 -1
  88. package/apps/cli/dist/worker.js +0 -18
  89. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/app-server.d.ts +0 -63
  90. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/app-server.js +0 -846
  91. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.d.ts +0 -54
  92. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.js +0 -154
  93. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +0 -15
  94. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.d.ts +0 -1
  95. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.js +0 -18
  96. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.d.ts +0 -16
  97. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.js +0 -59
  98. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.d.ts +0 -6
  99. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.js +0 -88
  100. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.d.ts +0 -1
  101. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.js +0 -2
  102. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +0 -42
  103. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +0 -292
  104. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.d.ts +0 -64
  105. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.js +0 -674
  106. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.d.ts +0 -2
  107. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.js +0 -5
  108. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.d.ts +0 -10
  109. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.js +0 -96
  110. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +0 -15
  111. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +0 -279
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-cli",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,29 +9,28 @@
9
9
  "types": "./dist/index.d.ts",
10
10
  "dependencies": {
11
11
  "commander": "15.0.0",
12
- "@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.9",
13
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.9",
12
+ "@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.10",
13
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.10",
14
14
  "json5": "2.2.3",
15
- "@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.9",
16
- "@mininglamp-oss/octo-runtime-host-sdk": "1.1.9",
17
- "@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.9",
18
- "@mininglamp-oss/octo-runtime-cross-service": "1.1.9",
19
- "@mininglamp-oss/octo-runtime-protocol": "1.1.9",
20
- "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.9",
21
- "@mininglamp-oss/octo-runtime-executor-core": "1.1.9",
22
- "@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.9",
23
- "@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.9",
24
- "@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.9",
25
- "@mininglamp-oss/octo-runtime-adapter-codex": "1.1.9",
26
- "@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.9",
27
- "@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.9",
28
- "@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.9",
29
- "@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.9",
30
- "@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.9",
31
- "@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.9",
32
- "@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.9",
33
- "@mininglamp-oss/octo-runtime-adapter-zcode-gui": "1.1.9",
34
- "@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.9",
35
- "@mininglamp-oss/octo-runtime-extra-webui": "1.1.9"
15
+ "@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.10",
16
+ "@mininglamp-oss/octo-runtime-host-sdk": "1.1.10",
17
+ "@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.10",
18
+ "@mininglamp-oss/octo-runtime-cross-service": "1.1.10",
19
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.10",
20
+ "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.10",
21
+ "@mininglamp-oss/octo-runtime-executor-core": "1.1.10",
22
+ "@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.10",
23
+ "@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.10",
24
+ "@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.10",
25
+ "@mininglamp-oss/octo-runtime-adapter-codex": "1.1.10",
26
+ "@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.10",
27
+ "@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.10",
28
+ "@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.10",
29
+ "@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.10",
30
+ "@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.10",
31
+ "@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.10",
32
+ "@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.10",
33
+ "@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.10",
34
+ "@mininglamp-oss/octo-runtime-extra-webui": "1.1.10"
36
35
  }
37
36
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-cross-service",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "private": true,
5
5
  "description": "Native user-service lifecycle backends for Octo Runtime",
6
6
  "type": "module",
@@ -44,7 +44,7 @@ export interface ExecutorShutdownResult {
44
44
  }
45
45
  /**
46
46
  * 唯一的进程内执行实现:校验输入/Adapter 输出、补齐消息生命周期、约束单个终态并传递取消。
47
- * Kernel worker 和显式进程内接入共用本类;它不拥有独立 Kernel、业务会话或 IM 投递。
47
+ * 由 Kernel 在宿主进程持有;它不拥有 RPC 端点、业务会话或 IM 投递。
48
48
  * 接入方须消费流并在退出时检查 shutdown 的 cleanup 结果;终态不能替代资源回收确认。
49
49
  */
50
50
  export declare class AgentExecutor {
@@ -68,7 +68,7 @@ export declare class AgentExecutor {
68
68
  * signal、执行环境和容量限制来自本次 environment,不从业务会话或其他 Run 继承。
69
69
  */
70
70
  invokeFrames(input: InvokeInput, environment?: InvokeEnvironment): AsyncGenerator<HostFrame>;
71
- /** Run the adapter's own environment probe; return an unchecked-available status when there is no probe. */
71
+ /** 保留 Adapter 的 this 与同步返回合同;实际异步探测完成前由 Core 持有,关闭后不再发起探测。 */
72
72
  probe(adapterType: string, options?: AdapterProbeOptions): unknown;
73
73
  /** 请求取消活动执行;true 仅表示已触发 abort,仍须消费终态并等待 Adapter 清理。 */
74
74
  cancel(invocationId: string, reason?: string): boolean;
@@ -76,7 +76,7 @@ export declare class AgentExecutor {
76
76
  respondInteraction(invocationId: string, response: InteractionResponse): Promise<void>;
77
77
  respondNative(invocationId: string, response: NativeInteractionResponse): Promise<void>;
78
78
  /**
79
- * 停止接纳并取消未终结执行,在 timeoutMs 内等待 Adapter 清理;不负责业务投递收尾。
79
+ * 停止接纳并取消未终结执行,在 timeoutMs 内等待 Adapter 清理及实际 probe;不负责业务投递收尾。
80
80
  * 并发调用共用当前尝试;超时或清理失败返回 incomplete 和遗留身份,不冒充资源已回收。
81
81
  */
82
82
  shutdown(reason?: string, timeoutMs?: number): Promise<ExecutorShutdownResult>;
@@ -13,7 +13,7 @@ import { noopRuntimeLog } from "@mininglamp-oss/octo-runtime-adapter-sdk";
13
13
  import { AdapterWatchdogTimeoutError, InvocationWatchdog } from "./watchdog.js";
14
14
  /**
15
15
  * 唯一的进程内执行实现:校验输入/Adapter 输出、补齐消息生命周期、约束单个终态并传递取消。
16
- * Kernel worker 和显式进程内接入共用本类;它不拥有独立 Kernel、业务会话或 IM 投递。
16
+ * 由 Kernel 在宿主进程持有;它不拥有 RPC 端点、业务会话或 IM 投递。
17
17
  * 接入方须消费流并在退出时检查 shutdown 的 cleanup 结果;终态不能替代资源回收确认。
18
18
  */
19
19
  export class AgentExecutor {
@@ -40,6 +40,8 @@ export class AgentExecutor {
40
40
  #activeAdapters = new Map();
41
41
  // 资源所有权独立于活动执行/终态:清理未确认的 owner 必须留存,供 shutdown 返回真实遗留项。
42
42
  #owners = new Map();
43
+ // probe 的展示超时只结束等待;底层宿主函数仍在运行,必须计入实际关闭事实。
44
+ #probes = new Set();
43
45
  #state = "open";
44
46
  #shutdownAttempt;
45
47
  #shutdownResult;
@@ -63,13 +65,16 @@ export class AgentExecutor {
63
65
  }
64
66
  /** Report installed provider identity separately from adapter registration. */
65
67
  async describe(configurations = {}) {
68
+ this.#assertOpen();
66
69
  return Promise.all([...this.#adapters.values()].map(async (adapter) => {
67
70
  let probe = {};
68
71
  let unavailableReason = adapter.probe ? "probe_invalid" : "probe_missing";
69
72
  let timer;
70
73
  try {
71
74
  const result = await Promise.race([
72
- Promise.resolve().then(() => adapter.probe?.(configurations[adapter.metadata.type])),
75
+ Promise.resolve().then(() => adapter.probe
76
+ ? this.probe(adapter.metadata.type, configurations[adapter.metadata.type])
77
+ : undefined),
73
78
  new Promise((resolve) => {
74
79
  timer = setTimeout(() => {
75
80
  unavailableReason = "probe_timeout";
@@ -854,14 +859,27 @@ export class AgentExecutor {
854
859
  }
855
860
  }
856
861
  }
857
- /** Run the adapter's own environment probe; return an unchecked-available status when there is no probe. */
862
+ /** 保留 Adapter 的 this 与同步返回合同;实际异步探测完成前由 Core 持有,关闭后不再发起探测。 */
858
863
  probe(adapterType, options) {
864
+ this.#assertOpen();
859
865
  const adapter = this.#adapters.get(adapterType);
860
866
  if (!adapter)
861
867
  throw new Error(`unknown adapter: ${adapterType}`);
862
868
  if (!adapter.probe)
863
869
  return { available: true, adapterType, unchecked: true };
864
- return adapter.probe(options);
870
+ const result = adapter.probe(options);
871
+ if (result === null ||
872
+ (typeof result !== "object" && typeof result !== "function") ||
873
+ typeof result.then !== "function")
874
+ return result;
875
+ // 统一 Promise/thenable,调用方也消费同一 Promise,不能重复驱动一次性的 thenable。
876
+ const pending = Promise.resolve(result);
877
+ this.#probes.add(pending);
878
+ const settled = () => {
879
+ this.#probes.delete(pending);
880
+ };
881
+ void pending.then(settled, settled);
882
+ return pending;
865
883
  }
866
884
  /** 请求取消活动执行;true 仅表示已触发 abort,仍须消费终态并等待 Adapter 清理。 */
867
885
  cancel(invocationId, reason = "cancelled") {
@@ -897,7 +915,7 @@ export class AgentExecutor {
897
915
  await adapter.respondNative(invocationId, response);
898
916
  }
899
917
  /**
900
- * 停止接纳并取消未终结执行,在 timeoutMs 内等待 Adapter 清理;不负责业务投递收尾。
918
+ * 停止接纳并取消未终结执行,在 timeoutMs 内等待 Adapter 清理及实际 probe;不负责业务投递收尾。
901
919
  * 并发调用共用当前尝试;超时或清理失败返回 incomplete 和遗留身份,不冒充资源已回收。
902
920
  */
903
921
  shutdown(reason = "executor shutdown", timeoutMs = 2_500) {
@@ -908,7 +926,7 @@ export class AgentExecutor {
908
926
  if (this.#shutdownResult?.cleanup === "complete")
909
927
  return Promise.resolve(this.#shutdownResult);
910
928
  this.#state = "closing";
911
- const pending = [];
929
+ const pending = [...this.#probes];
912
930
  for (const [id, owner] of this.#owners) {
913
931
  if (!this.#acceptedTerminals.has(id))
914
932
  owner.controller.abort(reason);
@@ -920,7 +938,8 @@ export class AgentExecutor {
920
938
  const failedCleanupInvocationIds = Object.freeze([...this.#owners].filter(([, owner]) => owner.cleanupState === "failed").map(([id]) => id));
921
939
  const result = Object.freeze({
922
940
  state: "closed",
923
- cleanup: unresolvedInvocationIds.length ? "incomplete" : "complete",
941
+ // probe 不属于某个 invocation,不能伪造 invocationId;仍在途时独立阻止 complete。
942
+ cleanup: unresolvedInvocationIds.length || this.#probes.size ? "incomplete" : "complete",
924
943
  unresolvedInvocationIds,
925
944
  failedCleanupInvocationIds
926
945
  });
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-executor-core",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
7
7
  "dependencies": {
8
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.9",
9
- "@mininglamp-oss/octo-runtime-protocol": "1.1.9"
8
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.10",
9
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.10"
10
10
  },
11
11
  "types": "./dist/index.d.ts",
12
12
  "files": [
@@ -1,6 +1,8 @@
1
1
  import { type KernelClient } from "./types.js";
2
2
  /**
3
3
  * 连接本机 socket/Windows Pipe,返回不拥有 Kernel 进程的客户端。
4
+ * 宿主接入层只在 CLI 模式跨进程连接已有服务时显式调用;原生 SDK 使用 kernel.client。
5
+ * Kernel/Extra 服务内部也复用本函数构造 RPC 客户端,不要求 SDK 调用方额外 attach。
4
6
  * invoke 提供登记、取消和尾流观察;关闭连接或迭代器不会隐式取消已接纳 Run。
5
7
  */
6
8
  export declare function attachKernel(options: {
@@ -6,6 +6,8 @@ import { InvocationRegistry } from "./invocation-lifecycle.js";
6
6
  import { markSubmissionRejected } from "./submission-error.js";
7
7
  /**
8
8
  * 连接本机 socket/Windows Pipe,返回不拥有 Kernel 进程的客户端。
9
+ * 宿主接入层只在 CLI 模式跨进程连接已有服务时显式调用;原生 SDK 使用 kernel.client。
10
+ * Kernel/Extra 服务内部也复用本函数构造 RPC 客户端,不要求 SDK 调用方额外 attach。
9
11
  * invoke 提供登记、取消和尾流观察;关闭连接或迭代器不会隐式取消已接纳 Run。
10
12
  */
11
13
  export function attachKernel(options) {
@@ -0,0 +1,17 @@
1
+ import type { AdapterProbeOptions } from "@mininglamp-oss/octo-runtime-adapter-sdk";
2
+ import type { HostedAdapterMetadata } from "@mininglamp-oss/octo-runtime-executor-core";
3
+ import { type InputInvoke, type InputFrames, type InteractionResponse, type NativeInteractionResponse } from "@mininglamp-oss/octo-runtime-protocol";
4
+ /** Kernel 内部的原生执行源;不是另一条传输协议,公共调用始终经过 KernelClient RPC。 */
5
+ export interface ExecutionSource {
6
+ list(configurations?: Record<string, AdapterProbeOptions>): Promise<HostedAdapterMetadata[]>;
7
+ probe(adapterType: string, options?: AdapterProbeOptions): Promise<unknown>;
8
+ cancel(invocationId: string, reason?: string): Promise<{
9
+ cancelled: boolean;
10
+ }>;
11
+ respondInteraction(invocationId: string, response: InteractionResponse): Promise<void>;
12
+ respondNative(invocationId: string, response: NativeInteractionResponse): Promise<void>;
13
+ invoke: InputInvoke;
14
+ invokeFrames: InputFrames;
15
+ }
16
+ /** 校验宿主提供的配置值,不读取文件或修改原对象。 */
17
+ export declare function probeOptions(value: unknown): AdapterProbeOptions | undefined;
@@ -0,0 +1,21 @@
1
+ import { resolveStreamLimitPolicy } from "@mininglamp-oss/octo-runtime-protocol";
2
+ /** 校验宿主提供的配置值,不读取文件或修改原对象。 */
3
+ export function probeOptions(value) {
4
+ if (value === undefined)
5
+ return undefined;
6
+ if (!value || typeof value !== "object" || Array.isArray(value))
7
+ throw new TypeError("invalid probe options");
8
+ const options = value;
9
+ if (options.providerOptions !== undefined &&
10
+ (!options.providerOptions ||
11
+ typeof options.providerOptions !== "object" ||
12
+ Array.isArray(options.providerOptions) ||
13
+ Object.values(options.providerOptions).some((v) => typeof v !== "string")))
14
+ throw new TypeError("invalid probe provider options");
15
+ return {
16
+ ...options,
17
+ ...(options.streamLimits === undefined
18
+ ? {}
19
+ : { streamLimits: resolveStreamLimitPolicy(options.streamLimits) })
20
+ };
21
+ }
@@ -1,4 +1,4 @@
1
- import type { WorkerRpc } from "./rpc.js";
1
+ import type { ExecutionSource } from "./execution-source.js";
2
2
  import { type HostFrame, type HostRunReceipt, type InvokeInput, type InvokeEnvironment, type NativeInteractionResponse, type InteractionResponse } from "@mininglamp-oss/octo-runtime-protocol";
3
3
  export interface SourceEvent {
4
4
  seq: number;
@@ -7,23 +7,23 @@ export interface SourceEvent {
7
7
  at: number;
8
8
  }
9
9
  /**
10
- * Kernel 内唯一的 Run 事件源:从 worker 消费一次,按原 stream/seq 有界缓存供多个订阅观察。
10
+ * Kernel 内唯一的 Run 事件源:从同进程 Core 消费一次,按原 stream/seq 有界缓存供多个订阅观察。
11
11
  * 接纳、执行与观察分离;订阅退出不取消源执行,缓存过期只报告缺口,不重跑 Provider。
12
12
  */
13
- export declare class HostRunService implements WorkerRpc {
13
+ export declare class HostRunService implements ExecutionSource {
14
14
  #private;
15
- readonly transport: WorkerRpc;
15
+ readonly transport: ExecutionSource;
16
16
  private readonly resolveStreamLimits?;
17
17
  readonly invoke: import("@mininglamp-oss/octo-runtime-protocol").InputInvoke;
18
- constructor(transport: WorkerRpc, resolveStreamLimits?: ((input: InvokeInput) => InvokeEnvironment["streamLimits"]) | undefined);
18
+ constructor(transport: ExecutionSource, resolveStreamLimits?: ((input: InvokeInput) => InvokeEnvironment["streamLimits"]) | undefined);
19
19
  get status(): {
20
20
  draining: boolean;
21
21
  activeRuns: number;
22
22
  admittingRuns: number;
23
23
  };
24
- list(...args: Parameters<WorkerRpc["list"]>): ReturnType<WorkerRpc["list"]>;
25
- probe(...args: Parameters<WorkerRpc["probe"]>): Promise<unknown>;
26
- cancel(invocationId: string, reason?: string): ReturnType<WorkerRpc["cancel"]>;
24
+ list(...args: Parameters<ExecutionSource["list"]>): ReturnType<ExecutionSource["list"]>;
25
+ probe(...args: Parameters<ExecutionSource["probe"]>): Promise<unknown>;
26
+ cancel(invocationId: string, reason?: string): ReturnType<ExecutionSource["cancel"]>;
27
27
  respondInteraction(invocationId: string, response: InteractionResponse): Promise<void>;
28
28
  respondNative(invocationId: string, response: NativeInteractionResponse): Promise<void>;
29
29
  invokeFrames(input: InvokeInput, environment?: InvokeEnvironment): AsyncGenerator<HostFrame>;
@@ -38,7 +38,7 @@ export declare class HostRunService implements WorkerRpc {
38
38
  read(runId: string, streamId: string | undefined, after: number): ReturnType<HostRunService["get"]> & {
39
39
  events: SourceEvent[];
40
40
  };
41
- cancelRun(runId: string, reason?: string): ReturnType<WorkerRpc["cancel"]>;
41
+ cancelRun(runId: string, reason?: string): ReturnType<ExecutionSource["cancel"]>;
42
42
  respond(runId: string, response: InteractionResponse): Promise<void>;
43
43
  respondNativeRun(runId: string, response: NativeInteractionResponse): Promise<void>;
44
44
  acquireSubscription(): () => void;
@@ -1,7 +1,7 @@
1
1
  import { createInputInvoke, assertInvokeRequestSize, identifyInvokeInput, assertHostFrameIdentity, isHostTerminal, isStreamCapacityReason, resolveStreamLimitPolicy, streamCapacityError, protocolError } from "@mininglamp-oss/octo-runtime-protocol";
2
2
  const TTL = 120_000;
3
3
  /**
4
- * Kernel 内唯一的 Run 事件源:从 worker 消费一次,按原 stream/seq 有界缓存供多个订阅观察。
4
+ * Kernel 内唯一的 Run 事件源:从同进程 Core 消费一次,按原 stream/seq 有界缓存供多个订阅观察。
5
5
  * 接纳、执行与观察分离;订阅退出不取消源执行,缓存过期只报告缺口,不重跑 Provider。
6
6
  */
7
7
  export class HostRunService {
@@ -6,10 +6,5 @@ export { attachKernel } from "./client.js";
6
6
  export { AsyncQuestionReply, type AsyncQuestionReplyResult } from "./async-question-reply.js";
7
7
  export { isInvocationNotSubmitted } from "./submission-error.js";
8
8
  export * from "./types.js";
9
- export { InvocationManifest, acknowledgeOrphanCleanup, inspectOrphanCleanup, processStartIdentity, reapOrphanedInvocationManifest } from "./invocation-manifest.js";
10
- export { readAdapterConfigurations } from "./runtime-configuration.js";
11
- export { spawnWorker } from "./process.js";
12
- export { serveWorker } from "./serve.js";
13
- export type { WorkerProcess, SpawnWorkerOptions } from "./process.js";
14
- export { WorkerRpcClient, WorkerRpcServer, type WorkerRpc, type RpcTrace, type RpcTraceDirection } from "./rpc.js";
9
+ export { InvocationManifest, acknowledgeOrphanCleanup, inspectOrphanCleanup, reapOrphanedInvocationManifest } from "./invocation-manifest.js";
15
10
  export { acquireEndpoint } from "./endpoint.js";
@@ -1,4 +1,4 @@
1
- // Kernel 只提供 IPC、Run 观察与 worker 监督;执行逻辑统一委托给 worker 中的 Core。
1
+ // Kernel 在宿主进程拥有 Core 与 Run 管理;所有业务调用统一经过本地 RPC。
2
2
  export { DEFAULT_RUNTIME_LIMITS, prepareRunContext } from "@mininglamp-oss/octo-runtime-executor-core";
3
3
  export { HostRunService } from "./host-run-service.js";
4
4
  export { createKernelService } from "./service.js";
@@ -7,9 +7,5 @@ export { attachKernel } from "./client.js";
7
7
  export { AsyncQuestionReply } from "./async-question-reply.js";
8
8
  export { isInvocationNotSubmitted } from "./submission-error.js";
9
9
  export * from "./types.js";
10
- export { InvocationManifest, acknowledgeOrphanCleanup, inspectOrphanCleanup, processStartIdentity, reapOrphanedInvocationManifest } from "./invocation-manifest.js";
11
- export { readAdapterConfigurations } from "./runtime-configuration.js";
12
- export { spawnWorker } from "./process.js";
13
- export { serveWorker } from "./serve.js";
14
- export { WorkerRpcClient, WorkerRpcServer } from "./rpc.js";
10
+ export { InvocationManifest, acknowledgeOrphanCleanup, inspectOrphanCleanup, reapOrphanedInvocationManifest } from "./invocation-manifest.js";
15
11
  export { acquireEndpoint } from "./endpoint.js";
@@ -6,13 +6,14 @@ export interface InvocationManifestEntry {
6
6
  }
7
7
  export interface OrphanReapResult {
8
8
  found: boolean;
9
- reaped: boolean;
10
- pid?: number;
11
- reason?: "kernel_alive" | "host_missing" | "identity_mismatch" | "unsupported_identity" | "cleanup_incomplete" | "cleanup_acknowledged";
9
+ /** 原生恢复不终止任何进程;人工确认也不表示自动回收。 */
10
+ reaped: false;
11
+ reason?: "kernel_alive" | "cleanup_incomplete" | "cleanup_acknowledged";
12
12
  }
13
13
  /**
14
- * 持久化 Kernel/worker 身份与在途执行事实,用于下次启动时识别遗留资源,不保存业务历史。
15
- * 写入串行化并通过 rename 替换;只有 owner 确认 worker 回收后才能 close 删除清单。
14
+ * 持久化原生 Kernel 所有权与在途执行事实,不保存业务历史,不迁移旧执行架构。
15
+ * 这是资源恢复记录,不是模块 manifest。写入串行化并通过 rename 替换;
16
+ * 只有 owner 确认 Core/Adapter 资源回收后才能 close 删除记录。
16
17
  */
17
18
  export declare class InvocationManifest {
18
19
  #private;
@@ -21,30 +22,30 @@ export declare class InvocationManifest {
21
22
  manifest: InvocationManifest;
22
23
  reap: OrphanReapResult;
23
24
  }>;
24
- setWorker(pid: number | undefined, entrypoint: string): Promise<void>;
25
+ /** 原生服务异常退出无法证明 Adapter 资源已清空;正常 close 才删除所有权证据。 */
26
+ markNativeOwner(): Promise<void>;
27
+ /** owner 关闭未完成时登记实际失败;宿主继续存活也不能将诊断恢复为 available。 */
28
+ markCleanupIncomplete(): Promise<void>;
25
29
  begin(entry: Omit<InvocationManifestEntry, "startedAt">): Promise<void>;
26
30
  end(invocationId: string): Promise<void>;
27
31
  close(): Promise<void>;
28
32
  }
29
33
  /**
30
- * 仅在原 Kernel 已退出且 worker 的 PID/启动身份仍匹配时尝试回收,防止 PID 复用误杀。
31
- * 无法验证身份时保留清单并报告 unsupported_identity;worker 已消失不证明 Windows 后代已清空。
34
+ * 检查原生 owner 的遗留记录,不终止宿主或 Provider 进程。
35
+ * 仅文件不存在或该原文已获人工确认才允许 open;损坏及旧 worker 记录保留并明确拒绝。
32
36
  */
33
37
  export declare function reapOrphanedInvocationManifest(path: string): Promise<OrphanReapResult>;
34
38
  /** 只读恢复诊断,不回收进程、不改写清单;用于 doctor 及 SDK 运维界面。 */
35
39
  export declare function inspectOrphanCleanup(path: string): Promise<{
36
40
  manifestPath: string;
37
- state: "missing" | "available" | "cleanup_incomplete" | "acknowledged" | "unreadable";
38
- workerPid?: number;
41
+ state: "missing" | "available" | "cleanup_incomplete" | "acknowledged" | "unsupported" | "unreadable";
39
42
  }>;
40
43
  /**
41
44
  * 操作者已停止未知后代后显式确认当前失败记录;不终止进程、不声称整树回收已验证。
42
- * 仍存活的原 Kernel/worker 或无法核验的 PID 不能放行。备份保留,确认仅匹配原文摘要,
45
+ * 仅接受有效原生记录,仍存活的原 Kernel 不能放行。备份保留,确认仅匹配原文摘要,
43
46
  * 所以并发启动、后续调用或另一份清单不会复用旧确认;下一次 open 才替换失败记录。
44
47
  */
45
48
  export declare function acknowledgeOrphanCleanup(path: string): Promise<{
46
49
  manifestPath: string;
47
50
  archivePath: string;
48
51
  }>;
49
- /** 查询系统启动时间以区分 PID 复用;失败时不返回可用于回收的身份,绝不以 PID 本身兜底。 */
50
- export declare function processStartIdentity(pid: number): Promise<string | undefined>;