@agentchatme/openclaw 0.2.0
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/CHANGELOG.md +75 -0
- package/LICENSE +21 -0
- package/README.md +233 -0
- package/RUNBOOK.md +134 -0
- package/SECURITY.md +57 -0
- package/dist/configured-state.cjs +12 -0
- package/dist/configured-state.cjs.map +1 -0
- package/dist/configured-state.d.cts +14 -0
- package/dist/configured-state.d.ts +14 -0
- package/dist/configured-state.js +10 -0
- package/dist/configured-state.js.map +1 -0
- package/dist/index.cjs +2412 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +756 -0
- package/dist/index.d.ts +756 -0
- package/dist/index.js +2389 -0
- package/dist/index.js.map +1 -0
- package/dist/setup-entry-CU0vHfyd.d.cts +96 -0
- package/dist/setup-entry-CU0vHfyd.d.ts +96 -0
- package/dist/setup-entry.cjs +920 -0
- package/dist/setup-entry.cjs.map +1 -0
- package/dist/setup-entry.d.cts +3 -0
- package/dist/setup-entry.d.ts +3 -0
- package/dist/setup-entry.js +914 -0
- package/dist/setup-entry.js.map +1 -0
- package/openclaw.plugin.json +187 -0
- package/package.json +129 -0
- package/skills/agentchat/SKILL.md +142 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as openclaw_plugin_sdk_channel_core from 'openclaw/plugin-sdk/channel-core';
|
|
2
|
+
import { defineChannelPluginEntry, ChannelPlugin } from 'openclaw/plugin-sdk/channel-core';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Zod schema for AgentChat channel config.
|
|
7
|
+
*
|
|
8
|
+
* Source of truth: this file. The JSON Schema inlined in `openclaw.plugin.json`
|
|
9
|
+
* MUST stay in sync (P1 adds a build step that emits it via zod-to-json-schema).
|
|
10
|
+
*
|
|
11
|
+
* `.strict()` rejects unknown keys — a common source of "the config silently
|
|
12
|
+
* ignored my setting" bugs.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
declare const agentchatChannelConfigSchema: z.ZodObject<{
|
|
16
|
+
apiBase: z.ZodDefault<z.ZodString>;
|
|
17
|
+
apiKey: z.ZodString;
|
|
18
|
+
agentHandle: z.ZodOptional<z.ZodString>;
|
|
19
|
+
reconnect: z.ZodPrefault<z.ZodObject<{
|
|
20
|
+
initialBackoffMs: z.ZodDefault<z.ZodNumber>;
|
|
21
|
+
maxBackoffMs: z.ZodDefault<z.ZodNumber>;
|
|
22
|
+
jitterRatio: z.ZodDefault<z.ZodNumber>;
|
|
23
|
+
}, z.core.$strict>>;
|
|
24
|
+
ping: z.ZodPrefault<z.ZodObject<{
|
|
25
|
+
intervalMs: z.ZodDefault<z.ZodNumber>;
|
|
26
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
27
|
+
}, z.core.$strict>>;
|
|
28
|
+
outbound: z.ZodPrefault<z.ZodObject<{
|
|
29
|
+
maxInFlight: z.ZodDefault<z.ZodNumber>;
|
|
30
|
+
sendTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
31
|
+
}, z.core.$strict>>;
|
|
32
|
+
observability: z.ZodPrefault<z.ZodObject<{
|
|
33
|
+
logLevel: z.ZodDefault<z.ZodEnum<{
|
|
34
|
+
error: "error";
|
|
35
|
+
trace: "trace";
|
|
36
|
+
debug: "debug";
|
|
37
|
+
info: "info";
|
|
38
|
+
warn: "warn";
|
|
39
|
+
}>>;
|
|
40
|
+
redactKeys: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
41
|
+
}, z.core.$strict>>;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
type AgentchatChannelConfig = z.infer<typeof agentchatChannelConfigSchema>;
|
|
44
|
+
/**
|
|
45
|
+
* Parse + validate config at plugin startup.
|
|
46
|
+
*
|
|
47
|
+
* Fails fast on invalid config rather than waiting until the first request.
|
|
48
|
+
* The `AgentChatChannelError` wrapper makes validation failures classifiable
|
|
49
|
+
* by the gateway's error handler (`terminal-user` — operator fix required).
|
|
50
|
+
*/
|
|
51
|
+
declare function parseChannelConfig(input: unknown): AgentchatChannelConfig;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* AgentChat channel plugin — entry point.
|
|
55
|
+
*
|
|
56
|
+
* P1 (this file): wires the real OpenClaw SDK contracts — builds a
|
|
57
|
+
* `ChannelPlugin<AgentchatResolvedAccount>` with id / meta / capabilities /
|
|
58
|
+
* config-adapter / config-schema / setup, and wraps it via
|
|
59
|
+
* `defineChannelPluginEntry(...)` for OpenClaw's extension loader.
|
|
60
|
+
*
|
|
61
|
+
* Config adapter supports both:
|
|
62
|
+
* - single-account flat form: `channels.agentchat.{ apiKey, apiBase, ... }`
|
|
63
|
+
* - multi-account form: `channels.agentchat.accounts.<id>.{ apiKey, ... }`
|
|
64
|
+
*
|
|
65
|
+
* Runtime (WS client, inbound normalizer, outbound adapter) arrives in P2+.
|
|
66
|
+
*
|
|
67
|
+
* Loaded by OpenClaw via `package.json`'s `openclaw.extensions` entry.
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
declare const AGENTCHAT_CHANNEL_ID: "agentchat";
|
|
71
|
+
declare const AGENTCHAT_DEFAULT_ACCOUNT_ID = "default";
|
|
72
|
+
interface AgentchatResolvedAccount {
|
|
73
|
+
accountId: string;
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
configured: boolean;
|
|
76
|
+
config: AgentchatChannelConfig | null;
|
|
77
|
+
parseError: string | null;
|
|
78
|
+
}
|
|
79
|
+
declare const agentchatPlugin: ChannelPlugin<AgentchatResolvedAccount>;
|
|
80
|
+
/**
|
|
81
|
+
* Canonical channel-entry descriptor consumed by OpenClaw's extension loader.
|
|
82
|
+
* Exported as `default` because `openclaw.extensions` in package.json points to
|
|
83
|
+
* this module and the loader reads the default export.
|
|
84
|
+
*
|
|
85
|
+
* The explicit `ReturnType<...>` annotation pins the emitted `.d.ts` to the
|
|
86
|
+
* function signature instead of the structural shape — otherwise the inferred
|
|
87
|
+
* type references `ChannelConfigSchema` through a non-exported path and TS
|
|
88
|
+
* fails with TS2742 ("cannot be named without a reference to ...").
|
|
89
|
+
*/
|
|
90
|
+
declare const agentchatChannelEntry: ReturnType<typeof defineChannelPluginEntry<typeof agentchatPlugin>>;
|
|
91
|
+
|
|
92
|
+
declare const agentchatSetupEntry: {
|
|
93
|
+
plugin: openclaw_plugin_sdk_channel_core.ChannelPlugin<AgentchatResolvedAccount>;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export { type AgentchatChannelConfig as A, AGENTCHAT_CHANNEL_ID as a, AGENTCHAT_DEFAULT_ACCOUNT_ID as b, type AgentchatResolvedAccount as c, agentchatChannelEntry as d, agentchatPlugin as e, agentchatSetupEntry as f, parseChannelConfig as p };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as openclaw_plugin_sdk_channel_core from 'openclaw/plugin-sdk/channel-core';
|
|
2
|
+
import { defineChannelPluginEntry, ChannelPlugin } from 'openclaw/plugin-sdk/channel-core';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Zod schema for AgentChat channel config.
|
|
7
|
+
*
|
|
8
|
+
* Source of truth: this file. The JSON Schema inlined in `openclaw.plugin.json`
|
|
9
|
+
* MUST stay in sync (P1 adds a build step that emits it via zod-to-json-schema).
|
|
10
|
+
*
|
|
11
|
+
* `.strict()` rejects unknown keys — a common source of "the config silently
|
|
12
|
+
* ignored my setting" bugs.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
declare const agentchatChannelConfigSchema: z.ZodObject<{
|
|
16
|
+
apiBase: z.ZodDefault<z.ZodString>;
|
|
17
|
+
apiKey: z.ZodString;
|
|
18
|
+
agentHandle: z.ZodOptional<z.ZodString>;
|
|
19
|
+
reconnect: z.ZodPrefault<z.ZodObject<{
|
|
20
|
+
initialBackoffMs: z.ZodDefault<z.ZodNumber>;
|
|
21
|
+
maxBackoffMs: z.ZodDefault<z.ZodNumber>;
|
|
22
|
+
jitterRatio: z.ZodDefault<z.ZodNumber>;
|
|
23
|
+
}, z.core.$strict>>;
|
|
24
|
+
ping: z.ZodPrefault<z.ZodObject<{
|
|
25
|
+
intervalMs: z.ZodDefault<z.ZodNumber>;
|
|
26
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
27
|
+
}, z.core.$strict>>;
|
|
28
|
+
outbound: z.ZodPrefault<z.ZodObject<{
|
|
29
|
+
maxInFlight: z.ZodDefault<z.ZodNumber>;
|
|
30
|
+
sendTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
31
|
+
}, z.core.$strict>>;
|
|
32
|
+
observability: z.ZodPrefault<z.ZodObject<{
|
|
33
|
+
logLevel: z.ZodDefault<z.ZodEnum<{
|
|
34
|
+
error: "error";
|
|
35
|
+
trace: "trace";
|
|
36
|
+
debug: "debug";
|
|
37
|
+
info: "info";
|
|
38
|
+
warn: "warn";
|
|
39
|
+
}>>;
|
|
40
|
+
redactKeys: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
41
|
+
}, z.core.$strict>>;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
type AgentchatChannelConfig = z.infer<typeof agentchatChannelConfigSchema>;
|
|
44
|
+
/**
|
|
45
|
+
* Parse + validate config at plugin startup.
|
|
46
|
+
*
|
|
47
|
+
* Fails fast on invalid config rather than waiting until the first request.
|
|
48
|
+
* The `AgentChatChannelError` wrapper makes validation failures classifiable
|
|
49
|
+
* by the gateway's error handler (`terminal-user` — operator fix required).
|
|
50
|
+
*/
|
|
51
|
+
declare function parseChannelConfig(input: unknown): AgentchatChannelConfig;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* AgentChat channel plugin — entry point.
|
|
55
|
+
*
|
|
56
|
+
* P1 (this file): wires the real OpenClaw SDK contracts — builds a
|
|
57
|
+
* `ChannelPlugin<AgentchatResolvedAccount>` with id / meta / capabilities /
|
|
58
|
+
* config-adapter / config-schema / setup, and wraps it via
|
|
59
|
+
* `defineChannelPluginEntry(...)` for OpenClaw's extension loader.
|
|
60
|
+
*
|
|
61
|
+
* Config adapter supports both:
|
|
62
|
+
* - single-account flat form: `channels.agentchat.{ apiKey, apiBase, ... }`
|
|
63
|
+
* - multi-account form: `channels.agentchat.accounts.<id>.{ apiKey, ... }`
|
|
64
|
+
*
|
|
65
|
+
* Runtime (WS client, inbound normalizer, outbound adapter) arrives in P2+.
|
|
66
|
+
*
|
|
67
|
+
* Loaded by OpenClaw via `package.json`'s `openclaw.extensions` entry.
|
|
68
|
+
*/
|
|
69
|
+
|
|
70
|
+
declare const AGENTCHAT_CHANNEL_ID: "agentchat";
|
|
71
|
+
declare const AGENTCHAT_DEFAULT_ACCOUNT_ID = "default";
|
|
72
|
+
interface AgentchatResolvedAccount {
|
|
73
|
+
accountId: string;
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
configured: boolean;
|
|
76
|
+
config: AgentchatChannelConfig | null;
|
|
77
|
+
parseError: string | null;
|
|
78
|
+
}
|
|
79
|
+
declare const agentchatPlugin: ChannelPlugin<AgentchatResolvedAccount>;
|
|
80
|
+
/**
|
|
81
|
+
* Canonical channel-entry descriptor consumed by OpenClaw's extension loader.
|
|
82
|
+
* Exported as `default` because `openclaw.extensions` in package.json points to
|
|
83
|
+
* this module and the loader reads the default export.
|
|
84
|
+
*
|
|
85
|
+
* The explicit `ReturnType<...>` annotation pins the emitted `.d.ts` to the
|
|
86
|
+
* function signature instead of the structural shape — otherwise the inferred
|
|
87
|
+
* type references `ChannelConfigSchema` through a non-exported path and TS
|
|
88
|
+
* fails with TS2742 ("cannot be named without a reference to ...").
|
|
89
|
+
*/
|
|
90
|
+
declare const agentchatChannelEntry: ReturnType<typeof defineChannelPluginEntry<typeof agentchatPlugin>>;
|
|
91
|
+
|
|
92
|
+
declare const agentchatSetupEntry: {
|
|
93
|
+
plugin: openclaw_plugin_sdk_channel_core.ChannelPlugin<AgentchatResolvedAccount>;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export { type AgentchatChannelConfig as A, AGENTCHAT_CHANNEL_ID as a, AGENTCHAT_DEFAULT_ACCOUNT_ID as b, type AgentchatResolvedAccount as c, agentchatChannelEntry as d, agentchatPlugin as e, agentchatSetupEntry as f, parseChannelConfig as p };
|