Skip to content

Commit f1e38f2

Browse files
committed
fix(telegram): narrow rich table alignment surface
1 parent d2933bb commit f1e38f2

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

extensions/telegram/src/format.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
markdownToIRWithMeta,
99
type MarkdownLinkSpan,
1010
type MarkdownIR,
11-
type MarkdownTableAlignment,
1211
type MarkdownTableCell,
1312
type MarkdownTableMeta,
1413
renderMarkdownIRChunksWithinLimit,
@@ -347,6 +346,8 @@ type TelegramHtmlTagSupport = {
347346
attrPatterns: ReadonlyMap<string, RegExp>;
348347
};
349348

349+
type TelegramTableAlignment = NonNullable<MarkdownTableMeta["aligns"]>[number];
350+
350351
const TELEGRAM_LEGACY_HTML_TAG_SUPPORT: TelegramHtmlTagSupport = {
351352
simpleTags: TELEGRAM_SIMPLE_HTML_TAGS,
352353
attrPatterns: TELEGRAM_ATTR_HTML_TAG_PATTERNS,
@@ -976,7 +977,7 @@ function renderTelegramRichHtmlTable(table: MarkdownTableMeta): string {
976977
const renderCell = (
977978
tag: "td" | "th",
978979
value: MarkdownTableCell | undefined,
979-
align: MarkdownTableAlignment | undefined,
980+
align: TelegramTableAlignment | undefined,
980981
) => {
981982
const alignAttr = align ? ` align="${align}"` : "";
982983
return `<${tag}${alignAttr}>${renderCellValue(value)}</${tag}>`;

packages/markdown-core/src/ir.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function createStyleSpan(params: MarkdownStyleSpan): MarkdownStyleSpan {
7878
return span;
7979
}
8080

81-
export type MarkdownTableAlignment = "left" | "center" | "right";
81+
type MarkdownTableAlignment = "left" | "center" | "right";
8282

8383
export type MarkdownTableData = {
8484
headers: string[];

scripts/plugin-sdk-surface-report.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const defaultPublicDeprecatedExportsByEntrypointBudget = Object.freeze({
131131
"ssrf-policy": 1,
132132
"ssrf-runtime": 1,
133133
"media-runtime": 2,
134-
"text-runtime": 190,
134+
"text-runtime": 189,
135135
"agent-runtime": 7,
136136
"plugin-runtime": 13,
137137
"channel-secret-runtime": 23,
@@ -202,11 +202,11 @@ let publicDeprecatedExportsByEntrypointBudget;
202202
try {
203203
budgets = {
204204
publicEntrypoints: readBudgetEnv("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_ENTRYPOINTS", 322),
205-
publicExports: readBudgetEnv("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_EXPORTS", 10383),
205+
publicExports: readBudgetEnv("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_EXPORTS", 10381),
206206
publicFunctionExports: readBudgetEnv("OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_FUNCTION_EXPORTS", 5210),
207207
publicDeprecatedExports: readBudgetEnv(
208208
"OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_DEPRECATED_EXPORTS",
209-
3248,
209+
3247,
210210
),
211211
publicWildcardReexports: readBudgetEnv(
212212
"OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_WILDCARD_REEXPORTS",

src/plugin-sdk/text-chunking.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export {
2525
type MarkdownParseOptions,
2626
type MarkdownStyle,
2727
type MarkdownStyleSpan,
28-
type MarkdownTableAlignment,
2928
type MarkdownTableCell,
3029
type MarkdownTableMeta,
3130
} from "../../packages/markdown-core/src/ir.js";

0 commit comments

Comments
 (0)