@evomap/evolver-cli 2.0.48 → 2.0.49
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/autoDistillTranscript.d.ts +1 -1
- package/dist/autoDistillTranscript.js +9 -2
- package/dist/autoexec.js +3 -0
- package/dist/cliContracts.js +5 -28
- package/dist/cycleConsumer.js +3 -0
- package/dist/distillAdmission.d.ts +8 -1
- package/dist/distillAdmission.js +30 -0
- package/dist/distillObserver.d.ts +0 -6
- package/dist/distillObserver.js +17 -5
- package/dist/distillPrimitives.d.ts +4 -3
- package/dist/distillPrimitives.js +27 -18
- package/dist/doctor.d.ts +3 -0
- package/dist/doctor.js +17 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -0
- package/dist/lifecycle.d.ts +9 -0
- package/dist/lifecycle.js +158 -98
- package/dist/lifecycleAutoexecCompanion.d.ts +40 -0
- package/dist/lifecycleAutoexecCompanion.js +102 -0
- package/dist/llmCycle.js +15 -5
- package/dist/localMemoryGraph.js +23 -19
- package/dist/promptRecallRuntime.d.ts +3 -0
- package/dist/promptRecallRuntime.js +6 -0
- package/dist/promptRecallShared.d.ts +2 -0
- package/dist/promptRecallShared.js +13 -3
- package/dist/protectedAuditStatus.d.ts +22 -0
- package/dist/protectedAuditStatus.js +234 -0
- package/dist/recall.js +2 -3
- package/dist/runtimeCapabilities.d.ts +1 -1
- package/dist/runtimeCapabilities.js +24 -0
- package/dist/runtimeSessionSource.js +4 -4
- package/dist/sessionIngest.js +3 -0
- package/dist/setupHooks.d.ts +3 -0
- package/dist/setupHooks.js +29 -5
- package/dist/trajectoryExport.js +2 -2
- package/package.json +7 -7
package/dist/lifecycle.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
2
|
import { spawn, spawnSync, execFileSync } from 'node:child_process';
|
|
3
3
|
import { createHash, randomUUID } from 'node:crypto';
|
|
4
|
-
import { closeSync, constants, existsSync, fstatSync, lstatSync, mkdirSync, openSync, readFileSync, readSync, rmSync, writeFileSync, } from 'node:fs';
|
|
4
|
+
import { closeSync, constants, existsSync, fstatSync, lstatSync, mkdirSync, openSync, readFileSync, readSync, realpathSync, rmSync, writeFileSync, } from 'node:fs';
|
|
5
5
|
import { homedir } from 'node:os';
|
|
6
6
|
import { basename, dirname, extname, isAbsolute, join, posix, resolve as resolvePath, win32 } from 'node:path';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
|
-
import { bootstrap as coreBootstrap, util as coreUtil } from '@evomap/evolver-core';
|
|
8
|
+
import { bootstrap as coreBootstrap, events as coreEvents, util as coreUtil } from '@evomap/evolver-core';
|
|
9
|
+
import { activateAutoexecCompanion, autoexecCompanionActions, } from './lifecycleAutoexecCompanion.js';
|
|
10
|
+
import { protectedAuditInstallReport, } from './protectedAuditStatus.js';
|
|
9
11
|
import { expandHomePath, loadEnvFile, loadEnvFileFromEnv, parseEnvFile } from '@evomap/evolver-mcp';
|
|
10
12
|
import { acquireBootstrapOwnerLock, acquireBootstrapReadinessLock, adoptLegacyBootstrapMarker, applyBootstrapCanonicalQuarantine, assertTrustedArtifactParent, assertActiveBootstrapRegistrationIntentToken, assertPlannedArtifactsAbsent, assertBootstrapTransactionClaimsAbsent, bootstrapArtifactClaimPath, bootstrapArtifactContentIdentityForFile, bootstrapArtifactIdentityForBytes, bootstrapJournalPath, bootstrapJournalFromMarker, bootstrapJournalManagerArtifactPath, bootstrapMarkerPath, bootstrapReadinessPath, captureBootstrapArtifactIdentities, createLegacyBootstrapRemovalJournal, createBootstrapJournal, ensureBootstrapManualTransition, finalizeBootstrapCanonicalQuarantine, planBootstrapCanonicalQuarantine, readBootstrapJournal, readBootstrapArtifactFile, readLegacyBootstrapMarker, readBootstrapManualTransition, readBootstrapMarker, readBootstrapReadiness, recordPublishedBootstrapArtifact, removeBootstrapJournal, removeBootstrapManualTransition, removeBootstrapReadiness, removeDurableFile, removeOwnedBootstrapArtifacts, restoreBootstrapCanonicalQuarantine, updateBootstrapJournal, writeBootstrapJournal, writeDurableBytesExclusive, writeDurableJsonExclusive, writeDurableTextExclusive, LEGACY_BOOTSTRAP_REMOVAL_OPERATION, } from './lifecycleBootstrapTransaction.js';
|
|
11
13
|
import { cleanupLegacyWindowsDaemonTasks, legacyTaskProbeSkipped, restoreLegacyTaskPreimage, sweepLegacyWindowsDaemonTasksAfterBootstrap, LEGACY_TASK_SKIP_ENV, } from './windowsLegacyTaskCleanup.js';
|
|
@@ -43,7 +45,8 @@ const LAUNCHCTL_DOMAIN_NOT_FOUND_STATUS = 112;
|
|
|
43
45
|
const LAUNCHCTL_SERVICE_NOT_FOUND_STATUS = 113;
|
|
44
46
|
const UNIX_RECOVERY_CONTROLLER_FILENAME = 'evolver-recovery-controller';
|
|
45
47
|
const HOST_WINDOWS_SYSTEM_ROOT = process.env['SystemRoot']?.trim() || 'C:\\Windows';
|
|
46
|
-
const
|
|
48
|
+
const INSTALL_SERVICE_OPTIONS = new Set(['target', 'dry-run', 'env-file', 'cwd', 'autoexec-home']);
|
|
49
|
+
const LIFECYCLE_USAGE = 'Usage: evolver lifecycle <start|stop|restart|status|check|watch|install-service --target=launchd|systemd|windows [--autoexec-home=<path>]|remove-service --target=launchd|systemd|windows [--dry-run] [--env-file=<path>]|bootstrap [--target=launchd|systemd|windows] [--dry-run]|remove-autoexec-service --target=launchd|systemd|windows [--dry-run]|cleanup-legacy-tasks [--dry-run]|restore-legacy-task-preimage --preimage=<path>>\n';
|
|
47
50
|
export function selectExistingPosixCommand(candidates, exists = existsSync) {
|
|
48
51
|
if (candidates.length === 0 || candidates.some((candidate) => !posix.isAbsolute(candidate))) {
|
|
49
52
|
throw new Error('trusted command candidates must be non-empty absolute POSIX paths');
|
|
@@ -245,6 +248,10 @@ async function runLifecycleCommandInner(argv, deps) {
|
|
|
245
248
|
return 0;
|
|
246
249
|
}
|
|
247
250
|
case 'install-service': {
|
|
251
|
+
const unknownOption = Object.keys(flags).find((name) => !INSTALL_SERVICE_OPTIONS.has(name));
|
|
252
|
+
if (unknownOption !== undefined) {
|
|
253
|
+
throw new Error(`lifecycle install-service received an unknown option --${unknownOption}`);
|
|
254
|
+
}
|
|
248
255
|
if (flags['dry-run'] !== undefined && flags['dry-run'] !== true) {
|
|
249
256
|
throw new Error('--dry-run is a boolean flag and does not accept a value');
|
|
250
257
|
}
|
|
@@ -295,8 +302,7 @@ async function runLifecycleCommandInner(argv, deps) {
|
|
|
295
302
|
if (readiness && (!marker || readiness.transactionId !== marker.transactionId)) {
|
|
296
303
|
throw new Error('install-service refused inconsistent committed bootstrap readiness; run lifecycle bootstrap recovery');
|
|
297
304
|
}
|
|
298
|
-
|
|
299
|
-
throw new Error(`install-service cannot rewrite a committed proxy service; use lifecycle remove-service --target=${target}, then lifecycle install-service --target=${target}${autoexecSuffix}; service downtime is expected between commands`);
|
|
305
|
+
throw new Error(`install-service cannot rewrite a committed proxy service; use lifecycle remove-service --target=${target}, then lifecycle install-service --target=${target}; service downtime is expected between commands`);
|
|
300
306
|
}
|
|
301
307
|
if (readiness) {
|
|
302
308
|
throw new Error('install-service refused while first-run bootstrap readiness is active; run lifecycle bootstrap recovery');
|
|
@@ -1433,9 +1439,6 @@ function parseBootstrapFlags(argv) {
|
|
|
1433
1439
|
}
|
|
1434
1440
|
const separator = argument.indexOf('=');
|
|
1435
1441
|
const name = argument.slice(2, separator >= 0 ? separator : undefined);
|
|
1436
|
-
if (name === 'with-autoexec' || name === 'autoexec-home') {
|
|
1437
|
-
throw new Error('lifecycle bootstrap manages only the proxy supervisor; --with-autoexec and --autoexec-home are unsupported and no artifacts were changed');
|
|
1438
|
-
}
|
|
1439
1442
|
if (!['target', 'env-file', 'cwd', 'dry-run'].includes(name)) {
|
|
1440
1443
|
throw new Error('lifecycle bootstrap received an unknown option');
|
|
1441
1444
|
}
|
|
@@ -1868,22 +1871,11 @@ async function assertNoActiveDurableSelfUpdateRecovery(input) {
|
|
|
1868
1871
|
async function installService(target, flags, env, argv1, loadUnixRecoveryController = () => import('@evomap/evolver-proxy'), options = {}) {
|
|
1869
1872
|
const dryRun = flags['dry-run'] === true;
|
|
1870
1873
|
const lifecycleStateDir = lifecyclePaths(env).stateDir;
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
}
|
|
1877
|
-
const withAutoexec = flags['with-autoexec'] === true;
|
|
1878
|
-
if (!withAutoexec && flags['autoexec-home'] !== undefined) {
|
|
1879
|
-
throw new Error('--autoexec-home requires --with-autoexec');
|
|
1880
|
-
}
|
|
1881
|
-
const configuredEnvFile = typeof flags['env-file'] === 'string'
|
|
1882
|
-
? flags['env-file'].trim()
|
|
1883
|
-
: nonBlankEnv(env, 'EVOLVER_ENV_FILE');
|
|
1884
|
-
const envFile = configuredEnvFile
|
|
1885
|
-
? resolvePath(expandHomePath(configuredEnvFile))
|
|
1886
|
-
: undefined;
|
|
1874
|
+
const envFile = serviceEnvFile(flags, env);
|
|
1875
|
+
const companionWorkingDirectory = serviceWorkingDirectory(flags);
|
|
1876
|
+
const companion = options.proxyOnly
|
|
1877
|
+
? undefined
|
|
1878
|
+
: planAutoexecCompanion(target, flags, env, argv1, envFile, companionWorkingDirectory);
|
|
1887
1879
|
const supervised = configuredSelfUpdateTarget(env)
|
|
1888
1880
|
? resolveDaemonCommand(env, process.execPath, argv1)
|
|
1889
1881
|
: resolveSelfUpdatingExecutable(process.execPath, argv1);
|
|
@@ -1926,28 +1918,9 @@ async function installService(target, flags, env, argv1, loadUnixRecoveryControl
|
|
|
1926
1918
|
unixControllerStateDir = dirname(dirname(controllerPath));
|
|
1927
1919
|
}
|
|
1928
1920
|
const serviceCommand = unixController ?? supervised;
|
|
1929
|
-
const
|
|
1930
|
-
if (autoexecHomeFlag !== undefined && !autoexecHomeFlag) {
|
|
1931
|
-
throw new Error('--autoexec-home requires a non-empty path');
|
|
1932
|
-
}
|
|
1933
|
-
const companionWorkingDirectoryFlag = typeof flags['cwd'] === 'string'
|
|
1934
|
-
? assertSingleLine(flags['cwd'].trim(), 'service working directory')
|
|
1935
|
-
: undefined;
|
|
1936
|
-
const companionWorkingDirectory = companionWorkingDirectoryFlag
|
|
1937
|
-
? (isAbsolute(companionWorkingDirectoryFlag) ? companionWorkingDirectoryFlag : resolvePath(companionWorkingDirectoryFlag))
|
|
1938
|
-
: process.cwd();
|
|
1939
|
-
const autoexecHome = autoexecHomeFlag
|
|
1940
|
-
? assertSingleLine(isAbsolute(autoexecHomeFlag) ? autoexecHomeFlag : resolvePath(companionWorkingDirectory, autoexecHomeFlag), 'autoexec home')
|
|
1941
|
-
: undefined;
|
|
1942
|
-
const autoexecCommand = withAutoexec
|
|
1943
|
-
? resolveAutoexecDaemonCommand(env, process.execPath, argv1, autoexecHome)
|
|
1944
|
-
: undefined;
|
|
1945
|
-
if (withAutoexec && !autoexecCommand) {
|
|
1946
|
-
throw new Error('cannot resolve the current evolver CLI for --with-autoexec; pass a standalone Evolver binary or run through cli.js');
|
|
1947
|
-
}
|
|
1921
|
+
const autoexecHome = companion?.autoexecHome;
|
|
1948
1922
|
if (target === 'systemd') {
|
|
1949
1923
|
const path = expandHome('~/.config/systemd/user/evolver-proxy.service');
|
|
1950
|
-
const autoexecPath = expandHome('~/.config/systemd/user/evolver-autoexec.service');
|
|
1951
1924
|
const workingDirectory = typeof flags['cwd'] === 'string' ? flags['cwd'] : undefined;
|
|
1952
1925
|
const unit = renderSystemdUnit({
|
|
1953
1926
|
envFile,
|
|
@@ -1962,23 +1935,14 @@ async function installService(target, flags, env, argv1, loadUnixRecoveryControl
|
|
|
1962
1935
|
});
|
|
1963
1936
|
if (!dryRun)
|
|
1964
1937
|
writeServiceArtifact(path, unit, 0o644, options);
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
autoexecUnit = renderAutoexecSystemdUnit({
|
|
1968
|
-
envFile,
|
|
1969
|
-
workingDirectory: companionWorkingDirectory,
|
|
1970
|
-
execStart: [autoexecCommand.command, ...autoexecCommand.args].map(quoteSystemdArg).join(' '),
|
|
1971
|
-
});
|
|
1972
|
-
if (!dryRun)
|
|
1973
|
-
writeServiceArtifact(autoexecPath, autoexecUnit, 0o644, options);
|
|
1974
|
-
}
|
|
1938
|
+
if (companion && !dryRun)
|
|
1939
|
+
writeServiceArtifact(companion.path, companion.content, 0o644, options);
|
|
1975
1940
|
return {
|
|
1976
1941
|
status: dryRun ? 'rendered' : 'installed',
|
|
1977
|
-
files: [path, ...(
|
|
1978
|
-
bootstrapArtifacts: [path, ...(
|
|
1942
|
+
files: [path, ...(companion ? [companion.path] : []), ...(unixController ? [unixController.command] : [])],
|
|
1943
|
+
bootstrapArtifacts: [path, ...(unixController ? [unixController.command] : [])],
|
|
1979
1944
|
bootstrapArtifactIdentities: expectedBootstrapArtifactIdentities([
|
|
1980
1945
|
[path, unit],
|
|
1981
|
-
...(autoexecUnit ? [[autoexecPath, autoexecUnit]] : []),
|
|
1982
1946
|
...(unixController && standaloneTarget && existsSync(standaloneTarget)
|
|
1983
1947
|
? [[unixController.command, { sourcePath: standaloneTarget }]]
|
|
1984
1948
|
: []),
|
|
@@ -1989,9 +1953,8 @@ async function installService(target, flags, env, argv1, loadUnixRecoveryControl
|
|
|
1989
1953
|
}
|
|
1990
1954
|
if (target === 'launchd') {
|
|
1991
1955
|
const path = expandHome('~/Library/LaunchAgents/com.evomap.evolver-proxy.plist');
|
|
1992
|
-
const autoexecPath = expandHome('~/Library/LaunchAgents/com.evomap.evolver-autoexec.plist');
|
|
1993
1956
|
const workingDirectory = companionWorkingDirectory;
|
|
1994
|
-
const logDir =
|
|
1957
|
+
const logDir = launchdLogDir();
|
|
1995
1958
|
const plist = renderLaunchdPlist({
|
|
1996
1959
|
envFile,
|
|
1997
1960
|
lifecycleStateDir,
|
|
@@ -2008,24 +1971,14 @@ async function installService(target, flags, env, argv1, loadUnixRecoveryControl
|
|
|
2008
1971
|
});
|
|
2009
1972
|
if (!dryRun)
|
|
2010
1973
|
writeServiceArtifact(path, plist, 0o644, options);
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
autoexecPlist = renderAutoexecLaunchdPlist({
|
|
2014
|
-
envFile,
|
|
2015
|
-
workingDirectory,
|
|
2016
|
-
programArguments: [autoexecCommand.command, ...autoexecCommand.args],
|
|
2017
|
-
logDir,
|
|
2018
|
-
});
|
|
2019
|
-
if (!dryRun)
|
|
2020
|
-
writeServiceArtifact(autoexecPath, autoexecPlist, 0o644, options);
|
|
2021
|
-
}
|
|
1974
|
+
if (companion && !dryRun)
|
|
1975
|
+
writeServiceArtifact(companion.path, companion.content, 0o644, options);
|
|
2022
1976
|
return {
|
|
2023
1977
|
status: dryRun ? 'rendered' : 'installed',
|
|
2024
|
-
files: [path, ...(
|
|
2025
|
-
bootstrapArtifacts: [path, ...(
|
|
1978
|
+
files: [path, ...(companion ? [companion.path] : []), ...(unixController ? [unixController.command] : [])],
|
|
1979
|
+
bootstrapArtifacts: [path, ...(unixController ? [unixController.command] : [])],
|
|
2026
1980
|
bootstrapArtifactIdentities: expectedBootstrapArtifactIdentities([
|
|
2027
1981
|
[path, plist],
|
|
2028
|
-
...(autoexecPlist ? [[autoexecPath, autoexecPlist]] : []),
|
|
2029
1982
|
...(unixController && standaloneTarget && existsSync(standaloneTarget)
|
|
2030
1983
|
? [[unixController.command, { sourcePath: standaloneTarget }]]
|
|
2031
1984
|
: []),
|
|
@@ -2035,7 +1988,7 @@ async function installService(target, flags, env, argv1, loadUnixRecoveryControl
|
|
|
2035
1988
|
};
|
|
2036
1989
|
}
|
|
2037
1990
|
let path = expandHome('~/install-evolver-proxy-windows.ps1');
|
|
2038
|
-
let autoexecPath =
|
|
1991
|
+
let autoexecPath = companion?.path;
|
|
2039
1992
|
const selfUpdateStateDir = env['EVOLVER_SELF_UPDATE_STATE_DIR']?.trim();
|
|
2040
1993
|
const standalone = standaloneTarget;
|
|
2041
1994
|
const bootstrapArtifacts = windowsBootstrapArtifacts(path, standalone, selfUpdateStateDir, env, options.exclusive === true);
|
|
@@ -2095,30 +2048,98 @@ async function installService(target, flags, env, argv1, loadUnixRecoveryControl
|
|
|
2095
2048
|
path = writeWindowsHelper(path, script);
|
|
2096
2049
|
}
|
|
2097
2050
|
}
|
|
2098
|
-
if (
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
...(standaloneAutoexec
|
|
2102
|
-
? { evolverBin: autoexecCommand.command }
|
|
2103
|
-
: { nodePath: autoexecCommand.command, cliBin: autoexecCommand.args[0] }),
|
|
2104
|
-
...(envFile ? { envFile } : {}),
|
|
2105
|
-
...(autoexecHome ? { autoexecHome } : {}),
|
|
2106
|
-
workingDirectory: companionWorkingDirectory,
|
|
2107
|
-
});
|
|
2108
|
-
if (!dryRun) {
|
|
2109
|
-
options.assertOwner?.();
|
|
2110
|
-
autoexecPath = writeWindowsHelper(autoexecPath, autoexecScript);
|
|
2111
|
-
}
|
|
2051
|
+
if (companion && !dryRun) {
|
|
2052
|
+
options.assertOwner?.();
|
|
2053
|
+
autoexecPath = writeWindowsHelper(companion.path, companion.content);
|
|
2112
2054
|
}
|
|
2113
2055
|
return {
|
|
2114
2056
|
status: dryRun ? 'rendered' : 'installed',
|
|
2115
|
-
files: [path, ...(
|
|
2057
|
+
files: [path, ...(autoexecPath ? [autoexecPath] : [])],
|
|
2116
2058
|
bootstrapArtifacts,
|
|
2117
2059
|
bootstrapArtifactIdentities: expectedBootstrapArtifactIdentities(windowsIdentityEntries),
|
|
2118
2060
|
service: 'windows-scheduled-task',
|
|
2119
2061
|
...(autoexecHome ? { autoexecHome } : {}),
|
|
2120
2062
|
};
|
|
2121
2063
|
}
|
|
2064
|
+
function serviceEnvFile(flags, env) {
|
|
2065
|
+
const configured = typeof flags['env-file'] === 'string'
|
|
2066
|
+
? flags['env-file'].trim()
|
|
2067
|
+
: nonBlankEnv(env, 'EVOLVER_ENV_FILE');
|
|
2068
|
+
return configured ? resolvePath(expandHomePath(configured)) : undefined;
|
|
2069
|
+
}
|
|
2070
|
+
function serviceWorkingDirectory(flags) {
|
|
2071
|
+
const flag = typeof flags['cwd'] === 'string'
|
|
2072
|
+
? assertSingleLine(flags['cwd'].trim(), 'service working directory')
|
|
2073
|
+
: undefined;
|
|
2074
|
+
if (!flag)
|
|
2075
|
+
return process.cwd();
|
|
2076
|
+
return isAbsolute(flag) ? flag : resolvePath(flag);
|
|
2077
|
+
}
|
|
2078
|
+
function launchdLogDir() {
|
|
2079
|
+
return join(homedir(), 'Library', 'Logs');
|
|
2080
|
+
}
|
|
2081
|
+
function canonicalCliPath(argv1) {
|
|
2082
|
+
if (!argv1)
|
|
2083
|
+
return undefined;
|
|
2084
|
+
try {
|
|
2085
|
+
return realpathSync(argv1);
|
|
2086
|
+
}
|
|
2087
|
+
catch {
|
|
2088
|
+
return undefined;
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
function planAutoexecCompanion(target, flags, env, argv1, envFile, workingDirectory) {
|
|
2092
|
+
if (flags['autoexec-home'] === true)
|
|
2093
|
+
throw new Error('--autoexec-home requires a path');
|
|
2094
|
+
const homeFlag = typeof flags['autoexec-home'] === 'string' ? flags['autoexec-home'].trim() : undefined;
|
|
2095
|
+
if (homeFlag !== undefined && !homeFlag)
|
|
2096
|
+
throw new Error('--autoexec-home requires a non-empty path');
|
|
2097
|
+
const autoexecHome = homeFlag
|
|
2098
|
+
? assertSingleLine(isAbsolute(homeFlag) ? homeFlag : resolvePath(workingDirectory, homeFlag), 'autoexec home')
|
|
2099
|
+
: undefined;
|
|
2100
|
+
// A global npm bin is a symlink named `evolver`; only its target identifies the cli.js entry.
|
|
2101
|
+
const command = resolveAutoexecDaemonCommand(env, process.execPath, argv1, autoexecHome)
|
|
2102
|
+
?? resolveAutoexecDaemonCommand(env, process.execPath, canonicalCliPath(argv1), autoexecHome);
|
|
2103
|
+
if (!command) {
|
|
2104
|
+
throw new Error('cannot resolve the current evolver CLI for the autoexec companion; run a standalone Evolver binary or the cli.js entry');
|
|
2105
|
+
}
|
|
2106
|
+
const home = autoexecHome ? { autoexecHome } : {};
|
|
2107
|
+
if (target === 'systemd') {
|
|
2108
|
+
return {
|
|
2109
|
+
path: expandHome('~/.config/systemd/user/evolver-autoexec.service'),
|
|
2110
|
+
content: renderAutoexecSystemdUnit({
|
|
2111
|
+
envFile,
|
|
2112
|
+
workingDirectory,
|
|
2113
|
+
execStart: [command.command, ...command.args].map(quoteSystemdArg).join(' '),
|
|
2114
|
+
}),
|
|
2115
|
+
...home,
|
|
2116
|
+
};
|
|
2117
|
+
}
|
|
2118
|
+
if (target === 'launchd') {
|
|
2119
|
+
return {
|
|
2120
|
+
path: expandHome('~/Library/LaunchAgents/com.evomap.evolver-autoexec.plist'),
|
|
2121
|
+
content: renderAutoexecLaunchdPlist({
|
|
2122
|
+
envFile,
|
|
2123
|
+
workingDirectory,
|
|
2124
|
+
programArguments: [command.command, ...command.args],
|
|
2125
|
+
logDir: launchdLogDir(),
|
|
2126
|
+
}),
|
|
2127
|
+
...home,
|
|
2128
|
+
};
|
|
2129
|
+
}
|
|
2130
|
+
return {
|
|
2131
|
+
path: expandHome('~/install-evolver-autoexec-windows.ps1'),
|
|
2132
|
+
content: renderWindowsAutoexecInstaller({
|
|
2133
|
+
...(command.args[0] === 'autoexec'
|
|
2134
|
+
? { evolverBin: command.command }
|
|
2135
|
+
: { nodePath: command.command, cliBin: command.args[0] }),
|
|
2136
|
+
...(envFile ? { envFile } : {}),
|
|
2137
|
+
...home,
|
|
2138
|
+
workingDirectory,
|
|
2139
|
+
}),
|
|
2140
|
+
...home,
|
|
2141
|
+
};
|
|
2142
|
+
}
|
|
2122
2143
|
function defaultBootstrapTarget(platform) {
|
|
2123
2144
|
if (platform === 'darwin')
|
|
2124
2145
|
return 'launchd';
|
|
@@ -2138,7 +2159,7 @@ async function adoptLegacyBootstrapService(input) {
|
|
|
2138
2159
|
? probeLegacyWindowsLauncherPath(run, commandTimeout(deadlineMs, now, BOOTSTRAP_ROLLBACK_RESERVE_MS))
|
|
2139
2160
|
: undefined;
|
|
2140
2161
|
assertOwner();
|
|
2141
|
-
const planned = await install(target, { ...installFlags, 'dry-run': true }, env, argv1, loadUnixRecoveryController, { assertOwner });
|
|
2162
|
+
const planned = await install(target, { ...installFlags, 'dry-run': true }, env, argv1, loadUnixRecoveryController, { proxyOnly: true, assertOwner });
|
|
2142
2163
|
assertOwner();
|
|
2143
2164
|
const artifactPlan = legacyBootstrapArtifactPlan(legacy, planned, target, env, lifecyclePaths(env).stateDir, legacyWindowsLauncherPath, false, true, uid);
|
|
2144
2165
|
const receipts = captureLegacyBootstrapArtifactReceipts(artifactPlan.paths, artifactPlan.expected, target, uid);
|
|
@@ -2235,7 +2256,7 @@ async function removeLegacyBootstrapService(input) {
|
|
|
2235
2256
|
? probeLegacyWindowsLauncherPath(run, commandTimeout(deadlineMs, now, BOOTSTRAP_ROLLBACK_RESERVE_MS), managerState !== 'disabled')
|
|
2236
2257
|
: undefined;
|
|
2237
2258
|
assertOwner();
|
|
2238
|
-
const planned = await install(target, { ...installFlags, 'dry-run': true }, env, argv1, loadUnixRecoveryController, { assertOwner });
|
|
2259
|
+
const planned = await install(target, { ...installFlags, 'dry-run': true }, env, argv1, loadUnixRecoveryController, { proxyOnly: true, assertOwner });
|
|
2239
2260
|
assertOwner();
|
|
2240
2261
|
const artifactPlan = legacyBootstrapArtifactPlan(legacy, planned, target, env, stateDir, legacyWindowsLauncherPath, managerState === 'absent', false, uid);
|
|
2241
2262
|
const receipts = captureLegacyBootstrapArtifactReceipts(artifactPlan.paths, artifactPlan.expected, target, uid);
|
|
@@ -2346,9 +2367,6 @@ async function bootstrapService(flags, env, argv1, deps, loadUnixRecoveryControl
|
|
|
2346
2367
|
if (flags['dry-run'] !== undefined && flags['dry-run'] !== true) {
|
|
2347
2368
|
throw new Error('--dry-run is a boolean flag and does not accept a value');
|
|
2348
2369
|
}
|
|
2349
|
-
if (flags['with-autoexec'] !== undefined || flags['autoexec-home'] !== undefined) {
|
|
2350
|
-
throw new Error('lifecycle bootstrap manages only the proxy supervisor; --with-autoexec and --autoexec-home are unsupported and no artifacts were changed');
|
|
2351
|
-
}
|
|
2352
2370
|
const platform = deps.platform ?? process.platform;
|
|
2353
2371
|
const target = typeof flags['target'] === 'string' ? serviceTarget(flags) : defaultBootstrapTarget(platform);
|
|
2354
2372
|
const dryRun = flags['dry-run'] === true;
|
|
@@ -2373,13 +2391,15 @@ async function bootstrapService(flags, env, argv1, deps, loadUnixRecoveryControl
|
|
|
2373
2391
|
};
|
|
2374
2392
|
});
|
|
2375
2393
|
if (dryRun) {
|
|
2376
|
-
const planned = await install(target, { ...installFlags, 'dry-run': true }, env, argv1, loadUnixRecoveryController, { exclusive: true, transactionId });
|
|
2394
|
+
const planned = await install(target, { ...installFlags, 'dry-run': true }, env, argv1, loadUnixRecoveryController, { exclusive: true, proxyOnly: true, transactionId });
|
|
2377
2395
|
const plannedFiles = planned.files ?? [];
|
|
2378
2396
|
return {
|
|
2379
2397
|
status: 'planned',
|
|
2380
2398
|
files: plannedFiles,
|
|
2381
2399
|
service: planned.service,
|
|
2382
2400
|
actions: bootstrapActivationPlan(target, plannedFiles, uid),
|
|
2401
|
+
autoexec: bootstrapAutoexecCompanion(target, installFlags, env, argv1, run, uid, true),
|
|
2402
|
+
...protectedAuditInstallReport((deps.protectedAudit ?? coreEvents.protectedAuditReadiness)()),
|
|
2383
2403
|
};
|
|
2384
2404
|
}
|
|
2385
2405
|
const nativeTarget = platform === 'linux'
|
|
@@ -2485,6 +2505,7 @@ async function bootstrapService(flags, env, argv1, deps, loadUnixRecoveryControl
|
|
|
2485
2505
|
assertForwardMutationBudget(deadlineMs, now());
|
|
2486
2506
|
const expected = await install(target, { ...installFlags, 'dry-run': true }, env, argv1, loadUnixRecoveryController, {
|
|
2487
2507
|
exclusive: true,
|
|
2508
|
+
proxyOnly: true,
|
|
2488
2509
|
transactionId: existingMarker.transactionId,
|
|
2489
2510
|
assertOwner,
|
|
2490
2511
|
});
|
|
@@ -2561,7 +2582,7 @@ async function bootstrapService(flags, env, argv1, deps, loadUnixRecoveryControl
|
|
|
2561
2582
|
}
|
|
2562
2583
|
assertForwardMutationBudget(deadlineMs, now());
|
|
2563
2584
|
assertOwner();
|
|
2564
|
-
const planned = await install(target, { ...installFlags, 'dry-run': true }, env, argv1, loadUnixRecoveryController, { exclusive: true, transactionId, assertOwner });
|
|
2585
|
+
const planned = await install(target, { ...installFlags, 'dry-run': true }, env, argv1, loadUnixRecoveryController, { exclusive: true, proxyOnly: true, transactionId, assertOwner });
|
|
2565
2586
|
assertOwner();
|
|
2566
2587
|
const plannedFiles = planned.files ?? [];
|
|
2567
2588
|
const plannedArtifacts = planned.bootstrapArtifacts ?? plannedFiles;
|
|
@@ -2621,7 +2642,7 @@ async function bootstrapService(flags, env, argv1, deps, loadUnixRecoveryControl
|
|
|
2621
2642
|
}
|
|
2622
2643
|
};
|
|
2623
2644
|
assertOwner();
|
|
2624
|
-
const installed = await install(target, applyFlags, env, argv1, loadUnixRecoveryController, { exclusive: true, transactionId, onArtifactPublished, assertOwner });
|
|
2645
|
+
const installed = await install(target, applyFlags, env, argv1, loadUnixRecoveryController, { exclusive: true, proxyOnly: true, transactionId, onArtifactPublished, assertOwner });
|
|
2625
2646
|
assertOwner();
|
|
2626
2647
|
const files = installed.files ?? [];
|
|
2627
2648
|
const actualArtifacts = installed.bootstrapArtifacts ?? files;
|
|
@@ -2783,7 +2804,46 @@ async function bootstrapService(flags, env, argv1, deps, loadUnixRecoveryControl
|
|
|
2783
2804
|
});
|
|
2784
2805
|
if (!outcome)
|
|
2785
2806
|
throw new Error('bootstrap completed without a lifecycle outcome');
|
|
2786
|
-
return
|
|
2807
|
+
return {
|
|
2808
|
+
...outcome,
|
|
2809
|
+
autoexec: bootstrapAutoexecCompanion(target, installFlags, env, argv1, run, uid, false),
|
|
2810
|
+
...protectedAuditInstallReport((deps.protectedAudit ?? coreEvents.protectedAuditReadiness)()),
|
|
2811
|
+
};
|
|
2812
|
+
}
|
|
2813
|
+
function bootstrapAutoexecCompanion(target, flags, env, argv1, run, uid, dryRun) {
|
|
2814
|
+
let plan;
|
|
2815
|
+
try {
|
|
2816
|
+
plan = planAutoexecCompanion(target, flags, env, argv1, serviceEnvFile(flags, env), serviceWorkingDirectory(flags));
|
|
2817
|
+
}
|
|
2818
|
+
catch (error) {
|
|
2819
|
+
return { status: 'failed', files: [], actions: [], detail: `${boundedBootstrapError(error)}; the proxy bootstrap is unaffected` };
|
|
2820
|
+
}
|
|
2821
|
+
if (dryRun)
|
|
2822
|
+
return { status: 'planned', files: [plan.path], actions: autoexecCompanionActions(target, plan.path, uid) };
|
|
2823
|
+
return activateAutoexecCompanion({
|
|
2824
|
+
target,
|
|
2825
|
+
plan,
|
|
2826
|
+
uid,
|
|
2827
|
+
systemctl: SYSTEMCTL_PATH,
|
|
2828
|
+
launchctl: LAUNCHCTL_PATH,
|
|
2829
|
+
powershell: trustedWindowsPowerShell,
|
|
2830
|
+
run: (command, args) => run(command, args, BOOTSTRAP_COMMAND_TIMEOUT_MS),
|
|
2831
|
+
exists: existsSync,
|
|
2832
|
+
writeUnit: (path, content) => { writeTextFile(path, content, 0o644, 'wx'); },
|
|
2833
|
+
removeUnit: removeUnitHolding,
|
|
2834
|
+
writeWindowsInstaller: writeWindowsHelper,
|
|
2835
|
+
});
|
|
2836
|
+
}
|
|
2837
|
+
function removeUnitHolding(path, content) {
|
|
2838
|
+
try {
|
|
2839
|
+
if (readFileSync(path, 'utf8') !== content)
|
|
2840
|
+
return false;
|
|
2841
|
+
rmSync(path);
|
|
2842
|
+
return true;
|
|
2843
|
+
}
|
|
2844
|
+
catch {
|
|
2845
|
+
return false;
|
|
2846
|
+
}
|
|
2787
2847
|
}
|
|
2788
2848
|
function bootstrapActivationPlan(target, files, uid) {
|
|
2789
2849
|
if (target === 'systemd') {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type CompanionTarget = 'systemd' | 'launchd' | 'windows';
|
|
2
|
+
export interface AutoexecCompanionPlan {
|
|
3
|
+
path: string;
|
|
4
|
+
content: string;
|
|
5
|
+
autoexecHome?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface AutoexecCompanionOutcome {
|
|
8
|
+
status: 'planned' | 'installed' | 'present' | 'failed';
|
|
9
|
+
files: string[];
|
|
10
|
+
actions: string[];
|
|
11
|
+
detail?: string;
|
|
12
|
+
}
|
|
13
|
+
interface ControlResult {
|
|
14
|
+
status: number | null;
|
|
15
|
+
error?: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface AutoexecCompanionActivation {
|
|
18
|
+
target: CompanionTarget;
|
|
19
|
+
plan: AutoexecCompanionPlan;
|
|
20
|
+
uid: number | undefined;
|
|
21
|
+
systemctl: string;
|
|
22
|
+
launchctl: string;
|
|
23
|
+
powershell: () => string;
|
|
24
|
+
run: (command: string, args: readonly string[]) => ControlResult;
|
|
25
|
+
exists: (path: string) => boolean;
|
|
26
|
+
/** Create-only; throws EEXIST when another writer published the companion first. */
|
|
27
|
+
writeUnit: (path: string, content: string) => void;
|
|
28
|
+
/** Removes the unit only while it still holds `content`; true when it is gone. */
|
|
29
|
+
removeUnit: (path: string, content: string) => boolean;
|
|
30
|
+
/** Returns the path actually written, which may differ when the preferred helper name is taken. */
|
|
31
|
+
writeWindowsInstaller: (path: string, content: string) => string;
|
|
32
|
+
}
|
|
33
|
+
export declare function autoexecCompanionActions(target: CompanionTarget, path: string, uid: number | undefined): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Bootstrap's proxy transaction owns only the proxy manager, so the companion is installed afterwards and
|
|
36
|
+
* never rolled back with it. An existing companion is left exactly as the operator configured it; one this call
|
|
37
|
+
* wrote but could not activate is removed again, since a later bootstrap would otherwise take it for configured.
|
|
38
|
+
*/
|
|
39
|
+
export declare function activateAutoexecCompanion(input: AutoexecCompanionActivation): AutoexecCompanionOutcome;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
const AUTOEXEC_TASK = 'EvoMapEvolverAutoexecDaemon';
|
|
2
|
+
const AUTOEXEC_SYSTEMD_UNIT = 'evolver-autoexec.service';
|
|
3
|
+
const WINDOWS_TASK_PROBE = `try { $tasks = @(Get-ScheduledTask -TaskPath '\\' -ErrorAction Stop | Where-Object { $_.TaskName -eq '${AUTOEXEC_TASK}' }) } catch { exit 9 }; if ($tasks.Count -eq 0) { exit 3 } else { exit 0 }`;
|
|
4
|
+
const WINDOWS_TASK_START = `Start-ScheduledTask -TaskPath '\\' -TaskName '${AUTOEXEC_TASK}' -ErrorAction Stop`;
|
|
5
|
+
export function autoexecCompanionActions(target, path, uid) {
|
|
6
|
+
if (target === 'systemd')
|
|
7
|
+
return ['systemctl --user daemon-reload', `systemctl --user enable --now ${AUTOEXEC_SYSTEMD_UNIT}`];
|
|
8
|
+
if (target === 'launchd')
|
|
9
|
+
return [`launchctl bootstrap gui/${uid ?? '<uid>'} ${path}`];
|
|
10
|
+
return [
|
|
11
|
+
`powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File ${path} -Install`,
|
|
12
|
+
`powershell.exe -NoProfile -NonInteractive -Command "${WINDOWS_TASK_START}"`,
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
class CompanionStepError extends Error {
|
|
16
|
+
}
|
|
17
|
+
function require0(result, operation) {
|
|
18
|
+
if (result.error || result.status !== 0)
|
|
19
|
+
throw new CompanionStepError(`${operation} failed`);
|
|
20
|
+
}
|
|
21
|
+
function windowsTaskRegistered(input) {
|
|
22
|
+
const probe = input.run(input.powershell(), ['-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-Command', WINDOWS_TASK_PROBE]);
|
|
23
|
+
if (!probe.error && probe.status === 0)
|
|
24
|
+
return true;
|
|
25
|
+
if (!probe.error && probe.status === 3)
|
|
26
|
+
return false;
|
|
27
|
+
throw new CompanionStepError('inspect Windows autoexec scheduled task failed');
|
|
28
|
+
}
|
|
29
|
+
function publishUnit(input) {
|
|
30
|
+
try {
|
|
31
|
+
input.writeUnit(input.plan.path, input.plan.content);
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error.code === 'EEXIST')
|
|
36
|
+
return false;
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function withdrawUnit(input, path) {
|
|
41
|
+
if (!input.removeUnit(path, input.plan.content))
|
|
42
|
+
return false;
|
|
43
|
+
// systemd already loaded the unit; reloading drops it so the manager matches the disk until the next bootstrap.
|
|
44
|
+
if (input.target === 'systemd')
|
|
45
|
+
input.run(input.systemctl, ['--user', 'daemon-reload']);
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
function failedOutcome(input, path, published, error) {
|
|
49
|
+
const reason = error instanceof CompanionStepError ? error.message : 'write autoexec companion failed';
|
|
50
|
+
if (published && withdrawUnit(input, path)) {
|
|
51
|
+
return {
|
|
52
|
+
status: 'failed',
|
|
53
|
+
files: [],
|
|
54
|
+
actions: [],
|
|
55
|
+
detail: `${reason}; the proxy bootstrap is unaffected and the unactivated companion was removed, so rerunning evolver lifecycle bootstrap retries it`,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
status: 'failed',
|
|
60
|
+
files: [path],
|
|
61
|
+
actions: [],
|
|
62
|
+
detail: `${reason}; the proxy bootstrap is unaffected. Run evolver lifecycle remove-autoexec-service --target=${input.target}, then rerun evolver lifecycle bootstrap`,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Bootstrap's proxy transaction owns only the proxy manager, so the companion is installed afterwards and
|
|
67
|
+
* never rolled back with it. An existing companion is left exactly as the operator configured it; one this call
|
|
68
|
+
* wrote but could not activate is removed again, since a later bootstrap would otherwise take it for configured.
|
|
69
|
+
*/
|
|
70
|
+
export function activateAutoexecCompanion(input) {
|
|
71
|
+
const { target, plan, uid } = input;
|
|
72
|
+
let path = plan.path;
|
|
73
|
+
let published = false;
|
|
74
|
+
const present = () => ({ status: 'present', files: [path], actions: [] });
|
|
75
|
+
try {
|
|
76
|
+
if (target === 'windows') {
|
|
77
|
+
if (windowsTaskRegistered(input))
|
|
78
|
+
return present();
|
|
79
|
+
path = input.writeWindowsInstaller(plan.path, plan.content);
|
|
80
|
+
const ps = input.powershell();
|
|
81
|
+
require0(input.run(ps, ['-NoProfile', '-NonInteractive', '-ExecutionPolicy', 'Bypass', '-File', path, '-Install']), 'register Windows autoexec scheduled task');
|
|
82
|
+
require0(input.run(ps, ['-NoProfile', '-NonInteractive', '-Command', WINDOWS_TASK_START]), 'start Windows autoexec scheduled task');
|
|
83
|
+
return { status: 'installed', files: [path], actions: autoexecCompanionActions(target, path, uid) };
|
|
84
|
+
}
|
|
85
|
+
if (input.exists(path) || !publishUnit(input))
|
|
86
|
+
return present();
|
|
87
|
+
published = true;
|
|
88
|
+
if (target === 'systemd') {
|
|
89
|
+
require0(input.run(input.systemctl, ['--user', 'daemon-reload']), 'reload systemd user manager for autoexec');
|
|
90
|
+
require0(input.run(input.systemctl, ['--user', 'enable', '--now', AUTOEXEC_SYSTEMD_UNIT]), 'enable systemd autoexec service');
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
if (uid === undefined)
|
|
94
|
+
throw new CompanionStepError('cannot determine the current user id for launchd autoexec');
|
|
95
|
+
require0(input.run(input.launchctl, ['bootstrap', `gui/${uid}`, path]), 'bootstrap launchd autoexec agent');
|
|
96
|
+
}
|
|
97
|
+
return { status: 'installed', files: [path], actions: autoexecCompanionActions(target, path, uid) };
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
return failedOutcome(input, path, published, error);
|
|
101
|
+
}
|
|
102
|
+
}
|
package/dist/llmCycle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { closeSync, constants, fstatSync, lstatSync, openSync, readSync } from 'node:fs';
|
|
2
|
-
import { exec, verify } from '@evomap/evolver-core';
|
|
2
|
+
import { assetstore, exec, verify } from '@evomap/evolver-core';
|
|
3
3
|
import { createLlmGit } from './llmGit.js';
|
|
4
4
|
/** Read the operator's acceptance plan once, before any material is claimed or model dispatched. */
|
|
5
5
|
export function readCycleValidationSpec(path) {
|
|
@@ -7,12 +7,19 @@ export function readCycleValidationSpec(path) {
|
|
|
7
7
|
throw new Error('--validation-spec requires a file path');
|
|
8
8
|
let fd;
|
|
9
9
|
try {
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
10
|
+
const named = lstatSync(path, { bigint: true });
|
|
11
|
+
if (!named.isFile() || named.isSymbolicLink() || named.nlink !== 1n || named.size > 65536n)
|
|
12
|
+
throw new Error();
|
|
13
|
+
const before = assetstore.captureRegularAssetFileSnapshot(path);
|
|
14
|
+
if (((process.platform !== 'win32' || named.dev !== 0n) && named.dev !== before.dev)
|
|
15
|
+
|| named.ino !== before.ino || named.birthtimeNs !== before.birthtimeNs || named.nlink !== before.nlink
|
|
16
|
+
|| named.mode !== before.mode || named.size !== before.size
|
|
17
|
+
|| named.mtimeNs !== before.mtimeNs || named.ctimeNs !== before.ctimeNs)
|
|
12
18
|
throw new Error();
|
|
13
19
|
fd = openSync(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0));
|
|
14
20
|
const opened = fstatSync(fd, { bigint: true });
|
|
15
|
-
if (before.dev !== opened.dev || before.ino !== opened.ino || before.
|
|
21
|
+
if (before.dev !== opened.dev || before.ino !== opened.ino || before.birthtimeNs !== opened.birthtimeNs
|
|
22
|
+
|| before.nlink !== opened.nlink || before.mode !== opened.mode || before.size !== opened.size
|
|
16
23
|
|| before.mtimeNs !== opened.mtimeNs || before.ctimeNs !== opened.ctimeNs)
|
|
17
24
|
throw new Error();
|
|
18
25
|
const buffer = Buffer.alloc(65_537);
|
|
@@ -25,7 +32,10 @@ export function readCycleValidationSpec(path) {
|
|
|
25
32
|
}
|
|
26
33
|
const bytes = buffer.subarray(0, count);
|
|
27
34
|
const after = fstatSync(fd, { bigint: true });
|
|
28
|
-
|
|
35
|
+
const pathAfter = assetstore.captureRegularAssetFileSnapshot(path);
|
|
36
|
+
if (bytes.length > 65_536 || [after, pathAfter].some(stat => stat.dev !== opened.dev || stat.ino !== opened.ino
|
|
37
|
+
|| stat.birthtimeNs !== opened.birthtimeNs || stat.nlink !== opened.nlink || stat.mode !== opened.mode
|
|
38
|
+
|| stat.size !== opened.size || stat.mtimeNs !== opened.mtimeNs || stat.ctimeNs !== opened.ctimeNs))
|
|
29
39
|
throw new Error();
|
|
30
40
|
return verify.parseDeclarativeValidationSpec(JSON.parse(bytes.toString('utf8')));
|
|
31
41
|
}
|