aicomputer 0.1.22 → 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,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
- };
@@ -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 };
@@ -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-LGJN26BQ.js";
12
- import "../chunk-3ZF7JRBW.js";
13
- import "../chunk-E7QD4MHI.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
- };
@@ -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 };
@@ -1,10 +0,0 @@
1
- import {
2
- ensureSSHAliasConfig
3
- } from "../chunk-G7UQLVUZ.js";
4
- import "../chunk-LGJN26BQ.js";
5
- import "../chunk-3ZF7JRBW.js";
6
- import "../chunk-E7QD4MHI.js";
7
- import "../chunk-5Y2NWK5I.js";
8
- export {
9
- ensureSSHAliasConfig
10
- };
@@ -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 };
@@ -1,8 +0,0 @@
1
- import {
2
- compareVersions,
3
- resolveLatestPublishedVersion
4
- } from "../chunk-GGBVVRLL.js";
5
- export {
6
- compareVersions,
7
- resolveLatestPublishedVersion
8
- };
@@ -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
- }