wiki-graph-sdk 0.8.2 → 0.8.4
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 +13 -3
- package/dist/archives.cjs +382 -25
- package/dist/archives.cjs.map +1 -1
- package/dist/archives.d.ts +4 -216
- package/dist/archives.js +372 -13
- package/dist/archives.js.map +1 -1
- package/dist/conversions.cjs +11 -12
- package/dist/conversions.cjs.map +1 -1
- package/dist/conversions.js +6 -7
- package/dist/conversions.js.map +1 -1
- package/dist/default-worker.cjs +40 -17
- package/dist/default-worker.cjs.map +1 -1
- package/dist/default-worker.js +37 -14
- package/dist/default-worker.js.map +1 -1
- package/dist/embedding.cjs +6 -7
- package/dist/embedding.cjs.map +1 -1
- package/dist/embedding.js +6 -7
- package/dist/embedding.js.map +1 -1
- package/dist/gc.cjs +61 -9
- package/dist/gc.cjs.map +1 -1
- package/dist/gc.d.ts +1 -1
- package/dist/gc.js +61 -9
- package/dist/gc.js.map +1 -1
- package/dist/host-IbqJ8WSV.d.ts +18 -0
- package/dist/index-DQzLAnjf.d.ts +346 -0
- package/dist/index.cjs +622 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +20 -12
- package/dist/index.js +601 -31
- package/dist/index.js.map +1 -1
- package/dist/local-config.cjs +6 -7
- package/dist/local-config.cjs.map +1 -1
- package/dist/local-config.js +6 -7
- package/dist/local-config.js.map +1 -1
- package/dist/maintenance.cjs.map +1 -1
- package/dist/maintenance.js.map +1 -1
- package/dist/runtime-config.cjs +6 -7
- package/dist/runtime-config.cjs.map +1 -1
- package/dist/runtime-config.js +6 -7
- package/dist/runtime-config.js.map +1 -1
- package/dist/stage.cjs +6 -7
- package/dist/stage.cjs.map +1 -1
- package/dist/stage.js +6 -7
- package/dist/stage.js.map +1 -1
- package/dist/worker.cjs +55 -31
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +61 -37
- package/dist/worker.js.map +1 -1
- package/package.json +2 -2
- package/dist/host-pQiVAKEY.d.ts +0 -10
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WikiGraphPlatform, WikiGraphStorage } from 'wiki-graph-core/platform';
|
|
2
|
+
|
|
3
|
+
interface WikiGraphSDKHostBase {
|
|
4
|
+
/** Process-wide runtime services. Concurrent SDKs must use one compatible platform. */
|
|
5
|
+
readonly platform?: WikiGraphPlatform;
|
|
6
|
+
}
|
|
7
|
+
type WikiGraphSDKHost = WikiGraphSDKHostBase & ({
|
|
8
|
+
/** Node state root for SDK configuration and other host-local state. */
|
|
9
|
+
readonly stateDir: string;
|
|
10
|
+
/** Storage roots scoped to this SDK instance or standalone operation. */
|
|
11
|
+
readonly storage: WikiGraphStorage;
|
|
12
|
+
} | {
|
|
13
|
+
/** Node state root used by the default Node storage layout. */
|
|
14
|
+
readonly stateDir?: string;
|
|
15
|
+
readonly storage?: undefined;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type { WikiGraphSDKHost as W };
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { ChapterEntry, IndexArtifactKind, ReadonlyDocument, ArchiveFindHit, ArchiveFindResult, ArchiveCollectionResult, ArchiveSourceLocator, ArchiveSourceLocatorResult, ArchiveListItem, ArchiveRelatedResult, ArchiveEvidence, WikiGraphLibrarySearchBucketPage, WikiGraphProgressCallback, SearchIndexQueryMode, QueryIndexScope, ArchiveFindOptions, ArchiveCollectionOptions, readSearchIndexCapabilityStatus, rebuildArchiveSearchIndex, ChapterDetails, ChapterStage, setChapterSource, setChapterTitle, ChapterTree, applyChapterTree, ChapterTreeApplyResult, ArchivePage, ArchivePack, BookMeta } from 'wiki-graph-core';
|
|
2
|
+
import { W as WikiGraphJobRuntime } from './jobs-CRK-DZ40.js';
|
|
3
|
+
import { W as WikiGraphArchiveTarget } from './target-CZ7elwmj.js';
|
|
4
|
+
|
|
5
|
+
interface WikiGraphArchiveIndexArtifactInspection {
|
|
6
|
+
readonly current: boolean;
|
|
7
|
+
readonly exists: boolean;
|
|
8
|
+
readonly kind: IndexArtifactKind;
|
|
9
|
+
readonly sourceRevision?: number;
|
|
10
|
+
}
|
|
11
|
+
interface WikiGraphArchiveChapterInspection {
|
|
12
|
+
readonly capabilities: {
|
|
13
|
+
readonly knowledgeGraph: {
|
|
14
|
+
readonly completed: boolean;
|
|
15
|
+
};
|
|
16
|
+
readonly readingGraph: {
|
|
17
|
+
readonly completed: boolean;
|
|
18
|
+
};
|
|
19
|
+
readonly readingSummary: {
|
|
20
|
+
readonly completed: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly chapter: ChapterEntry;
|
|
24
|
+
readonly indexes: {
|
|
25
|
+
readonly fts: WikiGraphArchiveIndexArtifactInspection;
|
|
26
|
+
readonly sourceEmbedding: WikiGraphArchiveIndexArtifactInspection;
|
|
27
|
+
readonly summaryEmbedding: WikiGraphArchiveIndexArtifactInspection;
|
|
28
|
+
};
|
|
29
|
+
readonly revision: number;
|
|
30
|
+
readonly summaryWords: number;
|
|
31
|
+
}
|
|
32
|
+
interface WikiGraphArchiveInspection {
|
|
33
|
+
readonly archiveUri: string;
|
|
34
|
+
readonly chapters: readonly WikiGraphArchiveChapterInspection[];
|
|
35
|
+
readonly localIndexCache: {
|
|
36
|
+
readonly current: boolean;
|
|
37
|
+
};
|
|
38
|
+
readonly scope: {
|
|
39
|
+
readonly chapterId?: number;
|
|
40
|
+
readonly type: "archive" | "chapter";
|
|
41
|
+
};
|
|
42
|
+
readonly uri: string;
|
|
43
|
+
}
|
|
44
|
+
declare function inspectWikiGraphArchive(document: ReadonlyDocument, options: {
|
|
45
|
+
readonly archiveUri: string;
|
|
46
|
+
readonly chapterId?: number;
|
|
47
|
+
}): Promise<WikiGraphArchiveInspection>;
|
|
48
|
+
|
|
49
|
+
/** Options that may be changed while advancing an existing cursor. */
|
|
50
|
+
interface CursorNextOptions {
|
|
51
|
+
readonly limit?: number;
|
|
52
|
+
readonly signal?: AbortSignal;
|
|
53
|
+
}
|
|
54
|
+
/** A runtime page constructor used for page-type identity and reconstruction. */
|
|
55
|
+
type PageClass<P> = abstract new (...args: never[]) => P;
|
|
56
|
+
/** The common, deliberately small surface shared by SDK result pages. */
|
|
57
|
+
interface IPage<T> extends Iterable<T> {
|
|
58
|
+
nextCursor(): ICursor<this> | null;
|
|
59
|
+
}
|
|
60
|
+
/** A lazy continuation associated with a concrete page class. */
|
|
61
|
+
interface ICursor<P extends IPage<unknown>> {
|
|
62
|
+
readonly pageClass: PageClass<P>;
|
|
63
|
+
next(options?: CursorNextOptions): Promise<P>;
|
|
64
|
+
token(): Promise<string>;
|
|
65
|
+
release(): Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
interface CursorImplementation<P extends IPage<unknown>> {
|
|
68
|
+
readonly pageClass: PageClass<P>;
|
|
69
|
+
readonly next: (options: CursorNextOptions) => Promise<P>;
|
|
70
|
+
readonly token: () => Promise<string>;
|
|
71
|
+
readonly release?: () => Promise<void> | void;
|
|
72
|
+
}
|
|
73
|
+
interface PageCursorImplementation<P extends IPage<unknown>> {
|
|
74
|
+
readonly pageClass: PageClass<P>;
|
|
75
|
+
readonly rawCursor: string;
|
|
76
|
+
readonly next: (rawCursor: string, options: CursorNextOptions) => Promise<P>;
|
|
77
|
+
readonly createToken: (rawCursor: string) => Promise<string>;
|
|
78
|
+
readonly releaseToken?: (token: string) => Promise<void> | void;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Creates a cursor without retaining the page that created it. The callbacks
|
|
82
|
+
* are deliberately supplied by the SDK operation that owns continuation
|
|
83
|
+
* persistence; this type is only the lifecycle/typing facade.
|
|
84
|
+
*/
|
|
85
|
+
declare function createCursor<P extends IPage<unknown>>(implementation: CursorImplementation<P>): ICursor<P>;
|
|
86
|
+
/** Adapts an existing raw cursor while creating durable state only on demand. */
|
|
87
|
+
declare function createPageCursor<P extends IPage<unknown>>(implementation: PageCursorImplementation<P>): ICursor<P>;
|
|
88
|
+
/** Iterates concrete pages and releases each page cursor after advancing. */
|
|
89
|
+
declare function iteratePages<P extends IPage<T>, T>(firstPage: P, options?: CursorNextOptions): AsyncIterable<P>;
|
|
90
|
+
/** Iterates items across all pages while managing every continuation cursor. */
|
|
91
|
+
declare function iterateItems<P extends IPage<T>, T>(firstPage: P, options?: CursorNextOptions): AsyncIterable<T>;
|
|
92
|
+
|
|
93
|
+
declare class ArchiveFindPage implements IPage<ArchiveFindHit> {
|
|
94
|
+
#private;
|
|
95
|
+
readonly result: ArchiveFindResult;
|
|
96
|
+
readonly chapters: ArchiveFindResult["chapters"];
|
|
97
|
+
readonly items: ArchiveFindResult["items"];
|
|
98
|
+
readonly lens: ArchiveFindResult["lens"];
|
|
99
|
+
readonly lensHint: ArchiveFindResult["lensHint"];
|
|
100
|
+
readonly limit: number;
|
|
101
|
+
readonly match: ArchiveFindResult["match"];
|
|
102
|
+
readonly rawNextCursor: string | null;
|
|
103
|
+
readonly order: ArchiveFindResult["order"];
|
|
104
|
+
readonly query: string;
|
|
105
|
+
readonly terms: readonly string[];
|
|
106
|
+
readonly types: ArchiveFindResult["types"];
|
|
107
|
+
constructor(result: ArchiveFindResult, cursor?: ICursor<ArchiveFindPage> | null);
|
|
108
|
+
static readonly pageClass: PageClass<ArchiveFindPage>;
|
|
109
|
+
[Symbol.iterator](): Iterator<ArchiveFindHit>;
|
|
110
|
+
nextCursor(): ICursor<this> | null;
|
|
111
|
+
}
|
|
112
|
+
declare class ArchiveCollectionPage implements IPage<ArchiveFindHit> {
|
|
113
|
+
#private;
|
|
114
|
+
readonly result: ArchiveCollectionResult;
|
|
115
|
+
readonly chapters: ArchiveCollectionResult["chapters"];
|
|
116
|
+
readonly ids: ArchiveCollectionResult["ids"];
|
|
117
|
+
readonly items: ArchiveCollectionResult["items"];
|
|
118
|
+
readonly limit: number;
|
|
119
|
+
readonly rawNextCursor: string | null;
|
|
120
|
+
readonly order: ArchiveCollectionResult["order"];
|
|
121
|
+
readonly types: ArchiveCollectionResult["types"];
|
|
122
|
+
constructor(result: ArchiveCollectionResult, cursor?: ICursor<ArchiveCollectionPage> | null);
|
|
123
|
+
static readonly pageClass: PageClass<ArchiveCollectionPage>;
|
|
124
|
+
[Symbol.iterator](): Iterator<ArchiveFindHit>;
|
|
125
|
+
nextCursor(): ICursor<this> | null;
|
|
126
|
+
}
|
|
127
|
+
declare class ArchiveEvidencePage implements IPage<ArchiveEvidence["items"][number]> {
|
|
128
|
+
#private;
|
|
129
|
+
readonly result: ArchiveEvidence;
|
|
130
|
+
readonly items: ArchiveEvidence["items"];
|
|
131
|
+
readonly limit: number;
|
|
132
|
+
readonly rawNextCursor: string | null;
|
|
133
|
+
constructor(result: ArchiveEvidence, cursor?: ICursor<ArchiveEvidencePage> | null);
|
|
134
|
+
static readonly pageClass: PageClass<ArchiveEvidencePage>;
|
|
135
|
+
[Symbol.iterator](): Iterator<ArchiveEvidence["items"][number]>;
|
|
136
|
+
nextCursor(): ICursor<this> | null;
|
|
137
|
+
}
|
|
138
|
+
declare class ArchiveRelatedPage implements IPage<ArchiveListItem> {
|
|
139
|
+
#private;
|
|
140
|
+
readonly result: ArchiveRelatedResult;
|
|
141
|
+
readonly items: ArchiveRelatedResult["items"];
|
|
142
|
+
readonly limit: number;
|
|
143
|
+
readonly rawNextCursor: string | null;
|
|
144
|
+
constructor(result: ArchiveRelatedResult, cursor?: ICursor<ArchiveRelatedPage> | null);
|
|
145
|
+
static readonly pageClass: PageClass<ArchiveRelatedPage>;
|
|
146
|
+
[Symbol.iterator](): Iterator<ArchiveListItem>;
|
|
147
|
+
nextCursor(): ICursor<this> | null;
|
|
148
|
+
}
|
|
149
|
+
declare class ArchiveSourceLocatorPage implements IPage<ArchiveSourceLocator> {
|
|
150
|
+
#private;
|
|
151
|
+
readonly result: ArchiveSourceLocatorResult;
|
|
152
|
+
readonly items: ArchiveSourceLocatorResult["items"];
|
|
153
|
+
readonly limit: number;
|
|
154
|
+
readonly rawNextCursor: string | null;
|
|
155
|
+
constructor(result: ArchiveSourceLocatorResult, cursor?: ICursor<ArchiveSourceLocatorPage> | null);
|
|
156
|
+
static readonly pageClass: PageClass<ArchiveSourceLocatorPage>;
|
|
157
|
+
[Symbol.iterator](): Iterator<ArchiveSourceLocator>;
|
|
158
|
+
nextCursor(): ICursor<this> | null;
|
|
159
|
+
}
|
|
160
|
+
declare function createArchiveFindPage(result: ArchiveFindResult, next: (cursor: string, options: CursorNextOptions) => Promise<ArchiveFindPage>, createToken: (cursor: string) => Promise<string>, releaseToken: (token: string) => Promise<void>): ArchiveFindPage;
|
|
161
|
+
declare function createArchiveCollectionPage(result: ArchiveCollectionResult, next: (cursor: string, options: CursorNextOptions) => Promise<ArchiveCollectionPage>, createToken: (cursor: string) => Promise<string>, releaseToken: (token: string) => Promise<void>): ArchiveCollectionPage;
|
|
162
|
+
declare function createArchiveEvidencePage(result: ArchiveEvidence, next: (cursor: string, options: CursorNextOptions) => Promise<ArchiveEvidencePage>, createToken: (cursor: string) => Promise<string>, releaseToken: (token: string) => Promise<void>): ArchiveEvidencePage;
|
|
163
|
+
declare function createArchiveRelatedPage(result: ArchiveRelatedResult, next: (cursor: string, options: CursorNextOptions) => Promise<ArchiveRelatedPage>, createToken: (cursor: string) => Promise<string>, releaseToken: (token: string) => Promise<void>): ArchiveRelatedPage;
|
|
164
|
+
declare function createArchiveSourceLocatorPage(result: ArchiveSourceLocatorResult, next: (cursor: string, options: CursorNextOptions) => Promise<ArchiveSourceLocatorPage>, createToken: (cursor: string) => Promise<string>, releaseToken: (token: string) => Promise<void>): ArchiveSourceLocatorPage;
|
|
165
|
+
declare class LibraryBucketPage implements IPage<ArchiveFindHit> {
|
|
166
|
+
#private;
|
|
167
|
+
readonly id: string;
|
|
168
|
+
readonly items: readonly ArchiveFindHit[];
|
|
169
|
+
readonly rawNextCursor: string | null;
|
|
170
|
+
readonly query: string;
|
|
171
|
+
readonly terms: readonly string[];
|
|
172
|
+
readonly types: WikiGraphLibrarySearchBucketPage["types"];
|
|
173
|
+
constructor(result: WikiGraphLibrarySearchBucketPage, cursor?: ICursor<LibraryBucketPage> | null);
|
|
174
|
+
static readonly pageClass: PageClass<LibraryBucketPage>;
|
|
175
|
+
[Symbol.iterator](): Iterator<ArchiveFindHit>;
|
|
176
|
+
nextCursor(): ICursor<this> | null;
|
|
177
|
+
}
|
|
178
|
+
declare function createLibraryBucketPage(result: WikiGraphLibrarySearchBucketPage, next: (cursor: string, options: CursorNextOptions) => Promise<LibraryBucketPage>, createToken: (cursor: string) => Promise<string>, releaseToken: (token: string) => Promise<void>): LibraryBucketPage;
|
|
179
|
+
|
|
180
|
+
interface WikiGraphOperationOptions {
|
|
181
|
+
readonly signal?: AbortSignal;
|
|
182
|
+
}
|
|
183
|
+
type SearchIndexCapabilityStatus = Awaited<ReturnType<typeof readSearchIndexCapabilityStatus>>;
|
|
184
|
+
type SearchIndexProgressEvent = Parameters<NonNullable<Parameters<typeof rebuildArchiveSearchIndex>[1]>>[0];
|
|
185
|
+
type WikiGraphChapterResetStage = Exclude<ChapterStage, "summarized">;
|
|
186
|
+
type WikiGraphChapterSourceOptions = NonNullable<Parameters<typeof setChapterSource>[3]>;
|
|
187
|
+
type WikiGraphChapterTreeInput = Parameters<typeof applyChapterTree>[1];
|
|
188
|
+
interface WikiGraphArchiveCreateOptions extends WikiGraphOperationOptions {
|
|
189
|
+
readonly importPath?: string;
|
|
190
|
+
readonly onProgress?: WikiGraphProgressCallback;
|
|
191
|
+
readonly path: string;
|
|
192
|
+
readonly replace?: boolean;
|
|
193
|
+
}
|
|
194
|
+
interface WikiGraphArchiveCreateResult {
|
|
195
|
+
readonly locatedUri: string;
|
|
196
|
+
readonly path: string;
|
|
197
|
+
}
|
|
198
|
+
declare class WikiGraphArchiveExistsError extends Error {
|
|
199
|
+
readonly code = "WIKI_GRAPH_ARCHIVE_EXISTS";
|
|
200
|
+
readonly path: string;
|
|
201
|
+
constructor(path: string);
|
|
202
|
+
}
|
|
203
|
+
interface WikiGraphArchiveWriteOptions extends WikiGraphOperationOptions {
|
|
204
|
+
readonly onIndexSyncError?: (error: unknown) => void;
|
|
205
|
+
readonly refreshLibraryIndex?: boolean;
|
|
206
|
+
readonly searchIndexWritebackPolicy?: "archive" | "cache";
|
|
207
|
+
}
|
|
208
|
+
interface WikiGraphArchiveIndexStatus {
|
|
209
|
+
readonly capabilities: SearchIndexCapabilityStatus;
|
|
210
|
+
readonly current: boolean;
|
|
211
|
+
}
|
|
212
|
+
interface WikiGraphArchiveCover {
|
|
213
|
+
readonly data: Uint8Array;
|
|
214
|
+
readonly mediaType: string;
|
|
215
|
+
readonly path: string;
|
|
216
|
+
}
|
|
217
|
+
interface WikiGraphArchiveIndexSyncOptions extends WikiGraphOperationOptions {
|
|
218
|
+
readonly onProgress?: (event: SearchIndexProgressEvent) => void | Promise<void>;
|
|
219
|
+
readonly skipUnindexed?: boolean;
|
|
220
|
+
}
|
|
221
|
+
interface WikiGraphChapterArtifactStatus {
|
|
222
|
+
readonly artifact?: {
|
|
223
|
+
readonly createdAt: string;
|
|
224
|
+
readonly metadata: Readonly<Record<string, unknown>>;
|
|
225
|
+
readonly sourceRevision: number;
|
|
226
|
+
};
|
|
227
|
+
readonly chapterId: number;
|
|
228
|
+
readonly current: boolean;
|
|
229
|
+
readonly kind: IndexArtifactKind;
|
|
230
|
+
readonly missing: boolean;
|
|
231
|
+
readonly revision: number;
|
|
232
|
+
}
|
|
233
|
+
interface WikiGraphChapterMoveOptions {
|
|
234
|
+
readonly afterPath?: string;
|
|
235
|
+
readonly beforePath?: string;
|
|
236
|
+
readonly first?: boolean;
|
|
237
|
+
readonly last?: boolean;
|
|
238
|
+
readonly parentPath?: string;
|
|
239
|
+
readonly root?: boolean;
|
|
240
|
+
}
|
|
241
|
+
interface WikiGraphArchiveScopeOptions {
|
|
242
|
+
readonly chapters?: readonly number[];
|
|
243
|
+
readonly depth?: number;
|
|
244
|
+
}
|
|
245
|
+
interface WikiGraphArchiveSearchOptions extends Omit<ArchiveFindOptions, "archiveKey" | "chapters">, WikiGraphArchiveScopeOptions, WikiGraphOperationOptions {
|
|
246
|
+
}
|
|
247
|
+
interface WikiGraphArchiveListOptions extends Omit<ArchiveCollectionOptions, "chapters">, WikiGraphArchiveScopeOptions, WikiGraphOperationOptions {
|
|
248
|
+
}
|
|
249
|
+
interface WikiGraphArchivePageOptions extends WikiGraphOperationOptions {
|
|
250
|
+
readonly backlinks?: boolean;
|
|
251
|
+
readonly evidenceLimit?: number;
|
|
252
|
+
readonly order?: "doc-asc" | "doc-desc";
|
|
253
|
+
readonly sourceContext?: number;
|
|
254
|
+
}
|
|
255
|
+
interface WikiGraphArchiveRelatedOptions extends WikiGraphOperationOptions {
|
|
256
|
+
readonly cursor?: string;
|
|
257
|
+
readonly evidenceLimit?: number;
|
|
258
|
+
readonly limit?: number;
|
|
259
|
+
readonly order?: "doc-asc" | "doc-desc";
|
|
260
|
+
readonly query?: string;
|
|
261
|
+
readonly queryMode?: SearchIndexQueryMode;
|
|
262
|
+
readonly role?: "any" | "object" | "self" | "subject";
|
|
263
|
+
readonly skipUnindexed?: boolean;
|
|
264
|
+
readonly sourceContext?: number;
|
|
265
|
+
}
|
|
266
|
+
interface WikiGraphArchiveEvidenceOptions extends WikiGraphOperationOptions {
|
|
267
|
+
readonly cursor?: string;
|
|
268
|
+
readonly limit?: number;
|
|
269
|
+
readonly order?: "doc-asc" | "doc-desc";
|
|
270
|
+
readonly query?: string;
|
|
271
|
+
readonly queryMode?: SearchIndexQueryMode;
|
|
272
|
+
readonly skipUnindexed?: boolean;
|
|
273
|
+
readonly sourceContext?: number;
|
|
274
|
+
}
|
|
275
|
+
interface WikiGraphArchiveScope {
|
|
276
|
+
readonly chapterIds: readonly number[];
|
|
277
|
+
readonly entries: readonly ChapterEntry[];
|
|
278
|
+
}
|
|
279
|
+
declare class WikiGraphArchiveManager {
|
|
280
|
+
#private;
|
|
281
|
+
constructor(runtime: WikiGraphJobRuntime);
|
|
282
|
+
create(options: WikiGraphArchiveCreateOptions): Promise<WikiGraphArchiveCreateResult>;
|
|
283
|
+
open(target: WikiGraphArchiveTarget, options?: WikiGraphOperationOptions): Promise<WikiGraphArchiveHandle>;
|
|
284
|
+
}
|
|
285
|
+
declare class WikiGraphArchiveHandle {
|
|
286
|
+
#private;
|
|
287
|
+
constructor(runtime: WikiGraphJobRuntime, location: unknown);
|
|
288
|
+
get archiveKey(): string;
|
|
289
|
+
get indexScope(): QueryIndexScope;
|
|
290
|
+
get locatedUri(): string;
|
|
291
|
+
get objectUri(): string;
|
|
292
|
+
get path(): string;
|
|
293
|
+
get target(): WikiGraphArchiveTarget;
|
|
294
|
+
inspect(options?: WikiGraphOperationOptions & {
|
|
295
|
+
readonly chapterId?: number;
|
|
296
|
+
}): Promise<WikiGraphArchiveInspection>;
|
|
297
|
+
search(query: string, options?: WikiGraphArchiveSearchOptions): Promise<ArchiveFindPage>;
|
|
298
|
+
list(options?: WikiGraphArchiveListOptions): Promise<ArchiveCollectionPage | ArchiveSourceLocatorPage>;
|
|
299
|
+
ensureSearchIndex(options?: WikiGraphArchiveScopeOptions & WikiGraphOperationOptions): Promise<void>;
|
|
300
|
+
getSearchIndexStatus(options?: WikiGraphOperationOptions): Promise<WikiGraphArchiveIndexStatus>;
|
|
301
|
+
syncSearchIndex(options?: WikiGraphArchiveIndexSyncOptions): Promise<{
|
|
302
|
+
readonly rebuilt: boolean;
|
|
303
|
+
}>;
|
|
304
|
+
cleanSearchIndex(options?: WikiGraphOperationOptions): Promise<WikiGraphArchiveIndexStatus>;
|
|
305
|
+
/** Clear cached search sessions without changing the archive index. */
|
|
306
|
+
clearSearchSessions(options?: WikiGraphOperationOptions): Promise<void>;
|
|
307
|
+
listChapters(options?: WikiGraphOperationOptions): Promise<readonly ChapterEntry[]>;
|
|
308
|
+
getChapter(path: string, options?: WikiGraphOperationOptions): Promise<ChapterEntry>;
|
|
309
|
+
addChapter(options: {
|
|
310
|
+
readonly parentPath?: string;
|
|
311
|
+
readonly source?: string;
|
|
312
|
+
readonly title?: string;
|
|
313
|
+
}): Promise<ChapterDetails>;
|
|
314
|
+
getChapterArtifact(path: string, kind: IndexArtifactKind): Promise<WikiGraphChapterArtifactStatus>;
|
|
315
|
+
deleteChapterArtifact(path: string, kind: IndexArtifactKind): Promise<{
|
|
316
|
+
readonly chapterId: number;
|
|
317
|
+
readonly deleted: true;
|
|
318
|
+
readonly kind: IndexArtifactKind;
|
|
319
|
+
}>;
|
|
320
|
+
moveChapter(path: string, options: WikiGraphChapterMoveOptions): Promise<ChapterDetails>;
|
|
321
|
+
removeChapter(path: string, recursive?: boolean): Promise<void>;
|
|
322
|
+
resetChapter(path: string, stage: WikiGraphChapterResetStage): Promise<ChapterDetails>;
|
|
323
|
+
setChapterSource(path: string, source: string, options?: WikiGraphChapterSourceOptions): Promise<ChapterDetails>;
|
|
324
|
+
setChapterSummary(path: string, summary: string): Promise<ChapterDetails>;
|
|
325
|
+
setChapterTitle(path: string, title: Parameters<typeof setChapterTitle>[2]): Promise<ChapterDetails>;
|
|
326
|
+
getChapterTree(): Promise<ChapterTree>;
|
|
327
|
+
applyChapterTree(tree: WikiGraphChapterTreeInput, options?: {
|
|
328
|
+
readonly dryRun?: boolean;
|
|
329
|
+
}): Promise<ChapterTreeApplyResult>;
|
|
330
|
+
page(objectUri?: string, options?: WikiGraphArchivePageOptions): Promise<ArchivePage>;
|
|
331
|
+
related(objectUri?: string, options?: WikiGraphArchiveRelatedOptions): Promise<ArchiveRelatedPage>;
|
|
332
|
+
evidence(objectUri?: string, options?: WikiGraphArchiveEvidenceOptions): Promise<ArchiveEvidencePage>;
|
|
333
|
+
pack(objectUri?: string, budget?: number, options?: WikiGraphOperationOptions): Promise<ArchivePack>;
|
|
334
|
+
getMetadata(objectPath: string, options?: WikiGraphOperationOptions): Promise<Readonly<Record<string, unknown>>>;
|
|
335
|
+
readBookMeta(options?: WikiGraphOperationOptions): Promise<BookMeta | undefined>;
|
|
336
|
+
replaceBookMeta(meta: BookMeta, options?: WikiGraphArchiveWriteOptions): Promise<BookMeta>;
|
|
337
|
+
setArchiveTitle(title: string | null, options?: WikiGraphArchiveWriteOptions): Promise<string | null>;
|
|
338
|
+
readCover(options?: WikiGraphOperationOptions): Promise<WikiGraphArchiveCover | undefined>;
|
|
339
|
+
replaceMetadata(objectPath: string, value: Readonly<Record<string, unknown>>, options?: WikiGraphArchiveWriteOptions): Promise<Readonly<Record<string, unknown>>>;
|
|
340
|
+
putMetadata(objectPath: string, key: string, value: unknown, options?: WikiGraphArchiveWriteOptions): Promise<Readonly<Record<string, unknown>>>;
|
|
341
|
+
deleteMetadata(objectPath: string, key: string, options?: WikiGraphArchiveWriteOptions): Promise<Readonly<Record<string, unknown>>>;
|
|
342
|
+
clearMetadata(objectPath: string, options?: WikiGraphArchiveWriteOptions): Promise<Readonly<Record<string, unknown>>>;
|
|
343
|
+
resolveScope(options?: WikiGraphArchiveScopeOptions & WikiGraphOperationOptions): Promise<WikiGraphArchiveScope | undefined>;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export { ArchiveFindPage as A, type WikiGraphChapterMoveOptions as B, type CursorImplementation as C, type WikiGraphChapterResetStage as D, type WikiGraphChapterSourceOptions as E, type WikiGraphChapterTreeInput as F, type WikiGraphOperationOptions as G, createArchiveCollectionPage as H, type ICursor as I, createArchiveEvidencePage as J, createArchiveFindPage as K, LibraryBucketPage as L, createArchiveRelatedPage as M, createArchiveSourceLocatorPage as N, createCursor as O, type PageClass as P, createLibraryBucketPage as Q, createPageCursor as R, inspectWikiGraphArchive as S, iterateItems as T, iteratePages as U, WikiGraphArchiveManager as W, ArchiveCollectionPage as a, ArchiveRelatedPage as b, ArchiveEvidencePage as c, ArchiveSourceLocatorPage as d, type CursorNextOptions as e, type IPage as f, type PageCursorImplementation as g, type WikiGraphArchiveChapterInspection as h, type WikiGraphArchiveCover as i, type WikiGraphArchiveCreateOptions as j, type WikiGraphArchiveCreateResult as k, type WikiGraphArchiveEvidenceOptions as l, WikiGraphArchiveExistsError as m, WikiGraphArchiveHandle as n, type WikiGraphArchiveIndexArtifactInspection as o, type WikiGraphArchiveIndexStatus as p, type WikiGraphArchiveIndexSyncOptions as q, type WikiGraphArchiveInspection as r, type WikiGraphArchiveListOptions as s, type WikiGraphArchivePageOptions as t, type WikiGraphArchiveRelatedOptions as u, type WikiGraphArchiveScope as v, type WikiGraphArchiveScopeOptions as w, type WikiGraphArchiveSearchOptions as x, type WikiGraphArchiveWriteOptions as y, type WikiGraphChapterArtifactStatus as z };
|