denchclaw 2.0.0 → 2.0.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/apps/web/.next/standalone/apps/web/.next/BUILD_ID +1 -1
- package/apps/web/.next/standalone/apps/web/.next/app-build-manifest.json +102 -102
- package/apps/web/.next/standalone/apps/web/.next/app-path-routes-manifest.json +34 -34
- 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/page_client-reference-manifest.js +1 -1
- 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/chat/active/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/stop/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/stream/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/chat/subagents/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/jobs/[jobId]/runs/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/jobs/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/runs/[sessionId]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/cron/runs/search-transcript/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/memories/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/profiles/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/profiles/switch/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/sessions/[sessionId]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/sessions/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/web-sessions/[id]/messages/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/web-sessions/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/web-sessions/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/assets/[...path]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/browse/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/browse-file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/context/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/copy/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/db/introspect/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/db/query/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/delete/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/init/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/list/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/mkdir/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/move/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/display-field/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/[id]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/bulk-delete/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/options/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/entries/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/fields/[fieldId]/enum-rename/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/fields/[fieldId]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/fields/reorder/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/objects/[name]/views/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/open-file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/path-info/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/query/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/raw-file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/rename/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/reports/execute/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/search-index/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/suggest-files/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/switch/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/thumbnail/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/tree/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/upload/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/virtual-file/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/watch/route_client-reference-manifest.js +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app/api/workspace/write-binary/route_client-reference-manifest.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/page_client-reference-manifest.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 +1 -1
- package/apps/web/.next/standalone/apps/web/.next/server/app-paths-manifest.json +34 -34
- package/apps/web/.next/standalone/apps/web/.next/server/functions-config-manifest.json +19 -19
- 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/package.json +2 -2
- package/dist/{cli-name-DUQ-cavN.js → cli-name-8WJ6gVD5.js} +36 -3
- package/dist/entry.js +2 -21
- package/dist/{register.bootstrap-D9YhQgaK.js → program-DhxRjAOe.js} +926 -91
- package/dist/{run-main-buUOQk0k.js → run-main-oHgYgpCR.js} +5 -6
- package/package.json +2 -2
- package/dist/links-BTx7dmFj.js +0 -57
- package/dist/program-DahL9wBm.js +0 -195
- package/dist/theme-uCBEEejb.js +0 -36
- /package/apps/web/.next/standalone/apps/web/.next/static/{oOwR1DKioMELtFQgLgScE → InPdqFM6GAVmsiSfDz98A}/_buildManifest.js +0 -0
- /package/apps/web/.next/standalone/apps/web/.next/static/{oOwR1DKioMELtFQgLgScE → InPdqFM6GAVmsiSfDz98A}/_ssgManifest.js +0 -0
- /package/apps/web/.next/static/{oOwR1DKioMELtFQgLgScE → InPdqFM6GAVmsiSfDz98A}/_buildManifest.js +0 -0
- /package/apps/web/.next/static/{oOwR1DKioMELtFQgLgScE → InPdqFM6GAVmsiSfDz98A}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { a as normalizeWindowsArgv,
|
|
2
|
-
import { n as resolveCliName, o as VERSION, r as emitCliBanner } from "./cli-name-
|
|
3
|
-
import "./theme-uCBEEejb.js";
|
|
1
|
+
import { a as normalizeWindowsArgv, l as hasHelpOrVersion, n as normalizeEnv, o as getCommandPath, s as getPrimaryCommand, t as isTruthyEnvValue } from "./entry.js";
|
|
2
|
+
import { n as resolveCliName, o as VERSION, r as emitCliBanner } from "./cli-name-8WJ6gVD5.js";
|
|
4
3
|
import { spawn } from "node:child_process";
|
|
5
4
|
import process$1 from "node:process";
|
|
6
5
|
import os from "node:os";
|
|
@@ -175,7 +174,7 @@ function shouldDelegateToGlobalOpenClaw(argv, env = process$1.env) {
|
|
|
175
174
|
if (isDelegationDisabled(env)) return false;
|
|
176
175
|
const primary = getPrimaryCommand(argv);
|
|
177
176
|
if (!primary) return false;
|
|
178
|
-
return primary !== "bootstrap";
|
|
177
|
+
return primary !== "bootstrap" && primary !== "update" && primary !== "stop";
|
|
179
178
|
}
|
|
180
179
|
async function delegateToGlobalOpenClaw(argv) {
|
|
181
180
|
if (isTruthyEnvValue(process$1.env.DENCHCLAW_DELEGATED) || isTruthyEnvValue(process$1.env.OPENCLAW_DELEGATED)) throw new Error("OpenClaw delegation loop detected. Check PATH so `openclaw` resolves to the global OpenClaw CLI.");
|
|
@@ -211,13 +210,13 @@ async function runCli(argv = process$1.argv) {
|
|
|
211
210
|
if (shouldEnsureCliPath(normalizedArgv)) ensureOpenClawCliOnPath();
|
|
212
211
|
assertSupportedRuntime();
|
|
213
212
|
const commandPath = getCommandPath(normalizedArgv, 2);
|
|
214
|
-
if (!(isTruthyEnvValue(process$1.env.DENCHCLAW_HIDE_BANNER) || isTruthyEnvValue(process$1.env.OPENCLAW_HIDE_BANNER) || commandPath[0] === "update" || commandPath[0] === "completion" || commandPath[0] === "plugins" && commandPath[1] === "update")) await emitCliBanner(VERSION, { argv: normalizedArgv });
|
|
213
|
+
if (!(isTruthyEnvValue(process$1.env.DENCHCLAW_HIDE_BANNER) || isTruthyEnvValue(process$1.env.OPENCLAW_HIDE_BANNER) || commandPath[0] === "update" || commandPath[0] === "stop" || commandPath[0] === "completion" || commandPath[0] === "plugins" && commandPath[1] === "update")) await emitCliBanner(VERSION, { argv: normalizedArgv });
|
|
215
214
|
const parseArgv = rewriteBareArgvToBootstrap(rewriteUpdateFlagArgv(normalizedArgv));
|
|
216
215
|
if (shouldDelegateToGlobalOpenClaw(parseArgv)) {
|
|
217
216
|
process$1.exitCode = await delegateToGlobalOpenClaw(parseArgv);
|
|
218
217
|
return;
|
|
219
218
|
}
|
|
220
|
-
const { buildProgram } = await import("./program-
|
|
219
|
+
const { buildProgram } = await import("./program-DhxRjAOe.js");
|
|
221
220
|
await buildProgram().parseAsync(parseArgv);
|
|
222
221
|
}
|
|
223
222
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "denchclaw",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "AI-powered CRM platform with multi-channel agent gateway, DuckDB workspace, and knowledge management",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/openclaw/openclaw#readme",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"prepack": "pnpm build && pnpm web:build && pnpm web:prepack",
|
|
46
46
|
"start": "node denchclaw.mjs",
|
|
47
47
|
"test": "pnpm test:cli && pnpm --dir apps/web test",
|
|
48
|
-
"test:cli": "vitest run --config vitest.unit.config.ts src/cli/run-main.test.ts src/cli/bootstrap-external.test.ts src/cli/bootstrap-external.bootstrap-command.test.ts src/cli/workspace-seed.test.ts",
|
|
48
|
+
"test:cli": "vitest run --config vitest.unit.config.ts src/cli/run-main.test.ts src/cli/bootstrap-external.test.ts src/cli/bootstrap-external.bootstrap-command.test.ts src/cli/workspace-seed.test.ts src/cli/web-runtime.test.ts src/cli/web-runtime-command.test.ts",
|
|
49
49
|
"test:web": "pnpm --dir apps/web test",
|
|
50
50
|
"web:build": "pnpm --dir apps/web build",
|
|
51
51
|
"web:dev": "pnpm --dir apps/web dev",
|
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 };
|
package/dist/theme-uCBEEejb.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import chalk, { Chalk } from "chalk";
|
|
2
|
-
|
|
3
|
-
//#region src/terminal/palette.ts
|
|
4
|
-
const IRON_PALETTE = {
|
|
5
|
-
accent: "#9CA3AF",
|
|
6
|
-
accentBright: "#D1D5DB",
|
|
7
|
-
accentDim: "#6B7280",
|
|
8
|
-
info: "#93C5FD",
|
|
9
|
-
success: "#34D399",
|
|
10
|
-
warn: "#FBBF24",
|
|
11
|
-
error: "#F87171",
|
|
12
|
-
muted: "#6B7280"
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/terminal/theme.ts
|
|
17
|
-
const hasForceColor = typeof process.env.FORCE_COLOR === "string" && process.env.FORCE_COLOR.trim().length > 0 && process.env.FORCE_COLOR.trim() !== "0";
|
|
18
|
-
const baseChalk = process.env.NO_COLOR && !hasForceColor ? new Chalk({ level: 0 }) : chalk;
|
|
19
|
-
const hex = (value) => baseChalk.hex(value);
|
|
20
|
-
const theme = {
|
|
21
|
-
accent: hex(IRON_PALETTE.accent),
|
|
22
|
-
accentBright: hex(IRON_PALETTE.accentBright),
|
|
23
|
-
accentDim: hex(IRON_PALETTE.accentDim),
|
|
24
|
-
info: hex(IRON_PALETTE.info),
|
|
25
|
-
success: hex(IRON_PALETTE.success),
|
|
26
|
-
warn: hex(IRON_PALETTE.warn),
|
|
27
|
-
error: hex(IRON_PALETTE.error),
|
|
28
|
-
muted: hex(IRON_PALETTE.muted),
|
|
29
|
-
heading: baseChalk.bold.hex(IRON_PALETTE.accent),
|
|
30
|
-
command: hex(IRON_PALETTE.accentBright),
|
|
31
|
-
option: hex(IRON_PALETTE.warn)
|
|
32
|
-
};
|
|
33
|
-
const isRich = () => Boolean(baseChalk.level > 0);
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
export { theme as n, isRich as t };
|
|
File without changes
|
|
File without changes
|
/package/apps/web/.next/static/{oOwR1DKioMELtFQgLgScE → InPdqFM6GAVmsiSfDz98A}/_buildManifest.js
RENAMED
|
File without changes
|
/package/apps/web/.next/static/{oOwR1DKioMELtFQgLgScE → InPdqFM6GAVmsiSfDz98A}/_ssgManifest.js
RENAMED
|
File without changes
|