mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
refactor: move terminal core into package (#88279)
* refactor: move terminal core into package * refactor: move terminal module files * fix: clean terminal package CI followups * test: update lint suppression allowlist * fix: ship terminal core runtime aliases
This commit is contained in:
committed by
GitHub
parent
7b699fddac
commit
de1dfab03e
@@ -184,6 +184,10 @@ const config = {
|
||||
entry: ["src/*.ts!"],
|
||||
project: ["src/**/*.ts!"],
|
||||
},
|
||||
"packages/terminal-core": {
|
||||
entry: ["src/*.ts!"],
|
||||
project: ["src/**/*.ts!"],
|
||||
},
|
||||
"packages/speech-core": {
|
||||
entry: ["api.ts!", "runtime-api.ts!", "speaker.ts!", "voice-models.ts!"],
|
||||
project: ["**/*.ts!"],
|
||||
|
||||
@@ -150,6 +150,63 @@
|
||||
"@openclaw/media-generation-core/*": [
|
||||
"../dist/plugin-sdk/packages/media-generation-core/src/*.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/index.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/ansi": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/ansi.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/decorative-emoji": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/decorative-emoji.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/health-style": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/health-style.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/links": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/links.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/note": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/note.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/osc-progress": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/osc-progress.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/palette": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/palette.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/progress-line": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/progress-line.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/prompt-select-styled": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/prompt-select-styled.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/prompt-select-styled-params": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/prompt-select-styled-params.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/prompt-style": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/prompt-style.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/restore": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/restore.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/safe-text": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/safe-text.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/stream-writer": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/stream-writer.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/table": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/table.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/terminal-link": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/terminal-link.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/theme": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/theme.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/*": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/*.d.ts"
|
||||
],
|
||||
"@openclaw/*.js": ["../packages/plugin-sdk/dist/extensions/*.d.ts", "../extensions/*"],
|
||||
"@openclaw/*": ["../packages/plugin-sdk/dist/extensions/*", "../extensions/*"],
|
||||
"openclaw/plugin-sdk/qa-channel": ["../dist/plugin-sdk/src/plugin-sdk/qa-channel.d.ts"],
|
||||
|
||||
@@ -159,6 +159,63 @@
|
||||
"@openclaw/media-generation-core/*": [
|
||||
"../../dist/plugin-sdk/packages/media-generation-core/src/*.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/index.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/ansi": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/ansi.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/decorative-emoji": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/decorative-emoji.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/health-style": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/health-style.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/links": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/links.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/note": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/note.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/osc-progress": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/osc-progress.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/palette": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/palette.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/progress-line": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/progress-line.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/prompt-select-styled": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/prompt-select-styled.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/prompt-select-styled-params": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/prompt-select-styled-params.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/prompt-style": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/prompt-style.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/restore": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/restore.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/safe-text": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/safe-text.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/stream-writer": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/stream-writer.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/table": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/table.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/terminal-link": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/terminal-link.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/theme": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/theme.d.ts"
|
||||
],
|
||||
"@openclaw/terminal-core/*": [
|
||||
"../../dist/plugin-sdk/packages/terminal-core/src/*.d.ts"
|
||||
],
|
||||
"@openclaw/*.js": ["../../packages/plugin-sdk/dist/extensions/*.d.ts", "../*"],
|
||||
"@openclaw/*": ["../*"],
|
||||
"openclaw/plugin-sdk/qa-channel": [
|
||||
|
||||
@@ -140,8 +140,8 @@ export { parseAgentSessionKey } from "../../../../src/routing/session-key.js";
|
||||
export { hasInterSessionUserProvenance } from "../../../../src/sessions/input-provenance.js";
|
||||
export { isCronRunSessionKey } from "../../../../src/sessions/session-key-utils.js";
|
||||
export { onSessionTranscriptUpdate } from "../../../../src/sessions/transcript-events.js";
|
||||
export { formatDocsLink } from "../../../../src/terminal/links.js";
|
||||
export { colorize, isRich, theme } from "../../../../src/terminal/theme.js";
|
||||
export { formatDocsLink } from "../../../terminal-core/src/links.js";
|
||||
export { colorize, isRich, theme } from "../../../terminal-core/src/theme.js";
|
||||
export { CHARS_PER_TOKEN_ESTIMATE, estimateStringChars } from "../../../../src/utils/cjk-chars.js";
|
||||
export { runTasksWithConcurrency } from "../../../../src/utils/run-with-concurrency.js";
|
||||
export { splitShellArgs } from "../../../../src/utils/shell-argv.js";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"include": [
|
||||
"../../packages/markdown-core/src/**/*.ts",
|
||||
"../../packages/media-generation-core/src/**/*.ts",
|
||||
"../../packages/terminal-core/src/**/*.ts",
|
||||
"../../src/plugin-sdk/**/*.ts",
|
||||
"../../src/video-generation/dashscope-compatible.ts",
|
||||
"../../src/video-generation/types.ts",
|
||||
|
||||
107
packages/terminal-core/package.json
Normal file
107
packages/terminal-core/package.json
Normal file
@@ -0,0 +1,107 @@
|
||||
{
|
||||
"name": "@openclaw/terminal-core",
|
||||
"version": "0.0.0-private",
|
||||
"private": true,
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"type": "module",
|
||||
"main": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.mts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"import": "./dist/index.mjs",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"./ansi": {
|
||||
"types": "./dist/ansi.d.mts",
|
||||
"import": "./dist/ansi.mjs",
|
||||
"default": "./dist/ansi.mjs"
|
||||
},
|
||||
"./decorative-emoji": {
|
||||
"types": "./dist/decorative-emoji.d.mts",
|
||||
"import": "./dist/decorative-emoji.mjs",
|
||||
"default": "./dist/decorative-emoji.mjs"
|
||||
},
|
||||
"./health-style": {
|
||||
"types": "./dist/health-style.d.mts",
|
||||
"import": "./dist/health-style.mjs",
|
||||
"default": "./dist/health-style.mjs"
|
||||
},
|
||||
"./links": {
|
||||
"types": "./dist/links.d.mts",
|
||||
"import": "./dist/links.mjs",
|
||||
"default": "./dist/links.mjs"
|
||||
},
|
||||
"./note": {
|
||||
"types": "./dist/note.d.mts",
|
||||
"import": "./dist/note.mjs",
|
||||
"default": "./dist/note.mjs"
|
||||
},
|
||||
"./osc-progress": {
|
||||
"types": "./dist/osc-progress.d.mts",
|
||||
"import": "./dist/osc-progress.mjs",
|
||||
"default": "./dist/osc-progress.mjs"
|
||||
},
|
||||
"./palette": {
|
||||
"types": "./dist/palette.d.mts",
|
||||
"import": "./dist/palette.mjs",
|
||||
"default": "./dist/palette.mjs"
|
||||
},
|
||||
"./progress-line": {
|
||||
"types": "./dist/progress-line.d.mts",
|
||||
"import": "./dist/progress-line.mjs",
|
||||
"default": "./dist/progress-line.mjs"
|
||||
},
|
||||
"./prompt-select-styled": {
|
||||
"types": "./dist/prompt-select-styled.d.mts",
|
||||
"import": "./dist/prompt-select-styled.mjs",
|
||||
"default": "./dist/prompt-select-styled.mjs"
|
||||
},
|
||||
"./prompt-select-styled-params": {
|
||||
"types": "./dist/prompt-select-styled-params.d.mts",
|
||||
"import": "./dist/prompt-select-styled-params.mjs",
|
||||
"default": "./dist/prompt-select-styled-params.mjs"
|
||||
},
|
||||
"./prompt-style": {
|
||||
"types": "./dist/prompt-style.d.mts",
|
||||
"import": "./dist/prompt-style.mjs",
|
||||
"default": "./dist/prompt-style.mjs"
|
||||
},
|
||||
"./restore": {
|
||||
"types": "./dist/restore.d.mts",
|
||||
"import": "./dist/restore.mjs",
|
||||
"default": "./dist/restore.mjs"
|
||||
},
|
||||
"./safe-text": {
|
||||
"types": "./dist/safe-text.d.mts",
|
||||
"import": "./dist/safe-text.mjs",
|
||||
"default": "./dist/safe-text.mjs"
|
||||
},
|
||||
"./stream-writer": {
|
||||
"types": "./dist/stream-writer.d.mts",
|
||||
"import": "./dist/stream-writer.mjs",
|
||||
"default": "./dist/stream-writer.mjs"
|
||||
},
|
||||
"./table": {
|
||||
"types": "./dist/table.d.mts",
|
||||
"import": "./dist/table.mjs",
|
||||
"default": "./dist/table.mjs"
|
||||
},
|
||||
"./terminal-link": {
|
||||
"types": "./dist/terminal-link.d.mts",
|
||||
"import": "./dist/terminal-link.mjs",
|
||||
"default": "./dist/terminal-link.mjs"
|
||||
},
|
||||
"./theme": {
|
||||
"types": "./dist/theme.d.mts",
|
||||
"import": "./dist/theme.mjs",
|
||||
"default": "./dist/theme.mjs"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@clack/prompts": "1.4.0",
|
||||
"chalk": "5.6.2"
|
||||
}
|
||||
}
|
||||
72
packages/terminal-core/src/display-string.ts
Normal file
72
packages/terminal-core/src/display-string.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
function normalize(value: string | undefined): string | undefined {
|
||||
const trimmed = value?.trim();
|
||||
return trimmed && trimmed !== "undefined" && trimmed !== "null" ? trimmed : undefined;
|
||||
}
|
||||
|
||||
function normalizeSafe(fn: () => string | undefined): string | undefined {
|
||||
try {
|
||||
return normalize(fn());
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
function resolveTermuxHome(env: NodeJS.ProcessEnv): string | undefined {
|
||||
const prefix = normalize(env.PREFIX);
|
||||
if (!prefix || !normalize(env.ANDROID_DATA)) {
|
||||
return undefined;
|
||||
}
|
||||
if (!/(?:^|\/)com\.termux\/files\/usr\/?$/u.test(prefix.replace(/\\/gu, "/"))) {
|
||||
return undefined;
|
||||
}
|
||||
return path.resolve(prefix, "..", "home");
|
||||
}
|
||||
|
||||
function resolveRawOsHomeDir(env: NodeJS.ProcessEnv, homedir: () => string): string | undefined {
|
||||
return (
|
||||
normalize(env.HOME) ??
|
||||
normalize(env.USERPROFILE) ??
|
||||
resolveTermuxHome(env) ??
|
||||
normalizeSafe(homedir)
|
||||
);
|
||||
}
|
||||
|
||||
function resolveRawHomeDir(
|
||||
env: NodeJS.ProcessEnv = process.env,
|
||||
homedir: () => string = os.homedir,
|
||||
): string | undefined {
|
||||
const explicitHome = normalize(env.OPENCLAW_HOME);
|
||||
if (explicitHome) {
|
||||
const fallbackHome = resolveRawOsHomeDir(env, homedir);
|
||||
return fallbackHome ? explicitHome.replace(/^~(?=$|[\\/])/, fallbackHome) : explicitHome;
|
||||
}
|
||||
return resolveRawOsHomeDir(env, homedir);
|
||||
}
|
||||
|
||||
function resolveEffectiveHomeDir(
|
||||
env: NodeJS.ProcessEnv = process.env,
|
||||
homedir: () => string = os.homedir,
|
||||
): string | undefined {
|
||||
const raw = resolveRawHomeDir(env, homedir);
|
||||
return raw ? path.resolve(raw) : undefined;
|
||||
}
|
||||
|
||||
function resolveHomeDisplayPrefix(): { home: string; prefix: string } | undefined {
|
||||
const home = resolveEffectiveHomeDir();
|
||||
if (!home) {
|
||||
return undefined;
|
||||
}
|
||||
const explicitHome = process.env.OPENCLAW_HOME?.trim();
|
||||
return explicitHome ? { home, prefix: "$OPENCLAW_HOME" } : { home, prefix: "~" };
|
||||
}
|
||||
|
||||
export function displayString(input: string): string {
|
||||
if (!input) {
|
||||
return input;
|
||||
}
|
||||
const display = resolveHomeDisplayPrefix();
|
||||
return display ? input.split(display.home).join(display.prefix) : input;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
|
||||
import { normalizeLowercaseStringOrEmpty } from "./string.js";
|
||||
import { theme } from "./theme.js";
|
||||
|
||||
export function styleHealthChannelLine(line: string, rich: boolean): string {
|
||||
17
packages/terminal-core/src/index.ts
Normal file
17
packages/terminal-core/src/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export * from "./ansi.js";
|
||||
export * from "./decorative-emoji.js";
|
||||
export * from "./health-style.js";
|
||||
export * from "./links.js";
|
||||
export * from "./note.js";
|
||||
export * from "./osc-progress.js";
|
||||
export * from "./palette.js";
|
||||
export * from "./progress-line.js";
|
||||
export * from "./prompt-select-styled.js";
|
||||
export * from "./prompt-select-styled-params.js";
|
||||
export * from "./prompt-style.js";
|
||||
export * from "./restore.js";
|
||||
export * from "./safe-text.js";
|
||||
export * from "./stream-writer.js";
|
||||
export * from "./table.js";
|
||||
export * from "./terminal-link.js";
|
||||
export * from "./theme.js";
|
||||
@@ -1,8 +1,8 @@
|
||||
import { AsyncLocalStorage } from "node:async_hooks";
|
||||
import { note as clackNote } from "@clack/prompts";
|
||||
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
|
||||
import { visibleWidth } from "./ansi.js";
|
||||
import { stylePromptTitle } from "./prompt-style.js";
|
||||
import { normalizeLowercaseStringOrEmpty } from "./string.js";
|
||||
|
||||
const MIN_NOTE_COLUMNS = 80;
|
||||
const URL_PREFIX_RE = /^(https?:\/\/|file:\/\/)/i;
|
||||
6
packages/terminal-core/src/string.ts
Normal file
6
packages/terminal-core/src/string.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export function normalizeLowercaseStringOrEmpty(value: unknown): string {
|
||||
if (typeof value !== "string") {
|
||||
return "";
|
||||
}
|
||||
return value.trim().toLowerCase();
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { mockProcessPlatform } from "../test-utils/vitest-spies.js";
|
||||
import { visibleWidth } from "./ansi.js";
|
||||
import { resolveNoteColumns, wrapNoteMessage } from "./note.js";
|
||||
import { renderTable } from "./table.js";
|
||||
|
||||
function mockProcessPlatform(platform: NodeJS.Platform): void {
|
||||
vi.spyOn(process, "platform", "get").mockReturnValue(platform);
|
||||
}
|
||||
|
||||
describe("renderTable", () => {
|
||||
afterEach(() => {
|
||||
vi.unstubAllEnvs();
|
||||
@@ -1,5 +1,5 @@
|
||||
import { displayString } from "../utils.js";
|
||||
import { splitGraphemes, visibleWidth } from "./ansi.js";
|
||||
import { displayString } from "./display-string.js";
|
||||
|
||||
type Align = "left" | "right" | "center";
|
||||
|
||||
9
pnpm-lock.yaml
generated
9
pnpm-lock.yaml
generated
@@ -1856,6 +1856,15 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:../..
|
||||
|
||||
packages/terminal-core:
|
||||
dependencies:
|
||||
'@clack/prompts':
|
||||
specifier: 1.4.0
|
||||
version: 1.4.0
|
||||
chalk:
|
||||
specifier: 5.6.2
|
||||
version: 5.6.2
|
||||
|
||||
ui:
|
||||
dependencies:
|
||||
'@create-markdown/preview':
|
||||
|
||||
@@ -48,6 +48,7 @@ export const BUILD_ALL_STEPS = [
|
||||
"packages/plugin-sdk/package.json",
|
||||
"packages/llm-core/package.json",
|
||||
"packages/markdown-core/package.json",
|
||||
"packages/terminal-core/package.json",
|
||||
"packages/memory-host-sdk/package.json",
|
||||
"tsconfig.json",
|
||||
"tsconfig.plugin-sdk.dts.json",
|
||||
@@ -56,6 +57,7 @@ export const BUILD_ALL_STEPS = [
|
||||
"packages/markdown-core/src",
|
||||
"packages/memory-host-sdk/src",
|
||||
"packages/media-generation-core/src",
|
||||
"packages/terminal-core/src",
|
||||
"src/types",
|
||||
"src/video-generation/dashscope-compatible.ts",
|
||||
"src/video-generation/types.ts",
|
||||
|
||||
@@ -93,6 +93,45 @@ export const EXTENSION_PACKAGE_BOUNDARY_BASE_PATHS = {
|
||||
"@openclaw/media-generation-core/*": [
|
||||
"../dist/plugin-sdk/packages/media-generation-core/src/*.d.ts",
|
||||
],
|
||||
"@openclaw/terminal-core": ["../dist/plugin-sdk/packages/terminal-core/src/index.d.ts"],
|
||||
"@openclaw/terminal-core/ansi": ["../dist/plugin-sdk/packages/terminal-core/src/ansi.d.ts"],
|
||||
"@openclaw/terminal-core/decorative-emoji": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/decorative-emoji.d.ts",
|
||||
],
|
||||
"@openclaw/terminal-core/health-style": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/health-style.d.ts",
|
||||
],
|
||||
"@openclaw/terminal-core/links": ["../dist/plugin-sdk/packages/terminal-core/src/links.d.ts"],
|
||||
"@openclaw/terminal-core/note": ["../dist/plugin-sdk/packages/terminal-core/src/note.d.ts"],
|
||||
"@openclaw/terminal-core/osc-progress": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/osc-progress.d.ts",
|
||||
],
|
||||
"@openclaw/terminal-core/palette": ["../dist/plugin-sdk/packages/terminal-core/src/palette.d.ts"],
|
||||
"@openclaw/terminal-core/progress-line": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/progress-line.d.ts",
|
||||
],
|
||||
"@openclaw/terminal-core/prompt-select-styled": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/prompt-select-styled.d.ts",
|
||||
],
|
||||
"@openclaw/terminal-core/prompt-select-styled-params": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/prompt-select-styled-params.d.ts",
|
||||
],
|
||||
"@openclaw/terminal-core/prompt-style": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/prompt-style.d.ts",
|
||||
],
|
||||
"@openclaw/terminal-core/restore": ["../dist/plugin-sdk/packages/terminal-core/src/restore.d.ts"],
|
||||
"@openclaw/terminal-core/safe-text": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/safe-text.d.ts",
|
||||
],
|
||||
"@openclaw/terminal-core/stream-writer": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/stream-writer.d.ts",
|
||||
],
|
||||
"@openclaw/terminal-core/table": ["../dist/plugin-sdk/packages/terminal-core/src/table.d.ts"],
|
||||
"@openclaw/terminal-core/terminal-link": [
|
||||
"../dist/plugin-sdk/packages/terminal-core/src/terminal-link.d.ts",
|
||||
],
|
||||
"@openclaw/terminal-core/theme": ["../dist/plugin-sdk/packages/terminal-core/src/theme.d.ts"],
|
||||
"@openclaw/terminal-core/*": ["../dist/plugin-sdk/packages/terminal-core/src/*.d.ts"],
|
||||
"@openclaw/*.js": ["../packages/plugin-sdk/dist/extensions/*.d.ts", "../extensions/*"],
|
||||
"@openclaw/*": ["../packages/plugin-sdk/dist/extensions/*", "../extensions/*"],
|
||||
"openclaw/plugin-sdk/qa-channel": ["../dist/plugin-sdk/src/plugin-sdk/qa-channel.d.ts"],
|
||||
|
||||
@@ -19,6 +19,7 @@ const PLUGIN_SDK_TYPE_INPUTS = [
|
||||
"packages/markdown-core/src",
|
||||
"packages/memory-host-sdk/src",
|
||||
"packages/media-generation-core/src",
|
||||
"packages/terminal-core/src",
|
||||
"src/video-generation/dashscope-compatible.ts",
|
||||
"src/video-generation/types.ts",
|
||||
"src/types",
|
||||
@@ -48,6 +49,24 @@ const ROOT_DTS_REQUIRED_OUTPUTS = [
|
||||
"dist/plugin-sdk/packages/media-generation-core/src/index.d.ts",
|
||||
"dist/plugin-sdk/packages/media-generation-core/src/model-ref.d.ts",
|
||||
"dist/plugin-sdk/packages/media-generation-core/src/normalization.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/ansi.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/decorative-emoji.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/health-style.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/index.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/links.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/note.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/osc-progress.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/palette.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/progress-line.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/prompt-select-styled-params.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/prompt-select-styled.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/prompt-style.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/restore.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/safe-text.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/stream-writer.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/table.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/terminal-link.d.ts",
|
||||
"dist/plugin-sdk/packages/terminal-core/src/theme.d.ts",
|
||||
"dist/plugin-sdk/error-runtime.d.ts",
|
||||
"dist/plugin-sdk/plugin-entry.d.ts",
|
||||
"dist/plugin-sdk/provider-auth.d.ts",
|
||||
@@ -70,6 +89,24 @@ const PACKAGE_DTS_REQUIRED_OUTPUTS = [
|
||||
"packages/plugin-sdk/dist/packages/media-generation-core/src/index.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/media-generation-core/src/model-ref.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/media-generation-core/src/normalization.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/ansi.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/decorative-emoji.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/health-style.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/index.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/links.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/note.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/osc-progress.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/palette.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/progress-line.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/prompt-select-styled-params.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/prompt-select-styled.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/prompt-style.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/restore.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/safe-text.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/stream-writer.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/table.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/terminal-link.d.ts",
|
||||
"packages/plugin-sdk/dist/packages/terminal-core/src/theme.d.ts",
|
||||
"packages/plugin-sdk/dist/src/plugin-sdk/error-runtime.d.ts",
|
||||
"packages/plugin-sdk/dist/src/plugin-sdk/plugin-entry.d.ts",
|
||||
"packages/plugin-sdk/dist/src/plugin-sdk/provider-auth.d.ts",
|
||||
|
||||
@@ -12,6 +12,7 @@ const RUN_NODE_PACKAGE_SOURCE_ROOTS = [
|
||||
"packages/gateway-protocol/src",
|
||||
"packages/markdown-core/src",
|
||||
"packages/media-generation-core/src",
|
||||
"packages/terminal-core/src",
|
||||
"packages/net-policy/src",
|
||||
];
|
||||
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { confirm, isCancel } from "@clack/prompts";
|
||||
import { stylePromptMessage } from "../packages/terminal-core/src/prompt-style.js";
|
||||
import { theme } from "../packages/terminal-core/src/theme.js";
|
||||
import { installCompletion } from "../src/cli/completion-cli.js";
|
||||
import {
|
||||
checkShellCompletionStatus,
|
||||
ensureCompletionCacheExists,
|
||||
} from "../src/commands/doctor-completion.js";
|
||||
import { stylePromptMessage } from "../src/terminal/prompt-style.js";
|
||||
import { theme } from "../src/terminal/theme.js";
|
||||
|
||||
const CLI_NAME = "openclaw";
|
||||
|
||||
|
||||
@@ -162,8 +162,8 @@ function resolveSubcommandHelpSourceSignature(sourceRootDir: string = rootDir):
|
||||
path.join(sourceRootDir, "src/cli/gateway-cli/run-command.ts"),
|
||||
path.join(sourceRootDir, "src/cli/models-cli.ts"),
|
||||
path.join(sourceRootDir, "src/cli/plugins-cli.ts"),
|
||||
path.join(sourceRootDir, "src/terminal/links.ts"),
|
||||
path.join(sourceRootDir, "src/terminal/theme.ts"),
|
||||
path.join(sourceRootDir, "packages/terminal-core/src/links.ts"),
|
||||
path.join(sourceRootDir, "packages/terminal-core/src/theme.ts"),
|
||||
],
|
||||
sourceRootDir,
|
||||
);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as readline from "node:readline";
|
||||
import type { RequestPermissionRequest, RequestPermissionResponse } from "@agentclientprotocol/sdk";
|
||||
import { sanitizeTerminalText } from "../../packages/terminal-core/src/safe-text.js";
|
||||
import {
|
||||
materializeWindowsSpawnProgram,
|
||||
resolveWindowsSpawnProgram,
|
||||
@@ -12,7 +13,6 @@ import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalString,
|
||||
} from "../shared/string-coerce.js";
|
||||
import { sanitizeTerminalText } from "../terminal/safe-text.js";
|
||||
import { classifyAcpToolApproval, type AcpApprovalClass } from "./approval-classifier.js";
|
||||
|
||||
type PermissionOption = RequestPermissionRequest["options"][number];
|
||||
|
||||
@@ -290,7 +290,7 @@ vi.mock("../sessions/send-policy.js", () => ({
|
||||
resolveSendPolicy: () => "allow",
|
||||
}));
|
||||
|
||||
vi.mock("../terminal/ansi.js", () => ({
|
||||
vi.mock("../../packages/terminal-core/src/ansi.js", () => ({
|
||||
sanitizeForLog: (s: string) => s,
|
||||
}));
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { sanitizeForLog } from "../../packages/terminal-core/src/ansi.js";
|
||||
import { resolveInlineAgentImageAttachments } from "../auto-reply/reply/agent-turn-attachments.js";
|
||||
import { sanitizePendingFinalDeliveryText } from "../auto-reply/reply/pending-final-delivery.js";
|
||||
import {
|
||||
@@ -44,7 +45,6 @@ import { normalizeOptionalString } from "../shared/string-coerce.js";
|
||||
import { resolveEffectiveAgentSkillFilter } from "../skills/discovery/agent-filter.js";
|
||||
import type { getRemoteSkillEligibility } from "../skills/runtime/remote.js";
|
||||
import type { resolveReusableWorkspaceSkillSnapshot } from "../skills/runtime/session-snapshot.js";
|
||||
import { sanitizeForLog } from "../terminal/ansi.js";
|
||||
import { createTrajectoryRuntimeRecorder } from "../trajectory/runtime.js";
|
||||
import { resolveUserPath } from "../utils.js";
|
||||
import { resolveMessageChannel } from "../utils/message-channel.js";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { sanitizeForLog } from "../../../packages/terminal-core/src/ansi.js";
|
||||
import { formatCliCommand } from "../../cli/command-format.js";
|
||||
import { sanitizeForLog } from "../../terminal/ansi.js";
|
||||
import { normalizeProviderId } from "../provider-id.js";
|
||||
|
||||
export type OAuthRefreshFailureReason =
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { sanitizeForLog } from "../../../packages/terminal-core/src/ansi.js";
|
||||
import { formatAcpErrorChain } from "../../acp/runtime/errors.js";
|
||||
import type { AcpRuntimeEvent } from "../../acp/runtime/types.js";
|
||||
import { normalizeReplyPayload } from "../../auto-reply/reply/normalize-reply.js";
|
||||
@@ -20,7 +21,6 @@ import {
|
||||
type PersistedUserTurnMessage,
|
||||
} from "../../sessions/user-turn-transcript.js";
|
||||
import { buildWorkspaceSkillSnapshot } from "../../skills/loading/workspace.js";
|
||||
import { sanitizeForLog } from "../../terminal/ansi.js";
|
||||
import { resolveUserPath } from "../../utils.js";
|
||||
import { resolveMessageChannel } from "../../utils/message-channel.js";
|
||||
import { resolveAuthProfileOrder } from "../auth-profiles/order.js";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { sanitizeForLog } from "../../../packages/terminal-core/src/ansi.js";
|
||||
import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js";
|
||||
import { sanitizeForLog } from "../../terminal/ansi.js";
|
||||
|
||||
const MAX_COMPACTION_REASON_DETAIL_CHARS = 100;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { randomBytes } from "node:crypto";
|
||||
import fs from "node:fs/promises";
|
||||
import { sanitizeForLog } from "../../../packages/terminal-core/src/ansi.js";
|
||||
import type { ReplyPayload } from "../../auto-reply/reply-payload.js";
|
||||
import type { ThinkLevel } from "../../auto-reply/thinking.js";
|
||||
import { SILENT_REPLY_TOKEN } from "../../auto-reply/tokens.js";
|
||||
@@ -20,7 +21,6 @@ import { enqueueCommandInLane } from "../../process/command-queue.js";
|
||||
import type { CommandQueueEnqueueOptions } from "../../process/command-queue.types.js";
|
||||
import { normalizeOptionalString } from "../../shared/string-coerce.js";
|
||||
import { createAgentHarnessTaskRuntimeScope } from "../../tasks/agent-harness-task-runtime-scope.js";
|
||||
import { sanitizeForLog } from "../../terminal/ansi.js";
|
||||
import { resolveUserPath } from "../../utils.js";
|
||||
import { isMarkdownCapableMessageChannel } from "../../utils/message-channel.js";
|
||||
import {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { sanitizeForLog } from "../../../../packages/terminal-core/src/ansi.js";
|
||||
import type { OpenClawConfig } from "../../../config/types.openclaw.js";
|
||||
import type { AssistantMessage } from "../../../llm/types.js";
|
||||
import { sanitizeForLog } from "../../../terminal/ansi.js";
|
||||
import type { AuthProfileFailureReason } from "../../auth-profiles.js";
|
||||
import {
|
||||
formatAssistantErrorText,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { sanitizeForLog } from "../../packages/terminal-core/src/ansi.js";
|
||||
import { resolveOpenClawMcpTransportAlias } from "../config/mcp-config-normalize.js";
|
||||
import { logWarn } from "../logger.js";
|
||||
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
|
||||
import { sanitizeForLog } from "../terminal/ansi.js";
|
||||
import {
|
||||
describeHttpMcpServerLaunchConfig,
|
||||
resolveHttpMcpServerLaunchConfig,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { sanitizeForLog } from "../../packages/terminal-core/src/ansi.js";
|
||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||
import { sanitizeForLog } from "../terminal/ansi.js";
|
||||
import { buildTextObservationFields } from "./embedded-agent-error-observation.js";
|
||||
import type { FailoverReason } from "./embedded-agent-helpers.js";
|
||||
import type { FallbackAttempt, ModelCandidate } from "./model-fallback.types.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { sanitizeForLog } from "../../packages/terminal-core/src/ansi.js";
|
||||
import {
|
||||
resolveAgentModelFallbackValues,
|
||||
resolveAgentModelPrimaryValue,
|
||||
@@ -16,7 +17,6 @@ import {
|
||||
import { isCommandLaneTaskTimeoutError } from "../process/command-queue.js";
|
||||
import { createLazyImportLoader } from "../shared/lazy-promise.js";
|
||||
import { normalizeOptionalString } from "../shared/string-coerce.js";
|
||||
import { sanitizeForLog } from "../terminal/ansi.js";
|
||||
import { isDefaultAgentRuntimeId } from "./agent-runtime-id.js";
|
||||
import { normalizeOptionalAgentRuntimeId } from "./agent-runtime-id.js";
|
||||
import { externalCliDiscoveryForProviders } from "./auth-profiles/external-cli-discovery.js";
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { sanitizeForLog, stripAnsi } from "../../packages/terminal-core/src/ansi.js";
|
||||
import { resolveAgentModelPrimaryValue } from "../config/model-input.js";
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||
@@ -8,7 +9,6 @@ import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalString,
|
||||
} from "../shared/string-coerce.js";
|
||||
import { sanitizeForLog, stripAnsi } from "../terminal/ansi.js";
|
||||
import { resolveConfiguredProviderFallback } from "./configured-provider-fallback.js";
|
||||
import { DEFAULT_PROVIDER } from "./defaults.js";
|
||||
import { findModelCatalogEntry } from "./model-catalog-lookup.js";
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
hasOutboundReplyContent,
|
||||
resolveSendableOutboundReplyParts,
|
||||
} from "openclaw/plugin-sdk/reply-payload";
|
||||
import { sanitizeForLog } from "../../../packages/terminal-core/src/ansi.js";
|
||||
import {
|
||||
clearAutoFallbackPrimaryProbeSelection,
|
||||
entryMatchesAutoFallbackPrimaryProbe,
|
||||
@@ -66,7 +67,6 @@ import {
|
||||
normalizeOptionalString,
|
||||
readStringValue,
|
||||
} from "../../shared/string-coerce.js";
|
||||
import { sanitizeForLog } from "../../terminal/ansi.js";
|
||||
import {
|
||||
isMarkdownCapableMessageChannel,
|
||||
resolveMessageChannel,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath, pathToFileURL } from "node:url";
|
||||
import { sanitizeForLog } from "../../../packages/terminal-core/src/ansi.js";
|
||||
import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../agents/agent-scope.js";
|
||||
import { resolveRuntimeConfigCacheKey } from "../../config/runtime-snapshot.js";
|
||||
import type { OpenClawConfig } from "../../config/types.openclaw.js";
|
||||
@@ -27,7 +28,6 @@ import {
|
||||
import { getActivePluginChannelRegistryVersion } from "../../plugins/runtime.js";
|
||||
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../routing/session-key.js";
|
||||
import { sortUniqueStrings, uniqueStrings } from "../../shared/string-normalization.js";
|
||||
import { sanitizeForLog } from "../../terminal/ansi.js";
|
||||
import { getBundledChannelSetupPlugin } from "./bundled.js";
|
||||
import {
|
||||
isSafeManifestChannelId,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { runAcpClientInteractive } from "../acp/client.js";
|
||||
import { serveAcpGateway } from "../acp/server.js";
|
||||
import { normalizeAcpProvenanceMode } from "../acp/types.js";
|
||||
import { formatErrorMessage } from "../infra/errors.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { inheritOptionFromParent } from "./command-options.js";
|
||||
import { resolveGatewayAuthOptions } from "./gateway-secret-options.js";
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { resolveCommitHash } from "../infra/git-commit.js";
|
||||
import { visibleWidth } from "../terminal/ansi.js";
|
||||
import { visibleWidth } from "../../packages/terminal-core/src/ansi.js";
|
||||
import {
|
||||
decorativeEmoji,
|
||||
decorativePrefix,
|
||||
stripDecorativeEmojiForTerminal,
|
||||
supportsDecorativeEmoji,
|
||||
type DecorativeEmojiOptions,
|
||||
} from "../terminal/decorative-emoji.js";
|
||||
import { isRich, theme } from "../terminal/theme.js";
|
||||
} from "../../packages/terminal-core/src/decorative-emoji.js";
|
||||
import { isRich, theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { resolveCommitHash } from "../infra/git-commit.js";
|
||||
import { hasRootVersionAlias } from "./argv.js";
|
||||
import { parseTaglineMode, readCliBannerTaglineMode } from "./banner-config-lite.js";
|
||||
import { pickTagline, type TaglineMode, type TaglineOptions } from "./tagline.js";
|
||||
|
||||
@@ -9,6 +9,8 @@ import {
|
||||
GATEWAY_CLIENT_MODES,
|
||||
GATEWAY_CLIENT_NAMES,
|
||||
} from "../../packages/gateway-protocol/src/client-info.js";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { resolveAgentDir, resolveDefaultAgentId } from "../agents/agent-scope.js";
|
||||
import {
|
||||
listProfilesForProvider,
|
||||
@@ -72,8 +74,6 @@ import {
|
||||
normalizeOptionalString,
|
||||
normalizeStringifiedOptionalString,
|
||||
} from "../shared/string-coerce.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { canonicalizeSpeechProviderId, listSpeechProviders } from "../tts/provider-registry.js";
|
||||
import {
|
||||
getTtsProvider,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { sanitizeForLog } from "../../packages/terminal-core/src/ansi.js";
|
||||
import { resolveChannelDefaultAccountId } from "../channels/plugins/helpers.js";
|
||||
import {
|
||||
getChannelPlugin,
|
||||
@@ -13,7 +14,6 @@ import { formatErrorMessage } from "../infra/errors.js";
|
||||
import { isBlockedObjectKey } from "../infra/prototype-keys.js";
|
||||
import { defaultRuntime, type RuntimeEnv } from "../runtime.js";
|
||||
import { normalizeOptionalString } from "../shared/string-coerce.js";
|
||||
import { sanitizeForLog } from "../terminal/ansi.js";
|
||||
import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js";
|
||||
import { formatCliCommand } from "./command-format.js";
|
||||
import { formatUnsupportedChannelActionMessage } from "./error-format.js";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { danger } from "../globals.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { createLazyImportLoader } from "../shared/lazy-promise.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { resolveCliArgvInvocation } from "./argv-invocation.js";
|
||||
import { runChannelLogin, runChannelLogout } from "./channel-auth.js";
|
||||
import { formatCliChannelOptions } from "./channel-options.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { registerQrCli } from "./qr-cli.js";
|
||||
|
||||
export function registerClawbotCli(program: Command) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { Command, Option } from "commander";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { routeLogsToStderr } from "../logging/console.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import {
|
||||
buildFishOptionCompletionLine,
|
||||
buildFishSubcommandCompletionLine,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import fs from "node:fs";
|
||||
import type { Command } from "commander";
|
||||
import JSON5 from "json5";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { normalizeConfiguredProviderCatalogModelId } from "../agents/model-ref-shared.js";
|
||||
import {
|
||||
type ConfigFileSnapshot,
|
||||
@@ -59,8 +61,6 @@ import { parseConfigPathArrayIndex } from "../shared/path-array-index.js";
|
||||
import { isRecord as isPlainRecord } from "../shared/record-coerce.js";
|
||||
import { normalizeOptionalString } from "../shared/string-coerce.js";
|
||||
import { normalizeStringEntries, uniqueValues } from "../shared/string-normalization.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { shortenHomePath } from "../utils.js";
|
||||
import { formatCliCommand } from "./command-format.js";
|
||||
import { formatPluginPackagingRuntimeOutputRecoveryHint } from "./config-recovery-hints.js";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Command } from "commander";
|
||||
import { theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import type { CronJob } from "../../cron/types.js";
|
||||
import { sanitizeAgentId } from "../../routing/session-key.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
@@ -6,7 +7,6 @@ import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalString,
|
||||
} from "../../shared/string-coerce.js";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import type { GatewayRpcOpts } from "../gateway-rpc.js";
|
||||
import { addGatewayClientOptions, callGatewayFromCli } from "../gateway-rpc.js";
|
||||
import { parsePositiveIntOrUndefined } from "../program/helpers.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../terminal/links.js";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import { formatDocsLink } from "../../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { applyParentDefaultHelpAction } from "../program/parent-default-help.js";
|
||||
import {
|
||||
registerCronAddCommand,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { colorize, isRich, theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { listChannelPlugins } from "../../channels/plugins/index.js";
|
||||
import { parseAbsoluteTimeMs } from "../../cron/parse.js";
|
||||
import { resolveCronStaggerMs } from "../../cron/stagger.js";
|
||||
@@ -13,7 +14,6 @@ import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalString,
|
||||
} from "../../shared/string-coerce.js";
|
||||
import { colorize, isRich, theme } from "../../terminal/theme.js";
|
||||
import type { GatewayRpcOpts } from "../gateway-rpc.js";
|
||||
import { callGatewayFromCli } from "../gateway-rpc.js";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { isRestartEnabled } from "../../config/commands.flags.js";
|
||||
import { readBestEffortConfig, resolveGatewayPort } from "../../config/config.js";
|
||||
import { resolveGatewayService } from "../../daemon/service.js";
|
||||
@@ -12,7 +13,6 @@ import type { SafeGatewayRestartRequestResult } from "../../infra/restart-coordi
|
||||
import { type GatewayRestartIntent, writeGatewayRestartIntentSync } from "../../infra/restart.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { normalizeOptionalString } from "../../shared/string-coerce.js";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import { formatCliCommand } from "../command-format.js";
|
||||
import { parseDurationMs } from "../parse-duration.js";
|
||||
import { recoverInstalledLaunchAgent } from "./launchd-recovery.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../terminal/links.js";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import { formatDocsLink } from "../../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { addGatewayServiceCommands } from "./register-service-commands.js";
|
||||
|
||||
export function registerDaemonCli(program: Command) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import { theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import {
|
||||
filterContainerGenericHints,
|
||||
parsePortFromArgs,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { colorize, isRich, theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { resolveIsNixMode } from "../../config/paths.js";
|
||||
import {
|
||||
resolveGatewayLaunchAgentLabel,
|
||||
@@ -11,7 +12,6 @@ import {
|
||||
buildPlatformServiceStartHints,
|
||||
} from "../../daemon/runtime-hints.js";
|
||||
import { parseInlineOptionToken } from "../../infra/inline-option-token.js";
|
||||
import { colorize, isRich, theme } from "../../terminal/theme.js";
|
||||
import { formatCliCommand } from "../command-format.js";
|
||||
import { parsePort } from "../shared/parse-port.js";
|
||||
import { createDaemonActionContext } from "./response.js";
|
||||
|
||||
@@ -16,9 +16,10 @@ vi.mock("../../runtime.js", () => ({
|
||||
defaultRuntime: runtime,
|
||||
}));
|
||||
|
||||
vi.mock("../../terminal/theme.js", async () => {
|
||||
const actual =
|
||||
await vi.importActual<typeof import("../../terminal/theme.js")>("../../terminal/theme.js");
|
||||
vi.mock("../../../packages/terminal-core/src/theme.js", async () => {
|
||||
const actual = await vi.importActual<
|
||||
typeof import("../../../packages/terminal-core/src/theme.js")
|
||||
>("../../../packages/terminal-core/src/theme.js");
|
||||
return {
|
||||
...actual,
|
||||
colorize: (_rich: boolean, _theme: unknown, text: string) => text,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { colorize } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { formatConfigIssueLine } from "../../config/issue-format.js";
|
||||
import {
|
||||
resolveGatewayLaunchAgentLabel,
|
||||
@@ -17,7 +18,6 @@ import { resolveControlUiLinks } from "../../gateway/control-ui-links.js";
|
||||
import { formatGatewayRestartHandoffDiagnostic } from "../../infra/restart-handoff.js";
|
||||
import { isWSLEnv } from "../../infra/wsl.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { colorize } from "../../terminal/theme.js";
|
||||
import { shortenHomePath } from "../../utils.js";
|
||||
import { formatCliCommand } from "../command-format.js";
|
||||
import {
|
||||
|
||||
@@ -25,7 +25,7 @@ vi.mock("../../runtime.js", () => ({
|
||||
defaultRuntime,
|
||||
}));
|
||||
|
||||
vi.mock("../../terminal/theme.js", () => ({
|
||||
vi.mock("../../../packages/terminal-core/src/theme.js", () => ({
|
||||
colorize: (_rich: boolean, _color: unknown, text: string) => text,
|
||||
isRich: () => false,
|
||||
theme: { error: "error" },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { colorize, isRich, theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { colorize, isRich, theme } from "../../terminal/theme.js";
|
||||
import { gatherDaemonStatus } from "./status.gather.js";
|
||||
import { printDaemonStatus } from "./status.print.js";
|
||||
import type { DaemonStatusOptions } from "./types.js";
|
||||
|
||||
@@ -6,6 +6,9 @@ import {
|
||||
readConnectPairingRequiredMessage,
|
||||
type ConnectPairingRequiredDetails,
|
||||
} from "../../packages/gateway-protocol/src/connect-error-details.js";
|
||||
import { sanitizeForLog } from "../../packages/terminal-core/src/ansi.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../../packages/terminal-core/src/table.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import {
|
||||
buildGatewayConnectionDetails,
|
||||
callGateway,
|
||||
@@ -34,9 +37,6 @@ import {
|
||||
normalizeStringifiedOptionalString,
|
||||
} from "../shared/string-coerce.js";
|
||||
import { uniqueStrings } from "../shared/string-normalization.js";
|
||||
import { sanitizeForLog } from "../terminal/ansi.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../terminal/table.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { formatCliCommand } from "./command-format.js";
|
||||
import { parseTimeoutMsWithFallback } from "./parse-timeout.js";
|
||||
import { withProgress } from "./progress.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Command } from "commander";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { stripAnsi } from "../terminal/ansi.js";
|
||||
import { stripAnsi } from "../../packages/terminal-core/src/ansi.js";
|
||||
import { registerDevicesCli } from "./devices-cli.js";
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../../packages/terminal-core/src/table.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { resolveChannelDefaultAccountId } from "../channels/plugins/helpers.js";
|
||||
import { getChannelPlugin } from "../channels/plugins/index.js";
|
||||
import { resolveInstallableChannelPlugin } from "../commands/channel-setup/channel-plugin-resolution.js";
|
||||
@@ -12,9 +15,6 @@ import {
|
||||
normalizeOptionalString,
|
||||
normalizeStringifiedOptionalString,
|
||||
} from "../shared/string-coerce.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../terminal/table.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { formatHelpExamples } from "./help-format.js";
|
||||
import { commitConfigWithPendingPluginInstalls } from "./plugins-install-record-commit.js";
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@ import { spawnSync } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../../packages/terminal-core/src/table.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { getRuntimeConfig } from "../config/config.js";
|
||||
import { pickPrimaryTailnetIPv4, pickPrimaryTailnetIPv6 } from "../infra/tailnet.js";
|
||||
import {
|
||||
@@ -10,9 +13,6 @@ import {
|
||||
resolveWideAreaDiscoveryDomain,
|
||||
} from "../infra/widearea-dns.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../terminal/table.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
|
||||
type RunOpts = { allowFailure?: boolean; inherit?: boolean };
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { docsSearchCommand } from "../commands/docs.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { runCommandWithRuntime } from "./cli-utils.js";
|
||||
|
||||
export function registerDocsCli(program: Command) {
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import fs from "node:fs/promises";
|
||||
import type { Command } from "commander";
|
||||
import JSON5 from "json5";
|
||||
import { sanitizeForLog } from "../../packages/terminal-core/src/ansi.js";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../../packages/terminal-core/src/table.js";
|
||||
import { isRich, theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { readBestEffortConfig, type OpenClawConfig } from "../config/config.js";
|
||||
import { formatErrorMessage } from "../infra/errors.js";
|
||||
import {
|
||||
@@ -16,10 +20,6 @@ import {
|
||||
import { formatTimeAgo } from "../infra/format-time/format-relative.ts";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { normalizeOptionalString } from "../shared/string-coerce.js";
|
||||
import { sanitizeForLog } from "../terminal/ansi.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../terminal/table.js";
|
||||
import { isRich, theme } from "../terminal/theme.js";
|
||||
import { callGatewayFromCli } from "./gateway-rpc.js";
|
||||
import { nodesCallOpts, resolveNodeId } from "./nodes-cli/rpc.js";
|
||||
import type { NodesRpcOpts } from "./nodes-cli/types.js";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import crypto from "node:crypto";
|
||||
import { Command } from "commander";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { stripAnsi } from "../../packages/terminal-core/src/ansi.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import type { ExecApprovalsFile, ExecApprovalsSnapshot } from "../infra/exec-approvals.js";
|
||||
import { stripAnsi } from "../terminal/ansi.js";
|
||||
import { registerExecPolicyCli } from "./exec-policy-cli.js";
|
||||
|
||||
function hashApprovalsFile(file: ExecApprovalsFile): string {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import crypto from "node:crypto";
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { sanitizeTerminalText } from "../../packages/terminal-core/src/safe-text.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../../packages/terminal-core/src/table.js";
|
||||
import { isRich, theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { readConfigFileSnapshot, replaceConfigFile } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import { sanitizeExecApprovalDisplayText } from "../infra/exec-approval-command-display.js";
|
||||
@@ -20,10 +24,6 @@ import {
|
||||
type ExecTarget,
|
||||
} from "../infra/exec-approvals.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { sanitizeTerminalText } from "../terminal/safe-text.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../terminal/table.js";
|
||||
import { isRich, theme } from "../terminal/theme.js";
|
||||
|
||||
type ExecPolicyPresetName = "yolo" | "cautious" | "deny-all";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { colorize, theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import type { GatewayBonjourBeacon } from "../../infra/bonjour-discovery.js";
|
||||
import { buildGatewayDiscoveryTarget } from "../../infra/gateway-discovery-targets.js";
|
||||
import { colorize, theme } from "../../terminal/theme.js";
|
||||
import { parseTimeoutMsWithFallback } from "../parse-timeout.js";
|
||||
|
||||
export type GatewayDiscoverOpts = {
|
||||
|
||||
@@ -83,15 +83,15 @@ vi.mock("../../infra/widearea-dns.js", () => ({
|
||||
resolveWideAreaDiscoveryDomain: () => undefined,
|
||||
}));
|
||||
|
||||
vi.mock("../../terminal/health-style.js", () => ({
|
||||
vi.mock("../../../packages/terminal-core/src/health-style.js", () => ({
|
||||
styleHealthChannelLine: (line: string) => line,
|
||||
}));
|
||||
|
||||
vi.mock("../../terminal/links.js", () => ({
|
||||
vi.mock("../../../packages/terminal-core/src/links.js", () => ({
|
||||
formatDocsLink: () => "docs.openclaw.ai/cli/gateway",
|
||||
}));
|
||||
|
||||
vi.mock("../../terminal/theme.js", () => ({
|
||||
vi.mock("../../../packages/terminal-core/src/theme.js", () => ({
|
||||
colorize: (_rich: boolean, _fn: (value: string) => string, value: string) => value,
|
||||
isRich: () => false,
|
||||
theme: {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../../packages/terminal-core/src/links.js";
|
||||
import { colorize, isRich, theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import type { HealthSummary } from "../../commands/health.js";
|
||||
import { parseStrictPositiveInteger } from "../../infra/parse-finite-number.js";
|
||||
import type { CostUsageSummary } from "../../infra/session-cost-usage.js";
|
||||
@@ -13,8 +15,6 @@ import {
|
||||
import type { WriteDiagnosticSupportExportResult } from "../../logging/diagnostic-support-export.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { createLazyImportLoader } from "../../shared/lazy-promise.js";
|
||||
import { formatDocsLink } from "../../terminal/links.js";
|
||||
import { colorize, isRich, theme } from "../../terminal/theme.js";
|
||||
import { inheritOptionFromParent } from "../command-options.js";
|
||||
import { addGatewayServiceCommands } from "../daemon-cli/register-service-commands.js";
|
||||
import { formatHelpExamples } from "../help-format.js";
|
||||
@@ -34,7 +34,7 @@ const bonjourDiscoveryModuleLoader = createLazyImportLoader(
|
||||
);
|
||||
const wideAreaDnsModuleLoader = createLazyImportLoader(() => import("../../infra/widearea-dns.js"));
|
||||
const healthStyleModuleLoader = createLazyImportLoader(
|
||||
() => import("../../terminal/health-style.js"),
|
||||
() => import("../../../packages/terminal-core/src/health-style.js"),
|
||||
);
|
||||
const usageFormatModuleLoader = createLazyImportLoader(() => import("../../utils/usage-format.js"));
|
||||
const stabilityBundleModuleLoader = createLazyImportLoader(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
|
||||
export type HelpExample = readonly [command: string, description: string];
|
||||
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import type { Command } from "commander";
|
||||
import {
|
||||
decorativeEmoji,
|
||||
decorativePrefix,
|
||||
} from "../../packages/terminal-core/src/decorative-emoji.js";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../../packages/terminal-core/src/table.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agents/agent-scope.js";
|
||||
import { getRuntimeConfig, readConfigFileSnapshot, replaceConfigFile } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
@@ -13,10 +20,6 @@ import { loadWorkspaceHookEntries } from "../hooks/workspace.js";
|
||||
import { formatErrorMessage } from "../infra/errors.js";
|
||||
import { buildPluginDiagnosticsReport } from "../plugins/status.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
import { decorativeEmoji, decorativePrefix } from "../terminal/decorative-emoji.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../terminal/table.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { shortenHomePath } from "../utils.js";
|
||||
import { formatCliCommand } from "./command-format.js";
|
||||
import { runNativeHookRelayCli, type NativeHookRelayCliOptions } from "./native-hook-relay-cli.js";
|
||||
|
||||
@@ -5,6 +5,10 @@ import {
|
||||
GATEWAY_CLIENT_NAMES,
|
||||
} from "../../packages/gateway-protocol/src/client-info.js";
|
||||
import { readConnectPairingRequiredMessage } from "../../packages/gateway-protocol/src/connect-error-details.js";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { clearActiveProgressLine } from "../../packages/terminal-core/src/progress-line.js";
|
||||
import { createSafeStreamWriter } from "../../packages/terminal-core/src/stream-writer.js";
|
||||
import { colorize, isRich, theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import {
|
||||
buildGatewayConnectionDetails,
|
||||
isGatewayTransportError,
|
||||
@@ -19,10 +23,6 @@ import { parseLogLine } from "../logging/parse-log-line.js";
|
||||
import { redactSensitiveLines, resolveRedactOptions } from "../logging/redact.js";
|
||||
import { formatTimestamp } from "../logging/timestamps.js";
|
||||
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { clearActiveProgressLine } from "../terminal/progress-line.js";
|
||||
import { createSafeStreamWriter } from "../terminal/stream-writer.js";
|
||||
import { colorize, isRich, theme } from "../terminal/theme.js";
|
||||
import { formatCliCommand } from "./command-format.js";
|
||||
import { addGatewayClientOptions, callGatewayFromCli } from "./gateway-rpc.js";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../terminal/links.js";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { formatDocsLink } from "../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
|
||||
type ModelsCliRuntime = typeof import("./models-cli.runtime.js");
|
||||
|
||||
|
||||
@@ -43,9 +43,10 @@ vi.mock("../../daemon/runtime-hints.js", () => ({
|
||||
buildPlatformServiceStartHints: () => ["openclaw node install", "openclaw node start"],
|
||||
}));
|
||||
|
||||
vi.mock("../../terminal/theme.js", async () => {
|
||||
const actual =
|
||||
await vi.importActual<typeof import("../../terminal/theme.js")>("../../terminal/theme.js");
|
||||
vi.mock("../../../packages/terminal-core/src/theme.js", async () => {
|
||||
const actual = await vi.importActual<
|
||||
typeof import("../../../packages/terminal-core/src/theme.js")
|
||||
>("../../../packages/terminal-core/src/theme.js");
|
||||
return {
|
||||
...actual,
|
||||
colorize: (_rich: boolean, _theme: unknown, text: string) => text,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { colorize } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { buildNodeInstallPlan } from "../../commands/node-daemon-install-helpers.js";
|
||||
import {
|
||||
DEFAULT_NODE_DAEMON_RUNTIME,
|
||||
@@ -17,7 +18,6 @@ import type { GatewayServiceRuntime } from "../../daemon/service-runtime.js";
|
||||
import { loadNodeHostConfig } from "../../node-host/config.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { normalizeOptionalString } from "../../shared/string-coerce.js";
|
||||
import { colorize } from "../../terminal/theme.js";
|
||||
import { formatCliCommand } from "../command-format.js";
|
||||
import {
|
||||
runServiceRestart,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { loadNodeHostConfig } from "../../node-host/config.js";
|
||||
import { runNodeHost } from "../../node-host/runner.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { normalizeOptionalString } from "../../shared/string-coerce.js";
|
||||
import { formatDocsLink } from "../../terminal/links.js";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import { parsePort } from "../daemon-cli/shared.js";
|
||||
import { formatInvalidPortOption } from "../error-format.js";
|
||||
import { formatHelpExamples } from "../help-format.js";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { isRich, theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { isRich, theme } from "../../terminal/theme.js";
|
||||
import { runCommandWithRuntime } from "../cli-utils.js";
|
||||
import { unauthorizedHintForMessage } from "./rpc.js";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { sanitizeTerminalText } from "../../../packages/terminal-core/src/safe-text.js";
|
||||
import { renderTable } from "../../../packages/terminal-core/src/table.js";
|
||||
import { formatTimeAgo } from "../../infra/format-time/format-relative.ts";
|
||||
import { sanitizeTerminalText } from "../../terminal/safe-text.js";
|
||||
import { renderTable } from "../../terminal/table.js";
|
||||
import type { PendingRequest } from "./types.js";
|
||||
|
||||
export function renderPendingPairingRequestsTable(params: {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { Command } from "commander";
|
||||
import { getTerminalTableWidth, renderTable } from "../../../packages/terminal-core/src/table.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import {
|
||||
normalizeLowercaseStringOrEmpty,
|
||||
normalizeOptionalString,
|
||||
} from "../../shared/string-coerce.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../../terminal/table.js";
|
||||
import { shortenHomePath } from "../../utils.js";
|
||||
import {
|
||||
type CameraFacing,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { Command } from "commander";
|
||||
import { getTerminalTableWidth } from "../../../packages/terminal-core/src/table.js";
|
||||
import type { OperatorScope } from "../../gateway/method-scopes.js";
|
||||
import { resolveNodePairApprovalScopes } from "../../infra/node-pairing-authz.js";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
import { normalizeOptionalString } from "../../shared/string-coerce.js";
|
||||
import { getTerminalTableWidth } from "../../terminal/table.js";
|
||||
import { formatCliCommand } from "../command-format.js";
|
||||
import { getNodesTheme, runNodesCommand } from "./cli-utils.js";
|
||||
import { parsePairingList } from "./format.js";
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import type { Command } from "commander";
|
||||
import { sanitizeTerminalText } from "../../../packages/terminal-core/src/safe-text.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../../../packages/terminal-core/src/table.js";
|
||||
import { formatErrorMessage } from "../../infra/errors.js";
|
||||
import { formatTimeAgo } from "../../infra/format-time/format-relative.ts";
|
||||
import { defaultRuntime } from "../../runtime.js";
|
||||
@@ -7,8 +9,6 @@ import {
|
||||
normalizeOptionalLowercaseString,
|
||||
normalizeOptionalString,
|
||||
} from "../../shared/string-coerce.js";
|
||||
import { sanitizeTerminalText } from "../../terminal/safe-text.js";
|
||||
import { getTerminalTableWidth, renderTable } from "../../terminal/table.js";
|
||||
import { shortenHomeInString } from "../../utils.js";
|
||||
import { parseDurationMs } from "../parse-duration.js";
|
||||
import { getNodesTheme, runNodesCommand } from "./cli-utils.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Command } from "commander";
|
||||
import { formatDocsLink } from "../../terminal/links.js";
|
||||
import { theme } from "../../terminal/theme.js";
|
||||
import { formatDocsLink } from "../../../packages/terminal-core/src/links.js";
|
||||
import { theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { formatHelpExamples } from "../help-format.js";
|
||||
import { withConsoleLogsRoutedToStderrForJson } from "../json-output-mode.js";
|
||||
import { registerNodesCameraCommands } from "./register.camera.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Command } from "commander";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { theme } from "../terminal/theme.js";
|
||||
import { theme } from "../../packages/terminal-core/src/theme.js";
|
||||
import { registerPairingCli } from "./pairing-cli.js";
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user