jishushell 0.4.10 → 0.4.24-beta.2
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/Dockerfile.hermes-slim +193 -0
- package/INSTALL-NOTICE +10 -12
- package/apps/hermes-container.yaml +35 -0
- package/apps/ollama-binary.yaml +164 -0
- package/apps/ollama-cpu-container.yaml +37 -0
- package/apps/ollama-with-hollama-binary.yaml +159 -0
- package/apps/openclaw-binary.yaml +69 -0
- package/apps/openclaw-container.yaml +37 -0
- package/apps/openclaw-with-ollama-container.yaml +42 -0
- package/apps/openclaw-with-searxng-container.yaml +136 -0
- package/apps/openwebui-container.yaml +53 -0
- package/apps/playwright-container.yaml +120 -0
- package/apps/searxng-container.yaml +115 -0
- package/dist/auth.d.ts +1 -0
- package/dist/auth.js +15 -14
- package/dist/auth.js.map +1 -1
- package/dist/cli/app.d.ts +4 -0
- package/dist/cli/app.js +874 -0
- package/dist/cli/app.js.map +1 -0
- package/dist/cli/backup.d.ts +3 -0
- package/dist/cli/backup.js +434 -0
- package/dist/cli/backup.js.map +1 -0
- package/dist/{doctor.d.ts → cli/doctor.d.ts} +7 -1
- package/dist/{doctor.js → cli/doctor.js} +377 -22
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/helpers.d.ts +4 -0
- package/dist/cli/helpers.js +32 -0
- package/dist/cli/helpers.js.map +1 -0
- package/dist/cli/job.d.ts +4 -0
- package/dist/cli/job.js +198 -0
- package/dist/cli/job.js.map +1 -0
- package/dist/cli/llm.d.ts +25 -0
- package/dist/cli/llm.js +599 -0
- package/dist/cli/llm.js.map +1 -0
- package/dist/cli/managed-list.d.ts +30 -0
- package/dist/cli/managed-list.js +129 -0
- package/dist/cli/managed-list.js.map +1 -0
- package/dist/cli/panel.d.ts +26 -0
- package/dist/cli/panel.js +804 -0
- package/dist/cli/panel.js.map +1 -0
- package/dist/cli/version.d.ts +1 -0
- package/dist/cli/version.js +12 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/cli.js +48 -776
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +69 -0
- package/dist/config.js +268 -7
- package/dist/config.js.map +1 -1
- package/dist/control.d.ts +17 -41
- package/dist/control.js +61 -1323
- package/dist/control.js.map +1 -1
- package/dist/install.d.ts +16 -0
- package/dist/install.js +75 -26
- package/dist/install.js.map +1 -1
- package/dist/routes/agent-apps.d.ts +15 -0
- package/dist/routes/agent-apps.js +78 -0
- package/dist/routes/agent-apps.js.map +1 -0
- package/dist/routes/apps.d.ts +3 -0
- package/dist/routes/apps.js +278 -0
- package/dist/routes/apps.js.map +1 -0
- package/dist/routes/backup.js +3 -3
- package/dist/routes/backup.js.map +1 -1
- package/dist/routes/instances.d.ts +6 -0
- package/dist/routes/instances.js +863 -874
- package/dist/routes/instances.js.map +1 -1
- package/dist/routes/llm.d.ts +15 -0
- package/dist/routes/llm.js +247 -0
- package/dist/routes/llm.js.map +1 -0
- package/dist/routes/runtime.d.ts +15 -0
- package/dist/routes/runtime.js +69 -0
- package/dist/routes/runtime.js.map +1 -0
- package/dist/routes/setup.js +131 -9
- package/dist/routes/setup.js.map +1 -1
- package/dist/routes/system.js +56 -9
- package/dist/routes/system.js.map +1 -1
- package/dist/server.js +107 -7
- package/dist/server.js.map +1 -1
- package/dist/services/agent-apps/catalog.d.ts +30 -0
- package/dist/services/agent-apps/catalog.js +60 -0
- package/dist/services/agent-apps/catalog.js.map +1 -0
- package/dist/services/agent-apps/index.d.ts +36 -0
- package/dist/services/agent-apps/index.js +171 -0
- package/dist/services/agent-apps/index.js.map +1 -0
- package/dist/services/agent-apps/installers/adapter-probes.d.ts +49 -0
- package/dist/services/agent-apps/installers/adapter-probes.js +223 -0
- package/dist/services/agent-apps/installers/adapter-probes.js.map +1 -0
- package/dist/services/agent-apps/installers/adapter.d.ts +30 -0
- package/dist/services/agent-apps/installers/adapter.js +171 -0
- package/dist/services/agent-apps/installers/adapter.js.map +1 -0
- package/dist/services/agent-apps/installers/registry-probe.d.ts +38 -0
- package/dist/services/agent-apps/installers/registry-probe.js +183 -0
- package/dist/services/agent-apps/installers/registry-probe.js.map +1 -0
- package/dist/services/agent-apps/installers/shell-script.d.ts +47 -0
- package/dist/services/agent-apps/installers/shell-script.js +471 -0
- package/dist/services/agent-apps/installers/shell-script.js.map +1 -0
- package/dist/services/agent-apps/types.d.ts +125 -0
- package/dist/services/agent-apps/types.js +17 -0
- package/dist/services/agent-apps/types.js.map +1 -0
- package/dist/services/app/app-compiler.d.ts +15 -0
- package/dist/services/app/app-compiler.js +172 -0
- package/dist/services/app/app-compiler.js.map +1 -0
- package/dist/services/app/app-manager.d.ts +142 -0
- package/dist/services/app/app-manager.js +2148 -0
- package/dist/services/app/app-manager.js.map +1 -0
- package/dist/services/app/custom-manager.d.ts +27 -0
- package/dist/services/app/custom-manager.js +285 -0
- package/dist/services/app/custom-manager.js.map +1 -0
- package/dist/services/app/hermes-agent-manager.d.ts +20 -0
- package/dist/services/app/hermes-agent-manager.js +289 -0
- package/dist/services/app/hermes-agent-manager.js.map +1 -0
- package/dist/services/app/id-normalizer.d.ts +27 -0
- package/dist/services/app/id-normalizer.js +77 -0
- package/dist/services/app/id-normalizer.js.map +1 -0
- package/dist/services/app/ollama-manager.d.ts +18 -0
- package/dist/services/app/ollama-manager.js +207 -0
- package/dist/services/app/ollama-manager.js.map +1 -0
- package/dist/services/app/openclaw-manager.d.ts +63 -0
- package/dist/services/app/openclaw-manager.js +1178 -0
- package/dist/services/app/openclaw-manager.js.map +1 -0
- package/dist/services/app/paths.d.ts +47 -0
- package/dist/services/app/paths.js +68 -0
- package/dist/services/app/paths.js.map +1 -0
- package/dist/services/app/registry.d.ts +17 -0
- package/dist/services/app/registry.js +31 -0
- package/dist/services/app/registry.js.map +1 -0
- package/dist/services/app/remote-spec.d.ts +14 -0
- package/dist/services/app/remote-spec.js +58 -0
- package/dist/services/app/remote-spec.js.map +1 -0
- package/dist/services/app/terminal-session-manager.d.ts +27 -0
- package/dist/services/app/terminal-session-manager.js +157 -0
- package/dist/services/app/terminal-session-manager.js.map +1 -0
- package/dist/services/app/types.d.ts +72 -0
- package/dist/services/app/types.js +16 -0
- package/dist/services/app/types.js.map +1 -0
- package/dist/services/backup-manager.js +60 -22
- package/dist/services/backup-manager.js.map +1 -1
- package/dist/services/instance-manager.d.ts +125 -34
- package/dist/services/instance-manager.js +679 -1043
- package/dist/services/instance-manager.js.map +1 -1
- package/dist/services/llm-proxy/adapters.js +5 -1
- package/dist/services/llm-proxy/adapters.js.map +1 -1
- package/dist/services/llm-proxy/circuit-breaker.js +10 -2
- package/dist/services/llm-proxy/circuit-breaker.js.map +1 -1
- package/dist/services/llm-proxy/index.d.ts +43 -0
- package/dist/services/llm-proxy/index.js +120 -5
- package/dist/services/llm-proxy/index.js.map +1 -1
- package/dist/services/llm-proxy/ssrf.js +1 -1
- package/dist/services/llm-proxy/ssrf.js.map +1 -1
- package/dist/services/nomad-manager.d.ts +260 -3
- package/dist/services/nomad-manager.js +2921 -341
- package/dist/services/nomad-manager.js.map +1 -1
- package/dist/services/panel-manager.d.ts +50 -0
- package/dist/services/panel-manager.js +443 -0
- package/dist/services/panel-manager.js.map +1 -0
- package/dist/services/plugin-installer.js +28 -2
- package/dist/services/plugin-installer.js.map +1 -1
- package/dist/services/process-manager.js +42 -7
- package/dist/services/process-manager.js.map +1 -1
- package/dist/services/runtime/adapters/custom.d.ts +20 -0
- package/dist/services/runtime/adapters/custom.js +90 -0
- package/dist/services/runtime/adapters/custom.js.map +1 -0
- package/dist/services/runtime/adapters/hermes.d.ts +174 -0
- package/dist/services/runtime/adapters/hermes.js +1316 -0
- package/dist/services/runtime/adapters/hermes.js.map +1 -0
- package/dist/services/runtime/adapters/openclaw-routes.d.ts +17 -0
- package/dist/services/runtime/adapters/openclaw-routes.js +946 -0
- package/dist/services/runtime/adapters/openclaw-routes.js.map +1 -0
- package/dist/services/runtime/adapters/openclaw.d.ts +188 -0
- package/dist/services/runtime/adapters/openclaw.js +2195 -0
- package/dist/services/runtime/adapters/openclaw.js.map +1 -0
- package/dist/services/runtime/errors.d.ts +28 -0
- package/dist/services/runtime/errors.js +31 -0
- package/dist/services/runtime/errors.js.map +1 -0
- package/dist/services/runtime/index.d.ts +34 -0
- package/dist/services/runtime/index.js +51 -0
- package/dist/services/runtime/index.js.map +1 -0
- package/dist/services/runtime/instance.d.ts +24 -0
- package/dist/services/runtime/instance.js +143 -0
- package/dist/services/runtime/instance.js.map +1 -0
- package/dist/services/runtime/migrations.d.ts +15 -0
- package/dist/services/runtime/migrations.js +25 -0
- package/dist/services/runtime/migrations.js.map +1 -0
- package/dist/services/runtime/registry.d.ts +13 -0
- package/dist/services/runtime/registry.js +32 -0
- package/dist/services/runtime/registry.js.map +1 -0
- package/dist/services/runtime/types.d.ts +545 -0
- package/dist/services/runtime/types.js +14 -0
- package/dist/services/runtime/types.js.map +1 -0
- package/dist/services/setup-manager.d.ts +70 -29
- package/dist/services/setup-manager.js +591 -625
- package/dist/services/setup-manager.js.map +1 -1
- package/dist/services/task-registry.d.ts +44 -0
- package/dist/services/task-registry.js +74 -0
- package/dist/services/task-registry.js.map +1 -0
- package/dist/services/telemetry/heartbeat.d.ts +6 -6
- package/dist/services/telemetry/heartbeat.js +29 -30
- package/dist/services/telemetry/heartbeat.js.map +1 -1
- package/dist/services/update-manager.d.ts +47 -0
- package/dist/services/update-manager.js +305 -0
- package/dist/services/update-manager.js.map +1 -0
- package/dist/types.d.ts +224 -0
- package/dist/utils/docker-host.d.ts +15 -0
- package/dist/utils/docker-host.js +64 -0
- package/dist/utils/docker-host.js.map +1 -0
- package/install/jishu-install.sh +303 -38
- package/install/post-install.sh +64 -5
- package/package.json +19 -5
- package/public/assets/Dashboard-rh9qpYRR.js +1 -0
- package/public/assets/HermesChatPanel-D6JI6lLY.js +1 -0
- package/public/assets/HermesConfigForm-DcbSemaj.js +4 -0
- package/public/assets/InitPassword-CFTKsED4.js +1 -0
- package/public/assets/InstanceDetail-BhNIKA6Z.js +91 -0
- package/public/assets/{Login-CUoEZOWR.js → Login-KB9qrtM0.js} +1 -1
- package/public/assets/NewInstance-CxkO8Hlq.js +1 -0
- package/public/assets/Settings-BVWJvOkU.js +1 -0
- package/public/assets/Setup-X-lzuaUT.js +1 -0
- package/public/assets/WeixinLoginPanel-gca0QTic.js +9 -0
- package/public/assets/index-C8B0cFJM.js +19 -0
- package/public/assets/index-CPhVFEsx.css +1 -0
- package/public/assets/input-paste-CrNVAyOy.js +1 -0
- package/public/assets/{providers-lBSOjUWy.js → providers-V-vwrExZ.js} +1 -1
- package/public/assets/registry-fVUSujib.js +2 -0
- package/public/assets/{usePolling-CK0DfI4h.js → usePolling-Do5Erqm_.js} +1 -1
- package/public/assets/vendor-i18n-ucpM0OR0.js +9 -0
- package/public/assets/{vendor-react-B1-3Yrt-.js → vendor-react-Bk1hRGiY.js} +1 -1
- package/public/favicon.png +0 -0
- package/public/index.html +9 -4
- package/public/logos/hermes.png +0 -0
- package/public/logos/ollama.png +0 -0
- package/public/logos/openclaw.svg +60 -0
- package/scripts/build-hermes-image.sh +21 -0
- package/scripts/build-local.sh +54 -0
- package/scripts/check-adapter-isolation.ts +293 -0
- package/scripts/fixtures/instances/hermes-sample/instance.json +37 -0
- package/scripts/fixtures/instances/legacy-openclaw-sample/instance.json +7 -0
- package/scripts/smoke/hermes-bootstrap.sh +195 -0
- package/templates/hermes-entrypoint.sh +154 -0
- package/dist/doctor.js.map +0 -1
- package/install/jishu-install-china.sh +0 -3092
- package/public/assets/Dashboard-DhsrzJ4F.js +0 -1
- package/public/assets/InitPassword-BjubiVdd.js +0 -1
- package/public/assets/InstanceDetail-DMcywsof.js +0 -17
- package/public/assets/NewInstance-Bk0G4EiJ.js +0 -1
- package/public/assets/Settings-D5tHL_h5.js +0 -1
- package/public/assets/Setup-4t6E3Rut.js +0 -1
- package/public/assets/index-BJ47MWpF.css +0 -1
- package/public/assets/index-DbX85irc.js +0 -16
- package/public/assets/vendor-i18n-CfW0RvgE.js +0 -9
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
type ConfigChangeListener = (instanceId: string) => void;
|
|
2
2
|
export declare function onConfigChange(listener: ConfigChangeListener): () => void;
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Fire the config-change listener fan-out. Adapters call this after
|
|
5
|
+
* `saveNativeConfig()` so LLM proxy / config editors pick up the change.
|
|
6
|
+
*/
|
|
7
|
+
export declare function notifyConfigChange(instanceId: string): void;
|
|
8
|
+
export declare function instanceDir(instanceId: string): string;
|
|
9
|
+
export declare function instanceMetaPath(instanceId: string): string;
|
|
10
|
+
export declare function defaultModelEnvFile(instanceId: string): string;
|
|
11
|
+
export declare function normalizePath(p: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Read the gateway port out of a persisted runtime record. Tries
|
|
14
|
+
* `runtime.ports[]` first (generic framework contract); on miss,
|
|
15
|
+
* asks the runtime adapter for its legacy fallback (e.g. OpenClaw's
|
|
16
|
+
* `env.OPENCLAW_GATEWAY_PORT` / `args --port N`).
|
|
17
|
+
*/
|
|
18
|
+
export declare function extractGatewayPort(runtime: Record<string, any> | undefined, agentType?: string): number | null;
|
|
19
|
+
/**
|
|
20
|
+
* Probes whether a port is currently held by any process on the host.
|
|
21
|
+
*
|
|
22
|
+
* Binds four addresses concurrently — `0.0.0.0`, `127.0.0.1`, `::` (v6-only),
|
|
23
|
+
* and `::1` — and treats the port as busy if any probe returns EADDRINUSE.
|
|
24
|
+
* The single-`0.0.0.0` probe used by the earlier revision was sufficient on
|
|
25
|
+
* Linux (where binding `0.0.0.0` conflicts with any pre-existing loopback
|
|
26
|
+
* listener on the same port) but silently passed on macOS, where BSD socket
|
|
27
|
+
* semantics let a wildcard v4 bind coexist with a `127.0.0.1` listener. A
|
|
28
|
+
* user running a natively-installed openclaw bound to `127.0.0.1:18789`
|
|
29
|
+
* would then be invisible to jishushell, so port allocation would assign
|
|
30
|
+
* 18789 to a new instance and the gateway would silently fail to bind at
|
|
31
|
+
* start time. Probing the loopback addresses directly closes that gap.
|
|
32
|
+
*/
|
|
33
|
+
export declare function isPortInUse(port: number): Promise<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Result of {@link allocateGatewayPort}.
|
|
36
|
+
*
|
|
37
|
+
* `skipped` is the ordered list of ports we walked past because they were
|
|
38
|
+
* already configured on another instance, already pending for a concurrent
|
|
39
|
+
* allocation, or held by a real listener on the host. When non-empty it
|
|
40
|
+
* means the default port was taken and the caller can surface a toast to
|
|
41
|
+
* the user explaining the shift.
|
|
42
|
+
*/
|
|
43
|
+
export type GatewayPortAllocation = {
|
|
44
|
+
port: number;
|
|
45
|
+
skipped: number[];
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Kind-agnostic gateway port allocator. Callers (adapters) pass their own
|
|
49
|
+
* `defaultPort` — the framework no longer hardcodes OpenClaw / Hermes base
|
|
50
|
+
* ports here. Walks upward from `defaultPort` until a free port is found
|
|
51
|
+
* that is neither held by an existing instance nor by any process on the
|
|
52
|
+
* host. Concurrent callers coordinate via `_pendingPorts`.
|
|
53
|
+
*
|
|
54
|
+
* Caller must release the allocated port via {@link releasePendingPort}
|
|
55
|
+
* after persisting it into instance metadata (or on failure).
|
|
56
|
+
*/
|
|
57
|
+
export declare function allocateGatewayPort(instanceId: string, defaultPort: number): Promise<GatewayPortAllocation>;
|
|
58
|
+
/** Release a port previously reserved by {@link allocateGatewayPort}. */
|
|
59
|
+
export declare function releasePendingPort(port: number): void;
|
|
4
60
|
export declare function getResolvedOpenclawBin(): string;
|
|
5
61
|
/**
|
|
6
62
|
* When jishushell runs as root (e.g. systemd service), returns the actual
|
|
@@ -12,48 +68,45 @@ export declare function resolveServiceUser(): {
|
|
|
12
68
|
uid: number;
|
|
13
69
|
gid: number;
|
|
14
70
|
} | null;
|
|
71
|
+
/**
|
|
72
|
+
* When running as root, chown a file (and its .bak) to the service user so the
|
|
73
|
+
* openclaw process (running as that user) can read/write its own data files.
|
|
74
|
+
* No-op when not running as root.
|
|
75
|
+
*/
|
|
76
|
+
export declare function chownToServiceUser(...paths: string[]): void;
|
|
15
77
|
export declare function parseEnvFile(path: string): Record<string, string>;
|
|
16
78
|
export declare function updateEnvFile(path: string, updates: Record<string, string>): void;
|
|
17
79
|
export declare function inferProviderApiKeyEnvName(providerId: string): string;
|
|
80
|
+
export declare function listInstances(): Record<string, any>[];
|
|
81
|
+
export declare function getInstance(instanceId: string): Record<string, any> | null;
|
|
82
|
+
export declare function updateInstance(instanceId: string, name?: string, description?: string): Record<string, any> | null;
|
|
83
|
+
export declare function updateInstanceMeta(instanceId: string, patch: Record<string, any>): void;
|
|
84
|
+
export declare function deleteInstance(instanceId: string, purgeBackups?: boolean): Promise<{
|
|
85
|
+
ok: boolean;
|
|
86
|
+
warnings?: string[];
|
|
87
|
+
}>;
|
|
88
|
+
export declare function getConfig(instanceId: string): Record<string, any> | null;
|
|
89
|
+
export declare function getStoredConfig(instanceId: string): Record<string, any> | null;
|
|
90
|
+
export declare function saveConfig(instanceId: string, config: Record<string, any>): Promise<boolean>;
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated Use `getAdapter("openclaw").channelPluginMap` instead.
|
|
93
|
+
* Provides the OpenClaw channel-plugin map via a Proxy so old direct-
|
|
94
|
+
* property reads (e.g. `CHANNEL_PLUGIN_MAP.feishu`) keep working.
|
|
95
|
+
*/
|
|
18
96
|
export declare const CHANNEL_PLUGIN_MAP: Record<string, string>;
|
|
19
97
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Mutates the given config in place:
|
|
23
|
-
* - Deletes the entire `channels` block (same channel cannot serve multiple
|
|
24
|
-
* instances, so every inherited enabled/credential/account entry must go).
|
|
25
|
-
* - Deletes matching IM entries from `plugins.entries` so the plugin loader
|
|
26
|
-
* does not try to boot a channel whose config no longer exists.
|
|
27
|
-
*
|
|
28
|
-
* Used by both domain clone (`createInstance`'s `cloneFrom` path) and the
|
|
29
|
-
* backup import paths (`importInstance`, `createFromBackup`) so that a new
|
|
30
|
-
* instance never inherits a half-configured IM binding.
|
|
98
|
+
* @deprecated Use `getAdapter(agentType).isChannelPluginInstalled(id, channelId)` instead.
|
|
31
99
|
*/
|
|
32
|
-
export declare function stripImBindings(config: Record<string, any>): void;
|
|
33
|
-
/** Check if a channel plugin is installed for an instance. */
|
|
34
100
|
export declare function isChannelPluginInstalled(instanceId: string, channelId: string): boolean;
|
|
35
101
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
102
|
+
* @deprecated Use `getAdapter(agentType).createInstance({ instanceId, name, description, ... })` instead.
|
|
103
|
+
* Retained for unit tests and legacy scripts; forwards to the
|
|
104
|
+
* OpenClawAdapter's `createInstance` method.
|
|
39
105
|
*/
|
|
40
|
-
export declare function
|
|
41
|
-
export declare function listInstances(): Record<string, any>[];
|
|
42
|
-
export declare function getInstance(instanceId: string): Record<string, any> | null;
|
|
43
|
-
export declare function createInstance(instanceId: string, name: string, description?: string, cloneFrom?: string, openclawHome?: string, cloneOptions?: {
|
|
106
|
+
export declare function createInstance(instanceId: string, name: string, description: string, cloneFrom?: string, agentHome?: string, cloneOptions?: {
|
|
44
107
|
include_sessions?: boolean;
|
|
45
108
|
include_memory?: boolean;
|
|
46
109
|
}): Promise<Record<string, any>>;
|
|
47
|
-
export declare function updateInstance(instanceId: string, name?: string, description?: string): Record<string, any> | null;
|
|
48
|
-
/** Update instance.json metadata fields (shallow merge at top level). */
|
|
49
|
-
export declare function updateInstanceMeta(instanceId: string, patch: Record<string, any>): void;
|
|
50
|
-
export declare function deleteInstance(instanceId: string, purgeBackups?: boolean): {
|
|
51
|
-
ok: boolean;
|
|
52
|
-
warnings?: string[];
|
|
53
|
-
};
|
|
54
|
-
export declare function getConfig(instanceId: string): Record<string, any> | null;
|
|
55
|
-
export declare function getStoredConfig(instanceId: string): Record<string, any> | null;
|
|
56
|
-
export declare function saveConfig(instanceId: string, config: Record<string, any>): boolean;
|
|
57
110
|
export declare function getOpenclawHome(instanceId: string): string;
|
|
58
111
|
export declare function saveFeishuCredentials(instanceId: string, creds: {
|
|
59
112
|
appId: string;
|
|
@@ -67,9 +120,6 @@ export declare function saveWeixinCredentials(instanceId: string, creds: {
|
|
|
67
120
|
baseUrl: string;
|
|
68
121
|
userId: string;
|
|
69
122
|
}): void;
|
|
70
|
-
/**
|
|
71
|
-
* Get connected WeChat accounts for an instance.
|
|
72
|
-
*/
|
|
73
123
|
export declare function getWeixinAccounts(instanceId: string): Array<{
|
|
74
124
|
accountId: string;
|
|
75
125
|
userId?: string;
|
|
@@ -80,8 +130,49 @@ export declare function getLegacyOpenclawConfigPath(instanceId: string): string;
|
|
|
80
130
|
export declare function getInstanceRuntime(instanceId: string): Record<string, any>;
|
|
81
131
|
export declare function getRuntimeEnvFiles(instanceId: string): string[];
|
|
82
132
|
export declare function getGatewayPort(instanceId: string): number;
|
|
133
|
+
export declare function getListeningHostForPort(port: number): string;
|
|
134
|
+
export declare function getAdvertisedHostForPort(port: number): string;
|
|
83
135
|
export declare function getGatewayHost(instanceId: string): Promise<string>;
|
|
136
|
+
/**
|
|
137
|
+
* Wrap an IPv6 literal in brackets for safe URL host-component / Host-header
|
|
138
|
+
* use. Bare names ("gateway.local") and IPv4 ("127.0.0.1") contain no colon
|
|
139
|
+
* and pass through unchanged; anything with a colon is an IPv6 literal and
|
|
140
|
+
* MUST be bracketed before being concatenated with a port, otherwise
|
|
141
|
+
* `http://::1:18789/` is unparseable.
|
|
142
|
+
*/
|
|
143
|
+
export declare function urlHost(host: string): string;
|
|
84
144
|
export declare function findInstancesSharingOpenclawHome(instanceId: string): string[];
|
|
145
|
+
/**
|
|
146
|
+
* Re-pick a gateway port for an existing instance and rewrite its persisted
|
|
147
|
+
* runtime metadata (`runtime.args` and `runtime.env.OPENCLAW_GATEWAY_PORT`).
|
|
148
|
+
*
|
|
149
|
+
* Used when {@link isPortInUse} reports that the previously-assigned port has
|
|
150
|
+
* been taken by something else between create-time and start-time (e.g. a
|
|
151
|
+
* host-side openclaw started by the user, an unrelated service that grabbed
|
|
152
|
+
* the port at boot, or a Docker race on the next allocation). The Nomad job
|
|
153
|
+
* spec is rebuilt from instance metadata on every submit, so updating
|
|
154
|
+
* `instance.json` here is sufficient — no other files need patching.
|
|
155
|
+
*/
|
|
156
|
+
export declare function reallocateGatewayPort(instanceId: string): Promise<{
|
|
157
|
+
from: number;
|
|
158
|
+
to: number;
|
|
159
|
+
skipped: number[];
|
|
160
|
+
}>;
|
|
85
161
|
export declare function findInstancesSharingGatewayPort(instanceId: string): string[];
|
|
86
162
|
export declare function getRuntimeEnv(instanceId: string): Record<string, string>;
|
|
87
163
|
export { instanceDir as getInstanceDir };
|
|
164
|
+
/**
|
|
165
|
+
* Compatibility shim: allocate a gateway port for a new instance and return
|
|
166
|
+
* just the port number. Wraps `allocateGatewayPort`, which takes a seed port
|
|
167
|
+
* and returns `{ port, skipped }`. Non-OpenClaw app managers don't have an
|
|
168
|
+
* agentType-specific default port yet, so we seed with 18789 (OpenClaw's
|
|
169
|
+
* default) — the allocator walks upward until it finds a free slot so the
|
|
170
|
+
* actual port chosen is independent of the seed.
|
|
171
|
+
*/
|
|
172
|
+
export declare function defaultGatewayPort(instanceId: string): Promise<number>;
|
|
173
|
+
/**
|
|
174
|
+
* Compatibility shim: release a pending port reservation.
|
|
175
|
+
* Mirrors the cli-branch `releasePort(port)` helper on top of the framework's
|
|
176
|
+
* existing `releasePendingPort`.
|
|
177
|
+
*/
|
|
178
|
+
export declare function releasePort(port: number): void;
|