@mininglamp-oss/octo-runtime 1.1.9 → 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.
- package/README.md +2 -2
- package/apps/cli/README.md +1 -1
- package/{node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-configuration.d.ts → apps/cli/dist/adapter-configuration.d.ts} +1 -0
- package/{node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-configuration.js → apps/cli/dist/adapter-configuration.js} +1 -0
- package/apps/cli/dist/adapter-configurations.d.ts +1 -1
- package/apps/cli/dist/adapter-configurations.js +1 -1
- package/apps/cli/dist/adapters.d.ts +7 -0
- package/apps/cli/dist/adapters.js +77 -0
- package/apps/cli/dist/build-info.json +2 -2
- package/apps/cli/dist/command-tree.js +2 -3
- package/apps/cli/dist/extras.js +11 -1
- package/apps/cli/dist/help.js +1 -1
- package/apps/cli/dist/index.js +18 -1
- package/apps/cli/dist/main.d.ts +2 -0
- package/apps/cli/dist/main.js +67 -34
- package/apps/cli/dist/manifest.json +0 -5
- package/apps/cli/dist/module-manifest.js +21 -3
- package/apps/cli/dist/output.d.ts +19 -1
- package/apps/cli/dist/output.js +180 -33
- package/apps/cli/dist/playboard-interrupt.d.ts +6 -0
- package/apps/cli/dist/playboard-interrupt.js +86 -0
- package/apps/cli/dist/playboard.d.ts +2 -0
- package/apps/cli/dist/playboard.js +10 -11
- package/apps/cli/dist/state.d.ts +5 -2
- package/apps/cli/dist/state.js +48 -13
- package/dist/public/codex.d.ts +1 -0
- package/dist/public/codex.js +1 -0
- package/dist/public/executor-kernel.d.ts +4 -1
- package/dist/public/executor-kernel.js +2 -1
- package/dist/public/extra.d.ts +1 -1
- package/dist/public/host.d.ts +5 -0
- package/dist/public/host.js +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-acp-client/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/dist/index.js +20 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-acp/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-antigravity/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-claude-code/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codebuddy/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.d.ts +6 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/app-server.js +68 -253
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.d.ts +11 -6
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/index.js +198 -52
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/service.d.ts +58 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/service.js +650 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/dist/stdin-writer.js +15 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-codex/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-dsh/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-grok-build/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-hermes/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-kimi-code/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-mcode/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-openclaw/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/dist/index.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-opencode/package.json +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qodercli/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-qoderclicn/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/activity.d.ts +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/execution-scope.d.ts +25 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/index.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/reasoning.js +1 -2
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/service-status.js +12 -30
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configuration.d.ts +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configuration.js +125 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapter-configurations.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.d.ts +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/adapters.js +77 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/build-info.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/command-tree.js +2 -3
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/extras.js +11 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/help.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/index.js +18 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/main.js +67 -34
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/manifest.json +0 -5
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/module-manifest.js +21 -3
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.d.ts +19 -1
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/output.js +180 -33
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard-interrupt.d.ts +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard-interrupt.js +86 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.d.ts +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/playboard.js +10 -11
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.d.ts +5 -2
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/state.js +48 -13
- package/node_modules/@mininglamp-oss/octo-runtime-cli/package.json +23 -24
- package/node_modules/@mininglamp-oss/octo-runtime-client/build-info.json +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/async-question-reply.d.ts +30 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/async-question-reply.js +199 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/browser.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/browser.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/client.d.ts +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/client.js +465 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/index.d.ts +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/index.js +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/internal.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/internal.js +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/invocation-lifecycle.d.ts +59 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/invocation-lifecycle.js +287 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/notification.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/notification.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/protocol.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/protocol.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/runtime-path.d.ts +21 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/runtime-path.js +138 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-catalog.d.ts +8 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-catalog.js +65 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-diagnostics.d.ts +82 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/startup-diagnostics.js +371 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/submission-error.d.ts +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/submission-error.js +23 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/types.d.ts +72 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/dist/types.js +10 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/package.json +54 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/context-configuration-fixtures.json +1219 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/context-fixtures.json +5988 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-client.behavior.json +56 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-ipc-fixtures.json +53 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/kernel-ipc.schema.json +538 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/native-invoke-fixtures.json +116 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/protocol.schema.json +4525 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/run-protocol-fixtures.json +761 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/runtime-selection-fixtures.json +663 -0
- package/node_modules/@mininglamp-oss/octo-runtime-client/schema/session-name-fixtures.json +191 -0
- package/node_modules/@mininglamp-oss/octo-runtime-cross-service/package.json +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.d.ts +29 -21
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/dist/index.js +173 -14
- package/node_modules/@mininglamp-oss/octo-runtime-executor-core/package.json +3 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.d.ts +1 -30
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/async-question-reply.js +2 -199
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.d.ts +1 -8
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/client.js +2 -444
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/endpoint.js +2 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/execution-source.d.ts +17 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/execution-source.js +21 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.d.ts +11 -9
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/host-run-service.js +14 -3
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.d.ts +5 -7
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/index.js +6 -7
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-lifecycle.d.ts +1 -53
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-lifecycle.js +2 -280
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.d.ts +14 -13
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/invocation-manifest.js +84 -187
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/lifecycle.d.ts +5 -10
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/lifecycle.js +4 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-home.d.ts +20 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runtime-home.js +180 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.d.ts +5 -8
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/server.js +75 -45
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.d.ts +9 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/service.js +60 -5
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-catalog.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-catalog.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-diagnostics.d.ts +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-diagnostics.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-logging.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/startup-logging.js +18 -0
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.d.ts +1 -10
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/submission-error.js +2 -23
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/types.d.ts +2 -72
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/types.js +2 -10
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/package.json +5 -12
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/extra.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/dist/ports.d.ts +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-gateway/package.json +6 -6
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/extra.js +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/dist/ports.d.ts +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-extra-channel-wecom/package.json +5 -5
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/index.js +4 -4
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/assets/{index-BVxePruX.js → index-BLMf2Etg.js} +1 -3
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/dist/web/index.html +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-extra-webui/package.json +2 -2
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.d.ts +1 -1
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/endpoint.js +12 -5
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/errors.d.ts +5 -1
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/errors.js +9 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/execution.d.ts +44 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/execution.js +207 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-config.js +23 -3
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-service.d.ts +27 -4
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extra-service.js +133 -25
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extras.d.ts +10 -3
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/extras.js +18 -4
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/home.d.ts +5 -6
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/home.js +33 -45
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/identity.js +6 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.d.ts +4 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/dist/index.js +3 -0
- package/node_modules/@mininglamp-oss/octo-runtime-host-sdk/package.json +5 -4
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/adapter-metadata.d.ts +7 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/generated/protocol-types.d.ts +19 -15
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.d.ts +3 -1
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/index.js +1 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/service-processes.d.ts +5 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/dist/service-processes.js +65 -0
- package/node_modules/@mininglamp-oss/octo-runtime-protocol/package.json +1 -1
- package/package.json +33 -29
- package/packages/octo-runtime-protocol/schema/protocol.schema.json +42 -36
- package/apps/cli/dist/worker.js +0 -18
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/app-server.d.ts +0 -63
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/app-server.js +0 -846
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.d.ts +0 -54
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/dist/index.js +0 -154
- package/node_modules/@mininglamp-oss/octo-runtime-adapter-zcode-gui/package.json +0 -15
- package/node_modules/@mininglamp-oss/octo-runtime-cli/dist/worker.js +0 -18
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.d.ts +0 -16
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/heartbeat.js +0 -59
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.d.ts +0 -6
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/manifest-adapters.js +0 -88
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.d.ts +0 -1
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.js +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.d.ts +0 -42
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/process.js +0 -292
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.d.ts +0 -64
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/rpc.js +0 -674
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.d.ts +0 -2
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/runner.js +0 -5
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.d.ts +0 -10
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/serve.js +0 -96
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.d.ts +0 -15
- package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/supervisor.js +0 -279
- /package/{apps/cli/dist/worker.d.ts → node_modules/@mininglamp-oss/octo-runtime-adapter-sdk/dist/execution-scope.js} +0 -0
- /package/node_modules/@mininglamp-oss/{octo-runtime-cli/dist/worker.d.ts → octo-runtime-protocol/dist/adapter-metadata.js} +0 -0
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { type AdapterInvocationContext, type InvokeRequest, type ProbeResult } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
-
import { type InteractionResponse } from "@mininglamp-oss/octo-runtime-protocol";
|
|
3
|
-
import { type ZcodeAppServerCommand, type ZcodeAppServerSpawn } from "./app-server.js";
|
|
4
|
-
export { normalizeZcodeEvent, runZcodeAppServerTurn, ZcodeAppServerProcessError, ZcodeAppServerRpcError, ZcodeEventNormalizer, type ZcodeAppServerCommand, type ZcodeAppServerSpawn, type ZcodeSessionEvent } from "./app-server.js";
|
|
5
|
-
/** Resolve the CLI embedded in ZCode Desktop when no PATH command is installed. */
|
|
6
|
-
export declare function discoverZcodeBin(env?: NodeJS.ProcessEnv): string | undefined;
|
|
7
|
-
/** Build the exact subprocess command for one invocation. */
|
|
8
|
-
export declare function buildZcodeCommand(request: InvokeRequest, command?: string, appServerArgs?: readonly string[]): ZcodeAppServerCommand;
|
|
9
|
-
export declare function probeZcodeGui(env?: NodeJS.ProcessEnv): Promise<ProbeResult>;
|
|
10
|
-
export declare function createZcodeGuiAdapter({ command, appServerArgs, spawnFn }?: {
|
|
11
|
-
command?: string;
|
|
12
|
-
appServerArgs?: readonly string[];
|
|
13
|
-
spawnFn?: ZcodeAppServerSpawn;
|
|
14
|
-
}): Readonly<Omit<{
|
|
15
|
-
metadata: {
|
|
16
|
-
type: string;
|
|
17
|
-
agentSources: "provisioned"[];
|
|
18
|
-
processModel: string;
|
|
19
|
-
transport: string;
|
|
20
|
-
};
|
|
21
|
-
probe: () => Promise<ProbeResult>;
|
|
22
|
-
respondInteraction(invocationId: string, response: InteractionResponse): Promise<void>;
|
|
23
|
-
invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<import("@mininglamp-oss/octo-runtime-protocol").CanonicalEvent, void, any>;
|
|
24
|
-
}, "metadata"> & {
|
|
25
|
-
metadata: Omit<{
|
|
26
|
-
type: string;
|
|
27
|
-
agentSources: "provisioned"[];
|
|
28
|
-
processModel: string;
|
|
29
|
-
transport: string;
|
|
30
|
-
}, "protocolSupport"> & {
|
|
31
|
-
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
32
|
-
};
|
|
33
|
-
}>;
|
|
34
|
-
export declare const zcodeGuiAdapter: Readonly<Omit<{
|
|
35
|
-
metadata: {
|
|
36
|
-
type: string;
|
|
37
|
-
agentSources: "provisioned"[];
|
|
38
|
-
processModel: string;
|
|
39
|
-
transport: string;
|
|
40
|
-
};
|
|
41
|
-
probe: () => Promise<ProbeResult>;
|
|
42
|
-
respondInteraction(invocationId: string, response: InteractionResponse): Promise<void>;
|
|
43
|
-
invoke(request: InvokeRequest, context?: AdapterInvocationContext): AsyncGenerator<import("@mininglamp-oss/octo-runtime-protocol").CanonicalEvent, void, any>;
|
|
44
|
-
}, "metadata"> & {
|
|
45
|
-
metadata: Omit<{
|
|
46
|
-
type: string;
|
|
47
|
-
agentSources: "provisioned"[];
|
|
48
|
-
processModel: string;
|
|
49
|
-
transport: string;
|
|
50
|
-
}, "protocolSupport"> & {
|
|
51
|
-
protocolSupport: import("@mininglamp-oss/octo-runtime-protocol").AdapterProtocolSupport;
|
|
52
|
-
};
|
|
53
|
-
}>;
|
|
54
|
-
export default zcodeGuiAdapter;
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { hasImageInput, invocationEnvironment, processEnvironmentValue } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
2
|
-
import { execFile } from "node:child_process";
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
4
|
-
import { homedir } from "node:os";
|
|
5
|
-
import { delimiter, extname, join, resolve } from "node:path";
|
|
6
|
-
import { promisify } from "node:util";
|
|
7
|
-
import { AcpApprovalBridge, defineAdapter, probeCommand } from "@mininglamp-oss/octo-runtime-adapter-sdk";
|
|
8
|
-
import { runZcodeAppServerTurn } from "./app-server.js";
|
|
9
|
-
export { normalizeZcodeEvent, runZcodeAppServerTurn, ZcodeAppServerProcessError, ZcodeAppServerRpcError, ZcodeEventNormalizer } from "./app-server.js";
|
|
10
|
-
const DEFAULT_APP_SERVER_ARGS = [
|
|
11
|
-
"app-server",
|
|
12
|
-
"--stdio",
|
|
13
|
-
"--disallowed-tools",
|
|
14
|
-
"CronCreate CronList CronUpdate CronDelete"
|
|
15
|
-
];
|
|
16
|
-
/** Resolve the CLI embedded in ZCode Desktop when no PATH command is installed. */
|
|
17
|
-
export function discoverZcodeBin(env = process.env) {
|
|
18
|
-
const configured = nonEmptyString(processEnvironmentValue(env, "ZCODE_BIN"));
|
|
19
|
-
if (configured)
|
|
20
|
-
return resolve(configured);
|
|
21
|
-
const pathCommand = findOnPath("zcode", env);
|
|
22
|
-
if (pathCommand)
|
|
23
|
-
return pathCommand;
|
|
24
|
-
const home = homedir();
|
|
25
|
-
const candidates = process.platform === "win32"
|
|
26
|
-
? [
|
|
27
|
-
join(processEnvironmentValue(env, "LOCALAPPDATA") ?? join(home, "AppData", "Local"), "Programs", "ZCode", "resources", "glm", "zcode.cjs")
|
|
28
|
-
]
|
|
29
|
-
: process.platform === "darwin"
|
|
30
|
-
? [
|
|
31
|
-
"/Applications/ZCode.app/Contents/Resources/glm/zcode.cjs",
|
|
32
|
-
join(home, "Applications", "ZCode.app", "Contents", "Resources", "glm", "zcode.cjs")
|
|
33
|
-
]
|
|
34
|
-
: ["/opt/ZCode/resources/glm/zcode.cjs", "/usr/share/zcode/resources/glm/zcode.cjs"];
|
|
35
|
-
return candidates.find(existsSync);
|
|
36
|
-
}
|
|
37
|
-
/** Build the exact subprocess command for one invocation. */
|
|
38
|
-
export function buildZcodeCommand(request, command, appServerArgs) {
|
|
39
|
-
if (hasImageInput(request))
|
|
40
|
-
throw new Error("UNSUPPORTED_INPUT_MODALITY: zcode-gui does not encode image input");
|
|
41
|
-
if (command) {
|
|
42
|
-
return {
|
|
43
|
-
command,
|
|
44
|
-
args: [...(appServerArgs ?? DEFAULT_APP_SERVER_ARGS)],
|
|
45
|
-
cwd: request.workdir,
|
|
46
|
-
env: invocationEnvironment(request)
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
const zcodeBin = discoverZcodeBin(invocationEnvironment(request));
|
|
50
|
-
if (!zcodeBin) {
|
|
51
|
-
return {
|
|
52
|
-
command: "zcode",
|
|
53
|
-
args: [...(appServerArgs ?? DEFAULT_APP_SERVER_ARGS)],
|
|
54
|
-
cwd: request.workdir,
|
|
55
|
-
env: invocationEnvironment(request)
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
const args = [...(appServerArgs ?? DEFAULT_APP_SERVER_ARGS)];
|
|
59
|
-
return isJavaScriptEntry(zcodeBin)
|
|
60
|
-
? {
|
|
61
|
-
command: process.execPath,
|
|
62
|
-
args: [zcodeBin, ...args],
|
|
63
|
-
cwd: request.workdir,
|
|
64
|
-
env: invocationEnvironment(request)
|
|
65
|
-
}
|
|
66
|
-
: { command: zcodeBin, args, cwd: request.workdir, env: invocationEnvironment(request) };
|
|
67
|
-
}
|
|
68
|
-
export async function probeZcodeGui(env = process.env) {
|
|
69
|
-
const zcodeBin = discoverZcodeBin(env);
|
|
70
|
-
if (!zcodeBin)
|
|
71
|
-
return probeCommand("zcode", { env });
|
|
72
|
-
if (!isJavaScriptEntry(zcodeBin))
|
|
73
|
-
return probeCommand(zcodeBin, { env });
|
|
74
|
-
if (!existsSync(zcodeBin))
|
|
75
|
-
return { available: false, command: zcodeBin, reason: "command_not_found" };
|
|
76
|
-
let version = null;
|
|
77
|
-
try {
|
|
78
|
-
const { stdout } = await promisify(execFile)(process.execPath, [zcodeBin, "--version"], {
|
|
79
|
-
env,
|
|
80
|
-
timeout: 2_000,
|
|
81
|
-
maxBuffer: 4_096,
|
|
82
|
-
windowsHide: true
|
|
83
|
-
});
|
|
84
|
-
version =
|
|
85
|
-
stdout.match(/(?:^|\s)v?(\d+\.\d+(?:\.\d+)?(?:[-+][A-Za-z0-9.-]+)?)(?=\s|$)/)?.[1] ?? null;
|
|
86
|
-
}
|
|
87
|
-
catch {
|
|
88
|
-
// Availability is distinct from version support, matching the shared probe contract.
|
|
89
|
-
}
|
|
90
|
-
return { available: true, command: zcodeBin, version };
|
|
91
|
-
}
|
|
92
|
-
export function createZcodeGuiAdapter({ command, appServerArgs, spawnFn } = {}) {
|
|
93
|
-
const responders = new Map();
|
|
94
|
-
return defineAdapter({
|
|
95
|
-
metadata: {
|
|
96
|
-
type: "zcode-gui",
|
|
97
|
-
agentSources: ["provisioned"],
|
|
98
|
-
processModel: "subprocess-per-invocation",
|
|
99
|
-
transport: "zcode-ndjson-rpc/stdio"
|
|
100
|
-
},
|
|
101
|
-
probe: () => (command ? probeCommand(command) : probeZcodeGui()),
|
|
102
|
-
async respondInteraction(invocationId, response) {
|
|
103
|
-
const bridge = responders.get(invocationId);
|
|
104
|
-
if (!bridge)
|
|
105
|
-
throw new Error("INTERACTION_NOT_ACTIVE");
|
|
106
|
-
await bridge.respond(response);
|
|
107
|
-
},
|
|
108
|
-
async *invoke(request, context) {
|
|
109
|
-
if (request.approvalMode === "assisted")
|
|
110
|
-
throw new Error("APPROVAL_MODE_UNSUPPORTED");
|
|
111
|
-
if (responders.has(request.invocationId))
|
|
112
|
-
throw new Error("INVOCATION_ALREADY_ACTIVE");
|
|
113
|
-
const bridge = new AcpApprovalBridge(request);
|
|
114
|
-
responders.set(request.invocationId, bridge);
|
|
115
|
-
try {
|
|
116
|
-
const spec = buildZcodeCommand(request, command, appServerArgs);
|
|
117
|
-
yield* bridge.stream(runZcodeAppServerTurn({
|
|
118
|
-
request,
|
|
119
|
-
spec,
|
|
120
|
-
context,
|
|
121
|
-
approvalBridge: bridge,
|
|
122
|
-
...(spawnFn ? { spawnFn } : {})
|
|
123
|
-
}));
|
|
124
|
-
}
|
|
125
|
-
finally {
|
|
126
|
-
bridge.close("execution_lost");
|
|
127
|
-
responders.delete(request.invocationId);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
function findOnPath(command, env) {
|
|
133
|
-
const extensions = process.platform === "win32"
|
|
134
|
-
? ["", ...(processEnvironmentValue(env, "PATHEXT") ?? ".EXE;.CMD;.BAT;.COM").split(";")]
|
|
135
|
-
: [""];
|
|
136
|
-
for (const directory of (processEnvironmentValue(env, "PATH") ?? "").split(delimiter)) {
|
|
137
|
-
if (!directory)
|
|
138
|
-
continue;
|
|
139
|
-
for (const extension of extensions) {
|
|
140
|
-
const candidate = resolve(directory, command + extension);
|
|
141
|
-
if (existsSync(candidate))
|
|
142
|
-
return candidate;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return undefined;
|
|
146
|
-
}
|
|
147
|
-
function isJavaScriptEntry(path) {
|
|
148
|
-
return [".cjs", ".mjs", ".js"].includes(extname(path).toLowerCase());
|
|
149
|
-
}
|
|
150
|
-
function nonEmptyString(value) {
|
|
151
|
-
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
152
|
-
}
|
|
153
|
-
export const zcodeGuiAdapter = createZcodeGuiAdapter();
|
|
154
|
-
export default zcodeGuiAdapter;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@mininglamp-oss/octo-runtime-adapter-zcode-gui",
|
|
3
|
-
"version": "1.1.9",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"exports": "./dist/index.js",
|
|
7
|
-
"dependencies": {
|
|
8
|
-
"@mininglamp-oss/octo-runtime-protocol": "1.1.9",
|
|
9
|
-
"@mininglamp-oss/octo-runtime-adapter-sdk": "1.1.9"
|
|
10
|
-
},
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"files": [
|
|
13
|
-
"dist"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
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);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/** A paused supervisor cannot establish worker failure; require a fresh probe after a gap. */
|
|
2
|
-
export declare class WorkerHeartbeat {
|
|
3
|
-
#private;
|
|
4
|
-
private readonly wallNow;
|
|
5
|
-
private readonly monotonicNow;
|
|
6
|
-
activeMs: number;
|
|
7
|
-
healthyMs: number;
|
|
8
|
-
constructor(wallNow?: () => number, monotonicNow?: () => number);
|
|
9
|
-
tick(): {
|
|
10
|
-
type: "ping";
|
|
11
|
-
id: number;
|
|
12
|
-
} | {
|
|
13
|
-
type: "waiting" | "expired";
|
|
14
|
-
};
|
|
15
|
-
pong(id: unknown): void;
|
|
16
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { performance } from "node:perf_hooks";
|
|
2
|
-
/** A paused supervisor cannot establish worker failure; require a fresh probe after a gap. */
|
|
3
|
-
export class WorkerHeartbeat {
|
|
4
|
-
wallNow;
|
|
5
|
-
monotonicNow;
|
|
6
|
-
#wall;
|
|
7
|
-
#mono;
|
|
8
|
-
#sequence = 0;
|
|
9
|
-
#pending;
|
|
10
|
-
#answered = false;
|
|
11
|
-
activeMs = 0;
|
|
12
|
-
healthyMs = 0;
|
|
13
|
-
constructor(wallNow = Date.now, monotonicNow = () => performance.now()) {
|
|
14
|
-
this.wallNow = wallNow;
|
|
15
|
-
this.monotonicNow = monotonicNow;
|
|
16
|
-
this.#wall = wallNow();
|
|
17
|
-
this.#mono = monotonicNow();
|
|
18
|
-
}
|
|
19
|
-
#gap(wall, mono) {
|
|
20
|
-
return (wall < this.#wall ||
|
|
21
|
-
mono < this.#mono ||
|
|
22
|
-
wall - this.#wall >= 5000 ||
|
|
23
|
-
mono - this.#mono >= 5000);
|
|
24
|
-
}
|
|
25
|
-
tick() {
|
|
26
|
-
const wall = this.wallNow(), mono = this.monotonicNow();
|
|
27
|
-
// Either clock can reveal suspend or a blocked supervisor; discard pre-gap liveness evidence.
|
|
28
|
-
if (this.#gap(wall, mono)) {
|
|
29
|
-
this.#pending = undefined;
|
|
30
|
-
this.#answered = false;
|
|
31
|
-
this.healthyMs = 0;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
const elapsed = mono - this.#mono;
|
|
35
|
-
this.activeMs += elapsed;
|
|
36
|
-
if (this.#answered)
|
|
37
|
-
this.healthyMs += elapsed;
|
|
38
|
-
}
|
|
39
|
-
this.#wall = wall;
|
|
40
|
-
this.#mono = mono;
|
|
41
|
-
this.#answered = false;
|
|
42
|
-
// Ordinary timer ticks never renew an unanswered probe's fixed deadline.
|
|
43
|
-
if (this.#pending)
|
|
44
|
-
return { type: mono >= this.#pending.deadline ? "expired" : "waiting" };
|
|
45
|
-
this.#pending = { id: ++this.#sequence, deadline: mono + 5000 };
|
|
46
|
-
return { type: "ping", id: this.#sequence };
|
|
47
|
-
}
|
|
48
|
-
pong(id) {
|
|
49
|
-
const wall = this.wallNow(), mono = this.monotonicNow();
|
|
50
|
-
// A queued or stale pong cannot establish post-resume health or extend the new deadline.
|
|
51
|
-
if (this.#gap(wall, mono) ||
|
|
52
|
-
!this.#pending ||
|
|
53
|
-
id !== this.#pending.id ||
|
|
54
|
-
mono >= this.#pending.deadline)
|
|
55
|
-
return;
|
|
56
|
-
this.#pending = undefined;
|
|
57
|
-
this.#answered = true;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { parseModuleManifest, readModuleManifest, resolveModuleSpecifier } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
|
|
2
|
-
/**
|
|
3
|
-
* 仅供清单驱动的 worker 在自身进程装配:只实例化所选模块,返回后由入口注册及 serveWorker。
|
|
4
|
-
* CLI 可在注册前用实际 metadata 做产品准备;SDK 原生 import 入口不经过此文件加载边界。
|
|
5
|
-
*/
|
|
6
|
-
export async function loadManifestAdapters() {
|
|
7
|
-
const index = process.argv.indexOf("--manifest");
|
|
8
|
-
const entries = process.argv.includes("--adapters-from-ipc")
|
|
9
|
-
? await receiveAdapters()
|
|
10
|
-
: index >= 0 && process.argv[index + 1]
|
|
11
|
-
? (await readModuleManifest(process.argv[index + 1], { legacy: true })).adapters
|
|
12
|
-
: (() => {
|
|
13
|
-
throw new Error("usage: octo-runtime-executor-kernel --manifest <file>");
|
|
14
|
-
})();
|
|
15
|
-
const adapters = [];
|
|
16
|
-
for (const entry of entries) {
|
|
17
|
-
const specifier = resolveModuleSpecifier(entry.module, entry.sourceManifest);
|
|
18
|
-
const loaded = await import(specifier);
|
|
19
|
-
const exports = asRecord(loaded, `adapter module ${entry.module}`);
|
|
20
|
-
const exported = exports[entry.export];
|
|
21
|
-
if (exported === undefined)
|
|
22
|
-
throw new Error(`missing export ${entry.export} from ${entry.module}`);
|
|
23
|
-
// 动态模块先校验工厂与 Adapter 形状,再交给唯一 Core 注册;不提前探测未选模块。
|
|
24
|
-
const instance = entry.factory ? callFactory(exported, entry) : exported;
|
|
25
|
-
if (!isHostedAdapter(instance))
|
|
26
|
-
throw new TypeError(`${entry.module}#${entry.export} is not an Octo Runtime adapter`);
|
|
27
|
-
if (entry.type && instance.metadata.type !== entry.type)
|
|
28
|
-
throw new Error(`manifest type ${entry.type} does not match adapter ${instance.metadata.type}`);
|
|
29
|
-
adapters.push(instance);
|
|
30
|
-
}
|
|
31
|
-
return adapters;
|
|
32
|
-
}
|
|
33
|
-
/** 内部启动消息只携带 JSON 模块声明,不传函数/实例;就绪仍沿用既有 list/probe 握手。 */
|
|
34
|
-
function receiveAdapters() {
|
|
35
|
-
return new Promise((resolve, reject) => {
|
|
36
|
-
const cleanup = () => {
|
|
37
|
-
clearTimeout(timer);
|
|
38
|
-
process.off("message", onMessage);
|
|
39
|
-
process.off("disconnect", onDisconnect);
|
|
40
|
-
};
|
|
41
|
-
const onDisconnect = () => {
|
|
42
|
-
cleanup();
|
|
43
|
-
reject(new Error("Adapter initialization channel disconnected"));
|
|
44
|
-
};
|
|
45
|
-
const onMessage = (message) => {
|
|
46
|
-
if (!isRecord(message) || message.type !== "kernel.adapters")
|
|
47
|
-
return;
|
|
48
|
-
cleanup();
|
|
49
|
-
try {
|
|
50
|
-
// 快照已经解析为绝对位置;这个路径只用于结构校验,不读取或生成任何文件。
|
|
51
|
-
resolve(parseModuleManifest({ version: 1, adapters: message.adapters, extras: [] }, process.cwd(), { legacy: true }).adapters);
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
reject(error instanceof Error ? error : new Error("Invalid Adapter initialization"));
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
const timer = setTimeout(() => {
|
|
58
|
-
cleanup();
|
|
59
|
-
reject(new Error("Adapter initialization timed out"));
|
|
60
|
-
}, 15000);
|
|
61
|
-
process.on("message", onMessage);
|
|
62
|
-
process.once("disconnect", onDisconnect);
|
|
63
|
-
if (!process.connected)
|
|
64
|
-
onDisconnect();
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
function callFactory(value, entry) {
|
|
68
|
-
if (typeof value !== "function")
|
|
69
|
-
throw new TypeError(`${entry.module}#${entry.export} is marked as a factory but is not callable`);
|
|
70
|
-
return value(entry.options);
|
|
71
|
-
}
|
|
72
|
-
function isHostedAdapter(value) {
|
|
73
|
-
if (!isRecord(value) || !isRecord(value.metadata))
|
|
74
|
-
return false;
|
|
75
|
-
return (typeof value.metadata.type === "string" &&
|
|
76
|
-
Array.isArray(value.metadata.agentSources) &&
|
|
77
|
-
value.metadata.agentSources.length > 0 &&
|
|
78
|
-
value.metadata.agentSources.every((source) => source === "preset" || source === "provisioned") &&
|
|
79
|
-
typeof value.invoke === "function");
|
|
80
|
-
}
|
|
81
|
-
function asRecord(value, label) {
|
|
82
|
-
if (!isRecord(value))
|
|
83
|
-
throw new TypeError(`${label} must be an object`);
|
|
84
|
-
return value;
|
|
85
|
-
}
|
|
86
|
-
function isRecord(value) {
|
|
87
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
88
|
-
}
|
package/node_modules/@mininglamp-oss/octo-runtime-executor-kernel/dist/module-specifier.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { resolveModuleSpecifier as resolveAdapterModuleSpecifier } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { type ChildProcess, type ChildProcessByStdio } from "node:child_process";
|
|
2
|
-
import type { Readable, Writable } from "node:stream";
|
|
3
|
-
import type { HostedAdapterMetadata } from "./index.js";
|
|
4
|
-
import { WorkerRpcClient } from "./rpc.js";
|
|
5
|
-
import type { AdapterModuleEntry } from "@mininglamp-oss/octo-runtime-adapter-sdk/module-manifest";
|
|
6
|
-
export interface SpawnWorkerOptions {
|
|
7
|
-
entrypoint: string;
|
|
8
|
-
/** CLI JSON 来源;SDK 的直接 import 入口不需要此参数。 */
|
|
9
|
-
manifest?: string;
|
|
10
|
-
/** CLI 已解析的不可变装配快照;与 manifest 互斥,不改变 SDK 自有 worker 的入口。 */
|
|
11
|
-
adapterModules?: AdapterModuleEntry[];
|
|
12
|
-
env?: NodeJS.ProcessEnv;
|
|
13
|
-
/** 取消就绪等待并请求回收子进程;POSIX 使用进程组,Windows taskkill 不保证父先退后的后代回收。 */
|
|
14
|
-
signal?: AbortSignal;
|
|
15
|
-
/** 启动快照发送和首次 RPC 就绪握手共用的最大等待时间。 */
|
|
16
|
-
readyTimeoutMs?: number;
|
|
17
|
-
onSpawn?: (child: ChildProcess) => Promise<void>;
|
|
18
|
-
}
|
|
19
|
-
type HostedChild = ChildProcessByStdio<Writable, Readable, Readable>;
|
|
20
|
-
/** 保留失败进程的回收入口;只有重新确认回收成功后,监督器才允许创建替代 worker。 */
|
|
21
|
-
export declare class WorkerCleanupError extends AggregateError {
|
|
22
|
-
readonly retryCleanup: (until: number) => Promise<void>;
|
|
23
|
-
readonly pid?: number | undefined;
|
|
24
|
-
readonly code: string;
|
|
25
|
-
constructor(errors: unknown[], retryCleanup: (until: number) => Promise<void>, pid?: number | undefined);
|
|
26
|
-
}
|
|
27
|
-
export interface WorkerProcess {
|
|
28
|
-
client: WorkerRpcClient;
|
|
29
|
-
child: HostedChild;
|
|
30
|
-
adapters: HostedAdapterMetadata[];
|
|
31
|
-
close(): Promise<void>;
|
|
32
|
-
stderr(): string;
|
|
33
|
-
}
|
|
34
|
-
/** Kernel 内部传递关闭预算;公开 WorkerProcess.close() 仍然无参数。故障恢复不等待日志排空。 */
|
|
35
|
-
export declare function closeWorker(worker: WorkerProcess, until: number, immediate?: boolean): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* 启动 Node worker,以首次 list RPC 成功作为就绪确认,再返回客户端与进程所有权。
|
|
38
|
-
* 入口/manifest/环境错误在启动阶段携带有界 stderr 抛出;失败路径仍须回收已创建的进程。
|
|
39
|
-
* owner 必须等待 close;清理失败不能当作可安全启动替代 worker 的普通启动错误。
|
|
40
|
-
*/
|
|
41
|
-
export declare function spawnWorker({ entrypoint, manifest, adapterModules, env, signal, onSpawn, readyTimeoutMs }: SpawnWorkerOptions): Promise<WorkerProcess>;
|
|
42
|
-
export {};
|