wiki-graph-sdk 0.7.0 → 0.8.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.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import { WikiGraphArchiveManager } from './archives.js';
2
- export { WikiGraphArchiveCover, WikiGraphArchiveCreateOptions, WikiGraphArchiveCreateResult, WikiGraphArchiveEvidenceOptions, WikiGraphArchiveExistsError, WikiGraphArchiveHandle, WikiGraphArchiveIndexStatus, WikiGraphArchiveIndexSyncOptions, WikiGraphArchiveInspectChapterReference, WikiGraphArchiveInspectCoverage, WikiGraphArchiveInspectImprovement, WikiGraphArchiveInspectReport, WikiGraphArchiveListOptions, WikiGraphArchiveLocation, WikiGraphArchivePageOptions, WikiGraphArchiveRelatedOptions, WikiGraphArchiveScope, WikiGraphArchiveScopeOptions, WikiGraphArchiveSearchOptions, WikiGraphArchiveWriteOptions, WikiGraphChapterArtifactStatus, WikiGraphChapterMoveOptions, WikiGraphChapterResetStage, WikiGraphChapterSourceOptions, WikiGraphChapterTreeInput, WikiGraphOperationOptions, createWikiGraphArchiveInspectReport, resolveWikiGraphArchiveLocation } from './archives.js';
2
+ export { WikiGraphArchiveChapterInspection, WikiGraphArchiveCover, WikiGraphArchiveCreateOptions, WikiGraphArchiveCreateResult, WikiGraphArchiveEvidenceOptions, WikiGraphArchiveExistsError, WikiGraphArchiveHandle, WikiGraphArchiveIndexArtifactInspection, WikiGraphArchiveIndexStatus, WikiGraphArchiveIndexSyncOptions, WikiGraphArchiveInspection, WikiGraphArchiveListOptions, WikiGraphArchivePageOptions, WikiGraphArchiveRelatedOptions, WikiGraphArchiveScope, WikiGraphArchiveScopeOptions, WikiGraphArchiveSearchOptions, WikiGraphArchiveWriteOptions, WikiGraphChapterArtifactStatus, WikiGraphChapterMoveOptions, WikiGraphChapterResetStage, WikiGraphChapterSourceOptions, WikiGraphChapterTreeInput, WikiGraphOperationOptions, inspectWikiGraphArchive } from './archives.js';
3
+ import { W as WikiGraphArchiveTarget } from './target-CZ7elwmj.js';
4
+ export { a as WikiGraphArchiveOwnershipError } from './target-CZ7elwmj.js';
3
5
  import { LocalConfigSection, LocalConfigObject } from './local-config.js';
4
6
  export { LOCAL_CONFIG_SECTIONS, clearLocalConfigSection, deleteLocalConfigValue, maskLocalConfigSection, normalizeLocalConfigKey, parseLocalConfigSection, putLocalConfigValue, readLocalConfigSection, replaceLocalConfigSection, validateLocalConfigSection } from './local-config.js';
5
- import { W as WikiGraphJobRuntime, a as WikiGraphJobManager } from './jobs-Dd5PMSId.js';
6
- export { b as WikiGraphJob, c as WikiGraphJobBackend, d as WikiGraphJobChapterReference, e as WikiGraphJobCreateOptions, f as WikiGraphJobEnqueueOptions, g as WikiGraphJobEnqueuePlan, h as WikiGraphJobEnqueueResult, i as WikiGraphJobEventListener, j as WikiGraphJobEventsOptions, k as WikiGraphJobListOptions, l as WikiGraphJobSubscriptionOptions } from './jobs-Dd5PMSId.js';
7
- import { ContinuationCursor, QueryIndexScope, ArchiveSourceLocatorResult, ArchiveCollectionResult, ArchiveFindResult, ArchiveEvidence, ArchiveRelatedResult, WikiGraphLibraryRecord, WikiGraphLibraryArchiveRecord, WikiGraphLibraryScanResult, ParsedWikiGraphLibraryUri, WikiGraphLibraryIndexState, rebuildWikiGraphLibraryIndex, ArchiveFindOptions, ArchiveCollectionOptions, readWikiGraphLibraryPage, ArchivePage, listRelatedWikiGraphLibraryObjects, listWikiGraphLibraryEvidence, ArchivePack } from 'wiki-graph-core';
8
- export { ArchiveBacklinkBucket, ArchiveBacklinks, ArchiveCollectionOptions, ArchiveCollectionResult, ArchiveEvidence, ArchiveEvidenceItem, ArchiveFindEvidencePreview, ArchiveFindHit, ArchiveFindOptions, ArchiveFindResult, ArchiveListItem, ArchivePack, ArchivePage, ArchiveRelatedResult, ArchiveSourceLocator, ArchiveSourceLocatorResult, ArchiveTriplePattern, BookMeta, BuildJob, BuildJobEvent, BuildJobProgressCounter, BuildJobTarget, ChapterDetails, ChapterEntry, ChapterStage, ChapterTree, ChapterTreeApplyResult, ContinuationCursor, DEFAULT_EXTRACTION_PROMPT, DEFAULT_KNOWLEDGE_GRAPH_RECALL_PROMPT, File, IndexArtifactKind, LLMPaymentRequiredError, LocatedWikiGraphUri, ParsedWikiGraphLibraryUri, QueryIndexScope, SearchIndexEmbeddingProvider, WIKI_GRAPH_URI_PREFIX, WikiGraphError, WikiGraphLLMOptions, WikiGraphLibraryArchiveRecord, WikiGraphLibraryIndexState, WikiGraphLibraryRecord, WikiGraphLibraryScanResult, WikiGraphMaintenanceUpgradeResult, WikiGraphProgressCallback, WikiGraphProgressEvent, WikispineProvider, formatError, formatLocatedChapterResourceUri, formatLocatedChapterSourceCollectionUri, formatLocatedChapterUri, formatLocatedWikiGraphUri, formatWikiGraphCommandUri, formatWikiGraphLibraryUri, isSourceLocatorScopeUri, isWikiGraphLibraryUri, parseChapterPath, parseChapterTreeInput, parseChapterUriPath, parseLocatedWikiGraphUri, parseSourceTextJsonl, parseWikiGraphLibraryUri, parseWikiGraphUriSyntax, resolveExtractionPrompt, resolveKnowledgeGraphRecallPrompt } from 'wiki-graph-core';
7
+ import { W as WikiGraphJobRuntime, a as WikiGraphJobManager } from './jobs-xIm_kshM.js';
8
+ export { b as WikiGraphJob, c as WikiGraphJobBackend, d as WikiGraphJobChapterReference, e as WikiGraphJobCreateOptions, f as WikiGraphJobEnqueueOptions, g as WikiGraphJobEnqueuePlan, h as WikiGraphJobEnqueueResult, i as WikiGraphJobEventListener, j as WikiGraphJobEventsOptions, k as WikiGraphJobListOptions, l as WikiGraphJobSnapshot, m as WikiGraphJobSubscriptionOptions } from './jobs-xIm_kshM.js';
9
+ import { ContinuationCursor, QueryIndexScope, ArchiveSourceLocatorResult, ArchiveCollectionResult, ArchiveFindResult, ArchiveEvidence, ArchiveRelatedResult, WikiGraphLibraryRecord, WikiGraphLibraryArchiveRecord, ParsedWikiGraphLibraryUri, WikiGraphLibraryIndexState, rebuildWikiGraphLibraryIndex, ArchiveFindOptions, ArchiveCollectionOptions, readWikiGraphLibraryPage, ArchivePage, listRelatedWikiGraphLibraryObjects, listWikiGraphLibraryEvidence, ArchivePack } from 'wiki-graph-core';
10
+ export { ArchiveBacklinkBucket, ArchiveBacklinks, ArchiveCollectionOptions, ArchiveCollectionResult, ArchiveEvidence, ArchiveEvidenceItem, ArchiveFindEvidencePreview, ArchiveFindHit, ArchiveFindOptions, ArchiveFindResult, ArchiveListItem, ArchivePack, ArchivePage, ArchiveRelatedResult, ArchiveSourceLocator, ArchiveSourceLocatorResult, ArchiveTriplePattern, BookMeta, BuildJobEvent, BuildJobProgressCounter, BuildJobTarget, ChapterDetails, ChapterEntry, ChapterStage, ChapterTree, ChapterTreeApplyResult, ContinuationCursor, DEFAULT_EXTRACTION_PROMPT, DEFAULT_KNOWLEDGE_GRAPH_RECALL_PROMPT, IndexArtifactKind, LLMPaymentRequiredError, LocatedWikiGraphUri, ParsedWikiGraphLibraryUri, QueryIndexScope, SearchIndexEmbeddingProvider, SourceArtifactInput, WIKI_GRAPH_URI_PREFIX, WikiGraphError, WikiGraphLLMOptions, WikiGraphLibraryIndexState, WikiGraphMaintenanceUpgradeResult, WikiGraphProgressCallback, WikiGraphProgressEvent, WikispineProvider, formatError, formatLocatedChapterResourceUri, formatLocatedChapterSourceCollectionUri, formatLocatedChapterUri, formatLocatedWikiGraphUri, formatWikiGraphCommandUri, formatWikiGraphLibraryUri, isSourceLocatorScopeUri, isWikiGraphLibraryUri, parseChapterPath, parseChapterTreeInput, parseChapterUriPath, parseLocatedWikiGraphUri, parseSourceTextJsonl, parseWikiGraphLibraryUri, parseWikiGraphUriSyntax, resolveExtractionPrompt, resolveKnowledgeGraphRecallPrompt } from 'wiki-graph-core';
9
11
  import { WikiGraphConversionManager } from './conversions.js';
10
12
  export { WikiGraphConversionFormat, WikiGraphConversionInput, WikiGraphConversionOptions, WikiGraphConversionResult, WikiGraphSourceFormat } from './conversions.js';
11
13
  export { WikiGraphQueueWorkerOptions, requireKnowledgeGraphWikispineConfig, runWikiGraphQueueWorker } from './default-worker.js';
@@ -55,7 +57,7 @@ declare class WikiGraphConfigManager {
55
57
 
56
58
  interface WikiGraphContinuationOptions {
57
59
  /** Optional archive locator used to verify that the cursor belongs to it. */
58
- readonly archive?: string;
60
+ readonly archive?: WikiGraphArchiveTarget;
59
61
  readonly cursor: string;
60
62
  readonly format?: ContinuationCursor["format"];
61
63
  readonly limit?: number;
@@ -125,7 +127,9 @@ declare class WikiGraphContinuationManager {
125
127
 
126
128
  type WikiGraphLibraryTarget = ParsedWikiGraphLibraryUri | string;
127
129
  type WikiGraphLibrarySearchOptions = Omit<ArchiveFindOptions, "embeddingProvider">;
128
- type WikiGraphLibraryPageOptions = Omit<Parameters<typeof readWikiGraphLibraryPage>[2], "wikimediaResolver">;
130
+ type WikiGraphLibraryPageOptions = Omit<Parameters<typeof readWikiGraphLibraryPage>[2], "wikimediaResolver"> & {
131
+ readonly signal?: AbortSignal;
132
+ };
129
133
  interface WikiGraphLibraryAddArchiveOptions {
130
134
  readonly inputPath: string;
131
135
  readonly target: WikiGraphLibraryTarget;
@@ -135,19 +139,32 @@ interface WikiGraphLibraryMoveArchiveOptions {
135
139
  readonly target: WikiGraphLibraryTarget;
136
140
  readonly to: string;
137
141
  }
142
+ interface WikiGraphLibraryReplaceArchiveOptions {
143
+ readonly inputPath: string;
144
+ readonly target: WikiGraphLibraryTarget;
145
+ }
146
+ interface WikiGraphLibrarySnapshot extends Omit<WikiGraphLibraryRecord, "folder" | "staging"> {
147
+ readonly folderPath: string;
148
+ }
149
+ type WikiGraphLibraryArchiveSnapshot = Omit<WikiGraphLibraryArchiveRecord, "file">;
150
+ interface WikiGraphLibraryScanSnapshot {
151
+ readonly archives: readonly WikiGraphLibraryArchiveSnapshot[];
152
+ readonly library?: WikiGraphLibrarySnapshot;
153
+ }
138
154
  declare class WikiGraphLibraryManager {
139
155
  #private;
140
156
  constructor(runtime: WikiGraphJobRuntime);
141
157
  create(folder: string): Promise<WikiGraphLibrary>;
142
158
  get(uri?: string): Promise<WikiGraphLibrary>;
143
- addArchive(options: WikiGraphLibraryAddArchiveOptions): Promise<WikiGraphLibraryArchiveRecord>;
159
+ addArchive(options: WikiGraphLibraryAddArchiveOptions): Promise<WikiGraphLibraryArchiveSnapshot>;
144
160
  assertCurrent(target: WikiGraphLibraryTarget): Promise<void>;
145
- rebind(target: WikiGraphLibraryTarget, folder: string): Promise<WikiGraphLibraryScanResult>;
146
- remove(target: WikiGraphLibraryTarget): Promise<WikiGraphLibraryRecord>;
147
- scan(target: WikiGraphLibraryTarget): Promise<WikiGraphLibraryScanResult>;
148
- getArchive(target: WikiGraphLibraryTarget): Promise<WikiGraphLibraryArchiveRecord>;
149
- moveArchive(options: WikiGraphLibraryMoveArchiveOptions): Promise<WikiGraphLibraryArchiveRecord>;
150
- removeArchive(target: WikiGraphLibraryTarget): Promise<WikiGraphLibraryArchiveRecord>;
161
+ rebind(target: WikiGraphLibraryTarget, folder: string): Promise<WikiGraphLibraryScanSnapshot>;
162
+ remove(target: WikiGraphLibraryTarget): Promise<WikiGraphLibrarySnapshot>;
163
+ scan(target: WikiGraphLibraryTarget): Promise<WikiGraphLibraryScanSnapshot>;
164
+ getArchive(target: WikiGraphLibraryTarget): Promise<WikiGraphLibraryArchiveSnapshot>;
165
+ moveArchive(options: WikiGraphLibraryMoveArchiveOptions): Promise<WikiGraphLibraryArchiveSnapshot>;
166
+ removeArchive(target: WikiGraphLibraryTarget): Promise<WikiGraphLibraryArchiveSnapshot>;
167
+ replaceArchive(options: WikiGraphLibraryReplaceArchiveOptions): Promise<WikiGraphLibraryArchiveSnapshot>;
151
168
  indexState(target: WikiGraphLibraryTarget): Promise<WikiGraphLibraryIndexState>;
152
169
  rebuildIndex(target: WikiGraphLibraryTarget, onProgress?: Parameters<typeof rebuildWikiGraphLibraryIndex>[1]): Promise<WikiGraphLibraryIndexState>;
153
170
  cleanIndex(target: WikiGraphLibraryTarget): Promise<WikiGraphLibraryIndexState>;
@@ -169,11 +186,11 @@ declare class WikiGraphLibraryManager {
169
186
  declare class WikiGraphLibrary {
170
187
  #private;
171
188
  constructor(runtime: WikiGraphJobRuntime, record: WikiGraphLibraryRecord);
172
- get snapshot(): WikiGraphLibraryRecord;
189
+ get snapshot(): WikiGraphLibrarySnapshot;
173
190
  get uri(): string;
174
- archives(): Promise<readonly WikiGraphLibraryArchiveRecord[]>;
175
- scan(): Promise<WikiGraphLibraryScanResult>;
176
- remove(): Promise<WikiGraphLibraryRecord>;
191
+ archives(): Promise<readonly WikiGraphLibraryArchiveSnapshot[]>;
192
+ scan(): Promise<WikiGraphLibraryScanSnapshot>;
193
+ remove(): Promise<WikiGraphLibrarySnapshot>;
177
194
  }
178
195
 
179
196
  type WikiGraphSDKEnvPolicy = "development" | "production";
@@ -210,4 +227,4 @@ declare class WikiGraphSDK implements WikiGraphJobRuntime {
210
227
  }
211
228
  declare function createWikiGraphSDK(options?: WikiGraphSDKOptions): WikiGraphSDK;
212
229
 
213
- export { LocalConfigObject, LocalConfigSection, WikiGraphArchiveManager, WikiGraphConfigManager, type WikiGraphContinuationContext, WikiGraphContinuationManager, type WikiGraphContinuationOptions, type WikiGraphContinuationPage, WikiGraphConversionManager, WikiGraphJobManager, WikiGraphJobRuntime, WikiGraphLibrary, type WikiGraphLibraryAddArchiveOptions, WikiGraphLibraryManager, type WikiGraphLibraryMoveArchiveOptions, type WikiGraphLibraryPageOptions, type WikiGraphLibrarySearchOptions, type WikiGraphLibraryTarget, WikiGraphMaintenanceManager, type WikiGraphProviderTestResult, WikiGraphSDK, type WikiGraphSDKEnvPolicy, type WikiGraphSDKOptions, type WikiGraphSDKRuntimeContext, createWikiGraphSDK, getWikiGraphSDKRuntimeContext, getWikiGraphSDKStateDir, withWikiGraphSDKRuntimeContext };
230
+ export { LocalConfigObject, LocalConfigSection, WikiGraphArchiveManager, WikiGraphArchiveTarget, WikiGraphConfigManager, type WikiGraphContinuationContext, WikiGraphContinuationManager, type WikiGraphContinuationOptions, type WikiGraphContinuationPage, WikiGraphConversionManager, WikiGraphJobManager, WikiGraphJobRuntime, WikiGraphLibrary, type WikiGraphLibraryAddArchiveOptions, type WikiGraphLibraryArchiveSnapshot, WikiGraphLibraryManager, type WikiGraphLibraryMoveArchiveOptions, type WikiGraphLibraryPageOptions, type WikiGraphLibraryReplaceArchiveOptions, type WikiGraphLibraryScanSnapshot, type WikiGraphLibrarySearchOptions, type WikiGraphLibrarySnapshot, type WikiGraphLibraryTarget, WikiGraphMaintenanceManager, type WikiGraphProviderTestResult, WikiGraphSDK, type WikiGraphSDKEnvPolicy, type WikiGraphSDKOptions, type WikiGraphSDKRuntimeContext, createWikiGraphSDK, getWikiGraphSDKRuntimeContext, getWikiGraphSDKStateDir, withWikiGraphSDKRuntimeContext };