mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-29 10:50:58 +00:00
fix(matrix): avoid heavy jiti runtime barrels
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ export {
|
||||
describeAccountSnapshot,
|
||||
listCombinedAccountIds,
|
||||
mergeAccountConfig,
|
||||
resolveListedDefaultAccountId,
|
||||
resolveMergedAccountConfig,
|
||||
} from "../channels/plugins/account-helpers.js";
|
||||
export { normalizeChatType } from "../channels/chat-type.js";
|
||||
|
||||
Reference in New Issue
Block a user