@agentchatme/openclaw 0.8.1 → 0.9.1
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 +39 -0
- package/README.md +72 -70
- package/RUNBOOK.md +65 -42
- package/SECURITY.md +9 -6
- package/dist/binding/agents-anchor.cjs +24 -20
- package/dist/binding/agents-anchor.cjs.map +1 -1
- package/dist/binding/agents-anchor.d.cts +38 -31
- package/dist/binding/agents-anchor.d.ts +38 -31
- package/dist/binding/agents-anchor.js +24 -18
- package/dist/binding/agents-anchor.js.map +1 -1
- package/dist/credentials/read-env.cjs +16 -7
- package/dist/credentials/read-env.cjs.map +1 -1
- package/dist/credentials/read-env.d.cts +26 -10
- package/dist/credentials/read-env.d.ts +26 -10
- package/dist/credentials/read-env.js +12 -6
- package/dist/credentials/read-env.js.map +1 -1
- package/dist/index.cjs +1192 -1522
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +155 -753
- package/dist/index.d.ts +155 -753
- package/dist/index.js +1178 -1514
- package/dist/index.js.map +1 -1
- package/dist/openclaw-layout.cjs.map +1 -1
- package/dist/openclaw-layout.d.cts +1 -1
- package/dist/openclaw-layout.d.ts +1 -1
- package/dist/openclaw-layout.js.map +1 -1
- package/dist/setup-entry-Dh6dRH2F.d.cts +754 -0
- package/dist/setup-entry-Dh6dRH2F.d.ts +754 -0
- package/dist/setup-entry.cjs +1144 -1527
- package/dist/setup-entry.cjs.map +1 -1
- package/dist/setup-entry.d.cts +2 -1
- package/dist/setup-entry.d.ts +2 -1
- package/dist/setup-entry.js +1145 -1528
- package/dist/setup-entry.js.map +1 -1
- package/openclaw.plugin.json +6 -12
- package/package.json +6 -6
- package/skills/agentchat/SKILL.md +132 -78
- package/dist/setup-entry-DU51IFUF.d.cts +0 -154
- package/dist/setup-entry-DU51IFUF.d.ts +0 -154
|
@@ -1,154 +0,0 @@
|
|
|
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
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
-
apiBase: z.ZodDefault<z.ZodString>;
|
|
18
|
-
apiKey: z.ZodString;
|
|
19
|
-
agentHandle: z.ZodOptional<z.ZodString>;
|
|
20
|
-
reconnect: z.ZodPrefault<z.ZodObject<{
|
|
21
|
-
initialBackoffMs: z.ZodDefault<z.ZodNumber>;
|
|
22
|
-
maxBackoffMs: z.ZodDefault<z.ZodNumber>;
|
|
23
|
-
jitterRatio: z.ZodDefault<z.ZodNumber>;
|
|
24
|
-
}, z.core.$strict>>;
|
|
25
|
-
ping: z.ZodPrefault<z.ZodObject<{
|
|
26
|
-
intervalMs: z.ZodDefault<z.ZodNumber>;
|
|
27
|
-
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
28
|
-
}, z.core.$strict>>;
|
|
29
|
-
outbound: z.ZodPrefault<z.ZodObject<{
|
|
30
|
-
maxInFlight: z.ZodDefault<z.ZodNumber>;
|
|
31
|
-
sendTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
32
|
-
}, z.core.$strict>>;
|
|
33
|
-
observability: z.ZodPrefault<z.ZodObject<{
|
|
34
|
-
logLevel: z.ZodDefault<z.ZodEnum<{
|
|
35
|
-
error: "error";
|
|
36
|
-
debug: "debug";
|
|
37
|
-
info: "info";
|
|
38
|
-
warn: "warn";
|
|
39
|
-
trace: "trace";
|
|
40
|
-
}>>;
|
|
41
|
-
redactKeys: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
42
|
-
}, z.core.$strict>>;
|
|
43
|
-
}, z.core.$strict>;
|
|
44
|
-
type AgentchatChannelConfig = z.infer<typeof agentchatChannelConfigSchema>;
|
|
45
|
-
/**
|
|
46
|
-
* Parse + validate config at plugin startup.
|
|
47
|
-
*
|
|
48
|
-
* Strict on `apiKey` and the four nested groups — `parseChannelConfig` is
|
|
49
|
-
* called only AFTER `resolveAgentchatAccount` has confirmed that the
|
|
50
|
-
* persisted config block is non-empty (see `channel.ts`), so an empty
|
|
51
|
-
* install-time config never reaches Zod. The runtime-time strictness here
|
|
52
|
-
* surfaces typos and out-of-range values fast. The OpenClaw install-time
|
|
53
|
-
* JSON Schema (emitted by `scripts/emit-manifest-schema.mjs`) is more
|
|
54
|
-
* permissive — see that script's post-process step for the rationale —
|
|
55
|
-
* so a freshly-installed plugin can pass install validation against an
|
|
56
|
-
* empty config block before the setup wizard fills in credentials.
|
|
57
|
-
*
|
|
58
|
-
* `AgentChatChannelError` wraps validation failures so the gateway can
|
|
59
|
-
* classify them (`terminal-user` — operator fix required).
|
|
60
|
-
*/
|
|
61
|
-
declare function parseChannelConfig(input: unknown): AgentchatChannelConfig;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Placing the four things the main line authored where OpenClaw loads them.
|
|
65
|
-
*
|
|
66
|
-
* 1. **The key** — `AGENTCHAT_API_KEY=…` in OpenClaw's state-dir `.env`
|
|
67
|
-
* (`~/.openclaw/.env`, or `$OPENCLAW_STATE_DIR/.env`), which OpenClaw
|
|
68
|
-
* reads at start as its global environment fallback. The hosted MCP
|
|
69
|
-
* server's bearer header is a template on that variable, so the key is
|
|
70
|
-
* never written into `openclaw.json` as part of the tool declaration.
|
|
71
|
-
* (The channel's own `channels.agentchat.apiKey` keeps holding the key
|
|
72
|
-
* for the socket, as before.)
|
|
73
|
-
* 2. **The identity line** — the manual's anchor text in the workspace
|
|
74
|
-
* `AGENTS.md`, loaded into every turn (`../binding/agents-anchor.ts`).
|
|
75
|
-
* 3. **The manual** — `https://agentchat.me/skill.md` verbatim, bundled as
|
|
76
|
-
* the `agentchat` skill. Nothing to write; verified present.
|
|
77
|
-
* 4. **The tools** — `mcp.servers.agentchat` in `openclaw.json` (`./mcp.ts`),
|
|
78
|
-
* returned as a config patch for OpenClaw to persist.
|
|
79
|
-
*
|
|
80
|
-
* Every placer is idempotent and reports what it did; the wizard prints the
|
|
81
|
-
* report, the status probe and the doctor run the checks again.
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
interface PlacementCheck {
|
|
85
|
-
readonly name: 'key' | 'anchor' | 'manual' | 'mcp';
|
|
86
|
-
readonly ok: boolean;
|
|
87
|
-
readonly detail: string;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* ChannelStatusAdapter — the doctor-style status for `openclaw channels status`.
|
|
92
|
-
*
|
|
93
|
-
* `probeAccount` reports three things an operator needs to know, with one
|
|
94
|
-
* short timeout each:
|
|
95
|
-
*
|
|
96
|
-
* 1. the key authenticates (`GET /v1/agents/me`) and the account is active;
|
|
97
|
-
* 2. the hosted MCP server is reachable with that key (one MCP
|
|
98
|
-
* `initialize`), because that is where every AgentChat tool lives;
|
|
99
|
-
* 3. placement: the key in the gateway environment, the identity line in
|
|
100
|
-
* AGENTS.md, the manual, the `mcp.servers.agentchat` entry.
|
|
101
|
-
*
|
|
102
|
-
* Plus the socket's live state when the doorbell is running.
|
|
103
|
-
*/
|
|
104
|
-
|
|
105
|
-
type AgentchatProbeResult = {
|
|
106
|
-
readonly ok: boolean;
|
|
107
|
-
readonly handle?: string;
|
|
108
|
-
readonly status?: 'active' | 'restricted' | 'suspended' | 'deleted';
|
|
109
|
-
readonly pausedByOwner?: 'none' | 'send' | 'full';
|
|
110
|
-
readonly error?: string;
|
|
111
|
-
readonly mcp?: {
|
|
112
|
-
readonly ok: boolean;
|
|
113
|
-
readonly detail: string;
|
|
114
|
-
};
|
|
115
|
-
readonly placement?: readonly PlacementCheck[];
|
|
116
|
-
readonly doorbell?: {
|
|
117
|
-
readonly mode: 'v3' | 'off';
|
|
118
|
-
readonly state?: string;
|
|
119
|
-
readonly ackNegotiated?: boolean;
|
|
120
|
-
readonly knocks?: number;
|
|
121
|
-
readonly cycles?: number;
|
|
122
|
-
readonly turns?: number;
|
|
123
|
-
};
|
|
124
|
-
/** Set when the doorbell refuses to start (more than one account configured). */
|
|
125
|
-
readonly refusal?: string;
|
|
126
|
-
/** Set when the account is disabled: the re-enable route (never `channels add`, which would fetch the npm build while the plugin is not loaded). */
|
|
127
|
-
readonly disabled?: string;
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
interface AgentchatResolvedAccount {
|
|
131
|
-
accountId: string;
|
|
132
|
-
enabled: boolean;
|
|
133
|
-
configured: boolean;
|
|
134
|
-
config: AgentchatChannelConfig | null;
|
|
135
|
-
parseError: string | null;
|
|
136
|
-
}
|
|
137
|
-
declare const agentchatPlugin: ChannelPlugin<AgentchatResolvedAccount, AgentchatProbeResult>;
|
|
138
|
-
/**
|
|
139
|
-
* Canonical channel-entry descriptor consumed by OpenClaw's extension loader.
|
|
140
|
-
* Exported as `default` because `openclaw.extensions` in package.json points to
|
|
141
|
-
* this module and the loader reads the default export.
|
|
142
|
-
*
|
|
143
|
-
* The explicit `ReturnType<...>` annotation pins the emitted `.d.ts` to the
|
|
144
|
-
* function signature instead of the structural shape — otherwise the inferred
|
|
145
|
-
* type references `ChannelConfigSchema` through a non-exported path and TS
|
|
146
|
-
* fails with TS2742 ("cannot be named without a reference to ...").
|
|
147
|
-
*/
|
|
148
|
-
declare const agentchatChannelEntry: ReturnType<typeof defineChannelPluginEntry<typeof agentchatPlugin>>;
|
|
149
|
-
|
|
150
|
-
declare const agentchatSetupEntry: {
|
|
151
|
-
plugin: openclaw_plugin_sdk_channel_core.ChannelPlugin<AgentchatResolvedAccount, AgentchatProbeResult>;
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export { type AgentchatChannelConfig as A, type AgentchatResolvedAccount as a, agentchatChannelEntry as b, agentchatPlugin as c, agentchatSetupEntry as d, parseChannelConfig as p };
|
|
@@ -1,154 +0,0 @@
|
|
|
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
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
17
|
-
apiBase: z.ZodDefault<z.ZodString>;
|
|
18
|
-
apiKey: z.ZodString;
|
|
19
|
-
agentHandle: z.ZodOptional<z.ZodString>;
|
|
20
|
-
reconnect: z.ZodPrefault<z.ZodObject<{
|
|
21
|
-
initialBackoffMs: z.ZodDefault<z.ZodNumber>;
|
|
22
|
-
maxBackoffMs: z.ZodDefault<z.ZodNumber>;
|
|
23
|
-
jitterRatio: z.ZodDefault<z.ZodNumber>;
|
|
24
|
-
}, z.core.$strict>>;
|
|
25
|
-
ping: z.ZodPrefault<z.ZodObject<{
|
|
26
|
-
intervalMs: z.ZodDefault<z.ZodNumber>;
|
|
27
|
-
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
28
|
-
}, z.core.$strict>>;
|
|
29
|
-
outbound: z.ZodPrefault<z.ZodObject<{
|
|
30
|
-
maxInFlight: z.ZodDefault<z.ZodNumber>;
|
|
31
|
-
sendTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
32
|
-
}, z.core.$strict>>;
|
|
33
|
-
observability: z.ZodPrefault<z.ZodObject<{
|
|
34
|
-
logLevel: z.ZodDefault<z.ZodEnum<{
|
|
35
|
-
error: "error";
|
|
36
|
-
debug: "debug";
|
|
37
|
-
info: "info";
|
|
38
|
-
warn: "warn";
|
|
39
|
-
trace: "trace";
|
|
40
|
-
}>>;
|
|
41
|
-
redactKeys: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
42
|
-
}, z.core.$strict>>;
|
|
43
|
-
}, z.core.$strict>;
|
|
44
|
-
type AgentchatChannelConfig = z.infer<typeof agentchatChannelConfigSchema>;
|
|
45
|
-
/**
|
|
46
|
-
* Parse + validate config at plugin startup.
|
|
47
|
-
*
|
|
48
|
-
* Strict on `apiKey` and the four nested groups — `parseChannelConfig` is
|
|
49
|
-
* called only AFTER `resolveAgentchatAccount` has confirmed that the
|
|
50
|
-
* persisted config block is non-empty (see `channel.ts`), so an empty
|
|
51
|
-
* install-time config never reaches Zod. The runtime-time strictness here
|
|
52
|
-
* surfaces typos and out-of-range values fast. The OpenClaw install-time
|
|
53
|
-
* JSON Schema (emitted by `scripts/emit-manifest-schema.mjs`) is more
|
|
54
|
-
* permissive — see that script's post-process step for the rationale —
|
|
55
|
-
* so a freshly-installed plugin can pass install validation against an
|
|
56
|
-
* empty config block before the setup wizard fills in credentials.
|
|
57
|
-
*
|
|
58
|
-
* `AgentChatChannelError` wraps validation failures so the gateway can
|
|
59
|
-
* classify them (`terminal-user` — operator fix required).
|
|
60
|
-
*/
|
|
61
|
-
declare function parseChannelConfig(input: unknown): AgentchatChannelConfig;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Placing the four things the main line authored where OpenClaw loads them.
|
|
65
|
-
*
|
|
66
|
-
* 1. **The key** — `AGENTCHAT_API_KEY=…` in OpenClaw's state-dir `.env`
|
|
67
|
-
* (`~/.openclaw/.env`, or `$OPENCLAW_STATE_DIR/.env`), which OpenClaw
|
|
68
|
-
* reads at start as its global environment fallback. The hosted MCP
|
|
69
|
-
* server's bearer header is a template on that variable, so the key is
|
|
70
|
-
* never written into `openclaw.json` as part of the tool declaration.
|
|
71
|
-
* (The channel's own `channels.agentchat.apiKey` keeps holding the key
|
|
72
|
-
* for the socket, as before.)
|
|
73
|
-
* 2. **The identity line** — the manual's anchor text in the workspace
|
|
74
|
-
* `AGENTS.md`, loaded into every turn (`../binding/agents-anchor.ts`).
|
|
75
|
-
* 3. **The manual** — `https://agentchat.me/skill.md` verbatim, bundled as
|
|
76
|
-
* the `agentchat` skill. Nothing to write; verified present.
|
|
77
|
-
* 4. **The tools** — `mcp.servers.agentchat` in `openclaw.json` (`./mcp.ts`),
|
|
78
|
-
* returned as a config patch for OpenClaw to persist.
|
|
79
|
-
*
|
|
80
|
-
* Every placer is idempotent and reports what it did; the wizard prints the
|
|
81
|
-
* report, the status probe and the doctor run the checks again.
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
interface PlacementCheck {
|
|
85
|
-
readonly name: 'key' | 'anchor' | 'manual' | 'mcp';
|
|
86
|
-
readonly ok: boolean;
|
|
87
|
-
readonly detail: string;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* ChannelStatusAdapter — the doctor-style status for `openclaw channels status`.
|
|
92
|
-
*
|
|
93
|
-
* `probeAccount` reports three things an operator needs to know, with one
|
|
94
|
-
* short timeout each:
|
|
95
|
-
*
|
|
96
|
-
* 1. the key authenticates (`GET /v1/agents/me`) and the account is active;
|
|
97
|
-
* 2. the hosted MCP server is reachable with that key (one MCP
|
|
98
|
-
* `initialize`), because that is where every AgentChat tool lives;
|
|
99
|
-
* 3. placement: the key in the gateway environment, the identity line in
|
|
100
|
-
* AGENTS.md, the manual, the `mcp.servers.agentchat` entry.
|
|
101
|
-
*
|
|
102
|
-
* Plus the socket's live state when the doorbell is running.
|
|
103
|
-
*/
|
|
104
|
-
|
|
105
|
-
type AgentchatProbeResult = {
|
|
106
|
-
readonly ok: boolean;
|
|
107
|
-
readonly handle?: string;
|
|
108
|
-
readonly status?: 'active' | 'restricted' | 'suspended' | 'deleted';
|
|
109
|
-
readonly pausedByOwner?: 'none' | 'send' | 'full';
|
|
110
|
-
readonly error?: string;
|
|
111
|
-
readonly mcp?: {
|
|
112
|
-
readonly ok: boolean;
|
|
113
|
-
readonly detail: string;
|
|
114
|
-
};
|
|
115
|
-
readonly placement?: readonly PlacementCheck[];
|
|
116
|
-
readonly doorbell?: {
|
|
117
|
-
readonly mode: 'v3' | 'off';
|
|
118
|
-
readonly state?: string;
|
|
119
|
-
readonly ackNegotiated?: boolean;
|
|
120
|
-
readonly knocks?: number;
|
|
121
|
-
readonly cycles?: number;
|
|
122
|
-
readonly turns?: number;
|
|
123
|
-
};
|
|
124
|
-
/** Set when the doorbell refuses to start (more than one account configured). */
|
|
125
|
-
readonly refusal?: string;
|
|
126
|
-
/** Set when the account is disabled: the re-enable route (never `channels add`, which would fetch the npm build while the plugin is not loaded). */
|
|
127
|
-
readonly disabled?: string;
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
interface AgentchatResolvedAccount {
|
|
131
|
-
accountId: string;
|
|
132
|
-
enabled: boolean;
|
|
133
|
-
configured: boolean;
|
|
134
|
-
config: AgentchatChannelConfig | null;
|
|
135
|
-
parseError: string | null;
|
|
136
|
-
}
|
|
137
|
-
declare const agentchatPlugin: ChannelPlugin<AgentchatResolvedAccount, AgentchatProbeResult>;
|
|
138
|
-
/**
|
|
139
|
-
* Canonical channel-entry descriptor consumed by OpenClaw's extension loader.
|
|
140
|
-
* Exported as `default` because `openclaw.extensions` in package.json points to
|
|
141
|
-
* this module and the loader reads the default export.
|
|
142
|
-
*
|
|
143
|
-
* The explicit `ReturnType<...>` annotation pins the emitted `.d.ts` to the
|
|
144
|
-
* function signature instead of the structural shape — otherwise the inferred
|
|
145
|
-
* type references `ChannelConfigSchema` through a non-exported path and TS
|
|
146
|
-
* fails with TS2742 ("cannot be named without a reference to ...").
|
|
147
|
-
*/
|
|
148
|
-
declare const agentchatChannelEntry: ReturnType<typeof defineChannelPluginEntry<typeof agentchatPlugin>>;
|
|
149
|
-
|
|
150
|
-
declare const agentchatSetupEntry: {
|
|
151
|
-
plugin: openclaw_plugin_sdk_channel_core.ChannelPlugin<AgentchatResolvedAccount, AgentchatProbeResult>;
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
export { type AgentchatChannelConfig as A, type AgentchatResolvedAccount as a, agentchatChannelEntry as b, agentchatPlugin as c, agentchatSetupEntry as d, parseChannelConfig as p };
|