@openfairygui/backend 0.2.0-alpha.8 → 0.2.0

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/index.d.mts CHANGED
@@ -1,6 +1,512 @@
1
- import { $ as BACKEND_CONTRACT_VERSION, A as BackendSessionSnapshot, B as ListJobsInput, C as BackendJobProgress, D as BackendResult, E as BackendProjectSessionStorage, F as GetCacheSnapshotInput, G as OpenProjectSessionInput, H as MaterializeSessionSnapshot, I as GetEventsInput, J as SaveSessionInput, K as RefreshCacheInput, L as GetEventsSnapshot, M as CacheRefreshFailedError, N as CancelJobInput, O as BackendRuntime, P as EventCursorInvalidError, Q as BACKEND_COMPATIBILITY_POLICY, R as GetJobInput, S as BackendJobNotFoundError, T as BackendJobStatus, U as MaterializeValidationFailedError, V as MaterializeSessionInput, W as MaterializeWriteFailedError, X as SessionStaleWriteError, Y as SessionNotFoundError, Z as BACKEND_CAPABILITY_SCHEMA_VERSION, _ as BackendJobErrors, a as BackendCacheSnapshot, b as BackendJobListStatusFilter, c as BackendCapabilityUnavailableError, d as BackendEventKind, et as BackendDiagnostic, f as BackendFailure, g as BackendHostAdapter, h as BackendFileSystem, i as BackendCacheEntry, j as BackendSuccess, k as BackendRuntimeOptions, l as BackendError, m as BackendFileStat, n as ApplySessionTransactionInput, nt as BackendResponseMeta, o as BackendCapabilities, p as BackendFileHandle, q as SavePartialFailureError, r as BackendArtifactBridgeCapability, rt as BackendStage, s as BackendCapabilityManifest, t as AdvisoryLockConflictError, tt as BackendMessage, u as BackendEvent, v as BackendJobKind, w as BackendJobSnapshot, x as BackendJobNotCancellableError, y as BackendJobListSnapshot, z as InProcessLockConflictError } from "./runtime-GyNVxAQ0.mjs";
1
+ import { UamProject, UamTransactionOperation } from "@openfairygui/core/uam";
2
+ import { ApplyUamTransactionAppError } from "@openfairygui/functions/uam";
2
3
  import { FileSystem } from "@openfairygui/core/project-io";
3
4
 
5
+ //#region src/contracts.d.ts
6
+ declare const BACKEND_CONTRACT_VERSION: "1.1.0-p2";
7
+ declare const BACKEND_CAPABILITY_SCHEMA_VERSION: 2;
8
+ declare const BACKEND_COMPATIBILITY_POLICY: {
9
+ readonly incompatibleChange: "requires contractVersion bump";
10
+ readonly capabilitySchemaChange: "requires capabilitySchemaVersion bump";
11
+ readonly additiveChange: "allowed without breaking existing consumers";
12
+ };
13
+ type BackendStage = 'read' | 'authoring' | 'runtime';
14
+ interface BackendMessage {
15
+ code: string;
16
+ message: string;
17
+ }
18
+ interface BackendDiagnostic {
19
+ code: string;
20
+ message: string;
21
+ severity: 'info' | 'warning' | 'error';
22
+ path?: string;
23
+ nodeKind?: string;
24
+ resourceKind?: string;
25
+ gearKind?: string;
26
+ field?: string;
27
+ operationKind?: string;
28
+ opIndex?: number;
29
+ opId?: string;
30
+ }
31
+ interface BackendResponseMeta {
32
+ requestId: string;
33
+ sessionId?: string;
34
+ revision?: number;
35
+ durationMs: number;
36
+ warnings: BackendMessage[];
37
+ diagnostics: BackendDiagnostic[];
38
+ stage: BackendStage;
39
+ contractVersion: typeof BACKEND_CONTRACT_VERSION;
40
+ capabilitySchemaVersion: typeof BACKEND_CAPABILITY_SCHEMA_VERSION;
41
+ }
42
+ //#endregion
43
+ //#region src/path-policy.d.ts
44
+ interface PathPolicyViolationError {
45
+ code: 'path_policy_violation';
46
+ message: string;
47
+ policy: 'save_target';
48
+ attemptedPath: string;
49
+ allowedPath: string;
50
+ }
51
+ //#endregion
52
+ //#region src/runtime/contracts.d.ts
53
+ /** An exclusive lock owned for the lifetime of one backend session. */
54
+ interface BackendSessionLock {
55
+ /** Persist optional host metadata without changing lock ownership. */
56
+ writeMetadata(content: string): Promise<void>;
57
+ /** Release ownership. Browser implementations must also release when their document terminates. */
58
+ release(): Promise<void>;
59
+ }
60
+ interface BackendFileStat {
61
+ isFile(): boolean;
62
+ isDirectory(): boolean;
63
+ }
64
+ interface BackendFileSystem {
65
+ stat(filePath: string): Promise<BackendFileStat>;
66
+ readdir(dirPath: string): Promise<string[]>;
67
+ readFile(filePath: string): Promise<string>;
68
+ readFileRaw(filePath: string): Promise<Uint8Array>;
69
+ writeFile(filePath: string, content: string): Promise<void>;
70
+ writeFileRaw(filePath: string, data: Uint8Array): Promise<void>;
71
+ mkdir(dirPath: string, options?: {
72
+ recursive?: boolean;
73
+ }): Promise<void>;
74
+ resolvePath(filePath: string): Promise<string>;
75
+ acquireSessionLock(lockPath: string): Promise<BackendSessionLock>;
76
+ unlink(filePath: string): Promise<void>;
77
+ rmdir(dirPath: string): Promise<void>;
78
+ join(...paths: string[]): string;
79
+ dirname(filePath: string): string;
80
+ resolve(...paths: string[]): string;
81
+ }
82
+ interface BackendHostAdapter {
83
+ lockMetadata?(input: {
84
+ canonicalPathKey: string;
85
+ canonicalProjectPath: string;
86
+ lockFilePath: string;
87
+ }): unknown;
88
+ }
89
+ interface BackendArtifactBridgeCapability {
90
+ available: false;
91
+ requiredHost: 'node';
92
+ executionBoundary: 'external-bridge';
93
+ bridgeEntrypoint: '@openfairygui/backend/node';
94
+ reason: string;
95
+ }
96
+ interface BackendCapabilityManifest {
97
+ browserSafe: true;
98
+ rootEntrypoint: '@openfairygui/backend';
99
+ nodeEntrypoint: '@openfairygui/backend/node';
100
+ adapters: {
101
+ fileSystem: {
102
+ injected: true;
103
+ requiredFor: readonly ['openSession', 'saveSession', 'materializeSession'];
104
+ };
105
+ projectStorage: {
106
+ injected: true;
107
+ browserSafe: true;
108
+ requiredFor: readonly ['openProjectSession.writeback', 'saveSession', 'materializeSession'];
109
+ adapterFactory: 'createBackendStorageFileSystem';
110
+ };
111
+ host: {
112
+ injected: true;
113
+ requiredFor: readonly ['advisoryLockMetadata'];
114
+ };
115
+ };
116
+ executionBoundaries: {
117
+ projectSession: 'in-process-browser-safe';
118
+ fileBackedSession: 'adapter-backed';
119
+ artifactPublish: BackendArtifactBridgeCapability;
120
+ artifactRestore: BackendArtifactBridgeCapability;
121
+ };
122
+ diagnostics: {
123
+ stableCodes: true;
124
+ errorDiagnosticMirror: true;
125
+ };
126
+ }
127
+ interface BackendCapabilities {
128
+ contractVersion: typeof BACKEND_CONTRACT_VERSION;
129
+ capabilitySchemaVersion: typeof BACKEND_CAPABILITY_SCHEMA_VERSION;
130
+ transactionKernelOwner: '@openfairygui/core';
131
+ appSeamOwner: '@openfairygui/functions';
132
+ runtimeOwner: '@openfairygui/backend';
133
+ methods: readonly ['getCapabilities', 'openSession', 'openProjectSession', 'getSession', 'applyTransaction', 'saveSession', 'materializeSession', 'closeSession', 'getEvents', 'getJob', 'listJobs', 'cancelJob', 'getCacheSnapshot', 'refreshCache'];
134
+ read: {
135
+ capabilitySnapshot: true;
136
+ sessionSnapshot: true;
137
+ };
138
+ authoring: {
139
+ applyTransaction: true;
140
+ saveSession: true;
141
+ resourceKinds: readonly string[];
142
+ nodeKinds: readonly string[];
143
+ gearKinds: readonly string[];
144
+ transactionScope: {
145
+ resourceKinds: readonly string[];
146
+ nodeKinds: readonly string[];
147
+ gearKinds: readonly string[];
148
+ };
149
+ unsupported: readonly ['artifact.publish', 'artifact.restore'];
150
+ };
151
+ artifact: {
152
+ publish: false;
153
+ restore: false;
154
+ status: 'bridge-required';
155
+ publishBridge: BackendArtifactBridgeCapability;
156
+ restoreBridge: BackendArtifactBridgeCapability;
157
+ };
158
+ manifest: BackendCapabilityManifest;
159
+ compatibilityPolicy: typeof BACKEND_COMPATIBILITY_POLICY;
160
+ runtime: {
161
+ sessionRuntime: true;
162
+ advisoryLocking: true;
163
+ coordinatedSave: true;
164
+ atomicSave: false;
165
+ staleRevisionProtection: true;
166
+ pathPolicy: {
167
+ canonicalization: 'realpath+normalized-casefold';
168
+ sessionIdentity: 'project-root';
169
+ saveTarget: 'opened-project-only';
170
+ outputTargets: 'deferred';
171
+ workspaceBoundary: 'project-root-only';
172
+ };
173
+ events: {
174
+ polling: true;
175
+ subscriptions: false;
176
+ retentionLimit: 1000;
177
+ sequenceScope: 'runtime';
178
+ };
179
+ jobs: {
180
+ inMemory: true;
181
+ cooperativeCancel: true;
182
+ persistent: false;
183
+ supportedKinds: readonly ['cache.refresh'];
184
+ artifactJobs: false;
185
+ completedRetentionLimit: 100;
186
+ };
187
+ cache: {
188
+ derivedReadOnly: true;
189
+ keyedBy: 'canonicalPathKey';
190
+ sourceOfTruth: false;
191
+ refreshMethod: 'refreshCache';
192
+ };
193
+ };
194
+ }
195
+ interface BackendSessionSnapshot {
196
+ sessionId: string;
197
+ canonicalProjectPath: string;
198
+ revision: number;
199
+ lastSavedRevision: number;
200
+ dirty: boolean;
201
+ uamFidelity: 'full' | 'unsupported';
202
+ lockHeld: boolean;
203
+ capabilities: BackendCapabilities;
204
+ }
205
+ interface MaterializeSessionSnapshot extends BackendSessionSnapshot {
206
+ mode: 'fullProject';
207
+ reason?: string;
208
+ materializeRevision: number;
209
+ saveRevision: number;
210
+ writtenPaths: string[];
211
+ skippedPaths: string[];
212
+ diagnostics: BackendDiagnostic[];
213
+ }
214
+ interface BackendSuccess<T> {
215
+ ok: true;
216
+ meta: BackendResponseMeta;
217
+ data: T;
218
+ }
219
+ interface BackendFailure<E extends BackendError = BackendError> {
220
+ ok: false;
221
+ meta: BackendResponseMeta;
222
+ error: E;
223
+ session?: BackendSessionSnapshot;
224
+ }
225
+ type BackendResult<T, E extends BackendError = BackendError> = BackendSuccess<T> | BackendFailure<E>;
226
+ interface SessionNotFoundError {
227
+ code: 'session_not_found';
228
+ message: string;
229
+ sessionId: string;
230
+ }
231
+ interface SessionStaleWriteError {
232
+ code: 'stale_write';
233
+ message: string;
234
+ sessionId: string;
235
+ canonicalPathKey: string;
236
+ expectedRevision: number;
237
+ actualRevision: number;
238
+ }
239
+ interface InProcessLockConflictError {
240
+ code: 'lock_conflict';
241
+ kind: 'in_process_session_exists';
242
+ message: string;
243
+ canonicalPathKey: string;
244
+ holderSessionId: string;
245
+ lockFilePath?: string;
246
+ }
247
+ interface AdvisoryLockConflictError {
248
+ code: 'lock_conflict';
249
+ kind: 'advisory_lock_conflict';
250
+ message: string;
251
+ canonicalPathKey: string;
252
+ holderSessionId?: string;
253
+ lockFilePath: string;
254
+ }
255
+ interface SavePartialFailureError {
256
+ code: 'save_partial_failure';
257
+ message: string;
258
+ sessionId: string;
259
+ canonicalPathKey: string;
260
+ attemptedRevision: number;
261
+ lastSavedRevision: number;
262
+ committedPaths: string[];
263
+ failedPaths: string[];
264
+ diskMayBePartiallyUpdated: true;
265
+ }
266
+ interface UamFidelityUnsupportedError {
267
+ code: 'uam_fidelity_unsupported';
268
+ message: string;
269
+ sessionId: string;
270
+ canonicalPathKey: string;
271
+ }
272
+ interface MaterializeValidationFailedError {
273
+ code: 'materialize_validation_failed';
274
+ message: string;
275
+ sessionId: string;
276
+ canonicalPathKey: string;
277
+ issueCount: number;
278
+ diagnostics: BackendDiagnostic[];
279
+ }
280
+ interface MaterializeWriteFailedError {
281
+ code: 'write_failed';
282
+ message: string;
283
+ sessionId: string;
284
+ canonicalPathKey: string;
285
+ attemptedRevision: number;
286
+ lastSavedRevision: number;
287
+ writtenPaths: string[];
288
+ failedPaths: string[];
289
+ skippedPaths: string[];
290
+ diagnostics: BackendDiagnostic[];
291
+ diskMayBePartiallyUpdated: true;
292
+ }
293
+ type BackendEventKind = 'session.opened' | 'transaction.applied' | 'transaction.rejected' | 'save.started' | 'save.completed' | 'save.failed' | 'session.closeRequested' | 'session.closed' | 'cache.invalidated' | 'cache.updated' | 'job.created' | 'job.started' | 'job.progress' | 'job.cancelRequested' | 'job.cancelled' | 'job.completed' | 'job.failed';
294
+ interface BackendEvent {
295
+ sequence: number;
296
+ kind: BackendEventKind;
297
+ timestamp: string;
298
+ sessionId?: string;
299
+ canonicalPathKey?: string;
300
+ revision?: number;
301
+ cacheRevision?: number;
302
+ jobId?: string;
303
+ diagnostics: BackendDiagnostic[];
304
+ payload?: unknown;
305
+ }
306
+ interface GetEventsInput {
307
+ sessionId: string;
308
+ after?: string;
309
+ limit?: number;
310
+ }
311
+ interface GetEventsSnapshot {
312
+ events: BackendEvent[];
313
+ oldestSequence: number;
314
+ currentSequence: number;
315
+ cursorExpired: boolean;
316
+ }
317
+ interface EventCursorInvalidError {
318
+ code: 'event_cursor_invalid';
319
+ message: string;
320
+ sessionId: string;
321
+ after: string;
322
+ }
323
+ type BackendJobStatus = 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
324
+ type BackendJobKind = 'cache.refresh';
325
+ type BackendJobListStatusFilter = BackendJobStatus | 'active' | 'terminal';
326
+ interface BackendJobProgress {
327
+ completed: number;
328
+ total?: number;
329
+ message?: string;
330
+ }
331
+ interface BackendJobSnapshot {
332
+ jobId: string;
333
+ kind: BackendJobKind;
334
+ status: BackendJobStatus;
335
+ createdAt: string;
336
+ startedAt?: string;
337
+ finishedAt?: string;
338
+ sessionId?: string;
339
+ canonicalPathKey?: string;
340
+ revision?: number;
341
+ cacheRevision?: number;
342
+ diagnostics: BackendDiagnostic[];
343
+ progress?: BackendJobProgress;
344
+ result?: unknown;
345
+ error?: BackendError;
346
+ }
347
+ interface BackendJobListSnapshot {
348
+ jobs: BackendJobSnapshot[];
349
+ }
350
+ interface GetJobInput {
351
+ sessionId: string;
352
+ jobId: string;
353
+ }
354
+ interface ListJobsInput {
355
+ sessionId: string;
356
+ status?: BackendJobListStatusFilter;
357
+ kind?: BackendJobKind;
358
+ limit?: number;
359
+ }
360
+ interface CancelJobInput {
361
+ sessionId: string;
362
+ jobId: string;
363
+ }
364
+ interface BackendJobNotFoundError {
365
+ code: 'job_not_found';
366
+ message: string;
367
+ sessionId: string;
368
+ jobId: string;
369
+ }
370
+ interface BackendJobNotCancellableError {
371
+ code: 'job_not_cancellable';
372
+ message: string;
373
+ sessionId: string;
374
+ jobId: string;
375
+ status: 'completed' | 'failed' | 'cancelled';
376
+ }
377
+ interface BackendJobCancelledError {
378
+ code: 'job_cancelled';
379
+ message: string;
380
+ sessionId: string;
381
+ jobId: string;
382
+ }
383
+ interface CacheRefreshFailedError {
384
+ code: 'cache_refresh_failed';
385
+ message: string;
386
+ sessionId: string;
387
+ jobId: string;
388
+ causeCode?: string;
389
+ }
390
+ interface BackendCapabilityUnavailableError {
391
+ code: 'capability_unavailable';
392
+ message: string;
393
+ capability: 'fileSystem' | 'artifact.publish' | 'artifact.restore';
394
+ requiredAdapter?: 'BackendFileSystem';
395
+ requiredHost?: 'node';
396
+ bridgeBoundary?: 'external-bridge';
397
+ }
398
+ type BackendJobErrors = BackendJobNotFoundError | BackendJobNotCancellableError | BackendJobCancelledError | CacheRefreshFailedError;
399
+ interface BackendCacheSnapshot {
400
+ cacheRevision: number;
401
+ entries: BackendCacheEntry[];
402
+ }
403
+ interface BackendCacheEntry {
404
+ canonicalPathKey: string;
405
+ sessionId?: string;
406
+ revision: number;
407
+ lastSavedRevision: number;
408
+ dirty: boolean;
409
+ valid: boolean;
410
+ indexedAt: string;
411
+ summary: {
412
+ resourceCount: number;
413
+ packageCount?: number;
414
+ diagnostics: BackendDiagnostic[];
415
+ };
416
+ }
417
+ interface GetCacheSnapshotInput {
418
+ sessionId: string;
419
+ }
420
+ interface RefreshCacheInput {
421
+ sessionId: string;
422
+ reason?: 'manual' | 'session_open' | 'after_save';
423
+ }
424
+ type BackendError = SessionNotFoundError | SessionStaleWriteError | InProcessLockConflictError | AdvisoryLockConflictError | SavePartialFailureError | UamFidelityUnsupportedError | MaterializeValidationFailedError | MaterializeWriteFailedError | PathPolicyViolationError | EventCursorInvalidError | BackendJobNotFoundError | BackendJobNotCancellableError | BackendJobCancelledError | CacheRefreshFailedError | BackendCapabilityUnavailableError | ApplyUamTransactionAppError;
425
+ interface ApplySessionTransactionInput {
426
+ sessionId: string;
427
+ expectedRevision: number;
428
+ operations: UamTransactionOperation[];
429
+ }
430
+ interface OpenProjectSessionInput {
431
+ /** Authoritative UAM project. Use BackendRuntime.openSession() when importing an existing project from storage. */
432
+ project: UamProject;
433
+ sessionId?: string;
434
+ canonicalProjectPath?: string;
435
+ canonicalPathKey?: string;
436
+ /** Optional writeback target for the authoritative UAM project; this is not an import source. */
437
+ storage?: BackendProjectSessionStorage;
438
+ }
439
+ interface BackendProjectSessionStorage {
440
+ fileSystem: BackendFileSystem;
441
+ fairyPath: string;
442
+ canonicalProjectPath?: string;
443
+ canonicalPathKey?: string;
444
+ }
445
+ interface SaveSessionInput {
446
+ sessionId: string;
447
+ expectedRevision?: number;
448
+ targetPath?: string;
449
+ fileSystem?: BackendFileSystem;
450
+ force?: boolean;
451
+ mode?: 'materializeCleanSession';
452
+ }
453
+ interface MaterializeSessionInput {
454
+ sessionId: string;
455
+ expectedRevision?: number;
456
+ storage?: BackendProjectSessionStorage;
457
+ targetPath?: string;
458
+ fileSystem?: BackendFileSystem;
459
+ mode?: 'fullProject';
460
+ reason?: string;
461
+ }
462
+ interface BackendRuntimeOptions {
463
+ fileSystem?: BackendFileSystem;
464
+ host?: BackendHostAdapter;
465
+ }
466
+ //#endregion
467
+ //#region src/runtime.d.ts
468
+ declare class BackendRuntime {
469
+ private readonly fileSystem?;
470
+ private readonly capabilities;
471
+ private readonly sessions;
472
+ private readonly sessionsByPath;
473
+ private readonly eventsBySession;
474
+ private readonly jobsBySession;
475
+ private readonly cacheBySession;
476
+ private eventSequence;
477
+ private readonly context;
478
+ private readonly readService;
479
+ private readonly runtimeService;
480
+ private readonly authoringService;
481
+ private readonly cacheService;
482
+ private readonly eventService;
483
+ private readonly jobService;
484
+ constructor(options?: BackendRuntimeOptions);
485
+ getCapabilities(): BackendSuccess<BackendCapabilities>;
486
+ openSession(input: {
487
+ projectPath: string;
488
+ }): Promise<BackendResult<BackendSessionSnapshot, InProcessLockConflictError | AdvisoryLockConflictError | BackendCapabilityUnavailableError>>;
489
+ openProjectSession(input: OpenProjectSessionInput): BackendResult<BackendSessionSnapshot>;
490
+ getSession(input: {
491
+ sessionId: string;
492
+ }): BackendResult<BackendSessionSnapshot, SessionNotFoundError>;
493
+ applyTransaction(input: ApplySessionTransactionInput): Promise<BackendResult<BackendSessionSnapshot, SessionNotFoundError | SessionStaleWriteError | ApplyUamTransactionAppError>>;
494
+ saveSession(input: SaveSessionInput): Promise<BackendResult<BackendSessionSnapshot | MaterializeSessionSnapshot, SessionNotFoundError | SessionStaleWriteError | SavePartialFailureError | UamFidelityUnsupportedError | MaterializeValidationFailedError | MaterializeWriteFailedError | PathPolicyViolationError | InProcessLockConflictError | BackendCapabilityUnavailableError>>;
495
+ materializeSession(input: MaterializeSessionInput): Promise<BackendResult<MaterializeSessionSnapshot, SessionNotFoundError | SessionStaleWriteError | UamFidelityUnsupportedError | MaterializeValidationFailedError | MaterializeWriteFailedError | PathPolicyViolationError | InProcessLockConflictError | BackendCapabilityUnavailableError>>;
496
+ closeSession(input: {
497
+ sessionId: string;
498
+ }): Promise<BackendResult<{
499
+ sessionId: string;
500
+ closed: true;
501
+ }, SessionNotFoundError>>;
502
+ getEvents(input: GetEventsInput): BackendResult<GetEventsSnapshot, SessionNotFoundError | EventCursorInvalidError>;
503
+ getJob(input: GetJobInput): BackendResult<BackendJobSnapshot, SessionNotFoundError | BackendJobNotFoundError>;
504
+ listJobs(input: ListJobsInput): BackendResult<BackendJobListSnapshot, SessionNotFoundError>;
505
+ cancelJob(input: CancelJobInput): BackendResult<BackendJobSnapshot, SessionNotFoundError | BackendJobNotFoundError | BackendJobNotCancellableError>;
506
+ getCacheSnapshot(input: GetCacheSnapshotInput): BackendResult<BackendCacheSnapshot, SessionNotFoundError>;
507
+ refreshCache(input: RefreshCacheInput): BackendResult<BackendJobSnapshot, SessionNotFoundError>;
508
+ }
509
+ //#endregion
4
510
  //#region src/storage.d.ts
5
511
  type StorageStatKind = 'file' | 'directory';
6
512
  interface BackendStorageStatLike {
@@ -20,9 +526,15 @@ interface BackendAsyncStorageAdapter {
20
526
  readdir(dirPath: string): Promise<string[]>;
21
527
  exists?(filePath: string): Promise<boolean>;
22
528
  stat?(filePath: string): Promise<BackendStorageStatLike>;
529
+ /** Stable cross-context path identity; also scopes the default Web Lock name. */
23
530
  resolvePath?(filePath: string): Promise<string>;
24
- openExclusive?(filePath: string): Promise<BackendFileHandle>;
25
- unlink?(filePath: string): Promise<void>;
531
+ /**
532
+ * Optional replacement for Web Locks. Acquisition must be atomic across browser contexts, remain held
533
+ * until release(), and recover automatically when the owning document terminates.
534
+ */
535
+ acquireSessionLock?(lockPath: string): Promise<BackendSessionLock>;
536
+ unlink(filePath: string): Promise<void>;
537
+ rmdir(dirPath: string): Promise<void>;
26
538
  join?(...paths: string[]): string;
27
539
  dirname?(filePath: string): string;
28
540
  resolve?(...paths: string[]): string;
@@ -30,4 +542,4 @@ interface BackendAsyncStorageAdapter {
30
542
  type BackendStorageFileSystem = BackendFileSystem & FileSystem;
31
543
  declare function createBackendStorageFileSystem(storage: BackendAsyncStorageAdapter): BackendStorageFileSystem;
32
544
  //#endregion
33
- export { type AdvisoryLockConflictError, type ApplySessionTransactionInput, BACKEND_CAPABILITY_SCHEMA_VERSION, BACKEND_COMPATIBILITY_POLICY, BACKEND_CONTRACT_VERSION, type BackendArtifactBridgeCapability, type BackendAsyncStorageAdapter, type BackendCacheEntry, type BackendCacheSnapshot, type BackendCapabilities, type BackendCapabilityManifest, type BackendCapabilityUnavailableError, type BackendDiagnostic, type BackendError, type BackendEvent, type BackendEventKind, type BackendFailure, type BackendFileHandle, type BackendFileStat, type BackendFileSystem, type BackendHostAdapter, type BackendJobErrors, type BackendJobKind, type BackendJobListSnapshot, type BackendJobListStatusFilter, type BackendJobNotCancellableError, type BackendJobNotFoundError, type BackendJobProgress, type BackendJobSnapshot, type BackendJobStatus, type BackendMessage, type BackendProjectSessionStorage, type BackendResponseMeta, type BackendResult, BackendRuntime, type BackendRuntimeOptions, type BackendSessionSnapshot, type BackendStage, type BackendStorageFileSystem, type BackendStorageStatLike, type BackendSuccess, type CacheRefreshFailedError, type CancelJobInput, type EventCursorInvalidError, type GetCacheSnapshotInput, type GetEventsInput, type GetEventsSnapshot, type GetJobInput, type InProcessLockConflictError, type ListJobsInput, type MaterializeSessionInput, type MaterializeSessionSnapshot, type MaterializeValidationFailedError, type MaterializeWriteFailedError, type OpenProjectSessionInput, type RefreshCacheInput, type SavePartialFailureError, type SaveSessionInput, type SessionNotFoundError, type SessionStaleWriteError, createBackendStorageFileSystem };
545
+ export { type AdvisoryLockConflictError, type ApplySessionTransactionInput, BACKEND_CAPABILITY_SCHEMA_VERSION, BACKEND_COMPATIBILITY_POLICY, BACKEND_CONTRACT_VERSION, type BackendArtifactBridgeCapability, type BackendAsyncStorageAdapter, type BackendCacheEntry, type BackendCacheSnapshot, type BackendCapabilities, type BackendCapabilityManifest, type BackendCapabilityUnavailableError, type BackendDiagnostic, type BackendError, type BackendEvent, type BackendEventKind, type BackendFailure, type BackendFileStat, type BackendFileSystem, type BackendHostAdapter, type BackendJobErrors, type BackendJobKind, type BackendJobListSnapshot, type BackendJobListStatusFilter, type BackendJobNotCancellableError, type BackendJobNotFoundError, type BackendJobProgress, type BackendJobSnapshot, type BackendJobStatus, type BackendMessage, type BackendProjectSessionStorage, type BackendResponseMeta, type BackendResult, BackendRuntime, type BackendRuntimeOptions, type BackendSessionLock, type BackendSessionSnapshot, type BackendStage, type BackendStorageFileSystem, type BackendStorageStatLike, type BackendSuccess, type CacheRefreshFailedError, type CancelJobInput, type EventCursorInvalidError, type GetCacheSnapshotInput, type GetEventsInput, type GetEventsSnapshot, type GetJobInput, type InProcessLockConflictError, type ListJobsInput, type MaterializeSessionInput, type MaterializeSessionSnapshot, type MaterializeValidationFailedError, type MaterializeWriteFailedError, type OpenProjectSessionInput, type RefreshCacheInput, type SavePartialFailureError, type SaveSessionInput, type SessionNotFoundError, type SessionStaleWriteError, type UamFidelityUnsupportedError, createBackendStorageFileSystem };