mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-20 21:23:23 +00:00
CLI: use raw JSON writer for config schema
This commit is contained in:
@@ -13,6 +13,7 @@ Docs: https://docs.openclaw.ai
|
||||
- Plugins/runtime: expose `runHeartbeatOnce` in the plugin runtime `system` namespace so plugins can trigger a single heartbeat cycle with an explicit delivery target override (e.g. `heartbeat: { target: "last" }`). (#40299) Thanks @loveyana.
|
||||
- Agents/compaction: surface safeguard-specific cancel reasons and relabel benign manual `/compact` no-op cases as skipped instead of failed. (#51072) Thanks @afurm.
|
||||
- Agents/compaction: preserve the post-compaction AGENTS refresh on stale-usage preflight compaction for both immediate replies and queued followups. (#49479) Thanks @jared596.
|
||||
- CLI: add `openclaw config schema` to print the generated JSON schema for `openclaw.json`. (#54523) Thanks @kvokka.
|
||||
|
||||
### Fixes
|
||||
|
||||
|
||||
@@ -453,6 +453,7 @@ describe("config cli", () => {
|
||||
|
||||
expect(mockExit).not.toHaveBeenCalled();
|
||||
expect(mockError).not.toHaveBeenCalled();
|
||||
expect(defaultRuntime.writeJson).toHaveBeenCalledTimes(1);
|
||||
const raw = mockLog.mock.calls.at(-1)?.[0];
|
||||
expect(typeof raw).toBe("string");
|
||||
const payload = JSON.parse(String(raw)) as {
|
||||
@@ -503,6 +504,7 @@ describe("config cli", () => {
|
||||
|
||||
await runConfigCommand(["config", "schema"]);
|
||||
|
||||
expect(defaultRuntime.writeJson).toHaveBeenCalledTimes(1);
|
||||
const payload = JSON.parse(String(mockLog.mock.calls.at(-1)?.[0])) as {
|
||||
properties?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
@@ -1213,7 +1213,7 @@ async function buildCliConfigSchema(): Promise<Record<string, unknown>> {
|
||||
export async function runConfigSchema(opts: { runtime?: RuntimeEnv } = {}) {
|
||||
const runtime = opts.runtime ?? defaultRuntime;
|
||||
try {
|
||||
runtime.log(JSON.stringify(await buildCliConfigSchema(), null, 2));
|
||||
writeRuntimeJson(runtime, await buildCliConfigSchema());
|
||||
} catch (err) {
|
||||
runtime.error(danger(`Config schema error: ${String(err)}`));
|
||||
runtime.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user