mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix(plugin-sdk): remove remaining bundled plugin src imports (openclaw#39638)
Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Kyle <3477429+kyledh@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -767,6 +767,7 @@ Docs: https://docs.openclaw.ai
|
|||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
- Gateway/macOS restart: remove self-issued `launchctl kickstart -k` from launchd supervised restart path to prevent race with launchd's async bootout state machine that permanently unloads the LaunchAgent. With `ThrottleInterval=1` (current default), `exit(0)` + `KeepAlive=true` restarts the service within ~1s without the race condition. (#39760) Landed from contributor PR #39763 by @daymade. Thanks @daymade.
|
- Gateway/macOS restart: remove self-issued `launchctl kickstart -k` from launchd supervised restart path to prevent race with launchd's async bootout state machine that permanently unloads the LaunchAgent. With `ThrottleInterval=1` (current default), `exit(0)` + `KeepAlive=true` restarts the service within ~1s without the race condition. (#39760) Landed from contributor PR #39763 by @daymade. Thanks @daymade.
|
||||||
|
- Plugin SDK/bundled subpath contracts: add regression coverage for newly routed bundled-plugin SDK exports so BlueBubbles, Mattermost, Nextcloud Talk, and Twitch subpath symbols stay pinned during future plugin-sdk cleanup. (#39638)
|
||||||
- Exec/system.run env sanitization: block dangerous override-only env pivots such as `GIT_SSH_COMMAND`, editor/pager hooks, and `GIT_CONFIG_` / `NPM_CONFIG_` override prefixes so allowlisted tools cannot smuggle helper command execution through subprocess environment overrides. Thanks @tdjackey and @SnailSploit for reporting.
|
- Exec/system.run env sanitization: block dangerous override-only env pivots such as `GIT_SSH_COMMAND`, editor/pager hooks, and `GIT_CONFIG_` / `NPM_CONFIG_` override prefixes so allowlisted tools cannot smuggle helper command execution through subprocess environment overrides. Thanks @tdjackey and @SnailSploit for reporting.
|
||||||
- Network/fetch guard redirect auth stripping: switch cross-origin redirect handling in `fetchWithSsrFGuard` from a narrow sensitive-header denylist to a safe-header allowlist so custom auth headers like `X-Api-Key` and `Private-Token` no longer leak on origin changes. Thanks @Rickidevs for reporting.
|
- Network/fetch guard redirect auth stripping: switch cross-origin redirect handling in `fetchWithSsrFGuard` from a narrow sensitive-header denylist to a safe-header allowlist so custom auth headers like `X-Api-Key` and `Private-Token` no longer leak on origin changes. Thanks @Rickidevs for reporting.
|
||||||
- Security/Sandbox media reads: eliminate sandbox media TOCTOU symlink-retarget escapes by enforcing root-scoped boundary-safe reads at attachment/image load time and consolidating shared safe-read helpers across sandbox media callsites. This ships in the next npm release. Thanks @tdjackey for reporting.
|
- Security/Sandbox media reads: eliminate sandbox media TOCTOU symlink-retarget escapes by enforcing root-scoped boundary-safe reads at attachment/image load time and consolidating shared safe-read helpers across sandbox media callsites. This ships in the next npm release. Thanks @tdjackey for reporting.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { parseFiniteNumber } from "../../../src/infra/parse-finite-number.js";
|
import { parseFiniteNumber } from "openclaw/plugin-sdk/bluebubbles";
|
||||||
import { extractHandleFromChatGuid, normalizeBlueBubblesHandle } from "./targets.js";
|
import { extractHandleFromChatGuid, normalizeBlueBubblesHandle } from "./targets.js";
|
||||||
import type { BlueBubblesAttachment } from "./types.js";
|
import type { BlueBubblesAttachment } from "./types.js";
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
DEFAULT_GROUP_HISTORY_LIMIT,
|
DEFAULT_GROUP_HISTORY_LIMIT,
|
||||||
recordPendingHistoryEntryIfEnabled,
|
recordPendingHistoryEntryIfEnabled,
|
||||||
isDangerousNameMatchingEnabled,
|
isDangerousNameMatchingEnabled,
|
||||||
|
parseStrictPositiveInteger,
|
||||||
registerPluginHttpRoute,
|
registerPluginHttpRoute,
|
||||||
resolveControlCommandGate,
|
resolveControlCommandGate,
|
||||||
readStoreAllowFromForDmPolicy,
|
readStoreAllowFromForDmPolicy,
|
||||||
@@ -30,7 +31,6 @@ import {
|
|||||||
listSkillCommandsForAgents,
|
listSkillCommandsForAgents,
|
||||||
type HistoryEntry,
|
type HistoryEntry,
|
||||||
} from "openclaw/plugin-sdk/mattermost";
|
} from "openclaw/plugin-sdk/mattermost";
|
||||||
import { parseStrictPositiveInteger } from "../../../../src/infra/parse-finite-number.js";
|
|
||||||
import { getMattermostRuntime } from "../runtime.js";
|
import { getMattermostRuntime } from "../runtime.js";
|
||||||
import { resolveMattermostAccount } from "./accounts.js";
|
import { resolveMattermostAccount } from "./accounts.js";
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ import {
|
|||||||
deleteAccountFromConfigSection,
|
deleteAccountFromConfigSection,
|
||||||
normalizeAccountId,
|
normalizeAccountId,
|
||||||
setAccountEnabledInConfigSection,
|
setAccountEnabledInConfigSection,
|
||||||
|
waitForAbortSignal,
|
||||||
type ChannelPlugin,
|
type ChannelPlugin,
|
||||||
type OpenClawConfig,
|
type OpenClawConfig,
|
||||||
type ChannelSetupInput,
|
type ChannelSetupInput,
|
||||||
} from "openclaw/plugin-sdk/nextcloud-talk";
|
} from "openclaw/plugin-sdk/nextcloud-talk";
|
||||||
import { waitForAbortSignal } from "../../../src/infra/abort-signal.js";
|
|
||||||
import {
|
import {
|
||||||
listNextcloudTalkAccountIds,
|
listNextcloudTalkAccountIds,
|
||||||
resolveDefaultNextcloudTalkAccountId,
|
resolveDefaultNextcloudTalkAccountId,
|
||||||
|
|||||||
@@ -9,8 +9,11 @@
|
|||||||
* 2. Environment variable: OPENCLAW_TWITCH_ACCESS_TOKEN (default account only)
|
* 2. Environment variable: OPENCLAW_TWITCH_ACCESS_TOKEN (default account only)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
import {
|
||||||
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../../src/routing/session-key.js";
|
DEFAULT_ACCOUNT_ID,
|
||||||
|
normalizeAccountId,
|
||||||
|
type OpenClawConfig,
|
||||||
|
} from "openclaw/plugin-sdk/twitch";
|
||||||
|
|
||||||
export type TwitchTokenSource = "env" | "config" | "none";
|
export type TwitchTokenSource = "env" | "config" | "none";
|
||||||
|
|
||||||
|
|||||||
@@ -5,26 +5,24 @@
|
|||||||
* from OpenClaw core.
|
* from OpenClaw core.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {
|
|
||||||
ChannelGatewayContext,
|
|
||||||
ChannelOutboundAdapter,
|
|
||||||
ChannelOutboundContext,
|
|
||||||
ChannelResolveKind,
|
|
||||||
ChannelResolveResult,
|
|
||||||
ChannelStatusAdapter,
|
|
||||||
} from "../../../src/channels/plugins/types.adapters.js";
|
|
||||||
import type {
|
import type {
|
||||||
ChannelAccountSnapshot,
|
ChannelAccountSnapshot,
|
||||||
ChannelCapabilities,
|
ChannelCapabilities,
|
||||||
|
ChannelGatewayContext,
|
||||||
ChannelLogSink,
|
ChannelLogSink,
|
||||||
ChannelMessageActionAdapter,
|
ChannelMessageActionAdapter,
|
||||||
ChannelMessageActionContext,
|
ChannelMessageActionContext,
|
||||||
ChannelMeta,
|
ChannelMeta,
|
||||||
} from "../../../src/channels/plugins/types.core.js";
|
ChannelOutboundAdapter,
|
||||||
import type { ChannelPlugin } from "../../../src/channels/plugins/types.plugin.js";
|
ChannelOutboundContext,
|
||||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
ChannelPlugin,
|
||||||
import type { OutboundDeliveryResult } from "../../../src/infra/outbound/deliver.js";
|
ChannelResolveKind,
|
||||||
import type { RuntimeEnv } from "../../../src/runtime.js";
|
ChannelResolveResult,
|
||||||
|
ChannelStatusAdapter,
|
||||||
|
OpenClawConfig,
|
||||||
|
OutboundDeliveryResult,
|
||||||
|
RuntimeEnv,
|
||||||
|
} from "openclaw/plugin-sdk/twitch";
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
// Twitch-Specific Types
|
// Twitch-Specific Types
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ export {
|
|||||||
resolveServicePrefixedTarget,
|
resolveServicePrefixedTarget,
|
||||||
} from "../imessage/target-parsing-helpers.js";
|
} from "../imessage/target-parsing-helpers.js";
|
||||||
export { stripMarkdown } from "../line/markdown-to-line.js";
|
export { stripMarkdown } from "../line/markdown-to-line.js";
|
||||||
|
export { parseFiniteNumber } from "../infra/parse-finite-number.js";
|
||||||
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
||||||
export type { PluginRuntime } from "../plugins/runtime/types.js";
|
export type { PluginRuntime } from "../plugins/runtime/types.js";
|
||||||
export type { OpenClawPluginApi } from "../plugins/types.js";
|
export type { OpenClawPluginApi } from "../plugins/types.js";
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ export {
|
|||||||
requireOpenAllowFrom,
|
requireOpenAllowFrom,
|
||||||
} from "../config/zod-schema.core.js";
|
} from "../config/zod-schema.core.js";
|
||||||
export { createDedupeCache } from "../infra/dedupe.js";
|
export { createDedupeCache } from "../infra/dedupe.js";
|
||||||
|
export { parseStrictPositiveInteger } from "../infra/parse-finite-number.js";
|
||||||
export { rawDataToString } from "../infra/ws.js";
|
export { rawDataToString } from "../infra/ws.js";
|
||||||
export { isLoopbackHost, isTrustedProxyAddress, resolveClientIp } from "../gateway/net.js";
|
export { isLoopbackHost, isTrustedProxyAddress, resolveClientIp } from "../gateway/net.js";
|
||||||
export { registerPluginHttpRoute } from "../plugins/http-registry.js";
|
export { registerPluginHttpRoute } from "../plugins/http-registry.js";
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ export {
|
|||||||
readRequestBodyWithLimit,
|
readRequestBodyWithLimit,
|
||||||
requestBodyErrorToText,
|
requestBodyErrorToText,
|
||||||
} from "../infra/http-body.js";
|
} from "../infra/http-body.js";
|
||||||
|
export { waitForAbortSignal } from "../infra/abort-signal.js";
|
||||||
export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js";
|
export { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js";
|
||||||
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
||||||
export type { PluginRuntime } from "../plugins/runtime/types.js";
|
export type { PluginRuntime } from "../plugins/runtime/types.js";
|
||||||
|
|||||||
@@ -105,4 +105,19 @@ describe("plugin-sdk subpath exports", () => {
|
|||||||
expect(mod, `subpath ${id} should resolve`).toBeTruthy();
|
expect(mod, `subpath ${id} should resolve`).toBeTruthy();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("keeps the newly added bundled plugin-sdk contracts available", async () => {
|
||||||
|
const bluebubbles = await import("openclaw/plugin-sdk/bluebubbles");
|
||||||
|
expect(typeof bluebubbles.parseFiniteNumber).toBe("function");
|
||||||
|
|
||||||
|
const mattermost = await import("openclaw/plugin-sdk/mattermost");
|
||||||
|
expect(typeof mattermost.parseStrictPositiveInteger).toBe("function");
|
||||||
|
|
||||||
|
const nextcloudTalk = await import("openclaw/plugin-sdk/nextcloud-talk");
|
||||||
|
expect(typeof nextcloudTalk.waitForAbortSignal).toBe("function");
|
||||||
|
|
||||||
|
const twitch = await import("openclaw/plugin-sdk/twitch");
|
||||||
|
expect(typeof twitch.DEFAULT_ACCOUNT_ID).toBe("string");
|
||||||
|
expect(typeof twitch.normalizeAccountId).toBe("function");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,17 +3,38 @@
|
|||||||
|
|
||||||
export type { ReplyPayload } from "../auto-reply/types.js";
|
export type { ReplyPayload } from "../auto-reply/types.js";
|
||||||
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
|
export { buildChannelConfigSchema } from "../channels/plugins/config-schema.js";
|
||||||
|
export type {
|
||||||
|
ChannelGatewayContext,
|
||||||
|
ChannelOutboundAdapter,
|
||||||
|
ChannelOutboundContext,
|
||||||
|
ChannelResolveKind,
|
||||||
|
ChannelResolveResult,
|
||||||
|
ChannelStatusAdapter,
|
||||||
|
} from "../channels/plugins/types.adapters.js";
|
||||||
|
export type {
|
||||||
|
BaseProbeResult,
|
||||||
|
ChannelAccountSnapshot,
|
||||||
|
ChannelCapabilities,
|
||||||
|
ChannelLogSink,
|
||||||
|
ChannelMessageActionAdapter,
|
||||||
|
ChannelMessageActionContext,
|
||||||
|
ChannelMeta,
|
||||||
|
ChannelStatusIssue,
|
||||||
|
} from "../channels/plugins/types.js";
|
||||||
|
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
|
||||||
export type {
|
export type {
|
||||||
ChannelOnboardingAdapter,
|
ChannelOnboardingAdapter,
|
||||||
ChannelOnboardingDmPolicy,
|
ChannelOnboardingDmPolicy,
|
||||||
} from "../channels/plugins/onboarding-types.js";
|
} from "../channels/plugins/onboarding-types.js";
|
||||||
export { promptChannelAccessConfig } from "../channels/plugins/onboarding/channel-access.js";
|
export { promptChannelAccessConfig } from "../channels/plugins/onboarding/channel-access.js";
|
||||||
export type { BaseProbeResult, ChannelStatusIssue } from "../channels/plugins/types.js";
|
|
||||||
export { createReplyPrefixOptions } from "../channels/reply-prefix.js";
|
export { createReplyPrefixOptions } from "../channels/reply-prefix.js";
|
||||||
export type { OpenClawConfig } from "../config/config.js";
|
export type { OpenClawConfig } from "../config/config.js";
|
||||||
export { MarkdownConfigSchema } from "../config/zod-schema.core.js";
|
export { MarkdownConfigSchema } from "../config/zod-schema.core.js";
|
||||||
|
export type { OutboundDeliveryResult } from "../infra/outbound/deliver.js";
|
||||||
|
export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "./account-id.js";
|
||||||
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
|
||||||
export type { PluginRuntime } from "../plugins/runtime/types.js";
|
export type { PluginRuntime } from "../plugins/runtime/types.js";
|
||||||
export type { OpenClawPluginApi } from "../plugins/types.js";
|
export type { OpenClawPluginApi } from "../plugins/types.js";
|
||||||
|
export type { RuntimeEnv } from "../runtime.js";
|
||||||
export { formatDocsLink } from "../terminal/links.js";
|
export { formatDocsLink } from "../terminal/links.js";
|
||||||
export type { WizardPrompter } from "../wizard/prompts.js";
|
export type { WizardPrompter } from "../wizard/prompts.js";
|
||||||
|
|||||||
Reference in New Issue
Block a user