aicomputer 0.1.21 → 0.2.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.
@@ -1,367 +0,0 @@
1
- import {
2
- MOUNT_SERVICE_LABEL,
3
- ensureHandleDirectories,
4
- ensureMountDirectories
5
- } from "./chunk-KXLTHWW3.js";
6
- import {
7
- resolveMutagenCommandPath
8
- } from "./chunk-GD42GHW3.js";
9
-
10
- // src/lib/mount-mutagen.ts
11
- import { chmodSync, readFileSync, symlinkSync, unlinkSync, writeFileSync } from "fs";
12
- import { spawn, spawnSync } from "child_process";
13
- import { basename, join, relative, resolve } from "path";
14
- var SYNC_NAME_PREFIX = "agentcomputer-mount-";
15
- var DEFAULT_IGNORE_PATHS = [
16
- ".codex/tmp",
17
- ".dbus",
18
- ".local",
19
- ".run",
20
- ".runtime",
21
- ".ssh/sshd.log"
22
- ];
23
- function ensureMutagenSshEnvironment(config, paths) {
24
- ensureMountDirectories(paths);
25
- const sshPath = resolveCommandPath("ssh");
26
- const scpPath = resolveCommandPath("scp");
27
- writeExecutableLink(paths.sshToolsDir, "ssh", sshPath);
28
- writeExecutableLink(paths.sshToolsDir, "scp", scpPath);
29
- writeExecutableLink(paths.sshToolsDir, basename(sshPath), sshPath);
30
- writeExecutableLink(paths.sshToolsDir, basename(scpPath), scpPath);
31
- }
32
- function getHandleSessionName(handle) {
33
- return `${SYNC_NAME_PREFIX}${handle}`;
34
- }
35
- function getDefaultMountIgnorePaths() {
36
- return [...DEFAULT_IGNORE_PATHS];
37
- }
38
- function createHandleSession(handle, config, paths, signal) {
39
- ensureHandleDirectories(handle, config.rootPath);
40
- const sessionName = getHandleSessionName(handle);
41
- const args = [
42
- "sync",
43
- "create",
44
- join(paths.rootPath, handle),
45
- `${handle}@${config.alias}:/home/node`,
46
- "--name",
47
- sessionName,
48
- "--label",
49
- `${MOUNT_SERVICE_LABEL}=true`,
50
- "--label",
51
- `${MOUNT_SERVICE_LABEL}.handle=${handle}`,
52
- "--symlink-mode",
53
- "posix-raw"
54
- ];
55
- for (const ignorePath of DEFAULT_IGNORE_PATHS) {
56
- args.push("--ignore", ignorePath);
57
- }
58
- return runMutagen(args, config, paths, handle, { signal }).then(async () => {
59
- await runMutagen(
60
- ["sync", "flush", sessionName, "--skip-wait"],
61
- config,
62
- paths,
63
- handle,
64
- { signal }
65
- );
66
- });
67
- }
68
- function terminateSession(session, config, paths, signal) {
69
- return runMutagen(
70
- ["sync", "terminate", session.identifier],
71
- config,
72
- paths,
73
- session.handle,
74
- { ignoreFailure: true, signal }
75
- ).then(() => void 0);
76
- }
77
- function inspectHandleSession(handle, config, paths, signal) {
78
- return listOwnedSessions(config, paths, signal).then((sessions) => {
79
- const matching = sessions.filter((session) => session.handle === handle);
80
- if (matching.length === 0) {
81
- return null;
82
- }
83
- return selectPreferredSession(handle, matching);
84
- });
85
- }
86
- async function listOwnedSessions(config, paths, signal) {
87
- const result = await runMutagen(["sync", "list", "-l"], config, paths, "mount", {
88
- ignoreFailure: true,
89
- signal
90
- });
91
- const raw = [result.stdout, result.stderr].filter(Boolean).join("\n").trim();
92
- if (!raw) {
93
- return [];
94
- }
95
- if (!result.ok && raw.includes("No synchronization sessions found")) {
96
- return [];
97
- }
98
- const rootPath = resolve(paths.rootPath);
99
- const sessions = parseMutagenSyncList(raw).filter((session) => session.alphaPath).map((session) => {
100
- const alphaPath = resolve(session.alphaPath);
101
- const handle = basename(alphaPath);
102
- const expectedName = getHandleSessionName(handle);
103
- const expectedBeta = `${handle}@${config.alias}:/home/node`;
104
- const owned = alphaPath === rootPath || relative(rootPath, alphaPath) === "" || !relative(rootPath, alphaPath).startsWith("..") && !relative(rootPath, alphaPath).startsWith("../");
105
- if (!owned || !session.identifier) {
106
- return null;
107
- }
108
- return {
109
- identifier: session.identifier,
110
- name: session.name,
111
- handle,
112
- alphaPath,
113
- betaUrl: session.betaUrl,
114
- alphaConnected: session.alphaConnected,
115
- betaConnected: session.betaConnected,
116
- status: session.status,
117
- lastError: session.lastError,
118
- stagingProgress: session.stagingProgress,
119
- currentFile: session.currentFile,
120
- scanProblemCount: session.scanProblemCount,
121
- conflictCount: session.conflictCount,
122
- legacy: session.name !== expectedName || session.betaUrl !== expectedBeta || alphaPath !== resolve(join(rootPath, handle))
123
- };
124
- }).filter((session) => session !== null);
125
- return sessions.sort((left, right) => left.handle.localeCompare(right.handle));
126
- }
127
- function selectPreferredSession(handle, sessions) {
128
- const expectedName = getHandleSessionName(handle);
129
- const exact = sessions.find((session) => session.name === expectedName);
130
- return exact ?? sessions[0];
131
- }
132
- function parseMutagenSyncList(output) {
133
- const sessions = [];
134
- let current = null;
135
- let section = "";
136
- const finishCurrent = () => {
137
- if (current?.identifier) {
138
- sessions.push(current);
139
- }
140
- current = null;
141
- section = "";
142
- };
143
- for (const line of output.split(/\r?\n/)) {
144
- if (/^-{20,}$/.test(line.trim())) {
145
- finishCurrent();
146
- continue;
147
- }
148
- const trimmed = line.trim();
149
- if (!trimmed) {
150
- continue;
151
- }
152
- if (!current) {
153
- current = {
154
- alphaConnected: false,
155
- betaConnected: false,
156
- scanProblemCount: 0,
157
- conflictCount: 0
158
- };
159
- }
160
- if (trimmed.endsWith(":")) {
161
- switch (trimmed.slice(0, -1)) {
162
- case "Alpha":
163
- case "Beta":
164
- case "Scan problems":
165
- case "Conflicts":
166
- section = trimmed.slice(0, -1);
167
- continue;
168
- default:
169
- continue;
170
- }
171
- }
172
- if (trimmed.startsWith("Name: ")) {
173
- current.name = trimmed.slice("Name: ".length);
174
- continue;
175
- }
176
- if (trimmed.startsWith("Identifier: ")) {
177
- current.identifier = trimmed.slice("Identifier: ".length);
178
- continue;
179
- }
180
- if (trimmed.startsWith("Status: ")) {
181
- current.status = trimmed.slice("Status: ".length);
182
- continue;
183
- }
184
- if (trimmed.startsWith("Staging progress: ")) {
185
- current.stagingProgress = trimmed.slice("Staging progress: ".length);
186
- continue;
187
- }
188
- if (trimmed.startsWith("Current file: ")) {
189
- current.currentFile = trimmed.slice("Current file: ".length);
190
- continue;
191
- }
192
- if (trimmed.startsWith("Last error: ")) {
193
- current.lastError = trimmed.slice("Last error: ".length);
194
- continue;
195
- }
196
- if (section === "Alpha") {
197
- if (trimmed.startsWith("URL: ")) {
198
- current.alphaPath = trimmed.slice("URL: ".length);
199
- continue;
200
- }
201
- if (trimmed.startsWith("Connected: ")) {
202
- current.alphaConnected = parseConnected(trimmed);
203
- continue;
204
- }
205
- }
206
- if (section === "Beta") {
207
- if (trimmed.startsWith("URL: ")) {
208
- current.betaUrl = trimmed.slice("URL: ".length);
209
- continue;
210
- }
211
- if (trimmed.startsWith("Connected: ")) {
212
- current.betaConnected = parseConnected(trimmed);
213
- continue;
214
- }
215
- }
216
- if (section === "Scan problems") {
217
- current.scanProblemCount += 1;
218
- continue;
219
- }
220
- if (section === "Conflicts") {
221
- if (trimmed.startsWith("(alpha)")) {
222
- current.conflictCount += 1;
223
- }
224
- continue;
225
- }
226
- }
227
- finishCurrent();
228
- return sessions;
229
- }
230
- function parseConnected(line) {
231
- return line.slice("Connected: ".length).trim().toLowerCase() === "yes";
232
- }
233
- function isAbortError(error) {
234
- return error instanceof Error && error.name === "AbortError";
235
- }
236
- async function runMutagen(args, config, paths, handle, options = {}) {
237
- if (options.signal?.aborted) {
238
- throw createAbortError(handle);
239
- }
240
- return new Promise((resolve2, reject) => {
241
- const child = spawn(resolveMutagenCommandPath(), args, {
242
- env: {
243
- ...process.env,
244
- MUTAGEN_SSH_PATH: paths.sshToolsDir,
245
- MUTAGEN_SSH_CONNECT_TIMEOUT: String(config.connectTimeoutSeconds)
246
- },
247
- stdio: ["ignore", "pipe", "pipe"]
248
- });
249
- let stdout = "";
250
- let stderr = "";
251
- let settled = false;
252
- let killTimer = null;
253
- const finish = (callback) => {
254
- if (settled) {
255
- return;
256
- }
257
- settled = true;
258
- if (killTimer) {
259
- clearTimeout(killTimer);
260
- }
261
- options.signal?.removeEventListener("abort", onAbort);
262
- callback();
263
- };
264
- const onAbort = () => {
265
- if (child.exitCode !== null) {
266
- return;
267
- }
268
- child.kill("SIGTERM");
269
- killTimer = setTimeout(() => {
270
- if (child.exitCode === null) {
271
- child.kill("SIGKILL");
272
- }
273
- }, 1e3);
274
- };
275
- options.signal?.addEventListener("abort", onAbort, { once: true });
276
- child.stdout?.setEncoding("utf8");
277
- child.stdout?.on("data", (chunk) => {
278
- stdout += chunk;
279
- });
280
- child.stderr?.setEncoding("utf8");
281
- child.stderr?.on("data", (chunk) => {
282
- stderr += chunk;
283
- });
284
- child.once("error", (error) => {
285
- finish(() => {
286
- reject(options.signal?.aborted ? createAbortError(handle) : error);
287
- });
288
- });
289
- child.once("close", (code) => {
290
- const result = {
291
- ok: code === 0,
292
- stdout: stdout.trim(),
293
- stderr: stderr.trim(),
294
- status: code
295
- };
296
- finish(() => {
297
- if (options.signal?.aborted) {
298
- reject(createAbortError(handle));
299
- return;
300
- }
301
- if (code !== 0 && !options.ignoreFailure) {
302
- reject(
303
- new Error(result.stderr || result.stdout || `mutagen failed for ${handle}`)
304
- );
305
- return;
306
- }
307
- resolve2(result);
308
- });
309
- });
310
- });
311
- }
312
- function createAbortError(handle) {
313
- const error = new Error(`mutagen cancelled for ${handle}`);
314
- error.name = "AbortError";
315
- return error;
316
- }
317
- function resolveCommandPath(command) {
318
- const result = spawnSync("which", [command], { encoding: "utf8" });
319
- if (result.status !== 0) {
320
- throw new Error(`failed to resolve ${command}`);
321
- }
322
- return result.stdout.trim();
323
- }
324
- function writeExecutableLink(directory, name, target) {
325
- const linkPath = join(directory, name);
326
- try {
327
- unlinkSync(linkPath);
328
- } catch {
329
- }
330
- try {
331
- symlinkSync(target, linkPath);
332
- } catch {
333
- const script = `#!/bin/sh
334
- exec "${escapeShell(target)}" "$@"
335
- `;
336
- writeFileSync(linkPath, script, { mode: 493 });
337
- chmodSync(linkPath, 493);
338
- return;
339
- }
340
- try {
341
- const stat = readFileSync(linkPath);
342
- if (!stat) {
343
- throw new Error("empty");
344
- }
345
- } catch {
346
- const script = `#!/bin/sh
347
- exec "${escapeShell(target)}" "$@"
348
- `;
349
- writeFileSync(linkPath, script, { mode: 493 });
350
- chmodSync(linkPath, 493);
351
- }
352
- }
353
- function escapeShell(value) {
354
- return value.replaceAll("\\", "\\\\").replaceAll("`", "\\`").replaceAll("$", "\\$").replaceAll('"', '\\"');
355
- }
356
-
357
- export {
358
- ensureMutagenSshEnvironment,
359
- getHandleSessionName,
360
- getDefaultMountIgnorePaths,
361
- createHandleSession,
362
- terminateSession,
363
- inspectHandleSession,
364
- listOwnedSessions,
365
- selectPreferredSession,
366
- isAbortError
367
- };
@@ -1,21 +0,0 @@
1
- type SupportedPlatform = "darwin" | "linux";
2
- type BundledAutosshAsset = {
3
- platform: SupportedPlatform;
4
- version: string;
5
- archiveName: string;
6
- downloadUrl: string;
7
- archiveSha256: string;
8
- installDir: string;
9
- executablePath: string;
10
- };
11
- declare const AGENTCOMPUTER_AUTOSSH_PATH_ENV = "AGENTCOMPUTER_AUTOSSH_PATH";
12
- declare const AUTOSSH_SSH_PATH_ENV = "AUTOSSH_PATH";
13
- declare function getBundledAutosshAsset(platform?: NodeJS.Platform, homeDirectory?: string): BundledAutosshAsset | null;
14
- declare function hasBundledAutossh(): boolean;
15
- declare function ensureAutosshCommandPath(env?: NodeJS.ProcessEnv): Promise<string>;
16
- declare function ensureBundledAutosshInstalled(): Promise<string>;
17
- declare function resolveAutosshCommandPath(env?: NodeJS.ProcessEnv): string;
18
- declare function resolveAutosshSSHCommandPath(env?: NodeJS.ProcessEnv): string;
19
- declare function getMissingOpenSSHClientMessage(platform?: NodeJS.Platform): string;
20
-
21
- export { AGENTCOMPUTER_AUTOSSH_PATH_ENV, AUTOSSH_SSH_PATH_ENV, type BundledAutosshAsset, ensureAutosshCommandPath, ensureBundledAutosshInstalled, getBundledAutosshAsset, getMissingOpenSSHClientMessage, hasBundledAutossh, resolveAutosshCommandPath, resolveAutosshSSHCommandPath };
@@ -1,23 +0,0 @@
1
- import {
2
- AGENTCOMPUTER_AUTOSSH_PATH_ENV,
3
- AUTOSSH_SSH_PATH_ENV,
4
- ensureAutosshCommandPath,
5
- ensureBundledAutosshInstalled,
6
- getBundledAutosshAsset,
7
- getMissingOpenSSHClientMessage,
8
- hasBundledAutossh,
9
- resolveAutosshCommandPath,
10
- resolveAutosshSSHCommandPath
11
- } from "../chunk-3ZF7JRBW.js";
12
- import "../chunk-5Y2NWK5I.js";
13
- export {
14
- AGENTCOMPUTER_AUTOSSH_PATH_ENV,
15
- AUTOSSH_SSH_PATH_ENV,
16
- ensureAutosshCommandPath,
17
- ensureBundledAutosshInstalled,
18
- getBundledAutosshAsset,
19
- getMissingOpenSSHClientMessage,
20
- hasBundledAutossh,
21
- resolveAutosshCommandPath,
22
- resolveAutosshSSHCommandPath
23
- };
@@ -1,79 +0,0 @@
1
- declare const MOUNT_SERVICE_LABEL = "ai.agentcomputer.mount";
2
- interface MountServiceConfig {
3
- alias: string;
4
- host: string;
5
- port: number;
6
- rootPath: string;
7
- pollIntervalMs: number;
8
- connectTimeoutSeconds: number;
9
- }
10
- interface ManagedMountSnapshot {
11
- handle: string;
12
- mountPath: string;
13
- state: "mounted" | "syncing" | "reconnecting" | "degraded" | "pending" | "error";
14
- message?: string;
15
- status?: string;
16
- progress?: string;
17
- currentFile?: string;
18
- etaSeconds?: number;
19
- updatedAt: string;
20
- }
21
- type MountStartupPhase = "starting" | "cleaning" | "syncing" | "ready";
22
- interface MountStatusSnapshot {
23
- updatedAt: string;
24
- controllerPid?: number;
25
- running: boolean;
26
- startupPhase?: MountStartupPhase;
27
- startupMessage?: string;
28
- lastHealthySyncAt?: string;
29
- lastSuccessfulSyncAt?: string;
30
- lastIssueAt?: string;
31
- lastIssue?: string;
32
- lastError?: string;
33
- mounts: ManagedMountSnapshot[];
34
- }
35
- interface MountPaths {
36
- stateDir: string;
37
- rootPath: string;
38
- configPath: string;
39
- statusPath: string;
40
- socketPath: string;
41
- controllerLockPath: string;
42
- handlesDir: string;
43
- sshToolsDir: string;
44
- staleDir: string;
45
- }
46
- interface MountHandlePaths {
47
- stateDir: string;
48
- metaPath: string;
49
- sshToolsDir: string;
50
- }
51
- interface MountHandleMeta {
52
- handle: string;
53
- sessionName?: string;
54
- startedAt: string;
55
- lastStartedAt?: string;
56
- }
57
- interface MountControllerLock {
58
- pid: number;
59
- startedAt: string;
60
- }
61
- declare function getDefaultMountRoot(): string;
62
- declare function getMountStateDir(): string;
63
- declare function getMountPaths(rootPath?: string): MountPaths;
64
- declare function getMountHandlePaths(handle: string, rootPath?: string): MountHandlePaths;
65
- declare function defaultMountServiceConfig(): MountServiceConfig;
66
- declare function ensureMountDirectories(paths: MountPaths): void;
67
- declare function ensureHandleDirectories(handle: string, rootPath?: string): MountHandlePaths;
68
- declare function readMountConfig(): MountServiceConfig | null;
69
- declare function writeMountConfig(config: MountServiceConfig): void;
70
- declare function readMountStatusSnapshot(rootPath?: string): MountStatusSnapshot | null;
71
- declare function writeMountStatusSnapshot(snapshot: MountStatusSnapshot, rootPath?: string): void;
72
- declare function readMountControllerLock(rootPath?: string): MountControllerLock | null;
73
- declare function writeMountControllerLock(lock: MountControllerLock, rootPath?: string): void;
74
- declare function removeMountControllerLock(rootPath?: string): void;
75
- declare function readMountHandleMeta(handle: string, rootPath?: string): MountHandleMeta | null;
76
- declare function writeMountHandleMeta(handle: string, meta: MountHandleMeta, rootPath?: string): void;
77
- declare function removeMountHandleState(handle: string, rootPath?: string): void;
78
-
79
- export { MOUNT_SERVICE_LABEL, type ManagedMountSnapshot, type MountControllerLock, type MountHandleMeta, type MountHandlePaths, type MountPaths, type MountServiceConfig, type MountStartupPhase, type MountStatusSnapshot, defaultMountServiceConfig, ensureHandleDirectories, ensureMountDirectories, getDefaultMountRoot, getMountHandlePaths, getMountPaths, getMountStateDir, readMountConfig, readMountControllerLock, readMountHandleMeta, readMountStatusSnapshot, removeMountControllerLock, removeMountHandleState, writeMountConfig, writeMountControllerLock, writeMountHandleMeta, writeMountStatusSnapshot };
@@ -1,40 +0,0 @@
1
- import {
2
- MOUNT_SERVICE_LABEL,
3
- defaultMountServiceConfig,
4
- ensureHandleDirectories,
5
- ensureMountDirectories,
6
- getDefaultMountRoot,
7
- getMountHandlePaths,
8
- getMountPaths,
9
- getMountStateDir,
10
- readMountConfig,
11
- readMountControllerLock,
12
- readMountHandleMeta,
13
- readMountStatusSnapshot,
14
- removeMountControllerLock,
15
- removeMountHandleState,
16
- writeMountConfig,
17
- writeMountControllerLock,
18
- writeMountHandleMeta,
19
- writeMountStatusSnapshot
20
- } from "../chunk-KXLTHWW3.js";
21
- export {
22
- MOUNT_SERVICE_LABEL,
23
- defaultMountServiceConfig,
24
- ensureHandleDirectories,
25
- ensureMountDirectories,
26
- getDefaultMountRoot,
27
- getMountHandlePaths,
28
- getMountPaths,
29
- getMountStateDir,
30
- readMountConfig,
31
- readMountControllerLock,
32
- readMountHandleMeta,
33
- readMountStatusSnapshot,
34
- removeMountControllerLock,
35
- removeMountHandleState,
36
- writeMountConfig,
37
- writeMountControllerLock,
38
- writeMountHandleMeta,
39
- writeMountStatusSnapshot
40
- };
@@ -1,13 +0,0 @@
1
- interface MountHostValidationIssue {
2
- code: "unsupported-platform" | "missing-ssh" | "missing-scp";
3
- message: string;
4
- }
5
- declare function getMountHostValidationIssues(): MountHostValidationIssue[];
6
- declare function formatMountHostInstallGuidance(issues: MountHostValidationIssue[]): string[];
7
- declare function evaluateMountHostValidation(input: {
8
- platform: NodeJS.Platform;
9
- hasSsh: boolean;
10
- hasScp: boolean;
11
- }): MountHostValidationIssue[];
12
-
13
- export { type MountHostValidationIssue, evaluateMountHostValidation, formatMountHostInstallGuidance, getMountHostValidationIssues };
@@ -1,10 +0,0 @@
1
- import {
2
- evaluateMountHostValidation,
3
- formatMountHostInstallGuidance,
4
- getMountHostValidationIssues
5
- } from "../chunk-JMRAYXUO.js";
6
- export {
7
- evaluateMountHostValidation,
8
- formatMountHostInstallGuidance,
9
- getMountHostValidationIssues
10
- };
@@ -1,39 +0,0 @@
1
- import { MountServiceConfig, MountPaths } from './mount-config.js';
2
-
3
- interface MutagenCommandResult {
4
- ok: boolean;
5
- stdout: string;
6
- stderr: string;
7
- status: number | null;
8
- }
9
- interface MutagenCommandOptions {
10
- ignoreFailure?: boolean;
11
- signal?: AbortSignal;
12
- }
13
- interface OwnedMountSession {
14
- identifier: string;
15
- name?: string;
16
- handle: string;
17
- alphaPath: string;
18
- betaUrl?: string;
19
- alphaConnected: boolean;
20
- betaConnected: boolean;
21
- status?: string;
22
- lastError?: string;
23
- stagingProgress?: string;
24
- currentFile?: string;
25
- scanProblemCount: number;
26
- conflictCount: number;
27
- legacy: boolean;
28
- }
29
- declare function ensureMutagenSshEnvironment(config: MountServiceConfig, paths: MountPaths): void;
30
- declare function getHandleSessionName(handle: string): string;
31
- declare function getDefaultMountIgnorePaths(): string[];
32
- declare function createHandleSession(handle: string, config: MountServiceConfig, paths: MountPaths, signal?: AbortSignal): Promise<void>;
33
- declare function terminateSession(session: Pick<OwnedMountSession, "identifier" | "handle">, config: MountServiceConfig, paths: MountPaths, signal?: AbortSignal): Promise<void>;
34
- declare function inspectHandleSession(handle: string, config: MountServiceConfig, paths: MountPaths, signal?: AbortSignal): Promise<OwnedMountSession | null>;
35
- declare function listOwnedSessions(config: MountServiceConfig, paths: MountPaths, signal?: AbortSignal): Promise<OwnedMountSession[]>;
36
- declare function selectPreferredSession(handle: string, sessions: OwnedMountSession[]): OwnedMountSession;
37
- declare function isAbortError(error: unknown): error is Error;
38
-
39
- export { type MutagenCommandOptions, type MutagenCommandResult, type OwnedMountSession, createHandleSession, ensureMutagenSshEnvironment, getDefaultMountIgnorePaths, getHandleSessionName, inspectHandleSession, isAbortError, listOwnedSessions, selectPreferredSession, terminateSession };
@@ -1,25 +0,0 @@
1
- import {
2
- createHandleSession,
3
- ensureMutagenSshEnvironment,
4
- getDefaultMountIgnorePaths,
5
- getHandleSessionName,
6
- inspectHandleSession,
7
- isAbortError,
8
- listOwnedSessions,
9
- selectPreferredSession,
10
- terminateSession
11
- } from "../chunk-TPFE3CC6.js";
12
- import "../chunk-KXLTHWW3.js";
13
- import "../chunk-GD42GHW3.js";
14
- import "../chunk-5Y2NWK5I.js";
15
- export {
16
- createHandleSession,
17
- ensureMutagenSshEnvironment,
18
- getDefaultMountIgnorePaths,
19
- getHandleSessionName,
20
- inspectHandleSession,
21
- isAbortError,
22
- listOwnedSessions,
23
- selectPreferredSession,
24
- terminateSession
25
- };
@@ -1,30 +0,0 @@
1
- import { MountServiceConfig, MountPaths, MountStatusSnapshot } from './mount-config.js';
2
- import { OwnedMountSession } from './mount-mutagen.js';
3
-
4
- interface DesiredMount {
5
- handle: string;
6
- mountPath: string;
7
- ready: boolean;
8
- message?: string;
9
- }
10
- interface MountPlan {
11
- toCreate: DesiredMount[];
12
- toInspect: DesiredMount[];
13
- toReset: string[];
14
- toStop: string[];
15
- pending: DesiredMount[];
16
- }
17
- declare function computeMountPlan(input: {
18
- desired: DesiredMount[];
19
- pending: DesiredMount[];
20
- ownedSessions: Pick<OwnedMountSession, "handle" | "legacy">[];
21
- rootEntries: string[];
22
- }): MountPlan;
23
- declare function planMountReconcile(config: MountServiceConfig, paths: MountPaths, signal?: AbortSignal): Promise<{
24
- plan: MountPlan;
25
- ownedSessions: OwnedMountSession[];
26
- }>;
27
- declare function reconcileMounts(config: MountServiceConfig, paths: MountPaths, controllerPid?: number, signal?: AbortSignal): Promise<MountStatusSnapshot>;
28
- declare function teardownManagedSessions(config: MountServiceConfig, paths: MountPaths, signal?: AbortSignal): Promise<void>;
29
-
30
- export { type DesiredMount, type MountPlan, computeMountPlan, planMountReconcile, reconcileMounts, teardownManagedSessions };
@@ -1,17 +0,0 @@
1
- import {
2
- computeMountPlan,
3
- planMountReconcile,
4
- reconcileMounts,
5
- teardownManagedSessions
6
- } from "../chunk-36BZXAAX.js";
7
- import "../chunk-TPFE3CC6.js";
8
- import "../chunk-KXLTHWW3.js";
9
- import "../chunk-GD42GHW3.js";
10
- import "../chunk-LOGK7YYJ.js";
11
- import "../chunk-5Y2NWK5I.js";
12
- export {
13
- computeMountPlan,
14
- planMountReconcile,
15
- reconcileMounts,
16
- teardownManagedSessions
17
- };
@@ -1,20 +0,0 @@
1
- type SupportedPlatform = "darwin" | "linux";
2
- type SupportedAssetArch = "amd64" | "arm64";
3
- type BundledMutagenAsset = {
4
- platform: SupportedPlatform;
5
- arch: SupportedAssetArch;
6
- version: string;
7
- assetName: string;
8
- downloadUrl: string;
9
- installDir: string;
10
- executablePath: string;
11
- };
12
- declare const AGENTCOMPUTER_MUTAGEN_PATH_ENV = "AGENTCOMPUTER_MUTAGEN_PATH";
13
- declare function getBundledMutagenAsset(platform?: NodeJS.Platform, arch?: string, homeDirectory?: string): BundledMutagenAsset | null;
14
- declare function hasBundledMutagen(): boolean;
15
- declare function ensureMutagenCommandPath(): Promise<string>;
16
- declare function ensureBundledMutagenInstalled(): Promise<string>;
17
- declare function resolveMutagenCommandPath(): string;
18
- declare function resolveMutagenAssetArch(arch: string): SupportedAssetArch | null;
19
-
20
- export { AGENTCOMPUTER_MUTAGEN_PATH_ENV, type BundledMutagenAsset, ensureBundledMutagenInstalled, ensureMutagenCommandPath, getBundledMutagenAsset, hasBundledMutagen, resolveMutagenAssetArch, resolveMutagenCommandPath };