aicomputer 0.1.13 → 0.1.15
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 +19 -5
- package/dist/chunk-5JVJROSI.js +186 -0
- package/dist/chunk-KQQUR2YX.js +655 -0
- package/dist/chunk-OWK5N76S.js +70 -0
- package/dist/index.js +892 -665
- package/dist/lib/mount-config.d.ts +69 -0
- package/dist/lib/mount-config.js +40 -0
- package/dist/lib/mount-host.d.ts +14 -0
- package/dist/lib/mount-host.js +10 -0
- package/dist/lib/mount-reconcile.d.ts +25 -0
- package/dist/lib/mount-reconcile.js +13 -0
- package/package.json +5 -4
|
@@ -0,0 +1,69 @@
|
|
|
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" | "pending" | "error";
|
|
14
|
+
message?: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
}
|
|
17
|
+
interface MountStatusSnapshot {
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
controllerPid?: number;
|
|
20
|
+
running: boolean;
|
|
21
|
+
lastSuccessfulSyncAt?: string;
|
|
22
|
+
lastError?: string;
|
|
23
|
+
mounts: ManagedMountSnapshot[];
|
|
24
|
+
}
|
|
25
|
+
interface MountPaths {
|
|
26
|
+
stateDir: string;
|
|
27
|
+
rootPath: string;
|
|
28
|
+
configPath: string;
|
|
29
|
+
statusPath: string;
|
|
30
|
+
socketPath: string;
|
|
31
|
+
controllerLockPath: string;
|
|
32
|
+
handlesDir: string;
|
|
33
|
+
sshToolsDir: string;
|
|
34
|
+
staleDir: string;
|
|
35
|
+
}
|
|
36
|
+
interface MountHandlePaths {
|
|
37
|
+
stateDir: string;
|
|
38
|
+
projectFilePath: string;
|
|
39
|
+
metaPath: string;
|
|
40
|
+
sshToolsDir: string;
|
|
41
|
+
}
|
|
42
|
+
interface MountHandleMeta {
|
|
43
|
+
handle: string;
|
|
44
|
+
startedAt: string;
|
|
45
|
+
lastStartedAt?: string;
|
|
46
|
+
}
|
|
47
|
+
interface MountControllerLock {
|
|
48
|
+
pid: number;
|
|
49
|
+
startedAt: string;
|
|
50
|
+
}
|
|
51
|
+
declare function getDefaultMountRoot(): string;
|
|
52
|
+
declare function getMountStateDir(): string;
|
|
53
|
+
declare function getMountPaths(rootPath?: string): MountPaths;
|
|
54
|
+
declare function getMountHandlePaths(handle: string, rootPath?: string): MountHandlePaths;
|
|
55
|
+
declare function defaultMountServiceConfig(): MountServiceConfig;
|
|
56
|
+
declare function ensureMountDirectories(paths: MountPaths): void;
|
|
57
|
+
declare function ensureHandleDirectories(handle: string, rootPath?: string): MountHandlePaths;
|
|
58
|
+
declare function readMountConfig(): MountServiceConfig | null;
|
|
59
|
+
declare function writeMountConfig(config: MountServiceConfig): void;
|
|
60
|
+
declare function readMountStatusSnapshot(rootPath?: string): MountStatusSnapshot | null;
|
|
61
|
+
declare function writeMountStatusSnapshot(snapshot: MountStatusSnapshot, rootPath?: string): void;
|
|
62
|
+
declare function readMountControllerLock(rootPath?: string): MountControllerLock | null;
|
|
63
|
+
declare function writeMountControllerLock(lock: MountControllerLock, rootPath?: string): void;
|
|
64
|
+
declare function removeMountControllerLock(rootPath?: string): void;
|
|
65
|
+
declare function readMountHandleMeta(handle: string, rootPath?: string): MountHandleMeta | null;
|
|
66
|
+
declare function writeMountHandleMeta(handle: string, meta: MountHandleMeta, rootPath?: string): void;
|
|
67
|
+
declare function removeMountHandleState(handle: string, rootPath?: string): void;
|
|
68
|
+
|
|
69
|
+
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 };
|
|
@@ -0,0 +1,40 @@
|
|
|
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-5JVJROSI.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
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface MountHostValidationIssue {
|
|
2
|
+
code: "unsupported-platform" | "missing-mutagen" | "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
|
+
hasMutagen: boolean;
|
|
10
|
+
hasSsh: boolean;
|
|
11
|
+
hasScp: boolean;
|
|
12
|
+
}): MountHostValidationIssue[];
|
|
13
|
+
|
|
14
|
+
export { type MountHostValidationIssue, evaluateMountHostValidation, formatMountHostInstallGuidance, getMountHostValidationIssues };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MountStatusSnapshot, MountServiceConfig, MountPaths } from './mount-config.js';
|
|
2
|
+
|
|
3
|
+
interface DesiredMount {
|
|
4
|
+
handle: string;
|
|
5
|
+
mountPath: string;
|
|
6
|
+
ready: boolean;
|
|
7
|
+
message?: string;
|
|
8
|
+
}
|
|
9
|
+
interface MountPlan {
|
|
10
|
+
toStart: DesiredMount[];
|
|
11
|
+
toCheck: DesiredMount[];
|
|
12
|
+
toStop: string[];
|
|
13
|
+
pending: DesiredMount[];
|
|
14
|
+
}
|
|
15
|
+
declare function computeMountPlan(input: {
|
|
16
|
+
desired: DesiredMount[];
|
|
17
|
+
pending: DesiredMount[];
|
|
18
|
+
previousSnapshot: MountStatusSnapshot | null;
|
|
19
|
+
rootEntries: string[];
|
|
20
|
+
}): MountPlan;
|
|
21
|
+
declare function planMountReconcile(config: MountServiceConfig, paths: MountPaths): Promise<MountPlan>;
|
|
22
|
+
declare function reconcileMounts(config: MountServiceConfig, paths: MountPaths, controllerPid?: number): Promise<MountStatusSnapshot>;
|
|
23
|
+
declare function teardownManagedSessions(config: MountServiceConfig, paths: MountPaths): Promise<void>;
|
|
24
|
+
|
|
25
|
+
export { type DesiredMount, type MountPlan, computeMountPlan, planMountReconcile, reconcileMounts, teardownManagedSessions };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computeMountPlan,
|
|
3
|
+
planMountReconcile,
|
|
4
|
+
reconcileMounts,
|
|
5
|
+
teardownManagedSessions
|
|
6
|
+
} from "../chunk-KQQUR2YX.js";
|
|
7
|
+
import "../chunk-5JVJROSI.js";
|
|
8
|
+
export {
|
|
9
|
+
computeMountPlan,
|
|
10
|
+
planMountReconcile,
|
|
11
|
+
reconcileMounts,
|
|
12
|
+
teardownManagedSessions
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aicomputer",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Computer CLI - manage your Agent Computer
|
|
3
|
+
"version": "0.1.15",
|
|
4
|
+
"description": "Computer CLI - manage your Agent Computer machines from the terminal",
|
|
5
5
|
"homepage": "https://agentcomputer.ai",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
"registry": "https://registry.npmjs.org/"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "tsup src/index.ts --format esm --dts",
|
|
22
|
-
"dev": "tsup src/index.ts --format esm --watch",
|
|
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",
|
|
23
23
|
"prepack": "npm run build",
|
|
24
24
|
"sync:nix": "../../scripts/cli/sync-nix-package.sh",
|
|
25
|
+
"test": "npm run build && node --test test/**/*.test.mjs",
|
|
25
26
|
"typecheck": "tsc --noEmit"
|
|
26
27
|
},
|
|
27
28
|
"files": [
|