@openclaw-channel/socket-chat 1.0.5 → 1.0.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/README.md +9 -0
- package/channel-api.ts +3 -0
- package/index.ts +11 -12
- package/package.json +1 -1
- package/runtime-api.ts +3 -0
- package/src/__sdk-stub__.ts +26 -8
- package/src/channel.ts +391 -336
- package/src/inbound.test.ts +405 -583
- package/src/inbound.ts +175 -407
- package/src/mqtt-client.ts +66 -50
- package/src/outbound.test.ts +36 -26
- package/src/outbound.ts +37 -75
- package/src/runtime-api.ts +28 -0
- package/src/runtime.ts +8 -12
- package/tsconfig.json +1 -1
- package/vitest.config.ts +13 -7
package/README.md
CHANGED
package/channel-api.ts
ADDED
package/index.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
|
|
3
|
-
import { socketChatPlugin } from "./src/channel.js";
|
|
4
|
-
import { setSocketChatRuntime } from "./src/runtime.js";
|
|
1
|
+
import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
export default defineBundledChannelEntry({
|
|
7
4
|
id: "socket-chat",
|
|
8
5
|
name: "Socket Chat",
|
|
9
6
|
description: "Socket Chat channel plugin — MQTT-based IM bridge",
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
importMetaUrl: import.meta.url,
|
|
8
|
+
plugin: {
|
|
9
|
+
specifier: "./channel-api.js",
|
|
10
|
+
exportName: "socketChatPlugin",
|
|
14
11
|
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
runtime: {
|
|
13
|
+
specifier: "./runtime-api.js",
|
|
14
|
+
exportName: "setSocketChatRuntime",
|
|
15
|
+
},
|
|
16
|
+
});
|
package/package.json
CHANGED
package/runtime-api.ts
ADDED
package/src/__sdk-stub__.ts
CHANGED
|
@@ -1,15 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Minimal openclaw/plugin-sdk stub for socket-chat unit tests.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Handles the broad "openclaw/plugin-sdk" fallback alias in vitest.config.ts.
|
|
5
|
+
* Per-subpath imports (openclaw/plugin-sdk/*) are resolved directly via
|
|
6
|
+
* individual aliases defined in vitest.config.ts.
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
8
|
+
export { createPluginRuntimeStore } from "../../openclaw/src/plugin-sdk/runtime-store.js";
|
|
9
|
+
export { createChannelPairingController } from "../../openclaw/src/plugin-sdk/channel-pairing.js";
|
|
10
|
+
export { createAccountStatusSink } from "../../openclaw/src/plugin-sdk/channel-lifecycle.js";
|
|
11
|
+
export { dispatchInboundReplyWithBase } from "../../openclaw/src/plugin-sdk/inbound-reply-dispatch.js";
|
|
12
|
+
export {
|
|
13
|
+
deliverFormattedTextWithAttachments,
|
|
14
|
+
buildMediaPayload,
|
|
15
|
+
} from "../../openclaw/src/plugin-sdk/reply-payload.js";
|
|
16
|
+
export { resolveChannelMediaMaxBytes, detectMime } from "../../openclaw/src/plugin-sdk/media-runtime.js";
|
|
17
|
+
export { resolveAllowlistMatchByCandidates } from "../../openclaw/src/plugin-sdk/allow-from.js";
|
|
18
|
+
export {
|
|
19
|
+
buildBaseChannelStatusSummary,
|
|
20
|
+
buildBaseAccountStatusSnapshot,
|
|
21
|
+
collectStatusIssuesFromLastError,
|
|
22
|
+
} from "../../openclaw/src/plugin-sdk/status-helpers.js";
|
|
13
23
|
|
|
14
24
|
// ---- type-only re-exports (erased at runtime) ----
|
|
25
|
+
export type { PluginRuntime } from "../../openclaw/src/plugin-sdk/runtime-store.js";
|
|
26
|
+
export type { OutboundReplyPayload } from "../../openclaw/src/plugin-sdk/reply-payload.js";
|
|
27
|
+
export type { ChannelPlugin } from "../../openclaw/src/plugin-sdk/channel-core.js";
|
|
28
|
+
export { createChatChannelPlugin } from "../../openclaw/src/plugin-sdk/channel-core.js";
|
|
29
|
+
export type {
|
|
30
|
+
ChannelAccountSnapshot,
|
|
31
|
+
ChannelStatusIssue,
|
|
32
|
+
} from "../../openclaw/src/plugin-sdk/status-helpers.js";
|
|
15
33
|
export type { ChannelGatewayContext } from "../../openclaw/src/plugin-sdk/index.js";
|