@skrr-ai/cli 0.1.87 → 0.1.89
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/commands/agents/chat.js +27 -1
- package/dist/commands/computer/index.d.ts +19 -0
- package/dist/commands/computer/index.js +37 -0
- package/dist/commands/labels/create.d.ts +1 -0
- package/dist/commands/labels/create.js +2 -0
- package/dist/commands/labels/restore.d.ts +1 -0
- package/dist/commands/labels/restore.js +6 -3
- package/dist/commands/labels/update.d.ts +1 -0
- package/dist/commands/labels/update.js +2 -0
- package/dist/commands/machines/computer-adoption.d.ts +16 -0
- package/dist/commands/machines/computer-adoption.js +34 -0
- package/dist/commands/machines/dedicated/agent-browser.d.ts +25 -0
- package/dist/commands/machines/dedicated/agent-browser.js +65 -0
- package/dist/commands/machines/dedicated/archive.d.ts +26 -0
- package/dist/commands/machines/dedicated/archive.js +113 -0
- package/dist/commands/machines/dedicated/audit.d.ts +25 -0
- package/dist/commands/machines/dedicated/audit.js +113 -0
- package/dist/commands/machines/dedicated/computer.d.ts +23 -0
- package/dist/commands/machines/dedicated/computer.js +64 -0
- package/dist/commands/machines/dedicated/cp.d.ts +2 -0
- package/dist/commands/machines/dedicated/cp.js +74 -2
- package/dist/commands/machines/dedicated/git-status.d.ts +15 -0
- package/dist/commands/machines/dedicated/git-status.js +56 -0
- package/dist/commands/machines/dedicated/index.js +15 -1
- package/dist/commands/machines/dedicated/ls.d.ts +27 -0
- package/dist/commands/machines/dedicated/ls.js +100 -0
- package/dist/commands/machines/dedicated/mkdir.d.ts +18 -0
- package/dist/commands/machines/dedicated/mkdir.js +57 -0
- package/dist/commands/machines/dedicated/mv.d.ts +24 -0
- package/dist/commands/machines/dedicated/mv.js +83 -0
- package/dist/commands/machines/dedicated/rm.d.ts +26 -0
- package/dist/commands/machines/dedicated/rm.js +100 -0
- package/dist/commands/machines/dedicated/search.d.ts +24 -0
- package/dist/commands/machines/dedicated/search.js +78 -0
- package/dist/commands/machines/dedicated/show.js +17 -2
- package/dist/commands/machines/dedicated/stat.d.ts +22 -0
- package/dist/commands/machines/dedicated/stat.js +92 -0
- package/dist/commands/machines/hosted/index.js +1 -1
- package/dist/commands/machines/hosted/list.js +1 -1
- package/dist/commands/machines/hosted/start.js +1 -1
- package/dist/commands/machines/services/declare.d.ts +24 -0
- package/dist/commands/machines/services/declare.js +73 -0
- package/dist/commands/machines/services/index.d.ts +15 -0
- package/dist/commands/machines/services/index.js +31 -0
- package/dist/commands/machines/services/ls.d.ts +17 -0
- package/dist/commands/machines/services/ls.js +60 -0
- package/dist/commands/machines/services/withdraw.d.ts +19 -0
- package/dist/commands/machines/services/withdraw.js +47 -0
- package/dist/commands/machines/share.d.ts +29 -0
- package/dist/commands/machines/share.js +100 -0
- package/dist/commands/machines/shared.d.ts +19 -0
- package/dist/commands/machines/shared.js +62 -0
- package/dist/commands/machines/shares.d.ts +16 -0
- package/dist/commands/machines/shares.js +69 -0
- package/dist/commands/machines/unshare.d.ts +19 -0
- package/dist/commands/machines/unshare.js +61 -0
- package/dist/commands/tasks/labels/create.d.ts +1 -0
- package/dist/commands/tasks/labels/create.js +3 -0
- package/dist/commands/views/create.d.ts +1 -0
- package/dist/commands/views/create.js +5 -0
- package/dist/lib/agent-home-workspace.d.ts +7 -0
- package/dist/lib/agent-home-workspace.js +147 -0
- package/dist/lib/computer-adoption.d.ts +60 -0
- package/dist/lib/computer-adoption.js +72 -0
- package/dist/lib/computer-consent.d.ts +55 -0
- package/dist/lib/computer-consent.js +154 -0
- package/dist/lib/computer-files.d.ts +239 -0
- package/dist/lib/computer-files.js +707 -0
- package/dist/lib/dedicated-copy.d.ts +45 -9
- package/dist/lib/dedicated-copy.js +141 -44
- package/dist/lib/dedicated-machines.d.ts +80 -0
- package/dist/lib/dedicated-machines.js +137 -6
- package/dist/lib/exec-runtime-binary.d.ts +3 -1
- package/dist/lib/exec-runtime-binary.js +16 -2
- package/dist/lib/label-scope.d.ts +12 -0
- package/dist/lib/label-scope.js +15 -1
- package/dist/lib/machine-audit.d.ts +34 -0
- package/dist/lib/machine-audit.js +50 -0
- package/dist/lib/machine-grants.d.ts +70 -0
- package/dist/lib/machine-grants.js +47 -0
- package/dist/lib/machine-services.d.ts +64 -0
- package/dist/lib/machine-services.js +60 -0
- package/dist/lib/task-view-render.d.ts +2 -0
- package/dist/lib/task-view-render.js +1 -1
- package/dist/lib/views/vocabulary.d.ts +1 -1
- package/dist/lib/views/vocabulary.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +1050 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +1196 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +7 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +1050 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +1175 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +7 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +22391 -20727
- package/dist/node_modules/@skrr-ai/data-provider/package.json +1 -1
- package/oclif.manifest.json +14767 -13095
- package/package.json +2 -2
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import type { ComputerFileArchiveChunkResult, ComputerFileArchivePrepareResult, ComputerFileArchiveReleaseResult, ComputerFileEntityTag, ComputerFileEntry, ComputerFileGitStatusResult, ComputerFileListResult, ComputerFileMutationResult, ComputerFileSearchHit, ComputerFileSearchResult, ComputerFileStatResult } from '@skrr-ai/data-provider';
|
|
2
|
+
import { type DedicatedRuntimeScope } from './dedicated-machines';
|
|
3
|
+
/** The generation a command's file calls present; see the header. */
|
|
4
|
+
export interface ComputerFileGeneration {
|
|
5
|
+
generation: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The lease could not say which generation is running — a server that does not
|
|
9
|
+
* publish it yet, or a lease with none. File calls cannot be fenced without
|
|
10
|
+
* one, and the server refuses them unfenced, so the command stops here.
|
|
11
|
+
*/
|
|
12
|
+
export declare class DedicatedFileGenerationUnavailableError extends Error {
|
|
13
|
+
readonly code = "DEDICATED_RUNTIME_GENERATION_UNAVAILABLE";
|
|
14
|
+
constructor(leaseId: string);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Read the lease once and return the generation every file call of this
|
|
18
|
+
* command presents. Resolved at the START of a command and never again: a
|
|
19
|
+
* second read mid-command would follow a replacement, which is exactly what
|
|
20
|
+
* the fence exists to refuse.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveDedicatedFileGeneration(leaseId: string, scope?: DedicatedRuntimeScope): Promise<number>;
|
|
23
|
+
/**
|
|
24
|
+
* List one directory on the machine, one page. `cursor` continues an earlier
|
|
25
|
+
* page's `nextCursor`; a withheld entry comes back with `withheld.reason`
|
|
26
|
+
* rather than silently absent (§18).
|
|
27
|
+
*/
|
|
28
|
+
export declare function listComputerFiles(leaseId: string, input: {
|
|
29
|
+
path: string;
|
|
30
|
+
cursor?: string;
|
|
31
|
+
limit?: number;
|
|
32
|
+
} & ComputerFileGeneration, scope?: DedicatedRuntimeScope): Promise<ComputerFileListResult>;
|
|
33
|
+
/**
|
|
34
|
+
* Stat one path — the entry, and its optimistic-concurrency `tag`. With
|
|
35
|
+
* `contents` a folder's tag also carries `contents` (a digest of everything
|
|
36
|
+
* inside it, at any depth) and the answer its total `entries`: the tag a
|
|
37
|
+
* fenced recursive delete presents. Needs `computer_files_fenced_v1`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function statComputerFile(leaseId: string, input: {
|
|
40
|
+
path: string;
|
|
41
|
+
contents?: boolean;
|
|
42
|
+
} & ComputerFileGeneration, scope?: DedicatedRuntimeScope): Promise<ComputerFileStatResult>;
|
|
43
|
+
/**
|
|
44
|
+
* Search under a folder by file name or (`content`) by text. The answer carries
|
|
45
|
+
* its own `state` and the bounds that applied — see `computerFileSearchLines`
|
|
46
|
+
* for saying them. Defaults (ignore rules honoured, the machine's limit and
|
|
47
|
+
* time bound) are the machine's, so only what the caller set is sent.
|
|
48
|
+
*/
|
|
49
|
+
export declare function searchComputerFiles(leaseId: string, input: {
|
|
50
|
+
path: string;
|
|
51
|
+
query: string;
|
|
52
|
+
content?: boolean;
|
|
53
|
+
respectIgnore?: boolean;
|
|
54
|
+
caseSensitive?: boolean;
|
|
55
|
+
limit?: number;
|
|
56
|
+
budgetMs?: number;
|
|
57
|
+
} & ComputerFileGeneration, scope?: DedicatedRuntimeScope): Promise<ComputerFileSearchResult>;
|
|
58
|
+
/** The git marks of one folder's entries (`modified`, `untracked`, …). */
|
|
59
|
+
export declare function gitStatusComputerFiles(leaseId: string, input: {
|
|
60
|
+
path: string;
|
|
61
|
+
} & ComputerFileGeneration, scope?: DedicatedRuntimeScope): Promise<ComputerFileGitStatusResult>;
|
|
62
|
+
/** Create a directory, including missing parents. */
|
|
63
|
+
export declare function mkdirComputerFile(leaseId: string, input: {
|
|
64
|
+
path: string;
|
|
65
|
+
} & ComputerFileGeneration, scope?: DedicatedRuntimeScope): Promise<ComputerFileMutationResult>;
|
|
66
|
+
/**
|
|
67
|
+
* Rename or move one path. `tag` fences it: the move is refused `file_changed`
|
|
68
|
+
* when the source no longer matches the tag it was read with.
|
|
69
|
+
*/
|
|
70
|
+
export declare function moveComputerFile(leaseId: string, input: {
|
|
71
|
+
from: string;
|
|
72
|
+
to: string;
|
|
73
|
+
tag?: ComputerFileEntityTag;
|
|
74
|
+
} & ComputerFileGeneration, scope?: DedicatedRuntimeScope): Promise<ComputerFileMutationResult>;
|
|
75
|
+
/**
|
|
76
|
+
* Delete one path. A folder is refused `not_empty` unless `recursive` is asked
|
|
77
|
+
* for; `tag` fences the delete against a file that changed since it was read.
|
|
78
|
+
* A RECURSIVE delete with a tag must present the folder's contents tag
|
|
79
|
+
* (`statComputerFile({contents: true})`): anything changed inside it since is
|
|
80
|
+
* refused `file_changed`, and a tag without `contents` is refused
|
|
81
|
+
* `contents_tag_required`. A recursive delete without a tag is unfenced.
|
|
82
|
+
*/
|
|
83
|
+
export declare function deleteComputerFile(leaseId: string, input: {
|
|
84
|
+
path: string;
|
|
85
|
+
tag?: ComputerFileEntityTag;
|
|
86
|
+
recursive?: boolean;
|
|
87
|
+
} & ComputerFileGeneration, scope?: DedicatedRuntimeScope): Promise<ComputerFileMutationResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Stage a folder's archive on the machine (`archive` prepare). The machine
|
|
90
|
+
* holds the staged bytes until `releaseComputerFileArchive` — or until its own
|
|
91
|
+
* stale-staging sweep — so callers always release.
|
|
92
|
+
*/
|
|
93
|
+
export declare function prepareComputerFileArchive(leaseId: string, input: {
|
|
94
|
+
path: string;
|
|
95
|
+
} & ComputerFileGeneration, scope?: DedicatedRuntimeScope): Promise<ComputerFileArchivePrepareResult>;
|
|
96
|
+
/** One chunk of a staged archive; `eof` ends the read. */
|
|
97
|
+
export declare function readComputerFileArchiveChunk(leaseId: string, input: {
|
|
98
|
+
archiveId: string;
|
|
99
|
+
offset?: number;
|
|
100
|
+
length?: number;
|
|
101
|
+
} & ComputerFileGeneration, scope?: DedicatedRuntimeScope): Promise<ComputerFileArchiveChunkResult>;
|
|
102
|
+
/** Release a staged archive. Best-effort callers still call it. */
|
|
103
|
+
export declare function releaseComputerFileArchive(leaseId: string, input: {
|
|
104
|
+
archiveId: string;
|
|
105
|
+
} & ComputerFileGeneration, scope?: DedicatedRuntimeScope): Promise<ComputerFileArchiveReleaseResult>;
|
|
106
|
+
export interface ComputerFileArchiveIo {
|
|
107
|
+
prepare: typeof prepareComputerFileArchive;
|
|
108
|
+
readChunk: typeof readComputerFileArchiveChunk;
|
|
109
|
+
release: typeof releaseComputerFileArchive;
|
|
110
|
+
/** Run `fn` if the process exits; returns the unregister. Injectable for tests. */
|
|
111
|
+
onProcessExit: (fn: () => void) => () => void;
|
|
112
|
+
}
|
|
113
|
+
export interface ComputerFileArchiveDownloadOptions extends Partial<ComputerFileArchiveIo> {
|
|
114
|
+
signal?: AbortSignal;
|
|
115
|
+
onProgress?: (received: number, total: number) => void;
|
|
116
|
+
}
|
|
117
|
+
export interface ComputerFileArchiveDownloadResult {
|
|
118
|
+
/** The folder on the machine that was archived. */
|
|
119
|
+
path: string;
|
|
120
|
+
/** The folder's name, as the machine named the archive. */
|
|
121
|
+
name: string;
|
|
122
|
+
format: string;
|
|
123
|
+
/** Entries the archive holds. */
|
|
124
|
+
entries: number;
|
|
125
|
+
/** The archive's byte size, as prepared. */
|
|
126
|
+
size: number;
|
|
127
|
+
/** Bytes written to the destination. */
|
|
128
|
+
bytes: number;
|
|
129
|
+
/** The local file written. */
|
|
130
|
+
destination: string;
|
|
131
|
+
/** False when release failed; the machine sweeps a stale archive itself. */
|
|
132
|
+
archiveReleased: boolean;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Where a folder download lands. A destination that names a directory — spelled
|
|
136
|
+
* with a trailing separator, or an existing one — receives `<name>.<format>`
|
|
137
|
+
* inside it, as `cp` already treats directories.
|
|
138
|
+
*/
|
|
139
|
+
export declare function computerFileArchiveDestination(localPath: string | undefined, name: string, format: string,
|
|
140
|
+
/** Whether `localPath` names an existing directory (caller's stat). */
|
|
141
|
+
isDirectory: boolean): string;
|
|
142
|
+
/**
|
|
143
|
+
* Download one folder as its staged archive, prepare → chunks → release. Every
|
|
144
|
+
* call — prepare, each chunk, the release — presents the one `generation` the
|
|
145
|
+
* command resolved, so a machine replaced mid-download refuses the rest.
|
|
146
|
+
*
|
|
147
|
+
* The local write is never half-visible: chunks land in a temporary file beside
|
|
148
|
+
* the destination and are renamed into place at the end; a failed or cancelled
|
|
149
|
+
* download removes the temporary and still releases the staged archive. The
|
|
150
|
+
* archive itself is one immutable staged file, so chunks always belong to the
|
|
151
|
+
* same tree snapshot — there is no mid-copy change to fence here.
|
|
152
|
+
*/
|
|
153
|
+
export declare function downloadComputerFileArchive(leaseId: string, remotePath: string, localPath: string | undefined, generation: number, scope?: DedicatedRuntimeScope, io?: ComputerFileArchiveDownloadOptions): Promise<ComputerFileArchiveDownloadResult>;
|
|
154
|
+
/**
|
|
155
|
+
* The tag exactly as `--tag` takes it back: `inode:size:mtimeNs`, the triple
|
|
156
|
+
* `stat` prints and a `file_changed` refusal carries — and, for a folder read
|
|
157
|
+
* with `stat --contents`, a fourth part, `inode:size:mtimeNs:contents`, the
|
|
158
|
+
* digest a fenced recursive delete presents.
|
|
159
|
+
*/
|
|
160
|
+
export declare function computerFileTagString(tag: ComputerFileEntityTag): string;
|
|
161
|
+
/**
|
|
162
|
+
* Parse a `--tag` value: the compact `inode:size:mtimeNs[:contents]` form, or
|
|
163
|
+
* the JSON object `--json` output prints. Throws a usage-shaped Error, never a
|
|
164
|
+
* half-tag.
|
|
165
|
+
*/
|
|
166
|
+
export declare function parseComputerFileTag(text: string): ComputerFileEntityTag;
|
|
167
|
+
/** `drwxr-x---` — the entry's type char plus its permission bits. */
|
|
168
|
+
export declare function computerFileModeString(type: string, mode: number): string;
|
|
169
|
+
/** `1.2 MiB`, `3182 B` — sizes a person scans. */
|
|
170
|
+
export declare function formatComputerFileSize(bytes: number): string;
|
|
171
|
+
/**
|
|
172
|
+
* How one `ls` row names its entry: `name` (dirs marked `/`), a symlink's
|
|
173
|
+
* stored target (`a -> b`, never followed), and a withheld entry said as
|
|
174
|
+
* withheld with the reason — never rendered as an ordinary readable file.
|
|
175
|
+
*/
|
|
176
|
+
export declare function computerFileEntryName(entry: ComputerFileEntry): string;
|
|
177
|
+
/** One search hit as a line: `path`, or `path:line: text` for a content match. */
|
|
178
|
+
export declare function computerFileSearchHitLine(hit: ComputerFileSearchHit): string;
|
|
179
|
+
/**
|
|
180
|
+
* The search read-out. The closing line says how it ended: a list cut at the
|
|
181
|
+
* limit or the time bound is never printed as if it were the whole answer, and
|
|
182
|
+
* "nothing found" is said only for a search that finished.
|
|
183
|
+
*/
|
|
184
|
+
export declare function computerFileSearchLines(result: ComputerFileSearchResult): string[];
|
|
185
|
+
/** The git-status read-out; `timed_out` offers no marks and says so. */
|
|
186
|
+
export declare function computerFileGitStatusLines(result: ComputerFileGitStatusResult): string[];
|
|
187
|
+
/** The parsed refusal body of a thrown call, when the wire sent one. */
|
|
188
|
+
export declare function computerFileRefusalBody(err: unknown): Record<string, unknown> | null;
|
|
189
|
+
/**
|
|
190
|
+
* The refusal, or null when the failure is not a computer refusal at all (an
|
|
191
|
+
* edge page, a lease that does not resolve — `formatDedicatedRuntimeApiError`'s
|
|
192
|
+
* cases, which the caller then handles).
|
|
193
|
+
*
|
|
194
|
+
* Codes the route returns that are not in COMPUTER_REFUSAL_CODES — `internal`,
|
|
195
|
+
* `not_supported`, a middleware's own — are still the refusal: they carry the
|
|
196
|
+
* same `{error, code, message}` envelope and there is no second reader to hand
|
|
197
|
+
* them to.
|
|
198
|
+
*/
|
|
199
|
+
export declare function computerFileRefusalInfo(err: unknown): {
|
|
200
|
+
code: string;
|
|
201
|
+
message: string;
|
|
202
|
+
status?: number;
|
|
203
|
+
currentTag?: ComputerFileEntityTag;
|
|
204
|
+
details?: Record<string, unknown>;
|
|
205
|
+
missingCapability?: string;
|
|
206
|
+
operation?: string;
|
|
207
|
+
body: Record<string, unknown>;
|
|
208
|
+
} | null;
|
|
209
|
+
export interface ComputerFileFailure {
|
|
210
|
+
message: string;
|
|
211
|
+
code: string;
|
|
212
|
+
status?: number;
|
|
213
|
+
retryable: boolean;
|
|
214
|
+
/** The refusal body verbatim, for the `--json` envelope's `error.details`. */
|
|
215
|
+
details?: Record<string, unknown>;
|
|
216
|
+
requestId?: string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* One refusal → the sentence the command prints: the server's own message, then
|
|
220
|
+
* what to do about it. A refusal that names its fix in the message already
|
|
221
|
+
* (`too_large` ends "Push it through Git or object storage instead.") is not
|
|
222
|
+
* given a second one.
|
|
223
|
+
*/
|
|
224
|
+
export declare function describeComputerFileRefusal(refusal: NonNullable<ReturnType<typeof computerFileRefusalInfo>>, ctx: {
|
|
225
|
+
bin: string;
|
|
226
|
+
leaseId?: string;
|
|
227
|
+
takesTag?: boolean;
|
|
228
|
+
}): string;
|
|
229
|
+
/**
|
|
230
|
+
* Everything a command needs to print a failure — the computer refusal
|
|
231
|
+
* sentence when the wire sent one, or the dedicated-runtime reading otherwise
|
|
232
|
+
* (edge page, lease not found). Null means neither had anything to say, and
|
|
233
|
+
* the caller falls back to `handleApiError`.
|
|
234
|
+
*/
|
|
235
|
+
export declare function describeComputerFileFailure(err: unknown, ctx: {
|
|
236
|
+
bin: string;
|
|
237
|
+
leaseId?: string;
|
|
238
|
+
takesTag?: boolean;
|
|
239
|
+
}): ComputerFileFailure | null;
|