target-supabase-sdk 0.2.8 → 0.2.10
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/chunks/{enable-log-persist-CKxXtE3K.js → enable-log-persist-BB-unD4p.js} +53 -26
- package/dist/chunks/enable-log-persist-BB-unD4p.js.map +1 -0
- package/dist/node/fs/file-write-queue.d.ts +2 -0
- package/dist/node/fs/file-write-queue.d.ts.map +1 -0
- package/dist/node/fs/json-state-store.d.ts.map +1 -1
- package/dist/node/node-runtime.base.d.ts.map +1 -1
- package/dist/node.js +23 -10
- package/dist/node.js.map +1 -1
- package/dist/preload.js +1 -1
- package/package.json +3 -2
- package/src/node/fs/file-write-queue.ts +15 -0
- package/src/node/fs/json-state-store.ts +44 -24
- package/src/node/node-runtime.base.ts +20 -8
- package/dist/chunks/enable-log-persist-CKxXtE3K.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { resolve, dirname, join } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { readFile, mkdir, writeFile, rename, readdir } from 'node:fs/promises';
|
|
4
|
+
import { readFile, unlink, mkdir, writeFile, rename, readdir } from 'node:fs/promises';
|
|
5
5
|
import { f as createLogger, b as LOG_PERSIST_LOADER_KEY, a as CategoryList, y as postLogListCreate, o as isCreateTargetAlreadyExistsError, c as LogLevel, I as registerLogPersistOffer } from './list.api-6Q4_-7oN.js';
|
|
6
6
|
import 'lodash-es';
|
|
7
|
-
import { createHash } from 'node:crypto';
|
|
7
|
+
import { randomBytes, createHash } from 'node:crypto';
|
|
8
8
|
|
|
9
9
|
function readEnv(name, env = process.env) {
|
|
10
10
|
const value = env[name]?.trim();
|
|
@@ -185,6 +185,15 @@ function resolveProjectRootByPackageName(importMetaUrl, packageName) {
|
|
|
185
185
|
throw new Error(`Could not find package root for "${packageName}" from ${importMetaUrl}`);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
/** Per-file write queue — serializes read-modify-write for a single JSON path within one process. */
|
|
189
|
+
const writeChains = new Map();
|
|
190
|
+
function withSerializedFileWrites(filePath, operation) {
|
|
191
|
+
const previous = writeChains.get(filePath) ?? Promise.resolve();
|
|
192
|
+
const next = previous.then(operation, operation);
|
|
193
|
+
writeChains.set(filePath, next.then(() => undefined, () => undefined));
|
|
194
|
+
return next;
|
|
195
|
+
}
|
|
196
|
+
|
|
188
197
|
function mergeWithNested(defaults, current, patch, nestedKeys) {
|
|
189
198
|
const merged = {
|
|
190
199
|
...defaults,
|
|
@@ -206,9 +215,16 @@ function mergeWithNested(defaults, current, patch, nestedKeys) {
|
|
|
206
215
|
async function atomicWriteJson(filePath, data) {
|
|
207
216
|
await mkdir(dirname(filePath), { recursive: true });
|
|
208
217
|
const content = `${JSON.stringify(data, null, 2)}\n`;
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
218
|
+
JSON.parse(content);
|
|
219
|
+
const tempPath = `${filePath}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`;
|
|
220
|
+
try {
|
|
221
|
+
await writeFile(tempPath, content, "utf8");
|
|
222
|
+
await rename(tempPath, filePath);
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
await unlink(tempPath).catch(() => undefined);
|
|
226
|
+
throw error;
|
|
227
|
+
}
|
|
212
228
|
}
|
|
213
229
|
/** JSON file-backed state with optional nested key merge and atomic writes. */
|
|
214
230
|
function createJsonFileStateStore(options) {
|
|
@@ -222,30 +238,41 @@ function createJsonFileStateStore(options) {
|
|
|
222
238
|
[updatedAtKey]: new Date().toISOString(),
|
|
223
239
|
};
|
|
224
240
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
241
|
+
async function readFromDisk() {
|
|
242
|
+
try {
|
|
243
|
+
const raw = await readFile(filePath, "utf8");
|
|
244
|
+
const parsed = JSON.parse(raw);
|
|
245
|
+
return mergeWithNested(defaultState, parsed, {}, nestedKeys);
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
if (error.code === "ENOENT") {
|
|
249
|
+
return mergeWithNested(defaultState, {}, {}, nestedKeys);
|
|
231
250
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
throw error;
|
|
251
|
+
if (error instanceof SyntaxError) {
|
|
252
|
+
await unlink(filePath).catch(() => undefined);
|
|
253
|
+
return mergeWithNested(defaultState, {}, {}, nestedKeys);
|
|
237
254
|
}
|
|
255
|
+
throw error;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return {
|
|
259
|
+
read() {
|
|
260
|
+
return readFromDisk();
|
|
238
261
|
},
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
262
|
+
write(patch) {
|
|
263
|
+
return withSerializedFileWrites(filePath, async () => {
|
|
264
|
+
const current = await readFromDisk();
|
|
265
|
+
const next = touchUpdatedAt(mergeWithNested(defaultState, current, patch, nestedKeys));
|
|
266
|
+
await atomicWriteJson(filePath, next);
|
|
267
|
+
return next;
|
|
268
|
+
});
|
|
244
269
|
},
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
270
|
+
reset() {
|
|
271
|
+
return withSerializedFileWrites(filePath, async () => {
|
|
272
|
+
const next = touchUpdatedAt({ ...defaultState });
|
|
273
|
+
await atomicWriteJson(filePath, next);
|
|
274
|
+
return next;
|
|
275
|
+
});
|
|
249
276
|
},
|
|
250
277
|
};
|
|
251
278
|
}
|
|
@@ -1514,4 +1541,4 @@ function resolveLogPersistRegistryPath(registryDir) {
|
|
|
1514
1541
|
}
|
|
1515
1542
|
|
|
1516
1543
|
export { resolveProjectRootFromModule as A, CLI_PROD_FLAG as C, SERVICE_ENV_PROFILE_ENV_KEY as S, logPersistEnabledFromEnv as a, readEnv as b, requireEnv as c, createJsonFileStateStore as d, disableLogPersist as e, ensureLogPersistFromEnv as f, getLogPersistStats as g, SERVICE_ENV_PROFILE_PROD as h, enableLogPersist as i, envBool as j, envInt as k, loadEnvFiles as l, envMs as m, envNumber as n, envPort as o, pinEnvProfileFromArgv as p, envProfileFromProcess as q, resolveProjectRootByPackageName as r, snapshotLogPersistReady as s, parseEnvFile as t, parseEnvLine as u, validateLogPersistPreloadEnv as v, waitForLogPersistReady as w, pollUntil as x, resolveDefaultEnvFiles as y, resolveLogPersistRegistryPath as z };
|
|
1517
|
-
//# sourceMappingURL=enable-log-persist-
|
|
1544
|
+
//# sourceMappingURL=enable-log-persist-BB-unD4p.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable-log-persist-BB-unD4p.js","sources":["../../src/node/env/require-env.ts","../../src/node/env/env-parsers.ts","../../src/node/env/load-env.ts","../../src/node/env/project-root.ts","../../src/node/fs/file-write-queue.ts","../../src/node/fs/json-state-store.ts","../../src/node/readiness/poll-until.ts","../../src/shared/log/log-persist.config.ts","../../src/shared/log/log-persist-batch-id.ts","../../src/shared/log/log-persist-logger.ts","../../src/shared/log/log-persist-flush.ts","../../src/shared/log/log-persist-registry.ts","../../src/shared/log/log-persist.ts","../../src/shared/log/enable-log-persist.ts"],"sourcesContent":["export function readEnv(name: string, env: NodeJS.ProcessEnv = process.env): string | undefined {\n const value = env[name]?.trim();\n if (value == null || value === \"\") {\n return undefined;\n }\n return value;\n}\n\nexport function requireEnv(name: string, env: NodeJS.ProcessEnv = process.env): string {\n const value = readEnv(name, env);\n if (value == null) {\n throw new Error(`Missing required environment variable: ${name}`);\n }\n return value;\n}\n","import { readEnv } from \"./require-env\";\n\nexport interface EnvIntOptions {\n env?: NodeJS.ProcessEnv;\n min?: number;\n max?: number;\n}\n\nexport function envInt(name: string, defaultValue: number, options?: EnvIntOptions): number {\n const env = options?.env ?? process.env;\n const raw = readEnv(name, env);\n if (raw == null) {\n return defaultValue;\n }\n\n const value = Number(raw);\n if (!Number.isInteger(value)) {\n throw new Error(`Invalid ${name}: ${raw}`);\n }\n\n const min = options?.min;\n if (min != null && value < min) {\n throw new Error(`Invalid ${name}: ${raw}`);\n }\n\n const max = options?.max;\n if (max != null && value > max) {\n throw new Error(`Invalid ${name}: ${raw}`);\n }\n\n return value;\n}\n\nexport function envMs(name: string, defaultMs: number, options?: EnvIntOptions): number {\n return envInt(name, defaultMs, { ...options, min: options?.min ?? 1 });\n}\n\nexport function envPort(defaultPort = 3100, options?: EnvIntOptions & { envKey?: string }): number {\n const envKey = options?.envKey ?? \"PORT\";\n return envInt(envKey, defaultPort, { ...options, min: 1, max: 65535 });\n}\n\nexport interface EnvNumberOptions {\n env?: NodeJS.ProcessEnv;\n min?: number;\n /** When true, use Math.floor on parsed value. */\n floor?: boolean;\n}\n\nexport function envNumber(name: string, defaultValue: number, options?: EnvNumberOptions): number {\n const env = options?.env ?? process.env;\n const raw = readEnv(name, env);\n if (raw == null) {\n return defaultValue;\n }\n\n const value = Number(raw);\n if (!Number.isFinite(value)) {\n throw new Error(`Invalid ${name}: ${raw}`);\n }\n\n const min = options?.min;\n const resolved = options?.floor === true ? Math.floor(value) : value;\n if (min != null && resolved < min) {\n throw new Error(`Invalid ${name}: ${raw}`);\n }\n\n return resolved;\n}\n\nexport function envBool(name: string, defaultValue = false, env: NodeJS.ProcessEnv = process.env): boolean {\n const raw = readEnv(name, env)?.toLowerCase();\n if (raw == null) {\n return defaultValue;\n }\n return raw === \"1\" || raw === \"true\" || raw === \"yes\";\n}\n","import { existsSync, readFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\n\nconst DEFAULT_ENV_FILES = [\".env.local\", \".env\"] as const;\nconst PROD_ENV_FILES = [\".env.prod\"] as const;\n\nexport const SERVICE_ENV_PROFILE_ENV_KEY = \"SERVICE_ENV_PROFILE\" as const;\nexport const SERVICE_ENV_PROFILE_PROD = \"prod\" as const;\nexport const CLI_PROD_FLAG = \"--prod\" as const;\n\nexport interface EnvProfileFromProcessOptions {\n env?: NodeJS.ProcessEnv;\n argv?: readonly string[];\n}\n\n/** Resolve active env profile from `SERVICE_ENV_PROFILE` or `--prod` on argv. */\nexport function envProfileFromProcess(options?: EnvProfileFromProcessOptions): string | undefined {\n const env = options?.env ?? process.env;\n const argv = options?.argv ?? process.argv;\n const fromEnv = env[SERVICE_ENV_PROFILE_ENV_KEY]?.trim();\n if (fromEnv != null && fromEnv !== \"\") {\n return fromEnv;\n }\n if (argv.includes(CLI_PROD_FLAG)) {\n return SERVICE_ENV_PROFILE_PROD;\n }\n return undefined;\n}\n\n/** Default env file list for a profile (`prod` → `.env.prod`; otherwise `.env.local` → `.env`). */\nexport function resolveDefaultEnvFiles(profile?: string): readonly string[] {\n if (profile === SERVICE_ENV_PROFILE_PROD) {\n return PROD_ENV_FILES;\n }\n return DEFAULT_ENV_FILES;\n}\n\n/** Pin `SERVICE_ENV_PROFILE=prod` when `--prod` is on argv (for child process inheritance). */\nexport function pinEnvProfileFromArgv(\n env: NodeJS.ProcessEnv = process.env,\n argv: readonly string[] = process.argv,\n): void {\n if (env[SERVICE_ENV_PROFILE_ENV_KEY]?.trim()) {\n return;\n }\n if (argv.includes(CLI_PROD_FLAG)) {\n env[SERVICE_ENV_PROFILE_ENV_KEY] = SERVICE_ENV_PROFILE_PROD;\n }\n}\n\nexport interface LoadEnvFilesOptions {\n /** Files to load in order (later files do not override existing env). */\n files?: readonly string[];\n env?: NodeJS.ProcessEnv;\n /** Called after all files are merged (e.g. legacy alias normalization). */\n afterLoad?: () => void;\n}\n\nfunction stripQuotes(value: string): string {\n return value.replace(/^[\"']|[\"']$/g, \"\");\n}\n\n/** Parse one KEY=VALUE line; returns null if line should be skipped. */\nexport function parseEnvLine(line: string): { key: string; value: string } | null {\n const trimmed = line.trim();\n if (trimmed === \"\" || trimmed.startsWith(\"#\")) {\n return null;\n }\n\n const eq = trimmed.indexOf(\"=\");\n if (eq === -1) {\n return null;\n }\n\n const key = trimmed.slice(0, eq).trim();\n const raw = trimmed.slice(eq + 1).trim();\n return { key, value: stripQuotes(raw) };\n}\n\nexport function parseEnvFileContent(content: string, env: NodeJS.ProcessEnv): void {\n for (const line of content.split(\"\\n\")) {\n const parsed = parseEnvLine(line);\n if (parsed == null) {\n continue;\n }\n if (env[parsed.key] == null || env[parsed.key] === \"\") {\n env[parsed.key] = parsed.value;\n }\n }\n}\n\nexport function parseEnvFile(filePath: string, env: NodeJS.ProcessEnv): void {\n if (!existsSync(filePath)) {\n return;\n }\n parseEnvFileContent(readFileSync(filePath, \"utf8\"), env);\n}\n\n/**\n * Load env files into `process.env` (or `options.env`).\n * Default files: `.env.local` → `.env`, or `.env.prod` when profile is `prod` / `--prod`.\n * Existing non-empty env values are not overwritten.\n */\nexport function loadEnvFiles(root: string, options?: LoadEnvFilesOptions): void {\n const env = options?.env ?? process.env;\n const files = options?.files ?? resolveDefaultEnvFiles(envProfileFromProcess({ env }));\n\n for (const name of files) {\n parseEnvFile(resolve(root, name), env);\n }\n\n options?.afterLoad?.();\n}\n","import { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/**\n * Resolve project root from a module URL (typically `import.meta.url`).\n * @param relativePath Path relative to the module file (default `\"..\"` = parent directory).\n */\nexport function resolveProjectRootFromModule(importMetaUrl: string, relativePath = \"..\"): string {\n return resolve(fileURLToPath(new URL(relativePath, importMetaUrl)));\n}\n\n/**\n * Walk upward from `importMetaUrl` until a `package.json` with matching `name` is found.\n * Use for esbuild bundles under `dist/` where a single `..` hop lands in `dist/`, not repo root.\n */\nexport function resolveProjectRootByPackageName(importMetaUrl: string, packageName: string): string {\n let dir = dirname(fileURLToPath(importMetaUrl));\n for (;;) {\n const packageJsonPath = resolve(dir, \"package.json\");\n if (existsSync(packageJsonPath)) {\n const pkg = JSON.parse(readFileSync(packageJsonPath, \"utf8\")) as { name?: string };\n if (pkg.name === packageName) {\n return dir;\n }\n }\n const parent = dirname(dir);\n if (parent === dir) {\n break;\n }\n dir = parent;\n }\n throw new Error(`Could not find package root for \"${packageName}\" from ${importMetaUrl}`);\n}\n","/** Per-file write queue — serializes read-modify-write for a single JSON path within one process. */\nconst writeChains = new Map<string, Promise<unknown>>();\n\nexport function withSerializedFileWrites<T>(filePath: string, operation: () => Promise<T>): Promise<T> {\n const previous = writeChains.get(filePath) ?? Promise.resolve();\n const next = previous.then(operation, operation);\n writeChains.set(\n filePath,\n next.then(\n () => undefined,\n () => undefined,\n ),\n );\n return next;\n}\n","import { randomBytes } from \"node:crypto\";\nimport { mkdir, readFile, rename, unlink, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport { withSerializedFileWrites } from \"./file-write-queue\";\n\nexport type JsonStatePatch<T extends object, NK extends keyof T> = Partial<Omit<T, NK>> & {\n [K in NK]?: T[K] extends object ? Partial<T[K]> : T[K];\n};\n\nexport interface JsonFileStateStore<T extends object, NK extends keyof T = never> {\n read(): Promise<T>;\n write(patch: JsonStatePatch<T, NK>): Promise<T>;\n reset(): Promise<T>;\n}\n\nexport interface CreateJsonFileStateStoreOptions<T extends object, NK extends keyof T = never> {\n filePath: string;\n defaultState: T;\n /** Top-level keys shallow-merged one level deep on read and write. */\n nestedKeys?: NK[];\n /** When set, assigned `new Date().toISOString()` on write and reset. */\n updatedAtKey?: keyof T;\n}\n\nfunction mergeWithNested<T extends object>(\n defaults: T,\n current: Partial<T> | undefined,\n patch: Partial<T>,\n nestedKeys: (keyof T)[],\n): T {\n const merged = {\n ...defaults,\n ...current,\n ...patch,\n } as T;\n\n for (const key of nestedKeys) {\n const defaultNested = defaults[key];\n if (defaultNested != null && typeof defaultNested === \"object\") {\n (merged as Record<keyof T, unknown>)[key] = {\n ...defaultNested,\n ...(current?.[key] as object | undefined),\n ...(patch[key] as object | undefined),\n };\n }\n }\n\n return merged;\n}\n\nasync function atomicWriteJson(filePath: string, data: unknown): Promise<void> {\n await mkdir(dirname(filePath), { recursive: true });\n const content = `${JSON.stringify(data, null, 2)}\\n`;\n JSON.parse(content);\n const tempPath = `${filePath}.${process.pid}.${randomBytes(4).toString(\"hex\")}.tmp`;\n try {\n await writeFile(tempPath, content, \"utf8\");\n await rename(tempPath, filePath);\n } catch (error) {\n await unlink(tempPath).catch(() => undefined);\n throw error;\n }\n}\n\n/** JSON file-backed state with optional nested key merge and atomic writes. */\nexport function createJsonFileStateStore<T extends object, NK extends keyof T = never>(\n options: CreateJsonFileStateStoreOptions<T, NK>,\n): JsonFileStateStore<T, NK> {\n const { filePath, defaultState, nestedKeys = [] as NK[], updatedAtKey } = options;\n\n function touchUpdatedAt(state: T): T {\n if (updatedAtKey == null) {\n return state;\n }\n return {\n ...state,\n [updatedAtKey]: new Date().toISOString(),\n };\n }\n\n async function readFromDisk(): Promise<T> {\n try {\n const raw = await readFile(filePath, \"utf8\");\n const parsed = JSON.parse(raw) as Partial<T>;\n return mergeWithNested(defaultState, parsed, {}, nestedKeys);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") {\n return mergeWithNested(defaultState, {}, {}, nestedKeys);\n }\n if (error instanceof SyntaxError) {\n await unlink(filePath).catch(() => undefined);\n return mergeWithNested(defaultState, {}, {}, nestedKeys);\n }\n throw error;\n }\n }\n\n return {\n read(): Promise<T> {\n return readFromDisk();\n },\n\n write(patch: JsonStatePatch<T, NK>): Promise<T> {\n return withSerializedFileWrites(filePath, async () => {\n const current = await readFromDisk();\n const next = touchUpdatedAt(mergeWithNested(defaultState, current, patch as Partial<T>, nestedKeys));\n await atomicWriteJson(filePath, next);\n return next;\n });\n },\n\n reset(): Promise<T> {\n return withSerializedFileWrites(filePath, async () => {\n const next = touchUpdatedAt({ ...defaultState });\n await atomicWriteJson(filePath, next);\n return next;\n });\n },\n };\n}\n","function sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nexport interface PollUntilOptions {\n timeoutMs: number;\n intervalMs?: number;\n until: () => boolean | Promise<boolean>;\n}\n\n/**\n * Poll `until()` until it returns true or `timeoutMs` elapses.\n * @throws Error on timeout\n */\nexport async function pollUntil(options: PollUntilOptions): Promise<void> {\n const intervalMs = options.intervalMs ?? 500;\n const deadline = Date.now() + options.timeoutMs;\n\n while (Date.now() < deadline) {\n if (await options.until()) {\n return;\n }\n await sleep(intervalMs);\n }\n\n throw new Error(`pollUntil timeout after ${options.timeoutMs}ms`);\n}\n","import { envBool, envInt, envMs } from \"../../node/env/env-parsers\";\nimport type { LogPersistConfig } from \"./log-persist.interface\";\n\nexport const DEFAULT_LOG_PERSIST_CONFIG: LogPersistConfig = {\n fast: {\n maxBufferEntries: 500,\n },\n medium: {\n debounceMs: 5_000,\n maxEntries: 20,\n maxBytes: 512 * 1024,\n maxBufferEntries: 1_000,\n },\n slow: {\n maxEntries: 400,\n maxBytes: 512 * 1024,\n maxAgeMs: 120_000,\n maxBufferEntries: 2_000,\n },\n postTimeoutMs: 30_000,\n shutdownDrainTimeoutMs: 15_000,\n};\n\nexport function resolveLogPersistConfig(partial?: Partial<LogPersistConfig>): LogPersistConfig {\n const defaults = DEFAULT_LOG_PERSIST_CONFIG;\n return {\n fast: { ...defaults.fast, ...partial?.fast },\n medium: { ...defaults.medium, ...partial?.medium },\n slow: { ...defaults.slow, ...partial?.slow },\n postTimeoutMs: partial?.postTimeoutMs ?? defaults.postTimeoutMs,\n shutdownDrainTimeoutMs: partial?.shutdownDrainTimeoutMs ?? defaults.shutdownDrainTimeoutMs,\n };\n}\n\nexport function logPersistEnabledFromEnv(env: NodeJS.ProcessEnv = process.env): boolean {\n return envBool(\"LOG_PERSIST_ENABLED\", false, env);\n}\n\nexport function logPersistServiceFromEnv(env: NodeJS.ProcessEnv = process.env): string | undefined {\n const raw = env.LOG_PERSIST_SERVICE?.trim();\n return raw != null && raw !== \"\" ? raw : undefined;\n}\n\nexport function logPersistProcessFromEnv(env: NodeJS.ProcessEnv = process.env): string | undefined {\n const raw = env.LOG_PERSIST_PROCESS?.trim();\n return raw != null && raw !== \"\" ? raw : undefined;\n}\n\nexport function logPersistRegistryDirFromEnv(env: NodeJS.ProcessEnv = process.env): string | undefined {\n const configured = env.LOG_PERSIST_REGISTRY_DIR?.trim();\n if (configured != null && configured !== \"\") {\n return configured;\n }\n const runtime = env.RUNTIME_DATA_DIR?.trim();\n return runtime != null && runtime !== \"\" ? runtime : undefined;\n}\n\nexport function logPersistConfigFromEnv(env: NodeJS.ProcessEnv = process.env): LogPersistConfig {\n return resolveLogPersistConfig({\n fast: {\n maxBufferEntries: envInt(\"LOG_FAST_MAX_BUFFER_ENTRIES\", DEFAULT_LOG_PERSIST_CONFIG.fast.maxBufferEntries, {\n env,\n min: 1,\n }),\n },\n medium: {\n debounceMs: envMs(\"LOG_MEDIUM_DEBOUNCE_MS\", DEFAULT_LOG_PERSIST_CONFIG.medium.debounceMs, { env }),\n maxEntries: envInt(\"LOG_MEDIUM_MAX_ENTRIES\", DEFAULT_LOG_PERSIST_CONFIG.medium.maxEntries, {\n env,\n min: 1,\n }),\n maxBytes: envInt(\"LOG_MEDIUM_MAX_BYTES\", DEFAULT_LOG_PERSIST_CONFIG.medium.maxBytes, { env, min: 1 }),\n maxBufferEntries: envInt(\n \"LOG_MEDIUM_MAX_BUFFER_ENTRIES\",\n DEFAULT_LOG_PERSIST_CONFIG.medium.maxBufferEntries,\n { env, min: 1 },\n ),\n },\n slow: {\n maxEntries: envInt(\"LOG_SLOW_MAX_ENTRIES\", DEFAULT_LOG_PERSIST_CONFIG.slow.maxEntries, { env, min: 1 }),\n maxBytes: envInt(\"LOG_SLOW_MAX_BYTES\", DEFAULT_LOG_PERSIST_CONFIG.slow.maxBytes, { env, min: 1 }),\n maxAgeMs: envMs(\"LOG_SLOW_MAX_AGE_MS\", DEFAULT_LOG_PERSIST_CONFIG.slow.maxAgeMs, { env }),\n maxBufferEntries: envInt(\"LOG_SLOW_MAX_BUFFER_ENTRIES\", DEFAULT_LOG_PERSIST_CONFIG.slow.maxBufferEntries, {\n env,\n min: 1,\n }),\n },\n postTimeoutMs: envMs(\"LOG_PERSIST_POST_TIMEOUT_MS\", DEFAULT_LOG_PERSIST_CONFIG.postTimeoutMs, { env }),\n shutdownDrainTimeoutMs: envMs(\n \"LOG_PERSIST_SHUTDOWN_DRAIN_MS\",\n DEFAULT_LOG_PERSIST_CONFIG.shutdownDrainTimeoutMs,\n { env },\n ),\n });\n}\n","import { createHash } from \"node:crypto\";\nimport type { LogEntry } from \"./log-manager\";\nimport type { LogPersistLane } from \"./log-persist.interface\";\n\nconst BATCH_ID_VERSION = 1;\n\n/** Stable subset of LogEntry for idempotency hashing (same batch → same key). */\nfunction canonicalLogEntry(entry: LogEntry): Record<string, unknown> {\n return {\n timestamp: entry.timestamp,\n level: entry.level,\n message: entry.message,\n topic: entry.topic,\n module: entry.module,\n traceId: entry.traceId,\n traceParentId: entry.traceParentId ?? null,\n extra: entry.extra ?? null,\n data: entry.data ?? null,\n labels: entry.labels ?? null,\n };\n}\n\n/**\n * Deterministic List.value for a log batch — retries after timeout map to the same row key.\n * SHA-256 over canonical JSON (service + process + lane + entries in order).\n */\nexport function computeLogBatchIdempotencyKey(input: {\n service: string;\n process: string;\n lane: LogPersistLane;\n entries: LogEntry[];\n}): string {\n const payload = {\n v: BATCH_ID_VERSION,\n service: input.service,\n process: input.process,\n lane: input.lane,\n entries: input.entries.map(canonicalLogEntry),\n };\n\n const hash = createHash(\"sha256\").update(JSON.stringify(payload), \"utf8\").digest(\"hex\");\n return `${hash.slice(0, 32)}`;\n}\n","import { createLogger } from \"./create-logger\";\n\n/** User-facing / lifecycle logs — may be persisted like normal app logs. */\nexport const LOG_PERSIST_TOPIC = \"log-persist\";\n\n/** Operational logs from the persist pipeline — never re-offered to avoid feedback loops. */\nexport const LOG_PERSIST_INTERNAL_TOPIC = \"log-persist-internal\";\n\nconst logger = createLogger({ module: \"log-persist\" });\n\nexport function isLogPersistInternalTopic(topic: string | undefined): boolean {\n return topic === LOG_PERSIST_INTERNAL_TOPIC;\n}\n\ntype PersistLogData = Record<string, unknown>;\n\nfunction write(level: \"debug\" | \"info\" | \"warn\" | \"error\", message: string, data?: PersistLogData): void {\n logger[level](message, {\n topic: LOG_PERSIST_INTERNAL_TOPIC,\n ...(data != null ? { data } : {}),\n });\n}\n\nexport const persistLogger = {\n debug: (message: string, data?: PersistLogData) => write(\"debug\", message, data),\n info: (message: string, data?: PersistLogData) => write(\"info\", message, data),\n warn: (message: string, data?: PersistLogData) => write(\"warn\", message, data),\n error: (message: string, data?: PersistLogData) => write(\"error\", message, data),\n};\n\nexport function patchPersistLoggerScope(labels: Record<string, string>): void {\n logger.resetScope({ labels });\n}\n","import { isCreateTargetAlreadyExistsError } from \"../../core.api\";\nimport { postLogListCreate } from \"../../list/list.api\";\nimport { CategoryList } from \"../../list/list.interface\";\nimport type { LogEntry } from \"./log-manager\";\nimport type { BuildLogListDraftInput, LogListDraft } from \"./log-persist.interface\";\nimport { LOG_PERSIST_LOADER_KEY } from \"./log-persist.interface\";\nimport { persistLogger } from \"./log-persist-logger\";\n\nexport function estimateEntriesBytes(entries: LogEntry[]): number {\n if (entries.length === 0) {\n return 0;\n }\n try {\n return Buffer.byteLength(JSON.stringify(entries), \"utf8\");\n } catch {\n return entries.length * 512;\n }\n}\n\nexport function buildLogListDraft(input: BuildLogListDraftInput): LogListDraft {\n const { service, process, lane, idempotencyKey, entries } = input;\n const first = entries[0];\n const last = entries[entries.length - 1];\n\n return {\n name: `log-batch:${service}:${process}:${lane}`,\n value: idempotencyKey,\n category: CategoryList.LIST,\n tagList: [\"log\", lane, service],\n details: {\n manifestVersion: 0,\n loaderKey: LOG_PERSIST_LOADER_KEY,\n meta: {\n service,\n process,\n pid: globalThis.process.pid,\n lane,\n count: entries.length,\n from: first?.timestamp ?? null,\n to: last?.timestamp ?? null,\n flushedAt: Date.now(),\n idempotencyKey,\n },\n preview: first?.message ?? \"\",\n items: entries,\n },\n };\n}\n\nasync function withTimeout<T>(promise: Promise<T>, timeoutMs: number, label: string): Promise<T> {\n let timer: ReturnType<typeof setTimeout> | null = null;\n try {\n return await Promise.race([\n promise,\n new Promise<T>((_resolve, reject) => {\n timer = setTimeout(() => {\n reject(new Error(`${label} timed out after ${timeoutMs}ms`));\n }, timeoutMs);\n }),\n ]);\n } finally {\n if (timer != null) {\n clearTimeout(timer);\n }\n }\n}\n\nexport async function postLogBatch(draft: LogListDraft, postTimeoutMs: number): Promise<void> {\n try {\n const result = await withTimeout(\n postLogListCreate({\n name: draft.name,\n value: draft.value,\n category: draft.category,\n details: draft.details,\n }),\n postTimeoutMs,\n \"postLogListCreate\",\n );\n\n if (!result.success) {\n const message = result.error?.message ?? \"postLogListCreate failed\";\n persistLogger.error(\"post log batch failed\", {\n idempotencyKey: draft.value,\n name: draft.name,\n error: message,\n });\n throw new Error(message);\n }\n } catch (error) {\n if (isCreateTargetAlreadyExistsError(error)) {\n persistLogger.error(\"post log batch idempotent duplicate — treating as success\", {\n idempotencyKey: draft.value,\n name: draft.name,\n });\n return;\n }\n throw error;\n }\n}\n\n/** Take a prefix of entries that fits within maxBytes. */\nexport function takeEntriesWithinBytes(entries: LogEntry[], maxBytes: number): LogEntry[] {\n if (entries.length === 0) {\n return [];\n }\n\n const taken: LogEntry[] = [];\n for (const entry of entries) {\n const candidate = [...taken, entry];\n if (taken.length > 0 && estimateEntriesBytes(candidate) > maxBytes) {\n break;\n }\n taken.push(entry);\n }\n\n const result = taken.length > 0 ? taken : [entries[0]];\n if (result.length < entries.length) {\n persistLogger.warn(\"trimmed batch to maxBytes\", {\n requested: entries.length,\n taken: result.length,\n maxBytes,\n takenBytes: estimateEntriesBytes(result),\n });\n }\n\n return result;\n}\n","import { mkdir, readdir, readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { createJsonFileStateStore } from \"../../node/fs/json-state-store\";\nimport type { LogPersistProcessRecord, LogPersistRegistryState } from \"./log-persist.interface\";\nimport { persistLogger } from \"./log-persist-logger\";\n\nconst DEFAULT_REGISTRY: LogPersistRegistryState = {\n updatedAt: new Date(0).toISOString(),\n service: \"\",\n processes: {},\n};\n\n/** Per-process shard — each process owns one file; no cross-process RMW. */\ninterface LogPersistProcessShard extends LogPersistProcessRecord {\n service: string;\n updatedAt: string;\n}\n\nconst DEFAULT_SHARD: LogPersistProcessShard = {\n service: \"\",\n updatedAt: new Date(0).toISOString(),\n pid: 0,\n enabledAt: new Date(0).toISOString(),\n lastHeartbeatAt: new Date(0).toISOString(),\n};\n\nconst legacyStores = new Map<\n string,\n ReturnType<typeof createJsonFileStateStore<LogPersistRegistryState, \"processes\">>\n>();\n\nconst shardStores = new Map<string, ReturnType<typeof createJsonFileStateStore<LogPersistProcessShard>>>();\n\nfunction isLegacyRegistryFile(registryPath: string): boolean {\n return registryPath.endsWith(\".json\");\n}\n\nfunction legacyStoreFor(filePath: string) {\n let store = legacyStores.get(filePath);\n if (store == null) {\n store = createJsonFileStateStore<LogPersistRegistryState, \"processes\">({\n filePath,\n defaultState: DEFAULT_REGISTRY,\n nestedKeys: [\"processes\"],\n updatedAtKey: \"updatedAt\",\n });\n legacyStores.set(filePath, store);\n }\n return store;\n}\n\nfunction shardStoreFor(shardFilePath: string) {\n let store = shardStores.get(shardFilePath);\n if (store == null) {\n store = createJsonFileStateStore<LogPersistProcessShard>({\n filePath: shardFilePath,\n defaultState: DEFAULT_SHARD,\n updatedAtKey: \"updatedAt\",\n });\n shardStores.set(shardFilePath, store);\n }\n return store;\n}\n\nfunction shardFilePath(registryDir: string, process: string): string {\n return join(registryDir, `${process}.json`);\n}\n\n/** Registry root directory — one shard file per process under this path. */\nexport function defaultLogPersistRegistryPath(registryDir: string): string {\n return join(registryDir, \"log-persist-registry\");\n}\n\nasync function readShardedLogPersistRegistry(registryDir: string): Promise<LogPersistRegistryState> {\n await mkdir(registryDir, { recursive: true });\n\n let entries: string[];\n try {\n entries = await readdir(registryDir);\n } catch {\n return { ...DEFAULT_REGISTRY };\n }\n\n const processes: Record<string, LogPersistProcessRecord> = {};\n let service = \"\";\n let updatedAt = new Date(0).toISOString();\n\n for (const name of entries) {\n if (!name.endsWith(\".json\")) {\n continue;\n }\n\n const processName = name.slice(0, -\".json\".length);\n if (processName === \"\" || processName.startsWith(\"_\")) {\n continue;\n }\n\n try {\n const raw = await readFile(join(registryDir, name), \"utf8\");\n const shard = JSON.parse(raw) as Partial<LogPersistProcessShard>;\n if (shard.service != null && shard.service !== \"\") {\n service = shard.service;\n }\n if (shard.updatedAt != null && shard.updatedAt > updatedAt) {\n updatedAt = shard.updatedAt;\n }\n processes[processName] = {\n pid: shard.pid ?? 0,\n enabledAt: shard.enabledAt ?? new Date(0).toISOString(),\n lastHeartbeatAt: shard.lastHeartbeatAt ?? new Date(0).toISOString(),\n };\n } catch {\n persistLogger.warn(\"registry shard read skipped — corrupt or missing\", {\n registryDir,\n shard: name,\n });\n }\n }\n\n return { updatedAt, service, processes };\n}\n\nexport async function registerLogPersistProcess(input: {\n registryFilePath: string;\n service: string;\n process: string;\n}): Promise<void> {\n const now = new Date().toISOString();\n const record: LogPersistProcessRecord = {\n pid: process.pid,\n enabledAt: now,\n lastHeartbeatAt: now,\n };\n\n if (isLegacyRegistryFile(input.registryFilePath)) {\n await legacyStoreFor(input.registryFilePath).write({\n service: input.service,\n processes: {\n [input.process]: record,\n },\n });\n } else {\n await shardStoreFor(shardFilePath(input.registryFilePath, input.process)).write({\n service: input.service,\n pid: record.pid,\n enabledAt: record.enabledAt,\n lastHeartbeatAt: record.lastHeartbeatAt,\n });\n }\n\n persistLogger.info(\"registry process registered\", {\n registryFilePath: input.registryFilePath,\n service: input.service,\n process: input.process,\n pid: record.pid,\n });\n}\n\nexport async function heartbeatLogPersistProcess(input: { registryFilePath: string; process: string }): Promise<void> {\n if (isLegacyRegistryFile(input.registryFilePath)) {\n const current = await legacyStoreFor(input.registryFilePath).read();\n const existing = current.processes[input.process];\n if (existing == null) {\n persistLogger.warn(\"registry heartbeat skipped — process not registered\", {\n registryFilePath: input.registryFilePath,\n process: input.process,\n });\n return;\n }\n\n await legacyStoreFor(input.registryFilePath).write({\n processes: {\n [input.process]: {\n ...existing,\n lastHeartbeatAt: new Date().toISOString(),\n },\n },\n });\n return;\n }\n\n const store = shardStoreFor(shardFilePath(input.registryFilePath, input.process));\n const current = await store.read();\n if (current.pid === 0) {\n persistLogger.warn(\"registry heartbeat skipped — process not registered\", {\n registryFilePath: input.registryFilePath,\n process: input.process,\n });\n return;\n }\n\n await store.write({\n lastHeartbeatAt: new Date().toISOString(),\n });\n}\n\nexport async function unregisterLogPersistProcess(input: { registryFilePath: string; process: string }): Promise<void> {\n if (isLegacyRegistryFile(input.registryFilePath)) {\n const current = await legacyStoreFor(input.registryFilePath).read();\n const existing = current.processes[input.process];\n if (existing == null) {\n persistLogger.warn(\"registry unregister skipped — process not found\", {\n registryFilePath: input.registryFilePath,\n process: input.process,\n });\n return;\n }\n\n await legacyStoreFor(input.registryFilePath).write({\n processes: {\n [input.process]: {\n ...existing,\n pid: 0,\n lastHeartbeatAt: new Date(0).toISOString(),\n },\n },\n });\n\n persistLogger.info(\"registry process unregistered\", {\n registryFilePath: input.registryFilePath,\n process: input.process,\n });\n return;\n }\n\n const store = shardStoreFor(shardFilePath(input.registryFilePath, input.process));\n const current = await store.read();\n if (current.pid === 0) {\n persistLogger.warn(\"registry unregister skipped — process not found\", {\n registryFilePath: input.registryFilePath,\n process: input.process,\n });\n return;\n }\n\n await store.write({\n pid: 0,\n lastHeartbeatAt: new Date(0).toISOString(),\n });\n\n persistLogger.info(\"registry process unregistered\", {\n registryFilePath: input.registryFilePath,\n process: input.process,\n });\n}\n\nexport async function readLogPersistRegistry(registryFilePath: string): Promise<LogPersistRegistryState> {\n if (isLegacyRegistryFile(registryFilePath)) {\n return legacyStoreFor(registryFilePath).read();\n }\n return readShardedLogPersistRegistry(registryFilePath);\n}\n","import { type LogEntry, LogLevel } from \"./log-manager\";\nimport { DEFAULT_LOG_PERSIST_CONFIG, resolveLogPersistConfig } from \"./log-persist.config\";\nimport type {\n EnableLogPersistOptions,\n LogPersistConfig,\n LogPersistLane,\n LogPersistStats,\n} from \"./log-persist.interface\";\nimport { computeLogBatchIdempotencyKey } from \"./log-persist-batch-id\";\nimport { buildLogListDraft, estimateEntriesBytes, postLogBatch, takeEntriesWithinBytes } from \"./log-persist-flush\";\nimport { registerLogPersistOffer } from \"./log-persist-hook\";\nimport { isLogPersistInternalTopic, patchPersistLoggerScope, persistLogger } from \"./log-persist-logger\";\nimport { heartbeatLogPersistProcess } from \"./log-persist-registry\";\n\nconst FAST_RETRY_INTERVAL_MS = 5_000;\nconst HEARTBEAT_INTERVAL_MS = 30_000;\n\nfunction routeLane(level: LogLevel): LogPersistLane {\n if (level === LogLevel.CRITICAL) {\n return \"fast\";\n }\n if (level === LogLevel.ERROR || level === LogLevel.SUCCESS) {\n return \"medium\";\n }\n return \"slow\";\n}\n\nclass LogPersist {\n private static instance: LogPersist | null = null;\n\n private enabled = false;\n private draining = false;\n private service: string | null = null;\n private processName: string | null = null;\n private registryFilePath: string | null = null;\n private config: LogPersistConfig = DEFAULT_LOG_PERSIST_CONFIG;\n\n private fastQueue: LogEntry[] = [];\n private fastRetryQueue: LogEntry[] = [];\n private mediumQueue: LogEntry[] = [];\n private slowQueue: LogEntry[] = [];\n\n private mediumDebounceTimer: ReturnType<typeof setTimeout> | null = null;\n private slowQueueStartedAt: number | null = null;\n private fastRetryTimer: ReturnType<typeof setTimeout> | null = null;\n private heartbeatTimer: ReturnType<typeof setInterval> | null = null;\n private lastHeartbeatAt = 0;\n\n private laneFlushing: Record<LogPersistLane, boolean> = {\n fast: false,\n medium: false,\n slow: false,\n };\n\n private consecutiveFailures: Record<LogPersistLane, number> = {\n fast: 0,\n medium: 0,\n slow: 0,\n };\n\n private lastFlushAt: Record<LogPersistLane, string | null> = {\n fast: null,\n medium: null,\n slow: null,\n };\n\n private lastError: string | null = null;\n private lastErrorAt: string | null = null;\n private shutdownHookInstalled = false;\n private shutdownPromise: Promise<void> | null = null;\n\n static getInstance(): LogPersist {\n LogPersist.instance ??= new LogPersist();\n return LogPersist.instance;\n }\n\n async enable(options: EnableLogPersistOptions): Promise<void> {\n if (this.enabled) {\n persistLogger.warn(\"log persist core enable skipped — already enabled\", {\n service: this.service,\n process: this.processName,\n });\n return;\n }\n\n this.service = options.service;\n this.processName = options.process;\n this.registryFilePath = options.registryFilePath ?? null;\n this.config = resolveLogPersistConfig(options.config);\n this.draining = false;\n this.shutdownPromise = null;\n this.consecutiveFailures = { fast: 0, medium: 0, slow: 0 };\n this.lastError = null;\n this.lastErrorAt = null;\n this.enabled = true;\n\n patchPersistLoggerScope({\n service: options.service,\n process: options.process,\n });\n\n persistLogger.info(\"log persist core enabled\", {\n service: options.service,\n process: options.process,\n registryFilePath: this.registryFilePath,\n config: this.config,\n pid: process.pid,\n });\n\n registerLogPersistOffer((entry) => {\n this.offer(entry);\n });\n\n if (this.registryFilePath != null) {\n const { registerLogPersistProcess } = await import(\"./log-persist-registry\");\n await registerLogPersistProcess({\n registryFilePath: this.registryFilePath,\n service: options.service,\n process: options.process,\n });\n this.startHeartbeat();\n }\n\n this.installShutdownHook();\n }\n\n async disable(): Promise<void> {\n if (!this.enabled && !this.draining) {\n persistLogger.debug(\"disable skipped — not enabled\");\n return;\n }\n\n persistLogger.info(\"log persist core disabling\", this.queueSnapshot());\n this.cancelMediumDebounce();\n this.stopHeartbeat();\n await this.shutdown();\n persistLogger.info(\"log persist core disabled\");\n }\n\n offer(entry: LogEntry): void {\n if (isLogPersistInternalTopic(entry.topic)) {\n return;\n }\n\n if (!this.enabled || this.draining || this.service == null || this.processName == null) {\n return;\n }\n\n void this.touchRegistryHeartbeat();\n\n const lane = routeLane(entry.level);\n\n if (lane === \"fast\") {\n this.fastQueue.push(entry);\n this.evictFastOverflow();\n void this.flushFast();\n return;\n }\n\n if (lane === \"medium\") {\n this.mediumQueue.push(entry);\n this.evictMediumOverflow();\n this.scheduleMediumFlush();\n return;\n }\n\n this.slowQueue.push(entry);\n if (this.slowQueueStartedAt == null) {\n this.slowQueueStartedAt = Date.now();\n }\n this.evictSlowOverflow();\n this.scheduleSlowFlush();\n }\n\n getStats(): LogPersistStats {\n return {\n enabled: this.enabled,\n draining: this.draining,\n service: this.service,\n process: this.processName,\n queues: {\n fast: this.fastQueue.length,\n fastRetry: this.fastRetryQueue.length,\n medium: this.mediumQueue.length,\n slow: this.slowQueue.length,\n },\n queueBytes: {\n fast: estimateEntriesBytes(this.fastQueue),\n fastRetry: estimateEntriesBytes(this.fastRetryQueue),\n medium: estimateEntriesBytes(this.mediumQueue),\n slow: estimateEntriesBytes(this.slowQueue),\n },\n mediumDebouncePending: this.mediumDebounceTimer != null,\n laneFlushing: { ...this.laneFlushing },\n consecutiveFailures: { ...this.consecutiveFailures },\n config: this.config,\n lastFlushAt: { ...this.lastFlushAt },\n lastError: this.lastError,\n lastErrorAt: this.lastErrorAt,\n };\n }\n\n async shutdown(): Promise<void> {\n if (this.shutdownPromise != null) {\n return this.shutdownPromise;\n }\n\n this.shutdownPromise = this.shutdownInner();\n return this.shutdownPromise;\n }\n\n private async shutdownInner(): Promise<void> {\n if (this.draining) {\n return;\n }\n\n this.draining = true;\n this.enabled = false;\n registerLogPersistOffer(null);\n\n persistLogger.info(\"shutdown flush started\", this.queueSnapshot());\n\n this.cancelMediumDebounce();\n await this.drainQueues(this.config.shutdownDrainTimeoutMs);\n\n if (this.registryFilePath != null && this.processName != null) {\n const { unregisterLogPersistProcess } = await import(\"./log-persist-registry\");\n await unregisterLogPersistProcess({\n registryFilePath: this.registryFilePath,\n process: this.processName,\n });\n }\n\n if (this.hasQueued()) {\n persistLogger.warn(\"shutdown drain incomplete — queued logs dropped\", {\n ...this.queueSnapshot(),\n shutdownDrainTimeoutMs: this.config.shutdownDrainTimeoutMs,\n });\n this.fastQueue = [];\n this.fastRetryQueue = [];\n this.mediumQueue = [];\n this.slowQueue = [];\n this.slowQueueStartedAt = null;\n }\n\n persistLogger.info(\"shutdown flush completed\", this.queueSnapshot());\n }\n\n private hasQueued(): boolean {\n return (\n this.fastQueue.length > 0 ||\n this.fastRetryQueue.length > 0 ||\n this.mediumQueue.length > 0 ||\n this.slowQueue.length > 0\n );\n }\n\n private async drainQueues(timeoutMs: number): Promise<void> {\n const deadline = Date.now() + timeoutMs;\n while (this.hasQueued() && Date.now() < deadline) {\n await this.flushFast();\n await this.flushMedium();\n await this.flushSlow();\n }\n }\n\n private recordLaneError(lane: LogPersistLane, error: unknown): void {\n const message = error instanceof Error ? error.message : String(error);\n this.lastError = message;\n this.lastErrorAt = new Date().toISOString();\n this.consecutiveFailures[lane] += 1;\n }\n\n private recordLaneSuccess(lane: LogPersistLane): void {\n this.lastError = null;\n this.consecutiveFailures[lane] = 0;\n }\n\n private queueSnapshot(): Record<string, unknown> {\n return {\n queues: {\n fast: this.fastQueue.length,\n fastRetry: this.fastRetryQueue.length,\n medium: this.mediumQueue.length,\n slow: this.slowQueue.length,\n },\n queueBytes: {\n fast: estimateEntriesBytes(this.fastQueue),\n fastRetry: estimateEntriesBytes(this.fastRetryQueue),\n medium: estimateEntriesBytes(this.mediumQueue),\n slow: estimateEntriesBytes(this.slowQueue),\n },\n laneFlushing: { ...this.laneFlushing },\n consecutiveFailures: { ...this.consecutiveFailures },\n lastError: this.lastError,\n };\n }\n\n private installShutdownHook(): void {\n if (this.shutdownHookInstalled) {\n return;\n }\n this.shutdownHookInstalled = true;\n\n const handler = (signal: NodeJS.Signals) => {\n persistLogger.info(\"shutdown signal received\", { signal });\n void this.shutdown();\n };\n process.once(\"SIGTERM\", handler);\n process.once(\"SIGINT\", handler);\n }\n\n private startHeartbeat(): void {\n this.stopHeartbeat();\n this.heartbeatTimer = setInterval(() => {\n void this.touchRegistryHeartbeat(true);\n }, HEARTBEAT_INTERVAL_MS);\n this.heartbeatTimer.unref?.();\n }\n\n private stopHeartbeat(): void {\n if (this.heartbeatTimer != null) {\n clearInterval(this.heartbeatTimer);\n this.heartbeatTimer = null;\n }\n }\n\n private async touchRegistryHeartbeat(force = false): Promise<void> {\n if (this.registryFilePath == null || this.processName == null) {\n return;\n }\n const now = Date.now();\n if (!force && now - this.lastHeartbeatAt < HEARTBEAT_INTERVAL_MS) {\n return;\n }\n this.lastHeartbeatAt = now;\n await heartbeatLogPersistProcess({\n registryFilePath: this.registryFilePath,\n process: this.processName,\n });\n }\n\n private scheduleMediumFlush(): void {\n const { debounceMs, maxEntries, maxBytes } = this.config.medium;\n const queueBytes = estimateEntriesBytes(this.mediumQueue);\n if (this.mediumQueue.length >= maxEntries || queueBytes >= maxBytes) {\n persistLogger.warn(\"medium flush scheduled — threshold\", {\n reason: this.mediumQueue.length >= maxEntries ? \"maxEntries\" : \"maxBytes\",\n queueLength: this.mediumQueue.length,\n maxEntries,\n queueBytes,\n maxBytes,\n });\n this.cancelMediumDebounce();\n void this.flushMedium();\n return;\n }\n\n if (this.mediumDebounceTimer == null && this.mediumQueue.length > 0) {\n persistLogger.debug(\"medium flush debounce scheduled\", {\n debounceMs,\n queueLength: this.mediumQueue.length,\n queueBytes,\n });\n this.mediumDebounceTimer = setTimeout(() => {\n this.mediumDebounceTimer = null;\n persistLogger.debug(\"medium flush debounce fired\");\n void this.flushMedium();\n }, debounceMs);\n this.mediumDebounceTimer.unref?.();\n }\n }\n\n private cancelMediumDebounce(): void {\n if (this.mediumDebounceTimer != null) {\n clearTimeout(this.mediumDebounceTimer);\n this.mediumDebounceTimer = null;\n persistLogger.debug(\"medium flush debounce cancelled\");\n }\n }\n\n private scheduleSlowFlush(): void {\n const { maxEntries, maxBytes, maxAgeMs } = this.config.slow;\n const queueBytes = estimateEntriesBytes(this.slowQueue);\n const ageMs = this.slowQueueStartedAt != null ? Date.now() - this.slowQueueStartedAt : 0;\n if (this.slowQueue.length >= maxEntries || queueBytes >= maxBytes || ageMs >= maxAgeMs) {\n persistLogger.debug(\"slow flush scheduled — threshold\", {\n reason:\n this.slowQueue.length >= maxEntries\n ? \"maxEntries\"\n : queueBytes >= maxBytes\n ? \"maxBytes\"\n : \"maxAgeMs\",\n queueLength: this.slowQueue.length,\n maxEntries,\n queueBytes,\n maxBytes,\n ageMs,\n maxAgeMs,\n });\n void this.flushSlow();\n }\n }\n\n private evictFastOverflow(): void {\n const { maxBufferEntries } = this.config.fast;\n let evicted = 0;\n while (this.fastQueue.length + this.fastRetryQueue.length > maxBufferEntries) {\n const removed = this.fastQueue.length > 0 ? this.fastQueue.shift() : this.fastRetryQueue.shift();\n evicted += 1;\n persistLogger.warn(\"fast queue overflow — evicted entry\", {\n evictedLevel: removed?.level,\n evictedTopic: removed?.topic,\n fromRetryQueue: this.fastQueue.length === 0,\n maxBufferEntries,\n });\n }\n if (evicted > 0) {\n persistLogger.warn(\"fast queue overflow summary\", { evicted, maxBufferEntries });\n }\n }\n\n private evictMediumOverflow(): void {\n const { maxBufferEntries } = this.config.medium;\n let evicted = 0;\n while (this.mediumQueue.length > maxBufferEntries) {\n const successIndex = this.mediumQueue.findIndex((entry) => entry.level === LogLevel.SUCCESS);\n const removed = successIndex >= 0 ? this.mediumQueue.splice(successIndex, 1)[0] : this.mediumQueue.shift();\n evicted += 1;\n persistLogger.warn(\"medium queue overflow — evicted entry\", {\n evictedLevel: removed?.level,\n evictedTopic: removed?.topic,\n queueLength: this.mediumQueue.length,\n maxBufferEntries,\n });\n }\n if (evicted > 0) {\n persistLogger.warn(\"medium queue overflow summary\", {\n evicted,\n queueLength: this.mediumQueue.length,\n maxBufferEntries,\n });\n }\n }\n\n private evictSlowOverflow(): void {\n const { maxBufferEntries } = this.config.slow;\n let evicted = 0;\n while (this.slowQueue.length > maxBufferEntries) {\n const debugIndex = this.slowQueue.findIndex((entry) => entry.level === LogLevel.DEBUG);\n const removed = debugIndex >= 0 ? this.slowQueue.splice(debugIndex, 1)[0] : this.slowQueue.shift();\n evicted += 1;\n persistLogger.warn(\"slow queue overflow — evicted entry\", {\n evictedLevel: removed?.level,\n evictedTopic: removed?.topic,\n queueLength: this.slowQueue.length,\n maxBufferEntries,\n });\n }\n if (evicted > 0) {\n persistLogger.warn(\"slow queue overflow summary\", {\n evicted,\n queueLength: this.slowQueue.length,\n maxBufferEntries,\n });\n }\n if (this.slowQueue.length === 0) {\n this.slowQueueStartedAt = null;\n }\n }\n\n private async flushFast(): Promise<void> {\n if (this.laneFlushing.fast) {\n persistLogger.debug(\"fast flush skipped — already flushing\");\n return;\n }\n if (this.service == null || this.processName == null) {\n return;\n }\n\n this.laneFlushing.fast = true;\n try {\n while (this.fastQueue.length > 0 || this.fastRetryQueue.length > 0) {\n const fromRetry = this.fastQueue.length === 0;\n const entry = this.fastQueue.shift() ?? this.fastRetryQueue.shift();\n if (entry == null) {\n break;\n }\n\n const idempotencyKey = computeLogBatchIdempotencyKey({\n service: this.service,\n process: this.processName,\n lane: \"fast\",\n entries: [entry],\n });\n\n try {\n const draft = buildLogListDraft({\n service: this.service,\n process: this.processName,\n lane: \"fast\",\n idempotencyKey,\n entries: [entry],\n });\n persistLogger.debug(\"fast flush posting batch\", {\n idempotencyKey,\n fromRetry,\n level: entry.level,\n topic: entry.topic,\n });\n await postLogBatch(draft, this.config.postTimeoutMs);\n this.lastFlushAt.fast = new Date().toISOString();\n this.recordLaneSuccess(\"fast\");\n persistLogger.info(\"fast lane flushed\", {\n idempotencyKey,\n level: entry.level,\n topic: entry.topic,\n fastRetryRemaining: this.fastRetryQueue.length,\n });\n } catch (error) {\n this.recordLaneError(\"fast\", error);\n this.fastRetryQueue.push(entry);\n persistLogger.error(\"fast flush failed — queued for retry\", {\n idempotencyKey,\n error: this.lastError,\n retryInMs: FAST_RETRY_INTERVAL_MS,\n fastRetryQueue: this.fastRetryQueue.length,\n });\n this.scheduleFastRetry();\n break;\n }\n }\n } finally {\n this.laneFlushing.fast = false;\n }\n }\n\n private scheduleFastRetry(): void {\n if (this.fastRetryTimer != null) {\n return;\n }\n persistLogger.warn(\"fast flush retry scheduled\", { retryInMs: FAST_RETRY_INTERVAL_MS });\n this.fastRetryTimer = setTimeout(() => {\n this.fastRetryTimer = null;\n persistLogger.debug(\"fast flush retry timer fired\");\n void this.flushFast();\n }, FAST_RETRY_INTERVAL_MS);\n this.fastRetryTimer.unref?.();\n }\n\n private async flushMedium(): Promise<void> {\n if (this.laneFlushing.medium) {\n persistLogger.debug(\"medium flush skipped — already flushing\");\n return;\n }\n if (this.mediumQueue.length === 0) {\n return;\n }\n if (this.service == null || this.processName == null) {\n return;\n }\n\n this.laneFlushing.medium = true;\n try {\n while (this.mediumQueue.length > 0) {\n const batch = takeEntriesWithinBytes(this.mediumQueue, this.config.medium.maxBytes);\n if (batch.length === 0) {\n break;\n }\n\n const idempotencyKey = computeLogBatchIdempotencyKey({\n service: this.service,\n process: this.processName,\n lane: \"medium\",\n entries: batch,\n });\n const batchBytes = estimateEntriesBytes(batch);\n\n try {\n persistLogger.debug(\"medium flush posting batch\", {\n idempotencyKey,\n batchSize: batch.length,\n batchBytes,\n queueRemaining: this.mediumQueue.length,\n });\n const draft = buildLogListDraft({\n service: this.service,\n process: this.processName,\n lane: \"medium\",\n idempotencyKey,\n entries: batch,\n });\n await postLogBatch(draft, this.config.postTimeoutMs);\n this.mediumQueue.splice(0, batch.length);\n this.lastFlushAt.medium = new Date().toISOString();\n this.recordLaneSuccess(\"medium\");\n persistLogger.info(\"medium lane flushed\", {\n idempotencyKey,\n batchSize: batch.length,\n batchBytes,\n queueRemaining: this.mediumQueue.length,\n });\n } catch (error) {\n this.recordLaneError(\"medium\", error);\n persistLogger.error(\"medium flush failed — entries retained\", {\n idempotencyKey,\n batchSize: batch.length,\n batchBytes,\n error: this.lastError,\n queueRemaining: this.mediumQueue.length,\n });\n this.scheduleMediumFlush();\n break;\n }\n }\n } finally {\n this.laneFlushing.medium = false;\n }\n\n if (this.mediumQueue.length > 0 && !this.laneFlushing.medium) {\n this.scheduleMediumFlush();\n }\n }\n\n private async flushSlow(): Promise<void> {\n if (this.laneFlushing.slow) {\n persistLogger.debug(\"slow flush skipped — already flushing\");\n return;\n }\n if (this.slowQueue.length === 0) {\n return;\n }\n if (this.service == null || this.processName == null) {\n return;\n }\n\n this.laneFlushing.slow = true;\n try {\n while (this.slowQueue.length > 0) {\n const batch = takeEntriesWithinBytes(this.slowQueue, this.config.slow.maxBytes);\n if (batch.length === 0) {\n break;\n }\n\n const idempotencyKey = computeLogBatchIdempotencyKey({\n service: this.service,\n process: this.processName,\n lane: \"slow\",\n entries: batch,\n });\n const batchBytes = estimateEntriesBytes(batch);\n\n try {\n persistLogger.debug(\"slow flush posting batch\", {\n idempotencyKey,\n batchSize: batch.length,\n batchBytes,\n queueRemaining: this.slowQueue.length,\n });\n const draft = buildLogListDraft({\n service: this.service,\n process: this.processName,\n lane: \"slow\",\n idempotencyKey,\n entries: batch,\n });\n await postLogBatch(draft, this.config.postTimeoutMs);\n this.slowQueue.splice(0, batch.length);\n this.lastFlushAt.slow = new Date().toISOString();\n this.recordLaneSuccess(\"slow\");\n persistLogger.info(\"slow lane flushed\", {\n idempotencyKey,\n batchSize: batch.length,\n batchBytes,\n queueRemaining: this.slowQueue.length,\n });\n } catch (error) {\n this.recordLaneError(\"slow\", error);\n persistLogger.error(\"slow flush failed — entries retained\", {\n idempotencyKey,\n batchSize: batch.length,\n batchBytes,\n error: this.lastError,\n queueRemaining: this.slowQueue.length,\n });\n this.scheduleSlowFlush();\n break;\n }\n }\n\n if (this.slowQueue.length === 0) {\n this.slowQueueStartedAt = null;\n }\n } finally {\n this.laneFlushing.slow = false;\n }\n\n if (this.slowQueue.length > 0 && !this.laneFlushing.slow) {\n this.scheduleSlowFlush();\n }\n }\n}\n\nexport { LogPersist };\n","import { resolve } from \"node:path\";\nimport { envBool } from \"../../node/env/env-parsers\";\nimport { readEnv, requireEnv } from \"../../node/env/require-env\";\nimport { pollUntil } from \"../../node/readiness\";\nimport { createLogger } from \"./create-logger\";\nimport { LogPersist } from \"./log-persist\";\nimport {\n logPersistConfigFromEnv,\n logPersistEnabledFromEnv,\n logPersistProcessFromEnv,\n logPersistRegistryDirFromEnv,\n logPersistServiceFromEnv,\n resolveLogPersistConfig,\n} from \"./log-persist.config\";\nimport type {\n EnableLogPersistOptions,\n EnsureLogPersistFromEnvOptions,\n LogPersistReadySnapshot,\n LogPersistStats,\n WaitForLogPersistReadyOptions,\n} from \"./log-persist.interface\";\nimport { registerLogPersistOffer } from \"./log-persist-hook\";\nimport { LOG_PERSIST_TOPIC, persistLogger } from \"./log-persist-logger\";\nimport { defaultLogPersistRegistryPath, readLogPersistRegistry } from \"./log-persist-registry\";\n\nexport { logPersistEnabledFromEnv };\n\nfunction resolveRegistryFilePath(explicit?: string): string {\n if (explicit != null && explicit.trim() !== \"\") {\n return resolve(explicit);\n }\n const dir = logPersistRegistryDirFromEnv();\n if (dir == null) {\n throw new Error(\n \"[LogPersist] registry path required: set registryFilePath option or LOG_PERSIST_REGISTRY_DIR / RUNTIME_DATA_DIR\",\n );\n }\n return defaultLogPersistRegistryPath(resolve(dir));\n}\n\nexport async function enableLogPersist(options: EnableLogPersistOptions): Promise<void> {\n const registryFilePath = options.registryFilePath != null ? resolve(options.registryFilePath) : undefined;\n const resolvedRegistry = registryFilePath ?? resolveRegistryFilePath();\n\n const envConfig = logPersistConfigFromEnv();\n await LogPersist.getInstance().enable({\n ...options,\n registryFilePath: resolvedRegistry,\n config: resolveLogPersistConfig({\n fast: { ...envConfig.fast, ...options.config?.fast },\n medium: { ...envConfig.medium, ...options.config?.medium },\n slow: { ...envConfig.slow, ...options.config?.slow },\n postTimeoutMs: options.config?.postTimeoutMs ?? envConfig.postTimeoutMs,\n shutdownDrainTimeoutMs: options.config?.shutdownDrainTimeoutMs ?? envConfig.shutdownDrainTimeoutMs,\n }),\n });\n}\n\nexport async function disableLogPersist(): Promise<void> {\n await LogPersist.getInstance().disable();\n}\n\nexport function getLogPersistStats(): LogPersistStats {\n return LogPersist.getInstance().getStats();\n}\n\n/**\n * Enable log persistence when LOG_PERSIST_ENABLED=true.\n * `process` / `service` can be passed explicitly or via LOG_PERSIST_PROCESS / LOG_PERSIST_SERVICE.\n */\nexport async function ensureLogPersistFromEnv(options: EnsureLogPersistFromEnvOptions = {}): Promise<boolean> {\n if (!logPersistEnabledFromEnv()) {\n registerLogPersistOffer(null);\n return false;\n }\n\n const service = options.service ?? logPersistServiceFromEnv();\n const processName = options.process ?? logPersistProcessFromEnv();\n if (service == null || service === \"\") {\n throw new Error(\"[LogPersist] LOG_PERSIST_SERVICE is required when LOG_PERSIST_ENABLED=true\");\n }\n if (processName == null || processName === \"\") {\n throw new Error(\n \"[LogPersist] LOG_PERSIST_PROCESS is required when LOG_PERSIST_ENABLED=true (or pass process option)\",\n );\n }\n\n const registryFilePath =\n options.registryFilePath != null ? resolve(options.registryFilePath) : resolveRegistryFilePath();\n\n await enableLogPersist({\n service,\n process: processName,\n registryFilePath,\n config: options.config,\n });\n\n const lifecycleLogger = createLogger({ module: \"log-persist\" });\n lifecycleLogger.info(\"log persist enabled from env\", {\n topic: LOG_PERSIST_TOPIC,\n data: { service, process: processName, registryFilePath },\n });\n\n return true;\n}\n\n/**\n * Preload guard: when persistence is enabled, required env must be present before app code runs.\n */\nexport function validateLogPersistPreloadEnv(env: NodeJS.ProcessEnv = process.env): void {\n if (!envBool(\"LOG_PERSIST_ENABLED\", false, env)) {\n return;\n }\n\n const missing: string[] = [];\n if (readEnv(\"LOG_PERSIST_SERVICE\", env) == null) {\n missing.push(\"LOG_PERSIST_SERVICE\");\n }\n const registryDir = logPersistRegistryDirFromEnv(env);\n if (registryDir == null) {\n missing.push(\"LOG_PERSIST_REGISTRY_DIR or RUNTIME_DATA_DIR\");\n }\n\n if (missing.length > 0) {\n throw new Error(`[LogPersist] preload env incomplete: ${missing.join(\", \")}`);\n }\n}\n\nfunction evaluateLogPersistReady(\n state: Awaited<ReturnType<typeof readLogPersistRegistry>>,\n expectedProcesses: string[],\n staleMs: number,\n now: number,\n): LogPersistReadySnapshot {\n const missing: string[] = [];\n const stale: string[] = [];\n const registered: string[] = [];\n\n for (const processName of expectedProcesses) {\n const record = state.processes[processName];\n if (record == null) {\n missing.push(processName);\n continue;\n }\n\n const heartbeatAt = Date.parse(record.lastHeartbeatAt);\n if (!Number.isFinite(heartbeatAt) || now - heartbeatAt > staleMs) {\n stale.push(processName);\n continue;\n }\n\n registered.push(processName);\n }\n\n return {\n ok: missing.length === 0 && stale.length === 0,\n missing,\n stale,\n registered,\n };\n}\n\n/**\n * Wait until every expected process has registered in the shared registry with a fresh heartbeat.\n * Call from the service main process after spawning children.\n */\nexport async function waitForLogPersistReady(options: WaitForLogPersistReadyOptions): Promise<LogPersistReadySnapshot> {\n const timeoutMs = options.timeoutMs ?? 60_000;\n const pollIntervalMs = options.pollIntervalMs ?? 500;\n const staleMs = options.staleMs ?? 90_000;\n\n let last: LogPersistReadySnapshot = {\n ok: false,\n missing: [...options.expectedProcesses],\n stale: [],\n registered: [],\n };\n\n try {\n await pollUntil({\n intervalMs: pollIntervalMs,\n timeoutMs,\n until: async () => {\n const state = await readLogPersistRegistry(options.registryFilePath);\n if (state.service !== options.service) {\n last = {\n ok: false,\n missing: options.expectedProcesses,\n stale: [],\n registered: [],\n };\n return false;\n }\n last = evaluateLogPersistReady(state, options.expectedProcesses, staleMs, Date.now());\n return last.ok;\n },\n });\n } catch {\n persistLogger.warn(\"waitForLogPersistReady timed out\", {\n timeoutMs,\n expectedProcesses: options.expectedProcesses,\n ...last,\n });\n }\n\n return last;\n}\n\nexport async function snapshotLogPersistReady(options: {\n registryFilePath: string;\n service: string;\n expectedProcesses: string[];\n staleMs?: number;\n}): Promise<LogPersistReadySnapshot> {\n const state = await readLogPersistRegistry(options.registryFilePath);\n return evaluateLogPersistReady(state, options.expectedProcesses, options.staleMs ?? 90_000, Date.now());\n}\n\nexport function resolveLogPersistRegistryPath(registryDir?: string): string {\n const dir = registryDir ?? logPersistRegistryDirFromEnv();\n if (dir == null) {\n requireEnv(\"LOG_PERSIST_REGISTRY_DIR\");\n }\n return defaultLogPersistRegistryPath(resolve(dir ?? \"\"));\n}\n"],"names":[],"mappings":";;;;;;;;AAAM,SAAU,OAAO,CAAC,IAAY,EAAE,G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O,CAAC,gBAAgB,CAAC;AACpE,IAAA,OAAO,uBAAuB,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,OAAO,IAAI,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;AAC3G;AAEM,SAAU,6BAA6B,CAAC,WAAoB,EAAA;AAC9D,IAAA,MAAM,GAAG,GAAG,WAAW,IAAI,4BAA4B,EAAE;AACzD,IAAA,IAAI,GAAG,IAAI,IAAI,EAAE;QACb,UAAU,CAAC,0BAA0B,CAAC;IAC1C;IACA,OAAO,6BAA6B,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;AAC5D;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-write-queue.d.ts","sourceRoot":"","sources":["../../../src/node/fs/file-write-queue.ts"],"names":[],"mappings":"AAGA,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAWrG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-state-store.d.ts","sourceRoot":"","sources":["../../../src/node/fs/json-state-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json-state-store.d.ts","sourceRoot":"","sources":["../../../src/node/fs/json-state-store.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,EAAE,SAAS,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG;KACrF,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACzD,CAAC;AAEF,MAAM,WAAW,kBAAk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AuF;cACvE,cAAc,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAQrF;;;OAGG;cACa,kBAAkB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7F;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
package/dist/node.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { M as MAX_POLL_TARGET_LIST_SIZE, H as validateWithSchema, f as createLogger, w as pollTargetList, i as generateResponse, g as createTarget, D as supabase, u as logManager, J as createScope, c as LogLevel, K as patchScope, A as scanTargetList, N as withModule, j as getPossibleTarget, r as isOptimisticLockResponse, F as updateTargetDetails } from './chunks/list.api-6Q4_-7oN.js';
|
|
3
3
|
export { B as BaseValidator, C as CREATE_TARGET_ALREADY_EXISTS_MESSAGE, a as CategoryList, L as LOG_BATCH_LOADER_KEY, b as LOG_PERSIST_LOADER_KEY, d as MAX_TARGET_LIST_PAGE_SIZE, O as OPTIMISTIC_LOCK_ERROR_CODE, e as OPTIMISTIC_LOCK_FAILED_MESSAGE, P as PostListValidator, S as StatusCode, U as UPDATE_TARGET_NOT_FOUND_MESSAGE, h as deleteTarget, k as getTarget, l as getTargetList, m as getTargetTotalCount, n as handleSupabaseError, o as isCreateTargetAlreadyExistsError, p as isDevEnvironment, q as isOptimisticLockError, s as logDev, t as logDevGroup, v as patchTarget, x as postListCreate, y as postLogListCreate, z as postTarget, E as updateTarget, G as validateWith } from './chunks/list.api-6Q4_-7oN.js';
|
|
4
|
-
import { l as loadEnvFiles, b as readEnv, c as requireEnv, d as createJsonFileStateStore, a as logPersistEnabledFromEnv, e as disableLogPersist, g as getLogPersistStats, s as snapshotLogPersistReady, w as waitForLogPersistReady, f as ensureLogPersistFromEnv } from './chunks/enable-log-persist-
|
|
5
|
-
export { C as CLI_PROD_FLAG, S as SERVICE_ENV_PROFILE_ENV_KEY, h as SERVICE_ENV_PROFILE_PROD, i as enableLogPersist, j as envBool, k as envInt, m as envMs, n as envNumber, o as envPort, q as envProfileFromProcess, t as parseEnvFile, u as parseEnvLine, p as pinEnvProfileFromArgv, x as pollUntil, y as resolveDefaultEnvFiles, z as resolveLogPersistRegistryPath, r as resolveProjectRootByPackageName, A as resolveProjectRootFromModule, v as validateLogPersistPreloadEnv } from './chunks/enable-log-persist-
|
|
4
|
+
import { l as loadEnvFiles, b as readEnv, c as requireEnv, d as createJsonFileStateStore, a as logPersistEnabledFromEnv, e as disableLogPersist, g as getLogPersistStats, s as snapshotLogPersistReady, w as waitForLogPersistReady, f as ensureLogPersistFromEnv } from './chunks/enable-log-persist-BB-unD4p.js';
|
|
5
|
+
export { C as CLI_PROD_FLAG, S as SERVICE_ENV_PROFILE_ENV_KEY, h as SERVICE_ENV_PROFILE_PROD, i as enableLogPersist, j as envBool, k as envInt, m as envMs, n as envNumber, o as envPort, q as envProfileFromProcess, t as parseEnvFile, u as parseEnvLine, p as pinEnvProfileFromArgv, x as pollUntil, y as resolveDefaultEnvFiles, z as resolveLogPersistRegistryPath, r as resolveProjectRootByPackageName, A as resolveProjectRootFromModule, v as validateLogPersistPreloadEnv } from './chunks/enable-log-persist-BB-unD4p.js';
|
|
6
6
|
import { access, stat, readFile, mkdir, unlink, writeFile, readdir } from 'node:fs/promises';
|
|
7
7
|
import { resolve, join, dirname, isAbsolute } from 'node:path';
|
|
8
8
|
import { bd as sha256Hex, bi as getErrorMessage, aI as postRegisterNode, am as patchChangeNodeStatus, N as NodeStatus, ax as patchStopNode, au as patchNodeHeartBeat, E as EMPTY_REGISTRY_SLOT_RUNTIME_STATE, b3 as runRegistrySlotGuardCheck, aW as registrySlotRuntimePatchFromGuardResult, d as CategoryNode, L as evaluateBusyNodeLiveness, aw as patchServiceRuntime, k as ServiceRegistryError, v as claimServiceRegistrySlot, f as CategoryRepo, R as ResultCode, bj as LOG_TOPIC_TASK, m as TASK_REPO_USAGE, a4 as getScanRemoteRepoValues, aq as patchClaimTask, bk as CRITICAL_UNKNOWN_TASK_TRACE_ID, ao as patchChangeTaskStatus, o as TaskStatusAction, bl as toError, aQ as postTaskSchema, bm as createTaskRow, n as TaskStatus } from './chunks/task-queue-D5uWjqVN.js';
|
|
@@ -555,7 +555,8 @@ class BaseNodeRuntime {
|
|
|
555
555
|
return false;
|
|
556
556
|
}
|
|
557
557
|
this.consecutiveHeartbeatFailures = 0;
|
|
558
|
-
|
|
558
|
+
// Success is the steady state every loop — do not INFO-spam; failures already warn/critical.
|
|
559
|
+
logger.debug("心跳更新成功", {
|
|
559
560
|
topic: LOG_TOPIC_NODE,
|
|
560
561
|
data: { lastHeartBeat: formatHeartbeat(lastHeartBeat) },
|
|
561
562
|
});
|
|
@@ -572,15 +573,27 @@ class BaseNodeRuntime {
|
|
|
572
573
|
minLevel: this.loopLoggerMinLevel(),
|
|
573
574
|
});
|
|
574
575
|
cmdLogger.debug("開始檢查控制指令", { topic: LOG_TOPIC_COMMAND });
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
576
|
+
let commandList = [];
|
|
577
|
+
try {
|
|
578
|
+
const polled = await getPollCommandList({
|
|
579
|
+
nodeId,
|
|
580
|
+
traceId: loopTraceId,
|
|
581
|
+
size: MAX_POLL_TARGET_LIST_SIZE,
|
|
582
|
+
});
|
|
583
|
+
if (polled.error) {
|
|
584
|
+
cmdLogger.warn("獲取指令失敗", {
|
|
585
|
+
topic: LOG_TOPIC_COMMAND,
|
|
586
|
+
data: { error: polled.error.message },
|
|
587
|
+
});
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
commandList = polled.data ?? [];
|
|
591
|
+
}
|
|
592
|
+
catch (error) {
|
|
593
|
+
// pollTargetList throws on transport/DB failures — treat as soft miss, not loop CRITICAL.
|
|
581
594
|
cmdLogger.warn("獲取指令失敗", {
|
|
582
595
|
topic: LOG_TOPIC_COMMAND,
|
|
583
|
-
data: { error:
|
|
596
|
+
data: { error: getErrorMessage(error) },
|
|
584
597
|
});
|
|
585
598
|
return;
|
|
586
599
|
}
|