@agentchatme/openclaw 0.6.11 → 0.6.12
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 +4 -0
- package/dist/binding/agents-anchor.cjs +1 -1
- package/dist/binding/agents-anchor.d.cts +104 -0
- package/dist/binding/agents-anchor.d.ts +104 -0
- package/dist/configured-state.d.cts +20 -0
- package/dist/configured-state.d.ts +20 -0
- package/dist/credentials/read-env.d.cts +33 -0
- package/dist/credentials/read-env.d.ts +33 -0
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +759 -0
- package/dist/index.d.ts +759 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/setup-entry-Dtj6vwDY.d.cts +104 -0
- package/dist/setup-entry-Dtj6vwDY.d.ts +104 -0
- package/dist/setup-entry.cjs +5 -5
- package/dist/setup-entry.cjs.map +1 -1
- package/dist/setup-entry.d.cts +3 -0
- package/dist/setup-entry.d.ts +3 -0
- package/dist/setup-entry.js +3 -3
- package/dist/setup-entry.js.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
warn: "warn";
|
|
35
|
+
error: "error";
|
|
36
|
+
trace: "trace";
|
|
37
|
+
debug: "debug";
|
|
38
|
+
info: "info";
|
|
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
|
+
* Strict on `apiKey` and the four nested groups — `parseChannelConfig` is
|
|
48
|
+
* called only AFTER `resolveAgentchatAccount` has confirmed that the
|
|
49
|
+
* persisted config block is non-empty (see `channel.ts`), so an empty
|
|
50
|
+
* install-time config never reaches Zod. The runtime-time strictness here
|
|
51
|
+
* surfaces typos and out-of-range values fast. The OpenClaw install-time
|
|
52
|
+
* JSON Schema (emitted by `scripts/emit-manifest-schema.mjs`) is more
|
|
53
|
+
* permissive — see that script's post-process step for the rationale —
|
|
54
|
+
* so a freshly-installed plugin can pass install validation against an
|
|
55
|
+
* empty config block before the setup wizard fills in credentials.
|
|
56
|
+
*
|
|
57
|
+
* `AgentChatChannelError` wraps validation failures so the gateway can
|
|
58
|
+
* classify them (`terminal-user` — operator fix required).
|
|
59
|
+
*/
|
|
60
|
+
declare function parseChannelConfig(input: unknown): AgentchatChannelConfig;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* ChannelStatusAdapter — account health + configured-state probe.
|
|
64
|
+
*
|
|
65
|
+
* `probeAccount` hits `/v1/agents/me` with a short timeout and reports
|
|
66
|
+
* whether the configured key still authenticates and whether the account
|
|
67
|
+
* is active / restricted / suspended. The gateway uses this to surface a
|
|
68
|
+
* red/yellow/green status in `openclaw channels status` and to decide when
|
|
69
|
+
* to page an operator for stuck accounts.
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
type AgentchatProbeResult = {
|
|
73
|
+
readonly ok: boolean;
|
|
74
|
+
readonly handle?: string;
|
|
75
|
+
readonly status?: 'active' | 'restricted' | 'suspended' | 'deleted';
|
|
76
|
+
readonly pausedByOwner?: 'none' | 'send' | 'full';
|
|
77
|
+
readonly error?: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
interface AgentchatResolvedAccount {
|
|
81
|
+
accountId: string;
|
|
82
|
+
enabled: boolean;
|
|
83
|
+
configured: boolean;
|
|
84
|
+
config: AgentchatChannelConfig | null;
|
|
85
|
+
parseError: string | null;
|
|
86
|
+
}
|
|
87
|
+
declare const agentchatPlugin: ChannelPlugin<AgentchatResolvedAccount, AgentchatProbeResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Canonical channel-entry descriptor consumed by OpenClaw's extension loader.
|
|
90
|
+
* Exported as `default` because `openclaw.extensions` in package.json points to
|
|
91
|
+
* this module and the loader reads the default export.
|
|
92
|
+
*
|
|
93
|
+
* The explicit `ReturnType<...>` annotation pins the emitted `.d.ts` to the
|
|
94
|
+
* function signature instead of the structural shape — otherwise the inferred
|
|
95
|
+
* type references `ChannelConfigSchema` through a non-exported path and TS
|
|
96
|
+
* fails with TS2742 ("cannot be named without a reference to ...").
|
|
97
|
+
*/
|
|
98
|
+
declare const agentchatChannelEntry: ReturnType<typeof defineChannelPluginEntry<typeof agentchatPlugin>>;
|
|
99
|
+
|
|
100
|
+
declare const agentchatSetupEntry: {
|
|
101
|
+
plugin: openclaw_plugin_sdk_channel_core.ChannelPlugin<AgentchatResolvedAccount, AgentchatProbeResult>;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { type AgentchatChannelConfig as A, type AgentchatResolvedAccount as a, agentchatChannelEntry as b, agentchatPlugin as c, agentchatSetupEntry as d, parseChannelConfig as p };
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
warn: "warn";
|
|
35
|
+
error: "error";
|
|
36
|
+
trace: "trace";
|
|
37
|
+
debug: "debug";
|
|
38
|
+
info: "info";
|
|
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
|
+
* Strict on `apiKey` and the four nested groups — `parseChannelConfig` is
|
|
48
|
+
* called only AFTER `resolveAgentchatAccount` has confirmed that the
|
|
49
|
+
* persisted config block is non-empty (see `channel.ts`), so an empty
|
|
50
|
+
* install-time config never reaches Zod. The runtime-time strictness here
|
|
51
|
+
* surfaces typos and out-of-range values fast. The OpenClaw install-time
|
|
52
|
+
* JSON Schema (emitted by `scripts/emit-manifest-schema.mjs`) is more
|
|
53
|
+
* permissive — see that script's post-process step for the rationale —
|
|
54
|
+
* so a freshly-installed plugin can pass install validation against an
|
|
55
|
+
* empty config block before the setup wizard fills in credentials.
|
|
56
|
+
*
|
|
57
|
+
* `AgentChatChannelError` wraps validation failures so the gateway can
|
|
58
|
+
* classify them (`terminal-user` — operator fix required).
|
|
59
|
+
*/
|
|
60
|
+
declare function parseChannelConfig(input: unknown): AgentchatChannelConfig;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* ChannelStatusAdapter — account health + configured-state probe.
|
|
64
|
+
*
|
|
65
|
+
* `probeAccount` hits `/v1/agents/me` with a short timeout and reports
|
|
66
|
+
* whether the configured key still authenticates and whether the account
|
|
67
|
+
* is active / restricted / suspended. The gateway uses this to surface a
|
|
68
|
+
* red/yellow/green status in `openclaw channels status` and to decide when
|
|
69
|
+
* to page an operator for stuck accounts.
|
|
70
|
+
*/
|
|
71
|
+
|
|
72
|
+
type AgentchatProbeResult = {
|
|
73
|
+
readonly ok: boolean;
|
|
74
|
+
readonly handle?: string;
|
|
75
|
+
readonly status?: 'active' | 'restricted' | 'suspended' | 'deleted';
|
|
76
|
+
readonly pausedByOwner?: 'none' | 'send' | 'full';
|
|
77
|
+
readonly error?: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
interface AgentchatResolvedAccount {
|
|
81
|
+
accountId: string;
|
|
82
|
+
enabled: boolean;
|
|
83
|
+
configured: boolean;
|
|
84
|
+
config: AgentchatChannelConfig | null;
|
|
85
|
+
parseError: string | null;
|
|
86
|
+
}
|
|
87
|
+
declare const agentchatPlugin: ChannelPlugin<AgentchatResolvedAccount, AgentchatProbeResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Canonical channel-entry descriptor consumed by OpenClaw's extension loader.
|
|
90
|
+
* Exported as `default` because `openclaw.extensions` in package.json points to
|
|
91
|
+
* this module and the loader reads the default export.
|
|
92
|
+
*
|
|
93
|
+
* The explicit `ReturnType<...>` annotation pins the emitted `.d.ts` to the
|
|
94
|
+
* function signature instead of the structural shape — otherwise the inferred
|
|
95
|
+
* type references `ChannelConfigSchema` through a non-exported path and TS
|
|
96
|
+
* fails with TS2742 ("cannot be named without a reference to ...").
|
|
97
|
+
*/
|
|
98
|
+
declare const agentchatChannelEntry: ReturnType<typeof defineChannelPluginEntry<typeof agentchatPlugin>>;
|
|
99
|
+
|
|
100
|
+
declare const agentchatSetupEntry: {
|
|
101
|
+
plugin: openclaw_plugin_sdk_channel_core.ChannelPlugin<AgentchatResolvedAccount, AgentchatProbeResult>;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export { type AgentchatChannelConfig as A, type AgentchatResolvedAccount as a, agentchatChannelEntry as b, agentchatPlugin as c, agentchatSetupEntry as d, parseChannelConfig as p };
|
package/dist/setup-entry.cjs
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var channelCore = require('openclaw/plugin-sdk/channel-core');
|
|
6
6
|
var setup = require('openclaw/plugin-sdk/setup');
|
|
7
|
-
var readEnv_js = require('./credentials/read-env.
|
|
8
|
-
var agentsAnchor_js = require('./binding/agents-anchor.
|
|
7
|
+
var readEnv_js = require('./credentials/read-env.cjs');
|
|
8
|
+
var agentsAnchor_js = require('./binding/agents-anchor.cjs');
|
|
9
9
|
var zod = require('zod');
|
|
10
10
|
var pino = require('pino');
|
|
11
11
|
var ws = require('ws');
|
|
@@ -324,8 +324,8 @@ async function promptEmail(prompter) {
|
|
|
324
324
|
}
|
|
325
325
|
async function promptHandle(prompter) {
|
|
326
326
|
return (await prompter.text({
|
|
327
|
-
message: "
|
|
328
|
-
placeholder: "
|
|
327
|
+
message: "Choose a handle (your @name on AgentChat)",
|
|
328
|
+
placeholder: "3\u201330 chars, lowercase a-z, 0-9, hyphens, starts with a letter",
|
|
329
329
|
validate: (value) => {
|
|
330
330
|
const trimmed = value.trim();
|
|
331
331
|
if (!trimmed) return "Handle is required";
|
|
@@ -1853,7 +1853,7 @@ var CircuitBreaker = class {
|
|
|
1853
1853
|
};
|
|
1854
1854
|
|
|
1855
1855
|
// src/version.ts
|
|
1856
|
-
var PACKAGE_VERSION = "0.6.
|
|
1856
|
+
var PACKAGE_VERSION = "0.6.12";
|
|
1857
1857
|
|
|
1858
1858
|
// src/outbound.ts
|
|
1859
1859
|
var DEFAULT_RETRY_POLICY = {
|