@skrr-ai/cli 0.1.25 → 0.1.27
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/base-command.js +29 -5
- package/dist/commands/code/install.js +13 -0
- package/dist/commands/harnesses/leases/billing.d.ts +9 -6
- package/dist/commands/harnesses/leases/billing.js +19 -24
- package/dist/commands/machines/dedicated/attach.d.ts +28 -0
- package/dist/commands/machines/dedicated/attach.js +76 -0
- package/dist/commands/machines/dedicated/catalog.d.ts +17 -0
- package/dist/commands/machines/dedicated/catalog.js +75 -0
- package/dist/commands/machines/dedicated/cp.d.ts +22 -0
- package/dist/commands/machines/dedicated/cp.js +76 -0
- package/dist/commands/machines/dedicated/create.d.ts +6 -2
- package/dist/commands/machines/dedicated/create.js +29 -20
- package/dist/commands/machines/dedicated/current.d.ts +19 -0
- package/dist/commands/machines/dedicated/current.js +49 -0
- package/dist/commands/machines/dedicated/destroy.d.ts +6 -2
- package/dist/commands/machines/dedicated/destroy.js +43 -25
- package/dist/commands/machines/dedicated/exec.d.ts +32 -0
- package/dist/commands/machines/dedicated/exec.js +122 -0
- package/dist/commands/machines/dedicated/grow.d.ts +6 -2
- package/dist/commands/machines/dedicated/grow.js +16 -20
- package/dist/commands/machines/dedicated/health-check.d.ts +2 -2
- package/dist/commands/machines/dedicated/health-check.js +18 -15
- package/dist/commands/machines/dedicated/incident-close.d.ts +3 -2
- package/dist/commands/machines/dedicated/incident-close.js +13 -15
- package/dist/commands/machines/dedicated/index.js +39 -16
- package/dist/commands/machines/dedicated/list.d.ts +2 -2
- package/dist/commands/machines/dedicated/list.js +28 -17
- package/dist/commands/machines/dedicated/restart.d.ts +5 -2
- package/dist/commands/machines/dedicated/restart.js +10 -20
- package/dist/commands/machines/dedicated/restore.d.ts +26 -0
- package/dist/commands/machines/dedicated/restore.js +64 -0
- package/dist/commands/machines/dedicated/show.d.ts +2 -2
- package/dist/commands/machines/dedicated/show.js +30 -31
- package/dist/commands/machines/dedicated/sign-in.d.ts +19 -0
- package/dist/commands/machines/dedicated/sign-in.js +49 -0
- package/dist/commands/machines/dedicated/snapshot.d.ts +5 -2
- package/dist/commands/machines/dedicated/snapshot.js +13 -20
- package/dist/commands/machines/dedicated/spending-limit.d.ts +22 -0
- package/dist/commands/machines/dedicated/spending-limit.js +51 -0
- package/dist/commands/machines/dedicated/start.d.ts +5 -2
- package/dist/commands/machines/dedicated/start.js +10 -20
- package/dist/commands/machines/dedicated/stop.d.ts +5 -2
- package/dist/commands/machines/dedicated/stop.js +10 -20
- package/dist/commands/machines/dedicated/terminal.d.ts +22 -0
- package/dist/commands/machines/dedicated/terminal.js +42 -0
- package/dist/commands/tasks/list.js +27 -0
- package/dist/lib/daemonBroker.d.ts +8 -0
- package/dist/lib/daemonBroker.js +2 -2
- package/dist/lib/dedicated-copy.d.ts +22 -0
- package/dist/lib/dedicated-copy.js +115 -0
- package/dist/lib/dedicated-exec.d.ts +80 -0
- package/dist/lib/dedicated-exec.js +271 -0
- package/dist/lib/dedicated-lease-command.d.ts +59 -0
- package/dist/lib/dedicated-lease-command.js +181 -0
- package/dist/lib/dedicated-machines.d.ts +337 -12
- package/dist/lib/dedicated-machines.js +502 -25
- package/dist/lib/dedicated-terminal.d.ts +89 -0
- package/dist/lib/dedicated-terminal.js +275 -0
- package/dist/lib/dedicated-wait.d.ts +72 -0
- package/dist/lib/dedicated-wait.js +195 -0
- package/dist/lib/edge-error-page.d.ts +49 -0
- package/dist/lib/edge-error-page.js +120 -0
- package/dist/lib/harnesses.d.ts +15 -1
- package/dist/lib/harnesses.js +20 -2
- package/dist/lib/hosted-machines.js +7 -0
- package/dist/lib/node-adapter.js +1 -1
- package/dist/lib/sky-code.d.ts +30 -1
- package/dist/lib/sky-code.js +44 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.d.ts +10 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +17 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.d.ts +10 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +16 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +2625 -2608
- package/oclif.manifest.json +27851 -26936
- package/package.json +1 -1
|
@@ -1,9 +1,74 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Harness, HarnessLease } from './harnesses';
|
|
2
2
|
export type DedicatedLeaseAction = 'start' | 'stop' | 'restart' | 'snapshot' | 'health-check';
|
|
3
3
|
export declare const DEDICATED_LEASE_ACTIONS: DedicatedLeaseAction[];
|
|
4
|
+
export declare const DEDICATED_MACHINE_PRODUCT = "dedicated-machine";
|
|
4
5
|
export interface DedicatedRuntimeScope {
|
|
5
6
|
workspaceId?: string;
|
|
6
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* One Dedicated Runtime lease, as `toPublicMachineLeasePayload` emits it.
|
|
10
|
+
*
|
|
11
|
+
* Only fields the server actually sends belong here — the shared `HarnessLease`
|
|
12
|
+
* once declared three fields nobody ever sent, and optional properties made that
|
|
13
|
+
* compile while the columns stayed empty. Provider ids (instance, volume, AMI)
|
|
14
|
+
* are deliberately absent from the payload and therefore from this type.
|
|
15
|
+
*/
|
|
16
|
+
export interface DedicatedLease extends Omit<HarnessLease, 'storage'> {
|
|
17
|
+
supportReference?: string;
|
|
18
|
+
lifecycleCapabilities?: Record<string, boolean>;
|
|
19
|
+
executionCapabilities?: Record<string, boolean>;
|
|
20
|
+
resources?: {
|
|
21
|
+
cpu?: number;
|
|
22
|
+
memoryGb?: number;
|
|
23
|
+
storageGb?: number;
|
|
24
|
+
architecture?: string;
|
|
25
|
+
os?: string;
|
|
26
|
+
imagePreset?: string;
|
|
27
|
+
imageVersion?: string;
|
|
28
|
+
sizePreset?: string;
|
|
29
|
+
regionClass?: string;
|
|
30
|
+
};
|
|
31
|
+
daemon?: {
|
|
32
|
+
version?: string;
|
|
33
|
+
imageVersion?: string;
|
|
34
|
+
lastHeartbeatAt?: string;
|
|
35
|
+
registeredAt?: string;
|
|
36
|
+
};
|
|
37
|
+
storage?: {
|
|
38
|
+
retentionClass?: string;
|
|
39
|
+
backupProfile?: string;
|
|
40
|
+
lastBackupAt?: string;
|
|
41
|
+
lastRestoreTestAt?: string;
|
|
42
|
+
lastRestoreTestStatus?: string;
|
|
43
|
+
unpaidSince?: string;
|
|
44
|
+
deletionNoticeAt?: string;
|
|
45
|
+
deleteAfter?: string;
|
|
46
|
+
/** A workspace deletion and its recovery window (D12). */
|
|
47
|
+
deletion?: DedicatedLeaseDeletion;
|
|
48
|
+
} & Record<string, unknown>;
|
|
49
|
+
recovery?: {
|
|
50
|
+
incidentHold?: {
|
|
51
|
+
status?: string;
|
|
52
|
+
reason?: string;
|
|
53
|
+
heldAt?: string;
|
|
54
|
+
closedAt?: string;
|
|
55
|
+
};
|
|
56
|
+
/** Set on a machine created by restoring a deleted one. */
|
|
57
|
+
restoredFromLeaseId?: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A deleted workspace: restorable into a new machine until `recoverableUntil`,
|
|
62
|
+
* then every copy is deleted and `completedAt` records it.
|
|
63
|
+
*/
|
|
64
|
+
export interface DedicatedLeaseDeletion {
|
|
65
|
+
status?: 'recoverable' | 'purging' | 'completed';
|
|
66
|
+
requestedAt?: string | null;
|
|
67
|
+
recoverableUntil?: string | null;
|
|
68
|
+
restorable?: boolean;
|
|
69
|
+
restoredToLeaseId?: string | null;
|
|
70
|
+
completedAt?: string | null;
|
|
71
|
+
}
|
|
7
72
|
export interface CreateDedicatedRuntimeInput extends DedicatedRuntimeScope {
|
|
8
73
|
requestId: string;
|
|
9
74
|
displayName: string;
|
|
@@ -16,7 +81,7 @@ export interface CreateDedicatedRuntimeInput extends DedicatedRuntimeScope {
|
|
|
16
81
|
repositoryRef?: string;
|
|
17
82
|
}
|
|
18
83
|
export interface DedicatedRuntimeResponse {
|
|
19
|
-
lease?:
|
|
84
|
+
lease?: DedicatedLease;
|
|
20
85
|
}
|
|
21
86
|
/**
|
|
22
87
|
* Flags in, request body out — and the point of it being a function is the
|
|
@@ -40,27 +105,287 @@ export declare function dedicatedRuntimeCreateInput(input: {
|
|
|
40
105
|
storageGb?: number;
|
|
41
106
|
retentionClass?: string;
|
|
42
107
|
backupProfile?: string;
|
|
108
|
+
repositoryRef?: string;
|
|
43
109
|
workspaceId?: string;
|
|
44
110
|
}): CreateDedicatedRuntimeInput;
|
|
111
|
+
/**
|
|
112
|
+
* The shapes the server's repository parser accepts: `owner/repo`,
|
|
113
|
+
* `github.com/owner/repo`, or an https URL to it, optionally ending in `.git`.
|
|
114
|
+
*
|
|
115
|
+
* This is a typo catcher, not the authority. The server re-parses the value and
|
|
116
|
+
* decides whether the owner's GitHub App installation covers it; checking the
|
|
117
|
+
* shape here only turns "create failed" into "that is not a repository" before a
|
|
118
|
+
* billable request is sent.
|
|
119
|
+
*/
|
|
120
|
+
export declare function isDedicatedRepositoryRef(value: string): boolean;
|
|
45
121
|
export declare function createDedicatedRuntime(input: CreateDedicatedRuntimeInput): Promise<DedicatedRuntimeResponse>;
|
|
46
122
|
export declare function listDedicatedRuntimes(options?: {
|
|
47
123
|
limit?: number;
|
|
48
124
|
state?: string;
|
|
49
|
-
}): Promise<{
|
|
50
|
-
leases?:
|
|
125
|
+
} & DedicatedRuntimeScope): Promise<{
|
|
126
|
+
leases?: DedicatedLease[];
|
|
51
127
|
}>;
|
|
52
|
-
export declare function getDedicatedRuntime(leaseId: string): Promise<DedicatedRuntimeResponse>;
|
|
53
|
-
export declare function performDedicatedLeaseAction(leaseId: string, action: DedicatedLeaseAction): Promise<DedicatedRuntimeResponse>;
|
|
128
|
+
export declare function getDedicatedRuntime(leaseId: string, scope?: DedicatedRuntimeScope): Promise<DedicatedRuntimeResponse>;
|
|
129
|
+
export declare function performDedicatedLeaseAction(leaseId: string, action: DedicatedLeaseAction, scope?: DedicatedRuntimeScope): Promise<DedicatedRuntimeResponse>;
|
|
54
130
|
export declare function growDedicatedRuntime(leaseId: string, storageGb: number, options?: {
|
|
55
131
|
requestId?: string;
|
|
56
|
-
}): Promise<DedicatedRuntimeResponse>;
|
|
132
|
+
} & DedicatedRuntimeScope): Promise<DedicatedRuntimeResponse>;
|
|
133
|
+
/**
|
|
134
|
+
* Restore a deleted Dedicated Runtime into a NEW machine, from the final recovery
|
|
135
|
+
* point its deletion kept. Only inside the deletion's recovery window, and once
|
|
136
|
+
* per deletion; the response's `lease` is the new machine. The cap defaults to
|
|
137
|
+
* the deleted machine's.
|
|
138
|
+
*/
|
|
139
|
+
export declare function restoreDeletedDedicatedRuntime(leaseId: string, options?: {
|
|
140
|
+
displayName?: string;
|
|
141
|
+
monthlySpendingLimitCents?: number;
|
|
142
|
+
requestId?: string;
|
|
143
|
+
} & DedicatedRuntimeScope): Promise<DedicatedRuntimeResponse>;
|
|
144
|
+
/**
|
|
145
|
+
* Change the monthly spending cap of one lease.
|
|
146
|
+
*
|
|
147
|
+
* The route accepts `spendingLimitCents` and nothing else: who pays is decided
|
|
148
|
+
* at create and there is no API that moves it. A cap below what the month has
|
|
149
|
+
* already spent (or is projected to) is refused rather than stopping the machine
|
|
150
|
+
* on the next reconciler pass.
|
|
151
|
+
*/
|
|
152
|
+
export declare function setDedicatedRuntimeSpendingLimit(leaseId: string, spendingLimitCents: number, scope?: DedicatedRuntimeScope): Promise<DedicatedRuntimeResponse>;
|
|
57
153
|
export declare function closeDedicatedRuntimeIncidentHold(leaseId: string, options?: {
|
|
58
154
|
requestId?: string;
|
|
59
|
-
}): Promise<DedicatedRuntimeResponse>;
|
|
155
|
+
} & DedicatedRuntimeScope): Promise<DedicatedRuntimeResponse>;
|
|
60
156
|
export declare function destroyDedicatedRuntime(leaseId: string, options?: {
|
|
61
157
|
retentionIntent?: 'retain' | 'purge';
|
|
62
|
-
}): Promise<DedicatedRuntimeResponse>;
|
|
63
|
-
export
|
|
64
|
-
|
|
65
|
-
|
|
158
|
+
} & DedicatedRuntimeScope): Promise<DedicatedRuntimeResponse>;
|
|
159
|
+
export interface DedicatedRuntimeExecInput {
|
|
160
|
+
command: string;
|
|
161
|
+
cwd?: string;
|
|
162
|
+
timeoutMs?: number;
|
|
163
|
+
}
|
|
164
|
+
export interface DedicatedRuntimeExecResult {
|
|
165
|
+
/** stdout and stderr, merged in the order the machine produced them, capped at 1 MB. */
|
|
166
|
+
stdout: string;
|
|
167
|
+
/** null when the command was killed at its deadline. */
|
|
168
|
+
exitCode: number | null;
|
|
169
|
+
timedOut: boolean;
|
|
170
|
+
truncated: boolean;
|
|
171
|
+
durationMs: number;
|
|
172
|
+
/**
|
|
173
|
+
* Present when a started command's stored outcome kept only the tail: the
|
|
174
|
+
* number of bytes the machine returned, of which `stdout` is the last part.
|
|
175
|
+
*/
|
|
176
|
+
outputBytes?: number;
|
|
177
|
+
}
|
|
178
|
+
/** The server's ceiling for one exec; documented beside the route. */
|
|
179
|
+
export declare const DEDICATED_EXEC_MAX_TIMEOUT_MS: number;
|
|
180
|
+
/** The server's default when a command names no timeout. */
|
|
181
|
+
export declare const DEDICATED_EXEC_DEFAULT_TIMEOUT_MS: number;
|
|
182
|
+
/**
|
|
183
|
+
* Run one command on the machine as the workload user, in ONE request.
|
|
184
|
+
*
|
|
185
|
+
* The synchronous route, kept for servers that predate `executions`. It holds
|
|
186
|
+
* the request open while the command runs, so behind CloudFront a command that
|
|
187
|
+
* runs past ~60 s is cut off at the edge while it keeps running (OSK-8705).
|
|
188
|
+
* `runDedicatedExec` (dedicated-exec.ts) starts and observes instead, and falls
|
|
189
|
+
* back to this only when the server has no `executions` route.
|
|
190
|
+
*
|
|
191
|
+
* Not idempotent and not retried: `apiFetch` gives each call a fresh
|
|
192
|
+
* idempotency key, which is the rule for an unfenced write — running the same
|
|
193
|
+
* command twice is two intents even when the text is identical.
|
|
194
|
+
*/
|
|
195
|
+
export declare function execDedicatedRuntime(leaseId: string, input: DedicatedRuntimeExecInput, scope?: DedicatedRuntimeScope): Promise<DedicatedRuntimeExecResult>;
|
|
196
|
+
export type DedicatedRuntimeExecutionState = 'running' | 'completed' | 'failed' | 'unknown';
|
|
197
|
+
/** A started command, as `GET .../executions/:id` reports it. */
|
|
198
|
+
export interface DedicatedRuntimeExecution {
|
|
199
|
+
id: string;
|
|
200
|
+
state: DedicatedRuntimeExecutionState;
|
|
201
|
+
startedAt: string;
|
|
202
|
+
timeoutMs: number;
|
|
203
|
+
completedAt?: string;
|
|
204
|
+
/** `completed`: exactly what the synchronous exec route returns. */
|
|
205
|
+
result?: DedicatedRuntimeExecResult;
|
|
206
|
+
/** `failed` / `unknown`: the status and body the synchronous route would have answered with. */
|
|
207
|
+
error?: {
|
|
208
|
+
status?: number;
|
|
209
|
+
code?: string;
|
|
210
|
+
error?: string;
|
|
211
|
+
message?: string;
|
|
212
|
+
} & Record<string, unknown>;
|
|
213
|
+
}
|
|
214
|
+
export interface DedicatedRuntimeExecutionResponse {
|
|
215
|
+
execution: DedicatedRuntimeExecution;
|
|
216
|
+
replayed?: boolean;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Start one command. `requestId` is the idempotency key: the same id, for the
|
|
220
|
+
* same command on the same lease, returns the execution it already started —
|
|
221
|
+
* so a retry after a lost response never runs the command twice.
|
|
222
|
+
*/
|
|
223
|
+
export declare function startDedicatedRuntimeExecution(leaseId: string, input: DedicatedRuntimeExecInput, options: {
|
|
224
|
+
requestId: string;
|
|
225
|
+
signal?: AbortSignal;
|
|
226
|
+
} & DedicatedRuntimeScope): Promise<DedicatedRuntimeExecutionResponse>;
|
|
227
|
+
/** Read a started command, letting the server hold the answer up to `waitMs` for it to end. */
|
|
228
|
+
export declare function observeDedicatedRuntimeExecution(leaseId: string, executionId: string, options: {
|
|
229
|
+
waitMs: number;
|
|
230
|
+
signal?: AbortSignal;
|
|
231
|
+
} & DedicatedRuntimeScope): Promise<DedicatedRuntimeExecutionResponse>;
|
|
232
|
+
/** Mirrors the daemon's bounds (daemon/src/tools/file-transfer.ts). */
|
|
233
|
+
export declare const DEDICATED_FILE_CHUNK_BYTES: number;
|
|
234
|
+
export declare const DEDICATED_FILE_MAX_BYTES: number;
|
|
235
|
+
export interface DedicatedFileChunk {
|
|
236
|
+
path: string;
|
|
237
|
+
size: number;
|
|
238
|
+
mtimeMs: number;
|
|
239
|
+
offset: number;
|
|
240
|
+
bytesRead: number;
|
|
241
|
+
dataBase64: string;
|
|
242
|
+
eof: boolean;
|
|
243
|
+
}
|
|
244
|
+
export interface DedicatedFileWriteResult {
|
|
245
|
+
path: string;
|
|
246
|
+
transferId: string;
|
|
247
|
+
staged: number;
|
|
248
|
+
committed: boolean;
|
|
249
|
+
aborted?: boolean;
|
|
250
|
+
}
|
|
251
|
+
export declare function readDedicatedRuntimeFileChunk(leaseId: string, input: {
|
|
252
|
+
path: string;
|
|
253
|
+
offset: number;
|
|
254
|
+
length: number;
|
|
255
|
+
}, scope?: DedicatedRuntimeScope): Promise<DedicatedFileChunk>;
|
|
256
|
+
export declare function writeDedicatedRuntimeFileChunk(leaseId: string, input: {
|
|
257
|
+
path: string;
|
|
258
|
+
transferId: string;
|
|
259
|
+
offset: number;
|
|
260
|
+
dataBase64?: string;
|
|
261
|
+
final?: boolean;
|
|
262
|
+
abort?: boolean;
|
|
263
|
+
totalSize?: number;
|
|
264
|
+
}, scope?: DedicatedRuntimeScope): Promise<DedicatedFileWriteResult>;
|
|
265
|
+
export type DedicatedCopyPlan = {
|
|
266
|
+
direction: 'upload';
|
|
267
|
+
localPath: string;
|
|
268
|
+
leaseId: string;
|
|
269
|
+
remotePath: string;
|
|
270
|
+
} | {
|
|
271
|
+
direction: 'download';
|
|
272
|
+
leaseId: string;
|
|
273
|
+
remotePath: string;
|
|
274
|
+
localPath: string;
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* `cp <src> <dst>` where exactly one side is `<lease-id>:<path>`.
|
|
278
|
+
*
|
|
279
|
+
* The remote side is recognised by the lease id prefix rather than by "has a
|
|
280
|
+
* colon", so a Windows path (`C:\\build\\out.zip`) or a local file whose name
|
|
281
|
+
* contains a colon is never mistaken for a machine.
|
|
282
|
+
*/
|
|
283
|
+
export declare function parseDedicatedCopyEndpoints(source: string, destination: string): DedicatedCopyPlan;
|
|
284
|
+
export declare function dedicatedLeaseId(lease: DedicatedLease | HarnessLease | undefined | null): string;
|
|
285
|
+
export declare function dedicatedLeaseState(lease: DedicatedLease | HarnessLease | undefined | null): string;
|
|
286
|
+
export declare function dedicatedLeaseDisplayName(lease: DedicatedLease | HarnessLease | undefined | null): string;
|
|
287
|
+
/** `$12.34` — cents are what the API speaks; dollars are what a person reads. */
|
|
288
|
+
export declare function formatUsdCents(cents: number | null | undefined): string;
|
|
289
|
+
/** `this month $1.23 of $500.00 cap`, or why that sentence cannot be written. */
|
|
290
|
+
export declare function dedicatedSpendSummary(lease: DedicatedLease): string;
|
|
291
|
+
/**
|
|
292
|
+
* The human rendering of `machines dedicated show`, as lines.
|
|
293
|
+
*
|
|
294
|
+
* Pure so it can be pinned without a server. Every field is optional because a
|
|
295
|
+
* lease that is still `requested` has no resources, daemon or spend yet, and a
|
|
296
|
+
* missing value is omitted rather than printed as a column of dashes.
|
|
297
|
+
*/
|
|
298
|
+
/** One line saying what a deletion still allows. */
|
|
299
|
+
export declare function describeDedicatedDeletion(deletion: DedicatedLeaseDeletion, leaseId?: string): string;
|
|
300
|
+
export declare function describeDedicatedLease(lease: DedicatedLease, harnesses?: readonly Harness[]): string[];
|
|
301
|
+
/**
|
|
302
|
+
* Every harness row a Dedicated Runtime lease's daemon registered, freshest
|
|
303
|
+
* first.
|
|
304
|
+
*
|
|
305
|
+
* A lease payload names no daemon (provider and daemon ids are deliberately
|
|
306
|
+
* absent), so the join goes the other way: each row a guest daemon registers
|
|
307
|
+
* carries `metadata.machineLeaseId` and `metadata.machineProduct`. One daemon
|
|
308
|
+
* writes one row PER ENGINE it announces (claude, codex, sky-code, or `oversky`
|
|
309
|
+
* when it announces none), all sharing the daemon id.
|
|
310
|
+
*/
|
|
311
|
+
export declare function dedicatedLeaseHarnesses(lease: Pick<DedicatedLease, 'id'>, harnesses: readonly Harness[]): Harness[];
|
|
312
|
+
/**
|
|
313
|
+
* The lease of the machine this process is running on, from the harness rows.
|
|
314
|
+
*
|
|
315
|
+
* Nothing in a workload process's environment names its lease — the daemon's
|
|
316
|
+
* environment (lease, generation, credentials) sits on the other side of the uid
|
|
317
|
+
* split by design. The CLI hand-off descriptor the daemon publishes to the
|
|
318
|
+
* workload group does carry the daemon's id, and every harness row that daemon
|
|
319
|
+
* registered carries `metadata.machineLeaseId`. Joining the two answers "which
|
|
320
|
+
* machine am I" with no new daemon surface.
|
|
321
|
+
*/
|
|
322
|
+
export declare function dedicatedLeaseIdForDaemon(daemonId: string | undefined | null, harnesses: readonly Harness[]): string | null;
|
|
323
|
+
/**
|
|
324
|
+
* The row an interactive terminal opens on: online, local, with a daemon.
|
|
325
|
+
*
|
|
326
|
+
* Any engine row reaches the same shell — they share the daemon — so the
|
|
327
|
+
* freshest one wins. The terminal relay's own access check refuses a row that
|
|
328
|
+
* is not local or has no daemon, so offering one here would only move the
|
|
329
|
+
* refusal later.
|
|
330
|
+
*/
|
|
331
|
+
export declare function dedicatedTerminalHarness(lease: Pick<DedicatedLease, 'id'>, harnesses: readonly Harness[]): Harness | null;
|
|
332
|
+
/**
|
|
333
|
+
* The harness row an agent should be attached to, for `attach`.
|
|
334
|
+
*
|
|
335
|
+
* Choosing a row also chooses the ENGINE the agent's turns run under, so an
|
|
336
|
+
* ambiguous choice is refused with the options named rather than guessed. A
|
|
337
|
+
* row need not be online to be attached — a stopped machine keeps its rows —
|
|
338
|
+
* but the error says so when it is not.
|
|
339
|
+
*/
|
|
340
|
+
export declare function selectDedicatedAttachHarness(lease: Pick<DedicatedLease, 'id'>, harnesses: readonly Harness[], engine?: string): {
|
|
341
|
+
harness: Harness;
|
|
342
|
+
} | {
|
|
343
|
+
error: string;
|
|
344
|
+
};
|
|
345
|
+
interface CatalogSize {
|
|
346
|
+
id?: string;
|
|
347
|
+
label?: string;
|
|
348
|
+
vcpus?: number;
|
|
349
|
+
memoryGiB?: number;
|
|
350
|
+
accelerator?: string;
|
|
351
|
+
}
|
|
352
|
+
interface CatalogPriceLine {
|
|
353
|
+
label?: string;
|
|
354
|
+
display?: string;
|
|
355
|
+
amountCents?: number | null;
|
|
356
|
+
cadence?: string;
|
|
357
|
+
}
|
|
358
|
+
export interface DedicatedCatalog {
|
|
359
|
+
availability: string;
|
|
360
|
+
disabledReason?: string;
|
|
361
|
+
sizes: CatalogSize[];
|
|
362
|
+
regionClasses: string[];
|
|
363
|
+
storage?: {
|
|
364
|
+
minGb?: number;
|
|
365
|
+
defaultGb?: number;
|
|
366
|
+
maxGb?: number;
|
|
367
|
+
};
|
|
368
|
+
retentionClasses: string[];
|
|
369
|
+
backupProfiles: string[];
|
|
370
|
+
defaultMonthlySpendingLimitCents?: number | null;
|
|
371
|
+
maxUserMonthlySpendingLimitCents?: number | null;
|
|
372
|
+
priceLines: CatalogPriceLine[];
|
|
373
|
+
headline?: string;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* The Dedicated Runtime row of `GET /api/machines/products`, reduced to what a
|
|
377
|
+
* caller needs to choose `create` flags.
|
|
378
|
+
*
|
|
379
|
+
* `--size-preset` has no client-side list of values on purpose — presets are
|
|
380
|
+
* gated by server flags — so this is where a caller learns which ones exist.
|
|
381
|
+
*/
|
|
382
|
+
export declare function dedicatedCatalogFromProducts(payload: unknown): DedicatedCatalog | null;
|
|
383
|
+
/**
|
|
384
|
+
* The product refusal code the server sent (`DEDICATED_RUNTIME_NOT_ASSIGNABLE`,
|
|
385
|
+
* …), for `this.error(message, { code })`. Without it a `--json` caller got the
|
|
386
|
+
* generic `CLI_ERROR` and could only branch on prose (OSK-8685). Falls back to
|
|
387
|
+
* `HTTP_<status>`, the same code `handleApiError` uses for a body with none.
|
|
388
|
+
*/
|
|
389
|
+
export declare function dedicatedRuntimeApiErrorCode(err: unknown): string | undefined;
|
|
66
390
|
export declare function formatDedicatedRuntimeApiError(err: unknown): string | null;
|
|
391
|
+
export {};
|