@lorepack/cli 0.0.0-stage → 0.1.0-alpha.0
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/.tsbuildinfo +1 -0
- package/dist/commands/activate.d.ts +20 -0
- package/dist/commands/activate.d.ts.map +1 -0
- package/dist/commands/activate.js +171 -0
- package/dist/commands/activate.js.map +1 -0
- package/dist/commands/build.d.ts +3 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +53 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/config.d.ts +14 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +109 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/connect.d.ts +5 -0
- package/dist/commands/connect.d.ts.map +1 -0
- package/dist/commands/connect.js +196 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/deploy.d.ts +14 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +248 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/dev.d.ts +25 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +227 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/diff.d.ts +3 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +75 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/doctor.d.ts +14 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +96 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/export.d.ts +3 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +126 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/index.d.ts +8 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +51 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +95 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/inspect.d.ts +15 -0
- package/dist/commands/inspect.d.ts.map +1 -0
- package/dist/commands/inspect.js +527 -0
- package/dist/commands/inspect.js.map +1 -0
- package/dist/commands/mcp.d.ts +12 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +219 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/pack.d.ts +9 -0
- package/dist/commands/pack.d.ts.map +1 -0
- package/dist/commands/pack.js +57 -0
- package/dist/commands/pack.js.map +1 -0
- package/dist/commands/plan.d.ts +3 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +44 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/prune.d.ts +7 -0
- package/dist/commands/prune.d.ts.map +1 -0
- package/dist/commands/prune.js +341 -0
- package/dist/commands/prune.js.map +1 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +84 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/serve.d.ts +20 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +66 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +27 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/target.d.ts +71 -0
- package/dist/commands/target.d.ts.map +1 -0
- package/dist/commands/target.js +945 -0
- package/dist/commands/target.js.map +1 -0
- package/dist/entry.d.ts +3 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +19 -0
- package/dist/entry.js.map +1 -0
- package/dist/framework/context.d.ts +49 -0
- package/dist/framework/context.d.ts.map +1 -0
- package/dist/framework/context.js +47 -0
- package/dist/framework/context.js.map +1 -0
- package/dist/framework/exit.d.ts +36 -0
- package/dist/framework/exit.d.ts.map +1 -0
- package/dist/framework/exit.js +57 -0
- package/dist/framework/exit.js.map +1 -0
- package/dist/framework/metadata.d.ts +38 -0
- package/dist/framework/metadata.d.ts.map +1 -0
- package/dist/framework/metadata.js +47 -0
- package/dist/framework/metadata.js.map +1 -0
- package/dist/framework/program.d.ts +47 -0
- package/dist/framework/program.d.ts.map +1 -0
- package/dist/framework/program.js +189 -0
- package/dist/framework/program.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/README.md +7 -0
- package/dist/migrations/build/0001_catalog.sql +85 -0
- package/dist/migrations/build/0002_tables.sql +43 -0
- package/dist/migrations/build/0003_table-cell-range.sql +13 -0
- package/dist/migrations/build/0004_chunk-page.sql +11 -0
- package/dist/migrations/state/0001_state.sql +40 -0
- package/dist/public-entry.js +38563 -0
- package/dist/public-entry.js.map +7 -0
- package/dist/public-index.js +36428 -0
- package/dist/public-index.js.map +7 -0
- package/dist/services/build.d.ts +48 -0
- package/dist/services/build.d.ts.map +1 -0
- package/dist/services/build.js +499 -0
- package/dist/services/build.js.map +1 -0
- package/dist/services/builds.d.ts +40 -0
- package/dist/services/builds.d.ts.map +1 -0
- package/dist/services/builds.js +184 -0
- package/dist/services/builds.js.map +1 -0
- package/dist/services/cancellation.d.ts +27 -0
- package/dist/services/cancellation.d.ts.map +1 -0
- package/dist/services/cancellation.js +41 -0
- package/dist/services/cancellation.js.map +1 -0
- package/dist/services/cloudflare-target.d.ts +38 -0
- package/dist/services/cloudflare-target.d.ts.map +1 -0
- package/dist/services/cloudflare-target.js +471 -0
- package/dist/services/cloudflare-target.js.map +1 -0
- package/dist/services/comparer.d.ts +15 -0
- package/dist/services/comparer.d.ts.map +1 -0
- package/dist/services/comparer.js +43 -0
- package/dist/services/comparer.js.map +1 -0
- package/dist/services/config-resolve.d.ts +60 -0
- package/dist/services/config-resolve.d.ts.map +1 -0
- package/dist/services/config-resolve.js +178 -0
- package/dist/services/config-resolve.js.map +1 -0
- package/dist/services/deploy.d.ts +70 -0
- package/dist/services/deploy.d.ts.map +1 -0
- package/dist/services/deploy.js +260 -0
- package/dist/services/deploy.js.map +1 -0
- package/dist/services/dev-session.d.ts +52 -0
- package/dist/services/dev-session.d.ts.map +1 -0
- package/dist/services/dev-session.js +102 -0
- package/dist/services/dev-session.js.map +1 -0
- package/dist/services/doctor.d.ts +35 -0
- package/dist/services/doctor.d.ts.map +1 -0
- package/dist/services/doctor.js +389 -0
- package/dist/services/doctor.js.map +1 -0
- package/dist/services/export.d.ts +20 -0
- package/dist/services/export.d.ts.map +1 -0
- package/dist/services/export.js +129 -0
- package/dist/services/export.js.map +1 -0
- package/dist/services/init.d.ts +46 -0
- package/dist/services/init.d.ts.map +1 -0
- package/dist/services/init.js +231 -0
- package/dist/services/init.js.map +1 -0
- package/dist/services/packing.d.ts +25 -0
- package/dist/services/packing.d.ts.map +1 -0
- package/dist/services/packing.js +69 -0
- package/dist/services/packing.js.map +1 -0
- package/dist/services/parse-cache.d.ts +47 -0
- package/dist/services/parse-cache.d.ts.map +1 -0
- package/dist/services/parse-cache.js +65 -0
- package/dist/services/parse-cache.js.map +1 -0
- package/dist/services/project.d.ts +49 -0
- package/dist/services/project.d.ts.map +1 -0
- package/dist/services/project.js +119 -0
- package/dist/services/project.js.map +1 -0
- package/dist/services/remote-prune.d.ts +7 -0
- package/dist/services/remote-prune.d.ts.map +1 -0
- package/dist/services/remote-prune.js +34 -0
- package/dist/services/remote-prune.js.map +1 -0
- package/dist/services/retention.d.ts +20 -0
- package/dist/services/retention.d.ts.map +1 -0
- package/dist/services/retention.js +106 -0
- package/dist/services/retention.js.map +1 -0
- package/dist/services/revalidate.d.ts +36 -0
- package/dist/services/revalidate.d.ts.map +1 -0
- package/dist/services/revalidate.js +73 -0
- package/dist/services/revalidate.js.map +1 -0
- package/dist/services/search.d.ts +25 -0
- package/dist/services/search.d.ts.map +1 -0
- package/dist/services/search.js +88 -0
- package/dist/services/search.js.map +1 -0
- package/dist/services/serving.d.ts +70 -0
- package/dist/services/serving.d.ts.map +1 -0
- package/dist/services/serving.js +240 -0
- package/dist/services/serving.js.map +1 -0
- package/dist/services/status.d.ts +54 -0
- package/dist/services/status.d.ts.map +1 -0
- package/dist/services/status.js +203 -0
- package/dist/services/status.js.map +1 -0
- package/dist/services/studio-assets.d.ts +13 -0
- package/dist/services/studio-assets.d.ts.map +1 -0
- package/dist/services/studio-assets.js +94 -0
- package/dist/services/studio-assets.js.map +1 -0
- package/dist/services/studio-diagnostics.d.ts +28 -0
- package/dist/services/studio-diagnostics.d.ts.map +1 -0
- package/dist/services/studio-diagnostics.js +88 -0
- package/dist/services/studio-diagnostics.js.map +1 -0
- package/dist/services/studio-endpoints.d.ts +61 -0
- package/dist/services/studio-endpoints.d.ts.map +1 -0
- package/dist/services/studio-endpoints.js +88 -0
- package/dist/services/studio-endpoints.js.map +1 -0
- package/dist/services/studio-mutations.d.ts +32 -0
- package/dist/services/studio-mutations.d.ts.map +1 -0
- package/dist/services/studio-mutations.js +149 -0
- package/dist/services/studio-mutations.js.map +1 -0
- package/dist/services/versions.d.ts +38 -0
- package/dist/services/versions.d.ts.map +1 -0
- package/dist/services/versions.js +46 -0
- package/dist/services/versions.js.map +1 -0
- package/dist/services/watch.d.ts +103 -0
- package/dist/services/watch.d.ts.map +1 -0
- package/dist/services/watch.js +420 -0
- package/dist/services/watch.js.map +1 -0
- package/package.json +73 -4
- package/studio-dist/assets/ibm-plex-mono-latin-400-normal-Dm_PoFIZ.woff2 +0 -0
- package/studio-dist/assets/ibm-plex-mono-latin-500-normal-C_OblDzq.woff2 +0 -0
- package/studio-dist/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
- package/studio-dist/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
- package/studio-dist/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
- package/studio-dist/assets/index-BuAYbQVX.js +66 -0
- package/studio-dist/assets/index-C_3XEUt4.css +1 -0
- package/studio-dist/index.html +30 -0
- package/README.md +0 -3
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { LoreError } from '@lorepack/core';
|
|
4
|
+
/**
|
|
5
|
+
* The receipt a running `lorepack dev` leaves, so the session is discoverable rather than
|
|
6
|
+
* guessed at.
|
|
7
|
+
*
|
|
8
|
+
* Architecture 15.3 fixes the file and the preferred port. The reason it exists is that a
|
|
9
|
+
* dev server is the one long-lived thing Lorepack runs, and everything else that wants to
|
|
10
|
+
* talk to it (another command, a connector's generated config, the person who has forgotten
|
|
11
|
+
* which terminal it is in) otherwise has to scan ports and hope.
|
|
12
|
+
*
|
|
13
|
+
* A receipt is evidence, not a lock. The process it names may be gone, and a file left
|
|
14
|
+
* behind by a machine that lost power must not stop the next session from starting. So it
|
|
15
|
+
* carries a pid and is always checked against reality before it is believed.
|
|
16
|
+
*/
|
|
17
|
+
export const DEV_PORT = 43110;
|
|
18
|
+
export const DEV_RECEIPT = 'dev.json';
|
|
19
|
+
function receiptPath(config) {
|
|
20
|
+
return join(config.projectRoot, '.lore', DEV_RECEIPT);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Written atomically, because a reader may arrive mid-write.
|
|
24
|
+
*
|
|
25
|
+
* A truncated receipt is worse than none: it names a port that is half a number, and the
|
|
26
|
+
* reader has no way to tell that from a session on a strange port. Rename is the one
|
|
27
|
+
* operation that is atomic on every filesystem this runs on.
|
|
28
|
+
*/
|
|
29
|
+
export function writeReceipt(config, receipt) {
|
|
30
|
+
const path = receiptPath(config);
|
|
31
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
32
|
+
const temporary = `${path}.${process.pid}.tmp`;
|
|
33
|
+
writeFileSync(temporary, `${JSON.stringify(receipt, null, 2)}\n`, 'utf8');
|
|
34
|
+
renameSync(temporary, path);
|
|
35
|
+
}
|
|
36
|
+
export function readReceipt(config) {
|
|
37
|
+
const path = receiptPath(config);
|
|
38
|
+
if (!existsSync(path))
|
|
39
|
+
return null;
|
|
40
|
+
try {
|
|
41
|
+
const parsed = JSON.parse(readFileSync(path, 'utf8'));
|
|
42
|
+
if (typeof parsed.pid !== 'number' || typeof parsed.port !== 'number')
|
|
43
|
+
return null;
|
|
44
|
+
return {
|
|
45
|
+
port: parsed.port,
|
|
46
|
+
pid: parsed.pid,
|
|
47
|
+
startedAt: typeof parsed.startedAt === 'string' ? parsed.startedAt : '',
|
|
48
|
+
buildId: typeof parsed.buildId === 'string' ? parsed.buildId : '',
|
|
49
|
+
host: typeof parsed.host === 'string' ? parsed.host : '127.0.0.1',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// Unreadable or not JSON is the same as absent: it cannot be believed, and refusing to
|
|
54
|
+
// start because of a corrupt file would make a crash unrecoverable without `rm`.
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export function removeReceipt(config) {
|
|
59
|
+
rmSync(receiptPath(config), { force: true });
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Whether the process a receipt names is still there.
|
|
63
|
+
*
|
|
64
|
+
* Signal `0` performs the permission and existence checks without delivering anything,
|
|
65
|
+
* which is the portable way to ask. `EPERM` means the process exists and belongs to someone
|
|
66
|
+
* else, which still counts as running.
|
|
67
|
+
*/
|
|
68
|
+
export function isRunning(pid) {
|
|
69
|
+
if (!Number.isInteger(pid) || pid <= 0)
|
|
70
|
+
return false;
|
|
71
|
+
try {
|
|
72
|
+
process.kill(pid, 0);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
return error.code === 'EPERM';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Refuses a second supervisor on the same project, and clears a receipt whose process died.
|
|
81
|
+
*
|
|
82
|
+
* Two supervisors on one project is not a race worth winning. They would both watch, both
|
|
83
|
+
* rebuild, and take turns failing to acquire the build lock, and the user would see a
|
|
84
|
+
* server that intermittently stalls for reasons nothing explains. Refusing with the port of
|
|
85
|
+
* the session that already exists is more useful than either of them starting.
|
|
86
|
+
*/
|
|
87
|
+
export function assertNoLiveSession(config) {
|
|
88
|
+
const receipt = readReceipt(config);
|
|
89
|
+
if (receipt === null)
|
|
90
|
+
return;
|
|
91
|
+
if (!isRunning(receipt.pid)) {
|
|
92
|
+
// Stale: the machine restarted, or the process was killed hard enough that it could not
|
|
93
|
+
// clean up. Nothing to report, because nothing is wrong.
|
|
94
|
+
removeReceipt(config);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
throw new LoreError('LORE_E_LOCK_HELD', `A dev session for this project is already running on http://${receipt.host}:${receipt.port} (pid ${receipt.pid}).`, {
|
|
98
|
+
remediation: `Use the session that is already running, or stop it first. If that process is gone, delete .lore/${DEV_RECEIPT}.`,
|
|
99
|
+
subject: String(receipt.pid),
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=dev-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-session.js","sourceRoot":"","sources":["../../src/services/dev-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAqB,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE9D;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC;AAC9B,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AAWtC,SAAS,WAAW,CAAC,MAAoB;IACvC,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,E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CAAC,OAAO,CAAC,GAAG,CAAC;KAC7B,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type CheckResult, type CheckStatus, type DoctorReport } from '@lorepack/core';
|
|
2
|
+
/**
|
|
3
|
+
* One command that names whatever is wrong, and says how to fix it.
|
|
4
|
+
*
|
|
5
|
+
* Architecture 6.5 and 6.9. The value is entirely in the remediation: a check that reports
|
|
6
|
+
* "FTS5 unavailable" and stops has told the user something they already knew from the
|
|
7
|
+
* failure that sent them here. Every check below carries the detected value and one concrete
|
|
8
|
+
* thing to do, because "almost always the wrong Node build" is knowledge that belongs in the
|
|
9
|
+
* output rather than in a maintainer's head.
|
|
10
|
+
*
|
|
11
|
+
* Checks are independent, named, and uniformly shaped, which is what lets the Phase 4 Studio
|
|
12
|
+
* Diagnostics route (#69) render the same results without a second implementation. It is
|
|
13
|
+
* also what lets the client checks arrive later with #58 as an addition rather than a
|
|
14
|
+
* rewrite, which is the amendment recorded on #56.
|
|
15
|
+
*
|
|
16
|
+
* Read-only apart from a temporary in-memory FTS5 probe, so it is safe to run at any time,
|
|
17
|
+
* including against a project that is mid-build.
|
|
18
|
+
*/
|
|
19
|
+
export type { CheckResult, CheckStatus, DoctorReport };
|
|
20
|
+
export interface DoctorOptions {
|
|
21
|
+
readonly cwd: string;
|
|
22
|
+
/** The dev port to test, so a project on a custom port checks the right one. */
|
|
23
|
+
readonly port?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Set when this project's own dev session is the thing holding that port.
|
|
26
|
+
*
|
|
27
|
+
* Without it the report warns that the port is occupied, which is true and useless: it is
|
|
28
|
+
* occupied by the server that just answered the request, or by the `lorepack dev` running in
|
|
29
|
+
* the next terminal. Both callers work this out and say so, so the browser and the
|
|
30
|
+
* terminal reach the same conclusion about the same port.
|
|
31
|
+
*/
|
|
32
|
+
readonly portHeldByThisProject?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function runDoctor(options: DoctorOptions): Promise<DoctorReport>;
|
|
35
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/services/doctor.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,WAAW,EAEhB,KAAK,YAAY,EAIlB,MAAM,gBAAgB,CAAC;AAGxB;;;;;;;;;;;;;;;;GAgBG;AAKH,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;OAOG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAC1C;AAED,wBAAsB,SAAS,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAkC7E"}
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { accessSync, existsSync, constants as fsConstants, readFileSync, statSync } from 'node:fs';
|
|
2
|
+
import { createServer } from 'node:net';
|
|
3
|
+
import { platform } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { DatabaseSync } from 'node:sqlite';
|
|
6
|
+
import { probeFts5 } from '@lorepack/backend-local';
|
|
7
|
+
import { checkNodeVersion, doctorReportSchema, loadConfig, } from '@lorepack/core';
|
|
8
|
+
import { DEV_PORT } from './dev-session.js';
|
|
9
|
+
export async function runDoctor(options) {
|
|
10
|
+
const checks = [
|
|
11
|
+
nodeVersionCheck(),
|
|
12
|
+
sqliteCapabilityCheck(),
|
|
13
|
+
fts5Check(),
|
|
14
|
+
watcherLimitCheck(),
|
|
15
|
+
];
|
|
16
|
+
// A project is optional: running doctor in an empty directory is a legitimate thing to do
|
|
17
|
+
// before there is anything to configure, and it should report the environment rather than
|
|
18
|
+
// refuse.
|
|
19
|
+
const project = findProject(options.cwd);
|
|
20
|
+
if (project !== null) {
|
|
21
|
+
checks.push(configCheck(project.config, project.root));
|
|
22
|
+
checks.push(sourcesCheck(project.config));
|
|
23
|
+
checks.push(writableCheck(project.root));
|
|
24
|
+
checks.push(activeBuildCheck(project.root));
|
|
25
|
+
}
|
|
26
|
+
checks.push(await portCheck(options.port ?? DEV_PORT, options.portHeldByThisProject === true));
|
|
27
|
+
const counts = {
|
|
28
|
+
pass: checks.filter((check) => check.status === 'pass').length,
|
|
29
|
+
warn: checks.filter((check) => check.status === 'warn').length,
|
|
30
|
+
fail: checks.filter((check) => check.status === 'fail').length,
|
|
31
|
+
};
|
|
32
|
+
// Parsed rather than asserted, so `--json` cannot drift from the committed schema without
|
|
33
|
+
// this failing first. Doctor of all commands should not be the one lying about its output.
|
|
34
|
+
return doctorReportSchema.parse({
|
|
35
|
+
status: counts.fail > 0 ? 'fail' : counts.warn > 0 ? 'warn' : 'pass',
|
|
36
|
+
project: project?.root ?? null,
|
|
37
|
+
checks,
|
|
38
|
+
counts,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A project, an unreadable project, or neither.
|
|
43
|
+
*
|
|
44
|
+
* The middle case is the interesting one: a `lore.yaml` that will not parse is exactly the
|
|
45
|
+
* situation doctor exists for, and treating it as "no project" would skip every check that
|
|
46
|
+
* could explain it.
|
|
47
|
+
*/
|
|
48
|
+
function findProject(cwd) {
|
|
49
|
+
if (!existsSync(join(cwd, 'lore.yaml')))
|
|
50
|
+
return null;
|
|
51
|
+
try {
|
|
52
|
+
return { root: cwd, config: loadConfig({ cwd }), error: null };
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
return {
|
|
56
|
+
root: cwd,
|
|
57
|
+
config: null,
|
|
58
|
+
error: error instanceof Error ? error.message : String(error),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function nodeVersionCheck() {
|
|
63
|
+
const result = checkNodeVersion();
|
|
64
|
+
return {
|
|
65
|
+
id: 'node-version',
|
|
66
|
+
title: 'Node version',
|
|
67
|
+
status: result.supported ? 'pass' : 'fail',
|
|
68
|
+
detail: result.supported
|
|
69
|
+
? `Node ${result.detected}`
|
|
70
|
+
: `Node ${result.detected} is outside the supported range.`,
|
|
71
|
+
...(result.supported ? {} : { remediation: result.message }),
|
|
72
|
+
values: { detected: result.detected, execPath: process.execPath },
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Which `node:sqlite` controls this build actually has, individually.
|
|
77
|
+
*
|
|
78
|
+
* Reported one by one rather than as a single yes/no, because a user on an unexpected build
|
|
79
|
+
* needs to know precisely which control is missing: they map to different Node versions and
|
|
80
|
+
* to different things Lorepack cannot do.
|
|
81
|
+
*/
|
|
82
|
+
function sqliteCapabilityCheck() {
|
|
83
|
+
const present = {
|
|
84
|
+
setAuthorizer: false,
|
|
85
|
+
enableDefensive: false,
|
|
86
|
+
limits: false,
|
|
87
|
+
};
|
|
88
|
+
let detail = '';
|
|
89
|
+
try {
|
|
90
|
+
// A static import, because this file is ESM and `require` does not exist here. It was
|
|
91
|
+
// written lazily at first to survive a build without `node:sqlite`, and the result was
|
|
92
|
+
// a doctor that reported a false failure on a perfectly good environment. A check that
|
|
93
|
+
// lies about the thing it exists to verify is worse than no check.
|
|
94
|
+
const db = new DatabaseSync(':memory:');
|
|
95
|
+
try {
|
|
96
|
+
const surface = db;
|
|
97
|
+
present.setAuthorizer = typeof surface.setAuthorizer === 'function';
|
|
98
|
+
present.enableDefensive = typeof surface.enableDefensive === 'function';
|
|
99
|
+
present.limits = typeof surface.limits === 'object' && surface.limits !== null;
|
|
100
|
+
}
|
|
101
|
+
finally {
|
|
102
|
+
db.close();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
return {
|
|
107
|
+
id: 'sqlite-capabilities',
|
|
108
|
+
title: 'node:sqlite controls',
|
|
109
|
+
status: 'fail',
|
|
110
|
+
detail: `node:sqlite could not be opened: ${error instanceof Error ? error.message : String(error)}`,
|
|
111
|
+
remediation: 'Install Node 24.15 or newer from https://nodejs.org/en/download',
|
|
112
|
+
values: { execPath: process.execPath },
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
const missing = Object.entries(present)
|
|
116
|
+
.filter(([, has]) => !has)
|
|
117
|
+
.map(([name]) => name);
|
|
118
|
+
detail =
|
|
119
|
+
missing.length === 0
|
|
120
|
+
? 'setAuthorizer, enableDefensive and limits are all present.'
|
|
121
|
+
: `Missing: ${missing.join(', ')}.`;
|
|
122
|
+
return {
|
|
123
|
+
id: 'sqlite-capabilities',
|
|
124
|
+
title: 'node:sqlite controls',
|
|
125
|
+
status: missing.length === 0 ? 'pass' : 'fail',
|
|
126
|
+
detail,
|
|
127
|
+
...(missing.length === 0
|
|
128
|
+
? {}
|
|
129
|
+
: {
|
|
130
|
+
// Each maps to a different floor: setAuthorizer 24.10, enableDefensive 24.14,
|
|
131
|
+
// limits 24.15. Naming the floor is more useful than naming the range.
|
|
132
|
+
remediation: 'Install Node 24.15 or newer, which is the first release with all three: https://nodejs.org/en/download',
|
|
133
|
+
}),
|
|
134
|
+
values: { ...present, execPath: process.execPath },
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The check that matters most, because "FTS5 missing" is almost always "wrong Node build".
|
|
139
|
+
*
|
|
140
|
+
* Official nodejs.org builds compile `SQLITE_ENABLE_FTS5`; a Node linked against a shared
|
|
141
|
+
* system SQLite may not. Reporting the SQLite version and the executable path is what turns
|
|
142
|
+
* an inexplicable failure into an obvious one.
|
|
143
|
+
*/
|
|
144
|
+
function fts5Check() {
|
|
145
|
+
const probe = probeFts5();
|
|
146
|
+
return {
|
|
147
|
+
id: 'fts5',
|
|
148
|
+
title: 'SQLite FTS5',
|
|
149
|
+
status: probe.available ? 'pass' : 'fail',
|
|
150
|
+
detail: probe.available
|
|
151
|
+
? `SQLite ${probe.sqliteVersion} with FTS5.`
|
|
152
|
+
: `SQLite ${probe.sqliteVersion} has no FTS5${probe.detail === undefined ? '' : `: ${probe.detail}`}`,
|
|
153
|
+
...(probe.available
|
|
154
|
+
? {}
|
|
155
|
+
: {
|
|
156
|
+
remediation: [
|
|
157
|
+
'This is almost always a Node build linked against a system SQLite.',
|
|
158
|
+
'Install an official build from https://nodejs.org/en/download',
|
|
159
|
+
'Verified builds: docs/compatibility/sqlite-fts5.md',
|
|
160
|
+
].join('\n'),
|
|
161
|
+
}),
|
|
162
|
+
values: {
|
|
163
|
+
sqliteVersion: probe.sqliteVersion,
|
|
164
|
+
nodeVersion: probe.nodeVersion,
|
|
165
|
+
execPath: probe.execPath,
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* On Linux, how many files the kernel will let one user watch.
|
|
171
|
+
*
|
|
172
|
+
* A warning rather than a failure, because the limit only matters at a size this project may
|
|
173
|
+
* never reach, and because the fix needs root. Silence would be worse: an exhausted inotify
|
|
174
|
+
* limit surfaces as a watcher that simply stops noticing changes, which reads as Lorepack
|
|
175
|
+
* being broken.
|
|
176
|
+
*/
|
|
177
|
+
function watcherLimitCheck() {
|
|
178
|
+
if (platform() !== 'linux') {
|
|
179
|
+
return {
|
|
180
|
+
id: 'watcher-limits',
|
|
181
|
+
title: 'Watcher limits',
|
|
182
|
+
status: 'pass',
|
|
183
|
+
detail: `No per-user watch limit applies on ${platform()}.`,
|
|
184
|
+
values: { platform: platform() },
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
const path = '/proc/sys/fs/inotify/max_user_watches';
|
|
188
|
+
let limit = 0;
|
|
189
|
+
try {
|
|
190
|
+
limit = Number.parseInt(readFileSync(path, 'utf8').trim(), 10);
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
return {
|
|
194
|
+
id: 'watcher-limits',
|
|
195
|
+
title: 'Watcher limits',
|
|
196
|
+
status: 'pass',
|
|
197
|
+
detail: 'The inotify limit could not be read, which is not a problem by itself.',
|
|
198
|
+
values: { platform: 'linux' },
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
const low = limit > 0 && limit < 8192;
|
|
202
|
+
return {
|
|
203
|
+
id: 'watcher-limits',
|
|
204
|
+
title: 'Watcher limits',
|
|
205
|
+
status: low ? 'warn' : 'pass',
|
|
206
|
+
detail: low
|
|
207
|
+
? `inotify allows ${limit} watches, which a large project can exhaust.`
|
|
208
|
+
: `inotify allows ${limit} watches.`,
|
|
209
|
+
...(low
|
|
210
|
+
? {
|
|
211
|
+
remediation: 'Raise it if `lorepack dev` stops noticing changes:\n sudo sysctl fs.inotify.max_user_watches=524288',
|
|
212
|
+
}
|
|
213
|
+
: {}),
|
|
214
|
+
values: { platform: 'linux', maxUserWatches: limit },
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function configCheck(config, root) {
|
|
218
|
+
if (config === null) {
|
|
219
|
+
return {
|
|
220
|
+
id: 'config',
|
|
221
|
+
title: 'Project configuration',
|
|
222
|
+
status: 'fail',
|
|
223
|
+
detail: `lore.yaml in ${root} could not be read.`,
|
|
224
|
+
remediation: 'Run `lorepack plan` to see the parse error in full, or fix lore.yaml by hand.',
|
|
225
|
+
values: { root },
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
id: 'config',
|
|
230
|
+
title: 'Project configuration',
|
|
231
|
+
status: 'pass',
|
|
232
|
+
detail: `${config.config.name}, ${config.sources.length} source root${config.sources.length === 1 ? '' : 's'}.`,
|
|
233
|
+
values: { root, name: config.config.name },
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Every configured source root exists, is a directory, and is inside the project.
|
|
238
|
+
*
|
|
239
|
+
* Containment is the security half: a source that escapes the project root would index
|
|
240
|
+
* something the user did not point at, and the build would carry it forever.
|
|
241
|
+
*/
|
|
242
|
+
function sourcesCheck(config) {
|
|
243
|
+
if (config === null) {
|
|
244
|
+
return {
|
|
245
|
+
id: 'sources',
|
|
246
|
+
title: 'Source paths',
|
|
247
|
+
status: 'warn',
|
|
248
|
+
detail: 'Not checked, because the configuration could not be read.',
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
const problems = [];
|
|
252
|
+
for (const source of config.sources) {
|
|
253
|
+
const path = source.root;
|
|
254
|
+
if (!existsSync(path)) {
|
|
255
|
+
problems.push(`${path} does not exist`);
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
// A `file` source is legitimately not a directory, so only a directory source is held
|
|
259
|
+
// to that.
|
|
260
|
+
if (source.kind === 'directory' && !statSync(path).isDirectory()) {
|
|
261
|
+
problems.push(`${path} is not a directory`);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
id: 'sources',
|
|
266
|
+
title: 'Source paths',
|
|
267
|
+
status: problems.length === 0 ? 'pass' : 'fail',
|
|
268
|
+
detail: problems.length === 0
|
|
269
|
+
? `${config.sources.length} source root${config.sources.length === 1 ? '' : 's'} reachable.`
|
|
270
|
+
: problems.join('; '),
|
|
271
|
+
...(problems.length === 0
|
|
272
|
+
? {}
|
|
273
|
+
: {
|
|
274
|
+
remediation: 'Correct the `sources` list in lore.yaml, or create the missing directory.',
|
|
275
|
+
}),
|
|
276
|
+
values: { roots: config.sources.length },
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function writableCheck(root) {
|
|
280
|
+
const path = join(root, '.lore');
|
|
281
|
+
try {
|
|
282
|
+
if (existsSync(path))
|
|
283
|
+
accessSync(path, fsConstants.W_OK);
|
|
284
|
+
else
|
|
285
|
+
accessSync(root, fsConstants.W_OK);
|
|
286
|
+
return {
|
|
287
|
+
id: 'lore-writable',
|
|
288
|
+
title: 'Build directory',
|
|
289
|
+
status: 'pass',
|
|
290
|
+
detail: `${path} is writable.`,
|
|
291
|
+
values: { path },
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
catch {
|
|
295
|
+
return {
|
|
296
|
+
id: 'lore-writable',
|
|
297
|
+
title: 'Build directory',
|
|
298
|
+
status: 'fail',
|
|
299
|
+
detail: `${path} is not writable.`,
|
|
300
|
+
// Not "check your permissions": the exact command, because the point of doctor is that
|
|
301
|
+
// the user does not have to work out what to type.
|
|
302
|
+
remediation: `Grant write access to the directory:\n chmod u+w "${root}"`,
|
|
303
|
+
values: { path },
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Whether there is a build and whether it can still be opened.
|
|
309
|
+
*
|
|
310
|
+
* A project with no build is not broken, it is new, so that is a warning with the command
|
|
311
|
+
* that fixes it rather than a failure.
|
|
312
|
+
*/
|
|
313
|
+
function activeBuildCheck(root) {
|
|
314
|
+
const state = join(root, '.lore', 'state.sqlite');
|
|
315
|
+
if (!existsSync(state)) {
|
|
316
|
+
return {
|
|
317
|
+
id: 'active-build',
|
|
318
|
+
title: 'Active build',
|
|
319
|
+
status: 'warn',
|
|
320
|
+
detail: 'This project has no build yet.',
|
|
321
|
+
remediation: 'Run `lorepack build`, or `lorepack dev` to build and serve in one step.',
|
|
322
|
+
values: { state },
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
try {
|
|
326
|
+
accessSync(state, fsConstants.R_OK);
|
|
327
|
+
return {
|
|
328
|
+
id: 'active-build',
|
|
329
|
+
title: 'Active build',
|
|
330
|
+
status: 'pass',
|
|
331
|
+
detail: 'Build state is present and readable.',
|
|
332
|
+
values: { state },
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
catch {
|
|
336
|
+
return {
|
|
337
|
+
id: 'active-build',
|
|
338
|
+
title: 'Active build',
|
|
339
|
+
status: 'fail',
|
|
340
|
+
detail: `${state} cannot be read.`,
|
|
341
|
+
remediation: 'Check the file permissions, or remove .lore and run `lorepack build` again.',
|
|
342
|
+
values: { state },
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Whether the dev port is free, by binding it rather than by guessing from a scan.
|
|
348
|
+
*
|
|
349
|
+
* `ours` is the case that matters whenever a session is up: the port is held by this
|
|
350
|
+
* project's own `lorepack dev`, and reporting that as a problem tells a person their working
|
|
351
|
+
* setup is broken. The check concludes differently rather than a caller editing the result
|
|
352
|
+
* afterwards, which would be two opinions about one check.
|
|
353
|
+
*/
|
|
354
|
+
async function portCheck(port, ours) {
|
|
355
|
+
const free = await isPortFree(port);
|
|
356
|
+
if (!free && ours) {
|
|
357
|
+
return {
|
|
358
|
+
id: 'dev-port',
|
|
359
|
+
title: 'Dev port',
|
|
360
|
+
status: 'pass',
|
|
361
|
+
detail: `127.0.0.1:${port} is in use by this project's dev session.`,
|
|
362
|
+
values: { port, session: true },
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
return {
|
|
366
|
+
id: 'dev-port',
|
|
367
|
+
title: 'Dev port',
|
|
368
|
+
status: free ? 'pass' : 'warn',
|
|
369
|
+
detail: free ? `127.0.0.1:${port} is free.` : `127.0.0.1:${port} is in use.`,
|
|
370
|
+
...(free
|
|
371
|
+
? {}
|
|
372
|
+
: {
|
|
373
|
+
// A warning, not a failure: `lorepack dev` steps to the next free port and says so, so
|
|
374
|
+
// an occupied port is an inconvenience rather than a problem (architecture 6.9).
|
|
375
|
+
remediation: `\`lorepack dev\` will use the next free port. Pass --port to choose one.`,
|
|
376
|
+
}),
|
|
377
|
+
values: { port },
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
function isPortFree(port) {
|
|
381
|
+
return new Promise((resolve) => {
|
|
382
|
+
const server = createServer();
|
|
383
|
+
server.once('error', () => resolve(false));
|
|
384
|
+
server.listen(port, '127.0.0.1', () => {
|
|
385
|
+
server.close(() => resolve(true));
|
|
386
|
+
});
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
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a,IAAI,2CAA2C;YACpE,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;SAChC,CAAC;IACJ,CAAC;IAED,OAAO;QACL,EAAE,EAAE,UAAU;QACd,KAAK,EAAE,UAAU;QACjB,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;QAC9B,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa,IAAI,WAAW,CAAC,CAAC,CAAC,aAAa,IAAI,aAAa;QAC5E,GAAG,CAAC,IAAI;YACN,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC;gBACE,uFAAuF;gBACvF,iFAAiF;gBACjF,WAAW,EAAE,0EAA0E;aACxF,CAAC;QACN,MAAM,EAAE,EAAE,IAAI,EAAE;KACjB,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE;YACpC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ContextBundle } from '@lorepack/core';
|
|
2
|
+
/**
|
|
3
|
+
* Rendering a bundle as Markdown: architecture 14.6.
|
|
4
|
+
*
|
|
5
|
+
* This is the compatibility bridge for every chat product that cannot speak MCP, which is
|
|
6
|
+
* most of them. A person pastes one file and the model has the corpus, the citations, and
|
|
7
|
+
* an honest account of what did not fit.
|
|
8
|
+
*
|
|
9
|
+
* Nothing here writes prose about the content. Every passage is text from a document, and
|
|
10
|
+
* the only sentences Lorepack contributes are structural: what this is, where it came
|
|
11
|
+
* from, and what was left out.
|
|
12
|
+
*/
|
|
13
|
+
export interface ExportOptions {
|
|
14
|
+
readonly projectName: string;
|
|
15
|
+
/** How to ask for more, rendered verbatim so a reader can copy it. */
|
|
16
|
+
readonly moreCommand: string;
|
|
17
|
+
readonly sourceState: ContextBundle['sourceState'];
|
|
18
|
+
}
|
|
19
|
+
export declare function renderBundleMarkdown(bundle: ContextBundle, options: ExportOptions): string;
|
|
20
|
+
//# sourceMappingURL=export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/services/export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAS,MAAM,gBAAgB,CAAC;AAE3D;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;CACpD;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,GAAG,MAAM,CA+F1F"}
|