stitchkit 0.120.0 → 0.122.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/CHANGELOG.md +83 -0
- package/dist/agent-runtime/browser-control-contract.d.ts +12 -0
- package/dist/agent-runtime/browser-control-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-discovery.d.ts +25 -0
- package/dist/agent-runtime/coding-discovery.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-automaton.d.ts +37 -0
- package/dist/agent-runtime/coding-search-automaton.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-case-fold.d.ts +4 -0
- package/dist/agent-runtime/coding-search-case-fold.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-class-ranges.d.ts +10 -0
- package/dist/agent-runtime/coding-search-class-ranges.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-contract.d.ts +86 -0
- package/dist/agent-runtime/coding-search-contract.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-limits.d.ts +13 -0
- package/dist/agent-runtime/coding-search-limits.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-matcher.d.ts +33 -0
- package/dist/agent-runtime/coding-search-matcher.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-output.d.ts +5 -0
- package/dist/agent-runtime/coding-search-output.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-regex-syntax.d.ts +39 -0
- package/dist/agent-runtime/coding-search-regex-syntax.d.ts.map +1 -0
- package/dist/agent-runtime/coding-search-unit-classes.d.ts +31 -0
- package/dist/agent-runtime/coding-search-unit-classes.d.ts.map +1 -0
- package/dist/agent-runtime/coding-shell-process.d.ts +1 -0
- package/dist/agent-runtime/coding-shell-process.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-contract.d.ts +8 -3
- package/dist/agent-runtime/coding-tool-contract.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-files.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-listing.d.ts +1 -11
- package/dist/agent-runtime/coding-tool-listing.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-paths.d.ts +6 -2
- package/dist/agent-runtime/coding-tool-paths.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-refusals.d.ts +6 -0
- package/dist/agent-runtime/coding-tool-refusals.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-search-patch.d.ts.map +1 -1
- package/dist/agent-runtime/coding-tool-search.d.ts +113 -0
- package/dist/agent-runtime/coding-tool-search.d.ts.map +1 -0
- package/dist/agent-runtime/coding-tool-shell.d.ts.map +1 -1
- package/dist/agent-runtime/contained-scan-budget.d.ts +32 -0
- package/dist/agent-runtime/contained-scan-budget.d.ts.map +1 -0
- package/dist/agent-runtime/contained-scan-contract.d.ts +52 -0
- package/dist/agent-runtime/contained-scan-contract.d.ts.map +1 -0
- package/dist/agent-runtime/contained-scan.d.ts +48 -13
- package/dist/agent-runtime/contained-scan.d.ts.map +1 -1
- package/dist/agent-runtime/control-schema.d.ts +27 -4
- package/dist/agent-runtime/control-schema.d.ts.map +1 -1
- package/dist/agent-runtime/event-schema.d.ts +33 -0
- package/dist/agent-runtime/event-schema.d.ts.map +1 -1
- package/dist/agent-runtime/run-acquisition.d.ts.map +1 -1
- package/dist/agent-runtime/run-execution-state.d.ts +6 -0
- package/dist/agent-runtime/run-execution-state.d.ts.map +1 -1
- package/dist/agent-runtime/run-model-attempts.d.ts.map +1 -1
- package/dist/agent-runtime/run-stream-parts.d.ts +11 -0
- package/dist/agent-runtime/run-stream-parts.d.ts.map +1 -1
- package/dist/agent-runtime/sandbox.d.ts +5 -1
- package/dist/agent-runtime/sandbox.d.ts.map +1 -1
- package/dist/agent-runtime/tool-progress.d.ts +21 -0
- package/dist/agent-runtime/tool-progress.d.ts.map +1 -0
- package/dist/agent-runtime/workspace-glob.d.ts +6 -0
- package/dist/agent-runtime/workspace-glob.d.ts.map +1 -0
- package/dist/entrypoints/agent-runtime/browser.js +7 -3
- package/dist/entrypoints/agent-runtime/coding-tools.js +7 -7
- package/dist/entrypoints/agent-runtime/harness.js +8 -8
- package/dist/entrypoints/agent-runtime/realtime.js +5 -5
- package/dist/entrypoints/agent-runtime/sandbox.js +7 -7
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +9 -9
- package/dist/entrypoints/agent-runtime/sqlite/node.js +9 -9
- package/dist/entrypoints/agent-runtime/testing.js +9 -9
- package/dist/entrypoints/agent-runtime.d.ts +1 -1
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime.js +15 -13
- package/dist/entrypoints/application/diagnostic-journal.js +3 -3
- package/dist/entrypoints/application/directory-inbox.js +5 -5
- package/dist/entrypoints/cli/publish.js +4 -4
- package/dist/entrypoints/cli.js +4 -4
- package/dist/entrypoints/files.js +4 -4
- package/dist/entrypoints/process/owner-loss.js +2 -1
- package/dist/entrypoints/process.js +4 -4
- package/dist/entrypoints/server.d.ts +1 -0
- package/dist/entrypoints/server.d.ts.map +1 -1
- package/dist/entrypoints/server.js +112 -47
- package/dist/entrypoints/telegram.js +3 -3
- package/dist/entrypoints/tools/agent.js +1 -1
- package/dist/entrypoints/tools/toolkit.js +5 -5
- package/dist/{index-yb9n4pgj.js → index-10rg78vf.js} +1 -1
- package/dist/{index-7zwtbak8.js → index-1fyea34p.js} +9 -4
- package/dist/{index-3yb5kft5.js → index-4tyt1qya.js} +1 -1
- package/dist/{index-8xyf8h2k.js → index-6j15ktag.js} +1 -1
- package/dist/{index-zrdcmg6j.js → index-72xtvcvr.js} +40 -6
- package/dist/{index-4qnzda76.js → index-7qyv50r4.js} +1 -1
- package/dist/{index-qctbzmg9.js → index-am1h8c9v.js} +69 -27
- package/dist/{index-e452syyh.js → index-aqmadanx.js} +2 -2
- package/dist/{index-yt7gyg5x.js → index-b51tzcgh.js} +1 -1
- package/dist/{index-aw6zahv1.js → index-dqpesdck.js} +2 -2
- package/dist/{index-1jwsfkfz.js → index-eeahxwvg.js} +60 -76
- package/dist/{index-sb9dr3tq.js → index-eh71zr32.js} +4 -4
- package/dist/{index-nyyam9ce.js → index-f6pw75e1.js} +1 -1
- package/dist/{index-qevqn3d3.js → index-gq3fnq3f.js} +1 -1
- package/dist/{index-bz479f0x.js → index-gtx3eknx.js} +1 -1
- package/dist/{index-mnkk1ffz.js → index-hs76yzt7.js} +13 -1
- package/dist/{index-nn9qvkww.js → index-j95jp7ee.js} +45 -9
- package/dist/{index-2kbysk9s.js → index-m5m9rmvt.js} +2 -0
- package/dist/{index-r3db01kh.js → index-nwm3ww60.js} +1 -1
- package/dist/index-qaqxdbxf.js +2857 -0
- package/dist/index-s9a0fjh3.js +305 -0
- package/dist/{index-b0w7rbpt.js → index-t05a2ry4.js} +39 -3
- package/dist/{index-pq2m7t46.js → index-v8yqk4w7.js} +22 -8
- package/dist/internal/contained-directory.d.ts +1 -1
- package/dist/internal/contained-directory.d.ts.map +1 -1
- package/dist/internal/contained-files.d.ts +18 -51
- package/dist/internal/contained-files.d.ts.map +1 -1
- package/dist/internal/contained-read.d.ts +17 -0
- package/dist/internal/contained-read.d.ts.map +1 -0
- package/dist/internal/darwin-binding.d.ts +3 -1
- package/dist/internal/darwin-binding.d.ts.map +1 -1
- package/dist/process/bun-child.d.ts.map +1 -1
- package/dist/process/command-owner.d.ts.map +1 -1
- package/dist/process/group.d.ts +2 -0
- package/dist/process/group.d.ts.map +1 -1
- package/dist/process/launch.d.ts +1 -0
- package/dist/process/launch.d.ts.map +1 -1
- package/dist/process/owned-child.d.ts.map +1 -1
- package/dist/process/owner-loss-guard.d.ts.map +1 -1
- package/dist/process/owner-loss-protocol.d.ts +1 -0
- package/dist/process/owner-loss-protocol.d.ts.map +1 -1
- package/dist/server/openapi-security.d.ts +73 -0
- package/dist/server/openapi-security.d.ts.map +1 -0
- package/dist/server/openapi.d.ts +12 -0
- package/dist/server/openapi.d.ts.map +1 -1
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/format.d.ts +11 -2
- package/dist/tools/cli/format.d.ts.map +1 -1
- package/dist/tools/cli/repeatable-read.d.ts +9 -0
- package/dist/tools/cli/repeatable-read.d.ts.map +1 -0
- package/dist/tools/cli/run-managed.d.ts.map +1 -1
- package/dist/tools/cli/run-native.d.ts.map +1 -1
- package/dist/tools/runtime-call-context.d.ts +15 -0
- package/dist/tools/runtime-call-context.d.ts.map +1 -0
- package/llms/agent-runtime-browser.txt +4 -1
- package/llms/agent-runtime-coding-tools.txt +9 -9
- package/llms/agent-runtime.2.txt +30 -108
- package/llms/agent-runtime.3.txt +111 -1
- package/llms/agent-runtime.txt +59 -24
- package/llms/application.3.txt +5 -2
- package/llms/cli.txt +21 -9
- package/llms/contract.txt +1 -1
- package/llms/process.txt +3 -1
- package/llms/server.2.txt +48 -0
- package/llms/server.5.txt +4 -0
- package/llms/stitchkit.txt +3 -3
- package/llms/tools.txt +4 -1
- package/llms/{upgrading-0.106.0-0.120.0.txt → upgrading-0.106.0-0.122.0.txt} +81 -3
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +255 -35
- package/llms.txt +7 -7
- package/native/darwin-arm64.node +0 -0
- package/native/darwin-x64.node +0 -0
- package/native-assets.json +4 -4
- package/package.json +2 -1
- package/dist/index-0qyrcjfs.js +0 -1478
- package/dist/index-aa50qwv4.js +0 -107
- package/dist/tools/durability-context.d.ts +0 -7
- package/dist/tools/durability-context.d.ts.map +0 -1
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import {
|
|
2
|
+
openDirectoryAt,
|
|
3
|
+
openPinnedDirectory,
|
|
4
|
+
openFileAt,
|
|
5
|
+
listAt
|
|
6
|
+
} from "./index-eeahxwvg.js";
|
|
7
|
+
import {
|
|
8
|
+
errnoOf
|
|
9
|
+
} from "./index-jj9228tt.js";
|
|
10
|
+
import {
|
|
11
|
+
raceAbort
|
|
12
|
+
} from "./index-b0kddvzw.js";
|
|
13
|
+
|
|
14
|
+
// src/agent-runtime/contained-scan-budget.ts
|
|
15
|
+
class ScanStopped extends Error {
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
class ContainedScanBudget {
|
|
19
|
+
limits;
|
|
20
|
+
reasons = new Set;
|
|
21
|
+
visitedDirectories = 0;
|
|
22
|
+
visitedEntries = 0;
|
|
23
|
+
readBytes = 0;
|
|
24
|
+
constructor(limits = {}) {
|
|
25
|
+
this.limits = limits;
|
|
26
|
+
}
|
|
27
|
+
stop(reason) {
|
|
28
|
+
this.reasons.add(reason);
|
|
29
|
+
throw new ScanStopped(reason);
|
|
30
|
+
}
|
|
31
|
+
check() {
|
|
32
|
+
if (this.limits.deadline !== undefined && performance.now() >= this.limits.deadline)
|
|
33
|
+
this.stop("timeout");
|
|
34
|
+
if (this.limits.signal?.aborted)
|
|
35
|
+
this.stop("cancelled");
|
|
36
|
+
}
|
|
37
|
+
async wait(operation, disposeLate) {
|
|
38
|
+
this.check();
|
|
39
|
+
try {
|
|
40
|
+
const pending = operation();
|
|
41
|
+
const value = this.limits.signal ? await raceAbort(pending, this.limits.signal, disposeLate) : await pending;
|
|
42
|
+
return value;
|
|
43
|
+
} catch (error) {
|
|
44
|
+
this.check();
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
directory() {
|
|
49
|
+
this.check();
|
|
50
|
+
if (this.visitedDirectories >= (this.limits.maxDirectories ?? Infinity))
|
|
51
|
+
this.stop("max-directories");
|
|
52
|
+
this.visitedDirectories += 1;
|
|
53
|
+
}
|
|
54
|
+
remainingEntries() {
|
|
55
|
+
this.check();
|
|
56
|
+
const max = this.limits.maxEntries;
|
|
57
|
+
if (max === undefined)
|
|
58
|
+
return;
|
|
59
|
+
if (this.visitedEntries >= max)
|
|
60
|
+
this.stop("max-entries");
|
|
61
|
+
return max - this.visitedEntries;
|
|
62
|
+
}
|
|
63
|
+
entry() {
|
|
64
|
+
this.remainingEntries();
|
|
65
|
+
this.visitedEntries += 1;
|
|
66
|
+
}
|
|
67
|
+
readAllowance(maxFileBytes) {
|
|
68
|
+
this.check();
|
|
69
|
+
const remaining = (this.limits.maxBytes ?? Infinity) - this.readBytes;
|
|
70
|
+
if (remaining <= 0)
|
|
71
|
+
this.stop("max-bytes");
|
|
72
|
+
return Math.min(maxFileBytes, remaining);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// src/agent-runtime/contained-scan.ts
|
|
77
|
+
import path from "node:path";
|
|
78
|
+
|
|
79
|
+
// src/internal/contained-read.ts
|
|
80
|
+
async function readContainedUtf8Handle(handle, maxBytes, progress) {
|
|
81
|
+
progress?.check();
|
|
82
|
+
const metadata = progress ? await progress.wait(() => handle.stat()) : await handle.stat();
|
|
83
|
+
progress?.check();
|
|
84
|
+
if (!metadata.isFile())
|
|
85
|
+
throw new Error("Contained path is not a regular file");
|
|
86
|
+
if (metadata.size > maxBytes) {
|
|
87
|
+
const error = new Error("Contained file exceeds byte budget");
|
|
88
|
+
Object.assign(error, { code: "FILE_TOO_LARGE" });
|
|
89
|
+
throw error;
|
|
90
|
+
}
|
|
91
|
+
const buffer = Buffer.alloc(metadata.size);
|
|
92
|
+
let offset = 0;
|
|
93
|
+
while (offset < buffer.byteLength) {
|
|
94
|
+
progress?.check();
|
|
95
|
+
const read = () => handle.read(buffer, offset, Math.min(16384, buffer.byteLength - offset), offset).then((result) => {
|
|
96
|
+
progress?.readBytes(result.bytesRead);
|
|
97
|
+
return result;
|
|
98
|
+
});
|
|
99
|
+
const { bytesRead } = progress ? await progress.wait(read) : await read();
|
|
100
|
+
if (bytesRead === 0)
|
|
101
|
+
break;
|
|
102
|
+
offset += bytesRead;
|
|
103
|
+
}
|
|
104
|
+
if (offset !== metadata.size)
|
|
105
|
+
throw new Error("Contained file changed while being read");
|
|
106
|
+
return {
|
|
107
|
+
text: new TextDecoder("utf-8", { fatal: true }).decode(buffer),
|
|
108
|
+
bytes: offset,
|
|
109
|
+
mode: metadata.mode
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// src/agent-runtime/contained-scan.ts
|
|
114
|
+
async function walkContainedFiles(input) {
|
|
115
|
+
const scan = await scanContainedFiles({ ...input, symlinks: "refuse" });
|
|
116
|
+
if (scan.truncated)
|
|
117
|
+
throw new Error("Contained file traversal exceeded its bounds");
|
|
118
|
+
return scan.files;
|
|
119
|
+
}
|
|
120
|
+
async function scanContainedFiles(input, io = { openRoot: openPinnedDirectory, list: listAt }) {
|
|
121
|
+
const budget = input.budget ?? new ContainedScanBudget;
|
|
122
|
+
const files = [];
|
|
123
|
+
const denied = [];
|
|
124
|
+
const errors = [];
|
|
125
|
+
let deniedTruncated = false;
|
|
126
|
+
let errorsTruncated = false;
|
|
127
|
+
let skippedDirectories = 0;
|
|
128
|
+
let skippedSymlinks = 0;
|
|
129
|
+
let scannedFiles = 0;
|
|
130
|
+
let stopped = false;
|
|
131
|
+
const disposeLate = (handle) => {
|
|
132
|
+
handle.close().catch(() => {
|
|
133
|
+
return;
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
const report = (error, relative, operation) => {
|
|
137
|
+
if (error instanceof ScanStopped || !input.skipUnreadable)
|
|
138
|
+
throw error;
|
|
139
|
+
budget.reasons.add("unreadable");
|
|
140
|
+
if (errors.length < (input.maxDiagnostics ?? input.maxFiles)) {
|
|
141
|
+
const code = errnoOf(error);
|
|
142
|
+
errors.push({
|
|
143
|
+
path: relative,
|
|
144
|
+
operation,
|
|
145
|
+
code: code && /^[A-Z][A-Z0-9_]{0,40}$/.test(code) ? code : "READ_FAILED"
|
|
146
|
+
});
|
|
147
|
+
} else
|
|
148
|
+
errorsTruncated = true;
|
|
149
|
+
};
|
|
150
|
+
const readFile = async (directory, name) => {
|
|
151
|
+
const maximum = input.readMaxBytes;
|
|
152
|
+
if (maximum === undefined)
|
|
153
|
+
return;
|
|
154
|
+
const allowance = budget.readAllowance(maximum);
|
|
155
|
+
const handle = await budget.wait(() => openFileAt(directory, name), disposeLate);
|
|
156
|
+
try {
|
|
157
|
+
return await readContainedUtf8Handle(handle, allowance, {
|
|
158
|
+
check: () => budget.check(),
|
|
159
|
+
readBytes: (bytes) => {
|
|
160
|
+
budget.readBytes += bytes;
|
|
161
|
+
},
|
|
162
|
+
wait: (operation) => budget.wait(operation)
|
|
163
|
+
});
|
|
164
|
+
} catch (error) {
|
|
165
|
+
if (errnoOf(error) === "FILE_TOO_LARGE") {
|
|
166
|
+
if (allowance < maximum)
|
|
167
|
+
budget.stop("max-bytes");
|
|
168
|
+
budget.reasons.add("max-file-bytes");
|
|
169
|
+
}
|
|
170
|
+
throw error;
|
|
171
|
+
} finally {
|
|
172
|
+
await handle.close();
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
const visitEntry = async (directory, entry, relativeDirectory, depth) => {
|
|
176
|
+
budget.check();
|
|
177
|
+
const relative = relativeDirectory ? path.join(relativeDirectory, entry.name) : entry.name;
|
|
178
|
+
const kind = entry.isDirectory() ? "directory" : entry.isSymbolicLink() ? "symlink" : entry.isFile() ? "file" : "other";
|
|
179
|
+
if (kind === "file" && input.includeFile && !input.includeFile(relative))
|
|
180
|
+
return;
|
|
181
|
+
if (kind === "directory" && input.excludeDirectory?.(relative)) {
|
|
182
|
+
skippedDirectories += 1;
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (input.authorizePath && !await budget.wait(async () => input.authorizePath?.(relative, kind))) {
|
|
186
|
+
budget.reasons.add("denied");
|
|
187
|
+
if (denied.length < (input.maxDiagnostics ?? input.maxFiles))
|
|
188
|
+
denied.push({ relative, kind });
|
|
189
|
+
else
|
|
190
|
+
deniedTruncated = true;
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
budget.check();
|
|
194
|
+
if (input.visitEntry && !await input.visitEntry(directory, { name: entry.name, kind }, relative))
|
|
195
|
+
return;
|
|
196
|
+
if (kind === "symlink") {
|
|
197
|
+
if (input.symlinks === "refuse")
|
|
198
|
+
throw new Error(`Contained file traversal refuses symlink: ${relative}`);
|
|
199
|
+
skippedSymlinks += 1;
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
if (kind === "directory") {
|
|
203
|
+
if (depth >= input.maxDepth) {
|
|
204
|
+
budget.reasons.add("max-depth");
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
budget.directory();
|
|
208
|
+
let child;
|
|
209
|
+
try {
|
|
210
|
+
child = await budget.wait(() => openDirectoryAt(directory, entry.name), disposeLate);
|
|
211
|
+
} catch (error) {
|
|
212
|
+
report(error, relative, "open-directory");
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
try {
|
|
216
|
+
await visit(child, relative, depth + 1);
|
|
217
|
+
} finally {
|
|
218
|
+
await child.close();
|
|
219
|
+
}
|
|
220
|
+
} else if (kind === "file") {
|
|
221
|
+
if (scannedFiles >= input.maxFiles)
|
|
222
|
+
budget.stop("max-files");
|
|
223
|
+
let content;
|
|
224
|
+
try {
|
|
225
|
+
content = await readFile(directory, entry.name);
|
|
226
|
+
} catch (error) {
|
|
227
|
+
report(error, relative, "read-file");
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
budget.check();
|
|
231
|
+
scannedFiles += 1;
|
|
232
|
+
const file = { absolute: relative, relative, ...content && { content } };
|
|
233
|
+
if (input.visitFile)
|
|
234
|
+
stopped = !await input.visitFile(file);
|
|
235
|
+
else
|
|
236
|
+
files.push(file);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
const visit = async (directory, relative, depth) => {
|
|
240
|
+
budget.check();
|
|
241
|
+
const remaining = budget.remainingEntries();
|
|
242
|
+
let countedEntries = 0;
|
|
243
|
+
let entries;
|
|
244
|
+
try {
|
|
245
|
+
entries = await budget.wait(() => io.list(directory, remaining, {
|
|
246
|
+
check: () => budget.check(),
|
|
247
|
+
entry: () => {
|
|
248
|
+
budget.visitedEntries += 1;
|
|
249
|
+
countedEntries += 1;
|
|
250
|
+
}
|
|
251
|
+
}));
|
|
252
|
+
} catch (error) {
|
|
253
|
+
report(error, relative || ".", "read-directory");
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
if (countedEntries === 0)
|
|
257
|
+
budget.visitedEntries += entries.length;
|
|
258
|
+
if (budget.limits.maxEntries !== undefined && budget.visitedEntries >= budget.limits.maxEntries)
|
|
259
|
+
budget.reasons.add("max-entries");
|
|
260
|
+
for (const entry of [...entries].sort((left, right) => left.name.localeCompare(right.name))) {
|
|
261
|
+
if (stopped)
|
|
262
|
+
break;
|
|
263
|
+
await visitEntry(directory, entry, relative, depth);
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
try {
|
|
267
|
+
let root;
|
|
268
|
+
if (typeof input.root === "string") {
|
|
269
|
+
budget.directory();
|
|
270
|
+
const rootPath = input.root;
|
|
271
|
+
try {
|
|
272
|
+
root = await budget.wait(() => io.openRoot(rootPath), disposeLate);
|
|
273
|
+
} catch (error) {
|
|
274
|
+
report(error, ".", "open-directory");
|
|
275
|
+
return result();
|
|
276
|
+
}
|
|
277
|
+
} else
|
|
278
|
+
root = input.root;
|
|
279
|
+
try {
|
|
280
|
+
await visit(root, input.basePath === "." ? "" : input.basePath ?? "", 0);
|
|
281
|
+
} finally {
|
|
282
|
+
if (typeof input.root === "string")
|
|
283
|
+
await root.close();
|
|
284
|
+
}
|
|
285
|
+
} catch (error) {
|
|
286
|
+
if (!(error instanceof ScanStopped))
|
|
287
|
+
throw error;
|
|
288
|
+
}
|
|
289
|
+
function result() {
|
|
290
|
+
return {
|
|
291
|
+
files,
|
|
292
|
+
truncated: budget.reasons.size > 0 || stopped,
|
|
293
|
+
scannedFiles,
|
|
294
|
+
skippedDirectories,
|
|
295
|
+
skippedSymlinks,
|
|
296
|
+
denied,
|
|
297
|
+
deniedTruncated,
|
|
298
|
+
errors,
|
|
299
|
+
errorsTruncated
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
return result();
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export { ScanStopped, ContainedScanBudget, readContainedUtf8Handle, walkContainedFiles, scanContainedFiles };
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./index-8kzct1d6.js";
|
|
5
5
|
import {
|
|
6
6
|
AgentRuntimeEventSchema2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-hs76yzt7.js";
|
|
8
8
|
|
|
9
9
|
// src/agent-runtime/control-schema.ts
|
|
10
10
|
import { z } from "zod";
|
|
@@ -154,6 +154,43 @@ function advanceAgentMultiSessionCursor2(raw, event) {
|
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
|
+
var EMPTY_TRANSIENT = { text: "", reasoning: "", tools: {} };
|
|
158
|
+
function nextRunTransient(transient, event) {
|
|
159
|
+
switch (event.type) {
|
|
160
|
+
case "assistant-delta":
|
|
161
|
+
return { ...transient, text: transient.text + event.textDelta };
|
|
162
|
+
case "reasoning-delta":
|
|
163
|
+
return { ...transient, reasoning: transient.reasoning + event.textDelta };
|
|
164
|
+
case "attempt-reset":
|
|
165
|
+
return EMPTY_TRANSIENT;
|
|
166
|
+
case "tool-progress": {
|
|
167
|
+
const { toolName, message, progress, total } = event;
|
|
168
|
+
return {
|
|
169
|
+
...transient,
|
|
170
|
+
tools: {
|
|
171
|
+
...transient.tools,
|
|
172
|
+
[event.callId]: {
|
|
173
|
+
toolName,
|
|
174
|
+
...message !== undefined && { message },
|
|
175
|
+
...progress !== undefined && { progress },
|
|
176
|
+
...total !== undefined && { total }
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
case "tool-status": {
|
|
182
|
+
if (event.status === "started" || !Object.hasOwn(transient.tools, event.callId)) {
|
|
183
|
+
return transient;
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
...transient,
|
|
187
|
+
tools: Object.fromEntries(Object.entries(transient.tools).filter(([callId]) => callId !== event.callId))
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
default:
|
|
191
|
+
return transient;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
157
194
|
function createAgentControlView2() {
|
|
158
195
|
return { cursor: { conversations: {} }, conversations: {} };
|
|
159
196
|
}
|
|
@@ -199,8 +236,7 @@ function reduceAgentControlEvent2(view, rawEvent) {
|
|
|
199
236
|
}
|
|
200
237
|
};
|
|
201
238
|
}
|
|
202
|
-
const
|
|
203
|
-
const nextTransient = event.type === "assistant-delta" ? { ...transient, text: transient.text + event.textDelta } : event.type === "reasoning-delta" ? { ...transient, reasoning: transient.reasoning + event.textDelta } : event.type === "attempt-reset" ? { text: "", reasoning: "" } : transient;
|
|
239
|
+
const nextTransient = nextRunTransient(current.transientByRun[event.runId] ?? EMPTY_TRANSIENT, event);
|
|
204
240
|
const snapshotStale = durable(event) && current.snapshot?.version !== event.snapshotVersion;
|
|
205
241
|
const transientByRun = event.type === "terminal" ? Object.fromEntries(Object.entries(current.transientByRun).filter(([runId]) => runId !== event.runId)) : { ...current.transientByRun, [event.runId]: nextTransient };
|
|
206
242
|
return {
|
|
@@ -25,12 +25,12 @@ import {
|
|
|
25
25
|
} from "./index-ycqhyars.js";
|
|
26
26
|
import {
|
|
27
27
|
writeContainedFile
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-aqmadanx.js";
|
|
29
29
|
import {
|
|
30
30
|
openPinnedDirectory,
|
|
31
31
|
isSafeEntryName,
|
|
32
32
|
containedEntryMetadata
|
|
33
|
-
} from "./index-
|
|
33
|
+
} from "./index-eeahxwvg.js";
|
|
34
34
|
import {
|
|
35
35
|
pollUntil
|
|
36
36
|
} from "./index-bph35vpy.js";
|
|
@@ -185,8 +185,16 @@ function emitResult2(result, writers, opts) {
|
|
|
185
185
|
`);
|
|
186
186
|
return cliExitCode2(result, opts.exitCodes);
|
|
187
187
|
}
|
|
188
|
+
function presentationFailureHint(repeatable, printed) {
|
|
189
|
+
if (repeatable) {
|
|
190
|
+
return "The result was not printed: this command only reads. Repeat it with a corrected view.";
|
|
191
|
+
}
|
|
192
|
+
return printed ? "The complete, unformatted result is on stdout. Do not repeat the command to recover its result." : "The command returned no result. Do not repeat it.";
|
|
193
|
+
}
|
|
188
194
|
function emitPresentationFailure(result, failure, writers, opts) {
|
|
189
|
-
|
|
195
|
+
const printed = !opts.repeatable && result.data !== undefined;
|
|
196
|
+
if (printed)
|
|
197
|
+
emitResult2(result, writers, opts);
|
|
190
198
|
return emitResult2({
|
|
191
199
|
ok: false,
|
|
192
200
|
code: "CLI_PRESENTATION_FAILED",
|
|
@@ -195,9 +203,10 @@ function emitPresentationFailure(result, failure, writers, opts) {
|
|
|
195
203
|
message: "The command completed successfully, but its result presentation failed.",
|
|
196
204
|
command: opts.toolName,
|
|
197
205
|
operationSucceeded: true,
|
|
206
|
+
resultOnStdout: printed,
|
|
198
207
|
cause: formatToolError(failure)
|
|
199
208
|
},
|
|
200
|
-
hint:
|
|
209
|
+
hint: presentationFailureHint(opts.repeatable, printed)
|
|
201
210
|
}, writers, { json: opts.json, toolName: opts.toolName, exitCodes: opts.exitCodes });
|
|
202
211
|
}
|
|
203
212
|
|
|
@@ -1773,6 +1782,11 @@ async function prepareInvocation(command, commandArgv, descriptor, config, readS
|
|
|
1773
1782
|
return { ok: true, toolArgs, options };
|
|
1774
1783
|
}
|
|
1775
1784
|
|
|
1785
|
+
// src/tools/cli/repeatable-read.ts
|
|
1786
|
+
function isRepeatableRead(operation) {
|
|
1787
|
+
return operation.annotations?.readOnlyHint ?? operation.method === "GET";
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1776
1790
|
// src/tools/cli/session.ts
|
|
1777
1791
|
function nativeDescriptor(definition) {
|
|
1778
1792
|
return {
|
|
@@ -2225,7 +2239,7 @@ async function runManagedCommand(session, route, command, managed) {
|
|
|
2225
2239
|
toolArgs,
|
|
2226
2240
|
options
|
|
2227
2241
|
});
|
|
2228
|
-
return emitManagedResult(session, command, result, options);
|
|
2242
|
+
return emitManagedResult(session, command, result, options, isRepeatableRead(tool.method));
|
|
2229
2243
|
}
|
|
2230
2244
|
async function executeManagedTool(session, route, command, managed, tool, { toolArgs, options }) {
|
|
2231
2245
|
const { config } = session;
|
|
@@ -2271,7 +2285,7 @@ async function executeManagedTool(session, route, command, managed, tool, { tool
|
|
|
2271
2285
|
}
|
|
2272
2286
|
return result;
|
|
2273
2287
|
}
|
|
2274
|
-
async function emitManagedResult(session, command, initial, options) {
|
|
2288
|
+
async function emitManagedResult(session, command, initial, options, repeatable) {
|
|
2275
2289
|
const { config } = session;
|
|
2276
2290
|
const { stdout, stderr, exit } = session.io;
|
|
2277
2291
|
let result = initial;
|
|
@@ -2289,7 +2303,7 @@ async function emitManagedResult(session, command, initial, options) {
|
|
|
2289
2303
|
code: "BAD_REQUEST",
|
|
2290
2304
|
details: { message: error.message }
|
|
2291
2305
|
} : toolResultFromError(error);
|
|
2292
|
-
return exit(emitPresentationFailure(result, failure, { stdout, stderr }, emitOptionsFor(config, options.json, command)));
|
|
2306
|
+
return exit(emitPresentationFailure(result, failure, { stdout, stderr }, { ...emitOptionsFor(config, options.json, command), repeatable }));
|
|
2293
2307
|
}
|
|
2294
2308
|
if (viewed.kind === "text") {
|
|
2295
2309
|
stdout(viewed.text);
|
|
@@ -2352,7 +2366,7 @@ async function runNativeCommand2(session, route, command, native) {
|
|
|
2352
2366
|
const result = await executeCliCommand(native, toolArgs, options, { stdout, stderr }, config.coerceJsonArgs ?? true, globals);
|
|
2353
2367
|
const emission = prepareCliCommandEmission(native, result, options);
|
|
2354
2368
|
if (emission.result.ok && emission.presentationFailure !== undefined) {
|
|
2355
|
-
return exit(emitPresentationFailure(emission.result, emission.presentationFailure, { stdout, stderr }, emitOptionsFor(config, options.json, command)));
|
|
2369
|
+
return exit(emitPresentationFailure(emission.result, emission.presentationFailure, { stdout, stderr }, { ...emitOptionsFor(config, options.json, command), repeatable: false }));
|
|
2356
2370
|
}
|
|
2357
2371
|
let emittedExitCode;
|
|
2358
2372
|
if (emission.result.ok && emission.presentation !== undefined) {
|
|
@@ -11,7 +11,7 @@ export declare function createDirectoryAt(directory: ContainedFileHandle, name:
|
|
|
11
11
|
* selection cannot redirect the walk. Missing descendants are created through the same
|
|
12
12
|
* pinned parents. The returned capability remains the selected directory if it is renamed.
|
|
13
13
|
*/
|
|
14
|
-
export declare function openPinnedDirectory(absolute: string, options?: {
|
|
14
|
+
export declare function openPinnedDirectory(absolute: string | ContainedFileHandle, options?: {
|
|
15
15
|
create?: boolean;
|
|
16
16
|
readable?: boolean;
|
|
17
17
|
}, io?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contained-directory.d.ts","sourceRoot":"","sources":["../../src/internal/contained-directory.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,oBAAoB,CAAC;AAkB5B,kEAAkE;AAClE,wBAAsB,eAAe,CACnC,SAAS,EAAE,mBAAmB,EAC9B,IAAI,EAAE,MAAM,EACZ,UAAU,UAAQ,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAO9B;AAED,6FAA6F;AAC7F,wBAAsB,OAAO,CAC3B,OAAO,EAAE,mBAAmB,EAC5B,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAQ9B;AAED,wFAAwF;AACxF,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,mBAAmB,EAC9B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAWlB;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"contained-directory.d.ts","sourceRoot":"","sources":["../../src/internal/contained-directory.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,mBAAmB,EAGzB,MAAM,oBAAoB,CAAC;AAkB5B,kEAAkE;AAClE,wBAAsB,eAAe,CACnC,SAAS,EAAE,mBAAmB,EAC9B,IAAI,EAAE,MAAM,EACZ,UAAU,UAAQ,GACjB,OAAO,CAAC,mBAAmB,CAAC,CAO9B;AAED,6FAA6F;AAC7F,wBAAsB,OAAO,CAC3B,OAAO,EAAE,mBAAmB,EAC5B,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAQ9B;AAED,wFAAwF;AACxF,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,mBAAmB,EAC9B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,OAAO,CAAC,CAWlB;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,GAAG,mBAAmB,EACtC,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,EACtD,EAAE,GAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;CAAiB,GAC7D,OAAO,CAAC,mBAAmB,CAAC,CAoD9B"}
|
|
@@ -8,24 +8,6 @@ export interface ContainedFile {
|
|
|
8
8
|
mode: number;
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
export interface ContainedFileScan {
|
|
12
|
-
files: readonly ContainedFile[];
|
|
13
|
-
truncated: boolean;
|
|
14
|
-
skippedDirectories: number;
|
|
15
|
-
skippedSymlinks: number;
|
|
16
|
-
/**
|
|
17
|
-
* Entries the host's `authorizePath` rejected while walking. A denied path
|
|
18
|
-
* used to disappear from every listing exactly like an absent one; naming
|
|
19
|
-
* them is what lets a caller tell "the host refused this" from "there is
|
|
20
|
-
* nothing here". Only the name and kind are carried — never content.
|
|
21
|
-
*/
|
|
22
|
-
denied: readonly {
|
|
23
|
-
relative: string;
|
|
24
|
-
kind: ContainedEntryKind;
|
|
25
|
-
}[];
|
|
26
|
-
/** The `denied` list hit its cap; there are more refusals than named. */
|
|
27
|
-
deniedTruncated: boolean;
|
|
28
|
-
}
|
|
29
11
|
export type ContainedEntryKind = 'file' | 'directory' | 'symlink' | 'other';
|
|
30
12
|
/** One entry name a directory-relative call may receive: never a walk and never truncated by NUL. */
|
|
31
13
|
export declare function isSafeEntryName(name: string): boolean;
|
|
@@ -44,22 +26,12 @@ interface ContainedDirectoryEntry {
|
|
|
44
26
|
isFile(): boolean;
|
|
45
27
|
isSymbolicLink(): boolean;
|
|
46
28
|
}
|
|
47
|
-
export declare function listAt(directory: ContainedFileHandle
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
bytes?: number;
|
|
54
|
-
}[];
|
|
55
|
-
truncated: boolean;
|
|
56
|
-
/** Direct children the host's policy refused, capped at `maxEntries`. */
|
|
57
|
-
denied: {
|
|
58
|
-
name: string;
|
|
59
|
-
kind: ContainedEntryKind;
|
|
60
|
-
}[];
|
|
61
|
-
deniedTruncated: boolean;
|
|
62
|
-
}>;
|
|
29
|
+
export declare function listAt(directory: ContainedFileHandle, maxEntries?: number, progress?: {
|
|
30
|
+
check(): void;
|
|
31
|
+
entry(): void;
|
|
32
|
+
}): Promise<readonly ContainedDirectoryEntry[]>;
|
|
33
|
+
/** One descendant directory opened from the request's selected root. */
|
|
34
|
+
export declare function openContainedDirectory(root: string | ContainedFileHandle, relative: string, beforeOpen?: () => void): Promise<ContainedFileHandle>;
|
|
63
35
|
export interface ContainedParent {
|
|
64
36
|
handle: ContainedFileHandle;
|
|
65
37
|
basename: string;
|
|
@@ -70,7 +42,7 @@ export interface ContainedParent {
|
|
|
70
42
|
* Read-only on purpose: the caller authorizes the mutation before any of it
|
|
71
43
|
* happens, and cannot do that without knowing what would be created.
|
|
72
44
|
*/
|
|
73
|
-
export declare function missingContainedDirectories(root: string, relative: string): Promise<string[]>;
|
|
45
|
+
export declare function missingContainedDirectories(root: string | ContainedFileHandle, relative: string): Promise<string[]>;
|
|
74
46
|
/**
|
|
75
47
|
* The first segment of `relative` that opens an entry stored under another spelling.
|
|
76
48
|
*
|
|
@@ -80,36 +52,31 @@ export declare function missingContainedDirectories(root: string, relative: stri
|
|
|
80
52
|
* because two distinct entries may exist on a volume that does not fold. A missing
|
|
81
53
|
* segment is not misspelled; the caller reports it.
|
|
82
54
|
*/
|
|
83
|
-
export declare function misspelledContainedSegment(root: string, relative: string
|
|
55
|
+
export declare function misspelledContainedSegment(root: string | ContainedFileHandle, relative: string, progress?: {
|
|
56
|
+
check(): void;
|
|
57
|
+
directory(): void;
|
|
58
|
+
entry(): void;
|
|
59
|
+
remainingEntries(): number | undefined;
|
|
60
|
+
wait<T>(operation: () => Promise<T>, disposeLate?: (value: T) => void): Promise<T>;
|
|
61
|
+
}): Promise<string | undefined>;
|
|
84
62
|
/** A directory vanished after the host approved a different creation plan. */
|
|
85
63
|
export declare class UnapprovedContainedDirectoryError extends Error {
|
|
86
64
|
readonly relative: string;
|
|
87
65
|
constructor(relative: string);
|
|
88
66
|
}
|
|
89
|
-
export declare function openContainedParent(root: string, relative: string, options?: {
|
|
67
|
+
export declare function openContainedParent(root: string | ContainedFileHandle, relative: string, options?: {
|
|
90
68
|
createDirectories?: readonly string[];
|
|
91
69
|
}): Promise<ContainedParent>;
|
|
92
70
|
/** Open a final regular-file candidate through pinned ancestors without following symlinks. */
|
|
93
|
-
export declare function openContainedFile(root: string, relative: string): Promise<ContainedFileHandle>;
|
|
71
|
+
export declare function openContainedFile(root: string | ContainedFileHandle, relative: string): Promise<ContainedFileHandle>;
|
|
94
72
|
/** What was checked is no longer what the path names; the caller can look again. */
|
|
95
73
|
export declare class ContainedPathChangedError extends Error {
|
|
96
74
|
readonly relative: string;
|
|
97
75
|
constructor(relative: string);
|
|
98
76
|
}
|
|
99
|
-
export declare function assertContainedFileCurrent(root: string, relative: string, expected: ContainedFileHandle): Promise<void>;
|
|
100
|
-
export declare function assertContainedParentCurrent(root: string, relative: string, expected: ContainedFileHandle): Promise<void>;
|
|
77
|
+
export declare function assertContainedFileCurrent(root: string | ContainedFileHandle, relative: string, expected: ContainedFileHandle): Promise<void>;
|
|
78
|
+
export declare function assertContainedParentCurrent(root: string | ContainedFileHandle, relative: string, expected: ContainedFileHandle): Promise<void>;
|
|
101
79
|
export declare function containedEntryMetadata(parent: ContainedParent): Promise<ContainedEntryMetadata | null>;
|
|
102
80
|
export declare function openContainedParentFile(parent: ContainedParent): Promise<ContainedFileHandle>;
|
|
103
|
-
export declare function readContainedUtf8Handle(handle: ContainedFileHandle, maxBytes: number): Promise<{
|
|
104
|
-
text: string;
|
|
105
|
-
bytes: number;
|
|
106
|
-
mode: number;
|
|
107
|
-
}>;
|
|
108
|
-
/** Open the final path without following any mutable ancestor or replacement symlink. */
|
|
109
|
-
export declare function readContainedUtf8File(root: string, relative: string, maxBytes: number): Promise<{
|
|
110
|
-
text: string;
|
|
111
|
-
bytes: number;
|
|
112
|
-
mode: number;
|
|
113
|
-
}>;
|
|
114
81
|
export {};
|
|
115
82
|
//# sourceMappingURL=contained-files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contained-files.d.ts","sourceRoot":"","sources":["../../src/internal/contained-files.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,mBAAmB,EAOzB,MAAM,oBAAoB,CAAC;AAI5B,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;CACzD;AAED,MAAM,
|
|
1
|
+
{"version":3,"file":"contained-files.d.ts","sourceRoot":"","sources":["../../src/internal/contained-files.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,mBAAmB,EAOzB,MAAM,oBAAoB,CAAC;AAI5B,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,M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EAChB,QAAQ,EAAE,mBAAmB,GAC5B,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,MAAM,GAAG,mBAAmB,EAClC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,mBAAmB,GAC5B,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC,CAExC;AAED,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,mBAAmB,CAAC,CAO9B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ContainedFileHandle } from './contained-handle.js';
|
|
2
|
+
export declare function readContainedUtf8Handle(handle: ContainedFileHandle, maxBytes: number, progress?: {
|
|
3
|
+
check(): void;
|
|
4
|
+
readBytes(bytes: number): void;
|
|
5
|
+
wait<T>(operation: () => Promise<T>): Promise<T>;
|
|
6
|
+
}): Promise<{
|
|
7
|
+
text: string;
|
|
8
|
+
bytes: number;
|
|
9
|
+
mode: number;
|
|
10
|
+
}>;
|
|
11
|
+
/** Open the final path without following any mutable ancestor or replacement symlink. */
|
|
12
|
+
export declare function readContainedUtf8File(root: string | ContainedFileHandle, relative: string, maxBytes: number): Promise<{
|
|
13
|
+
text: string;
|
|
14
|
+
bytes: number;
|
|
15
|
+
mode: number;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=contained-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contained-read.d.ts","sourceRoot":"","sources":["../../src/internal/contained-read.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,mBAAmB,EAC3B,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE;IACT,KAAK,IAAI,IAAI,CAAC;IACd,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAClD,GACA,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CA+BxD;AAED,yFAAyF;AACzF,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,GAAG,mBAAmB,EAClC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAOxD"}
|
|
@@ -6,11 +6,13 @@ export interface DarwinEntry {
|
|
|
6
6
|
export interface DarwinBinding {
|
|
7
7
|
processIdentity(pid: number): unknown;
|
|
8
8
|
openDirectoryAt(directory: number, name: string, searchOnly: boolean): number;
|
|
9
|
+
reopenDirectory(directory: number, searchOnly: boolean): number;
|
|
10
|
+
changeDirectory(directory: number): void;
|
|
9
11
|
openFileAt(directory: number, name: string): number;
|
|
10
12
|
createFileAt(directory: number, name: string, mode: number): number;
|
|
11
13
|
createDirectoryAt(directory: number, name: string, mode: number): boolean;
|
|
12
14
|
statAt(directory: number, name: string): Omit<DarwinEntry, 'name'> | null;
|
|
13
|
-
listAt(directory: number): readonly DarwinEntry[];
|
|
15
|
+
listAt(directory: number, maxEntries?: number, progress?: (entry: boolean) => void): readonly DarwinEntry[];
|
|
14
16
|
renameAt(directory: number, source: string, target: string): void;
|
|
15
17
|
unlinkAt(directory: number, name: string): void;
|
|
16
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"darwin-binding.d.ts","sourceRoot":"","sources":["../../src/internal/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