@heretek-ai/openclaw 2026.3.27 → 2026.3.29
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/dist/.buildstamp +1 -1
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/chunks/command-registry-B9Orjysx.mjs +214 -0
- package/dist/chunks/command-registry-BtWKyYyZ.mjs +14 -0
- package/dist/chunks/completion-cli-B8M--XTS.mjs +448 -0
- package/dist/chunks/completion-cli-o3_a4BuE.mjs +17 -0
- package/dist/chunks/doctor-completion-CyOOf-GM.mjs +92 -0
- package/dist/chunks/gateway-cli-ZLRmdr6x.mjs +43508 -0
- package/dist/chunks/onboard-DqlCib9K.mjs +601 -0
- package/dist/chunks/program-Bg5zshJo.mjs +163 -0
- package/dist/chunks/prompt-select-styled-CxHtgKpu.mjs +5035 -0
- package/dist/chunks/register.maintenance-BdaRRBo0.mjs +685 -0
- package/dist/chunks/register.onboard-D128_sx4.mjs +168 -0
- package/dist/chunks/register.setup-BqV-_yA8.mjs +188 -0
- package/dist/chunks/register.subclis-BTo9umpR.mjs +13 -0
- package/dist/chunks/register.subclis-CVkk-8A3.mjs +319 -0
- package/dist/chunks/run-main-Rx8sfWSp.mjs +437 -0
- package/dist/chunks/setup-BY2mioiw.mjs +399 -0
- package/dist/chunks/setup.finalize-DvAFcLhU.mjs +544 -0
- package/dist/chunks/update-cli-B1-vpFz1.mjs +1632 -0
- package/dist/entry.mjs +1 -1
- package/dist/extensions/memory-core/index.mjs +40 -0
- package/dist/index.mjs +1 -1
- package/docs/DEPLOYMENT-BUGS.md +152 -0
- package/package.json +5 -5
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { D as getVerboseFlag, S as getCommandPathWithRootOptions, h as loggingState, k as hasHelpOrVersion } from "./logger-vRSRu9wD.mjs";
|
|
2
|
+
import "./paths-CNST7z3O.mjs";
|
|
3
|
+
import "./tmp-openclaw-dir-BeWwpCKM.mjs";
|
|
4
|
+
import "./theme-w86ra_7m.mjs";
|
|
5
|
+
import { s as setVerbose } from "./globals-DZFR3wyP.mjs";
|
|
6
|
+
import { c as routeLogsToStderr, m as defaultRuntime } from "./subsystem-yLe4Gjha.mjs";
|
|
7
|
+
import "./ansi-BJ9IOlIp.mjs";
|
|
8
|
+
import "./boolean-Bwxxidw8.mjs";
|
|
9
|
+
import { t as isTruthyEnvValue } from "./env-9fhyzTaG.mjs";
|
|
10
|
+
import "./utils-Dc9DiBqf.mjs";
|
|
11
|
+
import "./links-BNNF54ea.mjs";
|
|
12
|
+
import "./openclaw-root-CSfnLaqO.mjs";
|
|
13
|
+
import { n as VERSION } from "./version-Ckv-IbvB.mjs";
|
|
14
|
+
import "./registry-DBJv0dvl.mjs";
|
|
15
|
+
import { n as resolveCliName } from "./cli-name-lEyorNIN.mjs";
|
|
16
|
+
import "./ports-lsof-D1pMGdtZ.mjs";
|
|
17
|
+
import "./ports-probe-CW8QePv6.mjs";
|
|
18
|
+
import "./git-commit-CcLZRWTj.mjs";
|
|
19
|
+
import { n as resolveCliChannelOptions } from "./channel-options-DpA8i0KM.mjs";
|
|
20
|
+
import "./register.subclis-CVkk-8A3.mjs";
|
|
21
|
+
import { i as registerProgramCommands } from "./command-registry-B9Orjysx.mjs";
|
|
22
|
+
import { n as setProgramContext } from "./program-context-9v4H9od4.mjs";
|
|
23
|
+
import { t as isCommandJsonOutputMode } from "./json-mode-BaPg7DWt.mjs";
|
|
24
|
+
import { t as forceFreePort } from "./ports-CQscWpU0.mjs";
|
|
25
|
+
import { t as emitCliBanner } from "./banner-BUu5fMZg.mjs";
|
|
26
|
+
import { t as configureProgramHelp } from "./help-Byh8pEMT.mjs";
|
|
27
|
+
import { Command } from "commander";
|
|
28
|
+
|
|
29
|
+
//#region src/cli/program/context.ts
|
|
30
|
+
function createProgramContext() {
|
|
31
|
+
let cachedChannelOptions;
|
|
32
|
+
const getChannelOptions = () => {
|
|
33
|
+
if (cachedChannelOptions === void 0) cachedChannelOptions = resolveCliChannelOptions();
|
|
34
|
+
return cachedChannelOptions;
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
programVersion: VERSION,
|
|
38
|
+
get channelOptions() {
|
|
39
|
+
return getChannelOptions();
|
|
40
|
+
},
|
|
41
|
+
get messageChannelOptions() {
|
|
42
|
+
return getChannelOptions().join("|");
|
|
43
|
+
},
|
|
44
|
+
get agentChannelOptions() {
|
|
45
|
+
return ["last", ...getChannelOptions()].join("|");
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/cli/program/preaction.ts
|
|
52
|
+
function setProcessTitleForCommand(actionCommand) {
|
|
53
|
+
let current = actionCommand;
|
|
54
|
+
while (current.parent && current.parent.parent) current = current.parent;
|
|
55
|
+
const name = current.name();
|
|
56
|
+
const cliName = resolveCliName();
|
|
57
|
+
if (!name || name === cliName) return;
|
|
58
|
+
process.title = `${cliName}-${name}`;
|
|
59
|
+
}
|
|
60
|
+
const PLUGIN_REQUIRED_COMMANDS = new Set([
|
|
61
|
+
"message",
|
|
62
|
+
"channels",
|
|
63
|
+
"directory",
|
|
64
|
+
"agents",
|
|
65
|
+
"configure",
|
|
66
|
+
"status",
|
|
67
|
+
"health"
|
|
68
|
+
]);
|
|
69
|
+
const CONFIG_GUARD_BYPASS_COMMANDS = new Set([
|
|
70
|
+
"backup",
|
|
71
|
+
"doctor",
|
|
72
|
+
"completion",
|
|
73
|
+
"secrets"
|
|
74
|
+
]);
|
|
75
|
+
let configGuardModulePromise;
|
|
76
|
+
let pluginRegistryModulePromise;
|
|
77
|
+
function shouldBypassConfigGuard(commandPath) {
|
|
78
|
+
const [primary, secondary] = commandPath;
|
|
79
|
+
if (!primary) return false;
|
|
80
|
+
if (CONFIG_GUARD_BYPASS_COMMANDS.has(primary)) return true;
|
|
81
|
+
if (primary === "config" && secondary === "validate") return true;
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
function loadConfigGuardModule() {
|
|
85
|
+
configGuardModulePromise ??= import("./config-guard-CTR2nuw7.mjs");
|
|
86
|
+
return configGuardModulePromise;
|
|
87
|
+
}
|
|
88
|
+
function loadPluginRegistryModule() {
|
|
89
|
+
pluginRegistryModulePromise ??= import("./plugin-registry-MhmZqHfA.mjs");
|
|
90
|
+
return pluginRegistryModulePromise;
|
|
91
|
+
}
|
|
92
|
+
function resolvePluginRegistryScope(commandPath) {
|
|
93
|
+
return commandPath[0] === "status" || commandPath[0] === "health" ? "channels" : "all";
|
|
94
|
+
}
|
|
95
|
+
function shouldLoadPluginsForCommand(commandPath, jsonOutputMode) {
|
|
96
|
+
const [primary, secondary] = commandPath;
|
|
97
|
+
if (!primary || !PLUGIN_REQUIRED_COMMANDS.has(primary)) return false;
|
|
98
|
+
if ((primary === "status" || primary === "health") && jsonOutputMode) return false;
|
|
99
|
+
if (primary === "onboard" || primary === "channels" && secondary === "add") return false;
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
function getRootCommand(command) {
|
|
103
|
+
let current = command;
|
|
104
|
+
while (current.parent) current = current.parent;
|
|
105
|
+
return current;
|
|
106
|
+
}
|
|
107
|
+
function getCliLogLevel(actionCommand) {
|
|
108
|
+
const root = getRootCommand(actionCommand);
|
|
109
|
+
if (typeof root.getOptionValueSource !== "function") return;
|
|
110
|
+
if (root.getOptionValueSource("logLevel") !== "cli") return;
|
|
111
|
+
const logLevel = root.opts().logLevel;
|
|
112
|
+
return typeof logLevel === "string" ? logLevel : void 0;
|
|
113
|
+
}
|
|
114
|
+
function registerPreActionHooks(program, programVersion) {
|
|
115
|
+
program.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
116
|
+
setProcessTitleForCommand(actionCommand);
|
|
117
|
+
const argv = process.argv;
|
|
118
|
+
if (hasHelpOrVersion(argv)) return;
|
|
119
|
+
const commandPath = getCommandPathWithRootOptions(argv, 2);
|
|
120
|
+
const jsonOutputMode = isCommandJsonOutputMode(actionCommand, argv);
|
|
121
|
+
if (jsonOutputMode) routeLogsToStderr();
|
|
122
|
+
if (!(isTruthyEnvValue(process.env.OPENCLAW_HIDE_BANNER) || commandPath[0] === "update" || commandPath[0] === "completion" || commandPath[0] === "plugins" && commandPath[1] === "update")) emitCliBanner(programVersion);
|
|
123
|
+
const verbose = getVerboseFlag(argv, { includeDebug: true });
|
|
124
|
+
setVerbose(verbose);
|
|
125
|
+
const cliLogLevel = getCliLogLevel(actionCommand);
|
|
126
|
+
if (cliLogLevel) process.env.OPENCLAW_LOG_LEVEL = cliLogLevel;
|
|
127
|
+
if (!verbose) process.env.NODE_NO_WARNINGS ??= "1";
|
|
128
|
+
if (shouldBypassConfigGuard(commandPath)) return;
|
|
129
|
+
const { ensureConfigReady } = await loadConfigGuardModule();
|
|
130
|
+
await ensureConfigReady({
|
|
131
|
+
runtime: defaultRuntime,
|
|
132
|
+
commandPath,
|
|
133
|
+
...jsonOutputMode ? { suppressDoctorStdout: true } : {}
|
|
134
|
+
});
|
|
135
|
+
if (shouldLoadPluginsForCommand(commandPath, jsonOutputMode)) {
|
|
136
|
+
const { ensurePluginRegistryLoaded } = await loadPluginRegistryModule();
|
|
137
|
+
const prev = loggingState.forceConsoleToStderr;
|
|
138
|
+
if (jsonOutputMode) loggingState.forceConsoleToStderr = true;
|
|
139
|
+
try {
|
|
140
|
+
ensurePluginRegistryLoaded({ scope: resolvePluginRegistryScope(commandPath) });
|
|
141
|
+
} finally {
|
|
142
|
+
loggingState.forceConsoleToStderr = prev;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/cli/program/build-program.ts
|
|
150
|
+
function buildProgram() {
|
|
151
|
+
const program = new Command();
|
|
152
|
+
program.enablePositionalOptions();
|
|
153
|
+
const ctx = createProgramContext();
|
|
154
|
+
const argv = process.argv;
|
|
155
|
+
setProgramContext(program, ctx);
|
|
156
|
+
configureProgramHelp(program, ctx);
|
|
157
|
+
registerPreActionHooks(program, ctx.programVersion);
|
|
158
|
+
registerProgramCommands(program, ctx, argv);
|
|
159
|
+
return program;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
//#endregion
|
|
163
|
+
export { buildProgram };
|