@@ -99,34 +99,22 @@ function canResolveTarget(request: {
|
99 | 99 | return sessionConversation?.id != null; |
100 | 100 | } |
101 | 101 | |
| 102 | +function resolveNativeDeliveryState(params: { |
| 103 | +cfg: OpenClawConfig; |
| 104 | +accountId?: string | null; |
| 105 | +}): { kind: "enabled" } | { kind: "disabled" } { |
| 106 | +const enabled = isNativeDeliveryEnabled(params); |
| 107 | +return enabled ? { kind: "enabled" } : { kind: "disabled" }; |
| 108 | +} |
| 109 | + |
102 | 110 | function createQQBotApprovalCapability(): ChannelApprovalCapability { |
103 | 111 | return createChannelApprovalCapability({ |
104 | 112 | authorizeActorAction: ({ cfg, accountId, senderId, approvalKind }) => |
105 | 113 | authorizeQQBotApprovalAction({ cfg, accountId, senderId, approvalKind }), |
106 | 114 | |
107 | | -getActionAvailabilityState: ({ |
108 | | - cfg, |
109 | | - accountId, |
110 | | -}: { |
111 | | -cfg: OpenClawConfig; |
112 | | -accountId?: string | null; |
113 | | -action: "approve"; |
114 | | -}) => { |
115 | | -const enabled = isNativeDeliveryEnabled({ cfg, accountId }); |
116 | | -return enabled ? { kind: "enabled" } : { kind: "disabled" }; |
117 | | -}, |
| 115 | +getActionAvailabilityState: resolveNativeDeliveryState, |
118 | 116 | |
119 | | -getExecInitiatingSurfaceState: ({ |
120 | | - cfg, |
121 | | - accountId, |
122 | | -}: { |
123 | | -cfg: OpenClawConfig; |
124 | | -accountId?: string | null; |
125 | | -action: "approve"; |
126 | | -}) => { |
127 | | -const enabled = isNativeDeliveryEnabled({ cfg, accountId }); |
128 | | -return enabled ? { kind: "enabled" } : { kind: "disabled" }; |
129 | | -}, |
| 117 | +getExecInitiatingSurfaceState: resolveNativeDeliveryState, |
130 | 118 | |
131 | 119 | describeExecApprovalSetup: ({ accountId }: { accountId?: string | null }) => { |
132 | 120 | const prefix = |
|