target-supabase-sdk 0.2.24 → 0.2.25
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 +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +3 -2
- package/dist/browser.js.map +1 -1
- package/dist/chunks/{enable-C7lFooTG.js → enable-DkiKPHDl.js} +20 -121
- package/dist/chunks/enable-DkiKPHDl.js.map +1 -0
- package/dist/chunks/{list.api-BzbTJBsM.js → list.api-B-aM4vzv.js} +46 -10
- package/dist/chunks/list.api-B-aM4vzv.js.map +1 -0
- package/dist/chunks/{task-queue-C_nUaM2S.js → task-queue-BYfO0Nzm.js} +11 -8
- package/dist/chunks/task-queue-BYfO0Nzm.js.map +1 -0
- package/dist/node.js +51 -23
- package/dist/node.js.map +1 -1
- package/dist/preload.js +3 -3
- package/dist/shared/log/core/log-batch.d.ts +4 -4
- package/dist/shared/log/core/log-batch.d.ts.map +1 -1
- package/dist/shared/log/index.d.ts +2 -1
- package/dist/shared/log/index.d.ts.map +1 -1
- package/dist/shared/log/spool/collector.d.ts +1 -1
- package/dist/shared/log/spool/collector.d.ts.map +1 -1
- package/dist/shared/log/spool/file.d.ts +2 -8
- package/dist/shared/log/spool/file.d.ts.map +1 -1
- package/dist/shared/log/spool/writer.d.ts.map +1 -1
- package/dist/shared/log/upload/flush.d.ts.map +1 -1
- package/dist/shared/log/upload/interface.d.ts +3 -11
- package/dist/shared/log/upload/interface.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/browser.ts +2 -2
- package/src/shared/log/README.md +2 -3
- package/src/shared/log/core/log-batch.ts +12 -10
- package/src/shared/log/index.ts +2 -1
- package/src/shared/log/spool/collector.ts +46 -20
- package/src/shared/log/spool/file.ts +12 -25
- package/src/shared/log/spool/writer.ts +2 -7
- package/src/shared/log/upload/flush.ts +23 -38
- package/src/shared/log/upload/interface.ts +3 -12
- package/dist/chunks/enable-C7lFooTG.js.map +0 -1
- package/dist/chunks/list.api-BzbTJBsM.js.map +0 -1
- package/dist/chunks/task-queue-C_nUaM2S.js.map +0 -1
- package/dist/shared/log/upload/batch-id.d.ts +0 -13
- package/dist/shared/log/upload/batch-id.d.ts.map +0 -1
- package/src/shared/log/upload/batch-id.ts +0 -43
package/dist/browser.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export { fetchBinaryWithRetry, fetchWithRetry, isRetryableHttpStatus, requestHas
|
|
|
47
47
|
export type { BuildIdeaImageLinkDraftInput, BuildIdeaLinkDraftInput, IdeaCreateSchemaInput, IdeaOriginal, IdeaUpdateSchemaInput, } from "./shared/idea";
|
|
48
48
|
export { buildIdeaImageLinkDraft, buildIdeaLinkDraft, IDEA_IMAGE_LINK_NAME, IDEA_IMAGE_TAG_RAW, IDEA_IMAGE_TEMP_DIR, IDEA_LINK_VALUE, ideaCreateSchema, ideaLinkValueFilters, ideaUpdateSchema, isIdeaImageLinkName, normalizeStringList, parseIdeaOriginal, } from "./shared/idea";
|
|
49
49
|
export type { CreateLoggerInput, DecodedLogBatch, FlatLogEntry, LogEntry, LoggerWithScope, LogScope, LogScopePatch, } from "./shared/log";
|
|
50
|
-
export { createLogger, decodeLogBatch, decodeLogBatchList, flattenLogBatch, flattenLogBatches, isLogBatchList, isLogEntry,
|
|
50
|
+
export { createLogger, decodeLogBatch, decodeLogBatchList, flattenLogBatch, flattenLogBatches, formatLogSpoolBatchTimestamp, isLogBatchList, isLogEntry, LOG_BATCH_LIST_VALUE, LOG_MIN_LEVEL_ENV_KEY, LogLevel, logManager, logMinLevelFromEnv, parseLogBatchMeta, resolveLogMinLevel, } from "./shared/log";
|
|
51
51
|
export type { BuildMediaLinkDraftInput, MediaOriginal, MediaValue } from "./shared/media";
|
|
52
52
|
export { buildMediaLinkDraft, buildMediaNameFromLocator, guessMediaMime, isMediaValue, MEDIA_CONTENT_HASH_ALGORITHM, MEDIA_CONTENT_HASH_PREFIX_LENGTH, MEDIA_VALUES, mediaLinkDedupFilters, } from "./shared/media";
|
|
53
53
|
export type { BuildReviewLinkDraftInput } from "./shared/review";
|
package/dist/browser.d.ts.map
CHANGED
|
@@ -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,YAAY,EACR,MAAM,EACN,aAAa,EACb,gBAAgB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5E,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,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,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,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,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B,EACpB,WAAW,GACd,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,cAAc,GACjB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACR,4BAA4B,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GACpB,MAAM,eAAe,CAAC;AACvB,YAAY,EACR,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,eAAe,EACf,QAAQ,EACR,aAAa,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACH,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,qBAAqB,EACrB,
|
|
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,YAAY,EACR,MAAM,EACN,aAAa,EACb,gBAAgB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5E,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,YAAY,EACR,oBAAoB,EACpB,6BAA6B,EAC7B,qBAAqB,EACrB,yBAAyB,GAC5B,MAAM,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tC,YAAY,EACR,4BAA4B,EAC5B,qBAAqB,EACrB,wBAAwB,GAC3B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACH,qBAAqB,EACrB,2BAA2B,EAC3B,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,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"}
|
package/dist/browser.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { A as ApiMethod, C as CategoryConfig, a as CategoryExtraction, b as CategoryLink, c as CategoryNode, d as CategoryParcel, e as CategoryRepo, f as CategoryService, g as CategoryTask, D as DEFAULT_SYSTEM_REGISTRY_SEED_SLOTS, E as EMPTY_REGISTRY_SLOT_RUNTIME_STATE, F as FEED_VALUES, I as IDEA_IMAGE_LINK_NAME, h as IDEA_IMAGE_TAG_RAW, i as IDEA_IMAGE_TEMP_DIR, j as IDEA_LINK_VALUE, L as LINK_MANIFEST_VERSION, k as LIST_MANIFEST_VERSION, M as MEDIA_CONTENT_HASH_ALGORITHM, l as MEDIA_CONTENT_HASH_PREFIX_LENGTH, m as MEDIA_VALUES, N as NodeStatus, P as POST_TASK_DEFAULT_MAX_ATTEMPTS, n as ParcelManager, o as PostLinkValidator, R as ResultCode, S as ServiceLifecycleStatus, p as ServiceRegistryError, q as ServiceSlotStatus, T as TARGET_SYSTEM_REGISTRY_KEY, r as TASK_REPO_USAGE, s as TaskStatus, t as TaskStatusAction, u as apiDetailsSchema, v as appendSystemRegistryEmptySlots, w as assertRegistrySlotAvailable, x as assertRegistrySlotOwner, y as buildEmptyServiceSlots, z as buildFeedLinkDraft, B as buildFeedLinkName, G as buildIdeaImageLinkDraft, H as buildIdeaLinkDraft, J as buildLinkTargetDraft, K as buildListTargetDraft, O as buildMediaLinkDraft, Q as buildMediaNameFromLocator, U as buildReviewLinkDraft, V as buildSystemRegistryConfigDetails, W as claimServiceRegistrySlot, X as classifyNetworkError, Y as countTasksByType, Z as createActiveServiceLifecycle, _ as createClaimedRegistrySlotRuntimeState, $ as createStorageProviderRegistry, a0 as createUploadTracker, a1 as decodeLogBatch, a2 as decodeLogBatchList, a3 as defaultL3ServiceDetails, a4 as deleteParcel, a5 as deleteParcelSchema, a6 as escapeIlikePattern, a7 as evaluateBusyNodeLiveness, a8 as feedLinkDedupFilters, a9 as fetchBinaryWithRetry, aa as fetchWithRetry, ab as fieldDefinitionSchema, ac as flattenLogBatch, ad as flattenLogBatches, ae as formatNetworkError, af as getApi, ag as getApiSchema, ah as getConfig, ai as getConfigSchema, aj as getExtraction, ak as getExtractionSchema, al as getParcel, am as getParcelSchema, an as getScanRemoteRepoValues, ao as getScanRemoteRepoValuesSchema, ap as getService, aq as getServiceSchema, ar as getTargetSystemRegistry, as as getValueAtPath, at as guessMediaMime, au as ideaCreateSchema, av as ideaLinkValueFilters, aw as ideaUpdateSchema, ax as installChunkFetchRegistry, ay as isFeedValue, az as isHttpUrl, aA as isIdeaImageLinkName, aB as isLocalFilesystemPath, aC as isLogBatchList, aD as isLogEntry, aE as isMediaValue, aF as isOpaqueChunkUrl, aG as isRetryableHttpStatus, aH as linkDedupFilters, aI as linkTargetDraftBuildInputSchema, aJ as mediaLinkDedupFilters, aK as normalizeStringList, aL as parcelDetailsSchema, aM as parseIdeaOriginal, aN as parseLogBatchMeta, aO as parseProviderPrefixedUrl, aP as parseServiceSlot, aQ as parseServiceSlots, aR as patchChangeNodeStatus, aS as patchChangeNodeStatusSchema, aT as patchChangeTaskStatus, aU as patchChangeTaskStatusSchema, aV as patchClaimTask, aW as patchClaimTaskSchema, aX as patchExtractionObjects, aY as patchExtractionObjectsSchema, aZ as patchNodeHeartBeat, a_ as patchNodeHeartBeatSchema, a$ as patchServiceRuntime, b0 as patchStopNode, b1 as patchStopNodeSchema, b2 as patchTaskProgress, b3 as patchTaskProgressSchema, b4 as postApi, b5 as postApiSchema, b6 as postExtraction, b7 as postExtractionSchema, b8 as postLinkCreate, b9 as postParcel, ba as postParcelSchema, bb as postRegisterNode, bc as postRegisterNodeSchema, bd as postService, be as postServiceInstance, bf as postServiceSchema, bg as postSystemRegistryConfig, bh as postSystemRegistryConfigSchema, bi as postTask, bj as postTaskSchema, bk as postTaskWithRetry, bl as publishParcel, bm as registerProviderChunkResolver, bn as registerService, bo as registerServiceAtStartup, bp as registrySlotRuntimePatchFromGuardResult, bq as releaseSystemRegistrySlots, br as releaseSystemRegistrySlotsByServiceId, bs as requestHasBody, bt as resetSystemRegistryConfig, bu as resetSystemRegistryConfigSchema, bv as resolveActiveRegistryServiceId, bw as resolveFetchUrl, bx as restoreParcel, by as restoreParcelById, bz as reviewLinksForNameFilters, bA as runRegistrySlotGuardCheck, bB as sanitizeFileName, bC as sanitizeParcelFileName, bD as scanExtractionList, bE as scanExtractionListSchema, bF as schemaDefinitionSchema, bG as serviceDetailsSchema, bH as serviceLifecycleSchema, bI as serviceNodeSnapshotSchema, bJ as serviceRuntimeSchema, bK as sha256Hex, bL as summarizeTaskQueue, bM as systemRegistrySeedSlotSchema, bN as toPostgrestTextArrayLiteral, bO as unregisterService, bP as unregisterServiceAtShutdown } from './chunks/task-queue-
|
|
2
|
-
export { B as BaseValidator, C as CREATE_TARGET_ALREADY_EXISTS_MESSAGE, a as CategoryList, L as
|
|
1
|
+
export { A as ApiMethod, C as CategoryConfig, a as CategoryExtraction, b as CategoryLink, c as CategoryNode, d as CategoryParcel, e as CategoryRepo, f as CategoryService, g as CategoryTask, D as DEFAULT_SYSTEM_REGISTRY_SEED_SLOTS, E as EMPTY_REGISTRY_SLOT_RUNTIME_STATE, F as FEED_VALUES, I as IDEA_IMAGE_LINK_NAME, h as IDEA_IMAGE_TAG_RAW, i as IDEA_IMAGE_TEMP_DIR, j as IDEA_LINK_VALUE, L as LINK_MANIFEST_VERSION, k as LIST_MANIFEST_VERSION, M as MEDIA_CONTENT_HASH_ALGORITHM, l as MEDIA_CONTENT_HASH_PREFIX_LENGTH, m as MEDIA_VALUES, N as NodeStatus, P as POST_TASK_DEFAULT_MAX_ATTEMPTS, n as ParcelManager, o as PostLinkValidator, R as ResultCode, S as ServiceLifecycleStatus, p as ServiceRegistryError, q as ServiceSlotStatus, T as TARGET_SYSTEM_REGISTRY_KEY, r as TASK_REPO_USAGE, s as TaskStatus, t as TaskStatusAction, u as apiDetailsSchema, v as appendSystemRegistryEmptySlots, w as assertRegistrySlotAvailable, x as assertRegistrySlotOwner, y as buildEmptyServiceSlots, z as buildFeedLinkDraft, B as buildFeedLinkName, G as buildIdeaImageLinkDraft, H as buildIdeaLinkDraft, J as buildLinkTargetDraft, K as buildListTargetDraft, O as buildMediaLinkDraft, Q as buildMediaNameFromLocator, U as buildReviewLinkDraft, V as buildSystemRegistryConfigDetails, W as claimServiceRegistrySlot, X as classifyNetworkError, Y as countTasksByType, Z as createActiveServiceLifecycle, _ as createClaimedRegistrySlotRuntimeState, $ as createStorageProviderRegistry, a0 as createUploadTracker, a1 as decodeLogBatch, a2 as decodeLogBatchList, a3 as defaultL3ServiceDetails, a4 as deleteParcel, a5 as deleteParcelSchema, a6 as escapeIlikePattern, a7 as evaluateBusyNodeLiveness, a8 as feedLinkDedupFilters, a9 as fetchBinaryWithRetry, aa as fetchWithRetry, ab as fieldDefinitionSchema, ac as flattenLogBatch, ad as flattenLogBatches, ae as formatNetworkError, af as getApi, ag as getApiSchema, ah as getConfig, ai as getConfigSchema, aj as getExtraction, ak as getExtractionSchema, al as getParcel, am as getParcelSchema, an as getScanRemoteRepoValues, ao as getScanRemoteRepoValuesSchema, ap as getService, aq as getServiceSchema, ar as getTargetSystemRegistry, as as getValueAtPath, at as guessMediaMime, au as ideaCreateSchema, av as ideaLinkValueFilters, aw as ideaUpdateSchema, ax as installChunkFetchRegistry, ay as isFeedValue, az as isHttpUrl, aA as isIdeaImageLinkName, aB as isLocalFilesystemPath, aC as isLogBatchList, aD as isLogEntry, aE as isMediaValue, aF as isOpaqueChunkUrl, aG as isRetryableHttpStatus, aH as linkDedupFilters, aI as linkTargetDraftBuildInputSchema, aJ as mediaLinkDedupFilters, aK as normalizeStringList, aL as parcelDetailsSchema, aM as parseIdeaOriginal, aN as parseLogBatchMeta, aO as parseProviderPrefixedUrl, aP as parseServiceSlot, aQ as parseServiceSlots, aR as patchChangeNodeStatus, aS as patchChangeNodeStatusSchema, aT as patchChangeTaskStatus, aU as patchChangeTaskStatusSchema, aV as patchClaimTask, aW as patchClaimTaskSchema, aX as patchExtractionObjects, aY as patchExtractionObjectsSchema, aZ as patchNodeHeartBeat, a_ as patchNodeHeartBeatSchema, a$ as patchServiceRuntime, b0 as patchStopNode, b1 as patchStopNodeSchema, b2 as patchTaskProgress, b3 as patchTaskProgressSchema, b4 as postApi, b5 as postApiSchema, b6 as postExtraction, b7 as postExtractionSchema, b8 as postLinkCreate, b9 as postParcel, ba as postParcelSchema, bb as postRegisterNode, bc as postRegisterNodeSchema, bd as postService, be as postServiceInstance, bf as postServiceSchema, bg as postSystemRegistryConfig, bh as postSystemRegistryConfigSchema, bi as postTask, bj as postTaskSchema, bk as postTaskWithRetry, bl as publishParcel, bm as registerProviderChunkResolver, bn as registerService, bo as registerServiceAtStartup, bp as registrySlotRuntimePatchFromGuardResult, bq as releaseSystemRegistrySlots, br as releaseSystemRegistrySlotsByServiceId, bs as requestHasBody, bt as resetSystemRegistryConfig, bu as resetSystemRegistryConfigSchema, bv as resolveActiveRegistryServiceId, bw as resolveFetchUrl, bx as restoreParcel, by as restoreParcelById, bz as reviewLinksForNameFilters, bA as runRegistrySlotGuardCheck, bB as sanitizeFileName, bC as sanitizeParcelFileName, bD as scanExtractionList, bE as scanExtractionListSchema, bF as schemaDefinitionSchema, bG as serviceDetailsSchema, bH as serviceLifecycleSchema, bI as serviceNodeSnapshotSchema, bJ as serviceRuntimeSchema, bK as sha256Hex, bL as summarizeTaskQueue, bM as systemRegistrySeedSlotSchema, bN as toPostgrestTextArrayLiteral, bO as unregisterService, bP as unregisterServiceAtShutdown } from './chunks/task-queue-BYfO0Nzm.js';
|
|
2
|
+
export { B as BaseValidator, C as CREATE_TARGET_ALREADY_EXISTS_MESSAGE, a as CategoryList, L as LOG_BATCH_LIST_VALUE, b as LOG_MIN_LEVEL_ENV_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, U as UPDATE_TARGET_NOT_FOUND_MESSAGE, f as createLogger, g as createTarget, h as deleteTarget, i as formatLogSpoolBatchTimestamp, j as formatZodError, k as generateResponse, l as getPossibleTarget, m as getTarget, n as getTargetList, o as getTargetTotalCount, p as handleSupabaseError, q as isCreateTargetAlreadyExistsError, r as isDevEnvironment, s as isOptimisticLockError, t as isOptimisticLockResponse, u as logDev, v as logDevGroup, w as logManager, x as logMinLevelFromEnv, y as patchTarget, z as pollTargetList, A as postListCreate, D as postLogListCreate, E as postTarget, F as postTargetPayloadSchema, G as queryFilterSchema, H as resolveLogMinLevel, I as safeParseWithSchema, J as scanTargetList, K as supabase, N as targetDraftSchema, Q as updateTarget, R as updateTargetDetails, T as validateWith, V as validateWithSchema } from './chunks/list.api-B-aM4vzv.js';
|
|
3
3
|
import 'zod';
|
|
4
|
+
import 'node:crypto';
|
|
4
5
|
import 'lodash-es';
|
|
5
6
|
import '@supabase/supabase-js';
|
|
6
7
|
//# sourceMappingURL=browser.js.map
|
package/dist/browser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
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 {
|
|
4
|
+
import { f as createLogger, L as LOG_BATCH_LIST_VALUE, a as CategoryList, A as postListCreate, W as randomLogSpoolShortId, X as buildLogSpoolBatchBaseName, Y as registerLogPersistOffer } from './list.api-B-aM4vzv.js';
|
|
5
5
|
import { mkdir, writeFile, rename } from 'node:fs/promises';
|
|
6
|
-
import { createHash } from 'node:crypto';
|
|
7
6
|
|
|
8
7
|
function readEnv(name, env = process.env) {
|
|
9
8
|
const value = env[name]?.trim();
|
|
@@ -374,18 +373,17 @@ function estimateEntriesBytes(entries) {
|
|
|
374
373
|
}
|
|
375
374
|
}
|
|
376
375
|
function buildLogListDraft(input) {
|
|
377
|
-
const { service, process, lane,
|
|
378
|
-
// TODO: `lane` is legacy transport metadata — scheduled for removal; callers still pass a fixed value for decode compatibility.
|
|
376
|
+
const { service, process, lane, entries } = input;
|
|
379
377
|
const first = entries[0];
|
|
380
378
|
const last = entries[entries.length - 1];
|
|
381
379
|
return {
|
|
382
|
-
name:
|
|
383
|
-
value:
|
|
380
|
+
name: service,
|
|
381
|
+
value: LOG_BATCH_LIST_VALUE,
|
|
384
382
|
category: CategoryList.LIST,
|
|
385
383
|
tagList: ["log", lane, service],
|
|
386
384
|
details: {
|
|
387
385
|
manifestVersion: 0,
|
|
388
|
-
loaderKey:
|
|
386
|
+
loaderKey: LOG_BATCH_LIST_VALUE,
|
|
389
387
|
meta: {
|
|
390
388
|
service,
|
|
391
389
|
process,
|
|
@@ -395,7 +393,6 @@ function buildLogListDraft(input) {
|
|
|
395
393
|
from: first?.timestamp ?? null,
|
|
396
394
|
to: last?.timestamp ?? null,
|
|
397
395
|
flushedAt: Date.now(),
|
|
398
|
-
idempotencyKey,
|
|
399
396
|
},
|
|
400
397
|
preview: first?.message ?? "",
|
|
401
398
|
items: entries,
|
|
@@ -421,32 +418,19 @@ async function withTimeout(promise, timeoutMs, label) {
|
|
|
421
418
|
}
|
|
422
419
|
}
|
|
423
420
|
async function postLogBatch(draft, postTimeoutMs) {
|
|
424
|
-
|
|
425
|
-
|
|
421
|
+
const result = await withTimeout(postListCreate({
|
|
422
|
+
name: draft.name,
|
|
423
|
+
value: draft.value,
|
|
424
|
+
category: draft.category,
|
|
425
|
+
details: draft.details,
|
|
426
|
+
}), postTimeoutMs, "postListCreate");
|
|
427
|
+
if (!result.success) {
|
|
428
|
+
const message = result.error?.message ?? "postListCreate failed";
|
|
429
|
+
persistLogger.error("post log batch failed", {
|
|
426
430
|
name: draft.name,
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
}), postTimeoutMs, "postLogListCreate");
|
|
431
|
-
if (!result.success) {
|
|
432
|
-
const message = result.error?.message ?? "postLogListCreate failed";
|
|
433
|
-
persistLogger.error("post log batch failed", {
|
|
434
|
-
idempotencyKey: draft.value,
|
|
435
|
-
name: draft.name,
|
|
436
|
-
error: message,
|
|
437
|
-
});
|
|
438
|
-
throw new Error(message);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
catch (error) {
|
|
442
|
-
if (isCreateTargetAlreadyExistsError(error)) {
|
|
443
|
-
persistLogger.error("post log batch idempotent duplicate — treating as success", {
|
|
444
|
-
idempotencyKey: draft.value,
|
|
445
|
-
name: draft.name,
|
|
446
|
-
});
|
|
447
|
-
return;
|
|
448
|
-
}
|
|
449
|
-
throw error;
|
|
431
|
+
error: message,
|
|
432
|
+
});
|
|
433
|
+
throw new Error(message);
|
|
450
434
|
}
|
|
451
435
|
}
|
|
452
436
|
/** Take a prefix of entries that fits within maxBytes. */
|
|
@@ -474,86 +458,6 @@ function takeEntriesWithinBytes(entries, maxBytes) {
|
|
|
474
458
|
return result;
|
|
475
459
|
}
|
|
476
460
|
|
|
477
|
-
const BATCH_ID_VERSION = 1;
|
|
478
|
-
/** Stable subset of LogEntry for idempotency hashing (same batch → same key). */
|
|
479
|
-
function canonicalLogEntry(entry) {
|
|
480
|
-
return {
|
|
481
|
-
timestamp: entry.timestamp,
|
|
482
|
-
level: entry.level,
|
|
483
|
-
message: entry.message,
|
|
484
|
-
topic: entry.topic,
|
|
485
|
-
module: entry.module,
|
|
486
|
-
traceId: entry.traceId,
|
|
487
|
-
traceParentId: entry.traceParentId ?? null,
|
|
488
|
-
extra: entry.extra ?? null,
|
|
489
|
-
data: entry.data ?? null,
|
|
490
|
-
labels: entry.labels ?? null,
|
|
491
|
-
};
|
|
492
|
-
}
|
|
493
|
-
/**
|
|
494
|
-
* Deterministic List.value for a log batch — retries after timeout map to the same row key.
|
|
495
|
-
* SHA-256 over canonical JSON (service + process + lane + entries in order).
|
|
496
|
-
*/
|
|
497
|
-
function computeLogBatchIdempotencyKey(input) {
|
|
498
|
-
const payload = {
|
|
499
|
-
v: BATCH_ID_VERSION,
|
|
500
|
-
service: input.service,
|
|
501
|
-
process: input.process,
|
|
502
|
-
lane: input.lane,
|
|
503
|
-
entries: input.entries.map(canonicalLogEntry),
|
|
504
|
-
};
|
|
505
|
-
const hash = createHash("sha256").update(JSON.stringify(payload), "utf8").digest("hex");
|
|
506
|
-
return `${hash.slice(0, 32)}`;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
/** `role.timestamp.hash.tmp|json` — role is lowercase alphanumeric + hyphen. */
|
|
510
|
-
const BATCH_FILE_PATTERN = /^([a-z][a-z0-9-]*)\.(\d{14})\.([a-f0-9]{8})\.(tmp|json)$/;
|
|
511
|
-
function formatLogSpoolBatchTimestamp(ms) {
|
|
512
|
-
const d = new Date(ms);
|
|
513
|
-
const pad = (n) => String(n).padStart(2, "0");
|
|
514
|
-
return (`${d.getFullYear()}` +
|
|
515
|
-
`${pad(d.getMonth() + 1)}` +
|
|
516
|
-
`${pad(d.getDate())}` +
|
|
517
|
-
`${pad(d.getHours())}` +
|
|
518
|
-
`${pad(d.getMinutes())}` +
|
|
519
|
-
`${pad(d.getSeconds())}`);
|
|
520
|
-
}
|
|
521
|
-
function computeLogSpoolShortHash(input) {
|
|
522
|
-
const processKey = `${input.serviceId}:${input.processRole}`;
|
|
523
|
-
const idempotencyKey = computeLogBatchIdempotencyKey({
|
|
524
|
-
service: input.serviceValue,
|
|
525
|
-
process: processKey,
|
|
526
|
-
lane: "slow",
|
|
527
|
-
entries: input.entries,
|
|
528
|
-
});
|
|
529
|
-
return idempotencyKey.slice(0, 8);
|
|
530
|
-
}
|
|
531
|
-
function buildLogSpoolBatchBaseName(input) {
|
|
532
|
-
const ts = formatLogSpoolBatchTimestamp(input.firstEntryTimestamp);
|
|
533
|
-
return `${input.processRole}.${ts}.${input.shortHash}`;
|
|
534
|
-
}
|
|
535
|
-
function parseLogSpoolBatchFilename(filename) {
|
|
536
|
-
const match = BATCH_FILE_PATTERN.exec(filename);
|
|
537
|
-
if (match == null) {
|
|
538
|
-
return null;
|
|
539
|
-
}
|
|
540
|
-
const processRole = match[1];
|
|
541
|
-
const tsRaw = match[2];
|
|
542
|
-
const shortHash = match[3];
|
|
543
|
-
const extension = match[4];
|
|
544
|
-
const year = Number(tsRaw.slice(0, 4));
|
|
545
|
-
const month = Number(tsRaw.slice(4, 6));
|
|
546
|
-
const day = Number(tsRaw.slice(6, 8));
|
|
547
|
-
const hour = Number(tsRaw.slice(8, 10));
|
|
548
|
-
const minute = Number(tsRaw.slice(10, 12));
|
|
549
|
-
const second = Number(tsRaw.slice(12, 14));
|
|
550
|
-
const timestampMs = Date.UTC(year, month - 1, day, hour, minute, second);
|
|
551
|
-
if (!Number.isFinite(timestampMs)) {
|
|
552
|
-
return null;
|
|
553
|
-
}
|
|
554
|
-
return { processRole, timestampMs, shortHash, extension };
|
|
555
|
-
}
|
|
556
|
-
|
|
557
461
|
class LogSpoolWriter {
|
|
558
462
|
static instance = null;
|
|
559
463
|
enabled = false;
|
|
@@ -734,12 +638,7 @@ class LogSpoolWriter {
|
|
|
734
638
|
}
|
|
735
639
|
async writeBatchTmp(input) {
|
|
736
640
|
const first = input.entries[0];
|
|
737
|
-
const shortHash =
|
|
738
|
-
serviceValue: input.serviceValue,
|
|
739
|
-
serviceId: input.serviceId,
|
|
740
|
-
processRole: input.processRole,
|
|
741
|
-
entries: input.entries,
|
|
742
|
-
});
|
|
641
|
+
const shortHash = randomLogSpoolShortId();
|
|
743
642
|
const baseName = buildLogSpoolBatchBaseName({
|
|
744
643
|
processRole: input.processRole,
|
|
745
644
|
firstEntryTimestamp: first.timestamp,
|
|
@@ -870,5 +769,5 @@ function validateLogSpoolPreloadEnv(env = process.env) {
|
|
|
870
769
|
}
|
|
871
770
|
}
|
|
872
771
|
|
|
873
|
-
export {
|
|
874
|
-
//# sourceMappingURL=enable-
|
|
772
|
+
export { envPort as A, envProfileFromProcess as B, CLI_PROD_FLAG as C, resolveDefaultEnvFiles as D, resolveProjectRootFromModule as E, LOG_SPOOL_SERVICE_ID_ENV as L, SERVICE_ENV_PROFILE_ENV_KEY as S, logSpoolEnabledFromEnv as a, readEnv as b, requireEnv as c, resolveLogSpoolSpawnEnvForLabel as d, resolveLogSpoolConfig as e, resolveLogSpoolRoot as f, resolveAllLogSpoolProcessRoles as g, logSpoolProcessDir as h, buildLogListDraft as i, postLogBatch as j, logSpoolConfigFromEnv as k, loadEnvFiles as l, mergeLogSpoolExtraProcessRolesEnv as m, ensureLogSpoolFromEnv as n, shutdownLogSpoolFromEnv as o, pinEnvProfileFromArgv as p, getLogSpoolStats as q, resolveProjectRootByPackageName as r, spoolLogger as s, SERVICE_ENV_PROFILE_PROD as t, buildLogSpoolSpawnEnv as u, validateLogSpoolPreloadEnv as v, envBool as w, envInt as x, envMs as y, envNumber as z };
|
|
773
|
+
//# sourceMappingURL=enable-DkiKPHDl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enable-DkiKPHDl.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/shared/log/upload/env.ts","../../src/shared/log/upload/logger.ts","../../src/shared/log/spool/config.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":["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 { 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 { envInt, envMs } from \"../../../node/env/env-parsers\";\nimport type { LogSpoolConfig } from \"./interface\";\n\nexport const LOG_SPOOL_SERVICE_ID_ENV = \"LOG_SPOOL_SERVICE_ID\";\n\nexport const DEFAULT_LOG_SPOOL_CONFIG: LogSpoolConfig = {\n writer: {\n maxEntries: 2000,\n maxBytes: 2 * 1024 * 1024,\n flushDebounceMs: 3_000,\n maxAgeMs: 60_000,\n postTimeoutMs: 30_000,\n },\n gc: {\n intervalMs: 24 * 60 * 60 * 1000,\n syncedRetentionMs: 7 * 24 * 60 * 60 * 1000,\n tmpRetentionMs: 7 * 24 * 60 * 60 * 1000,\n },\n collectIntervalMs: 60_000,\n};\n\nexport function resolveLogSpoolConfig(partial?: Partial<LogSpoolConfig>): LogSpoolConfig {\n const defaults = DEFAULT_LOG_SPOOL_CONFIG;\n return {\n writer: { ...defaults.writer, ...partial?.writer },\n gc: { ...defaults.gc, ...partial?.gc },\n collectIntervalMs: partial?.collectIntervalMs ?? defaults.collectIntervalMs,\n };\n}\n\nexport function logSpoolConfigFromEnv(env: NodeJS.ProcessEnv = process.env): LogSpoolConfig {\n return resolveLogSpoolConfig({\n writer: {\n maxEntries: envInt(\"LOG_SPOOL_MAX_ENTRIES\", DEFAULT_LOG_SPOOL_CONFIG.writer.maxEntries, { env, min: 1 }),\n maxBytes: envInt(\"LOG_SPOOL_MAX_BYTES\", DEFAULT_LOG_SPOOL_CONFIG.writer.maxBytes, { env, min: 1 }),\n flushDebounceMs: envMs(\"LOG_SPOOL_FLUSH_DEBOUNCE_MS\", DEFAULT_LOG_SPOOL_CONFIG.writer.flushDebounceMs, {\n env,\n }),\n maxAgeMs: envMs(\"LOG_SPOOL_MAX_AGE_MS\", DEFAULT_LOG_SPOOL_CONFIG.writer.maxAgeMs, { env }),\n postTimeoutMs: envMs(\"LOG_PERSIST_POST_TIMEOUT_MS\", DEFAULT_LOG_SPOOL_CONFIG.writer.postTimeoutMs, { env }),\n },\n gc: {\n intervalMs: envMs(\"LOG_SPOOL_GC_INTERVAL_MS\", DEFAULT_LOG_SPOOL_CONFIG.gc.intervalMs, { env }),\n syncedRetentionMs: envMs(\"LOG_SPOOL_SYNCED_RETENTION_MS\", DEFAULT_LOG_SPOOL_CONFIG.gc.syncedRetentionMs, {\n env,\n }),\n tmpRetentionMs: envMs(\"LOG_SPOOL_TMP_RETENTION_MS\", DEFAULT_LOG_SPOOL_CONFIG.gc.tmpRetentionMs, { env }),\n },\n collectIntervalMs: envMs(\"LOG_SPOOL_COLLECT_INTERVAL_MS\", DEFAULT_LOG_SPOOL_CONFIG.collectIntervalMs, { env }),\n });\n}\n\nexport function logSpoolServiceIdFromEnv(env: NodeJS.ProcessEnv = process.env): string | undefined {\n const raw = env[LOG_SPOOL_SERVICE_ID_ENV]?.trim();\n return raw != null && raw !== \"\" ? raw : undefined;\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":";;;;;;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,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E,IAAI,IAAI,IAAI,GAAG,CAAC,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;AAClF,QAAA,OAAO,CAAC,IAAI,CAAC,qBAAqB,CAAC;IACvC;AACA,IAAA,MAAM,UAAU,GAAG,GAAG,CAAC,wBAAwB,EAAE,IAAI,EAAE,IAAI,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,3 +1,4 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { pick, pickBy } from 'lodash-es';
|
|
3
4
|
import { createClient } from '@supabase/supabase-js';
|
|
@@ -1051,14 +1052,8 @@ function createLogger(input) {
|
|
|
1051
1052
|
return logManager.withScope(scope, scopeOptions).logger;
|
|
1052
1053
|
}
|
|
1053
1054
|
|
|
1054
|
-
/**
|
|
1055
|
-
|
|
1056
|
-
* Business type: **LogBatch** (transport flush). Pairs with log-service **LogTrace**
|
|
1057
|
-
* (`LogTrace.0`) after rekeying by `traceId`.
|
|
1058
|
-
*/
|
|
1059
|
-
const LOG_PERSIST_LOADER_KEY = "LogBatch.0";
|
|
1060
|
-
/** Alias for {@link LOG_PERSIST_LOADER_KEY} — preferred when contrasting with LogTrace. */
|
|
1061
|
-
const LOG_BATCH_LOADER_KEY = LOG_PERSIST_LOADER_KEY;
|
|
1055
|
+
/** Discriminator on `List.value` and `details.loaderKey` — query by `value` only, not JSON loaderKey. */
|
|
1056
|
+
const LOG_BATCH_LIST_VALUE = "log-batch";
|
|
1062
1057
|
|
|
1063
1058
|
/** Env key for global {@link LogManager} min level (console + log-persist when enabled). */
|
|
1064
1059
|
const LOG_MIN_LEVEL_ENV_KEY = "LOG_MIN_LEVEL";
|
|
@@ -1093,6 +1088,47 @@ function logMinLevelFromEnv(options) {
|
|
|
1093
1088
|
return resolveLogMinLevel(options);
|
|
1094
1089
|
}
|
|
1095
1090
|
|
|
1091
|
+
/** `role.timestamp.hash.tmp|json` — role is lowercase alphanumeric + hyphen. */
|
|
1092
|
+
const BATCH_FILE_PATTERN = /^([a-z][a-z0-9-]*)\.(\d{14})\.([a-f0-9]{8})\.(tmp|json|synced)$/;
|
|
1093
|
+
function formatLogSpoolBatchTimestamp(ms) {
|
|
1094
|
+
const d = new Date(ms);
|
|
1095
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
1096
|
+
return (`${d.getUTCFullYear()}` +
|
|
1097
|
+
`${pad(d.getUTCMonth() + 1)}` +
|
|
1098
|
+
`${pad(d.getUTCDate())}` +
|
|
1099
|
+
`${pad(d.getUTCHours())}` +
|
|
1100
|
+
`${pad(d.getUTCMinutes())}` +
|
|
1101
|
+
`${pad(d.getUTCSeconds())}`);
|
|
1102
|
+
}
|
|
1103
|
+
function randomLogSpoolShortId() {
|
|
1104
|
+
return randomBytes(4).toString("hex");
|
|
1105
|
+
}
|
|
1106
|
+
function buildLogSpoolBatchBaseName(input) {
|
|
1107
|
+
const ts = formatLogSpoolBatchTimestamp(input.firstEntryTimestamp);
|
|
1108
|
+
return `${input.processRole}.${ts}.${input.shortHash}`;
|
|
1109
|
+
}
|
|
1110
|
+
function parseLogSpoolBatchFilename(filename) {
|
|
1111
|
+
const match = BATCH_FILE_PATTERN.exec(filename);
|
|
1112
|
+
if (match == null) {
|
|
1113
|
+
return null;
|
|
1114
|
+
}
|
|
1115
|
+
const processRole = match[1];
|
|
1116
|
+
const tsRaw = match[2];
|
|
1117
|
+
const shortHash = match[3];
|
|
1118
|
+
const extension = match[4];
|
|
1119
|
+
const year = Number(tsRaw.slice(0, 4));
|
|
1120
|
+
const month = Number(tsRaw.slice(4, 6));
|
|
1121
|
+
const day = Number(tsRaw.slice(6, 8));
|
|
1122
|
+
const hour = Number(tsRaw.slice(8, 10));
|
|
1123
|
+
const minute = Number(tsRaw.slice(10, 12));
|
|
1124
|
+
const second = Number(tsRaw.slice(12, 14));
|
|
1125
|
+
const timestampMs = Date.UTC(year, month - 1, day, hour, minute, second);
|
|
1126
|
+
if (!Number.isFinite(timestampMs)) {
|
|
1127
|
+
return null;
|
|
1128
|
+
}
|
|
1129
|
+
return { processRole, timestampMs, shortHash, extension };
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1096
1132
|
var CategoryList;
|
|
1097
1133
|
(function (CategoryList) {
|
|
1098
1134
|
CategoryList["LIST"] = "list";
|
|
@@ -1147,5 +1183,5 @@ const postLogListCreate = async (payload) => {
|
|
|
1147
1183
|
});
|
|
1148
1184
|
};
|
|
1149
1185
|
|
|
1150
|
-
export { postListCreate as A, BaseValidator as B, CREATE_TARGET_ALREADY_EXISTS_MESSAGE as C, postLogListCreate as D, postTarget as E, postTargetPayloadSchema as F, queryFilterSchema as G, resolveLogMinLevel as H, safeParseWithSchema as I, scanTargetList as J, supabase as K,
|
|
1151
|
-
//# sourceMappingURL=list.api-
|
|
1186
|
+
export { withModule as $, postListCreate as A, BaseValidator as B, CREATE_TARGET_ALREADY_EXISTS_MESSAGE as C, postLogListCreate as D, postTarget as E, postTargetPayloadSchema as F, queryFilterSchema as G, resolveLogMinLevel as H, safeParseWithSchema as I, scanTargetList as J, supabase as K, LOG_BATCH_LIST_VALUE as L, MAX_POLL_TARGET_LIST_SIZE as M, targetDraftSchema as N, OPTIMISTIC_LOCK_ERROR_CODE as O, PostListValidator as P, updateTarget as Q, updateTargetDetails as R, StatusCode as S, validateWith as T, UPDATE_TARGET_NOT_FOUND_MESSAGE as U, validateWithSchema as V, randomLogSpoolShortId as W, buildLogSpoolBatchBaseName as X, registerLogPersistOffer as Y, createScope as Z, patchScope as _, CategoryList as a, parseLogSpoolBatchFilename as a0, LOG_MIN_LEVEL_ENV_KEY as b, LogLevel as c, MAX_TARGET_LIST_PAGE_SIZE as d, OPTIMISTIC_LOCK_FAILED_MESSAGE as e, createLogger as f, createTarget as g, deleteTarget as h, formatLogSpoolBatchTimestamp as i, formatZodError as j, generateResponse as k, getPossibleTarget as l, getTarget as m, getTargetList as n, getTargetTotalCount as o, handleSupabaseError as p, isCreateTargetAlreadyExistsError as q, isDevEnvironment as r, isOptimisticLockError as s, isOptimisticLockResponse as t, logDev as u, logDevGroup as v, logManager as w, logMinLevelFromEnv as x, patchTarget as y, pollTargetList as z };
|
|
1187
|
+
//# sourceMappingURL=list.api-B-aM4vzv.js.map
|