target-supabase-sdk 0.2.25 → 0.3.1
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/browser.d.ts +2 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +2 -2
- package/dist/chunks/{list.api-B-aM4vzv.js → config-aBbuDpyt.js} +144 -2
- package/dist/chunks/config-aBbuDpyt.js.map +1 -0
- package/dist/chunks/{enable-DkiKPHDl.js → enable-BTFwzWHc.js} +3 -120
- package/dist/chunks/enable-BTFwzWHc.js.map +1 -0
- package/dist/chunks/{task-queue-BYfO0Nzm.js → task-queue-D8CraGI8.js} +36 -7
- package/dist/chunks/task-queue-D8CraGI8.js.map +1 -0
- package/dist/core.api.d.ts +17 -0
- package/dist/core.api.d.ts.map +1 -1
- package/dist/node/{node-runtime.base.d.ts → base-node-runtime.d.ts} +4 -1
- package/dist/node/base-node-runtime.d.ts.map +1 -0
- package/dist/node/node-liveness.d.ts +2 -0
- package/dist/node/node-liveness.d.ts.map +1 -1
- package/dist/node/node-service-id.d.ts +3 -0
- package/dist/node/node-service-id.d.ts.map +1 -0
- package/dist/node/node.api.d.ts +9 -1
- package/dist/node/node.api.d.ts.map +1 -1
- package/dist/node/node.interface.d.ts +12 -3
- package/dist/node/node.interface.d.ts.map +1 -1
- package/dist/node/service-guard/run-service-guard-tick.d.ts.map +1 -1
- package/dist/node/service-guard/service-guard-node.d.ts +3 -1
- package/dist/node/service-guard/service-guard-node.d.ts.map +1 -1
- package/dist/node/service-host/service-host.d.ts.map +1 -1
- package/dist/node/service-host/single-process-service.d.ts.map +1 -1
- package/dist/node.d.ts +2 -2
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +199 -181
- package/dist/node.js.map +1 -1
- package/dist/preload.js +2 -2
- package/dist/service/service.interface.d.ts +5 -3
- package/dist/service/service.interface.d.ts.map +1 -1
- package/dist/task/task-node.d.ts +3 -1
- package/dist/task/task-node.d.ts.map +1 -1
- package/dist/task/task.interface.d.ts +3 -1
- package/dist/task/task.interface.d.ts.map +1 -1
- package/dist/trigger/trigger-manager.d.ts +1 -1
- package/dist/trigger/trigger-node.d.ts +3 -1
- package/dist/trigger/trigger-node.d.ts.map +1 -1
- package/dist/trigger/trigger.api.d.ts +10 -10
- package/package.json +1 -1
- package/src/browser.ts +2 -1
- package/src/core.api.ts +53 -0
- package/src/node/{node-runtime.base.ts → base-node-runtime.ts} +11 -2
- package/src/node/node-liveness.ts +6 -1
- package/src/node/node-service-id.ts +12 -0
- package/src/node/node.api.ts +7 -5
- package/src/node/node.interface.ts +12 -2
- package/src/node/service-guard/run-service-guard-tick.ts +12 -6
- package/src/node/service-guard/service-guard-node.ts +6 -1
- package/src/node/service-host/service-host.ts +2 -1
- package/src/node/service-host/single-process-service.ts +3 -0
- package/src/node.ts +2 -2
- package/src/service/service.interface.ts +4 -2
- package/src/task/task-node.ts +6 -1
- package/src/task/task.interface.ts +2 -0
- package/src/trigger/trigger-manager.ts +1 -1
- package/src/trigger/trigger-node.ts +6 -1
- package/dist/chunks/enable-DkiKPHDl.js.map +0 -1
- package/dist/chunks/list.api-B-aM4vzv.js.map +0 -1
- package/dist/chunks/task-queue-BYfO0Nzm.js.map +0 -1
- package/dist/node/node-runtime.base.d.ts.map +0 -1
|
@@ -1,76 +1,9 @@
|
|
|
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 { f as createLogger, L as LOG_BATCH_LIST_VALUE, a as CategoryList, A as postListCreate,
|
|
4
|
+
import { X as envBool, f as createLogger, L as LOG_BATCH_LIST_VALUE, a as CategoryList, A as postListCreate, Y as DEFAULT_LOG_SPOOL_CONFIG, Z as resolveLogSpoolConfig, _ as randomLogSpoolShortId, $ as buildLogSpoolBatchBaseName, a0 as registerLogPersistOffer, a1 as LOG_SPOOL_SERVICE_ID_ENV, a2 as logSpoolServiceIdFromEnv, a3 as logSpoolConfigFromEnv } from './config-aBbuDpyt.js';
|
|
5
5
|
import { mkdir, writeFile, rename } from 'node:fs/promises';
|
|
6
6
|
|
|
7
|
-
function readEnv(name, env = process.env) {
|
|
8
|
-
const value = env[name]?.trim();
|
|
9
|
-
if (value == null || value === "") {
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
|
-
return value;
|
|
13
|
-
}
|
|
14
|
-
function requireEnv(name, env = process.env) {
|
|
15
|
-
const value = readEnv(name, env);
|
|
16
|
-
if (value == null) {
|
|
17
|
-
throw new Error(`Missing required environment variable: ${name}`);
|
|
18
|
-
}
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function envInt(name, defaultValue, options) {
|
|
23
|
-
const env = options?.env ?? process.env;
|
|
24
|
-
const raw = readEnv(name, env);
|
|
25
|
-
if (raw == null) {
|
|
26
|
-
return defaultValue;
|
|
27
|
-
}
|
|
28
|
-
const value = Number(raw);
|
|
29
|
-
if (!Number.isInteger(value)) {
|
|
30
|
-
throw new Error(`Invalid ${name}: ${raw}`);
|
|
31
|
-
}
|
|
32
|
-
const min = options?.min;
|
|
33
|
-
if (min != null && value < min) {
|
|
34
|
-
throw new Error(`Invalid ${name}: ${raw}`);
|
|
35
|
-
}
|
|
36
|
-
const max = options?.max;
|
|
37
|
-
if (max != null && value > max) {
|
|
38
|
-
throw new Error(`Invalid ${name}: ${raw}`);
|
|
39
|
-
}
|
|
40
|
-
return value;
|
|
41
|
-
}
|
|
42
|
-
function envMs(name, defaultMs, options) {
|
|
43
|
-
return envInt(name, defaultMs, { ...options, min: options?.min ?? 1 });
|
|
44
|
-
}
|
|
45
|
-
function envPort(defaultPort = 3100, options) {
|
|
46
|
-
const envKey = options?.envKey ?? "PORT";
|
|
47
|
-
return envInt(envKey, defaultPort, { ...options, min: 1, max: 65535 });
|
|
48
|
-
}
|
|
49
|
-
function envNumber(name, defaultValue, options) {
|
|
50
|
-
const env = options?.env ?? process.env;
|
|
51
|
-
const raw = readEnv(name, env);
|
|
52
|
-
if (raw == null) {
|
|
53
|
-
return defaultValue;
|
|
54
|
-
}
|
|
55
|
-
const value = Number(raw);
|
|
56
|
-
if (!Number.isFinite(value)) {
|
|
57
|
-
throw new Error(`Invalid ${name}: ${raw}`);
|
|
58
|
-
}
|
|
59
|
-
const min = options?.min;
|
|
60
|
-
const resolved = options?.floor === true ? Math.floor(value) : value;
|
|
61
|
-
if (min != null && resolved < min) {
|
|
62
|
-
throw new Error(`Invalid ${name}: ${raw}`);
|
|
63
|
-
}
|
|
64
|
-
return resolved;
|
|
65
|
-
}
|
|
66
|
-
function envBool(name, defaultValue = false, env = process.env) {
|
|
67
|
-
const raw = readEnv(name, env)?.toLowerCase();
|
|
68
|
-
if (raw == null) {
|
|
69
|
-
return defaultValue;
|
|
70
|
-
}
|
|
71
|
-
return raw === "1" || raw === "true" || raw === "yes";
|
|
72
|
-
}
|
|
73
|
-
|
|
74
7
|
const DEFAULT_ENV_FILES = [".env.local", ".env"];
|
|
75
8
|
const PROD_ENV_FILES = [".env.prod"];
|
|
76
9
|
const SERVICE_ENV_PROFILE_ENV_KEY = "SERVICE_ENV_PROFILE";
|
|
@@ -232,56 +165,6 @@ function isLogPersistInternalTopic(topic) {
|
|
|
232
165
|
return topic === LOG_PERSIST_INTERNAL_TOPIC;
|
|
233
166
|
}
|
|
234
167
|
|
|
235
|
-
const LOG_SPOOL_SERVICE_ID_ENV = "LOG_SPOOL_SERVICE_ID";
|
|
236
|
-
const DEFAULT_LOG_SPOOL_CONFIG = {
|
|
237
|
-
writer: {
|
|
238
|
-
maxEntries: 2000,
|
|
239
|
-
maxBytes: 2 * 1024 * 1024,
|
|
240
|
-
flushDebounceMs: 3_000,
|
|
241
|
-
maxAgeMs: 60_000,
|
|
242
|
-
postTimeoutMs: 30_000,
|
|
243
|
-
},
|
|
244
|
-
gc: {
|
|
245
|
-
intervalMs: 24 * 60 * 60 * 1000,
|
|
246
|
-
syncedRetentionMs: 7 * 24 * 60 * 60 * 1000,
|
|
247
|
-
tmpRetentionMs: 7 * 24 * 60 * 60 * 1000,
|
|
248
|
-
},
|
|
249
|
-
collectIntervalMs: 60_000,
|
|
250
|
-
};
|
|
251
|
-
function resolveLogSpoolConfig(partial) {
|
|
252
|
-
const defaults = DEFAULT_LOG_SPOOL_CONFIG;
|
|
253
|
-
return {
|
|
254
|
-
writer: { ...defaults.writer, ...partial?.writer },
|
|
255
|
-
gc: { ...defaults.gc, ...partial?.gc },
|
|
256
|
-
collectIntervalMs: partial?.collectIntervalMs ?? defaults.collectIntervalMs,
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
function logSpoolConfigFromEnv(env = process.env) {
|
|
260
|
-
return resolveLogSpoolConfig({
|
|
261
|
-
writer: {
|
|
262
|
-
maxEntries: envInt("LOG_SPOOL_MAX_ENTRIES", DEFAULT_LOG_SPOOL_CONFIG.writer.maxEntries, { env, min: 1 }),
|
|
263
|
-
maxBytes: envInt("LOG_SPOOL_MAX_BYTES", DEFAULT_LOG_SPOOL_CONFIG.writer.maxBytes, { env, min: 1 }),
|
|
264
|
-
flushDebounceMs: envMs("LOG_SPOOL_FLUSH_DEBOUNCE_MS", DEFAULT_LOG_SPOOL_CONFIG.writer.flushDebounceMs, {
|
|
265
|
-
env,
|
|
266
|
-
}),
|
|
267
|
-
maxAgeMs: envMs("LOG_SPOOL_MAX_AGE_MS", DEFAULT_LOG_SPOOL_CONFIG.writer.maxAgeMs, { env }),
|
|
268
|
-
postTimeoutMs: envMs("LOG_PERSIST_POST_TIMEOUT_MS", DEFAULT_LOG_SPOOL_CONFIG.writer.postTimeoutMs, { env }),
|
|
269
|
-
},
|
|
270
|
-
gc: {
|
|
271
|
-
intervalMs: envMs("LOG_SPOOL_GC_INTERVAL_MS", DEFAULT_LOG_SPOOL_CONFIG.gc.intervalMs, { env }),
|
|
272
|
-
syncedRetentionMs: envMs("LOG_SPOOL_SYNCED_RETENTION_MS", DEFAULT_LOG_SPOOL_CONFIG.gc.syncedRetentionMs, {
|
|
273
|
-
env,
|
|
274
|
-
}),
|
|
275
|
-
tmpRetentionMs: envMs("LOG_SPOOL_TMP_RETENTION_MS", DEFAULT_LOG_SPOOL_CONFIG.gc.tmpRetentionMs, { env }),
|
|
276
|
-
},
|
|
277
|
-
collectIntervalMs: envMs("LOG_SPOOL_COLLECT_INTERVAL_MS", DEFAULT_LOG_SPOOL_CONFIG.collectIntervalMs, { env }),
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
function logSpoolServiceIdFromEnv(env = process.env) {
|
|
281
|
-
const raw = env[LOG_SPOOL_SERVICE_ID_ENV]?.trim();
|
|
282
|
-
return raw != null && raw !== "" ? raw : undefined;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
168
|
const LOG_SPOOL_DIR_NAME = "log-spool";
|
|
286
169
|
function resolveLogSpoolRoot(explicit) {
|
|
287
170
|
if (explicit != null && explicit.trim() !== "") {
|
|
@@ -769,5 +652,5 @@ function validateLogSpoolPreloadEnv(env = process.env) {
|
|
|
769
652
|
}
|
|
770
653
|
}
|
|
771
654
|
|
|
772
|
-
export {
|
|
773
|
-
//# sourceMappingURL=enable-
|
|
655
|
+
export { CLI_PROD_FLAG as C, SERVICE_ENV_PROFILE_ENV_KEY as S, logSpoolEnabledFromEnv as a, resolveLogSpoolSpawnEnvForLabel as b, resolveLogSpoolRoot as c, resolveAllLogSpoolProcessRoles as d, logSpoolProcessDir as e, buildLogListDraft as f, postLogBatch as g, ensureLogSpoolFromEnv as h, shutdownLogSpoolFromEnv as i, getLogSpoolStats as j, SERVICE_ENV_PROFILE_PROD as k, loadEnvFiles as l, mergeLogSpoolExtraProcessRolesEnv as m, buildLogSpoolSpawnEnv as n, envProfileFromProcess as o, pinEnvProfileFromArgv as p, resolveDefaultEnvFiles as q, resolveProjectRootByPackageName as r, spoolLogger as s, resolveProjectRootFromModule as t, validateLogSpoolPreloadEnv as v };
|
|
656
|
+
//# sourceMappingURL=enable-BTFwzWHc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable-BTFwzWHc.js","sources":["../../src/node/env/load-env.ts","../../src/node/env/project-root.ts","../../src/shared/log/upload/env.ts","../../src/shared/log/upload/logger.ts","../../src/shared/log/spool/paths.ts","../../src/shared/log/spool/process-roles.ts","../../src/shared/log/upload/flush.ts","../../src/shared/log/spool/writer.ts","../../src/shared/log/spool/enable.ts"],"sourcesContent":["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","import { envBool } from \"../../../node/env/env-parsers\";\n\n/** Master switch — env name kept for compatibility (`LOG_PERSIST_ENABLED`). */\nexport function logSpoolEnabledFromEnv(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\n/** `LOG_PERSIST_REGISTRY_DIR` or `RUNTIME_DATA_DIR`. */\nexport function runtimeDataDirFromEnv(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","import { createLogger } from \"../core/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\ntype PipelineLogData = Record<string, unknown>;\n\nfunction createPipelineLogger(module: string) {\n const logger = createLogger({ module });\n\n function write(level: \"debug\" | \"info\" | \"warn\" | \"error\", message: string, data?: PipelineLogData): void {\n logger[level](message, {\n topic: LOG_PERSIST_INTERNAL_TOPIC,\n ...(data != null ? { data } : {}),\n });\n }\n\n return {\n debug: (message: string, data?: PipelineLogData) => write(\"debug\", message, data),\n info: (message: string, data?: PipelineLogData) => write(\"info\", message, data),\n warn: (message: string, data?: PipelineLogData) => write(\"warn\", message, data),\n error: (message: string, data?: PipelineLogData) => write(\"error\", message, data),\n };\n}\n\n/** Supabase upload path (`postLogBatch`). */\nexport const persistLogger = createPipelineLogger(\"log-upload\");\n\n/** File spool writer + collector. */\nexport const spoolLogger = createPipelineLogger(\"log-spool\");\n\nexport function isLogPersistInternalTopic(topic: string | undefined): boolean {\n return topic === LOG_PERSIST_INTERNAL_TOPIC;\n}\n","import { join } from \"node:path\";\nimport { runtimeDataDirFromEnv } from \"../upload/env\";\nimport type { LogSpoolProcessRole } from \"./interface\";\n\nexport const LOG_SPOOL_DIR_NAME = \"log-spool\";\n\nexport function resolveLogSpoolRoot(explicit?: string): string {\n if (explicit != null && explicit.trim() !== \"\") {\n return explicit;\n }\n const configured = process.env.LOG_SPOOL_DIR?.trim();\n if (configured != null && configured !== \"\") {\n return configured;\n }\n const runtimeDir = runtimeDataDirFromEnv();\n if (runtimeDir == null) {\n throw new Error(\n \"[LogSpool] spool root required: set LOG_SPOOL_DIR or LOG_PERSIST_REGISTRY_DIR / RUNTIME_DATA_DIR\",\n );\n }\n return join(runtimeDir, LOG_SPOOL_DIR_NAME);\n}\n\nexport function logSpoolServiceDir(spoolRoot: string, serviceId: string): string {\n return join(spoolRoot, serviceId);\n}\n\nexport function logSpoolProcessDir(spoolRoot: string, serviceId: string, processRole: LogSpoolProcessRole): string {\n return join(spoolRoot, serviceId, processRole);\n}\n","/** Four-process L3 blueprint roles — always scanned by collect-log. */\nexport const LOG_SPOOL_CORE_PROCESS_ROLES = [\"main\", \"guard\", \"scheduler\", \"worker\"] as const;\n\nexport type LogSpoolCoreProcessRole = (typeof LOG_SPOOL_CORE_PROCESS_ROLES)[number];\n\n/** Spool directory / `LOG_PERSIST_PROCESS` name — core or service-specific extra. */\nexport type LogSpoolProcessRole = LogSpoolCoreProcessRole | string;\n\nexport const LOG_SPOOL_EXTRA_PROCESS_ROLES_ENV = \"LOG_SPOOL_EXTRA_PROCESS_ROLES\";\n\nconst EXTRA_ROLE_PATTERN = /^[a-z][a-z0-9-]*$/;\n\nfunction parseRoleList(raw: string | undefined): string[] {\n if (raw == null || raw.trim() === \"\") {\n return [];\n }\n return raw\n .split(\",\")\n .map((part) => part.trim())\n .filter((part) => part !== \"\");\n}\n\n/** Parse comma-separated extra roles from env (e.g. `chrome-sidecar`). */\nexport function logSpoolExtraProcessRolesFromEnv(env: NodeJS.ProcessEnv = process.env): string[] {\n return parseRoleList(env[LOG_SPOOL_EXTRA_PROCESS_ROLES_ENV]);\n}\n\n/** Core + extras, deduped, stable order (core first). */\nexport function resolveAllLogSpoolProcessRoles(env: NodeJS.ProcessEnv = process.env): LogSpoolProcessRole[] {\n const extras = logSpoolExtraProcessRolesFromEnv(env);\n const seen = new Set<string>(LOG_SPOOL_CORE_PROCESS_ROLES);\n const all: LogSpoolProcessRole[] = [...LOG_SPOOL_CORE_PROCESS_ROLES];\n for (const role of extras) {\n if (!seen.has(role)) {\n seen.add(role);\n all.push(role);\n }\n }\n return all;\n}\n\nexport function isLogSpoolCoreProcessRole(value: string): value is LogSpoolCoreProcessRole {\n return (LOG_SPOOL_CORE_PROCESS_ROLES as readonly string[]).includes(value);\n}\n\n/** Whether `value` is a known spool role (core or configured extra). */\nexport function isKnownLogSpoolProcessRole(value: string, env: NodeJS.ProcessEnv = process.env): boolean {\n if (isLogSpoolCoreProcessRole(value)) {\n return true;\n }\n return logSpoolExtraProcessRolesFromEnv(env).includes(value);\n}\n\n/** Validate extra role token — lowercase alphanumeric + hyphen, not a duplicate core name. */\nexport function assertValidLogSpoolExtraProcessRole(role: string): void {\n if (role === \"\" || !EXTRA_ROLE_PATTERN.test(role)) {\n throw new Error(\n `[LogSpool] invalid extra process role \"${role}\" — use lowercase letters, digits, hyphen (e.g. chrome-sidecar)`,\n );\n }\n if (isLogSpoolCoreProcessRole(role)) {\n throw new Error(`[LogSpool] extra process role \"${role}\" duplicates a core role`);\n }\n}\n\nexport function mergeLogSpoolExtraProcessRolesEnv(env: NodeJS.ProcessEnv, extraRoles: readonly string[]): void {\n if (extraRoles.length === 0) {\n return;\n }\n for (const role of extraRoles) {\n assertValidLogSpoolExtraProcessRole(role);\n }\n const merged = new Set([...logSpoolExtraProcessRolesFromEnv(env), ...extraRoles]);\n env[LOG_SPOOL_EXTRA_PROCESS_ROLES_ENV] = [...merged].join(\",\");\n}\n","import { postListCreate } from \"../../../list/list.api\";\nimport { CategoryList } from \"../../../list/list.interface\";\nimport type { LogEntry } from \"../core/log-manager\";\nimport type { BuildLogListDraftInput, LogListDraft } from \"./interface\";\nimport { LOG_BATCH_LIST_VALUE } from \"./interface\";\nimport { persistLogger } from \"./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, entries } = input;\n const first = entries[0];\n const last = entries[entries.length - 1];\n\n return {\n name: service,\n value: LOG_BATCH_LIST_VALUE,\n category: CategoryList.LIST,\n tagList: [\"log\", lane, service],\n details: {\n manifestVersion: 0,\n loaderKey: LOG_BATCH_LIST_VALUE,\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 },\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 const result = await withTimeout(\n postListCreate({\n name: draft.name,\n value: draft.value,\n category: draft.category,\n details: draft.details,\n }),\n postTimeoutMs,\n \"postListCreate\",\n );\n\n if (!result.success) {\n const message = result.error?.message ?? \"postListCreate failed\";\n persistLogger.error(\"post log batch failed\", {\n name: draft.name,\n error: message,\n });\n throw new Error(message);\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, rename, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport type { LogEntry } from \"../core/log-manager\";\nimport { estimateEntriesBytes, takeEntriesWithinBytes } from \"../upload/flush\";\nimport { registerLogPersistOffer } from \"../upload/hook\";\nimport { isLogPersistInternalTopic, spoolLogger } from \"../upload/logger\";\nimport { DEFAULT_LOG_SPOOL_CONFIG, resolveLogSpoolConfig } from \"./config\";\nimport { buildLogSpoolBatchBaseName, randomLogSpoolShortId } from \"./file\";\nimport type { EnableLogSpoolOptions, LogSpoolBatchFile, LogSpoolProcessRole, LogSpoolWriterStats } from \"./interface\";\nimport { logSpoolProcessDir, resolveLogSpoolRoot } from \"./paths\";\n\nclass LogSpoolWriter {\n private static instance: LogSpoolWriter | null = null;\n\n private enabled = false;\n private buffer: LogEntry[] = [];\n private flushInProgress = false;\n private debounceTimer: ReturnType<typeof setTimeout> | null = null;\n private ageTimer: ReturnType<typeof setTimeout> | null = null;\n private serviceId: string | null = null;\n private processRole: LogSpoolProcessRole | null = null;\n private serviceValue: string | null = null;\n private spoolRoot: string | null = null;\n private config = DEFAULT_LOG_SPOOL_CONFIG.writer;\n\n static getInstance(): LogSpoolWriter {\n LogSpoolWriter.instance ??= new LogSpoolWriter();\n return LogSpoolWriter.instance;\n }\n\n async enable(options: EnableLogSpoolOptions): Promise<void> {\n if (this.enabled) {\n spoolLogger.warn(\"log spool writer already enabled\", {\n serviceId: this.serviceId,\n processRole: this.processRole,\n });\n return;\n }\n\n this.serviceId = options.serviceId;\n this.processRole = options.processRole;\n this.serviceValue = options.serviceValue;\n this.spoolRoot = options.spoolRoot ?? resolveLogSpoolRoot();\n this.config = resolveLogSpoolConfig(options.config).writer;\n this.enabled = true;\n\n registerLogPersistOffer((entry) => this.offer(entry));\n\n spoolLogger.info(\"log spool writer enabled\", {\n serviceId: options.serviceId,\n processRole: options.processRole,\n serviceValue: options.serviceValue,\n spoolRoot: this.spoolRoot,\n config: this.config,\n });\n }\n\n async shutdown(): Promise<void> {\n this.cancelDebounce();\n this.cancelAgeFlush();\n registerLogPersistOffer(null);\n this.enabled = false;\n\n while (this.buffer.length > 0) {\n await this.flushChunk({ reason: \"shutdown\" });\n }\n\n spoolLogger.info(\"log spool writer shutdown complete\", {\n serviceId: this.serviceId,\n processRole: this.processRole,\n });\n }\n\n getStats(): LogSpoolWriterStats {\n return {\n enabled: this.enabled,\n bufferedEntries: this.buffer.length,\n bufferedBytes: estimateEntriesBytes(this.buffer),\n flushInProgress: this.flushInProgress,\n debouncePending: this.debounceTimer != null,\n ageFlushPending: this.ageTimer != null,\n serviceId: this.serviceId,\n processRole: this.processRole,\n };\n }\n\n offer(entry: LogEntry): void {\n if (isLogPersistInternalTopic(entry.topic)) {\n return;\n }\n\n if (!this.enabled) {\n return;\n }\n\n if (this.buffer.length === 0) {\n this.scheduleAgeFlush();\n }\n\n this.buffer.push(entry);\n\n if (this.shouldScheduleDebouncedFlush()) {\n this.scheduleDebouncedFlush();\n }\n }\n\n private shouldScheduleDebouncedFlush(): boolean {\n return (\n this.buffer.length >= this.config.maxEntries || estimateEntriesBytes(this.buffer) >= this.config.maxBytes\n );\n }\n\n private scheduleDebouncedFlush(): void {\n if (this.debounceTimer != null) {\n return;\n }\n\n spoolLogger.debug(\"log spool flush debounce scheduled\", {\n debounceMs: this.config.flushDebounceMs,\n bufferedEntries: this.buffer.length,\n });\n\n this.debounceTimer = setTimeout(() => {\n this.debounceTimer = null;\n void this.flushChunk({ reason: \"debounce\" });\n }, this.config.flushDebounceMs);\n this.debounceTimer.unref?.();\n }\n\n private scheduleAgeFlush(): void {\n if (this.ageTimer != null) {\n return;\n }\n\n spoolLogger.debug(\"log spool age flush scheduled\", {\n maxAgeMs: this.config.maxAgeMs,\n });\n\n this.ageTimer = setTimeout(() => {\n this.ageTimer = null;\n void this.flushChunk({ reason: \"maxAge\" });\n }, this.config.maxAgeMs);\n this.ageTimer.unref?.();\n }\n\n private cancelDebounce(): void {\n if (this.debounceTimer != null) {\n clearTimeout(this.debounceTimer);\n this.debounceTimer = null;\n }\n }\n\n private cancelAgeFlush(): void {\n if (this.ageTimer != null) {\n clearTimeout(this.ageTimer);\n this.ageTimer = null;\n }\n }\n\n private async flushChunk(input: { reason: string }): Promise<void> {\n if (this.flushInProgress || this.buffer.length === 0) {\n return;\n }\n if (this.serviceId == null || this.processRole == null || this.serviceValue == null || this.spoolRoot == null) {\n return;\n }\n\n this.cancelDebounce();\n this.cancelAgeFlush();\n this.flushInProgress = true;\n try {\n const byCount = this.buffer.slice(0, this.config.maxEntries);\n const entries = takeEntriesWithinBytes(byCount, this.config.maxBytes);\n this.buffer = this.buffer.slice(entries.length);\n\n if (entries.length === 0) {\n if (this.buffer.length > 0) {\n this.scheduleAgeFlush();\n } else {\n this.cancelAgeFlush();\n }\n return;\n }\n\n const batchFile = await this.writeBatchTmp({\n entries,\n serviceId: this.serviceId,\n processRole: this.processRole,\n serviceValue: this.serviceValue,\n spoolRoot: this.spoolRoot,\n });\n\n spoolLogger.info(\"log spool flushed to tmp\", {\n reason: input.reason,\n fileName: batchFile.fileName,\n entryCount: entries.length,\n remainingBuffered: this.buffer.length,\n });\n\n if (this.buffer.length > 0) {\n this.scheduleAgeFlush();\n if (this.shouldScheduleDebouncedFlush()) {\n this.scheduleDebouncedFlush();\n }\n } else {\n this.cancelAgeFlush();\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n spoolLogger.error(\"log spool flush failed\", { reason: input.reason, error: message });\n if (this.buffer.length > 0) {\n this.scheduleAgeFlush();\n }\n } finally {\n this.flushInProgress = false;\n }\n }\n\n private async writeBatchTmp(input: {\n entries: LogEntry[];\n serviceId: string;\n processRole: LogSpoolProcessRole;\n serviceValue: string;\n spoolRoot: string;\n }): Promise<{ fileName: string; tmpPath: string }> {\n const first = input.entries[0];\n const shortHash = randomLogSpoolShortId();\n const baseName = buildLogSpoolBatchBaseName({\n processRole: input.processRole,\n firstEntryTimestamp: first.timestamp,\n shortHash,\n });\n const fileName = `${baseName}.tmp`;\n const processDir = logSpoolProcessDir(input.spoolRoot, input.serviceId, input.processRole);\n await mkdir(processDir, { recursive: true });\n\n const tmpPath = join(processDir, fileName);\n const partPath = `${tmpPath}.part`;\n const payload: LogSpoolBatchFile = {\n entries: input.entries,\n meta: {\n serviceId: input.serviceId,\n processRole: input.processRole,\n serviceValue: input.serviceValue,\n },\n };\n const content = `${JSON.stringify(payload)}\\n`;\n\n await writeFile(partPath, content, \"utf8\");\n await rename(partPath, tmpPath);\n\n return { fileName, tmpPath };\n }\n}\n\nexport { LogSpoolWriter };\n\nexport async function enableLogSpoolWriter(options: EnableLogSpoolOptions): Promise<void> {\n await LogSpoolWriter.getInstance().enable(options);\n}\n\nexport async function shutdownLogSpoolWriter(): Promise<void> {\n await LogSpoolWriter.getInstance().shutdown();\n}\n\nexport function getLogSpoolWriterStats(): LogSpoolWriterStats {\n return LogSpoolWriter.getInstance().getStats();\n}\n","import { createLogger } from \"../core/create-logger\";\nimport { logPersistProcessFromEnv, logPersistServiceFromEnv, logSpoolEnabledFromEnv } from \"../upload/env\";\nimport { registerLogPersistOffer } from \"../upload/hook\";\nimport { LOG_PERSIST_TOPIC } from \"../upload/logger\";\nimport { LOG_SPOOL_SERVICE_ID_ENV, logSpoolConfigFromEnv, logSpoolServiceIdFromEnv } from \"./config\";\nimport type { EnsureLogSpoolFromEnvOptions, LogSpoolProcessRole } from \"./interface\";\nimport { resolveLogSpoolRoot } from \"./paths\";\nimport {\n assertValidLogSpoolExtraProcessRole,\n isKnownLogSpoolProcessRole,\n LOG_SPOOL_EXTRA_PROCESS_ROLES_ENV,\n} from \"./process-roles\";\nimport { enableLogSpoolWriter, getLogSpoolWriterStats, shutdownLogSpoolWriter } from \"./writer\";\n\nexport { logSpoolEnabledFromEnv };\n\nexport function resolveLogSpoolProcessRole(explicit?: string): LogSpoolProcessRole {\n const raw = explicit ?? logPersistProcessFromEnv();\n if (raw == null || raw === \"\") {\n throw new Error(\"[LogSpool] LOG_PERSIST_PROCESS is required when LOG_PERSIST_ENABLED=true\");\n }\n if (!isKnownLogSpoolProcessRole(raw)) {\n throw new Error(\n `[LogSpool] invalid LOG_PERSIST_PROCESS: ${raw} (not a core role and not listed in ${LOG_SPOOL_EXTRA_PROCESS_ROLES_ENV})`,\n );\n }\n return raw;\n}\n\n/**\n * Env vars for child spawn after main claims registry slot.\n * Optional when using {@link ManagedChildProcesses.spawn} — auto-injected from parent env.\n */\nexport function buildLogSpoolSpawnEnv(input: {\n serviceId: string;\n processRole: LogSpoolProcessRole;\n}): Record<string, string> {\n return {\n [LOG_SPOOL_SERVICE_ID_ENV]: input.serviceId,\n LOG_PERSIST_PROCESS: input.processRole,\n };\n}\n\n/**\n * When persistence is enabled and parent has `LOG_SPOOL_SERVICE_ID`, map spawn `label`\n * to spool env when `label` is a known core or extra process role.\n */\nexport function resolveLogSpoolSpawnEnvForLabel(\n label: string,\n env: NodeJS.ProcessEnv = process.env,\n): Record<string, string> {\n if (!logSpoolEnabledFromEnv(env)) {\n return {};\n }\n const serviceId = env[LOG_SPOOL_SERVICE_ID_ENV]?.trim();\n if (serviceId == null || serviceId === \"\") {\n return {};\n }\n if (!isKnownLogSpoolProcessRole(label, env)) {\n return {};\n }\n return buildLogSpoolSpawnEnv({ serviceId, processRole: label });\n}\n\nexport async function ensureLogSpoolFromEnv(options: EnsureLogSpoolFromEnvOptions = {}): Promise<boolean> {\n if (!logSpoolEnabledFromEnv()) {\n registerLogPersistOffer(null);\n return false;\n }\n\n const serviceId = options.serviceId ?? logSpoolServiceIdFromEnv();\n const serviceValue = options.serviceValue ?? logPersistServiceFromEnv();\n const processRole = resolveLogSpoolProcessRole(options.processRole);\n\n if (serviceId == null || serviceId === \"\") {\n throw new Error(\n \"[LogSpool] LOG_SPOOL_SERVICE_ID is required when LOG_PERSIST_ENABLED=true (set after registry claim or pass serviceId)\",\n );\n }\n if (serviceValue == null || serviceValue === \"\") {\n throw new Error(\"[LogSpool] LOG_PERSIST_SERVICE is required when LOG_PERSIST_ENABLED=true\");\n }\n\n const spoolRoot = options.spoolRoot ?? resolveLogSpoolRoot();\n\n await enableLogSpoolWriter({\n serviceId,\n processRole,\n serviceValue,\n spoolRoot,\n config: options.config ?? logSpoolConfigFromEnv(),\n });\n\n const lifecycleLogger = createLogger({ module: \"log-spool\" });\n lifecycleLogger.info(\"log spool enabled from env\", {\n topic: LOG_PERSIST_TOPIC,\n data: { serviceId, processRole, serviceValue, spoolRoot },\n });\n\n return true;\n}\n\nexport async function shutdownLogSpoolFromEnv(): Promise<void> {\n await shutdownLogSpoolWriter();\n}\n\nexport function getLogSpoolStats(): ReturnType<typeof getLogSpoolWriterStats> {\n return getLogSpoolWriterStats();\n}\n\nexport function validateLogSpoolPreloadEnv(env: NodeJS.ProcessEnv = process.env): void {\n if (!logSpoolEnabledFromEnv(env)) {\n return;\n }\n\n const missing: string[] = [];\n if (env.LOG_PERSIST_SERVICE?.trim() == null || env.LOG_PERSIST_SERVICE.trim() === \"\") {\n missing.push(\"LOG_PERSIST_SERVICE\");\n }\n const runtimeDir = env.LOG_PERSIST_REGISTRY_DIR?.trim() || env.RUNTIME_DATA_DIR?.trim();\n if (runtimeDir == null || runtimeDir === \"\") {\n missing.push(\"LOG_PERSIST_REGISTRY_DIR or RUNTIME_DATA_DIR\");\n }\n\n if (missing.length > 0) {\n throw new Error(`[LogSpool] preload env incomplete: ${missing.join(\", \")}`);\n }\n\n for (const role of env[LOG_SPOOL_EXTRA_PROCESS_ROLES_ENV]?.split(\",\") ?? []) {\n const trimmed = role.trim();\n if (trimmed === \"\") {\n continue;\n }\n assertValidLogSpoolExtraProcessRole(trimmed);\n }\n}\n"],"names":[],"mappings":";;;;;;AAGA,MAAM,iBAAiB,GAAG,CAAC,YAAY,EAAE,MAAM,CAAU;AACzD,MAAM,cAAc,GAAG,CAAC,WAAW,CAAU;AAEtC,MAAM,2BAA2B,GAAG;AACpC,MAAM,wBAAwB,GAAG;AACjC,MAAM,aAAa,GAAG;AAO7B;AACM,SAAU,qBAAqB,CAAC,OAAsC,EAAA;IACxE,MAAM,GAAG,GAAG,OAAO,EAAE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AI,GAAG,CAAC,gBAAgB,EAAE,IAAI,EAAE;IACvF,IAAI,UAAU,IAAI,IAAI,IAAI,UAAU,KAAK,EAAE,EAAE;AACzC,QAAA,OAAO,CAAC,IAAI,CAAC,8CAA8C,CAAC;IAChE;AAEA,IAAA,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;AACpB,QAAA,MAAM,IAAI,KAAK,CAAC,CAAA,mCAAA,EAAsC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA,CAAE,CAAC;IAC/E;AAEA,IAAA,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,iCAAiC,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE;AACzE,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE;AAC3B,QAAA,IAAI,OAAO,KAAK,EAAE,EAAE;YAChB;QACJ;QACA,mCAAmC,CAAC,OAAO,CAAC;IAChD;AACJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { W as validateWithSchema, m as getTarget, l as getPossibleTarget, L as LOG_BATCH_LIST_VALUE, k as generateResponse, T as updateTargetDetails, f as createLogger, g as createTarget, q as isCreateTargetAlreadyExistsError, J as scanTargetList, B as BaseValidator, a as CategoryList, a1 as LOG_SPOOL_SERVICE_ID_ENV, h as deleteTarget, s as isOptimisticLockError, n as getTargetList, e as OPTIMISTIC_LOCK_FAILED_MESSAGE, O as OPTIMISTIC_LOCK_ERROR_CODE, K as supabase, w as logManager } from './config-aBbuDpyt.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import 'node:crypto';
|
|
4
4
|
|
|
@@ -472,13 +472,25 @@ var NodeStatus;
|
|
|
472
472
|
var CategoryNode;
|
|
473
473
|
(function (CategoryNode) {
|
|
474
474
|
CategoryNode["NODE"] = "node";
|
|
475
|
+
/** Cold storage — excluded from scheduling and active node scans. */
|
|
476
|
+
CategoryNode["NODE_ARCHIVED"] = "node.archived";
|
|
475
477
|
})(CategoryNode || (CategoryNode = {}));
|
|
478
|
+
/** Node role — stored in {@link Node.value}. */
|
|
479
|
+
var NodeKind;
|
|
480
|
+
(function (NodeKind) {
|
|
481
|
+
NodeKind["TASK"] = "node.task";
|
|
482
|
+
NodeKind["TRIGGER"] = "node.trigger";
|
|
483
|
+
NodeKind["GUARD"] = "node.guard";
|
|
484
|
+
NodeKind["OTHER"] = "node.other";
|
|
485
|
+
})(NodeKind || (NodeKind = {}));
|
|
476
486
|
|
|
477
487
|
const NODE_STATUS_FIELD = "details->>status";
|
|
478
488
|
const nodeIdSchema$1 = z.string().trim().min(1);
|
|
479
489
|
const traceIdSchema$2 = z.string().trim().min(1).optional();
|
|
480
490
|
// ─── Zod schemas ─────────────────────────────────────────────────────────────
|
|
481
491
|
const postRegisterNodeSchema = z.object({
|
|
492
|
+
serviceId: nodeIdSchema$1,
|
|
493
|
+
kind: z.nativeEnum(NodeKind),
|
|
482
494
|
traceId: traceIdSchema$2,
|
|
483
495
|
});
|
|
484
496
|
const patchNodeHeartBeatSchema = z.object({
|
|
@@ -501,9 +513,9 @@ function lockOnNodeStatus(status) {
|
|
|
501
513
|
return [{ field: NODE_STATUS_FIELD, operator: "eq", value: status }];
|
|
502
514
|
}
|
|
503
515
|
// ─── postRegisterNode ────────────────────────────────────────────────────────
|
|
504
|
-
const postRegisterNode = validateWithSchema(postRegisterNodeSchema, "postRegisterNodeSchema")(async (payload) => {
|
|
516
|
+
const postRegisterNode = validateWithSchema(postRegisterNodeSchema, "postRegisterNodeSchema")(async ({ serviceId, kind, ...payload }) => {
|
|
505
517
|
return createTarget({
|
|
506
|
-
payload,
|
|
518
|
+
payload: { serviceId, kind, ...payload },
|
|
507
519
|
createFn: () => {
|
|
508
520
|
const details = {
|
|
509
521
|
manifestVersion: 0,
|
|
@@ -511,9 +523,9 @@ const postRegisterNode = validateWithSchema(postRegisterNodeSchema, "postRegiste
|
|
|
511
523
|
lastHeartBeat: Date.now(),
|
|
512
524
|
};
|
|
513
525
|
return {
|
|
514
|
-
name:
|
|
526
|
+
name: serviceId,
|
|
515
527
|
category: CategoryNode.NODE,
|
|
516
|
-
value:
|
|
528
|
+
value: kind,
|
|
517
529
|
tagList: [],
|
|
518
530
|
details,
|
|
519
531
|
};
|
|
@@ -572,6 +584,10 @@ const patchChangeNodeStatus = validateWithSchema(patchChangeNodeStatusSchema, "p
|
|
|
572
584
|
function isBusyWithHeartbeat(node) {
|
|
573
585
|
return node.details.status === NodeStatus.BUSY && typeof node.details.lastHeartBeat === "number";
|
|
574
586
|
}
|
|
587
|
+
/** Subset used for worker liveness (Guard / observability) — {@link NodeKind.TASK} only. */
|
|
588
|
+
function nodesForTaskLiveness(nodes) {
|
|
589
|
+
return nodes.filter((node) => node.value === NodeKind.TASK);
|
|
590
|
+
}
|
|
575
591
|
/** Evaluate TaskNode liveness from a scanned node list (no I/O). */
|
|
576
592
|
function evaluateBusyNodeLiveness(nodes, options) {
|
|
577
593
|
const now = options.now ?? Date.now();
|
|
@@ -605,6 +621,15 @@ function evaluateBusyNodeLiveness(nodes, options) {
|
|
|
605
621
|
};
|
|
606
622
|
}
|
|
607
623
|
|
|
624
|
+
/** Service instance id required for {@link postRegisterNode} (same env as log spool after registry claim). */
|
|
625
|
+
function requireNodeServiceIdFromEnv(env = process.env) {
|
|
626
|
+
const serviceId = env[LOG_SPOOL_SERVICE_ID_ENV]?.trim();
|
|
627
|
+
if (serviceId == null || serviceId === "") {
|
|
628
|
+
throw new Error(`[Node] ${LOG_SPOOL_SERVICE_ID_ENV} must be set before registering a node (claim the registry slot on the service host first)`);
|
|
629
|
+
}
|
|
630
|
+
return serviceId;
|
|
631
|
+
}
|
|
632
|
+
|
|
608
633
|
function resolveFetchUrl(input) {
|
|
609
634
|
if (typeof input === "string") {
|
|
610
635
|
return input;
|
|
@@ -1451,6 +1476,8 @@ const resetSystemRegistryConfig = validateWithSchema(resetSystemRegistryConfigSc
|
|
|
1451
1476
|
var CategoryService;
|
|
1452
1477
|
(function (CategoryService) {
|
|
1453
1478
|
CategoryService["SERVICE"] = "service";
|
|
1479
|
+
/** Cold storage — excluded from registry resolution and active service scans. */
|
|
1480
|
+
CategoryService["SERVICE_ARCHIVED"] = "service.archived";
|
|
1454
1481
|
})(CategoryService || (CategoryService = {}));
|
|
1455
1482
|
var CategoryApi;
|
|
1456
1483
|
(function (CategoryApi) {
|
|
@@ -3352,6 +3379,8 @@ const CRITICAL_UNKNOWN_TASK_TRACE_ID = "CRITICAL_UNKNOWN_TASK_TRACE_ID";
|
|
|
3352
3379
|
var CategoryTask;
|
|
3353
3380
|
(function (CategoryTask) {
|
|
3354
3381
|
CategoryTask["TASK"] = "task";
|
|
3382
|
+
/** Cold storage — excluded from worker claim and `category=task` scans. See task-archive skill. */
|
|
3383
|
+
CategoryTask["TASK_ARCHIVED"] = "task.archived";
|
|
3355
3384
|
})(CategoryTask || (CategoryTask = {}));
|
|
3356
3385
|
var TaskStatus;
|
|
3357
3386
|
(function (TaskStatus) {
|
|
@@ -3874,5 +3903,5 @@ function summarizeTaskQueue(tasks, taskType, statuses) {
|
|
|
3874
3903
|
return tasks.filter((task) => task.value === taskType && statuses.includes(task.details.status)).length;
|
|
3875
3904
|
}
|
|
3876
3905
|
|
|
3877
|
-
export {
|
|
3878
|
-
//# sourceMappingURL=task-queue-
|
|
3906
|
+
export { createClaimedRegistrySlotRuntimeState as $, ApiMethod as A, buildFeedLinkDraft as B, CategoryConfig as C, DEFAULT_SYSTEM_REGISTRY_SEED_SLOTS as D, EMPTY_REGISTRY_SLOT_RUNTIME_STATE as E, FEED_VALUES as F, buildFeedLinkName as G, buildIdeaImageLinkDraft as H, IDEA_IMAGE_LINK_NAME as I, buildIdeaLinkDraft as J, buildLinkTargetDraft as K, LINK_MANIFEST_VERSION as L, MEDIA_CONTENT_HASH_ALGORITHM as M, NodeKind as N, buildListTargetDraft as O, POST_TASK_DEFAULT_MAX_ATTEMPTS as P, buildMediaLinkDraft as Q, ResultCode as R, ServiceLifecycleStatus as S, TARGET_SYSTEM_REGISTRY_KEY as T, buildMediaNameFromLocator as U, buildReviewLinkDraft as V, buildSystemRegistryConfigDetails as W, claimServiceRegistrySlot as X, classifyNetworkError as Y, countTasksByType as Z, createActiveServiceLifecycle as _, CategoryExtraction as a, patchNodeHeartBeat as a$, createStorageProviderRegistry as a0, createUploadTracker as a1, decodeLogBatch as a2, decodeLogBatchList as a3, defaultL3ServiceDetails as a4, deleteParcel as a5, deleteParcelSchema as a6, escapeIlikePattern as a7, evaluateBusyNodeLiveness as a8, feedLinkDedupFilters as a9, isHttpUrl as aA, isIdeaImageLinkName as aB, isLocalFilesystemPath as aC, isLogBatchList as aD, isLogEntry as aE, isMediaValue as aF, isOpaqueChunkUrl as aG, isRetryableHttpStatus as aH, linkDedupFilters as aI, linkTargetDraftBuildInputSchema as aJ, mediaLinkDedupFilters as aK, nodesForTaskLiveness as aL, normalizeStringList as aM, parcelDetailsSchema as aN, parseIdeaOriginal as aO, parseLogBatchMeta as aP, parseProviderPrefixedUrl as aQ, parseServiceSlot as aR, parseServiceSlots as aS, patchChangeNodeStatus as aT, patchChangeNodeStatusSchema as aU, patchChangeTaskStatus as aV, patchChangeTaskStatusSchema as aW, patchClaimTask as aX, patchClaimTaskSchema as aY, patchExtractionObjects as aZ, patchExtractionObjectsSchema as a_, fetchBinaryWithRetry as aa, fetchWithRetry as ab, fieldDefinitionSchema as ac, flattenLogBatch as ad, flattenLogBatches as ae, formatNetworkError as af, getApi as ag, getApiSchema as ah, getConfig as ai, getConfigSchema as aj, getExtraction as ak, getExtractionSchema as al, getParcel as am, getParcelSchema as an, getScanRemoteRepoValues as ao, getScanRemoteRepoValuesSchema as ap, getService as aq, getServiceSchema as ar, getTargetSystemRegistry as as, getValueAtPath as at, guessMediaMime as au, ideaCreateSchema as av, ideaLinkValueFilters as aw, ideaUpdateSchema as ax, installChunkFetchRegistry as ay, isFeedValue as az, CategoryLink as b, createTaskRow as b$, patchNodeHeartBeatSchema as b0, patchServiceRuntime as b1, patchStopNode as b2, patchStopNodeSchema as b3, patchTaskProgress as b4, patchTaskProgressSchema as b5, postApi as b6, postApiSchema as b7, postExtraction as b8, postExtractionSchema as b9, restoreParcel as bA, restoreParcelById as bB, reviewLinksForNameFilters as bC, runRegistrySlotGuardCheck as bD, sanitizeFileName as bE, sanitizeParcelFileName as bF, scanExtractionList as bG, scanExtractionListSchema as bH, schemaDefinitionSchema as bI, serviceDetailsSchema as bJ, serviceLifecycleSchema as bK, serviceNodeSnapshotSchema as bL, serviceRuntimeSchema as bM, sha256Hex as bN, summarizeTaskQueue as bO, systemRegistrySeedSlotSchema as bP, toPostgrestTextArrayLiteral as bQ, unregisterService as bR, unregisterServiceAtShutdown as bS, getErrorMessage as bT, LOG_TOPIC_NODE as bU, isFeedIngestSource as bV, resolveFeedOriginalStorageProvider as bW, buildFeedTagList as bX, LOG_TOPIC_TASK as bY, CRITICAL_UNKNOWN_TASK_TRACE_ID as bZ, toError as b_, postLinkCreate as ba, postParcel as bb, postParcelSchema as bc, postRegisterNode as bd, postRegisterNodeSchema as be, postService as bf, postServiceInstance as bg, postServiceSchema as bh, postSystemRegistryConfig as bi, postSystemRegistryConfigSchema as bj, postTask as bk, postTaskSchema as bl, postTaskWithRetry as bm, publishParcel as bn, registerProviderChunkResolver as bo, registerService as bp, registerServiceAtStartup as bq, registrySlotRuntimePatchFromGuardResult as br, releaseSystemRegistrySlots as bs, releaseSystemRegistrySlotsByServiceId as bt, requestHasBody as bu, requireNodeServiceIdFromEnv as bv, resetSystemRegistryConfig as bw, resetSystemRegistryConfigSchema as bx, resolveActiveRegistryServiceId as by, resolveFetchUrl as bz, CategoryNode as c, FEED_INGEST_SOURCES as c0, CategoryParcel as d, CategoryRepo as e, CategoryService as f, CategoryTask as g, IDEA_IMAGE_TAG_RAW as h, IDEA_IMAGE_TEMP_DIR as i, IDEA_LINK_VALUE as j, LIST_MANIFEST_VERSION as k, MEDIA_CONTENT_HASH_PREFIX_LENGTH as l, MEDIA_VALUES as m, NodeStatus as n, ParcelManager as o, PostLinkValidator as p, ServiceRegistryError as q, ServiceSlotStatus as r, TASK_REPO_USAGE as s, TaskStatus as t, TaskStatusAction as u, apiDetailsSchema as v, appendSystemRegistryEmptySlots as w, assertRegistrySlotAvailable as x, assertRegistrySlotOwner as y, buildEmptyServiceSlots as z };
|
|
3907
|
+
//# sourceMappingURL=task-queue-D8CraGI8.js.map
|