wiki-graph-sdk 0.8.3 → 0.9.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.
@@ -1,219 +1,7 @@
1
- import { ChapterEntry, IndexArtifactKind, ReadonlyDocument, WikiGraphProgressCallback, SearchIndexQueryMode, QueryIndexScope, ArchiveFindOptions, ArchiveFindResult, ArchiveCollectionOptions, ArchiveCollectionResult, ArchiveSourceLocatorResult, readSearchIndexCapabilityStatus, rebuildArchiveSearchIndex, ChapterDetails, ChapterStage, setChapterSource, setChapterTitle, ChapterTree, applyChapterTree, ChapterTreeApplyResult, ArchivePage, ArchiveRelatedResult, ArchiveEvidence, 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
- export { a as WikiGraphArchiveOwnershipError } from './target-CZ7elwmj.js';
1
+ export { h as WikiGraphArchiveChapterInspection, i as WikiGraphArchiveCover, j as WikiGraphArchiveCreateOptions, k as WikiGraphArchiveCreateResult, l as WikiGraphArchiveEvidenceOptions, m as WikiGraphArchiveExistsError, n as WikiGraphArchiveHandle, o as WikiGraphArchiveIndexArtifactInspection, p as WikiGraphArchiveIndexStatus, q as WikiGraphArchiveIndexSyncOptions, r as WikiGraphArchiveInspection, s as WikiGraphArchiveListOptions, W as WikiGraphArchiveManager, t as WikiGraphArchivePageOptions, u as WikiGraphArchiveRelatedOptions, v as WikiGraphArchiveScope, w as WikiGraphArchiveScopeOptions, x as WikiGraphArchiveSearchOptions, y as WikiGraphArchiveWriteOptions, z as WikiGraphChapterArtifactStatus, B as WikiGraphChapterMoveOptions, D as WikiGraphChapterResetStage, E as WikiGraphChapterSourceOptions, F as WikiGraphChapterTreeInput, G as WikiGraphOperationOptions, S as inspectWikiGraphArchive } from './index-DQzLAnjf.js';
2
+ export { a as WikiGraphArchiveOwnershipError, W as WikiGraphArchiveTarget } from './target-CZ7elwmj.js';
3
+ import 'wiki-graph-core';
4
+ import './jobs-CRK-DZ40.js';
5
5
  import './default-worker.js';
6
6
  import './runtime-config.js';
7
7
  import 'zod';
8
-
9
- interface WikiGraphArchiveIndexArtifactInspection {
10
- readonly current: boolean;
11
- readonly exists: boolean;
12
- readonly kind: IndexArtifactKind;
13
- readonly sourceRevision?: number;
14
- }
15
- interface WikiGraphArchiveChapterInspection {
16
- readonly capabilities: {
17
- readonly knowledgeGraph: {
18
- readonly completed: boolean;
19
- };
20
- readonly readingGraph: {
21
- readonly completed: boolean;
22
- };
23
- readonly readingSummary: {
24
- readonly completed: boolean;
25
- };
26
- };
27
- readonly chapter: ChapterEntry;
28
- readonly indexes: {
29
- readonly fts: WikiGraphArchiveIndexArtifactInspection;
30
- readonly sourceEmbedding: WikiGraphArchiveIndexArtifactInspection;
31
- readonly summaryEmbedding: WikiGraphArchiveIndexArtifactInspection;
32
- };
33
- readonly revision: number;
34
- readonly summaryWords: number;
35
- }
36
- interface WikiGraphArchiveInspection {
37
- readonly archiveUri: string;
38
- readonly chapters: readonly WikiGraphArchiveChapterInspection[];
39
- readonly localIndexCache: {
40
- readonly current: boolean;
41
- };
42
- readonly scope: {
43
- readonly chapterId?: number;
44
- readonly type: "archive" | "chapter";
45
- };
46
- readonly uri: string;
47
- }
48
- declare function inspectWikiGraphArchive(document: ReadonlyDocument, options: {
49
- readonly archiveUri: string;
50
- readonly chapterId?: number;
51
- }): Promise<WikiGraphArchiveInspection>;
52
-
53
- interface WikiGraphOperationOptions {
54
- readonly signal?: AbortSignal;
55
- }
56
- type SearchIndexCapabilityStatus = Awaited<ReturnType<typeof readSearchIndexCapabilityStatus>>;
57
- type SearchIndexProgressEvent = Parameters<NonNullable<Parameters<typeof rebuildArchiveSearchIndex>[1]>>[0];
58
- type WikiGraphChapterResetStage = Exclude<ChapterStage, "summarized">;
59
- type WikiGraphChapterSourceOptions = NonNullable<Parameters<typeof setChapterSource>[3]>;
60
- type WikiGraphChapterTreeInput = Parameters<typeof applyChapterTree>[1];
61
- interface WikiGraphArchiveCreateOptions extends WikiGraphOperationOptions {
62
- readonly importPath?: string;
63
- readonly onProgress?: WikiGraphProgressCallback;
64
- readonly path: string;
65
- readonly replace?: boolean;
66
- }
67
- interface WikiGraphArchiveCreateResult {
68
- readonly locatedUri: string;
69
- readonly path: string;
70
- }
71
- declare class WikiGraphArchiveExistsError extends Error {
72
- readonly code = "WIKI_GRAPH_ARCHIVE_EXISTS";
73
- readonly path: string;
74
- constructor(path: string);
75
- }
76
- interface WikiGraphArchiveWriteOptions extends WikiGraphOperationOptions {
77
- readonly onIndexSyncError?: (error: unknown) => void;
78
- readonly refreshLibraryIndex?: boolean;
79
- readonly searchIndexWritebackPolicy?: "archive" | "cache";
80
- }
81
- interface WikiGraphArchiveIndexStatus {
82
- readonly capabilities: SearchIndexCapabilityStatus;
83
- readonly current: boolean;
84
- }
85
- interface WikiGraphArchiveCover {
86
- readonly data: Uint8Array;
87
- readonly mediaType: string;
88
- readonly path: string;
89
- }
90
- interface WikiGraphArchiveIndexSyncOptions extends WikiGraphOperationOptions {
91
- readonly onProgress?: (event: SearchIndexProgressEvent) => void | Promise<void>;
92
- readonly skipUnindexed?: boolean;
93
- }
94
- interface WikiGraphChapterArtifactStatus {
95
- readonly artifact?: {
96
- readonly createdAt: string;
97
- readonly metadata: Readonly<Record<string, unknown>>;
98
- readonly sourceRevision: number;
99
- };
100
- readonly chapterId: number;
101
- readonly current: boolean;
102
- readonly kind: IndexArtifactKind;
103
- readonly missing: boolean;
104
- readonly revision: number;
105
- }
106
- interface WikiGraphChapterMoveOptions {
107
- readonly afterPath?: string;
108
- readonly beforePath?: string;
109
- readonly first?: boolean;
110
- readonly last?: boolean;
111
- readonly parentPath?: string;
112
- readonly root?: boolean;
113
- }
114
- interface WikiGraphArchiveScopeOptions {
115
- readonly chapters?: readonly number[];
116
- readonly depth?: number;
117
- }
118
- interface WikiGraphArchiveSearchOptions extends Omit<ArchiveFindOptions, "archiveKey" | "chapters">, WikiGraphArchiveScopeOptions, WikiGraphOperationOptions {
119
- }
120
- interface WikiGraphArchiveListOptions extends Omit<ArchiveCollectionOptions, "chapters">, WikiGraphArchiveScopeOptions, WikiGraphOperationOptions {
121
- }
122
- interface WikiGraphArchivePageOptions extends WikiGraphOperationOptions {
123
- readonly backlinks?: boolean;
124
- readonly evidenceLimit?: number;
125
- readonly order?: "doc-asc" | "doc-desc";
126
- readonly sourceContext?: number;
127
- }
128
- interface WikiGraphArchiveRelatedOptions extends WikiGraphOperationOptions {
129
- readonly cursor?: string;
130
- readonly evidenceLimit?: number;
131
- readonly limit?: number;
132
- readonly order?: "doc-asc" | "doc-desc";
133
- readonly query?: string;
134
- readonly queryMode?: SearchIndexQueryMode;
135
- readonly role?: "any" | "object" | "self" | "subject";
136
- readonly skipUnindexed?: boolean;
137
- readonly sourceContext?: number;
138
- }
139
- interface WikiGraphArchiveEvidenceOptions extends WikiGraphOperationOptions {
140
- readonly cursor?: string;
141
- readonly limit?: number;
142
- readonly order?: "doc-asc" | "doc-desc";
143
- readonly query?: string;
144
- readonly queryMode?: SearchIndexQueryMode;
145
- readonly skipUnindexed?: boolean;
146
- readonly sourceContext?: number;
147
- }
148
- interface WikiGraphArchiveScope {
149
- readonly chapterIds: readonly number[];
150
- readonly entries: readonly ChapterEntry[];
151
- }
152
- declare class WikiGraphArchiveManager {
153
- #private;
154
- constructor(runtime: WikiGraphJobRuntime);
155
- create(options: WikiGraphArchiveCreateOptions): Promise<WikiGraphArchiveCreateResult>;
156
- open(target: WikiGraphArchiveTarget, options?: WikiGraphOperationOptions): Promise<WikiGraphArchiveHandle>;
157
- }
158
- declare class WikiGraphArchiveHandle {
159
- #private;
160
- constructor(runtime: WikiGraphJobRuntime, location: unknown);
161
- get archiveKey(): string;
162
- get indexScope(): QueryIndexScope;
163
- get locatedUri(): string;
164
- get objectUri(): string;
165
- get path(): string;
166
- get target(): WikiGraphArchiveTarget;
167
- inspect(options?: WikiGraphOperationOptions & {
168
- readonly chapterId?: number;
169
- }): Promise<WikiGraphArchiveInspection>;
170
- search(query: string, options?: WikiGraphArchiveSearchOptions): Promise<ArchiveFindResult>;
171
- list(options?: WikiGraphArchiveListOptions): Promise<ArchiveCollectionResult | ArchiveSourceLocatorResult>;
172
- ensureSearchIndex(options?: WikiGraphArchiveScopeOptions & WikiGraphOperationOptions): Promise<void>;
173
- getSearchIndexStatus(options?: WikiGraphOperationOptions): Promise<WikiGraphArchiveIndexStatus>;
174
- syncSearchIndex(options?: WikiGraphArchiveIndexSyncOptions): Promise<{
175
- readonly rebuilt: boolean;
176
- }>;
177
- cleanSearchIndex(options?: WikiGraphOperationOptions): Promise<WikiGraphArchiveIndexStatus>;
178
- /** Clear cached search sessions without changing the archive index. */
179
- clearSearchSessions(options?: WikiGraphOperationOptions): Promise<void>;
180
- listChapters(options?: WikiGraphOperationOptions): Promise<readonly ChapterEntry[]>;
181
- getChapter(path: string, options?: WikiGraphOperationOptions): Promise<ChapterEntry>;
182
- addChapter(options: {
183
- readonly parentPath?: string;
184
- readonly source?: string;
185
- readonly title?: string;
186
- }): Promise<ChapterDetails>;
187
- getChapterArtifact(path: string, kind: IndexArtifactKind): Promise<WikiGraphChapterArtifactStatus>;
188
- deleteChapterArtifact(path: string, kind: IndexArtifactKind): Promise<{
189
- readonly chapterId: number;
190
- readonly deleted: true;
191
- readonly kind: IndexArtifactKind;
192
- }>;
193
- moveChapter(path: string, options: WikiGraphChapterMoveOptions): Promise<ChapterDetails>;
194
- removeChapter(path: string, recursive?: boolean): Promise<void>;
195
- resetChapter(path: string, stage: WikiGraphChapterResetStage): Promise<ChapterDetails>;
196
- setChapterSource(path: string, source: string, options?: WikiGraphChapterSourceOptions): Promise<ChapterDetails>;
197
- setChapterSummary(path: string, summary: string): Promise<ChapterDetails>;
198
- setChapterTitle(path: string, title: Parameters<typeof setChapterTitle>[2]): Promise<ChapterDetails>;
199
- getChapterTree(): Promise<ChapterTree>;
200
- applyChapterTree(tree: WikiGraphChapterTreeInput, options?: {
201
- readonly dryRun?: boolean;
202
- }): Promise<ChapterTreeApplyResult>;
203
- page(objectUri?: string, options?: WikiGraphArchivePageOptions): Promise<ArchivePage>;
204
- related(objectUri?: string, options?: WikiGraphArchiveRelatedOptions): Promise<ArchiveRelatedResult>;
205
- evidence(objectUri?: string, options?: WikiGraphArchiveEvidenceOptions): Promise<ArchiveEvidence>;
206
- pack(objectUri?: string, budget?: number, options?: WikiGraphOperationOptions): Promise<ArchivePack>;
207
- getMetadata(objectPath: string, options?: WikiGraphOperationOptions): Promise<Readonly<Record<string, unknown>>>;
208
- readBookMeta(options?: WikiGraphOperationOptions): Promise<BookMeta | undefined>;
209
- replaceBookMeta(meta: BookMeta, options?: WikiGraphArchiveWriteOptions): Promise<BookMeta>;
210
- setArchiveTitle(title: string | null, options?: WikiGraphArchiveWriteOptions): Promise<string | null>;
211
- readCover(options?: WikiGraphOperationOptions): Promise<WikiGraphArchiveCover | undefined>;
212
- replaceMetadata(objectPath: string, value: Readonly<Record<string, unknown>>, options?: WikiGraphArchiveWriteOptions): Promise<Readonly<Record<string, unknown>>>;
213
- putMetadata(objectPath: string, key: string, value: unknown, options?: WikiGraphArchiveWriteOptions): Promise<Readonly<Record<string, unknown>>>;
214
- deleteMetadata(objectPath: string, key: string, options?: WikiGraphArchiveWriteOptions): Promise<Readonly<Record<string, unknown>>>;
215
- clearMetadata(objectPath: string, options?: WikiGraphArchiveWriteOptions): Promise<Readonly<Record<string, unknown>>>;
216
- resolveScope(options?: WikiGraphArchiveScopeOptions & WikiGraphOperationOptions): Promise<WikiGraphArchiveScope | undefined>;
217
- }
218
-
219
- export { type WikiGraphArchiveChapterInspection, type WikiGraphArchiveCover, type WikiGraphArchiveCreateOptions, type WikiGraphArchiveCreateResult, type WikiGraphArchiveEvidenceOptions, WikiGraphArchiveExistsError, WikiGraphArchiveHandle, type WikiGraphArchiveIndexArtifactInspection, type WikiGraphArchiveIndexStatus, type WikiGraphArchiveIndexSyncOptions, type WikiGraphArchiveInspection, type WikiGraphArchiveListOptions, WikiGraphArchiveManager, type WikiGraphArchivePageOptions, type WikiGraphArchiveRelatedOptions, type WikiGraphArchiveScope, type WikiGraphArchiveScopeOptions, type WikiGraphArchiveSearchOptions, WikiGraphArchiveTarget, type WikiGraphArchiveWriteOptions, type WikiGraphChapterArtifactStatus, type WikiGraphChapterMoveOptions, type WikiGraphChapterResetStage, type WikiGraphChapterSourceOptions, type WikiGraphChapterTreeInput, type WikiGraphOperationOptions, inspectWikiGraphArchive };