denchclaw 2.0.0 → 2.0.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/README.md +1 -1
- package/apps/web/.next/standalone/apps/web/.next/BUILD_ID +1 -1
- package/apps/web/.next/standalone/apps/web/.next/app-build-manifest.json +95 -95
- package/apps/web/.next/standalone/apps/web/.next/app-path-routes-manifest.json +27 -27
- package/apps/web/.next/standalone/apps/web/.next/build-manifest.json +2 -2
- package/apps/web/.next/standalone/apps/web/.next/server/app/_not-found.html +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/_not-found.rsc +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/init/route.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/index.html +2 -2
- package/apps/web/.next/standalone/apps/web/.next/server/app/index.rsc +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/workspace/page.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/workspace/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/workspace.html +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/workspace.rsc +2 -2
- package/apps/web/.next/standalone/apps/web/.next/server/app-paths-manifest.json +27 -27
- package/apps/web/.next/standalone/apps/web/.next/server/functions-config-manifest.json +20 -20
- package/apps/web/.next/standalone/apps/web/.next/server/pages/404.html +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/pages/500.html +1 -1
- package/apps/web/.next/standalone/apps/web/.next/static/chunks/app/workspace/page-a9c68aaa3f71a7fe.js +1 -0
- package/apps/web/.next/standalone/package.json +2 -2
- package/apps/web/.next/static/chunks/app/workspace/page-a9c68aaa3f71a7fe.js +1 -0
- package/dist/{cli-name-DUQ-cavN.js → cli-name-8WJ6gVD5.js} +36 -3
- package/dist/entry.js +2 -21
- package/dist/program-DSR-Zphq.js +2412 -0
- package/dist/{run-main-buUOQk0k.js → run-main-B-QwRglo.js} +9 -7
- package/package.json +2 -2
- package/apps/web/.next/standalone/apps/web/.next/static/chunks/app/workspace/page-d499296a443bbbf0.js +0 -1
- package/apps/web/.next/static/chunks/app/workspace/page-d499296a443bbbf0.js +0 -1
- package/dist/links-BTx7dmFj.js +0 -57
- package/dist/program-DahL9wBm.js +0 -195
- package/dist/register.bootstrap-D9YhQgaK.js +0 -1330
- package/dist/theme-uCBEEejb.js +0 -36
- /package/apps/web/.next/standalone/apps/web/.next/static/{oOwR1DKioMELtFQgLgScE → rfl8V4U-KWtyivUflJxQF}/_buildManifest.js +0 -0
- /package/apps/web/.next/standalone/apps/web/.next/static/{oOwR1DKioMELtFQgLgScE → rfl8V4U-KWtyivUflJxQF}/_ssgManifest.js +0 -0
- /package/apps/web/.next/static/{oOwR1DKioMELtFQgLgScE → rfl8V4U-KWtyivUflJxQF}/_buildManifest.js +0 -0
- /package/apps/web/.next/static/{oOwR1DKioMELtFQgLgScE → rfl8V4U-KWtyivUflJxQF}/_ssgManifest.js +0 -0
package/dist/links-BTx7dmFj.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { m as resolveRequiredHomeDir, p as expandHomePrefix } from "./entry.js";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import fs from "node:fs";
|
|
5
|
-
|
|
6
|
-
//#region src/utils.ts
|
|
7
|
-
/**
|
|
8
|
-
* Escapes special regex characters in a string so it can be used in a RegExp constructor.
|
|
9
|
-
*/
|
|
10
|
-
function escapeRegExp(value) {
|
|
11
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
12
|
-
}
|
|
13
|
-
function resolveUserPath(input) {
|
|
14
|
-
const trimmed = input.trim();
|
|
15
|
-
if (!trimmed) return trimmed;
|
|
16
|
-
if (trimmed.startsWith("~")) {
|
|
17
|
-
const expanded = expandHomePrefix(trimmed, {
|
|
18
|
-
home: resolveRequiredHomeDir(process.env, os.homedir),
|
|
19
|
-
env: process.env,
|
|
20
|
-
homedir: os.homedir
|
|
21
|
-
});
|
|
22
|
-
return path.resolve(expanded);
|
|
23
|
-
}
|
|
24
|
-
return path.resolve(trimmed);
|
|
25
|
-
}
|
|
26
|
-
function resolveConfigDir(env = process.env, homedir = os.homedir) {
|
|
27
|
-
const override = env.OPENCLAW_STATE_DIR?.trim() || env.CLAWDBOT_STATE_DIR?.trim();
|
|
28
|
-
if (override) return resolveUserPath(override);
|
|
29
|
-
const newDir = path.join(resolveRequiredHomeDir(env, homedir), ".openclaw");
|
|
30
|
-
try {
|
|
31
|
-
if (fs.existsSync(newDir)) return newDir;
|
|
32
|
-
} catch {}
|
|
33
|
-
return newDir;
|
|
34
|
-
}
|
|
35
|
-
function formatTerminalLink(label, url, opts) {
|
|
36
|
-
const esc = "\x1B";
|
|
37
|
-
const safeLabel = label.replaceAll(esc, "");
|
|
38
|
-
const safeUrl = url.replaceAll(esc, "");
|
|
39
|
-
if (!(opts?.force === true ? true : opts?.force === false ? false : Boolean(process.stdout.isTTY))) return opts?.fallback ?? `${safeLabel} (${safeUrl})`;
|
|
40
|
-
return `\u001b]8;;${safeUrl}\u0007${safeLabel}\u001b]8;;\u0007`;
|
|
41
|
-
}
|
|
42
|
-
const CONFIG_DIR = resolveConfigDir();
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
|
-
//#region src/terminal/links.ts
|
|
46
|
-
const DOCS_ROOT = "https://docs.openclaw.ai";
|
|
47
|
-
function formatDocsLink(path, label, opts) {
|
|
48
|
-
const trimmed = path.trim();
|
|
49
|
-
const url = trimmed.startsWith("http") ? trimmed : `${DOCS_ROOT}${trimmed.startsWith("/") ? trimmed : `/${trimmed}`}`;
|
|
50
|
-
return formatTerminalLink(label ?? url, url, {
|
|
51
|
-
fallback: opts?.fallback ?? url,
|
|
52
|
-
force: opts?.force
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
//#endregion
|
|
57
|
-
export { escapeRegExp as n, formatDocsLink as t };
|
package/dist/program-DahL9wBm.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { c as getPrimaryCommand, d as hasRootVersionAlias, l as hasFlag, o as buildParseArgv } from "./entry.js";
|
|
2
|
-
import { n as escapeRegExp, t as formatDocsLink } from "./links-BTx7dmFj.js";
|
|
3
|
-
import { a as hasEmittedCliBanner, i as formatCliBannerLine, n as resolveCliName, o as VERSION, t as replaceCliName } from "./cli-name-DUQ-cavN.js";
|
|
4
|
-
import { n as theme, t as isRich } from "./theme-uCBEEejb.js";
|
|
5
|
-
import fs from "node:fs";
|
|
6
|
-
import { Command } from "commander";
|
|
7
|
-
|
|
8
|
-
//#region src/infra/ports-lsof.ts
|
|
9
|
-
const LSOF_CANDIDATES = process.platform === "darwin" ? ["/usr/sbin/lsof", "/usr/bin/lsof"] : ["/usr/bin/lsof", "/usr/sbin/lsof"];
|
|
10
|
-
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/cli/program/helpers.ts
|
|
13
|
-
function resolveActionArgs(actionCommand) {
|
|
14
|
-
if (!actionCommand) return [];
|
|
15
|
-
const args = actionCommand.args;
|
|
16
|
-
return Array.isArray(args) ? args : [];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/cli/program/action-reparse.ts
|
|
21
|
-
async function reparseProgramFromActionArgs(program, actionArgs) {
|
|
22
|
-
const actionCommand = actionArgs.at(-1);
|
|
23
|
-
const rawArgs = (actionCommand?.parent ?? program).rawArgs;
|
|
24
|
-
const actionArgsList = resolveActionArgs(actionCommand);
|
|
25
|
-
const fallbackArgv = actionCommand?.name() ? [actionCommand.name(), ...actionArgsList] : actionArgsList;
|
|
26
|
-
const parseArgv = buildParseArgv({
|
|
27
|
-
programName: program.name(),
|
|
28
|
-
rawArgs,
|
|
29
|
-
fallbackArgv
|
|
30
|
-
});
|
|
31
|
-
await program.parseAsync(parseArgv);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/cli/program/command-tree.ts
|
|
36
|
-
function removeCommand(program, command) {
|
|
37
|
-
const commands = program.commands;
|
|
38
|
-
const index = commands.indexOf(command);
|
|
39
|
-
if (index < 0) return false;
|
|
40
|
-
commands.splice(index, 1);
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
function removeCommandByName(program, name) {
|
|
44
|
-
const existing = program.commands.find((command) => command.name() === name);
|
|
45
|
-
if (!existing) return false;
|
|
46
|
-
return removeCommand(program, existing);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/cli/program/command-registry.ts
|
|
51
|
-
const BOOTSTRAP_ENTRY = {
|
|
52
|
-
name: "bootstrap",
|
|
53
|
-
description: "Bootstrap DenchClaw + OpenClaw and launch the web UI",
|
|
54
|
-
register: async ({ program }) => {
|
|
55
|
-
(await import("./register.bootstrap-D9YhQgaK.js")).registerBootstrapCommand(program);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
function registerLazyBootstrap(program, ctx) {
|
|
59
|
-
const placeholder = program.command(BOOTSTRAP_ENTRY.name).description(BOOTSTRAP_ENTRY.description);
|
|
60
|
-
placeholder.allowUnknownOption(true);
|
|
61
|
-
placeholder.allowExcessArguments(true);
|
|
62
|
-
placeholder.action(async (...actionArgs) => {
|
|
63
|
-
removeCommandByName(program, BOOTSTRAP_ENTRY.name);
|
|
64
|
-
await BOOTSTRAP_ENTRY.register({
|
|
65
|
-
program,
|
|
66
|
-
ctx,
|
|
67
|
-
argv: process.argv
|
|
68
|
-
});
|
|
69
|
-
await reparseProgramFromActionArgs(program, actionArgs);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
function getCoreCliCommandsWithSubcommands() {
|
|
73
|
-
return [];
|
|
74
|
-
}
|
|
75
|
-
function registerCoreCliCommands(program, ctx, argv) {
|
|
76
|
-
const primary = getPrimaryCommand(argv);
|
|
77
|
-
if (primary && primary !== BOOTSTRAP_ENTRY.name) return;
|
|
78
|
-
registerLazyBootstrap(program, ctx);
|
|
79
|
-
}
|
|
80
|
-
function registerProgramCommands(program, ctx, argv = process.argv) {
|
|
81
|
-
registerCoreCliCommands(program, ctx, argv);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/cli/program/context.ts
|
|
86
|
-
function createProgramContext() {
|
|
87
|
-
const channelOptions = ["web"];
|
|
88
|
-
return {
|
|
89
|
-
programVersion: VERSION,
|
|
90
|
-
channelOptions,
|
|
91
|
-
messageChannelOptions: channelOptions.join("|"),
|
|
92
|
-
agentChannelOptions: ["last", ...channelOptions].join("|")
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region src/cli/program/help.ts
|
|
98
|
-
const CLI_NAME = resolveCliName();
|
|
99
|
-
const CLI_NAME_PATTERN = escapeRegExp(CLI_NAME);
|
|
100
|
-
const ROOT_COMMANDS_WITH_SUBCOMMANDS = new Set(getCoreCliCommandsWithSubcommands());
|
|
101
|
-
const ROOT_COMMANDS_HINT = "Hint: commands suffixed with * have subcommands. Run <command> --help for details.";
|
|
102
|
-
const EXAMPLES = [
|
|
103
|
-
["openclaw models --help", "Show detailed help for the models command."],
|
|
104
|
-
["openclaw channels login --verbose", "Link personal WhatsApp Web and show QR + connection logs."],
|
|
105
|
-
["openclaw message send --target +15555550123 --message \"Hi\" --json", "Send via your web session and print JSON result."],
|
|
106
|
-
["openclaw gateway --port 18789", "Run the WebSocket Gateway locally."],
|
|
107
|
-
["openclaw --profile team-a gateway", "Compatibility flag example: warns and still runs with --profile dench."],
|
|
108
|
-
["openclaw gateway --force", "Kill anything bound to the default gateway port, then start it."],
|
|
109
|
-
["openclaw gateway ...", "Gateway control via WebSocket."],
|
|
110
|
-
["openclaw agent --to +15555550123 --message \"Run summary\" --deliver", "Talk directly to the agent using the Gateway; optionally send the WhatsApp reply."],
|
|
111
|
-
["openclaw message send --channel telegram --target @mychat --message \"Hi\"", "Send via your Telegram bot."]
|
|
112
|
-
];
|
|
113
|
-
function configureProgramHelp(program, ctx) {
|
|
114
|
-
program.name(CLI_NAME).description("").version(ctx.programVersion).option("--dev", "Compatibility flag; DenchClaw always uses --profile dench and ~/.openclaw-dench").option("--profile <name>", "Compatibility flag; non-dench values are ignored with a warning");
|
|
115
|
-
program.option("--no-color", "Disable ANSI colors", false);
|
|
116
|
-
program.helpOption("-h, --help", "Display help for command");
|
|
117
|
-
program.helpCommand("help [command]", "Display help for command");
|
|
118
|
-
program.configureHelp({
|
|
119
|
-
sortSubcommands: true,
|
|
120
|
-
sortOptions: true,
|
|
121
|
-
optionTerm: (option) => theme.option(option.flags),
|
|
122
|
-
subcommandTerm: (cmd) => {
|
|
123
|
-
const hasSubcommands = cmd.parent === program && ROOT_COMMANDS_WITH_SUBCOMMANDS.has(cmd.name());
|
|
124
|
-
return theme.command(hasSubcommands ? `${cmd.name()} *` : cmd.name());
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
const formatHelpOutput = (str) => {
|
|
128
|
-
let output = str;
|
|
129
|
-
if (new RegExp(`^Usage:\\s+${CLI_NAME_PATTERN}\\s+\\[options\\]\\s+\\[command\\]\\s*$`, "m").test(output) && /^Commands:/m.test(output)) output = output.replace(/^Commands:/m, `Commands:\n ${theme.muted(ROOT_COMMANDS_HINT)}`);
|
|
130
|
-
return output.replace(/^Usage:/gm, theme.heading("Usage:")).replace(/^Options:/gm, theme.heading("Options:")).replace(/^Commands:/gm, theme.heading("Commands:"));
|
|
131
|
-
};
|
|
132
|
-
program.configureOutput({
|
|
133
|
-
writeOut: (str) => {
|
|
134
|
-
process.stdout.write(formatHelpOutput(str));
|
|
135
|
-
},
|
|
136
|
-
writeErr: (str) => {
|
|
137
|
-
process.stderr.write(formatHelpOutput(str));
|
|
138
|
-
},
|
|
139
|
-
outputError: (str, write) => write(theme.error(str))
|
|
140
|
-
});
|
|
141
|
-
if (hasFlag(process.argv, "-V") || hasFlag(process.argv, "--version") || hasRootVersionAlias(process.argv)) {
|
|
142
|
-
console.log(ctx.programVersion);
|
|
143
|
-
process.exit(0);
|
|
144
|
-
}
|
|
145
|
-
program.addHelpText("beforeAll", () => {
|
|
146
|
-
if (hasEmittedCliBanner()) return "";
|
|
147
|
-
const rich = isRich();
|
|
148
|
-
return `\n${formatCliBannerLine(ctx.programVersion, { richTty: rich })}\n`;
|
|
149
|
-
});
|
|
150
|
-
const fmtExamples = EXAMPLES.map(([cmd, desc]) => ` ${theme.command(replaceCliName(cmd, CLI_NAME))}\n ${theme.muted(desc)}`).join("\n");
|
|
151
|
-
program.addHelpText("afterAll", ({ command }) => {
|
|
152
|
-
if (command !== program) return "";
|
|
153
|
-
const docs = formatDocsLink("/cli", "docs.openclaw.ai/cli");
|
|
154
|
-
return `\n${theme.heading("Examples:")}\n${fmtExamples}\n\n${theme.muted("Docs:")} ${docs}\n`;
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
//#endregion
|
|
159
|
-
//#region src/cli/program/preaction.ts
|
|
160
|
-
function setProcessTitleForCommand(actionCommand) {
|
|
161
|
-
let current = actionCommand;
|
|
162
|
-
while (current.parent && current.parent.parent) current = current.parent;
|
|
163
|
-
const name = current.name();
|
|
164
|
-
const cliName = resolveCliName();
|
|
165
|
-
if (!name || name === cliName) return;
|
|
166
|
-
process.title = `${cliName}-${name}`;
|
|
167
|
-
}
|
|
168
|
-
function registerPreActionHooks(program, programVersion) {
|
|
169
|
-
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
170
|
-
setProcessTitleForCommand(actionCommand);
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
//#endregion
|
|
175
|
-
//#region src/cli/program/program-context.ts
|
|
176
|
-
const PROGRAM_CONTEXT_SYMBOL = Symbol.for("openclaw.cli.programContext");
|
|
177
|
-
function setProgramContext(program, ctx) {
|
|
178
|
-
program[PROGRAM_CONTEXT_SYMBOL] = ctx;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
//#endregion
|
|
182
|
-
//#region src/cli/program/build-program.ts
|
|
183
|
-
function buildProgram() {
|
|
184
|
-
const program = new Command();
|
|
185
|
-
const ctx = createProgramContext();
|
|
186
|
-
const argv = process.argv;
|
|
187
|
-
setProgramContext(program, ctx);
|
|
188
|
-
configureProgramHelp(program, ctx);
|
|
189
|
-
registerPreActionHooks(program, ctx.programVersion);
|
|
190
|
-
registerProgramCommands(program, ctx, argv);
|
|
191
|
-
return program;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
//#endregion
|
|
195
|
-
export { buildProgram };
|