Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix(cli): standardize workspaces path under ~/.alook/

Gener834a1264ee80
diff --git a/.env.example b/.env.example
index 07324f49e..e38088474 100644
--- a/.env.example
+++ b/.env.example
@@ -63,8 +63,8 @@
# Directory where the daemon stores workspace checkouts
# Dev default: <project-root>/.alook/workspaces/
-# Prod default: ~/alook_workspaces
-# ALOOK_WORKSPACES_ROOT=~/alook_workspaces
+# Prod default: ~/.alook/workspaces
+# ALOOK_WORKSPACES_ROOT=~/.alook/workspaces
# =============================================================================
diff --git a/src/cli/daemon/config.test.ts b/src/cli/daemon/config.test.ts
index 09f269e10..f218cc62f 100644
--- a/src/cli/daemon/config.test.ts
+++ b/src/cli/daemon/config.test.ts
@@ -106,15 +106,15 @@ describe("daemonId profile suffix", () => {
});
describe("workspacesRoot profile handling", () => {
- it("defaults to ~/alook_workspaces without profile in production", () => {
+ it("defaults to ~/.alook/workspaces without profile in production", () => {
const cfg = loadDaemonConfig();
- expect(cfg.workspacesRoot).toBe(join(homedir(), "alook_workspaces"));
+ expect(cfg.workspacesRoot).toBe(join(homedir(), ".alook", "workspaces"));
});
- it("uses ~/alook_workspaces_{profile} with profile in production", () => {
+ it("uses ~/.alook/workspaces_{profile} with profile in production", () => {
const cfg = loadDaemonConfig("dev");
expect(cfg.workspacesRoot).toBe(
- join(homedir(), "alook_workspaces_dev"),
+ join(homedir(), ".alook", "workspaces_dev"),
);
});
diff --git a/src/cli/daemon/config.ts b/src/cli/daemon/config.ts
index d4d916f29..56ad1943d 100644
--- a/src/cli/daemon/config.ts
+++ b/src/cli/daemon/config.ts
@@ -1,6 +1,6 @@
-import { hostname, homedir } from "os";
+import { hostname } from "os";
import { join } from "path";
-import { isDev } from "../lib/env.js";
+import { configDir } from "../lib/config.js";
function parseDuration(s: string): number {
if (!s) return 0;
@@ -61,15 +61,10 @@ export function loadDaemonConfig(profile?: string): DaemonConfig {
daemonId = `${daemonId}-${profile}`;
}
- let defaultRoot: string;
- if (isDev() && process.env.ALOOK_PROJECT_ROOT) {
- defaultRoot = join(process.env.ALOOK_PROJECT_ROOT, ".alook", "workspaces");
- } else {
- defaultRoot = join(
- homedir(),
- profile ? `alook_workspaces_${profile}` : "alook_workspaces",
- );
- }
+ const defaultRoot = join(
+ configDir(),
+ profile ? `workspaces_${profile}` : "workspaces",
+ );
const workspacesRoot = process.env.ALOOK_WORKSPACES_ROOT || defaultRoot;
return {