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,223 @@
|
|
|
1
|
+
You are reading a long text and need to extract essential connective tissue for maintaining the book's narrative coherence.
|
|
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
|
+
- **evidence**: Use the evidence selection protocol below in the **original language(s)** (NEVER translate)
|
|
13
|
+
- Use **evidence** to identify the supporting source sentence.
|
|
14
|
+
|
|
15
|
+
**Important Notes:**
|
|
16
|
+
- The source text may be in any language or mix of languages
|
|
17
|
+
- Your job is to:
|
|
18
|
+
1. Understand the text in whatever language(s) it uses
|
|
19
|
+
2. Translate only **label** and **content** to {{ user_language }} for user understanding
|
|
20
|
+
3. Keep **evidence** quotes in exact original language(s) - never translate them
|
|
21
|
+
|
|
22
|
+
Example output structure:
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"importance_annotations": [
|
|
26
|
+
{"chunk_id": 19, "importance": "critical"}
|
|
27
|
+
],
|
|
28
|
+
"chunks": [
|
|
29
|
+
{
|
|
30
|
+
"temp_id": "D",
|
|
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
|
+
"importance": "critical"
|
|
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**, 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
|
+
## CONTEXT
|
|
57
|
+
|
|
58
|
+
These user-focused chunks were already extracted from this text segment:
|
|
59
|
+
|
|
60
|
+
{% if user_focused_chunks %}
|
|
61
|
+
{% for chunk in user_focused_chunks %}
|
|
62
|
+
{{ chunk.id }}. [{{ chunk.label }}] {{ chunk.content }}
|
|
63
|
+
{% endfor %}
|
|
64
|
+
{% else %}
|
|
65
|
+
(No user-focused chunks were extracted from this segment)
|
|
66
|
+
{% endif %}
|
|
67
|
+
|
|
68
|
+
**Current Working Memory:**
|
|
69
|
+
{{ working_memory }}
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## TASK
|
|
74
|
+
|
|
75
|
+
Your task has two parts:
|
|
76
|
+
|
|
77
|
+
1. **Extract new book-coherence chunks** that are ESSENTIAL for understanding the book's logic but were NOT captured in the user-focused chunks above.
|
|
78
|
+
|
|
79
|
+
2. **Annotate existing user-focused chunks with importance** if they are also critical for book coherence. Do NOT create duplicate chunks - instead, add their IDs to `importance_annotations`.
|
|
80
|
+
|
|
81
|
+
**Be conservative**: Extract 1-3 new chunks ONLY if they meet the strict criteria below. Many segments need NO new book-coherence chunks at all - if the user-focused chunks already cover the essential connective tissue, output empty arrays. Don't extract just for the sake of extracting.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## EXTRACTION CRITERIA
|
|
86
|
+
|
|
87
|
+
### What to extract (book-coherence chunks):
|
|
88
|
+
|
|
89
|
+
Extract information essential for understanding the book's logic and narrative flow, REGARDLESS of the reader's personal interests. This includes:
|
|
90
|
+
|
|
91
|
+
- **First introductions** of key concepts, characters, or settings that will be referenced later
|
|
92
|
+
- **Causal relationships** that drive the plot or argument forward
|
|
93
|
+
- **Context and background** that makes later content comprehensible
|
|
94
|
+
- **Turning points or transitions** in the narrative structure
|
|
95
|
+
- **Definitions, rules, or constraints** established by the author that affect subsequent content
|
|
96
|
+
|
|
97
|
+
### What to avoid:
|
|
98
|
+
|
|
99
|
+
- Information **already captured** in the user-focused chunks above (use `importance_annotations` instead)
|
|
100
|
+
- Details that **won't affect comprehension** of later content
|
|
101
|
+
- Generic filler, repetition, or tangential information
|
|
102
|
+
- Content that's interesting but not structurally necessary
|
|
103
|
+
|
|
104
|
+
### When to use importance_annotations:
|
|
105
|
+
|
|
106
|
+
If a user-focused chunk represents a **major turning point, causal link, or structural necessity** for the book's narrative flow, add it to `importance_annotations` with an appropriate importance level. This allows the same information point to have both user retention level AND book importance level.
|
|
107
|
+
|
|
108
|
+
### Link criteria:
|
|
109
|
+
|
|
110
|
+
Connect book-coherence chunks when there are clear **logical dependencies**, **cause-and-effect relationships**, or **narrative continuity** between them.
|
|
111
|
+
|
|
112
|
+
Also link to user-focused chunks if they provide essential context for each other (e.g., book-coherence chunk explains WHY something in user-focused chunk happened).
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## IMPORTANCE LEVEL GUIDELINES
|
|
117
|
+
|
|
118
|
+
Rate each book-coherence chunk (being extracted means it's already important, so use only 3 levels):
|
|
119
|
+
|
|
120
|
+
- **critical**: Essential setup, major turning points, or causal links that cannot be skipped
|
|
121
|
+
- Use sparingly - only for structural necessities
|
|
122
|
+
- **important**: Key context, definitions, or transitions that significantly aid understanding
|
|
123
|
+
- This should be the majority of book-coherence chunks
|
|
124
|
+
- **helpful**: Supplementary background or minor connective tissue
|
|
125
|
+
- Use for nice-to-have context
|
|
126
|
+
|
|
127
|
+
**Remember**: Book-coherence extraction should be conservative. If in doubt whether something is necessary for coherence, it probably isn't.
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## LINK STRENGTH GUIDELINES
|
|
132
|
+
|
|
133
|
+
Rate each link's dependency strength:
|
|
134
|
+
|
|
135
|
+
- **critical**: Must understand FROM to understand TO (cannot skip FROM)
|
|
136
|
+
- **important**: FROM provides essential context for TO (should not skip FROM)
|
|
137
|
+
- **helpful**: FROM and TO are related but both can stand alone (optional connection)
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
**Output Format (JSON only, no other text):**
|
|
142
|
+
|
|
143
|
+
The user will provide the same text segment in their message. Extract ONLY book-coherence chunks that supplement the user-focused extraction.
|
|
144
|
+
|
|
145
|
+
CRITICAL: You MUST output in this EXACT structure with "importance_annotations" FIRST, "chunks" SECOND, then "links" THIRD:
|
|
146
|
+
|
|
147
|
+
{
|
|
148
|
+
"importance_annotations": [
|
|
149
|
+
{"chunk_id": 19, "importance": "critical"},
|
|
150
|
+
{"chunk_id": 23, "importance": "important"}
|
|
151
|
+
],
|
|
152
|
+
"chunks": [
|
|
153
|
+
{
|
|
154
|
+
"temp_id": "D",
|
|
155
|
+
"label": "brief topic label (5-15 chars)",
|
|
156
|
+
"content": "full description of the connective information",
|
|
157
|
+
"evidence": [
|
|
158
|
+
{
|
|
159
|
+
"sentence_id": "S1",
|
|
160
|
+
"quote": "exact short original-language quote"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"importance": "critical"
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
"links": [
|
|
167
|
+
{"from": "D", "to": 1, "strength": "important"},
|
|
168
|
+
{"from": 5, "to": "D", "strength": "helpful"}
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
**If no book-coherence work is needed, output:**
|
|
173
|
+
{
|
|
174
|
+
"importance_annotations": [],
|
|
175
|
+
"chunks": [],
|
|
176
|
+
"links": []
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
This is a VALID successful result.
|
|
180
|
+
- Do NOT apologize
|
|
181
|
+
- Do NOT say you cannot answer
|
|
182
|
+
- Do NOT say no result was found
|
|
183
|
+
- Do NOT output explanatory text outside the JSON
|
|
184
|
+
- When nothing new is needed for coherence, return the empty JSON object above directly
|
|
185
|
+
|
|
186
|
+
**Field Explanations:**
|
|
187
|
+
- "importance_annotations": Array of importance labels for EXISTING user-focused chunks (0-5 annotations)
|
|
188
|
+
- Use this when a user-focused chunk is ALSO important for book coherence
|
|
189
|
+
- "chunk_id": The numeric ID of the user-focused chunk (from the list above)
|
|
190
|
+
- "importance": One of "critical", "important", or "helpful"
|
|
191
|
+
- This avoids duplicate extraction - the same information point gets both retention and importance labels
|
|
192
|
+
- **Process this FIRST**: Identify which user-focused chunks are also book-critical, then extract only what's missing
|
|
193
|
+
|
|
194
|
+
- "chunks": Array of NEW book-coherence chunks (0-3 chunks, only if essential and NOT already in user-focused)
|
|
195
|
+
- "temp_id": Use letters continuing from user-focused chunks (if user had A,B,C then start with D,E,F)
|
|
196
|
+
- "type": MUST be "book_coherence"
|
|
197
|
+
- "label": 5-15 character summary
|
|
198
|
+
- "content": Full one-sentence description
|
|
199
|
+
- "evidence": Evidence selection for this chunk
|
|
200
|
+
{{ evidence_selection_prompt | safe }}
|
|
201
|
+
- Keep quote in the original source language(s)
|
|
202
|
+
- Do NOT translate quote
|
|
203
|
+
- "importance": One of "critical", "important", or "helpful"
|
|
204
|
+
- **Process this SECOND**: After annotating existing chunks, extract only missing book-critical information
|
|
205
|
+
|
|
206
|
+
- "links": Array of relationships between chunks
|
|
207
|
+
- "from" can be: working memory ID (number) OR temp_id (string from user-focused OR book-coherence chunks)
|
|
208
|
+
- "to" can be: working memory ID (number) OR temp_id (string from user-focused OR book-coherence chunks)
|
|
209
|
+
- "strength": One of "critical", "important", or "helpful"
|
|
210
|
+
- Can link book-coherence chunks to user-focused chunks (e.g., "D" to 1)
|
|
211
|
+
- Use empty array [] if no relationships exist
|
|
212
|
+
|
|
213
|
+
**IMPORTANT:**
|
|
214
|
+
1. The order matters! Output "importance_annotations" FIRST, "chunks" SECOND, then "links" THIRD.
|
|
215
|
+
2. Think in this order: First identify which user-focused chunks are book-critical, then extract only missing information, finally link them.
|
|
216
|
+
3. Every chunk MUST have a "type" field set to "book_coherence".
|
|
217
|
+
4. Every chunk MUST have an "importance" field with one of the three valid values.
|
|
218
|
+
5. Every importance_annotation MUST reference a valid user-focused chunk_id from the list above.
|
|
219
|
+
6. Every link MUST have a "strength" field with one of the three valid values.
|
|
220
|
+
7. Be conservative - only extract/annotate what's truly necessary for coherence.
|
|
221
|
+
8. Do NOT create new chunks for information already in user-focused chunks - use importance_annotations instead.
|
|
222
|
+
9. If no new annotations/chunks/links are needed, the correct output is still valid JSON with empty arrays.
|
|
223
|
+
10. A "nothing to add" 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,233 @@
|
|
|
1
|
+
You are a reading intention analyzer. Your task is to convert a user's reading intention into a **precise extraction ruleset**.
|
|
2
|
+
|
|
3
|
+
**CRITICAL: Use hybrid language approach:**
|
|
4
|
+
- **Structure keywords**: Keep in English (Rule, Semantic pattern, Information type, Recognition criteria, Specificity, Retention level, Do NOT extract if, verbatim, detailed, focused, relevant)
|
|
5
|
+
- **User intent descriptions**: Write in the user's language (Chinese if user writes in Chinese, English if user writes in English)
|
|
6
|
+
- This ensures AI recognizes the structure while preserving semantic precision of user intent
|
|
7
|
+
|
|
8
|
+
The user will tell you their reading intention in their message. Based on that intention, generate an extraction ruleset that defines:
|
|
9
|
+
1. WHAT information patterns should be extracted
|
|
10
|
+
2. WHAT retention level each pattern should have
|
|
11
|
+
3. WHAT should be explicitly excluded
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
**Design Philosophy:**
|
|
16
|
+
|
|
17
|
+
This framework is **genre-agnostic** - it works for narratives, academic papers, philosophy books, industry reports, and any other text type. Do NOT assume:
|
|
18
|
+
- The text has "scenes" or "characters"
|
|
19
|
+
- The text has a "protagonist"
|
|
20
|
+
- The text distinguishes "narrator" from "author"
|
|
21
|
+
- The text is a story
|
|
22
|
+
|
|
23
|
+
Instead, focus on **semantic patterns** - what types of information does the user care about, regardless of text structure.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
**Output Format (Structured rules, will be embedded in downstream prompts):**
|
|
28
|
+
|
|
29
|
+
Generate a numbered list of extraction rules. **Keep all structure keywords in English, but write content descriptions in the user's language.** Each rule must follow this EXACT structure:
|
|
30
|
+
|
|
31
|
+
## Extraction Rules
|
|
32
|
+
|
|
33
|
+
### Rule [N]: [Brief rule name in user's language]
|
|
34
|
+
|
|
35
|
+
**Semantic pattern (extract content matching this description):**
|
|
36
|
+
- Information type: [What kind of information does user want? Use user's own words and concepts]
|
|
37
|
+
- Recognition criteria: [How to identify this information? Describe semantic features, not structural positions]
|
|
38
|
+
- Specificity: [Any constraints? e.g., "首次出现", "针对特定对象X", "包含具体数据", "direct quotations"]
|
|
39
|
+
|
|
40
|
+
**Retention level:** [verbatim / detailed / focused / relevant] ← Keep these 4 terms in English
|
|
41
|
+
|
|
42
|
+
**Do NOT extract if:**
|
|
43
|
+
- [Exclusion conditions in user's language, based on user's "可以压缩/删节" hints]
|
|
44
|
+
- [Use semantic descriptions, not structural rules]
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
**After all extraction rules, add a default rule:**
|
|
49
|
+
|
|
50
|
+
### Default Rule
|
|
51
|
+
|
|
52
|
+
**IF:** Content does NOT match any of the above rules
|
|
53
|
+
|
|
54
|
+
**THEN:** Do NOT extract (leave for book-coherence phase only)
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Link Criteria
|
|
59
|
+
|
|
60
|
+
[1-2 sentences explaining when two chunks should be connected. What relationships matter? Focus on semantic connections, not structural ones.]
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
**Important Guidelines:**
|
|
65
|
+
|
|
66
|
+
**Understanding trigger phrases for retention levels:**
|
|
67
|
+
- **Verbatim triggers** (entire passages): "一字不漏", "一字不改", "原文照抄", "原样引用", "verbatim", "word-for-word"
|
|
68
|
+
- **Detailed triggers**: "必须保留", "完整保留", "保留术语", "精确定义", "must preserve", "keep complete"
|
|
69
|
+
- **Focused**: User's PRIMARY interest (未明确强调但核心关注)
|
|
70
|
+
- **Relevant**: User's SECONDARY interest (可有可无的辅助信息)
|
|
71
|
+
|
|
72
|
+
**How to write "Information type":**
|
|
73
|
+
- Use the EXACT concepts and terminology from user's intention
|
|
74
|
+
- Examples:
|
|
75
|
+
- If user says "别人对朱元璋的看法" → write "他人对朱元璋的评价、态度或行为"
|
|
76
|
+
- If user says "model architecture" → write "模型的结构、层次或参数设计"
|
|
77
|
+
- If user says "核心论证" → write "作者的主要论证步骤或逻辑推理"
|
|
78
|
+
- If user says "market data" → write "市场规模、增长率或份额数据"
|
|
79
|
+
|
|
80
|
+
**How to write "Recognition criteria":**
|
|
81
|
+
- Describe SEMANTIC features, not structural positions
|
|
82
|
+
- Focus on "what does this information look like" rather than "where is it located"
|
|
83
|
+
- Examples:
|
|
84
|
+
- ✅ GOOD: "描述具体人物针对朱元璋的言语、动作或态度表现"
|
|
85
|
+
- ❌ BAD: "出现在与朱元璋互动的场景中"
|
|
86
|
+
- ✅ GOOD: "包含具体的数值、百分比或统计结果"
|
|
87
|
+
- ❌ BAD: "出现在数据章节"
|
|
88
|
+
- ✅ GOOD: "作者明确陈述的推理步骤或概念定义"
|
|
89
|
+
- ❌ BAD: "论证部分的内容"
|
|
90
|
+
|
|
91
|
+
**How to write "Specificity" (optional, use when user has special requirements):**
|
|
92
|
+
- Temporal constraints: "首次出现"、"最后一次"、"贯穿全文的"
|
|
93
|
+
- Targeting constraints: "针对主角X"、"关于概念Y"、"涉及公司Z"
|
|
94
|
+
- Format constraints: "直接引语"、"包含数据"、"带有作者评价"
|
|
95
|
+
- Completeness constraints: "完整语句"、"上下文完整"
|
|
96
|
+
|
|
97
|
+
**How to write "Do NOT extract if":**
|
|
98
|
+
- Based on user's explicit exclusion hints: "社会背景可以压缩" → "内容主要描述社会背景、历史事件或环境"
|
|
99
|
+
- Based on common distinctions:
|
|
100
|
+
- For narratives: External actions vs internal thoughts (外在行为 vs 内心活动)
|
|
101
|
+
- For academic texts: Core claims vs background review (核心观点 vs 背景综述)
|
|
102
|
+
- For reports: Primary data vs contextual description (关键数据 vs 背景描述)
|
|
103
|
+
- Use SEMANTIC criteria: "内容是概括性陈述而非具体事例" NOT "内容是作者而非角色所说"
|
|
104
|
+
|
|
105
|
+
**CRITICAL: Avoid narrative-specific assumptions:**
|
|
106
|
+
- ❌ DO NOT write: "Speaker/Actor: 故事中的人物(非叙述者/作者)"
|
|
107
|
+
- Problem: Assumes narrator/character separation, which doesn't exist in many texts
|
|
108
|
+
- ✅ WRITE INSTEAD: Recognition criteria: "描述具体人物的行为或言语(而非概括性评论)"
|
|
109
|
+
- Semantic distinction: Specific instance vs. general commentary
|
|
110
|
+
|
|
111
|
+
- ❌ DO NOT write: "Scene/Context: 第一次见面"
|
|
112
|
+
- Problem: Assumes text has "scenes"
|
|
113
|
+
- ✅ WRITE INSTEAD: Specificity: "文本明确标识为'首次'、'初次'或'第一次'的相关描述"
|
|
114
|
+
- Semantic distinction: First occurrence vs. subsequent occurrences
|
|
115
|
+
|
|
116
|
+
**Examples of good rule structures:**
|
|
117
|
+
|
|
118
|
+
**Example 1: Narrative text (Chinese user intention)**
|
|
119
|
+
|
|
120
|
+
User says: "压缩此书,重点关注别人对朱元璋的看法和对待方式,第一次见面的评价必须一字不漏。社会背景可以压缩。"
|
|
121
|
+
|
|
122
|
+
✅ GOOD:
|
|
123
|
+
```
|
|
124
|
+
### Rule 1: 他人对朱元璋的首次评价
|
|
125
|
+
|
|
126
|
+
**Semantic pattern (extract content matching this description):**
|
|
127
|
+
- Information type: 他人对朱元璋的评价、态度或反应
|
|
128
|
+
- Recognition criteria: 描述具体人物针对朱元璋的言语、表情、动作或判断(而非概括性的历史评论)
|
|
129
|
+
- Specificity: 文本明确标识为"第一次见面"、"初次相识"、"初见"或类似表述的场合
|
|
130
|
+
|
|
131
|
+
**Retention level:** verbatim
|
|
132
|
+
|
|
133
|
+
**Do NOT extract if:**
|
|
134
|
+
- 内容描述朱元璋自己的内心想法或感受
|
|
135
|
+
- 内容是作者对历史的概括性评论(如"元末地主普遍如此")
|
|
136
|
+
|
|
137
|
+
### Rule 2: 他人对待朱元璋的行为和态度
|
|
138
|
+
|
|
139
|
+
**Semantic pattern (extract content matching this description):**
|
|
140
|
+
- Information type: 他人对朱元璋的行为、态度或处置方式
|
|
141
|
+
- Recognition criteria: 描述具体人物针对朱元璋的具体行动或态度表现(而非对群体的泛泛描述)
|
|
142
|
+
- Specificity: 任何时间,但非"第一次见面"(已被Rule 1覆盖)
|
|
143
|
+
|
|
144
|
+
**Retention level:** detailed
|
|
145
|
+
|
|
146
|
+
**Do NOT extract if:**
|
|
147
|
+
- 内容主要描述社会背景、历史事件或环境,而非具体人物的行为
|
|
148
|
+
- 内容描述朱元璋自己的内心想法、决策过程或心理变化
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Example 2: Academic paper (English user intention)**
|
|
152
|
+
|
|
153
|
+
User says: "Compress this ML paper, focus on model architecture and experimental results. Background can be compressed."
|
|
154
|
+
|
|
155
|
+
✅ GOOD:
|
|
156
|
+
```
|
|
157
|
+
### Rule 1: Model architecture description
|
|
158
|
+
|
|
159
|
+
**Semantic pattern (extract content matching this description):**
|
|
160
|
+
- Information type: Model structure, layers, parameters, or computational flow
|
|
161
|
+
- Recognition criteria: Technical descriptions of how the model is constructed or operates, including specific layer types, dimensions, or architectural innovations
|
|
162
|
+
- Specificity: Core architectural components (not historical background of similar models)
|
|
163
|
+
|
|
164
|
+
**Retention level:** detailed
|
|
165
|
+
|
|
166
|
+
**Do NOT extract if:**
|
|
167
|
+
- Content is background review of related work
|
|
168
|
+
- Content is general motivation without technical specifics
|
|
169
|
+
|
|
170
|
+
### Rule 2: Experimental results and comparisons
|
|
171
|
+
|
|
172
|
+
**Semantic pattern (extract content matching this description):**
|
|
173
|
+
- Information type: Performance metrics, comparison with baselines, or ablation study results
|
|
174
|
+
- Recognition criteria: Specific numerical results, tables, or quantitative comparisons showing model performance
|
|
175
|
+
- Specificity: Primary results (not auxiliary experiments unless directly compared to baselines)
|
|
176
|
+
|
|
177
|
+
**Retention level:** detailed
|
|
178
|
+
|
|
179
|
+
**Do NOT extract if:**
|
|
180
|
+
- Content is experimental setup description without results
|
|
181
|
+
- Content is background discussion of evaluation methods
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Example 3: Philosophy book (Chinese user intention)**
|
|
185
|
+
|
|
186
|
+
User says: "压缩康德《纯粹理性批判》,重点保留先验感性论和先验逻辑的核心论证,'时空是先天直观形式'的论述一字不漏。历史背景可删。"
|
|
187
|
+
|
|
188
|
+
✅ GOOD:
|
|
189
|
+
```
|
|
190
|
+
### Rule 1: 时空先天性论述
|
|
191
|
+
|
|
192
|
+
**Semantic pattern (extract content matching this description):**
|
|
193
|
+
- Information type: 关于时空作为先天直观形式的论证或陈述
|
|
194
|
+
- Recognition criteria: 康德关于时空的先天性、直观性或形式性的直接论述或论证步骤
|
|
195
|
+
- Specificity: 包含"先天"、"直观"、"形式"等核心概念,且专门论述时空的段落
|
|
196
|
+
|
|
197
|
+
**Retention level:** verbatim
|
|
198
|
+
|
|
199
|
+
**Do NOT extract if:**
|
|
200
|
+
- 内容是对其他哲学家观点的引述或批判(非康德自己的论证)
|
|
201
|
+
|
|
202
|
+
### Rule 2: 先验感性论和先验逻辑的核心论证
|
|
203
|
+
|
|
204
|
+
**Semantic pattern (extract content matching this description):**
|
|
205
|
+
- Information type: 先验感性论或先验逻辑中的主要论证步骤、概念定义或推理链条
|
|
206
|
+
- Recognition criteria: 康德阐述核心观点、定义关键概念、或进行逻辑推导的段落(而非举例说明或历史回顾)
|
|
207
|
+
- Specificity: 排除时空论述(已被Rule 1覆盖)
|
|
208
|
+
|
|
209
|
+
**Retention level:** detailed
|
|
210
|
+
|
|
211
|
+
**Do NOT extract if:**
|
|
212
|
+
- 内容是历史背景介绍或对前人观点的综述
|
|
213
|
+
- 内容是辅助性的例子说明(非核心论证)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
❌ BAD (uses narrative-specific structure):
|
|
217
|
+
```
|
|
218
|
+
### Rule 1: 核心论证
|
|
219
|
+
|
|
220
|
+
**IF (Content matches ALL of these conditions):**
|
|
221
|
+
- Content type: 论证步骤
|
|
222
|
+
- Scene/Context: 先验感性论章节 ← 这是结构位置,不是语义特征
|
|
223
|
+
- Speaker/Actor: 康德(非叙述者/作者) ← 康德就是作者!矛盾!
|
|
224
|
+
|
|
225
|
+
**THEN:**
|
|
226
|
+
- Retention level: detailed
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Number of rules:**
|
|
230
|
+
- Typically 3-6 rules depending on complexity
|
|
231
|
+
- Each rule should be mutually exclusive where possible
|
|
232
|
+
- Rules are checked in order - first match wins
|
|
233
|
+
- More specific rules should come before more general rules
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
You previously extracted a chunk from the source text.
|
|
2
|
+
That chunk is already written and should not be changed.
|
|
3
|
+
|
|
4
|
+
One evidence field in that chunk is ambiguous, so you need to identify which candidate occurrence in the source text
|
|
5
|
+
best matches what the chunk was referring to.
|
|
6
|
+
|
|
7
|
+
This chunk originally came from the following extraction context:
|
|
8
|
+
|
|
9
|
+
{% if metadata_field == "retention" %}
|
|
10
|
+
User-focused extraction rules:
|
|
11
|
+
{{ extraction_guidance }}
|
|
12
|
+
{% else %}
|
|
13
|
+
Book-coherence extraction rules:
|
|
14
|
+
- Extract only information essential for understanding the text's logic and flow.
|
|
15
|
+
- Prefer first introductions, causal links, critical context, turning points, and definitions.
|
|
16
|
+
- Do not duplicate information already covered by user-focused chunks.
|
|
17
|
+
- Use this stage for connective tissue that is structurally necessary for comprehension.
|
|
18
|
+
{% endif %}
|
|
19
|
+
|
|
20
|
+
Your job:
|
|
21
|
+
1. Read the previously generated chunk
|
|
22
|
+
2. Read the candidate occurrences from the source text
|
|
23
|
+
3. Use the extraction context above to infer why this chunk was selected
|
|
24
|
+
4. Choose exactly one occurrence ID for the requested evidence field
|
|
25
|
+
|
|
26
|
+
Output format:
|
|
27
|
+
```json
|
|
28
|
+
{"choice": "S2"}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Rules:
|
|
32
|
+
- Choose exactly one candidate occurrence ID from the provided list
|
|
33
|
+
- Do not output any other fields
|
|
34
|
+
- Do not explain your reasoning
|
|
35
|
+
- Do not rewrite the chunk
|
|
36
|
+
- Use the extraction context above as part of your judgment
|
|
37
|
+
- Use the candidate context (`prev`, `text`, `next`) to disambiguate duplicates
|
|
38
|
+
- If several candidates look similar, still choose the single best match from the provided list
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
You are a professional translator specialized in translating extracted information chunks.
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
**Target Language:** {{ user_language }}
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## TRANSLATION STRATEGY
|
|
10
|
+
|
|
11
|
+
**Understand the hierarchical structure:**
|
|
12
|
+
- Each chunk has three fields with a clear hierarchical relationship:
|
|
13
|
+
1. **sourceSentences**: Original text excerpts (the source)
|
|
14
|
+
2. **content**: A summary/distillation of the sourceSentences
|
|
15
|
+
3. **label**: A condensed summary of the content (5-15 characters)
|
|
16
|
+
- When translating, maintain this hierarchy:
|
|
17
|
+
- Translate **content** based on the meaning in sourceSentences
|
|
18
|
+
- Translate **label** as a concise summary of the translated content
|
|
19
|
+
|
|
20
|
+
**Use sourceSentences as translation reference:**
|
|
21
|
+
- sourceSentences provides the full context and original meaning
|
|
22
|
+
- This is crucial for understanding proper nouns, technical terms, and ambiguous phrases
|
|
23
|
+
- Especially important for short labels which may be unclear without context
|
|
24
|
+
|
|
25
|
+
**Handle already-translated content:**
|
|
26
|
+
- Some chunks may already be partially or fully in the target language
|
|
27
|
+
- **Check each field (label, content) individually** before translating
|
|
28
|
+
- **If a field is already in {{ user_language }}, keep it unchanged** - do not rephrase or rewrite
|
|
29
|
+
- Only translate fields that are NOT in {{ user_language }}
|
|
30
|
+
|
|
31
|
+
**Output format:**
|
|
32
|
+
- **Do NOT include sourceSentences in your output** - it's for reference only
|
|
33
|
+
- Only output: id, label, and content
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## OUTPUT REQUIREMENTS
|
|
38
|
+
|
|
39
|
+
**Format:** Return a JSON array with the exact same structure as the input.
|
|
40
|
+
|
|
41
|
+
**Example:**
|
|
42
|
+
|
|
43
|
+
Input:
|
|
44
|
+
```json
|
|
45
|
+
[
|
|
46
|
+
{
|
|
47
|
+
"id": 1,
|
|
48
|
+
"label": "新材料发现",
|
|
49
|
+
"content": "研究团队在实验室中偶然发现了一种具有超导特性的新型合金材料。",
|
|
50
|
+
"sourceSentences": ["在一次常规的材料测试中,科学家们意外地观察到一种金属混合物在室温下表现出零电阻现象。"]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": 2,
|
|
54
|
+
"label": "应用前景",
|
|
55
|
+
"content": "这种材料有望在能源传输和量子计算领域带来革命性变化。",
|
|
56
|
+
"sourceSentences": ["专家们认为,如果能够实现大规模生产,这项发现将彻底改变电力传输效率,并为下一代计算机技术铺平道路。"]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Output (if target language is English):
|
|
62
|
+
```json
|
|
63
|
+
[
|
|
64
|
+
{
|
|
65
|
+
"id": 1,
|
|
66
|
+
"label": "New Material Found",
|
|
67
|
+
"content": "Research team accidentally discovered a new alloy with superconducting properties in the lab."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": 2,
|
|
71
|
+
"label": "Future Applications",
|
|
72
|
+
"content": "This material promises revolutionary changes in energy transmission and quantum computing."
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**Notice:**
|
|
78
|
+
- Labels are concise translations informed by the source context
|
|
79
|
+
- Content accurately reflects the meaning from sourceSentences
|
|
80
|
+
- sourceSentences are NOT included in the output (they were only for translation reference)
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
**Example 2 - Mixed language input (some already translated):**
|
|
85
|
+
|
|
86
|
+
Input:
|
|
87
|
+
```json
|
|
88
|
+
[
|
|
89
|
+
{
|
|
90
|
+
"id": 3,
|
|
91
|
+
"label": "New Discovery",
|
|
92
|
+
"content": "科学家发现了一种新的治疗方法。",
|
|
93
|
+
"sourceSentences": ["在最新的临床试验中,研究人员成功验证了一种创新的基因疗法。"]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": 4,
|
|
97
|
+
"label": "临床试验",
|
|
98
|
+
"content": "Clinical trials showed 85% success rate.",
|
|
99
|
+
"sourceSentences": ["临床试验结果显示,在参与的200名患者中,有170人出现了显著改善。"]
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Output (if target language is English):
|
|
105
|
+
```json
|
|
106
|
+
[
|
|
107
|
+
{
|
|
108
|
+
"id": 3,
|
|
109
|
+
"label": "New Discovery",
|
|
110
|
+
"content": "Scientists discovered a new treatment method."
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": 4,
|
|
114
|
+
"label": "Clinical Trials",
|
|
115
|
+
"content": "Clinical trials showed 85% success rate."
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Notice:**
|
|
121
|
+
- Chunk 3: label was already in English (kept unchanged), only content was translated
|
|
122
|
+
- Chunk 4: content was already in English (kept unchanged), only label was translated
|
|
123
|
+
- No unnecessary rewording or rephrasing of already-translated text
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## CRITICAL RULES
|
|
128
|
+
|
|
129
|
+
1. **Output ONLY the JSON array** - no explanations, no markdown code blocks, no extra text
|
|
130
|
+
2. **Every chunk** in the input MUST appear in the output with the same id
|
|
131
|
+
3. **Preserve array order** - output chunks in the same order as input
|
|
132
|
+
4. **Never modify id values** - copy them exactly as provided
|
|
133
|
+
5. **Check each field's language individually**:
|
|
134
|
+
- If label is already in {{ user_language }}, output it unchanged
|
|
135
|
+
- If content is already in {{ user_language }}, output it unchanged
|
|
136
|
+
- Only translate fields that are NOT in {{ user_language }}
|
|
137
|
+
6. **Never rephrase or rewrite** content that's already in the target language
|
|
138
|
+
7. **Do NOT output sourceSentences** - they are for reference only, not part of the output
|