@xdsjs/dossierx-daemon 0.1.18 → 0.1.19
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/index.js +14 -13
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import os3 from "os";
|
|
|
6
6
|
import path14 from "path";
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
|
|
9
|
-
// ../../node_modules/.pnpm/@xdsjs+dossierx-workspace@0.1.
|
|
9
|
+
// ../../node_modules/.pnpm/@xdsjs+dossierx-workspace@0.1.2/node_modules/@xdsjs/dossierx-workspace/dist/index.js
|
|
10
10
|
import path from "path";
|
|
11
11
|
import { createHash } from "crypto";
|
|
12
12
|
import { mkdir, readdir, readFile, stat, writeFile } from "fs/promises";
|
|
@@ -471,7 +471,7 @@ var DaemonErrorCodeSchema = z10.enum([
|
|
|
471
471
|
"UNKNOWN"
|
|
472
472
|
]);
|
|
473
473
|
|
|
474
|
-
// ../../node_modules/.pnpm/@xdsjs+dossierx-workspace@0.1.
|
|
474
|
+
// ../../node_modules/.pnpm/@xdsjs+dossierx-workspace@0.1.2/node_modules/@xdsjs/dossierx-workspace/dist/index.js
|
|
475
475
|
import { readFile as readFile2 } from "fs/promises";
|
|
476
476
|
import path3 from "path";
|
|
477
477
|
import { z as z11 } from "zod";
|
|
@@ -489,7 +489,7 @@ function resolveInsideWorkspace(root, relativePath) {
|
|
|
489
489
|
}
|
|
490
490
|
return resolvedTarget;
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function sha256Content(content) {
|
|
493
493
|
return `sha256:${createHash("sha256").update(content).digest("hex")}`;
|
|
494
494
|
}
|
|
495
495
|
var DOSSIERX_CONFIG_DIR = "~/.dossierx";
|
|
@@ -544,13 +544,14 @@ var INVEST_WIKI_TOP_LEVEL_FILES = [
|
|
|
544
544
|
"wiki-purpose.md",
|
|
545
545
|
"wiki-schema.md"
|
|
546
546
|
];
|
|
547
|
-
var
|
|
547
|
+
var MANIFEST_FILE_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
548
548
|
".md",
|
|
549
549
|
".txt",
|
|
550
550
|
".toml",
|
|
551
551
|
".json",
|
|
552
552
|
".yml",
|
|
553
|
-
".yaml"
|
|
553
|
+
".yaml",
|
|
554
|
+
".pdf"
|
|
554
555
|
]);
|
|
555
556
|
function manifestTitle(relativePath) {
|
|
556
557
|
return path2.basename(relativePath);
|
|
@@ -559,7 +560,7 @@ function canIncludeFile(relativePath) {
|
|
|
559
560
|
if (relativePath.endsWith("/manifest.json")) {
|
|
560
561
|
return false;
|
|
561
562
|
}
|
|
562
|
-
return
|
|
563
|
+
return MANIFEST_FILE_EXTENSIONS.has(path2.extname(relativePath).toLowerCase());
|
|
563
564
|
}
|
|
564
565
|
async function collectDirectoryCandidates(input, depth = 0) {
|
|
565
566
|
const maxDepth = 3;
|
|
@@ -679,7 +680,7 @@ async function scanCompanyManifest(input) {
|
|
|
679
680
|
try {
|
|
680
681
|
const [fileStat, content] = await Promise.all([
|
|
681
682
|
stat(absolutePath),
|
|
682
|
-
readFile(absolutePath
|
|
683
|
+
readFile(absolutePath)
|
|
683
684
|
]);
|
|
684
685
|
if (!fileStat.isFile()) {
|
|
685
686
|
continue;
|
|
@@ -688,8 +689,8 @@ async function scanCompanyManifest(input) {
|
|
|
688
689
|
type: candidate.type,
|
|
689
690
|
title: candidate.title,
|
|
690
691
|
path: candidate.relativePath,
|
|
691
|
-
size:
|
|
692
|
-
hash:
|
|
692
|
+
size: fileStat.size,
|
|
693
|
+
hash: sha256Content(content),
|
|
693
694
|
updatedAt: fileStat.mtime.toISOString()
|
|
694
695
|
});
|
|
695
696
|
} catch (error) {
|
|
@@ -1542,12 +1543,12 @@ async function commit(input) {
|
|
|
1542
1543
|
async function push(input) {
|
|
1543
1544
|
await git(input, ["push", "-u", "origin", input.branch]);
|
|
1544
1545
|
}
|
|
1545
|
-
function
|
|
1546
|
+
function sha256Text(content) {
|
|
1546
1547
|
return `sha256:${createHash2("sha256").update(content).digest("hex")}`;
|
|
1547
1548
|
}
|
|
1548
1549
|
function treeHashForManifest(manifest) {
|
|
1549
1550
|
const lines = manifest.pages.map((page) => `${page.path}\0${page.hash}\0${page.size}`).sort((a, b) => a.localeCompare(b));
|
|
1550
|
-
return
|
|
1551
|
+
return sha256Text(`${lines.join("\n")}
|
|
1551
1552
|
`);
|
|
1552
1553
|
}
|
|
1553
1554
|
function snapshotMetadataPath(ticker) {
|
|
@@ -1667,7 +1668,7 @@ async function verifyCompanySnapshot(input) {
|
|
|
1667
1668
|
}
|
|
1668
1669
|
const content = await readFile22(absolutePath, "utf8");
|
|
1669
1670
|
const size = Buffer.byteLength(content);
|
|
1670
|
-
const hash =
|
|
1671
|
+
const hash = sha256Text(content);
|
|
1671
1672
|
if (size !== page.size || hash !== page.hash) {
|
|
1672
1673
|
throw validationError(`Mirror page hash mismatch: ${page.path}`);
|
|
1673
1674
|
}
|
|
@@ -2290,7 +2291,7 @@ function createTaskArchive(options) {
|
|
|
2290
2291
|
|
|
2291
2292
|
// src/version.ts
|
|
2292
2293
|
var DAEMON_PACKAGE_NAME = "@xdsjs/dossierx-daemon";
|
|
2293
|
-
var DAEMON_VERSION = "0.1.
|
|
2294
|
+
var DAEMON_VERSION = "0.1.19";
|
|
2294
2295
|
|
|
2295
2296
|
// src/local-api/server.ts
|
|
2296
2297
|
var DEFAULT_MAX_FILE_BYTES = 5 * 1024 * 1024;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xdsjs/dossierx-daemon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -22,19 +22,12 @@
|
|
|
22
22
|
"engines": {
|
|
23
23
|
"node": ">=20"
|
|
24
24
|
},
|
|
25
|
-
"scripts": {
|
|
26
|
-
"dev": "tsx src/index.ts",
|
|
27
|
-
"build": "tsup",
|
|
28
|
-
"typecheck": "tsc --noEmit",
|
|
29
|
-
"test": "vitest run",
|
|
30
|
-
"lint": "tsc --noEmit"
|
|
31
|
-
},
|
|
32
25
|
"dependencies": {
|
|
33
26
|
"@supabase/supabase-js": "^2.0.0",
|
|
34
|
-
"@xdsjs/dossier-financial-reports": "^0.1.
|
|
27
|
+
"@xdsjs/dossier-financial-reports": "^0.1.6",
|
|
35
28
|
"@xdsjs/dossierx-git-mirror": "^0.1.2",
|
|
36
29
|
"@xdsjs/dossierx-shared": "^0.1.5",
|
|
37
|
-
"@xdsjs/dossierx-workspace": "^0.1.
|
|
30
|
+
"@xdsjs/dossierx-workspace": "^0.1.2",
|
|
38
31
|
"commander": "^14.0.0",
|
|
39
32
|
"execa": "^9.0.0",
|
|
40
33
|
"pino": "^10.0.0",
|
|
@@ -46,5 +39,12 @@
|
|
|
46
39
|
"tsup": "^8.0.0",
|
|
47
40
|
"typescript": "^5.0.0",
|
|
48
41
|
"vitest": "^3.0.0"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"dev": "tsx src/index.ts",
|
|
45
|
+
"build": "tsup",
|
|
46
|
+
"typecheck": "tsc --noEmit",
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"lint": "tsc --noEmit"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|