target-supabase-sdk 0.2.9 → 0.2.11
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 +3 -4
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +3 -3
- package/dist/chunks/{enable-log-persist-CKxXtE3K.js → enable-log-persist-Cu3SGxK7.js} +212 -55
- package/dist/chunks/enable-log-persist-Cu3SGxK7.js.map +1 -0
- package/dist/chunks/{list.api-6Q4_-7oN.js → list.api-DSTOHzOC.js} +48 -13
- package/dist/chunks/list.api-DSTOHzOC.js.map +1 -0
- package/dist/chunks/{task-queue-D5uWjqVN.js → task-queue-BHvNgb-X.js} +54 -3
- package/dist/chunks/task-queue-BHvNgb-X.js.map +1 -0
- package/dist/core.api.d.ts +6 -15
- package/dist/core.api.d.ts.map +1 -1
- package/dist/core.interface.d.ts +5 -0
- package/dist/core.interface.d.ts.map +1 -1
- package/dist/core.schema.d.ts +77 -0
- package/dist/core.schema.d.ts.map +1 -0
- package/dist/link/index.d.ts +10 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/link.build.d.ts +45 -0
- package/dist/link/link.build.d.ts.map +1 -0
- package/dist/list/index.d.ts +10 -0
- package/dist/list/index.d.ts.map +1 -0
- package/dist/list/list.build.d.ts +21 -0
- package/dist/list/list.build.d.ts.map +1 -0
- package/dist/node/fs/file-write-queue.d.ts +2 -0
- package/dist/node/fs/file-write-queue.d.ts.map +1 -0
- package/dist/node/fs/json-state-store.d.ts.map +1 -1
- package/dist/node.js +6 -6
- package/dist/parcel/parcel.api.d.ts +3 -3
- package/dist/parcel/parcel.api.d.ts.map +1 -1
- package/dist/preload.js +3 -2
- package/dist/preload.js.map +1 -1
- package/dist/service/config.api.d.ts.map +1 -1
- package/dist/service/service.api.d.ts +6 -6
- package/dist/service/service.api.d.ts.map +1 -1
- package/dist/shared/log/log-persist-errors.d.ts +4 -0
- package/dist/shared/log/log-persist-errors.d.ts.map +1 -0
- package/dist/shared/log/log-persist-logger.d.ts +1 -0
- package/dist/shared/log/log-persist-logger.d.ts.map +1 -1
- package/dist/shared/log/log-persist.config.d.ts.map +1 -1
- package/dist/shared/log/log-persist.d.ts +8 -1
- package/dist/shared/log/log-persist.d.ts.map +1 -1
- package/dist/shared/log/log-persist.interface.d.ts +8 -0
- package/dist/shared/log/log-persist.interface.d.ts.map +1 -1
- package/dist/task/task-post-validated.api.d.ts +2 -2
- package/dist/task/task-post.api.d.ts +6 -6
- package/dist/trigger/trigger.api.d.ts +6 -6
- package/package.json +3 -2
- package/src/browser.ts +3 -4
- package/src/core.api.ts +19 -28
- package/src/core.interface.ts +6 -0
- package/src/core.schema.ts +51 -0
- package/src/link/index.ts +10 -0
- package/src/link/link.build.ts +48 -0
- package/src/list/index.ts +13 -0
- package/src/list/list.build.ts +51 -0
- package/src/node/fs/file-write-queue.ts +15 -0
- package/src/node/fs/json-state-store.ts +44 -24
- package/src/shared/log/log-persist-errors.ts +16 -0
- package/src/shared/log/log-persist-logger.ts +28 -0
- package/src/shared/log/log-persist.config.ts +20 -0
- package/src/shared/log/log-persist.interface.ts +8 -0
- package/src/shared/log/log-persist.ts +161 -43
- package/dist/chunks/enable-log-persist-CKxXtE3K.js.map +0 -1
- package/dist/chunks/list.api-6Q4_-7oN.js.map +0 -1
- package/dist/chunks/task-queue-D5uWjqVN.js.map +0 -1
package/dist/browser.d.ts
CHANGED
|
@@ -7,16 +7,15 @@
|
|
|
7
7
|
export type { SupabaseClient } from "@supabase/supabase-js";
|
|
8
8
|
export * from "./core.api";
|
|
9
9
|
export * from "./core.interface";
|
|
10
|
+
export * from "./core.schema";
|
|
10
11
|
export * from "./core.utils";
|
|
11
12
|
export type { GetExtractionPayload, PatchExtractionObjectsPayload, PostExtractionPayload, ScanExtractionListPayload, } from "./extraction/extraction.api";
|
|
12
13
|
export { getExtraction, getExtractionSchema, patchExtractionObjects, patchExtractionObjectsSchema, postExtraction, postExtractionSchema, scanExtractionList, scanExtractionListSchema, } from "./extraction/extraction.api";
|
|
13
14
|
export type { Extraction, ExtractionDetails } from "./extraction/extraction.interface";
|
|
14
15
|
export { CategoryExtraction } from "./extraction/extraction.interface";
|
|
15
16
|
export * from "./idea/idea.interface";
|
|
16
|
-
export * from "./link/
|
|
17
|
-
export * from "./
|
|
18
|
-
export * from "./list/list.api";
|
|
19
|
-
export * from "./list/list.interface";
|
|
17
|
+
export * from "./link/index";
|
|
18
|
+
export * from "./list/index";
|
|
20
19
|
export * from "./node/node.api";
|
|
21
20
|
export * from "./node/node.interface";
|
|
22
21
|
export type { EvaluateBusyNodeLivenessOptions, TaskNodeLivenessFreshest, TaskNodeLivenessReport, } from "./node/node-liveness";
|
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,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,
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,cAAc,EAAE,M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C;AACzD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/browser.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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, U as UPDATE_TARGET_NOT_FOUND_MESSAGE, f as createLogger, g as createTarget, h as deleteTarget, i as
|
|
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, 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,
|
|
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, U as UPDATE_TARGET_NOT_FOUND_MESSAGE, f as createLogger, g as createTarget, h as deleteTarget, i as formatZodError, j as generateResponse, k as getPossibleTarget, l as getTarget, m as getTargetList, n as getTargetTotalCount, o as handleSupabaseError, p as isCreateTargetAlreadyExistsError, q as isDevEnvironment, r as isOptimisticLockError, s as isOptimisticLockResponse, t as logDev, u as logDevGroup, v as logManager, w as patchTarget, x as pollTargetList, y as postListCreate, z as postLogListCreate, A as postTarget, D as postTargetPayloadSchema, E as queryFilterSchema, F as safeParseWithSchema, G as scanTargetList, H as supabase, I as targetDraftSchema, J as updateTarget, K as updateTargetDetails, N as validateWith, Q as validateWithSchema } from './chunks/list.api-DSTOHzOC.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, D as DEFAULT_SYSTEM_REGISTRY_SEED_SLOTS, E as EMPTY_REGISTRY_SLOT_RUNTIME_STATE, L as LINK_MANIFEST_VERSION, i as LIST_MANIFEST_VERSION, 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 appendSystemRegistrySlots, s as assertRegistrySlotAvailable, t as assertRegistrySlotOwner, u as buildEmptyServiceSlots, v as buildLinkTargetDraft, w as buildListTargetDraft, x as buildSystemRegistryConfigDetails, y as claimServiceRegistrySlot, z as classifyNetworkError, B as countTasksByType, F as createActiveServiceLifecycle, G as createClaimedRegistrySlotRuntimeState, H as createStorageProviderRegistry, I as createUploadTracker, J as decodeLogBatch, K as decodeLogBatchList, O as defaultL3ServiceDetails, Q as deleteParcel, U as deleteParcelSchema, V as evaluateBusyNodeLiveness, W as fetchBinaryWithRetry, X as fetchWithRetry, Y as fieldDefinitionSchema, Z as flattenLogBatch, _ as flattenLogBatches, $ as formatNetworkError, a0 as getApi, a1 as getApiSchema, a2 as getConfig, a3 as getConfigSchema, a4 as getExtraction, a5 as getExtractionSchema, a6 as getParcel, a7 as getParcelSchema, a8 as getScanRemoteRepoValues, a9 as getScanRemoteRepoValuesSchema, aa as getService, ab as getServiceSchema, ac as getTargetSystemRegistry, ad as getValueAtPath, ae as installChunkFetchRegistry, af as isHttpUrl, ag as isLocalFilesystemPath, ah as isLogBatchList, ai as isLogEntry, aj as isOpaqueChunkUrl, ak as isRetryableHttpStatus, al as linkTargetDraftBuildInputSchema, am as parcelDetailsSchema, 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, aA as patchNodeHeartBeatSchema, aB as patchServiceRuntime, aC as patchStopNode, aD as patchStopNodeSchema, aE as patchTaskProgress, aF as patchTaskProgressSchema, aG as postApi, aH as postApiSchema, aI as postExtraction, aJ as postExtractionSchema, aK as postLinkCreate, aL as postParcel, aM as postParcelSchema, aN as postRegisterNode, aO as postRegisterNodeSchema, aP as postService, aQ as postServiceInstance, aR as postServiceSchema, aS as postSystemRegistryConfig, aT as postSystemRegistryConfigSchema, aU as postTask, aV as postTaskSchema, aW as postTaskWithRetry, aX as publishParcel, aY as registerProviderChunkResolver, aZ as registerService, a_ as registerServiceAtStartup, a$ as registrySlotRuntimePatchFromGuardResult, b0 as releaseSystemRegistrySlots, b1 as requestHasBody, b2 as resetSystemRegistryConfig, b3 as resetSystemRegistryConfigSchema, b4 as resolveActiveRegistryServiceId, b5 as resolveFetchUrl, b6 as restoreParcel, b7 as restoreParcelById, b8 as runRegistrySlotGuardCheck, b9 as sanitizeFileName, ba as sanitizeParcelFileName, bb as scanExtractionList, bc as scanExtractionListSchema, bd as schemaDefinitionSchema, be as serviceDetailsSchema, bf as serviceLifecycleSchema, bg as serviceNodeSnapshotSchema, bh as serviceRuntimeSchema, bi as sha256Hex, bj as summarizeTaskQueue, bk as systemRegistrySeedSlotSchema, bl as unregisterService, bm as unregisterServiceAtShutdown } from './chunks/task-queue-BHvNgb-X.js';
|
|
3
|
+
import 'zod';
|
|
3
4
|
import 'lodash-es';
|
|
4
5
|
import '@supabase/supabase-js';
|
|
5
|
-
import 'zod';
|
|
6
6
|
//# sourceMappingURL=browser.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { resolve, dirname, join } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import { readFile, mkdir, writeFile, rename, readdir } from 'node:fs/promises';
|
|
5
|
-
import { f as createLogger, b as LOG_PERSIST_LOADER_KEY, a as CategoryList,
|
|
4
|
+
import { readFile, unlink, mkdir, writeFile, rename, readdir } from 'node:fs/promises';
|
|
5
|
+
import { f as createLogger, b as LOG_PERSIST_LOADER_KEY, a as CategoryList, z as postLogListCreate, p as isCreateTargetAlreadyExistsError, c as LogLevel, R as registerLogPersistOffer } from './list.api-DSTOHzOC.js';
|
|
6
6
|
import 'lodash-es';
|
|
7
|
-
import { createHash } from 'node:crypto';
|
|
7
|
+
import { randomBytes, createHash } from 'node:crypto';
|
|
8
8
|
|
|
9
9
|
function readEnv(name, env = process.env) {
|
|
10
10
|
const value = env[name]?.trim();
|
|
@@ -185,6 +185,15 @@ function resolveProjectRootByPackageName(importMetaUrl, packageName) {
|
|
|
185
185
|
throw new Error(`Could not find package root for "${packageName}" from ${importMetaUrl}`);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
/** Per-file write queue — serializes read-modify-write for a single JSON path within one process. */
|
|
189
|
+
const writeChains = new Map();
|
|
190
|
+
function withSerializedFileWrites(filePath, operation) {
|
|
191
|
+
const previous = writeChains.get(filePath) ?? Promise.resolve();
|
|
192
|
+
const next = previous.then(operation, operation);
|
|
193
|
+
writeChains.set(filePath, next.then(() => undefined, () => undefined));
|
|
194
|
+
return next;
|
|
195
|
+
}
|
|
196
|
+
|
|
188
197
|
function mergeWithNested(defaults, current, patch, nestedKeys) {
|
|
189
198
|
const merged = {
|
|
190
199
|
...defaults,
|
|
@@ -206,9 +215,16 @@ function mergeWithNested(defaults, current, patch, nestedKeys) {
|
|
|
206
215
|
async function atomicWriteJson(filePath, data) {
|
|
207
216
|
await mkdir(dirname(filePath), { recursive: true });
|
|
208
217
|
const content = `${JSON.stringify(data, null, 2)}\n`;
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
218
|
+
JSON.parse(content);
|
|
219
|
+
const tempPath = `${filePath}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`;
|
|
220
|
+
try {
|
|
221
|
+
await writeFile(tempPath, content, "utf8");
|
|
222
|
+
await rename(tempPath, filePath);
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
await unlink(tempPath).catch(() => undefined);
|
|
226
|
+
throw error;
|
|
227
|
+
}
|
|
212
228
|
}
|
|
213
229
|
/** JSON file-backed state with optional nested key merge and atomic writes. */
|
|
214
230
|
function createJsonFileStateStore(options) {
|
|
@@ -222,30 +238,41 @@ function createJsonFileStateStore(options) {
|
|
|
222
238
|
[updatedAtKey]: new Date().toISOString(),
|
|
223
239
|
};
|
|
224
240
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
241
|
+
async function readFromDisk() {
|
|
242
|
+
try {
|
|
243
|
+
const raw = await readFile(filePath, "utf8");
|
|
244
|
+
const parsed = JSON.parse(raw);
|
|
245
|
+
return mergeWithNested(defaultState, parsed, {}, nestedKeys);
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
if (error.code === "ENOENT") {
|
|
249
|
+
return mergeWithNested(defaultState, {}, {}, nestedKeys);
|
|
231
250
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
throw error;
|
|
251
|
+
if (error instanceof SyntaxError) {
|
|
252
|
+
await unlink(filePath).catch(() => undefined);
|
|
253
|
+
return mergeWithNested(defaultState, {}, {}, nestedKeys);
|
|
237
254
|
}
|
|
255
|
+
throw error;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return {
|
|
259
|
+
read() {
|
|
260
|
+
return readFromDisk();
|
|
238
261
|
},
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
262
|
+
write(patch) {
|
|
263
|
+
return withSerializedFileWrites(filePath, async () => {
|
|
264
|
+
const current = await readFromDisk();
|
|
265
|
+
const next = touchUpdatedAt(mergeWithNested(defaultState, current, patch, nestedKeys));
|
|
266
|
+
await atomicWriteJson(filePath, next);
|
|
267
|
+
return next;
|
|
268
|
+
});
|
|
244
269
|
},
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
270
|
+
reset() {
|
|
271
|
+
return withSerializedFileWrites(filePath, async () => {
|
|
272
|
+
const next = touchUpdatedAt({ ...defaultState });
|
|
273
|
+
await atomicWriteJson(filePath, next);
|
|
274
|
+
return next;
|
|
275
|
+
});
|
|
249
276
|
},
|
|
250
277
|
};
|
|
251
278
|
}
|
|
@@ -287,6 +314,9 @@ const DEFAULT_LOG_PERSIST_CONFIG = {
|
|
|
287
314
|
},
|
|
288
315
|
postTimeoutMs: 30_000,
|
|
289
316
|
shutdownDrainTimeoutMs: 15_000,
|
|
317
|
+
laneRetryIntervalMs: 5_000,
|
|
318
|
+
errorLogRateLimitMs: 5_000,
|
|
319
|
+
circuitBreakerPermanentFailureThreshold: 3,
|
|
290
320
|
};
|
|
291
321
|
function resolveLogPersistConfig(partial) {
|
|
292
322
|
const defaults = DEFAULT_LOG_PERSIST_CONFIG;
|
|
@@ -296,6 +326,9 @@ function resolveLogPersistConfig(partial) {
|
|
|
296
326
|
slow: { ...defaults.slow, ...partial?.slow },
|
|
297
327
|
postTimeoutMs: partial?.postTimeoutMs ?? defaults.postTimeoutMs,
|
|
298
328
|
shutdownDrainTimeoutMs: partial?.shutdownDrainTimeoutMs ?? defaults.shutdownDrainTimeoutMs,
|
|
329
|
+
laneRetryIntervalMs: partial?.laneRetryIntervalMs ?? defaults.laneRetryIntervalMs,
|
|
330
|
+
errorLogRateLimitMs: partial?.errorLogRateLimitMs ?? defaults.errorLogRateLimitMs,
|
|
331
|
+
circuitBreakerPermanentFailureThreshold: partial?.circuitBreakerPermanentFailureThreshold ?? defaults.circuitBreakerPermanentFailureThreshold,
|
|
299
332
|
};
|
|
300
333
|
}
|
|
301
334
|
function logPersistEnabledFromEnv(env = process.env) {
|
|
@@ -345,6 +378,11 @@ function logPersistConfigFromEnv(env = process.env) {
|
|
|
345
378
|
},
|
|
346
379
|
postTimeoutMs: envMs("LOG_PERSIST_POST_TIMEOUT_MS", DEFAULT_LOG_PERSIST_CONFIG.postTimeoutMs, { env }),
|
|
347
380
|
shutdownDrainTimeoutMs: envMs("LOG_PERSIST_SHUTDOWN_DRAIN_MS", DEFAULT_LOG_PERSIST_CONFIG.shutdownDrainTimeoutMs, { env }),
|
|
381
|
+
laneRetryIntervalMs: envMs("LOG_PERSIST_LANE_RETRY_MS", DEFAULT_LOG_PERSIST_CONFIG.laneRetryIntervalMs, {
|
|
382
|
+
env,
|
|
383
|
+
}),
|
|
384
|
+
errorLogRateLimitMs: envMs("LOG_PERSIST_ERROR_LOG_RATE_LIMIT_MS", DEFAULT_LOG_PERSIST_CONFIG.errorLogRateLimitMs, { env }),
|
|
385
|
+
circuitBreakerPermanentFailureThreshold: envInt("LOG_PERSIST_CIRCUIT_BREAKER_THRESHOLD", DEFAULT_LOG_PERSIST_CONFIG.circuitBreakerPermanentFailureThreshold, { env, min: 1 }),
|
|
348
386
|
});
|
|
349
387
|
}
|
|
350
388
|
|
|
@@ -380,15 +418,54 @@ function computeLogBatchIdempotencyKey(input) {
|
|
|
380
418
|
return `${hash.slice(0, 32)}`;
|
|
381
419
|
}
|
|
382
420
|
|
|
421
|
+
const PERMANENT_LOG_PERSIST_ERROR_PATTERNS = [
|
|
422
|
+
/not initialized/i,
|
|
423
|
+
/call initialize\(\) first/i,
|
|
424
|
+
/missing required supabase environment/i,
|
|
425
|
+
/preload env incomplete/i,
|
|
426
|
+
];
|
|
427
|
+
function formatLogPersistError(error) {
|
|
428
|
+
return error instanceof Error ? error.message : String(error);
|
|
429
|
+
}
|
|
430
|
+
/** Errors that will not succeed on retry without fixing process configuration. */
|
|
431
|
+
function isPermanentLogPersistError(error) {
|
|
432
|
+
const message = formatLogPersistError(error);
|
|
433
|
+
return PERMANENT_LOG_PERSIST_ERROR_PATTERNS.some((pattern) => pattern.test(message));
|
|
434
|
+
}
|
|
435
|
+
|
|
383
436
|
/** User-facing / lifecycle logs — may be persisted like normal app logs. */
|
|
384
437
|
const LOG_PERSIST_TOPIC = "log-persist";
|
|
385
438
|
/** Operational logs from the persist pipeline — never re-offered to avoid feedback loops. */
|
|
386
439
|
const LOG_PERSIST_INTERNAL_TOPIC = "log-persist-internal";
|
|
387
440
|
const logger = createLogger({ module: "log-persist" });
|
|
441
|
+
let errorLogRateLimitMs = 5_000;
|
|
442
|
+
const lastLoggedAt = new Map();
|
|
443
|
+
function configurePersistLoggerRateLimit(ms) {
|
|
444
|
+
errorLogRateLimitMs = Math.max(0, ms);
|
|
445
|
+
}
|
|
388
446
|
function isLogPersistInternalTopic(topic) {
|
|
389
447
|
return topic === LOG_PERSIST_INTERNAL_TOPIC;
|
|
390
448
|
}
|
|
449
|
+
function shouldEmit(level, message) {
|
|
450
|
+
if (level !== "error" && level !== "warn") {
|
|
451
|
+
return true;
|
|
452
|
+
}
|
|
453
|
+
if (errorLogRateLimitMs <= 0) {
|
|
454
|
+
return true;
|
|
455
|
+
}
|
|
456
|
+
const key = `${level}:${message}`;
|
|
457
|
+
const now = Date.now();
|
|
458
|
+
const last = lastLoggedAt.get(key);
|
|
459
|
+
if (last != null && now - last < errorLogRateLimitMs) {
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
462
|
+
lastLoggedAt.set(key, now);
|
|
463
|
+
return true;
|
|
464
|
+
}
|
|
391
465
|
function write(level, message, data) {
|
|
466
|
+
if (!shouldEmit(level, message)) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
392
469
|
logger[level](message, {
|
|
393
470
|
topic: LOG_PERSIST_INTERNAL_TOPIC,
|
|
394
471
|
...(data != null ? { data } : {}),
|
|
@@ -732,7 +809,6 @@ var logPersistRegistry = /*#__PURE__*/Object.freeze({
|
|
|
732
809
|
unregisterLogPersistProcess: unregisterLogPersistProcess
|
|
733
810
|
});
|
|
734
811
|
|
|
735
|
-
const FAST_RETRY_INTERVAL_MS = 5_000;
|
|
736
812
|
const HEARTBEAT_INTERVAL_MS = 30_000;
|
|
737
813
|
function routeLane(level) {
|
|
738
814
|
if (level === LogLevel.CRITICAL) {
|
|
@@ -758,8 +834,12 @@ class LogPersist {
|
|
|
758
834
|
mediumDebounceTimer = null;
|
|
759
835
|
slowQueueStartedAt = null;
|
|
760
836
|
fastRetryTimer = null;
|
|
837
|
+
mediumRetryTimer = null;
|
|
838
|
+
slowRetryTimer = null;
|
|
761
839
|
heartbeatTimer = null;
|
|
762
840
|
lastHeartbeatAt = 0;
|
|
841
|
+
permanentFailureCount = 0;
|
|
842
|
+
circuitBreakerTripped = false;
|
|
763
843
|
laneFlushing = {
|
|
764
844
|
fast: false,
|
|
765
845
|
medium: false,
|
|
@@ -795,9 +875,12 @@ class LogPersist {
|
|
|
795
875
|
this.processName = options.process;
|
|
796
876
|
this.registryFilePath = options.registryFilePath ?? null;
|
|
797
877
|
this.config = resolveLogPersistConfig(options.config);
|
|
878
|
+
configurePersistLoggerRateLimit(this.config.errorLogRateLimitMs);
|
|
798
879
|
this.draining = false;
|
|
799
880
|
this.shutdownPromise = null;
|
|
800
881
|
this.consecutiveFailures = { fast: 0, medium: 0, slow: 0 };
|
|
882
|
+
this.permanentFailureCount = 0;
|
|
883
|
+
this.circuitBreakerTripped = false;
|
|
801
884
|
this.lastError = null;
|
|
802
885
|
this.lastErrorAt = null;
|
|
803
886
|
this.enabled = true;
|
|
@@ -833,6 +916,7 @@ class LogPersist {
|
|
|
833
916
|
}
|
|
834
917
|
persistLogger.info("log persist core disabling", this.queueSnapshot());
|
|
835
918
|
this.cancelMediumDebounce();
|
|
919
|
+
this.cancelLaneRetryTimers();
|
|
836
920
|
this.stopHeartbeat();
|
|
837
921
|
await this.shutdown();
|
|
838
922
|
persistLogger.info("log persist core disabled");
|
|
@@ -869,6 +953,8 @@ class LogPersist {
|
|
|
869
953
|
return {
|
|
870
954
|
enabled: this.enabled,
|
|
871
955
|
draining: this.draining,
|
|
956
|
+
circuitBreakerTripped: this.circuitBreakerTripped,
|
|
957
|
+
permanentFailureCount: this.permanentFailureCount,
|
|
872
958
|
service: this.service,
|
|
873
959
|
process: this.processName,
|
|
874
960
|
queues: {
|
|
@@ -952,6 +1038,93 @@ class LogPersist {
|
|
|
952
1038
|
recordLaneSuccess(lane) {
|
|
953
1039
|
this.lastError = null;
|
|
954
1040
|
this.consecutiveFailures[lane] = 0;
|
|
1041
|
+
this.permanentFailureCount = 0;
|
|
1042
|
+
}
|
|
1043
|
+
handleLaneFlushFailure(lane, error, scheduleRetry, logMessage, context) {
|
|
1044
|
+
this.recordLaneError(lane, error);
|
|
1045
|
+
const message = this.lastError ?? formatLogPersistError(error);
|
|
1046
|
+
if (isPermanentLogPersistError(error)) {
|
|
1047
|
+
this.permanentFailureCount += 1;
|
|
1048
|
+
if (this.permanentFailureCount >= this.config.circuitBreakerPermanentFailureThreshold) {
|
|
1049
|
+
this.tripCircuitBreaker(message);
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
persistLogger.error(logMessage, {
|
|
1054
|
+
...context,
|
|
1055
|
+
error: message,
|
|
1056
|
+
retryInMs: this.config.laneRetryIntervalMs,
|
|
1057
|
+
permanentFailureCount: this.permanentFailureCount,
|
|
1058
|
+
});
|
|
1059
|
+
scheduleRetry();
|
|
1060
|
+
}
|
|
1061
|
+
tripCircuitBreaker(reason) {
|
|
1062
|
+
if (this.circuitBreakerTripped) {
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
this.circuitBreakerTripped = true;
|
|
1066
|
+
this.cancelMediumDebounce();
|
|
1067
|
+
this.cancelLaneRetryTimers();
|
|
1068
|
+
this.stopHeartbeat();
|
|
1069
|
+
const dropped = this.queueSnapshot();
|
|
1070
|
+
this.fastQueue = [];
|
|
1071
|
+
this.fastRetryQueue = [];
|
|
1072
|
+
this.mediumQueue = [];
|
|
1073
|
+
this.slowQueue = [];
|
|
1074
|
+
this.slowQueueStartedAt = null;
|
|
1075
|
+
this.enabled = false;
|
|
1076
|
+
registerLogPersistOffer(null);
|
|
1077
|
+
persistLogger.error("circuit breaker tripped — log persist disabled", {
|
|
1078
|
+
reason,
|
|
1079
|
+
permanentFailureCount: this.permanentFailureCount,
|
|
1080
|
+
threshold: this.config.circuitBreakerPermanentFailureThreshold,
|
|
1081
|
+
dropped,
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1084
|
+
cancelLaneRetryTimers() {
|
|
1085
|
+
if (this.fastRetryTimer != null) {
|
|
1086
|
+
clearTimeout(this.fastRetryTimer);
|
|
1087
|
+
this.fastRetryTimer = null;
|
|
1088
|
+
}
|
|
1089
|
+
if (this.mediumRetryTimer != null) {
|
|
1090
|
+
clearTimeout(this.mediumRetryTimer);
|
|
1091
|
+
this.mediumRetryTimer = null;
|
|
1092
|
+
}
|
|
1093
|
+
if (this.slowRetryTimer != null) {
|
|
1094
|
+
clearTimeout(this.slowRetryTimer);
|
|
1095
|
+
this.slowRetryTimer = null;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
scheduleLaneRetry(lane, flush) {
|
|
1099
|
+
const retryMs = this.config.laneRetryIntervalMs;
|
|
1100
|
+
const existing = lane === "fast" ? this.fastRetryTimer : lane === "medium" ? this.mediumRetryTimer : this.slowRetryTimer;
|
|
1101
|
+
if (existing != null) {
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
persistLogger.warn(`${lane} flush retry scheduled`, { retryInMs: retryMs });
|
|
1105
|
+
const timer = setTimeout(() => {
|
|
1106
|
+
if (lane === "fast") {
|
|
1107
|
+
this.fastRetryTimer = null;
|
|
1108
|
+
}
|
|
1109
|
+
else if (lane === "medium") {
|
|
1110
|
+
this.mediumRetryTimer = null;
|
|
1111
|
+
}
|
|
1112
|
+
else {
|
|
1113
|
+
this.slowRetryTimer = null;
|
|
1114
|
+
}
|
|
1115
|
+
persistLogger.debug(`${lane} flush retry timer fired`);
|
|
1116
|
+
flush();
|
|
1117
|
+
}, retryMs);
|
|
1118
|
+
timer.unref?.();
|
|
1119
|
+
if (lane === "fast") {
|
|
1120
|
+
this.fastRetryTimer = timer;
|
|
1121
|
+
}
|
|
1122
|
+
else if (lane === "medium") {
|
|
1123
|
+
this.mediumRetryTimer = timer;
|
|
1124
|
+
}
|
|
1125
|
+
else {
|
|
1126
|
+
this.slowRetryTimer = timer;
|
|
1127
|
+
}
|
|
955
1128
|
}
|
|
956
1129
|
queueSnapshot() {
|
|
957
1130
|
return {
|
|
@@ -1012,6 +1185,9 @@ class LogPersist {
|
|
|
1012
1185
|
});
|
|
1013
1186
|
}
|
|
1014
1187
|
scheduleMediumFlush() {
|
|
1188
|
+
if (this.mediumRetryTimer != null) {
|
|
1189
|
+
return;
|
|
1190
|
+
}
|
|
1015
1191
|
const { debounceMs, maxEntries, maxBytes } = this.config.medium;
|
|
1016
1192
|
const queueBytes = estimateEntriesBytes(this.mediumQueue);
|
|
1017
1193
|
if (this.mediumQueue.length >= maxEntries || queueBytes >= maxBytes) {
|
|
@@ -1048,6 +1224,9 @@ class LogPersist {
|
|
|
1048
1224
|
}
|
|
1049
1225
|
}
|
|
1050
1226
|
scheduleSlowFlush() {
|
|
1227
|
+
if (this.slowRetryTimer != null) {
|
|
1228
|
+
return;
|
|
1229
|
+
}
|
|
1051
1230
|
const { maxEntries, maxBytes, maxAgeMs } = this.config.slow;
|
|
1052
1231
|
const queueBytes = estimateEntriesBytes(this.slowQueue);
|
|
1053
1232
|
const ageMs = this.slowQueueStartedAt != null ? Date.now() - this.slowQueueStartedAt : 0;
|
|
@@ -1179,15 +1358,11 @@ class LogPersist {
|
|
|
1179
1358
|
});
|
|
1180
1359
|
}
|
|
1181
1360
|
catch (error) {
|
|
1182
|
-
this.recordLaneError("fast", error);
|
|
1183
1361
|
this.fastRetryQueue.push(entry);
|
|
1184
|
-
|
|
1362
|
+
this.handleLaneFlushFailure("fast", error, () => this.scheduleLaneRetry("fast", () => void this.flushFast()), "fast flush failed — queued for retry", {
|
|
1185
1363
|
idempotencyKey,
|
|
1186
|
-
error: this.lastError,
|
|
1187
|
-
retryInMs: FAST_RETRY_INTERVAL_MS,
|
|
1188
1364
|
fastRetryQueue: this.fastRetryQueue.length,
|
|
1189
1365
|
});
|
|
1190
|
-
this.scheduleFastRetry();
|
|
1191
1366
|
break;
|
|
1192
1367
|
}
|
|
1193
1368
|
}
|
|
@@ -1196,18 +1371,6 @@ class LogPersist {
|
|
|
1196
1371
|
this.laneFlushing.fast = false;
|
|
1197
1372
|
}
|
|
1198
1373
|
}
|
|
1199
|
-
scheduleFastRetry() {
|
|
1200
|
-
if (this.fastRetryTimer != null) {
|
|
1201
|
-
return;
|
|
1202
|
-
}
|
|
1203
|
-
persistLogger.warn("fast flush retry scheduled", { retryInMs: FAST_RETRY_INTERVAL_MS });
|
|
1204
|
-
this.fastRetryTimer = setTimeout(() => {
|
|
1205
|
-
this.fastRetryTimer = null;
|
|
1206
|
-
persistLogger.debug("fast flush retry timer fired");
|
|
1207
|
-
void this.flushFast();
|
|
1208
|
-
}, FAST_RETRY_INTERVAL_MS);
|
|
1209
|
-
this.fastRetryTimer.unref?.();
|
|
1210
|
-
}
|
|
1211
1374
|
async flushMedium() {
|
|
1212
1375
|
if (this.laneFlushing.medium) {
|
|
1213
1376
|
persistLogger.debug("medium flush skipped — already flushing");
|
|
@@ -1259,15 +1422,12 @@ class LogPersist {
|
|
|
1259
1422
|
});
|
|
1260
1423
|
}
|
|
1261
1424
|
catch (error) {
|
|
1262
|
-
this.
|
|
1263
|
-
persistLogger.error("medium flush failed — entries retained", {
|
|
1425
|
+
this.handleLaneFlushFailure("medium", error, () => this.scheduleLaneRetry("medium", () => void this.flushMedium()), "medium flush failed — entries retained", {
|
|
1264
1426
|
idempotencyKey,
|
|
1265
1427
|
batchSize: batch.length,
|
|
1266
1428
|
batchBytes,
|
|
1267
|
-
error: this.lastError,
|
|
1268
1429
|
queueRemaining: this.mediumQueue.length,
|
|
1269
1430
|
});
|
|
1270
|
-
this.scheduleMediumFlush();
|
|
1271
1431
|
break;
|
|
1272
1432
|
}
|
|
1273
1433
|
}
|
|
@@ -1275,7 +1435,7 @@ class LogPersist {
|
|
|
1275
1435
|
finally {
|
|
1276
1436
|
this.laneFlushing.medium = false;
|
|
1277
1437
|
}
|
|
1278
|
-
if (this.mediumQueue.length > 0 && !this.laneFlushing.medium) {
|
|
1438
|
+
if (this.mediumQueue.length > 0 && !this.laneFlushing.medium && this.mediumRetryTimer == null) {
|
|
1279
1439
|
this.scheduleMediumFlush();
|
|
1280
1440
|
}
|
|
1281
1441
|
}
|
|
@@ -1330,15 +1490,12 @@ class LogPersist {
|
|
|
1330
1490
|
});
|
|
1331
1491
|
}
|
|
1332
1492
|
catch (error) {
|
|
1333
|
-
this.
|
|
1334
|
-
persistLogger.error("slow flush failed — entries retained", {
|
|
1493
|
+
this.handleLaneFlushFailure("slow", error, () => this.scheduleLaneRetry("slow", () => void this.flushSlow()), "slow flush failed — entries retained", {
|
|
1335
1494
|
idempotencyKey,
|
|
1336
1495
|
batchSize: batch.length,
|
|
1337
1496
|
batchBytes,
|
|
1338
|
-
error: this.lastError,
|
|
1339
1497
|
queueRemaining: this.slowQueue.length,
|
|
1340
1498
|
});
|
|
1341
|
-
this.scheduleSlowFlush();
|
|
1342
1499
|
break;
|
|
1343
1500
|
}
|
|
1344
1501
|
}
|
|
@@ -1349,7 +1506,7 @@ class LogPersist {
|
|
|
1349
1506
|
finally {
|
|
1350
1507
|
this.laneFlushing.slow = false;
|
|
1351
1508
|
}
|
|
1352
|
-
if (this.slowQueue.length > 0 && !this.laneFlushing.slow) {
|
|
1509
|
+
if (this.slowQueue.length > 0 && !this.laneFlushing.slow && this.slowRetryTimer == null) {
|
|
1353
1510
|
this.scheduleSlowFlush();
|
|
1354
1511
|
}
|
|
1355
1512
|
}
|
|
@@ -1514,4 +1671,4 @@ function resolveLogPersistRegistryPath(registryDir) {
|
|
|
1514
1671
|
}
|
|
1515
1672
|
|
|
1516
1673
|
export { resolveProjectRootFromModule as A, CLI_PROD_FLAG as C, SERVICE_ENV_PROFILE_ENV_KEY as S, logPersistEnabledFromEnv as a, readEnv as b, requireEnv as c, createJsonFileStateStore as d, disableLogPersist as e, ensureLogPersistFromEnv as f, getLogPersistStats as g, SERVICE_ENV_PROFILE_PROD as h, enableLogPersist as i, envBool as j, envInt as k, loadEnvFiles as l, envMs as m, envNumber as n, envPort as o, pinEnvProfileFromArgv as p, envProfileFromProcess as q, resolveProjectRootByPackageName as r, snapshotLogPersistReady as s, parseEnvFile as t, parseEnvLine as u, validateLogPersistPreloadEnv as v, waitForLogPersistReady as w, pollUntil as x, resolveDefaultEnvFiles as y, resolveLogPersistRegistryPath as z };
|
|
1517
|
-
//# sourceMappingURL=enable-log-persist-
|
|
1674
|
+
//# sourceMappingURL=enable-log-persist-Cu3SGxK7.js.map
|