wiki-graph-sdk 0.8.0 → 0.8.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 -0
- package/dist/archives.cjs +91 -17
- package/dist/archives.cjs.map +1 -1
- package/dist/archives.d.ts +8 -2
- package/dist/archives.js +92 -17
- package/dist/archives.js.map +1 -1
- package/dist/conversions.cjs +23 -5
- package/dist/conversions.cjs.map +1 -1
- package/dist/conversions.d.ts +6 -1
- package/dist/conversions.js +23 -5
- package/dist/conversions.js.map +1 -1
- package/dist/default-worker.cjs +34 -11
- package/dist/default-worker.cjs.map +1 -1
- package/dist/default-worker.d.ts +1 -0
- package/dist/default-worker.js +34 -11
- package/dist/default-worker.js.map +1 -1
- package/dist/embedding.cjs +2 -1
- package/dist/embedding.cjs.map +1 -1
- package/dist/embedding.d.ts +4 -4
- package/dist/embedding.js +2 -1
- package/dist/embedding.js.map +1 -1
- package/dist/index.cjs +336 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +26 -9
- package/dist/index.js +337 -47
- package/dist/index.js.map +1 -1
- package/dist/{jobs-xIm_kshM.d.ts → jobs-CRK-DZ40.d.ts} +5 -0
- package/dist/local-config.cjs +2 -1
- package/dist/local-config.cjs.map +1 -1
- package/dist/local-config.js +2 -1
- package/dist/local-config.js.map +1 -1
- package/dist/maintenance.cjs +2 -1
- package/dist/maintenance.cjs.map +1 -1
- package/dist/maintenance.d.ts +4 -1
- package/dist/maintenance.js +2 -1
- package/dist/maintenance.js.map +1 -1
- package/dist/runtime-config.cjs +4 -3
- package/dist/runtime-config.cjs.map +1 -1
- package/dist/runtime-config.d.ts +4 -1
- package/dist/runtime-config.js +4 -3
- package/dist/runtime-config.js.map +1 -1
- package/dist/stage-BnWI3Rqt.d.ts +33 -0
- package/dist/stage.cjs +22 -12
- package/dist/stage.cjs.map +1 -1
- package/dist/stage.d.ts +2 -14
- package/dist/stage.js +22 -12
- package/dist/stage.js.map +1 -1
- package/dist/worker.cjs +2 -1
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.js +2 -1
- package/dist/worker.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -4,22 +4,23 @@ import { W as WikiGraphArchiveTarget } from './target-CZ7elwmj.js';
|
|
|
4
4
|
export { a as WikiGraphArchiveOwnershipError } from './target-CZ7elwmj.js';
|
|
5
5
|
import { LocalConfigSection, LocalConfigObject } from './local-config.js';
|
|
6
6
|
export { LOCAL_CONFIG_SECTIONS, clearLocalConfigSection, deleteLocalConfigValue, maskLocalConfigSection, normalizeLocalConfigKey, parseLocalConfigSection, putLocalConfigValue, readLocalConfigSection, replaceLocalConfigSection, validateLocalConfigSection } from './local-config.js';
|
|
7
|
-
import { W as WikiGraphJobRuntime, a as WikiGraphJobManager } from './jobs-
|
|
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-
|
|
9
|
-
import { ContinuationCursor, QueryIndexScope, ArchiveSourceLocatorResult, ArchiveCollectionResult, ArchiveFindResult, ArchiveEvidence, ArchiveRelatedResult, WikiGraphLibraryRecord, WikiGraphLibraryArchiveRecord, ParsedWikiGraphLibraryUri, WikiGraphLibraryIndexState, rebuildWikiGraphLibraryIndex, ArchiveFindOptions, ArchiveCollectionOptions, readWikiGraphLibraryPage, ArchivePage, listRelatedWikiGraphLibraryObjects,
|
|
7
|
+
import { W as WikiGraphJobRuntime, a as WikiGraphJobManager } from './jobs-CRK-DZ40.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-CRK-DZ40.js';
|
|
9
|
+
import { ContinuationCursor, QueryIndexScope, SearchIndexQueryMode, ArchiveSourceLocatorResult, ArchiveCollectionResult, ArchiveFindResult, ArchiveEvidence, ArchiveRelatedResult, WikiGraphLibraryRecord, WikiGraphLibraryArchiveRecord, ParsedWikiGraphLibraryUri, listWikiGraphLibraryEvidence, WikiGraphLibraryIndexState, rebuildWikiGraphLibraryIndex, ArchiveFindOptions, ArchiveCollectionOptions, readWikiGraphLibraryPage, ArchivePage, listRelatedWikiGraphLibraryObjects, ArchivePack } from 'wiki-graph-core';
|
|
10
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';
|
|
11
11
|
import { WikiGraphConversionManager } from './conversions.js';
|
|
12
12
|
export { WikiGraphConversionFormat, WikiGraphConversionInput, WikiGraphConversionOptions, WikiGraphConversionResult, WikiGraphSourceFormat } from './conversions.js';
|
|
13
13
|
export { WikiGraphQueueWorkerOptions, requireKnowledgeGraphWikispineConfig, runWikiGraphQueueWorker } from './default-worker.js';
|
|
14
14
|
export { DANGEROUS_RUNTIME_ENV_NAMES, WikiGraphEntryEnvPolicy, WikiGraphEntryRuntimeContext, WikiGraphEntryRuntimeOptions, createEntryRuntimeContext } from './entry-context.js';
|
|
15
|
-
export { QueryEmbeddingResult, WikiGraphEmbeddingConfig,
|
|
15
|
+
export { QueryEmbeddingResult, WikiGraphEmbeddingConfig, WikiGraphEmbeddingProviderName, buildSearchIndexEmbeddingProvider, embedQueryText, embedQueryTextWithLocalConfig, readWikiGraphEmbeddingConfig } from './embedding.js';
|
|
16
16
|
export { buildWikiGraphLLMOptions } from './llm.js';
|
|
17
17
|
import { WikiGraphMaintenanceManager } from './maintenance.js';
|
|
18
18
|
export { WikiGraphLegacyMigrationResult, WikiGraphMaintenanceTarget } from './maintenance.js';
|
|
19
19
|
export { NodeDirectory, NodeFile, createNodeTemplateEnvironment, createNodeWikiGraphStorage, ensureNodeWikiGraphPlatform, getNodeResourcePath, installNodeWikiGraphPlatform, nodeWikiGraphPlatform, withNodeWikiGraphStorage, writeNodeFileHandle } from './node-platform.js';
|
|
20
20
|
export { DEFAULT_GENERATION_JOB_CONCURRENCY, DEFAULT_GENERATION_REQUEST_CONCURRENCY, GenerationConcurrency, GenerationPerformanceHint, GenerationPlanningCost, createGenerationPerformanceHints, formatGenerationPlanningDuration, formatGenerationPlanningModel, planGenerationTask } from './planning.js';
|
|
21
|
-
|
|
22
|
-
export { createStageLLM, loadRequiredStageConfig } from './stage.js';
|
|
21
|
+
import { W as WikiGraphSDKProviders } from './stage-BnWI3Rqt.js';
|
|
22
|
+
export { a as WikiGraphEmbeddingProvider, b as WikiGraphLLMMessage, c as WikiGraphLLMProvider, d as WikiGraphLLMProviderEvent, e as WikiGraphLLMProviderOptions, f as createStageLLM, l as loadRequiredStageConfig, r as resolveWikiGraphLLMJSON } from './stage-BnWI3Rqt.js';
|
|
23
|
+
export { HostedProviderScope, WikiGraphLLMConfig, WikiGraphProvider, WikiGraphRuntimeConfig, loadWikiGraphRuntimeConfig, resolveHostedProviderEndpoint, resolveWikispineConfig } from './runtime-config.js';
|
|
23
24
|
export { nodeWikispineCommandRunner } from './wikispine.js';
|
|
24
25
|
import 'zod';
|
|
25
26
|
import 'node:fs/promises';
|
|
@@ -76,6 +77,7 @@ interface WikiGraphContinuationContext {
|
|
|
76
77
|
readonly libraryQuery?: "archive-members" | "objects";
|
|
77
78
|
readonly order?: "doc-asc" | "doc-desc";
|
|
78
79
|
readonly query?: string;
|
|
80
|
+
readonly queryMode?: SearchIndexQueryMode;
|
|
79
81
|
readonly role?: "any" | "object" | "self" | "subject" | undefined;
|
|
80
82
|
readonly skipUnindexed?: boolean;
|
|
81
83
|
readonly sourceContext?: number;
|
|
@@ -127,6 +129,8 @@ declare class WikiGraphContinuationManager {
|
|
|
127
129
|
|
|
128
130
|
type WikiGraphLibraryTarget = ParsedWikiGraphLibraryUri | string;
|
|
129
131
|
type WikiGraphLibrarySearchOptions = Omit<ArchiveFindOptions, "embeddingProvider">;
|
|
132
|
+
type WikiGraphLibraryRelatedOptions = Omit<NonNullable<Parameters<typeof listRelatedWikiGraphLibraryObjects>[2]>, "embeddingProvider">;
|
|
133
|
+
type WikiGraphLibraryEvidenceOptions = Omit<NonNullable<Parameters<typeof listWikiGraphLibraryEvidence>[2]>, "embeddingProvider">;
|
|
130
134
|
type WikiGraphLibraryPageOptions = Omit<Parameters<typeof readWikiGraphLibraryPage>[2], "wikimediaResolver"> & {
|
|
131
135
|
readonly signal?: AbortSignal;
|
|
132
136
|
};
|
|
@@ -143,6 +147,15 @@ interface WikiGraphLibraryReplaceArchiveOptions {
|
|
|
143
147
|
readonly inputPath: string;
|
|
144
148
|
readonly target: WikiGraphLibraryTarget;
|
|
145
149
|
}
|
|
150
|
+
interface WikiGraphLibraryArchiveContent {
|
|
151
|
+
readonly mediaType: "application/vnd.wiki-graph.archive";
|
|
152
|
+
readonly size: number;
|
|
153
|
+
readonly stream: AsyncIterable<Uint8Array>;
|
|
154
|
+
readonly uri: string;
|
|
155
|
+
}
|
|
156
|
+
interface WikiGraphLibraryArchiveReadOptions {
|
|
157
|
+
readonly signal?: AbortSignal;
|
|
158
|
+
}
|
|
146
159
|
interface WikiGraphLibrarySnapshot extends Omit<WikiGraphLibraryRecord, "folder" | "staging"> {
|
|
147
160
|
readonly folderPath: string;
|
|
148
161
|
}
|
|
@@ -162,6 +175,7 @@ declare class WikiGraphLibraryManager {
|
|
|
162
175
|
remove(target: WikiGraphLibraryTarget): Promise<WikiGraphLibrarySnapshot>;
|
|
163
176
|
scan(target: WikiGraphLibraryTarget): Promise<WikiGraphLibraryScanSnapshot>;
|
|
164
177
|
getArchive(target: WikiGraphLibraryTarget): Promise<WikiGraphLibraryArchiveSnapshot>;
|
|
178
|
+
readArchive<T>(target: WikiGraphLibraryTarget, consume: (content: WikiGraphLibraryArchiveContent) => Promise<T> | T, options?: WikiGraphLibraryArchiveReadOptions): Promise<T>;
|
|
165
179
|
moveArchive(options: WikiGraphLibraryMoveArchiveOptions): Promise<WikiGraphLibraryArchiveSnapshot>;
|
|
166
180
|
removeArchive(target: WikiGraphLibraryTarget): Promise<WikiGraphLibraryArchiveSnapshot>;
|
|
167
181
|
replaceArchive(options: WikiGraphLibraryReplaceArchiveOptions): Promise<WikiGraphLibraryArchiveSnapshot>;
|
|
@@ -178,8 +192,8 @@ declare class WikiGraphLibraryManager {
|
|
|
178
192
|
objects(target: WikiGraphLibraryTarget, options?: ArchiveCollectionOptions): Promise<ArchiveCollectionResult>;
|
|
179
193
|
archiveMembers(target: WikiGraphLibraryTarget, options?: ArchiveCollectionOptions): Promise<ArchiveCollectionResult>;
|
|
180
194
|
page(target: WikiGraphLibraryTarget, objectUri: string, options?: WikiGraphLibraryPageOptions): Promise<ArchivePage>;
|
|
181
|
-
related(target: WikiGraphLibraryTarget, objectUri: string, options?:
|
|
182
|
-
evidence(target: WikiGraphLibraryTarget, objectUri: string, options?:
|
|
195
|
+
related(target: WikiGraphLibraryTarget, objectUri: string, options?: WikiGraphLibraryRelatedOptions): Promise<ArchiveRelatedResult>;
|
|
196
|
+
evidence(target: WikiGraphLibraryTarget, objectUri: string, options?: WikiGraphLibraryEvidenceOptions): Promise<ArchiveEvidence>;
|
|
183
197
|
pack(target: WikiGraphLibraryTarget, objectUri: string, budget?: number): Promise<ArchivePack>;
|
|
184
198
|
list(): Promise<readonly WikiGraphLibrary[]>;
|
|
185
199
|
}
|
|
@@ -198,16 +212,19 @@ interface WikiGraphSDKRuntimeContext {
|
|
|
198
212
|
readonly cwd: string;
|
|
199
213
|
readonly env: NodeJS.ProcessEnv;
|
|
200
214
|
readonly envPolicy: WikiGraphSDKEnvPolicy;
|
|
215
|
+
readonly providers?: WikiGraphSDKProviders;
|
|
201
216
|
readonly stateDir?: string | undefined;
|
|
202
217
|
}
|
|
203
218
|
declare function withWikiGraphSDKRuntimeContext<T>(context: WikiGraphSDKRuntimeContext, operation: () => Promise<T> | T): Promise<T>;
|
|
204
219
|
declare function getWikiGraphSDKRuntimeContext(): WikiGraphSDKRuntimeContext;
|
|
205
220
|
declare function getWikiGraphSDKStateDir(): string | undefined;
|
|
221
|
+
declare function getWikiGraphSDKProviders(): WikiGraphSDKProviders;
|
|
206
222
|
|
|
207
223
|
interface WikiGraphSDKOptions {
|
|
208
224
|
readonly cwd?: string;
|
|
209
225
|
readonly env?: NodeJS.ProcessEnv;
|
|
210
226
|
readonly envPolicy?: WikiGraphSDKEnvPolicy;
|
|
227
|
+
readonly providers?: WikiGraphSDKProviders;
|
|
211
228
|
readonly stateDir?: string;
|
|
212
229
|
}
|
|
213
230
|
declare class WikiGraphSDK implements WikiGraphJobRuntime {
|
|
@@ -227,4 +244,4 @@ declare class WikiGraphSDK implements WikiGraphJobRuntime {
|
|
|
227
244
|
}
|
|
228
245
|
declare function createWikiGraphSDK(options?: WikiGraphSDKOptions): WikiGraphSDK;
|
|
229
246
|
|
|
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 };
|
|
247
|
+
export { LocalConfigObject, LocalConfigSection, WikiGraphArchiveManager, WikiGraphArchiveTarget, WikiGraphConfigManager, type WikiGraphContinuationContext, WikiGraphContinuationManager, type WikiGraphContinuationOptions, type WikiGraphContinuationPage, WikiGraphConversionManager, WikiGraphJobManager, WikiGraphJobRuntime, WikiGraphLibrary, type WikiGraphLibraryAddArchiveOptions, type WikiGraphLibraryArchiveContent, type WikiGraphLibraryArchiveReadOptions, type WikiGraphLibraryArchiveSnapshot, type WikiGraphLibraryEvidenceOptions, WikiGraphLibraryManager, type WikiGraphLibraryMoveArchiveOptions, type WikiGraphLibraryPageOptions, type WikiGraphLibraryRelatedOptions, type WikiGraphLibraryReplaceArchiveOptions, type WikiGraphLibraryScanSnapshot, type WikiGraphLibrarySearchOptions, type WikiGraphLibrarySnapshot, type WikiGraphLibraryTarget, WikiGraphMaintenanceManager, type WikiGraphProviderTestResult, WikiGraphSDK, type WikiGraphSDKEnvPolicy, type WikiGraphSDKOptions, WikiGraphSDKProviders, type WikiGraphSDKRuntimeContext, createWikiGraphSDK, getWikiGraphSDKProviders, getWikiGraphSDKRuntimeContext, getWikiGraphSDKStateDir, withWikiGraphSDKRuntimeContext };
|