






















@@ -313,23 +313,6 @@ function isManagedByGlobalPackageManager(
313313});
314314}
315315316-export function getSelfUpdateCommand(
317-packageName: string,
318-npmCommand?: string[],
319-updatePackageName = packageName,
320-): SelfUpdateCommand | undefined {
321-const method = detectInstallMethod();
322-const command = getSelfUpdateCommandForMethod(method, packageName, updatePackageName, npmCommand);
323-if (
324-!command ||
325-!isManagedByGlobalPackageManager(method, packageName, npmCommand) ||
326-!isSelfUpdatePathWritable()
327-) {
328-return undefined;
329-}
330-return command;
331-}
332-333316export function getSelfUpdateUnavailableInstruction(
334317packageName: string,
335318npmCommand?: string[],
@@ -352,15 +335,6 @@ export function getSelfUpdateUnavailableInstruction(
352335return `Update ${updatePackageName} using the package manager, wrapper, or source checkout that provides this installation.`;
353336}
354337355-export function getUpdateInstruction(packageName: string): string {
356-const method = detectInstallMethod();
357-const command = getSelfUpdateCommandForMethod(method, packageName);
358-if (command) {
359-return `Run: ${command.display}`;
360-}
361-return getSelfUpdateUnavailableInstruction(packageName);
362-}
363-364338// =============================================================================
365339// Package Asset Paths (shipped with executable)
366340// =============================================================================
@@ -439,29 +413,6 @@ export function getExamplesPath(): string {
439413return resolve(join(getPackageDir(), "examples"));
440414}
441415442-/** Get path to CHANGELOG.md */
443-export function getChangelogPath(): string {
444-return resolve(join(getPackageDir(), "CHANGELOG.md"));
445-}
446-447-/**
448- * Get path to built-in interactive assets directory.
449- * - For Bun binary: assets/ next to executable
450- * - For Node.js (dist/): dist/agents/modes/interactive/assets/
451- * - For tsx (src/): src/agents/modes/interactive/assets/
452- */
453-export function getInteractiveAssetsDir(): string {
454-if (isBunBinary) {
455-return join(getPackageDir(), "assets");
456-}
457-return join(getPackageSourceOrDistDir(), "agents", "modes", "interactive", "assets");
458-}
459-460-/** Get path to a bundled interactive asset */
461-export function getBundledInteractiveAssetPath(name: string): string {
462-return join(getInteractiveAssetsDir(), name);
463-}
464-465416// =============================================================================
466417// App Config (from package.json openclawConfig)
467418// =============================================================================
@@ -478,14 +429,11 @@ interface PackageJson {
478429const pkg = JSON.parse(readFileSync(getPackageJsonPath(), "utf-8")) as PackageJson;
479430480431const openClawConfigName: string | undefined = pkg.openclawConfig?.name;
481-export const PACKAGE_NAME: string = pkg.name || "openclaw/plugin-sdk/agent-sessions";
482432export const APP_NAME: string = openClawConfigName || "openclaw";
483-export const APP_TITLE: string = openClawConfigName ? APP_NAME : "OpenClaw";
484433export const CONFIG_DIR_NAME: string = pkg.openclawConfig?.configDir || ".openclaw";
485434export const VERSION: string = pkg.version || "0.0.0";
486435487436export const ENV_AGENT_DIR = `${APP_NAME.toUpperCase()}_AGENT_DIR`;
488-export const ENV_SESSION_DIR = `${APP_NAME.toUpperCase()}_AGENT_SESSION_DIR`;
489437490438export function expandTildePath(path: string): string {
491439if (path === "~") {
@@ -497,14 +445,6 @@ export function expandTildePath(path: string): string {
497445return path;
498446}
499447500-const DEFAULT_SHARE_VIEWER_URL = "https://openclaw.ai/session/";
501-502-/** Get the share viewer URL for a gist ID */
503-export function getShareViewerUrl(gistId: string): string {
504-const baseUrl = process.env.OPENCLAW_SHARE_VIEWER_URL || DEFAULT_SHARE_VIEWER_URL;
505-return `${baseUrl}#${gistId}`;
506-}
507-508448// =============================================================================
509449// User Config Paths (~/.openclaw/agent/*)
510450// =============================================================================
@@ -523,42 +463,12 @@ export function getCustomThemesDir(): string {
523463return join(getAgentDir(), "themes");
524464}
525465526-/** Get path to models.json */
527-export function getModelsPath(): string {
528-return join(getAgentDir(), "models.json");
529-}
530-531-/** Get path to auth.json */
532-export function getAuthPath(): string {
533-return join(getAgentDir(), "auth.json");
534-}
535-536-/** Get path to settings.json */
537-export function getSettingsPath(): string {
538-return join(getAgentDir(), "settings.json");
539-}
540-541-/** Get path to tools directory */
542-export function getToolsDir(): string {
543-return join(getAgentDir(), "tools");
544-}
545-546466/** Get path to managed binaries directory (fd, rg) */
547467export function getBinDir(): string {
548468return join(getAgentDir(), "bin");
549469}
550470551-/** Get path to prompt templates directory */
552-export function getPromptsDir(): string {
553-return join(getAgentDir(), "prompts");
554-}
555-556471/** Get path to sessions directory */
557472export function getSessionsDir(): string {
558473return join(getAgentDir(), "sessions");
559474}
560-561-/** Get path to debug log file */
562-export function getDebugLogPath(): string {
563-return join(getAgentDir(), `${APP_NAME}-debug.log`);
564-}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。