wiki-graph-core 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/data/editor/clue_reviewer.jinja +410 -0
- package/data/editor/clue_reviewer_generator.jinja +428 -0
- package/data/editor/revision_feedback.jinja +5 -0
- package/data/editor/text_compressor.jinja +127 -0
- package/data/guaranteed/response_intent_classifier.jinja +8 -0
- package/data/help/commands/archive/next.jinja +29 -0
- package/data/help/commands/gc.jinja +38 -0
- package/data/help/commands/legacy/migrate.jinja +20 -0
- package/data/help/commands/legacy.jinja +19 -0
- package/data/help/commands/maintenance/chapter/add.jinja +41 -0
- package/data/help/commands/maintenance/chapter/list.jinja +33 -0
- package/data/help/commands/maintenance/chapter/move.jinja +36 -0
- package/data/help/commands/maintenance/chapter/remove.jinja +26 -0
- package/data/help/commands/maintenance/chapter/reset.jinja +29 -0
- package/data/help/commands/maintenance/chapter/set-source.jinja +34 -0
- package/data/help/commands/maintenance/chapter/set-summary.jinja +31 -0
- package/data/help/commands/maintenance/chapter/set-title.jinja +29 -0
- package/data/help/commands/maintenance/chapter/tree.jinja +58 -0
- package/data/help/commands/maintenance/chapter.jinja +59 -0
- package/data/help/commands/maintenance/cover.jinja +28 -0
- package/data/help/commands/maintenance/meta.jinja +55 -0
- package/data/help/commands/predicate.jinja +460 -0
- package/data/help/commands/root.jinja +83 -0
- package/data/help/commands/transform.jinja +34 -0
- package/data/help/commands/uri.jinja +274 -0
- package/data/help/topics/config.jinja +88 -0
- package/data/help/topics/format.jinja +72 -0
- package/data/help/topics/readiness.jinja +99 -0
- package/data/help/topics/recipe.jinja +151 -0
- package/data/help/topics/runtime.jinja +62 -0
- package/data/help/topics/uri.jinja +178 -0
- package/data/output/epub/cover.xhtml.jinja +13 -0
- package/data/output/epub/nav.xhtml.jinja +12 -0
- package/data/output/epub/package.opf.xml.jinja +39 -0
- package/data/output/epub/section.xhtml.jinja +12 -0
- package/data/topologization/book_coherence_extraction.jinja +223 -0
- package/data/topologization/chunk_extraction.jinja +233 -0
- package/data/topologization/evidence_choice.jinja +38 -0
- package/data/topologization/translate_chunks.jinja +138 -0
- package/data/topologization/user_focused_extraction.jinja +378 -0
- package/dist/archive/query/archive-view.d.ts +26 -0
- package/dist/archive/query/archive-view.js +4540 -0
- package/dist/archive/query/archive-view.js.map +1 -0
- package/dist/archive/query/continuation-cursor.d.ts +61 -0
- package/dist/archive/query/continuation-cursor.js +363 -0
- package/dist/archive/query/continuation-cursor.js.map +1 -0
- package/dist/archive/query/index.d.ts +29 -0
- package/dist/archive/query/index.js +63 -0
- package/dist/archive/query/index.js.map +1 -0
- package/dist/archive/query/lexical-search.d.ts +22 -0
- package/dist/archive/query/lexical-search.js +137 -0
- package/dist/archive/query/lexical-search.js.map +1 -0
- package/dist/archive/query/search-cache.d.ts +192 -0
- package/dist/archive/query/search-cache.js +1248 -0
- package/dist/archive/query/search-cache.js.map +1 -0
- package/dist/archive/search-index/index.d.ts +26 -0
- package/dist/archive/search-index/index.js +29 -0
- package/dist/archive/search-index/index.js.map +1 -0
- package/dist/archive/search-index/search-index.d.ts +26 -0
- package/dist/archive/search-index/search-index.js +555 -0
- package/dist/archive/search-index/search-index.js.map +1 -0
- package/dist/archive/search-index/search-tokenizer.d.ts +16 -0
- package/dist/archive/search-index/search-tokenizer.js +225 -0
- package/dist/archive/search-index/search-tokenizer.js.map +1 -0
- package/dist/common/cli-command.d.ts +4 -0
- package/dist/common/cli-command.js +7 -0
- package/dist/common/cli-command.js.map +1 -0
- package/dist/common/data-dir.d.ts +3 -0
- package/dist/common/data-dir.js +48 -0
- package/dist/common/data-dir.js.map +1 -0
- package/dist/common/language.d.ts +55 -0
- package/dist/common/language.js +208 -0
- package/dist/common/language.js.map +1 -0
- package/dist/common/llm-scope.d.ts +19 -0
- package/dist/common/llm-scope.js +31 -0
- package/dist/common/llm-scope.js.map +1 -0
- package/dist/common/logging.d.ts +22 -0
- package/dist/common/logging.js +141 -0
- package/dist/common/logging.js.map +1 -0
- package/dist/common/template.d.ts +8 -0
- package/dist/common/template.js +54 -0
- package/dist/common/template.js.map +1 -0
- package/dist/common/tinyld-language.d.ts +6 -0
- package/dist/common/tinyld-language.js +34 -0
- package/dist/common/tinyld-language.js.map +1 -0
- package/dist/common/wiki-graph-dir.d.ts +10 -0
- package/dist/common/wiki-graph-dir.js +41 -0
- package/dist/common/wiki-graph-dir.js.map +1 -0
- package/dist/common/wiki-graph-temp.d.ts +6 -0
- package/dist/common/wiki-graph-temp.js +21 -0
- package/dist/common/wiki-graph-temp.js.map +1 -0
- package/dist/common/wiki-graph-uri.d.ts +28 -0
- package/dist/common/wiki-graph-uri.js +171 -0
- package/dist/common/wiki-graph-uri.js.map +1 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.js +13 -0
- package/dist/context/index.js.map +1 -0
- package/dist/context/task-context.d.ts +41 -0
- package/dist/context/task-context.js +111 -0
- package/dist/context/task-context.js.map +1 -0
- package/dist/document/database.d.ts +30 -0
- package/dist/document/database.js +273 -0
- package/dist/document/database.js.map +1 -0
- package/dist/document/document.d.ts +153 -0
- package/dist/document/document.js +615 -0
- package/dist/document/document.js.map +1 -0
- package/dist/document/fragments.d.ts +63 -0
- package/dist/document/fragments.js +371 -0
- package/dist/document/fragments.js.map +1 -0
- package/dist/document/index.d.ts +13 -0
- package/dist/document/index.js +62 -0
- package/dist/document/index.js.map +1 -0
- package/dist/document/schema.d.ts +8 -0
- package/dist/document/schema.js +472 -0
- package/dist/document/schema.js.map +1 -0
- package/dist/document/shared-state-database.d.ts +9 -0
- package/dist/document/shared-state-database.js +193 -0
- package/dist/document/shared-state-database.js.map +1 -0
- package/dist/document/stores.d.ts +203 -0
- package/dist/document/stores.js +1678 -0
- package/dist/document/stores.js.map +1 -0
- package/dist/document/text-streams.d.ts +86 -0
- package/dist/document/text-streams.js +515 -0
- package/dist/document/text-streams.js.map +1 -0
- package/dist/document/types.d.ts +148 -0
- package/dist/document/types.js +69 -0
- package/dist/document/types.js.map +1 -0
- package/dist/editor/clue.d.ts +27 -0
- package/dist/editor/clue.js +158 -0
- package/dist/editor/clue.js.map +1 -0
- package/dist/editor/compressor.d.ts +18 -0
- package/dist/editor/compressor.js +68 -0
- package/dist/editor/compressor.js.map +1 -0
- package/dist/editor/editor.d.ts +39 -0
- package/dist/editor/editor.js +253 -0
- package/dist/editor/editor.js.map +1 -0
- package/dist/editor/feedback.d.ts +16 -0
- package/dist/editor/feedback.js +104 -0
- package/dist/editor/feedback.js.map +1 -0
- package/dist/editor/index.d.ts +17 -0
- package/dist/editor/index.js +5 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/editor/language-review.d.ts +14 -0
- package/dist/editor/language-review.js +35 -0
- package/dist/editor/language-review.js.map +1 -0
- package/dist/editor/log.d.ts +37 -0
- package/dist/editor/log.js +202 -0
- package/dist/editor/log.js.map +1 -0
- package/dist/editor/markup.d.ts +20 -0
- package/dist/editor/markup.js +294 -0
- package/dist/editor/markup.js.map +1 -0
- package/dist/editor/prompt-templates.d.ts +6 -0
- package/dist/editor/prompt-templates.js +11 -0
- package/dist/editor/prompt-templates.js.map +1 -0
- package/dist/editor/response.d.ts +5 -0
- package/dist/editor/response.js +31 -0
- package/dist/editor/response.js.map +1 -0
- package/dist/editor/review.d.ts +34 -0
- package/dist/editor/review.js +189 -0
- package/dist/editor/review.js.map +1 -0
- package/dist/editor/types.d.ts +31 -0
- package/dist/editor/types.js +21 -0
- package/dist/editor/types.js.map +1 -0
- package/dist/evidence-selection/anchor-resolver.d.ts +43 -0
- package/dist/evidence-selection/anchor-resolver.js +783 -0
- package/dist/evidence-selection/anchor-resolver.js.map +1 -0
- package/dist/evidence-selection/anchor-types.d.ts +27 -0
- package/dist/evidence-selection/anchor-types.js +1 -0
- package/dist/evidence-selection/anchor-types.js.map +1 -0
- package/dist/evidence-selection/index.d.ts +8 -0
- package/dist/evidence-selection/index.js +32 -0
- package/dist/evidence-selection/index.js.map +1 -0
- package/dist/evidence-selection/prompt.d.ts +18 -0
- package/dist/evidence-selection/prompt.js +54 -0
- package/dist/evidence-selection/prompt.js.map +1 -0
- package/dist/evidence-selection/quote-score.d.ts +29 -0
- package/dist/evidence-selection/quote-score.js +331 -0
- package/dist/evidence-selection/quote-score.js.map +1 -0
- package/dist/evidence-selection/selection-resolver.d.ts +19 -0
- package/dist/evidence-selection/selection-resolver.js +303 -0
- package/dist/evidence-selection/selection-resolver.js.map +1 -0
- package/dist/evidence-selection/text.d.ts +4 -0
- package/dist/evidence-selection/text.js +66 -0
- package/dist/evidence-selection/text.js.map +1 -0
- package/dist/evidence-selection/types.d.ts +36 -0
- package/dist/evidence-selection/types.js +1 -0
- package/dist/evidence-selection/types.js.map +1 -0
- package/dist/facade/app.d.ts +75 -0
- package/dist/facade/app.js +141 -0
- package/dist/facade/app.js.map +1 -0
- package/dist/facade/build-queue.d.ts +181 -0
- package/dist/facade/build-queue.js +1442 -0
- package/dist/facade/build-queue.js.map +1 -0
- package/dist/facade/chapter-build.d.ts +60 -0
- package/dist/facade/chapter-build.js +1020 -0
- package/dist/facade/chapter-build.js.map +1 -0
- package/dist/facade/chapter.d.ts +168 -0
- package/dist/facade/chapter.js +944 -0
- package/dist/facade/chapter.js.map +1 -0
- package/dist/facade/digest.d.ts +55 -0
- package/dist/facade/digest.js +168 -0
- package/dist/facade/digest.js.map +1 -0
- package/dist/facade/graph.d.ts +60 -0
- package/dist/facade/graph.js +203 -0
- package/dist/facade/graph.js.map +1 -0
- package/dist/facade/import.d.ts +49 -0
- package/dist/facade/import.js +262 -0
- package/dist/facade/import.js.map +1 -0
- package/dist/facade/index.d.ts +39 -0
- package/dist/facade/index.js +171 -0
- package/dist/facade/index.js.map +1 -0
- package/dist/facade/knowledge-graph-build.d.ts +75 -0
- package/dist/facade/knowledge-graph-build.js +897 -0
- package/dist/facade/knowledge-graph-build.js.map +1 -0
- package/dist/facade/llm-sampling.d.ts +11 -0
- package/dist/facade/llm-sampling.js +58 -0
- package/dist/facade/llm-sampling.js.map +1 -0
- package/dist/facade/types.d.ts +8 -0
- package/dist/facade/types.js +1 -0
- package/dist/facade/types.js.map +1 -0
- package/dist/facade/wiki-graph-archive.d.ts +41 -0
- package/dist/facade/wiki-graph-archive.js +130 -0
- package/dist/facade/wiki-graph-archive.js.map +1 -0
- package/dist/gc/files.d.ts +15 -0
- package/dist/gc/files.js +141 -0
- package/dist/gc/files.js.map +1 -0
- package/dist/gc/index.d.ts +2 -0
- package/dist/gc/index.js +5 -0
- package/dist/gc/index.js.map +1 -0
- package/dist/gc/lock.d.ts +3 -0
- package/dist/gc/lock.js +137 -0
- package/dist/gc/lock.js.map +1 -0
- package/dist/gc/runner.d.ts +9 -0
- package/dist/gc/runner.js +129 -0
- package/dist/gc/runner.js.map +1 -0
- package/dist/gc/tmp-gc.d.ts +5 -0
- package/dist/gc/tmp-gc.js +57 -0
- package/dist/gc/tmp-gc.js.map +1 -0
- package/dist/gc/types.d.ts +24 -0
- package/dist/gc/types.js +1 -0
- package/dist/gc/types.js.map +1 -0
- package/dist/gc.cjs +10041 -0
- package/dist/gc.cjs.map +1 -0
- package/dist/gc.d.cts +10 -0
- package/dist/gc.d.ts +2 -0
- package/dist/gc.js +5 -0
- package/dist/gc.js.map +1 -0
- package/dist/guaranteed/classifier.d.ts +10 -0
- package/dist/guaranteed/classifier.js +88 -0
- package/dist/guaranteed/classifier.js.map +1 -0
- package/dist/guaranteed/errors.d.ts +38 -0
- package/dist/guaranteed/errors.js +73 -0
- package/dist/guaranteed/errors.js.map +1 -0
- package/dist/guaranteed/index.d.ts +7 -0
- package/dist/guaranteed/index.js +21 -0
- package/dist/guaranteed/index.js.map +1 -0
- package/dist/guaranteed/request.d.ts +8 -0
- package/dist/guaranteed/request.js +206 -0
- package/dist/guaranteed/request.js.map +1 -0
- package/dist/guaranteed/response.d.ts +12 -0
- package/dist/guaranteed/response.js +98 -0
- package/dist/guaranteed/response.js.map +1 -0
- package/dist/guaranteed/types.d.ts +20 -0
- package/dist/guaranteed/types.js +1 -0
- package/dist/guaranteed/types.js.map +1 -0
- package/dist/index-B8NNnQ8P.d.ts +424 -0
- package/dist/index.cjs +34774 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2462 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.js +168 -0
- package/dist/index.js.map +1 -0
- package/dist/legacy-sdpub/upgrade.d.ts +7 -0
- package/dist/legacy-sdpub/upgrade.js +795 -0
- package/dist/legacy-sdpub/upgrade.js.map +1 -0
- package/dist/llm/cache.d.ts +13 -0
- package/dist/llm/cache.js +35 -0
- package/dist/llm/cache.js.map +1 -0
- package/dist/llm/client.d.ts +26 -0
- package/dist/llm/client.js +572 -0
- package/dist/llm/client.js.map +1 -0
- package/dist/llm/context.d.ts +22 -0
- package/dist/llm/context.js +78 -0
- package/dist/llm/context.js.map +1 -0
- package/dist/llm/errors.d.ts +7 -0
- package/dist/llm/errors.js +12 -0
- package/dist/llm/errors.js.map +1 -0
- package/dist/llm/index.d.ts +7 -0
- package/dist/llm/index.js +17 -0
- package/dist/llm/index.js.map +1 -0
- package/dist/llm/request-log.d.ts +9 -0
- package/dist/llm/request-log.js +35 -0
- package/dist/llm/request-log.js.map +1 -0
- package/dist/llm/sampling.d.ts +11 -0
- package/dist/llm/sampling.js +67 -0
- package/dist/llm/sampling.js.map +1 -0
- package/dist/llm/types.d.ts +50 -0
- package/dist/llm/types.js +1 -0
- package/dist/llm/types.js.map +1 -0
- package/dist/output/epub/archive.d.ts +9 -0
- package/dist/output/epub/archive.js +81 -0
- package/dist/output/epub/archive.js.map +1 -0
- package/dist/output/epub/book.d.ts +15 -0
- package/dist/output/epub/book.js +76 -0
- package/dist/output/epub/book.js.map +1 -0
- package/dist/output/epub/content.d.ts +9 -0
- package/dist/output/epub/content.js +35 -0
- package/dist/output/epub/content.js.map +1 -0
- package/dist/output/epub/index.d.ts +20 -0
- package/dist/output/epub/index.js +14 -0
- package/dist/output/epub/index.js.map +1 -0
- package/dist/output/epub/model.d.ts +24 -0
- package/dist/output/epub/model.js +1 -0
- package/dist/output/epub/model.js.map +1 -0
- package/dist/output/epub/navigation.d.ts +10 -0
- package/dist/output/epub/navigation.js +39 -0
- package/dist/output/epub/navigation.js.map +1 -0
- package/dist/output/epub/package.d.ts +17 -0
- package/dist/output/epub/package.js +29 -0
- package/dist/output/epub/package.js.map +1 -0
- package/dist/output/epub/shared.d.ts +4 -0
- package/dist/output/epub/shared.js +12 -0
- package/dist/output/epub/shared.js.map +1 -0
- package/dist/output/epub/templates.d.ts +35 -0
- package/dist/output/epub/templates.js +26 -0
- package/dist/output/epub/templates.js.map +1 -0
- package/dist/output/index.d.ts +14 -0
- package/dist/output/index.js +11 -0
- package/dist/output/index.js.map +1 -0
- package/dist/output/plain-text.d.ts +18 -0
- package/dist/output/plain-text.js +56 -0
- package/dist/output/plain-text.js.map +1 -0
- package/dist/progress/index.d.ts +3 -0
- package/dist/progress/index.js +14 -0
- package/dist/progress/index.js.map +1 -0
- package/dist/progress/reporter.d.ts +10 -0
- package/dist/progress/reporter.js +79 -0
- package/dist/progress/reporter.js.map +1 -0
- package/dist/progress/tracker.d.ts +37 -0
- package/dist/progress/tracker.js +119 -0
- package/dist/progress/tracker.js.map +1 -0
- package/dist/progress/types.d.ts +28 -0
- package/dist/progress/types.js +1 -0
- package/dist/progress/types.js.map +1 -0
- package/dist/reader/attention/attention.d.ts +39 -0
- package/dist/reader/attention/attention.js +123 -0
- package/dist/reader/attention/attention.js.map +1 -0
- package/dist/reader/attention/index.d.ts +9 -0
- package/dist/reader/attention/index.js +5 -0
- package/dist/reader/attention/index.js.map +1 -0
- package/dist/reader/attention/wave-reflection.d.ts +21 -0
- package/dist/reader/attention/wave-reflection.js +153 -0
- package/dist/reader/attention/wave-reflection.js.map +1 -0
- package/dist/reader/attention/working-memory.d.ts +28 -0
- package/dist/reader/attention/working-memory.js +62 -0
- package/dist/reader/attention/working-memory.js.map +1 -0
- package/dist/reader/chunk-batch/extract.d.ts +13 -0
- package/dist/reader/chunk-batch/extract.js +14 -0
- package/dist/reader/chunk-batch/extract.js.map +1 -0
- package/dist/reader/chunk-batch/extractor.d.ts +17 -0
- package/dist/reader/chunk-batch/extractor.js +337 -0
- package/dist/reader/chunk-batch/extractor.js.map +1 -0
- package/dist/reader/chunk-batch/fragment-projection.d.ts +34 -0
- package/dist/reader/chunk-batch/fragment-projection.js +94 -0
- package/dist/reader/chunk-batch/fragment-projection.js.map +1 -0
- package/dist/reader/chunk-batch/index.d.ts +12 -0
- package/dist/reader/chunk-batch/index.js +13 -0
- package/dist/reader/chunk-batch/index.js.map +1 -0
- package/dist/reader/chunk-batch/language.d.ts +9 -0
- package/dist/reader/chunk-batch/language.js +23 -0
- package/dist/reader/chunk-batch/language.js.map +1 -0
- package/dist/reader/chunk-batch/parser.d.ts +94 -0
- package/dist/reader/chunk-batch/parser.js +640 -0
- package/dist/reader/chunk-batch/parser.js.map +1 -0
- package/dist/reader/chunk-batch/prompt-templates.d.ts +6 -0
- package/dist/reader/chunk-batch/prompt-templates.js +11 -0
- package/dist/reader/chunk-batch/prompt-templates.js.map +1 -0
- package/dist/reader/chunk-batch/types.d.ts +85 -0
- package/dist/reader/chunk-batch/types.js +1 -0
- package/dist/reader/chunk-batch/types.js.map +1 -0
- package/dist/reader/index.d.ts +13 -0
- package/dist/reader/index.js +7 -0
- package/dist/reader/index.js.map +1 -0
- package/dist/reader/reader.d.ts +37 -0
- package/dist/reader/reader.js +82 -0
- package/dist/reader/reader.js.map +1 -0
- package/dist/reader/segment/index.d.ts +2 -0
- package/dist/reader/segment/index.js +5 -0
- package/dist/reader/segment/index.js.map +1 -0
- package/dist/reader/segment/intl-segmenter.d.ts +5 -0
- package/dist/reader/segment/intl-segmenter.js +102 -0
- package/dist/reader/segment/intl-segmenter.js.map +1 -0
- package/dist/reader/segment/segment.d.ts +5 -0
- package/dist/reader/segment/segment.js +9 -0
- package/dist/reader/segment/segment.js.map +1 -0
- package/dist/reader/segment/types.d.ts +14 -0
- package/dist/reader/segment/types.js +1 -0
- package/dist/reader/segment/types.js.map +1 -0
- package/dist/reader/types.d.ts +29 -0
- package/dist/reader/types.js +1 -0
- package/dist/reader/types.js.map +1 -0
- package/dist/serial.d.ts +89 -0
- package/dist/serial.js +476 -0
- package/dist/serial.js.map +1 -0
- package/dist/source/adapter.d.ts +15 -0
- package/dist/source/adapter.js +1 -0
- package/dist/source/adapter.js.map +1 -0
- package/dist/source/epub/archive.d.ts +27 -0
- package/dist/source/epub/archive.js +189 -0
- package/dist/source/epub/archive.js.map +1 -0
- package/dist/source/epub/content.d.ts +22 -0
- package/dist/source/epub/content.js +183 -0
- package/dist/source/epub/content.js.map +1 -0
- package/dist/source/epub/document.d.ts +55 -0
- package/dist/source/epub/document.js +179 -0
- package/dist/source/epub/document.js.map +1 -0
- package/dist/source/epub/index.d.ts +10 -0
- package/dist/source/epub/index.js +6 -0
- package/dist/source/epub/index.js.map +1 -0
- package/dist/source/epub/navigation.d.ts +16 -0
- package/dist/source/epub/navigation.js +215 -0
- package/dist/source/epub/navigation.js.map +1 -0
- package/dist/source/epub/package.d.ts +33 -0
- package/dist/source/epub/package.js +237 -0
- package/dist/source/epub/package.js.map +1 -0
- package/dist/source/epub/xml.d.ts +16 -0
- package/dist/source/epub/xml.js +111 -0
- package/dist/source/epub/xml.js.map +1 -0
- package/dist/source/index.d.ts +12 -0
- package/dist/source/index.js +32 -0
- package/dist/source/index.js.map +1 -0
- package/dist/source/meta.d.ts +30 -0
- package/dist/source/meta.js +22 -0
- package/dist/source/meta.js.map +1 -0
- package/dist/source/plain-text.d.ts +16 -0
- package/dist/source/plain-text.js +86 -0
- package/dist/source/plain-text.js.map +1 -0
- package/dist/source/toc.d.ts +16 -0
- package/dist/source/toc.js +17 -0
- package/dist/source/toc.js.map +1 -0
- package/dist/source/types.d.ts +16 -0
- package/dist/source/types.js +1 -0
- package/dist/source/types.js.map +1 -0
- package/dist/topology/grouping.d.ts +15 -0
- package/dist/topology/grouping.js +18 -0
- package/dist/topology/grouping.js.map +1 -0
- package/dist/topology/index.d.ts +21 -0
- package/dist/topology/index.js +5 -0
- package/dist/topology/index.js.map +1 -0
- package/dist/topology/resource-segmentation.d.ts +13 -0
- package/dist/topology/resource-segmentation.js +111 -0
- package/dist/topology/resource-segmentation.js.map +1 -0
- package/dist/topology/segment-incision.d.ts +18 -0
- package/dist/topology/segment-incision.js +197 -0
- package/dist/topology/segment-incision.js.map +1 -0
- package/dist/topology/snake-detector.d.ts +13 -0
- package/dist/topology/snake-detector.js +520 -0
- package/dist/topology/snake-detector.js.map +1 -0
- package/dist/topology/snake-graph-builder.d.ts +14 -0
- package/dist/topology/snake-graph-builder.js +76 -0
- package/dist/topology/snake-graph-builder.js.map +1 -0
- package/dist/topology/topology.d.ts +29 -0
- package/dist/topology/topology.js +348 -0
- package/dist/topology/topology.js.map +1 -0
- package/dist/topology/weights.d.ts +10 -0
- package/dist/topology/weights.js +84 -0
- package/dist/topology/weights.js.map +1 -0
- package/dist/types-FVIqiLC9.d.cts +24 -0
- package/dist/utils/async-semaphore.d.ts +7 -0
- package/dist/utils/async-semaphore.js +40 -0
- package/dist/utils/async-semaphore.js.map +1 -0
- package/dist/utils/enum.d.ts +5 -0
- package/dist/utils/enum.js +18 -0
- package/dist/utils/enum.js.map +1 -0
- package/dist/utils/hash.d.ts +3 -0
- package/dist/utils/hash.js +132 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/node-error.d.ts +4 -0
- package/dist/utils/node-error.js +59 -0
- package/dist/utils/node-error.js.map +1 -0
- package/dist/wikg/archive-uri.d.ts +1 -0
- package/dist/wikg/archive-uri.js +37 -0
- package/dist/wikg/archive-uri.js.map +1 -0
- package/dist/wikg/archive.d.ts +28 -0
- package/dist/wikg/archive.js +496 -0
- package/dist/wikg/archive.js.map +1 -0
- package/dist/wikg/index.d.ts +31 -0
- package/dist/wikg/index.js +60 -0
- package/dist/wikg/index.js.map +1 -0
- package/dist/wikg/wikg-coordinator.d.ts +45 -0
- package/dist/wikg/wikg-coordinator.js +1687 -0
- package/dist/wikg/wikg-coordinator.js.map +1 -0
- package/dist/wikg/wiki-graph-archive-file.d.ts +42 -0
- package/dist/wikg/wiki-graph-archive-file.js +78 -0
- package/dist/wikg/wiki-graph-archive-file.js.map +1 -0
- package/dist/wikilink/index.d.ts +10 -0
- package/dist/wikilink/index.js +7 -0
- package/dist/wikilink/index.js.map +1 -0
- package/dist/wikilink/relation-discovery.d.ts +31 -0
- package/dist/wikilink/relation-discovery.js +477 -0
- package/dist/wikilink/relation-discovery.js.map +1 -0
- package/dist/wikilink/types.d.ts +23 -0
- package/dist/wikilink/types.js +1 -0
- package/dist/wikilink/types.js.map +1 -0
- package/dist/wikilink/window.d.ts +7 -0
- package/dist/wikilink/window.js +53 -0
- package/dist/wikilink/window.js.map +1 -0
- package/dist/wikimatch/enrichment.d.ts +10 -0
- package/dist/wikimatch/enrichment.js +55 -0
- package/dist/wikimatch/enrichment.js.map +1 -0
- package/dist/wikimatch/index.d.ts +16 -0
- package/dist/wikimatch/index.js +66 -0
- package/dist/wikimatch/index.js.map +1 -0
- package/dist/wikimatch/option-narrowing.d.ts +17 -0
- package/dist/wikimatch/option-narrowing.js +208 -0
- package/dist/wikimatch/option-narrowing.js.map +1 -0
- package/dist/wikimatch/options.d.ts +14 -0
- package/dist/wikimatch/options.js +155 -0
- package/dist/wikimatch/options.js.map +1 -0
- package/dist/wikimatch/policy-judge.d.ts +17 -0
- package/dist/wikimatch/policy-judge.js +430 -0
- package/dist/wikimatch/policy-judge.js.map +1 -0
- package/dist/wikimatch/range-suppression.d.ts +9 -0
- package/dist/wikimatch/range-suppression.js +27 -0
- package/dist/wikimatch/range-suppression.js.map +1 -0
- package/dist/wikimatch/surface-screening.d.ts +16 -0
- package/dist/wikimatch/surface-screening.js +168 -0
- package/dist/wikimatch/surface-screening.js.map +1 -0
- package/dist/wikimatch/surface-window.d.ts +6 -0
- package/dist/wikimatch/surface-window.js +44 -0
- package/dist/wikimatch/surface-window.js.map +1 -0
- package/dist/wikimatch/types.d.ts +151 -0
- package/dist/wikimatch/types.js +1 -0
- package/dist/wikimatch/types.js.map +1 -0
- package/dist/wikimatch/wikispine.d.ts +43 -0
- package/dist/wikimatch/wikispine.js +399 -0
- package/dist/wikimatch/wikispine.js.map +1 -0
- package/dist/wikimatch/window.d.ts +6 -0
- package/dist/wikimatch/window.js +83 -0
- package/dist/wikimatch/window.js.map +1 -0
- package/dist/wikimatch/words.d.ts +16 -0
- package/dist/wikimatch/words.js +66 -0
- package/dist/wikimatch/words.js.map +1 -0
- package/dist/wikipage/cache.d.ts +18 -0
- package/dist/wikipage/cache.js +404 -0
- package/dist/wikipage/cache.js.map +1 -0
- package/dist/wikipage/fetch-log.d.ts +17 -0
- package/dist/wikipage/fetch-log.js +143 -0
- package/dist/wikipage/fetch-log.js.map +1 -0
- package/dist/wikipage/index.d.ts +14 -0
- package/dist/wikipage/index.js +17 -0
- package/dist/wikipage/index.js.map +1 -0
- package/dist/wikipage/normalizer.d.ts +14 -0
- package/dist/wikipage/normalizer.js +147 -0
- package/dist/wikipage/normalizer.js.map +1 -0
- package/dist/wikipage/rate-limiter.d.ts +13 -0
- package/dist/wikipage/rate-limiter.js +84 -0
- package/dist/wikipage/rate-limiter.js.map +1 -0
- package/dist/wikipage/resolver.d.ts +26 -0
- package/dist/wikipage/resolver.js +325 -0
- package/dist/wikipage/resolver.js.map +1 -0
- package/dist/wikipage/types.d.ts +96 -0
- package/dist/wikipage/types.js +1 -0
- package/dist/wikipage/types.js.map +1 -0
- package/dist/wikipage/wikimedia-client.d.ts +48 -0
- package/dist/wikipage/wikimedia-client.js +397 -0
- package/dist/wikipage/wikimedia-client.js.map +1 -0
- package/dist/worker-BgQ0Xl8T.d.cts +181 -0
- package/dist/worker.cjs +5259 -0
- package/dist/worker.cjs.map +1 -0
- package/dist/worker.d.cts +2 -0
- package/dist/worker.d.ts +2 -0
- package/dist/worker.js +5 -0
- package/dist/worker.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
You are reading a long text and need to extract key information based on the user's reading intention.
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
{% if user_language %}
|
|
6
|
+
**Language Configuration:**
|
|
7
|
+
|
|
8
|
+
**User interface language:** {{ user_language }}
|
|
9
|
+
|
|
10
|
+
**Output Requirements:**
|
|
11
|
+
- **label** and **content** fields: Must be in **{{ user_language }}** (translate from source text if needed)
|
|
12
|
+
- **fragment_summary**: Keep in the **SAME LANGUAGE(S) as the source text** you're reading (do NOT translate)
|
|
13
|
+
- **evidence**: Use the evidence selection protocol below in the **original language(s)** (NEVER translate)
|
|
14
|
+
- Use **evidence** to identify the supporting source sentence.
|
|
15
|
+
|
|
16
|
+
**Important Notes:**
|
|
17
|
+
- The source text may be in any language or mix of languages (e.g., an English book with French quotes, or a Chinese-English bilingual textbook)
|
|
18
|
+
- Your job is to:
|
|
19
|
+
1. Understand the text in whatever language(s) it uses
|
|
20
|
+
2. Translate only **label** and **content** to {{ user_language }} for user understanding
|
|
21
|
+
3. Preserve **fragment_summary** in its original language(s) - this is internal narrative continuation
|
|
22
|
+
4. Keep **evidence** quotes in exact original language(s) - never translate them
|
|
23
|
+
- The extraction rules below may also be in a different language. Use your multilingual understanding to apply the semantic patterns correctly.
|
|
24
|
+
|
|
25
|
+
Example output structure:
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"fragment_summary": "Original text language(s)...",
|
|
29
|
+
"chunks": [
|
|
30
|
+
{
|
|
31
|
+
"label": "{{ user_language }} translated label",
|
|
32
|
+
"content": "{{ user_language }} translated description",
|
|
33
|
+
"evidence": [
|
|
34
|
+
{
|
|
35
|
+
"sentence_id": "S1",
|
|
36
|
+
"quote": "Exact short original-language quote"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"retention": "focused"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
{% else %}
|
|
46
|
+
**Language Note:** No user language specified. Keep all output fields in the **SAME LANGUAGE(S) as the source text**. Do not translate anything.
|
|
47
|
+
|
|
48
|
+
**Output Requirements:**
|
|
49
|
+
- **label**, **content**, **fragment_summary**, and **evidence**: All in the source text's original language(s)
|
|
50
|
+
- Use **evidence** to identify the supporting source sentence.
|
|
51
|
+
- If the source text contains multiple languages, preserve them as they appear
|
|
52
|
+
{% endif %}
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## RETENTION STRATEGY
|
|
57
|
+
|
|
58
|
+
{{ extraction_guidance }}
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## TASK
|
|
63
|
+
|
|
64
|
+
Extract user-focused cognitive chunks from the new text segment by **matching against the extraction rules above**.
|
|
65
|
+
|
|
66
|
+
**Extraction Process (CRITICAL - Follow step by step, DO NOT skip):**
|
|
67
|
+
|
|
68
|
+
**STEP 1: For each piece of information, test exclusion conditions FIRST**
|
|
69
|
+
|
|
70
|
+
Check if content should be excluded based on the "Do NOT extract if" conditions in each rule. Common exclusion patterns include:
|
|
71
|
+
|
|
72
|
+
**Generic exclusion patterns (adapt based on text genre):**
|
|
73
|
+
|
|
74
|
+
**For narrative texts:**
|
|
75
|
+
- **Internal decision/planning**: Content describes internal choices or plans not yet expressed through observable actions
|
|
76
|
+
- **Internal psychological state**: Content describes thoughts, feelings, or mental states not observable to others
|
|
77
|
+
- **Internal transformation**: Content describes character development or psychological growth over time (not specific moments)
|
|
78
|
+
- **Author's meta-commentary**: Content is the author's commentary stepping outside the narrative (e.g., "This reflects the era's social structure")
|
|
79
|
+
- **Generic groups**: Content describes actions toward unnamed groups without specifically targeting the subject of user's interest
|
|
80
|
+
|
|
81
|
+
**For academic texts:**
|
|
82
|
+
- **Background review**: Content summarizes prior work without presenting the author's own contribution
|
|
83
|
+
- **General motivation**: Content provides context or justification without specific technical content
|
|
84
|
+
- **Tangential examples**: Content provides examples not directly supporting the core argument
|
|
85
|
+
|
|
86
|
+
**For all texts:**
|
|
87
|
+
- Content that is explicitly marked for exclusion in the extraction rules (check "Do NOT extract if" sections)
|
|
88
|
+
- Content that doesn't relate to the user's stated focus areas
|
|
89
|
+
|
|
90
|
+
**EXCLUSION check procedure:**
|
|
91
|
+
1. Read content carefully and understand its semantic meaning
|
|
92
|
+
2. Check if it matches ANY exclusion pattern from the extraction rules
|
|
93
|
+
3. If YES → REJECT immediately, do NOT extract, move to next piece of information
|
|
94
|
+
4. If NO → Proceed to STEP 2
|
|
95
|
+
|
|
96
|
+
**STEP 2: Match content against extraction rules**
|
|
97
|
+
|
|
98
|
+
For each extraction rule in order (Rule 1, 2, 3...):
|
|
99
|
+
|
|
100
|
+
1. **Information type** - Does the content match the type of information the user wants?
|
|
101
|
+
- Check if content semantically matches the "Information type" description
|
|
102
|
+
- Focus on WHAT the information is about, not WHERE it appears in the text
|
|
103
|
+
|
|
104
|
+
2. **Recognition criteria** - Can you identify this information using the rule's criteria?
|
|
105
|
+
- Check if content has the semantic features described in "Recognition criteria"
|
|
106
|
+
- Look for the patterns and characteristics specified, not structural positions
|
|
107
|
+
|
|
108
|
+
3. **Specificity** - Does the content meet any special constraints?
|
|
109
|
+
- Check "Specificity" conditions if present (e.g., "first occurrence", "includes specific data", "directed at subject X")
|
|
110
|
+
- If no specificity constraints, this step passes automatically
|
|
111
|
+
|
|
112
|
+
If ALL conditions satisfied → Extract with specified retention level
|
|
113
|
+
If ANY condition fails → Check next rule
|
|
114
|
+
|
|
115
|
+
**Example matching process:**
|
|
116
|
+
|
|
117
|
+
Rule says:
|
|
118
|
+
```
|
|
119
|
+
**Semantic pattern:**
|
|
120
|
+
- Information type: 他人对朱元璋的评价、态度或反应
|
|
121
|
+
- Recognition criteria: 描述具体人物针对朱元璋的言语、表情、动作或判断(而非概括性的历史评论)
|
|
122
|
+
- Specificity: 文本明确标识为"第一次见面"、"初次相识"、"初见"或类似表述的场合
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Content: "郭子兴看着朱重八的眼睛,希望能看到慌乱,这是他平时的乐趣之一。但在这个人眼睛里,他看到的只有镇定。"
|
|
126
|
+
|
|
127
|
+
Checking:
|
|
128
|
+
1. Information type: ✅ This describes 郭子兴 evaluating/judging 朱元璋
|
|
129
|
+
2. Recognition criteria: ✅ Describes specific person (郭子兴) performing observable action (looking, judging) toward 朱元璋
|
|
130
|
+
3. Specificity: ❌ Text doesn't say "first meeting" → Try next rule
|
|
131
|
+
|
|
132
|
+
**STEP 3: Verify extracted chunk against exclusion conditions again**
|
|
133
|
+
|
|
134
|
+
After extracting, double-check:
|
|
135
|
+
- Does the chunk match any exclusion patterns from the rules?
|
|
136
|
+
- Is it generic commentary rather than specific information the user wants?
|
|
137
|
+
- Is it about the wrong subject or topic?
|
|
138
|
+
|
|
139
|
+
If YES to any → DELETE the chunk
|
|
140
|
+
|
|
141
|
+
**STEP 4 (RELEVANT FALLBACK): Consider loosely-related content**
|
|
142
|
+
|
|
143
|
+
After completing STEP 1-3 for verbatim/detailed/focused extractions, **you MAY extract additional "relevant" level chunks** with looser criteria:
|
|
144
|
+
|
|
145
|
+
**When to use relevant fallback:**
|
|
146
|
+
- Content is RELATED to user's intent but doesn't strictly match extraction rules
|
|
147
|
+
- Content provides useful context for understanding extracted chunks
|
|
148
|
+
- Content shows patterns, background, or atmosphere relevant to the user's focus
|
|
149
|
+
- Content is marginally related to user's interest but not core focus
|
|
150
|
+
|
|
151
|
+
**Looser exclusion criteria for relevant:**
|
|
152
|
+
- Apply exclusion rules more leniently
|
|
153
|
+
- Can include contextual information that frames the core extractions
|
|
154
|
+
- Can include background that helps understand why extracted information matters
|
|
155
|
+
|
|
156
|
+
**Examples of valid relevant-level extractions:**
|
|
157
|
+
- **For narratives**: General conditions that frame specific interactions, environmental descriptions
|
|
158
|
+
- **For academic texts**: Brief background that contextualizes core arguments
|
|
159
|
+
- **For reports**: Market context that frames specific data points
|
|
160
|
+
|
|
161
|
+
**Quality bar for relevant:**
|
|
162
|
+
- Does it help readers understand the core extracted information?
|
|
163
|
+
- Would removing it make the content harder to follow?
|
|
164
|
+
- Is it connected to already-extracted chunks?
|
|
165
|
+
|
|
166
|
+
**Quantity guideline:** Aim for 1-3 relevant chunks per fragment if applicable content exists
|
|
167
|
+
|
|
168
|
+
**Common mistake patterns:**
|
|
169
|
+
|
|
170
|
+
❌ **Mistake type 1**: Extracting content that clearly matches exclusion rules
|
|
171
|
+
- Problem: Ignoring "Do NOT extract if" conditions
|
|
172
|
+
- Correct approach: Always check exclusion conditions FIRST before extracting
|
|
173
|
+
|
|
174
|
+
❌ **Mistake type 2**: Extracting based on structural position rather than semantic content
|
|
175
|
+
- Example: "This appears in Chapter 3" rather than "This describes model architecture"
|
|
176
|
+
- Correct approach: Focus on WHAT the information is, not WHERE it is
|
|
177
|
+
|
|
178
|
+
❌ **Mistake type 3**: Extracting generic statements when user wants specific instances
|
|
179
|
+
- Example: User wants "specific person's actions toward protagonist" but you extract "people generally treated him well"
|
|
180
|
+
- Correct approach: Match the specificity level in the recognition criteria
|
|
181
|
+
|
|
182
|
+
❌ **Mistake type 4**: Over-extracting when content doesn't match any rule
|
|
183
|
+
- Problem: Extracting interesting content that user didn't ask for
|
|
184
|
+
- Correct approach: If no rule matches, don't extract (unless it's contextual "relevant" content in STEP 4)
|
|
185
|
+
|
|
186
|
+
✅ **Correct extraction pattern**:
|
|
187
|
+
1. Check exclusion conditions → Content doesn't match exclusion patterns ✅
|
|
188
|
+
2. Check Information type → Content is about the right topic ✅
|
|
189
|
+
3. Check Recognition criteria → Content has the right semantic features ✅
|
|
190
|
+
4. Check Specificity → Content meets special constraints if any ✅
|
|
191
|
+
5. → Extract with retention level from matched rule
|
|
192
|
+
|
|
193
|
+
**Aim for 3-6 high-quality chunks (verbatim/detailed/focused), but ONLY if rules match. Quality over quantity.**
|
|
194
|
+
|
|
195
|
+
**Additionally, you MAY extract 1-3 relevant-level chunks using the looser STEP 4 criteria.**
|
|
196
|
+
|
|
197
|
+
**CRITICAL**: If the text segment does NOT contain information matching ANY extraction rule, that is still a VALID successful result.
|
|
198
|
+
- You MUST still output the full JSON object
|
|
199
|
+
- Set `"chunks": []`
|
|
200
|
+
- Set `"links": []`
|
|
201
|
+
- Still write `"fragment_summary"` normally
|
|
202
|
+
- Do NOT apologize
|
|
203
|
+
- Do NOT say you cannot answer
|
|
204
|
+
- Do NOT say no result was found
|
|
205
|
+
- Do NOT output any explanatory text outside the JSON
|
|
206
|
+
- Do NOT force extraction just because working memory exists
|
|
207
|
+
|
|
208
|
+
**Requirements:**
|
|
209
|
+
1. Each chunk should be:
|
|
210
|
+
- For verbatim/detailed/focused: **matches at least one extraction rule** (STEP 2)
|
|
211
|
+
- For relevant: **passes STEP 4 looser criteria**
|
|
212
|
+
- Have a concise label (5-15 characters) summarizing the topic
|
|
213
|
+
- Have full content description (one sentence)
|
|
214
|
+
- Have the retention level specified by the matched rule OR "relevant" for STEP 4 extractions
|
|
215
|
+
- Can be connected to existing working memory AND/OR other chunks from the same segment
|
|
216
|
+
|
|
217
|
+
2. Do NOT repeat information already in working memory
|
|
218
|
+
|
|
219
|
+
3. **For verbatim/detailed/focused extractions:**
|
|
220
|
+
- Do NOT extract information that does NOT match any extraction rule, even if:
|
|
221
|
+
- It connects to working memory
|
|
222
|
+
- It seems important for the book's plot
|
|
223
|
+
- It provides background context
|
|
224
|
+
- Such information belongs to book-coherence extraction OR relevant-level extraction (STEP 4)
|
|
225
|
+
|
|
226
|
+
4. **For relevant extractions (STEP 4):**
|
|
227
|
+
- Use creative judgment - over-extraction is acceptable
|
|
228
|
+
- Focus on contextual information that helps understand user's focus areas
|
|
229
|
+
- Can include descriptive passages and background information if they frame the core extractions
|
|
230
|
+
|
|
231
|
+
**Current Working Memory:**
|
|
232
|
+
{{ working_memory }}
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## RETENTION LEVEL GUIDELINES
|
|
237
|
+
|
|
238
|
+
Assign each chunk a retention level based on the strategy above. The retention level indicates HOW the user wants this information preserved during compression.
|
|
239
|
+
|
|
240
|
+
**IMPORTANT**: Retention levels are combined with importance levels (for book-coherence chunks) into a unified three-tier verification system:
|
|
241
|
+
- **High priority** (verbatim / detailed / critical) → CRITICAL if completely missing, MAJOR if incomplete
|
|
242
|
+
- **Medium priority** (focused / important) → MAJOR if completely missing, MINOR if incomplete
|
|
243
|
+
- **Low priority** (relevant / helpful) → MINOR if completely missing, MINOR if incomplete
|
|
244
|
+
|
|
245
|
+
When a chunk has both retention and importance attributes, the higher priority level is used for verification.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
- **verbatim**: ENTIRE passages/sentences must be preserved word-for-word
|
|
250
|
+
- ONLY use if extraction rules specify this level (usually triggered by user saying "一字不漏", "原文照抄", "word-for-word")
|
|
251
|
+
- Applies to FULL text passages, NOT individual words or terms
|
|
252
|
+
- Example: Direct quotes, critical descriptions that user explicitly requested preserved intact
|
|
253
|
+
- **Verification priority**: High (same as detailed/critical)
|
|
254
|
+
- **Verification**: Word-for-word matching (handled by code post-processing)
|
|
255
|
+
|
|
256
|
+
- **detailed**: Information must be captured COMPLETELY without loss
|
|
257
|
+
- Content must be complete and accurate, but wording can be adjusted
|
|
258
|
+
- Includes preserving specific terminology and precise facts
|
|
259
|
+
- Use sparingly - only for content that MUST be captured in full
|
|
260
|
+
- Example: Core arguments, essential steps, main mechanisms that user prioritizes
|
|
261
|
+
- **Verification priority**: High (same as verbatim/critical)
|
|
262
|
+
- **Verification**: All core facts + at least one supporting detail must be present
|
|
263
|
+
|
|
264
|
+
- **focused**: User's PRIMARY interest that can be moderately summarized
|
|
265
|
+
- This should be the MAJORITY of extractions
|
|
266
|
+
- Content can be compressed while preserving meaning
|
|
267
|
+
- Example: Main themes, patterns, relationships the user cares about
|
|
268
|
+
- **Verification priority**: Medium (same as important)
|
|
269
|
+
- **Verification**: At least one key point from the chunk must be mentioned
|
|
270
|
+
|
|
271
|
+
- **relevant**: Useful but NOT essential context (can be dropped if needed for space)
|
|
272
|
+
- **SPECIAL**: Has a separate, looser extraction path (see STEP 4)
|
|
273
|
+
- Use generously for secondary context and supporting details
|
|
274
|
+
- Helpful for understanding but not the user's main focus
|
|
275
|
+
- Can include descriptive passages and background information if they contextualize core extractions
|
|
276
|
+
- Example: Background information, supplementary examples, contextual atmosphere
|
|
277
|
+
- **Creative buffer**: Intentionally permissive - over-extraction is acceptable
|
|
278
|
+
- **Verification priority**: Low (same as helpful)
|
|
279
|
+
- **Verification**: Any form of mention counts as satisfying the requirement
|
|
280
|
+
|
|
281
|
+
**Distribution guideline**: Most chunks should be "focused", fewer "detailed", and "relevant" used liberally for nice-to-have context. It's OK to have many relevant chunks since they can be dropped during compression.
|
|
282
|
+
|
|
283
|
+
**What NOT to extract:**
|
|
284
|
+
- Do NOT extract chunks matching exclusion conditions in the extraction rules
|
|
285
|
+
- Excluded content should not appear as user-focused chunks (though book-coherence extraction may still include them for narrative flow)
|
|
286
|
+
|
|
287
|
+
---
|
|
288
|
+
|
|
289
|
+
## LINK STRENGTH GUIDELINES
|
|
290
|
+
|
|
291
|
+
Rate each link's dependency strength:
|
|
292
|
+
|
|
293
|
+
- **critical**: Must understand FROM to understand TO (cannot skip FROM)
|
|
294
|
+
- **important**: FROM provides essential context for TO (should not skip FROM)
|
|
295
|
+
- **helpful**: FROM and TO are related but both can stand alone (optional connection)
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
**Output Format (JSON only, no other text):**
|
|
300
|
+
|
|
301
|
+
The user will provide the new text segment in their message. Extract chunks from that text.
|
|
302
|
+
|
|
303
|
+
CRITICAL: You MUST output in this EXACT structure with "fragment_summary" FIRST, then "chunks" SECOND, then "links" THIRD:
|
|
304
|
+
|
|
305
|
+
{
|
|
306
|
+
"fragment_summary": "Concise 1-2 sentence narrative capturing key events/developments in this segment. Write as if continuing the text naturally - avoid meta-narrative phrases like '本章讲述了', '随后描述了', 'this chapter describes'. This will be inserted as a transition when this fragment is skipped.",
|
|
307
|
+
"chunks": [
|
|
308
|
+
{
|
|
309
|
+
"temp_id": "A",
|
|
310
|
+
"label": "brief topic label (5-15 chars)",
|
|
311
|
+
"content": "full description of the key information",
|
|
312
|
+
"evidence": [
|
|
313
|
+
{
|
|
314
|
+
"sentence_id": "S1",
|
|
315
|
+
"quote": "原文短引文"
|
|
316
|
+
}
|
|
317
|
+
],
|
|
318
|
+
"retention": "focused"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"temp_id": "B",
|
|
322
|
+
"label": "another topic label",
|
|
323
|
+
"content": "another description",
|
|
324
|
+
"evidence": [
|
|
325
|
+
{
|
|
326
|
+
"sentence_id": "S2",
|
|
327
|
+
"quote": "另一段原文短引文"
|
|
328
|
+
}
|
|
329
|
+
],
|
|
330
|
+
"retention": "detailed"
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
"links": [
|
|
334
|
+
{"from": 1, "to": "A", "strength": "important"},
|
|
335
|
+
{"from": "A", "to": "B", "strength": "critical"},
|
|
336
|
+
{"from": 3, "to": "B", "strength": "helpful"}
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
**Field Explanations:**
|
|
341
|
+
- "fragment_summary": Concise narrative of key events/developments in this segment (1-2 sentences)
|
|
342
|
+
- Write as NARRATIVE, not meta-commentary (e.g., "朱元璋加入义军" NOT "本章讲述朱元璋加入义军的过程")
|
|
343
|
+
- Capture what happens in the text's natural progression (not user's focus areas)
|
|
344
|
+
- Should read like a compressed continuation of the text itself
|
|
345
|
+
- Avoid meta-phrases: "本章描述了", "随后讲述了", "接着介绍了", "this chapter describes", "then it explains"
|
|
346
|
+
- Write in the same language and narrative tone as the original text
|
|
347
|
+
|
|
348
|
+
**Style examples for fragment_summary:**
|
|
349
|
+
✅ GOOD: "主角进入新城市,开始寻找工作" (direct narrative)
|
|
350
|
+
✅ GOOD: "战争爆发,小镇陷入混乱" (direct narrative)
|
|
351
|
+
✅ GOOD: "研究团队提出了新的注意力机制" (for academic text)
|
|
352
|
+
✅ GOOD: "市场规模在2025年达到新高" (for reports)
|
|
353
|
+
❌ BAD: "本章讲述了主角进入新城市的过程" (meta-commentary)
|
|
354
|
+
❌ BAD: "随后描述了战争爆发导致的混乱" (meta-commentary)
|
|
355
|
+
|
|
356
|
+
- "chunks": Array of new information extracted from the text
|
|
357
|
+
- "temp_id": Use letters like "A", "B", "C" for chunks in this extraction
|
|
358
|
+
- "label": 5-15 character summary
|
|
359
|
+
- "content": Full one-sentence description
|
|
360
|
+
- "evidence": Evidence selection for this chunk
|
|
361
|
+
{{ evidence_selection_prompt | safe }}
|
|
362
|
+
- Keep quote in the original source language(s)
|
|
363
|
+
- Do NOT translate quote
|
|
364
|
+
- "retention": One of "verbatim", "detailed", "focused", or "relevant"
|
|
365
|
+
|
|
366
|
+
- "links": Array of relationships between chunks
|
|
367
|
+
- "from" can be: working memory ID (number) OR temp_id (string from chunks above)
|
|
368
|
+
- "to" can be: working memory ID (number) OR temp_id (string from chunks above)
|
|
369
|
+
- "strength": One of "critical", "important", or "helpful"
|
|
370
|
+
- Use empty array [] if no relationships exist
|
|
371
|
+
|
|
372
|
+
**IMPORTANT:**
|
|
373
|
+
1. The order matters! Output "fragment_summary" FIRST, then "chunks" SECOND, then "links" THIRD.
|
|
374
|
+
2. Every chunk MUST have a "retention" field with one of the four valid values.
|
|
375
|
+
3. Every link MUST have a "strength" field with one of the three valid values.
|
|
376
|
+
4. The "fragment_summary" field is REQUIRED - it must always be present even if there are no chunks.
|
|
377
|
+
5. If no extraction rules match, the correct output is still valid JSON with `"chunks": []` and `"links": []`.
|
|
378
|
+
6. A "no matching chunks" case is NOT a failure. Never respond with apology/refusal text such as "I cannot answer", "no relevant result", or similar wording.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import '../../document/types.js';
|
|
2
|
+
import '../../document/document.js';
|
|
3
|
+
import '../../source/meta.js';
|
|
4
|
+
import '../../wikipage/types.js';
|
|
5
|
+
import '../../facade/graph.js';
|
|
6
|
+
import '../../facade/chapter.js';
|
|
7
|
+
export { A as ArchiveBacklinkBucket, a as ArchiveBacklinks, b as ArchiveCollectionOptions, c as ArchiveCollectionResult, d as ArchiveCollectionType, aj as ArchiveEntityWikipageLocale, e as ArchiveEvidence, f as ArchiveEvidenceItem, ak as ArchiveEvidenceOptions, g as ArchiveFindEvidencePreview, h as ArchiveFindField, i as ArchiveFindFilterType, j as ArchiveFindHit, al as ArchiveFindLens, am as ArchiveFindLensHint, an as ArchiveFindMatch, k as ArchiveFindObjectType, l as ArchiveFindOptions, m as ArchiveFindOrder, n as ArchiveFindPosition, o as ArchiveFindResult, p as ArchiveIndex, r as ArchiveListItem, s as ArchiveListKind, t as ArchiveNodeLabel, u as ArchiveNodeSourceFragment, v as ArchiveObjectType, w as ArchivePack, x as ArchivePage, ao as ArchivePageOptions, ap as ArchiveRelatedOptions, y as ArchiveRelatedResult, aq as ArchiveRelatedRole, ar as ArchiveSourceFragment, z as ArchiveTriplePattern, O as clearDirtyArchiveSearchIndex, P as createArchiveSearchIndexFingerprint, U as findArchiveObjects, V as formatChapterId, as as formatChapterTitleId, W as formatEdgeId, at as formatFragmentId, X as formatNodeId, Y as formatSummaryId, Z as getArchiveIndex, _ as grepArchiveObjects, $ as isArchiveSearchIndexCurrent, a1 as listAllArchiveLinks, a2 as listArchiveCollection, a3 as listArchiveEvidence, a4 as listArchiveLinks, a5 as listArchiveObjects, a6 as listRelatedArchiveObjects, a7 as packArchiveContext, aa as readArchivePage, ab as readArchiveSearchIndexStatus, ac as readArchiveText, af as rebuildArchiveSearchIndex } from '../../index-B8NNnQ8P.js';
|
|
8
|
+
import '../../source/toc.js';
|
|
9
|
+
import 'zod';
|
|
10
|
+
import '../../source/types.js';
|
|
11
|
+
import '../../document/database.js';
|
|
12
|
+
import 'sqlite3';
|
|
13
|
+
import '../../document/text-streams.js';
|
|
14
|
+
import '../../document/stores.js';
|
|
15
|
+
import '../../common/language.js';
|
|
16
|
+
import '../../common/llm-scope.js';
|
|
17
|
+
import '../../llm/client.js';
|
|
18
|
+
import '../../llm/context.js';
|
|
19
|
+
import '../../llm/cache.js';
|
|
20
|
+
import '../../llm/types.js';
|
|
21
|
+
import 'ai';
|
|
22
|
+
import '../../reader/types.js';
|
|
23
|
+
import '../../reader/attention/attention.js';
|
|
24
|
+
import '../../reader/chunk-batch/types.js';
|
|
25
|
+
import '../../reader/segment/types.js';
|
|
26
|
+
import '../../serial.js';
|