@mininglamp-oss/octo-runtime 1.1.10 → 1.1.11

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 (170) hide show
  1. package/README.md +1 -1
  2. package/apps/cli/README.md +1 -1
  3. package/apps/cli/dist/adapters.js +40 -14
  4. package/apps/cli/dist/build-info.json +2 -2
  5. package/apps/cli/dist/command-tree.js +2 -3
  6. package/apps/cli/dist/extras.js +11 -1
  7. package/apps/cli/dist/index.js +14 -1
  8. package/apps/cli/dist/main.js +58 -23
  9. package/apps/cli/dist/module-manifest.js +21 -3
  10. package/apps/cli/dist/output.d.ts +19 -1
  11. package/apps/cli/dist/output.js +179 -27
  12. package/apps/cli/dist/playboard.js +2 -2
  13. package/apps/cli/dist/state.d.ts +5 -2
  14. package/apps/cli/dist/state.js +48 -13
  15. package/dist/public/codex.d.ts +1 -0
  16. package/dist/public/codex.js +1 -0
  17. package/dist/public/executor-kernel.d.ts +4 -0
  18. package/dist/public/executor-kernel.js +2 -0
  19. package/dist/public/extra.d.ts +1 -1
  20. package/dist/public/host.d.ts +5 -0
  21. package/dist/public/host.js +2 -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/dist/index.js +20 -0
  24. package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
  25. package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
  26. package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
  27. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
  28. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.d.ts +6 -6
  29. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +68 -253
  30. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.d.ts +11 -6
  31. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.js +198 -52
  32. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/service.d.ts +58 -0
  33. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/service.js +650 -0
  34. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.d.ts +3 -0
  35. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.js +15 -0
  36. package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
  37. package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
  38. package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
  39. package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
  40. package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
  41. package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
  42. package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
  43. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.d.ts +2 -0
  44. package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
  45. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
  46. package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
  47. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/activity.d.ts +5 -0
  48. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/execution-scope.d.ts +25 -0
  49. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/execution-scope.js +1 -0
  50. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +3 -0
  51. package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
  52. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.js +40 -14
  53. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
  54. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.js +2 -3
  55. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.js +11 -1
  56. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/index.js +14 -1
  57. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +58 -23
  58. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.js +21 -3
  59. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.d.ts +19 -1
  60. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +179 -27
  61. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +2 -2
  62. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.d.ts +5 -2
  63. package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.js +48 -13
  64. package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +23 -23
  65. package/node_modules/@mininglamp-oss/octo-runtime-client/build-info.json +5 -0
  66. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/async-question-reply.d.ts +30 -0
  67. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/async-question-reply.js +199 -0
  68. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/browser.d.ts +1 -0
  69. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/browser.js +1 -0
  70. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/client.d.ts +10 -0
  71. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/client.js +465 -0
  72. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/index.d.ts +6 -0
  73. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/index.js +6 -0
  74. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/internal.d.ts +4 -0
  75. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/internal.js +5 -0
  76. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/invocation-lifecycle.d.ts +59 -0
  77. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/invocation-lifecycle.js +287 -0
  78. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/notification.d.ts +1 -0
  79. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/notification.js +1 -0
  80. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/protocol.d.ts +1 -0
  81. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/protocol.js +1 -0
  82. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/runtime-path.d.ts +21 -0
  83. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/runtime-path.js +138 -0
  84. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-catalog.d.ts +8 -0
  85. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-catalog.js +65 -0
  86. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-diagnostics.d.ts +82 -0
  87. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-diagnostics.js +371 -0
  88. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/submission-error.d.ts +10 -0
  89. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/submission-error.js +23 -0
  90. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/types.d.ts +72 -0
  91. package/node_modules/@mininglamp-oss/octo-runtime-client/dist/types.js +10 -0
  92. package/node_modules/@mininglamp-oss/octo-runtime-client/package.json +54 -0
  93. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/context-configuration-fixtures.json +1219 -0
  94. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/context-fixtures.json +5988 -0
  95. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-client.behavior.json +56 -0
  96. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-ipc-fixtures.json +53 -0
  97. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-ipc.schema.json +538 -0
  98. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/native-invoke-fixtures.json +116 -0
  99. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/protocol.schema.json +4525 -0
  100. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/run-protocol-fixtures.json +761 -0
  101. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/runtime-selection-fixtures.json +663 -0
  102. package/node_modules/@mininglamp-oss/octo-runtime-client/schema/session-name-fixtures.json +191 -0
  103. package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
  104. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +26 -18
  105. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +151 -11
  106. package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
  107. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.d.ts +1 -30
  108. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.js +2 -199
  109. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.d.ts +1 -10
  110. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.js +2 -446
  111. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/endpoint.js +2 -0
  112. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.d.ts +2 -0
  113. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.js +13 -2
  114. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.d.ts +4 -1
  115. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.js +4 -1
  116. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-lifecycle.d.ts +1 -53
  117. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-lifecycle.js +2 -280
  118. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/lifecycle.d.ts +5 -10
  119. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/lifecycle.js +4 -1
  120. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-home.d.ts +20 -0
  121. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-home.js +180 -0
  122. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +31 -8
  123. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.d.ts +5 -2
  124. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +48 -5
  125. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-catalog.d.ts +1 -0
  126. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-catalog.js +1 -0
  127. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-diagnostics.d.ts +1 -0
  128. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-diagnostics.js +1 -0
  129. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-logging.d.ts +4 -0
  130. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-logging.js +18 -0
  131. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.d.ts +1 -10
  132. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.js +2 -23
  133. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/types.d.ts +2 -72
  134. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/types.js +2 -10
  135. package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +5 -4
  136. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/extra.js +1 -1
  137. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/ports.d.ts +2 -2
  138. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
  139. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/extra.js +1 -1
  140. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/ports.d.ts +2 -2
  141. package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
  142. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/index.js +4 -4
  143. package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
  144. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.d.ts +1 -1
  145. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.js +12 -5
  146. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/errors.d.ts +5 -1
  147. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/errors.js +9 -0
  148. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/execution.d.ts +44 -0
  149. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/execution.js +207 -0
  150. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-config.js +23 -3
  151. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-service.d.ts +27 -4
  152. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-service.js +133 -25
  153. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extras.d.ts +10 -3
  154. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extras.js +18 -4
  155. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/home.d.ts +5 -6
  156. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/home.js +33 -45
  157. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/identity.js +6 -0
  158. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.d.ts +4 -0
  159. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.js +3 -0
  160. package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +5 -4
  161. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/adapter-metadata.d.ts +7 -0
  162. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/adapter-metadata.js +1 -0
  163. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +19 -0
  164. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.d.ts +3 -1
  165. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +1 -0
  166. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/service-processes.d.ts +5 -0
  167. package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/service-processes.js +65 -0
  168. package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
  169. package/package.json +33 -27
  170. package/packages/octo-runtime-protocol/schema/protocol.schema.json +42 -0
@@ -1,13 +1,14 @@
1
1
  import { noopRuntimeLog } from "@mininglamp-oss/octo-runtime-adapter-sdk";
2
2
  import { abortForShutdown, shutdownDeadline, withinShutdown } from "./shutdown.js";
3
3
  import { snapshotExtraDependencies } from "./extra-dependencies.js";
4
+ import { ipcExecutionContext } from "./execution.js";
4
5
  export function assertExtraName(name) {
5
6
  if (typeof name !== "string" || !/^[a-z][a-z0-9-]{0,63}$/.test(name))
6
7
  throw new Error("EXTRA_NAME_INVALID");
7
8
  }
8
9
  /** 每个声明名最多一个实例;只加载宿主选定的插件,并统一管理取消、状态和清理。 */
9
10
  export class ExtraPlugins {
10
- kernel;
11
+ binding;
11
12
  logForExtra;
12
13
  #registrations = new Map();
13
14
  #instances = new Map();
@@ -31,8 +32,8 @@ export class ExtraPlugins {
31
32
  names.add(entry.name);
32
33
  }
33
34
  }
34
- constructor(registrations, kernel, logForExtra = () => noopRuntimeLog) {
35
- this.kernel = kernel;
35
+ constructor(registrations, binding, logForExtra = () => noopRuntimeLog) {
36
+ this.binding = binding;
36
37
  this.logForExtra = logForExtra;
37
38
  ExtraPlugins.validate(registrations);
38
39
  for (const registration of registrations) {
@@ -172,7 +173,9 @@ export class ExtraPlugins {
172
173
  assertStatusObject(registration.config);
173
174
  instance.controller.signal.throwIfAborted();
174
175
  const initialize = plugin.default({
175
- kernel: this.kernel,
176
+ ...("execution" in this.binding
177
+ ? this.binding
178
+ : { kernel: this.binding, execution: ipcExecutionContext(this.binding) }),
176
179
  log: (level, event, data) => {
177
180
  try {
178
181
  this.logForExtra(name)(level, event, data);
@@ -226,6 +229,17 @@ export class ExtraPlugins {
226
229
  });
227
230
  if (!instance.disposing && !instance.disposalError)
228
231
  this.#instances.delete(name);
232
+ if (cleanupFailed && instance.disposalError) {
233
+ // 回滚失败不能只留在加载器内部;聚合保留主失败与真实 disposer 链。
234
+ // 外层服务继续使用原 ServiceInitializationError/cleanup,主 message/code 保持兼容。
235
+ const failure = new AggregateError([error, instance.disposalError], error instanceof Error ? error.message : code, { cause: error });
236
+ const primaryCode = error instanceof Error
237
+ ? Object.getOwnPropertyDescriptor(error, "code")?.value
238
+ : undefined;
239
+ if (typeof primaryCode === "string")
240
+ Object.defineProperty(failure, "code", { value: primaryCode });
241
+ throw failure;
242
+ }
229
243
  throw error;
230
244
  }
231
245
  });
@@ -10,28 +10,27 @@ export interface HostHomePaths {
10
10
  pidFile: string;
11
11
  }
12
12
  export interface HostAccountPaths {
13
+ home: string;
13
14
  accountKey: string;
14
15
  root: string;
15
16
  configFile: string;
16
17
  logs: string;
17
18
  }
18
19
  export interface HostProfilePaths {
20
+ home: string;
19
21
  name: string;
20
22
  root: string;
21
23
  configFile: string;
22
24
  identityFile: string;
23
25
  credentialFile: string;
24
26
  }
25
- export declare function resolveHostHome(appId: string, options?: {
26
- platform?: NodeJS.Platform;
27
- env?: NodeJS.ProcessEnv;
28
- userHome?: string;
29
- }): string;
30
- export declare function hostHomePaths(homeInput: string, platform?: NodeJS.Platform): HostHomePaths;
27
+ /** 宿主先准备根;返回经过实际存在/权限与当前 endpoint 预算校验的 Home 路径,不创建身份。 */
28
+ export declare function hostHomePaths(homeInput: string): HostHomePaths;
31
29
  export declare function accountKeyFor(subjectType: string, subjectId: string): string;
32
30
  export declare function profileNameFor(appId: string, tenantId: string): string;
33
31
  export declare function accountPaths(paths: HostHomePaths, accountKey: string): HostAccountPaths;
34
32
  export declare function profilePaths(account: HostAccountPaths, name: string): HostProfilePaths;
33
+ /** 仅在宿主已存在的 Home 中创建 Runtime 子目录/身份;根不可用时失败,不自动修复根。 */
35
34
  export declare function ensureHostHome(paths: HostHomePaths): MachineIdentity;
36
35
  export declare function ensureAccount(account: HostAccountPaths, profiles: readonly string[]): void;
37
36
  export declare function readJson<T>(path: string): T;
@@ -1,31 +1,23 @@
1
1
  import { createHash, randomUUID } from "node:crypto";
2
2
  import { chmodSync, closeSync, existsSync, fsyncSync, mkdirSync, openSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
3
- import { homedir } from "node:os";
4
- import { basename, dirname, isAbsolute, join, parse, resolve, win32 } from "node:path";
3
+ import { basename, dirname, join } from "node:path";
4
+ import { normalizeRuntimeHome, validateRuntimeHome, assertRuntimePath, prepareHomeDirectory } from "@mininglamp-oss/octo-runtime-executor-kernel";
5
5
  import { HostRuntimeError } from "./errors.js";
6
6
  import { componentEndpoint } from "./endpoint.js";
7
7
  const PROFILE_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
8
8
  const MACHINE_PATTERN = /^machine_[0-9a-f-]{36}$/;
9
- export function resolveHostHome(appId, options = {}) {
10
- const slug = appSlug(appId);
11
- const platform = options.platform ?? process.platform;
12
- const env = options.env ?? process.env;
13
- const userHome = options.userHome ?? homedir();
14
- if (platform === "win32") {
15
- const localAppData = env.LOCALAPPDATA?.trim();
16
- if (!localAppData) {
17
- throw new HostRuntimeError("HOME_UNAVAILABLE", "home", false, "LOCALAPPDATA is required on Windows");
18
- }
19
- return win32.join(localAppData, slug, "OctoRuntime");
20
- }
21
- if (platform === "darwin")
22
- return join(userHome, "Library", "Application Support", slug, "octo-runtime");
23
- return join(env.XDG_STATE_HOME?.trim() || join(userHome, ".local", "state"), slug, "octo-runtime");
24
- }
25
- export function hostHomePaths(homeInput, platform = process.platform) {
26
- const home = validateHome(homeInput, platform);
9
+ /** 宿主先准备根;返回经过实际存在/权限与当前 endpoint 预算校验的 Home 路径,不创建身份。 */
10
+ export function hostHomePaths(homeInput) {
11
+ const home = normalizeRuntimeHome(homeInput);
27
12
  const run = join(home, "run");
28
- const socket = componentEndpoint(home, "executor-kernel", platform);
13
+ const socket = componentEndpoint(home, "executor-kernel");
14
+ validateRuntimeHome(home, [
15
+ { path: join(home, "octo-runtime-executor-kernel.pid"), resource: "kernel-pid" },
16
+ {
17
+ path: join(home, `.machine.json.${"0".repeat(10)}.${"0".repeat(36)}.tmp`),
18
+ resource: "machine-identity"
19
+ }
20
+ ]);
29
21
  return {
30
22
  home,
31
23
  machineFile: join(home, "machine.json"),
@@ -52,6 +44,7 @@ export function profileNameFor(appId, tenantId) {
52
44
  export function accountPaths(paths, accountKey) {
53
45
  const root = join(paths.home, "accounts", accountKey);
54
46
  return {
47
+ home: paths.home,
55
48
  accountKey,
56
49
  root,
57
50
  configFile: join(root, "config.json"),
@@ -62,7 +55,9 @@ export function profilePaths(account, name) {
62
55
  if (!PROFILE_PATTERN.test(name))
63
56
  throw new HostRuntimeError("PROFILE_INVALID", "home", false, `invalid profile: ${name}`);
64
57
  const root = join(account.root, name);
58
+ assertRuntimePath(join(root, "credentials", `.runtime-token.json.${"0".repeat(10)}.${"0".repeat(36)}.tmp`), "profile-credential");
65
59
  return {
60
+ home: account.home,
66
61
  name,
67
62
  root,
68
63
  configFile: join(root, "config.json"),
@@ -70,11 +65,16 @@ export function profilePaths(account, name) {
70
65
  credentialFile: join(root, "credentials", "runtime-token.json")
71
66
  };
72
67
  }
68
+ /** 仅在宿主已存在的 Home 中创建 Runtime 子目录/身份;根不可用时失败,不自动修复根。 */
73
69
  export function ensureHostHome(paths) {
74
- for (const directory of [paths.home, paths.run, join(paths.home, "accounts")])
75
- mkdirSync(directory, { recursive: true });
70
+ validateRuntimeHome(paths.home, [
71
+ { path: paths.machineFile, resource: "machine-identity" },
72
+ { path: paths.run, resource: "runtime-state" }
73
+ ]);
74
+ for (const directory of [paths.run, join(paths.home, "accounts")])
75
+ prepareHomeDirectory(paths.home, directory);
76
76
  if (process.platform !== "win32")
77
- mkdirSync(dirname(paths.socket), { recursive: true });
77
+ prepareHomeDirectory(paths.home, dirname(paths.socket));
78
78
  if (existsSync(paths.machineFile)) {
79
79
  const machine = readJson(paths.machineFile);
80
80
  if (machine.schema_version !== 1 || !MACHINE_PATTERN.test(machine.machine_id)) {
@@ -87,12 +87,15 @@ export function ensureHostHome(paths) {
87
87
  return machine;
88
88
  }
89
89
  export function ensureAccount(account, profiles) {
90
+ validateRuntimeHome(account.home, [
91
+ { path: account.configFile, resource: "account-configuration" }
92
+ ]);
90
93
  if (profiles.length === 0)
91
94
  throw new HostRuntimeError("TENANTS_EMPTY", "home", false, "at least one authorized tenant is required");
92
95
  for (const profile of profiles) {
93
96
  const paths = profilePaths(account, profile);
94
- mkdirSync(dirname(paths.identityFile), { recursive: true });
95
- mkdirSync(dirname(paths.credentialFile), { recursive: true });
97
+ prepareHomeDirectory(account.home, dirname(paths.identityFile));
98
+ prepareHomeDirectory(account.home, dirname(paths.credentialFile));
96
99
  }
97
100
  const existing = existsSync(account.configFile)
98
101
  ? readJson(account.configFile)
@@ -112,7 +115,8 @@ export function readJson(path) {
112
115
  }
113
116
  catch (error) {
114
117
  throw new HostRuntimeError("LOCAL_STATE_INVALID", "home", false, `cannot read ${path}`, {
115
- cause: error
118
+ cause: error,
119
+ context: { path, resource: "local-state", operation: "read" }
116
120
  });
117
121
  }
118
122
  }
@@ -122,8 +126,9 @@ export function readJsonOptional(path) {
122
126
  return readJson(path);
123
127
  }
124
128
  export function writeJsonAtomic(path, value, secret = false) {
125
- mkdirSync(dirname(path), { recursive: true });
126
129
  const temporary = join(dirname(path), `.${basename(path)}.${process.pid}.${randomUUID()}.tmp`);
130
+ assertRuntimePath(temporary, "runtime-state");
131
+ mkdirSync(dirname(path), { recursive: true });
127
132
  const fd = openSync(temporary, "wx", secret ? 0o600 : 0o644);
128
133
  try {
129
134
  writeFileSync(fd, `${JSON.stringify(value, null, 2)}\n`, "utf8");
@@ -141,23 +146,6 @@ export function writeJsonAtomic(path, value, secret = false) {
141
146
  export function removeFile(path) {
142
147
  rmSync(path, { force: true });
143
148
  }
144
- function validateHome(homeInput, platform) {
145
- const pathApi = platform === "win32" ? win32 : { isAbsolute, resolve, parse };
146
- if (!homeInput.trim() || !pathApi.isAbsolute(homeInput)) {
147
- throw new HostRuntimeError("HOME_INVALID", "home", false, "Embedded Runtime Home must be an absolute path");
148
- }
149
- const home = pathApi.resolve(homeInput);
150
- const root = pathApi.parse(home).root;
151
- if (home === root)
152
- throw new HostRuntimeError("HOME_INVALID", "home", false, "filesystem root cannot be used as Embedded Runtime Home");
153
- if (platform === "win32") {
154
- const input = homeInput.replaceAll("/", "\\");
155
- if (input.startsWith("\\\\") || input.startsWith("\\\\?\\") || /^[A-Za-z]:[^\\]/.test(input)) {
156
- throw new HostRuntimeError("HOME_UNSUPPORTED", "home", false, "Windows Embedded Runtime Home must be a local absolute path");
157
- }
158
- }
159
- return home;
160
- }
161
149
  function appSlug(appId) {
162
150
  const normalized = appId
163
151
  .trim()
@@ -1,6 +1,12 @@
1
1
  import { randomUUID } from "node:crypto";
2
+ import { validateRuntimeHome } from "@mininglamp-oss/octo-runtime-executor-kernel";
2
3
  import { readJsonOptional, writeJsonAtomic } from "./home.js";
3
4
  export function ensureLocalRuntime(profile, tenant) {
5
+ // 路径对象可能来自先前读取;写身份前重新确认根,不能递归补建已经消失的 Home。
6
+ validateRuntimeHome(profile.home, [
7
+ { path: profile.identityFile, resource: "runtime-identity" },
8
+ { path: profile.configFile, resource: "profile-configuration" }
9
+ ]);
4
10
  const saved = readJsonOptional(profile.identityFile);
5
11
  if (saved &&
6
12
  (saved.schema_version !== 1 ||
@@ -4,7 +4,11 @@ export * from "./extras.js";
4
4
  export * from "./extra-config.js";
5
5
  export * from "./context-loader.js";
6
6
  export * from "./extra-service.js";
7
+ export type { ExtraExecution, ExtraExecutionContext } from "./execution.js";
7
8
  export * from "./endpoint.js";
8
9
  export * from "./home.js";
9
10
  export * from "./identity.js";
10
11
  export * from "./extra-commands.js";
12
+ export { RuntimeHomeError, normalizeRuntimeHome, validateRuntimeHome, assertRuntimePath, assertIpcEndpoint, runtimePathFailure, type StartupPathDiagnostic } from "@mininglamp-oss/octo-runtime-executor-kernel";
13
+ export { HostRuntimeError } from "./errors.js";
14
+ export { STARTUP_CATALOG, describeStartupError, formatStartupDiagnostic, StartupError, type StartupDiagnostic, type StartupContext, type StartupLocation, type StartupCause } from "@mininglamp-oss/octo-runtime-executor-kernel";
@@ -7,3 +7,6 @@ export * from "./endpoint.js";
7
7
  export * from "./home.js";
8
8
  export * from "./identity.js";
9
9
  export * from "./extra-commands.js";
10
+ export { RuntimeHomeError, normalizeRuntimeHome, validateRuntimeHome, assertRuntimePath, assertIpcEndpoint, runtimePathFailure } from "@mininglamp-oss/octo-runtime-executor-kernel";
11
+ export { HostRuntimeError } from "./errors.js";
12
+ export { STARTUP_CATALOG, describeStartupError, formatStartupDiagnostic, StartupError } from "@mininglamp-oss/octo-runtime-executor-kernel";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-host-sdk",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -23,9 +23,10 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.10",
27
- "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.10",
28
- "@mininglamp-oss/octo-runtime-protocol": "1.1.10"
26
+ "@mininglamp-oss/octo-runtime-executor-core": "1.1.11",
27
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.11",
28
+ "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.11",
29
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.11"
29
30
  },
30
31
  "types": "./dist/index.d.ts",
31
32
  "files": [
@@ -0,0 +1,7 @@
1
+ import type { AdapterProtocolSupport } from "./run-protocol.js";
2
+ import type { HostedAdapterMetadataWire } from "./generated/protocol-types.js";
3
+ /** 宿主注册及执行时使用的完整元数据;编写时的可选默认值须由 Adapter 工厂先补齐。 */
4
+ export type HostedAdapterMetadata = Pick<HostedAdapterMetadataWire, "workspace" | "type" | "agentSources" | "processModel" | "transport" | "providerVersion" | "providerPath" | "available" | "unavailableReason"> & {
5
+ /** wire 可省略的编写输入不能放宽 Core 注册合同。 */
6
+ protocolSupport: AdapterProtocolSupport;
7
+ };
@@ -595,6 +595,21 @@ export interface ExecutionEvidence {
595
595
  reason?: "provider_unsupported" | "adapter_unmapped" | "provider_unconfirmed";
596
596
  };
597
597
  }
598
+ /**
599
+ * This interface was referenced by `OctoRuntimeProtocolSchema`'s JSON-Schema
600
+ * via the `definition` "ServiceProcessSnapshot".
601
+ */
602
+ export interface ServiceProcessSnapshot {
603
+ scope_id: string;
604
+ service_id: string;
605
+ incarnation: number;
606
+ provider: string;
607
+ owner_pid: number;
608
+ pid?: number;
609
+ state: "not_started" | "starting" | "ready" | "recovering" | "degraded" | "closing" | "closed" | "cleanup_incomplete";
610
+ observation: "alive" | "exited" | "unknown";
611
+ ownership: "owned";
612
+ }
598
613
  /**
599
614
  * This interface was referenced by `OctoRuntimeProtocolSchema`'s JSON-Schema
600
615
  * via the `definition` "KernelStatus".
@@ -604,6 +619,10 @@ export interface KernelStatus {
604
619
  kernel_instance_id: string;
605
620
  pid: number;
606
621
  execution_ready: boolean;
622
+ /**
623
+ * @maxItems 256
624
+ */
625
+ service_processes?: ServiceProcessSnapshot[];
607
626
  }
608
627
  /**
609
628
  * This interface was referenced by `OctoRuntimeProtocolSchema`'s JSON-Schema
@@ -1,10 +1,12 @@
1
+ export type { HostedAdapterMetadata } from "./adapter-metadata.js";
1
2
  export { assertAsyncQuestions, assertQuestionRequest, assertQuestionResponse, questionAnswerText } from "./questions.js";
2
3
  export type { AsyncUserInputQuestion, AsyncQuestionReplySnapshot, QuestionRequest, QuestionResponse } from "./generated/protocol-types.js";
3
4
  export { assertJsonByteLimit } from "./json-size.js";
4
5
  export { INVOKE_REQUEST_MAX_BYTES, assertInvokeRequestSize } from "./invoke-size.js";
5
6
  export * from "./stream-limits.js";
7
+ export { assertKernelStatus, assertServiceProcessSnapshot } from "./service-processes.js";
6
8
  export * from "./run-protocol.js";
7
- export type { KernelLookupKey, KernelRunRef, KernelRunSnapshot, KernelStatus } from "./generated/protocol-types.js";
9
+ export type { KernelLookupKey, KernelRunRef, KernelRunSnapshot, KernelStatus, ServiceProcessSnapshot } from "./generated/protocol-types.js";
8
10
  export * from "./invoke-input.js";
9
11
  export * from "./model-context.js";
10
12
  export * from "./execution-plan.js";
@@ -5,6 +5,7 @@ import { assertSessionName } from "./invoke-input.js";
5
5
  export { assertJsonByteLimit } from "./json-size.js";
6
6
  export { INVOKE_REQUEST_MAX_BYTES, assertInvokeRequestSize } from "./invoke-size.js";
7
7
  export * from "./stream-limits.js";
8
+ export { assertKernelStatus, assertServiceProcessSnapshot } from "./service-processes.js";
8
9
  export * from "./run-protocol.js";
9
10
  export * from "./invoke-input.js";
10
11
  export * from "./model-context.js";
@@ -0,0 +1,5 @@
1
+ import type { KernelStatus, ServiceProcessSnapshot } from "./generated/protocol-types.js";
2
+ /** status 的安全进程白名单与共享 Schema 对齐,拒绝任意 argv/env 扩展字段。 */
3
+ export declare function assertServiceProcessSnapshot(value: unknown): asserts value is ServiceProcessSnapshot;
4
+ /** 兼容没有服务快照的旧 status;有快照时完整校验后才能交给 doctor。 */
5
+ export declare function assertKernelStatus(value: unknown): asserts value is KernelStatus;
@@ -0,0 +1,65 @@
1
+ const record = (value) => {
2
+ if (!value || typeof value !== "object" || Array.isArray(value))
3
+ throw new TypeError("INVALID_KERNEL_STATUS");
4
+ return value;
5
+ };
6
+ const positive = (value) => typeof value === "number" && Number.isSafeInteger(value) && value > 0;
7
+ /** status 的安全进程白名单与共享 Schema 对齐,拒绝任意 argv/env 扩展字段。 */
8
+ export function assertServiceProcessSnapshot(value) {
9
+ const item = record(value);
10
+ if (Object.keys(item).some((key) => ![
11
+ "scope_id",
12
+ "service_id",
13
+ "incarnation",
14
+ "provider",
15
+ "owner_pid",
16
+ "pid",
17
+ "state",
18
+ "observation",
19
+ "ownership"
20
+ ].includes(key)) ||
21
+ ["scope_id", "service_id", "provider"].some((key) => typeof item[key] !== "string" || !item[key].length) ||
22
+ typeof item.incarnation !== "number" ||
23
+ !Number.isSafeInteger(item.incarnation) ||
24
+ item.incarnation < 0 ||
25
+ !positive(item.owner_pid) ||
26
+ (item.pid !== undefined && !positive(item.pid)) ||
27
+ typeof item.state !== "string" ||
28
+ ![
29
+ "not_started",
30
+ "starting",
31
+ "ready",
32
+ "recovering",
33
+ "degraded",
34
+ "closing",
35
+ "closed",
36
+ "cleanup_incomplete"
37
+ ].includes(item.state) ||
38
+ typeof item.observation !== "string" ||
39
+ !["alive", "exited", "unknown"].includes(item.observation) ||
40
+ item.ownership !== "owned")
41
+ throw new TypeError("INVALID_KERNEL_STATUS");
42
+ }
43
+ /** 兼容没有服务快照的旧 status;有快照时完整校验后才能交给 doctor。 */
44
+ export function assertKernelStatus(value) {
45
+ const item = record(value);
46
+ if (Object.keys(item).some((key) => ![
47
+ "ipc_version",
48
+ "kernel_instance_id",
49
+ "pid",
50
+ "execution_ready",
51
+ "service_processes"
52
+ ].includes(key)) ||
53
+ item.ipc_version !== 1 ||
54
+ typeof item.kernel_instance_id !== "string" ||
55
+ !item.kernel_instance_id ||
56
+ !positive(item.pid) ||
57
+ typeof item.execution_ready !== "boolean")
58
+ throw new TypeError("INVALID_KERNEL_STATUS");
59
+ if (item.service_processes !== undefined) {
60
+ if (!Array.isArray(item.service_processes) || item.service_processes.length > 256)
61
+ throw new TypeError("INVALID_KERNEL_STATUS");
62
+ for (const process of item.service_processes)
63
+ assertServiceProcessSnapshot(process);
64
+ }
65
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime-protocol",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mininglamp-oss/octo-runtime",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "description": "Provider-neutral Agent runtime for unified execution through provider adapters",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,6 +16,10 @@
16
16
  "octo-runtime": "apps/cli/dist/index.js"
17
17
  },
18
18
  "exports": {
19
+ "./adapters/codex": {
20
+ "types": "./dist/public/codex.d.ts",
21
+ "import": "./dist/public/codex.js"
22
+ },
19
23
  "./adapters/dsh": {
20
24
  "types": "./dist/public/dsh.d.ts",
21
25
  "import": "./dist/public/dsh.js"
@@ -86,32 +90,33 @@
86
90
  "access": "public"
87
91
  },
88
92
  "dependencies": {
93
+ "@mininglamp-oss/octo-runtime-client": "1.1.11",
94
+ "@mininglamp-oss/octo-runtime-protocol": "1.1.11",
89
95
  "commander": "15.0.0",
90
- "@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.10",
96
+ "@mininglamp-oss/octo-runtime-adapter-dsh": "1.1.11",
91
97
  "semver": "7.8.5",
92
- "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.10",
93
- "@mininglamp-oss/octo-runtime-protocol": "1.1.10",
98
+ "@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.11",
94
99
  "import-meta-resolve": "4.2.0",
95
- "@mininglamp-oss/octo-runtime-extra-webui": "1.1.10",
96
- "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.10",
97
- "@mininglamp-oss/octo-runtime-acp-client": "1.1.10",
98
- "@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.10",
99
- "@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.10",
100
- "@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.10",
101
- "@mininglamp-oss/octo-runtime-adapter-codex": "1.1.10",
102
- "@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.10",
103
- "@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.10",
104
- "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.10",
105
- "@mininglamp-oss/octo-runtime-executor-core": "1.1.10",
106
- "@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.10",
107
- "@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.10",
108
- "@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.10",
100
+ "@mininglamp-oss/octo-runtime-extra-webui": "1.1.11",
101
+ "@mininglamp-oss/octo-runtime-adapter-acp": "1.1.11",
102
+ "@mininglamp-oss/octo-runtime-acp-client": "1.1.11",
103
+ "@mininglamp-oss/octo-runtime-adapter-antigravity": "1.1.11",
104
+ "@mininglamp-oss/octo-runtime-adapter-claude-code": "1.1.11",
105
+ "@mininglamp-oss/octo-runtime-adapter-codebuddy": "1.1.11",
106
+ "@mininglamp-oss/octo-runtime-adapter-codex": "1.1.11",
107
+ "@mininglamp-oss/octo-runtime-adapter-hermes": "1.1.11",
108
+ "@mininglamp-oss/octo-runtime-adapter-grok-build": "1.1.11",
109
+ "@mininglamp-oss/octo-runtime-executor-kernel": "1.1.11",
110
+ "@mininglamp-oss/octo-runtime-executor-core": "1.1.11",
111
+ "@mininglamp-oss/octo-runtime-adapter-kimi-code": "1.1.11",
112
+ "@mininglamp-oss/octo-runtime-adapter-mcode": "1.1.11",
113
+ "@mininglamp-oss/octo-runtime-adapter-openclaw": "1.1.11",
109
114
  "ws": "8.22.0",
110
- "@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.10",
111
- "@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.10",
112
- "@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.10",
113
- "@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.10",
114
- "@mininglamp-oss/octo-runtime-host-sdk": "1.1.10",
115
+ "@mininglamp-oss/octo-runtime-adapter-opencode": "1.1.11",
116
+ "@mininglamp-oss/octo-runtime-adapter-qodercli": "1.1.11",
117
+ "@mininglamp-oss/octo-runtime-adapter-qoderclicn": "1.1.11",
118
+ "@mininglamp-oss/octo-runtime-extra-channel-gateway": "1.1.11",
119
+ "@mininglamp-oss/octo-runtime-host-sdk": "1.1.11",
115
120
  "mdast-util-from-markdown": "2.1.0",
116
121
  "@types/mdast": "4.0.4",
117
122
  "@types/unist": "3.0.3",
@@ -147,19 +152,20 @@
147
152
  "micromark-util-sanitize-uri": "2.0.1",
148
153
  "micromark-util-decode-string": "2.0.1",
149
154
  "unist-util-stringify-position": "4.0.0",
150
- "@mininglamp-oss/octo-runtime-cross-service": "1.1.10",
155
+ "@mininglamp-oss/octo-runtime-cross-service": "1.1.11",
151
156
  "iconv-lite": "0.7.3",
152
157
  "safer-buffer": "2.1.2",
153
- "@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.10",
154
- "@mininglamp-oss/octo-runtime-cli": "1.1.10",
158
+ "@mininglamp-oss/octo-runtime-extra-channel-wecom": "1.1.11",
159
+ "@mininglamp-oss/octo-runtime-cli": "1.1.11",
155
160
  "json5": "2.2.3"
156
161
  },
157
162
  "bundleDependencies": [
163
+ "@mininglamp-oss/octo-runtime-client",
164
+ "@mininglamp-oss/octo-runtime-protocol",
158
165
  "commander",
159
166
  "@mininglamp-oss/octo-runtime-adapter-dsh",
160
167
  "semver",
161
168
  "@mininglamp-oss/octo-runtime-adapter-sdk",
162
- "@mininglamp-oss/octo-runtime-protocol",
163
169
  "import-meta-resolve",
164
170
  "@mininglamp-oss/octo-runtime-extra-webui",
165
171
  "@mininglamp-oss/octo-runtime-adapter-acp",
@@ -122,6 +122,43 @@
122
122
  }
123
123
  }
124
124
  },
125
+ "ServiceProcessSnapshot": {
126
+ "title": "ServiceProcessSnapshot",
127
+ "type": "object",
128
+ "additionalProperties": false,
129
+ "required": [
130
+ "scope_id",
131
+ "service_id",
132
+ "incarnation",
133
+ "provider",
134
+ "owner_pid",
135
+ "state",
136
+ "observation",
137
+ "ownership"
138
+ ],
139
+ "properties": {
140
+ "scope_id": { "type": "string", "minLength": 1 },
141
+ "service_id": { "type": "string", "minLength": 1 },
142
+ "incarnation": { "type": "integer", "minimum": 0 },
143
+ "provider": { "type": "string", "minLength": 1 },
144
+ "owner_pid": { "type": "integer", "minimum": 1 },
145
+ "pid": { "type": "integer", "minimum": 1 },
146
+ "state": {
147
+ "enum": [
148
+ "not_started",
149
+ "starting",
150
+ "ready",
151
+ "recovering",
152
+ "degraded",
153
+ "closing",
154
+ "closed",
155
+ "cleanup_incomplete"
156
+ ]
157
+ },
158
+ "observation": { "enum": ["alive", "exited", "unknown"] },
159
+ "ownership": { "const": "owned" }
160
+ }
161
+ },
125
162
  "KernelStatus": {
126
163
  "title": "KernelStatus",
127
164
  "type": "object",
@@ -141,6 +178,11 @@
141
178
  },
142
179
  "execution_ready": {
143
180
  "type": "boolean"
181
+ },
182
+ "service_processes": {
183
+ "type": "array",
184
+ "maxItems": 256,
185
+ "items": { "$ref": "#/definitions/ServiceProcessSnapshot" }
144
186
  }
145
187
  }
146
188
  },