@mininglamp-oss/octo-runtime 1.1.0 → 1.1.1

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 (127) hide show
  1. package/README.md +4 -2
  2. package/apps/cli/README.md +3 -1
  3. package/apps/cli/dist/build-info.json +2 -2
  4. package/apps/cli/dist/extras.d.ts +4 -2
  5. package/apps/cli/dist/extras.js +20 -21
  6. package/apps/cli/dist/help.js +3 -0
  7. package/apps/cli/dist/logs.d.ts +10 -0
  8. package/apps/cli/dist/logs.js +186 -0
  9. package/apps/cli/dist/main.d.ts +1 -0
  10. package/apps/cli/dist/main.js +94 -19
  11. package/apps/cli/dist/{default_adapters.json → manifest.json} +5 -0
  12. package/apps/cli/dist/module-manifest.d.ts +3 -0
  13. package/apps/cli/dist/module-manifest.js +11 -0
  14. package/apps/cli/dist/openclaw.js +30 -6
  15. package/apps/cli/dist/output.js +3 -0
  16. package/apps/cli/dist/playboard.js +10 -8
  17. package/apps/cli/dist/status-output.d.ts +10 -0
  18. package/apps/cli/dist/status-output.js +65 -0
  19. package/apps/cli/dist/worker.d.ts +1 -0
  20. package/apps/cli/dist/worker.js +18 -0
  21. package/dist/public/host.d.ts +1 -0
  22. package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
  23. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  24. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  25. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  26. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  27. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  28. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  29. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  30. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  31. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  32. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
  33. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
  34. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  35. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +1 -0
  36. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.js +1 -0
  37. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.d.ts +33 -0
  38. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/module-manifest.js +118 -0
  39. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log-worker.js +7 -5
  40. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.d.ts +3 -0
  41. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/runtime-log.js +45 -10
  42. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +11 -0
  43. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +70 -0
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +5 -3
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +3 -3
  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/extras.d.ts +4 -2
  48. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.js +20 -21
  49. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +3 -0
  50. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/logs.d.ts +10 -0
  51. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/logs.js +186 -0
  52. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.d.ts +1 -0
  53. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +94 -19
  54. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/{default_adapters.json → manifest.json} +5 -0
  55. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.d.ts +3 -0
  56. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.js +11 -0
  57. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/openclaw.js +30 -6
  58. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +3 -0
  59. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +10 -8
  60. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/status-output.d.ts +10 -0
  61. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/status-output.js +65 -0
  62. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.d.ts +1 -0
  63. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.js +18 -0
  64. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +22 -9
  65. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +2 -2
  66. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.d.ts +1 -1
  67. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/model-input.js +5 -5
  68. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  69. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.d.ts +16 -0
  70. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.js +59 -0
  71. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.d.ts +1 -0
  72. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +4 -1
  73. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.d.ts +6 -0
  74. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.js +88 -0
  75. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.d.ts +1 -2
  76. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.js +2 -9
  77. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +7 -2
  78. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +138 -9
  79. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.js +3 -92
  80. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.js +36 -12
  81. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +4 -1
  82. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +14 -6
  83. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +2 -1
  84. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +2 -2
  85. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +57 -34
  86. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +8 -16
  87. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/config-schema.json +2 -2
  88. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/application/im-channel.js +16 -17
  89. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
  90. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/config-schema.json +2 -2
  91. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
  92. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/config-schema.json +2 -2
  93. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/index.js +1 -1
  94. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/store.d.ts +4 -1
  95. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/store.js +54 -4
  96. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
  97. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-config.d.ts +8 -1
  98. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-config.js +27 -12
  99. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-service.js +39 -2
  100. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.d.ts +1 -0
  101. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +4 -4
  102. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  103. package/node_modules/import-meta-resolve/index.d.ts +19 -0
  104. package/node_modules/import-meta-resolve/index.d.ts.map +1 -0
  105. package/node_modules/import-meta-resolve/index.js +47 -0
  106. package/node_modules/import-meta-resolve/lib/errors.d.ts +24 -0
  107. package/node_modules/import-meta-resolve/lib/errors.d.ts.map +1 -0
  108. package/node_modules/import-meta-resolve/lib/errors.js +504 -0
  109. package/node_modules/import-meta-resolve/lib/get-format.d.ts +13 -0
  110. package/node_modules/import-meta-resolve/lib/get-format.d.ts.map +1 -0
  111. package/node_modules/import-meta-resolve/lib/get-format.js +159 -0
  112. package/node_modules/import-meta-resolve/lib/package-json-reader.d.ts +31 -0
  113. package/node_modules/import-meta-resolve/lib/package-json-reader.d.ts.map +1 -0
  114. package/node_modules/import-meta-resolve/lib/package-json-reader.js +177 -0
  115. package/node_modules/import-meta-resolve/lib/resolve.d.ts +29 -0
  116. package/node_modules/import-meta-resolve/lib/resolve.d.ts.map +1 -0
  117. package/node_modules/import-meta-resolve/lib/resolve.js +1301 -0
  118. package/node_modules/import-meta-resolve/lib/utils.d.ts +6 -0
  119. package/node_modules/import-meta-resolve/lib/utils.d.ts.map +1 -0
  120. package/node_modules/import-meta-resolve/lib/utils.js +47 -0
  121. package/node_modules/import-meta-resolve/license +74 -0
  122. package/node_modules/import-meta-resolve/package.json +78 -0
  123. package/node_modules/import-meta-resolve/readme.md +252 -0
  124. package/package.json +28 -26
  125. package/packages/octo-runtime-extra-channel-gateway/config-schema.json +2 -2
  126. package/packages/octo-runtime-extra-channel-wecom/config-schema.json +2 -2
  127. package/packages/octo-runtime-extra-webui/config-schema.json +2 -2
@@ -102,6 +102,9 @@ export function describeError(error, fallback = "COMMAND_FAILED") {
102
102
  SERVICE_NOT_INSTALLED: "Run this component's install command, then start it.",
103
103
  NOT_INSTALLED: "Run this component's install command, then start it.",
104
104
  EXTRA_NOT_REGISTERED: "Save this Extra's declaration with extraset before starting it.",
105
+ EXTRA_MANIFEST_DECLARATION_REQUIRED: "Add this Extra's name and module to the selected Home manifest.json (extras array), then retry.",
106
+ EXTRA_MODULE_MIGRATION_REQUIRED: "The saved module differs from manifest.json. Review both declarations, then save matching module text or omit module from the Extra configuration.",
107
+ MANIFEST_INVALID: "Check manifest.json: version must be 1 and adapters/extras must be valid arrays without duplicate keys.",
105
108
  MANAGER_UNAVAILABLE: "Run doctor and check the current user's native service manager.",
106
109
  COMPONENT_UNAVAILABLE: "Check component status and the service logs; the IPC or worker is not ready.",
107
110
  SERVICE_PROCESS_EXITED: "The service exited unexpectedly. Check its logs and configuration.",
@@ -1,7 +1,7 @@
1
1
  import { defaultRuntimeHome, runtimePaths, readJsonFile } from "./state.js";
2
- import { initializeCliOpenClaw } from "./openclaw.js";
2
+ import { loadCliManifest } from "./module-manifest.js";
3
+ import { resolveAdapterModules } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
3
4
  import { readAdapterConfigurations, createKernelService } from "@mininglamp-oss/octo-runtime-executor-kernel";
4
- import { resolve } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { componentEndpoint } from "@mininglamp-oss/octo-runtime-host-sdk";
7
7
  import { mkdtemp, rm } from "node:fs/promises";
@@ -67,15 +67,17 @@ export async function runPlayboard(options) {
67
67
  const temporary = await mkdtemp(join(tmpdir(), "octo-playboard-"));
68
68
  try {
69
69
  const paths = runtimePaths(home, profile);
70
- await initializeCliOpenClaw(paths.profileRoot, options.env ?? process.env);
70
+ const manifest = await loadCliManifest(home, options.manifest);
71
71
  const configuration = await readJsonFile(paths.profileConfig);
72
72
  kernel = createKernelService({
73
73
  endpoint: process.platform === "win32" ? componentEndpoint(temporary) : join(temporary, "k.sock"),
74
- workerEntrypoint: fileURLToPath(import.meta.resolve("@mininglamp-oss/octo-runtime-executor-kernel/runner")),
75
- manifest: options.manifest
76
- ? resolve(options.manifest)
77
- : fileURLToPath(new URL("./default_adapters.json", import.meta.url)),
78
- env: options.env ?? process.env,
74
+ workerEntrypoint: fileURLToPath(new URL("./worker.js", import.meta.url)),
75
+ adapterModules: resolveAdapterModules(manifest),
76
+ env: {
77
+ ...(options.env ?? process.env),
78
+ OCTO_RUNTIME_CLI_PROFILE_ROOT: paths.profileRoot,
79
+ OCTO_RUNTIME_CLI_SYNC_OPENCLAW_TOOLS: "0"
80
+ },
79
81
  adapterConfigurations: readAdapterConfigurations(paths.profileRoot, configuration?.adapters)
80
82
  });
81
83
  await kernel.initialize({ signal: controller.signal });
@@ -0,0 +1,10 @@
1
+ import type { Writable } from "node:stream";
2
+ import { type ExtraStatusRecord } from "@mininglamp-oss/octo-runtime-adapter-sdk";
3
+ /** Bound stdout buffering without blocking Extras; report dropped records when the pipe drains. */
4
+ export declare class StatusOutput {
5
+ #private;
6
+ private readonly output;
7
+ constructor(output: Writable);
8
+ readonly write: (record: ExtraStatusRecord) => void;
9
+ readonly close: () => void;
10
+ }
@@ -0,0 +1,65 @@
1
+ import { extraStatusRecord } from "@mininglamp-oss/octo-runtime-adapter-sdk";
2
+ /** Bound stdout buffering without blocking Extras; report dropped records when the pipe drains. */
3
+ export class StatusOutput {
4
+ output;
5
+ #queue = [];
6
+ #bytes = 0;
7
+ #blocked = false;
8
+ #closed = false;
9
+ #dropped = 0;
10
+ #extra = "extra";
11
+ constructor(output) {
12
+ this.output = output;
13
+ output.on("error", this.close);
14
+ }
15
+ write = (record) => {
16
+ if (this.#closed)
17
+ return;
18
+ this.#extra = record.extra_type;
19
+ const line = `${JSON.stringify(record)}\n`;
20
+ if (this.#queue.length >= 128 || this.#bytes + Buffer.byteLength(line) > 1024 * 1024) {
21
+ this.#dropped = Math.min(Number.MAX_SAFE_INTEGER, this.#dropped + 1);
22
+ return;
23
+ }
24
+ this.#queue.push(line);
25
+ this.#bytes += Buffer.byteLength(line);
26
+ this.#flush();
27
+ };
28
+ #drain = () => {
29
+ this.#blocked = false;
30
+ this.#flush();
31
+ };
32
+ #flush() {
33
+ if (this.#closed || this.#blocked)
34
+ return;
35
+ while (this.#queue.length) {
36
+ const line = this.#queue.shift();
37
+ this.#bytes -= Buffer.byteLength(line);
38
+ try {
39
+ if (!this.output.write(line)) {
40
+ this.#blocked = true;
41
+ this.output.once("drain", this.#drain);
42
+ return;
43
+ }
44
+ }
45
+ catch {
46
+ this.close();
47
+ return;
48
+ }
49
+ }
50
+ if (this.#dropped) {
51
+ const record = extraStatusRecord(this.#extra, "warn", "service.output_dropped", {
52
+ dropped_count: this.#dropped
53
+ });
54
+ this.#dropped = 0;
55
+ this.write(record);
56
+ }
57
+ }
58
+ close = () => {
59
+ this.#closed = true;
60
+ this.#queue = [];
61
+ this.#bytes = 0;
62
+ this.output.off("drain", this.#drain);
63
+ this.output.off("error", this.close);
64
+ };
65
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ // CLI 自有执行 worker。顶层 Kernel 仍由 CLI 调用进程创建;SDK 原生入口不使用此装配。
2
+ import { loadManifestAdapters } from "@mininglamp-oss/octo-runtime-executor-kernel/manifest-adapters";
3
+ import { serveWorker } from "@mininglamp-oss/octo-runtime-executor-kernel";
4
+ import { readExtraDirectory } from "@mininglamp-oss/octo-runtime-host-sdk";
5
+ import { dirname, join } from "node:path";
6
+ const adapters = await loadManifestAdapters();
7
+ // 旧显式清单允许省略 type;以所选实例真实类型判断,不猜包名,也不在父进程重复实例化。
8
+ if (adapters.some((adapter) => adapter.metadata.type === "openclaw")) {
9
+ const profileRoot = process.env.OCTO_RUNTIME_CLI_PROFILE_ROOT;
10
+ if (!profileRoot)
11
+ throw new Error("CLI_PROFILE_ROOT_REQUIRED");
12
+ const { initializeCliOpenClaw, syncCliOpenClawToolEnvironment } = await import("./openclaw.js");
13
+ await initializeCliOpenClaw(profileRoot);
14
+ if (process.env.OCTO_RUNTIME_CLI_SYNC_OPENCLAW_TOOLS === "1")
15
+ await syncCliOpenClawToolEnvironment(profileRoot, await readExtraDirectory(join(dirname(profileRoot), "extras")));
16
+ }
17
+ // 产品连接准备完成后才建立既有 list/probe 握手;所有实例仅交给唯一 Core 注册一次。
18
+ serveWorker(adapters);
@@ -2,5 +2,6 @@ export { createExtraService, ComponentStartError, componentEndpoint, componentSe
2
2
  export type { ExtraService, ExtraServiceOptions, ExtraServiceStatus, CleanupResult } from "@mininglamp-oss/octo-runtime-host-sdk";
3
3
  export { startNativeComponent } from "@mininglamp-oss/octo-runtime-host-sdk";
4
4
  export type { NativeComponentOptions } from "@mininglamp-oss/octo-runtime-host-sdk";
5
+ export type { RuntimeLoggingOptions, ExtraStatusRecord } from "@mininglamp-oss/octo-runtime-host-sdk";
5
6
  export { createKernelService, ServiceInitializationError } from "./executor-kernel.js";
6
7
  export type { KernelService, KernelServiceOptions, KernelServiceStatus, ServiceCleanupResult, ServiceLifecycle, ServicePhase } from "./executor-kernel.js";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-acp-client",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,7 +9,7 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.0",
13
- "@mininglamp-oss/octo-runtime-protocol": "1.1.0"
12
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.1",
13
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.1"
14
14
  }
15
15
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-acp",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,8 +9,8 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-protocol": "1.1.0",
13
- "@mininglamp-oss/octo-runtime-acp-client": "1.1.0",
14
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.0"
12
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.1",
13
+ "@mininglamp-oss/octo-runtime-acp-client": "1.1.1",
14
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.1"
15
15
  }
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-antigravity",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -10,7 +10,7 @@
10
10
  "README.md"
11
11
  ],
12
12
  "dependencies": {
13
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.0",
14
- "@mininglamp-oss/octo-runtime-protocol": "1.1.0"
13
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.1",
14
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.1"
15
15
  }
16
16
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-claude-code",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
7
7
  "dependencies": {
8
- "@mininglamp-oss/octo-runtime-protocol": "1.1.0",
9
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.0"
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.1",
9
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.1"
10
10
  },
11
11
  "types": "./dist/index.d.ts",
12
12
  "files": [
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-codebuddy",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
7
7
  "dependencies": {
8
- "@mininglamp-oss/octo-runtime-protocol": "1.1.0",
9
- "@mininglamp-oss/octo-runtime-acp-client": "1.1.0",
10
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.0"
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.1",
9
+ "@mininglamp-oss/octo-runtime-acp-client": "1.1.1",
10
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.1"
11
11
  },
12
12
  "types": "./dist/index.d.ts",
13
13
  "files": [
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-codex",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
7
7
  "dependencies": {
8
- "@mininglamp-oss/octo-runtime-protocol": "1.1.0",
9
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.0"
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.1",
9
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.1"
10
10
  },
11
11
  "types": "./dist/index.d.ts",
12
12
  "files": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-hermes",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,6 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.0"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.1"
13
13
  }
14
14
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-kimi-code",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,6 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.0"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.1"
13
13
  }
14
14
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-mcode",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,6 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.0"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.1"
13
13
  }
14
14
  }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-openclaw",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
7
7
  "dependencies": {
8
- "@mininglamp-oss/octo-runtime-protocol": "1.1.0",
9
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.0",
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.1",
9
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.1",
10
10
  "ws": "8.22.0"
11
11
  },
12
12
  "types": "./dist/index.d.ts",
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-opencode",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
7
7
  "dependencies": {
8
- "@mininglamp-oss/octo-runtime-protocol": "1.1.0",
9
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.0",
10
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.0"
8
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.1",
9
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.1",
10
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.1"
11
11
  },
12
12
  "types": "./dist/index.d.ts",
13
13
  "files": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-qodercli",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,6 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.0"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.1"
13
13
  }
14
14
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-adapter-qoderclicn",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",
@@ -9,6 +9,6 @@
9
9
  "dist"
10
10
  ],
11
11
  "dependencies": {
12
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.0"
12
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.1"
13
13
  }
14
14
  }
@@ -15,6 +15,7 @@ export { watchLineLimit } from "./line-limit.js";
15
15
  export { readBoundedLines } from "./bounded-lines.js";
16
16
  export { HourlyLogWriter, HOURLY_LOG_MAX_BYTES } from "./hourly-log.js";
17
17
  export { RuntimeLogging, assertRuntimeLogging, noopRuntimeLog, type RuntimeLog, type RuntimeLogLevel, type RuntimeLoggingOptions } from "./runtime-log.js";
18
+ export { extraStatusRecord, type ExtraStatusRecord } from "./service-status.js";
18
19
  export { sanitizePublicValue } from "./public-display.js";
19
20
  export { DEFAULT_REASONING_LEVEL_MAPS, OMNI_REASONING_LEVELS, mapReasoningEffort, reasoningLevelMap, type OmniReasoningLevel, type ReasoningLevelMap } from "./reasoning.js";
20
21
  export interface AdapterMetadata {
@@ -21,6 +21,7 @@ export { watchLineLimit } from "./line-limit.js";
21
21
  export { readBoundedLines } from "./bounded-lines.js";
22
22
  export { HourlyLogWriter, HOURLY_LOG_MAX_BYTES } from "./hourly-log.js";
23
23
  export { RuntimeLogging, assertRuntimeLogging, noopRuntimeLog } from "./runtime-log.js";
24
+ export { extraStatusRecord } from "./service-status.js";
24
25
  export { sanitizePublicValue } from "./public-display.js";
25
26
  export { DEFAULT_REASONING_LEVEL_MAPS, OMNI_REASONING_LEVELS, mapReasoningEffort, reasoningLevelMap } from "./reasoning.js";
26
27
  /**
@@ -0,0 +1,33 @@
1
+ export interface AdapterModuleEntry {
2
+ type?: string;
3
+ module: string;
4
+ export: string;
5
+ factory: boolean;
6
+ options: Record<string, unknown>;
7
+ sourceManifest: string;
8
+ }
9
+ export interface ExtraModuleEntry {
10
+ name: string;
11
+ module: string;
12
+ sourceManifest: string;
13
+ }
14
+ export interface ModuleManifest {
15
+ version: 1;
16
+ adapters: AdapterModuleEntry[];
17
+ extras: ExtraModuleEntry[];
18
+ }
19
+ /** CLI 清单边界:只校验声明、不导入模块;来源路径始终随条目保留,不能用合并位置替换。 */
20
+ export declare function parseModuleManifest(value: unknown, source: string, { legacy }?: {
21
+ legacy?: boolean | undefined;
22
+ }): ModuleManifest;
23
+ /** 只有可选用户文件的 ENOENT 表示无扩展;权限、JSON 或格式错误必须保留失败。 */
24
+ export declare function readModuleManifest(file: string, { optional, legacy }?: {
25
+ optional?: boolean | undefined;
26
+ legacy?: boolean | undefined;
27
+ }): Promise<ModuleManifest>;
28
+ /** 内置优先、用户追加;冲突项在解析/import 前剔除,诊断不得包含 options 或业务配置。 */
29
+ export declare function mergeModuleManifests(builtin: ModuleManifest, extension: ModuleManifest, report?: (message: string) => void): ModuleManifest;
30
+ /** 按原始清单解析裸包的 ESM import/exports;本机路径先转 URL,避免 Windows 盘符误判。 */
31
+ export declare function resolveModuleSpecifier(module: string, sourceManifest: string): string;
32
+ /** 仅解析选中 Adapter,生成可跨进程的启动快照;不提前解析或加载 Extra。 */
33
+ export declare function resolveAdapterModules(manifest: ModuleManifest): AdapterModuleEntry[];
@@ -0,0 +1,118 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import { dirname, isAbsolute, resolve } from "node:path";
3
+ import { pathToFileURL } from "node:url";
4
+ import { resolve as resolveEsm } from "import-meta-resolve";
5
+ /** CLI 清单边界:只校验声明、不导入模块;来源路径始终随条目保留,不能用合并位置替换。 */
6
+ export function parseModuleManifest(value, source, { legacy = false } = {}) {
7
+ const manifest = record(value, "manifest");
8
+ if (manifest.version !== 1)
9
+ throw new TypeError("manifest.version must be 1");
10
+ if (!Array.isArray(manifest.adapters))
11
+ throw new TypeError("manifest.adapters must be an array");
12
+ const extras = manifest.extras === undefined && legacy ? [] : manifest.extras;
13
+ if (!Array.isArray(extras))
14
+ throw new TypeError("manifest.extras must be an array");
15
+ const sourceManifest = resolve(source);
16
+ const adapters = manifest.adapters.map((value, index) => {
17
+ const entry = record(value, `adapters[${index}]`);
18
+ const type = entry.type === undefined && legacy ? undefined : text(entry.type, "adapter.type");
19
+ if (entry.factory !== undefined && typeof entry.factory !== "boolean")
20
+ throw new TypeError("adapter.factory must be a boolean");
21
+ return {
22
+ ...(type === undefined ? {} : { type }),
23
+ module: text(entry.module, "adapter.module"),
24
+ export: entry.export === undefined ? "default" : text(entry.export, "adapter.export"),
25
+ factory: entry.factory === true,
26
+ options: entry.options === undefined ? {} : record(entry.options, "adapter.options"),
27
+ sourceManifest
28
+ };
29
+ });
30
+ const extraEntries = extras.map((value, index) => {
31
+ const entry = record(value, `extras[${index}]`);
32
+ const name = text(entry.name, "extra.name");
33
+ if (!/^[a-z][a-z0-9-]{0,63}$/.test(name))
34
+ throw new TypeError("extra.name is invalid");
35
+ return { name, module: text(entry.module, "extra.module"), sourceManifest };
36
+ });
37
+ unique(adapters, (entry) => entry.type, "adapter.type");
38
+ unique(extraEntries, (entry) => entry.name, "extra.name");
39
+ return { version: 1, adapters, extras: extraEntries };
40
+ }
41
+ /** 只有可选用户文件的 ENOENT 表示无扩展;权限、JSON 或格式错误必须保留失败。 */
42
+ export async function readModuleManifest(file, { optional = false, legacy = false } = {}) {
43
+ let content;
44
+ try {
45
+ content = await readFile(file, "utf8");
46
+ }
47
+ catch (error) {
48
+ if (optional && error.code === "ENOENT")
49
+ return { version: 1, adapters: [], extras: [] };
50
+ throw error;
51
+ }
52
+ try {
53
+ return parseModuleManifest(JSON.parse(content), file, { legacy });
54
+ }
55
+ catch (error) {
56
+ throw Object.assign(new TypeError(`Invalid manifest ${file}: ${error instanceof Error ? error.message : "invalid JSON"}`, { cause: error }), { code: "MANIFEST_INVALID" });
57
+ }
58
+ }
59
+ /** 内置优先、用户追加;冲突项在解析/import 前剔除,诊断不得包含 options 或业务配置。 */
60
+ export function mergeModuleManifests(builtin, extension, report = () => { }) {
61
+ function merge(first, second, key) {
62
+ const seen = new Set(first.map(key).filter((value) => value !== undefined));
63
+ return [
64
+ ...first,
65
+ ...second.filter((entry) => {
66
+ const name = key(entry);
67
+ if (name !== undefined && seen.has(name)) {
68
+ report(`Ignoring extension module "${name}": built-in declaration takes precedence`);
69
+ return false;
70
+ }
71
+ if (name !== undefined)
72
+ seen.add(name);
73
+ return true;
74
+ })
75
+ ];
76
+ }
77
+ return {
78
+ version: 1,
79
+ adapters: merge(builtin.adapters, extension.adapters, (entry) => entry.type),
80
+ extras: merge(builtin.extras, extension.extras, (entry) => entry.name)
81
+ };
82
+ }
83
+ /** 按原始清单解析裸包的 ESM import/exports;本机路径先转 URL,避免 Windows 盘符误判。 */
84
+ export function resolveModuleSpecifier(module, sourceManifest) {
85
+ if (module.startsWith(".") || isAbsolute(module))
86
+ return pathToFileURL(resolve(dirname(sourceManifest), module)).href;
87
+ if (/^[a-z][a-z0-9+.-]*:/i.test(module))
88
+ return module;
89
+ return resolveEsm(module, pathToFileURL(resolve(sourceManifest)).href);
90
+ }
91
+ /** 仅解析选中 Adapter,生成可跨进程的启动快照;不提前解析或加载 Extra。 */
92
+ export function resolveAdapterModules(manifest) {
93
+ return manifest.adapters.map((entry) => ({
94
+ ...entry,
95
+ module: resolveModuleSpecifier(entry.module, entry.sourceManifest)
96
+ }));
97
+ }
98
+ function record(value, label) {
99
+ if (!value || typeof value !== "object" || Array.isArray(value))
100
+ throw new TypeError(`${label} must be an object`);
101
+ return value;
102
+ }
103
+ function text(value, label) {
104
+ if (typeof value !== "string" || !value.trim())
105
+ throw new TypeError(`${label} must be a non-empty string`);
106
+ return value;
107
+ }
108
+ function unique(entries, key, label) {
109
+ const seen = new Set();
110
+ for (const entry of entries) {
111
+ const value = key(entry);
112
+ if (value === undefined)
113
+ continue;
114
+ if (seen.has(value))
115
+ throw new TypeError(`duplicate ${label}: ${value}`);
116
+ seen.add(value);
117
+ }
118
+ }
@@ -1,4 +1,4 @@
1
- /** 日志专用线程:复用小时桶、容量与跨进程互斥,不运行任何业务逻辑。 */
1
+ /** Dedicated log thread: reuse hourly retention, capacity limits and cross-process exclusion. */
2
2
  import { parentPort, workerData } from "node:worker_threads";
3
3
  import { join } from "node:path";
4
4
  import { HourlyLogWriter } from "./hourly-log.js";
@@ -13,8 +13,10 @@ parentPort.on("message", (message) => {
13
13
  return;
14
14
  }
15
15
  try {
16
- const category = message.extra ?? "kernel";
17
- const key = message.extra ? `extra:${message.extra}` : "kernel";
16
+ const category = message.extra
17
+ ? `${message.extra}${message.status ? "-status" : ""}`
18
+ : "kernel";
19
+ const key = message.extra ? `extra:${category}` : "kernel";
18
20
  let writer = writers.get(key);
19
21
  if (!writer && writers.size < 128) {
20
22
  writer = new HourlyLogWriter(message.extra ? join(directory, "extras") : directory, category, { onError: () => { } });
@@ -23,7 +25,7 @@ parentPort.on("message", (message) => {
23
25
  writer?.write(message.line);
24
26
  }
25
27
  catch {
26
- /* 写入失败只丢弃本条诊断,不影响执行。 */
28
+ /* Dropping a diagnostic must never affect execution. */
27
29
  }
28
- parentPort.postMessage("written");
30
+ parentPort.postMessage({ written: message.status === true });
29
31
  });
@@ -1,7 +1,10 @@
1
+ import { type ExtraStatusRecord } from "./service-status.js";
1
2
  export type RuntimeLogLevel = "info" | "warn" | "error";
2
3
  export type RuntimeLog = (level: RuntimeLogLevel, event: string, data?: Readonly<Record<string, unknown>>) => void;
3
4
  export interface RuntimeLoggingOptions {
4
5
  directory: string;
6
+ /** In-process status sink; SDK defaults to silence. Never placed in JSON config or workerData. */
7
+ statusOutput?: (record: ExtraStatusRecord) => void;
5
8
  }
6
9
  export declare const noopRuntimeLog: RuntimeLog;
7
10
  export declare function assertRuntimeLogging(options?: RuntimeLoggingOptions): void;