@ynhcj/xiaoyi 2.5.6 → 2.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/auth.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AuthCredentials } from "./types";
1
+ import { AuthCredentials } from "./types.js";
2
2
  /**
3
3
  * Generate authentication signature using AK/SK mechanism
4
4
  * Based on: https://developer.huawei.com/consumer/cn/doc/service/pushmessage-0000002505761436
package/dist/channel.d.ts CHANGED
@@ -1,5 +1,15 @@
1
- import type { ChannelOutboundContext, OutboundDeliveryResult, ChannelGatewayContext, ChannelMessagingNormalizeTargetContext, ChannelStatusGetAccountStatusContext, OpenClawConfig } from "openclaw";
2
- import { XiaoYiChannelConfig } from "./types";
1
+ import type { ChannelOutboundContext, ChannelGatewayContext, OpenClawConfig } from "openclaw/dist/plugin-sdk/index.js";
2
+ type OutboundDeliveryResult = {
3
+ channel: string;
4
+ messageId: string;
5
+ chatId?: string;
6
+ channelId?: string;
7
+ roomId?: string;
8
+ conversationId?: string;
9
+ timestamp?: number;
10
+ meta?: Record<string, unknown>;
11
+ };
12
+ import { XiaoYiChannelConfig } from "./types.js";
3
13
  /**
4
14
  * Resolved XiaoYi account configuration (single account mode)
5
15
  */
@@ -111,34 +121,69 @@ export declare const xiaoyiPlugin: {
111
121
  };
112
122
  };
113
123
  /**
114
- * Outbound adapter - send messages
124
+ * Gateway adapter - manage connections
125
+ * Using xy-monitor for message handling (xy_channel architecture)
126
+ */
127
+ gateway: {
128
+ startAccount: (ctx: ChannelGatewayContext<ResolvedXiaoYiAccount>) => Promise<void>;
129
+ stopAccount: (ctx: ChannelGatewayContext<ResolvedXiaoYiAccount>) => Promise<void>;
130
+ };
131
+ /**
132
+ * Outbound adapter - send messages via push
115
133
  */
116
134
  outbound: {
117
135
  deliveryMode: string;
118
136
  textChunkLimit: number;
137
+ resolveTarget: ({ cfg, to, accountId, mode }: any) => {
138
+ ok: boolean;
139
+ to: any;
140
+ };
119
141
  sendText: (ctx: ChannelOutboundContext) => Promise<OutboundDeliveryResult>;
120
142
  sendMedia: (ctx: ChannelOutboundContext) => Promise<OutboundDeliveryResult>;
121
143
  };
122
- /**
123
- * Gateway adapter - manage connections
124
- */
125
- gateway: {
126
- startAccount: (ctx: ChannelGatewayContext<ResolvedXiaoYiAccount>) => Promise<void>;
127
- stopAccount: (ctx: ChannelGatewayContext<ResolvedXiaoYiAccount>) => Promise<void>;
128
- };
129
144
  /**
130
145
  * Messaging adapter - normalize targets
146
+ * In new openclaw version, normalizeTarget receives a string and returns a normalized string
131
147
  */
132
148
  messaging: {
133
- normalizeTarget: (ctx: ChannelMessagingNormalizeTargetContext) => Promise<string>;
149
+ normalizeTarget: (raw: string) => string;
134
150
  };
135
151
  /**
136
152
  * Status adapter - health checks
153
+ * Using buildAccountSnapshot for compatibility with new openclaw version
137
154
  */
138
155
  status: {
139
- getAccountStatus: (ctx: ChannelStatusGetAccountStatusContext) => Promise<{
140
- status: string;
141
- message: string;
156
+ buildAccountSnapshot: (params: {
157
+ account: ResolvedXiaoYiAccount;
158
+ cfg: OpenClawConfig;
159
+ runtime?: any;
160
+ probe?: unknown;
161
+ audit?: unknown;
162
+ }) => Promise<{
163
+ accountId: string;
164
+ state: "offline";
165
+ lastEventAt: number;
166
+ issues: {
167
+ severity: "error";
168
+ message: string;
169
+ }[];
170
+ lastInboundAt?: undefined;
171
+ } | {
172
+ accountId: string;
173
+ state: "ready";
174
+ lastEventAt: number;
175
+ lastInboundAt: number;
176
+ issues?: undefined;
177
+ } | {
178
+ accountId: string;
179
+ state: "authenticating";
180
+ lastEventAt: number;
181
+ issues: {
182
+ severity: "warning";
183
+ message: string;
184
+ }[];
185
+ lastInboundAt?: undefined;
142
186
  }>;
143
187
  };
144
188
  };
189
+ export {};