@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 +1 -1
- package/dist/channel.d.ts +59 -14
- package/dist/channel.js +142 -814
- package/dist/file-download.d.ts +17 -0
- package/dist/file-download.js +69 -0
- package/dist/heartbeat.d.ts +39 -0
- package/dist/heartbeat.js +102 -0
- package/dist/index.js +5 -5
- package/dist/push.d.ts +1 -1
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +2 -2
- package/dist/types.d.ts +74 -1
- package/dist/websocket.d.ts +17 -1
- package/dist/websocket.js +163 -13
- package/dist/xy-bot.d.ts +19 -0
- package/dist/xy-bot.js +277 -0
- package/dist/xy-client.d.ts +26 -0
- package/dist/xy-client.js +78 -0
- package/dist/xy-config.d.ts +18 -0
- package/dist/xy-config.js +37 -0
- package/dist/xy-formatter.d.ts +94 -0
- package/dist/xy-formatter.js +303 -0
- package/dist/xy-monitor.d.ts +17 -0
- package/dist/xy-monitor.js +187 -0
- package/dist/xy-parser.d.ts +49 -0
- package/dist/xy-parser.js +109 -0
- package/dist/xy-reply-dispatcher.d.ts +17 -0
- package/dist/xy-reply-dispatcher.js +308 -0
- package/dist/xy-tools/session-manager.d.ts +29 -0
- package/dist/xy-tools/session-manager.js +80 -0
- package/dist/xy-utils/config-manager.d.ts +26 -0
- package/dist/xy-utils/config-manager.js +61 -0
- package/dist/xy-utils/crypto.d.ts +8 -0
- package/dist/xy-utils/crypto.js +21 -0
- package/dist/xy-utils/logger.d.ts +6 -0
- package/dist/xy-utils/logger.js +37 -0
- package/dist/xy-utils/session.d.ts +34 -0
- package/dist/xy-utils/session.js +55 -0
- package/package.json +32 -17
package/dist/auth.d.ts
CHANGED
package/dist/channel.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import type { ChannelOutboundContext,
|
|
2
|
-
|
|
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
|
-
*
|
|
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: (
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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 {};
|