@agentchatme/openclaw 0.7.8211111 → 0.8.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 +193 -0
- package/README.md +174 -253
- package/RUNBOOK.md +86 -91
- package/SECURITY.md +36 -20
- package/dist/binding/agents-anchor.cjs +41 -53
- package/dist/binding/agents-anchor.cjs.map +1 -1
- package/dist/binding/agents-anchor.d.cts +61 -74
- package/dist/binding/agents-anchor.d.ts +61 -74
- package/dist/binding/agents-anchor.js +35 -53
- package/dist/binding/agents-anchor.js.map +1 -1
- package/dist/credentials/read-env.cjs +35 -1
- package/dist/credentials/read-env.cjs.map +1 -1
- package/dist/credentials/read-env.d.cts +31 -3
- package/dist/credentials/read-env.d.ts +31 -3
- package/dist/credentials/read-env.js +29 -2
- package/dist/credentials/read-env.js.map +1 -1
- package/dist/index.cjs +2116 -3607
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +543 -330
- package/dist/index.d.ts +543 -330
- package/dist/index.js +2100 -3607
- package/dist/index.js.map +1 -1
- package/dist/openclaw-layout.cjs +120 -0
- package/dist/openclaw-layout.cjs.map +1 -0
- package/dist/openclaw-layout.d.cts +64 -0
- package/dist/openclaw-layout.d.ts +64 -0
- package/dist/openclaw-layout.js +90 -0
- package/dist/openclaw-layout.js.map +1 -0
- package/dist/{setup-entry-BuDCZ44W.d.cts → setup-entry-DU51IFUF.d.cts} +58 -8
- package/dist/{setup-entry-BuDCZ44W.d.ts → setup-entry-DU51IFUF.d.ts} +58 -8
- package/dist/setup-entry.cjs +2084 -3605
- package/dist/setup-entry.cjs.map +1 -1
- package/dist/setup-entry.d.cts +1 -1
- package/dist/setup-entry.d.ts +1 -1
- package/dist/setup-entry.js +2081 -3603
- package/dist/setup-entry.js.map +1 -1
- package/openclaw.plugin.json +8 -2
- package/package.json +9 -6
- package/skills/agentchat/SKILL.md +741 -227
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* outbound I/O") for the full rationale and the contract callers
|
|
11
11
|
* must respect.
|
|
12
12
|
*/
|
|
13
|
+
/** The variable the key lives under — the same name the hosted MCP server's bearer template references. */
|
|
14
|
+
declare const API_KEY_ENV = "AGENTCHAT_API_KEY";
|
|
13
15
|
/**
|
|
14
16
|
* Reads the AgentChat API key from `AGENTCHAT_API_KEY`.
|
|
15
17
|
*
|
|
@@ -21,13 +23,39 @@
|
|
|
21
23
|
declare function readApiKeyFromEnv(minLength: number): string | undefined;
|
|
22
24
|
/**
|
|
23
25
|
* Reads `OPENCLAW_PROFILE` for workspace path resolution. Mirrors
|
|
24
|
-
* OpenClaw's own logic
|
|
25
|
-
*
|
|
26
|
+
* OpenClaw's own logic: non-default profile name →
|
|
27
|
+
* `~/.openclaw/workspace-${profile}`.
|
|
26
28
|
*
|
|
27
29
|
* Returns the trimmed profile name only when it is set AND not equal
|
|
28
30
|
* to "default" (case-insensitive). Returns `undefined` otherwise so
|
|
29
31
|
* callers can fall through to the bare default.
|
|
30
32
|
*/
|
|
31
33
|
declare function readOpenClawProfileFromEnv(): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Reads `OPENCLAW_STATE_DIR` — OpenClaw's override for its state directory
|
|
36
|
+
* (`~/.openclaw` by default; `resolveStateDir` in OpenClaw). The doorbell
|
|
37
|
+
* places the key in `<state dir>/.env`, which OpenClaw loads at start
|
|
38
|
+
* (docs.openclaw.ai/gateway/configuration/environment-variables).
|
|
39
|
+
*/
|
|
40
|
+
declare function readOpenClawStateDirFromEnv(): string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Reads `OPENCLAW_WORKSPACE_DIR` — OpenClaw's explicit override for the
|
|
43
|
+
* default agent workspace (`resolveDefaultAgentWorkspaceDir` in OpenClaw
|
|
44
|
+
* checks it first).
|
|
45
|
+
*/
|
|
46
|
+
declare function readOpenClawWorkspaceDirFromEnv(): string | undefined;
|
|
47
|
+
type DoorbellMode = 'v3' | 'off';
|
|
48
|
+
/**
|
|
49
|
+
* `AGENTCHAT_DOORBELL=v3|off`. `off` keeps the hosted tools and the manual
|
|
50
|
+
* but opens no socket, takes no knocks and starts no turns. Anything else
|
|
51
|
+
* (including unset) is `v3`.
|
|
52
|
+
*/
|
|
53
|
+
declare function readDoorbellModeFromEnv(): DoorbellMode;
|
|
54
|
+
/** `AGENTCHAT_REPLY_GATE_ENABLED=0` turns the gate step off; the agent then judges every card inside the turn. */
|
|
55
|
+
declare function readReplyGateEnabledFromEnv(): boolean;
|
|
56
|
+
/** `AGENTCHAT_REPLY_GATE_FAIL_OPEN=1` starts the turn when the gate cannot run; the default is fail-closed (silence, re-knock). */
|
|
57
|
+
declare function readReplyGateFailOpenFromEnv(): boolean;
|
|
58
|
+
/** `AGENTCHAT_REPLY_GATE_TIMEOUT_MS` — decision-call timeout override; `undefined` lets the gate apply its default. */
|
|
59
|
+
declare function readReplyGateTimeoutMsFromEnv(): number | undefined;
|
|
32
60
|
|
|
33
|
-
export { readApiKeyFromEnv, readOpenClawProfileFromEnv };
|
|
61
|
+
export { API_KEY_ENV, type DoorbellMode, readApiKeyFromEnv, readDoorbellModeFromEnv, readOpenClawProfileFromEnv, readOpenClawStateDirFromEnv, readOpenClawWorkspaceDirFromEnv, readReplyGateEnabledFromEnv, readReplyGateFailOpenFromEnv, readReplyGateTimeoutMsFromEnv };
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* outbound I/O") for the full rationale and the contract callers
|
|
11
11
|
* must respect.
|
|
12
12
|
*/
|
|
13
|
+
/** The variable the key lives under — the same name the hosted MCP server's bearer template references. */
|
|
14
|
+
declare const API_KEY_ENV = "AGENTCHAT_API_KEY";
|
|
13
15
|
/**
|
|
14
16
|
* Reads the AgentChat API key from `AGENTCHAT_API_KEY`.
|
|
15
17
|
*
|
|
@@ -21,13 +23,39 @@
|
|
|
21
23
|
declare function readApiKeyFromEnv(minLength: number): string | undefined;
|
|
22
24
|
/**
|
|
23
25
|
* Reads `OPENCLAW_PROFILE` for workspace path resolution. Mirrors
|
|
24
|
-
* OpenClaw's own logic
|
|
25
|
-
*
|
|
26
|
+
* OpenClaw's own logic: non-default profile name →
|
|
27
|
+
* `~/.openclaw/workspace-${profile}`.
|
|
26
28
|
*
|
|
27
29
|
* Returns the trimmed profile name only when it is set AND not equal
|
|
28
30
|
* to "default" (case-insensitive). Returns `undefined` otherwise so
|
|
29
31
|
* callers can fall through to the bare default.
|
|
30
32
|
*/
|
|
31
33
|
declare function readOpenClawProfileFromEnv(): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Reads `OPENCLAW_STATE_DIR` — OpenClaw's override for its state directory
|
|
36
|
+
* (`~/.openclaw` by default; `resolveStateDir` in OpenClaw). The doorbell
|
|
37
|
+
* places the key in `<state dir>/.env`, which OpenClaw loads at start
|
|
38
|
+
* (docs.openclaw.ai/gateway/configuration/environment-variables).
|
|
39
|
+
*/
|
|
40
|
+
declare function readOpenClawStateDirFromEnv(): string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Reads `OPENCLAW_WORKSPACE_DIR` — OpenClaw's explicit override for the
|
|
43
|
+
* default agent workspace (`resolveDefaultAgentWorkspaceDir` in OpenClaw
|
|
44
|
+
* checks it first).
|
|
45
|
+
*/
|
|
46
|
+
declare function readOpenClawWorkspaceDirFromEnv(): string | undefined;
|
|
47
|
+
type DoorbellMode = 'v3' | 'off';
|
|
48
|
+
/**
|
|
49
|
+
* `AGENTCHAT_DOORBELL=v3|off`. `off` keeps the hosted tools and the manual
|
|
50
|
+
* but opens no socket, takes no knocks and starts no turns. Anything else
|
|
51
|
+
* (including unset) is `v3`.
|
|
52
|
+
*/
|
|
53
|
+
declare function readDoorbellModeFromEnv(): DoorbellMode;
|
|
54
|
+
/** `AGENTCHAT_REPLY_GATE_ENABLED=0` turns the gate step off; the agent then judges every card inside the turn. */
|
|
55
|
+
declare function readReplyGateEnabledFromEnv(): boolean;
|
|
56
|
+
/** `AGENTCHAT_REPLY_GATE_FAIL_OPEN=1` starts the turn when the gate cannot run; the default is fail-closed (silence, re-knock). */
|
|
57
|
+
declare function readReplyGateFailOpenFromEnv(): boolean;
|
|
58
|
+
/** `AGENTCHAT_REPLY_GATE_TIMEOUT_MS` — decision-call timeout override; `undefined` lets the gate apply its default. */
|
|
59
|
+
declare function readReplyGateTimeoutMsFromEnv(): number | undefined;
|
|
32
60
|
|
|
33
|
-
export { readApiKeyFromEnv, readOpenClawProfileFromEnv };
|
|
61
|
+
export { API_KEY_ENV, type DoorbellMode, readApiKeyFromEnv, readDoorbellModeFromEnv, readOpenClawProfileFromEnv, readOpenClawStateDirFromEnv, readOpenClawWorkspaceDirFromEnv, readReplyGateEnabledFromEnv, readReplyGateFailOpenFromEnv, readReplyGateTimeoutMsFromEnv };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/credentials/read-env.ts
|
|
2
|
+
var API_KEY_ENV = "AGENTCHAT_API_KEY";
|
|
2
3
|
function readApiKeyFromEnv(minLength) {
|
|
3
|
-
const raw = process.env
|
|
4
|
+
const raw = process.env[API_KEY_ENV]?.trim();
|
|
4
5
|
if (!raw) return void 0;
|
|
5
6
|
if (raw.length < minLength) return void 0;
|
|
6
7
|
return raw;
|
|
@@ -11,7 +12,33 @@ function readOpenClawProfileFromEnv() {
|
|
|
11
12
|
if (raw.toLowerCase() === "default") return void 0;
|
|
12
13
|
return raw;
|
|
13
14
|
}
|
|
15
|
+
function readOpenClawStateDirFromEnv() {
|
|
16
|
+
const raw = process.env.OPENCLAW_STATE_DIR?.trim();
|
|
17
|
+
return raw ? raw : void 0;
|
|
18
|
+
}
|
|
19
|
+
function readOpenClawWorkspaceDirFromEnv() {
|
|
20
|
+
const raw = process.env.OPENCLAW_WORKSPACE_DIR?.trim();
|
|
21
|
+
return raw ? raw : void 0;
|
|
22
|
+
}
|
|
23
|
+
function readDoorbellModeFromEnv() {
|
|
24
|
+
const raw = (process.env.AGENTCHAT_DOORBELL ?? "").trim().toLowerCase();
|
|
25
|
+
return raw === "off" ? "off" : "v3";
|
|
26
|
+
}
|
|
27
|
+
var OFF_TOKENS = /* @__PURE__ */ new Set(["0", "false", "off", "no"]);
|
|
28
|
+
var ON_TOKENS = /* @__PURE__ */ new Set(["1", "true", "on", "yes"]);
|
|
29
|
+
function readReplyGateEnabledFromEnv() {
|
|
30
|
+
return !OFF_TOKENS.has((process.env.AGENTCHAT_REPLY_GATE_ENABLED ?? "").trim().toLowerCase());
|
|
31
|
+
}
|
|
32
|
+
function readReplyGateFailOpenFromEnv() {
|
|
33
|
+
return ON_TOKENS.has((process.env.AGENTCHAT_REPLY_GATE_FAIL_OPEN ?? "").trim().toLowerCase());
|
|
34
|
+
}
|
|
35
|
+
function readReplyGateTimeoutMsFromEnv() {
|
|
36
|
+
const raw = process.env.AGENTCHAT_REPLY_GATE_TIMEOUT_MS;
|
|
37
|
+
if (raw === void 0 || raw.trim() === "") return void 0;
|
|
38
|
+
const n = Number(raw);
|
|
39
|
+
return Number.isFinite(n) && n > 0 ? n : void 0;
|
|
40
|
+
}
|
|
14
41
|
|
|
15
|
-
export { readApiKeyFromEnv, readOpenClawProfileFromEnv };
|
|
42
|
+
export { API_KEY_ENV, readApiKeyFromEnv, readDoorbellModeFromEnv, readOpenClawProfileFromEnv, readOpenClawStateDirFromEnv, readOpenClawWorkspaceDirFromEnv, readReplyGateEnabledFromEnv, readReplyGateFailOpenFromEnv, readReplyGateTimeoutMsFromEnv };
|
|
16
43
|
//# sourceMappingURL=read-env.js.map
|
|
17
44
|
//# sourceMappingURL=read-env.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/credentials/read-env.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"sources":["../../src/credentials/read-env.ts"],"names":[],"mappings":";AAcO,IAAM,WAAA,GAAc;AAUpB,SAAS,kBAAkB,SAAA,EAAuC;AACvE,EAAA,MAAM,GAAA,GAAM,OAAA,CAAQ,GAAA,CAAI,WAAW,GAAG,IAAA,EAAK;AAC3C,EAAA,IAAI,CAAC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S,4BAAA,GAAwC;AACtD,EAAA,OAAO,SAAA,CAAU,KAAK,OAAA,CAAQ,GAAA,CAAI,kCAAkC,EAAA,EAAI,IAAA,EAAK,CAAE,WAAA,EAAa,CAAA;AAC9F;AAGO,SAAS,6BAAA,GAAoD;AAClE,EAAA,MAAM,GAAA,GAAM,QAAQ,GAAA,CAAI,+BAAA;AACxB,EAAA,IAAI,QAAQ,MAAA,IAAa,GAAA,CAAI,IAAA,EAAK,KAAM,IAAI,OAAO,MAAA;AACnD,EAAA,MAAM,CAAA,GAAI,OAAO,GAAG,CAAA;AACpB,EAAA,OAAO,OAAO,QAAA,CAAS,CAAC,CAAA,IAAK,CAAA,GAAI,IAAI,CAAA,GAAI,MAAA;AAC3C","file":"read-env.js","sourcesContent":["/**\n * Environment variable readers — isolated from outbound networking.\n *\n * The wizard, runtime, and SDK consume the helpers below instead of\n * touching the host environment directly. The split keeps credential\n * lookup in a small audit-friendly module that imports nothing more\n * than its own typings: no SDK, no transport, no logging.\n *\n * See SECURITY.md (\"Defensive separation of credential lookup from\n * outbound I/O\") for the full rationale and the contract callers\n * must respect.\n */\n\n/** The variable the key lives under — the same name the hosted MCP server's bearer template references. */\nexport const API_KEY_ENV = 'AGENTCHAT_API_KEY'\n\n/**\n * Reads the AgentChat API key from `AGENTCHAT_API_KEY`.\n *\n * Returns the trimmed value when non-empty AND meeting `minLength`,\n * otherwise `undefined`. The min-length is supplied by the caller\n * (`MIN_API_KEY_LENGTH` from `channel-account.ts`) so this module\n * owns no domain constants.\n */\nexport function readApiKeyFromEnv(minLength: number): string | undefined {\n const raw = process.env[API_KEY_ENV]?.trim()\n if (!raw) return undefined\n if (raw.length < minLength) return undefined\n return raw\n}\n\n/**\n * Reads `OPENCLAW_PROFILE` for workspace path resolution. Mirrors\n * OpenClaw's own logic: non-default profile name →\n * `~/.openclaw/workspace-${profile}`.\n *\n * Returns the trimmed profile name only when it is set AND not equal\n * to \"default\" (case-insensitive). Returns `undefined` otherwise so\n * callers can fall through to the bare default.\n */\nexport function readOpenClawProfileFromEnv(): string | undefined {\n const raw = process.env.OPENCLAW_PROFILE?.trim()\n if (!raw) return undefined\n if (raw.toLowerCase() === 'default') return undefined\n return raw\n}\n\n/**\n * Reads `OPENCLAW_STATE_DIR` — OpenClaw's override for its state directory\n * (`~/.openclaw` by default; `resolveStateDir` in OpenClaw). The doorbell\n * places the key in `<state dir>/.env`, which OpenClaw loads at start\n * (docs.openclaw.ai/gateway/configuration/environment-variables).\n */\nexport function readOpenClawStateDirFromEnv(): string | undefined {\n const raw = process.env.OPENCLAW_STATE_DIR?.trim()\n return raw ? raw : undefined\n}\n\n/**\n * Reads `OPENCLAW_WORKSPACE_DIR` — OpenClaw's explicit override for the\n * default agent workspace (`resolveDefaultAgentWorkspaceDir` in OpenClaw\n * checks it first).\n */\nexport function readOpenClawWorkspaceDirFromEnv(): string | undefined {\n const raw = process.env.OPENCLAW_WORKSPACE_DIR?.trim()\n return raw ? raw : undefined\n}\n\nexport type DoorbellMode = 'v3' | 'off'\n\n/**\n * `AGENTCHAT_DOORBELL=v3|off`. `off` keeps the hosted tools and the manual\n * but opens no socket, takes no knocks and starts no turns. Anything else\n * (including unset) is `v3`.\n */\nexport function readDoorbellModeFromEnv(): DoorbellMode {\n const raw = (process.env.AGENTCHAT_DOORBELL ?? '').trim().toLowerCase()\n return raw === 'off' ? 'off' : 'v3'\n}\n\nconst OFF_TOKENS = new Set(['0', 'false', 'off', 'no'])\nconst ON_TOKENS = new Set(['1', 'true', 'on', 'yes'])\n\n/** `AGENTCHAT_REPLY_GATE_ENABLED=0` turns the gate step off; the agent then judges every card inside the turn. */\nexport function readReplyGateEnabledFromEnv(): boolean {\n return !OFF_TOKENS.has((process.env.AGENTCHAT_REPLY_GATE_ENABLED ?? '').trim().toLowerCase())\n}\n\n/** `AGENTCHAT_REPLY_GATE_FAIL_OPEN=1` starts the turn when the gate cannot run; the default is fail-closed (silence, re-knock). */\nexport function readReplyGateFailOpenFromEnv(): boolean {\n return ON_TOKENS.has((process.env.AGENTCHAT_REPLY_GATE_FAIL_OPEN ?? '').trim().toLowerCase())\n}\n\n/** `AGENTCHAT_REPLY_GATE_TIMEOUT_MS` — decision-call timeout override; `undefined` lets the gate apply its default. */\nexport function readReplyGateTimeoutMsFromEnv(): number | undefined {\n const raw = process.env.AGENTCHAT_REPLY_GATE_TIMEOUT_MS\n if (raw === undefined || raw.trim() === '') return undefined\n const n = Number(raw)\n return Number.isFinite(n) && n > 0 ? n : undefined\n}\n"]}
|