diff --git a/docs/.generated/plugin-sdk-api-baseline.json b/docs/.generated/plugin-sdk-api-baseline.json index 2eeb8307bac..ce70f5a6de9 100644 --- a/docs/.generated/plugin-sdk-api-baseline.json +++ b/docs/.generated/plugin-sdk-api-baseline.json @@ -154,7 +154,7 @@ "exportName": "ChannelMessageActionAdapter", "kind": "type", "source": { - "line": 553, + "line": 556, "path": "src/channels/plugins/types.core.ts" } }, @@ -163,7 +163,7 @@ "exportName": "ChannelMessageActionContext", "kind": "type", "source": { - "line": 517, + "line": 520, "path": "src/channels/plugins/types.core.ts" } }, @@ -1170,7 +1170,7 @@ "exportName": "BaseProbeResult", "kind": "type", "source": { - "line": 596, + "line": 599, "path": "src/channels/plugins/types.core.ts" } }, @@ -1179,7 +1179,7 @@ "exportName": "BaseTokenResolution", "kind": "type", "source": { - "line": 602, + "line": 605, "path": "src/channels/plugins/types.core.ts" } }, @@ -1224,7 +1224,7 @@ "exportName": "ChannelMessageActionAdapter", "kind": "type", "source": { - "line": 553, + "line": 556, "path": "src/channels/plugins/types.core.ts" } }, @@ -1233,7 +1233,7 @@ "exportName": "ChannelMessageActionContext", "kind": "type", "source": { - "line": 517, + "line": 520, "path": "src/channels/plugins/types.core.ts" } }, @@ -1752,7 +1752,7 @@ "exportName": "BaseProbeResult", "kind": "type", "source": { - "line": 596, + "line": 599, "path": "src/channels/plugins/types.core.ts" } }, @@ -1761,7 +1761,7 @@ "exportName": "BaseTokenResolution", "kind": "type", "source": { - "line": 602, + "line": 605, "path": "src/channels/plugins/types.core.ts" } }, @@ -1797,7 +1797,7 @@ "exportName": "ChannelAgentPromptAdapter", "kind": "type", "source": { - "line": 490, + "line": 493, "path": "src/channels/plugins/types.core.ts" } }, @@ -1977,7 +1977,7 @@ "exportName": "ChannelDirectoryEntry", "kind": "type", "source": { - "line": 504, + "line": 507, "path": "src/channels/plugins/types.core.ts" } }, @@ -1986,7 +1986,7 @@ "exportName": "ChannelDirectoryEntryKind", "kind": "type", "source": { - "line": 502, + "line": 505, "path": "src/channels/plugins/types.core.ts" } }, @@ -2130,7 +2130,7 @@ "exportName": "ChannelMessageActionAdapter", "kind": "type", "source": { - "line": 553, + "line": 556, "path": "src/channels/plugins/types.core.ts" } }, @@ -2139,7 +2139,7 @@ "exportName": "ChannelMessageActionContext", "kind": "type", "source": { - "line": 517, + "line": 520, "path": "src/channels/plugins/types.core.ts" } }, @@ -2274,7 +2274,7 @@ "exportName": "ChannelPollContext", "kind": "type", "source": { - "line": 584, + "line": 587, "path": "src/channels/plugins/types.core.ts" } }, @@ -2283,7 +2283,7 @@ "exportName": "ChannelPollResult", "kind": "type", "source": { - "line": 575, + "line": 578, "path": "src/channels/plugins/types.core.ts" } }, @@ -2427,7 +2427,7 @@ "exportName": "ChannelToolSend", "kind": "type", "source": { - "line": 546, + "line": 549, "path": "src/channels/plugins/types.core.ts" } }, @@ -3738,7 +3738,7 @@ "exportName": "ChannelMessageActionContext", "kind": "type", "source": { - "line": 517, + "line": 520, "path": "src/channels/plugins/types.core.ts" } }, diff --git a/docs/.generated/plugin-sdk-api-baseline.jsonl b/docs/.generated/plugin-sdk-api-baseline.jsonl index a12b3c4c820..6f0dbbe4559 100644 --- a/docs/.generated/plugin-sdk-api-baseline.jsonl +++ b/docs/.generated/plugin-sdk-api-baseline.jsonl @@ -15,8 +15,8 @@ {"declaration":"export type ChannelConfiguredBindingProvider = ChannelConfiguredBindingProvider;","entrypoint":"index","exportName":"ChannelConfiguredBindingProvider","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":674,"sourcePath":"src/channels/plugins/types.adapters.ts"} {"declaration":"export type ChannelGatewayContext = ChannelGatewayContext;","entrypoint":"index","exportName":"ChannelGatewayContext","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":271,"sourcePath":"src/channels/plugins/types.adapters.ts"} {"declaration":"export type ChannelId = ChannelId;","entrypoint":"index","exportName":"ChannelId","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":14,"sourcePath":"src/channels/plugins/types.core.ts"} -{"declaration":"export type ChannelMessageActionAdapter = ChannelMessageActionAdapter;","entrypoint":"index","exportName":"ChannelMessageActionAdapter","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":553,"sourcePath":"src/channels/plugins/types.core.ts"} -{"declaration":"export type ChannelMessageActionContext = ChannelMessageActionContext;","entrypoint":"index","exportName":"ChannelMessageActionContext","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":517,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelMessageActionAdapter = ChannelMessageActionAdapter;","entrypoint":"index","exportName":"ChannelMessageActionAdapter","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":556,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelMessageActionContext = ChannelMessageActionContext;","entrypoint":"index","exportName":"ChannelMessageActionContext","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":520,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelMessageActionName = \"send\" | \"broadcast\" | \"poll\" | \"poll-vote\" | \"react\" | \"reactions\" | \"read\" | \"edit\" | \"unsend\" | \"reply\" | \"sendWithEffect\" | \"renameGroup\" | \"setGroupIcon\" | \"addParticipant\" | \"removeParticipant\" | \"leaveGroup\" | \"sendAttachment\" | \"delete\" | \"pin\" | \"unpin\" | \"list-pins\" | \"permissions\" | \"thread-create\" | \"thread-list\" | \"thread-reply\" | \"search\" | \"sticker\" | \"sticker-search\" | \"member-info\" | \"role-info\" | \"emoji-list\" | \"emoji-upload\" | \"sticker-upload\" | \"role-add\" | \"role-remove\" | \"channel-info\" | \"channel-list\" | \"channel-create\" | \"channel-edit\" | \"channel-delete\" | \"channel-move\" | \"category-create\" | \"category-edit\" | \"category-delete\" | \"topic-create\" | \"topic-edit\" | \"voice-status\" | \"event-list\" | \"event-create\" | \"timeout\" | \"kick\" | \"ban\" | \"set-profile\" | \"set-presence\" | \"download-file\" | \"upload-file\";","entrypoint":"index","exportName":"ChannelMessageActionName","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":6,"sourcePath":"src/channels/plugins/types.ts"} {"declaration":"export type ChannelPlugin = ChannelPlugin;","entrypoint":"index","exportName":"ChannelPlugin","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":77,"sourcePath":"src/channels/plugins/types.plugin.ts"} {"declaration":"export type ChannelSetupAdapter = ChannelSetupAdapter;","entrypoint":"index","exportName":"ChannelSetupAdapter","importSpecifier":"openclaw/plugin-sdk","kind":"type","recordType":"export","sourceLine":63,"sourcePath":"src/channels/plugins/types.adapters.ts"} @@ -127,14 +127,14 @@ {"declaration":"export const ToolPolicySchema: z.ZodOptional>; alsoAllow: z.ZodOptional>; deny: z.ZodOptional>; }, z.core.$strict>>;","entrypoint":"channel-config-schema","exportName":"ToolPolicySchema","importSpecifier":"openclaw/plugin-sdk/channel-config-schema","kind":"const","recordType":"export","sourceLine":253,"sourcePath":"src/config/zod-schema.agent-runtime.ts"} {"declaration":"export const WhatsAppConfigSchema: z.ZodObject<{ enabled: z.ZodOptional; capabilities: z.ZodOptional>; markdown: z.ZodOptional>; }, z.core.$strict>>; configWrites: z.ZodOptional; sendReadReceipts: z.ZodOptional; messagePrefix: z.ZodOptional; responsePrefix: z.ZodOptional; dmPolicy: z.ZodDefault>>; selfChatMode: z.ZodOptional; allowFrom: z.ZodOptional>; defaultTo: z.ZodOptional; groupAllowFrom: z.ZodOptional>; groupPolicy: z.ZodDefault>>; historyLimit: z.ZodOptional; dmHistoryLimit: z.ZodOptional; dms: z.ZodOptional; }, z.core.$strict>>>>; textChunkLimit: z.ZodOptional; chunkMode: z.ZodOptional>; blockStreaming: z.ZodOptional; blockStreamingCoalesce: z.ZodOptional; maxChars: z.ZodOptional; idleMs: z.ZodOptional; }, z.core.$strict>>; groups: z.ZodOptional; tools: z.ZodOptional>; alsoAllow: z.ZodOptional>; deny: z.ZodOptional>; }, z.core.$strict>>; toolsBySender: z.ZodOptional>; alsoAllow: z.ZodOptional>; deny: z.ZodOptional>; }, z.core.$strict>>>>; }, z.core.$strict>>>>; ackReaction: z.ZodOptional; direct: z.ZodDefault>; group: z.ZodDefault>>; }, z.core.$strict>>; debounceMs: z.ZodDefault>; heartbeat: z.ZodOptional; showAlerts: z.ZodOptional; useIndicator: z.ZodOptional; }, z.core.$strict>>; healthMonitor: z.ZodOptional; }, z.core.$strict>>; accounts: z.ZodOptional>; markdown: z.ZodOptional>; }, z.core.$strict>>; configWrites: z.ZodOptional; sendReadReceipts: z.ZodOptional; messagePrefix: z.ZodOptional; responsePrefix: z.ZodOptional; dmPolicy: z.ZodDefault>>; selfChatMode: z.ZodOptional; allowFrom: z.ZodOptional>; defaultTo: z.ZodOptional; groupAllowFrom: z.ZodOptional>; groupPolicy: z.ZodDefault>>; historyLimit: z.ZodOptional; dmHistoryLimit: z.ZodOptional; dms: z.ZodOptional; }, z.core.$strict>>>>; textChunkLimit: z.ZodOptional; chunkMode: z.ZodOptional>; blockStreaming: z.ZodOptional; blockStreamingCoalesce: z.ZodOptional; maxChars: z.ZodOptional; idleMs: z.ZodOptional; }, z.core.$strict>>; groups: z.ZodOptional; tools: z.ZodOptional>; alsoAllow: z.ZodOptional>; deny: z.ZodOptional>; }, z.core.$strict>>; toolsBySender: z.ZodOptional>; alsoAllow: z.ZodOptional>; deny: z.ZodOptional>; }, z.core.$strict>>>>; }, z.core.$strict>>>>; ackReaction: z.ZodOptional; direct: z.ZodDefault>; group: z.ZodDefault>>; }, z.core.$strict>>; debounceMs: z.ZodDefault>; heartbeat: z.ZodOptional; showAlerts: z.ZodOptional; useIndicator: z.ZodOptional; }, z.core.$strict>>; healthMonitor: z.ZodOptional; }, z.core.$strict>>; name: z.ZodOptional; enabled: z.ZodOptional; authDir: z.ZodOptional; mediaMaxMb: z.ZodOptional; }, z.core.$strict>>>>; defaultAccount: z.ZodOptional; mediaMaxMb: z.ZodDefault>; actions: z.ZodOptional; sendMessage: z.ZodOptional; polls: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>;","entrypoint":"channel-config-schema","exportName":"WhatsAppConfigSchema","importSpecifier":"openclaw/plugin-sdk/channel-config-schema","kind":"const","recordType":"export","sourceLine":119,"sourcePath":"src/config/zod-schema.providers-whatsapp.ts"} {"category":"channel","entrypoint":"channel-contract","importSpecifier":"openclaw/plugin-sdk/channel-contract","recordType":"module","sourceLine":1,"sourcePath":"src/plugin-sdk/channel-contract.ts"} -{"declaration":"export type BaseProbeResult = BaseProbeResult;","entrypoint":"channel-contract","exportName":"BaseProbeResult","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":596,"sourcePath":"src/channels/plugins/types.core.ts"} -{"declaration":"export type BaseTokenResolution = BaseTokenResolution;","entrypoint":"channel-contract","exportName":"BaseTokenResolution","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":602,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type BaseProbeResult = BaseProbeResult;","entrypoint":"channel-contract","exportName":"BaseProbeResult","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":599,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type BaseTokenResolution = BaseTokenResolution;","entrypoint":"channel-contract","exportName":"BaseTokenResolution","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":605,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelAccountSnapshot = ChannelAccountSnapshot;","entrypoint":"channel-contract","exportName":"ChannelAccountSnapshot","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":147,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelAgentTool = ChannelAgentTool;","entrypoint":"channel-contract","exportName":"ChannelAgentTool","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":19,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelCommandConversationContext = ChannelCommandConversationContext;","entrypoint":"channel-contract","exportName":"ChannelCommandConversationContext","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":662,"sourcePath":"src/channels/plugins/types.adapters.ts"} {"declaration":"export type ChannelGroupContext = ChannelGroupContext;","entrypoint":"channel-contract","exportName":"ChannelGroupContext","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":219,"sourcePath":"src/channels/plugins/types.core.ts"} -{"declaration":"export type ChannelMessageActionAdapter = ChannelMessageActionAdapter;","entrypoint":"channel-contract","exportName":"ChannelMessageActionAdapter","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":553,"sourcePath":"src/channels/plugins/types.core.ts"} -{"declaration":"export type ChannelMessageActionContext = ChannelMessageActionContext;","entrypoint":"channel-contract","exportName":"ChannelMessageActionContext","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":517,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelMessageActionAdapter = ChannelMessageActionAdapter;","entrypoint":"channel-contract","exportName":"ChannelMessageActionAdapter","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":556,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelMessageActionContext = ChannelMessageActionContext;","entrypoint":"channel-contract","exportName":"ChannelMessageActionContext","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":520,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelMessageActionDiscoveryContext = ChannelMessageActionDiscoveryContext;","entrypoint":"channel-contract","exportName":"ChannelMessageActionDiscoveryContext","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":32,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelMessageActionName = \"send\" | \"broadcast\" | \"poll\" | \"poll-vote\" | \"react\" | \"reactions\" | \"read\" | \"edit\" | \"unsend\" | \"reply\" | \"sendWithEffect\" | \"renameGroup\" | \"setGroupIcon\" | \"addParticipant\" | \"removeParticipant\" | \"leaveGroup\" | \"sendAttachment\" | \"delete\" | \"pin\" | \"unpin\" | \"list-pins\" | \"permissions\" | \"thread-create\" | \"thread-list\" | \"thread-reply\" | \"search\" | \"sticker\" | \"sticker-search\" | \"member-info\" | \"role-info\" | \"emoji-list\" | \"emoji-upload\" | \"sticker-upload\" | \"role-add\" | \"role-remove\" | \"channel-info\" | \"channel-list\" | \"channel-create\" | \"channel-edit\" | \"channel-delete\" | \"channel-move\" | \"category-create\" | \"category-edit\" | \"category-delete\" | \"topic-create\" | \"topic-edit\" | \"voice-status\" | \"event-list\" | \"event-create\" | \"timeout\" | \"kick\" | \"ban\" | \"set-profile\" | \"set-presence\" | \"download-file\" | \"upload-file\";","entrypoint":"channel-contract","exportName":"ChannelMessageActionName","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":6,"sourcePath":"src/channels/plugins/types.ts"} {"declaration":"export type ChannelMessageToolDiscovery = ChannelMessageToolDiscovery;","entrypoint":"channel-contract","exportName":"ChannelMessageToolDiscovery","importSpecifier":"openclaw/plugin-sdk/channel-contract","kind":"type","recordType":"export","sourceLine":57,"sourcePath":"src/channels/plugins/types.core.ts"} @@ -191,12 +191,12 @@ {"declaration":"export const isWhatsAppGroupJid: (value: string) => boolean;","entrypoint":"channel-runtime","exportName":"isWhatsAppGroupJid","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"const","recordType":"export","sourceLine":13,"sourcePath":"src/plugin-sdk/whatsapp-targets.ts"} {"declaration":"export const isWhatsAppUserTarget: (value: string) => boolean;","entrypoint":"channel-runtime","exportName":"isWhatsAppUserTarget","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"const","recordType":"export","sourceLine":15,"sourcePath":"src/plugin-sdk/whatsapp-targets.ts"} {"declaration":"export const normalizeWhatsAppTarget: (value: string) => string | null;","entrypoint":"channel-runtime","exportName":"normalizeWhatsAppTarget","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"const","recordType":"export","sourceLine":17,"sourcePath":"src/plugin-sdk/whatsapp-targets.ts"} -{"declaration":"export type BaseProbeResult = BaseProbeResult;","entrypoint":"channel-runtime","exportName":"BaseProbeResult","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":596,"sourcePath":"src/channels/plugins/types.core.ts"} -{"declaration":"export type BaseTokenResolution = BaseTokenResolution;","entrypoint":"channel-runtime","exportName":"BaseTokenResolution","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":602,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type BaseProbeResult = BaseProbeResult;","entrypoint":"channel-runtime","exportName":"BaseProbeResult","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":599,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type BaseTokenResolution = BaseTokenResolution;","entrypoint":"channel-runtime","exportName":"BaseTokenResolution","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":605,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelAccountSnapshot = ChannelAccountSnapshot;","entrypoint":"channel-runtime","exportName":"ChannelAccountSnapshot","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":147,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelAccountState = ChannelAccountState;","entrypoint":"channel-runtime","exportName":"ChannelAccountState","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":110,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelActionAvailabilityState = ChannelActionAvailabilityState;","entrypoint":"channel-runtime","exportName":"ChannelActionAvailabilityState","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":32,"sourcePath":"src/channels/plugins/types.adapters.ts"} -{"declaration":"export type ChannelAgentPromptAdapter = ChannelAgentPromptAdapter;","entrypoint":"channel-runtime","exportName":"ChannelAgentPromptAdapter","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":490,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelAgentPromptAdapter = ChannelAgentPromptAdapter;","entrypoint":"channel-runtime","exportName":"ChannelAgentPromptAdapter","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":493,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelAgentTool = ChannelAgentTool;","entrypoint":"channel-runtime","exportName":"ChannelAgentTool","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":19,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelAgentToolFactory = ChannelAgentToolFactory;","entrypoint":"channel-runtime","exportName":"ChannelAgentToolFactory","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":24,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelAllowlistAdapter = ChannelAllowlistAdapter;","entrypoint":"channel-runtime","exportName":"ChannelAllowlistAdapter","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":597,"sourcePath":"src/channels/plugins/types.adapters.ts"} @@ -216,8 +216,8 @@ {"declaration":"export type ChannelConfiguredBindingProvider = ChannelConfiguredBindingProvider;","entrypoint":"channel-runtime","exportName":"ChannelConfiguredBindingProvider","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":674,"sourcePath":"src/channels/plugins/types.adapters.ts"} {"declaration":"export type ChannelConversationBindingSupport = ChannelConversationBindingSupport;","entrypoint":"channel-runtime","exportName":"ChannelConversationBindingSupport","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":690,"sourcePath":"src/channels/plugins/types.adapters.ts"} {"declaration":"export type ChannelDirectoryAdapter = ChannelDirectoryAdapter;","entrypoint":"channel-runtime","exportName":"ChannelDirectoryAdapter","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":454,"sourcePath":"src/channels/plugins/types.adapters.ts"} -{"declaration":"export type ChannelDirectoryEntry = ChannelDirectoryEntry;","entrypoint":"channel-runtime","exportName":"ChannelDirectoryEntry","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":504,"sourcePath":"src/channels/plugins/types.core.ts"} -{"declaration":"export type ChannelDirectoryEntryKind = ChannelDirectoryEntryKind;","entrypoint":"channel-runtime","exportName":"ChannelDirectoryEntryKind","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":502,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelDirectoryEntry = ChannelDirectoryEntry;","entrypoint":"channel-runtime","exportName":"ChannelDirectoryEntry","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":507,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelDirectoryEntryKind = ChannelDirectoryEntryKind;","entrypoint":"channel-runtime","exportName":"ChannelDirectoryEntryKind","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":505,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelElevatedAdapter = ChannelElevatedAdapter;","entrypoint":"channel-runtime","exportName":"ChannelElevatedAdapter","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":485,"sourcePath":"src/channels/plugins/types.adapters.ts"} {"declaration":"export type ChannelGatewayAdapter = ChannelGatewayAdapter;","entrypoint":"channel-runtime","exportName":"ChannelGatewayAdapter","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":379,"sourcePath":"src/channels/plugins/types.adapters.ts"} {"declaration":"export type ChannelGatewayContext = ChannelGatewayContext;","entrypoint":"channel-runtime","exportName":"ChannelGatewayContext","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":271,"sourcePath":"src/channels/plugins/types.adapters.ts"} @@ -233,8 +233,8 @@ {"declaration":"export type ChannelLogoutResult = ChannelLogoutResult;","entrypoint":"channel-runtime","exportName":"ChannelLogoutResult","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":344,"sourcePath":"src/channels/plugins/types.adapters.ts"} {"declaration":"export type ChannelLogSink = ChannelLogSink;","entrypoint":"channel-runtime","exportName":"ChannelLogSink","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":212,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelMentionAdapter = ChannelMentionAdapter;","entrypoint":"channel-runtime","exportName":"ChannelMentionAdapter","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":263,"sourcePath":"src/channels/plugins/types.core.ts"} -{"declaration":"export type ChannelMessageActionAdapter = ChannelMessageActionAdapter;","entrypoint":"channel-runtime","exportName":"ChannelMessageActionAdapter","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":553,"sourcePath":"src/channels/plugins/types.core.ts"} -{"declaration":"export type ChannelMessageActionContext = ChannelMessageActionContext;","entrypoint":"channel-runtime","exportName":"ChannelMessageActionContext","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":517,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelMessageActionAdapter = ChannelMessageActionAdapter;","entrypoint":"channel-runtime","exportName":"ChannelMessageActionAdapter","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":556,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelMessageActionContext = ChannelMessageActionContext;","entrypoint":"channel-runtime","exportName":"ChannelMessageActionContext","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":520,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelMessageActionDiscoveryContext = ChannelMessageActionDiscoveryContext;","entrypoint":"channel-runtime","exportName":"ChannelMessageActionDiscoveryContext","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":32,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelMessageActionName = \"send\" | \"broadcast\" | \"poll\" | \"poll-vote\" | \"react\" | \"reactions\" | \"read\" | \"edit\" | \"unsend\" | \"reply\" | \"sendWithEffect\" | \"renameGroup\" | \"setGroupIcon\" | \"addParticipant\" | \"removeParticipant\" | \"leaveGroup\" | \"sendAttachment\" | \"delete\" | \"pin\" | \"unpin\" | \"list-pins\" | \"permissions\" | \"thread-create\" | \"thread-list\" | \"thread-reply\" | \"search\" | \"sticker\" | \"sticker-search\" | \"member-info\" | \"role-info\" | \"emoji-list\" | \"emoji-upload\" | \"sticker-upload\" | \"role-add\" | \"role-remove\" | \"channel-info\" | \"channel-list\" | \"channel-create\" | \"channel-edit\" | \"channel-delete\" | \"channel-move\" | \"category-create\" | \"category-edit\" | \"category-delete\" | \"topic-create\" | \"topic-edit\" | \"voice-status\" | \"event-list\" | \"event-create\" | \"timeout\" | \"kick\" | \"ban\" | \"set-profile\" | \"set-presence\" | \"download-file\" | \"upload-file\";","entrypoint":"channel-runtime","exportName":"ChannelMessageActionName","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":6,"sourcePath":"src/channels/plugins/types.ts"} {"declaration":"export type ChannelMessageCapability = \"interactive\" | \"buttons\" | \"cards\" | \"components\" | \"blocks\";","entrypoint":"channel-runtime","exportName":"ChannelMessageCapability","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":9,"sourcePath":"src/channels/plugins/message-capabilities.ts"} @@ -249,8 +249,8 @@ {"declaration":"export type ChannelOutboundTargetRef = ChannelOutboundTargetRef;","entrypoint":"channel-runtime","exportName":"ChannelOutboundTargetRef","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":164,"sourcePath":"src/channels/plugins/types.adapters.ts"} {"declaration":"export type ChannelPairingAdapter = ChannelPairingAdapter;","entrypoint":"channel-runtime","exportName":"ChannelPairingAdapter","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":368,"sourcePath":"src/channels/plugins/types.adapters.ts"} {"declaration":"export type ChannelPlugin = ChannelPlugin;","entrypoint":"channel-runtime","exportName":"ChannelPlugin","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":77,"sourcePath":"src/channels/plugins/types.plugin.ts"} -{"declaration":"export type ChannelPollContext = ChannelPollContext;","entrypoint":"channel-runtime","exportName":"ChannelPollContext","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":584,"sourcePath":"src/channels/plugins/types.core.ts"} -{"declaration":"export type ChannelPollResult = ChannelPollResult;","entrypoint":"channel-runtime","exportName":"ChannelPollResult","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":575,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelPollContext = ChannelPollContext;","entrypoint":"channel-runtime","exportName":"ChannelPollContext","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":587,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelPollResult = ChannelPollResult;","entrypoint":"channel-runtime","exportName":"ChannelPollResult","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":578,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelResolveKind = ChannelResolveKind;","entrypoint":"channel-runtime","exportName":"ChannelResolveKind","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":465,"sourcePath":"src/channels/plugins/types.adapters.ts"} {"declaration":"export type ChannelResolverAdapter = ChannelResolverAdapter;","entrypoint":"channel-runtime","exportName":"ChannelResolverAdapter","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":475,"sourcePath":"src/channels/plugins/types.adapters.ts"} {"declaration":"export type ChannelResolveResult = ChannelResolveResult;","entrypoint":"channel-runtime","exportName":"ChannelResolveResult","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":467,"sourcePath":"src/channels/plugins/types.adapters.ts"} @@ -266,7 +266,7 @@ {"declaration":"export type ChannelThreadingAdapter = ChannelThreadingAdapter;","entrypoint":"channel-runtime","exportName":"ChannelThreadingAdapter","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":325,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelThreadingContext = ChannelThreadingContext;","entrypoint":"channel-runtime","exportName":"ChannelThreadingContext","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":368,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelThreadingToolContext = ChannelThreadingToolContext;","entrypoint":"channel-runtime","exportName":"ChannelThreadingToolContext","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":382,"sourcePath":"src/channels/plugins/types.core.ts"} -{"declaration":"export type ChannelToolSend = ChannelToolSend;","entrypoint":"channel-runtime","exportName":"ChannelToolSend","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":546,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelToolSend = ChannelToolSend;","entrypoint":"channel-runtime","exportName":"ChannelToolSend","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":549,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChatType = ChatType;","entrypoint":"channel-runtime","exportName":"ChatType","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":1,"sourcePath":"src/channels/chat-type.ts"} {"declaration":"export type CreateTypingCallbacksParams = CreateTypingCallbacksParams;","entrypoint":"channel-runtime","exportName":"CreateTypingCallbacksParams","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":11,"sourcePath":"src/channels/typing.ts"} {"declaration":"export type HeartbeatEventPayload = HeartbeatEventPayload;","entrypoint":"channel-runtime","exportName":"HeartbeatEventPayload","importSpecifier":"openclaw/plugin-sdk/channel-runtime","kind":"type","recordType":"export","sourceLine":6,"sourcePath":"src/infra/heartbeat-events.ts"} @@ -411,7 +411,7 @@ {"declaration":"export const DEFAULT_SECRET_FILE_MAX_BYTES: number;","entrypoint":"core","exportName":"DEFAULT_SECRET_FILE_MAX_BYTES","importSpecifier":"openclaw/plugin-sdk/core","kind":"const","recordType":"export","sourceLine":5,"sourcePath":"src/infra/secret-file.ts"} {"declaration":"export type AnyAgentTool = AnyAgentTool;","entrypoint":"core","exportName":"AnyAgentTool","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":9,"sourcePath":"src/agents/tools/common.ts"} {"declaration":"export type ChannelConfigUiHint = ChannelConfigUiHint;","entrypoint":"core","exportName":"ChannelConfigUiHint","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":38,"sourcePath":"src/channels/plugins/types.plugin.ts"} -{"declaration":"export type ChannelMessageActionContext = ChannelMessageActionContext;","entrypoint":"core","exportName":"ChannelMessageActionContext","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":517,"sourcePath":"src/channels/plugins/types.core.ts"} +{"declaration":"export type ChannelMessageActionContext = ChannelMessageActionContext;","entrypoint":"core","exportName":"ChannelMessageActionContext","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":520,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelMessagingAdapter = ChannelMessagingAdapter;","entrypoint":"core","exportName":"ChannelMessagingAdapter","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":398,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelOutboundSessionRoute = ChannelOutboundSessionRoute;","entrypoint":"core","exportName":"ChannelOutboundSessionRoute","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":312,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelOutboundSessionRouteParams = { cfg: OpenClawConfig; agentId: string; accountId?: string | null; target: string; resolvedTarget?: { to: string; kind: import(\"../channels/plugins/types.core.js\").ChannelDirectoryEntryKind | \"channel\"; display?: string; source: \"normalized\" | \"directory\"; }; replyToId?: string | null; threadId?: string | number | null;};","entrypoint":"core","exportName":"ChannelOutboundSessionRouteParams","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":159,"sourcePath":"src/plugin-sdk/core.ts"} diff --git a/docs/plugins/sdk-channel-plugins.md b/docs/plugins/sdk-channel-plugins.md index 59283e6a613..a8b7baaa5a2 100644 --- a/docs/plugins/sdk-channel-plugins.md +++ b/docs/plugins/sdk-channel-plugins.md @@ -38,7 +38,9 @@ generic `:thread:` bookkeeping, and dispatch. If your platform stores extra scope inside conversation ids, keep that parsing in the plugin with `messaging.resolveSessionConversation(...)`. That is the canonical hook for mapping `rawId` to the base conversation id, optional thread -id, and any `parentConversationCandidates`. +id, explicit `baseConversationId`, and any `parentConversationCandidates`. +When you return `parentConversationCandidates`, keep them ordered from the +narrowest parent to the broadest/base conversation. Bundled plugins that need the same parsing before the channel registry boots can also expose a top-level `session-key-api.ts` file with a matching diff --git a/extensions/feishu/src/channel.test.ts b/extensions/feishu/src/channel.test.ts index 2529affc3a6..9e36dce3940 100644 --- a/extensions/feishu/src/channel.test.ts +++ b/extensions/feishu/src/channel.test.ts @@ -197,6 +197,7 @@ describe("feishuPlugin messaging", () => { }), ).toEqual({ id: "oc_group_chat:topic:om_topic_root:sender:ou_topic_user", + baseConversationId: "oc_group_chat", parentConversationCandidates: ["oc_group_chat:topic:om_topic_root", "oc_group_chat"], }); expect( @@ -206,6 +207,7 @@ describe("feishuPlugin messaging", () => { }), ).toEqual({ id: "oc_group_chat:topic:om_topic_root", + baseConversationId: "oc_group_chat", parentConversationCandidates: ["oc_group_chat"], }); expect( @@ -215,6 +217,7 @@ describe("feishuPlugin messaging", () => { }), ).toEqual({ id: "oc_group_chat:topic:om_topic_root:sender:ou_topic_user", + baseConversationId: "oc_group_chat", parentConversationCandidates: ["oc_group_chat:topic:om_topic_root", "oc_group_chat"], }); }); diff --git a/extensions/feishu/src/session-conversation.ts b/extensions/feishu/src/session-conversation.ts index 859a6af5642..4527038e390 100644 --- a/extensions/feishu/src/session-conversation.ts +++ b/extensions/feishu/src/session-conversation.ts @@ -34,6 +34,7 @@ export function resolveFeishuSessionConversation(params: { } return { id: parsed.canonicalConversationId, + baseConversationId: parsed.chatId, parentConversationCandidates: resolveFeishuParentConversationCandidates( parsed.canonicalConversationId, ), diff --git a/extensions/telegram/src/channel.test.ts b/extensions/telegram/src/channel.test.ts index 39c16129179..8c7f7d9309b 100644 --- a/extensions/telegram/src/channel.test.ts +++ b/extensions/telegram/src/channel.test.ts @@ -197,6 +197,7 @@ describe("telegramPlugin messaging", () => { ).toEqual({ id: "-1001", threadId: "77", + baseConversationId: "-1001", parentConversationCandidates: ["-1001"], }); expect( @@ -207,6 +208,7 @@ describe("telegramPlugin messaging", () => { ).toEqual({ id: "-1001", threadId: "77", + baseConversationId: "-1001", parentConversationCandidates: ["-1001"], }); expect( diff --git a/extensions/telegram/src/session-conversation.ts b/extensions/telegram/src/session-conversation.ts index c5266444aaf..68089c5fa81 100644 --- a/extensions/telegram/src/session-conversation.ts +++ b/extensions/telegram/src/session-conversation.ts @@ -11,6 +11,7 @@ export function resolveTelegramSessionConversation(params: { return { id: parsed.chatId, threadId: parsed.topicId, + baseConversationId: parsed.chatId, parentConversationCandidates: [parsed.chatId], }; } diff --git a/src/agents/pi-tools.policy.ts b/src/agents/pi-tools.policy.ts index 0f8e482aad1..cc6d2ef594f 100644 --- a/src/agents/pi-tools.policy.ts +++ b/src/agents/pi-tools.policy.ts @@ -141,8 +141,7 @@ function resolveGroupContextFromSessionKey(sessionKey?: string | null): { } const resolvedConversation = resolveSessionConversationRef(raw); if (resolvedConversation) { - const groupId = - resolvedConversation.parentConversationCandidates.at(-1) ?? resolvedConversation.id; + const groupId = resolvedConversation.baseConversationId; if (!groupId) { return {}; } diff --git a/src/channels/plugins/session-conversation.test.ts b/src/channels/plugins/session-conversation.test.ts index d35f29566db..6693b36a4e1 100644 --- a/src/channels/plugins/session-conversation.test.ts +++ b/src/channels/plugins/session-conversation.test.ts @@ -24,6 +24,7 @@ describe("session conversation routing", () => { id: "general", threadId: "1699999999.0001", baseSessionKey: "agent:main:slack:channel:general", + baseConversationId: "general", parentConversationCandidates: ["general"], }); }); @@ -36,6 +37,7 @@ describe("session conversation routing", () => { id: "-100123", threadId: "77", baseSessionKey: "agent:main:telegram:group:-100123", + baseConversationId: "-100123", parentConversationCandidates: ["-100123"], }); expect(resolveSessionThreadInfo("agent:main:telegram:group:-100123:topic:77")).toEqual({ @@ -57,6 +59,7 @@ describe("session conversation routing", () => { id: "-100123", threadId: "77", baseSessionKey: "agent:main:telegram:group:-100123", + baseConversationId: "-100123", parentConversationCandidates: ["-100123"], }); }); @@ -76,6 +79,7 @@ describe("session conversation routing", () => { threadId: undefined, baseSessionKey: "agent:main:feishu:group:oc_group_chat:topic:om_topic_root:sender:ou_topic_user", + baseConversationId: "oc_group_chat", parentConversationCandidates: ["oc_group_chat:topic:om_topic_root", "oc_group_chat"], }); }); @@ -93,6 +97,7 @@ describe("session conversation routing", () => { threadId: undefined, baseSessionKey: "agent:main:feishu:group:oc_group_chat:topic:om_topic_root:sender:ou_topic_user", + baseConversationId: "oc_group_chat", parentConversationCandidates: ["oc_group_chat:topic:om_topic_root", "oc_group_chat"], }); expect( @@ -140,6 +145,7 @@ describe("session conversation routing", () => { ).toEqual({ id: "room:sender:user", threadId: undefined, + baseConversationId: "room", parentConversationCandidates: ["room"], }); }); diff --git a/src/channels/plugins/session-conversation.ts b/src/channels/plugins/session-conversation.ts index 8a2f4cfd0bf..d5034ba5bb8 100644 --- a/src/channels/plugins/session-conversation.ts +++ b/src/channels/plugins/session-conversation.ts @@ -14,6 +14,7 @@ import { getChannelPlugin, normalizeChannelId as normalizeAnyChannelId } from ". export type ResolvedSessionConversation = { id: string; threadId: string | undefined; + baseConversationId: string; parentConversationCandidates: string[]; }; @@ -24,12 +25,14 @@ export type ResolvedSessionConversationRef = { id: string; threadId: string | undefined; baseSessionKey: string; + baseConversationId: string; parentConversationCandidates: string[]; }; type SessionConversationHookResult = { id: string; threadId?: string | null; + baseConversationId?: string | null; parentConversationCandidates?: string[]; }; @@ -100,6 +103,7 @@ function buildGenericConversationResolution(rawId: string): ResolvedSessionConve return { id, threadId: parsed.threadId, + baseConversationId: id, parentConversationCandidates: dedupeConversationIds( parsed.threadId ? [parsed.baseSessionKey] : [], ), @@ -116,6 +120,10 @@ function normalizeSessionConversationResolution( return { id: resolved.id.trim(), threadId: resolved.threadId?.trim() || undefined, + baseConversationId: + resolved.baseConversationId?.trim() || + dedupeConversationIds(resolved.parentConversationCandidates ?? []).at(-1) || + resolved.id.trim(), parentConversationCandidates: dedupeConversationIds( resolved.parentConversationCandidates ?? [], ), @@ -197,9 +205,12 @@ function resolveSessionConversationResolution(params: { rawId, }) ?? resolved.parentConversationCandidates), ); + const baseConversationId = + parentConversationCandidates.at(-1) ?? resolved.baseConversationId ?? resolved.id; return { ...resolved, + baseConversationId, parentConversationCandidates, }; } @@ -236,6 +247,7 @@ export function resolveSessionConversationRef( id: resolved.id, threadId: resolved.threadId, baseSessionKey: buildBaseSessionKey(raw, resolved.id), + baseConversationId: resolved.baseConversationId, parentConversationCandidates: resolved.parentConversationCandidates, }; } diff --git a/src/channels/plugins/types.core.ts b/src/channels/plugins/types.core.ts index 4c0f1ad3595..f74d438fe96 100644 --- a/src/channels/plugins/types.core.ts +++ b/src/channels/plugins/types.core.ts @@ -401,14 +401,17 @@ export type ChannelMessagingAdapter = { * Canonical plugin-owned session conversation grammar. * Use this when the provider encodes thread or scoped-conversation semantics * inside `rawId` (for example Telegram topics or Feishu sender scopes). - * Return `parentConversationCandidates` here when you can so parsing and - * inheritance stay in one place. + * Return `baseConversationId` and `parentConversationCandidates` here when + * you can so parsing and inheritance stay in one place. + * `parentConversationCandidates`, when present, should be ordered from the + * narrowest parent to the broadest/base conversation. * Bundled plugins that need the same grammar before runtime bootstrap can * mirror this contract through a top-level `session-key-api.ts` surface. */ resolveSessionConversation?: (params: { kind: "group" | "channel"; rawId: string }) => { id: string; threadId?: string | null; + baseConversationId?: string | null; parentConversationCandidates?: string[]; } | null; /**