Files
openclaw/extensions/line/runtime-api.ts
T
Peter Steinberger d8ebe85c24 refactor(line): replace nine-marker prompt DSL with typed rich messages (#124755)
* refactor(line): replace nine-marker prompt DSL with typed rich messages

Delete the LINE plugin's double-bracket marker language (quick_replies,
location, confirm, buttons, media_player, event, agenda, device,
appletv_remote) and its parser. Portable interactions now flow through the
existing presentation-block seam (renderPresentation, matching Discord and
Feishu); LINE-specific cards ride closed channelData.line schemas mapped to
the existing Flex renderers. Prompt section shrinks to four capability
lines and explicitly de-fangs marker text. Removes the stale
assertion-safety baseline entry for the deleted parser.

Production LOC net -69, tests net -433. Suite: 510/510 green.

* fix(line): declare rich message schema dependency

* fix(line): satisfy rich message type checks

* docs(line): mark card fragments as partial
2026-08-16 12:45:39 -07:00

162 lines
4.3 KiB
TypeScript

// Private runtime barrel for the bundled LINE extension.
// Keep this barrel thin and aligned with the local extension surface.
export type {
ChannelAccountSnapshot,
ChannelPlugin,
OpenClawConfig,
OpenClawPluginApi,
PluginRuntime,
} from "openclaw/plugin-sdk/core";
export type {
ChannelGatewayContext,
ChannelStatusIssue,
} from "openclaw/plugin-sdk/channel-contract";
export { clearAccountEntryFields } from "openclaw/plugin-sdk/core";
export { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
export type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
export type { ChannelSetupDmPolicy, ChannelSetupWizard } from "openclaw/plugin-sdk/setup";
export {
buildComputedAccountStatusSnapshot,
buildTokenChannelStatusSummary,
} from "openclaw/plugin-sdk/status-helpers";
export {
DEFAULT_ACCOUNT_ID,
formatDocsLink,
setSetupChannelEnabled,
splitSetupEntries,
} from "openclaw/plugin-sdk/setup";
export { setLineRuntime } from "./src/runtime.js";
export { firstDefined, normalizeAllowFrom } from "./src/bot-access.js";
export { downloadLineMedia } from "./src/download.js";
export { probeLineBot } from "./src/probe.js";
export { buildTemplateMessageFromPayload } from "./src/template-messages.js";
export {
createQuickReplyItems,
pushFlexMessage,
pushLocationMessage,
pushMessageLine,
pushMessagesLine,
pushTemplateMessage,
pushTextMessageWithQuickReplies,
sendMessageLine,
} from "./src/send.js";
export { monitorLineProvider } from "./src/monitor.js";
export {
listLineAccountIds,
normalizeAccountId,
resolveDefaultLineAccountId,
resolveLineAccount,
} from "./src/accounts.js";
export { type NormalizedAllowFrom } from "./src/bot-access.js";
export { resolveLineChannelAccessToken } from "./src/channel-access-token.js";
export {
LineChannelConfigSchema,
LineConfigSchema,
type LineConfigSchemaType,
} from "./src/config-schema.js";
export {
resolveExactLineGroupConfigKey,
resolveLineGroupConfigEntry,
resolveLineGroupLookupIds,
resolveLineGroupsConfig,
} from "./src/group-keys.js";
export {
type CodeBlock,
convertCodeBlockToFlexBubble,
convertTableToFlexBubble,
hasMarkdownToConvert,
type MarkdownTable,
type ProcessedLineMessage,
processLineMessage,
stripMarkdown,
} from "./src/markdown-to-line.js";
export {
createAudioMessage,
createFlexMessage,
createImageMessage,
createLocationMessage,
createTextMessageWithQuickReplies,
createVideoMessage,
getUserDisplayName,
getUserProfile,
pushImageMessage,
replyMessageLine,
showLoadingAnimation,
} from "./src/send.js";
export { validateLineSignature } from "./src/signature.js";
export {
type ButtonsTemplate,
type CarouselColumn,
type CarouselTemplate,
type ConfirmTemplate,
createButtonTemplate,
createCarouselColumn,
createConfirmTemplate,
createTemplateCarousel,
type TemplateMessage,
} from "./src/template-messages.js";
export type {
LineChannelData,
LineConfig,
LineProbeResult,
ResolvedLineAccount,
} from "./src/types.js";
export { createLineNodeWebhookHandler, readLineWebhookRequestBody } from "./src/webhook-node.js";
export {
createLineWebhookMiddleware,
type LineWebhookOptions,
startLineWebhook,
type StartLineWebhookOptions,
} from "./src/webhook.js";
export { parseLineWebhookBody } from "./src/webhook-utils.js";
export { datetimePickerAction, messageAction, postbackAction, uriAction } from "./src/actions.js";
export type { Action } from "./src/actions.js";
export {
createActionCard,
createAgendaCard,
createAppleTvRemoteCard,
createDeviceControlCard,
createEventCard,
createImageCard,
createInfoCard,
createListCard,
createMediaPlayerCard,
createReceiptCard,
toFlexMessage,
} from "./src/flex-templates.js";
export type {
CardAction,
FlexBox,
FlexBubble,
FlexButton,
FlexComponent,
FlexContainer,
FlexImage,
FlexText,
ListItem,
} from "./src/flex-templates.js";
export {
cancelDefaultRichMenu,
createDefaultMenuConfig,
createGridLayout,
createRichMenu,
createRichMenuAlias,
deleteRichMenu,
deleteRichMenuAlias,
getDefaultRichMenuId,
getRichMenu,
getRichMenuIdOfUser,
getRichMenuList,
setDefaultRichMenu,
uploadRichMenuImage,
} from "./src/rich-menu.js";
export type {
CreateRichMenuParams,
RichMenuArea,
RichMenuAreaRequest,
RichMenuRequest,
RichMenuResponse,
RichMenuSize,
} from "./src/rich-menu.js";