@hasna/models 0.0.2 → 0.0.3
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/cli/index.js +7 -4
- package/dist/index.js +5 -2
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -2574,7 +2574,7 @@ var source_default = chalk;
|
|
|
2574
2574
|
|
|
2575
2575
|
// src/cli/index.ts
|
|
2576
2576
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
2577
|
-
import { existsSync, readFileSync as readFileSync2, rmSync, statSync } from "fs";
|
|
2577
|
+
import { existsSync, readFileSync as readFileSync2, rmSync, statSync as statSync2 } from "fs";
|
|
2578
2578
|
import { dirname as dirname4, join as join3 } from "path";
|
|
2579
2579
|
import { fileURLToPath } from "url";
|
|
2580
2580
|
|
|
@@ -2778,7 +2778,7 @@ function safePathSegment(value) {
|
|
|
2778
2778
|
}
|
|
2779
2779
|
|
|
2780
2780
|
// src/huggingface.ts
|
|
2781
|
-
import { createWriteStream, mkdirSync as mkdirSync2, renameSync, unlinkSync } from "fs";
|
|
2781
|
+
import { createWriteStream, mkdirSync as mkdirSync2, renameSync, statSync, unlinkSync } from "fs";
|
|
2782
2782
|
import { dirname as dirname2, isAbsolute, join as join2, resolve, sep } from "path";
|
|
2783
2783
|
import { pipeline } from "stream/promises";
|
|
2784
2784
|
import { Readable } from "stream";
|
|
@@ -3045,8 +3045,11 @@ async function downloadPlannedFiles(plan) {
|
|
|
3045
3045
|
}
|
|
3046
3046
|
try {
|
|
3047
3047
|
await pipeline(Readable.fromWeb(response.body), createWriteStream(tempDestination));
|
|
3048
|
+
const bytes = statSync(tempDestination).size;
|
|
3049
|
+
if (file.size != null && bytes !== file.size) {
|
|
3050
|
+
throw new Error(`Downloaded size mismatch for ${file.path}: expected ${file.size} bytes, got ${bytes}`);
|
|
3051
|
+
}
|
|
3048
3052
|
renameSync(tempDestination, destination);
|
|
3049
|
-
const bytes = file.size ?? Bun.file(destination).size;
|
|
3050
3053
|
downloaded.push({ path: file.path, bytes, destination });
|
|
3051
3054
|
} catch (error) {
|
|
3052
3055
|
try {
|
|
@@ -3733,7 +3736,7 @@ program2.command("goals").description("Print the implementation goal chain").opt
|
|
|
3733
3736
|
const path = join3(cliDir, "..", "..", "docs", "GOALS.md");
|
|
3734
3737
|
const text = existsSync(path) ? readFileSync2(path, "utf8") : "Goal chain not found.";
|
|
3735
3738
|
if (isJson(opts)) {
|
|
3736
|
-
printJson({ path, bytes: existsSync(path) ?
|
|
3739
|
+
printJson({ path, bytes: existsSync(path) ? statSync2(path).size : 0, text });
|
|
3737
3740
|
} else {
|
|
3738
3741
|
console.log(text);
|
|
3739
3742
|
}
|
package/dist/index.js
CHANGED
|
@@ -424,7 +424,7 @@ function saveHuggingFaceSecretRef(secretKey) {
|
|
|
424
424
|
return redactAuthStatus({ provider: "huggingface", available: Boolean(readSecret(secretKey)), source: "secrets", secretKey });
|
|
425
425
|
}
|
|
426
426
|
// src/huggingface.ts
|
|
427
|
-
import { createWriteStream, mkdirSync as mkdirSync3, renameSync, unlinkSync } from "fs";
|
|
427
|
+
import { createWriteStream, mkdirSync as mkdirSync3, renameSync, statSync, unlinkSync } from "fs";
|
|
428
428
|
import { dirname as dirname3, isAbsolute, join as join2, resolve, sep } from "path";
|
|
429
429
|
import { pipeline } from "stream/promises";
|
|
430
430
|
import { Readable } from "stream";
|
|
@@ -691,8 +691,11 @@ async function downloadPlannedFiles(plan) {
|
|
|
691
691
|
}
|
|
692
692
|
try {
|
|
693
693
|
await pipeline(Readable.fromWeb(response.body), createWriteStream(tempDestination));
|
|
694
|
+
const bytes = statSync(tempDestination).size;
|
|
695
|
+
if (file.size != null && bytes !== file.size) {
|
|
696
|
+
throw new Error(`Downloaded size mismatch for ${file.path}: expected ${file.size} bytes, got ${bytes}`);
|
|
697
|
+
}
|
|
694
698
|
renameSync(tempDestination, destination);
|
|
695
|
-
const bytes = file.size ?? Bun.file(destination).size;
|
|
696
699
|
downloaded.push({ path: file.path, bytes, destination });
|
|
697
700
|
} catch (error) {
|
|
698
701
|
try {
|