feat: 简化微信渠道账号连接

This commit is contained in:
2026-09-14 12:05:16 +08:00
parent a721b8fb7e
commit 21e707d9c4
21 changed files with 238 additions and 1078 deletions

View File

@@ -173,8 +173,6 @@ export interface CloudChannelView {
last_confirmed_at?: string | null;
revision?: number;
blockers?: string[];
access_mode?: string;
policy_revision?: number;
adoption_state?: 'available' | 'managed_elsewhere' | 'managed_external' | string;
managed_agent_slug?: string | null;
target_agent_slug?: string | null;
@@ -205,8 +203,6 @@ export interface CloudUserChannelAccount {
target_agent_slug: string | null;
target_agent_name: string | null;
target_agent_published_version: number | null;
access_mode?: string;
policy_revision?: number;
provider_generation?: string;
desired_state?: string;
last_confirmed_at?: string | null;
@@ -291,16 +287,6 @@ export interface CloudChannelActivity {
input_preparation?: { state?: string; error_type?: string | null };
}
export interface CloudChannelActivityPage { items: CloudChannelActivity[]; next_offset: number | null }
export interface CloudChannelPairing {
invitation_id?: string;
binding_id: string;
provider_generation: string;
agent_slug?: string;
kind: 'self' | 'invite' | string;
expires_at?: string;
consumed: boolean;
code?: string;
}
export interface CloudWechatBindState {
session_key: string;
status: string;
@@ -323,14 +309,6 @@ export interface CloudChannelDelivery {
}
export interface CloudChannelWorker { account_id: string; address: string }
export interface CloudChannelMutation { channel: CloudChannelView; target_agent?: string | CloudChannelView; worker?: CloudChannelWorker; wechat?: Record<string, unknown>; disconnected?: boolean }
export interface CloudChannelPolicy {
binding_id: string;
channel_account_id: string;
access_mode: 'self_only' | 'invited' | string;
policy_revision: number;
revoked_caller_ids: string[];
revoked_invitation_ids: string[];
}
export interface CloudChannelControl {
operation_id: string; status: string; session_id: string; action: 'resume' | 'stop' | 'new-session';
previous_session_id?: string;
@@ -433,16 +411,12 @@ export interface CloudAgentOperations {
enableChannelBinding: Op<Agent & { channel_account_id: string; operation_id: string; expected_revision: number }, CloudChannelMutation>;
pauseChannelBinding: Op<Agent & { channel_account_id: string; operation_id: string; expected_revision: number }, CloudChannelMutation>;
disconnectChannelBinding: Op<Agent & { channel_account_id: string; operation_id: string; expected_revision: number }, CloudChannelMutation>;
channelPolicy: Op<Agent & { channel_account_id: string; operation_id: string; access_mode: 'self_only' | 'invited'; expected_policy_revision: number }, CloudChannelPolicy>;
createChannelPairing: Op<Agent & { channel_account_id: string; operation_id: string; kind: 'self' | 'invite' }, CloudChannelPairing>;
wechatBindStart: Op<Agent & { channel_account_id: string; operation_id: string; force: boolean }, CloudWechatBindState>;
wechatBindStatus: Op<Agent & { channel_account_id: string; session_key: string }, CloudWechatBindState>;
wechatBindVerification: Op<Agent & { channel_account_id: string; operation_id: string; session_key: string; verify_code: string }, CloudWechatBindState>;
wechatBindAccount: Op<Agent & { channel_account_id: string }, CloudChannelAccountStatus>;
wechatUnbind: Op<Agent & { channel_account_id: string; operation_id: string }, CloudChannelAccountStatus>;
channelSelfCallers: Op<Agent, CloudChannelCallerPage>;
channelCallers: Op<Agent & { channel_account_id: string }, CloudChannelCallerPage>;
revokeChannelCaller: Op<Agent & { channel_account_id: string; caller_id: string; operation_id: string }, { status: string; caller_id: string }>;
channelActivity: Op<Agent & { channel_account_id: string; offset?: number; limit?: number }, CloudChannelActivityPage>;
channelConversations: Op<Agent & { offset?: number }, CloudChannelConversationPage>;
channelConversation: Op<{ session_id: string; offset?: number }, CloudChannelConversation>;