toolcraft 0.0.882 → 0.0.883
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/composition.json +2 -2
- package/dist/composition.json +2 -2
- package/node_modules/@poe-code/safe-fs/dist/fs/object-publication/index.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/object-publication/index.js +7 -4
- package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
- package/node_modules/toolcraft-schema/package.json +1 -1
- package/package.json +2 -2
package/composition.json
CHANGED
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"name": "toolcraft",
|
|
141
|
-
"version": "0.0.
|
|
141
|
+
"version": "0.0.883",
|
|
142
142
|
"license": "MIT"
|
|
143
143
|
},
|
|
144
144
|
{
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
"name": "toolcraft-schema",
|
|
151
|
-
"version": "0.0.
|
|
151
|
+
"version": "0.0.883",
|
|
152
152
|
"license": "MIT"
|
|
153
153
|
},
|
|
154
154
|
{
|
package/dist/composition.json
CHANGED
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"name": "toolcraft",
|
|
141
|
-
"version": "0.0.
|
|
141
|
+
"version": "0.0.883",
|
|
142
142
|
"license": "MIT"
|
|
143
143
|
},
|
|
144
144
|
{
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
"name": "toolcraft-schema",
|
|
151
|
-
"version": "0.0.
|
|
151
|
+
"version": "0.0.883",
|
|
152
152
|
"license": "MIT"
|
|
153
153
|
},
|
|
154
154
|
{
|
|
@@ -20,6 +20,7 @@ export interface ObjectFileAcquireOptions extends FsOptions {
|
|
|
20
20
|
}
|
|
21
21
|
export interface ObjectFileStaging {
|
|
22
22
|
readPage(index: number, options?: FsOptions): Promise<Uint8Array | undefined>;
|
|
23
|
+
/** Own acknowledged bytes; the caller may reuse its buffer after settlement. */
|
|
23
24
|
writePage(index: number, bytes: Uint8Array, options?: FsOptions): Promise<void>;
|
|
24
25
|
truncate(size: number, options?: FsOptions): Promise<void>;
|
|
25
26
|
close(): Promise<void>;
|
|
@@ -296,13 +296,16 @@ export function withObjectFileDescriptors(filesystem, store, options = {}) {
|
|
|
296
296
|
const page = Math.floor(offset / chunkBytes);
|
|
297
297
|
const within = offset % chunkBytes;
|
|
298
298
|
const length = Math.min(buffer.byteLength - copied, chunkBytes - within);
|
|
299
|
-
|
|
299
|
+
const complete = within === 0 && length === chunkBytes;
|
|
300
|
+
// Staging owns acknowledged bytes. Borrow the caller's complete
|
|
301
|
+
// page until writePage settles instead of allocating another copy.
|
|
302
|
+
let bytes = complete ? buffer.subarray(copied, copied + length) : await readStagedPage(page, forwarded);
|
|
300
303
|
if (!bytes) {
|
|
301
304
|
bytes = new Uint8Array(chunkBytes);
|
|
302
|
-
|
|
303
|
-
bytes.set(await readBase(page * chunkBytes, chunkBytes, forwarded));
|
|
305
|
+
bytes.set(await readBase(page * chunkBytes, chunkBytes, forwarded));
|
|
304
306
|
}
|
|
305
|
-
|
|
307
|
+
if (!complete)
|
|
308
|
+
bytes.set(buffer.subarray(copied, copied + length), within);
|
|
306
309
|
await perform(forwarded, selected => state.staging.writePage(page, bytes, selected));
|
|
307
310
|
copied += length;
|
|
308
311
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.883",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
"saxes"
|
|
178
178
|
],
|
|
179
179
|
"optionalDependencies": {
|
|
180
|
-
"toolcraft-schema": "0.0.
|
|
180
|
+
"toolcraft-schema": "0.0.883",
|
|
181
181
|
"toolcraft-design": "*",
|
|
182
182
|
"@poe-code/frontmatter": "*",
|
|
183
183
|
"@poe-code/agent-mcp-config": "*",
|