@moxt-ai/mobius 0.0.344 → 0.0.345
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/handler/agents/index.js +4 -4
- package/dist/cli/handler/agents/index.js.map +1 -1
- package/dist/cli/handler/agents/logic/agent-diagnostics.js +1 -1
- package/dist/cli/handler/agents/logic/agent-diagnostics.js.map +1 -1
- package/dist/cli/handler/daemon/start.js +2 -2
- package/dist/cli/handler/daemon/start.js.map +1 -1
- package/dist/cli/handler/logs/logic/collect-local-logs.js +2 -2
- package/dist/cli/handler/logs/logic/collect-local-logs.js.map +1 -1
- package/dist/cli/handler/pair/logic/pair-list-output.js +1 -1
- package/dist/cli/handler/pair/logic/pair-list-output.js.map +1 -1
- package/dist/cli/handler/pair/pair.js +2 -2
- package/dist/cli/handler/pair/pair.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli.js +10089 -10034
- package/dist/cli.js.map +4 -4
- package/dist/daemon/config.d.ts +5 -0
- package/dist/daemon/config.d.ts.map +1 -0
- package/dist/daemon/config.js +40 -0
- package/dist/daemon/config.js.map +1 -0
- package/dist/daemon/control/local-client.d.ts.map +1 -1
- package/dist/daemon/control/local-client.js +1 -1
- package/dist/daemon/control/local-client.js.map +1 -1
- package/dist/daemon/control/local-server.d.ts.map +1 -1
- package/dist/daemon/control/local-server.js +1 -1
- package/dist/daemon/control/local-server.js.map +1 -1
- package/dist/daemon/lifecycle/manager-client.d.ts.map +1 -1
- package/dist/daemon/lifecycle/manager-client.js +3 -3
- package/dist/daemon/lifecycle/manager-client.js.map +1 -1
- package/dist/daemon/lifecycle/manager.d.ts.map +1 -1
- package/dist/daemon/lifecycle/manager.js +1 -1
- package/dist/daemon/lifecycle/manager.js.map +1 -1
- package/dist/daemon/lifecycle/worker.d.ts.map +1 -1
- package/dist/daemon/lifecycle/worker.js +6 -3
- package/dist/daemon/lifecycle/worker.js.map +1 -1
- package/dist/daemon/pairing/pair-local-machine.d.ts.map +1 -1
- package/dist/daemon/pairing/pair-local-machine.js +26 -21
- package/dist/daemon/pairing/pair-local-machine.js.map +1 -1
- package/dist/daemon/upgrades/data.d.ts.map +1 -1
- package/dist/daemon/upgrades/data.js +2 -2
- package/dist/daemon/upgrades/data.js.map +1 -1
- package/dist/daemon/upgrades/package.d.ts.map +1 -1
- package/dist/daemon/upgrades/package.js +1 -1
- package/dist/daemon/upgrades/package.js.map +1 -1
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +1 -1
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/runtime/catalog/refresh-agent-catalog.js +1 -1
- package/dist/engine/runtime/catalog/refresh-agent-catalog.js.map +1 -1
- package/dist/engine/runtime/catalog/resolve-catalog-agent.js +1 -1
- package/dist/engine/runtime/catalog/resolve-catalog-agent.js.map +1 -1
- package/dist/engine/runtime/command/registry/index.d.ts.map +1 -1
- package/dist/engine/runtime/command/registry/index.js +18 -1
- package/dist/engine/runtime/command/registry/index.js.map +1 -1
- package/dist/engine/runtime/config.d.ts +6 -8
- package/dist/engine/runtime/config.d.ts.map +1 -1
- package/dist/engine/runtime/config.js +9 -15
- package/dist/engine/runtime/config.js.map +1 -1
- package/dist/engine/runtime/connection/runtime-connection.d.ts +1 -2
- package/dist/engine/runtime/connection/runtime-connection.d.ts.map +1 -1
- package/dist/engine/runtime/connection/runtime-connection.js +1 -3
- package/dist/engine/runtime/connection/runtime-connection.js.map +1 -1
- package/dist/engine/runtime/connection/runtime-installation-store.d.ts +4 -7
- package/dist/engine/runtime/connection/runtime-installation-store.d.ts.map +1 -1
- package/dist/engine/runtime/connection/runtime-installation-store.js +56 -60
- package/dist/engine/runtime/connection/runtime-installation-store.js.map +1 -1
- package/dist/engine/runtime/engine.d.ts +10 -4
- package/dist/engine/runtime/engine.d.ts.map +1 -1
- package/dist/engine/runtime/engine.js +6 -25
- package/dist/engine/runtime/engine.js.map +1 -1
- package/dist/engine/runtime/relay/diagnostics.d.ts.map +1 -1
- package/dist/engine/runtime/relay/diagnostics.js +15 -0
- package/dist/engine/runtime/relay/diagnostics.js.map +1 -1
- package/dist/engine/runtime/relay/run-relay-connection.d.ts.map +1 -1
- package/dist/engine/runtime/relay/run-relay-connection.js +3 -0
- package/dist/engine/runtime/relay/run-relay-connection.js.map +1 -1
- package/dist/engine/runtime/run.js +2 -2
- package/dist/engine/runtime/run.js.map +1 -1
- package/dist/engine/session/process/agent-process-pool.d.ts +0 -1
- package/dist/engine/session/process/agent-process-pool.d.ts.map +1 -1
- package/dist/engine/session/process/agent-process-pool.js +0 -14
- package/dist/engine/session/process/agent-process-pool.js.map +1 -1
- package/dist/engine/session/prompt/execute-prompt.d.ts.map +1 -1
- package/dist/engine/session/prompt/execute-prompt.js +10 -1
- package/dist/engine/session/prompt/execute-prompt.js.map +1 -1
- package/dist/engine/session/prompt/prompt-artifacts.d.ts.map +1 -1
- package/dist/engine/session/prompt/prompt-artifacts.js +6 -7
- package/dist/engine/session/prompt/prompt-artifacts.js.map +1 -1
- package/dist/engine/storage/installation/installation-files.d.ts +3 -4
- package/dist/engine/storage/installation/installation-files.d.ts.map +1 -1
- package/dist/engine/storage/installation/installation-files.js +5 -9
- package/dist/engine/storage/installation/installation-files.js.map +1 -1
- package/dist/engine/storage/logs/log-files.d.ts +2 -26
- package/dist/engine/storage/logs/log-files.d.ts.map +1 -1
- package/dist/engine/storage/logs/log-files.js +5 -128
- package/dist/engine/storage/logs/log-files.js.map +1 -1
- package/dist/engine.js +479 -469
- package/dist/engine.js.map +4 -4
- package/dist/{engine/storage → storage}/daemon/control-token.d.ts +1 -1
- package/dist/storage/daemon/control-token.d.ts.map +1 -0
- package/dist/{engine/storage → storage}/daemon/control-token.js +1 -1
- package/dist/storage/daemon/control-token.js.map +1 -0
- package/dist/{engine/storage → storage}/daemon/manager-lock.d.ts +1 -1
- package/dist/storage/daemon/manager-lock.d.ts.map +1 -0
- package/dist/{engine/storage → storage}/daemon/manager-lock.js +1 -1
- package/dist/storage/daemon/manager-lock.js.map +1 -0
- package/dist/storage/daemon/release-files.d.ts.map +1 -0
- package/dist/storage/daemon/release-files.js.map +1 -0
- package/dist/{engine/storage → storage}/daemon/version-data.d.ts +2 -0
- package/dist/storage/daemon/version-data.d.ts.map +1 -0
- package/dist/{engine/storage → storage}/daemon/version-data.js +17 -2
- package/dist/storage/daemon/version-data.js.map +1 -0
- package/dist/storage/files/output-file.d.ts.map +1 -0
- package/dist/{engine/storage → storage}/files/output-file.js +1 -1
- package/dist/storage/files/output-file.js.map +1 -0
- package/dist/storage/logs/log-files.d.ts +24 -0
- package/dist/storage/logs/log-files.d.ts.map +1 -0
- package/dist/storage/logs/log-files.js +122 -0
- package/dist/storage/logs/log-files.js.map +1 -0
- package/dist/storage/state-directory.d.ts.map +1 -0
- package/dist/storage/state-directory.js.map +1 -0
- package/dist/storage/state-root-layout.d.ts.map +1 -0
- package/dist/storage/state-root-layout.js.map +1 -0
- package/dist/storage/state-root.d.ts.map +1 -0
- package/dist/{engine/storage → storage}/state-root.js +1 -1
- package/dist/storage/state-root.js.map +1 -0
- package/package.json +1 -1
- package/dist/engine/storage/daemon/control-token.d.ts.map +0 -1
- package/dist/engine/storage/daemon/control-token.js.map +0 -1
- package/dist/engine/storage/daemon/manager-lock.d.ts.map +0 -1
- package/dist/engine/storage/daemon/manager-lock.js.map +0 -1
- package/dist/engine/storage/daemon/release-files.d.ts.map +0 -1
- package/dist/engine/storage/daemon/release-files.js.map +0 -1
- package/dist/engine/storage/daemon/version-data.d.ts.map +0 -1
- package/dist/engine/storage/daemon/version-data.js.map +0 -1
- package/dist/engine/storage/files/output-file.d.ts.map +0 -1
- package/dist/engine/storage/files/output-file.js.map +0 -1
- package/dist/engine/storage/state-directory.d.ts.map +0 -1
- package/dist/engine/storage/state-directory.js.map +0 -1
- package/dist/engine/storage/state-root-layout.d.ts.map +0 -1
- package/dist/engine/storage/state-root-layout.js.map +0 -1
- package/dist/engine/storage/state-root.d.ts.map +0 -1
- package/dist/engine/storage/state-root.js.map +0 -1
- /package/dist/{engine/storage → storage}/daemon/release-files.d.ts +0 -0
- /package/dist/{engine/storage → storage}/daemon/release-files.js +0 -0
- /package/dist/{engine/storage → storage}/files/output-file.d.ts +0 -0
- /package/dist/{engine/storage → storage}/state-directory.d.ts +0 -0
- /package/dist/{engine/storage → storage}/state-directory.js +0 -0
- /package/dist/{engine/storage → storage}/state-root-layout.d.ts +0 -0
- /package/dist/{engine/storage → storage}/state-root-layout.js +0 -0
- /package/dist/{engine/storage → storage}/state-root.d.ts +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function installationPointerPath(applicationDirectory: string): string;
|
|
2
|
+
export declare function installationPointerPath(engineDataDir: string): string;
|
|
4
3
|
declare const installationDirectorySchema: z.core.$ZodBranded<z.ZodString, "InstallationDirectory", "out">;
|
|
5
|
-
/** One
|
|
4
|
+
/** One data directory selected by the current pointer. */
|
|
6
5
|
export type InstallationDirectory = z.infer<typeof installationDirectorySchema>;
|
|
7
|
-
export declare function installationDirectory(
|
|
6
|
+
export declare function installationDirectory(engineDataDir: string, installationId: string): InstallationDirectory;
|
|
8
7
|
export declare function connectionDirectory(installationDirectory: string): string;
|
|
9
8
|
export declare function connectionFilePath(connectionDirectory: string, connectionId: string): string;
|
|
10
9
|
/** Channel index files are named by a hash, so a channel ID never becomes part of a path. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation-files.d.ts","sourceRoot":"","sources":["../../../../src/engine/storage/installation/installation-files.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"installation-files.d.ts","sourceRoot":"","sources":["../../../../src/engine/storage/installation/installation-files.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CA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,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtF;AAED,wBAAsB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAEzF;AAED,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAExE"}
|
|
@@ -3,20 +3,16 @@ import { mkdir, open, readdir, rename, unlink, writeFile } from "node:fs/promise
|
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { isNodeError } from "../../util/node-error.js";
|
|
6
|
-
|
|
7
|
-
// One application's installations live in `<root>/installations/<applicationId>/`. `current.json`
|
|
6
|
+
// Engine data lives beneath its explicitly selected data directory. `current.json`
|
|
8
7
|
// points at the current installation, whose directory keeps one file per saved connection in
|
|
9
8
|
// `connections/` and one index file per relay channel in `channels/`.
|
|
10
9
|
const MAXIMUM_FILE_BYTES = 16 * 1024;
|
|
11
|
-
export function
|
|
12
|
-
return join(
|
|
13
|
-
}
|
|
14
|
-
export function installationPointerPath(applicationDirectory) {
|
|
15
|
-
return join(applicationDirectory, "current.json");
|
|
10
|
+
export function installationPointerPath(engineDataDir) {
|
|
11
|
+
return join(engineDataDir, "current.json");
|
|
16
12
|
}
|
|
17
13
|
const installationDirectorySchema = z.string().brand();
|
|
18
|
-
export function installationDirectory(
|
|
19
|
-
return installationDirectorySchema.parse(join(
|
|
14
|
+
export function installationDirectory(engineDataDir, installationId) {
|
|
15
|
+
return installationDirectorySchema.parse(join(engineDataDir, installationId));
|
|
20
16
|
}
|
|
21
17
|
export function connectionDirectory(installationDirectory) {
|
|
22
18
|
return join(installationDirectory, "connections");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation-files.js","sourceRoot":"","sources":["../../../../src/engine/storage/installation/installation-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAmB,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"installation-files.js","sourceRoot":"","sources":["../../../../src/engine/storage/installation/installation-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAmB,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,mFAAmF;AACnF,6FAA6F;AAC7F,sEAAsE;AAEtE,MAAM,kBAAkB,GAAG,EAAE,GAAG,IAAI,CAAC;AAErC,MAAM,UAAU,uBAAuB,CAAC,aAAqB;IACzD,OAAO,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAA2B,CAAC;AAKhF,MAAM,UAAU,qBAAqB,CAAC,aAAqB,EAAE,cAAsB;IAC/E,OAAO,2BAA2B,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,qBAA6B;IAC7D,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Y;IACrD,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -1,31 +1,7 @@
|
|
|
1
1
|
export declare const DAEMON_LOG_FILENAME = "daemon.log";
|
|
2
2
|
export declare const WORKER_LIFECYCLE_LOG_FILENAME = "worker-lifecycle.log";
|
|
3
3
|
export declare function unhandledRejectionLogFilename(role: "manager" | "worker"): string;
|
|
4
|
-
export declare function logDirectory(
|
|
5
|
-
|
|
6
|
-
export declare function processLogPaths(stateDirectory: string): readonly string[];
|
|
7
|
-
/** A log's text, or null when it is absent, mid-rotation, or owned by another process and unreadable. */
|
|
4
|
+
export declare function logDirectory(dataDirectory: string): string;
|
|
5
|
+
export declare function processLogPaths(dataDirectory: string): readonly string[];
|
|
8
6
|
export declare function readLogText(path: string): string | null;
|
|
9
|
-
/**
|
|
10
|
-
* Resolve the installation log directories. The installation store produces two
|
|
11
|
-
* shapes: `<root>/installations/<appId>/<installationId>` for the control
|
|
12
|
-
* installation, and the same path under `versions/<version>/` for a version-
|
|
13
|
-
* scoped CLI installation. These are enumerated instead of walked, because the
|
|
14
|
-
* state root also holds Agent adapters with their own node_modules trees.
|
|
15
|
-
*
|
|
16
|
-
* Directories that exist but cannot be read are added to `unreadable`, relative to `root`.
|
|
17
|
-
*/
|
|
18
|
-
export declare function findLogDirectories(root: string, unreadable: string[], signal: AbortSignal): Promise<readonly string[]>;
|
|
19
|
-
/** The log file names in a log directory. An unreadable directory is added to `unreadable`, relative to `root`. */
|
|
20
|
-
export declare function listLogFiles(directory: string, root: string, unreadable: string[]): Promise<readonly string[]>;
|
|
21
|
-
export type OwnedLogFileRead = {
|
|
22
|
-
readonly kind: "read";
|
|
23
|
-
readonly content: string;
|
|
24
|
-
} | {
|
|
25
|
-
readonly kind: "skipped";
|
|
26
|
-
} | {
|
|
27
|
-
readonly kind: "unreadable";
|
|
28
|
-
};
|
|
29
|
-
/** Reads a log file this user owns. Absent files, links and other users' files are skipped. */
|
|
30
|
-
export declare function readOwnedLogFile(path: string, signal: AbortSignal): Promise<OwnedLogFileRead>;
|
|
31
7
|
//# sourceMappingURL=log-files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-files.d.ts","sourceRoot":"","sources":["../../../../src/engine/storage/logs/log-files.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"log-files.d.ts","sourceRoot":"","sources":["../../../../src/engine/storage/logs/log-files.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAChD,eAAO,MAAM,6BAA6B,yBAAyB,CAAC;AAEpE,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,CAEhF;AAED,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAMxE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMvD"}
|
|
@@ -1,25 +1,20 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
|
-
import {
|
|
3
|
-
import { join, relative } from "node:path";
|
|
4
|
-
// Every installation keeps its logs in `<state directory>/logs/`. The Runtime writes `daemon.log`, and
|
|
5
|
-
// the daemon manager writes the worker lifecycle log and one unhandled-rejection log per process role.
|
|
2
|
+
import { join } from "node:path";
|
|
6
3
|
export const DAEMON_LOG_FILENAME = "daemon.log";
|
|
7
4
|
export const WORKER_LIFECYCLE_LOG_FILENAME = "worker-lifecycle.log";
|
|
8
5
|
export function unhandledRejectionLogFilename(role) {
|
|
9
6
|
return `unhandled-rejections-${role}.log`;
|
|
10
7
|
}
|
|
11
|
-
export function logDirectory(
|
|
12
|
-
return join(
|
|
8
|
+
export function logDirectory(dataDirectory) {
|
|
9
|
+
return join(dataDirectory, "logs");
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
export function processLogPaths(stateDirectory) {
|
|
11
|
+
export function processLogPaths(dataDirectory) {
|
|
16
12
|
return [
|
|
17
13
|
WORKER_LIFECYCLE_LOG_FILENAME,
|
|
18
14
|
unhandledRejectionLogFilename("manager"),
|
|
19
15
|
unhandledRejectionLogFilename("worker"),
|
|
20
|
-
].map((filename) => join(logDirectory(
|
|
16
|
+
].map((filename) => join(logDirectory(dataDirectory), filename));
|
|
21
17
|
}
|
|
22
|
-
/** A log's text, or null when it is absent, mid-rotation, or owned by another process and unreadable. */
|
|
23
18
|
export function readLogText(path) {
|
|
24
19
|
try {
|
|
25
20
|
return readFileSync(path, "utf8");
|
|
@@ -28,122 +23,4 @@ export function readLogText(path) {
|
|
|
28
23
|
return null;
|
|
29
24
|
}
|
|
30
25
|
}
|
|
31
|
-
const LOG_FILE_NAME_PATTERN = /^[\w.-]{1,128}\.log$/u;
|
|
32
|
-
const INSTALLATIONS_DIRECTORY = "installations";
|
|
33
|
-
const VERSIONS_DIRECTORY = "versions";
|
|
34
|
-
/** True when a path is legitimately absent, rather than present and unreadable. */
|
|
35
|
-
function isAbsent(cause) {
|
|
36
|
-
return typeof cause === "object" && cause !== null && Reflect.get(cause, "code") === "ENOENT";
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Resolve the installation log directories. The installation store produces two
|
|
40
|
-
* shapes: `<root>/installations/<appId>/<installationId>` for the control
|
|
41
|
-
* installation, and the same path under `versions/<version>/` for a version-
|
|
42
|
-
* scoped CLI installation. These are enumerated instead of walked, because the
|
|
43
|
-
* state root also holds Agent adapters with their own node_modules trees.
|
|
44
|
-
*
|
|
45
|
-
* Directories that exist but cannot be read are added to `unreadable`, relative to `root`.
|
|
46
|
-
*/
|
|
47
|
-
export async function findLogDirectories(root, unreadable, signal) {
|
|
48
|
-
const versions = join(root, VERSIONS_DIRECTORY);
|
|
49
|
-
const installationsRoots = [join(root, INSTALLATIONS_DIRECTORY)];
|
|
50
|
-
for (const version of await listDirectories(versions, root, unreadable, signal)) {
|
|
51
|
-
installationsRoots.push(join(versions, version, INSTALLATIONS_DIRECTORY));
|
|
52
|
-
}
|
|
53
|
-
const found = [];
|
|
54
|
-
for (const installations of installationsRoots) {
|
|
55
|
-
for (const applicationId of await listDirectories(installations, root, unreadable, signal)) {
|
|
56
|
-
const application = join(installations, applicationId);
|
|
57
|
-
for (const installationId of await listDirectories(application, root, unreadable, signal)) {
|
|
58
|
-
const logs = join(application, installationId, "logs");
|
|
59
|
-
const status = await directoryStatus(logs);
|
|
60
|
-
if (status === "listed") {
|
|
61
|
-
found.push(logs);
|
|
62
|
-
}
|
|
63
|
-
else if (status === "unreadable") {
|
|
64
|
-
unreadable.push(relative(root, logs));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return found;
|
|
70
|
-
}
|
|
71
|
-
async function listDirectories(path, root, unreadable, signal) {
|
|
72
|
-
signal.throwIfAborted();
|
|
73
|
-
try {
|
|
74
|
-
const entries = await readdir(path, { withFileTypes: true });
|
|
75
|
-
return entries.filter((entry) => entry.isDirectory() && !entry.isSymbolicLink()).map((entry) => entry.name);
|
|
76
|
-
}
|
|
77
|
-
catch (cause) {
|
|
78
|
-
// A state root that has never been used has no installations directory;
|
|
79
|
-
// anything else is a failure to collect from, not an absence of logs.
|
|
80
|
-
if (!isAbsent(cause)) {
|
|
81
|
-
unreadable.push(relative(root, path));
|
|
82
|
-
}
|
|
83
|
-
return [];
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/** The log file names in a log directory. An unreadable directory is added to `unreadable`, relative to `root`. */
|
|
87
|
-
export async function listLogFiles(directory, root, unreadable) {
|
|
88
|
-
try {
|
|
89
|
-
const entries = await readdir(directory, { withFileTypes: true });
|
|
90
|
-
return entries
|
|
91
|
-
.filter((entry) => entry.isFile() && !entry.isSymbolicLink() && LOG_FILE_NAME_PATTERN.test(entry.name))
|
|
92
|
-
.map((entry) => entry.name)
|
|
93
|
-
.sort();
|
|
94
|
-
}
|
|
95
|
-
catch (cause) {
|
|
96
|
-
if (!isAbsent(cause)) {
|
|
97
|
-
unreadable.push(relative(root, directory));
|
|
98
|
-
}
|
|
99
|
-
return [];
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Classify a directory without changing it. Symlinks are rejected so a planted
|
|
104
|
-
* link cannot redirect the report outside the state root, and the owner check
|
|
105
|
-
* keeps another user's files out of it; both are deliberate exclusions rather
|
|
106
|
-
* than collection failures.
|
|
107
|
-
*/
|
|
108
|
-
async function directoryStatus(path) {
|
|
109
|
-
let metadata;
|
|
110
|
-
try {
|
|
111
|
-
metadata = await lstat(path);
|
|
112
|
-
}
|
|
113
|
-
catch (cause) {
|
|
114
|
-
return isAbsent(cause) ? "skipped" : "unreadable";
|
|
115
|
-
}
|
|
116
|
-
if (!metadata.isDirectory() || metadata.isSymbolicLink() || !ownedByCurrentUser(metadata)) {
|
|
117
|
-
return "skipped";
|
|
118
|
-
}
|
|
119
|
-
return "listed";
|
|
120
|
-
}
|
|
121
|
-
/** Reads a log file this user owns. Absent files, links and other users' files are skipped. */
|
|
122
|
-
export async function readOwnedLogFile(path, signal) {
|
|
123
|
-
let metadata;
|
|
124
|
-
try {
|
|
125
|
-
metadata = await lstat(path);
|
|
126
|
-
}
|
|
127
|
-
catch (cause) {
|
|
128
|
-
return isAbsent(cause) ? { kind: "skipped" } : { kind: "unreadable" };
|
|
129
|
-
}
|
|
130
|
-
if (!metadata.isFile() || metadata.isSymbolicLink() || !ownedByCurrentUser(metadata)) {
|
|
131
|
-
return { kind: "skipped" };
|
|
132
|
-
}
|
|
133
|
-
try {
|
|
134
|
-
return { kind: "read", content: await readFile(path, { encoding: "utf8", signal }) };
|
|
135
|
-
}
|
|
136
|
-
catch (cause) {
|
|
137
|
-
// Cancellation is not evidence about the file: let it propagate so the
|
|
138
|
-
// command fails as aborted rather than reporting a healthy log as broken.
|
|
139
|
-
if (signal.aborted) {
|
|
140
|
-
throw cause;
|
|
141
|
-
}
|
|
142
|
-
return { kind: "unreadable" };
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
function ownedByCurrentUser(metadata) {
|
|
146
|
-
// Windows reports uid 0 for every file, so ownership is not a signal there.
|
|
147
|
-
return process.getuid === undefined || metadata.uid === process.getuid();
|
|
148
|
-
}
|
|
149
26
|
//# sourceMappingURL=log-files.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-files.js","sourceRoot":"","sources":["../../../../src/engine/storage/logs/log-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"log-files.js","sourceRoot":"","sources":["../../../../src/engine/storage/logs/log-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAChD,MAAM,CAAC,MAAM,6BAA6B,GAAG,sBAAsB,CAAC;AAEpE,MAAM,UAAU,6BAA6B,CAAC,IAA0B;IACpE,OAAO,wBAAwB,IAAI,MAAM,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,aAAqB;IAC9C,OAAO,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,aAAqB;IACjD,OAAO;QACH,6BAA6B;QAC7B,6BAA6B,CAAC,SAAS,CAAC;QACxC,6BAA6B,CAAC,QAAQ,CAAC;KAC1C,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAY;IACpC,IAAI,CAAC;QACD,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC"}
|