feat: enhance after-pack script to copy OpenClaw runtime dependencies

- Added a new script `bundle-openclaw.mjs` to bundle OpenClaw runtime dependencies.
- Updated `after-pack.cjs` to copy bundled OpenClaw runtime and its node_modules.
- Improved cleanup of unnecessary development files in node_modules.
- Adjusted paths for resources in the packaging process.

style: update loading indicator styles in ChatHistoryPanel

- Changed the border radius and padding for the loading indicator in ChatHistoryPanel.

fix: improve ProvidersSection to handle provider account syncing

- Added logic to sync model configuration to provider accounts.
- Introduced error handling and loading states during the sync process.
- Enhanced vendor resolution and account management logic.

fix: fallback session handling in chat store

- Implemented fallback session logic in loadSessions to ensure a valid session is always available on error.
This commit is contained in:
duanshuwen
2026-04-22 21:56:37 +08:00
parent 2f675afe47
commit ea1fd18e6f
22 changed files with 8947 additions and 94 deletions

View File

@@ -64,6 +64,49 @@ export function getOpenClawEntryPath(): string {
return join(getOpenClawDir(), OPENCLAW_ENTRY_FILE_NAME);
}
export function getOpenClawNodeModulesDir(): string {
return join(getOpenClawDir(), 'node_modules');
}
export function getOpenClawBuildDir(): string {
return join(app.getAppPath(), 'build', OPENCLAW_PACKAGE_DIR_NAME);
}
export function getOpenClawPackageStatus(): {
dir: string;
entryPath: string;
nodeModulesDir: string;
packageExists: boolean;
entryExists: boolean;
nodeModulesExists: boolean;
};
export function getOpenClawPackageStatus(
overrides?: Partial<Pick<OpenClawRuntimePaths, 'dir' | 'entryPath'>>,
): {
dir: string;
entryPath: string;
nodeModulesDir: string;
packageExists: boolean;
entryExists: boolean;
nodeModulesExists: boolean;
} {
const dir = overrides?.dir ?? getOpenClawDir();
const entryPath = overrides?.entryPath ?? join(dir, OPENCLAW_ENTRY_FILE_NAME);
const nodeModulesDir = join(dir, 'node_modules');
const entryExists = existsSync(entryPath);
const nodeModulesExists = existsSync(nodeModulesDir);
return {
dir,
entryPath,
nodeModulesDir,
packageExists: existsSync(dir),
entryExists,
nodeModulesExists,
};
}
export function getClawHubCliBinPath(): string {
const binName = process.platform === 'win32' ? 'clawhub.cmd' : 'clawhub';
return join(app.getAppPath(), 'node_modules', '.bin', binName);