@minato-aqukin/autodl-cli 0.1.2 → 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/dist/index.d.ts CHANGED
@@ -745,7 +745,7 @@ interface ConnectOptions extends CredentialOptions {
745
745
  connectAttempts?: number;
746
746
  }
747
747
  /**
748
- * The single funnel for every SSH operation.
748
+ * The single funnel for every one-shot SSH operation.
749
749
  *
750
750
  * Each attempt re-reads the credentials, which covers both ways a connection can fail:
751
751
  * the port may have been reassigned since the snapshot was taken, and sshd may simply
@@ -753,6 +753,15 @@ interface ConnectOptions extends CredentialOptions {
753
753
  * second only by waiting — so attempts are spaced out rather than fired back to back.
754
754
  */
755
755
  declare function withSSH<T>(client: AutoDLClient, uuid: string, fn: (conn: Client, creds: SSHCredentials) => Promise<T>, options?: ConnectOptions): Promise<T>;
756
+ /**
757
+ * Build one authenticated connection and hand ownership to the caller.
758
+ *
759
+ * Same retry policy as `withSSH` (fresh credentials per attempt, spaced retries
760
+ * for sshd-not-up-yet and port reassignment), except nothing is closed: the
761
+ * caller MUST eventually call `conn.end()`. Used for the file view's reusable
762
+ * browsing connection; one-shot operations should keep using `withSSH`.
763
+ */
764
+ declare function connectSSH(client: AutoDLClient, uuid: string, options?: ConnectOptions): Promise<Client>;
756
765
 
757
766
  /**
758
767
  * Interactive login hands off to the system `ssh` binary rather than ssh2: the user
@@ -945,4 +954,4 @@ interface RunResult {
945
954
  */
946
955
  declare function runWorkflow(client: AutoDLClient, options: RunOptions): Promise<RunResult>;
947
956
 
948
- export { AuthError, AutoDLClient, AutoDLError, BASE_IMAGES, type Balance, type BaseImage, BudgetError, type ClientOptions, type Context, type CreateInstanceInput, DEFAULT_BASE_IMAGE, DEFAULT_BASE_URL, type DeployOptions, type DeployResult, type ErrorCode, type ExecOptions, type ExecResult, ExitCode, GPU_SPECS, type GlobalOptions, type GpuSpec, type GpuStockEntry, type IdleOptions, type IdleResult, type Instance, type InstanceSnapshot, type InstanceStatus, NoStockError, NotFoundError, type Pagination, type ParsedRepo, type PrivateImage, REGIONS, type Region, type RegionChoice, type RegionStock, type RunOptions, type RunResult, type SSHCredentials, SSHError, type ServiceEndpoint, type StockQuery, type StockSnapshot, type StoredConfig, TimeoutError, type TransferOptions, type TransferSummary, UsageError, VERSION, type WaitOptions, armTTLOverSSH, assertBudget, assertStockRegion, buildServer, buildTTLSnippet, chooseRegions, composeStartCommand, connectInteractive, createContext, createInstance, deployWorkflow, disarmTTLOverSSH, estimateCost, execCommand, execOnConnection, findBaseImage, findInstance, findRegionsWithStock, formatCudaVersion, formatDuration, formatRate, formatSSHCommand, formatYuan, getBalance, getCredentials, getInstanceSnapshot, getInstanceStatus, getRegionGpuStock, getStockByRegion, listAllInstances, listInstancesPage, listPrivateImages, milliToYuan, normalizeBalance, normalizeInstance, normalizeSnapshot, parseCudaVersion, parseDuration, parseRepo, parseUtilisation, powerOffInstance, powerOnInstance, pull, push, readConfig, recordTTL, redactCredentials, redactSnapshot, redactToken, releaseInstance, resolveGitToken, resolveGpuSpec, resolveMinBalance, resolveRegion, resolveToken, runWorkflow, saveImage, setNfsMount, specForStockName, startMcpServer, sweepExpired, toAutoDLError, updateConfig, waitForRunning, waitForShutdown, waitForStatus, watchIdle, withCredentials, withSSH, writeConfig, yuanToMilli };
957
+ export { AuthError, AutoDLClient, AutoDLError, BASE_IMAGES, type Balance, type BaseImage, BudgetError, type ClientOptions, type Context, type CreateInstanceInput, DEFAULT_BASE_IMAGE, DEFAULT_BASE_URL, type DeployOptions, type DeployResult, type ErrorCode, type ExecOptions, type ExecResult, ExitCode, GPU_SPECS, type GlobalOptions, type GpuSpec, type GpuStockEntry, type IdleOptions, type IdleResult, type Instance, type InstanceSnapshot, type InstanceStatus, NoStockError, NotFoundError, type Pagination, type ParsedRepo, type PrivateImage, REGIONS, type Region, type RegionChoice, type RegionStock, type RunOptions, type RunResult, type SSHCredentials, SSHError, type ServiceEndpoint, type StockQuery, type StockSnapshot, type StoredConfig, TimeoutError, type TransferOptions, type TransferSummary, UsageError, VERSION, type WaitOptions, armTTLOverSSH, assertBudget, assertStockRegion, buildServer, buildTTLSnippet, chooseRegions, composeStartCommand, connectInteractive, connectSSH, createContext, createInstance, deployWorkflow, disarmTTLOverSSH, estimateCost, execCommand, execOnConnection, findBaseImage, findInstance, findRegionsWithStock, formatCudaVersion, formatDuration, formatRate, formatSSHCommand, formatYuan, getBalance, getCredentials, getInstanceSnapshot, getInstanceStatus, getRegionGpuStock, getStockByRegion, listAllInstances, listInstancesPage, listPrivateImages, milliToYuan, normalizeBalance, normalizeInstance, normalizeSnapshot, parseCudaVersion, parseDuration, parseRepo, parseUtilisation, powerOffInstance, powerOnInstance, pull, push, readConfig, recordTTL, redactCredentials, redactSnapshot, redactToken, releaseInstance, resolveGitToken, resolveGpuSpec, resolveMinBalance, resolveRegion, resolveToken, runWorkflow, saveImage, setNfsMount, specForStockName, startMcpServer, sweepExpired, toAutoDLError, updateConfig, waitForRunning, waitForShutdown, waitForStatus, watchIdle, withCredentials, withSSH, writeConfig, yuanToMilli };
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  startMcpServer,
21
21
  watchIdle,
22
22
  withCredentials
23
- } from "./chunk-BMKVXRT7.js";
23
+ } from "./chunk-MWYYK755.js";
24
24
  import {
25
25
  BASE_IMAGES,
26
26
  DEFAULT_BASE_IMAGE,
@@ -40,10 +40,10 @@ import {
40
40
  resolveRegion,
41
41
  setNfsMount,
42
42
  specForStockName
43
- } from "./chunk-GJGHX55T.js";
43
+ } from "./chunk-WN2CXPD2.js";
44
44
  import {
45
45
  createContext
46
- } from "./chunk-NBWWTYSL.js";
46
+ } from "./chunk-VEDMEYCW.js";
47
47
  import {
48
48
  AuthError,
49
49
  AutoDLClient,
@@ -59,6 +59,7 @@ import {
59
59
  armTTLOverSSH,
60
60
  buildTTLSnippet,
61
61
  composeStartCommand,
62
+ connectSSH,
62
63
  createInstance,
63
64
  disarmTTLOverSSH,
64
65
  estimateCost,
@@ -95,7 +96,7 @@ import {
95
96
  withSSH,
96
97
  writeConfig,
97
98
  yuanToMilli
98
- } from "./chunk-6QR4ZYQR.js";
99
+ } from "./chunk-GHJVQKKC.js";
99
100
  export {
100
101
  AuthError,
101
102
  AutoDLClient,
@@ -121,6 +122,7 @@ export {
121
122
  chooseRegions,
122
123
  composeStartCommand,
123
124
  connectInteractive,
125
+ connectSSH,
124
126
  createContext,
125
127
  createInstance,
126
128
  deployWorkflow,
@@ -5,12 +5,12 @@ import {
5
5
  assertInteractive,
6
6
  launchTui,
7
7
  registerTuiCommand
8
- } from "./chunk-DLCDJE6I.js";
9
- import "./chunk-NBWWTYSL.js";
10
- import "./chunk-6QR4ZYQR.js";
8
+ } from "./chunk-JOOIUQLJ.js";
9
+ import "./chunk-VEDMEYCW.js";
10
+ import "./chunk-GHJVQKKC.js";
11
11
  export {
12
12
  assertInteractive,
13
13
  launchTui,
14
14
  registerTuiCommand
15
15
  };
16
- //# sourceMappingURL=tui-2JGNYYRA.js.map
16
+ //# sourceMappingURL=tui-ZT5ZBVSQ.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minato-aqukin/autodl-cli",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Agent-friendly CLI, MCP server and SDK for managing AutoDL GPU instances — create, boot, SSH, run and auto-shutdown, all scriptable.",
5
5
  "keywords": [
6
6
  "autodl",