mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-27 09:21:35 +07:00
fix: restore plugin sdk runtime barrels
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled Feishu extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../src/plugin-sdk/feishu.js";
|
||||
export * from "openclaw/plugin-sdk/feishu";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled Google Chat extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../src/plugin-sdk/googlechat.js";
|
||||
export * from "openclaw/plugin-sdk/googlechat";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled IRC extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../../src/plugin-sdk/irc.js";
|
||||
export * from "openclaw/plugin-sdk/irc";
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Private runtime barrel for the bundled LINE extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../src/plugin-sdk/line.js";
|
||||
export { resolveExactLineGroupConfigKey } from "../../src/plugin-sdk/line-core.js";
|
||||
export * from "openclaw/plugin-sdk/line";
|
||||
export { resolveExactLineGroupConfigKey } from "openclaw/plugin-sdk/line-core";
|
||||
export {
|
||||
formatDocsLink,
|
||||
setSetupChannelEnabled,
|
||||
splitSetupEntries,
|
||||
type ChannelSetupDmPolicy,
|
||||
type ChannelSetupWizard,
|
||||
} from "../../src/plugin-sdk/line-core.js";
|
||||
} from "openclaw/plugin-sdk/line-core";
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
resolveLineAccount,
|
||||
type OpenClawConfig,
|
||||
type ResolvedLineAccount,
|
||||
} from "../runtime-api.js";
|
||||
} from "openclaw/plugin-sdk/line-core";
|
||||
|
||||
export function normalizeLineAllowFrom(entry: string): string {
|
||||
return entry.replace(/^line:(?:user:)?/i, "");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
||||
import { resolveExactLineGroupConfigKey, type OpenClawConfig } from "../runtime-api.js";
|
||||
import { resolveExactLineGroupConfigKey, type OpenClawConfig } from "openclaw/plugin-sdk/line-core";
|
||||
|
||||
type LineGroupContext = {
|
||||
cfg: OpenClawConfig;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { ChannelSetupAdapter, OpenClawConfig } from "openclaw/plugin-sdk/setup";
|
||||
import {
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
listLineAccountIds,
|
||||
normalizeAccountId,
|
||||
resolveLineAccount,
|
||||
type LineConfig,
|
||||
} from "../runtime-api.js";
|
||||
} from "openclaw/plugin-sdk/line-core";
|
||||
import type { ChannelSetupAdapter, OpenClawConfig } from "openclaw/plugin-sdk/setup";
|
||||
|
||||
const channel = "line" as const;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { createAllowFromSection, createTopLevelChannelDmPolicy } from "openclaw/plugin-sdk/setup";
|
||||
import {
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
formatDocsLink,
|
||||
@@ -7,7 +6,8 @@ import {
|
||||
splitSetupEntries,
|
||||
type ChannelSetupDmPolicy,
|
||||
type ChannelSetupWizard,
|
||||
} from "../runtime-api.js";
|
||||
} from "openclaw/plugin-sdk/line-core";
|
||||
import { createAllowFromSection, createTopLevelChannelDmPolicy } from "openclaw/plugin-sdk/setup";
|
||||
import {
|
||||
isLineConfigured,
|
||||
listLineAccountIds,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled Mattermost extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../src/plugin-sdk/mattermost.js";
|
||||
export * from "openclaw/plugin-sdk/mattermost";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled Microsoft Teams extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../src/plugin-sdk/msteams.js";
|
||||
export * from "openclaw/plugin-sdk/msteams";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled Nextcloud Talk extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../src/plugin-sdk/nextcloud-talk.js";
|
||||
export * from "openclaw/plugin-sdk/nextcloud-talk";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled Nostr extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../src/plugin-sdk/nostr.js";
|
||||
export * from "openclaw/plugin-sdk/nostr";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled Signal extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../../src/plugin-sdk/signal.js";
|
||||
export * from "openclaw/plugin-sdk/signal";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled Tlon extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../src/plugin-sdk/tlon.js";
|
||||
export * from "openclaw/plugin-sdk/tlon";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled Twitch extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../src/plugin-sdk/twitch.js";
|
||||
export * from "openclaw/plugin-sdk/twitch";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled Voice Call extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../src/plugin-sdk/voice-call.js";
|
||||
export * from "openclaw/plugin-sdk/voice-call";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled Zalo extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../src/plugin-sdk/zalo.js";
|
||||
export * from "openclaw/plugin-sdk/zalo";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Private runtime barrel for the bundled Zalo Personal extension.
|
||||
// Keep this barrel thin and aligned with the local extension surface.
|
||||
|
||||
export * from "../../src/plugin-sdk/zalouser.js";
|
||||
export * from "openclaw/plugin-sdk/zalouser";
|
||||
|
||||
60
package.json
60
package.json
@@ -193,10 +193,50 @@
|
||||
"types": "./dist/plugin-sdk/discord-core.d.ts",
|
||||
"default": "./dist/plugin-sdk/discord-core.js"
|
||||
},
|
||||
"./plugin-sdk/feishu": {
|
||||
"types": "./dist/plugin-sdk/feishu.d.ts",
|
||||
"default": "./dist/plugin-sdk/feishu.js"
|
||||
},
|
||||
"./plugin-sdk/googlechat": {
|
||||
"types": "./dist/plugin-sdk/googlechat.d.ts",
|
||||
"default": "./dist/plugin-sdk/googlechat.js"
|
||||
},
|
||||
"./plugin-sdk/irc": {
|
||||
"types": "./dist/plugin-sdk/irc.d.ts",
|
||||
"default": "./dist/plugin-sdk/irc.js"
|
||||
},
|
||||
"./plugin-sdk/line": {
|
||||
"types": "./dist/plugin-sdk/line.d.ts",
|
||||
"default": "./dist/plugin-sdk/line.js"
|
||||
},
|
||||
"./plugin-sdk/line-core": {
|
||||
"types": "./dist/plugin-sdk/line-core.d.ts",
|
||||
"default": "./dist/plugin-sdk/line-core.js"
|
||||
},
|
||||
"./plugin-sdk/matrix": {
|
||||
"types": "./dist/plugin-sdk/matrix.d.ts",
|
||||
"default": "./dist/plugin-sdk/matrix.js"
|
||||
},
|
||||
"./plugin-sdk/mattermost": {
|
||||
"types": "./dist/plugin-sdk/mattermost.d.ts",
|
||||
"default": "./dist/plugin-sdk/mattermost.js"
|
||||
},
|
||||
"./plugin-sdk/msteams": {
|
||||
"types": "./dist/plugin-sdk/msteams.d.ts",
|
||||
"default": "./dist/plugin-sdk/msteams.js"
|
||||
},
|
||||
"./plugin-sdk/nextcloud-talk": {
|
||||
"types": "./dist/plugin-sdk/nextcloud-talk.d.ts",
|
||||
"default": "./dist/plugin-sdk/nextcloud-talk.js"
|
||||
},
|
||||
"./plugin-sdk/nostr": {
|
||||
"types": "./dist/plugin-sdk/nostr.d.ts",
|
||||
"default": "./dist/plugin-sdk/nostr.js"
|
||||
},
|
||||
"./plugin-sdk/signal": {
|
||||
"types": "./dist/plugin-sdk/signal.d.ts",
|
||||
"default": "./dist/plugin-sdk/signal.js"
|
||||
},
|
||||
"./plugin-sdk/slack": {
|
||||
"types": "./dist/plugin-sdk/slack.d.ts",
|
||||
"default": "./dist/plugin-sdk/slack.js"
|
||||
@@ -205,6 +245,26 @@
|
||||
"types": "./dist/plugin-sdk/slack-core.d.ts",
|
||||
"default": "./dist/plugin-sdk/slack-core.js"
|
||||
},
|
||||
"./plugin-sdk/tlon": {
|
||||
"types": "./dist/plugin-sdk/tlon.d.ts",
|
||||
"default": "./dist/plugin-sdk/tlon.js"
|
||||
},
|
||||
"./plugin-sdk/twitch": {
|
||||
"types": "./dist/plugin-sdk/twitch.d.ts",
|
||||
"default": "./dist/plugin-sdk/twitch.js"
|
||||
},
|
||||
"./plugin-sdk/voice-call": {
|
||||
"types": "./dist/plugin-sdk/voice-call.d.ts",
|
||||
"default": "./dist/plugin-sdk/voice-call.js"
|
||||
},
|
||||
"./plugin-sdk/zalo": {
|
||||
"types": "./dist/plugin-sdk/zalo.d.ts",
|
||||
"default": "./dist/plugin-sdk/zalo.js"
|
||||
},
|
||||
"./plugin-sdk/zalouser": {
|
||||
"types": "./dist/plugin-sdk/zalouser.d.ts",
|
||||
"default": "./dist/plugin-sdk/zalouser.js"
|
||||
},
|
||||
"./plugin-sdk/imessage": {
|
||||
"types": "./dist/plugin-sdk/imessage.d.ts",
|
||||
"default": "./dist/plugin-sdk/imessage.js"
|
||||
|
||||
@@ -38,9 +38,24 @@
|
||||
"telegram-core",
|
||||
"discord",
|
||||
"discord-core",
|
||||
"feishu",
|
||||
"googlechat",
|
||||
"irc",
|
||||
"line",
|
||||
"line-core",
|
||||
"matrix",
|
||||
"mattermost",
|
||||
"msteams",
|
||||
"nextcloud-talk",
|
||||
"nostr",
|
||||
"signal",
|
||||
"slack",
|
||||
"slack-core",
|
||||
"tlon",
|
||||
"twitch",
|
||||
"voice-call",
|
||||
"zalo",
|
||||
"zalouser",
|
||||
"imessage",
|
||||
"imessage-core",
|
||||
"whatsapp",
|
||||
|
||||
@@ -3,11 +3,11 @@ export type { LineConfig } from "../line/types.js";
|
||||
export {
|
||||
createTopLevelChannelDmPolicy,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
formatDocsLink,
|
||||
setSetupChannelEnabled,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
splitSetupEntries,
|
||||
} from "./setup.js";
|
||||
export { formatDocsLink } from "../terminal/links.js";
|
||||
export type { ChannelSetupAdapter, ChannelSetupDmPolicy, ChannelSetupWizard } from "./setup.js";
|
||||
export {
|
||||
listLineAccountIds,
|
||||
|
||||
@@ -62,6 +62,14 @@ function resolveControlCommandGate(params) {
|
||||
return { commandAuthorized, shouldBlock };
|
||||
}
|
||||
|
||||
function onDiagnosticEvent(listener) {
|
||||
const monolithic = loadMonolithicSdk();
|
||||
if (!monolithic || typeof monolithic.onDiagnosticEvent !== "function") {
|
||||
throw new Error("openclaw/plugin-sdk root alias could not resolve onDiagnosticEvent");
|
||||
}
|
||||
return monolithic.onDiagnosticEvent(listener);
|
||||
}
|
||||
|
||||
function getPackageRoot() {
|
||||
return path.resolve(__dirname, "..", "..");
|
||||
}
|
||||
@@ -152,6 +160,7 @@ function tryLoadMonolithicSdk() {
|
||||
|
||||
const fastExports = {
|
||||
emptyPluginConfigSchema,
|
||||
onDiagnosticEvent,
|
||||
resolveControlCommandGate,
|
||||
};
|
||||
|
||||
|
||||
@@ -180,7 +180,11 @@ describe("plugin-sdk root alias", () => {
|
||||
const lazyRootSdk = lazyModule.moduleExports;
|
||||
|
||||
expect(typeof lazyRootSdk.onDiagnosticEvent).toBe("function");
|
||||
expect(lazyRootSdk.onDiagnosticEvent).toBe(onDiagnosticEvent);
|
||||
expect(
|
||||
typeof (lazyRootSdk.onDiagnosticEvent as (listener: () => void) => () => void)(
|
||||
() => undefined,
|
||||
),
|
||||
).toBe("function");
|
||||
expect("onDiagnosticEvent" in lazyRootSdk).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
@@ -34,14 +34,14 @@ const RUNTIME_API_EXPORT_GUARDS: Record<string, readonly string[]> = {
|
||||
'export { probeIMessage } from "./src/probe.js";',
|
||||
'export { sendMessageIMessage } from "./src/send.js";',
|
||||
],
|
||||
"extensions/googlechat/runtime-api.ts": ['export * from "../../src/plugin-sdk/googlechat.js";'],
|
||||
"extensions/googlechat/runtime-api.ts": ['export * from "openclaw/plugin-sdk/googlechat";'],
|
||||
"extensions/matrix/runtime-api.ts": [
|
||||
'export * from "./src/auth-precedence.js";',
|
||||
'export * from "./helper-api.js";',
|
||||
'export * from "./thread-bindings-runtime.js";',
|
||||
],
|
||||
"extensions/nextcloud-talk/runtime-api.ts": [
|
||||
'export * from "../../src/plugin-sdk/nextcloud-talk.js";',
|
||||
'export * from "openclaw/plugin-sdk/nextcloud-talk";',
|
||||
],
|
||||
"extensions/signal/runtime-api.ts": ['export * from "./src/runtime-api.js";'],
|
||||
"extensions/slack/runtime-api.ts": [
|
||||
|
||||
@@ -61,30 +61,15 @@ describe("plugin-sdk subpath exports", () => {
|
||||
expect(pluginSdkSubpaths).not.toContain("acpx");
|
||||
expect(pluginSdkSubpaths).not.toContain("compat");
|
||||
expect(pluginSdkSubpaths).not.toContain("device-pair");
|
||||
expect(pluginSdkSubpaths).not.toContain("feishu");
|
||||
expect(pluginSdkSubpaths).not.toContain("google");
|
||||
expect(pluginSdkSubpaths).not.toContain("googlechat");
|
||||
expect(pluginSdkSubpaths).not.toContain("irc");
|
||||
expect(pluginSdkSubpaths).not.toContain("line");
|
||||
expect(pluginSdkSubpaths).not.toContain("line-core");
|
||||
expect(pluginSdkSubpaths).not.toContain("lobster");
|
||||
expect(pluginSdkSubpaths).not.toContain("mattermost");
|
||||
expect(pluginSdkSubpaths).not.toContain("msteams");
|
||||
expect(pluginSdkSubpaths).not.toContain("nextcloud-talk");
|
||||
expect(pluginSdkSubpaths).not.toContain("nostr");
|
||||
expect(pluginSdkSubpaths).not.toContain("pairing-access");
|
||||
expect(pluginSdkSubpaths).not.toContain("qwen-portal-auth");
|
||||
expect(pluginSdkSubpaths).not.toContain("reply-prefix");
|
||||
expect(pluginSdkSubpaths).not.toContain("signal");
|
||||
expect(pluginSdkSubpaths).not.toContain("signal-core");
|
||||
expect(pluginSdkSubpaths).not.toContain("synology-chat");
|
||||
expect(pluginSdkSubpaths).not.toContain("tlon");
|
||||
expect(pluginSdkSubpaths).not.toContain("twitch");
|
||||
expect(pluginSdkSubpaths).not.toContain("typing");
|
||||
expect(pluginSdkSubpaths).not.toContain("voice-call");
|
||||
expect(pluginSdkSubpaths).not.toContain("zalo");
|
||||
expect(pluginSdkSubpaths).not.toContain("zai");
|
||||
expect(pluginSdkSubpaths).not.toContain("zalouser");
|
||||
expect(pluginSdkSubpaths).not.toContain("provider-model-definitions");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user