toolcraft 0.0.884 → 0.0.886
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/memory/ledger.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/memory/ledger.js +12 -18
- package/node_modules/@poe-code/safe-fs/dist/fs/scoped.d.ts +1 -0
- package/node_modules/@poe-code/safe-fs/dist/fs/scoped.js +3 -2
- 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.886",
|
|
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.886",
|
|
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.886",
|
|
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.886",
|
|
152
152
|
"license": "MIT"
|
|
153
153
|
},
|
|
154
154
|
{
|
|
@@ -12,6 +12,7 @@ export declare class MemoryLedger {
|
|
|
12
12
|
get availableBytes(): number;
|
|
13
13
|
canPreallocate64(nameBytes: number): boolean;
|
|
14
14
|
fileSize(length: number, syscall: string, path: string): void;
|
|
15
|
+
private canReserve;
|
|
15
16
|
check(bytes: number, units: number, syscall: string, path: string): void;
|
|
16
17
|
reserve(bytes: number, units: number, syscall: string, path: string): void;
|
|
17
18
|
release(bytes: number, units: number): void;
|
|
@@ -10,9 +10,9 @@ export class MemoryLedger {
|
|
|
10
10
|
hasInfiniteRetained;
|
|
11
11
|
constructor(limits) {
|
|
12
12
|
this.limits = limits;
|
|
13
|
-
this.maxFileBytesSmi = limits.maxFileBytes
|
|
14
|
-
this.maxRetainedBytesSmi = limits.maxRetainedBytes
|
|
15
|
-
this.maxMetadataUnitsSmi = limits.maxMetadataUnits
|
|
13
|
+
this.maxFileBytesSmi = Math.min(limits.maxFileBytes, MAX_SMI) | 0;
|
|
14
|
+
this.maxRetainedBytesSmi = Math.min(limits.maxRetainedBytes, MAX_SMI) | 0;
|
|
15
|
+
this.maxMetadataUnitsSmi = Math.min(limits.maxMetadataUnits, MAX_SMI) | 0;
|
|
16
16
|
this.hasInfiniteRetained = limits.maxRetainedBytes === Infinity;
|
|
17
17
|
if (limits.maxFileBytes !== Infinity)
|
|
18
18
|
this.hasInfiniteFileBytes = false;
|
|
@@ -31,27 +31,24 @@ export class MemoryLedger {
|
|
|
31
31
|
throw new FsError("EFBIG", { syscall, path });
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
canReserve(bytes, units) {
|
|
35
|
+
return ((bytes | 0) === bytes && bytes >= 0 &&
|
|
36
36
|
(units | 0) === units && units >= 0 &&
|
|
37
37
|
this.retainedBytes <= this.maxRetainedBytesSmi - bytes &&
|
|
38
|
-
this.metadataUnits <= this.maxMetadataUnitsSmi - units)
|
|
38
|
+
this.metadataUnits <= this.maxMetadataUnitsSmi - units);
|
|
39
|
+
}
|
|
40
|
+
check(bytes, units, syscall, path) {
|
|
41
|
+
if (this.canReserve(bytes, units))
|
|
39
42
|
return;
|
|
40
|
-
}
|
|
41
|
-
const maxRetained = this.limits.maxRetainedBytes;
|
|
42
|
-
const maxUnits = this.limits.maxMetadataUnits;
|
|
43
43
|
if (!Number.isSafeInteger(bytes) || bytes < 0 ||
|
|
44
|
-
|
|
44
|
+
bytes > this.limits.maxRetainedBytes - this.retainedBytes ||
|
|
45
45
|
!Number.isSafeInteger(units) || units < 0 ||
|
|
46
|
-
|
|
46
|
+
units > this.limits.maxMetadataUnits - this.metadataUnits) {
|
|
47
47
|
throw new FsError("ENOSPC", { syscall, path });
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
reserve(bytes, units, syscall, path) {
|
|
51
|
-
if ((bytes
|
|
52
|
-
(units | 0) === units && units >= 0 &&
|
|
53
|
-
this.retainedBytes <= this.maxRetainedBytesSmi - bytes &&
|
|
54
|
-
this.metadataUnits <= this.maxMetadataUnitsSmi - units) {
|
|
51
|
+
if (this.canReserve(bytes, units)) {
|
|
55
52
|
this.retainedBytes = (this.retainedBytes + bytes) | 0;
|
|
56
53
|
this.metadataUnits = (this.metadataUnits + units) | 0;
|
|
57
54
|
return;
|
|
@@ -90,7 +87,4 @@ export class MemoryAllocation {
|
|
|
90
87
|
}
|
|
91
88
|
}
|
|
92
89
|
}
|
|
93
|
-
Object.assign(MemoryAllocation.prototype, {
|
|
94
|
-
references: 1,
|
|
95
|
-
});
|
|
96
90
|
Object.assign(MemoryLedger.prototype, { hasInfiniteFileBytes: true });
|
|
@@ -7,6 +7,7 @@ export declare function scopeFileSystem(filesystem: FileSystem, charge: () => vo
|
|
|
7
7
|
}): FileSystem;
|
|
8
8
|
export interface RetainedFileSystemCleanupView {
|
|
9
9
|
readonly removeFileConditional?: NonNullable<FileSystem["removeFileConditional"]>;
|
|
10
|
+
readonly removeTreeConditional?: NonNullable<FileSystem["removeTreeConditional"]>;
|
|
10
11
|
readonly removeStagedFile?: NonNullable<FileSystem["removeStagedFile"]>;
|
|
11
12
|
readonly lstat: FileSystem["lstat"];
|
|
12
13
|
readonly realpath: FileSystem["realpath"];
|
|
@@ -611,8 +611,8 @@ export function retainFileSystemCleanup(filesystem, cleanupCallback, options) {
|
|
|
611
611
|
if (typeof operation !== "function")
|
|
612
612
|
throw new FsError("ENOTSUP", { syscall: method, path });
|
|
613
613
|
const parameters = method === "rm" ? { ...settings, recursive: false, force: false } : settings;
|
|
614
|
-
result = method === "removeStagedFile" || method === "removeFileConditional"
|
|
615
|
-
? requireOwnedMutation(backing, path, method === "removeFileConditional" ? "atomicFileMutation" : "atomicFileStaging", settings ?? {}).then(() => Reflect.apply(operation, backing, [input, parameters]))
|
|
614
|
+
result = method === "removeStagedFile" || method === "removeFileConditional" || method === "removeTreeConditional"
|
|
615
|
+
? requireOwnedMutation(backing, path, method === "removeFileConditional" ? "atomicFileMutation" : method === "removeTreeConditional" ? "atomicTreeRemoval" : "atomicFileStaging", settings ?? {}).then(() => Reflect.apply(operation, backing, [input, parameters]))
|
|
616
616
|
: Promise.resolve(Reflect.apply(operation, backing, [input, parameters]));
|
|
617
617
|
}
|
|
618
618
|
catch (error) {
|
|
@@ -627,6 +627,7 @@ export function retainFileSystemCleanup(filesystem, cleanupCallback, options) {
|
|
|
627
627
|
const view = Object.freeze(Object.assign(Object.create(null), {
|
|
628
628
|
...(typeof backing.removeFileConditional === "function" ? { removeFileConditional: invoke.bind(undefined, "removeFileConditional") } : {}),
|
|
629
629
|
...(typeof backing.removeStagedFile === "function" ? { removeStagedFile: invoke.bind(undefined, "removeStagedFile") } : {}),
|
|
630
|
+
...(typeof backing.removeTreeConditional === "function" ? { removeTreeConditional: invoke.bind(undefined, "removeTreeConditional") } : {}),
|
|
630
631
|
lstat: invoke.bind(undefined, "lstat"),
|
|
631
632
|
realpath: invoke.bind(undefined, "realpath"),
|
|
632
633
|
rm: invoke.bind(undefined, "rm"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.886",
|
|
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.886",
|
|
181
181
|
"toolcraft-design": "*",
|
|
182
182
|
"@poe-code/frontmatter": "*",
|
|
183
183
|
"@poe-code/agent-mcp-config": "*",
|