@co0ontty/wand 3.1.1 → 4.0.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/auth.d.ts +19 -5
- package/dist/auth.js +83 -45
- package/dist/build-info.json +3 -3
- package/dist/cert.d.ts +1 -1
- package/dist/cert.js +124 -74
- package/dist/config.js +25 -8
- package/dist/express-async.d.ts +6 -0
- package/dist/express-async.js +28 -0
- package/dist/git-quick-commit.d.ts +2 -0
- package/dist/git-quick-commit.js +215 -76
- package/dist/git-utils.d.ts +4 -0
- package/dist/git-utils.js +60 -11
- package/dist/git-worktree.d.ts +8 -1
- package/dist/git-worktree.js +406 -41
- package/dist/models.d.ts +34 -4
- package/dist/models.js +334 -48
- package/dist/process-manager.d.ts +22 -30
- package/dist/process-manager.js +374 -441
- package/dist/provider-history-scanner.d.ts +54 -0
- package/dist/provider-history-scanner.js +354 -0
- package/dist/request-limits.d.ts +1 -0
- package/dist/request-limits.js +8 -0
- package/dist/resume-policy.d.ts +2 -0
- package/dist/resume-policy.js +5 -0
- package/dist/runtime-config.d.ts +16 -0
- package/dist/runtime-config.js +49 -0
- package/dist/server-file-routes.d.ts +17 -0
- package/dist/server-file-routes.js +653 -0
- package/dist/server-session-routes.d.ts +16 -3
- package/dist/server-session-routes.js +170 -149
- package/dist/server-settings-routes.d.ts +43 -0
- package/dist/server-settings-routes.js +225 -0
- package/dist/server-update-routes.d.ts +61 -0
- package/dist/server-update-routes.js +215 -0
- package/dist/server.d.ts +6 -4
- package/dist/server.js +350 -1313
- package/dist/session-logger.d.ts +32 -2
- package/dist/session-logger.js +145 -15
- package/dist/session-registry.d.ts +27 -0
- package/dist/session-registry.js +153 -0
- package/dist/session-transport.d.ts +31 -0
- package/dist/session-transport.js +82 -0
- package/dist/storage.d.ts +24 -6
- package/dist/storage.js +291 -44
- package/dist/structured-claude-adapter.d.ts +19 -0
- package/dist/structured-claude-adapter.js +117 -0
- package/dist/structured-codex-adapter.d.ts +3 -0
- package/dist/structured-codex-adapter.js +29 -0
- package/dist/structured-opencode-adapter.d.ts +11 -0
- package/dist/structured-opencode-adapter.js +115 -0
- package/dist/structured-provider-common.d.ts +11 -0
- package/dist/structured-provider-common.js +77 -0
- package/dist/structured-session-manager.d.ts +32 -35
- package/dist/structured-session-manager.js +551 -605
- package/dist/types.d.ts +10 -0
- package/dist/update-helper.js +5 -1
- package/dist/web-ui/content/scripts.js +32 -32
- package/dist/web-ui/embedded-assets.d.ts +1 -1
- package/dist/web-ui/embedded-assets.js +2 -2
- package/dist/ws-broadcast.d.ts +16 -1
- package/dist/ws-broadcast.js +124 -58
- package/package.json +2 -1
package/dist/git-utils.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export interface RunGitOptions {
|
|
2
2
|
timeout?: number;
|
|
3
3
|
maxBuffer?: number;
|
|
4
|
+
env?: NodeJS.ProcessEnv;
|
|
5
|
+
signal?: AbortSignal;
|
|
4
6
|
}
|
|
5
7
|
export declare function runGit(args: string[], cwd: string, opts?: RunGitOptions): string;
|
|
6
8
|
export declare function runGitRaw(args: string[], cwd: string, opts?: RunGitOptions): string;
|
|
9
|
+
export declare function runGitAsync(args: string[], cwd: string, opts?: RunGitOptions): Promise<string>;
|
|
10
|
+
export declare function runGitRawAsync(args: string[], cwd: string, opts?: RunGitOptions): Promise<string>;
|
|
7
11
|
export declare function getGitErrorMessage(error: unknown): string;
|
package/dist/git-utils.js
CHANGED
|
@@ -1,20 +1,69 @@
|
|
|
1
|
-
import { execFileSync } from "node:child_process";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { execFile, execFileSync, } from "node:child_process";
|
|
2
|
+
const DEFAULT_GIT_TIMEOUT_MS = 30_000;
|
|
3
|
+
const DEFAULT_GIT_MAX_BUFFER = 10 * 1024 * 1024;
|
|
4
|
+
function positiveInteger(value, fallback) {
|
|
5
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0
|
|
6
|
+
? Math.floor(value)
|
|
7
|
+
: fallback;
|
|
8
|
+
}
|
|
9
|
+
function gitEnvironment(opts) {
|
|
10
|
+
return {
|
|
11
|
+
...process.env,
|
|
12
|
+
...(opts.env ?? {}),
|
|
13
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
14
|
+
GIT_ASKPASS: "true",
|
|
15
|
+
GCM_INTERACTIVE: "never",
|
|
16
|
+
SSH_ASKPASS_REQUIRE: "never",
|
|
17
|
+
GIT_EDITOR: "true",
|
|
18
|
+
GIT_SEQUENCE_EDITOR: "true",
|
|
19
|
+
GIT_MERGE_AUTOEDIT: "no",
|
|
20
|
+
GIT_PAGER: "cat",
|
|
21
|
+
PAGER: "cat",
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function gitExecOptions(cwd, opts) {
|
|
25
|
+
return {
|
|
4
26
|
cwd,
|
|
5
27
|
encoding: "utf8",
|
|
6
28
|
stdio: ["ignore", "pipe", "pipe"],
|
|
7
|
-
timeout: opts.timeout,
|
|
8
|
-
maxBuffer: opts.maxBuffer,
|
|
9
|
-
|
|
29
|
+
timeout: positiveInteger(opts.timeout, DEFAULT_GIT_TIMEOUT_MS),
|
|
30
|
+
maxBuffer: positiveInteger(opts.maxBuffer, DEFAULT_GIT_MAX_BUFFER),
|
|
31
|
+
windowsHide: true,
|
|
32
|
+
env: gitEnvironment(opts),
|
|
33
|
+
};
|
|
10
34
|
}
|
|
11
|
-
|
|
12
|
-
return
|
|
35
|
+
function gitExecAsyncOptions(cwd, opts) {
|
|
36
|
+
return {
|
|
13
37
|
cwd,
|
|
14
38
|
encoding: "utf8",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
39
|
+
timeout: positiveInteger(opts.timeout, DEFAULT_GIT_TIMEOUT_MS),
|
|
40
|
+
maxBuffer: positiveInteger(opts.maxBuffer, DEFAULT_GIT_MAX_BUFFER),
|
|
41
|
+
windowsHide: true,
|
|
42
|
+
env: gitEnvironment(opts),
|
|
43
|
+
signal: opts.signal,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export function runGit(args, cwd, opts = {}) {
|
|
47
|
+
return execFileSync("git", args, gitExecOptions(cwd, opts)).trim();
|
|
48
|
+
}
|
|
49
|
+
export function runGitRaw(args, cwd, opts = {}) {
|
|
50
|
+
return execFileSync("git", args, gitExecOptions(cwd, opts));
|
|
51
|
+
}
|
|
52
|
+
export async function runGitAsync(args, cwd, opts = {}) {
|
|
53
|
+
return (await runGitRawAsync(args, cwd, opts)).trim();
|
|
54
|
+
}
|
|
55
|
+
export function runGitRawAsync(args, cwd, opts = {}) {
|
|
56
|
+
return new Promise((resolve, reject) => {
|
|
57
|
+
execFile("git", args, gitExecAsyncOptions(cwd, opts), (error, stdout, stderr) => {
|
|
58
|
+
if (error) {
|
|
59
|
+
const commandError = error;
|
|
60
|
+
commandError.stdout = typeof stdout === "string" ? stdout : "";
|
|
61
|
+
commandError.stderr = typeof stderr === "string" ? stderr : "";
|
|
62
|
+
reject(commandError);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
resolve(stdout);
|
|
66
|
+
});
|
|
18
67
|
});
|
|
19
68
|
}
|
|
20
69
|
export function getGitErrorMessage(error) {
|
package/dist/git-worktree.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ interface WorktreeSetupResult {
|
|
|
10
10
|
}
|
|
11
11
|
interface WorktreeOperationOptions {
|
|
12
12
|
worktree: NonNullable<SessionSnapshot["worktree"]>;
|
|
13
|
+
/** Primarily exposed for bounded request handling and deterministic tests. */
|
|
14
|
+
gitTimeoutMs?: number;
|
|
13
15
|
}
|
|
14
16
|
interface WorktreeMergeOptions extends WorktreeOperationOptions {
|
|
15
17
|
targetBranch?: string;
|
|
@@ -19,10 +21,15 @@ export declare class WorktreeMergeError extends Error {
|
|
|
19
21
|
readonly result?: Partial<WorktreeMergeResult> | undefined;
|
|
20
22
|
constructor(code: string, message: string, result?: Partial<WorktreeMergeResult> | undefined);
|
|
21
23
|
}
|
|
22
|
-
export declare function getDefaultBaseBranch(repoRoot: string): string;
|
|
24
|
+
export declare function getDefaultBaseBranch(repoRoot: string, timeoutMs?: number): string;
|
|
23
25
|
export declare function getWorktreeMergeErrorCode(error: unknown): string | undefined;
|
|
24
26
|
export declare function checkSessionWorktreeMergeability(options: WorktreeMergeOptions): WorktreeMergeCheckResult;
|
|
25
27
|
export declare function cleanupSessionWorktree(options: WorktreeOperationOptions): boolean;
|
|
26
28
|
export declare function mergeSessionWorktree(options: WorktreeMergeOptions): WorktreeMergeResult;
|
|
29
|
+
/** Async HTTP-facing worktree check; commands remain deliberately serial. */
|
|
30
|
+
export declare function checkSessionWorktreeMergeabilityAsync(options: WorktreeMergeOptions): Promise<WorktreeMergeCheckResult>;
|
|
31
|
+
export declare function cleanupSessionWorktreeAsync(options: WorktreeOperationOptions): Promise<boolean>;
|
|
32
|
+
/** Async HTTP-facing merge with serial, non-cancellable rollback. */
|
|
33
|
+
export declare function mergeSessionWorktreeAsync(options: WorktreeMergeOptions): Promise<WorktreeMergeResult>;
|
|
27
34
|
export declare function prepareSessionWorktree(options: WorktreeSetupOptions): WorktreeSetupResult;
|
|
28
35
|
export {};
|