wiki-graph-core 0.3.1 → 0.4.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/README.md +15 -0
- package/data/editor/text_compressor.jinja +17 -13
- package/data/help/commands/archive/next.jinja +7 -2
- package/data/help/commands/gc.jinja +2 -1
- package/data/help/commands/legacy/migrate.jinja +6 -1
- package/data/help/commands/legacy.jinja +3 -2
- package/data/help/commands/library-predicate.jinja +296 -0
- package/data/help/commands/library.jinja +235 -0
- package/data/help/commands/maintenance/chapter/add.jinja +3 -3
- package/data/help/commands/maintenance/chapter/list.jinja +4 -4
- package/data/help/commands/maintenance/chapter/move.jinja +4 -4
- package/data/help/commands/maintenance/chapter/remove.jinja +1 -1
- package/data/help/commands/maintenance/chapter/reset.jinja +1 -1
- package/data/help/commands/maintenance/chapter/set-source.jinja +2 -2
- package/data/help/commands/maintenance/chapter/set-summary.jinja +1 -1
- package/data/help/commands/maintenance/chapter/set-title.jinja +3 -3
- package/data/help/commands/maintenance/chapter/tree.jinja +6 -6
- package/data/help/commands/maintenance/chapter.jinja +10 -10
- package/data/help/commands/maintenance/meta.jinja +7 -7
- package/data/help/commands/maintenance/upgrade.jinja +35 -0
- package/data/help/commands/maintenance.jinja +23 -0
- package/data/help/commands/predicate.jinja +204 -28
- package/data/help/commands/root.jinja +10 -3
- package/data/help/commands/uri.jinja +165 -6
- package/data/help/topics/config.jinja +10 -3
- package/data/help/topics/library.jinja +87 -0
- package/data/help/topics/readiness.jinja +32 -2
- package/data/help/topics/recipe.jinja +42 -17
- package/data/help/topics/runtime.jinja +20 -3
- package/data/help/topics/uri.jinja +51 -25
- package/dist/api/app.d.ts +87 -0
- package/dist/api/app.js +137 -0
- package/dist/api/app.js.map +1 -0
- package/dist/api/chapter/advance.d.ts +36 -0
- package/dist/api/chapter/advance.js +171 -0
- package/dist/api/chapter/advance.js.map +1 -0
- package/dist/api/chapter/details.d.ts +25 -0
- package/dist/api/chapter/details.js +17 -0
- package/dist/api/chapter/details.js.map +1 -0
- package/dist/api/chapter/entries.d.ts +41 -0
- package/dist/api/chapter/entries.js +216 -0
- package/dist/api/chapter/entries.js.map +1 -0
- package/dist/api/chapter/generate.d.ts +42 -0
- package/dist/api/chapter/generate.js +61 -0
- package/dist/api/chapter/generate.js.map +1 -0
- package/dist/api/chapter/index.d.ts +43 -0
- package/dist/api/chapter/index.js +11 -0
- package/dist/api/chapter/index.js.map +1 -0
- package/dist/api/chapter/manage.d.ts +53 -0
- package/dist/api/chapter/manage.js +185 -0
- package/dist/api/chapter/manage.js.map +1 -0
- package/dist/api/chapter/options.d.ts +51 -0
- package/dist/api/chapter/options.js +11 -0
- package/dist/api/chapter/options.js.map +1 -0
- package/dist/api/chapter/parse.d.ts +13 -0
- package/dist/api/chapter/parse.js +16 -0
- package/dist/api/chapter/parse.js.map +1 -0
- package/dist/api/chapter/tree.d.ts +61 -0
- package/dist/api/chapter/tree.js +387 -0
- package/dist/api/chapter/tree.js.map +1 -0
- package/dist/api/chapter/types.d.ts +104 -0
- package/dist/api/chapter/types.js +5 -0
- package/dist/api/chapter/types.js.map +1 -0
- package/dist/api/chapter-build/index.d.ts +42 -0
- package/dist/api/chapter-build/index.js +3 -0
- package/dist/api/chapter-build/index.js.map +1 -0
- package/dist/api/chapter-build/types.d.ts +37 -0
- package/dist/api/digest.d.ts +67 -0
- package/dist/api/digest.js +171 -0
- package/dist/api/digest.js.map +1 -0
- package/dist/api/graph.d.ts +24 -0
- package/dist/api/graph.js +2 -0
- package/dist/api/graph.js.map +1 -0
- package/dist/api/import.d.ts +62 -0
- package/dist/api/import.js +269 -0
- package/dist/api/import.js.map +1 -0
- package/dist/api/index.d.ts +91 -0
- package/dist/api/index.js +189 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/knowledge-graph-build/index.d.ts +40 -0
- package/dist/api/knowledge-graph-build/index.js +2 -0
- package/dist/api/knowledge-graph-build/index.js.map +1 -0
- package/dist/api/knowledge-graph-build/types.d.ts +13 -0
- package/dist/api/llm-sampling.d.ts +11 -0
- package/dist/api/llm-sampling.js +58 -0
- package/dist/api/llm-sampling.js.map +1 -0
- package/dist/api/prompts.d.ts +1 -0
- package/dist/api/prompts.js +2 -0
- package/dist/api/prompts.js.map +1 -0
- package/dist/api/wiki-graph-archive.d.ts +42 -0
- package/dist/api/wiki-graph-archive.js +130 -0
- package/dist/api/wiki-graph-archive.js.map +1 -0
- package/dist/core-Cv8a8viI.d.ts +85 -0
- package/dist/document/chapter/index.d.ts +26 -0
- package/dist/document/chapter/index.js +23 -0
- package/dist/document/chapter/index.js.map +1 -0
- package/dist/document/chapter/path.d.ts +14 -0
- package/dist/document/chapter/path.js +133 -0
- package/dist/document/chapter/path.js.map +1 -0
- package/dist/document/chapter/query.d.ts +33 -0
- package/dist/document/chapter/query.js +83 -0
- package/dist/document/chapter/query.js.map +1 -0
- package/dist/document/chapter/stage.d.ts +28 -0
- package/dist/document/chapter/stage.js +13 -0
- package/dist/document/chapter/stage.js.map +1 -0
- package/dist/document/chapter/toc.d.ts +33 -0
- package/dist/document/chapter/toc.js +213 -0
- package/dist/document/chapter/toc.js.map +1 -0
- package/dist/document/chapter/tree.d.ts +20 -0
- package/dist/document/chapter/tree.js +48 -0
- package/dist/document/chapter/tree.js.map +1 -0
- package/dist/document/chapter/types.d.ts +31 -0
- package/dist/document/chapter/types.js +10 -0
- package/dist/document/chapter/types.js.map +1 -0
- package/dist/document/directory/context.d.ts +25 -0
- package/dist/document/directory/context.js +54 -0
- package/dist/document/directory/context.js.map +1 -0
- package/dist/document/directory/core.d.ts +25 -0
- package/dist/document/directory/core.js +382 -0
- package/dist/document/directory/core.js.map +1 -0
- package/dist/document/directory/file-store.d.ts +27 -0
- package/dist/document/directory/file-store.js +48 -0
- package/dist/document/directory/file-store.js.map +1 -0
- package/dist/document/directory/files.d.ts +53 -0
- package/dist/document/directory/files.js +71 -0
- package/dist/document/directory/files.js.map +1 -0
- package/dist/document/directory/index.d.ts +26 -0
- package/dist/document/directory/index.js +4 -0
- package/dist/document/directory/index.js.map +1 -0
- package/dist/document/directory/search-index.d.ts +32 -0
- package/dist/document/directory/search-index.js +154 -0
- package/dist/document/directory/search-index.js.map +1 -0
- package/dist/document/directory/serial-cleanup.d.ts +47 -0
- package/dist/document/directory/serial-cleanup.js +178 -0
- package/dist/document/directory/serial-cleanup.js.map +1 -0
- package/dist/document/directory/toc.d.ts +6 -0
- package/dist/document/directory/toc.js +14 -0
- package/dist/document/directory/toc.js.map +1 -0
- package/dist/document/directory/types.d.ts +105 -0
- package/dist/document/fragment-backed.d.ts +27 -0
- package/dist/document/fragment-backed.js +26 -0
- package/dist/document/fragment-backed.js.map +1 -0
- package/dist/document/fragments/core.d.ts +18 -0
- package/dist/document/fragments/core.js +68 -0
- package/dist/document/fragments/core.js.map +1 -0
- package/dist/document/fragments/draft.d.ts +16 -0
- package/dist/document/fragments/draft.js +57 -0
- package/dist/document/fragments/draft.js.map +1 -0
- package/dist/document/fragments/file-access.d.ts +7 -0
- package/dist/document/fragments/file-access.js +28 -0
- package/dist/document/fragments/file-access.js.map +1 -0
- package/dist/document/fragments/file.d.ts +7 -0
- package/dist/document/fragments/file.js +55 -0
- package/dist/document/fragments/file.js.map +1 -0
- package/dist/document/fragments/index.d.ts +5 -0
- package/dist/document/fragments/index.js +5 -0
- package/dist/document/fragments/index.js.map +1 -0
- package/dist/document/fragments/sentence.d.ts +5 -0
- package/dist/document/fragments/sentence.js +14 -0
- package/dist/document/fragments/sentence.js.map +1 -0
- package/dist/document/fragments/serial.d.ts +16 -0
- package/dist/document/fragments/serial.js +187 -0
- package/dist/document/fragments/serial.js.map +1 -0
- package/dist/document/fragments/types.d.ts +37 -0
- package/dist/document/fragments/types.js +9 -0
- package/dist/document/fragments/types.js.map +1 -0
- package/dist/document/home-schema-upgrade.d.ts +5 -0
- package/dist/document/home-schema-upgrade.js +529 -0
- package/dist/document/home-schema-upgrade.js.map +1 -0
- package/dist/document/index.d.ts +27 -8
- package/dist/document/index.js +10 -4
- package/dist/document/index.js.map +1 -1
- package/dist/document/schema.d.ts +3 -2
- package/dist/document/schema.js +24 -11
- package/dist/document/schema.js.map +1 -1
- package/dist/document/shared-state-database.js +27 -3
- package/dist/document/shared-state-database.js.map +1 -1
- package/dist/document/stores/chunk.d.ts +21 -0
- package/dist/document/stores/chunk.js +299 -0
- package/dist/document/stores/chunk.js.map +1 -0
- package/dist/document/stores/fragment-group.d.ts +16 -0
- package/dist/document/stores/fragment-group.js +77 -0
- package/dist/document/stores/fragment-group.js.map +1 -0
- package/dist/document/stores/graph-build-parameter.d.ts +17 -0
- package/dist/document/stores/graph-build-parameter.js +62 -0
- package/dist/document/stores/graph-build-parameter.js.map +1 -0
- package/dist/document/stores/helpers.d.ts +22 -0
- package/dist/document/stores/helpers.js +115 -0
- package/dist/document/stores/helpers.js.map +1 -0
- package/dist/document/stores/index.d.ts +15 -0
- package/dist/document/stores/index.js +23 -0
- package/dist/document/stores/index.js.map +1 -0
- package/dist/document/stores/mention-link.d.ts +32 -0
- package/dist/document/stores/mention-link.js +287 -0
- package/dist/document/stores/mention-link.js.map +1 -0
- package/dist/document/stores/mention.d.ts +31 -0
- package/dist/document/stores/mention.js +238 -0
- package/dist/document/stores/mention.js.map +1 -0
- package/dist/document/stores/object-metadata.d.ts +19 -0
- package/dist/document/stores/object-metadata.js +148 -0
- package/dist/document/stores/object-metadata.js.map +1 -0
- package/dist/document/stores/reading-edge.d.ts +17 -0
- package/dist/document/stores/reading-edge.js +80 -0
- package/dist/document/stores/reading-edge.js.map +1 -0
- package/dist/document/stores/serial.d.ts +29 -0
- package/dist/document/stores/serial.js +296 -0
- package/dist/document/stores/serial.js.map +1 -0
- package/dist/document/stores/snake/chunk.d.ts +14 -0
- package/dist/document/stores/snake/chunk.js +48 -0
- package/dist/document/stores/snake/chunk.js.map +1 -0
- package/dist/document/stores/snake/core.d.ts +15 -0
- package/dist/document/stores/snake/core.js +112 -0
- package/dist/document/stores/snake/core.js.map +1 -0
- package/dist/document/stores/snake/edge.d.ts +16 -0
- package/dist/document/stores/snake/edge.js +86 -0
- package/dist/document/stores/snake/edge.js.map +1 -0
- package/dist/document/stores/snake/index.d.ts +7 -0
- package/dist/document/stores/snake/index.js +4 -0
- package/dist/document/stores/snake/index.js.map +1 -0
- package/dist/document/stores/types.d.ts +95 -0
- package/dist/document/text-streams/core.d.ts +17 -0
- package/dist/document/text-streams/core.js +45 -0
- package/dist/document/text-streams/core.js.map +1 -0
- package/dist/document/text-streams/draft.d.ts +20 -0
- package/dist/document/text-streams/draft.js +70 -0
- package/dist/document/text-streams/draft.js.map +1 -0
- package/dist/document/text-streams/file-access.d.ts +6 -0
- package/dist/document/text-streams/file-access.js +31 -0
- package/dist/document/text-streams/file-access.js.map +1 -0
- package/dist/document/text-streams/index.d.ts +7 -0
- package/dist/document/text-streams/index.js +5 -0
- package/dist/document/text-streams/index.js.map +1 -0
- package/dist/document/text-streams/sentence.d.ts +13 -0
- package/dist/document/text-streams/sentence.js +77 -0
- package/dist/document/text-streams/sentence.js.map +1 -0
- package/dist/document/text-streams/serial.d.ts +24 -0
- package/dist/document/text-streams/serial.js +324 -0
- package/dist/document/text-streams/serial.js.map +1 -0
- package/dist/document/text-streams/types.d.ts +55 -0
- package/dist/document/text-streams/types.js +10 -0
- package/dist/document/text-streams/types.js.map +1 -0
- package/dist/external/guaranteed/classifier.js.map +1 -0
- package/dist/external/guaranteed/errors.js.map +1 -0
- package/dist/external/guaranteed/index.js.map +1 -0
- package/dist/external/guaranteed/request.js.map +1 -0
- package/dist/external/guaranteed/response.js.map +1 -0
- package/dist/external/llm/cache.js +35 -0
- package/dist/external/llm/cache.js.map +1 -0
- package/dist/external/llm/client/core.d.ts +26 -0
- package/dist/external/llm/client/core.js +321 -0
- package/dist/external/llm/client/core.js.map +1 -0
- package/dist/external/llm/client/files.d.ts +6 -0
- package/dist/external/llm/client/files.js +29 -0
- package/dist/external/llm/client/files.js.map +1 -0
- package/dist/external/llm/client/generation.d.ts +16 -0
- package/dist/external/llm/client/generation.js +35 -0
- package/dist/external/llm/client/generation.js.map +1 -0
- package/dist/external/llm/client/index.d.ts +5 -0
- package/dist/external/llm/client/index.js +5 -0
- package/dist/external/llm/client/index.js.map +1 -0
- package/dist/external/llm/client/log.d.ts +22 -0
- package/dist/external/llm/client/log.js +106 -0
- package/dist/external/llm/client/log.js.map +1 -0
- package/dist/external/llm/client/model.d.ts +10 -0
- package/dist/external/llm/client/model.js +26 -0
- package/dist/external/llm/client/model.js.map +1 -0
- package/dist/external/llm/client/retry.d.ts +4 -0
- package/dist/external/llm/client/retry.js +91 -0
- package/dist/external/llm/client/retry.js.map +1 -0
- package/dist/external/llm/context.js +78 -0
- package/dist/external/llm/context.js.map +1 -0
- package/dist/external/llm/errors.js.map +1 -0
- package/dist/external/llm/index.d.ts +7 -0
- package/dist/external/llm/index.js +17 -0
- package/dist/external/llm/index.js.map +1 -0
- package/dist/external/llm/request-log.js +35 -0
- package/dist/external/llm/request-log.js.map +1 -0
- package/dist/external/llm/sampling.js.map +1 -0
- package/dist/external/wikimatch/enrichment.d.ts +15 -0
- package/dist/external/wikimatch/enrichment.js +61 -0
- package/dist/external/wikimatch/enrichment.js.map +1 -0
- package/dist/external/wikimatch/index.d.ts +19 -0
- package/dist/external/wikimatch/index.js +66 -0
- package/dist/external/wikimatch/index.js.map +1 -0
- package/dist/external/wikimatch/option-narrowing.d.ts +19 -0
- package/dist/external/wikimatch/option-narrowing.js.map +1 -0
- package/dist/external/wikimatch/options.d.ts +16 -0
- package/dist/external/wikimatch/options.js +154 -0
- package/dist/external/wikimatch/options.js.map +1 -0
- package/dist/external/wikimatch/policy-judge.d.ts +19 -0
- package/dist/external/wikimatch/policy-judge.js +431 -0
- package/dist/external/wikimatch/policy-judge.js.map +1 -0
- package/dist/external/wikimatch/range-suppression.js.map +1 -0
- package/dist/external/wikimatch/surface/index.d.ts +10 -0
- package/dist/external/wikimatch/surface/index.js +3 -0
- package/dist/external/wikimatch/surface/index.js.map +1 -0
- package/dist/external/wikimatch/surface/screening.d.ts +18 -0
- package/dist/external/wikimatch/surface/screening.js +168 -0
- package/dist/external/wikimatch/surface/screening.js.map +1 -0
- package/dist/external/wikimatch/surface/window.d.ts +8 -0
- package/dist/external/wikimatch/surface/window.js +44 -0
- package/dist/external/wikimatch/surface/window.js.map +1 -0
- package/dist/external/wikimatch/types.d.ts +153 -0
- package/dist/external/wikimatch/wikispine.d.ts +45 -0
- package/dist/external/wikimatch/wikispine.js.map +1 -0
- package/dist/external/wikimatch/window.d.ts +8 -0
- package/dist/external/wikimatch/window.js.map +1 -0
- package/dist/external/wikimatch/words.js.map +1 -0
- package/dist/external/wikipage/cache.d.ts +20 -0
- package/dist/external/wikipage/cache.js +442 -0
- package/dist/external/wikipage/cache.js.map +1 -0
- package/dist/external/wikipage/fetch-log.js +146 -0
- package/dist/external/wikipage/fetch-log.js.map +1 -0
- package/dist/external/wikipage/index.d.ts +15 -0
- package/dist/external/wikipage/index.js +17 -0
- package/dist/external/wikipage/index.js.map +1 -0
- package/dist/external/wikipage/normalizer.d.ts +16 -0
- package/dist/external/wikipage/normalizer.js +188 -0
- package/dist/external/wikipage/normalizer.js.map +1 -0
- package/dist/external/wikipage/rate-limiter.js.map +1 -0
- package/dist/external/wikipage/resolver.d.ts +22 -0
- package/dist/external/wikipage/resolver.js +359 -0
- package/dist/external/wikipage/resolver.js.map +1 -0
- package/dist/external/wikipage/types.d.ts +118 -0
- package/dist/external/wikipage/wikimedia-client/core.d.ts +13 -0
- package/dist/external/wikipage/wikimedia-client/core.js +207 -0
- package/dist/external/wikipage/wikimedia-client/core.js.map +1 -0
- package/dist/external/wikipage/wikimedia-client/html.d.ts +7 -0
- package/dist/external/wikipage/wikimedia-client/html.js +136 -0
- package/dist/external/wikipage/wikimedia-client/html.js.map +1 -0
- package/dist/external/wikipage/wikimedia-client/index.d.ts +5 -0
- package/dist/external/wikipage/wikimedia-client/index.js +4 -0
- package/dist/external/wikipage/wikimedia-client/index.js.map +1 -0
- package/dist/external/wikipage/wikimedia-client/json.d.ts +7 -0
- package/dist/external/wikipage/wikimedia-client/json.js +27 -0
- package/dist/external/wikipage/wikimedia-client/json.js.map +1 -0
- package/dist/external/wikipage/wikimedia-client/request.d.ts +12 -0
- package/dist/external/wikipage/wikimedia-client/request.js +51 -0
- package/dist/external/wikipage/wikimedia-client/request.js.map +1 -0
- package/dist/external/wikipage/wikimedia-client/wiki.d.ts +54 -0
- package/dist/external/wikipage/wikimedia-client/wiki.js +28 -0
- package/dist/external/wikipage/wikimedia-client/wiki.js.map +1 -0
- package/dist/gc.cjs +8188 -8373
- package/dist/gc.cjs.map +1 -1
- package/dist/gc.d.cts +23 -3
- package/dist/gc.d.ts +2 -2
- package/dist/gc.js +1 -1
- package/dist/gc.js.map +1 -1
- package/dist/graph/evidence-selection/anchor/index.d.ts +4 -0
- package/dist/graph/evidence-selection/anchor/index.js +3 -0
- package/dist/graph/evidence-selection/anchor/index.js.map +1 -0
- package/dist/graph/evidence-selection/anchor/resolver/index.d.ts +38 -0
- package/dist/graph/evidence-selection/anchor/resolver/index.js +418 -0
- package/dist/graph/evidence-selection/anchor/resolver/index.js.map +1 -0
- package/dist/graph/evidence-selection/anchor/resolver/matcher.d.ts +8 -0
- package/dist/graph/evidence-selection/anchor/resolver/matcher.js +178 -0
- package/dist/graph/evidence-selection/anchor/resolver/matcher.js.map +1 -0
- package/dist/graph/evidence-selection/anchor/resolver/parser.d.ts +7 -0
- package/dist/graph/evidence-selection/anchor/resolver/parser.js +91 -0
- package/dist/graph/evidence-selection/anchor/resolver/parser.js.map +1 -0
- package/dist/graph/evidence-selection/anchor/resolver/scoring.d.ts +20 -0
- package/dist/graph/evidence-selection/anchor/resolver/scoring.js +119 -0
- package/dist/graph/evidence-selection/anchor/resolver/scoring.js.map +1 -0
- package/dist/graph/evidence-selection/anchor/resolver/types.d.ts +15 -0
- package/dist/graph/evidence-selection/anchor/resolver/types.js +17 -0
- package/dist/graph/evidence-selection/anchor/resolver/types.js.map +1 -0
- package/dist/graph/evidence-selection/anchor/types.d.ts +27 -0
- package/dist/graph/evidence-selection/index.d.ts +9 -0
- package/dist/graph/evidence-selection/index.js +32 -0
- package/dist/graph/evidence-selection/index.js.map +1 -0
- package/dist/graph/evidence-selection/prompt.js.map +1 -0
- package/dist/graph/evidence-selection/quote-score.js.map +1 -0
- package/dist/graph/evidence-selection/resolver.js +303 -0
- package/dist/graph/evidence-selection/resolver.js.map +1 -0
- package/dist/graph/evidence-selection/text.js.map +1 -0
- package/dist/graph/knowledge-build/artifact-io.d.ts +12 -0
- package/dist/graph/knowledge-build/artifact-io.js +151 -0
- package/dist/graph/knowledge-build/artifact-io.js.map +1 -0
- package/dist/graph/knowledge-build/artifact.d.ts +17 -0
- package/dist/graph/knowledge-build/artifact.js +66 -0
- package/dist/graph/knowledge-build/artifact.js.map +1 -0
- package/dist/graph/knowledge-build/candidates.d.ts +24 -0
- package/dist/graph/knowledge-build/candidates.js +60 -0
- package/dist/graph/knowledge-build/candidates.js.map +1 -0
- package/dist/graph/knowledge-build/commit.d.ts +39 -0
- package/dist/graph/knowledge-build/commit.js +52 -0
- package/dist/graph/knowledge-build/commit.js.map +1 -0
- package/dist/graph/knowledge-build/constants.d.ts +6 -0
- package/dist/graph/knowledge-build/constants.js +11 -0
- package/dist/graph/knowledge-build/constants.js.map +1 -0
- package/dist/graph/knowledge-build/fragments.d.ts +33 -0
- package/dist/graph/knowledge-build/fragments.js +36 -0
- package/dist/graph/knowledge-build/fragments.js.map +1 -0
- package/dist/graph/knowledge-build/generate.d.ts +39 -0
- package/dist/graph/knowledge-build/generate.js +128 -0
- package/dist/graph/knowledge-build/generate.js.map +1 -0
- package/dist/graph/knowledge-build/grounding-runner.d.ts +23 -0
- package/dist/graph/knowledge-build/grounding-runner.js +90 -0
- package/dist/graph/knowledge-build/grounding-runner.js.map +1 -0
- package/dist/graph/knowledge-build/grounding.d.ts +19 -0
- package/dist/graph/knowledge-build/grounding.js +158 -0
- package/dist/graph/knowledge-build/grounding.js.map +1 -0
- package/dist/graph/knowledge-build/index.d.ts +40 -0
- package/dist/graph/knowledge-build/index.js +8 -0
- package/dist/graph/knowledge-build/index.js.map +1 -0
- package/dist/graph/knowledge-build/mentions.d.ts +25 -0
- package/dist/graph/knowledge-build/mentions.js +66 -0
- package/dist/graph/knowledge-build/mentions.js.map +1 -0
- package/dist/graph/knowledge-build/parameter.d.ts +19 -0
- package/dist/graph/knowledge-build/parameter.js +14 -0
- package/dist/graph/knowledge-build/parameter.js.map +1 -0
- package/dist/graph/knowledge-build/progress.d.ts +8 -0
- package/dist/graph/knowledge-build/progress.js +45 -0
- package/dist/graph/knowledge-build/progress.js.map +1 -0
- package/dist/graph/knowledge-build/relations.d.ts +22 -0
- package/dist/graph/knowledge-build/relations.js +118 -0
- package/dist/graph/knowledge-build/relations.js.map +1 -0
- package/dist/graph/knowledge-build/request.d.ts +8 -0
- package/dist/graph/knowledge-build/request.js +19 -0
- package/dist/graph/knowledge-build/request.js.map +1 -0
- package/dist/graph/knowledge-build/snapshot.d.ts +38 -0
- package/dist/graph/knowledge-build/snapshot.js +18 -0
- package/dist/graph/knowledge-build/snapshot.js.map +1 -0
- package/dist/graph/knowledge-build/types.d.ts +46 -0
- package/dist/graph/reading-build/artifact.d.ts +42 -0
- package/dist/graph/reading-build/artifact.js +162 -0
- package/dist/graph/reading-build/artifact.js.map +1 -0
- package/dist/graph/reading-build/copy.d.ts +28 -0
- package/dist/graph/reading-build/copy.js +65 -0
- package/dist/graph/reading-build/copy.js.map +1 -0
- package/dist/graph/reading-build/index.d.ts +39 -0
- package/dist/graph/reading-build/index.js +4 -0
- package/dist/graph/reading-build/index.js.map +1 -0
- package/dist/graph/reading-build/input.d.ts +32 -0
- package/dist/graph/reading-build/input.js +19 -0
- package/dist/graph/reading-build/input.js.map +1 -0
- package/dist/graph/reading-build/options.d.ts +47 -0
- package/dist/graph/reading-build/options.js +20 -0
- package/dist/graph/reading-build/options.js.map +1 -0
- package/dist/graph/reading-build/source-fragments.d.ts +15 -0
- package/dist/graph/reading-build/source-fragments.js +36 -0
- package/dist/graph/reading-build/source-fragments.js.map +1 -0
- package/dist/graph/reading-build/types.d.ts +57 -0
- package/dist/graph/reading.d.ts +73 -0
- package/dist/graph/reading.js +203 -0
- package/dist/graph/reading.js.map +1 -0
- package/dist/graph/topology/core.d.ts +42 -0
- package/dist/graph/topology/core.js +348 -0
- package/dist/graph/topology/core.js.map +1 -0
- package/dist/graph/topology/grouping.d.ts +13 -0
- package/dist/graph/topology/grouping.js.map +1 -0
- package/dist/graph/topology/index.d.ts +34 -0
- package/dist/graph/topology/index.js +5 -0
- package/dist/graph/topology/index.js.map +1 -0
- package/dist/graph/topology/resource-segmentation.d.ts +11 -0
- package/dist/graph/topology/resource-segmentation.js.map +1 -0
- package/dist/graph/topology/segment-incision.d.ts +16 -0
- package/dist/graph/topology/segment-incision.js.map +1 -0
- package/dist/graph/topology/snake/compare.d.ts +8 -0
- package/dist/graph/topology/snake/compare.js +29 -0
- package/dist/graph/topology/snake/compare.js.map +1 -0
- package/dist/graph/topology/snake/components.d.ts +12 -0
- package/dist/graph/topology/snake/components.js +80 -0
- package/dist/graph/topology/snake/components.js.map +1 -0
- package/dist/graph/topology/snake/constants.d.ts +7 -0
- package/dist/graph/topology/snake/constants.js +13 -0
- package/dist/graph/topology/snake/constants.js.map +1 -0
- package/dist/graph/topology/snake/detect.d.ts +9 -0
- package/dist/graph/topology/snake/detect.js +63 -0
- package/dist/graph/topology/snake/detect.js.map +1 -0
- package/dist/graph/topology/snake/detector.d.ts +3 -0
- package/dist/graph/topology/snake/detector.js +7 -0
- package/dist/graph/topology/snake/detector.js.map +1 -0
- package/dist/graph/topology/snake/fingerprints.d.ts +7 -0
- package/dist/graph/topology/snake/fingerprints.js +86 -0
- package/dist/graph/topology/snake/fingerprints.js.map +1 -0
- package/dist/graph/topology/snake/graph-builder.d.ts +14 -0
- package/dist/graph/topology/snake/graph-builder.js +76 -0
- package/dist/graph/topology/snake/graph-builder.js.map +1 -0
- package/dist/graph/topology/snake/graph.d.ts +7 -0
- package/dist/graph/topology/snake/graph.js +105 -0
- package/dist/graph/topology/snake/graph.js.map +1 -0
- package/dist/graph/topology/snake/index.d.ts +4 -0
- package/dist/graph/topology/snake/index.js +3 -0
- package/dist/graph/topology/snake/index.js.map +1 -0
- package/dist/graph/topology/snake/merge.d.ts +6 -0
- package/dist/graph/topology/snake/merge.js +174 -0
- package/dist/graph/topology/snake/merge.js.map +1 -0
- package/dist/graph/topology/snake/records.d.ts +12 -0
- package/dist/graph/topology/snake/records.js +35 -0
- package/dist/graph/topology/snake/records.js.map +1 -0
- package/dist/graph/topology/snake/types.d.ts +23 -0
- package/dist/graph/topology/snake/types.js +1 -0
- package/dist/graph/topology/snake/weights.d.ts +3 -0
- package/dist/graph/topology/snake/weights.js +17 -0
- package/dist/graph/topology/snake/weights.js.map +1 -0
- package/dist/graph/topology/weights.d.ts +10 -0
- package/dist/graph/topology/weights.js +84 -0
- package/dist/graph/topology/weights.js.map +1 -0
- package/dist/graph/wikilink/index.d.ts +12 -0
- package/dist/graph/wikilink/index.js.map +1 -0
- package/dist/graph/wikilink/relation-discovery.d.ts +33 -0
- package/dist/graph/wikilink/relation-discovery.js +477 -0
- package/dist/graph/wikilink/relation-discovery.js.map +1 -0
- package/dist/graph/wikilink/types.d.ts +25 -0
- package/dist/graph/wikilink/types.js +1 -0
- package/dist/graph/wikilink/window.d.ts +9 -0
- package/dist/graph/wikilink/window.js.map +1 -0
- package/dist/index.cjs +37880 -29183
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1657 -1421
- package/dist/index.d.ts +127 -72
- package/dist/index.js +333 -27
- package/dist/index.js.map +1 -1
- package/dist/library/index.d.ts +38 -0
- package/dist/library/index.js +6 -0
- package/dist/library/index.js.map +1 -0
- package/dist/library/lock.d.ts +9 -0
- package/dist/library/lock.js +121 -0
- package/dist/library/lock.js.map +1 -0
- package/dist/library/membership.d.ts +51 -0
- package/dist/library/membership.js +799 -0
- package/dist/library/membership.js.map +1 -0
- package/dist/library/query-helpers.d.ts +45 -0
- package/dist/library/query-helpers.js +45 -0
- package/dist/library/query-helpers.js.map +1 -0
- package/dist/library/query.d.ts +45 -0
- package/dist/library/query.js +422 -0
- package/dist/library/query.js.map +1 -0
- package/dist/library/registry.d.ts +39 -0
- package/dist/library/registry.js +591 -0
- package/dist/library/registry.js.map +1 -0
- package/dist/library/search-index.d.ts +87 -0
- package/dist/library/search-index.js +473 -0
- package/dist/library/search-index.js.map +1 -0
- package/dist/library/search-query.d.ts +32 -0
- package/dist/library/search-query.js +418 -0
- package/dist/library/search-query.js.map +1 -0
- package/dist/library/segments.d.ts +3 -0
- package/dist/library/segments.js +16 -0
- package/dist/library/segments.js.map +1 -0
- package/dist/maintenance/upgrade.d.ts +54 -0
- package/dist/maintenance/upgrade.js +199 -0
- package/dist/maintenance/upgrade.js.map +1 -0
- package/dist/object-stream.d.ts +170 -0
- package/dist/object-stream.js +732 -0
- package/dist/object-stream.js.map +1 -0
- package/dist/retrieval/query/archive-view/backlinks.d.ts +38 -0
- package/dist/retrieval/query/archive-view/backlinks.js +200 -0
- package/dist/retrieval/query/archive-view/backlinks.js.map +1 -0
- package/dist/retrieval/query/archive-view/collection.d.ts +33 -0
- package/dist/retrieval/query/archive-view/collection.js +327 -0
- package/dist/retrieval/query/archive-view/collection.js.map +1 -0
- package/dist/retrieval/query/archive-view/core.d.ts +44 -0
- package/dist/retrieval/query/archive-view/core.js +165 -0
- package/dist/retrieval/query/archive-view/core.js.map +1 -0
- package/dist/retrieval/query/archive-view/evidence-hydration.d.ts +41 -0
- package/dist/retrieval/query/archive-view/evidence-hydration.js +311 -0
- package/dist/retrieval/query/archive-view/evidence-hydration.js.map +1 -0
- package/dist/retrieval/query/archive-view/evidence.d.ts +31 -0
- package/dist/retrieval/query/archive-view/evidence.js +166 -0
- package/dist/retrieval/query/archive-view/evidence.js.map +1 -0
- package/dist/retrieval/query/archive-view/find.d.ts +41 -0
- package/dist/retrieval/query/archive-view/find.js +289 -0
- package/dist/retrieval/query/archive-view/find.js.map +1 -0
- package/dist/retrieval/query/archive-view/helper/constants.d.ts +15 -0
- package/dist/retrieval/query/archive-view/helper/constants.js +20 -0
- package/dist/retrieval/query/archive-view/helper/constants.js.map +1 -0
- package/dist/retrieval/query/archive-view/helper/index.d.ts +34 -0
- package/dist/retrieval/query/archive-view/helper/index.js +9 -0
- package/dist/retrieval/query/archive-view/helper/index.js.map +1 -0
- package/dist/retrieval/query/archive-view/helper/meta.d.ts +17 -0
- package/dist/retrieval/query/archive-view/helper/meta.js +57 -0
- package/dist/retrieval/query/archive-view/helper/meta.js.map +1 -0
- package/dist/retrieval/query/archive-view/helper/parse.d.ts +38 -0
- package/dist/retrieval/query/archive-view/helper/parse.js +71 -0
- package/dist/retrieval/query/archive-view/helper/parse.js.map +1 -0
- package/dist/retrieval/query/archive-view/helper/position.d.ts +39 -0
- package/dist/retrieval/query/archive-view/helper/position.js +75 -0
- package/dist/retrieval/query/archive-view/helper/position.js.map +1 -0
- package/dist/retrieval/query/archive-view/helper/results.d.ts +45 -0
- package/dist/retrieval/query/archive-view/helper/results.js +153 -0
- package/dist/retrieval/query/archive-view/helper/results.js.map +1 -0
- package/dist/retrieval/query/archive-view/helper/sort.d.ts +35 -0
- package/dist/retrieval/query/archive-view/helper/sort.js +88 -0
- package/dist/retrieval/query/archive-view/helper/sort.js.map +1 -0
- package/dist/retrieval/query/archive-view/helper/text.d.ts +46 -0
- package/dist/retrieval/query/archive-view/helper/text.js +91 -0
- package/dist/retrieval/query/archive-view/helper/text.js.map +1 -0
- package/dist/retrieval/query/archive-view/helper/uri.d.ts +4 -0
- package/dist/retrieval/query/archive-view/helper/uri.js +12 -0
- package/dist/retrieval/query/archive-view/helper/uri.js.map +1 -0
- package/dist/retrieval/query/archive-view/helpers.d.ts +34 -0
- package/dist/retrieval/query/archive-view/helpers.js +2 -0
- package/dist/retrieval/query/archive-view/helpers.js.map +1 -0
- package/dist/retrieval/query/archive-view/index-state.d.ts +35 -0
- package/dist/retrieval/query/archive-view/index-state.js +191 -0
- package/dist/retrieval/query/archive-view/index-state.js.map +1 -0
- package/dist/retrieval/query/archive-view/index.d.ts +41 -0
- package/dist/retrieval/query/archive-view/index.js +51 -0
- package/dist/retrieval/query/archive-view/index.js.map +1 -0
- package/dist/retrieval/query/archive-view/knowledge.d.ts +45 -0
- package/dist/retrieval/query/archive-view/knowledge.js +99 -0
- package/dist/retrieval/query/archive-view/knowledge.js.map +1 -0
- package/dist/retrieval/query/archive-view/pack.d.ts +30 -0
- package/dist/retrieval/query/archive-view/pack.js +49 -0
- package/dist/retrieval/query/archive-view/pack.js.map +1 -0
- package/dist/retrieval/query/archive-view/pages.d.ts +41 -0
- package/dist/retrieval/query/archive-view/pages.js +341 -0
- package/dist/retrieval/query/archive-view/pages.js.map +1 -0
- package/dist/retrieval/query/archive-view/references.d.ts +88 -0
- package/dist/retrieval/query/archive-view/references.js +287 -0
- package/dist/retrieval/query/archive-view/references.js.map +1 -0
- package/dist/retrieval/query/archive-view/related/core.d.ts +37 -0
- package/dist/retrieval/query/archive-view/related/core.js +163 -0
- package/dist/retrieval/query/archive-view/related/core.js.map +1 -0
- package/dist/retrieval/query/archive-view/related/entity.d.ts +33 -0
- package/dist/retrieval/query/archive-view/related/entity.js +93 -0
- package/dist/retrieval/query/archive-view/related/entity.js.map +1 -0
- package/dist/retrieval/query/archive-view/related/index.d.ts +37 -0
- package/dist/retrieval/query/archive-view/related/index.js +7 -0
- package/dist/retrieval/query/archive-view/related/index.js.map +1 -0
- package/dist/retrieval/query/archive-view/related/pagination.d.ts +31 -0
- package/dist/retrieval/query/archive-view/related/pagination.js +90 -0
- package/dist/retrieval/query/archive-view/related/pagination.js.map +1 -0
- package/dist/retrieval/query/archive-view/related/query.d.ts +31 -0
- package/dist/retrieval/query/archive-view/related/query.js +145 -0
- package/dist/retrieval/query/archive-view/related/query.js.map +1 -0
- package/dist/retrieval/query/archive-view/related/sort.d.ts +32 -0
- package/dist/retrieval/query/archive-view/related/sort.js +85 -0
- package/dist/retrieval/query/archive-view/related/sort.js.map +1 -0
- package/dist/retrieval/query/archive-view/related/wikipage.d.ts +37 -0
- package/dist/retrieval/query/archive-view/related/wikipage.js +43 -0
- package/dist/retrieval/query/archive-view/related/wikipage.js.map +1 -0
- package/dist/retrieval/query/archive-view/search/bucket-hydration.d.ts +31 -0
- package/dist/retrieval/query/archive-view/search/bucket-hydration.js +58 -0
- package/dist/retrieval/query/archive-view/search/bucket-hydration.js.map +1 -0
- package/dist/retrieval/query/archive-view/search/bucket-order.d.ts +36 -0
- package/dist/retrieval/query/archive-view/search/bucket-order.js +64 -0
- package/dist/retrieval/query/archive-view/search/bucket-order.js.map +1 -0
- package/dist/retrieval/query/archive-view/search/bucket.d.ts +30 -0
- package/dist/retrieval/query/archive-view/search/bucket.js +3 -0
- package/dist/retrieval/query/archive-view/search/bucket.js.map +1 -0
- package/dist/retrieval/query/archive-view/search/buckets.d.ts +42 -0
- package/dist/retrieval/query/archive-view/search/buckets.js +302 -0
- package/dist/retrieval/query/archive-view/search/buckets.js.map +1 -0
- package/dist/retrieval/query/archive-view/search/cache-input.d.ts +45 -0
- package/dist/retrieval/query/archive-view/search/cache-input.js +255 -0
- package/dist/retrieval/query/archive-view/search/cache-input.js.map +1 -0
- package/dist/retrieval/query/archive-view/search/core.d.ts +31 -0
- package/dist/retrieval/query/archive-view/search/core.js +388 -0
- package/dist/retrieval/query/archive-view/search/core.js.map +1 -0
- package/dist/retrieval/query/archive-view/search/hydration.d.ts +51 -0
- package/dist/retrieval/query/archive-view/search/hydration.js +234 -0
- package/dist/retrieval/query/archive-view/search/hydration.js.map +1 -0
- package/dist/retrieval/query/archive-view/search/index.d.ts +35 -0
- package/dist/retrieval/query/archive-view/search/index.js +7 -0
- package/dist/retrieval/query/archive-view/search/index.js.map +1 -0
- package/dist/retrieval/query/archive-view/source-evidence/core.d.ts +60 -0
- package/dist/retrieval/query/archive-view/source-evidence/core.js +330 -0
- package/dist/retrieval/query/archive-view/source-evidence/core.js.map +1 -0
- package/dist/retrieval/query/archive-view/source-evidence/index.d.ts +30 -0
- package/dist/retrieval/query/archive-view/source-evidence/index.js +5 -0
- package/dist/retrieval/query/archive-view/source-evidence/index.js.map +1 -0
- package/dist/retrieval/query/archive-view/source-evidence/pagination.d.ts +46 -0
- package/dist/retrieval/query/archive-view/source-evidence/pagination.js +82 -0
- package/dist/retrieval/query/archive-view/source-evidence/pagination.js.map +1 -0
- package/dist/retrieval/query/archive-view/source-evidence/ranges.d.ts +47 -0
- package/dist/retrieval/query/archive-view/source-evidence/ranges.js +209 -0
- package/dist/retrieval/query/archive-view/source-evidence/ranges.js.map +1 -0
- package/dist/retrieval/query/archive-view/source-evidence/read.d.ts +31 -0
- package/dist/retrieval/query/archive-view/source-evidence/read.js +49 -0
- package/dist/retrieval/query/archive-view/source-evidence/read.js.map +1 -0
- package/dist/retrieval/query/archive-view/source.d.ts +30 -0
- package/dist/retrieval/query/archive-view/source.js +2 -0
- package/dist/retrieval/query/archive-view/source.js.map +1 -0
- package/dist/retrieval/query/archive-view/text-streams.d.ts +44 -0
- package/dist/retrieval/query/archive-view/text-streams.js +160 -0
- package/dist/retrieval/query/archive-view/text-streams.js.map +1 -0
- package/dist/retrieval/query/archive-view/types.d.ts +363 -0
- package/dist/retrieval/query/archive-view/types.js +1 -0
- package/dist/retrieval/query/continuation-cursor/core.d.ts +6 -0
- package/dist/retrieval/query/continuation-cursor/core.js +82 -0
- package/dist/retrieval/query/continuation-cursor/core.js.map +1 -0
- package/dist/retrieval/query/continuation-cursor/index.d.ts +2 -0
- package/dist/retrieval/query/continuation-cursor/index.js +3 -0
- package/dist/retrieval/query/continuation-cursor/index.js.map +1 -0
- package/dist/retrieval/query/continuation-cursor/payload.d.ts +12 -0
- package/dist/retrieval/query/continuation-cursor/payload.js +285 -0
- package/dist/retrieval/query/continuation-cursor/payload.js.map +1 -0
- package/dist/retrieval/query/continuation-cursor/store.d.ts +10 -0
- package/dist/retrieval/query/continuation-cursor/store.js +65 -0
- package/dist/retrieval/query/continuation-cursor/store.js.map +1 -0
- package/dist/retrieval/query/continuation-cursor/types.d.ts +72 -0
- package/dist/retrieval/query/continuation-cursor/types.js +1 -0
- package/dist/retrieval/query/continuation-cursor/types.js.map +1 -0
- package/dist/retrieval/query/index.d.ts +47 -0
- package/dist/retrieval/query/index.js +63 -0
- package/dist/retrieval/query/index.js.map +1 -0
- package/dist/retrieval/query/lexical-search.js.map +1 -0
- package/dist/retrieval/query/search-cache/buckets.d.ts +32 -0
- package/dist/retrieval/query/search-cache/buckets.js +87 -0
- package/dist/retrieval/query/search-cache/buckets.js.map +1 -0
- package/dist/retrieval/query/search-cache/cursor.d.ts +42 -0
- package/dist/retrieval/query/search-cache/cursor.js +84 -0
- package/dist/retrieval/query/search-cache/cursor.js.map +1 -0
- package/dist/retrieval/query/search-cache/database.d.ts +7 -0
- package/dist/retrieval/query/search-cache/database.js +47 -0
- package/dist/retrieval/query/search-cache/database.js.map +1 -0
- package/dist/retrieval/query/search-cache/gc.d.ts +6 -0
- package/dist/retrieval/query/search-cache/gc.js +110 -0
- package/dist/retrieval/query/search-cache/gc.js.map +1 -0
- package/dist/retrieval/query/search-cache/hits.d.ts +42 -0
- package/dist/retrieval/query/search-cache/hits.js +446 -0
- package/dist/retrieval/query/search-cache/hits.js.map +1 -0
- package/dist/retrieval/query/search-cache/ids.d.ts +32 -0
- package/dist/retrieval/query/search-cache/ids.js +48 -0
- package/dist/retrieval/query/search-cache/ids.js.map +1 -0
- package/dist/retrieval/query/search-cache/index.d.ts +33 -0
- package/dist/retrieval/query/search-cache/index.js +46 -0
- package/dist/retrieval/query/search-cache/index.js.map +1 -0
- package/dist/retrieval/query/search-cache/parsing.d.ts +36 -0
- package/dist/retrieval/query/search-cache/parsing.js +38 -0
- package/dist/retrieval/query/search-cache/parsing.js.map +1 -0
- package/dist/retrieval/query/search-cache/schema.d.ts +7 -0
- package/dist/retrieval/query/search-cache/schema.js +117 -0
- package/dist/retrieval/query/search-cache/schema.js.map +1 -0
- package/dist/retrieval/query/search-cache/scores.d.ts +4 -0
- package/dist/retrieval/query/search-cache/scores.js +12 -0
- package/dist/retrieval/query/search-cache/scores.js.map +1 -0
- package/dist/retrieval/query/search-cache/sessions.d.ts +45 -0
- package/dist/retrieval/query/search-cache/sessions.js +330 -0
- package/dist/retrieval/query/search-cache/sessions.js.map +1 -0
- package/dist/retrieval/query/search-cache/store.d.ts +23 -0
- package/dist/retrieval/query/search-cache/store.js +111 -0
- package/dist/retrieval/query/search-cache/store.js.map +1 -0
- package/dist/retrieval/query/search-cache/types.d.ts +164 -0
- package/dist/retrieval/query/search-cache/types.js +9 -0
- package/dist/retrieval/query/search-cache/types.js.map +1 -0
- package/dist/retrieval/query/view.d.ts +41 -0
- package/dist/retrieval/query/view.js +2 -0
- package/dist/retrieval/query/view.js.map +1 -0
- package/dist/retrieval/search-index/index.d.ts +33 -0
- package/dist/retrieval/search-index/index.js +41 -0
- package/dist/retrieval/search-index/index.js.map +1 -0
- package/dist/retrieval/search-index/search/build.d.ts +39 -0
- package/dist/retrieval/search-index/search/build.js +212 -0
- package/dist/retrieval/search-index/search/build.js.map +1 -0
- package/dist/retrieval/search-index/search/core.d.ts +33 -0
- package/dist/retrieval/search-index/search/core.js +8 -0
- package/dist/retrieval/search-index/search/core.js.map +1 -0
- package/dist/retrieval/search-index/search/dirty.d.ts +30 -0
- package/dist/retrieval/search-index/search/dirty.js +28 -0
- package/dist/retrieval/search-index/search/dirty.js.map +1 -0
- package/dist/retrieval/search-index/search/errors.d.ts +3 -0
- package/dist/retrieval/search-index/search/errors.js +8 -0
- package/dist/retrieval/search-index/search/errors.js.map +1 -0
- package/dist/retrieval/search-index/search/fingerprint.d.ts +8 -0
- package/dist/retrieval/search-index/search/fingerprint.js +51 -0
- package/dist/retrieval/search-index/search/fingerprint.js.map +1 -0
- package/dist/retrieval/search-index/search/helpers.d.ts +44 -0
- package/dist/retrieval/search-index/search/helpers.js +109 -0
- package/dist/retrieval/search-index/search/helpers.js.map +1 -0
- package/dist/retrieval/search-index/search/index.d.ts +34 -0
- package/dist/retrieval/search-index/search/index.js +3 -0
- package/dist/retrieval/search-index/search/index.js.map +1 -0
- package/dist/retrieval/search-index/search/match.d.ts +34 -0
- package/dist/retrieval/search-index/search/match.js +82 -0
- package/dist/retrieval/search-index/search/match.js.map +1 -0
- package/dist/retrieval/search-index/search/query.d.ts +44 -0
- package/dist/retrieval/search-index/search/query.js +219 -0
- package/dist/retrieval/search-index/search/query.js.map +1 -0
- package/dist/retrieval/search-index/search/settings.d.ts +29 -0
- package/dist/retrieval/search-index/search/settings.js +35 -0
- package/dist/retrieval/search-index/search/settings.js.map +1 -0
- package/dist/retrieval/search-index/search/status.d.ts +31 -0
- package/dist/retrieval/search-index/search/status.js +70 -0
- package/dist/retrieval/search-index/search/status.js.map +1 -0
- package/dist/retrieval/search-index/search/tokenizer.js +225 -0
- package/dist/retrieval/search-index/search/tokenizer.js.map +1 -0
- package/dist/retrieval/search-index/search/types.d.ts +79 -0
- package/dist/retrieval/search-index/search/types.js +31 -0
- package/dist/retrieval/search-index/search/types.js.map +1 -0
- package/dist/retrieval/search-index/search/write.d.ts +10 -0
- package/dist/retrieval/search-index/search/write.js +70 -0
- package/dist/retrieval/search-index/search/write.js.map +1 -0
- package/dist/runtime/common/cli-command.js.map +1 -0
- package/dist/runtime/common/data-dir.js +49 -0
- package/dist/runtime/common/data-dir.js.map +1 -0
- package/dist/runtime/common/language.js.map +1 -0
- package/dist/runtime/common/llm-scope.js.map +1 -0
- package/dist/runtime/common/logging.js.map +1 -0
- package/dist/runtime/common/prompts.d.ts +6 -0
- package/dist/runtime/common/prompts.js +25 -0
- package/dist/runtime/common/prompts.js.map +1 -0
- package/dist/runtime/common/template.js.map +1 -0
- package/dist/runtime/common/tinyld-language.js.map +1 -0
- package/dist/runtime/common/wiki-graph/dir.d.ts +19 -0
- package/dist/runtime/common/wiki-graph/dir.js +68 -0
- package/dist/runtime/common/wiki-graph/dir.js.map +1 -0
- package/dist/runtime/common/wiki-graph/index.d.ts +3 -0
- package/dist/runtime/common/wiki-graph/index.js +4 -0
- package/dist/runtime/common/wiki-graph/index.js.map +1 -0
- package/dist/runtime/common/wiki-graph/temp.js +21 -0
- package/dist/runtime/common/wiki-graph/temp.js.map +1 -0
- package/dist/runtime/common/wiki-graph/uri.d.ts +37 -0
- package/dist/runtime/common/wiki-graph/uri.js +288 -0
- package/dist/runtime/common/wiki-graph/uri.js.map +1 -0
- package/dist/runtime/context/index.d.ts +1 -0
- package/dist/runtime/context/index.js +13 -0
- package/dist/runtime/context/index.js.map +1 -0
- package/dist/runtime/context/task.js +111 -0
- package/dist/runtime/context/task.js.map +1 -0
- package/dist/runtime/gc/files.js +141 -0
- package/dist/runtime/gc/files.js.map +1 -0
- package/dist/runtime/gc/index.js.map +1 -0
- package/dist/runtime/gc/lock.js +137 -0
- package/dist/runtime/gc/lock.js.map +1 -0
- package/dist/runtime/gc/runner.js +134 -0
- package/dist/runtime/gc/runner.js.map +1 -0
- package/dist/runtime/gc/temp.js +57 -0
- package/dist/runtime/gc/temp.js.map +1 -0
- package/dist/runtime/gc/types.js +1 -0
- package/dist/runtime/gc/types.js.map +1 -0
- package/dist/runtime/jobs/conflicts.d.ts +16 -0
- package/dist/runtime/jobs/conflicts.js +61 -0
- package/dist/runtime/jobs/conflicts.js.map +1 -0
- package/dist/runtime/jobs/database.d.ts +12 -0
- package/dist/runtime/jobs/database.js +74 -0
- package/dist/runtime/jobs/database.js.map +1 -0
- package/dist/runtime/jobs/events.d.ts +6 -0
- package/dist/runtime/jobs/events.js +29 -0
- package/dist/runtime/jobs/events.js.map +1 -0
- package/dist/runtime/jobs/gc.d.ts +10 -0
- package/dist/runtime/jobs/gc.js +81 -0
- package/dist/runtime/jobs/gc.js.map +1 -0
- package/dist/runtime/jobs/helpers.d.ts +6 -0
- package/dist/runtime/jobs/helpers.js +35 -0
- package/dist/runtime/jobs/helpers.js.map +1 -0
- package/dist/runtime/jobs/index.d.ts +7 -0
- package/dist/runtime/jobs/index.js +42 -0
- package/dist/runtime/jobs/index.js.map +1 -0
- package/dist/runtime/jobs/jobs.d.ts +24 -0
- package/dist/runtime/jobs/jobs.js +416 -0
- package/dist/runtime/jobs/jobs.js.map +1 -0
- package/dist/runtime/jobs/paths.d.ts +9 -0
- package/dist/runtime/jobs/paths.js +48 -0
- package/dist/runtime/jobs/paths.js.map +1 -0
- package/dist/runtime/jobs/progress.d.ts +37 -0
- package/dist/runtime/jobs/progress.js +246 -0
- package/dist/runtime/jobs/progress.js.map +1 -0
- package/dist/runtime/jobs/recovery.d.ts +6 -0
- package/dist/runtime/jobs/recovery.js +40 -0
- package/dist/runtime/jobs/recovery.js.map +1 -0
- package/dist/runtime/jobs/row.d.ts +10 -0
- package/dist/runtime/jobs/row.js +92 -0
- package/dist/runtime/jobs/row.js.map +1 -0
- package/dist/runtime/jobs/schema.d.ts +3 -0
- package/dist/runtime/jobs/schema.js +55 -0
- package/dist/runtime/jobs/schema.js.map +1 -0
- package/dist/runtime/jobs/state.d.ts +13 -0
- package/dist/runtime/jobs/state.js +156 -0
- package/dist/runtime/jobs/state.js.map +1 -0
- package/dist/runtime/jobs/types.d.ts +141 -0
- package/dist/runtime/jobs/types.js +13 -0
- package/dist/runtime/jobs/types.js.map +1 -0
- package/dist/runtime/jobs/worker.d.ts +5 -0
- package/dist/runtime/jobs/worker.js +241 -0
- package/dist/runtime/jobs/worker.js.map +1 -0
- package/dist/runtime/progress/index.js.map +1 -0
- package/dist/runtime/progress/reporter.js.map +1 -0
- package/dist/runtime/progress/tracker.js.map +1 -0
- package/dist/runtime/progress/types.js +1 -0
- package/dist/runtime/progress/types.js.map +1 -0
- package/dist/serial.d.ts +36 -85
- package/dist/serial.js +1 -475
- package/dist/serial.js.map +1 -1
- package/dist/state-lock.d.ts +21 -0
- package/dist/state-lock.js +233 -0
- package/dist/state-lock.js.map +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/archive.d.ts +11 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/archive.js +94 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/archive.js.map +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/database.d.ts +7 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/database.js +28 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/database.js.map +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/extract.d.ts +3 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/extract.js +68 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/extract.js.map +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/index.js +47 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/index.js.map +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/schema.d.ts +3 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/schema.js +41 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/schema.js.map +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/core.d.ts +3 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/core.js +77 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/core.js.map +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/fragments.d.ts +10 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/fragments.js +123 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/fragments.js.map +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/index.d.ts +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/index.js +2 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/index.js.map +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/references.d.ts +5 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/references.js +305 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/references.js.map +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/source-text.d.ts +11 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/source-text.js +62 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/source-text.js.map +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/summaries.d.ts +3 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/summaries.js +45 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/summaries.js.map +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/types.d.ts +19 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/types.js +1 -0
- package/dist/storage/migration/legacy-sdpub/upgrade/text-storage/types.js.map +1 -0
- package/dist/storage/schema-upgrade/index.d.ts +8 -0
- package/dist/storage/schema-upgrade/index.js +308 -0
- package/dist/storage/schema-upgrade/index.js.map +1 -0
- package/dist/storage/wikg/archive/constants.d.ts +6 -0
- package/dist/storage/wikg/archive/constants.js +19 -0
- package/dist/storage/wikg/archive/constants.js.map +1 -0
- package/dist/storage/wikg/archive/document-files.d.ts +11 -0
- package/dist/storage/wikg/archive/document-files.js +70 -0
- package/dist/storage/wikg/archive/document-files.js.map +1 -0
- package/dist/storage/wikg/archive/extract.d.ts +3 -0
- package/dist/storage/wikg/archive/extract.js +37 -0
- package/dist/storage/wikg/archive/extract.js.map +1 -0
- package/dist/storage/wikg/archive/index.d.ts +6 -0
- package/dist/storage/wikg/archive/index.js +25 -0
- package/dist/storage/wikg/archive/index.js.map +1 -0
- package/dist/storage/wikg/archive/manifest.d.ts +11 -0
- package/dist/storage/wikg/archive/manifest.js +60 -0
- package/dist/storage/wikg/archive/manifest.js.map +1 -0
- package/dist/storage/wikg/archive/paths.d.ts +9 -0
- package/dist/storage/wikg/archive/paths.js +46 -0
- package/dist/storage/wikg/archive/paths.js.map +1 -0
- package/dist/storage/wikg/archive/reader.d.ts +17 -0
- package/dist/storage/wikg/archive/reader.js +101 -0
- package/dist/storage/wikg/archive/reader.js.map +1 -0
- package/dist/storage/wikg/archive/types.d.ts +10 -0
- package/dist/storage/wikg/archive/types.js +1 -0
- package/dist/storage/wikg/archive/types.js.map +1 -0
- package/dist/storage/wikg/archive/write.d.ts +8 -0
- package/dist/storage/wikg/archive/write.js +155 -0
- package/dist/storage/wikg/archive/write.js.map +1 -0
- package/dist/storage/wikg/archive/zip.d.ts +13 -0
- package/dist/storage/wikg/archive/zip.js +122 -0
- package/dist/storage/wikg/archive/zip.js.map +1 -0
- package/dist/storage/wikg/archive-uri.d.ts +1 -0
- package/dist/storage/wikg/archive-uri.js +39 -0
- package/dist/storage/wikg/archive-uri.js.map +1 -0
- package/dist/storage/wikg/coordinator.d.ts +29 -0
- package/dist/storage/wikg/coordinator.js +2 -0
- package/dist/storage/wikg/coordinator.js.map +1 -0
- package/dist/storage/wikg/index.d.ts +41 -0
- package/dist/storage/wikg/index.js +68 -0
- package/dist/storage/wikg/index.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/activity.d.ts +4 -0
- package/dist/storage/wikg/wikg-coordinator/activity.js +48 -0
- package/dist/storage/wikg/wikg-coordinator/activity.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/archive-key.d.ts +7 -0
- package/dist/storage/wikg/wikg-coordinator/archive-key.js +38 -0
- package/dist/storage/wikg/wikg-coordinator/archive-key.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/constants.d.ts +9 -0
- package/dist/storage/wikg/wikg-coordinator/constants.js +19 -0
- package/dist/storage/wikg/wikg-coordinator/constants.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/facade.d.ts +40 -0
- package/dist/storage/wikg/wikg-coordinator/facade.js +43 -0
- package/dist/storage/wikg/wikg-coordinator/facade.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/file-store.d.ts +52 -0
- package/dist/storage/wikg/wikg-coordinator/file-store.js +369 -0
- package/dist/storage/wikg/wikg-coordinator/file-store.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/flusher.d.ts +4 -0
- package/dist/storage/wikg/wikg-coordinator/flusher.js +115 -0
- package/dist/storage/wikg/wikg-coordinator/flusher.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/gc.d.ts +5 -0
- package/dist/storage/wikg/wikg-coordinator/gc.js +197 -0
- package/dist/storage/wikg/wikg-coordinator/gc.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/index.d.ts +29 -0
- package/dist/storage/wikg/wikg-coordinator/index.js +11 -0
- package/dist/storage/wikg/wikg-coordinator/index.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/locks.d.ts +19 -0
- package/dist/storage/wikg/wikg-coordinator/locks.js +194 -0
- package/dist/storage/wikg/wikg-coordinator/locks.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/overlays.d.ts +32 -0
- package/dist/storage/wikg/wikg-coordinator/overlays.js +141 -0
- package/dist/storage/wikg/wikg-coordinator/overlays.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/owners.d.ts +15 -0
- package/dist/storage/wikg/wikg-coordinator/owners.js +95 -0
- package/dist/storage/wikg/wikg-coordinator/owners.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/search-index-cache.d.ts +9 -0
- package/dist/storage/wikg/wikg-coordinator/search-index-cache.js +164 -0
- package/dist/storage/wikg/wikg-coordinator/search-index-cache.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/session.d.ts +43 -0
- package/dist/storage/wikg/wikg-coordinator/session.js +147 -0
- package/dist/storage/wikg/wikg-coordinator/session.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/state.d.ts +16 -0
- package/dist/storage/wikg/wikg-coordinator/state.js +258 -0
- package/dist/storage/wikg/wikg-coordinator/state.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/types.d.ts +28 -0
- package/dist/storage/wikg/wikg-coordinator/types.js +1 -0
- package/dist/storage/wikg/wikg-coordinator/types.js.map +1 -0
- package/dist/storage/wikg/wikg-coordinator/workspace.d.ts +8 -0
- package/dist/storage/wikg/wikg-coordinator/workspace.js +60 -0
- package/dist/storage/wikg/wikg-coordinator/workspace.js.map +1 -0
- package/dist/storage/wikg/wiki-graph-archive-file.d.ts +45 -0
- package/dist/storage/wikg/wiki-graph-archive-file.js +78 -0
- package/dist/storage/wikg/wiki-graph-archive-file.js.map +1 -0
- package/dist/text/editor/clue.d.ts +40 -0
- package/dist/text/editor/clue.js.map +1 -0
- package/dist/text/editor/compression.d.ts +52 -0
- package/dist/text/editor/compression.js +253 -0
- package/dist/text/editor/compression.js.map +1 -0
- package/dist/text/editor/compressor.d.ts +19 -0
- package/dist/text/editor/compressor.js +123 -0
- package/dist/text/editor/compressor.js.map +1 -0
- package/dist/text/editor/feedback.d.ts +16 -0
- package/dist/text/editor/feedback.js.map +1 -0
- package/dist/text/editor/index.d.ts +30 -0
- package/dist/text/editor/index.js +5 -0
- package/dist/text/editor/index.js.map +1 -0
- package/dist/text/editor/language-review.d.ts +14 -0
- package/dist/text/editor/language-review.js +35 -0
- package/dist/text/editor/language-review.js.map +1 -0
- package/dist/text/editor/log.d.ts +50 -0
- package/dist/text/editor/log.js +202 -0
- package/dist/text/editor/log.js.map +1 -0
- package/dist/text/editor/markup.d.ts +18 -0
- package/dist/text/editor/markup.js +294 -0
- package/dist/text/editor/markup.js.map +1 -0
- package/dist/text/editor/prompt-templates.js.map +1 -0
- package/dist/text/editor/response.js.map +1 -0
- package/dist/text/editor/review.d.ts +47 -0
- package/dist/text/editor/review.js +189 -0
- package/dist/text/editor/review.js.map +1 -0
- package/dist/text/editor/types.js +21 -0
- package/dist/text/editor/types.js.map +1 -0
- package/dist/text/output/epub/archive.js.map +1 -0
- package/dist/text/output/epub/book.d.ts +28 -0
- package/dist/text/output/epub/book.js.map +1 -0
- package/dist/text/output/epub/content.js.map +1 -0
- package/dist/text/output/epub/index.d.ts +33 -0
- package/dist/text/output/epub/index.js.map +1 -0
- package/dist/text/output/epub/model.js.map +1 -0
- package/dist/text/output/epub/navigation.js.map +1 -0
- package/dist/text/output/epub/package.js.map +1 -0
- package/dist/text/output/epub/shared.js.map +1 -0
- package/dist/text/output/epub/templates.js +26 -0
- package/dist/text/output/epub/templates.js.map +1 -0
- package/dist/text/output/index.d.ts +27 -0
- package/dist/text/output/index.js.map +1 -0
- package/dist/text/output/plain-text.d.ts +31 -0
- package/dist/text/output/plain-text.js.map +1 -0
- package/dist/text/reader/attention/core.d.ts +39 -0
- package/dist/text/reader/attention/core.js +123 -0
- package/dist/text/reader/attention/core.js.map +1 -0
- package/dist/text/reader/attention/index.d.ts +9 -0
- package/dist/text/reader/attention/index.js +5 -0
- package/dist/text/reader/attention/index.js.map +1 -0
- package/dist/text/reader/attention/wave-reflection.d.ts +21 -0
- package/dist/text/reader/attention/wave-reflection.js.map +1 -0
- package/dist/text/reader/attention/working-memory.d.ts +28 -0
- package/dist/text/reader/attention/working-memory.js.map +1 -0
- package/dist/text/reader/chunk-batch/extract.d.ts +13 -0
- package/dist/text/reader/chunk-batch/extract.js.map +1 -0
- package/dist/text/reader/chunk-batch/extractor.d.ts +17 -0
- package/dist/text/reader/chunk-batch/extractor.js +337 -0
- package/dist/text/reader/chunk-batch/extractor.js.map +1 -0
- package/dist/text/reader/chunk-batch/fragment-projection.d.ts +34 -0
- package/dist/text/reader/chunk-batch/fragment-projection.js.map +1 -0
- package/dist/text/reader/chunk-batch/index.d.ts +13 -0
- package/dist/text/reader/chunk-batch/index.js +13 -0
- package/dist/text/reader/chunk-batch/index.js.map +1 -0
- package/dist/text/reader/chunk-batch/language.d.ts +9 -0
- package/dist/text/reader/chunk-batch/language.js +23 -0
- package/dist/text/reader/chunk-batch/language.js.map +1 -0
- package/dist/text/reader/chunk-batch/parser/annotations.d.ts +19 -0
- package/dist/text/reader/chunk-batch/parser/annotations.js +34 -0
- package/dist/text/reader/chunk-batch/parser/annotations.js.map +1 -0
- package/dist/text/reader/chunk-batch/parser/core.d.ts +33 -0
- package/dist/text/reader/chunk-batch/parser/core.js +171 -0
- package/dist/text/reader/chunk-batch/parser/core.js.map +1 -0
- package/dist/text/reader/chunk-batch/parser/evidence.d.ts +21 -0
- package/dist/text/reader/chunk-batch/parser/evidence.js +40 -0
- package/dist/text/reader/chunk-batch/parser/evidence.js.map +1 -0
- package/dist/text/reader/chunk-batch/parser/helpers.d.ts +27 -0
- package/dist/text/reader/chunk-batch/parser/helpers.js +98 -0
- package/dist/text/reader/chunk-batch/parser/helpers.js.map +1 -0
- package/dist/text/reader/chunk-batch/parser/index.d.ts +13 -0
- package/dist/text/reader/chunk-batch/parser/index.js +3 -0
- package/dist/text/reader/chunk-batch/parser/index.js.map +1 -0
- package/dist/text/reader/chunk-batch/parser/links.d.ts +17 -0
- package/dist/text/reader/chunk-batch/parser/links.js +44 -0
- package/dist/text/reader/chunk-batch/parser/links.js.map +1 -0
- package/dist/text/reader/chunk-batch/parser/resolver.d.ts +28 -0
- package/dist/text/reader/chunk-batch/parser/resolver.js +267 -0
- package/dist/text/reader/chunk-batch/parser/resolver.js.map +1 -0
- package/dist/text/reader/chunk-batch/parser/schema.d.ts +136 -0
- package/dist/text/reader/chunk-batch/parser/schema.js +71 -0
- package/dist/text/reader/chunk-batch/parser/schema.js.map +1 -0
- package/dist/text/reader/chunk-batch/prompt-templates.js.map +1 -0
- package/dist/text/reader/chunk-batch/types.d.ts +85 -0
- package/dist/text/reader/chunk-batch/types.js +1 -0
- package/dist/text/reader/chunk-batch/types.js.map +1 -0
- package/dist/text/reader/core.d.ts +37 -0
- package/dist/text/reader/core.js +82 -0
- package/dist/text/reader/core.js.map +1 -0
- package/dist/text/reader/index.d.ts +13 -0
- package/dist/text/reader/index.js +7 -0
- package/dist/text/reader/index.js.map +1 -0
- package/dist/text/reader/segment/core.js +9 -0
- package/dist/text/reader/segment/core.js.map +1 -0
- package/dist/text/reader/segment/index.d.ts +2 -0
- package/dist/text/reader/segment/index.js +5 -0
- package/dist/text/reader/segment/index.js.map +1 -0
- package/dist/text/reader/segment/intl-segmenter.js.map +1 -0
- package/dist/text/reader/segment/types.js +1 -0
- package/dist/text/reader/segment/types.js.map +1 -0
- package/dist/text/reader/types.d.ts +29 -0
- package/dist/text/reader/types.js +1 -0
- package/dist/text/reader/types.js.map +1 -0
- package/dist/text/serial/discovery.d.ts +36 -0
- package/dist/text/serial/discovery.js +5 -0
- package/dist/text/serial/discovery.js.map +1 -0
- package/dist/text/serial/fragments.d.ts +67 -0
- package/dist/text/serial/fragments.js +121 -0
- package/dist/text/serial/fragments.js.map +1 -0
- package/dist/text/serial/generation.d.ts +48 -0
- package/dist/text/serial/generation.js +257 -0
- package/dist/text/serial/generation.js.map +1 -0
- package/dist/text/serial/index.d.ts +40 -0
- package/dist/text/serial/index.js +7 -0
- package/dist/text/serial/index.js.map +1 -0
- package/dist/text/serial/options.d.ts +77 -0
- package/dist/text/serial/options.js +17 -0
- package/dist/text/serial/options.js.map +1 -0
- package/dist/text/serial/read.d.ts +28 -0
- package/dist/text/serial/read.js +19 -0
- package/dist/text/serial/read.js.map +1 -0
- package/dist/text/serial/reader-graph.d.ts +39 -0
- package/dist/text/serial/reader-graph.js +27 -0
- package/dist/text/serial/reader-graph.js.map +1 -0
- package/dist/text/serial/record.d.ts +40 -0
- package/dist/text/serial/record.js +21 -0
- package/dist/text/serial/record.js.map +1 -0
- package/dist/text/serial/source.d.ts +39 -0
- package/dist/text/serial/source.js +12 -0
- package/dist/text/serial/source.js.map +1 -0
- package/dist/text/serial/topology.d.ts +43 -0
- package/dist/text/serial/topology.js +64 -0
- package/dist/text/serial/topology.js.map +1 -0
- package/dist/text/source/adapter.js.map +1 -0
- package/dist/text/source/epub/archive.js.map +1 -0
- package/dist/text/source/epub/content.js.map +1 -0
- package/dist/text/source/epub/document.js.map +1 -0
- package/dist/text/source/epub/index.js.map +1 -0
- package/dist/text/source/epub/navigation.js.map +1 -0
- package/dist/text/source/epub/package.js.map +1 -0
- package/dist/text/source/epub/xml.js.map +1 -0
- package/dist/text/source/index.js.map +1 -0
- package/dist/text/source/meta.js.map +1 -0
- package/dist/text/source/plain-text.js.map +1 -0
- package/dist/text/source/toc.d.ts +17 -0
- package/dist/text/source/toc.js +19 -0
- package/dist/text/source/toc.js.map +1 -0
- package/dist/text/source/types.js +1 -0
- package/dist/text/source/types.js.map +1 -0
- package/dist/text/summary-build/artifact.d.ts +44 -0
- package/dist/text/summary-build/artifact.js +157 -0
- package/dist/text/summary-build/artifact.js.map +1 -0
- package/dist/text/summary-build/build.d.ts +37 -0
- package/dist/text/summary-build/build.js +60 -0
- package/dist/text/summary-build/build.js.map +1 -0
- package/dist/text/summary-build/index.d.ts +38 -0
- package/dist/text/summary-build/index.js +4 -0
- package/dist/text/summary-build/index.js.map +1 -0
- package/dist/text/summary-build/schema.d.ts +106 -0
- package/dist/text/summary-build/schema.js +118 -0
- package/dist/text/summary-build/schema.js.map +1 -0
- package/dist/text/summary-build/snapshot/chunk-store.d.ts +17 -0
- package/dist/text/summary-build/snapshot/chunk-store.js +68 -0
- package/dist/text/summary-build/snapshot/chunk-store.js.map +1 -0
- package/dist/text/summary-build/snapshot/empty-stores.d.ts +50 -0
- package/dist/text/summary-build/snapshot/empty-stores.js +60 -0
- package/dist/text/summary-build/snapshot/empty-stores.js.map +1 -0
- package/dist/text/summary-build/snapshot/graph-stores.d.ts +42 -0
- package/dist/text/summary-build/snapshot/graph-stores.js +148 -0
- package/dist/text/summary-build/snapshot/graph-stores.js.map +1 -0
- package/dist/text/summary-build/snapshot/helpers.d.ts +17 -0
- package/dist/text/summary-build/snapshot/helpers.js +65 -0
- package/dist/text/summary-build/snapshot/helpers.js.map +1 -0
- package/dist/text/summary-build/snapshot/index.d.ts +63 -0
- package/dist/text/summary-build/snapshot/index.js +106 -0
- package/dist/text/summary-build/snapshot/index.js.map +1 -0
- package/dist/text/summary-build/snapshot/serial-store.d.ts +29 -0
- package/dist/text/summary-build/snapshot/serial-store.js +92 -0
- package/dist/text/summary-build/snapshot/serial-store.js.map +1 -0
- package/dist/text/summary-build/snapshot-io.d.ts +14 -0
- package/dist/text/summary-build/snapshot-io.js +25 -0
- package/dist/text/summary-build/snapshot-io.js.map +1 -0
- package/dist/text/summary-build/source.d.ts +39 -0
- package/dist/text/summary-build/source.js +30 -0
- package/dist/text/summary-build/source.js.map +1 -0
- package/dist/text/summary-build/types.d.ts +34 -0
- package/dist/text/summary-build/types.js +1 -0
- package/dist/text/summary-build/types.js.map +1 -0
- package/dist/worker-DWasYKWW.d.cts +143 -0
- package/dist/worker.cjs +5560 -2312
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +1 -2
- package/dist/worker.d.ts +2 -2
- package/dist/worker.js +1 -1
- package/dist/worker.js.map +1 -1
- package/package.json +3 -2
- package/dist/archive/query/archive-view.d.ts +0 -26
- package/dist/archive/query/archive-view.js +0 -4540
- package/dist/archive/query/archive-view.js.map +0 -1
- package/dist/archive/query/continuation-cursor.d.ts +0 -61
- package/dist/archive/query/continuation-cursor.js +0 -363
- package/dist/archive/query/continuation-cursor.js.map +0 -1
- package/dist/archive/query/index.d.ts +0 -29
- package/dist/archive/query/index.js +0 -63
- package/dist/archive/query/index.js.map +0 -1
- package/dist/archive/query/lexical-search.js.map +0 -1
- package/dist/archive/query/search-cache.d.ts +0 -192
- package/dist/archive/query/search-cache.js +0 -1248
- package/dist/archive/query/search-cache.js.map +0 -1
- package/dist/archive/search-index/index.d.ts +0 -26
- package/dist/archive/search-index/index.js +0 -29
- package/dist/archive/search-index/index.js.map +0 -1
- package/dist/archive/search-index/search-index.d.ts +0 -26
- package/dist/archive/search-index/search-index.js +0 -555
- package/dist/archive/search-index/search-index.js.map +0 -1
- package/dist/archive/search-index/search-tokenizer.js +0 -225
- package/dist/archive/search-index/search-tokenizer.js.map +0 -1
- package/dist/common/cli-command.js.map +0 -1
- package/dist/common/data-dir.js +0 -48
- package/dist/common/data-dir.js.map +0 -1
- package/dist/common/language.js.map +0 -1
- package/dist/common/llm-scope.js.map +0 -1
- package/dist/common/logging.js.map +0 -1
- package/dist/common/template.js.map +0 -1
- package/dist/common/tinyld-language.js.map +0 -1
- package/dist/common/wiki-graph-dir.d.ts +0 -10
- package/dist/common/wiki-graph-dir.js +0 -41
- package/dist/common/wiki-graph-dir.js.map +0 -1
- package/dist/common/wiki-graph-temp.js +0 -21
- package/dist/common/wiki-graph-temp.js.map +0 -1
- package/dist/common/wiki-graph-uri.d.ts +0 -28
- package/dist/common/wiki-graph-uri.js +0 -171
- package/dist/common/wiki-graph-uri.js.map +0 -1
- package/dist/context/index.d.ts +0 -1
- package/dist/context/index.js +0 -13
- package/dist/context/index.js.map +0 -1
- package/dist/context/task-context.js +0 -111
- package/dist/context/task-context.js.map +0 -1
- package/dist/document/document.d.ts +0 -153
- package/dist/document/document.js +0 -615
- package/dist/document/document.js.map +0 -1
- package/dist/document/fragments.d.ts +0 -63
- package/dist/document/fragments.js +0 -371
- package/dist/document/fragments.js.map +0 -1
- package/dist/document/stores.d.ts +0 -203
- package/dist/document/stores.js +0 -1678
- package/dist/document/stores.js.map +0 -1
- package/dist/document/text-streams.d.ts +0 -86
- package/dist/document/text-streams.js +0 -515
- package/dist/document/text-streams.js.map +0 -1
- package/dist/editor/clue.d.ts +0 -27
- package/dist/editor/clue.js.map +0 -1
- package/dist/editor/compressor.d.ts +0 -18
- package/dist/editor/compressor.js +0 -68
- package/dist/editor/compressor.js.map +0 -1
- package/dist/editor/editor.d.ts +0 -39
- package/dist/editor/editor.js +0 -253
- package/dist/editor/editor.js.map +0 -1
- package/dist/editor/feedback.d.ts +0 -16
- package/dist/editor/feedback.js.map +0 -1
- package/dist/editor/index.d.ts +0 -17
- package/dist/editor/index.js +0 -5
- package/dist/editor/index.js.map +0 -1
- package/dist/editor/language-review.d.ts +0 -14
- package/dist/editor/language-review.js +0 -35
- package/dist/editor/language-review.js.map +0 -1
- package/dist/editor/log.d.ts +0 -37
- package/dist/editor/log.js +0 -202
- package/dist/editor/log.js.map +0 -1
- package/dist/editor/markup.d.ts +0 -20
- package/dist/editor/markup.js +0 -294
- package/dist/editor/markup.js.map +0 -1
- package/dist/editor/prompt-templates.js.map +0 -1
- package/dist/editor/response.js.map +0 -1
- package/dist/editor/review.d.ts +0 -34
- package/dist/editor/review.js +0 -189
- package/dist/editor/review.js.map +0 -1
- package/dist/editor/types.js +0 -21
- package/dist/editor/types.js.map +0 -1
- package/dist/evidence-selection/anchor-resolver.d.ts +0 -43
- package/dist/evidence-selection/anchor-resolver.js +0 -783
- package/dist/evidence-selection/anchor-resolver.js.map +0 -1
- package/dist/evidence-selection/anchor-types.d.ts +0 -27
- package/dist/evidence-selection/anchor-types.js +0 -1
- package/dist/evidence-selection/index.d.ts +0 -8
- package/dist/evidence-selection/index.js +0 -32
- package/dist/evidence-selection/index.js.map +0 -1
- package/dist/evidence-selection/prompt.js.map +0 -1
- package/dist/evidence-selection/quote-score.js.map +0 -1
- package/dist/evidence-selection/selection-resolver.js +0 -303
- package/dist/evidence-selection/selection-resolver.js.map +0 -1
- package/dist/evidence-selection/text.js.map +0 -1
- package/dist/facade/app.d.ts +0 -75
- package/dist/facade/app.js +0 -141
- package/dist/facade/app.js.map +0 -1
- package/dist/facade/build-queue.d.ts +0 -181
- package/dist/facade/build-queue.js +0 -1442
- package/dist/facade/build-queue.js.map +0 -1
- package/dist/facade/chapter-build.d.ts +0 -60
- package/dist/facade/chapter-build.js +0 -1020
- package/dist/facade/chapter-build.js.map +0 -1
- package/dist/facade/chapter.d.ts +0 -168
- package/dist/facade/chapter.js +0 -944
- package/dist/facade/chapter.js.map +0 -1
- package/dist/facade/digest.d.ts +0 -55
- package/dist/facade/digest.js +0 -168
- package/dist/facade/digest.js.map +0 -1
- package/dist/facade/graph.d.ts +0 -60
- package/dist/facade/graph.js +0 -203
- package/dist/facade/graph.js.map +0 -1
- package/dist/facade/import.d.ts +0 -49
- package/dist/facade/import.js +0 -262
- package/dist/facade/import.js.map +0 -1
- package/dist/facade/index.d.ts +0 -39
- package/dist/facade/index.js +0 -171
- package/dist/facade/index.js.map +0 -1
- package/dist/facade/knowledge-graph-build.d.ts +0 -75
- package/dist/facade/knowledge-graph-build.js +0 -897
- package/dist/facade/knowledge-graph-build.js.map +0 -1
- package/dist/facade/llm-sampling.d.ts +0 -11
- package/dist/facade/llm-sampling.js +0 -58
- package/dist/facade/llm-sampling.js.map +0 -1
- package/dist/facade/wiki-graph-archive.d.ts +0 -41
- package/dist/facade/wiki-graph-archive.js +0 -130
- package/dist/facade/wiki-graph-archive.js.map +0 -1
- package/dist/gc/files.js +0 -141
- package/dist/gc/files.js.map +0 -1
- package/dist/gc/index.js.map +0 -1
- package/dist/gc/lock.js +0 -137
- package/dist/gc/lock.js.map +0 -1
- package/dist/gc/runner.js +0 -129
- package/dist/gc/runner.js.map +0 -1
- package/dist/gc/tmp-gc.js +0 -57
- package/dist/gc/tmp-gc.js.map +0 -1
- package/dist/guaranteed/classifier.js.map +0 -1
- package/dist/guaranteed/errors.js.map +0 -1
- package/dist/guaranteed/index.js.map +0 -1
- package/dist/guaranteed/request.js.map +0 -1
- package/dist/guaranteed/response.js.map +0 -1
- package/dist/index-B8NNnQ8P.d.ts +0 -424
- package/dist/legacy-sdpub/upgrade.js +0 -795
- package/dist/legacy-sdpub/upgrade.js.map +0 -1
- package/dist/llm/cache.js +0 -35
- package/dist/llm/cache.js.map +0 -1
- package/dist/llm/client.d.ts +0 -26
- package/dist/llm/client.js +0 -572
- package/dist/llm/client.js.map +0 -1
- package/dist/llm/context.js +0 -78
- package/dist/llm/context.js.map +0 -1
- package/dist/llm/errors.js.map +0 -1
- package/dist/llm/index.d.ts +0 -7
- package/dist/llm/index.js +0 -17
- package/dist/llm/index.js.map +0 -1
- package/dist/llm/request-log.js +0 -35
- package/dist/llm/request-log.js.map +0 -1
- package/dist/llm/sampling.js.map +0 -1
- package/dist/output/epub/archive.js.map +0 -1
- package/dist/output/epub/book.d.ts +0 -15
- package/dist/output/epub/book.js.map +0 -1
- package/dist/output/epub/content.js.map +0 -1
- package/dist/output/epub/index.d.ts +0 -20
- package/dist/output/epub/index.js.map +0 -1
- package/dist/output/epub/navigation.js.map +0 -1
- package/dist/output/epub/package.js.map +0 -1
- package/dist/output/epub/shared.js.map +0 -1
- package/dist/output/epub/templates.js +0 -26
- package/dist/output/epub/templates.js.map +0 -1
- package/dist/output/index.d.ts +0 -14
- package/dist/output/index.js.map +0 -1
- package/dist/output/plain-text.d.ts +0 -18
- package/dist/output/plain-text.js.map +0 -1
- package/dist/progress/index.js.map +0 -1
- package/dist/progress/reporter.js.map +0 -1
- package/dist/progress/tracker.js.map +0 -1
- package/dist/reader/attention/attention.d.ts +0 -39
- package/dist/reader/attention/attention.js +0 -123
- package/dist/reader/attention/attention.js.map +0 -1
- package/dist/reader/attention/index.d.ts +0 -9
- package/dist/reader/attention/index.js +0 -5
- package/dist/reader/attention/index.js.map +0 -1
- package/dist/reader/attention/wave-reflection.d.ts +0 -21
- package/dist/reader/attention/wave-reflection.js.map +0 -1
- package/dist/reader/attention/working-memory.d.ts +0 -28
- package/dist/reader/attention/working-memory.js.map +0 -1
- package/dist/reader/chunk-batch/extract.d.ts +0 -13
- package/dist/reader/chunk-batch/extract.js.map +0 -1
- package/dist/reader/chunk-batch/extractor.d.ts +0 -17
- package/dist/reader/chunk-batch/extractor.js +0 -337
- package/dist/reader/chunk-batch/extractor.js.map +0 -1
- package/dist/reader/chunk-batch/fragment-projection.d.ts +0 -34
- package/dist/reader/chunk-batch/fragment-projection.js.map +0 -1
- package/dist/reader/chunk-batch/index.d.ts +0 -12
- package/dist/reader/chunk-batch/index.js +0 -13
- package/dist/reader/chunk-batch/index.js.map +0 -1
- package/dist/reader/chunk-batch/language.d.ts +0 -9
- package/dist/reader/chunk-batch/language.js +0 -23
- package/dist/reader/chunk-batch/language.js.map +0 -1
- package/dist/reader/chunk-batch/parser.d.ts +0 -94
- package/dist/reader/chunk-batch/parser.js +0 -640
- package/dist/reader/chunk-batch/parser.js.map +0 -1
- package/dist/reader/chunk-batch/prompt-templates.js.map +0 -1
- package/dist/reader/chunk-batch/types.d.ts +0 -85
- package/dist/reader/index.d.ts +0 -13
- package/dist/reader/index.js +0 -7
- package/dist/reader/index.js.map +0 -1
- package/dist/reader/reader.d.ts +0 -37
- package/dist/reader/reader.js +0 -82
- package/dist/reader/reader.js.map +0 -1
- package/dist/reader/segment/index.d.ts +0 -2
- package/dist/reader/segment/index.js +0 -5
- package/dist/reader/segment/index.js.map +0 -1
- package/dist/reader/segment/intl-segmenter.js.map +0 -1
- package/dist/reader/segment/segment.js +0 -9
- package/dist/reader/segment/segment.js.map +0 -1
- package/dist/reader/types.d.ts +0 -29
- package/dist/source/epub/archive.js.map +0 -1
- package/dist/source/epub/content.js.map +0 -1
- package/dist/source/epub/document.js.map +0 -1
- package/dist/source/epub/index.js.map +0 -1
- package/dist/source/epub/navigation.js.map +0 -1
- package/dist/source/epub/package.js.map +0 -1
- package/dist/source/epub/xml.js.map +0 -1
- package/dist/source/index.js.map +0 -1
- package/dist/source/meta.js.map +0 -1
- package/dist/source/plain-text.js.map +0 -1
- package/dist/source/toc.d.ts +0 -16
- package/dist/source/toc.js +0 -17
- package/dist/source/toc.js.map +0 -1
- package/dist/topology/grouping.d.ts +0 -15
- package/dist/topology/grouping.js.map +0 -1
- package/dist/topology/index.d.ts +0 -21
- package/dist/topology/index.js +0 -5
- package/dist/topology/index.js.map +0 -1
- package/dist/topology/resource-segmentation.d.ts +0 -13
- package/dist/topology/resource-segmentation.js.map +0 -1
- package/dist/topology/segment-incision.d.ts +0 -18
- package/dist/topology/segment-incision.js.map +0 -1
- package/dist/topology/snake-detector.d.ts +0 -13
- package/dist/topology/snake-detector.js +0 -520
- package/dist/topology/snake-detector.js.map +0 -1
- package/dist/topology/snake-graph-builder.d.ts +0 -14
- package/dist/topology/snake-graph-builder.js +0 -76
- package/dist/topology/snake-graph-builder.js.map +0 -1
- package/dist/topology/topology.d.ts +0 -29
- package/dist/topology/topology.js +0 -348
- package/dist/topology/topology.js.map +0 -1
- package/dist/topology/weights.d.ts +0 -10
- package/dist/topology/weights.js +0 -84
- package/dist/topology/weights.js.map +0 -1
- package/dist/types-FVIqiLC9.d.cts +0 -24
- package/dist/wikg/archive-uri.d.ts +0 -1
- package/dist/wikg/archive-uri.js +0 -37
- package/dist/wikg/archive-uri.js.map +0 -1
- package/dist/wikg/archive.d.ts +0 -28
- package/dist/wikg/archive.js +0 -496
- package/dist/wikg/archive.js.map +0 -1
- package/dist/wikg/index.d.ts +0 -31
- package/dist/wikg/index.js +0 -60
- package/dist/wikg/index.js.map +0 -1
- package/dist/wikg/wikg-coordinator.d.ts +0 -45
- package/dist/wikg/wikg-coordinator.js +0 -1687
- package/dist/wikg/wikg-coordinator.js.map +0 -1
- package/dist/wikg/wiki-graph-archive-file.d.ts +0 -42
- package/dist/wikg/wiki-graph-archive-file.js +0 -78
- package/dist/wikg/wiki-graph-archive-file.js.map +0 -1
- package/dist/wikilink/index.d.ts +0 -10
- package/dist/wikilink/index.js.map +0 -1
- package/dist/wikilink/relation-discovery.d.ts +0 -31
- package/dist/wikilink/relation-discovery.js +0 -477
- package/dist/wikilink/relation-discovery.js.map +0 -1
- package/dist/wikilink/types.d.ts +0 -23
- package/dist/wikilink/window.d.ts +0 -7
- package/dist/wikilink/window.js.map +0 -1
- package/dist/wikimatch/enrichment.d.ts +0 -10
- package/dist/wikimatch/enrichment.js +0 -55
- package/dist/wikimatch/enrichment.js.map +0 -1
- package/dist/wikimatch/index.d.ts +0 -16
- package/dist/wikimatch/index.js +0 -66
- package/dist/wikimatch/index.js.map +0 -1
- package/dist/wikimatch/option-narrowing.d.ts +0 -17
- package/dist/wikimatch/option-narrowing.js.map +0 -1
- package/dist/wikimatch/options.d.ts +0 -14
- package/dist/wikimatch/options.js +0 -155
- package/dist/wikimatch/options.js.map +0 -1
- package/dist/wikimatch/policy-judge.d.ts +0 -17
- package/dist/wikimatch/policy-judge.js +0 -430
- package/dist/wikimatch/policy-judge.js.map +0 -1
- package/dist/wikimatch/range-suppression.js.map +0 -1
- package/dist/wikimatch/surface-screening.d.ts +0 -16
- package/dist/wikimatch/surface-screening.js +0 -168
- package/dist/wikimatch/surface-screening.js.map +0 -1
- package/dist/wikimatch/surface-window.d.ts +0 -6
- package/dist/wikimatch/surface-window.js +0 -44
- package/dist/wikimatch/surface-window.js.map +0 -1
- package/dist/wikimatch/types.d.ts +0 -151
- package/dist/wikimatch/wikispine.d.ts +0 -43
- package/dist/wikimatch/wikispine.js.map +0 -1
- package/dist/wikimatch/window.d.ts +0 -6
- package/dist/wikimatch/window.js.map +0 -1
- package/dist/wikimatch/words.js.map +0 -1
- package/dist/wikipage/cache.d.ts +0 -18
- package/dist/wikipage/cache.js +0 -404
- package/dist/wikipage/cache.js.map +0 -1
- package/dist/wikipage/fetch-log.js +0 -143
- package/dist/wikipage/fetch-log.js.map +0 -1
- package/dist/wikipage/index.d.ts +0 -14
- package/dist/wikipage/index.js +0 -17
- package/dist/wikipage/index.js.map +0 -1
- package/dist/wikipage/normalizer.d.ts +0 -14
- package/dist/wikipage/normalizer.js +0 -147
- package/dist/wikipage/normalizer.js.map +0 -1
- package/dist/wikipage/rate-limiter.js.map +0 -1
- package/dist/wikipage/resolver.d.ts +0 -26
- package/dist/wikipage/resolver.js +0 -325
- package/dist/wikipage/resolver.js.map +0 -1
- package/dist/wikipage/types.d.ts +0 -96
- package/dist/wikipage/wikimedia-client.d.ts +0 -48
- package/dist/wikipage/wikimedia-client.js +0 -397
- package/dist/wikipage/wikimedia-client.js.map +0 -1
- package/dist/worker-BgQ0Xl8T.d.cts +0 -181
- /package/dist/{evidence-selection → api/chapter-build}/types.js +0 -0
- /package/dist/{evidence-selection → api/chapter-build}/types.js.map +0 -0
- /package/dist/{facade → api/knowledge-graph-build}/types.js +0 -0
- /package/dist/{facade → api/knowledge-graph-build}/types.js.map +0 -0
- /package/dist/{facade → api}/types.d.ts +0 -0
- /package/dist/{gc → api}/types.js +0 -0
- /package/dist/{gc → api}/types.js.map +0 -0
- /package/dist/{guaranteed → document/directory}/types.js +0 -0
- /package/dist/{guaranteed → document/directory}/types.js.map +0 -0
- /package/dist/{llm → document/stores}/types.js +0 -0
- /package/dist/{llm → document/stores}/types.js.map +0 -0
- /package/dist/{guaranteed → external/guaranteed}/classifier.d.ts +0 -0
- /package/dist/{guaranteed → external/guaranteed}/classifier.js +0 -0
- /package/dist/{guaranteed → external/guaranteed}/errors.d.ts +0 -0
- /package/dist/{guaranteed → external/guaranteed}/errors.js +0 -0
- /package/dist/{guaranteed → external/guaranteed}/index.d.ts +0 -0
- /package/dist/{guaranteed → external/guaranteed}/index.js +0 -0
- /package/dist/{guaranteed → external/guaranteed}/request.d.ts +0 -0
- /package/dist/{guaranteed → external/guaranteed}/request.js +0 -0
- /package/dist/{guaranteed → external/guaranteed}/response.d.ts +0 -0
- /package/dist/{guaranteed → external/guaranteed}/response.js +0 -0
- /package/dist/{guaranteed → external/guaranteed}/types.d.ts +0 -0
- /package/dist/{progress → external/guaranteed}/types.js +0 -0
- /package/dist/{progress → external/guaranteed}/types.js.map +0 -0
- /package/dist/{llm → external/llm}/cache.d.ts +0 -0
- /package/dist/{llm → external/llm}/context.d.ts +0 -0
- /package/dist/{llm → external/llm}/errors.d.ts +0 -0
- /package/dist/{llm → external/llm}/errors.js +0 -0
- /package/dist/{llm → external/llm}/request-log.d.ts +0 -0
- /package/dist/{llm → external/llm}/sampling.d.ts +0 -0
- /package/dist/{llm → external/llm}/sampling.js +0 -0
- /package/dist/{llm → external/llm}/types.d.ts +0 -0
- /package/dist/{reader/chunk-batch → external/llm}/types.js +0 -0
- /package/dist/{reader/chunk-batch → external/llm}/types.js.map +0 -0
- /package/dist/{wikimatch → external/wikimatch}/option-narrowing.js +0 -0
- /package/dist/{wikimatch → external/wikimatch}/range-suppression.d.ts +0 -0
- /package/dist/{wikimatch → external/wikimatch}/range-suppression.js +0 -0
- /package/dist/{reader/segment → external/wikimatch}/types.js +0 -0
- /package/dist/{reader/segment → external/wikimatch}/types.js.map +0 -0
- /package/dist/{wikimatch → external/wikimatch}/wikispine.js +0 -0
- /package/dist/{wikimatch → external/wikimatch}/window.js +0 -0
- /package/dist/{wikimatch → external/wikimatch}/words.d.ts +0 -0
- /package/dist/{wikimatch → external/wikimatch}/words.js +0 -0
- /package/dist/{wikipage → external/wikipage}/fetch-log.d.ts +0 -0
- /package/dist/{wikipage → external/wikipage}/rate-limiter.d.ts +0 -0
- /package/dist/{wikipage → external/wikipage}/rate-limiter.js +0 -0
- /package/dist/{reader → external/wikipage}/types.js +0 -0
- /package/dist/{reader → external/wikipage}/types.js.map +0 -0
- /package/dist/{source → graph/evidence-selection/anchor}/types.js +0 -0
- /package/dist/{source → graph/evidence-selection/anchor}/types.js.map +0 -0
- /package/dist/{evidence-selection → graph/evidence-selection}/prompt.d.ts +0 -0
- /package/dist/{evidence-selection → graph/evidence-selection}/prompt.js +0 -0
- /package/dist/{evidence-selection → graph/evidence-selection}/quote-score.d.ts +0 -0
- /package/dist/{evidence-selection → graph/evidence-selection}/quote-score.js +0 -0
- /package/dist/{evidence-selection/selection-resolver.d.ts → graph/evidence-selection/resolver.d.ts} +0 -0
- /package/dist/{evidence-selection → graph/evidence-selection}/text.d.ts +0 -0
- /package/dist/{evidence-selection → graph/evidence-selection}/text.js +0 -0
- /package/dist/{evidence-selection → graph/evidence-selection}/types.d.ts +0 -0
- /package/dist/{wikilink → graph/evidence-selection}/types.js +0 -0
- /package/dist/{wikilink → graph/evidence-selection}/types.js.map +0 -0
- /package/dist/{wikimatch → graph/knowledge-build}/types.js +0 -0
- /package/dist/{wikimatch → graph/knowledge-build}/types.js.map +0 -0
- /package/dist/{wikipage → graph/reading-build}/types.js +0 -0
- /package/dist/{wikipage → graph/reading-build}/types.js.map +0 -0
- /package/dist/{topology → graph/topology}/grouping.js +0 -0
- /package/dist/{topology → graph/topology}/resource-segmentation.js +0 -0
- /package/dist/{topology → graph/topology}/segment-incision.js +0 -0
- /package/dist/{evidence-selection/anchor-types.js.map → graph/topology/snake/types.js.map} +0 -0
- /package/dist/{wikilink → graph/wikilink}/index.js +0 -0
- /package/dist/{output/epub/model.js.map → graph/wikilink/types.js.map} +0 -0
- /package/dist/{wikilink → graph/wikilink}/window.js +0 -0
- /package/dist/{source/adapter.js.map → retrieval/query/archive-view/types.js.map} +0 -0
- /package/dist/{archive → retrieval}/query/lexical-search.d.ts +0 -0
- /package/dist/{archive → retrieval}/query/lexical-search.js +0 -0
- /package/dist/{archive/search-index/search-tokenizer.d.ts → retrieval/search-index/search/tokenizer.d.ts} +0 -0
- /package/dist/{common → runtime/common}/cli-command.d.ts +0 -0
- /package/dist/{common → runtime/common}/cli-command.js +0 -0
- /package/dist/{common → runtime/common}/data-dir.d.ts +0 -0
- /package/dist/{common → runtime/common}/language.d.ts +0 -0
- /package/dist/{common → runtime/common}/language.js +0 -0
- /package/dist/{common → runtime/common}/llm-scope.d.ts +0 -0
- /package/dist/{common → runtime/common}/llm-scope.js +0 -0
- /package/dist/{common → runtime/common}/logging.d.ts +0 -0
- /package/dist/{common → runtime/common}/logging.js +0 -0
- /package/dist/{common → runtime/common}/template.d.ts +0 -0
- /package/dist/{common → runtime/common}/template.js +0 -0
- /package/dist/{common → runtime/common}/tinyld-language.d.ts +0 -0
- /package/dist/{common → runtime/common}/tinyld-language.js +0 -0
- /package/dist/{common/wiki-graph-temp.d.ts → runtime/common/wiki-graph/temp.d.ts} +0 -0
- /package/dist/{context/task-context.d.ts → runtime/context/task.d.ts} +0 -0
- /package/dist/{gc → runtime/gc}/files.d.ts +0 -0
- /package/dist/{gc → runtime/gc}/index.d.ts +0 -0
- /package/dist/{gc → runtime/gc}/index.js +0 -0
- /package/dist/{gc → runtime/gc}/lock.d.ts +0 -0
- /package/dist/{gc → runtime/gc}/runner.d.ts +0 -0
- /package/dist/{gc/tmp-gc.d.ts → runtime/gc/temp.d.ts} +0 -0
- /package/dist/{gc → runtime/gc}/types.d.ts +0 -0
- /package/dist/{progress → runtime/progress}/index.d.ts +0 -0
- /package/dist/{progress → runtime/progress}/index.js +0 -0
- /package/dist/{progress → runtime/progress}/reporter.d.ts +0 -0
- /package/dist/{progress → runtime/progress}/reporter.js +0 -0
- /package/dist/{progress → runtime/progress}/tracker.d.ts +0 -0
- /package/dist/{progress → runtime/progress}/tracker.js +0 -0
- /package/dist/{progress → runtime/progress}/types.d.ts +0 -0
- /package/dist/{legacy-sdpub/upgrade.d.ts → storage/migration/legacy-sdpub/upgrade/index.d.ts} +0 -0
- /package/dist/{editor → text/editor}/clue.js +0 -0
- /package/dist/{editor → text/editor}/feedback.js +0 -0
- /package/dist/{editor → text/editor}/prompt-templates.d.ts +0 -0
- /package/dist/{editor → text/editor}/prompt-templates.js +0 -0
- /package/dist/{editor → text/editor}/response.d.ts +0 -0
- /package/dist/{editor → text/editor}/response.js +0 -0
- /package/dist/{editor → text/editor}/types.d.ts +0 -0
- /package/dist/{output → text/output}/epub/archive.d.ts +0 -0
- /package/dist/{output → text/output}/epub/archive.js +0 -0
- /package/dist/{output → text/output}/epub/book.js +0 -0
- /package/dist/{output → text/output}/epub/content.d.ts +0 -0
- /package/dist/{output → text/output}/epub/content.js +0 -0
- /package/dist/{output → text/output}/epub/index.js +0 -0
- /package/dist/{output → text/output}/epub/model.d.ts +0 -0
- /package/dist/{output → text/output}/epub/model.js +0 -0
- /package/dist/{output → text/output}/epub/navigation.d.ts +0 -0
- /package/dist/{output → text/output}/epub/navigation.js +0 -0
- /package/dist/{output → text/output}/epub/package.d.ts +0 -0
- /package/dist/{output → text/output}/epub/package.js +0 -0
- /package/dist/{output → text/output}/epub/shared.d.ts +0 -0
- /package/dist/{output → text/output}/epub/shared.js +0 -0
- /package/dist/{output → text/output}/epub/templates.d.ts +0 -0
- /package/dist/{output → text/output}/index.js +0 -0
- /package/dist/{output → text/output}/plain-text.js +0 -0
- /package/dist/{reader → text/reader}/attention/wave-reflection.js +0 -0
- /package/dist/{reader → text/reader}/attention/working-memory.js +0 -0
- /package/dist/{reader → text/reader}/chunk-batch/extract.js +0 -0
- /package/dist/{reader → text/reader}/chunk-batch/fragment-projection.js +0 -0
- /package/dist/{reader → text/reader}/chunk-batch/prompt-templates.d.ts +0 -0
- /package/dist/{reader → text/reader}/chunk-batch/prompt-templates.js +0 -0
- /package/dist/{reader/segment/segment.d.ts → text/reader/segment/core.d.ts} +0 -0
- /package/dist/{reader → text/reader}/segment/intl-segmenter.d.ts +0 -0
- /package/dist/{reader → text/reader}/segment/intl-segmenter.js +0 -0
- /package/dist/{reader → text/reader}/segment/types.d.ts +0 -0
- /package/dist/{source → text/source}/adapter.d.ts +0 -0
- /package/dist/{source → text/source}/adapter.js +0 -0
- /package/dist/{source → text/source}/epub/archive.d.ts +0 -0
- /package/dist/{source → text/source}/epub/archive.js +0 -0
- /package/dist/{source → text/source}/epub/content.d.ts +0 -0
- /package/dist/{source → text/source}/epub/content.js +0 -0
- /package/dist/{source → text/source}/epub/document.d.ts +0 -0
- /package/dist/{source → text/source}/epub/document.js +0 -0
- /package/dist/{source → text/source}/epub/index.d.ts +0 -0
- /package/dist/{source → text/source}/epub/index.js +0 -0
- /package/dist/{source → text/source}/epub/navigation.d.ts +0 -0
- /package/dist/{source → text/source}/epub/navigation.js +0 -0
- /package/dist/{source → text/source}/epub/package.d.ts +0 -0
- /package/dist/{source → text/source}/epub/package.js +0 -0
- /package/dist/{source → text/source}/epub/xml.d.ts +0 -0
- /package/dist/{source → text/source}/epub/xml.js +0 -0
- /package/dist/{source → text/source}/index.d.ts +0 -0
- /package/dist/{source → text/source}/index.js +0 -0
- /package/dist/{source → text/source}/meta.d.ts +0 -0
- /package/dist/{source → text/source}/meta.js +0 -0
- /package/dist/{source → text/source}/plain-text.d.ts +0 -0
- /package/dist/{source → text/source}/plain-text.js +0 -0
- /package/dist/{source → text/source}/types.d.ts +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { LanguageModel, ModelMessage } from 'ai';
|
|
2
2
|
import { Environment } from 'nunjucks';
|
|
3
|
-
import * as Sqlite3Namespace from 'sqlite3';
|
|
4
3
|
import { z } from 'zod';
|
|
5
|
-
import
|
|
6
|
-
import { B as BuildJobProgressReporter } from './worker-
|
|
7
|
-
export {
|
|
4
|
+
import * as Sqlite3Namespace from 'sqlite3';
|
|
5
|
+
import { A as AddBuildJobOptions, B as BuildJob, a as BuildJobListOptions, b as BuildJobTarget, c as BuildJobConflictScope, d as BuildJobEvent, e as BuildJobState, f as BuildJobProgressReporter } from './worker-DWasYKWW.cjs';
|
|
6
|
+
export { g as BuildJobExecutionContext, h as BuildJobProgressCounter, i as BuildJobWorkerOptions, r as runBuildJobWorker } from './worker-DWasYKWW.cjs';
|
|
8
7
|
|
|
9
8
|
declare enum Language {
|
|
10
9
|
Arabic = "Arabic",
|
|
@@ -232,12 +231,90 @@ declare function createEnv(dirPath: string, options?: {
|
|
|
232
231
|
readonly trimBlocks?: boolean;
|
|
233
232
|
}): Environment;
|
|
234
233
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
234
|
+
interface WikiGraphLibraryRecord {
|
|
235
|
+
readonly id: number;
|
|
236
|
+
readonly publicId: string;
|
|
237
|
+
readonly uri: string;
|
|
238
|
+
readonly folderPath: string;
|
|
239
|
+
readonly isDefault: boolean;
|
|
240
|
+
readonly stagingPath: string;
|
|
241
|
+
readonly createdAt: string;
|
|
242
|
+
readonly updatedAt: string;
|
|
243
|
+
}
|
|
244
|
+
interface ParsedWikiGraphLibraryUri {
|
|
245
|
+
readonly archivePublicId?: string;
|
|
246
|
+
readonly kind: "archive" | "archive-collection" | "archive-path" | "archive-tree" | "metadata" | "path" | "registry" | "scope";
|
|
247
|
+
readonly objectUri?: string;
|
|
248
|
+
readonly publicId?: string;
|
|
249
|
+
readonly isDefault: boolean;
|
|
250
|
+
}
|
|
251
|
+
declare function isWikiGraphLibraryUri(uri: string | undefined): uri is string;
|
|
252
|
+
declare function parseWikiGraphLibraryUri(uri: string): ParsedWikiGraphLibraryUri | undefined;
|
|
253
|
+
declare function formatWikiGraphLibraryUri(publicId?: string): string;
|
|
254
|
+
declare function resolveDefaultWikiGraphLibraryDirectoryPath(): string;
|
|
255
|
+
declare function resolveWikiGraphLibraryStagingDirectoryPath(id: number): string;
|
|
256
|
+
declare function ensureDefaultWikiGraphLibrary(): Promise<WikiGraphLibraryRecord>;
|
|
257
|
+
declare function createWikiGraphLibrary(input: {
|
|
258
|
+
readonly folderPath: string;
|
|
259
|
+
}): Promise<WikiGraphLibraryRecord>;
|
|
260
|
+
declare function listWikiGraphLibraries(): Promise<readonly WikiGraphLibraryRecord[]>;
|
|
261
|
+
declare function resolveWikiGraphLibrary(target: ParsedWikiGraphLibraryUri): Promise<WikiGraphLibraryRecord>;
|
|
262
|
+
declare function resolveWikiGraphLibraryById(id: number): Promise<WikiGraphLibraryRecord>;
|
|
263
|
+
declare function listWikiGraphLibraryScope(target: ParsedWikiGraphLibraryUri): Promise<readonly []>;
|
|
264
|
+
declare function removeWikiGraphLibrary(target: ParsedWikiGraphLibraryUri): Promise<WikiGraphLibraryRecord>;
|
|
265
|
+
declare function getWikiGraphLibraryMetadata(target: ParsedWikiGraphLibraryUri): Promise<Readonly<Record<string, unknown>>>;
|
|
266
|
+
declare function replaceWikiGraphLibraryMetadata(target: ParsedWikiGraphLibraryUri, map: Readonly<Record<string, unknown>>): Promise<Readonly<Record<string, unknown>>>;
|
|
267
|
+
declare function putWikiGraphLibraryMetadata(target: ParsedWikiGraphLibraryUri, key: string, value: unknown): Promise<Readonly<Record<string, unknown>>>;
|
|
268
|
+
declare function deleteWikiGraphLibraryMetadataKey(target: ParsedWikiGraphLibraryUri, key: string): Promise<Readonly<Record<string, unknown>>>;
|
|
269
|
+
declare function clearWikiGraphLibraryMetadata(target: ParsedWikiGraphLibraryUri): Promise<Readonly<Record<string, unknown>>>;
|
|
270
|
+
|
|
271
|
+
type WikiGraphLibraryArchiveStatus = "conflict" | "missing" | "present";
|
|
272
|
+
interface WikiGraphLibraryArchiveRecord {
|
|
273
|
+
readonly id: number;
|
|
274
|
+
readonly publicId: string;
|
|
275
|
+
readonly uri: string;
|
|
276
|
+
readonly libraryId: number;
|
|
277
|
+
readonly libraryUri: string;
|
|
278
|
+
readonly relativePath: string;
|
|
279
|
+
readonly path: string;
|
|
280
|
+
readonly exists: boolean;
|
|
281
|
+
readonly status: WikiGraphLibraryArchiveStatus;
|
|
282
|
+
readonly lastSeenMutationToken?: string;
|
|
283
|
+
readonly lastSeenSize?: number;
|
|
284
|
+
readonly lastSeenMtimeMs?: number;
|
|
285
|
+
readonly lastScannedAt?: string;
|
|
286
|
+
readonly createdAt: string;
|
|
287
|
+
readonly updatedAt: string;
|
|
288
|
+
}
|
|
289
|
+
interface WikiGraphLibraryScanResult {
|
|
290
|
+
readonly library: WikiGraphLibraryRecord;
|
|
291
|
+
readonly archives: readonly WikiGraphLibraryArchiveRecord[];
|
|
292
|
+
}
|
|
293
|
+
declare function scanWikiGraphLibrary(target: ParsedWikiGraphLibraryUri): Promise<WikiGraphLibraryScanResult>;
|
|
294
|
+
declare function rebindWikiGraphLibrary(input: {
|
|
295
|
+
readonly target: ParsedWikiGraphLibraryUri;
|
|
296
|
+
readonly folderPath: string;
|
|
297
|
+
}): Promise<WikiGraphLibraryScanResult>;
|
|
298
|
+
declare function listWikiGraphLibraryArchives(target: ParsedWikiGraphLibraryUri): Promise<readonly WikiGraphLibraryArchiveRecord[]>;
|
|
299
|
+
declare function getWikiGraphLibraryArchive(target: ParsedWikiGraphLibraryUri): Promise<WikiGraphLibraryArchiveRecord>;
|
|
300
|
+
declare function getWikiGraphLibraryArchiveById(library: WikiGraphLibraryRecord, archiveId: number): Promise<WikiGraphLibraryArchiveRecord>;
|
|
301
|
+
declare function resolveWikiGraphLibraryArchivePath(archiveLocator: string): Promise<string>;
|
|
302
|
+
declare function addWikiGraphLibraryArchive(input: {
|
|
303
|
+
readonly target: ParsedWikiGraphLibraryUri;
|
|
304
|
+
readonly inputPath: string;
|
|
305
|
+
readonly to?: string;
|
|
306
|
+
}): Promise<WikiGraphLibraryArchiveRecord>;
|
|
307
|
+
declare function finalizeWikiGraphLibraryArchiveWrite(input: {
|
|
308
|
+
readonly target: ParsedWikiGraphLibraryUri;
|
|
309
|
+
}): Promise<boolean>;
|
|
310
|
+
declare function ensureLibraryManagedArchiveHasNoSearchIndex(archivePath: string): Promise<boolean>;
|
|
311
|
+
declare function removeWikiGraphLibraryArchive(input: {
|
|
312
|
+
readonly target: ParsedWikiGraphLibraryUri;
|
|
313
|
+
}): Promise<WikiGraphLibraryArchiveRecord>;
|
|
314
|
+
declare function moveWikiGraphLibraryArchive(input: {
|
|
315
|
+
readonly target: ParsedWikiGraphLibraryUri;
|
|
316
|
+
readonly to: string;
|
|
317
|
+
}): Promise<WikiGraphLibraryArchiveRecord>;
|
|
241
318
|
|
|
242
319
|
type SqliteDatabase = Sqlite3Namespace.Database;
|
|
243
320
|
type SqlBindValue = Buffer | Uint8Array | number | string | null;
|
|
@@ -266,7 +343,6 @@ declare class Database {
|
|
|
266
343
|
declare function openSharedStateDatabase(databasePath: string, schemaSql: string, options?: {
|
|
267
344
|
readonly readonly?: boolean;
|
|
268
345
|
}): Promise<Database>;
|
|
269
|
-
declare function ensureSharedStateDatabaseInitialized(databasePath: string, schemaSql: string): Promise<void>;
|
|
270
346
|
|
|
271
347
|
declare enum ChunkRetention {
|
|
272
348
|
Verbatim = "verbatim",
|
|
@@ -274,15 +350,11 @@ declare enum ChunkRetention {
|
|
|
274
350
|
Focused = "focused",
|
|
275
351
|
Relevant = "relevant"
|
|
276
352
|
}
|
|
277
|
-
declare const isChunkRetention: (value: string) => value is ChunkRetention;
|
|
278
|
-
declare const expectChunkRetention: (value: string) => ChunkRetention;
|
|
279
353
|
declare enum ChunkImportance {
|
|
280
354
|
Critical = "critical",
|
|
281
355
|
Important = "important",
|
|
282
356
|
Helpful = "helpful"
|
|
283
357
|
}
|
|
284
|
-
declare const isChunkImportance: (value: string) => value is ChunkImportance;
|
|
285
|
-
declare const expectChunkImportance: (value: string) => ChunkImportance;
|
|
286
358
|
type SentenceId = readonly [chapterId: number, sentenceIndex: number];
|
|
287
359
|
interface SentenceRecord {
|
|
288
360
|
readonly text: string;
|
|
@@ -406,6 +478,23 @@ interface ObjectMetadataTarget {
|
|
|
406
478
|
readonly tripleObjectQid?: string;
|
|
407
479
|
}
|
|
408
480
|
|
|
481
|
+
declare class TextStreamDraft {
|
|
482
|
+
#private;
|
|
483
|
+
constructor(serialId: number, startSentenceIndex: number, callbacks: {
|
|
484
|
+
readonly discard: () => void;
|
|
485
|
+
readonly finalize: (startSentenceIndex: number, summary: string, sentences: readonly SentenceRecord[]) => Promise<FragmentRecord | undefined>;
|
|
486
|
+
});
|
|
487
|
+
addSentence(text: string, wordsCount: number, location?: {
|
|
488
|
+
readonly byteOffset: number;
|
|
489
|
+
readonly byteLength: number;
|
|
490
|
+
}): SentenceId;
|
|
491
|
+
commit(): Promise<FragmentRecord | undefined>;
|
|
492
|
+
commitWithText(text: string): Promise<FragmentRecord | undefined>;
|
|
493
|
+
discard(): void;
|
|
494
|
+
setSummary(summary: string): void;
|
|
495
|
+
get fragmentId(): number;
|
|
496
|
+
}
|
|
497
|
+
|
|
409
498
|
declare const TEXT_STREAM_KIND: {
|
|
410
499
|
readonly source: 1;
|
|
411
500
|
readonly summary: 2;
|
|
@@ -446,14 +535,7 @@ interface ReadonlySerialTextStream {
|
|
|
446
535
|
readonly path: string;
|
|
447
536
|
readonly serialId: number;
|
|
448
537
|
}
|
|
449
|
-
|
|
450
|
-
#private;
|
|
451
|
-
constructor(documentPath: string, database: Database, fileAccess?: TextStreamFileAccess);
|
|
452
|
-
ensureCreated(): Promise<void>;
|
|
453
|
-
getSentence(sentenceId: SentenceId): Promise<string>;
|
|
454
|
-
getSerial(serialId: number): SerialTextStream;
|
|
455
|
-
getSummarySerial(serialId: number): SerialTextStream;
|
|
456
|
-
}
|
|
538
|
+
|
|
457
539
|
declare class SerialTextStream implements ReadonlySerialTextStream {
|
|
458
540
|
#private;
|
|
459
541
|
constructor(documentPath: string, database: Database, fileAccess: TextStreamFileAccess, stream: TextStreamName, serialId: number);
|
|
@@ -470,81 +552,14 @@ declare class SerialTextStream implements ReadonlySerialTextStream {
|
|
|
470
552
|
get path(): string;
|
|
471
553
|
get serialId(): number;
|
|
472
554
|
}
|
|
473
|
-
declare class TextStreamDraft {
|
|
474
|
-
#private;
|
|
475
|
-
constructor(serialId: number, startSentenceIndex: number, callbacks: {
|
|
476
|
-
readonly discard: () => void;
|
|
477
|
-
readonly finalize: (startSentenceIndex: number, summary: string, sentences: readonly SentenceRecord[]) => Promise<FragmentRecord | undefined>;
|
|
478
|
-
});
|
|
479
|
-
addSentence(text: string, wordsCount: number, location?: {
|
|
480
|
-
readonly byteOffset: number;
|
|
481
|
-
readonly byteLength: number;
|
|
482
|
-
}): SentenceId;
|
|
483
|
-
commit(): Promise<FragmentRecord | undefined>;
|
|
484
|
-
commitWithText(text: string): Promise<FragmentRecord | undefined>;
|
|
485
|
-
discard(): void;
|
|
486
|
-
setSummary(summary: string): void;
|
|
487
|
-
get fragmentId(): number;
|
|
488
|
-
}
|
|
489
555
|
|
|
490
|
-
|
|
491
|
-
write(path: string, content: string): Promise<void>;
|
|
492
|
-
}
|
|
493
|
-
interface FragmentFileAccess {
|
|
494
|
-
ensureDirectory(path: string): Promise<void>;
|
|
495
|
-
listFileContents?(path: string): Promise<ReadonlyMap<string, Uint8Array>>;
|
|
496
|
-
listFiles(path: string): Promise<readonly string[]>;
|
|
497
|
-
readFile(path: string): Promise<Uint8Array | undefined>;
|
|
498
|
-
}
|
|
499
|
-
interface ReadonlyFragments {
|
|
500
|
-
getSerial(serialId: number): ReadonlySerialFragments;
|
|
501
|
-
getSummarySerial(serialId: number): ReadonlySerialFragments;
|
|
502
|
-
getSentence(sentenceId: SentenceId): Promise<string>;
|
|
503
|
-
getSummary(serialId: number, fragmentId: number): Promise<string>;
|
|
504
|
-
getWordsCount(serialId: number, fragmentId: number): Promise<number>;
|
|
505
|
-
readonly path: string;
|
|
506
|
-
}
|
|
507
|
-
interface TextStreamWriteOptions {
|
|
508
|
-
readonly maxWordsCount?: number;
|
|
509
|
-
}
|
|
510
|
-
interface ReadonlySerialFragments {
|
|
511
|
-
getFragment(fragmentId: number): Promise<FragmentRecord>;
|
|
512
|
-
listFragmentIds(): Promise<readonly number[]>;
|
|
513
|
-
readonly serialId: number;
|
|
514
|
-
readonly path: string;
|
|
515
|
-
}
|
|
516
|
-
declare class Fragments implements ReadonlyFragments {
|
|
556
|
+
declare class TextStreams implements ReadonlyTextStreams {
|
|
517
557
|
#private;
|
|
518
|
-
constructor(documentPath: string,
|
|
558
|
+
constructor(documentPath: string, database: Database, fileAccess?: TextStreamFileAccess);
|
|
519
559
|
ensureCreated(): Promise<void>;
|
|
520
|
-
getSerial(serialId: number): SerialFragments;
|
|
521
|
-
getSummarySerial(serialId: number): SerialFragments;
|
|
522
560
|
getSentence(sentenceId: SentenceId): Promise<string>;
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
get path(): string;
|
|
526
|
-
}
|
|
527
|
-
declare class SerialFragments implements ReadonlySerialFragments {
|
|
528
|
-
#private;
|
|
529
|
-
constructor(documentPath: string, serialId: number, rootDirectoryName?: string, writer?: FragmentWriter, fileAccess?: FragmentFileAccess);
|
|
530
|
-
createDraft(): Promise<FragmentDraft>;
|
|
531
|
-
getFragment(fragmentId: number): Promise<FragmentRecord>;
|
|
532
|
-
listFragmentIds(): Promise<readonly number[]>;
|
|
533
|
-
writeTextStream(text: string, options?: TextStreamWriteOptions): Promise<void>;
|
|
534
|
-
get serialId(): number;
|
|
535
|
-
get path(): string;
|
|
536
|
-
}
|
|
537
|
-
declare class FragmentDraft {
|
|
538
|
-
#private;
|
|
539
|
-
constructor(serialId: number, fragmentId: number, startSentenceIndex: number, callbacks: {
|
|
540
|
-
readonly discard: () => void;
|
|
541
|
-
readonly finalize: (fragmentId: number, startSentenceIndex: number, summary: string, sentences: readonly SentenceRecord[]) => Promise<FragmentRecord | undefined>;
|
|
542
|
-
});
|
|
543
|
-
addSentence(text: string, wordsCount: number): SentenceId;
|
|
544
|
-
commit(): Promise<FragmentRecord | undefined>;
|
|
545
|
-
discard(): void;
|
|
546
|
-
setSummary(summary: string): void;
|
|
547
|
-
get fragmentId(): number;
|
|
561
|
+
getSerial(serialId: number): SerialTextStream;
|
|
562
|
+
getSummarySerial(serialId: number): SerialTextStream;
|
|
548
563
|
}
|
|
549
564
|
|
|
550
565
|
declare const bookMetaSchema: z.ZodObject<{
|
|
@@ -567,6 +582,7 @@ type BookMeta = z.infer<typeof bookMetaSchema>;
|
|
|
567
582
|
|
|
568
583
|
declare const TOC_FILE_VERSION = 1;
|
|
569
584
|
interface TocItem {
|
|
585
|
+
readonly key?: string | undefined;
|
|
570
586
|
readonly title?: string | null | undefined;
|
|
571
587
|
readonly serialId?: number | undefined;
|
|
572
588
|
readonly children: readonly TocItem[];
|
|
@@ -613,16 +629,38 @@ interface ReadonlyReadingEdgeStore {
|
|
|
613
629
|
listOutgoing(chunkId: number): Promise<ReadingEdgeRecord[]>;
|
|
614
630
|
}
|
|
615
631
|
interface ReadonlyMentionStore {
|
|
632
|
+
countByQid(qid: string, options?: {
|
|
633
|
+
readonly chapterId?: number;
|
|
634
|
+
}): Promise<number>;
|
|
616
635
|
getById(mentionId: string): Promise<MentionRecord | undefined>;
|
|
617
636
|
listAll(): Promise<MentionRecord[]>;
|
|
618
637
|
listBySurfaceTerms(terms: readonly string[]): Promise<MentionRecord[]>;
|
|
619
638
|
listBySurfaces(surfaces: readonly string[]): Promise<MentionRecord[]>;
|
|
620
|
-
listByQid(qid: string
|
|
639
|
+
listByQid(qid: string, options?: {
|
|
640
|
+
readonly chapterId?: number;
|
|
641
|
+
readonly limit?: number;
|
|
642
|
+
readonly offset?: number;
|
|
643
|
+
readonly order?: "asc" | "desc";
|
|
644
|
+
}): Promise<MentionRecord[]>;
|
|
645
|
+
listLabelsByQid(qid: string, options?: {
|
|
646
|
+
readonly chapterId?: number;
|
|
647
|
+
}): Promise<string[]>;
|
|
621
648
|
listByChapter(chapterId: number): Promise<MentionRecord[]>;
|
|
622
649
|
}
|
|
623
650
|
interface ReadonlyMentionLinkStore {
|
|
651
|
+
countByTriple(input: {
|
|
652
|
+
readonly chapterId?: number;
|
|
653
|
+
readonly objectQid: string;
|
|
654
|
+
readonly predicate: string;
|
|
655
|
+
readonly subjectQid: string;
|
|
656
|
+
}): Promise<number>;
|
|
624
657
|
getById(linkId: string): Promise<MentionLinkRecord | undefined>;
|
|
658
|
+
listAll(): Promise<MentionLinkRecord[]>;
|
|
625
659
|
listByTriple(input: {
|
|
660
|
+
readonly chapterId?: number;
|
|
661
|
+
readonly limit?: number;
|
|
662
|
+
readonly offset?: number;
|
|
663
|
+
readonly order?: "asc" | "desc";
|
|
626
664
|
readonly objectQid: string;
|
|
627
665
|
readonly predicate: string;
|
|
628
666
|
readonly subjectQid: string;
|
|
@@ -652,6 +690,94 @@ interface ReadonlyFragmentGroupStore {
|
|
|
652
690
|
interface ReadonlyObjectMetadataStore {
|
|
653
691
|
getMap(objectPath: string): Promise<Readonly<Record<string, unknown>>>;
|
|
654
692
|
}
|
|
693
|
+
|
|
694
|
+
declare class ChunkStore implements ReadonlyChunkStore {
|
|
695
|
+
#private;
|
|
696
|
+
constructor(database: Database);
|
|
697
|
+
countAll(): Promise<number>;
|
|
698
|
+
create(record: CreateChunkRecord): Promise<ChunkRecord>;
|
|
699
|
+
save(record: ChunkRecord): Promise<void>;
|
|
700
|
+
getById(chunkId: number): Promise<ChunkRecord | undefined>;
|
|
701
|
+
listAll(): Promise<ChunkRecord[]>;
|
|
702
|
+
listBySentenceStartIndexes(serialId: number, sentenceStartIndexes: readonly number[]): Promise<ChunkRecord[]>;
|
|
703
|
+
listBySentenceRange(serialId: number, startSentenceIndex: number, endSentenceIndex: number): Promise<ChunkRecord[]>;
|
|
704
|
+
listBySerial(serialId: number): Promise<ChunkRecord[]>;
|
|
705
|
+
getMaxId(): Promise<number>;
|
|
706
|
+
listFragmentPairs(): Promise<ReadonlyArray<readonly [number, number]>>;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
declare class FragmentGroupStore implements ReadonlyFragmentGroupStore {
|
|
710
|
+
#private;
|
|
711
|
+
constructor(database: Database);
|
|
712
|
+
save(record: SentenceGroupRecord): Promise<void>;
|
|
713
|
+
saveMany(records: readonly SentenceGroupRecord[]): Promise<void>;
|
|
714
|
+
listBySerial(serialId: number): Promise<SentenceGroupRecord[]>;
|
|
715
|
+
listSerialIds(): Promise<number[]>;
|
|
716
|
+
listGroupIdsForSerial(serialId: number): Promise<number[]>;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
declare class GraphBuildParameterStore implements ReadonlyGraphBuildParameterStore {
|
|
720
|
+
#private;
|
|
721
|
+
constructor(database: Database);
|
|
722
|
+
save(input: {
|
|
723
|
+
readonly language?: string;
|
|
724
|
+
readonly prompt: string;
|
|
725
|
+
}): Promise<GraphBuildParameterRecord>;
|
|
726
|
+
getByHash(hash: string): Promise<GraphBuildParameterRecord | undefined>;
|
|
727
|
+
deleteUnreferenced(): Promise<void>;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
declare class MentionLinkStore implements ReadonlyMentionLinkStore {
|
|
731
|
+
#private;
|
|
732
|
+
constructor(database: Database);
|
|
733
|
+
save(record: MentionLinkRecord): Promise<void>;
|
|
734
|
+
saveMany(records: readonly MentionLinkRecord[]): Promise<void>;
|
|
735
|
+
getById(linkId: string): Promise<MentionLinkRecord | undefined>;
|
|
736
|
+
listAll(): Promise<MentionLinkRecord[]>;
|
|
737
|
+
countByTriple(input: {
|
|
738
|
+
readonly chapterId?: number;
|
|
739
|
+
readonly objectQid: string;
|
|
740
|
+
readonly predicate: string;
|
|
741
|
+
readonly subjectQid: string;
|
|
742
|
+
}): Promise<number>;
|
|
743
|
+
listByTriple(input: {
|
|
744
|
+
readonly chapterId?: number;
|
|
745
|
+
readonly limit?: number;
|
|
746
|
+
readonly offset?: number;
|
|
747
|
+
readonly order?: "asc" | "desc";
|
|
748
|
+
readonly objectQid: string;
|
|
749
|
+
readonly predicate: string;
|
|
750
|
+
readonly subjectQid: string;
|
|
751
|
+
}): Promise<MentionLinkRecord[]>;
|
|
752
|
+
listByChapter(chapterId: number): Promise<MentionLinkRecord[]>;
|
|
753
|
+
deleteByChapter(chapterId: number): Promise<void>;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
declare class MentionStore implements ReadonlyMentionStore {
|
|
757
|
+
#private;
|
|
758
|
+
constructor(database: Database);
|
|
759
|
+
save(record: MentionRecord): Promise<void>;
|
|
760
|
+
saveMany(records: readonly MentionRecord[]): Promise<void>;
|
|
761
|
+
getById(mentionId: string): Promise<MentionRecord | undefined>;
|
|
762
|
+
listAll(): Promise<MentionRecord[]>;
|
|
763
|
+
countByQid(qid: string, options?: {
|
|
764
|
+
readonly chapterId?: number;
|
|
765
|
+
}): Promise<number>;
|
|
766
|
+
listByQid(qid: string, options?: {
|
|
767
|
+
readonly chapterId?: number;
|
|
768
|
+
readonly limit?: number;
|
|
769
|
+
readonly offset?: number;
|
|
770
|
+
readonly order?: "asc" | "desc";
|
|
771
|
+
}): Promise<MentionRecord[]>;
|
|
772
|
+
listLabelsByQid(qid: string, options?: {
|
|
773
|
+
readonly chapterId?: number;
|
|
774
|
+
}): Promise<string[]>;
|
|
775
|
+
listBySurfaces(surfaces: readonly string[]): Promise<MentionRecord[]>;
|
|
776
|
+
listBySurfaceTerms(terms: readonly string[]): Promise<MentionRecord[]>;
|
|
777
|
+
listByChapter(chapterId: number): Promise<MentionRecord[]>;
|
|
778
|
+
deleteByChapter(chapterId: number): Promise<void>;
|
|
779
|
+
}
|
|
780
|
+
|
|
655
781
|
declare class ObjectMetadataStore implements ReadonlyObjectMetadataStore {
|
|
656
782
|
#private;
|
|
657
783
|
constructor(database: Database);
|
|
@@ -664,6 +790,18 @@ declare class ObjectMetadataStore implements ReadonlyObjectMetadataStore {
|
|
|
664
790
|
deleteDeletedChunks(): Promise<void>;
|
|
665
791
|
deleteDeletedEntitiesAndTriples(): Promise<void>;
|
|
666
792
|
}
|
|
793
|
+
|
|
794
|
+
declare class ReadingEdgeStore implements ReadonlyReadingEdgeStore {
|
|
795
|
+
#private;
|
|
796
|
+
constructor(database: Database);
|
|
797
|
+
countAll(): Promise<number>;
|
|
798
|
+
save(record: ReadingEdgeRecord): Promise<void>;
|
|
799
|
+
listAll(): Promise<ReadingEdgeRecord[]>;
|
|
800
|
+
listBySerial(serialId: number): Promise<ReadingEdgeRecord[]>;
|
|
801
|
+
listIncoming(chunkId: number): Promise<ReadingEdgeRecord[]>;
|
|
802
|
+
listOutgoing(chunkId: number): Promise<ReadingEdgeRecord[]>;
|
|
803
|
+
}
|
|
804
|
+
|
|
667
805
|
declare class SerialStore implements ReadonlySerialStore {
|
|
668
806
|
#private;
|
|
669
807
|
constructor(database: Database);
|
|
@@ -686,40 +824,15 @@ declare class SerialStore implements ReadonlySerialStore {
|
|
|
686
824
|
readonly serialId: number;
|
|
687
825
|
}[]): Promise<void>;
|
|
688
826
|
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
constructor(database: Database);
|
|
692
|
-
save(input: {
|
|
693
|
-
readonly language?: string;
|
|
694
|
-
readonly prompt: string;
|
|
695
|
-
}): Promise<GraphBuildParameterRecord>;
|
|
696
|
-
getByHash(hash: string): Promise<GraphBuildParameterRecord | undefined>;
|
|
697
|
-
deleteUnreferenced(): Promise<void>;
|
|
698
|
-
}
|
|
699
|
-
declare class ChunkStore implements ReadonlyChunkStore {
|
|
700
|
-
#private;
|
|
701
|
-
constructor(database: Database);
|
|
702
|
-
countAll(): Promise<number>;
|
|
703
|
-
create(record: CreateChunkRecord): Promise<ChunkRecord>;
|
|
704
|
-
save(record: ChunkRecord): Promise<void>;
|
|
705
|
-
getById(chunkId: number): Promise<ChunkRecord | undefined>;
|
|
706
|
-
listAll(): Promise<ChunkRecord[]>;
|
|
707
|
-
listBySentenceStartIndexes(serialId: number, sentenceStartIndexes: readonly number[]): Promise<ChunkRecord[]>;
|
|
708
|
-
listBySentenceRange(serialId: number, startSentenceIndex: number, endSentenceIndex: number): Promise<ChunkRecord[]>;
|
|
709
|
-
listBySerial(serialId: number): Promise<ChunkRecord[]>;
|
|
710
|
-
getMaxId(): Promise<number>;
|
|
711
|
-
listFragmentPairs(): Promise<ReadonlyArray<readonly [number, number]>>;
|
|
712
|
-
}
|
|
713
|
-
declare class ReadingEdgeStore implements ReadonlyReadingEdgeStore {
|
|
827
|
+
|
|
828
|
+
declare class SnakeChunkStore implements ReadonlySnakeChunkStore {
|
|
714
829
|
#private;
|
|
715
830
|
constructor(database: Database);
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
listBySerial(serialId: number): Promise<ReadingEdgeRecord[]>;
|
|
720
|
-
listIncoming(chunkId: number): Promise<ReadingEdgeRecord[]>;
|
|
721
|
-
listOutgoing(chunkId: number): Promise<ReadingEdgeRecord[]>;
|
|
831
|
+
save(record: SnakeChunkRecord): Promise<void>;
|
|
832
|
+
listChunkIds(snakeId: number): Promise<number[]>;
|
|
833
|
+
listBySnake(snakeId: number): Promise<SnakeChunkRecord[]>;
|
|
722
834
|
}
|
|
835
|
+
|
|
723
836
|
declare class SnakeStore implements ReadonlySnakeStore {
|
|
724
837
|
#private;
|
|
725
838
|
constructor(database: Database);
|
|
@@ -728,40 +841,7 @@ declare class SnakeStore implements ReadonlySnakeStore {
|
|
|
728
841
|
listIdsByGroup(serialId: number, groupId: number): Promise<number[]>;
|
|
729
842
|
listBySerial(serialId: number): Promise<SnakeRecord[]>;
|
|
730
843
|
}
|
|
731
|
-
|
|
732
|
-
#private;
|
|
733
|
-
constructor(database: Database);
|
|
734
|
-
save(record: MentionRecord): Promise<void>;
|
|
735
|
-
saveMany(records: readonly MentionRecord[]): Promise<void>;
|
|
736
|
-
getById(mentionId: string): Promise<MentionRecord | undefined>;
|
|
737
|
-
listAll(): Promise<MentionRecord[]>;
|
|
738
|
-
listByQid(qid: string): Promise<MentionRecord[]>;
|
|
739
|
-
listBySurfaces(surfaces: readonly string[]): Promise<MentionRecord[]>;
|
|
740
|
-
listBySurfaceTerms(terms: readonly string[]): Promise<MentionRecord[]>;
|
|
741
|
-
listByChapter(chapterId: number): Promise<MentionRecord[]>;
|
|
742
|
-
deleteByChapter(chapterId: number): Promise<void>;
|
|
743
|
-
}
|
|
744
|
-
declare class MentionLinkStore implements ReadonlyMentionLinkStore {
|
|
745
|
-
#private;
|
|
746
|
-
constructor(database: Database);
|
|
747
|
-
save(record: MentionLinkRecord): Promise<void>;
|
|
748
|
-
saveMany(records: readonly MentionLinkRecord[]): Promise<void>;
|
|
749
|
-
getById(linkId: string): Promise<MentionLinkRecord | undefined>;
|
|
750
|
-
listByTriple(input: {
|
|
751
|
-
readonly objectQid: string;
|
|
752
|
-
readonly predicate: string;
|
|
753
|
-
readonly subjectQid: string;
|
|
754
|
-
}): Promise<MentionLinkRecord[]>;
|
|
755
|
-
listByChapter(chapterId: number): Promise<MentionLinkRecord[]>;
|
|
756
|
-
deleteByChapter(chapterId: number): Promise<void>;
|
|
757
|
-
}
|
|
758
|
-
declare class SnakeChunkStore implements ReadonlySnakeChunkStore {
|
|
759
|
-
#private;
|
|
760
|
-
constructor(database: Database);
|
|
761
|
-
save(record: SnakeChunkRecord): Promise<void>;
|
|
762
|
-
listChunkIds(snakeId: number): Promise<number[]>;
|
|
763
|
-
listBySnake(snakeId: number): Promise<SnakeChunkRecord[]>;
|
|
764
|
-
}
|
|
844
|
+
|
|
765
845
|
declare class SnakeEdgeStore implements ReadonlySnakeEdgeStore {
|
|
766
846
|
#private;
|
|
767
847
|
constructor(database: Database);
|
|
@@ -771,15 +851,6 @@ declare class SnakeEdgeStore implements ReadonlySnakeEdgeStore {
|
|
|
771
851
|
listWithin(snakeIds: readonly number[]): Promise<SnakeEdgeRecord[]>;
|
|
772
852
|
listBySerial(serialId: number): Promise<SnakeEdgeRecord[]>;
|
|
773
853
|
}
|
|
774
|
-
declare class FragmentGroupStore implements ReadonlyFragmentGroupStore {
|
|
775
|
-
#private;
|
|
776
|
-
constructor(database: Database);
|
|
777
|
-
save(record: SentenceGroupRecord): Promise<void>;
|
|
778
|
-
saveMany(records: readonly SentenceGroupRecord[]): Promise<void>;
|
|
779
|
-
listBySerial(serialId: number): Promise<SentenceGroupRecord[]>;
|
|
780
|
-
listSerialIds(): Promise<number[]>;
|
|
781
|
-
listGroupIdsForSerial(serialId: number): Promise<number[]>;
|
|
782
|
-
}
|
|
783
854
|
|
|
784
855
|
interface DocumentFileStore {
|
|
785
856
|
close(): Promise<void>;
|
|
@@ -861,6 +932,19 @@ interface Document extends ReadonlyDocument {
|
|
|
861
932
|
writeToc(toc: TocFile): Promise<void>;
|
|
862
933
|
writeSearchIndexDatabase<T>(operation: (database: Database) => Promise<T> | T): Promise<T>;
|
|
863
934
|
}
|
|
935
|
+
|
|
936
|
+
declare class DirectoryDocumentContext implements DocumentContext {
|
|
937
|
+
#private;
|
|
938
|
+
constructor(document: DirectoryDocument);
|
|
939
|
+
complete(): void;
|
|
940
|
+
dispose(): Promise<void>;
|
|
941
|
+
ownSerial(serialId: number): void;
|
|
942
|
+
run<T>(operation: () => Promise<T> | T): Promise<T>;
|
|
943
|
+
listCreatedFilePaths(): readonly string[];
|
|
944
|
+
listOwnedSerialIds(): readonly number[];
|
|
945
|
+
registerCreatedFile(path: string): void;
|
|
946
|
+
}
|
|
947
|
+
|
|
864
948
|
declare class DirectoryDocument implements Document {
|
|
865
949
|
#private;
|
|
866
950
|
readonly chunks: ChunkStore;
|
|
@@ -911,1295 +995,1233 @@ declare class DirectoryDocument implements Document {
|
|
|
911
995
|
runWithContext<T>(context: DirectoryDocumentContext, operation: () => Promise<T> | T): Promise<T>;
|
|
912
996
|
rollbackContext(context: DirectoryDocumentContext): Promise<void>;
|
|
913
997
|
}
|
|
914
|
-
declare class DirectoryDocumentContext implements DocumentContext {
|
|
915
|
-
#private;
|
|
916
|
-
constructor(document: DirectoryDocument);
|
|
917
|
-
complete(): void;
|
|
918
|
-
dispose(): Promise<void>;
|
|
919
|
-
ownSerial(serialId: number): void;
|
|
920
|
-
run<T>(operation: () => Promise<T> | T): Promise<T>;
|
|
921
|
-
listCreatedFilePaths(): readonly string[];
|
|
922
|
-
listOwnedSerialIds(): readonly number[];
|
|
923
|
-
registerCreatedFile(path: string): void;
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
declare const SCHEMA_SQL = "\n CREATE TABLE IF NOT EXISTS serials (\n id INTEGER PRIMARY KEY,\n document_order INTEGER NOT NULL DEFAULT 0\n );\n\n CREATE TABLE IF NOT EXISTS serial_states (\n serial_id INTEGER PRIMARY KEY,\n revision INTEGER NOT NULL DEFAULT 0,\n topology_ready INTEGER NOT NULL DEFAULT 0,\n topology_parameter_hash TEXT,\n knowledge_graph_ready INTEGER NOT NULL DEFAULT 0,\n knowledge_graph_parameter_hash TEXT,\n FOREIGN KEY (serial_id) REFERENCES serials(id)\n );\n\n CREATE TABLE IF NOT EXISTS archive_revisions (\n key TEXT PRIMARY KEY,\n value INTEGER NOT NULL\n );\n\n CREATE TABLE IF NOT EXISTS archive_index_settings (\n id INTEGER PRIMARY KEY CHECK (id = 1),\n fts_embedded INTEGER NOT NULL DEFAULT 0\n );\n\n CREATE TABLE IF NOT EXISTS graph_build_parameters (\n hash TEXT PRIMARY KEY,\n prompt TEXT NOT NULL,\n language TEXT,\n created_at TEXT NOT NULL\n );\n\n CREATE TABLE IF NOT EXISTS chunks (\n id INTEGER PRIMARY KEY,\n generation INTEGER NOT NULL,\n serial_id INTEGER NOT NULL,\n sentence_index INTEGER NOT NULL,\n label TEXT NOT NULL,\n content TEXT NOT NULL,\n retention TEXT,\n importance TEXT,\n wordsCount INTEGER NOT NULL DEFAULT 0,\n weight REAL NOT NULL DEFAULT 0.0\n );\n\n CREATE INDEX IF NOT EXISTS idx_chunks_sentence\n ON chunks(serial_id, sentence_index);\n\n CREATE INDEX IF NOT EXISTS idx_chunks_serial_id\n ON chunks(serial_id, id);\n\n CREATE TABLE IF NOT EXISTS chunk_sentences (\n chunk_id INTEGER NOT NULL,\n serial_id INTEGER NOT NULL,\n sentence_index INTEGER NOT NULL,\n FOREIGN KEY (chunk_id) REFERENCES chunks(id),\n PRIMARY KEY (chunk_id, serial_id, sentence_index)\n );\n\n CREATE TABLE IF NOT EXISTS reading_edges (\n from_id INTEGER NOT NULL,\n to_id INTEGER NOT NULL,\n strength TEXT,\n weight REAL NOT NULL DEFAULT 0.1,\n PRIMARY KEY (from_id, to_id),\n FOREIGN KEY (from_id) REFERENCES chunks(id),\n FOREIGN KEY (to_id) REFERENCES chunks(id)\n );\n\n CREATE TABLE IF NOT EXISTS snakes (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n serial_id INTEGER NOT NULL,\n group_id INTEGER NOT NULL,\n local_snake_id INTEGER NOT NULL,\n size INTEGER NOT NULL,\n first_label TEXT NOT NULL,\n last_label TEXT NOT NULL,\n wordsCount INTEGER NOT NULL DEFAULT 0,\n weight REAL NOT NULL DEFAULT 0.0,\n UNIQUE(serial_id, group_id, local_snake_id)\n );\n\n CREATE TABLE IF NOT EXISTS snake_chunks (\n snake_id INTEGER NOT NULL,\n chunk_id INTEGER NOT NULL,\n position INTEGER NOT NULL,\n FOREIGN KEY (snake_id) REFERENCES snakes(id),\n FOREIGN KEY (chunk_id) REFERENCES chunks(id),\n PRIMARY KEY (snake_id, chunk_id)\n );\n\n CREATE TABLE IF NOT EXISTS snake_edges (\n from_snake_id INTEGER NOT NULL,\n to_snake_id INTEGER NOT NULL,\n weight REAL NOT NULL DEFAULT 0.1,\n PRIMARY KEY (from_snake_id, to_snake_id),\n FOREIGN KEY (from_snake_id) REFERENCES snakes(id),\n FOREIGN KEY (to_snake_id) REFERENCES snakes(id)\n );\n\n CREATE TABLE IF NOT EXISTS sentence_groups (\n serial_id INTEGER NOT NULL,\n group_id INTEGER NOT NULL,\n start_sentence_index INTEGER NOT NULL,\n end_sentence_index INTEGER NOT NULL,\n PRIMARY KEY (serial_id, group_id, start_sentence_index, end_sentence_index)\n );\n\n CREATE TABLE IF NOT EXISTS mentions (\n id TEXT PRIMARY KEY,\n chapter_id INTEGER NOT NULL,\n sentence_index INTEGER,\n range_start INTEGER NOT NULL,\n range_end INTEGER NOT NULL,\n surface TEXT NOT NULL,\n qid TEXT NOT NULL,\n confidence REAL,\n note TEXT,\n FOREIGN KEY (chapter_id) REFERENCES serials(id)\n );\n\n CREATE INDEX IF NOT EXISTS idx_mentions_chapter\n ON mentions(chapter_id);\n\n CREATE INDEX IF NOT EXISTS idx_mentions_chapter_position\n ON mentions(chapter_id, sentence_index, range_start, range_end, id);\n\n CREATE INDEX IF NOT EXISTS idx_mentions_chapter_qid\n ON mentions(chapter_id, qid);\n\n CREATE INDEX IF NOT EXISTS idx_mentions_qid\n ON mentions(qid);\n\n CREATE INDEX IF NOT EXISTS idx_mentions_qid_position\n ON mentions(qid, chapter_id, sentence_index, range_start, range_end, id);\n\n CREATE INDEX IF NOT EXISTS idx_mentions_surface\n ON mentions(surface);\n\n CREATE INDEX IF NOT EXISTS idx_mentions_surface_position\n ON mentions(surface, chapter_id, sentence_index, range_start, range_end, id);\n\n CREATE INDEX IF NOT EXISTS idx_mentions_sentence\n ON mentions(chapter_id, sentence_index);\n\n CREATE TABLE IF NOT EXISTS mention_links (\n id TEXT PRIMARY KEY,\n source_mention_id TEXT NOT NULL,\n target_mention_id TEXT NOT NULL,\n predicate TEXT NOT NULL,\n confidence REAL,\n note TEXT,\n FOREIGN KEY (source_mention_id) REFERENCES mentions(id),\n FOREIGN KEY (target_mention_id) REFERENCES mentions(id)\n );\n\n CREATE TABLE IF NOT EXISTS mention_link_evidence_sentences (\n link_id TEXT NOT NULL,\n chapter_id INTEGER NOT NULL,\n sentence_index INTEGER NOT NULL,\n FOREIGN KEY (link_id) REFERENCES mention_links(id),\n PRIMARY KEY (link_id, chapter_id, sentence_index)\n );\n\n CREATE INDEX IF NOT EXISTS idx_mention_link_evidence_sentences_sentence\n ON mention_link_evidence_sentences(chapter_id, sentence_index);\n\n CREATE INDEX IF NOT EXISTS idx_mention_links_source\n ON mention_links(source_mention_id);\n\n CREATE INDEX IF NOT EXISTS idx_mention_links_target\n ON mention_links(target_mention_id);\n\n CREATE INDEX IF NOT EXISTS idx_mention_links_predicate\n ON mention_links(predicate);\n\n CREATE INDEX IF NOT EXISTS idx_mention_links_predicate_source_target\n ON mention_links(predicate, source_mention_id, target_mention_id);\n\n CREATE INDEX IF NOT EXISTS idx_mention_links_predicate_target_source\n ON mention_links(predicate, target_mention_id, source_mention_id);\n\n CREATE INDEX IF NOT EXISTS idx_mention_links_source_predicate_target\n ON mention_links(source_mention_id, predicate, target_mention_id);\n\n CREATE INDEX IF NOT EXISTS idx_mention_links_target_predicate_source\n ON mention_links(target_mention_id, predicate, source_mention_id);\n\n CREATE INDEX IF NOT EXISTS idx_mention_links_source_target_predicate\n ON mention_links(source_mention_id, target_mention_id, predicate);\n\n CREATE INDEX IF NOT EXISTS idx_reading_edges_target\n ON reading_edges(to_id, from_id);\n\n CREATE INDEX IF NOT EXISTS idx_snake_edges_target\n ON snake_edges(to_snake_id, from_snake_id);\n\n CREATE VIEW IF NOT EXISTS chapter_entities AS\n SELECT\n chapter_id,\n qid,\n COUNT(*) AS mention_count\n FROM mentions\n GROUP BY chapter_id, qid;\n\n CREATE VIEW IF NOT EXISTS book_entities AS\n SELECT\n qid,\n SUM(mention_count) AS mention_count\n FROM chapter_entities\n GROUP BY qid;\n\n CREATE VIEW IF NOT EXISTS chapter_entity_relations AS\n SELECT\n source_mentions.chapter_id AS chapter_id,\n source_mentions.qid AS subject_qid,\n mention_links.predicate AS predicate,\n target_mentions.qid AS object_qid,\n COUNT(*) AS evidence_count\n FROM mention_links\n JOIN mentions AS source_mentions\n ON source_mentions.id = mention_links.source_mention_id\n JOIN mentions AS target_mentions\n ON target_mentions.id = mention_links.target_mention_id\n WHERE source_mentions.chapter_id = target_mentions.chapter_id\n GROUP BY\n source_mentions.chapter_id,\n source_mentions.qid,\n mention_links.predicate,\n target_mentions.qid;\n\n CREATE VIEW IF NOT EXISTS book_entity_relations AS\n SELECT\n subject_qid,\n predicate,\n object_qid,\n SUM(evidence_count) AS evidence_count\n FROM chapter_entity_relations\n GROUP BY subject_qid, predicate, object_qid;\n\n CREATE TABLE IF NOT EXISTS text_sentence_records (\n id INTEGER PRIMARY KEY,\n kind INTEGER NOT NULL,\n chapter_id INTEGER NOT NULL,\n sentence_index INTEGER NOT NULL,\n words_count INTEGER NOT NULL DEFAULT 0,\n byte_offset INTEGER NOT NULL DEFAULT 0,\n byte_length INTEGER NOT NULL DEFAULT 0,\n UNIQUE(kind, chapter_id, sentence_index)\n );\n\n CREATE INDEX IF NOT EXISTS idx_text_sentence_records_chapter\n ON text_sentence_records(kind, chapter_id, sentence_index);\n\n CREATE TABLE IF NOT EXISTS object_metadata (\n id INTEGER PRIMARY KEY,\n object_kind INTEGER NOT NULL,\n object_path TEXT NOT NULL,\n key TEXT NOT NULL,\n value_json TEXT NOT NULL,\n updated_at TEXT NOT NULL,\n chapter_id INTEGER,\n chunk_id INTEGER,\n entity_qid TEXT,\n triple_subject_qid TEXT,\n triple_predicate TEXT,\n triple_object_qid TEXT,\n UNIQUE(object_path, key)\n );\n\n CREATE INDEX IF NOT EXISTS idx_object_metadata_object\n ON object_metadata(object_path);\n\n CREATE INDEX IF NOT EXISTS idx_object_metadata_chapter\n ON object_metadata(chapter_id);\n\n CREATE INDEX IF NOT EXISTS idx_object_metadata_chunk\n ON object_metadata(chunk_id);\n\n CREATE INDEX IF NOT EXISTS idx_object_metadata_entity\n ON object_metadata(entity_qid);\n\n CREATE INDEX IF NOT EXISTS idx_object_metadata_triple\n ON object_metadata(\n triple_subject_qid,\n triple_predicate,\n triple_object_qid\n );\n";
|
|
927
|
-
|
|
928
|
-
declare const EVIDENCE_SELECTION_PROMPT_FRAGMENT: string;
|
|
929
|
-
declare const EVIDENCE_SELECTION_JSON_SHAPE: readonly [{
|
|
930
|
-
readonly quote: "exact short source quote copied from the selected sentence";
|
|
931
|
-
readonly sentence_id: "sentence id from the source context, such as S1";
|
|
932
|
-
}];
|
|
933
|
-
declare function formatEvidenceSelectionChoicePrompt(input: {
|
|
934
|
-
readonly evidenceLabel: string;
|
|
935
|
-
readonly generatedEvidence: unknown;
|
|
936
|
-
readonly candidates: readonly {
|
|
937
|
-
readonly nextText: string;
|
|
938
|
-
readonly occurrenceId: string;
|
|
939
|
-
readonly prevText: string;
|
|
940
|
-
readonly score: number;
|
|
941
|
-
readonly text: string;
|
|
942
|
-
}[];
|
|
943
|
-
}): string;
|
|
944
998
|
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
readonly
|
|
948
|
-
readonly
|
|
949
|
-
readonly
|
|
950
|
-
readonly
|
|
951
|
-
readonly
|
|
952
|
-
readonly
|
|
953
|
-
readonly
|
|
954
|
-
readonly score: number;
|
|
955
|
-
readonly strategy: EvidenceQuoteMatchStrategy;
|
|
999
|
+
interface GraphNode {
|
|
1000
|
+
readonly content: string;
|
|
1001
|
+
readonly id: number;
|
|
1002
|
+
readonly importance?: ChunkImportance;
|
|
1003
|
+
readonly label: string;
|
|
1004
|
+
readonly retention?: ChunkRetention;
|
|
1005
|
+
readonly sentenceIds: readonly SentenceId[];
|
|
1006
|
+
readonly weight: number;
|
|
1007
|
+
readonly wordsCount: number;
|
|
956
1008
|
}
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
readonly
|
|
961
|
-
readonly
|
|
962
|
-
}): EvidenceQuoteScore;
|
|
963
|
-
|
|
964
|
-
type EvidenceSentenceId = readonly [number, number];
|
|
965
|
-
interface EvidenceSelectionSentence {
|
|
966
|
-
readonly id: string;
|
|
967
|
-
readonly sentenceId: EvidenceSentenceId;
|
|
968
|
-
readonly text: string;
|
|
1009
|
+
interface GraphEdge {
|
|
1010
|
+
readonly fromId: number;
|
|
1011
|
+
readonly strength?: string;
|
|
1012
|
+
readonly toId: number;
|
|
1013
|
+
readonly weight: number;
|
|
969
1014
|
}
|
|
970
|
-
interface
|
|
971
|
-
readonly
|
|
972
|
-
readonly
|
|
1015
|
+
interface GraphNeighbor {
|
|
1016
|
+
readonly direction: "incoming" | "outgoing";
|
|
1017
|
+
readonly edge: GraphEdge;
|
|
1018
|
+
readonly node: GraphNode;
|
|
973
1019
|
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
readonly
|
|
979
|
-
readonly
|
|
980
|
-
readonly
|
|
981
|
-
readonly
|
|
982
|
-
readonly
|
|
983
|
-
readonly
|
|
984
|
-
readonly
|
|
985
|
-
readonly
|
|
1020
|
+
|
|
1021
|
+
declare const CHAPTER_STAGES: readonly ["planned", "sourced", "graphed", "summarized"];
|
|
1022
|
+
type ChapterStage = (typeof CHAPTER_STAGES)[number];
|
|
1023
|
+
interface ChapterEntry {
|
|
1024
|
+
readonly chapterId: number;
|
|
1025
|
+
readonly childCount: number;
|
|
1026
|
+
readonly depth: number;
|
|
1027
|
+
readonly documentOrder: number;
|
|
1028
|
+
readonly fragmentCount: number;
|
|
1029
|
+
readonly key: string;
|
|
1030
|
+
readonly path: string;
|
|
1031
|
+
readonly stage: ChapterStage;
|
|
1032
|
+
readonly title: string | null;
|
|
1033
|
+
readonly tocPath: readonly string[];
|
|
1034
|
+
readonly uri: string;
|
|
1035
|
+
readonly words: number;
|
|
986
1036
|
}
|
|
987
|
-
interface
|
|
988
|
-
readonly
|
|
989
|
-
readonly
|
|
990
|
-
readonly
|
|
991
|
-
readonly strategy: string;
|
|
1037
|
+
interface ChapterDetails extends ChapterEntry {
|
|
1038
|
+
readonly graphReady: boolean;
|
|
1039
|
+
readonly hasSummary: boolean;
|
|
1040
|
+
readonly words: number;
|
|
992
1041
|
}
|
|
993
|
-
interface
|
|
994
|
-
readonly
|
|
995
|
-
|
|
996
|
-
|
|
1042
|
+
interface ChapterTree {
|
|
1043
|
+
readonly chapters: readonly ChapterTreeNode[];
|
|
1044
|
+
}
|
|
1045
|
+
interface ChapterTreeNode {
|
|
1046
|
+
readonly children: readonly ChapterTreeNode[];
|
|
1047
|
+
readonly title: string | null;
|
|
1048
|
+
readonly uri: string;
|
|
997
1049
|
}
|
|
998
1050
|
|
|
999
|
-
declare function
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
}): readonly [
|
|
1003
|
-
resolution: EvidenceSelectionResolution | undefined,
|
|
1004
|
-
failure: EvidenceSelectionFailure | undefined
|
|
1005
|
-
];
|
|
1006
|
-
declare function resolveEvidenceSelectionList(input: {
|
|
1007
|
-
readonly evidence: EvidenceSelectionList;
|
|
1008
|
-
readonly sentences: readonly EvidenceSelectionSentence[];
|
|
1009
|
-
}): readonly [
|
|
1010
|
-
resolution: EvidenceSelectionResolution | undefined,
|
|
1011
|
-
failure: EvidenceSelectionFailure | undefined
|
|
1012
|
-
];
|
|
1013
|
-
declare function rankEvidenceQuote(quote: string, sentences: readonly EvidenceSelectionSentence[]): EvidenceSelectionCandidate[];
|
|
1051
|
+
declare function getChapterDetails(document: ReadonlyDocument, chapterId: number): Promise<ChapterDetails>;
|
|
1052
|
+
declare function listChapters(document: ReadonlyDocument): Promise<readonly ChapterEntry[]>;
|
|
1053
|
+
declare function getChapterTree(document: ReadonlyDocument): Promise<ChapterTree>;
|
|
1014
1054
|
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
readonly
|
|
1024
|
-
readonly
|
|
1025
|
-
readonly
|
|
1026
|
-
readonly
|
|
1027
|
-
readonly
|
|
1028
|
-
readonly wiki?: string;
|
|
1055
|
+
type ArchiveObjectType = "chapter" | "chapter-title" | "chapter-tree" | "edge" | "entity" | "fragment" | "meta" | "node" | "source" | "state" | "summary" | "triple";
|
|
1056
|
+
type ChapterStateTarget = "knowledge-graph" | "reading-graph" | "reading-summary" | "source";
|
|
1057
|
+
type ChapterStateValue = "missing" | "ready";
|
|
1058
|
+
type ChapterState = Record<ChapterStateTarget, ChapterStateValue>;
|
|
1059
|
+
type ArchiveCollectionType = "chapter" | "chapter-title" | "entity" | "fragment" | "meta" | "node" | "source" | "summary" | "triple";
|
|
1060
|
+
type ArchiveFindObjectType = "chapter" | "chapter-title" | "chapter-tree" | "entity" | "fragment" | "meta" | "node" | "source" | "summary" | "triple";
|
|
1061
|
+
type ArchiveFindFilterType = "chapter" | "chapter-title" | "entity" | "fragment" | "meta" | "node" | "source" | "summary" | "triple";
|
|
1062
|
+
interface ArchiveIndex {
|
|
1063
|
+
readonly chapters: readonly ChapterEntry[];
|
|
1064
|
+
readonly edgeCount: number;
|
|
1065
|
+
readonly meta: BookMeta | undefined;
|
|
1066
|
+
readonly nodeCount: number;
|
|
1067
|
+
readonly summaryCount: number;
|
|
1029
1068
|
}
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
readonly
|
|
1033
|
-
readonly
|
|
1034
|
-
readonly total: number;
|
|
1069
|
+
interface ArchiveLibrarySourceFields {
|
|
1070
|
+
readonly archiveId?: number;
|
|
1071
|
+
readonly libraryArchiveUri?: string;
|
|
1072
|
+
readonly sources?: readonly ArchiveLibrarySource[];
|
|
1035
1073
|
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
readonly
|
|
1039
|
-
readonly disambiguation?: DisambiguationExpansion;
|
|
1040
|
-
readonly disambiguationPages?: readonly DisambiguationPageText[];
|
|
1041
|
-
readonly isDisambiguation: boolean;
|
|
1042
|
-
readonly label?: string;
|
|
1043
|
-
readonly qid: string;
|
|
1044
|
-
readonly sitelink?: WikipageSitelink;
|
|
1045
|
-
readonly sitelinks?: readonly WikipageSitelink[];
|
|
1074
|
+
interface ArchiveLibrarySource {
|
|
1075
|
+
readonly archiveId: number;
|
|
1076
|
+
readonly libraryArchiveUri: string;
|
|
1046
1077
|
}
|
|
1047
|
-
interface
|
|
1078
|
+
interface ArchiveFindHit extends ArchiveLibrarySourceFields {
|
|
1079
|
+
readonly backlinks?: ArchiveBacklinks;
|
|
1080
|
+
readonly chapter?: number;
|
|
1081
|
+
readonly evidence?: ArchiveFindEvidencePreview;
|
|
1082
|
+
readonly evidenceLinks?: readonly MentionLinkRecord[];
|
|
1083
|
+
readonly evidenceMentions?: readonly EntityEvidenceMention[];
|
|
1084
|
+
readonly field: ArchiveFindField;
|
|
1085
|
+
readonly id: string;
|
|
1086
|
+
readonly matchCount?: number;
|
|
1087
|
+
readonly matchedTerms?: readonly string[];
|
|
1088
|
+
readonly missingTerms?: readonly string[];
|
|
1089
|
+
readonly position?: ArchiveFindPosition;
|
|
1090
|
+
readonly score?: number;
|
|
1091
|
+
readonly snippet: string;
|
|
1092
|
+
readonly state?: ChapterState;
|
|
1048
1093
|
readonly title: string;
|
|
1049
|
-
readonly
|
|
1094
|
+
readonly triple?: {
|
|
1095
|
+
readonly objectLabel: string;
|
|
1096
|
+
readonly predicate: string;
|
|
1097
|
+
readonly subjectLabel: string;
|
|
1098
|
+
};
|
|
1099
|
+
readonly type: ArchiveFindObjectType;
|
|
1050
1100
|
}
|
|
1051
|
-
interface
|
|
1052
|
-
readonly
|
|
1053
|
-
readonly
|
|
1054
|
-
readonly linkedQids: readonly DisambiguationLinkedQid[];
|
|
1055
|
-
readonly pages: readonly DisambiguationPageText[];
|
|
1056
|
-
readonly profile?: DisambiguationProfile;
|
|
1101
|
+
interface EntityEvidenceMention {
|
|
1102
|
+
readonly match: Pick<ArchiveFindHit, "matchCount" | "matchedTerms" | "missingTerms" | "score">;
|
|
1103
|
+
readonly mention: MentionRecord;
|
|
1057
1104
|
}
|
|
1058
|
-
interface
|
|
1059
|
-
readonly
|
|
1060
|
-
readonly
|
|
1061
|
-
readonly
|
|
1062
|
-
readonly
|
|
1063
|
-
readonly wiki: "enwiki" | "zhwiki";
|
|
1105
|
+
interface ArchiveFindEvidencePreview {
|
|
1106
|
+
readonly nextCursor: string | null;
|
|
1107
|
+
readonly shown: number;
|
|
1108
|
+
readonly sources: readonly ArchiveEvidenceItem[];
|
|
1109
|
+
readonly total: number;
|
|
1064
1110
|
}
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
readonly
|
|
1111
|
+
type ArchiveFindField = "content" | "metadata" | "source" | "summary" | "title";
|
|
1112
|
+
interface ArchiveFindOptions {
|
|
1113
|
+
readonly archiveKey?: string;
|
|
1114
|
+
readonly backlinks?: boolean;
|
|
1115
|
+
readonly chapters?: readonly number[];
|
|
1116
|
+
readonly cursor?: string;
|
|
1117
|
+
readonly evidenceLimit?: number;
|
|
1118
|
+
readonly ids?: readonly string[];
|
|
1119
|
+
readonly limit?: number;
|
|
1120
|
+
readonly match?: ArchiveFindMatch;
|
|
1121
|
+
readonly order?: ArchiveFindOrder;
|
|
1122
|
+
readonly sourceContext?: number;
|
|
1123
|
+
readonly triplePattern?: ArchiveTriplePattern;
|
|
1124
|
+
readonly types?: readonly ArchiveFindFilterType[];
|
|
1068
1125
|
}
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
readonly
|
|
1073
|
-
readonly
|
|
1074
|
-
readonly
|
|
1075
|
-
readonly
|
|
1076
|
-
}
|
|
1077
|
-
interface CachedDisambiguationRecord {
|
|
1078
|
-
readonly checkedAt: string;
|
|
1079
|
-
readonly disambiguationQid: string;
|
|
1080
|
-
readonly pages: readonly DisambiguationPageText[];
|
|
1081
|
-
readonly profile?: DisambiguationProfile;
|
|
1082
|
-
}
|
|
1083
|
-
interface CachedPageRecord {
|
|
1084
|
-
readonly isDisambiguation: boolean;
|
|
1085
|
-
readonly pageId?: number;
|
|
1086
|
-
readonly title: string;
|
|
1087
|
-
readonly wiki: "enwiki" | "zhwiki";
|
|
1088
|
-
}
|
|
1089
|
-
type DisambiguationMeaningPriority = "other" | "primary" | "secondary";
|
|
1090
|
-
interface DisambiguationProfile {
|
|
1091
|
-
readonly meanings: readonly DisambiguationProfileMeaning[];
|
|
1092
|
-
readonly sourceQid: string;
|
|
1093
|
-
readonly surface?: string;
|
|
1094
|
-
}
|
|
1095
|
-
interface DisambiguationProfileMeaning {
|
|
1096
|
-
readonly category?: string;
|
|
1097
|
-
readonly information: string;
|
|
1098
|
-
readonly name: string;
|
|
1099
|
-
readonly priority: DisambiguationMeaningPriority;
|
|
1100
|
-
readonly qid: string;
|
|
1101
|
-
}
|
|
1102
|
-
type DisambiguationProfileNormalizer = (input: DisambiguationProfileNormalizerInput) => Promise<DisambiguationProfile>;
|
|
1103
|
-
interface DisambiguationProfileNormalizerInput {
|
|
1104
|
-
readonly pageQidLinks: readonly DisambiguationLinkedQid[];
|
|
1105
|
-
readonly pages: readonly DisambiguationPageText[];
|
|
1106
|
-
readonly sourceQid: string;
|
|
1107
|
-
readonly surface?: string;
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
declare class WikipageCache {
|
|
1111
|
-
#private;
|
|
1112
|
-
constructor(database: Database);
|
|
1113
|
-
static open(path?: string): Promise<WikipageCache>;
|
|
1114
|
-
close(): Promise<void>;
|
|
1115
|
-
getQids(qids: readonly string[], language: string): Promise<ReadonlyMap<string, CachedQidRecord>>;
|
|
1116
|
-
putQids(records: readonly CachedQidRecord[], language: string): Promise<void>;
|
|
1117
|
-
getDisambiguations(qids: readonly string[], wiki: string): Promise<ReadonlyMap<string, CachedDisambiguationRecord>>;
|
|
1118
|
-
putDisambiguations(records: readonly CachedDisambiguationRecord[], wiki: string): Promise<void>;
|
|
1126
|
+
type ArchiveFindOrder = "doc-asc" | "doc-desc";
|
|
1127
|
+
type ArchiveFindMatch = "all" | "any";
|
|
1128
|
+
interface ArchiveFindPosition {
|
|
1129
|
+
readonly chapter: number;
|
|
1130
|
+
readonly documentOrder?: number;
|
|
1131
|
+
readonly fragment?: number;
|
|
1132
|
+
readonly sentence?: number;
|
|
1119
1133
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
readonly
|
|
1129
|
-
readonly
|
|
1130
|
-
readonly
|
|
1134
|
+
interface ArchiveFindResult {
|
|
1135
|
+
readonly chapters: readonly number[] | null;
|
|
1136
|
+
readonly items: readonly ArchiveFindHit[];
|
|
1137
|
+
readonly lens: ArchiveFindLens;
|
|
1138
|
+
readonly lensHint: ArchiveFindLensHint | null;
|
|
1139
|
+
readonly limit: number;
|
|
1140
|
+
readonly match: ArchiveFindMatch;
|
|
1141
|
+
readonly nextCursor: string | null;
|
|
1142
|
+
readonly order: ArchiveFindOrder;
|
|
1143
|
+
readonly query: string;
|
|
1144
|
+
readonly terms: readonly string[];
|
|
1145
|
+
readonly types: readonly ArchiveFindFilterType[] | null;
|
|
1131
1146
|
}
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1147
|
+
type ArchiveFindLens = "broad" | "exact" | "typed";
|
|
1148
|
+
interface ArchiveFindLensHint {
|
|
1149
|
+
readonly lenses: {
|
|
1150
|
+
readonly chapter: string;
|
|
1151
|
+
readonly chunk: string;
|
|
1152
|
+
readonly entity: string;
|
|
1153
|
+
readonly node: string;
|
|
1154
|
+
readonly triple: string;
|
|
1155
|
+
};
|
|
1156
|
+
readonly message: string;
|
|
1137
1157
|
}
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1158
|
+
interface ArchiveCollectionOptions {
|
|
1159
|
+
readonly backlinks?: boolean;
|
|
1160
|
+
readonly chapters?: readonly number[];
|
|
1161
|
+
readonly cursor?: string;
|
|
1162
|
+
readonly evidenceLimit?: number;
|
|
1163
|
+
readonly ids?: readonly string[];
|
|
1164
|
+
readonly limit?: number;
|
|
1165
|
+
readonly order?: ArchiveFindOrder;
|
|
1166
|
+
readonly sourceContext?: number;
|
|
1167
|
+
readonly triplePattern?: ArchiveTriplePattern;
|
|
1168
|
+
readonly types?: readonly ArchiveCollectionType[];
|
|
1143
1169
|
}
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
readonly
|
|
1148
|
-
append(entry: WikipageFetchLogEntry): Promise<void>;
|
|
1149
|
-
warnFailed(): void;
|
|
1170
|
+
interface ArchiveTriplePattern {
|
|
1171
|
+
readonly objectQid?: string;
|
|
1172
|
+
readonly predicate?: string;
|
|
1173
|
+
readonly subjectQid?: string;
|
|
1150
1174
|
}
|
|
1151
|
-
interface
|
|
1152
|
-
readonly
|
|
1153
|
-
readonly
|
|
1154
|
-
readonly
|
|
1155
|
-
readonly
|
|
1156
|
-
readonly
|
|
1157
|
-
readonly
|
|
1158
|
-
readonly
|
|
1175
|
+
interface ArchiveCollectionResult {
|
|
1176
|
+
readonly chapters: readonly number[] | null;
|
|
1177
|
+
readonly ids: readonly string[] | null;
|
|
1178
|
+
readonly items: readonly ArchiveFindHit[];
|
|
1179
|
+
readonly limit: number;
|
|
1180
|
+
readonly nextCursor: string | null;
|
|
1181
|
+
readonly order: ArchiveFindOrder;
|
|
1182
|
+
readonly types: readonly ArchiveCollectionType[] | null;
|
|
1159
1183
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
readonly
|
|
1164
|
-
readonly fetch?: typeof fetch;
|
|
1165
|
-
readonly language: string;
|
|
1166
|
-
readonly minRequestIntervalMs: number;
|
|
1167
|
-
readonly requestLog: WikipageFetchLog;
|
|
1168
|
-
readonly retryBaseDelayMs: number;
|
|
1169
|
-
readonly retryTimes: number;
|
|
1170
|
-
readonly userAgent?: string;
|
|
1171
|
-
readonly wiki: string;
|
|
1184
|
+
interface ArchiveBacklinks {
|
|
1185
|
+
readonly chunks: ArchiveBacklinkBucket;
|
|
1186
|
+
readonly entities: ArchiveBacklinkBucket;
|
|
1187
|
+
readonly triples: ArchiveBacklinkBucket;
|
|
1172
1188
|
}
|
|
1173
|
-
interface
|
|
1174
|
-
readonly
|
|
1175
|
-
readonly
|
|
1176
|
-
readonly
|
|
1177
|
-
readonly sitelinks: readonly WikidataSitelinkInfo[];
|
|
1189
|
+
interface ArchiveBacklinkBucket {
|
|
1190
|
+
readonly items: readonly ArchiveFindHit[];
|
|
1191
|
+
readonly limit: number;
|
|
1192
|
+
readonly nextCursor: string | null;
|
|
1178
1193
|
}
|
|
1179
|
-
|
|
1194
|
+
type ArchiveListKind = "chapters" | "edges" | "fragments" | "meta" | "nodes" | "summaries";
|
|
1195
|
+
type ArchiveListItem = ArchiveLibrarySourceFields & ({
|
|
1196
|
+
readonly evidence?: ArchiveFindEvidencePreview;
|
|
1197
|
+
readonly id: string;
|
|
1198
|
+
readonly label: string;
|
|
1199
|
+
readonly score?: number;
|
|
1200
|
+
readonly state?: ChapterState;
|
|
1201
|
+
readonly summary: string;
|
|
1202
|
+
readonly type: Exclude<ArchiveObjectType, "triple">;
|
|
1203
|
+
} | {
|
|
1204
|
+
readonly evidence?: ArchiveFindEvidencePreview;
|
|
1205
|
+
readonly id: string;
|
|
1206
|
+
readonly label: string;
|
|
1207
|
+
readonly evidenceLinks?: readonly MentionLinkRecord[];
|
|
1208
|
+
readonly objectLabel: string;
|
|
1209
|
+
readonly objectQid: string;
|
|
1210
|
+
readonly predicate: string;
|
|
1211
|
+
readonly score?: number;
|
|
1212
|
+
readonly subjectLabel: string;
|
|
1213
|
+
readonly subjectQid: string;
|
|
1214
|
+
readonly summary: string;
|
|
1215
|
+
readonly type: "triple";
|
|
1216
|
+
});
|
|
1217
|
+
type ArchivePage = ArchiveLibrarySourceFields & ({
|
|
1218
|
+
readonly id: string;
|
|
1219
|
+
readonly state: ChapterState;
|
|
1180
1220
|
readonly title: string;
|
|
1181
|
-
readonly
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1184
|
-
readonly isDisambiguation: boolean;
|
|
1185
|
-
readonly pageId?: number;
|
|
1221
|
+
readonly type: "chapter";
|
|
1222
|
+
} | {
|
|
1223
|
+
readonly id: string;
|
|
1186
1224
|
readonly title: string;
|
|
1187
|
-
readonly
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
interface ParsedDisambiguationPage {
|
|
1191
|
-
readonly linkedTitles: readonly string[];
|
|
1192
|
-
readonly pageId?: number;
|
|
1193
|
-
readonly text: string;
|
|
1225
|
+
readonly type: "chapter-title";
|
|
1226
|
+
} | {
|
|
1227
|
+
readonly id: string;
|
|
1194
1228
|
readonly title: string;
|
|
1195
|
-
readonly
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
constructor(options: WikimediaClientOptions);
|
|
1200
|
-
getEntities(qids: readonly string[]): Promise<ReadonlyMap<string, WikidataEntityInfo>>;
|
|
1201
|
-
getPagesByTitles(titles: readonly string[], wiki?: SupportedWiki): Promise<ReadonlyMap<string, WikiPageInfo>>;
|
|
1202
|
-
parseDisambiguationPage(title: string, wiki: SupportedWiki): Promise<ParsedDisambiguationPage>;
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
|
-
declare class WikipageResolver {
|
|
1206
|
-
#private;
|
|
1207
|
-
constructor(input: {
|
|
1208
|
-
readonly cache: WikipageCache;
|
|
1209
|
-
readonly client: WikimediaClient;
|
|
1210
|
-
readonly language: string;
|
|
1211
|
-
readonly maxBatchSize: number;
|
|
1212
|
-
readonly normalizer: DisambiguationProfileNormalizer | undefined;
|
|
1213
|
-
readonly ownsCache: boolean;
|
|
1214
|
-
readonly progress: WikipageResolveProgressReporter | undefined;
|
|
1215
|
-
readonly wiki: string;
|
|
1216
|
-
});
|
|
1217
|
-
static open(options?: WikipageResolverOptions): Promise<WikipageResolver>;
|
|
1218
|
-
close(): Promise<void>;
|
|
1219
|
-
resolveQids(qids: readonly string[]): Promise<readonly QidResolution[]>;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
|
-
interface WikimatchCandidate {
|
|
1223
|
-
readonly hasMoreOptions?: boolean;
|
|
1229
|
+
readonly tree: ChapterTree;
|
|
1230
|
+
readonly type: "chapter-tree";
|
|
1231
|
+
} | {
|
|
1232
|
+
readonly generatedNodeSummary: string;
|
|
1224
1233
|
readonly id: string;
|
|
1225
|
-
readonly
|
|
1226
|
-
readonly
|
|
1227
|
-
readonly
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
readonly
|
|
1231
|
-
readonly
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
readonly
|
|
1236
|
-
readonly
|
|
1237
|
-
readonly
|
|
1238
|
-
readonly
|
|
1234
|
+
readonly incoming: readonly GraphNeighbor[];
|
|
1235
|
+
readonly neighbors: readonly GraphNeighbor[];
|
|
1236
|
+
readonly outgoing: readonly GraphNeighbor[];
|
|
1237
|
+
readonly position: ArchiveFindPosition | undefined;
|
|
1238
|
+
readonly sourceFragments: readonly ArchiveNodeSourceFragment[];
|
|
1239
|
+
readonly title: string;
|
|
1240
|
+
readonly type: "node";
|
|
1241
|
+
} | {
|
|
1242
|
+
readonly backlinks?: ArchiveBacklinks;
|
|
1243
|
+
readonly fragment: ArchiveSourceFragment;
|
|
1244
|
+
readonly id: string;
|
|
1245
|
+
readonly nextFragmentId: string | undefined;
|
|
1246
|
+
readonly nodes: readonly ArchiveNodeLabel[];
|
|
1247
|
+
readonly previousFragmentId: string | undefined;
|
|
1248
|
+
readonly title: string;
|
|
1249
|
+
readonly type: "fragment";
|
|
1250
|
+
} | {
|
|
1251
|
+
readonly content: string;
|
|
1252
|
+
readonly id: string;
|
|
1253
|
+
readonly title: string;
|
|
1254
|
+
readonly type: "summary";
|
|
1255
|
+
} | {
|
|
1256
|
+
readonly evidence: ArchiveFindEvidencePreview;
|
|
1257
|
+
readonly id: string;
|
|
1258
|
+
readonly label: string;
|
|
1259
|
+
readonly labels: readonly string[];
|
|
1260
|
+
readonly mentionCount: number;
|
|
1239
1261
|
readonly qid: string;
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
readonly
|
|
1243
|
-
readonly start: number;
|
|
1244
|
-
}
|
|
1245
|
-
interface WikimatchWindow {
|
|
1246
|
-
readonly baseOffset: number;
|
|
1247
|
-
readonly candidates: readonly WikimatchCandidate[];
|
|
1248
|
-
readonly groups: readonly WikimatchConflictGroup[];
|
|
1249
|
-
readonly text: string;
|
|
1250
|
-
}
|
|
1251
|
-
interface WikimatchSurface {
|
|
1262
|
+
readonly type: "entity";
|
|
1263
|
+
} | {
|
|
1264
|
+
readonly en: ArchiveEntityWikipageLocale | null;
|
|
1252
1265
|
readonly id: string;
|
|
1253
|
-
readonly
|
|
1254
|
-
readonly
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
readonly candidateIds: readonly string[];
|
|
1266
|
+
readonly type: "entity-wikipage";
|
|
1267
|
+
readonly zh: ArchiveEntityWikipageLocale | null;
|
|
1268
|
+
} | {
|
|
1269
|
+
readonly evidence: ArchiveFindEvidencePreview;
|
|
1258
1270
|
readonly id: string;
|
|
1259
|
-
readonly
|
|
1271
|
+
readonly label: string;
|
|
1272
|
+
readonly objectQid: string;
|
|
1273
|
+
readonly predicate: string;
|
|
1274
|
+
readonly subjectQid: string;
|
|
1275
|
+
readonly type: "triple";
|
|
1276
|
+
} | {
|
|
1277
|
+
readonly authors?: readonly string[];
|
|
1278
|
+
readonly description?: string;
|
|
1279
|
+
readonly id: string;
|
|
1280
|
+
readonly publisher?: string;
|
|
1281
|
+
readonly title: string;
|
|
1282
|
+
readonly type: "meta";
|
|
1283
|
+
} | {
|
|
1284
|
+
readonly id: string;
|
|
1285
|
+
readonly state: ChapterState;
|
|
1286
|
+
readonly type: "state";
|
|
1287
|
+
} | {
|
|
1288
|
+
readonly id: string;
|
|
1289
|
+
readonly target: ChapterStateTarget;
|
|
1290
|
+
readonly type: "state";
|
|
1291
|
+
readonly value: ChapterStateValue;
|
|
1292
|
+
});
|
|
1293
|
+
interface ArchiveEntityWikipageLocale {
|
|
1294
|
+
readonly description?: string;
|
|
1295
|
+
readonly title: string;
|
|
1296
|
+
readonly url: string;
|
|
1260
1297
|
}
|
|
1261
|
-
interface
|
|
1262
|
-
readonly
|
|
1263
|
-
readonly
|
|
1264
|
-
readonly
|
|
1265
|
-
readonly text: string;
|
|
1298
|
+
interface ArchivePack {
|
|
1299
|
+
readonly anchor: ArchivePage;
|
|
1300
|
+
readonly budget: number;
|
|
1301
|
+
readonly related: readonly ArchiveListItem[];
|
|
1266
1302
|
}
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
readonly
|
|
1270
|
-
readonly
|
|
1303
|
+
type ArchiveRelatedRole = "any" | "object" | "self" | "subject";
|
|
1304
|
+
interface ArchiveRelatedOptions {
|
|
1305
|
+
readonly cursor?: string;
|
|
1306
|
+
readonly evidenceLimit?: number;
|
|
1307
|
+
readonly limit?: number;
|
|
1308
|
+
readonly order?: ArchiveFindOrder;
|
|
1309
|
+
readonly query?: string;
|
|
1310
|
+
readonly role?: ArchiveRelatedRole;
|
|
1311
|
+
readonly sourceContext?: number;
|
|
1271
1312
|
}
|
|
1272
|
-
interface
|
|
1273
|
-
readonly
|
|
1274
|
-
readonly
|
|
1313
|
+
interface ArchiveRelatedResult {
|
|
1314
|
+
readonly items: readonly ArchiveListItem[];
|
|
1315
|
+
readonly limit: number;
|
|
1316
|
+
readonly nextCursor: string | null;
|
|
1275
1317
|
}
|
|
1276
|
-
interface
|
|
1277
|
-
readonly
|
|
1278
|
-
readonly
|
|
1318
|
+
interface ArchiveEvidence {
|
|
1319
|
+
readonly items: readonly ArchiveEvidenceItem[];
|
|
1320
|
+
readonly limit: number;
|
|
1321
|
+
readonly nextCursor: string | null;
|
|
1279
1322
|
}
|
|
1280
|
-
interface
|
|
1281
|
-
readonly
|
|
1323
|
+
interface ArchiveEvidenceItem extends ArchiveLibrarySourceFields {
|
|
1324
|
+
readonly chapterId: number;
|
|
1325
|
+
readonly endSentenceIndex: number;
|
|
1326
|
+
readonly fragmentId?: number;
|
|
1327
|
+
readonly id: string;
|
|
1328
|
+
readonly score?: number;
|
|
1329
|
+
readonly source: string;
|
|
1330
|
+
readonly startSentenceIndex: number;
|
|
1331
|
+
readonly title: string;
|
|
1332
|
+
readonly type: "source";
|
|
1282
1333
|
}
|
|
1283
|
-
interface
|
|
1284
|
-
readonly
|
|
1285
|
-
readonly
|
|
1334
|
+
interface ArchiveNodeLabel {
|
|
1335
|
+
readonly id: string;
|
|
1336
|
+
readonly title: string;
|
|
1286
1337
|
}
|
|
1287
|
-
interface
|
|
1288
|
-
readonly
|
|
1289
|
-
readonly
|
|
1338
|
+
interface ArchiveSourceFragment {
|
|
1339
|
+
readonly fragmentId?: number;
|
|
1340
|
+
readonly id: string;
|
|
1341
|
+
readonly preview: string;
|
|
1342
|
+
readonly sentenceCount: number;
|
|
1290
1343
|
readonly text: string;
|
|
1344
|
+
readonly wordsCount: number;
|
|
1291
1345
|
}
|
|
1292
|
-
interface
|
|
1293
|
-
readonly
|
|
1294
|
-
readonly suspiciousSurfaces: readonly WikimatchSurface[];
|
|
1295
|
-
}
|
|
1296
|
-
interface WikimatchSurfaceProtectionBuildResult {
|
|
1297
|
-
readonly candidates: readonly WikimatchCandidate[];
|
|
1298
|
-
readonly suppressedCandidates: readonly WikimatchCandidate[];
|
|
1299
|
-
readonly suspiciousSurfaces: readonly WikimatchSurface[];
|
|
1300
|
-
}
|
|
1301
|
-
interface WikimatchSurfaceProtectionResult {
|
|
1302
|
-
readonly fallback?: WikimatchSurfaceProtectionFallback;
|
|
1303
|
-
readonly protectedSurfaces: readonly WikimatchProtectedSurface[];
|
|
1304
|
-
}
|
|
1305
|
-
interface WikimatchProtectedSurface {
|
|
1306
|
-
readonly note?: string;
|
|
1307
|
-
readonly surfaceId: string;
|
|
1346
|
+
interface ArchiveNodeSourceFragment {
|
|
1347
|
+
readonly id: string;
|
|
1308
1348
|
readonly text: string;
|
|
1349
|
+
readonly truncated: boolean;
|
|
1309
1350
|
}
|
|
1310
|
-
interface
|
|
1311
|
-
readonly
|
|
1312
|
-
readonly
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
readonly
|
|
1316
|
-
readonly surfaceId: string;
|
|
1317
|
-
}
|
|
1318
|
-
interface WikimatchSurfaceProtectionResponse {
|
|
1319
|
-
readonly protectedSurfaces: readonly WikimatchProtectedSurfaceOutput[];
|
|
1320
|
-
}
|
|
1321
|
-
type WikimatchPolicyDecision = "continue" | "never_recall" | "recall" | "skip_this_time";
|
|
1322
|
-
interface WikimatchPolicyJudgeInput {
|
|
1323
|
-
readonly candidates: readonly WikimatchCandidate[];
|
|
1324
|
-
readonly policyPrompt: string;
|
|
1325
|
-
readonly window: WikimatchWindow;
|
|
1326
|
-
}
|
|
1327
|
-
interface WikimatchPolicyJudgeResult {
|
|
1328
|
-
readonly continuations: readonly WikimatchPolicyContinuation[];
|
|
1329
|
-
readonly fallback?: WikimatchPolicyFallback;
|
|
1330
|
-
readonly mentions: readonly WikimatchAcceptedMention[];
|
|
1331
|
-
readonly policyUpdates: readonly WikimatchPolicyUpdate[];
|
|
1332
|
-
}
|
|
1333
|
-
interface WikimatchAcceptedMention {
|
|
1334
|
-
readonly candidateId: string;
|
|
1335
|
-
readonly confidence?: number;
|
|
1336
|
-
readonly qid: string;
|
|
1337
|
-
readonly range: WikimatchTextRange;
|
|
1338
|
-
readonly note?: string;
|
|
1339
|
-
readonly surface: string;
|
|
1340
|
-
}
|
|
1341
|
-
interface WikimatchPolicyUpdate {
|
|
1342
|
-
readonly candidateId: string;
|
|
1343
|
-
readonly decision: Exclude<WikimatchPolicyDecision, "recall" | "continue">;
|
|
1344
|
-
readonly note?: string;
|
|
1345
|
-
readonly qid?: string;
|
|
1346
|
-
readonly surface: string;
|
|
1347
|
-
}
|
|
1348
|
-
interface WikimatchPolicyContinuation {
|
|
1349
|
-
readonly candidateIds: readonly string[];
|
|
1350
|
-
readonly groupId: string;
|
|
1351
|
-
}
|
|
1352
|
-
interface WikimatchPolicyFallback {
|
|
1353
|
-
readonly issues: readonly string[];
|
|
1354
|
-
readonly reason: "guaranteed_json_failed";
|
|
1355
|
-
}
|
|
1356
|
-
interface WikimatchPolicyDecisionOutput {
|
|
1357
|
-
readonly candidateId: string;
|
|
1358
|
-
readonly confidence?: number;
|
|
1359
|
-
readonly decision: WikimatchPolicyDecision;
|
|
1360
|
-
readonly qid?: string;
|
|
1351
|
+
interface ArchiveEvidenceOptions {
|
|
1352
|
+
readonly cursor?: string;
|
|
1353
|
+
readonly limit?: number;
|
|
1354
|
+
readonly order?: ArchiveFindOrder;
|
|
1355
|
+
readonly query?: string;
|
|
1356
|
+
readonly sourceContext?: number;
|
|
1361
1357
|
}
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1358
|
+
|
|
1359
|
+
declare function findArchiveObjects(document: ReadonlyDocument, query: string, options?: ArchiveFindOptions): Promise<ArchiveFindResult>;
|
|
1360
|
+
declare function grepArchiveObjects(document: ReadonlyDocument, query: string, options?: ArchiveFindOptions): Promise<ArchiveFindResult>;
|
|
1361
|
+
|
|
1362
|
+
declare const TEXT_SENTENCE_KIND: {
|
|
1363
|
+
readonly source: 1;
|
|
1364
|
+
readonly summary: 2;
|
|
1365
|
+
};
|
|
1366
|
+
type TextSentenceKind = (typeof TEXT_SENTENCE_KIND)[keyof typeof TEXT_SENTENCE_KIND];
|
|
1367
|
+
declare const SEARCH_OBJECT_PROPERTY_OWNER_KIND: {
|
|
1368
|
+
readonly chapter: 1;
|
|
1369
|
+
readonly chunk: 2;
|
|
1370
|
+
readonly entity: 3;
|
|
1371
|
+
};
|
|
1372
|
+
type SearchObjectPropertyOwnerKind = (typeof SEARCH_OBJECT_PROPERTY_OWNER_KIND)[keyof typeof SEARCH_OBJECT_PROPERTY_OWNER_KIND];
|
|
1373
|
+
declare const SEARCH_OBJECT_PROPERTY_KIND: {
|
|
1374
|
+
readonly title: 1;
|
|
1375
|
+
readonly label: 1;
|
|
1376
|
+
readonly content: 2;
|
|
1377
|
+
readonly surface: 1;
|
|
1378
|
+
};
|
|
1379
|
+
type SearchObjectPropertyKind = (typeof SEARCH_OBJECT_PROPERTY_KIND)[keyof typeof SEARCH_OBJECT_PROPERTY_KIND];
|
|
1380
|
+
type SearchIndexProgressPhase = "checking" | "clearing" | "collecting" | "finalizing" | "indexing-objects" | "indexing-text";
|
|
1381
|
+
interface SearchIndexProgressEvent {
|
|
1382
|
+
readonly done?: number;
|
|
1383
|
+
readonly phase: SearchIndexProgressPhase;
|
|
1384
|
+
readonly total?: number;
|
|
1385
|
+
readonly unit?: "chapter" | "object" | "sentence";
|
|
1365
1386
|
}
|
|
1366
|
-
|
|
1367
|
-
|
|
1387
|
+
type SearchIndexProgressReporter = (event: SearchIndexProgressEvent) => void | Promise<void>;
|
|
1388
|
+
interface SearchIndexTextHit {
|
|
1389
|
+
readonly archiveId: number;
|
|
1390
|
+
readonly chapterId: number;
|
|
1391
|
+
readonly kind: TextSentenceKind;
|
|
1392
|
+
readonly rank: number;
|
|
1393
|
+
readonly score: number;
|
|
1394
|
+
readonly sentenceIndex: number;
|
|
1395
|
+
readonly wordsCount: number;
|
|
1368
1396
|
}
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
readonly
|
|
1372
|
-
readonly
|
|
1397
|
+
interface SearchIndexObjectHit {
|
|
1398
|
+
readonly archiveId: number;
|
|
1399
|
+
readonly chapterId?: number;
|
|
1400
|
+
readonly ownerId: string;
|
|
1401
|
+
readonly ownerKind: SearchObjectPropertyOwnerKind;
|
|
1402
|
+
readonly propertyKind: SearchObjectPropertyKind;
|
|
1403
|
+
readonly score: number;
|
|
1373
1404
|
}
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
declare function validatePolicyResponse(candidates: readonly WikimatchCandidate[], response: WikimatchPolicyResponse, groups?: readonly WikimatchConflictGroup[]): readonly string[];
|
|
1377
|
-
declare function formatCandidateForPrompt(candidate: WikimatchCandidate, _group?: WikimatchConflictGroup): object;
|
|
1378
|
-
|
|
1379
|
-
interface NarrowWikimatchCandidateOptionsOptions extends NarrowWikimatchCandidateOptionsInput {
|
|
1380
|
-
readonly maxRetries?: number;
|
|
1381
|
-
readonly optionBudget: number;
|
|
1382
|
-
readonly request: GuaranteedRequest;
|
|
1405
|
+
interface ArchiveIndexSettings {
|
|
1406
|
+
readonly ftsEmbedded: boolean;
|
|
1383
1407
|
}
|
|
1384
|
-
declare function narrowWikimatchCandidateOptions(options: NarrowWikimatchCandidateOptionsOptions): Promise<WikimatchCandidateOptionNarrowingResult>;
|
|
1385
|
-
declare function parseNarrowingResponse(candidate: WikimatchCandidate, response: WikimatchCandidateOptionNarrowingResponse): WikimatchCandidateOptionNarrowingResult;
|
|
1386
|
-
declare function validateNarrowingResponse(candidate: WikimatchCandidate, response: WikimatchCandidateOptionNarrowingResponse): readonly string[];
|
|
1387
|
-
|
|
1388
|
-
declare function countWikimatchCandidateOptions(candidate: WikimatchCandidate): number;
|
|
1389
|
-
declare function countWikimatchQidOption(option: WikimatchQidOption): number;
|
|
1390
|
-
declare function listCandidateSelectableQids(candidate: WikimatchCandidate): readonly string[];
|
|
1391
|
-
declare function filterCandidateQidOptions(candidate: WikimatchCandidate, allowedQids: ReadonlySet<string>): WikimatchCandidate;
|
|
1392
|
-
declare function splitCandidateByOptionBudget(candidate: WikimatchCandidate, optionBudget: number): readonly WikimatchCandidate[];
|
|
1393
|
-
declare function sliceCandidateByOptionBudget(candidate: WikimatchCandidate, optionBudget: number, offset: number): {
|
|
1394
|
-
readonly candidate: WikimatchCandidate;
|
|
1395
|
-
readonly nextOffset?: number;
|
|
1396
|
-
};
|
|
1397
1408
|
|
|
1398
|
-
declare function
|
|
1399
|
-
|
|
1400
|
-
readonly resolverOptions?: Omit<WikipageResolverOptions, "progress">;
|
|
1401
|
-
}): Promise<readonly WikimatchCandidate[]>;
|
|
1402
|
-
declare function applyQidResolutions(candidates: readonly WikimatchCandidate[], resolutions: readonly QidResolution[]): readonly WikimatchCandidate[];
|
|
1409
|
+
declare function readArchiveIndexSettings(document: ReadonlyDocument): Promise<ArchiveIndexSettings>;
|
|
1410
|
+
declare function setFtsIndexEmbedded(document: Document, embedded: boolean): Promise<void>;
|
|
1403
1411
|
|
|
1404
|
-
interface
|
|
1405
|
-
readonly
|
|
1406
|
-
|
|
1412
|
+
interface WikipageFetchLog {
|
|
1413
|
+
readonly filePath: string | undefined;
|
|
1414
|
+
append(entry: WikipageFetchLogEntry): Promise<void>;
|
|
1415
|
+
warnFailed(): void;
|
|
1407
1416
|
}
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
readonly
|
|
1416
|
-
readonly end: number;
|
|
1417
|
-
readonly start: number;
|
|
1418
|
-
};
|
|
1417
|
+
interface WikipageFetchLogEntry {
|
|
1418
|
+
readonly attempt: number;
|
|
1419
|
+
readonly durationMs: number;
|
|
1420
|
+
readonly error?: unknown;
|
|
1421
|
+
readonly response?: Response;
|
|
1422
|
+
readonly responseText?: string;
|
|
1423
|
+
readonly startedAt: number;
|
|
1424
|
+
readonly url: URL;
|
|
1419
1425
|
}
|
|
1420
|
-
declare function suppressContainedRanges<T extends SuppressContainedRangeInput>(items: readonly T[]): readonly T[];
|
|
1421
1426
|
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
readonly
|
|
1425
|
-
readonly endpoint?: string;
|
|
1427
|
+
type SupportedWiki = "enwiki" | "zhwiki";
|
|
1428
|
+
interface WikimediaClientOptions {
|
|
1429
|
+
readonly concurrency: number;
|
|
1426
1430
|
readonly fetch?: typeof fetch;
|
|
1427
|
-
readonly
|
|
1428
|
-
readonly
|
|
1429
|
-
readonly
|
|
1430
|
-
readonly
|
|
1431
|
-
readonly
|
|
1431
|
+
readonly language: string;
|
|
1432
|
+
readonly minRequestIntervalMs: number;
|
|
1433
|
+
readonly requestLog: WikipageFetchLog;
|
|
1434
|
+
readonly retryBaseDelayMs: number;
|
|
1435
|
+
readonly retryTimes: number;
|
|
1436
|
+
readonly userAgent?: string;
|
|
1437
|
+
readonly wiki: string;
|
|
1432
1438
|
}
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
readonly
|
|
1439
|
+
interface WikidataEntityInfo {
|
|
1440
|
+
readonly description?: string;
|
|
1441
|
+
readonly label?: string;
|
|
1442
|
+
readonly qid: string;
|
|
1443
|
+
readonly sitelinks: readonly WikidataSitelinkInfo[];
|
|
1436
1444
|
}
|
|
1437
|
-
interface
|
|
1438
|
-
readonly
|
|
1439
|
-
readonly
|
|
1440
|
-
readonly endpoint?: string;
|
|
1441
|
-
readonly fetch?: typeof fetch;
|
|
1442
|
-
readonly provider?: WikispineProvider;
|
|
1445
|
+
interface WikidataSitelinkInfo {
|
|
1446
|
+
readonly title: string;
|
|
1447
|
+
readonly wiki: SupportedWiki;
|
|
1443
1448
|
}
|
|
1444
|
-
interface
|
|
1445
|
-
readonly
|
|
1446
|
-
readonly
|
|
1447
|
-
readonly
|
|
1448
|
-
readonly
|
|
1449
|
+
interface WikiPageInfo {
|
|
1450
|
+
readonly isDisambiguation: boolean;
|
|
1451
|
+
readonly pageId?: number;
|
|
1452
|
+
readonly title: string;
|
|
1453
|
+
readonly wiki: SupportedWiki;
|
|
1454
|
+
readonly wikibaseItem?: string;
|
|
1449
1455
|
}
|
|
1450
|
-
interface
|
|
1451
|
-
readonly
|
|
1452
|
-
readonly
|
|
1453
|
-
readonly
|
|
1454
|
-
readonly
|
|
1455
|
-
readonly
|
|
1456
|
+
interface ParsedDisambiguationPage {
|
|
1457
|
+
readonly linkedTitles: readonly string[];
|
|
1458
|
+
readonly pageId?: number;
|
|
1459
|
+
readonly text: string;
|
|
1460
|
+
readonly title: string;
|
|
1461
|
+
readonly wiki: SupportedWiki;
|
|
1456
1462
|
}
|
|
1457
|
-
declare const DEFAULT_WIKISPINE_FETCH_ENDPOINT = "https://wikispi-service-cxbfjlteab.cn-hangzhou.fcapp.run";
|
|
1458
|
-
declare function matchWikispineSentenceCandidates(options: MatchWikispineSentenceCandidatesOptions): Promise<readonly WikimatchCandidate[]>;
|
|
1459
|
-
declare function testWikispineRuntime(options: TestWikispineRuntimeOptions): Promise<WikispineRuntimeTestResult>;
|
|
1460
|
-
|
|
1461
|
-
declare function buildWikimatchWindows(options: BuildWikimatchWindowsOptions): readonly WikimatchWindow[];
|
|
1462
1463
|
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1464
|
+
declare class WikimediaClient implements WikiClient {
|
|
1465
|
+
#private;
|
|
1466
|
+
constructor(options: WikimediaClientOptions);
|
|
1467
|
+
getEntities(qids: readonly string[]): Promise<ReadonlyMap<string, WikidataEntityInfo>>;
|
|
1468
|
+
getPagesByTitles(titles: readonly string[], wiki?: SupportedWiki): Promise<ReadonlyMap<string, WikiPageInfo>>;
|
|
1469
|
+
parseDisambiguationPage(title: string, wiki: SupportedWiki): Promise<ParsedDisambiguationPage>;
|
|
1466
1470
|
}
|
|
1467
|
-
declare function listWordBoundaries(text: string): readonly WordBoundary[];
|
|
1468
|
-
declare function expandRangeByWords(input: {
|
|
1469
|
-
readonly rangeEnd: number;
|
|
1470
|
-
readonly rangeStart: number;
|
|
1471
|
-
readonly text: string;
|
|
1472
|
-
readonly words: number;
|
|
1473
|
-
}): {
|
|
1474
|
-
readonly end: number;
|
|
1475
|
-
readonly start: number;
|
|
1476
|
-
};
|
|
1477
|
-
|
|
1478
|
-
type WikiGraphSamplingConfig = SamplingScopeConfig<WikiGraphScope>;
|
|
1479
|
-
declare function createDefaultWikiGraphSampling(input?: {
|
|
1480
|
-
readonly temperature?: TemperatureSetting;
|
|
1481
|
-
readonly topP?: TemperatureSetting;
|
|
1482
|
-
}): WikiGraphSamplingConfig;
|
|
1483
1471
|
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
readonly
|
|
1487
|
-
readonly
|
|
1488
|
-
readonly
|
|
1489
|
-
readonly
|
|
1472
|
+
interface WikipageResolverOptions {
|
|
1473
|
+
readonly cacheDatabasePath?: string;
|
|
1474
|
+
readonly concurrency?: number;
|
|
1475
|
+
readonly fetch?: typeof fetch;
|
|
1476
|
+
readonly language?: string;
|
|
1477
|
+
readonly logDirPath?: string;
|
|
1478
|
+
readonly maxBatchSize?: number;
|
|
1479
|
+
readonly minRequestIntervalMs?: number;
|
|
1480
|
+
readonly normalizer?: DisambiguationProfileNormalizer;
|
|
1481
|
+
readonly progress?: WikipageResolveProgressReporter;
|
|
1482
|
+
readonly retryBaseDelayMs?: number;
|
|
1483
|
+
readonly retryTimes?: number;
|
|
1484
|
+
readonly userAgent?: string;
|
|
1485
|
+
readonly wiki?: string;
|
|
1490
1486
|
}
|
|
1491
|
-
interface
|
|
1492
|
-
|
|
1493
|
-
readonly
|
|
1494
|
-
readonly
|
|
1487
|
+
interface WikiClient {
|
|
1488
|
+
/** Runtime adapter for reading Wikimedia/Wikidata data; local CLI uses WikimediaClient. */
|
|
1489
|
+
readonly getEntities: (qids: readonly string[]) => Promise<ReadonlyMap<string, WikidataEntityInfo>>;
|
|
1490
|
+
readonly getPagesByTitles: (titles: readonly string[], wiki?: SupportedWiki) => Promise<ReadonlyMap<string, WikiPageInfo>>;
|
|
1491
|
+
readonly parseDisambiguationPage: (title: string, wiki: SupportedWiki) => Promise<ParsedDisambiguationPage>;
|
|
1495
1492
|
}
|
|
1496
|
-
interface
|
|
1497
|
-
|
|
1498
|
-
readonly
|
|
1499
|
-
readonly
|
|
1500
|
-
readonly
|
|
1493
|
+
interface EnrichmentStore {
|
|
1494
|
+
/** Runtime adapter for enrichment cache reads and writes; local CLI uses WikipageCache. */
|
|
1495
|
+
readonly getQids: (qids: readonly string[], language: string) => Promise<ReadonlyMap<string, CachedQidRecord>>;
|
|
1496
|
+
readonly putQids: (records: readonly CachedQidRecord[], language: string) => Promise<void>;
|
|
1497
|
+
readonly getDisambiguations: (qids: readonly string[], wiki: string) => Promise<ReadonlyMap<string, CachedDisambiguationRecord>>;
|
|
1498
|
+
readonly putDisambiguations: (records: readonly CachedDisambiguationRecord[], wiki: string) => Promise<void>;
|
|
1501
1499
|
}
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
readonly
|
|
1505
|
-
readonly
|
|
1500
|
+
type WikipageResolveProgressDetail = "disambiguation-page" | "entity" | "linked-page" | "page" | "qid";
|
|
1501
|
+
interface WikipageResolveProgress {
|
|
1502
|
+
readonly detail: WikipageResolveProgressDetail;
|
|
1503
|
+
readonly done: number;
|
|
1504
|
+
readonly total: number;
|
|
1506
1505
|
}
|
|
1507
|
-
type
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
readonly fragments: number;
|
|
1518
|
-
readonly words: number;
|
|
1519
|
-
}): Promise<void>;
|
|
1520
|
-
advance(wordsCount: number): Promise<void>;
|
|
1521
|
-
complete(finalWordsCount?: number): Promise<void>;
|
|
1506
|
+
type WikipageResolveProgressReporter = (event: WikipageResolveProgress) => Promise<void> | void;
|
|
1507
|
+
interface QidResolution {
|
|
1508
|
+
readonly description?: string;
|
|
1509
|
+
readonly disambiguation?: DisambiguationExpansion;
|
|
1510
|
+
readonly disambiguationPages?: readonly DisambiguationPageText[];
|
|
1511
|
+
readonly isDisambiguation: boolean;
|
|
1512
|
+
readonly label?: string;
|
|
1513
|
+
readonly qid: string;
|
|
1514
|
+
readonly sitelink?: WikipageSitelink;
|
|
1515
|
+
readonly sitelinks?: readonly WikipageSitelink[];
|
|
1522
1516
|
}
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
readonly
|
|
1529
|
-
readonly
|
|
1530
|
-
readonly
|
|
1531
|
-
readonly
|
|
1532
|
-
readonly
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
readonly
|
|
1517
|
+
interface WikipageSitelink {
|
|
1518
|
+
readonly title: string;
|
|
1519
|
+
readonly wiki: string;
|
|
1520
|
+
}
|
|
1521
|
+
interface DisambiguationExpansion {
|
|
1522
|
+
readonly checkedAt: string;
|
|
1523
|
+
readonly disambiguationQid: string;
|
|
1524
|
+
readonly linkedQids: readonly DisambiguationLinkedQid[];
|
|
1525
|
+
readonly pages: readonly DisambiguationPageText[];
|
|
1526
|
+
readonly profile?: DisambiguationProfile;
|
|
1527
|
+
}
|
|
1528
|
+
interface DisambiguationPageText {
|
|
1529
|
+
readonly linkedQids: readonly DisambiguationLinkedQid[];
|
|
1530
|
+
readonly pageId?: number;
|
|
1531
|
+
readonly text: string;
|
|
1532
|
+
readonly title: string;
|
|
1533
|
+
readonly wiki: "enwiki" | "zhwiki";
|
|
1534
|
+
}
|
|
1535
|
+
interface DisambiguationLinkedQid {
|
|
1536
|
+
readonly qid: string;
|
|
1537
|
+
readonly title: string;
|
|
1538
|
+
}
|
|
1539
|
+
interface CachedQidRecord {
|
|
1540
|
+
readonly checkedAt: string;
|
|
1541
|
+
readonly description?: string;
|
|
1542
|
+
readonly label?: string;
|
|
1543
|
+
readonly qid: string;
|
|
1544
|
+
readonly sitelinks: readonly CachedPageRecord[];
|
|
1545
|
+
readonly updatedAt: string;
|
|
1546
|
+
}
|
|
1547
|
+
interface CachedDisambiguationRecord {
|
|
1548
|
+
readonly checkedAt: string;
|
|
1549
|
+
readonly disambiguationQid: string;
|
|
1550
|
+
readonly pages: readonly DisambiguationPageText[];
|
|
1551
|
+
readonly profileError?: DisambiguationProfileError;
|
|
1552
|
+
readonly profile?: DisambiguationProfile;
|
|
1536
1553
|
}
|
|
1537
|
-
interface
|
|
1538
|
-
readonly
|
|
1539
|
-
readonly
|
|
1540
|
-
readonly
|
|
1554
|
+
interface DisambiguationProfileError {
|
|
1555
|
+
readonly failedAt: string;
|
|
1556
|
+
readonly message: string;
|
|
1557
|
+
readonly retryAfter: string;
|
|
1541
1558
|
}
|
|
1542
|
-
interface
|
|
1543
|
-
readonly
|
|
1559
|
+
interface CachedPageRecord {
|
|
1560
|
+
readonly isDisambiguation: boolean;
|
|
1561
|
+
readonly pageId?: number;
|
|
1562
|
+
readonly title: string;
|
|
1563
|
+
readonly wiki: "enwiki" | "zhwiki";
|
|
1544
1564
|
}
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
readonly
|
|
1548
|
-
readonly
|
|
1565
|
+
type DisambiguationMeaningPriority = "other" | "primary" | "secondary";
|
|
1566
|
+
interface DisambiguationProfile {
|
|
1567
|
+
readonly meanings: readonly DisambiguationProfileMeaning[];
|
|
1568
|
+
readonly sourceQid: string;
|
|
1569
|
+
readonly surface?: string;
|
|
1549
1570
|
}
|
|
1550
|
-
interface
|
|
1551
|
-
readonly
|
|
1571
|
+
interface DisambiguationProfileMeaning {
|
|
1572
|
+
readonly category?: string;
|
|
1573
|
+
readonly information: string;
|
|
1574
|
+
readonly name: string;
|
|
1575
|
+
readonly priority: DisambiguationMeaningPriority;
|
|
1576
|
+
readonly qid: string;
|
|
1552
1577
|
}
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
readonly
|
|
1556
|
-
readonly
|
|
1578
|
+
type DisambiguationProfileNormalizer = (input: DisambiguationProfileNormalizerInput) => Promise<DisambiguationProfile>;
|
|
1579
|
+
interface DisambiguationProfileNormalizerInput {
|
|
1580
|
+
readonly pageQidLinks: readonly DisambiguationLinkedQid[];
|
|
1581
|
+
readonly pages: readonly DisambiguationPageText[];
|
|
1582
|
+
readonly sourceQid: string;
|
|
1583
|
+
readonly surface?: string;
|
|
1557
1584
|
}
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1585
|
+
|
|
1586
|
+
declare class WikipageCache implements EnrichmentStore {
|
|
1587
|
+
#private;
|
|
1588
|
+
constructor(database: Database);
|
|
1589
|
+
static open(path?: string): Promise<WikipageCache>;
|
|
1590
|
+
close(): Promise<void>;
|
|
1591
|
+
getQids(qids: readonly string[], language: string): Promise<ReadonlyMap<string, CachedQidRecord>>;
|
|
1592
|
+
putQids(records: readonly CachedQidRecord[], language: string): Promise<void>;
|
|
1593
|
+
getDisambiguations(qids: readonly string[], wiki: string): Promise<ReadonlyMap<string, CachedDisambiguationRecord>>;
|
|
1594
|
+
putDisambiguations(records: readonly CachedDisambiguationRecord[], wiki: string): Promise<void>;
|
|
1563
1595
|
}
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1596
|
+
|
|
1597
|
+
type GuaranteedRequest = (messages: readonly LLMessage[], index: number, maxRetries: number) => Promise<string | undefined>;
|
|
1598
|
+
type GuaranteedLazyRequest = <T>(operation: (request: GuaranteedRequest) => Promise<T>) => Promise<T>;
|
|
1599
|
+
type GuaranteedRequestController = GuaranteedRequest & {
|
|
1600
|
+
lazy?: GuaranteedLazyRequest;
|
|
1601
|
+
};
|
|
1602
|
+
|
|
1603
|
+
interface CreateDisambiguationProfileNormalizerOptions {
|
|
1604
|
+
readonly maxMeanings?: number;
|
|
1605
|
+
readonly maxRetries?: number;
|
|
1606
|
+
readonly request: GuaranteedRequest;
|
|
1572
1607
|
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
readonly
|
|
1608
|
+
declare function createDisambiguationProfileNormalizer(options: CreateDisambiguationProfileNormalizerOptions): DisambiguationProfileNormalizer;
|
|
1609
|
+
|
|
1610
|
+
interface RateLimiterOptions {
|
|
1611
|
+
readonly concurrency: number;
|
|
1612
|
+
readonly minRequestIntervalMs: number;
|
|
1577
1613
|
}
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
readonly parentChapterId?: number;
|
|
1584
|
-
readonly root?: boolean;
|
|
1614
|
+
declare class RateLimiter {
|
|
1615
|
+
#private;
|
|
1616
|
+
constructor(options: RateLimiterOptions);
|
|
1617
|
+
use<T>(operation: () => Promise<T>): Promise<T>;
|
|
1618
|
+
blockFor(ms: number): void;
|
|
1585
1619
|
}
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1620
|
+
declare function parseRetryAfterMs(value: string | null): number | undefined;
|
|
1621
|
+
|
|
1622
|
+
declare class WikipageResolver {
|
|
1623
|
+
#private;
|
|
1624
|
+
constructor(input: {
|
|
1625
|
+
readonly client: WikiClient;
|
|
1626
|
+
readonly language: string;
|
|
1627
|
+
readonly maxBatchSize: number;
|
|
1628
|
+
readonly normalizer: DisambiguationProfileNormalizer | undefined;
|
|
1629
|
+
readonly ownsStore?: boolean;
|
|
1630
|
+
readonly progress: WikipageResolveProgressReporter | undefined;
|
|
1631
|
+
readonly store: EnrichmentStore;
|
|
1632
|
+
readonly wiki: string;
|
|
1633
|
+
});
|
|
1634
|
+
static open(options?: WikipageResolverOptions): Promise<WikipageResolver>;
|
|
1635
|
+
close(): Promise<void>;
|
|
1636
|
+
resolveQids(qids: readonly string[]): Promise<readonly QidResolution[]>;
|
|
1594
1637
|
}
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
readonly
|
|
1598
|
-
readonly
|
|
1599
|
-
readonly
|
|
1638
|
+
|
|
1639
|
+
interface ArchivePageOptions {
|
|
1640
|
+
readonly backlinks?: boolean;
|
|
1641
|
+
readonly evidenceLimit?: number;
|
|
1642
|
+
readonly order?: ArchiveFindOrder;
|
|
1643
|
+
readonly sourceContext?: number;
|
|
1644
|
+
readonly wikipageResolverOptions?: WikipageResolverOptions;
|
|
1600
1645
|
}
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1646
|
+
declare function readArchiveText(document: ReadonlyDocument, id: string): Promise<string>;
|
|
1647
|
+
declare function readArchivePage(document: ReadonlyDocument, id: string, options?: ArchivePageOptions): Promise<ArchivePage>;
|
|
1648
|
+
|
|
1649
|
+
declare function listArchiveLinks(document: ReadonlyDocument, id: string, direction: "backlinks" | "links"): Promise<readonly GraphNeighbor[]>;
|
|
1650
|
+
declare function listAllArchiveLinks(document: ReadonlyDocument, id: string): Promise<readonly GraphNeighbor[]>;
|
|
1651
|
+
declare function listRelatedArchiveObjects(document: ReadonlyDocument, id: string, options?: ArchiveRelatedOptions): Promise<ArchiveRelatedResult>;
|
|
1652
|
+
|
|
1653
|
+
declare function formatChapterId(chapterId: number): string;
|
|
1654
|
+
declare function formatEdgeId(edge: ReadingEdgeRecord): string;
|
|
1655
|
+
declare function formatNodeId(nodeId: number): string;
|
|
1656
|
+
declare function formatSummaryId(chapterId: number): string;
|
|
1657
|
+
|
|
1658
|
+
declare function rebuildArchiveSearchIndex(document: Document, progress?: SearchIndexProgressReporter): Promise<void>;
|
|
1659
|
+
declare function isArchiveSearchIndexCurrent(document: ReadonlyDocument): Promise<boolean>;
|
|
1660
|
+
|
|
1661
|
+
declare function getArchiveIndex(document: ReadonlyDocument): Promise<ArchiveIndex>;
|
|
1662
|
+
declare function listArchiveObjects(document: ReadonlyDocument, kind: ArchiveListKind): Promise<readonly ArchiveListItem[]>;
|
|
1663
|
+
declare function listArchiveCollection(document: ReadonlyDocument, options?: ArchiveCollectionOptions): Promise<ArchiveCollectionResult>;
|
|
1664
|
+
|
|
1665
|
+
declare function listArchiveEvidence(document: ReadonlyDocument, uri: string, options?: ArchiveEvidenceOptions): Promise<ArchiveEvidence>;
|
|
1666
|
+
|
|
1667
|
+
declare function packArchiveContext(document: ReadonlyDocument, id: string, budget: number): Promise<ArchivePack>;
|
|
1668
|
+
|
|
1669
|
+
declare function findWikiGraphLibraryObjects(target: ParsedWikiGraphLibraryUri, query: string, options?: ArchiveFindOptions): Promise<ArchiveFindResult>;
|
|
1670
|
+
declare function listWikiGraphLibraryObjects(target: ParsedWikiGraphLibraryUri, options?: ArchiveCollectionOptions): Promise<ArchiveCollectionResult>;
|
|
1671
|
+
declare function readWikiGraphLibraryPage(target: ParsedWikiGraphLibraryUri, objectUri: string, options?: Parameters<typeof readArchivePage>[2]): Promise<ArchivePage>;
|
|
1672
|
+
declare function listWikiGraphLibraryEvidence(target: ParsedWikiGraphLibraryUri, objectUri: string, options?: ArchiveEvidenceOptions): Promise<ArchiveEvidence>;
|
|
1673
|
+
declare function listRelatedWikiGraphLibraryObjects(target: ParsedWikiGraphLibraryUri, objectUri: string, options?: ArchiveRelatedOptions): Promise<ArchiveRelatedResult>;
|
|
1674
|
+
declare function packWikiGraphLibraryContext(target: ParsedWikiGraphLibraryUri, objectUri: string, budget: number): Promise<ArchivePack>;
|
|
1675
|
+
declare function resolveWikiGraphLibraryQueryTargetById(libraryId: number): Promise<ParsedWikiGraphLibraryUri>;
|
|
1676
|
+
|
|
1677
|
+
type WikiGraphLibraryIndexStatus = "current" | "dirty" | "disabled" | "missing";
|
|
1678
|
+
interface WikiGraphLibraryIndexSource {
|
|
1679
|
+
readonly archiveId: number;
|
|
1680
|
+
readonly archiveUri: string;
|
|
1681
|
+
readonly exists: boolean;
|
|
1682
|
+
readonly lastSeenMutationToken?: string;
|
|
1683
|
+
readonly relativePath: string;
|
|
1684
|
+
readonly status: string;
|
|
1685
|
+
}
|
|
1686
|
+
interface WikiGraphLibraryIndexState {
|
|
1687
|
+
readonly enabled: boolean;
|
|
1688
|
+
readonly fingerprint?: string;
|
|
1689
|
+
readonly sourceFingerprint: string;
|
|
1690
|
+
readonly sources: readonly WikiGraphLibraryIndexSource[];
|
|
1691
|
+
readonly status: WikiGraphLibraryIndexStatus;
|
|
1692
|
+
}
|
|
1693
|
+
interface WikiGraphLibraryIndexQueryResult {
|
|
1694
|
+
readonly objectHits: readonly WikiGraphLibraryIndexObjectHit[];
|
|
1695
|
+
readonly terms: readonly string[];
|
|
1696
|
+
readonly textHits: readonly WikiGraphLibraryIndexTextHit[];
|
|
1697
|
+
}
|
|
1698
|
+
interface WikiGraphLibraryIndexQueryOptions {
|
|
1699
|
+
readonly chapters?: readonly number[];
|
|
1700
|
+
readonly match?: ArchiveFindMatch;
|
|
1701
|
+
readonly objectHitLimit?: number;
|
|
1702
|
+
readonly textAfter?: {
|
|
1703
|
+
readonly archiveId: number;
|
|
1704
|
+
readonly chapterId: number;
|
|
1705
|
+
readonly kind: TextSentenceKind;
|
|
1706
|
+
readonly rank: number;
|
|
1707
|
+
readonly sentenceIndex: number;
|
|
1708
|
+
};
|
|
1709
|
+
readonly textHitLimit?: number;
|
|
1710
|
+
readonly types?: readonly ArchiveFindObjectType[] | null;
|
|
1711
|
+
}
|
|
1712
|
+
type WikiGraphLibraryIndexObjectHit = SearchIndexObjectHit & {
|
|
1713
|
+
readonly archiveUri: string;
|
|
1714
|
+
readonly libraryArchiveUri: string;
|
|
1626
1715
|
};
|
|
1627
|
-
|
|
1628
|
-
readonly
|
|
1629
|
-
readonly
|
|
1630
|
-
|
|
1716
|
+
type WikiGraphLibraryIndexTextHit = SearchIndexTextHit & {
|
|
1717
|
+
readonly archiveUri: string;
|
|
1718
|
+
readonly libraryArchiveUri: string;
|
|
1719
|
+
};
|
|
1720
|
+
declare function readWikiGraphLibraryIndexState(target: ParsedWikiGraphLibraryUri): Promise<WikiGraphLibraryIndexState>;
|
|
1721
|
+
declare function rebuildWikiGraphLibraryIndex(target: ParsedWikiGraphLibraryUri, progress?: SearchIndexProgressReporter): Promise<WikiGraphLibraryIndexState>;
|
|
1722
|
+
declare function disableWikiGraphLibraryIndex(target: ParsedWikiGraphLibraryUri): Promise<WikiGraphLibraryIndexState>;
|
|
1723
|
+
declare function markWikiGraphLibraryIndexDirty(targetOrLibrary: ParsedWikiGraphLibraryUri | WikiGraphLibraryRecord): Promise<void>;
|
|
1724
|
+
declare function queryWikiGraphLibrarySearchIndex(target: ParsedWikiGraphLibraryUri, query: string, options?: WikiGraphLibraryIndexQueryOptions): Promise<WikiGraphLibraryIndexQueryResult | undefined>;
|
|
1725
|
+
declare function listWikiGraphLibraryIndexArchiveIdsForObject(target: ParsedWikiGraphLibraryUri, objectUri: string): Promise<readonly number[]>;
|
|
1726
|
+
|
|
1727
|
+
declare function resolveWikiGraphHomeDirectoryPath(): string;
|
|
1728
|
+
declare function withWikiGraphRuntimeStateDirectoryPath<T>(path: string | undefined, operation: () => Promise<T> | T): Promise<T>;
|
|
1729
|
+
/**
|
|
1730
|
+
* @deprecated Runtime state overrides are no longer read from process-style
|
|
1731
|
+
* environment objects. Use `withWikiGraphRuntimeStateDirectoryPath` instead.
|
|
1732
|
+
*/
|
|
1733
|
+
declare function withWikiGraphRuntimeEnvironment<T>(_environment: NodeJS.ProcessEnv, operation: () => Promise<T> | T): Promise<T>;
|
|
1734
|
+
declare function resolveWikiGraphCoreDatabasePath(): string;
|
|
1735
|
+
|
|
1736
|
+
type WikiGraphTempCategory = "archive-open" | "archive-write" | "cli-output" | "sdpub-upgrade" | "stdin-create" | "url-create";
|
|
1737
|
+
declare function resolveWikiGraphStateRootPath(): string;
|
|
1738
|
+
declare function createWikiGraphTempDirectory(category: WikiGraphTempCategory): Promise<string>;
|
|
1739
|
+
|
|
1740
|
+
declare const EVIDENCE_SELECTION_PROMPT_FRAGMENT: string;
|
|
1741
|
+
declare const EVIDENCE_SELECTION_JSON_SHAPE: readonly [{
|
|
1742
|
+
readonly quote: "exact short source quote copied from the selected sentence";
|
|
1743
|
+
readonly sentence_id: "sentence id from the source context, such as S1";
|
|
1744
|
+
}];
|
|
1745
|
+
declare function formatEvidenceSelectionChoicePrompt(input: {
|
|
1746
|
+
readonly evidenceLabel: string;
|
|
1747
|
+
readonly generatedEvidence: unknown;
|
|
1748
|
+
readonly candidates: readonly {
|
|
1749
|
+
readonly nextText: string;
|
|
1750
|
+
readonly occurrenceId: string;
|
|
1751
|
+
readonly prevText: string;
|
|
1752
|
+
readonly score: number;
|
|
1753
|
+
readonly text: string;
|
|
1754
|
+
}[];
|
|
1755
|
+
}): string;
|
|
1756
|
+
|
|
1757
|
+
type EvidenceQuoteMatchStrategy = "empty" | "exact" | "normalized_exact" | "normalized_substring" | "fuzzy_window";
|
|
1758
|
+
interface EvidenceQuoteScore {
|
|
1759
|
+
readonly exactRaw: boolean;
|
|
1760
|
+
readonly exactNormalized: boolean;
|
|
1761
|
+
readonly exactSubstring: boolean;
|
|
1762
|
+
readonly matchEnd: number;
|
|
1763
|
+
readonly matchStart: number;
|
|
1764
|
+
readonly normalizedQuote: string;
|
|
1765
|
+
readonly normalizedSentence: string;
|
|
1766
|
+
readonly score: number;
|
|
1767
|
+
readonly strategy: EvidenceQuoteMatchStrategy;
|
|
1631
1768
|
}
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1769
|
+
declare function normalizeEvidenceDisplayText(text: string): string;
|
|
1770
|
+
declare function normalizeEvidenceText(text: string): string;
|
|
1771
|
+
declare function scoreEvidenceQuote(input: {
|
|
1772
|
+
readonly quote: string;
|
|
1773
|
+
readonly sentence: string;
|
|
1774
|
+
}): EvidenceQuoteScore;
|
|
1775
|
+
|
|
1776
|
+
type EvidenceSentenceId = readonly [number, number];
|
|
1777
|
+
interface EvidenceSelectionSentence {
|
|
1778
|
+
readonly id: string;
|
|
1779
|
+
readonly sentenceId: EvidenceSentenceId;
|
|
1780
|
+
readonly text: string;
|
|
1635
1781
|
}
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
readonly
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
readonly
|
|
1782
|
+
interface EvidenceSelection {
|
|
1783
|
+
readonly quote?: string;
|
|
1784
|
+
readonly sentence_id?: string;
|
|
1785
|
+
}
|
|
1786
|
+
type EvidenceSelectionList = EvidenceSelection | readonly EvidenceSelection[];
|
|
1787
|
+
interface EvidenceSelectionCandidate {
|
|
1788
|
+
readonly exactNormalized: boolean;
|
|
1789
|
+
readonly exactRaw: boolean;
|
|
1790
|
+
readonly exactSubstring: boolean;
|
|
1791
|
+
readonly index: number;
|
|
1792
|
+
readonly nextText: string;
|
|
1793
|
+
readonly occurrenceId: string;
|
|
1794
|
+
readonly prevText: string;
|
|
1795
|
+
readonly score: number;
|
|
1796
|
+
readonly sentence: EvidenceSelectionSentence;
|
|
1797
|
+
readonly strategy: string;
|
|
1643
1798
|
}
|
|
1644
|
-
interface
|
|
1645
|
-
readonly
|
|
1646
|
-
readonly
|
|
1647
|
-
readonly
|
|
1799
|
+
interface EvidenceSelectionResolution {
|
|
1800
|
+
readonly candidate: EvidenceSelectionCandidate;
|
|
1801
|
+
readonly confidence: number;
|
|
1802
|
+
readonly sentenceIds: readonly EvidenceSentenceId[];
|
|
1803
|
+
readonly strategy: string;
|
|
1648
1804
|
}
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
declare function getChapterDetails(document: ReadonlyDocument, chapterId: number): Promise<ChapterDetails>;
|
|
1654
|
-
declare function listChapters(document: ReadonlyDocument): Promise<readonly ChapterEntry[]>;
|
|
1655
|
-
declare function getChapterTree(document: ReadonlyDocument): Promise<ChapterTree>;
|
|
1656
|
-
declare function applyChapterTree(document: Document, tree: ChapterTreeInput, options?: {
|
|
1657
|
-
readonly dryRun?: boolean;
|
|
1658
|
-
}): Promise<ChapterTreeApplyResult>;
|
|
1659
|
-
declare function moveChapter(document: Document, chapterId: number, options: MoveChapterOptions): Promise<ChapterDetails>;
|
|
1660
|
-
declare function removeChapter(document: Document, chapterId: number, options?: {
|
|
1661
|
-
readonly recursive?: boolean;
|
|
1662
|
-
}): Promise<void>;
|
|
1663
|
-
declare function resetChapter(document: Document, chapterId: number, stage: Exclude<ChapterStage, "summarized">): Promise<ChapterDetails>;
|
|
1664
|
-
declare function setChapterSource(document: Document, chapterId: number, stream: ReaderTextStream): Promise<ChapterDetails>;
|
|
1665
|
-
declare function setChapterSummary(document: Document, chapterId: number, summary: string): Promise<ChapterDetails>;
|
|
1666
|
-
declare function setChapterTitle(document: Document, chapterId: number, title: string | null | undefined): Promise<ChapterDetails>;
|
|
1667
|
-
|
|
1668
|
-
interface WikiGraphSerialEntry {
|
|
1669
|
-
readonly fragmentCount: number;
|
|
1670
|
-
readonly serialId: number;
|
|
1671
|
-
readonly title: string | null;
|
|
1672
|
-
readonly tocPath: readonly string[];
|
|
1805
|
+
interface EvidenceSelectionFailure {
|
|
1806
|
+
readonly candidates: readonly EvidenceSelectionCandidate[];
|
|
1807
|
+
readonly code: "ambiguous" | "invalid" | "low_confidence" | "missing_sentence" | "none";
|
|
1808
|
+
readonly message: string;
|
|
1673
1809
|
}
|
|
1674
1810
|
|
|
1675
|
-
declare
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1811
|
+
declare function resolveEvidenceSelection(input: {
|
|
1812
|
+
readonly evidence: EvidenceSelection;
|
|
1813
|
+
readonly sentences: readonly EvidenceSelectionSentence[];
|
|
1814
|
+
}): readonly [
|
|
1815
|
+
resolution: EvidenceSelectionResolution | undefined,
|
|
1816
|
+
failure: EvidenceSelectionFailure | undefined
|
|
1817
|
+
];
|
|
1818
|
+
declare function resolveEvidenceSelectionList(input: {
|
|
1819
|
+
readonly evidence: EvidenceSelectionList;
|
|
1820
|
+
readonly sentences: readonly EvidenceSelectionSentence[];
|
|
1821
|
+
}): readonly [
|
|
1822
|
+
resolution: EvidenceSelectionResolution | undefined,
|
|
1823
|
+
failure: EvidenceSelectionFailure | undefined
|
|
1824
|
+
];
|
|
1825
|
+
declare function rankEvidenceQuote(quote: string, sentences: readonly EvidenceSelectionSentence[]): EvidenceSelectionCandidate[];
|
|
1689
1826
|
|
|
1690
|
-
interface
|
|
1691
|
-
readonly
|
|
1827
|
+
interface WikimatchCandidate {
|
|
1828
|
+
readonly hasMoreOptions?: boolean;
|
|
1829
|
+
readonly id: string;
|
|
1830
|
+
readonly qidOptions: readonly WikimatchQidOption[];
|
|
1831
|
+
readonly range: WikimatchTextRange;
|
|
1832
|
+
readonly surface: string;
|
|
1692
1833
|
}
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
readonly
|
|
1696
|
-
readonly
|
|
1697
|
-
readonly logDirPath?: string;
|
|
1698
|
-
readonly model: LanguageModel;
|
|
1699
|
-
readonly retryIntervalSeconds?: number;
|
|
1700
|
-
readonly retryTimes?: number;
|
|
1701
|
-
readonly stream?: boolean;
|
|
1702
|
-
readonly temperature?: number | readonly number[];
|
|
1703
|
-
readonly timeout?: number;
|
|
1704
|
-
readonly topP?: number | readonly number[];
|
|
1834
|
+
interface WikimatchSentence {
|
|
1835
|
+
readonly id?: string;
|
|
1836
|
+
readonly range: WikimatchTextRange;
|
|
1837
|
+
readonly text: string;
|
|
1705
1838
|
}
|
|
1706
|
-
interface
|
|
1707
|
-
readonly
|
|
1708
|
-
readonly
|
|
1709
|
-
readonly
|
|
1839
|
+
interface WikimatchQidOption {
|
|
1840
|
+
readonly description?: string;
|
|
1841
|
+
readonly disambiguation?: DisambiguationExpansion;
|
|
1842
|
+
readonly isDisambiguation?: boolean;
|
|
1843
|
+
readonly label?: string;
|
|
1844
|
+
readonly qid: string;
|
|
1710
1845
|
}
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
readonly
|
|
1714
|
-
readonly onProgress?: WikiGraphProgressCallback;
|
|
1715
|
-
readonly path: string;
|
|
1716
|
-
readonly targetStage?: ChapterStage;
|
|
1717
|
-
readonly userLanguage?: Language;
|
|
1846
|
+
interface WikimatchTextRange {
|
|
1847
|
+
readonly end: number;
|
|
1848
|
+
readonly start: number;
|
|
1718
1849
|
}
|
|
1719
|
-
interface
|
|
1720
|
-
readonly
|
|
1721
|
-
readonly
|
|
1722
|
-
readonly
|
|
1723
|
-
readonly
|
|
1724
|
-
readonly stream: AsyncIterable<string> | Iterable<string>;
|
|
1725
|
-
readonly targetStage?: ChapterStage;
|
|
1726
|
-
readonly title?: string | null;
|
|
1727
|
-
readonly userLanguage?: Language;
|
|
1850
|
+
interface WikimatchWindow {
|
|
1851
|
+
readonly baseOffset: number;
|
|
1852
|
+
readonly candidates: readonly WikimatchCandidate[];
|
|
1853
|
+
readonly groups: readonly WikimatchConflictGroup[];
|
|
1854
|
+
readonly text: string;
|
|
1728
1855
|
}
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
digestMarkdownSession<T>(options: WikiGraphSourceSessionOptions, operation: (digest: WikiGraphArchive) => Promise<T> | T): Promise<T>;
|
|
1734
|
-
digestTextStreamSession<T>(options: WikiGraphTextStreamSessionOptions, operation: (digest: WikiGraphArchive) => Promise<T> | T): Promise<T>;
|
|
1735
|
-
digestTxtSession<T>(options: WikiGraphSourceSessionOptions, operation: (digest: WikiGraphArchive) => Promise<T> | T): Promise<T>;
|
|
1736
|
-
openSession<T>(path: string, operation: (digest: WikiGraphArchive) => Promise<T> | T, options?: WikiGraphOpenSessionOptions): Promise<T>;
|
|
1856
|
+
interface WikimatchConflictGroup {
|
|
1857
|
+
readonly candidateIds: readonly string[];
|
|
1858
|
+
readonly id: string;
|
|
1859
|
+
readonly range: WikimatchTextRange;
|
|
1737
1860
|
}
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
readonly
|
|
1741
|
-
readonly
|
|
1742
|
-
readonly
|
|
1743
|
-
readonly label: string;
|
|
1744
|
-
readonly retention?: ChunkRetention;
|
|
1745
|
-
readonly sentenceIds: readonly SentenceId[];
|
|
1746
|
-
readonly weight: number;
|
|
1747
|
-
readonly wordsCount: number;
|
|
1861
|
+
interface BuildWikimatchWindowsOptions {
|
|
1862
|
+
readonly candidates: readonly WikimatchCandidate[];
|
|
1863
|
+
readonly contextWords: number;
|
|
1864
|
+
readonly optionBudget: number;
|
|
1865
|
+
readonly text: string;
|
|
1748
1866
|
}
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
readonly
|
|
1752
|
-
readonly
|
|
1753
|
-
readonly
|
|
1867
|
+
type WikimatchPolicyDecision = "continue" | "never_recall" | "recall" | "skip_this_time";
|
|
1868
|
+
interface WikimatchPolicyJudgeInput {
|
|
1869
|
+
readonly candidates: readonly WikimatchCandidate[];
|
|
1870
|
+
readonly policyPrompt: string;
|
|
1871
|
+
readonly window: WikimatchWindow;
|
|
1754
1872
|
}
|
|
1755
|
-
interface
|
|
1756
|
-
readonly
|
|
1757
|
-
readonly
|
|
1873
|
+
interface WikimatchPolicyJudgeResult {
|
|
1874
|
+
readonly continuations: readonly WikimatchPolicyContinuation[];
|
|
1875
|
+
readonly fallback?: WikimatchPolicyFallback;
|
|
1876
|
+
readonly mentions: readonly WikimatchAcceptedMention[];
|
|
1877
|
+
readonly policyUpdates: readonly WikimatchPolicyUpdate[];
|
|
1758
1878
|
}
|
|
1759
|
-
interface
|
|
1760
|
-
readonly
|
|
1761
|
-
readonly
|
|
1762
|
-
readonly
|
|
1763
|
-
readonly
|
|
1879
|
+
interface WikimatchAcceptedMention {
|
|
1880
|
+
readonly candidateId: string;
|
|
1881
|
+
readonly confidence?: number;
|
|
1882
|
+
readonly qid: string;
|
|
1883
|
+
readonly range: WikimatchTextRange;
|
|
1884
|
+
readonly note?: string;
|
|
1885
|
+
readonly surface: string;
|
|
1764
1886
|
}
|
|
1765
|
-
interface
|
|
1766
|
-
readonly
|
|
1767
|
-
readonly
|
|
1887
|
+
interface WikimatchPolicyUpdate {
|
|
1888
|
+
readonly candidateId: string;
|
|
1889
|
+
readonly decision: Exclude<WikimatchPolicyDecision, "recall" | "continue">;
|
|
1890
|
+
readonly note?: string;
|
|
1891
|
+
readonly qid?: string;
|
|
1892
|
+
readonly surface: string;
|
|
1768
1893
|
}
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
readonly
|
|
1772
|
-
readonly edge: GraphEdge;
|
|
1773
|
-
readonly node: GraphNode;
|
|
1894
|
+
interface WikimatchPolicyContinuation {
|
|
1895
|
+
readonly candidateIds: readonly string[];
|
|
1896
|
+
readonly groupId: string;
|
|
1774
1897
|
}
|
|
1775
|
-
interface
|
|
1776
|
-
readonly
|
|
1777
|
-
readonly
|
|
1898
|
+
interface WikimatchPolicyFallback {
|
|
1899
|
+
readonly issues: readonly string[];
|
|
1900
|
+
readonly reason: "guaranteed_json_failed";
|
|
1778
1901
|
}
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
declare function getGraphEvidence(document: ReadonlyDocument, chapterId: number, nodeId: number): Promise<readonly GraphEvidenceLine[]>;
|
|
1785
|
-
declare function findGraphPath(document: ReadonlyDocument, chapterId: number, fromNodeId: number, toNodeId: number): Promise<readonly GraphPathStep[]>;
|
|
1786
|
-
|
|
1787
|
-
declare const TEXT_SENTENCE_KIND: {
|
|
1788
|
-
readonly source: 1;
|
|
1789
|
-
readonly summary: 2;
|
|
1790
|
-
};
|
|
1791
|
-
type TextSentenceKind = (typeof TEXT_SENTENCE_KIND)[keyof typeof TEXT_SENTENCE_KIND];
|
|
1792
|
-
declare const SEARCH_OBJECT_PROPERTY_OWNER_KIND: {
|
|
1793
|
-
readonly chapter: 1;
|
|
1794
|
-
readonly chunk: 2;
|
|
1795
|
-
readonly entity: 3;
|
|
1796
|
-
};
|
|
1797
|
-
type SearchObjectPropertyOwnerKind = (typeof SEARCH_OBJECT_PROPERTY_OWNER_KIND)[keyof typeof SEARCH_OBJECT_PROPERTY_OWNER_KIND];
|
|
1798
|
-
declare const SEARCH_OBJECT_PROPERTY_KIND: {
|
|
1799
|
-
readonly title: 1;
|
|
1800
|
-
readonly label: 1;
|
|
1801
|
-
readonly content: 2;
|
|
1802
|
-
readonly surface: 1;
|
|
1803
|
-
};
|
|
1804
|
-
type SearchObjectPropertyKind = (typeof SEARCH_OBJECT_PROPERTY_KIND)[keyof typeof SEARCH_OBJECT_PROPERTY_KIND];
|
|
1805
|
-
interface TextSentenceRecordInput {
|
|
1806
|
-
readonly chapterId: number;
|
|
1807
|
-
readonly kind: TextSentenceKind;
|
|
1808
|
-
readonly sentenceIndex: number;
|
|
1809
|
-
readonly text: string;
|
|
1810
|
-
readonly wordsCount: number;
|
|
1902
|
+
interface WikimatchPolicyDecisionOutput {
|
|
1903
|
+
readonly candidateId: string;
|
|
1904
|
+
readonly confidence?: number;
|
|
1905
|
+
readonly decision: WikimatchPolicyDecision;
|
|
1906
|
+
readonly qid?: string;
|
|
1811
1907
|
}
|
|
1812
|
-
interface
|
|
1813
|
-
readonly
|
|
1814
|
-
readonly
|
|
1815
|
-
readonly ownerKind: SearchObjectPropertyOwnerKind;
|
|
1816
|
-
readonly propertyKind: SearchObjectPropertyKind;
|
|
1817
|
-
readonly text: string;
|
|
1908
|
+
interface WikimatchPolicyGroupOutput {
|
|
1909
|
+
readonly decisions: readonly WikimatchPolicyDecisionOutput[];
|
|
1910
|
+
readonly groupId: string;
|
|
1818
1911
|
}
|
|
1819
|
-
interface
|
|
1820
|
-
readonly
|
|
1821
|
-
readonly textSentences: readonly TextSentenceRecordInput[];
|
|
1912
|
+
interface WikimatchPolicyResponse {
|
|
1913
|
+
readonly groups: readonly WikimatchPolicyGroupOutput[];
|
|
1822
1914
|
}
|
|
1823
|
-
|
|
1824
|
-
interface
|
|
1825
|
-
readonly
|
|
1826
|
-
readonly
|
|
1827
|
-
readonly total?: number;
|
|
1828
|
-
readonly unit?: "chapter" | "object" | "sentence";
|
|
1915
|
+
|
|
1916
|
+
interface JudgeWikimatchPolicyOptions extends WikimatchPolicyJudgeInput {
|
|
1917
|
+
readonly maxRetries?: number;
|
|
1918
|
+
readonly request: GuaranteedRequest;
|
|
1829
1919
|
}
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
readonly
|
|
1836
|
-
readonly
|
|
1837
|
-
readonly
|
|
1838
|
-
readonly
|
|
1920
|
+
declare function judgeWikimatchPolicy(options: JudgeWikimatchPolicyOptions): Promise<WikimatchPolicyJudgeResult>;
|
|
1921
|
+
declare function parsePolicyResponse(candidates: readonly WikimatchCandidate[], response: WikimatchPolicyResponse, groups?: readonly WikimatchConflictGroup[]): WikimatchPolicyJudgeResult;
|
|
1922
|
+
declare function validatePolicyResponse(candidates: readonly WikimatchCandidate[], response: WikimatchPolicyResponse, groups?: readonly WikimatchConflictGroup[]): readonly string[];
|
|
1923
|
+
|
|
1924
|
+
interface MatchWikispineSentenceCandidatesOptions {
|
|
1925
|
+
readonly command?: string;
|
|
1926
|
+
readonly dataDir?: string;
|
|
1927
|
+
readonly endpoint?: string;
|
|
1928
|
+
readonly fetch?: typeof fetch;
|
|
1929
|
+
readonly includeDisambiguation?: boolean;
|
|
1930
|
+
readonly maxCandidatesPerSurface?: number;
|
|
1931
|
+
readonly onProgress?: (progress: WikispineMatchProgress) => Promise<void> | void;
|
|
1932
|
+
readonly provider?: WikispineProvider;
|
|
1933
|
+
readonly sentences: readonly WikimatchSentence[];
|
|
1839
1934
|
}
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
readonly
|
|
1843
|
-
readonly ownerKind: SearchObjectPropertyOwnerKind;
|
|
1844
|
-
readonly propertyKind: SearchObjectPropertyKind;
|
|
1845
|
-
readonly score: number;
|
|
1935
|
+
type WikispineProvider = "cli" | "fetch";
|
|
1936
|
+
interface WikispineMatchProgress {
|
|
1937
|
+
readonly coveredRangeEnd: number;
|
|
1846
1938
|
}
|
|
1847
|
-
interface
|
|
1848
|
-
readonly
|
|
1849
|
-
readonly
|
|
1850
|
-
readonly
|
|
1939
|
+
interface TestWikispineRuntimeOptions {
|
|
1940
|
+
readonly command?: string;
|
|
1941
|
+
readonly dataDir?: string;
|
|
1942
|
+
readonly endpoint?: string;
|
|
1943
|
+
readonly fetch?: typeof fetch;
|
|
1944
|
+
readonly provider?: WikispineProvider;
|
|
1851
1945
|
}
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
readonly
|
|
1946
|
+
interface WikispineRuntimeTestResult {
|
|
1947
|
+
readonly durationMs: number;
|
|
1948
|
+
readonly metadata?: WikispineMetadata;
|
|
1949
|
+
readonly ok: true;
|
|
1950
|
+
readonly provider: WikispineProvider;
|
|
1855
1951
|
}
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
readonly chapters?: readonly number[];
|
|
1863
|
-
readonly match?: ArchiveFindMatch;
|
|
1864
|
-
readonly objectHitLimit?: number;
|
|
1865
|
-
readonly textAfter?: {
|
|
1866
|
-
readonly chapterId: number;
|
|
1867
|
-
readonly kind: TextSentenceKind;
|
|
1868
|
-
readonly rank: number;
|
|
1869
|
-
readonly sentenceIndex: number;
|
|
1870
|
-
};
|
|
1871
|
-
readonly textHitLimit?: number;
|
|
1872
|
-
readonly types?: readonly ArchiveFindObjectType[] | null;
|
|
1873
|
-
}): Promise<SearchIndexQueryResult | undefined>;
|
|
1874
|
-
declare function createSearchIndexFingerprint(input: SearchIndexInput): string;
|
|
1875
|
-
declare function readSearchIndexFingerprintFromDatabase(database: Database): Promise<string | undefined>;
|
|
1876
|
-
|
|
1877
|
-
type ArchiveObjectType = "chapter" | "chapter-title" | "chapter-tree" | "edge" | "entity" | "fragment" | "meta" | "node" | "source" | "state" | "summary" | "triple";
|
|
1878
|
-
type ChapterStateTarget = "knowledge-graph" | "reading-graph" | "reading-summary" | "source";
|
|
1879
|
-
type ChapterStateValue = "missing" | "ready";
|
|
1880
|
-
type ChapterState = Record<ChapterStateTarget, ChapterStateValue>;
|
|
1881
|
-
type ArchiveCollectionType = "chapter" | "chapter-title" | "entity" | "fragment" | "meta" | "node" | "source" | "summary" | "triple";
|
|
1882
|
-
type ArchiveFindObjectType = "chapter" | "chapter-title" | "chapter-tree" | "entity" | "fragment" | "meta" | "node" | "source" | "summary" | "triple";
|
|
1883
|
-
type ArchiveFindFilterType = "chapter" | "chapter-title" | "entity" | "fragment" | "meta" | "node" | "source" | "summary" | "triple";
|
|
1884
|
-
interface ArchiveIndex {
|
|
1885
|
-
readonly chapters: readonly ChapterEntry[];
|
|
1886
|
-
readonly edgeCount: number;
|
|
1887
|
-
readonly meta: BookMeta | undefined;
|
|
1888
|
-
readonly nodeCount: number;
|
|
1889
|
-
readonly summaryCount: number;
|
|
1952
|
+
interface WikispineMetadata {
|
|
1953
|
+
readonly automaton_shard_count: number;
|
|
1954
|
+
readonly format: string;
|
|
1955
|
+
readonly qid_count: number;
|
|
1956
|
+
readonly surface_count: number;
|
|
1957
|
+
readonly surface_normalization: string;
|
|
1890
1958
|
}
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
readonly
|
|
1899
|
-
readonly
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
readonly
|
|
1905
|
-
readonly
|
|
1906
|
-
readonly title
|
|
1907
|
-
readonly
|
|
1908
|
-
readonly objectLabel: string;
|
|
1909
|
-
readonly predicate: string;
|
|
1910
|
-
readonly subjectLabel: string;
|
|
1911
|
-
};
|
|
1912
|
-
readonly type: ArchiveFindObjectType;
|
|
1959
|
+
declare const DEFAULT_WIKISPINE_FETCH_ENDPOINT = "https://wikispi-service-cxbfjlteab.cn-hangzhou.fcapp.run";
|
|
1960
|
+
declare function testWikispineRuntime(options: TestWikispineRuntimeOptions): Promise<WikispineRuntimeTestResult>;
|
|
1961
|
+
|
|
1962
|
+
declare function buildWikimatchWindows(options: BuildWikimatchWindowsOptions): readonly WikimatchWindow[];
|
|
1963
|
+
|
|
1964
|
+
type WikiGraphSamplingConfig = SamplingScopeConfig<WikiGraphScope>;
|
|
1965
|
+
declare function createDefaultWikiGraphSampling(input?: {
|
|
1966
|
+
readonly temperature?: TemperatureSetting;
|
|
1967
|
+
readonly topP?: TemperatureSetting;
|
|
1968
|
+
}): WikiGraphSamplingConfig;
|
|
1969
|
+
|
|
1970
|
+
type WikiGraphOperation = "digest-epub" | "digest-markdown" | "digest-text-stream" | "digest-txt";
|
|
1971
|
+
interface SerialDiscoveryItem {
|
|
1972
|
+
readonly id: number;
|
|
1973
|
+
readonly fragments?: number | undefined;
|
|
1974
|
+
readonly title?: string | undefined;
|
|
1975
|
+
readonly words: number;
|
|
1913
1976
|
}
|
|
1914
|
-
interface
|
|
1915
|
-
readonly
|
|
1916
|
-
readonly
|
|
1977
|
+
interface SerialsDiscoveredEvent {
|
|
1978
|
+
readonly type: "serials-discovered";
|
|
1979
|
+
readonly available: boolean;
|
|
1980
|
+
readonly serials: readonly SerialDiscoveryItem[];
|
|
1917
1981
|
}
|
|
1918
|
-
interface
|
|
1919
|
-
readonly
|
|
1920
|
-
readonly
|
|
1921
|
-
readonly
|
|
1922
|
-
readonly
|
|
1982
|
+
interface SerialProgressEvent {
|
|
1983
|
+
readonly type: "serial-progress";
|
|
1984
|
+
readonly id: number;
|
|
1985
|
+
readonly completedWords: number;
|
|
1986
|
+
readonly completedFragments: number;
|
|
1923
1987
|
}
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
readonly
|
|
1927
|
-
readonly
|
|
1928
|
-
readonly chapters?: readonly number[];
|
|
1929
|
-
readonly cursor?: string;
|
|
1930
|
-
readonly evidenceLimit?: number;
|
|
1931
|
-
readonly ids?: readonly string[];
|
|
1932
|
-
readonly limit?: number;
|
|
1933
|
-
readonly match?: ArchiveFindMatch;
|
|
1934
|
-
readonly order?: ArchiveFindOrder;
|
|
1935
|
-
readonly sourceContext?: number;
|
|
1936
|
-
readonly triplePattern?: ArchiveTriplePattern;
|
|
1937
|
-
readonly types?: readonly ArchiveFindFilterType[];
|
|
1988
|
+
interface DigestProgressEvent {
|
|
1989
|
+
readonly type: "digest-progress";
|
|
1990
|
+
readonly completedWords: number;
|
|
1991
|
+
readonly totalWords: number;
|
|
1938
1992
|
}
|
|
1939
|
-
type
|
|
1940
|
-
type
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1993
|
+
type WikiGraphProgressEventType = WikiGraphProgressEvent["type"];
|
|
1994
|
+
type WikiGraphProgressEvent = SerialsDiscoveredEvent | SerialProgressEvent | DigestProgressEvent;
|
|
1995
|
+
type WikiGraphProgressCallback = (event: WikiGraphProgressEvent) => void | Promise<void>;
|
|
1996
|
+
|
|
1997
|
+
type TextStream = AsyncIterable<string> | Iterable<string>;
|
|
1998
|
+
|
|
1999
|
+
type ReaderTextStream = TextStream;
|
|
2000
|
+
|
|
2001
|
+
interface ChapterTreeInput {
|
|
2002
|
+
readonly chapters: readonly ChapterTreeInputNode[];
|
|
1946
2003
|
}
|
|
1947
|
-
interface
|
|
1948
|
-
readonly
|
|
1949
|
-
readonly
|
|
1950
|
-
readonly
|
|
1951
|
-
readonly lensHint: ArchiveFindLensHint | null;
|
|
1952
|
-
readonly limit: number;
|
|
1953
|
-
readonly match: ArchiveFindMatch;
|
|
1954
|
-
readonly nextCursor: string | null;
|
|
1955
|
-
readonly order: ArchiveFindOrder;
|
|
1956
|
-
readonly query: string;
|
|
1957
|
-
readonly terms: readonly string[];
|
|
1958
|
-
readonly types: readonly ArchiveFindFilterType[] | null;
|
|
2004
|
+
interface ChapterTreeInputNode {
|
|
2005
|
+
readonly children: readonly ChapterTreeInputNode[];
|
|
2006
|
+
readonly uri: string;
|
|
2007
|
+
readonly title?: string | null | undefined;
|
|
1959
2008
|
}
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
readonly
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
readonly entity: string;
|
|
1966
|
-
readonly node: string;
|
|
1967
|
-
readonly triple: string;
|
|
1968
|
-
};
|
|
1969
|
-
readonly message: string;
|
|
2009
|
+
interface ChapterTreeApplyResult {
|
|
2010
|
+
readonly changed: boolean;
|
|
2011
|
+
readonly moved: readonly ChapterTreeMoveChange[];
|
|
2012
|
+
readonly renamed: readonly ChapterTreeTitleChange[];
|
|
2013
|
+
readonly unchanged: number;
|
|
1970
2014
|
}
|
|
1971
|
-
interface
|
|
1972
|
-
readonly
|
|
1973
|
-
readonly
|
|
1974
|
-
readonly
|
|
1975
|
-
readonly
|
|
1976
|
-
readonly
|
|
1977
|
-
readonly
|
|
1978
|
-
readonly
|
|
1979
|
-
readonly
|
|
1980
|
-
readonly triplePattern?: ArchiveTriplePattern;
|
|
1981
|
-
readonly types?: readonly ArchiveCollectionType[];
|
|
2015
|
+
interface ChapterTreeMoveChange {
|
|
2016
|
+
readonly newUri: string;
|
|
2017
|
+
readonly newIndex: number;
|
|
2018
|
+
readonly newPath: readonly string[];
|
|
2019
|
+
readonly newParentUri: string | null;
|
|
2020
|
+
readonly oldUri: string;
|
|
2021
|
+
readonly oldIndex: number;
|
|
2022
|
+
readonly oldPath: readonly string[];
|
|
2023
|
+
readonly oldParentUri: string | null;
|
|
1982
2024
|
}
|
|
1983
|
-
interface
|
|
1984
|
-
readonly
|
|
1985
|
-
readonly
|
|
1986
|
-
readonly
|
|
2025
|
+
interface ChapterTreeTitleChange {
|
|
2026
|
+
readonly uri: string;
|
|
2027
|
+
readonly newTitle: string | null;
|
|
2028
|
+
readonly oldTitle: string | null;
|
|
1987
2029
|
}
|
|
1988
|
-
interface
|
|
1989
|
-
readonly
|
|
1990
|
-
readonly
|
|
1991
|
-
readonly
|
|
1992
|
-
readonly
|
|
1993
|
-
readonly
|
|
1994
|
-
readonly
|
|
1995
|
-
readonly types: readonly ArchiveCollectionType[] | null;
|
|
2030
|
+
interface MoveChapterOptions {
|
|
2031
|
+
readonly afterChapterId?: number;
|
|
2032
|
+
readonly beforeChapterId?: number;
|
|
2033
|
+
readonly first?: boolean;
|
|
2034
|
+
readonly last?: boolean;
|
|
2035
|
+
readonly parentChapterId?: number;
|
|
2036
|
+
readonly root?: boolean;
|
|
1996
2037
|
}
|
|
1997
|
-
interface
|
|
1998
|
-
readonly
|
|
1999
|
-
readonly
|
|
2000
|
-
readonly
|
|
2038
|
+
interface AdvanceChapterStagesOptions {
|
|
2039
|
+
readonly chapterId?: number;
|
|
2040
|
+
readonly extractionPrompt?: string;
|
|
2041
|
+
readonly llm: LLM<WikiGraphScope>;
|
|
2042
|
+
readonly logDirPath?: string;
|
|
2043
|
+
readonly onProgress?: AdvanceChapterStagesProgressCallback;
|
|
2044
|
+
readonly targetStage: ChapterStage;
|
|
2045
|
+
readonly userLanguage?: Language;
|
|
2001
2046
|
}
|
|
2002
|
-
interface
|
|
2003
|
-
readonly
|
|
2004
|
-
readonly
|
|
2005
|
-
readonly
|
|
2047
|
+
interface AdvanceChapterStagesProgressState {
|
|
2048
|
+
readonly graphWords: number;
|
|
2049
|
+
readonly summaryWords: number;
|
|
2050
|
+
readonly totalGraphWords: number;
|
|
2051
|
+
readonly totalSummaryWords: number;
|
|
2006
2052
|
}
|
|
2007
|
-
type
|
|
2008
|
-
type
|
|
2009
|
-
readonly
|
|
2010
|
-
readonly
|
|
2011
|
-
readonly
|
|
2012
|
-
readonly
|
|
2013
|
-
readonly state?: ChapterState;
|
|
2014
|
-
readonly summary: string;
|
|
2015
|
-
readonly type: Exclude<ArchiveObjectType, "triple">;
|
|
2016
|
-
} | {
|
|
2017
|
-
readonly evidence?: ArchiveFindEvidencePreview;
|
|
2018
|
-
readonly id: string;
|
|
2019
|
-
readonly label: string;
|
|
2020
|
-
readonly evidenceLinks?: readonly MentionLinkRecord[];
|
|
2021
|
-
readonly objectLabel: string;
|
|
2022
|
-
readonly objectQid: string;
|
|
2023
|
-
readonly predicate: string;
|
|
2024
|
-
readonly score?: number;
|
|
2025
|
-
readonly subjectLabel: string;
|
|
2026
|
-
readonly subjectQid: string;
|
|
2027
|
-
readonly summary: string;
|
|
2028
|
-
readonly type: "triple";
|
|
2029
|
-
};
|
|
2030
|
-
type ArchivePage = {
|
|
2031
|
-
readonly id: string;
|
|
2032
|
-
readonly state: ChapterState;
|
|
2033
|
-
readonly title: string;
|
|
2034
|
-
readonly type: "chapter";
|
|
2035
|
-
} | {
|
|
2036
|
-
readonly id: string;
|
|
2037
|
-
readonly title: string;
|
|
2038
|
-
readonly type: "chapter-title";
|
|
2039
|
-
} | {
|
|
2040
|
-
readonly id: string;
|
|
2041
|
-
readonly title: string;
|
|
2042
|
-
readonly tree: ChapterTree;
|
|
2043
|
-
readonly type: "chapter-tree";
|
|
2044
|
-
} | {
|
|
2045
|
-
readonly generatedNodeSummary: string;
|
|
2046
|
-
readonly id: string;
|
|
2047
|
-
readonly incoming: readonly GraphNeighbor[];
|
|
2048
|
-
readonly neighbors: readonly GraphNeighbor[];
|
|
2049
|
-
readonly outgoing: readonly GraphNeighbor[];
|
|
2050
|
-
readonly position: ArchiveFindPosition | undefined;
|
|
2051
|
-
readonly sourceFragments: readonly ArchiveNodeSourceFragment[];
|
|
2052
|
-
readonly title: string;
|
|
2053
|
-
readonly type: "node";
|
|
2054
|
-
} | {
|
|
2055
|
-
readonly backlinks?: ArchiveBacklinks;
|
|
2056
|
-
readonly fragment: ArchiveSourceFragment;
|
|
2057
|
-
readonly id: string;
|
|
2058
|
-
readonly nextFragmentId: string | undefined;
|
|
2059
|
-
readonly nodes: readonly ArchiveNodeLabel[];
|
|
2060
|
-
readonly previousFragmentId: string | undefined;
|
|
2061
|
-
readonly title: string;
|
|
2062
|
-
readonly type: "fragment";
|
|
2063
|
-
} | {
|
|
2064
|
-
readonly content: string;
|
|
2065
|
-
readonly id: string;
|
|
2066
|
-
readonly title: string;
|
|
2067
|
-
readonly type: "summary";
|
|
2068
|
-
} | {
|
|
2069
|
-
readonly evidence: ArchiveFindEvidencePreview;
|
|
2070
|
-
readonly id: string;
|
|
2071
|
-
readonly label: string;
|
|
2072
|
-
readonly labels: readonly string[];
|
|
2073
|
-
readonly mentionCount: number;
|
|
2074
|
-
readonly qid: string;
|
|
2075
|
-
readonly type: "entity";
|
|
2076
|
-
} | {
|
|
2077
|
-
readonly en: ArchiveEntityWikipageLocale | null;
|
|
2078
|
-
readonly id: string;
|
|
2079
|
-
readonly type: "entity-wikipage";
|
|
2080
|
-
readonly zh: ArchiveEntityWikipageLocale | null;
|
|
2053
|
+
type AdvanceChapterStagesProgressCallback = (event: AdvanceChapterStagesProgressEvent) => void | Promise<void>;
|
|
2054
|
+
type AdvanceChapterStagesProgressEvent = {
|
|
2055
|
+
readonly type: "selected";
|
|
2056
|
+
readonly state: AdvanceChapterStagesProgressState;
|
|
2057
|
+
readonly targetStage: ChapterStage;
|
|
2058
|
+
readonly totalChapters: number;
|
|
2081
2059
|
} | {
|
|
2082
|
-
readonly
|
|
2083
|
-
readonly
|
|
2084
|
-
readonly
|
|
2085
|
-
readonly
|
|
2086
|
-
readonly predicate: string;
|
|
2087
|
-
readonly subjectQid: string;
|
|
2088
|
-
readonly type: "triple";
|
|
2060
|
+
readonly type: "skipped";
|
|
2061
|
+
readonly chapter: ChapterEntry;
|
|
2062
|
+
readonly reason: "planned";
|
|
2063
|
+
readonly targetStage: ChapterStage;
|
|
2089
2064
|
} | {
|
|
2090
|
-
readonly
|
|
2091
|
-
readonly
|
|
2092
|
-
readonly
|
|
2093
|
-
readonly publisher?: string;
|
|
2094
|
-
readonly title: string;
|
|
2095
|
-
readonly type: "meta";
|
|
2065
|
+
readonly type: "progress";
|
|
2066
|
+
readonly state: AdvanceChapterStagesProgressState;
|
|
2067
|
+
readonly targetStage: ChapterStage;
|
|
2096
2068
|
} | {
|
|
2097
|
-
readonly
|
|
2098
|
-
readonly
|
|
2099
|
-
readonly
|
|
2069
|
+
readonly type: "started";
|
|
2070
|
+
readonly chapter: ChapterEntry;
|
|
2071
|
+
readonly step: "graph" | "summary";
|
|
2072
|
+
readonly targetStage: ChapterStage;
|
|
2100
2073
|
} | {
|
|
2101
|
-
readonly
|
|
2102
|
-
readonly
|
|
2103
|
-
readonly
|
|
2104
|
-
readonly
|
|
2074
|
+
readonly type: "completed";
|
|
2075
|
+
readonly chapter: ChapterEntry;
|
|
2076
|
+
readonly step: "graph" | "summary";
|
|
2077
|
+
readonly targetStage: ChapterStage;
|
|
2105
2078
|
};
|
|
2106
|
-
interface
|
|
2107
|
-
readonly
|
|
2108
|
-
readonly
|
|
2109
|
-
readonly
|
|
2079
|
+
interface AdvanceChapterStagesResult {
|
|
2080
|
+
readonly advanced: readonly ChapterEntry[];
|
|
2081
|
+
readonly pending: readonly ChapterEntry[];
|
|
2082
|
+
readonly skipped: readonly ChapterEntry[];
|
|
2110
2083
|
}
|
|
2111
|
-
interface
|
|
2112
|
-
readonly
|
|
2113
|
-
readonly
|
|
2114
|
-
readonly related: readonly ArchiveListItem[];
|
|
2084
|
+
interface AddChapterOptions {
|
|
2085
|
+
readonly parentChapterId?: number;
|
|
2086
|
+
readonly title?: string | null | undefined;
|
|
2115
2087
|
}
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2088
|
+
|
|
2089
|
+
declare function advanceChapterStages(document: Document, options: AdvanceChapterStagesOptions): Promise<AdvanceChapterStagesResult>;
|
|
2090
|
+
|
|
2091
|
+
interface SerialProgressSink {
|
|
2092
|
+
begin?(input?: {
|
|
2093
|
+
readonly fragments: number;
|
|
2094
|
+
readonly words: number;
|
|
2095
|
+
}): Promise<void>;
|
|
2096
|
+
advance(wordsCount: number): Promise<void>;
|
|
2097
|
+
complete(finalWordsCount?: number): Promise<void>;
|
|
2125
2098
|
}
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
readonly
|
|
2129
|
-
readonly
|
|
2099
|
+
|
|
2100
|
+
interface GenerateChapterGraphOptions {
|
|
2101
|
+
readonly extractionPrompt?: string;
|
|
2102
|
+
readonly llm: LLM<WikiGraphScope>;
|
|
2103
|
+
readonly logDirPath?: string;
|
|
2104
|
+
readonly progressTracker?: SerialProgressSink;
|
|
2105
|
+
readonly userLanguage?: Language;
|
|
2130
2106
|
}
|
|
2131
|
-
interface
|
|
2132
|
-
readonly
|
|
2133
|
-
readonly
|
|
2134
|
-
readonly
|
|
2107
|
+
interface GenerateChapterSummaryOptions {
|
|
2108
|
+
readonly llm: LLM<WikiGraphScope>;
|
|
2109
|
+
readonly logDirPath?: string;
|
|
2110
|
+
readonly userLanguage?: Language;
|
|
2135
2111
|
}
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
readonly
|
|
2145
|
-
|
|
2112
|
+
|
|
2113
|
+
declare function generateChapterGraph(document: Document, chapterId: number, options: GenerateChapterGraphOptions): Promise<ChapterDetails>;
|
|
2114
|
+
declare function generateChapterSummary(document: Document, chapterId: number, options: GenerateChapterSummaryOptions): Promise<ChapterDetails>;
|
|
2115
|
+
|
|
2116
|
+
declare function addChapter(document: Document, options: AddChapterOptions): Promise<ChapterDetails>;
|
|
2117
|
+
declare function resolveChapterPath(document: Document, chapterPath: string): Promise<number>;
|
|
2118
|
+
declare function resolveChapterPathReadonly(document: ReadonlyDocument, chapterPath: string): Promise<number>;
|
|
2119
|
+
declare function applyChapterTree(document: Document, tree: ChapterTreeInput, options?: {
|
|
2120
|
+
readonly dryRun?: boolean;
|
|
2121
|
+
}): Promise<ChapterTreeApplyResult>;
|
|
2122
|
+
declare function moveChapter(document: Document, chapterId: number, options: MoveChapterOptions): Promise<ChapterDetails>;
|
|
2123
|
+
declare function removeChapter(document: Document, chapterId: number, options?: {
|
|
2124
|
+
readonly recursive?: boolean;
|
|
2125
|
+
}): Promise<void>;
|
|
2126
|
+
declare function resetChapter(document: Document, chapterId: number, stage: Exclude<ChapterStage, "summarized">): Promise<ChapterDetails>;
|
|
2127
|
+
declare function setChapterSource(document: Document, chapterId: number, stream: ReaderTextStream): Promise<ChapterDetails>;
|
|
2128
|
+
declare function setChapterSummary(document: Document, chapterId: number, summary: string): Promise<ChapterDetails>;
|
|
2129
|
+
declare function setChapterTitle(document: Document, chapterId: number, title: string | null | undefined): Promise<ChapterDetails>;
|
|
2130
|
+
|
|
2131
|
+
declare function parseChapterTreeInput(input: unknown): ChapterTreeInput;
|
|
2132
|
+
|
|
2133
|
+
interface WikiGraphSerialEntry {
|
|
2134
|
+
readonly fragmentCount: number;
|
|
2135
|
+
readonly serialId: number;
|
|
2136
|
+
readonly title: string | null;
|
|
2137
|
+
readonly tocPath: readonly string[];
|
|
2146
2138
|
}
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2139
|
+
|
|
2140
|
+
declare class WikiGraphArchive {
|
|
2141
|
+
#private;
|
|
2142
|
+
constructor(document: ReadonlyDocument, documentDirectoryPath: string);
|
|
2143
|
+
exportEpub(path: string): Promise<void>;
|
|
2144
|
+
exportText(path: string): Promise<void>;
|
|
2145
|
+
readCover(): Promise<SourceAsset | undefined>;
|
|
2146
|
+
readMeta(): Promise<BookMeta | undefined>;
|
|
2147
|
+
readToc(): Promise<TocFile | undefined>;
|
|
2148
|
+
readArchiveFormatVersion(): Promise<number>;
|
|
2149
|
+
readChapterStage(serialId: number): Promise<ChapterStage>;
|
|
2150
|
+
listSerials(): Promise<readonly WikiGraphSerialEntry[]>;
|
|
2151
|
+
readSerialSummary(serialId: number): Promise<string>;
|
|
2152
|
+
saveAs(path: string): Promise<void>;
|
|
2150
2153
|
}
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
readonly
|
|
2154
|
-
readonly preview: string;
|
|
2155
|
-
readonly sentenceCount: number;
|
|
2156
|
-
readonly text: string;
|
|
2157
|
-
readonly wordsCount: number;
|
|
2154
|
+
|
|
2155
|
+
interface DigestDocumentSessionOptions {
|
|
2156
|
+
readonly documentDirPath?: string;
|
|
2158
2157
|
}
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
readonly
|
|
2162
|
-
readonly
|
|
2158
|
+
|
|
2159
|
+
interface WikiGraphLLMOptions {
|
|
2160
|
+
readonly cacheDirPath?: string;
|
|
2161
|
+
readonly concurrent?: number;
|
|
2162
|
+
readonly logDirPath?: string;
|
|
2163
|
+
readonly model: LanguageModel;
|
|
2164
|
+
readonly retryIntervalSeconds?: number;
|
|
2165
|
+
readonly retryTimes?: number;
|
|
2166
|
+
readonly stream?: boolean;
|
|
2167
|
+
readonly temperature?: number | readonly number[];
|
|
2168
|
+
readonly timeout?: number;
|
|
2169
|
+
readonly topP?: number | readonly number[];
|
|
2170
|
+
}
|
|
2171
|
+
interface WikiGraphOptions {
|
|
2172
|
+
readonly debugLogDirPath?: string;
|
|
2173
|
+
readonly llm?: LanguageModel | WikiGraphLLMOptions;
|
|
2174
|
+
readonly verbose?: boolean;
|
|
2175
|
+
}
|
|
2176
|
+
type WikiGraphOpenSessionOptions = DigestDocumentSessionOptions;
|
|
2177
|
+
interface WikiGraphSourceSessionOptions extends DigestDocumentSessionOptions {
|
|
2178
|
+
readonly extractionPrompt?: string;
|
|
2179
|
+
readonly onProgress?: WikiGraphProgressCallback;
|
|
2180
|
+
readonly path: string;
|
|
2181
|
+
readonly targetStage?: ChapterStage;
|
|
2182
|
+
readonly userLanguage?: Language;
|
|
2163
2183
|
}
|
|
2164
|
-
interface
|
|
2165
|
-
readonly
|
|
2166
|
-
readonly
|
|
2167
|
-
readonly
|
|
2168
|
-
readonly
|
|
2169
|
-
readonly
|
|
2184
|
+
interface WikiGraphTextStreamSessionOptions extends DigestDocumentSessionOptions {
|
|
2185
|
+
readonly bookLanguage?: string | null;
|
|
2186
|
+
readonly extractionPrompt?: string;
|
|
2187
|
+
readonly onProgress?: WikiGraphProgressCallback;
|
|
2188
|
+
readonly sourceFormat?: "markdown" | "txt";
|
|
2189
|
+
readonly stream: AsyncIterable<string> | Iterable<string>;
|
|
2190
|
+
readonly targetStage?: ChapterStage;
|
|
2191
|
+
readonly title?: string | null;
|
|
2192
|
+
readonly userLanguage?: Language;
|
|
2170
2193
|
}
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2194
|
+
declare class WikiGraph {
|
|
2195
|
+
#private;
|
|
2196
|
+
constructor(options: WikiGraphOptions);
|
|
2197
|
+
digestEpubSession<T>(options: WikiGraphSourceSessionOptions, operation: (digest: WikiGraphArchive) => Promise<T> | T): Promise<T>;
|
|
2198
|
+
digestMarkdownSession<T>(options: WikiGraphSourceSessionOptions, operation: (digest: WikiGraphArchive) => Promise<T> | T): Promise<T>;
|
|
2199
|
+
digestTextStreamSession<T>(options: WikiGraphTextStreamSessionOptions, operation: (digest: WikiGraphArchive) => Promise<T> | T): Promise<T>;
|
|
2200
|
+
digestTxtSession<T>(options: WikiGraphSourceSessionOptions, operation: (digest: WikiGraphArchive) => Promise<T> | T): Promise<T>;
|
|
2201
|
+
openSession<T>(path: string, operation: (digest: WikiGraphArchive) => Promise<T> | T, options?: WikiGraphOpenSessionOptions): Promise<T>;
|
|
2177
2202
|
}
|
|
2178
|
-
declare function getArchiveIndex(document: ReadonlyDocument): Promise<ArchiveIndex>;
|
|
2179
|
-
declare function listArchiveObjects(document: ReadonlyDocument, kind: ArchiveListKind): Promise<readonly ArchiveListItem[]>;
|
|
2180
|
-
declare function listArchiveCollection(document: ReadonlyDocument, options?: ArchiveCollectionOptions): Promise<ArchiveCollectionResult>;
|
|
2181
|
-
declare function findArchiveObjects(document: ReadonlyDocument, query: string, options?: ArchiveFindOptions): Promise<ArchiveFindResult>;
|
|
2182
|
-
declare function rebuildArchiveSearchIndex(document: Document, progress?: SearchIndexProgressReporter): Promise<void>;
|
|
2183
|
-
declare function isArchiveSearchIndexCurrent(document: ReadonlyDocument): Promise<boolean>;
|
|
2184
|
-
declare function readArchiveSearchIndexStatus(document: ReadonlyDocument): Promise<"current" | "dirty" | "missing">;
|
|
2185
|
-
declare function clearDirtyArchiveSearchIndex(document: Document): Promise<void>;
|
|
2186
|
-
declare function createArchiveSearchIndexFingerprint(document: ReadonlyDocument): Promise<string>;
|
|
2187
|
-
declare function grepArchiveObjects(document: ReadonlyDocument, query: string, options?: ArchiveFindOptions): Promise<ArchiveFindResult>;
|
|
2188
|
-
declare function readArchiveText(document: ReadonlyDocument, id: string): Promise<string>;
|
|
2189
|
-
declare function readArchivePage(document: ReadonlyDocument, id: string, options?: ArchivePageOptions): Promise<ArchivePage>;
|
|
2190
|
-
declare function listArchiveLinks(document: ReadonlyDocument, id: string, direction: "backlinks" | "links"): Promise<readonly GraphNeighbor[]>;
|
|
2191
|
-
declare function listAllArchiveLinks(document: ReadonlyDocument, id: string): Promise<readonly GraphNeighbor[]>;
|
|
2192
|
-
declare function listRelatedArchiveObjects(document: ReadonlyDocument, id: string, options?: ArchiveRelatedOptions): Promise<ArchiveRelatedResult>;
|
|
2193
|
-
declare function listArchiveEvidence(document: ReadonlyDocument, uri: string, options?: ArchiveEvidenceOptions): Promise<ArchiveEvidence>;
|
|
2194
|
-
declare function packArchiveContext(document: ReadonlyDocument, id: string, budget: number): Promise<ArchivePack>;
|
|
2195
|
-
declare function formatChapterId(chapterId: number): string;
|
|
2196
|
-
declare function formatEdgeId(edge: ReadingEdgeRecord): string;
|
|
2197
|
-
declare function formatNodeId(nodeId: number): string;
|
|
2198
|
-
declare function formatSummaryId(chapterId: number): string;
|
|
2199
2203
|
|
|
2200
|
-
type
|
|
2204
|
+
type QueryScope = {
|
|
2205
|
+
readonly kind: "archive";
|
|
2206
|
+
readonly archiveId: number;
|
|
2207
|
+
} | {
|
|
2208
|
+
readonly kind: "library";
|
|
2209
|
+
readonly libraryId: number;
|
|
2210
|
+
};
|
|
2211
|
+
type QueryIndexScope = {
|
|
2212
|
+
readonly kind: "archive-index";
|
|
2213
|
+
readonly archivePath: string;
|
|
2214
|
+
readonly archiveKey: string;
|
|
2215
|
+
} | {
|
|
2216
|
+
readonly kind: "library-index";
|
|
2217
|
+
readonly libraryId: number;
|
|
2218
|
+
};
|
|
2219
|
+
type ContinuationCursorBase = {
|
|
2201
2220
|
readonly archiveKey: string;
|
|
2202
2221
|
readonly archivePath: string;
|
|
2222
|
+
readonly indexScope: QueryIndexScope;
|
|
2223
|
+
};
|
|
2224
|
+
type ContinuationCursor = (ContinuationCursorBase & {
|
|
2203
2225
|
readonly backlinks?: boolean;
|
|
2204
2226
|
readonly chapters: readonly number[] | null;
|
|
2205
2227
|
readonly cursor: string;
|
|
@@ -2215,10 +2237,9 @@ type ContinuationCursor = {
|
|
|
2215
2237
|
readonly subjectQid?: string;
|
|
2216
2238
|
};
|
|
2217
2239
|
readonly types: readonly string[] | null;
|
|
2218
|
-
} | {
|
|
2219
|
-
readonly archiveKey: string;
|
|
2220
|
-
readonly archivePath: string;
|
|
2240
|
+
}) | (ContinuationCursorBase & {
|
|
2221
2241
|
readonly backlinks?: boolean;
|
|
2242
|
+
readonly chapters?: readonly number[] | null;
|
|
2222
2243
|
readonly cursor: string;
|
|
2223
2244
|
readonly evidenceLimit?: number;
|
|
2224
2245
|
readonly format: "json" | "jsonl" | "text";
|
|
@@ -2231,9 +2252,7 @@ type ContinuationCursor = {
|
|
|
2231
2252
|
readonly subjectQid?: string;
|
|
2232
2253
|
};
|
|
2233
2254
|
readonly types: readonly string[] | null;
|
|
2234
|
-
} | {
|
|
2235
|
-
readonly archiveKey: string;
|
|
2236
|
-
readonly archivePath: string;
|
|
2255
|
+
}) | (ContinuationCursorBase & {
|
|
2237
2256
|
readonly cursor: string;
|
|
2238
2257
|
readonly format: "json" | "jsonl" | "text";
|
|
2239
2258
|
readonly kind: "evidence";
|
|
@@ -2241,9 +2260,7 @@ type ContinuationCursor = {
|
|
|
2241
2260
|
readonly query?: string;
|
|
2242
2261
|
readonly sourceContext?: number;
|
|
2243
2262
|
readonly targetUri: string;
|
|
2244
|
-
} | {
|
|
2245
|
-
readonly archiveKey: string;
|
|
2246
|
-
readonly archivePath: string;
|
|
2263
|
+
}) | (ContinuationCursorBase & {
|
|
2247
2264
|
readonly cursor: string;
|
|
2248
2265
|
readonly evidenceLimit?: number;
|
|
2249
2266
|
readonly format: "json" | "jsonl" | "text";
|
|
@@ -2253,115 +2270,113 @@ type ContinuationCursor = {
|
|
|
2253
2270
|
readonly role?: "any" | "object" | "self" | "subject";
|
|
2254
2271
|
readonly sourceContext?: number;
|
|
2255
2272
|
readonly targetUri: string;
|
|
2256
|
-
};
|
|
2273
|
+
});
|
|
2274
|
+
|
|
2257
2275
|
declare function createContinuationCursor(input: ContinuationCursor): Promise<string>;
|
|
2258
2276
|
declare function readContinuationCursor(cursorId: string): Promise<ContinuationCursor>;
|
|
2259
2277
|
|
|
2260
|
-
interface SearchSessionInput {
|
|
2261
|
-
readonly archiveKey: string;
|
|
2262
|
-
readonly chapters: readonly number[] | null;
|
|
2263
|
-
readonly chunkHits?: readonly SearchChunkHitInput[];
|
|
2264
|
-
readonly entityHits?: readonly SearchEntityHitInput[];
|
|
2265
|
-
readonly evidenceEvents?: readonly SearchEvidenceHitEventInput[];
|
|
2266
|
-
readonly items?: readonly ArchiveFindHit[];
|
|
2267
|
-
readonly lens: string;
|
|
2268
|
-
readonly match: string;
|
|
2269
|
-
readonly order: string;
|
|
2270
|
-
readonly query: string;
|
|
2271
|
-
readonly revisionScope: string;
|
|
2272
|
-
readonly terms: readonly string[];
|
|
2273
|
-
readonly tripleHits?: readonly SearchTripleHitInput[];
|
|
2274
|
-
readonly types: readonly string[] | null;
|
|
2275
|
-
}
|
|
2276
|
-
declare const SEARCH_EVIDENCE_KIND: {
|
|
2277
|
-
readonly mention: 1;
|
|
2278
|
-
readonly mentionLink: 2;
|
|
2279
|
-
readonly chunk: 3;
|
|
2280
|
-
};
|
|
2281
|
-
type SearchEvidenceKind = (typeof SEARCH_EVIDENCE_KIND)[keyof typeof SEARCH_EVIDENCE_KIND];
|
|
2282
|
-
interface SearchEvidenceHitEventInput {
|
|
2283
|
-
readonly chapterId: number;
|
|
2284
|
-
readonly evidenceId: string;
|
|
2285
|
-
readonly evidenceKind: SearchEvidenceKind;
|
|
2286
|
-
readonly score: number;
|
|
2287
|
-
readonly sentenceIndex: number;
|
|
2288
|
-
}
|
|
2289
|
-
interface SearchEntityHitInput {
|
|
2290
|
-
readonly evidenceTopScores?: readonly number[];
|
|
2291
|
-
readonly propertyTopScores?: readonly number[];
|
|
2292
|
-
readonly qid: string;
|
|
2293
|
-
}
|
|
2294
|
-
interface SearchTripleHitInput {
|
|
2295
|
-
readonly evidenceTopScores: readonly number[];
|
|
2296
|
-
readonly objectQid: string;
|
|
2297
|
-
readonly predicate: string;
|
|
2298
|
-
readonly subjectQid: string;
|
|
2299
|
-
}
|
|
2300
|
-
interface SearchChunkHitInput {
|
|
2301
|
-
readonly chunkId: number;
|
|
2302
|
-
readonly evidenceTopScores?: readonly number[];
|
|
2303
|
-
readonly propertyTopScores?: readonly number[];
|
|
2304
|
-
}
|
|
2305
|
-
interface SearchSessionPage {
|
|
2306
|
-
readonly chapters: readonly number[] | null;
|
|
2307
|
-
readonly items: readonly ArchiveFindHit[];
|
|
2308
|
-
readonly lens: string;
|
|
2309
|
-
readonly match: string;
|
|
2310
|
-
readonly nextCursor: string | null;
|
|
2311
|
-
readonly query: string;
|
|
2312
|
-
readonly sessionId: string;
|
|
2313
|
-
readonly terms: readonly string[];
|
|
2314
|
-
readonly types: readonly string[] | null;
|
|
2315
|
-
}
|
|
2316
|
-
interface SearchSessionDescriptor {
|
|
2317
|
-
readonly chapters: readonly number[] | null;
|
|
2318
|
-
readonly createdAt: number;
|
|
2319
|
-
readonly lens: string;
|
|
2320
|
-
readonly match: string;
|
|
2321
|
-
readonly objectCachesPopulated: boolean;
|
|
2322
|
-
readonly query: string;
|
|
2323
|
-
readonly sessionId: string;
|
|
2324
|
-
readonly terms: readonly string[];
|
|
2325
|
-
readonly types: readonly string[] | null;
|
|
2326
|
-
}
|
|
2327
|
-
type SearchSessionCacheInput = Omit<SearchSessionInput, "items">;
|
|
2328
|
-
declare function readCachedSearchSessionPage(input: SearchSessionCacheInput, offset: number, limit: number): Promise<SearchSessionPage | undefined>;
|
|
2329
|
-
declare function createSearchSession(input: SearchSessionInput): Promise<string>;
|
|
2330
2278
|
declare function deleteArchiveSearchSessions(archiveKey: string): Promise<void>;
|
|
2331
|
-
|
|
2279
|
+
|
|
2280
|
+
declare function addBuildJob(options: AddBuildJobOptions): Promise<BuildJob>;
|
|
2281
|
+
declare function recordBuildJobInputRevision(input: {
|
|
2282
|
+
readonly currentRevision: number;
|
|
2283
|
+
readonly jobId: string;
|
|
2284
|
+
readonly ownerId: string;
|
|
2285
|
+
}): Promise<BuildJob>;
|
|
2286
|
+
declare function assertBuildJobInputRevision(input: {
|
|
2287
|
+
readonly currentRevision: number;
|
|
2288
|
+
readonly jobId: string;
|
|
2289
|
+
readonly ownerId: string;
|
|
2290
|
+
}): Promise<void>;
|
|
2291
|
+
declare function listBuildJobs(options?: BuildJobListOptions): Promise<BuildJob[]>;
|
|
2292
|
+
declare function getBuildJob(jobId: string): Promise<BuildJob>;
|
|
2293
|
+
declare function resolveBuildJobId(jobIdPrefix: string): Promise<string>;
|
|
2294
|
+
declare function pauseBuildJob(jobId: string): Promise<BuildJob>;
|
|
2295
|
+
declare function resumeBuildJob(jobId: string): Promise<BuildJob>;
|
|
2296
|
+
declare function cancelBuildJob(jobId: string): Promise<BuildJob>;
|
|
2297
|
+
declare function boostBuildJob(jobId: string): Promise<BuildJob>;
|
|
2298
|
+
declare function updateBuildJobTarget(jobId: string, target: BuildJobTarget): Promise<BuildJob>;
|
|
2299
|
+
|
|
2300
|
+
declare function assertNoActiveBuildJobs(input: {
|
|
2301
|
+
readonly archivePath: string;
|
|
2302
|
+
readonly chapterIds: readonly number[];
|
|
2303
|
+
readonly operation: string;
|
|
2304
|
+
readonly requiresTarget?: BuildJobTarget;
|
|
2305
|
+
}): Promise<void>;
|
|
2306
|
+
declare function assertNoActiveBuildJobConflicts(input: {
|
|
2307
|
+
readonly archivePath: string;
|
|
2308
|
+
readonly operation: string;
|
|
2309
|
+
readonly requiresTarget?: BuildJobTarget;
|
|
2310
|
+
readonly scope: BuildJobConflictScope;
|
|
2311
|
+
}): Promise<void>;
|
|
2312
|
+
|
|
2313
|
+
declare function readBuildJobEvents(job: Pick<BuildJob, "eventsPath">): Promise<BuildJobEvent[]>;
|
|
2314
|
+
|
|
2315
|
+
declare function cleanBuildJobs(options?: {
|
|
2316
|
+
readonly olderThanMs?: number;
|
|
2317
|
+
readonly states?: readonly BuildJobState[];
|
|
2318
|
+
}): Promise<number>;
|
|
2332
2319
|
|
|
2333
2320
|
interface ChapterGraphBuildArtifact {
|
|
2334
2321
|
readonly documentPath: string;
|
|
2335
2322
|
readonly chapterId: number;
|
|
2323
|
+
readonly objectsPath: string;
|
|
2336
2324
|
readonly parameter: GraphBuildParameterInput$1;
|
|
2337
2325
|
}
|
|
2338
2326
|
interface GraphBuildParameterInput$1 {
|
|
2339
2327
|
readonly language?: string;
|
|
2340
2328
|
readonly prompt: string;
|
|
2341
2329
|
}
|
|
2342
|
-
interface
|
|
2343
|
-
readonly
|
|
2344
|
-
|
|
2345
|
-
|
|
2330
|
+
interface BuildChapterGraphArtifactOptions {
|
|
2331
|
+
readonly extractionPrompt?: string;
|
|
2332
|
+
readonly llm: LLM<WikiGraphScope>;
|
|
2333
|
+
readonly logDirPath?: string;
|
|
2334
|
+
readonly progressTracker?: SerialProgressSink;
|
|
2346
2335
|
readonly sourceText: readonly string[];
|
|
2336
|
+
readonly userLanguage?: Language;
|
|
2347
2337
|
readonly workspacePath: string;
|
|
2348
2338
|
}
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
}
|
|
2339
|
+
|
|
2340
|
+
declare function buildChapterGraphArtifact(chapterId: number, options: BuildChapterGraphArtifactOptions): Promise<ChapterGraphBuildArtifact>;
|
|
2341
|
+
declare function commitChapterGraphArtifact(document: Document, artifact: ChapterGraphBuildArtifact): Promise<ChapterDetails>;
|
|
2342
|
+
|
|
2354
2343
|
declare function readChapterBuildInput(document: ReadonlyDocument, chapterId: number): Promise<{
|
|
2355
2344
|
readonly details: ChapterDetails;
|
|
2356
2345
|
readonly revision: number;
|
|
2357
2346
|
readonly sourceText: readonly string[];
|
|
2358
2347
|
}>;
|
|
2359
|
-
|
|
2360
|
-
|
|
2348
|
+
|
|
2349
|
+
interface ChapterSummaryInputSnapshot {
|
|
2350
|
+
readonly filePath: string;
|
|
2351
|
+
readonly objectsPath: string;
|
|
2352
|
+
}
|
|
2353
|
+
interface BuildChapterSummaryArtifactOptions {
|
|
2354
|
+
readonly llm: LLM<WikiGraphScope>;
|
|
2355
|
+
readonly logDirPath?: string;
|
|
2356
|
+
readonly readingGraphObjectsPath?: string;
|
|
2357
|
+
readonly snapshotPath?: string;
|
|
2358
|
+
readonly sourceDocumentPath?: string;
|
|
2359
|
+
readonly userLanguage?: Language;
|
|
2360
|
+
readonly workspacePath: string;
|
|
2361
|
+
}
|
|
2362
|
+
interface SummaryInputSnapshotData {
|
|
2363
|
+
readonly chunks: readonly ChunkRecord[];
|
|
2364
|
+
readonly fragmentGroups: readonly SentenceGroupRecord[];
|
|
2365
|
+
readonly fragments: readonly FragmentRecord[];
|
|
2366
|
+
readonly readingEdges: readonly ReadingEdgeRecord[];
|
|
2367
|
+
readonly serial: SerialRecord;
|
|
2368
|
+
readonly snakeChunks: readonly SnakeChunkRecord[];
|
|
2369
|
+
readonly snakeEdges: readonly SnakeEdgeRecord[];
|
|
2370
|
+
readonly snakes: readonly SnakeRecord[];
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2361
2373
|
declare function buildChapterSummaryArtifact(document: ReadonlyDocument, chapterId: number, options: BuildChapterSummaryArtifactOptions): Promise<string>;
|
|
2362
2374
|
declare function buildChapterSummaryArtifactFromSnapshot(chapterId: number, options: BuildChapterSummaryArtifactOptions & {
|
|
2363
2375
|
readonly snapshotPath: string;
|
|
2364
2376
|
}): Promise<string>;
|
|
2377
|
+
declare function buildChapterSummaryArtifactFromReadingGraphObjects(chapterId: number, options: BuildChapterSummaryArtifactOptions & {
|
|
2378
|
+
readonly readingGraphObjectsPath: string;
|
|
2379
|
+
}): Promise<string>;
|
|
2365
2380
|
declare function commitChapterSummaryArtifact(document: Document, chapterId: number, summary: string): Promise<ChapterDetails>;
|
|
2366
2381
|
declare function snapshotChapterSummaryInput(document: ReadonlyDocument, chapterId: number, workspacePath: string): Promise<ChapterSummaryInputSnapshot>;
|
|
2367
2382
|
|
|
@@ -2369,6 +2384,7 @@ interface ChapterKnowledgeGraphBuildArtifact {
|
|
|
2369
2384
|
readonly chapterId: number;
|
|
2370
2385
|
readonly mentionLinksPath: string;
|
|
2371
2386
|
readonly mentionsPath: string;
|
|
2387
|
+
readonly objectsPath: string;
|
|
2372
2388
|
readonly parameter: GraphBuildParameterInput;
|
|
2373
2389
|
readonly workspacePath: string;
|
|
2374
2390
|
}
|
|
@@ -2387,33 +2403,58 @@ interface BuildChapterKnowledgeGraphArtifactOptions {
|
|
|
2387
2403
|
readonly workspacePath: string;
|
|
2388
2404
|
}
|
|
2389
2405
|
interface GenerateChapterKnowledgeGraphArtifactOptions {
|
|
2390
|
-
readonly policyPrompt
|
|
2406
|
+
readonly policyPrompt?: string;
|
|
2391
2407
|
readonly progressTracker?: Pick<BuildJobProgressReporter, "throwIfStopped" | "updatePhase">;
|
|
2392
2408
|
readonly request: GuaranteedRequestController;
|
|
2393
2409
|
readonly resolverOptions?: Omit<WikipageResolverOptions, "progress">;
|
|
2394
2410
|
readonly wikispine?: Pick<MatchWikispineSentenceCandidatesOptions, "command" | "dataDir" | "endpoint" | "provider">;
|
|
2395
2411
|
readonly workspacePath: string;
|
|
2396
2412
|
}
|
|
2413
|
+
type KnowledgeGraphProgressTracker = GenerateChapterKnowledgeGraphArtifactOptions["progressTracker"];
|
|
2414
|
+
|
|
2415
|
+
declare function buildChapterKnowledgeGraphArtifact(chapterId: number, options: BuildChapterKnowledgeGraphArtifactOptions): Promise<ChapterKnowledgeGraphBuildArtifact>;
|
|
2416
|
+
|
|
2417
|
+
declare function commitChapterKnowledgeGraphArtifact(document: Document, artifact: ChapterKnowledgeGraphBuildArtifact): Promise<void>;
|
|
2418
|
+
declare function clearChapterKnowledgeGraph(document: Document, chapterId: number): Promise<void>;
|
|
2419
|
+
|
|
2397
2420
|
declare function generateChapterKnowledgeGraphArtifact(document: ReadonlyDocument, chapterId: number, options: GenerateChapterKnowledgeGraphArtifactOptions): Promise<ChapterKnowledgeGraphBuildArtifact>;
|
|
2398
|
-
declare function snapshotChapterKnowledgeGraphInput(document: ReadonlyDocument, chapterId: number): Promise<ChapterKnowledgeGraphInputSnapshot>;
|
|
2399
2421
|
declare function generateChapterKnowledgeGraphArtifactFromSnapshot(chapterId: number, snapshot: ChapterKnowledgeGraphInputSnapshot, options: GenerateChapterKnowledgeGraphArtifactOptions): Promise<ChapterKnowledgeGraphBuildArtifact>;
|
|
2400
|
-
|
|
2422
|
+
|
|
2401
2423
|
declare function groundWikimatchCandidates(input: {
|
|
2402
2424
|
readonly candidates: readonly WikimatchCandidate[];
|
|
2403
2425
|
readonly policyPrompt: string;
|
|
2404
|
-
readonly progressTracker?:
|
|
2426
|
+
readonly progressTracker?: KnowledgeGraphProgressTracker;
|
|
2405
2427
|
readonly request: GuaranteedRequestController;
|
|
2406
2428
|
readonly text: string;
|
|
2407
2429
|
}): Promise<readonly WikimatchAcceptedMention[]>;
|
|
2430
|
+
|
|
2408
2431
|
declare function createEnrichmentProgressReporter(progressTracker: Pick<BuildJobProgressReporter, "throwIfStopped" | "updatePhase">): (event: WikipageResolveProgress) => Promise<void>;
|
|
2409
|
-
declare function commitChapterKnowledgeGraphArtifact(document: Document, artifact: ChapterKnowledgeGraphBuildArtifact): Promise<void>;
|
|
2410
|
-
declare function clearChapterKnowledgeGraph(document: Document, chapterId: number): Promise<void>;
|
|
2411
2432
|
|
|
2412
|
-
declare function
|
|
2433
|
+
declare function snapshotChapterKnowledgeGraphInput(document: ReadonlyDocument, chapterId: number): Promise<ChapterKnowledgeGraphInputSnapshot>;
|
|
2434
|
+
|
|
2435
|
+
declare const DEFAULT_EXTRACTION_PROMPT = "Focus on the main storyline and key character developments. Preserve important dialogues and critical plot points. Background descriptions and minor details can be compressed significantly.";
|
|
2436
|
+
declare const DEFAULT_KNOWLEDGE_GRAPH_RECALL_PROMPT: string;
|
|
2437
|
+
declare function resolveExtractionPrompt(prompt: string | undefined): string;
|
|
2438
|
+
declare function resolveKnowledgeGraphRecallPrompt(prompt: string | undefined): string;
|
|
2439
|
+
|
|
2440
|
+
declare function formatChapterUri(path: string): string;
|
|
2441
|
+
declare function parseChapterPath(value: string, label?: string): string;
|
|
2442
|
+
declare function parseChapterUriPath(uri: string): string | undefined;
|
|
2443
|
+
|
|
2413
2444
|
declare function readWikgArchiveFormatVersion(documentDirectoryPath: string): Promise<number>;
|
|
2414
2445
|
|
|
2446
|
+
declare function writeWikgArchive(documentDirectoryPath: string, outputPath: string): Promise<void>;
|
|
2447
|
+
|
|
2415
2448
|
declare const WIKI_GRAPH_URI_PREFIX = "wikg://";
|
|
2416
2449
|
declare const WIKI_GRAPH_JOB_URI_PREFIX = "wikg://local/job";
|
|
2450
|
+
interface ParsedWikiGraphUri {
|
|
2451
|
+
readonly protocol: string;
|
|
2452
|
+
readonly path: readonly string[];
|
|
2453
|
+
readonly fragment?: number | {
|
|
2454
|
+
readonly begin: number;
|
|
2455
|
+
readonly end: number;
|
|
2456
|
+
};
|
|
2457
|
+
}
|
|
2417
2458
|
interface LocatedWikiGraphUri {
|
|
2418
2459
|
readonly archivePath?: string;
|
|
2419
2460
|
readonly objectUri?: string;
|
|
@@ -2421,11 +2462,12 @@ interface LocatedWikiGraphUri {
|
|
|
2421
2462
|
declare function isWikiGraphUri(value: string | undefined): value is string;
|
|
2422
2463
|
declare function isWikiGraphJobUri(value: string | undefined): value is string;
|
|
2423
2464
|
declare function parseLocatedWikiGraphUri(uri: string): LocatedWikiGraphUri;
|
|
2465
|
+
declare function parseWikiGraphUriSyntax(uri: string): ParsedWikiGraphUri;
|
|
2424
2466
|
declare function formatLocatedWikiGraphUri(archivePath: string, objectUri?: string): string;
|
|
2425
2467
|
declare function formatWikiGraphCommandUri(archivePath: string, objectUri?: string, cwd?: string): string;
|
|
2426
|
-
declare function formatLocatedChapterUri(archivePath: string,
|
|
2427
|
-
declare function formatLocatedChapterResourceUri(archivePath: string,
|
|
2428
|
-
declare function formatLocatedChapterSourceCollectionUri(archivePath: string,
|
|
2468
|
+
declare function formatLocatedChapterUri(archivePath: string, chapterPath: string): string;
|
|
2469
|
+
declare function formatLocatedChapterResourceUri(archivePath: string, chapterPath: string, resource: "source" | "summary" | "title"): string;
|
|
2470
|
+
declare function formatLocatedChapterSourceCollectionUri(archivePath: string, chapterPath: string): string;
|
|
2429
2471
|
declare function requireArchiveUri(uri: string): string;
|
|
2430
2472
|
declare function requireLocatedObjectUri(uri: string): {
|
|
2431
2473
|
readonly archivePath: string;
|
|
@@ -2451,6 +2493,64 @@ declare class WikiGraphArchiveFile {
|
|
|
2451
2493
|
}): Promise<T>;
|
|
2452
2494
|
}
|
|
2453
2495
|
|
|
2496
|
+
declare function ensureWikiGraphHomeSchemaCurrent(): Promise<void>;
|
|
2497
|
+
declare function readWikiGraphHomeSchemaVersion(coreDatabasePath?: string): Promise<number>;
|
|
2498
|
+
|
|
2499
|
+
declare function ensureWikiGraphArchiveSchemaCurrent(archivePath: string): Promise<void>;
|
|
2500
|
+
declare function readWikiGraphArchiveSchemaVersion(archivePath: string): Promise<number>;
|
|
2501
|
+
declare function upgradeWikiGraphArchiveSchema(archivePath: string): Promise<void>;
|
|
2502
|
+
|
|
2503
|
+
type WikiGraphMaintenanceUpgradeResult = {
|
|
2504
|
+
readonly kind: "home";
|
|
2505
|
+
readonly path: string;
|
|
2506
|
+
readonly schemaVersionBefore: number;
|
|
2507
|
+
readonly schemaVersionAfter: number;
|
|
2508
|
+
readonly status: "already-current" | "upgraded";
|
|
2509
|
+
} | {
|
|
2510
|
+
readonly kind: "archive";
|
|
2511
|
+
readonly path: string;
|
|
2512
|
+
readonly schemaVersionBefore: number;
|
|
2513
|
+
readonly schemaVersionAfter: number;
|
|
2514
|
+
readonly status: "already-current" | "upgraded";
|
|
2515
|
+
} | {
|
|
2516
|
+
readonly kind: "sdpub";
|
|
2517
|
+
readonly inputPath: string;
|
|
2518
|
+
readonly outputPath: string;
|
|
2519
|
+
readonly status: "migrated";
|
|
2520
|
+
} | WikiGraphLibraryUpgradeResult;
|
|
2521
|
+
interface WikiGraphLibraryUpgradeResult {
|
|
2522
|
+
readonly kind: "lib";
|
|
2523
|
+
readonly library: {
|
|
2524
|
+
readonly id: number;
|
|
2525
|
+
readonly publicId: string;
|
|
2526
|
+
readonly uri: string;
|
|
2527
|
+
readonly folderPath: string;
|
|
2528
|
+
readonly stagingPath: string;
|
|
2529
|
+
};
|
|
2530
|
+
readonly upgraded: readonly WikiGraphLibraryArchiveUpgradeItem[];
|
|
2531
|
+
readonly skipped: readonly WikiGraphLibraryArchiveUpgradeItem[];
|
|
2532
|
+
readonly failed?: WikiGraphLibraryArchiveFailure | undefined;
|
|
2533
|
+
readonly status: "already-current" | "partial" | "upgraded";
|
|
2534
|
+
}
|
|
2535
|
+
interface WikiGraphLibraryArchiveUpgradeItem {
|
|
2536
|
+
readonly publicId: string;
|
|
2537
|
+
readonly uri: string;
|
|
2538
|
+
readonly path: string;
|
|
2539
|
+
readonly schemaVersionBefore: number;
|
|
2540
|
+
readonly schemaVersionAfter: number;
|
|
2541
|
+
}
|
|
2542
|
+
interface WikiGraphLibraryArchiveFailure {
|
|
2543
|
+
readonly publicId: string;
|
|
2544
|
+
readonly uri: string;
|
|
2545
|
+
readonly path: string;
|
|
2546
|
+
readonly message: string;
|
|
2547
|
+
}
|
|
2548
|
+
declare function upgradeWikiGraphMaintenanceTarget(target: string, options?: {
|
|
2549
|
+
readonly outputPath?: string;
|
|
2550
|
+
}): Promise<WikiGraphMaintenanceUpgradeResult>;
|
|
2551
|
+
declare function assertWikiGraphLibrarySchemaCurrent(target: ParsedWikiGraphLibraryUri): Promise<void>;
|
|
2552
|
+
declare function upgradeWikiGraphLibrarySchema(target: ParsedWikiGraphLibraryUri): Promise<WikiGraphLibraryUpgradeResult>;
|
|
2553
|
+
|
|
2454
2554
|
interface LegacySdpubMigrationResult {
|
|
2455
2555
|
readonly inputPath: string;
|
|
2456
2556
|
readonly outputPath: string;
|
|
@@ -2459,4 +2559,140 @@ declare function migrateLegacySdpubToWikg(inputPath: string, outputPath?: string
|
|
|
2459
2559
|
|
|
2460
2560
|
declare function formatError(error: unknown): string;
|
|
2461
2561
|
|
|
2462
|
-
export { type AddChapterOptions, type AdvanceChapterStagesOptions, type AdvanceChapterStagesProgressCallback, type AdvanceChapterStagesProgressEvent, type AdvanceChapterStagesResult, type ArchiveBacklinkBucket, type ArchiveBacklinks, type ArchiveCollectionOptions, type ArchiveCollectionResult, type ArchiveCollectionType, type ArchiveEvidence, type ArchiveEvidenceItem, type ArchiveFindEvidencePreview, type ArchiveFindField, type ArchiveFindFilterType, type ArchiveFindHit, type ArchiveFindObjectType, type ArchiveFindOptions, type ArchiveFindOrder, type ArchiveFindPosition, type ArchiveFindResult, type ArchiveIndex, type ArchiveIndexSettings, type ArchiveListItem, type ArchiveListKind, type ArchiveNodeLabel, type ArchiveNodeSourceFragment, type ArchiveObjectType, type ArchivePack, type ArchivePage, type ArchiveRelatedResult, type ArchiveTriplePattern, type BookMeta, type BuildChapterGraphArtifactOptions, type BuildChapterKnowledgeGraphArtifactOptions, type BuildChapterSummaryArtifactOptions, BuildJobProgressReporter, type BuildWikimatchSurfaceProtectionInputOptions, type BuildWikimatchWindowsOptions, CHAPTER_STAGES, CLI_FULL_COMMAND, CLI_PRIMARY_COMMAND, type CachedDisambiguationRecord, type CachedPageRecord, type CachedQidRecord, type ChapterDetails, type ChapterEntry, type ChapterGraphBuildArtifact, type ChapterKnowledgeGraphBuildArtifact, type ChapterKnowledgeGraphInputSnapshot, type ChapterStage, type ChapterTree, type ChapterTreeApplyResult, type ChapterTreeInput, type ChapterTreeInputNode, type ChapterTreeMoveChange, type ChapterTreeNode, type ChapterTreeTitleChange, ChunkImportance, type ChunkRecord, ChunkRetention, ChunkStore, type ContinuationCursor, type CreateSnakeRecord, DEFAULT_WIKISPINE_FETCH_ENDPOINT, Database, type DigestProgressEvent, DirectoryDocument, type DisambiguationExpansion, type DisambiguationLinkedQid, type DisambiguationMeaningPriority, type DisambiguationPageText, type DisambiguationProfile, type DisambiguationProfileMeaning, type DisambiguationProfileNormalizer, type DisambiguationProfileNormalizerInput, type Document, type DocumentContext, EVIDENCE_SELECTION_JSON_SHAPE, EVIDENCE_SELECTION_PROMPT_FRAGMENT, type EvidenceQuoteMatchStrategy, type EvidenceQuoteScore, type EvidenceSelection, type EvidenceSelectionCandidate, type EvidenceSelectionFailure, type EvidenceSelectionList, type EvidenceSelectionResolution, type EvidenceSelectionSentence, type EvidenceSentenceId, FragmentDraft, FragmentGroupStore, type FragmentRecord, Fragments, type GenerateChapterGraphOptions, type GenerateChapterSummaryOptions, type GraphBuildParameterRecord, GraphBuildParameterStore, type GraphEdge, type GraphEvidenceLine, type GraphNeighbor, type GraphNode, type GraphPathStep, type GraphSearchField, type GraphSearchHit, type GraphStatus, type GuaranteedRequest, type GuaranteedRequestController, type JudgeWikimatchPolicyOptions, type JudgeWikimatchSurfaceProtectionOptions, LLM, type LLMOptions, LLMPaymentRequiredError, type LLMRequestOptions, type LLMStreamProgressCallback, type LLMTokenUsage, type LLMTokenUsageCallback, type LLMessage, Language, LanguageCode, type LocatedWikiGraphUri, type MatchWikispineSentenceCandidatesOptions, type MentionLinkRecord, MentionLinkStore, type MentionRecord, MentionStore, type MoveChapterOptions, type NarrowWikimatchCandidateOptionsInput, type NarrowWikimatchCandidateOptionsOptions, ObjectMetadataKind, ObjectMetadataStore, type ObjectMetadataTarget, type QidResolution, RateLimiter, type ReadingEdgeRecord, ReadingEdgeStore, type ReadonlyChunkStore, type ReadonlyDocument, type ReadonlyFragmentGroupStore, type ReadonlyTextStreams as ReadonlyFragments, type ReadonlyGraphBuildParameterStore, type ReadonlyMentionLinkStore, type ReadonlyMentionStore, type ReadonlyObjectMetadataStore, type ReadonlyReadingEdgeStore, type ReadonlySerialTextStream as ReadonlySerialFragments, type ReadonlySerialStore, type ReadonlySerialTextStream, type ReadonlySnakeChunkStore, type ReadonlySnakeEdgeStore, type ReadonlySnakeStore, type ReadonlyTextStreams, SCHEMA_SQL, SEARCH_INDEX_FTS_HIT_LIMIT, SEARCH_OBJECT_PROPERTY_KIND, SEARCH_OBJECT_PROPERTY_OWNER_KIND, type SearchIndexInput, type SearchIndexObjectHit, type SearchIndexProgressEvent, type SearchIndexProgressPhase, type SearchIndexProgressReporter, type SearchIndexQueryResult, type SearchIndexStatus, type SearchIndexTextHit, type SearchObjectPropertyKind, type SearchObjectPropertyOwnerKind, type SearchSessionDescriptor, type SearchSessionInput, type SearchSessionPage, type SentenceGroupRecord, type SentenceId, type SentenceRecord, type SerialDiscoveryItem, SerialFragments, type SerialProgressEvent, type SerialRecord, SerialStore, SerialTextStream, type SerialsDiscoveredEvent, type SnakeChunkRecord, SnakeChunkStore, type SnakeEdgeRecord, SnakeEdgeStore, type SnakeRecord, SnakeStore, TEXT_SENTENCE_KIND, TOC_FILE_VERSION, type TestWikispineRuntimeOptions, type TextSentenceKind, TextStreams, WIKI_GRAPH_CONTEXT_VERSION, WIKI_GRAPH_EDITOR_SCOPES, WIKI_GRAPH_JOB_URI_PREFIX, WIKI_GRAPH_READER_SCOPES, WIKI_GRAPH_SCOPES, WIKI_GRAPH_URI_PREFIX, WikiGraph, WikiGraphArchive, WikiGraphArchiveFile, type WikiGraphLLMOptions, type WikiGraphOpenSessionOptions, type WikiGraphOperation, type WikiGraphOptions, type WikiGraphProgressCallback, type WikiGraphProgressEvent, type WikiGraphProgressEventType, WikiGraphScope, type WikiGraphSerialEntry, type WikiGraphSourceSessionOptions, WikiGraphTask, WikiGraphTaskContext, type WikiGraphTaskContextOptions, type WikiGraphTaskIdentity, type WikiGraphTaskType, type WikiGraphTextStreamSessionOptions, type WikimatchAcceptedMention, type WikimatchCandidate, type WikimatchCandidateOptionNarrowingFallback, type WikimatchCandidateOptionNarrowingItemOutput, type WikimatchCandidateOptionNarrowingResponse, type WikimatchCandidateOptionNarrowingResult, type WikimatchConflictGroup, type WikimatchPolicyContinuation, type WikimatchPolicyDecision, type WikimatchPolicyDecisionOutput, type WikimatchPolicyFallback, type WikimatchPolicyJudgeInput, type WikimatchPolicyJudgeResult, type WikimatchPolicyResponse, type WikimatchPolicyUpdate, type WikimatchProtectedSurface, type WikimatchQidOption, type WikimatchSentence, type WikimatchSurface, type WikimatchSurfaceProtectionBuildResult, type WikimatchSurfaceProtectionFallback, type WikimatchSurfaceProtectionInput, type WikimatchSurfaceProtectionResponse, type WikimatchSurfaceProtectionResult, type WikimatchTextRange, type WikimatchWindow, WikimediaClient, WikipageCache, WikipageResolver, type WikipageResolverOptions, type WikipageSitelink, type WikispineProvider, type WikispineRuntimeTestResult, addChapter, advanceChapterStages, applyChapterTree, applyQidResolutions, buildChapterGraphArtifact, buildChapterKnowledgeGraphArtifact, buildChapterSummaryArtifact, buildChapterSummaryArtifactFromSnapshot, buildWikimatchSurfaceProtectionInput, buildWikimatchWindows, clearChapterKnowledgeGraph, clearDirtyArchiveSearchIndex, commitChapterGraphArtifact, commitChapterKnowledgeGraphArtifact, commitChapterSummaryArtifact, countWikimatchCandidateOptions, countWikimatchQidOption, createArchiveSearchIndexFingerprint, createContinuationCursor, createDefaultWikiGraphSampling, createDisambiguationProfileNormalizer, createEnrichmentProgressReporter, createEnv, createSearchIndexFingerprint, createSearchSession, createWikiGraphTaskId, createWikiGraphTempDirectory, deleteArchiveSearchSessions, enrichWikimatchCandidates, ensureSearchIndex, ensureSharedStateDatabaseInitialized, expandRangeByWords, expectChunkImportance, expectChunkRetention, filterCandidateQidOptions, findArchiveObjects, findGraphPath, formatCandidateForPrompt, formatChapterId, formatEdgeId, formatError, formatEvidenceSelectionChoicePrompt, formatLanguageForPrompt, formatLocatedChapterResourceUri, formatLocatedChapterSourceCollectionUri, formatLocatedChapterUri, formatLocatedWikiGraphUri, formatNodeId, formatSummaryId, formatWikiGraphCommandUri, generateChapterGraph, generateChapterKnowledgeGraphArtifact, generateChapterKnowledgeGraphArtifactFromSnapshot, generateChapterSummary, getArchiveIndex, getChapterDetails, getChapterTree, getGraphEvidence, getGraphNode, getGraphStatus, getLanguageCode, getWikipageLanguageCode, grepArchiveObjects, groundWikimatchCandidates, isArchiveSearchIndexCurrent, isChunkImportance, isChunkRetention, isSearchIndexCurrent, isWikiGraphJobUri, isWikiGraphUri, judgeWikimatchPolicy, judgeWikimatchSurfaceProtection, listAllArchiveLinks, listArchiveCollection, listArchiveEvidence, listArchiveLinks, listArchiveObjects, listCandidateSelectableQids, listChapters, listGraphNeighbors, listGraphNodes, listRelatedArchiveObjects, listWordBoundaries, matchWikispineSentenceCandidates, migrateLegacySdpubToWikg, moveChapter, narrowWikimatchCandidateOptions, normalizeEvidenceDisplayText, normalizeEvidenceText, normalizeLanguageCode, openSharedStateDatabase, packArchiveContext, parseChapterTreeInput, parseLocatedWikiGraphUri, parseNarrowingResponse, parsePolicyResponse, parseRetryAfterMs, parseSurfaceProtectionResponse, querySearchIndex, rankEvidenceQuote, readArchiveIndexSettings, readArchivePage, readArchiveSearchIndexStatus, readArchiveText, readCachedSearchSessionPage, readChapterBuildInput, readContinuationCursor, readSearchIndexFingerprintFromDatabase, readSearchIndexStatus, readWikgArchiveFormatVersion, rebuildArchiveSearchIndex, removeChapter, requireArchiveUri, requireLocatedObjectOrArchiveUri, requireLocatedObjectUri, resetChapter, resolveDataDirPath, resolveEvidenceSelection, resolveEvidenceSelectionList, resolveWikiGraphCoreDatabasePath, resolveWikiGraphHomeDirectoryPath, resolveWikiGraphStateRootPath, runSearchCacheGc, scoreEvidenceQuote, searchGraphNodes, setChapterSource, setChapterSummary, setChapterTitle, setFtsIndexEmbedded, sliceCandidateByOptionBudget, snapshotChapterKnowledgeGraphInput, snapshotChapterSummaryInput, splitCandidateByOptionBudget, suppressContainedRanges, testWikispineRuntime, validateNarrowingResponse, validatePolicyResponse, validateSurfaceProtectionResponse, withLoggingContext, writeWikgArchive };
|
|
2562
|
+
declare const WIKG_OBJECT_SCHEMA_VERSION = 1;
|
|
2563
|
+
type WikgObject = WikgMetaObject | WikgParameterObject | WikgSourceFragmentObject | WikgReadingChunkObject | WikgReadingEdgeObject | WikgFragmentGroupObject | WikgSnakeObject | WikgSnakeChunkObject | WikgSnakeEdgeObject | WikgSummaryObject | WikgMentionObject | WikgMentionLinkObject | WikgEndObject;
|
|
2564
|
+
interface WikgMetaObject {
|
|
2565
|
+
readonly type: "meta";
|
|
2566
|
+
readonly schemaVersion: typeof WIKG_OBJECT_SCHEMA_VERSION;
|
|
2567
|
+
readonly chapterId: number;
|
|
2568
|
+
readonly stream: "knowledge-graph" | "reading-graph" | "summary";
|
|
2569
|
+
}
|
|
2570
|
+
interface WikgParameterObject {
|
|
2571
|
+
readonly type: "parameter";
|
|
2572
|
+
readonly scope: "knowledge-graph" | "reading-graph" | "summary";
|
|
2573
|
+
readonly language?: string;
|
|
2574
|
+
readonly prompt: string;
|
|
2575
|
+
}
|
|
2576
|
+
interface WikgSourceFragmentObject {
|
|
2577
|
+
readonly type: "source-fragment";
|
|
2578
|
+
readonly fragmentId: number;
|
|
2579
|
+
readonly summary: string;
|
|
2580
|
+
readonly sentences: readonly SentenceRecord[];
|
|
2581
|
+
}
|
|
2582
|
+
interface WikgReadingChunkObject {
|
|
2583
|
+
readonly type: "reading-chunk";
|
|
2584
|
+
readonly id: string;
|
|
2585
|
+
readonly generation: number;
|
|
2586
|
+
readonly sentenceIndex: number;
|
|
2587
|
+
readonly label: string;
|
|
2588
|
+
readonly content: string;
|
|
2589
|
+
readonly sentenceIndexes: readonly number[];
|
|
2590
|
+
readonly retention?: ChunkRetention;
|
|
2591
|
+
readonly importance?: ChunkImportance;
|
|
2592
|
+
readonly wordsCount: number;
|
|
2593
|
+
readonly weight: number;
|
|
2594
|
+
}
|
|
2595
|
+
interface WikgReadingEdgeObject {
|
|
2596
|
+
readonly type: "reading-edge";
|
|
2597
|
+
readonly fromChunkId: string;
|
|
2598
|
+
readonly toChunkId: string;
|
|
2599
|
+
readonly strength?: string;
|
|
2600
|
+
readonly weight: number;
|
|
2601
|
+
}
|
|
2602
|
+
interface WikgFragmentGroupObject {
|
|
2603
|
+
readonly type: "fragment-group";
|
|
2604
|
+
readonly groupId: number;
|
|
2605
|
+
readonly startSentenceIndex: number;
|
|
2606
|
+
readonly endSentenceIndex: number;
|
|
2607
|
+
}
|
|
2608
|
+
interface WikgSnakeObject {
|
|
2609
|
+
readonly type: "snake";
|
|
2610
|
+
readonly id: string;
|
|
2611
|
+
readonly groupId: number;
|
|
2612
|
+
readonly localSnakeId: number;
|
|
2613
|
+
readonly size: number;
|
|
2614
|
+
readonly firstLabel: string;
|
|
2615
|
+
readonly lastLabel: string;
|
|
2616
|
+
readonly wordsCount: number;
|
|
2617
|
+
readonly weight: number;
|
|
2618
|
+
}
|
|
2619
|
+
interface WikgSnakeChunkObject {
|
|
2620
|
+
readonly type: "snake-chunk";
|
|
2621
|
+
readonly snakeId: string;
|
|
2622
|
+
readonly chunkId: string;
|
|
2623
|
+
readonly position: number;
|
|
2624
|
+
}
|
|
2625
|
+
interface WikgSnakeEdgeObject {
|
|
2626
|
+
readonly type: "snake-edge";
|
|
2627
|
+
readonly fromSnakeId: string;
|
|
2628
|
+
readonly toSnakeId: string;
|
|
2629
|
+
readonly weight: number;
|
|
2630
|
+
}
|
|
2631
|
+
interface WikgSummaryObject {
|
|
2632
|
+
readonly type: "summary";
|
|
2633
|
+
readonly text: string;
|
|
2634
|
+
}
|
|
2635
|
+
interface WikgMentionObject {
|
|
2636
|
+
readonly type: "mention";
|
|
2637
|
+
readonly id: string;
|
|
2638
|
+
readonly fragmentId?: number;
|
|
2639
|
+
readonly sentenceIndex?: number;
|
|
2640
|
+
readonly rangeStart: number;
|
|
2641
|
+
readonly rangeEnd: number;
|
|
2642
|
+
readonly surface: string;
|
|
2643
|
+
readonly qid: string;
|
|
2644
|
+
readonly confidence?: number;
|
|
2645
|
+
readonly note?: string;
|
|
2646
|
+
}
|
|
2647
|
+
interface WikgMentionLinkObject {
|
|
2648
|
+
readonly type: "mention-link";
|
|
2649
|
+
readonly id: string;
|
|
2650
|
+
readonly sourceMentionId: string;
|
|
2651
|
+
readonly targetMentionId: string;
|
|
2652
|
+
readonly predicate: string;
|
|
2653
|
+
readonly evidenceSentenceIndexes: readonly number[];
|
|
2654
|
+
readonly confidence?: number;
|
|
2655
|
+
readonly note?: string;
|
|
2656
|
+
}
|
|
2657
|
+
interface WikgEndObject {
|
|
2658
|
+
readonly type: "end";
|
|
2659
|
+
}
|
|
2660
|
+
interface ChapterKnowledgeGraphObjects {
|
|
2661
|
+
readonly mentionLinks: readonly MentionLinkRecord[];
|
|
2662
|
+
readonly mentions: readonly MentionRecord[];
|
|
2663
|
+
readonly parameter?: WikgParameterObject;
|
|
2664
|
+
}
|
|
2665
|
+
declare function parseWikgObject(record: unknown): WikgObject;
|
|
2666
|
+
declare function writeWikgObjectsToJsonl(path: string, objects: AsyncIterable<WikgObject> | Iterable<WikgObject>): Promise<void>;
|
|
2667
|
+
declare function readWikgObjectsFromJsonl(path: string): AsyncGenerator<WikgObject>;
|
|
2668
|
+
declare function createChapterKnowledgeGraphObjectStream(input: {
|
|
2669
|
+
readonly chapterId: number;
|
|
2670
|
+
readonly mentionLinks: AsyncIterable<MentionLinkRecord> | Iterable<MentionLinkRecord>;
|
|
2671
|
+
readonly mentions: AsyncIterable<MentionRecord> | Iterable<MentionRecord>;
|
|
2672
|
+
readonly parameter?: {
|
|
2673
|
+
readonly language?: string;
|
|
2674
|
+
readonly prompt: string;
|
|
2675
|
+
};
|
|
2676
|
+
}): AsyncGenerator<WikgObject>;
|
|
2677
|
+
declare function collectChapterKnowledgeGraphObjects(chapterId: number, objects: AsyncIterable<WikgObject> | Iterable<WikgObject>): Promise<ChapterKnowledgeGraphObjects>;
|
|
2678
|
+
declare function createChapterReadingGraphObjectStream(input: {
|
|
2679
|
+
readonly chapterId: number;
|
|
2680
|
+
readonly document: ReadonlyDocument;
|
|
2681
|
+
readonly parameter?: {
|
|
2682
|
+
readonly language?: string;
|
|
2683
|
+
readonly prompt: string;
|
|
2684
|
+
};
|
|
2685
|
+
}): AsyncGenerator<WikgObject>;
|
|
2686
|
+
declare function collectReadingGraphObjects(chapterId: number, objects: AsyncIterable<WikgObject> | Iterable<WikgObject>): Promise<{
|
|
2687
|
+
readonly chunks: readonly WikgReadingChunkObject[];
|
|
2688
|
+
readonly fragmentGroups: readonly WikgFragmentGroupObject[];
|
|
2689
|
+
readonly fragments: readonly FragmentRecord[];
|
|
2690
|
+
readonly parameter?: WikgParameterObject;
|
|
2691
|
+
readonly readingEdges: readonly WikgReadingEdgeObject[];
|
|
2692
|
+
readonly snakeChunks: readonly WikgSnakeChunkObject[];
|
|
2693
|
+
readonly snakeEdges: readonly WikgSnakeEdgeObject[];
|
|
2694
|
+
readonly snakes: readonly WikgSnakeObject[];
|
|
2695
|
+
}>;
|
|
2696
|
+
declare function createSummaryInputSnapshotFromReadingGraphObjects(chapterId: number, objects: AsyncIterable<WikgObject> | Iterable<WikgObject>): Promise<SummaryInputSnapshotData>;
|
|
2697
|
+
|
|
2698
|
+
export { AddBuildJobOptions, type AddChapterOptions, type AdvanceChapterStagesOptions, type AdvanceChapterStagesProgressCallback, type AdvanceChapterStagesProgressEvent, type AdvanceChapterStagesResult, type ArchiveBacklinkBucket, type ArchiveBacklinks, type ArchiveCollectionOptions, type ArchiveCollectionResult, type ArchiveCollectionType, type ArchiveEvidence, type ArchiveEvidenceItem, type ArchiveFindEvidencePreview, type ArchiveFindField, type ArchiveFindFilterType, type ArchiveFindHit, type ArchiveFindObjectType, type ArchiveFindOptions, type ArchiveFindOrder, type ArchiveFindPosition, type ArchiveFindResult, type ArchiveIndex, type ArchiveLibrarySource, type ArchiveListItem, type ArchiveListKind, type ArchiveNodeLabel, type ArchiveNodeSourceFragment, type ArchiveObjectType, type ArchivePack, type ArchivePage, type ArchiveRelatedResult, type ArchiveTriplePattern, type BookMeta, type BuildChapterGraphArtifactOptions, type BuildChapterKnowledgeGraphArtifactOptions, type BuildChapterSummaryArtifactOptions, BuildJob, BuildJobConflictScope, BuildJobEvent, BuildJobListOptions, BuildJobProgressReporter, BuildJobState, BuildJobTarget, type BuildWikimatchWindowsOptions, CHAPTER_STAGES, CLI_FULL_COMMAND, CLI_PRIMARY_COMMAND, type CachedDisambiguationRecord, type CachedPageRecord, type CachedQidRecord, type ChapterDetails, type ChapterEntry, type ChapterGraphBuildArtifact, type ChapterKnowledgeGraphBuildArtifact, type ChapterKnowledgeGraphInputSnapshot, type ChapterStage, type ChapterTree, type ChapterTreeApplyResult, type ChapterTreeInput, type ChapterTreeInputNode, type ChapterTreeMoveChange, type ChapterTreeNode, type ChapterTreeTitleChange, type ContinuationCursor, DEFAULT_EXTRACTION_PROMPT, DEFAULT_KNOWLEDGE_GRAPH_RECALL_PROMPT, DEFAULT_WIKISPINE_FETCH_ENDPOINT, Database, type DigestProgressEvent, DirectoryDocument, type DisambiguationExpansion, type DisambiguationLinkedQid, type DisambiguationMeaningPriority, type DisambiguationPageText, type DisambiguationProfile, type DisambiguationProfileError, type DisambiguationProfileMeaning, type DisambiguationProfileNormalizer, type DisambiguationProfileNormalizerInput, type Document, EVIDENCE_SELECTION_JSON_SHAPE, EVIDENCE_SELECTION_PROMPT_FRAGMENT, type EnrichmentStore, type EvidenceQuoteMatchStrategy, type EvidenceQuoteScore, type EvidenceSelection, type EvidenceSelectionCandidate, type EvidenceSelectionFailure, type EvidenceSelectionList, type EvidenceSelectionResolution, type EvidenceSelectionSentence, type EvidenceSentenceId, type GenerateChapterGraphOptions, type GenerateChapterSummaryOptions, type GuaranteedRequest, type GuaranteedRequestController, type JudgeWikimatchPolicyOptions, LLM, type LLMOptions, LLMPaymentRequiredError, type LLMRequestOptions, type LLMStreamProgressCallback, type LLMTokenUsage, type LLMTokenUsageCallback, type LLMessage, Language, LanguageCode, type LocatedWikiGraphUri, type MoveChapterOptions, ObjectMetadataKind, type ObjectMetadataTarget, type ParsedWikiGraphLibraryUri, type ParsedWikiGraphUri, type QidResolution, type QueryIndexScope, type QueryScope, RateLimiter, type ReadonlyDocument, type SerialDiscoveryItem, type SerialProgressEvent, type SerialsDiscoveredEvent, TOC_FILE_VERSION, WIKG_OBJECT_SCHEMA_VERSION, WIKI_GRAPH_CONTEXT_VERSION, WIKI_GRAPH_EDITOR_SCOPES, WIKI_GRAPH_JOB_URI_PREFIX, WIKI_GRAPH_READER_SCOPES, WIKI_GRAPH_SCOPES, WIKI_GRAPH_URI_PREFIX, type WikgObject, type WikiClient, WikiGraph, WikiGraphArchive, WikiGraphArchiveFile, type WikiGraphLLMOptions, type WikiGraphLibraryArchiveRecord, type WikiGraphLibraryIndexObjectHit, type WikiGraphLibraryIndexQueryResult, type WikiGraphLibraryIndexSource, type WikiGraphLibraryIndexState, type WikiGraphLibraryIndexStatus, type WikiGraphLibraryIndexTextHit, type WikiGraphLibraryRecord, type WikiGraphLibraryScanResult, type WikiGraphLibraryUpgradeResult, type WikiGraphMaintenanceUpgradeResult, type WikiGraphOpenSessionOptions, type WikiGraphOperation, type WikiGraphOptions, type WikiGraphProgressCallback, type WikiGraphProgressEvent, type WikiGraphProgressEventType, WikiGraphScope, type WikiGraphSerialEntry, type WikiGraphSourceSessionOptions, WikiGraphTask, WikiGraphTaskContext, type WikiGraphTaskContextOptions, type WikiGraphTaskIdentity, type WikiGraphTaskType, type WikiGraphTextStreamSessionOptions, type WikimatchAcceptedMention, type WikimatchCandidate, type WikimatchConflictGroup, type WikimatchPolicyDecision, type WikimatchPolicyDecisionOutput, type WikimatchPolicyFallback, type WikimatchPolicyJudgeInput, type WikimatchPolicyJudgeResult, type WikimatchPolicyResponse, type WikimatchPolicyUpdate, type WikimatchQidOption, type WikimatchTextRange, type WikimatchWindow, WikimediaClient, WikipageCache, WikipageResolver, type WikipageResolverOptions, type WikipageSitelink, type WikispineProvider, addBuildJob, addChapter, addWikiGraphLibraryArchive, advanceChapterStages, applyChapterTree, assertBuildJobInputRevision, assertNoActiveBuildJobConflicts, assertNoActiveBuildJobs, assertWikiGraphLibrarySchemaCurrent, boostBuildJob, buildChapterGraphArtifact, buildChapterKnowledgeGraphArtifact, buildChapterSummaryArtifact, buildChapterSummaryArtifactFromReadingGraphObjects, buildChapterSummaryArtifactFromSnapshot, buildWikimatchWindows, cancelBuildJob, cleanBuildJobs, clearChapterKnowledgeGraph, clearWikiGraphLibraryMetadata, collectChapterKnowledgeGraphObjects, collectReadingGraphObjects, commitChapterGraphArtifact, commitChapterKnowledgeGraphArtifact, commitChapterSummaryArtifact, createChapterKnowledgeGraphObjectStream, createChapterReadingGraphObjectStream, createContinuationCursor, createDefaultWikiGraphSampling, createDisambiguationProfileNormalizer, createEnrichmentProgressReporter, createEnv, createSummaryInputSnapshotFromReadingGraphObjects, createWikiGraphLibrary, createWikiGraphTaskId, createWikiGraphTempDirectory, deleteArchiveSearchSessions, deleteWikiGraphLibraryMetadataKey, disableWikiGraphLibraryIndex, ensureDefaultWikiGraphLibrary, ensureLibraryManagedArchiveHasNoSearchIndex, ensureWikiGraphArchiveSchemaCurrent, ensureWikiGraphHomeSchemaCurrent, finalizeWikiGraphLibraryArchiveWrite, findArchiveObjects, findWikiGraphLibraryObjects, formatChapterId, formatChapterUri, formatEdgeId, formatError, formatEvidenceSelectionChoicePrompt, formatLanguageForPrompt, formatLocatedChapterResourceUri, formatLocatedChapterSourceCollectionUri, formatLocatedChapterUri, formatLocatedWikiGraphUri, formatNodeId, formatSummaryId, formatWikiGraphCommandUri, formatWikiGraphLibraryUri, generateChapterGraph, generateChapterKnowledgeGraphArtifact, generateChapterKnowledgeGraphArtifactFromSnapshot, generateChapterSummary, getArchiveIndex, getBuildJob, getChapterDetails, getChapterTree, getLanguageCode, getWikiGraphLibraryArchive, getWikiGraphLibraryArchiveById, getWikiGraphLibraryMetadata, getWikipageLanguageCode, grepArchiveObjects, groundWikimatchCandidates, isArchiveSearchIndexCurrent, isWikiGraphJobUri, isWikiGraphLibraryUri, isWikiGraphUri, judgeWikimatchPolicy, listAllArchiveLinks, listArchiveCollection, listArchiveEvidence, listArchiveLinks, listArchiveObjects, listBuildJobs, listChapters, listRelatedArchiveObjects, listRelatedWikiGraphLibraryObjects, listWikiGraphLibraries, listWikiGraphLibraryArchives, listWikiGraphLibraryEvidence, listWikiGraphLibraryIndexArchiveIdsForObject, listWikiGraphLibraryObjects, listWikiGraphLibraryScope, markWikiGraphLibraryIndexDirty, migrateLegacySdpubToWikg, moveChapter, moveWikiGraphLibraryArchive, normalizeEvidenceDisplayText, normalizeEvidenceText, normalizeLanguageCode, openSharedStateDatabase, packArchiveContext, packWikiGraphLibraryContext, parseChapterPath, parseChapterTreeInput, parseChapterUriPath, parseLocatedWikiGraphUri, parsePolicyResponse, parseRetryAfterMs, parseWikgObject, parseWikiGraphLibraryUri, parseWikiGraphUriSyntax, pauseBuildJob, putWikiGraphLibraryMetadata, queryWikiGraphLibrarySearchIndex, rankEvidenceQuote, readArchiveIndexSettings, readArchivePage, readArchiveText, readBuildJobEvents, readChapterBuildInput, readContinuationCursor, readWikgArchiveFormatVersion, readWikgObjectsFromJsonl, readWikiGraphArchiveSchemaVersion, readWikiGraphHomeSchemaVersion, readWikiGraphLibraryIndexState, readWikiGraphLibraryPage, rebindWikiGraphLibrary, rebuildArchiveSearchIndex, rebuildWikiGraphLibraryIndex, recordBuildJobInputRevision, removeChapter, removeWikiGraphLibrary, removeWikiGraphLibraryArchive, replaceWikiGraphLibraryMetadata, requireArchiveUri, requireLocatedObjectOrArchiveUri, requireLocatedObjectUri, resetChapter, resolveBuildJobId, resolveChapterPath, resolveChapterPathReadonly, resolveDataDirPath, resolveDefaultWikiGraphLibraryDirectoryPath, resolveEvidenceSelection, resolveEvidenceSelectionList, resolveExtractionPrompt, resolveKnowledgeGraphRecallPrompt, resolveWikiGraphCoreDatabasePath, resolveWikiGraphHomeDirectoryPath, resolveWikiGraphLibrary, resolveWikiGraphLibraryArchivePath, resolveWikiGraphLibraryById, resolveWikiGraphLibraryQueryTargetById, resolveWikiGraphLibraryStagingDirectoryPath, resolveWikiGraphStateRootPath, resumeBuildJob, scanWikiGraphLibrary, scoreEvidenceQuote, setChapterSource, setChapterSummary, setChapterTitle, setFtsIndexEmbedded, snapshotChapterKnowledgeGraphInput, snapshotChapterSummaryInput, testWikispineRuntime, updateBuildJobTarget, upgradeWikiGraphArchiveSchema, upgradeWikiGraphLibrarySchema, upgradeWikiGraphMaintenanceTarget, validatePolicyResponse, withLoggingContext, withWikiGraphRuntimeEnvironment, withWikiGraphRuntimeStateDirectoryPath, writeWikgArchive, writeWikgObjectsToJsonl };
|