refactor: add host and collection runtime sdk seams

This commit is contained in:
Peter Steinberger
2026-03-28 06:19:16 +00:00
parent df204b1d8f
commit 70c2458861
9 changed files with 24 additions and 3 deletions

View File

@@ -127,7 +127,9 @@ is a small, self-contained module with a clear purpose and documented contract.
| `plugin-sdk/channel-runtime` | Runtime wiring helpers | Channel runtime utilities |
| `plugin-sdk/channel-send-result` | Send result types | Reply result types |
| `plugin-sdk/runtime-store` | Persistent plugin storage | `createPluginRuntimeStore` |
| `plugin-sdk/collection-runtime` | Bounded cache helpers | `pruneMapToMaxSize` |
| `plugin-sdk/fetch-runtime` | Wrapped fetch/proxy helpers | `resolveFetch`, proxy helpers |
| `plugin-sdk/host-runtime` | Host normalization helpers | `normalizeHostname`, `normalizeScpRemoteHost` |
| `plugin-sdk/retry-runtime` | Retry helpers | `RetryConfig`, `retryAsync`, policy runners |
| `plugin-sdk/allow-from` | Allowlist formatting | `formatAllowFromLowercase` |
| `plugin-sdk/allowlist-resolution` | Allowlist input mapping | `mapAllowlistResolutionInputs` |

View File

@@ -94,7 +94,9 @@ subpaths is in `scripts/lib/plugin-sdk-entrypoints.json`.
| `plugin-sdk/runtime-store` | `createPluginRuntimeStore` |
| `plugin-sdk/config-runtime` | Config load/write helpers |
| `plugin-sdk/infra-runtime` | System event/heartbeat helpers |
| `plugin-sdk/collection-runtime` | Small bounded cache helpers |
| `plugin-sdk/fetch-runtime` | Wrapped fetch, proxy, and pinned lookup helpers |
| `plugin-sdk/host-runtime` | Hostname and SCP host normalization helpers |
| `plugin-sdk/retry-runtime` | Retry config and retry runner helpers |
| `plugin-sdk/agent-runtime` | Agent dir/identity/workspace helpers |
| `plugin-sdk/directory-runtime` | Config-backed directory query/dedup |

View File

@@ -19,7 +19,7 @@ import {
upsertChannelPairingRequest,
} from "openclaw/plugin-sdk/conversation-runtime";
import { recordInboundSession } from "openclaw/plugin-sdk/conversation-runtime";
import { normalizeScpRemoteHost } from "openclaw/plugin-sdk/infra-runtime";
import { normalizeScpRemoteHost } from "openclaw/plugin-sdk/host-runtime";
import {
isInboundPathAllowed,
resolveIMessageAttachmentRoots,

View File

@@ -1,5 +1,5 @@
import type { WebClient as SlackWebClient } from "@slack/web-api";
import { normalizeHostname } from "openclaw/plugin-sdk/infra-runtime";
import { normalizeHostname } from "openclaw/plugin-sdk/host-runtime";
import type { FetchLike } from "openclaw/plugin-sdk/media-runtime";
import { fetchRemoteMedia } from "openclaw/plugin-sdk/media-runtime";
import { saveMediaBuffer } from "openclaw/plugin-sdk/media-runtime";

View File

@@ -1,5 +1,5 @@
import type { WebClient as SlackWebClient } from "@slack/web-api";
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/infra-runtime";
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
import { logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
import type { SlackMessageEvent } from "../types.js";

View File

@@ -200,6 +200,10 @@
"types": "./dist/plugin-sdk/hook-runtime.d.ts",
"default": "./dist/plugin-sdk/hook-runtime.js"
},
"./plugin-sdk/host-runtime": {
"types": "./dist/plugin-sdk/host-runtime.d.ts",
"default": "./dist/plugin-sdk/host-runtime.js"
},
"./plugin-sdk/process-runtime": {
"types": "./dist/plugin-sdk/process-runtime.d.ts",
"default": "./dist/plugin-sdk/process-runtime.js"
@@ -304,6 +308,10 @@
"types": "./dist/plugin-sdk/command-auth.d.ts",
"default": "./dist/plugin-sdk/command-auth.js"
},
"./plugin-sdk/collection-runtime": {
"types": "./dist/plugin-sdk/collection-runtime.d.ts",
"default": "./dist/plugin-sdk/collection-runtime.js"
},
"./plugin-sdk/compat": {
"types": "./dist/plugin-sdk/compat.d.ts",
"default": "./dist/plugin-sdk/compat.js"

View File

@@ -40,6 +40,7 @@
"cli-runtime",
"cli-backend",
"hook-runtime",
"host-runtime",
"process-runtime",
"windows-spawn",
"acp-runtime",
@@ -66,6 +67,7 @@
"byteplus",
"chutes",
"command-auth",
"collection-runtime",
"compat",
"direct-dm",
"deepseek",

View File

@@ -0,0 +1,3 @@
// Small collection helpers for bounded in-memory plugin caches.
export { pruneMapToMaxSize } from "../infra/map-size.js";

View File

@@ -0,0 +1,4 @@
// Hostname and SCP host normalization helpers for plugin runtime callers.
export { normalizeHostname } from "../infra/net/hostname.ts";
export { normalizeScpRemoteHost } from "../infra/scp-host.ts";