fix(matrix): avoid heavy jiti runtime barrels

This commit is contained in:
Ayaan Zaidi
2026-03-28 15:35:05 +05:30
parent a628d5d78b
commit 8ea5c22985
3 changed files with 25 additions and 9 deletions

View File

@@ -32,6 +32,21 @@ export type {
RuntimeLogger,
RuntimeEnv,
WizardPrompter,
} from "openclaw/plugin-sdk/matrix";
export { formatZonedTimestamp } from "openclaw/plugin-sdk/matrix";
export { chunkTextForOutbound } from "openclaw/plugin-sdk/matrix";
} from "openclaw/plugin-sdk/matrix-runtime-shared";
export { formatZonedTimestamp } from "openclaw/plugin-sdk/matrix-runtime-shared";
export function chunkTextForOutbound(text: string, limit: number): string[] {
const chunks: string[] = [];
let remaining = text;
while (remaining.length > limit) {
const window = remaining.slice(0, limit);
const splitAt = Math.max(window.lastIndexOf("\n"), window.lastIndexOf(" "));
const breakAt = splitAt > 0 ? splitAt : limit;
chunks.push(remaining.slice(0, breakAt).trimEnd());
remaining = remaining.slice(breakAt).trimStart();
}
if (remaining.length > 0 || text.length === 0) {
chunks.push(remaining);
}
return chunks;
}

View File

@@ -1,14 +1,14 @@
import {
DEFAULT_ACCOUNT_ID,
normalizeAccountId,
normalizeOptionalAccountId,
} from "openclaw/plugin-sdk/account-id";
import {
listCombinedAccountIds,
listConfiguredAccountIds,
resolveListedDefaultAccountId,
resolveNormalizedAccountEntry,
} from "openclaw/plugin-sdk/account-resolution";
} from "openclaw/plugin-sdk/account-core";
import {
DEFAULT_ACCOUNT_ID,
normalizeAccountId,
normalizeOptionalAccountId,
} from "openclaw/plugin-sdk/account-id";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { listMatrixEnvAccountIds } from "./env-vars.js";

View File

@@ -6,6 +6,7 @@ export {
describeAccountSnapshot,
listCombinedAccountIds,
mergeAccountConfig,
resolveListedDefaultAccountId,
resolveMergedAccountConfig,
} from "../channels/plugins/account-helpers.js";
export { normalizeChatType } from "../channels/chat-type.js";