target-supabase-sdk 0.2.4 → 0.2.5

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.
Files changed (31) hide show
  1. package/dist/browser.d.ts +2 -2
  2. package/dist/browser.d.ts.map +1 -1
  3. package/dist/browser.js +1 -1
  4. package/dist/chunks/{enable-log-persist-B8rg_wXG.js → enable-log-persist-BL2FaGQp.js} +6 -3
  5. package/dist/chunks/enable-log-persist-BL2FaGQp.js.map +1 -0
  6. package/dist/chunks/{word.interface-B_fbVFOW.js → word.interface-Mw7bTSqs.js} +115 -2
  7. package/dist/chunks/word.interface-Mw7bTSqs.js.map +1 -0
  8. package/dist/node/fs/json-state-store.d.ts.map +1 -1
  9. package/dist/node/fs/runtime-state-path.d.ts +17 -0
  10. package/dist/node/fs/runtime-state-path.d.ts.map +1 -0
  11. package/dist/node/fs/sharded-json-state-store.d.ts +19 -0
  12. package/dist/node/fs/sharded-json-state-store.d.ts.map +1 -0
  13. package/dist/node/runtime-state/create-service-runtime-state-store.d.ts +6 -2
  14. package/dist/node/runtime-state/create-service-runtime-state-store.d.ts.map +1 -1
  15. package/dist/node.js +164 -21
  16. package/dist/node.js.map +1 -1
  17. package/dist/preload.js +1 -1
  18. package/dist/service/index.d.ts +2 -2
  19. package/dist/service/index.d.ts.map +1 -1
  20. package/dist/service/registry.service.d.ts +23 -0
  21. package/dist/service/registry.service.d.ts.map +1 -1
  22. package/package.json +1 -1
  23. package/src/browser.ts +4 -0
  24. package/src/node/fs/json-state-store.ts +5 -2
  25. package/src/node/fs/runtime-state-path.ts +35 -0
  26. package/src/node/fs/sharded-json-state-store.ts +157 -0
  27. package/src/node/runtime-state/create-service-runtime-state-store.ts +17 -17
  28. package/src/service/index.ts +4 -0
  29. package/src/service/registry.service.ts +162 -0
  30. package/dist/chunks/enable-log-persist-B8rg_wXG.js.map +0 -1
  31. package/dist/chunks/word.interface-B_fbVFOW.js.map +0 -1
package/dist/browser.d.ts CHANGED
@@ -38,8 +38,8 @@ export type { ProviderProbeMap, StorageProviderRegistry } from "./parcel/storage
38
38
  export { createStorageProviderRegistry } from "./parcel/storage-provider-registry";
39
39
  export * from "./repo/repo.api";
40
40
  export * from "./repo/repo.interface";
41
- export type { Api, ApiDetails, ClaimRegistrySlotInput, Config, ConfigDetails, GetApiPayload, GetConfigPayload, GetServicePayload, PatchServiceRuntimeInput, PostApiPayload, PostServiceInstanceOptions, PostServicePayload, PostSystemRegistryConfigPayload, RegisterServiceInput, RegistrySlotGuardResult, RegistrySlotRuntimeState, ResetSystemRegistryConfigPayload, Service, ServiceBootstrapResult, ServiceDetails, ServiceNodeSnapshot, ServiceRegistrySession, ServiceRuntime, ServiceSlot, SystemRegistrySeedSlot, TargetSystemRegistrySlotView, TargetSystemRegistryView, } from "./service/index";
42
- export { ApiMethod, apiDetailsSchema, assertRegistrySlotAvailable, assertRegistrySlotOwner, buildEmptyServiceSlots, buildSystemRegistryConfigDetails, CategoryConfig, CategoryService, claimServiceRegistrySlot, createActiveServiceLifecycle, createClaimedRegistrySlotRuntimeState, DEFAULT_SYSTEM_REGISTRY_SEED_SLOTS, defaultL3ServiceDetails, EMPTY_REGISTRY_SLOT_RUNTIME_STATE, fieldDefinitionSchema, getApi, getApiSchema, getConfig, getConfigSchema, getService, getServiceSchema, getTargetSystemRegistry, parseServiceSlot, parseServiceSlots, patchServiceRuntime, postApi, postApiSchema, postService, postServiceInstance, postServiceSchema, postSystemRegistryConfig, postSystemRegistryConfigSchema, registerService, registerServiceAtStartup, registrySlotRuntimePatchFromGuardResult, resetSystemRegistryConfig, resetSystemRegistryConfigSchema, resolveActiveRegistryServiceId, runRegistrySlotGuardCheck, ServiceLifecycleStatus, ServiceRegistryError, ServiceSlotStatus, schemaDefinitionSchema, serviceDetailsSchema, serviceLifecycleSchema, serviceNodeSnapshotSchema, serviceRuntimeSchema, systemRegistrySeedSlotSchema, TARGET_SYSTEM_REGISTRY_KEY, unregisterService, unregisterServiceAtShutdown, } from "./service/index";
41
+ export type { Api, ApiDetails, ClaimRegistrySlotInput, Config, ConfigDetails, GetApiPayload, GetConfigPayload, GetServicePayload, PatchServiceRuntimeInput, PostApiPayload, PostServiceInstanceOptions, PostServicePayload, PostSystemRegistryConfigPayload, RegisterServiceInput, RegistrySlotGuardResult, RegistrySlotRuntimeState, ReleasedRegistrySlot, ReleaseSystemRegistrySlotsInput, ReleaseSystemRegistrySlotsOutcome, ResetSystemRegistryConfigPayload, Service, ServiceBootstrapResult, ServiceDetails, ServiceNodeSnapshot, ServiceRegistrySession, ServiceRuntime, ServiceSlot, SystemRegistrySeedSlot, TargetSystemRegistrySlotView, TargetSystemRegistryView, } from "./service/index";
42
+ export { ApiMethod, apiDetailsSchema, assertRegistrySlotAvailable, assertRegistrySlotOwner, buildEmptyServiceSlots, buildSystemRegistryConfigDetails, CategoryConfig, CategoryService, claimServiceRegistrySlot, createActiveServiceLifecycle, createClaimedRegistrySlotRuntimeState, DEFAULT_SYSTEM_REGISTRY_SEED_SLOTS, defaultL3ServiceDetails, EMPTY_REGISTRY_SLOT_RUNTIME_STATE, fieldDefinitionSchema, getApi, getApiSchema, getConfig, getConfigSchema, getService, getServiceSchema, getTargetSystemRegistry, parseServiceSlot, parseServiceSlots, patchServiceRuntime, postApi, postApiSchema, postService, postServiceInstance, postServiceSchema, postSystemRegistryConfig, postSystemRegistryConfigSchema, registerService, registerServiceAtStartup, registrySlotRuntimePatchFromGuardResult, releaseSystemRegistrySlots, resetSystemRegistryConfig, resetSystemRegistryConfigSchema, resolveActiveRegistryServiceId, runRegistrySlotGuardCheck, ServiceLifecycleStatus, ServiceRegistryError, ServiceSlotStatus, schemaDefinitionSchema, serviceDetailsSchema, serviceLifecycleSchema, serviceNodeSnapshotSchema, serviceRuntimeSchema, systemRegistrySeedSlotSchema, TARGET_SYSTEM_REGISTRY_KEY, unregisterService, unregisterServiceAtShutdown, } from "./service/index";
43
43
  export type { FetchInitFactory, FetchRetryOptions } from "./shared/http/fetch-retry";
44
44
  export { fetchBinaryWithRetry, fetchWithRetry, isRetryableHttpStatus, requestHasBody, } from "./shared/http/fetch-retry";
45
45
  export type { CreateLoggerInput, DecodedLogBatch, FlatLogEntry, LogEntry, LoggerWithScope, LogScope, LogScopePatch, } from "./shared/log";
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,YAAY,EACR,oBAAoB,EACpB,6BAA6B,EAC7B,qBAAqB,EACrB,yBAAyB,GAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACH,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,EAC5B,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,GAC3B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,YAAY,EACR,+BAA+B,EAC/B,wBAAwB,EACxB,sBAAsB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACH,yBAAyB,EACzB,6BAA6B,GAChC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,qBAAqB,EACrB,g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,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EACH,YAAY,EACZ,UAAU,EACV,UAAU,EACV,gBAAgB,GACnB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAChE,YAAY,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACpG,OAAO,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/F,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACzE,cAAc,uBAAuB,CAAC"}
package/dist/browser.js CHANGED
@@ -1,5 +1,5 @@
1
1
  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, c as LogLevel, M as MAX_POLL_TARGET_LIST_SIZE, 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, f as createLogger, g as createTarget, h as deleteTarget, i as generateResponse, j as getPossibleTarget, k as getTarget, l as getTargetList, m as getTargetTotalCount, n as handleSupabaseError, o as isCreateTargetAlreadyExistsError, p as isDevEnvironment, q as isOptimisticLockError, r as isOptimisticLockResponse, s as logDev, t as logDevGroup, u as logManager, v as patchTarget, w as pollTargetList, x as postListCreate, y as postLogListCreate, z as postTarget, A as scanTargetList, D as supabase, E as updateTargetDetails, F as validateWith, G as validateWithSchema } from './chunks/list.api-Ab9v8yOg.js';
2
- export { A as ApiMethod, C as CategoryConfig, a as CategoryExtraction, b as CategoryIdea, c as CategoryLink, d as CategoryNode, e as CategoryParcel, f as CategoryRepo, g as CategoryService, h as CategoryTask, i as CategoryWord, D as DEFAULT_SYSTEM_REGISTRY_SEED_SLOTS, E as EMPTY_REGISTRY_SLOT_RUNTIME_STATE, M as Market, N as NodeStatus, P as POST_TASK_DEFAULT_MAX_ATTEMPTS, j as ParcelManager, k as PostLinkValidator, R as ResultCode, S as ServiceLifecycleStatus, l as ServiceRegistryError, m as ServiceSlotStatus, T as TARGET_SYSTEM_REGISTRY_KEY, n as TASK_REPO_USAGE, o as TaskStatus, p as TaskStatusAction, q as apiDetailsSchema, r as assertRegistrySlotAvailable, s as assertRegistrySlotOwner, t as buildEmptyServiceSlots, u as buildSystemRegistryConfigDetails, v as claimServiceRegistrySlot, w as classifyNetworkError, x as countTasksByType, y as createActiveServiceLifecycle, z as createClaimedRegistrySlotRuntimeState, B as createStorageProviderRegistry, F as createUploadTracker, G as decodeLogBatch, H as decodeLogBatchList, I as defaultL3ServiceDetails, J as deleteParcel, K as deleteParcelSchema, L as evaluateBusyNodeLiveness, O as fetchBinaryWithRetry, Q as fetchWithRetry, U as fieldDefinitionSchema, V as flattenLogBatch, W as flattenLogBatches, X as formatNetworkError, Y as getApi, Z as getApiSchema, _ as getConfig, $ as getConfigSchema, a0 as getExtraction, a1 as getExtractionSchema, a2 as getParcel, a3 as getParcelSchema, a4 as getScanRemoteRepoValues, a5 as getScanRemoteRepoValuesSchema, a6 as getService, a7 as getServiceSchema, a8 as getTargetSystemRegistry, a9 as getValueAtPath, aa as installChunkFetchRegistry, ab as isHttpUrl, ac as isLocalFilesystemPath, ad as isLogBatchList, ae as isLogEntry, af as isOpaqueChunkUrl, ag as isRetryableHttpStatus, ah as parcelDetailsSchema, ai as parseLogBatchMeta, aj as parseProviderPrefixedUrl, ak as parseServiceSlot, al as parseServiceSlots, am as patchChangeNodeStatus, an as patchChangeNodeStatusSchema, ao as patchChangeTaskStatus, ap as patchChangeTaskStatusSchema, aq as patchClaimTask, ar as patchClaimTaskSchema, as as patchExtractionObjects, at as patchExtractionObjectsSchema, au as patchNodeHeartBeat, av as patchNodeHeartBeatSchema, aw as patchServiceRuntime, ax as patchStopNode, ay as patchStopNodeSchema, az as patchTaskProgress, aA as patchTaskProgressSchema, aB as postApi, aC as postApiSchema, aD as postExtraction, aE as postExtractionSchema, aF as postLinkCreate, aG as postParcel, aH as postParcelSchema, aI as postRegisterNode, aJ as postRegisterNodeSchema, aK as postService, aL as postServiceInstance, aM as postServiceSchema, aN as postSystemRegistryConfig, aO as postSystemRegistryConfigSchema, aP as postTask, aQ as postTaskSchema, aR as postTaskWithRetry, aS as publishParcel, aT as registerProviderChunkResolver, aU as registerService, aV as registerServiceAtStartup, aW as registrySlotRuntimePatchFromGuardResult, aX as requestHasBody, aY as resetSystemRegistryConfig, aZ as resetSystemRegistryConfigSchema, a_ as resolveActiveRegistryServiceId, a$ as resolveFetchUrl, b0 as restoreParcel, b1 as restoreParcelById, b2 as runRegistrySlotGuardCheck, b3 as sanitizeFileName, b4 as sanitizeParcelFileName, b5 as scanExtractionList, b6 as scanExtractionListSchema, b7 as schemaDefinitionSchema, b8 as serviceDetailsSchema, b9 as serviceLifecycleSchema, ba as serviceNodeSnapshotSchema, bb as serviceRuntimeSchema, bc as sha256Hex, bd as summarizeTaskQueue, be as systemRegistrySeedSlotSchema, bf as unregisterService, bg as unregisterServiceAtShutdown } from './chunks/word.interface-B_fbVFOW.js';
2
+ export { A as ApiMethod, C as CategoryConfig, a as CategoryExtraction, b as CategoryIdea, c as CategoryLink, d as CategoryNode, e as CategoryParcel, f as CategoryRepo, g as CategoryService, h as CategoryTask, i as CategoryWord, D as DEFAULT_SYSTEM_REGISTRY_SEED_SLOTS, E as EMPTY_REGISTRY_SLOT_RUNTIME_STATE, M as Market, N as NodeStatus, P as POST_TASK_DEFAULT_MAX_ATTEMPTS, j as ParcelManager, k as PostLinkValidator, R as ResultCode, S as ServiceLifecycleStatus, l as ServiceRegistryError, m as ServiceSlotStatus, T as TARGET_SYSTEM_REGISTRY_KEY, n as TASK_REPO_USAGE, o as TaskStatus, p as TaskStatusAction, q as apiDetailsSchema, r as assertRegistrySlotAvailable, s as assertRegistrySlotOwner, t as buildEmptyServiceSlots, u as buildSystemRegistryConfigDetails, v as claimServiceRegistrySlot, w as classifyNetworkError, x as countTasksByType, y as createActiveServiceLifecycle, z as createClaimedRegistrySlotRuntimeState, B as createStorageProviderRegistry, F as createUploadTracker, G as decodeLogBatch, H as decodeLogBatchList, I as defaultL3ServiceDetails, J as deleteParcel, K as deleteParcelSchema, L as evaluateBusyNodeLiveness, O as fetchBinaryWithRetry, Q as fetchWithRetry, U as fieldDefinitionSchema, V as flattenLogBatch, W as flattenLogBatches, X as formatNetworkError, Y as getApi, Z as getApiSchema, _ as getConfig, $ as getConfigSchema, a0 as getExtraction, a1 as getExtractionSchema, a2 as getParcel, a3 as getParcelSchema, a4 as getScanRemoteRepoValues, a5 as getScanRemoteRepoValuesSchema, a6 as getService, a7 as getServiceSchema, a8 as getTargetSystemRegistry, a9 as getValueAtPath, aa as installChunkFetchRegistry, ab as isHttpUrl, ac as isLocalFilesystemPath, ad as isLogBatchList, ae as isLogEntry, af as isOpaqueChunkUrl, ag as isRetryableHttpStatus, ah as parcelDetailsSchema, ai as parseLogBatchMeta, aj as parseProviderPrefixedUrl, ak as parseServiceSlot, al as parseServiceSlots, am as patchChangeNodeStatus, an as patchChangeNodeStatusSchema, ao as patchChangeTaskStatus, ap as patchChangeTaskStatusSchema, aq as patchClaimTask, ar as patchClaimTaskSchema, as as patchExtractionObjects, at as patchExtractionObjectsSchema, au as patchNodeHeartBeat, av as patchNodeHeartBeatSchema, aw as patchServiceRuntime, ax as patchStopNode, ay as patchStopNodeSchema, az as patchTaskProgress, aA as patchTaskProgressSchema, aB as postApi, aC as postApiSchema, aD as postExtraction, aE as postExtractionSchema, aF as postLinkCreate, aG as postParcel, aH as postParcelSchema, aI as postRegisterNode, aJ as postRegisterNodeSchema, aK as postService, aL as postServiceInstance, aM as postServiceSchema, aN as postSystemRegistryConfig, aO as postSystemRegistryConfigSchema, aP as postTask, aQ as postTaskSchema, aR as postTaskWithRetry, aS as publishParcel, aT as registerProviderChunkResolver, aU as registerService, aV as registerServiceAtStartup, aW as registrySlotRuntimePatchFromGuardResult, aX as releaseSystemRegistrySlots, aY as requestHasBody, aZ as resetSystemRegistryConfig, a_ as resetSystemRegistryConfigSchema, a$ as resolveActiveRegistryServiceId, b0 as resolveFetchUrl, b1 as restoreParcel, b2 as restoreParcelById, b3 as runRegistrySlotGuardCheck, b4 as sanitizeFileName, b5 as sanitizeParcelFileName, b6 as scanExtractionList, b7 as scanExtractionListSchema, b8 as schemaDefinitionSchema, b9 as serviceDetailsSchema, ba as serviceLifecycleSchema, bb as serviceNodeSnapshotSchema, bc as serviceRuntimeSchema, bd as sha256Hex, be as summarizeTaskQueue, bf as systemRegistrySeedSlotSchema, bg as unregisterService, bh as unregisterServiceAtShutdown } from './chunks/word.interface-Mw7bTSqs.js';
3
3
  import 'lodash-es';
4
4
  import '@supabase/supabase-js';
5
5
  import 'zod';
@@ -229,8 +229,11 @@ function createJsonFileStateStore(options) {
229
229
  const parsed = JSON.parse(raw);
230
230
  return mergeWithNested(defaultState, parsed, {}, nestedKeys);
231
231
  }
232
- catch {
233
- return { ...defaultState };
232
+ catch (error) {
233
+ if (error.code === "ENOENT") {
234
+ return mergeWithNested(defaultState, {}, {}, nestedKeys);
235
+ }
236
+ throw error;
234
237
  }
235
238
  },
236
239
  async write(patch) {
@@ -1511,4 +1514,4 @@ function resolveLogPersistRegistryPath(registryDir) {
1511
1514
  }
1512
1515
 
1513
1516
  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 };
1514
- //# sourceMappingURL=enable-log-persist-B8rg_wXG.js.map
1517
+ //# sourceMappingURL=enable-log-persist-BL2FaGQp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enable-log-persist-BL2FaGQp.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/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","import { mkdir, readFile, rename, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\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 const tempPath = `${filePath}.${process.pid}.tmp`;\n await writeFile(tempPath, content, \"utf8\");\n await rename(tempPath, filePath);\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 return {\n async read(): 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 throw error;\n }\n },\n\n async write(patch: JsonStatePatch<T, NK>): Promise<T> {\n const current = await this.read();\n const next = touchUpdatedAt(mergeWithNested(defaultState, current, patch as Partial<T>, nestedKeys));\n await atomicWriteJson(filePath, next);\n return next;\n },\n\n async reset(): Promise<T> {\n const next = touchUpdatedAt({ ...defaultState });\n await atomicWriteJson(filePath, next);\n return next;\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,GAAA,GAAyB,OAAO,CAAC,GAAG,EAAA;IACtE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE;IAC/B,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE;AAC/B,QAAA,OAAO,SAAS;IACpB;AACA,IAAA,OAAO,KAAK;AAChB;AAEM,SAAU,UAAU,CAAC,IAAY,EAAE,GAAA,GAAyB,OAAO,CAAC,GAAG,EAAA;IACzE,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AAChC,IAAA,IAAI,KAAK,IAAI,IAAI,EAAE;AACf,QAAA,MAAM,IAAI,KAAK,CAAC,0CAA0C,IAAI,CAAA,CAAE,CAAC;IACrE;AACA,IAAA,OAAO,KAAK;AAChB;;SCNgB,MAAM,CAAC,IAAY,EAAE,YAAoB,EAAE,OAAuB,EAAA;IAC9E,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG;IACvC,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AAC9B,IAAA,IAAI,GAAG,IAAI,IAAI,EAAE;AACb,QAAA,OAAO,YAAY;IACvB;A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AA,EAAE,EAAE,KAAK;wBACT,OAAO,EAAE,OAAO,CAAC,iBAAiB;AAClC,wBAAA,KAAK,EAAE,EAAE;AACT,wBAAA,UAAU,EAAE,EAAE;qBACjB;AACD,oBAAA,OAAO,KAAK;gBAChB;AACA,gBAAA,IAAI,GAAG,uBAAuB,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;gBACrF,OAAO,IAAI,CAAC,EAAE;YAClB,CAAC;AACJ,SAAA,CAAC;IACN;AAAE,IAAA,MAAM;AACJ,QAAA,aAAa,CAAC,IAAI,CAAC,kCAAkC,EAAE;YACnD,SAAS;YACT,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;AAC5C,YAAA,GAAG,IAAI;AACV,SAAA,CAAC;IACN;AAEA,IAAA,OAAO,IAAI;AACf;AAEO,eAAe,uBAAuB,CAAC,OAK7C,EAAA;IACG,MAAM,KAAK,GAAG,MAAM,sBAAsB,CAAC,OAAO,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;;;;"}
@@ -1820,6 +1820,119 @@ function releaseOwnedSlot(slots, serviceId) {
1820
1820
  };
1821
1821
  return next;
1822
1822
  }
1823
+ function releaseActiveSlotsForServiceValues(slots, serviceValueSet) {
1824
+ const nextSlots = [...slots];
1825
+ const released = [];
1826
+ for (let slotIndex = 0; slotIndex < nextSlots.length; slotIndex += 1) {
1827
+ const slot = nextSlots[slotIndex];
1828
+ if (!serviceValueSet.has(slot.serviceValue) ||
1829
+ slot.status !== ServiceSlotStatus.ACTIVE ||
1830
+ slot.serviceId == null) {
1831
+ continue;
1832
+ }
1833
+ released.push({
1834
+ serviceValue: slot.serviceValue,
1835
+ serviceId: slot.serviceId,
1836
+ slotIndex,
1837
+ });
1838
+ nextSlots[slotIndex] = {
1839
+ ...slot,
1840
+ serviceId: null,
1841
+ status: ServiceSlotStatus.EMPTY,
1842
+ };
1843
+ }
1844
+ return { nextSlots, released };
1845
+ }
1846
+ /**
1847
+ * Force-release ACTIVE registry slots for the given logical service keys (`ACTIVE → EMPTY`).
1848
+ * Ops/dev recovery when a process crashed without {@link unregisterService}.
1849
+ * Does not delete Service rows or mutate `details.runtime`.
1850
+ */
1851
+ async function releaseSystemRegistrySlots(input) {
1852
+ const serviceValues = [
1853
+ ...new Set(input.serviceValues.map((value) => value.trim()).filter((value) => value !== "")),
1854
+ ];
1855
+ if (serviceValues.length === 0) {
1856
+ throw new Error("[releaseSystemRegistrySlots] serviceValues must not be empty");
1857
+ }
1858
+ const serviceValueSet = new Set(serviceValues);
1859
+ const maxAttempts = input.maxAttempts ?? DEFAULT_REGISTER_RETRY_ATTEMPTS;
1860
+ const logger = createLogger({
1861
+ module: "releaseSystemRegistrySlots",
1862
+ traceId: input.traceId,
1863
+ labels: { serviceValues: serviceValues.join(",") },
1864
+ });
1865
+ logger.info("开始强制释放 registry 槽位", {
1866
+ topic: LOG_TOPIC_REGISTRY,
1867
+ data: { serviceValues },
1868
+ });
1869
+ for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
1870
+ try {
1871
+ const config = await loadSystemRegistryConfig();
1872
+ const revision = parseRegistryRevision(config.details.meta);
1873
+ const slots = parseServiceSlots(config);
1874
+ for (const serviceValue of serviceValues) {
1875
+ if (!isServiceValueDeclared(slots, serviceValue)) {
1876
+ throw new ServiceRegistryError(`Service ${serviceValue} is not declared in system registry config`, "SERVICE_NOT_DECLARED");
1877
+ }
1878
+ }
1879
+ const { nextSlots, released } = releaseActiveSlotsForServiceValues(slots, serviceValueSet);
1880
+ const releasedValueSet = new Set(released.map((entry) => entry.serviceValue));
1881
+ const unchangedServiceValues = serviceValues.filter((serviceValue) => !releasedValueSet.has(serviceValue));
1882
+ if (released.length === 0) {
1883
+ logger.info("无 ACTIVE 槽位需要释放", {
1884
+ topic: LOG_TOPIC_REGISTRY,
1885
+ data: { serviceValues, attempt },
1886
+ });
1887
+ return { config, released, unchangedServiceValues: serviceValues };
1888
+ }
1889
+ await persistSlotClaim({
1890
+ configId: config.id,
1891
+ revision,
1892
+ slots: nextSlots,
1893
+ });
1894
+ const updated = await loadSystemRegistryConfig();
1895
+ logger.info("槽位强制释放成功", {
1896
+ topic: LOG_TOPIC_REGISTRY,
1897
+ data: {
1898
+ released,
1899
+ unchangedServiceValues,
1900
+ attempt,
1901
+ revision: revision + 1,
1902
+ },
1903
+ });
1904
+ return {
1905
+ config: updated,
1906
+ released,
1907
+ unchangedServiceValues,
1908
+ };
1909
+ }
1910
+ catch (error) {
1911
+ if (error instanceof ServiceRegistryError) {
1912
+ logger.error("槽位强制释放被拒绝", {
1913
+ topic: LOG_TOPIC_REGISTRY,
1914
+ data: { serviceValues, code: error.code, message: error.message },
1915
+ });
1916
+ throw error;
1917
+ }
1918
+ if (isOptimisticLockError(error) && attempt < maxAttempts) {
1919
+ logger.warn("registry 乐观锁冲突,重试", {
1920
+ topic: LOG_TOPIC_REGISTRY,
1921
+ data: { serviceValues, attempt, maxAttempts },
1922
+ });
1923
+ await sleep$1(50 * attempt);
1924
+ continue;
1925
+ }
1926
+ const message = error instanceof Error ? error.message : String(error);
1927
+ logger.error("槽位强制释放失败", {
1928
+ topic: LOG_TOPIC_REGISTRY,
1929
+ data: { serviceValues, attempt, message },
1930
+ });
1931
+ throw new ServiceRegistryError(message, "REGISTRY_UPDATE_FAILED");
1932
+ }
1933
+ }
1934
+ throw new ServiceRegistryError("[releaseSystemRegistrySlots] Optimistic lock retries exhausted", "REGISTRY_UPDATE_FAILED");
1935
+ }
1823
1936
  /**
1824
1937
  * Claim one EMPTY slot for a running Service instance (`EMPTY → ACTIVE` only).
1825
1938
  *
@@ -2950,5 +3063,5 @@ var CategoryWord;
2950
3063
  CategoryWord["WORD"] = "word";
2951
3064
  })(CategoryWord || (CategoryWord = {}));
2952
3065
 
2953
- export { getConfigSchema as $, ApiMethod as A, createStorageProviderRegistry as B, CategoryConfig as C, DEFAULT_SYSTEM_REGISTRY_SEED_SLOTS as D, EMPTY_REGISTRY_SLOT_RUNTIME_STATE as E, createUploadTracker as F, decodeLogBatch as G, decodeLogBatchList as H, defaultL3ServiceDetails as I, deleteParcel as J, deleteParcelSchema as K, evaluateBusyNodeLiveness as L, Market as M, NodeStatus as N, fetchBinaryWithRetry as O, POST_TASK_DEFAULT_MAX_ATTEMPTS as P, fetchWithRetry as Q, ResultCode as R, ServiceLifecycleStatus as S, TARGET_SYSTEM_REGISTRY_KEY as T, fieldDefinitionSchema as U, flattenLogBatch as V, flattenLogBatches as W, formatNetworkError as X, getApi as Y, getApiSchema as Z, getConfig as _, CategoryExtraction as a, resolveFetchUrl as a$, getExtraction as a0, getExtractionSchema as a1, getParcel as a2, getParcelSchema as a3, getScanRemoteRepoValues as a4, getScanRemoteRepoValuesSchema as a5, getService as a6, getServiceSchema as a7, getTargetSystemRegistry as a8, getValueAtPath as a9, patchTaskProgressSchema as aA, postApi as aB, postApiSchema as aC, postExtraction as aD, postExtractionSchema as aE, postLinkCreate as aF, postParcel as aG, postParcelSchema as aH, postRegisterNode as aI, postRegisterNodeSchema as aJ, postService as aK, postServiceInstance as aL, postServiceSchema as aM, postSystemRegistryConfig as aN, postSystemRegistryConfigSchema as aO, postTask as aP, postTaskSchema as aQ, postTaskWithRetry as aR, publishParcel as aS, registerProviderChunkResolver as aT, registerService as aU, registerServiceAtStartup as aV, registrySlotRuntimePatchFromGuardResult as aW, requestHasBody as aX, resetSystemRegistryConfig as aY, resetSystemRegistryConfigSchema as aZ, resolveActiveRegistryServiceId as a_, installChunkFetchRegistry as aa, isHttpUrl as ab, isLocalFilesystemPath as ac, isLogBatchList as ad, isLogEntry as ae, isOpaqueChunkUrl as af, isRetryableHttpStatus as ag, parcelDetailsSchema as ah, parseLogBatchMeta as ai, parseProviderPrefixedUrl as aj, parseServiceSlot as ak, parseServiceSlots as al, patchChangeNodeStatus as am, patchChangeNodeStatusSchema as an, patchChangeTaskStatus as ao, patchChangeTaskStatusSchema as ap, patchClaimTask as aq, patchClaimTaskSchema as ar, patchExtractionObjects as as, patchExtractionObjectsSchema as at, patchNodeHeartBeat as au, patchNodeHeartBeatSchema as av, patchServiceRuntime as aw, patchStopNode as ax, patchStopNodeSchema as ay, patchTaskProgress as az, CategoryIdea as b, restoreParcel as b0, restoreParcelById as b1, runRegistrySlotGuardCheck as b2, sanitizeFileName as b3, sanitizeParcelFileName as b4, scanExtractionList as b5, scanExtractionListSchema as b6, schemaDefinitionSchema as b7, serviceDetailsSchema as b8, serviceLifecycleSchema as b9, serviceNodeSnapshotSchema as ba, serviceRuntimeSchema as bb, sha256Hex as bc, summarizeTaskQueue as bd, systemRegistrySeedSlotSchema as be, unregisterService as bf, unregisterServiceAtShutdown as bg, getErrorMessage as bh, LOG_TOPIC_TASK as bi, CRITICAL_UNKNOWN_TASK_TRACE_ID as bj, toError as bk, createTaskRow as bl, CategoryLink as c, CategoryNode as d, CategoryParcel as e, CategoryRepo as f, CategoryService as g, CategoryTask as h, CategoryWord as i, ParcelManager as j, PostLinkValidator as k, ServiceRegistryError as l, ServiceSlotStatus as m, TASK_REPO_USAGE as n, TaskStatus as o, TaskStatusAction as p, apiDetailsSchema as q, assertRegistrySlotAvailable as r, assertRegistrySlotOwner as s, buildEmptyServiceSlots as t, buildSystemRegistryConfigDetails as u, claimServiceRegistrySlot as v, classifyNetworkError as w, countTasksByType as x, createActiveServiceLifecycle as y, createClaimedRegistrySlotRuntimeState as z };
2954
- //# sourceMappingURL=word.interface-B_fbVFOW.js.map
3066
+ export { getConfigSchema as $, ApiMethod as A, createStorageProviderRegistry as B, CategoryConfig as C, DEFAULT_SYSTEM_REGISTRY_SEED_SLOTS as D, EMPTY_REGISTRY_SLOT_RUNTIME_STATE as E, createUploadTracker as F, decodeLogBatch as G, decodeLogBatchList as H, defaultL3ServiceDetails as I, deleteParcel as J, deleteParcelSchema as K, evaluateBusyNodeLiveness as L, Market as M, NodeStatus as N, fetchBinaryWithRetry as O, POST_TASK_DEFAULT_MAX_ATTEMPTS as P, fetchWithRetry as Q, ResultCode as R, ServiceLifecycleStatus as S, TARGET_SYSTEM_REGISTRY_KEY as T, fieldDefinitionSchema as U, flattenLogBatch as V, flattenLogBatches as W, formatNetworkError as X, getApi as Y, getApiSchema as Z, getConfig as _, CategoryExtraction as a, resolveActiveRegistryServiceId as a$, getExtraction as a0, getExtractionSchema as a1, getParcel as a2, getParcelSchema as a3, getScanRemoteRepoValues as a4, getScanRemoteRepoValuesSchema as a5, getService as a6, getServiceSchema as a7, getTargetSystemRegistry as a8, getValueAtPath as a9, patchTaskProgressSchema as aA, postApi as aB, postApiSchema as aC, postExtraction as aD, postExtractionSchema as aE, postLinkCreate as aF, postParcel as aG, postParcelSchema as aH, postRegisterNode as aI, postRegisterNodeSchema as aJ, postService as aK, postServiceInstance as aL, postServiceSchema as aM, postSystemRegistryConfig as aN, postSystemRegistryConfigSchema as aO, postTask as aP, postTaskSchema as aQ, postTaskWithRetry as aR, publishParcel as aS, registerProviderChunkResolver as aT, registerService as aU, registerServiceAtStartup as aV, registrySlotRuntimePatchFromGuardResult as aW, releaseSystemRegistrySlots as aX, requestHasBody as aY, resetSystemRegistryConfig as aZ, resetSystemRegistryConfigSchema as a_, installChunkFetchRegistry as aa, isHttpUrl as ab, isLocalFilesystemPath as ac, isLogBatchList as ad, isLogEntry as ae, isOpaqueChunkUrl as af, isRetryableHttpStatus as ag, parcelDetailsSchema as ah, parseLogBatchMeta as ai, parseProviderPrefixedUrl as aj, parseServiceSlot as ak, parseServiceSlots as al, patchChangeNodeStatus as am, patchChangeNodeStatusSchema as an, patchChangeTaskStatus as ao, patchChangeTaskStatusSchema as ap, patchClaimTask as aq, patchClaimTaskSchema as ar, patchExtractionObjects as as, patchExtractionObjectsSchema as at, patchNodeHeartBeat as au, patchNodeHeartBeatSchema as av, patchServiceRuntime as aw, patchStopNode as ax, patchStopNodeSchema as ay, patchTaskProgress as az, CategoryIdea as b, resolveFetchUrl as b0, restoreParcel as b1, restoreParcelById as b2, runRegistrySlotGuardCheck as b3, sanitizeFileName as b4, sanitizeParcelFileName as b5, scanExtractionList as b6, scanExtractionListSchema as b7, schemaDefinitionSchema as b8, serviceDetailsSchema as b9, serviceLifecycleSchema as ba, serviceNodeSnapshotSchema as bb, serviceRuntimeSchema as bc, sha256Hex as bd, summarizeTaskQueue as be, systemRegistrySeedSlotSchema as bf, unregisterService as bg, unregisterServiceAtShutdown as bh, getErrorMessage as bi, LOG_TOPIC_TASK as bj, CRITICAL_UNKNOWN_TASK_TRACE_ID as bk, toError as bl, createTaskRow as bm, CategoryLink as c, CategoryNode as d, CategoryParcel as e, CategoryRepo as f, CategoryService as g, CategoryTask as h, CategoryWord as i, ParcelManager as j, PostLinkValidator as k, ServiceRegistryError as l, ServiceSlotStatus as m, TASK_REPO_USAGE as n, TaskStatus as o, TaskStatusAction as p, apiDetailsSchema as q, assertRegistrySlotAvailable as r, assertRegistrySlotOwner as s, buildEmptyServiceSlots as t, buildSystemRegistryConfigDetails as u, claimServiceRegistrySlot as v, classifyNetworkError as w, countTasksByType as x, createActiveServiceLifecycle as y, createClaimedRegistrySlotRuntimeState as z };
3067
+ //# sourceMappingURL=word.interface-Mw7bTSqs.js.map