@scotthuang/agent-knock-knock 0.2.51 → 0.3.0-beta.2
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 +31 -0
- package/README.md +120 -79
- package/dist/src/cli.js +382 -49
- package/dist/src/cli.js.map +1 -1
- package/dist/src/doctor-capabilities.d.ts +64 -13
- package/dist/src/doctor-capabilities.js +241 -12
- package/dist/src/doctor-capabilities.js.map +1 -1
- package/dist/src/openclaw-doctor.d.ts +28 -0
- package/dist/src/openclaw-doctor.js +359 -0
- package/dist/src/openclaw-doctor.js.map +1 -0
- package/dist/src/openclaw-plugin-helpers.d.ts +5 -2
- package/dist/src/openclaw-plugin-helpers.js +72 -24
- package/dist/src/openclaw-plugin-helpers.js.map +1 -1
- package/dist/src/openclaw-plugin.d.ts +3 -7
- package/dist/src/openclaw-plugin.js +131 -13
- package/dist/src/openclaw-plugin.js.map +1 -1
- package/dist/src/session-selector.d.ts +81 -0
- package/dist/src/session-selector.js +330 -0
- package/dist/src/session-selector.js.map +1 -0
- package/dist/src/terminal-process-source.d.ts +4 -0
- package/dist/src/terminal-process-source.js +20 -0
- package/dist/src/terminal-process-source.js.map +1 -1
- package/docs/assets/agent-knock-knock-icon.png +0 -0
- package/docs/quickstart-managed-acpx.md +43 -0
- package/docs/quickstart-tmux.md +43 -0
- package/openclaw.plugin.json +22 -9
- package/package.json +40 -4
- package/scripts/smoke-acpx.js +139 -0
- package/scripts/smoke-tmux.js +140 -0
- package/templates/openclaw-skills/agent-knock-knock/SKILL.md +23 -20
|
@@ -1,22 +1,73 @@
|
|
|
1
|
+
export type DoctorMode = "tmux" | "acpx" | "all";
|
|
2
|
+
export type DoctorReadiness = "ready" | "partially_ready" | "not_ready";
|
|
3
|
+
export type DoctorProbeCommand = "openclaw" | "tmux" | "acpx" | "codex" | "claude" | "cursor";
|
|
4
|
+
export type DoctorProbeStatus = "ok" | "not_found" | "not_executable" | "version_failed" | "timeout" | "malformed_output";
|
|
1
5
|
export interface DoctorCommandCheck {
|
|
2
6
|
command: string;
|
|
3
7
|
available: boolean;
|
|
4
8
|
version_supported?: boolean;
|
|
9
|
+
status?: DoctorProbeStatus;
|
|
10
|
+
}
|
|
11
|
+
export interface DoctorCommandProbe extends DoctorCommandCheck {
|
|
12
|
+
command: DoctorProbeCommand;
|
|
13
|
+
status: DoctorProbeStatus;
|
|
14
|
+
executable: string;
|
|
15
|
+
args: readonly string[];
|
|
16
|
+
found: boolean;
|
|
17
|
+
executable_ok: boolean;
|
|
18
|
+
duration_ms: number;
|
|
19
|
+
version?: string;
|
|
20
|
+
output?: string;
|
|
21
|
+
error?: string;
|
|
22
|
+
exit_code?: number | null;
|
|
23
|
+
signal?: NodeJS.Signals | null;
|
|
24
|
+
}
|
|
25
|
+
export interface DoctorProbeOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Timeout for each command. Values above 30 seconds are clamped so a doctor
|
|
28
|
+
* run cannot become unbounded through configuration.
|
|
29
|
+
*/
|
|
30
|
+
timeoutMs?: number;
|
|
31
|
+
env?: NodeJS.ProcessEnv;
|
|
32
|
+
cwd?: string;
|
|
33
|
+
executables?: Partial<Record<DoctorProbeCommand, string>>;
|
|
34
|
+
}
|
|
35
|
+
interface DoctorModeCapability {
|
|
36
|
+
available: boolean;
|
|
37
|
+
status: DoctorReadiness;
|
|
38
|
+
agents: string[];
|
|
39
|
+
requires: string[];
|
|
40
|
+
missing: string[];
|
|
41
|
+
}
|
|
42
|
+
interface DoctorTmuxCapability extends DoctorModeCapability {
|
|
43
|
+
recommended: true;
|
|
44
|
+
}
|
|
45
|
+
interface DoctorAcpxCapability extends DoctorModeCapability {
|
|
46
|
+
client: "acpx";
|
|
5
47
|
}
|
|
6
48
|
export interface DoctorCapabilitySummary {
|
|
7
49
|
coreOk: boolean;
|
|
8
50
|
transportOk: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
client: "acpx";
|
|
18
|
-
agents: string[];
|
|
19
|
-
requires: string[];
|
|
20
|
-
};
|
|
51
|
+
mode: DoctorMode;
|
|
52
|
+
readiness: DoctorReadiness;
|
|
53
|
+
tmux: DoctorTmuxCapability;
|
|
54
|
+
acpx: DoctorAcpxCapability;
|
|
55
|
+
/**
|
|
56
|
+
* Backwards-compatible alias retained for existing CLI consumers.
|
|
57
|
+
*/
|
|
58
|
+
acp: DoctorAcpxCapability;
|
|
21
59
|
}
|
|
22
|
-
export declare
|
|
60
|
+
export declare const DOCTOR_PROBE_COMMANDS: readonly DoctorProbeCommand[];
|
|
61
|
+
/**
|
|
62
|
+
* Run a bounded, non-interactive version probe for one doctor dependency.
|
|
63
|
+
*
|
|
64
|
+
* This deliberately does not invoke a shell. Successful process execution is
|
|
65
|
+
* not enough: the output must also contain a recognizable version.
|
|
66
|
+
*/
|
|
67
|
+
export declare function probeDoctorCommand(command: DoctorProbeCommand, options?: DoctorProbeOptions): DoctorCommandProbe;
|
|
68
|
+
/**
|
|
69
|
+
* Probe every external command used by the tmux and ACPX execution modes.
|
|
70
|
+
*/
|
|
71
|
+
export declare function runDoctorCapabilityProbes(options?: DoctorProbeOptions, mode?: DoctorMode): DoctorCommandProbe[];
|
|
72
|
+
export declare function evaluateDoctorCapabilities(checks: readonly DoctorCommandCheck[], mode?: DoctorMode): DoctorCapabilitySummary;
|
|
73
|
+
export {};
|
|
@@ -1,29 +1,258 @@
|
|
|
1
|
-
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
const DEFAULT_PROBE_TIMEOUT_MS = 3_000;
|
|
3
|
+
const MAX_PROBE_TIMEOUT_MS = 30_000;
|
|
4
|
+
const MAX_PROBE_BUFFER_BYTES = 64 * 1024;
|
|
5
|
+
const MAX_REPORTED_OUTPUT_CHARS = 2_000;
|
|
6
|
+
const PROBE_ARGUMENTS = {
|
|
7
|
+
openclaw: ["--version"],
|
|
8
|
+
tmux: ["-V"],
|
|
9
|
+
acpx: ["--version"],
|
|
10
|
+
codex: ["--version"],
|
|
11
|
+
claude: ["--version"],
|
|
12
|
+
cursor: ["--version"]
|
|
13
|
+
};
|
|
14
|
+
const DEFAULT_PROBE_EXECUTABLES = {
|
|
15
|
+
openclaw: "openclaw",
|
|
16
|
+
tmux: "tmux",
|
|
17
|
+
acpx: "acpx",
|
|
18
|
+
codex: "codex",
|
|
19
|
+
claude: "claude",
|
|
20
|
+
// ACPX's built-in Cursor adapter launches `cursor-agent acp`. The desktop
|
|
21
|
+
// `cursor` shim may exist while no ACP-capable Cursor agent is available.
|
|
22
|
+
cursor: "cursor-agent"
|
|
23
|
+
};
|
|
24
|
+
export const DOCTOR_PROBE_COMMANDS = Object.freeze(Object.keys(PROBE_ARGUMENTS));
|
|
25
|
+
const MODE_PROBE_COMMANDS = {
|
|
26
|
+
tmux: ["openclaw", "tmux", "codex", "claude"],
|
|
27
|
+
acpx: ["openclaw", "acpx", "codex", "claude", "cursor"],
|
|
28
|
+
all: DOCTOR_PROBE_COMMANDS
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Run a bounded, non-interactive version probe for one doctor dependency.
|
|
32
|
+
*
|
|
33
|
+
* This deliberately does not invoke a shell. Successful process execution is
|
|
34
|
+
* not enough: the output must also contain a recognizable version.
|
|
35
|
+
*/
|
|
36
|
+
export function probeDoctorCommand(command, options = {}) {
|
|
37
|
+
const executable = options.executables?.[command] ?? DEFAULT_PROBE_EXECUTABLES[command];
|
|
38
|
+
const args = PROBE_ARGUMENTS[command];
|
|
39
|
+
const timeoutMs = boundedTimeout(options.timeoutMs);
|
|
40
|
+
const startedAt = Date.now();
|
|
41
|
+
const result = spawnSync(executable, args, {
|
|
42
|
+
cwd: options.cwd,
|
|
43
|
+
env: {
|
|
44
|
+
...process.env,
|
|
45
|
+
CI: "1",
|
|
46
|
+
NO_COLOR: "1",
|
|
47
|
+
FORCE_COLOR: "0",
|
|
48
|
+
TERM: "dumb",
|
|
49
|
+
PAGER: "cat",
|
|
50
|
+
GIT_PAGER: "cat",
|
|
51
|
+
...options.env
|
|
52
|
+
},
|
|
53
|
+
encoding: "utf8",
|
|
54
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
55
|
+
timeout: timeoutMs,
|
|
56
|
+
killSignal: "SIGKILL",
|
|
57
|
+
maxBuffer: MAX_PROBE_BUFFER_BYTES,
|
|
58
|
+
windowsHide: true
|
|
59
|
+
});
|
|
60
|
+
const durationMs = Date.now() - startedAt;
|
|
61
|
+
const output = cleanProbeOutput([result.stdout, result.stderr].filter(Boolean).join("\n"));
|
|
62
|
+
const processError = result.error;
|
|
63
|
+
if (processError) {
|
|
64
|
+
const status = classifySpawnError(processError);
|
|
65
|
+
return buildProbeResult({
|
|
66
|
+
command,
|
|
67
|
+
executable,
|
|
68
|
+
args,
|
|
69
|
+
status,
|
|
70
|
+
durationMs,
|
|
71
|
+
output,
|
|
72
|
+
error: processError.message,
|
|
73
|
+
exitCode: result.status,
|
|
74
|
+
signal: result.signal
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (result.status !== 0) {
|
|
78
|
+
return buildProbeResult({
|
|
79
|
+
command,
|
|
80
|
+
executable,
|
|
81
|
+
args,
|
|
82
|
+
status: "version_failed",
|
|
83
|
+
durationMs,
|
|
84
|
+
output,
|
|
85
|
+
error: output || `${command} version probe exited with status ${result.status}`,
|
|
86
|
+
exitCode: result.status,
|
|
87
|
+
signal: result.signal
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
const version = parseVersion(output);
|
|
91
|
+
if (!version) {
|
|
92
|
+
return buildProbeResult({
|
|
93
|
+
command,
|
|
94
|
+
executable,
|
|
95
|
+
args,
|
|
96
|
+
status: "malformed_output",
|
|
97
|
+
durationMs,
|
|
98
|
+
output,
|
|
99
|
+
error: `${command} version probe did not return a recognizable version`,
|
|
100
|
+
exitCode: result.status,
|
|
101
|
+
signal: result.signal
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return buildProbeResult({
|
|
105
|
+
command,
|
|
106
|
+
executable,
|
|
107
|
+
args,
|
|
108
|
+
status: "ok",
|
|
109
|
+
durationMs,
|
|
110
|
+
output,
|
|
111
|
+
version,
|
|
112
|
+
exitCode: result.status,
|
|
113
|
+
signal: result.signal
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Probe every external command used by the tmux and ACPX execution modes.
|
|
118
|
+
*/
|
|
119
|
+
export function runDoctorCapabilityProbes(options = {}, mode = "all") {
|
|
120
|
+
return MODE_PROBE_COMMANDS[mode].map((command) => probeDoctorCommand(command, options));
|
|
121
|
+
}
|
|
122
|
+
export function evaluateDoctorCapabilities(checks, mode = "all") {
|
|
2
123
|
const checkByCommand = new Map(checks.map((check) => [check.command, check]));
|
|
3
124
|
const nodeCheck = checkByCommand.get("node");
|
|
4
|
-
const
|
|
5
|
-
nodeCheck
|
|
6
|
-
|
|
125
|
+
const nodeOk = isUsable(nodeCheck) &&
|
|
126
|
+
nodeCheck?.version_supported === true;
|
|
127
|
+
const openclawOk = isUsable(checkByCommand.get("openclaw"));
|
|
128
|
+
const coreOk = nodeOk && openclawOk;
|
|
129
|
+
const missingCore = [
|
|
130
|
+
...(!nodeOk ? ["node"] : []),
|
|
131
|
+
...(!openclawOk ? ["openclaw"] : [])
|
|
132
|
+
];
|
|
7
133
|
const availableAgents = ["codex", "claude", "cursor"]
|
|
8
|
-
.filter((agent) => checkByCommand.get(agent)
|
|
134
|
+
.filter((agent) => isUsable(checkByCommand.get(agent)));
|
|
9
135
|
const tmuxAgents = availableAgents.filter((agent) => agent !== "cursor");
|
|
136
|
+
const tmuxTransportOk = isUsable(checkByCommand.get("tmux"));
|
|
137
|
+
const acpxTransportOk = isUsable(checkByCommand.get("acpx"));
|
|
10
138
|
const tmux = {
|
|
11
|
-
available:
|
|
139
|
+
available: tmuxTransportOk && tmuxAgents.length > 0,
|
|
140
|
+
status: readinessFromParts([coreOk, tmuxTransportOk, tmuxAgents.length > 0]),
|
|
12
141
|
recommended: true,
|
|
13
142
|
agents: tmuxAgents,
|
|
14
|
-
requires: ["tmux", "codex or claude"]
|
|
143
|
+
requires: ["node", "openclaw", "tmux", "codex or claude"],
|
|
144
|
+
missing: [
|
|
145
|
+
...missingCore,
|
|
146
|
+
...(!tmuxTransportOk ? ["tmux"] : []),
|
|
147
|
+
...(tmuxAgents.length === 0 ? ["codex or claude"] : [])
|
|
148
|
+
]
|
|
15
149
|
};
|
|
16
|
-
const
|
|
17
|
-
available:
|
|
150
|
+
const acpx = {
|
|
151
|
+
available: acpxTransportOk && availableAgents.length > 0,
|
|
152
|
+
status: readinessFromParts([coreOk, acpxTransportOk, availableAgents.length > 0]),
|
|
18
153
|
client: "acpx",
|
|
19
154
|
agents: availableAgents,
|
|
20
|
-
requires: ["acpx", "codex, claude, or cursor"]
|
|
155
|
+
requires: ["node", "openclaw", "acpx", "codex, claude, or cursor"],
|
|
156
|
+
missing: [
|
|
157
|
+
...missingCore,
|
|
158
|
+
...(!acpxTransportOk ? ["acpx"] : []),
|
|
159
|
+
...(availableAgents.length === 0 ? ["codex, claude, or cursor"] : [])
|
|
160
|
+
]
|
|
21
161
|
};
|
|
22
162
|
return {
|
|
23
163
|
coreOk,
|
|
24
|
-
transportOk: tmux.available ||
|
|
164
|
+
transportOk: tmux.available || acpx.available,
|
|
165
|
+
mode,
|
|
166
|
+
readiness: selectedReadiness(mode, tmux.status, acpx.status),
|
|
25
167
|
tmux,
|
|
26
|
-
|
|
168
|
+
acpx,
|
|
169
|
+
acp: acpx
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function buildProbeResult({ command, executable, args, status, durationMs, version, output, error, exitCode, signal }) {
|
|
173
|
+
return {
|
|
174
|
+
command,
|
|
175
|
+
executable,
|
|
176
|
+
args,
|
|
177
|
+
status,
|
|
178
|
+
available: status === "ok",
|
|
179
|
+
found: status !== "not_found",
|
|
180
|
+
executable_ok: !["not_found", "not_executable"].includes(status),
|
|
181
|
+
duration_ms: durationMs,
|
|
182
|
+
...(version ? { version } : {}),
|
|
183
|
+
...(output ? { output } : {}),
|
|
184
|
+
...(error ? { error } : {}),
|
|
185
|
+
...(exitCode !== undefined ? { exit_code: exitCode } : {}),
|
|
186
|
+
...(signal !== undefined ? { signal } : {})
|
|
27
187
|
};
|
|
28
188
|
}
|
|
189
|
+
function classifySpawnError(error) {
|
|
190
|
+
if (error.code === "ENOENT" || error.code === "ENOTDIR") {
|
|
191
|
+
return "not_found";
|
|
192
|
+
}
|
|
193
|
+
if (error.code === "EACCES" ||
|
|
194
|
+
error.code === "EPERM" ||
|
|
195
|
+
error.code === "EISDIR" ||
|
|
196
|
+
error.code === "ENOEXEC") {
|
|
197
|
+
return "not_executable";
|
|
198
|
+
}
|
|
199
|
+
if (error.code === "ETIMEDOUT") {
|
|
200
|
+
return "timeout";
|
|
201
|
+
}
|
|
202
|
+
return "version_failed";
|
|
203
|
+
}
|
|
204
|
+
function cleanProbeOutput(value) {
|
|
205
|
+
const cleaned = value
|
|
206
|
+
.replace(/\u001B\[[0-?]*[ -/]*[@-~]/g, "")
|
|
207
|
+
.replace(/\r/g, "")
|
|
208
|
+
.trim();
|
|
209
|
+
if (!cleaned) {
|
|
210
|
+
return undefined;
|
|
211
|
+
}
|
|
212
|
+
return cleaned.slice(0, MAX_REPORTED_OUTPUT_CHARS);
|
|
213
|
+
}
|
|
214
|
+
function parseVersion(output) {
|
|
215
|
+
if (!output) {
|
|
216
|
+
return undefined;
|
|
217
|
+
}
|
|
218
|
+
const match = output.match(/(?:^|[^0-9A-Za-z])v?(\d+\.\d+(?:\.\d+)?(?:[-+][0-9A-Za-z.-]+|[A-Za-z]\d*)?)(?=$|[^0-9A-Za-z])/m);
|
|
219
|
+
return match?.[1];
|
|
220
|
+
}
|
|
221
|
+
function boundedTimeout(value) {
|
|
222
|
+
if (value === undefined) {
|
|
223
|
+
return DEFAULT_PROBE_TIMEOUT_MS;
|
|
224
|
+
}
|
|
225
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
226
|
+
throw new RangeError("doctor probe timeoutMs must be a positive finite number");
|
|
227
|
+
}
|
|
228
|
+
return Math.min(Math.ceil(value), MAX_PROBE_TIMEOUT_MS);
|
|
229
|
+
}
|
|
230
|
+
function isUsable(check) {
|
|
231
|
+
return check?.available === true && (check.status === undefined || check.status === "ok");
|
|
232
|
+
}
|
|
233
|
+
function readinessFromParts(parts) {
|
|
234
|
+
const readyParts = parts.filter(Boolean).length;
|
|
235
|
+
if (readyParts === parts.length) {
|
|
236
|
+
return "ready";
|
|
237
|
+
}
|
|
238
|
+
return readyParts === 0 ? "not_ready" : "partially_ready";
|
|
239
|
+
}
|
|
240
|
+
function selectedReadiness(mode, tmux, acpx) {
|
|
241
|
+
if (mode === "tmux") {
|
|
242
|
+
return tmux;
|
|
243
|
+
}
|
|
244
|
+
if (mode === "acpx") {
|
|
245
|
+
return acpx;
|
|
246
|
+
}
|
|
247
|
+
// "all" inspects both execution modes, but the product only requires one
|
|
248
|
+
// usable transport. Per-mode status still shows which optional mode needs
|
|
249
|
+
// attention.
|
|
250
|
+
if (tmux === "ready" || acpx === "ready") {
|
|
251
|
+
return "ready";
|
|
252
|
+
}
|
|
253
|
+
if (tmux === "not_ready" && acpx === "not_ready") {
|
|
254
|
+
return "not_ready";
|
|
255
|
+
}
|
|
256
|
+
return "partially_ready";
|
|
257
|
+
}
|
|
29
258
|
//# sourceMappingURL=doctor-capabilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-capabilities.js","sourceRoot":"","sources":["../../src/doctor-capabilities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor-capabilities.js","sourceRoot":"","sources":["../../src/doctor-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAoF/C,MAAM,wBAAwB,GAAG,KAAK,CAAC;AACvC,MAAM,oBAAoB,GAA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,IAAI,CAAC,CAAC;AAC5F,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAyB;IACnD,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;IAChD,IAAI,UAAU,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QAChC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC;AAC5D,CAAC;AAED,SAAS,iBAAiB,CACxB,IAAgB,EAChB,IAAqB,EACrB,IAAqB;IAErB,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,yEAAyE;IACzE,0EAA0E;IAC1E,aAAa;IACb,IAAI,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACzC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;QACjD,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type OpenClawDiagnosticStatus = "ok" | "failed" | "missing" | "invalid" | "unreachable";
|
|
2
|
+
export interface OpenClawDiagnosticCheck {
|
|
3
|
+
name: "config" | "plugin_entry" | "plugin_installed" | "plugin_enabled" | "plugin_runtime" | "skill" | "workspace" | "gateway";
|
|
4
|
+
ok: boolean;
|
|
5
|
+
status: OpenClawDiagnosticStatus;
|
|
6
|
+
detail: string;
|
|
7
|
+
remediation?: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface OpenClawChainDiagnostics {
|
|
10
|
+
ready: boolean;
|
|
11
|
+
package_ready: boolean;
|
|
12
|
+
gateway_ready: boolean;
|
|
13
|
+
default_agent?: "codex" | "claude" | "cursor";
|
|
14
|
+
workspace?: string;
|
|
15
|
+
checks: OpenClawDiagnosticCheck[];
|
|
16
|
+
}
|
|
17
|
+
export interface OpenClawChainDiagnosticOptions {
|
|
18
|
+
openclawBin: string;
|
|
19
|
+
workspace?: string;
|
|
20
|
+
timeoutMs?: number;
|
|
21
|
+
env?: NodeJS.ProcessEnv;
|
|
22
|
+
cwd?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Verify the complete OpenClaw-side AKK chain without returning config values
|
|
26
|
+
* other than the explicitly non-secret workspace path.
|
|
27
|
+
*/
|
|
28
|
+
export declare function runOpenClawChainDiagnostics(options: OpenClawChainDiagnosticOptions): OpenClawChainDiagnostics;
|