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.
- package/README.md +55 -136
- package/dist/index.d.ts +381 -1
- package/dist/index.js +1657 -4977
- package/package.json +24 -31
- package/dist/chunk-36BZXAAX.js +0 -544
- package/dist/chunk-3ZF7JRBW.js +0 -270
- package/dist/chunk-4TE5XTYE.js +0 -242
- package/dist/chunk-5Y2NWK5I.js +0 -14
- package/dist/chunk-D3SAFNSI.js +0 -75
- package/dist/chunk-GD42GHW3.js +0 -183
- package/dist/chunk-GGBVVRLL.js +0 -32
- package/dist/chunk-JMRAYXUO.js +0 -62
- package/dist/chunk-KXLTHWW3.js +0 -184
- package/dist/chunk-LOGK7YYJ.js +0 -255
- package/dist/chunk-TPFE3CC6.js +0 -367
- package/dist/lib/autossh-runtime.d.ts +0 -21
- package/dist/lib/autossh-runtime.js +0 -23
- package/dist/lib/mount-config.d.ts +0 -79
- package/dist/lib/mount-config.js +0 -40
- package/dist/lib/mount-host.d.ts +0 -13
- package/dist/lib/mount-host.js +0 -10
- package/dist/lib/mount-mutagen.d.ts +0 -39
- package/dist/lib/mount-mutagen.js +0 -25
- package/dist/lib/mount-reconcile.d.ts +0 -30
- package/dist/lib/mount-reconcile.js +0 -17
- package/dist/lib/mutagen-runtime.d.ts +0 -20
- package/dist/lib/mutagen-runtime.js +0 -19
- package/dist/lib/ssh-access.d.ts +0 -74
- package/dist/lib/ssh-access.js +0 -25
- package/dist/lib/ssh-config.d.ts +0 -14
- package/dist/lib/ssh-config.js +0 -10
- package/dist/lib/upgrade-version.d.ts +0 -10
- package/dist/lib/upgrade-version.js +0 -8
- package/scripts/postinstall.mjs +0 -48
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AGENTCOMPUTER_MUTAGEN_PATH_ENV,
|
|
3
|
-
ensureBundledMutagenInstalled,
|
|
4
|
-
ensureMutagenCommandPath,
|
|
5
|
-
getBundledMutagenAsset,
|
|
6
|
-
hasBundledMutagen,
|
|
7
|
-
resolveMutagenAssetArch,
|
|
8
|
-
resolveMutagenCommandPath
|
|
9
|
-
} from "../chunk-GD42GHW3.js";
|
|
10
|
-
import "../chunk-5Y2NWK5I.js";
|
|
11
|
-
export {
|
|
12
|
-
AGENTCOMPUTER_MUTAGEN_PATH_ENV,
|
|
13
|
-
ensureBundledMutagenInstalled,
|
|
14
|
-
ensureMutagenCommandPath,
|
|
15
|
-
getBundledMutagenAsset,
|
|
16
|
-
hasBundledMutagen,
|
|
17
|
-
resolveMutagenAssetArch,
|
|
18
|
-
resolveMutagenCommandPath
|
|
19
|
-
};
|
package/dist/lib/ssh-access.d.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
type RuntimeFamily = "managed-worker" | "custom-machine";
|
|
2
|
-
type SourceKind = "none" | "oci-image";
|
|
3
|
-
type HealthcheckType = "http" | "tcp";
|
|
4
|
-
type FilesystemMode = "isolated" | "shared";
|
|
5
|
-
type ComputerDesiredPowerState = "on" | "off";
|
|
6
|
-
interface Computer {
|
|
7
|
-
id: string;
|
|
8
|
-
handle: string;
|
|
9
|
-
display_name: string;
|
|
10
|
-
status: string;
|
|
11
|
-
desired_power_state: ComputerDesiredPowerState;
|
|
12
|
-
tier: string;
|
|
13
|
-
runtime_family: RuntimeFamily;
|
|
14
|
-
source_kind: SourceKind;
|
|
15
|
-
build_status: "pending" | "building" | "ready" | "failed";
|
|
16
|
-
image_family: string;
|
|
17
|
-
image_ref: string;
|
|
18
|
-
resolved_image_ref: string;
|
|
19
|
-
source_repo_url?: string;
|
|
20
|
-
source_ref?: string;
|
|
21
|
-
source_subpath?: string;
|
|
22
|
-
user_source_id?: string;
|
|
23
|
-
primary_web_host: string;
|
|
24
|
-
primary_port: number;
|
|
25
|
-
primary_path: string;
|
|
26
|
-
healthcheck_type: HealthcheckType;
|
|
27
|
-
healthcheck_value?: string;
|
|
28
|
-
ssh_enabled: boolean;
|
|
29
|
-
vnc_enabled: boolean;
|
|
30
|
-
filesystem_mode: FilesystemMode;
|
|
31
|
-
filesystem_id?: string;
|
|
32
|
-
workspace_name?: string;
|
|
33
|
-
ssh_host: string;
|
|
34
|
-
ssh_port: number;
|
|
35
|
-
last_error?: string;
|
|
36
|
-
created_at: string;
|
|
37
|
-
updated_at: string;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
declare const SSH_SERVER_ALIVE_INTERVAL_SECONDS = 30;
|
|
41
|
-
declare const SSH_SERVER_ALIVE_COUNT_MAX = 3;
|
|
42
|
-
type SSHConnection = {
|
|
43
|
-
computer: Computer;
|
|
44
|
-
commandPath: string;
|
|
45
|
-
command: string;
|
|
46
|
-
args: string[];
|
|
47
|
-
env: NodeJS.ProcessEnv;
|
|
48
|
-
};
|
|
49
|
-
type SSHConnectionOptions = {
|
|
50
|
-
extraArgs?: string[];
|
|
51
|
-
tmux?: boolean;
|
|
52
|
-
};
|
|
53
|
-
type SSHLaunchPlanInput = {
|
|
54
|
-
user: string;
|
|
55
|
-
host: string;
|
|
56
|
-
port: number;
|
|
57
|
-
identityFilePath: string;
|
|
58
|
-
commandPath?: string;
|
|
59
|
-
sshCommandPath?: string;
|
|
60
|
-
extraArgs?: string[];
|
|
61
|
-
tmux?: boolean;
|
|
62
|
-
};
|
|
63
|
-
type SSHLaunchPlan = Omit<SSHConnection, "computer">;
|
|
64
|
-
declare function prepareSSHConnection(computer: Computer, options?: SSHConnectionOptions): Promise<SSHConnection>;
|
|
65
|
-
declare function prepareSSHConnectionByIdentifier(identifier: string, options?: SSHConnectionOptions): Promise<SSHConnection>;
|
|
66
|
-
declare function openSSHConnection(connection: SSHConnection): Promise<void>;
|
|
67
|
-
declare function buildSSHLaunchPlan(input: SSHLaunchPlanInput): SSHLaunchPlan;
|
|
68
|
-
declare function getSSHResilienceOptionArgs(): string[];
|
|
69
|
-
declare function getSSHResilienceConfigLines(): string[];
|
|
70
|
-
declare function formatSSHCommand(user: string, host: string, port: number, extraArgs?: string[], options?: {
|
|
71
|
-
tmux?: boolean;
|
|
72
|
-
}): string;
|
|
73
|
-
|
|
74
|
-
export { type SSHConnection, type SSHConnectionOptions, type SSHLaunchPlan, type SSHLaunchPlanInput, SSH_SERVER_ALIVE_COUNT_MAX, SSH_SERVER_ALIVE_INTERVAL_SECONDS, buildSSHLaunchPlan, formatSSHCommand, getSSHResilienceConfigLines, getSSHResilienceOptionArgs, openSSHConnection, prepareSSHConnection, prepareSSHConnectionByIdentifier };
|
package/dist/lib/ssh-access.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SSH_SERVER_ALIVE_COUNT_MAX,
|
|
3
|
-
SSH_SERVER_ALIVE_INTERVAL_SECONDS,
|
|
4
|
-
buildSSHLaunchPlan,
|
|
5
|
-
formatSSHCommand,
|
|
6
|
-
getSSHResilienceConfigLines,
|
|
7
|
-
getSSHResilienceOptionArgs,
|
|
8
|
-
openSSHConnection,
|
|
9
|
-
prepareSSHConnection,
|
|
10
|
-
prepareSSHConnectionByIdentifier
|
|
11
|
-
} from "../chunk-4TE5XTYE.js";
|
|
12
|
-
import "../chunk-3ZF7JRBW.js";
|
|
13
|
-
import "../chunk-LOGK7YYJ.js";
|
|
14
|
-
import "../chunk-5Y2NWK5I.js";
|
|
15
|
-
export {
|
|
16
|
-
SSH_SERVER_ALIVE_COUNT_MAX,
|
|
17
|
-
SSH_SERVER_ALIVE_INTERVAL_SECONDS,
|
|
18
|
-
buildSSHLaunchPlan,
|
|
19
|
-
formatSSHCommand,
|
|
20
|
-
getSSHResilienceConfigLines,
|
|
21
|
-
getSSHResilienceOptionArgs,
|
|
22
|
-
openSSHConnection,
|
|
23
|
-
prepareSSHConnection,
|
|
24
|
-
prepareSSHConnectionByIdentifier
|
|
25
|
-
};
|
package/dist/lib/ssh-config.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface EnsureSSHAliasConfigOptions {
|
|
2
|
-
alias: string;
|
|
3
|
-
host: string;
|
|
4
|
-
port: number;
|
|
5
|
-
identityFilePath: string;
|
|
6
|
-
user?: string;
|
|
7
|
-
}
|
|
8
|
-
interface SSHAliasConfigResult {
|
|
9
|
-
configPath: string;
|
|
10
|
-
changed: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare function ensureSSHAliasConfig(options: EnsureSSHAliasConfigOptions): Promise<SSHAliasConfigResult>;
|
|
13
|
-
|
|
14
|
-
export { type EnsureSSHAliasConfigOptions, type SSHAliasConfigResult, ensureSSHAliasConfig };
|
package/dist/lib/ssh-config.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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 };
|
package/scripts/postinstall.mjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { spawnSync } from "node:child_process";
|
|
2
|
-
import { dirname, join } from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
|
|
5
|
-
const supportedPlatform = ["darwin", "linux"].includes(process.platform);
|
|
6
|
-
const globalInstall = process.env.npm_config_global === "true";
|
|
7
|
-
|
|
8
|
-
if (!supportedPlatform || !globalInstall) {
|
|
9
|
-
process.exit(0);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const scriptsDir = dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const entrypoint = join(scriptsDir, "..", "dist", "index.js");
|
|
14
|
-
|
|
15
|
-
runBundledInstall({
|
|
16
|
-
command: "internal-install-mutagen",
|
|
17
|
-
skipEnvVar: "AICOMPUTER_SKIP_MUTAGEN_POSTINSTALL",
|
|
18
|
-
warning:
|
|
19
|
-
"Agent Computer installed successfully, but bundled Mutagen did not finish installing. `computer mount` will retry on first use.",
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
runBundledInstall({
|
|
23
|
-
command: "internal-install-autossh",
|
|
24
|
-
skipEnvVar: "AICOMPUTER_SKIP_AUTOSSH_POSTINSTALL",
|
|
25
|
-
warning:
|
|
26
|
-
"Agent Computer installed successfully, but bundled autossh did not finish installing. `computer ssh` will retry on first use.",
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
process.exit(0);
|
|
30
|
-
|
|
31
|
-
function runBundledInstall({ command, skipEnvVar, warning }) {
|
|
32
|
-
if (process.env[skipEnvVar] === "1") {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const install = spawnSync(
|
|
37
|
-
process.execPath,
|
|
38
|
-
[entrypoint, command, "--quiet"],
|
|
39
|
-
{
|
|
40
|
-
stdio: "inherit",
|
|
41
|
-
env: process.env,
|
|
42
|
-
},
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
if (install.status !== 0) {
|
|
46
|
-
console.warn(warning);
|
|
47
|
-
}
|
|
48
|
-
}
|