aicomputer 0.1.17 → 0.1.18
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/README.md +8 -3
- package/dist/{chunk-5IEWKH52.js → chunk-3ZUTAUUD.js} +70 -280
- package/dist/chunk-F2U4SFJ4.js +517 -0
- package/dist/{chunk-OWK5N76S.js → chunk-JMRAYXUO.js} +3 -11
- package/dist/index.js +324 -114
- package/dist/lib/mount-config.d.ts +4 -1
- package/dist/lib/mount-host.d.ts +1 -2
- package/dist/lib/mount-host.js +1 -1
- package/dist/lib/mount-mutagen.d.ts +37 -0
- package/dist/lib/mount-mutagen.js +23 -0
- package/dist/lib/mount-reconcile.d.ts +4 -18
- package/dist/lib/mount-reconcile.js +2 -1
- package/package.json +5 -3
- package/scripts/postinstall.mjs +35 -0
|
@@ -14,10 +14,13 @@ interface ManagedMountSnapshot {
|
|
|
14
14
|
message?: string;
|
|
15
15
|
updatedAt: string;
|
|
16
16
|
}
|
|
17
|
+
type MountStartupPhase = "starting" | "cleaning" | "syncing" | "ready";
|
|
17
18
|
interface MountStatusSnapshot {
|
|
18
19
|
updatedAt: string;
|
|
19
20
|
controllerPid?: number;
|
|
20
21
|
running: boolean;
|
|
22
|
+
startupPhase?: MountStartupPhase;
|
|
23
|
+
startupMessage?: string;
|
|
21
24
|
lastHealthySyncAt?: string;
|
|
22
25
|
lastSuccessfulSyncAt?: string;
|
|
23
26
|
lastIssueAt?: string;
|
|
@@ -69,4 +72,4 @@ declare function readMountHandleMeta(handle: string, rootPath?: string): MountHa
|
|
|
69
72
|
declare function writeMountHandleMeta(handle: string, meta: MountHandleMeta, rootPath?: string): void;
|
|
70
73
|
declare function removeMountHandleState(handle: string, rootPath?: string): void;
|
|
71
74
|
|
|
72
|
-
export { MOUNT_SERVICE_LABEL, type ManagedMountSnapshot, type MountControllerLock, type MountHandleMeta, type MountHandlePaths, type MountPaths, type MountServiceConfig, type MountStatusSnapshot, defaultMountServiceConfig, ensureHandleDirectories, ensureMountDirectories, getDefaultMountRoot, getMountHandlePaths, getMountPaths, getMountStateDir, readMountConfig, readMountControllerLock, readMountHandleMeta, readMountStatusSnapshot, removeMountControllerLock, removeMountHandleState, writeMountConfig, writeMountControllerLock, writeMountHandleMeta, writeMountStatusSnapshot };
|
|
75
|
+
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 };
|
package/dist/lib/mount-host.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
interface MountHostValidationIssue {
|
|
2
|
-
code: "unsupported-platform" | "missing-
|
|
2
|
+
code: "unsupported-platform" | "missing-ssh" | "missing-scp";
|
|
3
3
|
message: string;
|
|
4
4
|
}
|
|
5
5
|
declare function getMountHostValidationIssues(): MountHostValidationIssue[];
|
|
6
6
|
declare function formatMountHostInstallGuidance(issues: MountHostValidationIssue[]): string[];
|
|
7
7
|
declare function evaluateMountHostValidation(input: {
|
|
8
8
|
platform: NodeJS.Platform;
|
|
9
|
-
hasMutagen: boolean;
|
|
10
9
|
hasSsh: boolean;
|
|
11
10
|
hasScp: boolean;
|
|
12
11
|
}): MountHostValidationIssue[];
|
package/dist/lib/mount-host.js
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
scanProblemCount: number;
|
|
24
|
+
conflictCount: number;
|
|
25
|
+
legacy: boolean;
|
|
26
|
+
}
|
|
27
|
+
declare function ensureMutagenSshEnvironment(config: MountServiceConfig, paths: MountPaths): void;
|
|
28
|
+
declare function getHandleSessionName(handle: string): string;
|
|
29
|
+
declare function getDefaultMountIgnorePaths(): string[];
|
|
30
|
+
declare function createHandleSession(handle: string, config: MountServiceConfig, paths: MountPaths, signal?: AbortSignal): Promise<void>;
|
|
31
|
+
declare function terminateSession(session: Pick<OwnedMountSession, "identifier" | "handle">, config: MountServiceConfig, paths: MountPaths, signal?: AbortSignal): Promise<void>;
|
|
32
|
+
declare function inspectHandleSession(handle: string, config: MountServiceConfig, paths: MountPaths, signal?: AbortSignal): Promise<OwnedMountSession | null>;
|
|
33
|
+
declare function listOwnedSessions(config: MountServiceConfig, paths: MountPaths, signal?: AbortSignal): Promise<OwnedMountSession[]>;
|
|
34
|
+
declare function selectPreferredSession(handle: string, sessions: OwnedMountSession[]): OwnedMountSession;
|
|
35
|
+
declare function isAbortError(error: unknown): error is Error;
|
|
36
|
+
|
|
37
|
+
export { type MutagenCommandOptions, type MutagenCommandResult, type OwnedMountSession, createHandleSession, ensureMutagenSshEnvironment, getDefaultMountIgnorePaths, getHandleSessionName, inspectHandleSession, isAbortError, listOwnedSessions, selectPreferredSession, terminateSession };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createHandleSession,
|
|
3
|
+
ensureMutagenSshEnvironment,
|
|
4
|
+
getDefaultMountIgnorePaths,
|
|
5
|
+
getHandleSessionName,
|
|
6
|
+
inspectHandleSession,
|
|
7
|
+
isAbortError,
|
|
8
|
+
listOwnedSessions,
|
|
9
|
+
selectPreferredSession,
|
|
10
|
+
terminateSession
|
|
11
|
+
} from "../chunk-F2U4SFJ4.js";
|
|
12
|
+
import "../chunk-KXLTHWW3.js";
|
|
13
|
+
export {
|
|
14
|
+
createHandleSession,
|
|
15
|
+
ensureMutagenSshEnvironment,
|
|
16
|
+
getDefaultMountIgnorePaths,
|
|
17
|
+
getHandleSessionName,
|
|
18
|
+
inspectHandleSession,
|
|
19
|
+
isAbortError,
|
|
20
|
+
listOwnedSessions,
|
|
21
|
+
selectPreferredSession,
|
|
22
|
+
terminateSession
|
|
23
|
+
};
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import { MountServiceConfig, MountPaths, MountStatusSnapshot } from './mount-config.js';
|
|
2
|
-
|
|
3
|
-
interface OwnedMountSession {
|
|
4
|
-
identifier: string;
|
|
5
|
-
name?: string;
|
|
6
|
-
handle: string;
|
|
7
|
-
alphaPath: string;
|
|
8
|
-
betaUrl?: string;
|
|
9
|
-
alphaConnected: boolean;
|
|
10
|
-
betaConnected: boolean;
|
|
11
|
-
status?: string;
|
|
12
|
-
lastError?: string;
|
|
13
|
-
scanProblemCount: number;
|
|
14
|
-
conflictCount: number;
|
|
15
|
-
legacy: boolean;
|
|
16
|
-
}
|
|
2
|
+
import { OwnedMountSession } from './mount-mutagen.js';
|
|
17
3
|
|
|
18
4
|
interface DesiredMount {
|
|
19
5
|
handle: string;
|
|
@@ -34,11 +20,11 @@ declare function computeMountPlan(input: {
|
|
|
34
20
|
ownedSessions: Pick<OwnedMountSession, "handle" | "legacy">[];
|
|
35
21
|
rootEntries: string[];
|
|
36
22
|
}): MountPlan;
|
|
37
|
-
declare function planMountReconcile(config: MountServiceConfig, paths: MountPaths): Promise<{
|
|
23
|
+
declare function planMountReconcile(config: MountServiceConfig, paths: MountPaths, signal?: AbortSignal): Promise<{
|
|
38
24
|
plan: MountPlan;
|
|
39
25
|
ownedSessions: OwnedMountSession[];
|
|
40
26
|
}>;
|
|
41
|
-
declare function reconcileMounts(config: MountServiceConfig, paths: MountPaths, controllerPid?: number): Promise<MountStatusSnapshot>;
|
|
42
|
-
declare function teardownManagedSessions(config: MountServiceConfig, paths: MountPaths): Promise<void>;
|
|
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>;
|
|
43
29
|
|
|
44
30
|
export { type DesiredMount, type MountPlan, computeMountPlan, planMountReconcile, reconcileMounts, teardownManagedSessions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aicomputer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"description": "Computer CLI - manage your Agent Computer machines from the terminal",
|
|
5
5
|
"homepage": "https://agentcomputer.ai",
|
|
6
6
|
"repository": {
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
"registry": "https://registry.npmjs.org/"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "tsup src/index.ts src/lib/mount-config.ts src/lib/mount-host.ts src/lib/mount-reconcile.ts --format esm --dts",
|
|
22
|
-
"dev": "tsup src/index.ts src/lib/mount-config.ts src/lib/mount-host.ts src/lib/mount-reconcile.ts --format esm --watch",
|
|
21
|
+
"build": "tsup src/index.ts src/lib/mount-config.ts src/lib/mount-host.ts src/lib/mount-mutagen.ts src/lib/mount-reconcile.ts --format esm --dts",
|
|
22
|
+
"dev": "tsup src/index.ts src/lib/mount-config.ts src/lib/mount-host.ts src/lib/mount-mutagen.ts src/lib/mount-reconcile.ts --format esm --watch",
|
|
23
|
+
"postinstall": "node ./scripts/postinstall.mjs",
|
|
23
24
|
"prepack": "npm run build",
|
|
24
25
|
"sync:nix": "../../scripts/cli/sync-nix-package.sh",
|
|
25
26
|
"test": "npm run build && node --test test/**/*.test.mjs",
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
},
|
|
28
29
|
"files": [
|
|
29
30
|
"dist",
|
|
31
|
+
"scripts",
|
|
30
32
|
"package.json",
|
|
31
33
|
"README.md"
|
|
32
34
|
],
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
if (process.env.AICOMPUTER_SKIP_MUTAGEN_POSTINSTALL === "1") {
|
|
6
|
+
process.exit(0);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
if (process.env.npm_config_global !== "true") {
|
|
10
|
+
process.exit(0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (!["darwin", "linux"].includes(process.platform)) {
|
|
14
|
+
process.exit(0);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const scriptsDir = dirname(fileURLToPath(import.meta.url));
|
|
18
|
+
const entrypoint = join(scriptsDir, "..", "dist", "index.js");
|
|
19
|
+
const install = spawnSync(
|
|
20
|
+
process.execPath,
|
|
21
|
+
[entrypoint, "internal-install-mutagen", "--quiet"],
|
|
22
|
+
{
|
|
23
|
+
stdio: "inherit",
|
|
24
|
+
env: process.env,
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
if (install.status === 0) {
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
console.warn(
|
|
33
|
+
"Agent Computer installed successfully, but bundled Mutagen did not finish installing. `computer mount` will retry on first use.",
|
|
34
|
+
);
|
|
35
|
+
process.exit(0);
|