pi-fabric 0.92.0 → 0.92.2
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/chunks/{chunk-OJX2V36R.js → chunk-2ECGHE2U.js} +21 -15
- package/dist/chunks/chunk-2ECGHE2U.js.map +7 -0
- package/dist/chunks/{chunk-LLJXPPTA.js → chunk-6ELA5OWI.js} +2 -2
- package/dist/chunks/{chunk-5MDFFHOO.js → chunk-BSGA3KSB.js} +3 -1
- package/dist/chunks/chunk-BSGA3KSB.js.map +7 -0
- package/dist/chunks/{chunk-CHNDPTCW.js → chunk-OKDKF6L5.js} +52 -28
- package/dist/chunks/chunk-OKDKF6L5.js.map +7 -0
- package/dist/chunks/{chunk-4S5PVL7Y.js → chunk-SWB2OHYW.js} +3 -1
- package/dist/chunks/chunk-SWB2OHYW.js.map +7 -0
- package/dist/chunks/{chunk-DDVCVE4D.js → chunk-T4YUVJMQ.js} +3 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/core/damaged-file.d.ts +6 -0
- package/dist/core/damaged-file.d.ts.map +1 -0
- package/dist/entropy/compiled-surface.d.ts +1 -0
- package/dist/entropy/compiled-surface.d.ts.map +1 -1
- package/dist/entropy/index.js +4 -2
- package/dist/fabric-runtime-state.js +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +2 -2
- package/dist/mesh/store.d.ts.map +1 -1
- package/dist/residency/host.js +3 -3
- package/dist/residency/pi-entry.js +3 -3
- package/dist/runtime/monty-runtime.js +2 -2
- package/dist/runtime/monty-values.d.ts +3 -1
- package/dist/runtime/monty-values.d.ts.map +1 -1
- package/dist/speculation/python-scanner.js +1 -1
- package/dist/ui/settings.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/chunk-4S5PVL7Y.js.map +0 -7
- package/dist/chunks/chunk-5MDFFHOO.js.map +0 -7
- package/dist/chunks/chunk-CHNDPTCW.js.map +0 -7
- package/dist/chunks/chunk-OJX2V36R.js.map +0 -7
- /package/dist/chunks/{chunk-LLJXPPTA.js.map → chunk-6ELA5OWI.js.map} +0 -0
- /package/dist/chunks/{chunk-DDVCVE4D.js.map → chunk-T4YUVJMQ.js.map} +0 -0
|
@@ -28,8 +28,9 @@ import {
|
|
|
28
28
|
import {
|
|
29
29
|
DEFAULT_FABRIC_CONFIG,
|
|
30
30
|
MAX_AGENT_TIMEOUT_MS,
|
|
31
|
-
MIN_AGENT_TIMEOUT_MS
|
|
32
|
-
|
|
31
|
+
MIN_AGENT_TIMEOUT_MS,
|
|
32
|
+
quarantineDamagedFile
|
|
33
|
+
} from "./chunk-OKDKF6L5.js";
|
|
33
34
|
import {
|
|
34
35
|
writeFileAtomic,
|
|
35
36
|
writeJsonAtomic
|
|
@@ -154,25 +155,30 @@ var recoverConcatenatedState = (serialized) => {
|
|
|
154
155
|
}
|
|
155
156
|
return start < 0 && documents > 1 ? snapshots.at(-1) : void 0;
|
|
156
157
|
};
|
|
158
|
+
var emptyState = () => ({ format: 1, entries: {} });
|
|
157
159
|
var readState = (filePath, maxBytes) => {
|
|
160
|
+
let serialized;
|
|
158
161
|
try {
|
|
159
162
|
const stat = fs.statSync(filePath);
|
|
160
163
|
if (stat.size > maxBytes) throw new Error(`state exceeds ${maxBytes} bytes`);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
const parsed = JSON.parse(serialized);
|
|
164
|
-
if (isMeshStateFile(parsed)) return parsed;
|
|
165
|
-
throw new Error("invalid state format");
|
|
166
|
-
} catch (error) {
|
|
167
|
-
const recovered = recoverConcatenatedState(serialized);
|
|
168
|
-
if (recovered) return recovered;
|
|
169
|
-
throw error;
|
|
170
|
-
}
|
|
164
|
+
if (stat.size === 0) return emptyState();
|
|
165
|
+
serialized = fs.readFileSync(filePath, "utf8");
|
|
171
166
|
} catch (error) {
|
|
172
|
-
if (errorCode(error) === "ENOENT") return
|
|
167
|
+
if (errorCode(error) === "ENOENT") return emptyState();
|
|
173
168
|
const message = error instanceof Error ? error.message : String(error);
|
|
174
169
|
throw new Error(`Failed to read Fabric mesh state: ${message}`);
|
|
175
170
|
}
|
|
171
|
+
if (!serialized.trim()) return emptyState();
|
|
172
|
+
try {
|
|
173
|
+
const parsed = JSON.parse(serialized);
|
|
174
|
+
if (isMeshStateFile(parsed)) return parsed;
|
|
175
|
+
throw new Error("invalid state format");
|
|
176
|
+
} catch (error) {
|
|
177
|
+
const recovered = recoverConcatenatedState(serialized);
|
|
178
|
+
if (recovered) return recovered;
|
|
179
|
+
quarantineDamagedFile(filePath);
|
|
180
|
+
return emptyState();
|
|
181
|
+
}
|
|
176
182
|
};
|
|
177
183
|
var atomicWrite = (filePath, value, maxBytes = Number.POSITIVE_INFINITY) => {
|
|
178
184
|
const serialized = JSON.stringify(value, null, 2);
|
|
@@ -550,7 +556,7 @@ var MeshStore = class {
|
|
|
550
556
|
}
|
|
551
557
|
} catch (error) {
|
|
552
558
|
this.#stateCache = void 0;
|
|
553
|
-
if (errorCode(error) === "ENOENT") return
|
|
559
|
+
if (errorCode(error) === "ENOENT") return emptyState();
|
|
554
560
|
throw error;
|
|
555
561
|
}
|
|
556
562
|
const state = readState(this.#statePath, this.#maxStateBytes);
|
|
@@ -6642,4 +6648,4 @@ export {
|
|
|
6642
6648
|
agentParticipantRecords,
|
|
6643
6649
|
actorParticipantRecord
|
|
6644
6650
|
};
|
|
6645
|
-
//# sourceMappingURL=chunk-
|
|
6651
|
+
//# sourceMappingURL=chunk-2ECGHE2U.js.map
|