mirror of
http://192.168.0.88:13333/lywsvip/openclaw-zero-token.git
synced 2026-05-31 22:20:40 +08:00
Major upgrade from e26988a38 to upstream v2026.3.28 (f9b107928).
Key changes:
- Upstream src/, ui/, extensions/ (89 bundled extensions)
- Zero-token web providers preserved in src/zero-token/
- AskOnce plugin restored and registered as CLI command
- Added missing packages: @anthropic-ai/vertex-sdk, @modelcontextprotocol/sdk
- Fixed tsconfig rootDir, skipLibCheck for plugin-sdk DTS build
- Added askonce to bundled plugin metadata and package.json exports
- Fixed AskOnce CLI command registration (missing commands metadata)
- Restored AskOnce adapter imports (correct 5-level relative paths)
- Removed stale migration artifacts from root directory
91 lines
2.9 KiB
TypeScript
91 lines
2.9 KiB
TypeScript
import { formatCliCommand } from "../cli/command-format.js";
|
|
import {
|
|
resolveGatewayLaunchAgentLabel,
|
|
resolveGatewaySystemdServiceName,
|
|
resolveGatewayWindowsTaskName,
|
|
} from "../daemon/constants.js";
|
|
import { resolveDaemonContainerContext } from "../daemon/container-context.js";
|
|
import { formatRuntimeStatus } from "../daemon/runtime-format.js";
|
|
import { buildPlatformRuntimeLogHints } from "../daemon/runtime-hints.js";
|
|
import type { GatewayServiceRuntime } from "../daemon/service-runtime.js";
|
|
import {
|
|
isSystemdUnavailableDetail,
|
|
renderSystemdUnavailableHints,
|
|
} from "../daemon/systemd-hints.js";
|
|
import { classifySystemdUnavailableDetail } from "../daemon/systemd-unavailable.js";
|
|
import { isWSLEnv } from "../infra/wsl.js";
|
|
import { getResolvedLoggerSettings } from "../logging.js";
|
|
|
|
type RuntimeHintOptions = {
|
|
platform?: NodeJS.Platform;
|
|
env?: Record<string, string | undefined>;
|
|
};
|
|
|
|
export function formatGatewayRuntimeSummary(
|
|
runtime: GatewayServiceRuntime | undefined,
|
|
): string | null {
|
|
return formatRuntimeStatus(runtime);
|
|
}
|
|
|
|
export function buildGatewayRuntimeHints(
|
|
runtime: GatewayServiceRuntime | undefined,
|
|
options: RuntimeHintOptions = {},
|
|
): string[] {
|
|
const hints: string[] = [];
|
|
if (!runtime) {
|
|
return hints;
|
|
}
|
|
const platform = options.platform ?? process.platform;
|
|
const env = options.env ?? process.env;
|
|
const container = Boolean(resolveDaemonContainerContext(env));
|
|
const fileLog = (() => {
|
|
try {
|
|
return getResolvedLoggerSettings().file;
|
|
} catch {
|
|
return null;
|
|
}
|
|
})();
|
|
if (platform === "linux" && isSystemdUnavailableDetail(runtime.detail)) {
|
|
hints.push(
|
|
...renderSystemdUnavailableHints({
|
|
wsl: isWSLEnv(),
|
|
kind: classifySystemdUnavailableDetail(runtime.detail),
|
|
container,
|
|
}),
|
|
);
|
|
if (fileLog) {
|
|
hints.push(`File logs: ${fileLog}`);
|
|
}
|
|
return hints;
|
|
}
|
|
if (runtime.cachedLabel && platform === "darwin") {
|
|
const label = resolveGatewayLaunchAgentLabel(env.OPENCLAW_PROFILE);
|
|
hints.push(
|
|
`LaunchAgent label cached but plist missing. Clear with: launchctl bootout gui/$UID/${label}`,
|
|
);
|
|
hints.push(`Then reinstall: ${formatCliCommand("openclaw gateway install", env)}`);
|
|
}
|
|
if (runtime.missingUnit) {
|
|
hints.push(`Service not installed. Run: ${formatCliCommand("openclaw gateway install", env)}`);
|
|
if (fileLog) {
|
|
hints.push(`File logs: ${fileLog}`);
|
|
}
|
|
return hints;
|
|
}
|
|
if (runtime.status === "stopped") {
|
|
hints.push("Service is loaded but not running (likely exited immediately).");
|
|
if (fileLog) {
|
|
hints.push(`File logs: ${fileLog}`);
|
|
}
|
|
hints.push(
|
|
...buildPlatformRuntimeLogHints({
|
|
platform,
|
|
env,
|
|
systemdServiceName: resolveGatewaySystemdServiceName(env.OPENCLAW_PROFILE),
|
|
windowsTaskName: resolveGatewayWindowsTaskName(env.OPENCLAW_PROFILE),
|
|
}),
|
|
);
|
|
}
|
|
return hints;
|
|
}
|