mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 15:50:23 +00:00
fix(ci): repair extension and discord test gates
This commit is contained in:
@@ -111,6 +111,10 @@ vi.mock("../../resolve-targets.js", () => ({
|
||||
resolveMatrixTargets: vi.fn(async () => []),
|
||||
}));
|
||||
|
||||
vi.mock("../../../../../src/generated/bundled-channel-entries.generated.ts", () => ({
|
||||
GENERATED_BUNDLED_CHANNEL_ENTRIES: [],
|
||||
}));
|
||||
|
||||
vi.mock("../../runtime.js", () => ({
|
||||
getMatrixRuntime: () => ({
|
||||
config: {
|
||||
@@ -460,7 +464,19 @@ describe("matrix plugin registration", () => {
|
||||
loadRuntimeApiExportTypesViaJiti({
|
||||
modulePath: runtimeApiPath,
|
||||
exportNames: [],
|
||||
realPluginSdkSpecifiers: [],
|
||||
realPluginSdkSpecifiers: [
|
||||
"openclaw/plugin-sdk/account-helpers",
|
||||
"openclaw/plugin-sdk/allow-from",
|
||||
"openclaw/plugin-sdk/channel-config-helpers",
|
||||
"openclaw/plugin-sdk/channel-policy",
|
||||
"openclaw/plugin-sdk/core",
|
||||
"openclaw/plugin-sdk/directory-runtime",
|
||||
"openclaw/plugin-sdk/extension-shared",
|
||||
"openclaw/plugin-sdk/irc",
|
||||
"openclaw/plugin-sdk/signal",
|
||||
"openclaw/plugin-sdk/status-helpers",
|
||||
"openclaw/plugin-sdk/text-runtime",
|
||||
],
|
||||
}),
|
||||
).toEqual({});
|
||||
}, 240_000);
|
||||
|
||||
@@ -1,14 +1,30 @@
|
||||
export {
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
PAIRING_APPROVED_MESSAGE,
|
||||
buildChannelConfigSchema,
|
||||
buildProbeChannelStatusSummary,
|
||||
collectStatusIssuesFromLastError,
|
||||
createActionGate,
|
||||
formatZonedTimestamp,
|
||||
getChatChannelMeta,
|
||||
jsonResult,
|
||||
normalizeAccountId,
|
||||
normalizeOptionalAccountId,
|
||||
readNumberParam,
|
||||
readReactionParams,
|
||||
readStringArrayParam,
|
||||
readStringParam,
|
||||
} from "openclaw/plugin-sdk/matrix";
|
||||
export * from "openclaw/plugin-sdk/matrix";
|
||||
export {
|
||||
assertHttpUrlTargetsPrivateNetwork,
|
||||
buildTimeoutAbortSignal,
|
||||
closeDispatcher,
|
||||
createPinnedDispatcher,
|
||||
resolvePinnedHostnameWithPolicy,
|
||||
ssrfPolicyFromAllowPrivateNetwork,
|
||||
type LookupFn,
|
||||
type SsrFPolicy,
|
||||
} from "openclaw/plugin-sdk/infra-runtime";
|
||||
} from "openclaw/plugin-sdk/ssrf-runtime";
|
||||
export {
|
||||
dispatchReplyFromConfigWithSettledDispatcher,
|
||||
ensureConfiguredAcpBindingReady,
|
||||
@@ -17,3 +33,35 @@ export {
|
||||
} from "openclaw/plugin-sdk/matrix-runtime-heavy";
|
||||
// resolveMatrixAccountStringValues already comes from plugin-sdk/matrix.
|
||||
// Re-exporting auth-precedence here makes Jiti try to define the same export twice.
|
||||
|
||||
export function buildTimeoutAbortSignal(params: { timeoutMs?: number; signal?: AbortSignal }): {
|
||||
signal?: AbortSignal;
|
||||
cleanup: () => void;
|
||||
} {
|
||||
const { timeoutMs, signal } = params;
|
||||
if (!timeoutMs && !signal) {
|
||||
return { signal: undefined, cleanup: () => {} };
|
||||
}
|
||||
if (!timeoutMs) {
|
||||
return { signal, cleanup: () => {} };
|
||||
}
|
||||
|
||||
const controller = new AbortController();
|
||||
const timeoutId = setTimeout(controller.abort.bind(controller), timeoutMs);
|
||||
const onAbort = () => controller.abort();
|
||||
if (signal) {
|
||||
if (signal.aborted) {
|
||||
controller.abort();
|
||||
} else {
|
||||
signal.addEventListener("abort", onAbort, { once: true });
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
signal: controller.signal,
|
||||
cleanup: () => {
|
||||
clearTimeout(timeoutId);
|
||||
signal?.removeEventListener("abort", onAbort);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user