@co0ontty/wand 4.60.0 → 4.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +3 -3
- package/dist/claude-pty-bridge.js +4 -0
- package/dist/mission-types.d.ts +4 -0
- package/dist/missions.js +4 -0
- package/dist/server-app-connect.d.ts +40 -0
- package/dist/server-app-connect.js +241 -0
- package/dist/server-file-routes.js +11 -10
- package/dist/server-github-routes.js +12 -30
- package/dist/server-mission-routes.js +4 -2
- package/dist/server-request.d.ts +34 -0
- package/dist/server-request.js +61 -0
- package/dist/server-resume-routes.d.ts +25 -0
- package/dist/server-resume-routes.js +124 -0
- package/dist/server-session-routes.js +37 -182
- package/dist/server-settings-routes.js +6 -5
- package/dist/server-task-routes.js +93 -15
- package/dist/server-update-routes.js +23 -16
- package/dist/server-vault-routes.d.ts +16 -0
- package/dist/server-vault-routes.js +125 -0
- package/dist/server-workspace-routes.js +44 -8
- package/dist/server.js +12 -367
- package/dist/storage.d.ts +20 -1
- package/dist/storage.js +112 -16
- package/dist/structured-session-manager.js +33 -44
- package/dist/task-types.d.ts +19 -1
- package/dist/task-types.js +6 -1
- package/dist/types.d.ts +6 -0
- package/dist/wand-task-sync.d.ts +5 -3
- package/dist/wand-task-sync.js +30 -12
- package/dist/web-ui/content/scripts.js +76 -73
- package/dist/web-ui/content/styles.css +1 -1
- package/dist/web-ui/embedded-assets.js +2 -2
- package/dist/workspace-binding.d.ts +8 -1
- package/dist/workspace-binding.js +38 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WandStorage } from "./storage.js";
|
|
2
|
-
import type
|
|
2
|
+
import { type Workspace, type WorkspaceDefaultProvider, type WorktreeInfo } from "./types.js";
|
|
3
3
|
/** Normalize a project/session cwd so `/foo/bar/` and `/foo/bar` match. */
|
|
4
4
|
export declare function normalizeProjectCwd(cwd: string | null | undefined): string;
|
|
5
5
|
/**
|
|
@@ -16,6 +16,13 @@ export declare function ensureWorkspaceForCwd(storage: WandStorage, cwd: string,
|
|
|
16
16
|
name?: string;
|
|
17
17
|
defaultProvider?: WorkspaceDefaultProvider;
|
|
18
18
|
}): Workspace;
|
|
19
|
+
/**
|
|
20
|
+
* 「工作区名称」和「项目名」是同一个概念:用户在任意一端改名,两端都要写。
|
|
21
|
+
* name 为空表示恢复目录名(清掉自定义名)。返回最终生效的显示名。
|
|
22
|
+
*/
|
|
23
|
+
export declare function renameWorkspaceDirectory(storage: WandStorage, cwd: string, name: string | null | undefined): string;
|
|
24
|
+
/** 项目(workspaces.name)被直接改名后,把目录自定义名同步成同一个名字。 */
|
|
25
|
+
export declare function syncDirectoryNameForWorkspace(storage: WandStorage, workspace: Workspace): void;
|
|
19
26
|
/**
|
|
20
27
|
* Workspace id to persist on a newly created session.
|
|
21
28
|
* An explicit id wins; otherwise find-or-create the project for `cwd`.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { normalizeSessionDirectory } from "./session-directory-tree.js";
|
|
3
|
+
import { GLOBAL_WORKSPACE_ID } from "./types.js";
|
|
3
4
|
/** Normalize a project/session cwd so `/foo/bar/` and `/foo/bar` match. */
|
|
4
5
|
export function normalizeProjectCwd(cwd) {
|
|
5
6
|
const trimmed = cwd?.trim() ?? "";
|
|
@@ -60,6 +61,43 @@ export function ensureWorkspaceForCwd(storage, cwd, options = {}) {
|
|
|
60
61
|
defaultProvider: options.defaultProvider,
|
|
61
62
|
});
|
|
62
63
|
}
|
|
64
|
+
function isGlobalWorkspaceRecord(workspace) {
|
|
65
|
+
return workspace.kind === "global" || workspace.id === GLOBAL_WORKSPACE_ID;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* 「工作区名称」和「项目名」是同一个概念:用户在任意一端改名,两端都要写。
|
|
69
|
+
* name 为空表示恢复目录名(清掉自定义名)。返回最终生效的显示名。
|
|
70
|
+
*/
|
|
71
|
+
export function renameWorkspaceDirectory(storage, cwd, name) {
|
|
72
|
+
const normalized = normalizeProjectCwd(cwd);
|
|
73
|
+
if (!normalized)
|
|
74
|
+
return "";
|
|
75
|
+
const trimmed = name?.trim() ?? "";
|
|
76
|
+
const resolved = trimmed || path.basename(normalized) || normalized;
|
|
77
|
+
storage.setSessionDirectoryName(normalized, trimmed || null);
|
|
78
|
+
for (const workspace of storage.listWorkspaces()) {
|
|
79
|
+
if (isGlobalWorkspaceRecord(workspace))
|
|
80
|
+
continue;
|
|
81
|
+
if (normalizeProjectCwd(workspace.cwd) !== normalized)
|
|
82
|
+
continue;
|
|
83
|
+
if (workspace.name === resolved)
|
|
84
|
+
continue;
|
|
85
|
+
storage.updateWorkspace(workspace.id, { name: resolved });
|
|
86
|
+
}
|
|
87
|
+
return resolved;
|
|
88
|
+
}
|
|
89
|
+
/** 项目(workspaces.name)被直接改名后,把目录自定义名同步成同一个名字。 */
|
|
90
|
+
export function syncDirectoryNameForWorkspace(storage, workspace) {
|
|
91
|
+
if (isGlobalWorkspaceRecord(workspace))
|
|
92
|
+
return;
|
|
93
|
+
const normalized = normalizeProjectCwd(workspace.cwd);
|
|
94
|
+
const name = workspace.name.trim();
|
|
95
|
+
if (!normalized || !name)
|
|
96
|
+
return;
|
|
97
|
+
if (storage.listSessionDirectoryNames().get(normalized) === name)
|
|
98
|
+
return;
|
|
99
|
+
storage.setSessionDirectoryName(normalized, name);
|
|
100
|
+
}
|
|
63
101
|
/**
|
|
64
102
|
* Workspace id to persist on a newly created session.
|
|
65
103
|
* An explicit id wins; otherwise find-or-create the project for `cwd`.
|