@hraness/sponge 0.2.6 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -9
- package/bin/sponge.js +8 -7
- package/dist/contracts/index.js +24 -6
- package/dist/contracts/validate.js +106 -29
- package/dist/migrations/008.d.ts +3 -0
- package/dist/migrations/008.js +5 -0
- package/dist/migrations/009.d.ts +3 -0
- package/dist/migrations/009.js +8 -0
- package/dist/migrations/010.d.ts +3 -0
- package/dist/migrations/010.js +11 -0
- package/dist/migrations/index.d.ts +15 -0
- package/dist/migrations/index.js +39 -0
- package/dist/src/acquisition/capture.js +87 -28
- package/dist/src/acquisition/cleanup.d.ts +0 -4
- package/dist/src/acquisition/cleanup.js +3 -5
- package/dist/src/acquisition/errors.js +17 -2
- package/dist/src/acquisition/files.d.ts +0 -1
- package/dist/src/acquisition/files.js +14 -11
- package/dist/src/acquisition/index.d.ts +2 -3
- package/dist/src/acquisition/index.js +1 -2
- package/dist/src/acquisition/lock.js +1 -1
- package/dist/src/acquisition/normalize.js +57 -18
- package/dist/src/acquisition/pins.js +22 -4
- package/dist/src/acquisition/process.js +67 -29
- package/dist/src/acquisition/runtime.d.ts +5 -7
- package/dist/src/acquisition/runtime.js +129 -68
- package/dist/src/acquisition/verify-helper.js +10 -3
- package/dist/src/annotations/quote.js +40 -12
- package/dist/src/annotations/store.d.ts +0 -1
- package/dist/src/annotations/store.js +66 -14
- package/dist/src/app/article.d.ts +2 -1
- package/dist/src/app/article.js +66 -70
- package/dist/src/app/bundle-files.d.ts +0 -4
- package/dist/src/app/bundle-files.js +11 -14
- package/dist/src/app/markdown.js +18 -6
- package/dist/src/app/source.d.ts +0 -4
- package/dist/src/app/source.js +18 -14
- package/dist/src/cli/arguments.d.ts +2 -8
- package/dist/src/cli/arguments.js +67 -80
- package/dist/src/cli/commands.d.ts +42 -0
- package/dist/src/cli/commands.js +795 -0
- package/dist/src/cli/config.js +12 -9
- package/dist/src/cli/digest.d.ts +1 -1
- package/dist/src/cli/digest.js +38 -16
- package/dist/src/cli/import.js +25 -4
- package/dist/src/cli/indexing.d.ts +2 -0
- package/dist/src/cli/indexing.js +26 -9
- package/dist/src/cli/main.js +47 -386
- package/dist/src/cli/portability.d.ts +0 -2
- package/dist/src/cli/portability.js +13 -8
- package/dist/src/cli/queue.js +12 -8
- package/dist/src/cli/runtimes.d.ts +1 -3
- package/dist/src/cli/runtimes.js +13 -6
- package/dist/src/cli/terminal.js +1 -1
- package/dist/src/cli/worker.d.ts +7 -0
- package/dist/src/cli/worker.js +54 -15
- package/dist/src/derivations/kinds.d.ts +34 -0
- package/dist/src/derivations/kinds.js +14 -0
- package/dist/src/derivations/types.d.ts +48 -0
- package/dist/src/derivations/types.js +1 -0
- package/dist/src/digest/derivation.d.ts +25 -0
- package/dist/src/digest/derivation.js +124 -0
- package/dist/src/digest/editorial.d.ts +9 -46
- package/dist/src/digest/editorial.js +57 -49
- package/dist/src/digest/endpoint.js +63 -27
- package/dist/src/digest/pipeline.d.ts +49 -28
- package/dist/src/digest/pipeline.js +369 -102
- package/dist/src/digest/schema.d.ts +11 -25
- package/dist/src/digest/schema.js +86 -18
- package/dist/src/errors.d.ts +46 -0
- package/dist/src/errors.js +117 -0
- package/dist/src/identity/query-policy.d.ts +0 -5
- package/dist/src/identity/query-policy.js +61 -9
- package/dist/src/identity/uri.d.ts +6 -5
- package/dist/src/identity/uri.js +37 -18
- package/dist/src/identity/visibility.d.ts +11 -1
- package/dist/src/identity/visibility.js +81 -17
- package/dist/src/importers/apply.js +104 -36
- package/dist/src/importers/custody.js +27 -9
- package/dist/src/importers/inspect.js +125 -38
- package/dist/src/importers/jungle-digest.d.ts +3 -6
- package/dist/src/importers/jungle-digest.js +196 -69
- package/dist/src/importers/jungle-store.d.ts +19 -6
- package/dist/src/importers/jungle-store.js +124 -28
- package/dist/src/importers/jungle.d.ts +14 -14
- package/dist/src/importers/jungle.js +142 -31
- package/dist/src/importers/manifest.js +57 -21
- package/dist/src/importers/verify-helper.js +18 -4
- package/dist/src/indexing/image.js +29 -10
- package/dist/src/indexing/index.d.ts +37 -6
- package/dist/src/indexing/index.js +360 -124
- package/dist/src/indexing/jobs.js +156 -47
- package/dist/src/indexing/prune-run.d.ts +2 -0
- package/dist/src/indexing/prune-run.js +69 -26
- package/dist/src/indexing/prune.d.ts +12 -3
- package/dist/src/indexing/prune.js +85 -35
- package/dist/src/indexing/runner.d.ts +2 -1
- package/dist/src/indexing/runner.js +83 -40
- package/dist/src/indexing/upgrade.d.ts +9 -0
- package/dist/src/indexing/upgrade.js +79 -0
- package/dist/src/inference/asr/bridge.js +6 -2
- package/dist/src/inference/asr/protocol.js +109 -19
- package/dist/src/inference/asr/runtime.js +58 -21
- package/dist/src/inference/asr/windows.js +9 -5
- package/dist/src/inference/embedding/index.d.ts +2 -6
- package/dist/src/inference/embedding/index.js +89 -29
- package/dist/src/ingest/attempt.d.ts +29 -0
- package/dist/src/ingest/attempt.js +55 -0
- package/dist/src/media/capture-helper.js +7 -2
- package/dist/src/media/capture.d.ts +2 -1
- package/dist/src/media/capture.js +124 -43
- package/dist/src/media/handler.d.ts +4 -2
- package/dist/src/media/handler.js +88 -70
- package/dist/src/media/transcribe.js +63 -21
- package/dist/src/metadata/article.js +49 -17
- package/dist/src/models/artifacts.d.ts +10 -8
- package/dist/src/models/artifacts.js +237 -106
- package/dist/src/models/catalog.d.ts +2 -5
- package/dist/src/models/catalog.js +94 -25
- package/dist/src/models/download.js +55 -15
- package/dist/src/models/runtime.d.ts +0 -2
- package/dist/src/models/runtime.js +69 -33
- package/dist/src/pdf/capture-helper.js +3 -1
- package/dist/src/pdf/capture.d.ts +2 -1
- package/dist/src/pdf/capture.js +95 -27
- package/dist/src/pdf/errors.js +12 -1
- package/dist/src/pdf/handler.d.ts +2 -1
- package/dist/src/pdf/handler.js +70 -71
- package/dist/src/pdf/index.d.ts +1 -3
- package/dist/src/pdf/index.js +0 -2
- package/dist/src/pdf/input.js +12 -7
- package/dist/src/pdf/normalize.js +80 -21
- package/dist/src/pdf/source-identity.js +3 -2
- package/dist/src/pdf/source.js +12 -8
- package/dist/src/pdf/verify-helper.js +15 -3
- package/dist/src/portability/backup.d.ts +2 -9
- package/dist/src/portability/backup.js +106 -22
- package/dist/src/portability/database.js +51 -17
- package/dist/src/portability/export.js +35 -9
- package/dist/src/portability/files.d.ts +1 -4
- package/dist/src/portability/files.js +127 -67
- package/dist/src/portability/gc.js +65 -22
- package/dist/src/publish/component.js +1 -1
- package/dist/src/publish/feed.d.ts +2 -2
- package/dist/src/publish/feed.js +75 -29
- package/dist/src/publish/identity.d.ts +5 -1
- package/dist/src/publish/identity.js +31 -11
- package/dist/src/publish/index.d.ts +2 -3
- package/dist/src/publish/index.js +34 -21
- package/dist/src/publish/projection.d.ts +2 -9
- package/dist/src/publish/projection.js +21 -14
- package/dist/src/search/extension.js +3 -1
- package/dist/src/search/hybrid.d.ts +3 -8
- package/dist/src/search/hybrid.js +45 -11
- package/dist/src/search/lexical.js +18 -4
- package/dist/src/search/query.js +56 -25
- package/dist/src/search/vector.js +37 -10
- package/dist/src/service/launch-agent.d.ts +5 -3
- package/dist/src/service/launch-agent.js +272 -83
- package/dist/src/service/lifetime.js +47 -14
- package/dist/src/service/loop.d.ts +3 -3
- package/dist/src/service/loop.js +47 -19
- package/dist/src/store/annotations.d.ts +32 -0
- package/dist/src/store/annotations.js +44 -0
- package/dist/src/store/backups.d.ts +18 -0
- package/dist/src/store/backups.js +110 -0
- package/dist/src/store/blobs.d.ts +24 -0
- package/dist/src/store/blobs.js +139 -0
- package/dist/src/store/changes.d.ts +5 -12
- package/dist/src/store/changes.js +108 -56
- package/dist/src/store/context.d.ts +15 -0
- package/dist/src/store/context.js +19 -0
- package/dist/src/store/derivations.d.ts +42 -0
- package/dist/src/store/derivations.js +104 -0
- package/dist/src/store/files.d.ts +0 -2
- package/dist/src/store/files.js +19 -24
- package/dist/src/store/ids.d.ts +30 -0
- package/dist/src/store/ids.js +34 -0
- package/dist/src/store/imports.d.ts +26 -0
- package/dist/src/store/imports.js +57 -0
- package/dist/src/store/index.d.ts +3 -186
- package/dist/src/store/index.js +2 -809
- package/dist/src/store/lease.d.ts +20 -0
- package/dist/src/store/lease.js +62 -0
- package/dist/src/store/library.d.ts +75 -0
- package/dist/src/store/library.js +174 -0
- package/dist/src/store/open.d.ts +7 -0
- package/dist/src/store/open.js +183 -0
- package/dist/src/store/queue.d.ts +65 -0
- package/dist/src/store/queue.js +327 -0
- package/dist/src/store/revisions.d.ts +12 -0
- package/dist/src/store/revisions.js +189 -0
- package/dist/src/store/search-index.d.ts +63 -0
- package/dist/src/store/search-index.js +190 -0
- package/dist/src/store/sync-ready.d.ts +6 -0
- package/dist/src/store/sync-ready.js +121 -0
- package/dist/src/store/types.d.ts +1 -5
- package/dist/src/store/types.js +1 -8
- package/dist/src/util/canonical.d.ts +2 -0
- package/dist/src/util/canonical.js +17 -0
- package/dist/src/util/exact.d.ts +2 -0
- package/dist/src/util/exact.js +9 -0
- package/dist/src/util/fsync.d.ts +4 -0
- package/dist/src/util/fsync.js +22 -0
- package/dist/src/util/hash.d.ts +4 -0
- package/dist/src/util/hash.js +8 -0
- package/dist/src/worker/basic.d.ts +0 -1
- package/dist/src/worker/basic.js +23 -7
- package/dist/src/worker/custody.d.ts +4 -1
- package/dist/src/worker/custody.js +111 -38
- package/dist/src/worker/engine.d.ts +2 -1
- package/dist/src/worker/engine.js +42 -20
- package/dist/src/worker/identity.js +13 -5
- package/dist/src/worker/journal.d.ts +1 -1
- package/dist/src/worker/journal.js +54 -24
- package/dist/src/worker/lock.d.ts +18 -0
- package/dist/src/worker/lock.js +196 -0
- package/dist/src/worker/runtime-gc.d.ts +4 -3
- package/dist/src/worker/runtime-gc.js +68 -41
- package/dist/src/worker/supervisor-child.js +19 -6
- package/dist/src/worker/supervisor.js +41 -8
- package/native/runtime-manifest.json +4 -4
- package/package.json +10 -2
- package/dist/src/digest/store.d.ts +0 -57
- package/dist/src/digest/store.js +0 -79
- package/dist/src/store/foundation.d.ts +0 -7
- package/dist/src/store/foundation.js +0 -7
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as jungle from '../importers/jungle-store.js';
|
|
2
|
+
import { hash, text } from './files.js';
|
|
3
|
+
import { transaction } from './context.js';
|
|
4
|
+
import { SpongeError } from '../errors.js';
|
|
5
|
+
/** The receipt an importer left for exactly this source state, if any. */
|
|
6
|
+
export function importReceipt(db, namespace, sourceKey, sourceHash) {
|
|
7
|
+
text(namespace, 256);
|
|
8
|
+
text(sourceKey, 8192);
|
|
9
|
+
hash(sourceHash);
|
|
10
|
+
const row = db
|
|
11
|
+
.prepare('SELECT item_id itemId,outcome FROM import_receipts WHERE namespace=? AND source_key=? AND source_hash=?')
|
|
12
|
+
.get(namespace, sourceKey, sourceHash);
|
|
13
|
+
return row ? { itemId: String(row.itemId), outcome: String(row.outcome) } : null;
|
|
14
|
+
}
|
|
15
|
+
/** What importers read and write: their realm's items and revisions, their receipts, and Jungle Reading notes. */
|
|
16
|
+
export class Imports {
|
|
17
|
+
c;
|
|
18
|
+
constructor(c) {
|
|
19
|
+
this.c = c;
|
|
20
|
+
}
|
|
21
|
+
/** The item an importer realm holds for one source key, with its current revision; deleted items are reported, not hidden. */
|
|
22
|
+
item(realm, sourceKey) {
|
|
23
|
+
text(realm, 256);
|
|
24
|
+
text(sourceKey, 8192);
|
|
25
|
+
const r = this.c.db
|
|
26
|
+
.prepare('SELECT i.id,i.deleted_at,i.current_revision FROM source_refs s JOIN items i ON i.id=s.item_id WHERE s.source_key=? AND s.realm_key=?')
|
|
27
|
+
.get(sourceKey, realm);
|
|
28
|
+
return r
|
|
29
|
+
? {
|
|
30
|
+
itemId: String(r.id),
|
|
31
|
+
deleted: r.deleted_at !== null,
|
|
32
|
+
revisionId: r.current_revision === null ? null : String(r.current_revision),
|
|
33
|
+
}
|
|
34
|
+
: null;
|
|
35
|
+
}
|
|
36
|
+
revision(itemId, bundleHash) {
|
|
37
|
+
text(itemId, 256);
|
|
38
|
+
hash(bundleHash);
|
|
39
|
+
const r = this.c.db.prepare('SELECT id FROM revisions WHERE item_id=? AND bundle_hash=?').get(itemId, bundleHash);
|
|
40
|
+
if (!r)
|
|
41
|
+
throw new SpongeError('unavailable');
|
|
42
|
+
return String(r.id);
|
|
43
|
+
}
|
|
44
|
+
receipt(namespace, sourceKey, sourceHash) {
|
|
45
|
+
return importReceipt(this.c.db, namespace, sourceKey, sourceHash);
|
|
46
|
+
}
|
|
47
|
+
planJungleNote(input) {
|
|
48
|
+
text(input.itemId, 256);
|
|
49
|
+
text(input.revisionId, 256);
|
|
50
|
+
return jungle.planJungleNote(this.c.db, input);
|
|
51
|
+
}
|
|
52
|
+
applyJungleNote(input) {
|
|
53
|
+
text(input.itemId, 256);
|
|
54
|
+
text(input.revisionId, 256);
|
|
55
|
+
return transaction(this.c.db, () => jungle.applyJungleNote(this.c.db, input));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -1,187 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { JobCheckpoint } from '../../contracts/index.js';
|
|
5
|
-
import { type AttemptToken, type OwnedAttempt, type BlobReference, type CommitRevision, type OwnerToken, type ReadableItem, type SourceSubmission, type StoreOptions, type Submission } from './types.js';
|
|
6
|
-
import * as indexing from '../indexing/index.js';
|
|
7
|
-
import * as prune from '../indexing/prune.js';
|
|
8
|
-
import { hybridSearch } from '../search/hybrid.js';
|
|
1
|
+
export { LibraryStore } from './library.js';
|
|
2
|
+
export { openLibrary, keptSchemaBackups, libraryVersion } from './open.js';
|
|
3
|
+
export type { RetryOptions, JobKind } from './queue.js';
|
|
9
4
|
export * from './types.js';
|
|
10
|
-
export declare const libraryVersion = 7;
|
|
11
|
-
export declare const libraryMigrations: readonly string[];
|
|
12
|
-
type Row = Record<string, any>;
|
|
13
|
-
export declare function openLibrary(path: string, options?: StoreOptions): Promise<LibraryStore>;
|
|
14
|
-
/** Storage CAS authority only. The worker separately establishes OS/process custody. */
|
|
15
|
-
export declare class LibraryStore {
|
|
16
|
-
readonly root: string;
|
|
17
|
-
private readonly db;
|
|
18
|
-
private readonly options;
|
|
19
|
-
private closed;
|
|
20
|
-
constructor(root: string, db: DatabaseSync, options: StoreOptions);
|
|
21
|
-
createIndexGeneration(options: Parameters<typeof indexing.createGeneration>[1]): indexing.GenerationStatus;
|
|
22
|
-
submitIndexJob(generationId: string): string;
|
|
23
|
-
indexJob(id: string): Record<string, import("node:sqlite").SQLOutputValue> | undefined;
|
|
24
|
-
claimIndexJob(owner: OwnerToken, id?: string): AttemptToken | null;
|
|
25
|
-
checkpointIndexAttempt(token: AttemptToken, stage: string): void;
|
|
26
|
-
writeIndexAttemptBatch(token: AttemptToken, fingerprint: string, batch: Parameters<typeof indexing.writeBatch>[3]): void;
|
|
27
|
-
completeIndexAttempt(token: AttemptToken): indexing.GenerationStatus;
|
|
28
|
-
failIndexAttempt(token: AttemptToken, reason: string): void;
|
|
29
|
-
settleIndexAttempt(token: AttemptToken): void;
|
|
30
|
-
private checkIndexStaging;
|
|
31
|
-
indexStatus(id: string): indexing.GenerationStatus;
|
|
32
|
-
indexInputs(id: string, limit?: number): indexing.IndexInput[];
|
|
33
|
-
writeIndexBatch(id: string, fingerprint: string, batch: Parameters<typeof indexing.writeBatch>[3]): void;
|
|
34
|
-
activateIndex(id: string): indexing.GenerationStatus;
|
|
35
|
-
cancelIndex(id: string): void;
|
|
36
|
-
/** Retired-generation pruning; see src/indexing/prune.ts. The plan probes rollback inside a rolled-back savepoint. */
|
|
37
|
-
pruneIndexPlan(keep: number): {
|
|
38
|
-
generations: prune.PruneEntry[];
|
|
39
|
-
stats: prune.PageStats;
|
|
40
|
-
};
|
|
41
|
-
pruneIndexStep(owner: OwnerToken, id: string, keep: number): number;
|
|
42
|
-
/** VACUUM cannot run in a transaction: fences are checked under the owner token immediately before it. */
|
|
43
|
-
vacuumLibrary(owner: OwnerToken): prune.PageStats;
|
|
44
|
-
searchHybrid(query: string, options?: Parameters<typeof hybridSearch>[2]): Promise<import("../search/hybrid.js").SearchResult>;
|
|
45
|
-
/** Export's view: the one annotation reader, without the redundant item id, plus reading state. */
|
|
46
|
-
readAnnotations(itemId: string): {
|
|
47
|
-
annotations: {
|
|
48
|
-
id: string;
|
|
49
|
-
kind: "note" | "highlight" | "comment";
|
|
50
|
-
revisionId: string | null;
|
|
51
|
-
parentId: string | null;
|
|
52
|
-
anchor: unknown;
|
|
53
|
-
body: string;
|
|
54
|
-
createdAt: string;
|
|
55
|
-
updatedAt: string | null;
|
|
56
|
-
anchored?: boolean;
|
|
57
|
-
}[];
|
|
58
|
-
readingState: {
|
|
59
|
-
state: unknown;
|
|
60
|
-
updatedAt: string;
|
|
61
|
-
} | null;
|
|
62
|
-
};
|
|
63
|
-
/** Sync and publishing foundation; see docs/decisions/sync-and-publishing.md. */
|
|
64
|
-
identity(itemId: string): {
|
|
65
|
-
uris: import("../identity/uri.js").ItemUri[];
|
|
66
|
-
visibility: foundation.VisibilityState;
|
|
67
|
-
};
|
|
68
|
-
itemsForUri(uri: string): string[];
|
|
69
|
-
setVisibility(itemId: string, value: foundation.Visibility | null): foundation.VisibilityState;
|
|
70
|
-
addHighlight(input: Parameters<typeof foundation.addHighlight>[1]): foundation.Annotation;
|
|
71
|
-
addComment(input: Parameters<typeof foundation.addComment>[1]): foundation.Annotation;
|
|
72
|
-
updateAnnotation(id: string, body: string): foundation.Annotation;
|
|
73
|
-
deleteAnnotation(id: string): void;
|
|
74
|
-
listAnnotations(itemId: string): (foundation.Annotation & {
|
|
75
|
-
anchored?: boolean;
|
|
76
|
-
})[];
|
|
77
|
-
putDigest(input: Parameters<typeof foundation.putDigest>[1]): {
|
|
78
|
-
id: string;
|
|
79
|
-
duplicate: boolean;
|
|
80
|
-
};
|
|
81
|
-
currentDigest(itemId: string): foundation.Derivation | undefined;
|
|
82
|
-
readDigest(id: string): foundation.Derivation | undefined;
|
|
83
|
-
findDigest(revisionId: string, inputHash: string): foundation.Derivation | undefined;
|
|
84
|
-
reviewDigest(id: string, review: foundation.DigestReview): foundation.Derivation;
|
|
85
|
-
currentEditorial(itemId: string): foundation.Editorial | undefined;
|
|
86
|
-
readEditorial(id: string): foundation.Editorial | undefined;
|
|
87
|
-
reviewEditorial(id: string, status: foundation.ReviewStatus | null): foundation.Editorial;
|
|
88
|
-
/** The item an importer realm holds for one source key, with its current revision; deleted items are reported, not hidden. */
|
|
89
|
-
importedItem(realm: string, sourceKey: string): {
|
|
90
|
-
itemId: string;
|
|
91
|
-
deleted: boolean;
|
|
92
|
-
revisionId: string | null;
|
|
93
|
-
} | null;
|
|
94
|
-
importedRevision(itemId: string, bundleHash: string): string;
|
|
95
|
-
revisionMarkdown(revisionId: string): string;
|
|
96
|
-
planJungleNote(input: jungle.JungleNoteInput): jungle.JunglePlan;
|
|
97
|
-
applyJungleNote(input: jungle.JungleNoteInput): jungle.JunglePlan;
|
|
98
|
-
listChanges(after?: number, limit?: number): foundation.LoggedChange[];
|
|
99
|
-
publicProjection(): {
|
|
100
|
-
entries: foundation.PublicEntry[];
|
|
101
|
-
skipped: {
|
|
102
|
-
itemId: string;
|
|
103
|
-
reason: string;
|
|
104
|
-
}[];
|
|
105
|
-
};
|
|
106
|
-
lookupImportReceipt(namespace: string, sourceKey: string, sourceHash: string): {
|
|
107
|
-
itemId: string;
|
|
108
|
-
outcome: string;
|
|
109
|
-
} | null;
|
|
110
|
-
close(): void;
|
|
111
|
-
private transaction;
|
|
112
|
-
get revisionEpoch(): number;
|
|
113
|
-
private bumpEpoch;
|
|
114
|
-
acquireOwner(ownerIncarnation: string): OwnerToken;
|
|
115
|
-
releaseOwner(token: OwnerToken): void;
|
|
116
|
-
ownerSnapshot(): OwnerToken | null;
|
|
117
|
-
ownerAttempts(token: OwnerToken): OwnedAttempt[];
|
|
118
|
-
/** Requires external custody proof for EVERY pending attempt, even after its job committed.
|
|
119
|
-
* IDs are acknowledgements from the custody owner, never evidence inferred from PID/timeouts here. */
|
|
120
|
-
recoverOwner(expected: OwnerToken, provedAttemptIds: readonly string[]): void;
|
|
121
|
-
checkpointAttempt(token: AttemptToken, stage: JobCheckpoint['stage']): void;
|
|
122
|
-
jobCancellationRequested(jobId: string): boolean;
|
|
123
|
-
retryJob(jobId: string, options?: {
|
|
124
|
-
notBefore?: string;
|
|
125
|
-
automatic?: boolean;
|
|
126
|
-
}): void;
|
|
127
|
-
private checkOwner;
|
|
128
|
-
submitSource(input: SourceSubmission): Submission;
|
|
129
|
-
listJobs(): Row[];
|
|
130
|
-
sourceForJob(jobId: string): {
|
|
131
|
-
itemId: string;
|
|
132
|
-
kind: string;
|
|
133
|
-
sourceKey: string;
|
|
134
|
-
locator: string;
|
|
135
|
-
realm: string;
|
|
136
|
-
} | null;
|
|
137
|
-
claimNext(token: OwnerToken): AttemptToken | null;
|
|
138
|
-
claimJob(token: OwnerToken, jobId: string): AttemptToken;
|
|
139
|
-
private checkAttempt;
|
|
140
|
-
requestCancellation(jobId: string): void;
|
|
141
|
-
failAttempt(token: AttemptToken, reason?: string, options?: {
|
|
142
|
-
retryable?: boolean;
|
|
143
|
-
retryAfterMs?: number;
|
|
144
|
-
}): void;
|
|
145
|
-
/** Caller must first settle owned external children. This only releases storage staging pins. */
|
|
146
|
-
settleAttempt(token: AttemptToken): void;
|
|
147
|
-
putBlob(token: AttemptToken, expectedHash: string, expectedBytes: number, source: AsyncIterable<Uint8Array>): Promise<BlobReference>;
|
|
148
|
-
commitRevision(input: CommitRevision): {
|
|
149
|
-
revisionId: string;
|
|
150
|
-
duplicate: boolean;
|
|
151
|
-
};
|
|
152
|
-
list(): {
|
|
153
|
-
itemId: string;
|
|
154
|
-
kind: string;
|
|
155
|
-
title: string;
|
|
156
|
-
revisionId: string | null;
|
|
157
|
-
}[];
|
|
158
|
-
read(itemId: string): ReadableItem | null;
|
|
159
|
-
readBlob(reference: BlobReference): Uint8Array;
|
|
160
|
-
search(query: string, count?: number): {
|
|
161
|
-
itemId: string;
|
|
162
|
-
title: string;
|
|
163
|
-
revisionId: string;
|
|
164
|
-
}[];
|
|
165
|
-
delete(itemId: string): void;
|
|
166
|
-
/** Online DB snapshot only; P12 pairs this with blobs while the returned fence remains active. */
|
|
167
|
-
createBackupSnapshot(): Promise<{
|
|
168
|
-
id: string;
|
|
169
|
-
path: string;
|
|
170
|
-
revisionEpoch: number;
|
|
171
|
-
}>;
|
|
172
|
-
finishBackup(id: string): void;
|
|
173
|
-
/** Hold the SQLite writer fence across synchronous GC inspection and removal. */
|
|
174
|
-
withGcFence<T>(expectedEpoch: number, callback: (references: readonly BlobReference[]) => T): T;
|
|
175
|
-
/** Runtime GC pins: recorded model artifacts and embedding helpers of active or building generations. */
|
|
176
|
-
runtimeReferences(): {
|
|
177
|
-
modelArtifacts: {
|
|
178
|
-
id: string;
|
|
179
|
-
manifest: string;
|
|
180
|
-
}[];
|
|
181
|
-
embeddingHelpers: string[];
|
|
182
|
-
unmappedSpaces: number;
|
|
183
|
-
};
|
|
184
|
-
/** GC must honor both durable staging pins and active backup fences. */
|
|
185
|
-
pendingCleanupCount(): number;
|
|
186
|
-
hasGcFence(): boolean;
|
|
187
|
-
}
|