aicomputer 0.1.17 → 0.1.19

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.
@@ -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 };
@@ -1,12 +1,11 @@
1
1
  interface MountHostValidationIssue {
2
- code: "unsupported-platform" | "missing-mutagen" | "missing-ssh" | "missing-scp";
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[];
@@ -2,7 +2,7 @@ import {
2
2
  evaluateMountHostValidation,
3
3
  formatMountHostInstallGuidance,
4
4
  getMountHostValidationIssues
5
- } from "../chunk-OWK5N76S.js";
5
+ } from "../chunk-JMRAYXUO.js";
6
6
  export {
7
7
  evaluateMountHostValidation,
8
8
  formatMountHostInstallGuidance,
@@ -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,24 @@
1
+ import {
2
+ createHandleSession,
3
+ ensureMutagenSshEnvironment,
4
+ getDefaultMountIgnorePaths,
5
+ getHandleSessionName,
6
+ inspectHandleSession,
7
+ isAbortError,
8
+ listOwnedSessions,
9
+ selectPreferredSession,
10
+ terminateSession
11
+ } from "../chunk-NN4GECN6.js";
12
+ import "../chunk-KXLTHWW3.js";
13
+ import "../chunk-MDSPJ57B.js";
14
+ export {
15
+ createHandleSession,
16
+ ensureMutagenSshEnvironment,
17
+ getDefaultMountIgnorePaths,
18
+ getHandleSessionName,
19
+ inspectHandleSession,
20
+ isAbortError,
21
+ listOwnedSessions,
22
+ selectPreferredSession,
23
+ terminateSession
24
+ };
@@ -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 };
@@ -3,8 +3,10 @@ import {
3
3
  planMountReconcile,
4
4
  reconcileMounts,
5
5
  teardownManagedSessions
6
- } from "../chunk-5IEWKH52.js";
6
+ } from "../chunk-5JYMQXKN.js";
7
+ import "../chunk-NN4GECN6.js";
7
8
  import "../chunk-KXLTHWW3.js";
9
+ import "../chunk-MDSPJ57B.js";
8
10
  export {
9
11
  computeMountPlan,
10
12
  planMountReconcile,
@@ -0,0 +1,21 @@
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 resolveSystemCommandPath(command: string): string | null;
16
+ declare function ensureMutagenCommandPath(): Promise<string>;
17
+ declare function ensureBundledMutagenInstalled(): Promise<string>;
18
+ declare function resolveMutagenCommandPath(): string;
19
+ declare function resolveMutagenAssetArch(arch: string): SupportedAssetArch | null;
20
+
21
+ export { AGENTCOMPUTER_MUTAGEN_PATH_ENV, type BundledMutagenAsset, ensureBundledMutagenInstalled, ensureMutagenCommandPath, getBundledMutagenAsset, hasBundledMutagen, resolveMutagenAssetArch, resolveMutagenCommandPath, resolveSystemCommandPath };
@@ -0,0 +1,20 @@
1
+ import {
2
+ AGENTCOMPUTER_MUTAGEN_PATH_ENV,
3
+ ensureBundledMutagenInstalled,
4
+ ensureMutagenCommandPath,
5
+ getBundledMutagenAsset,
6
+ hasBundledMutagen,
7
+ resolveMutagenAssetArch,
8
+ resolveMutagenCommandPath,
9
+ resolveSystemCommandPath
10
+ } from "../chunk-MDSPJ57B.js";
11
+ export {
12
+ AGENTCOMPUTER_MUTAGEN_PATH_ENV,
13
+ ensureBundledMutagenInstalled,
14
+ ensureMutagenCommandPath,
15
+ getBundledMutagenAsset,
16
+ hasBundledMutagen,
17
+ resolveMutagenAssetArch,
18
+ resolveMutagenCommandPath,
19
+ resolveSystemCommandPath
20
+ };
@@ -0,0 +1,10 @@
1
+ type RegistryPackument = {
2
+ "dist-tags"?: {
3
+ latest?: string;
4
+ };
5
+ versions?: Record<string, unknown>;
6
+ };
7
+ declare function compareVersions(a: string, b: string): number;
8
+ declare function resolveLatestPublishedVersion(packument: RegistryPackument): string;
9
+
10
+ export { compareVersions, resolveLatestPublishedVersion };
@@ -0,0 +1,8 @@
1
+ import {
2
+ compareVersions,
3
+ resolveLatestPublishedVersion
4
+ } from "../chunk-GGBVVRLL.js";
5
+ export {
6
+ compareVersions,
7
+ resolveLatestPublishedVersion
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aicomputer",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
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 src/lib/mutagen-runtime.ts src/lib/upgrade-version.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 src/lib/mutagen-runtime.ts src/lib/upgrade-version.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);