@research-copilot/plugin 1.1.16 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.claude-plugin/plugin.json +1 -1
- package/dist/.codex-plugin/plugin.toml +1 -1
- package/dist/.cursor-plugin/plugin.json +1 -1
- package/dist/.gemini-plugin/plugin.json +1 -1
- package/dist/.opencode-plugin/plugin.json +1 -1
- package/dist/.windsurf-plugin/plugin.json +1 -1
- package/dist/skills/ablation-planner/SKILL.md +126 -0
- package/dist/skills/alphaxiv/SKILL.md +186 -0
- package/dist/skills/analyze-results/SKILL.md +45 -0
- package/dist/skills/arxiv/SKILL.md +210 -0
- package/dist/skills/auto-paper-improvement-loop/SKILL.md +574 -0
- package/dist/skills/auto-review-loop/SKILL.md +370 -0
- package/dist/skills/auto-review-loop-llm/SKILL.md +247 -0
- package/dist/skills/auto-review-loop-minimax/SKILL.md +290 -0
- package/dist/skills/benchmark-paper-template/SKILL.md +142 -0
- package/dist/skills/benchmark-paper-template/references/benchmark-design.md +180 -0
- package/dist/skills/benchmark-paper-template/references/checklist.md +113 -0
- package/dist/skills/benchmark-paper-template/references/construction-pipeline.md +127 -0
- package/dist/skills/benchmark-paper-template/references/experiments.md +159 -0
- package/dist/skills/benchmark-paper-template/references/gap-analysis.md +86 -0
- package/dist/skills/benchmark-paper-template/references/instantiation-template.md +194 -0
- package/dist/skills/benchmark-paper-template/references/orchestrator-notes.md +96 -0
- package/dist/skills/benchmark-paper-template/references/paper-structure.md +209 -0
- package/dist/skills/citation-audit/SKILL.md +494 -0
- package/dist/skills/claims-drafting/SKILL.md +239 -0
- package/dist/skills/comm-lit-review/SKILL.md +299 -0
- package/dist/skills/comm-lit-review/references/domain-taxonomy.md +57 -0
- package/dist/skills/comm-lit-review/references/output-template.md +37 -0
- package/dist/skills/comm-lit-review/references/source-policy.md +99 -0
- package/dist/skills/comm-lit-review/references/venue-tiering.md +112 -0
- package/dist/skills/composer/SKILL.md +840 -0
- package/dist/skills/composer/references/section_guides.md +675 -0
- package/dist/skills/composer/references/writing_standards.md +629 -0
- package/dist/skills/composer/scripts/chapter_quality_check.py +470 -0
- package/dist/skills/composer/scripts/final_evaluation.py +550 -0
- package/dist/skills/deepxiv/SKILL.md +142 -0
- package/dist/skills/dse-loop/SKILL.md +277 -0
- package/dist/skills/embodiment-description/SKILL.md +129 -0
- package/dist/skills/exa-search/SKILL.md +192 -0
- package/dist/skills/experiment-audit/SKILL.md +262 -0
- package/dist/skills/experiment-bridge/SKILL.md +316 -0
- package/dist/skills/experiment-plan/SKILL.md +249 -0
- package/dist/skills/experiment-queue/SKILL.md +380 -0
- package/dist/skills/experiment-queue/scripts/build_manifest.py +142 -0
- package/dist/skills/experiment-queue/scripts/queue_manager.py +426 -0
- package/dist/skills/feishu-notify/SKILL.md +155 -0
- package/dist/skills/figure-description/SKILL.md +138 -0
- package/dist/skills/figure-designer/SKILL.md +207 -0
- package/dist/skills/figure-designer/references/design-rules.md +99 -0
- package/dist/skills/figure-designer/references/experimental-results.md +127 -0
- package/dist/skills/figure-designer/references/motivated-example.md +138 -0
- package/dist/skills/figure-designer/references/solution-overview.md +145 -0
- package/dist/skills/figure-designer/references/tools.md +124 -0
- package/dist/skills/figure-spec/SKILL.md +252 -0
- package/dist/skills/figure-spec/scripts/figure_renderer.py +799 -0
- package/dist/skills/formula-derivation/SKILL.md +280 -0
- package/dist/skills/gemini-search/SKILL.md +205 -0
- package/dist/skills/grant-proposal/SKILL.md +625 -0
- package/dist/skills/humanizer/AGENTS.md +25 -0
- package/dist/skills/humanizer/SKILL.md +621 -0
- package/dist/skills/idea-creator/SKILL.md +311 -0
- package/dist/skills/idea-discovery/SKILL.md +340 -0
- package/dist/skills/idea-discovery-robot/SKILL.md +362 -0
- package/dist/skills/idea-evaluator/SKILL.md +265 -0
- package/dist/skills/idea-evaluator/references/fatal-flaws.md +192 -0
- package/dist/skills/idea-evaluator/references/five-dimensions.md +251 -0
- package/dist/skills/idea-evaluator/references/lifecycle-capability-matching.md +177 -0
- package/dist/skills/idea-evaluator/references/paradigm-elephant.md +112 -0
- package/dist/skills/idea-evaluator/references/paradigm-examples.md +107 -0
- package/dist/skills/idea-evaluator/references/paradigm-first-principles.md +115 -0
- package/dist/skills/idea-evaluator/references/paradigm-hamming.md +137 -0
- package/dist/skills/idea-evaluator/references/paradigm-shift-probe.md +160 -0
- package/dist/skills/idea-evaluator/references/paradigm-technology-cycle.md +116 -0
- package/dist/skills/idea-evaluator/references/worked-examples.md +206 -0
- package/dist/skills/interview-cheatsheet/SKILL.md +245 -0
- package/dist/skills/intro-drafter/SKILL.md +250 -0
- package/dist/skills/intro-drafter/references/contribution-patterns.md +116 -0
- package/dist/skills/intro-drafter/references/flowchart.md +204 -0
- package/dist/skills/intro-drafter/references/paper-types.md +155 -0
- package/dist/skills/intro-drafter/references/running-example.md +133 -0
- package/dist/skills/intro-drafter/references/worked-examples.md +161 -0
- package/dist/skills/invention-structuring/SKILL.md +188 -0
- package/dist/skills/jurisdiction-format/SKILL.md +192 -0
- package/dist/skills/kill-argument/SKILL.md +384 -0
- package/dist/skills/llm-wiki/.mise.toml +2 -0
- package/dist/skills/llm-wiki/.nvmrc +1 -0
- package/dist/skills/llm-wiki/AGENTS.md +132 -0
- package/dist/skills/llm-wiki/CHANGELOG.md +459 -0
- package/dist/skills/llm-wiki/CLAUDE.md +109 -0
- package/dist/skills/llm-wiki/HERMES.md +44 -0
- package/dist/skills/llm-wiki/SKILL.md +1133 -0
- package/dist/skills/llm-wiki/assets/graph-demo.gif +0 -0
- package/dist/skills/llm-wiki/assets/graph-preview.png +0 -0
- package/dist/skills/llm-wiki/deps/LICENSE-d3.txt +13 -0
- package/dist/skills/llm-wiki/deps/LICENSE-marked.txt +44 -0
- package/dist/skills/llm-wiki/deps/LICENSE-purify.txt +568 -0
- package/{LICENSE → dist/skills/llm-wiki/deps/LICENSE-roughjs.txt} +1 -1
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/SKILL.md +261 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/references/config/first-time-setup.md +106 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/cdp.ts +179 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/constants.ts +13 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/defuddle-converter.ts +58 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/html-to-markdown.ts +135 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/legacy-converter.ts +629 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/main.ts +314 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/markdown-conversion-shared.ts +305 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/media-localizer.ts +317 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/package.json +14 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/paths.ts +29 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/vendor/baoyu-chrome-cdp/package.json +9 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/vendor/baoyu-chrome-cdp/src/index.test.ts +307 -0
- package/dist/skills/llm-wiki/deps/baoyu-url-to-markdown/scripts/vendor/baoyu-chrome-cdp/src/index.ts +523 -0
- package/dist/skills/llm-wiki/deps/d3.min.js +2 -0
- package/dist/skills/llm-wiki/deps/marked.min.js +6 -0
- package/dist/skills/llm-wiki/deps/purify.min.js +3 -0
- package/dist/skills/llm-wiki/deps/rough.min.js +7 -0
- package/dist/skills/llm-wiki/deps/youtube-transcript/SKILL.md +47 -0
- package/dist/skills/llm-wiki/deps/youtube-transcript/scripts/get_transcript.py +72 -0
- package/dist/skills/llm-wiki/docs/design/oriental-atlas/DESIGN.md +183 -0
- package/dist/skills/llm-wiki/docs/design/oriental-atlas/design-brief.md +170 -0
- package/dist/skills/llm-wiki/docs/design/oriental-atlas/oriental-editorial-atlas.html +1908 -0
- package/dist/skills/llm-wiki/docs/design/oriental-atlas/reviews/result-review.md +68 -0
- package/dist/skills/llm-wiki/docs/plans/2026-06-15-omp-tool-status-events-phased-plan.md +655 -0
- package/dist/skills/llm-wiki/docs/plans/2026-06-15-omp-tool-status-events-progress.json +913 -0
- package/dist/skills/llm-wiki/docs/spark/2026-06-15-omp-tool-status-events-design.md +174 -0
- package/dist/skills/llm-wiki/install.ps1 +87 -0
- package/dist/skills/llm-wiki/install.sh +722 -0
- package/dist/skills/llm-wiki/package-lock.json +10309 -0
- package/dist/skills/llm-wiki/package.json +24 -0
- package/dist/skills/llm-wiki/packages/graph-engine/package.json +33 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/anim/.gitkeep +1 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/anim/index.ts +179 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/diff.ts +121 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/graph-node.ts +37 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/index.ts +140 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/atlas.ts +18 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/index.ts +6 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/labels.ts +11 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/learning.ts +8 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/legacy-helpers.ts +1373 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/queue.ts +7 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/storage.ts +4 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/model/visibility.ts +9 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/.gitkeep +1 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/index.ts +59 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/legend.ts +25 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/model.ts +593 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/preview.ts +65 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/search.ts +48 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/static-renderer.ts +2783 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/toolbar.ts +40 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/render/viewport.ts +272 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/select/.gitkeep +1 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/select/index.ts +189 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/sim/index.ts +298 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/sim/pins.ts +96 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/themes/.gitkeep +1 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/themes/index.ts +8 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/themes/tokens.ts +107 -0
- package/dist/skills/llm-wiki/packages/graph-engine/src/types.ts +313 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/anim.test.ts +100 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/diff.test.ts +133 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/helpers.test.ts +275 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/learning.test.ts +259 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/preview.test.ts +56 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/queue.test.ts +114 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/render-model.test.ts +322 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/runtime-state.test.ts +281 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/search-and-legend.test.ts +111 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/select.test.ts +168 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/sim.test.ts +123 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/themes.test.ts +62 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/toolbar.test.ts +64 -0
- package/dist/skills/llm-wiki/packages/graph-engine/test/viewport.test.ts +167 -0
- package/dist/skills/llm-wiki/packages/graph-engine/tsconfig.json +17 -0
- package/dist/skills/llm-wiki/packages/graph-engine/vite.config.ts +15 -0
- package/dist/skills/llm-wiki/platforms/claude/CLAUDE.md +37 -0
- package/dist/skills/llm-wiki/platforms/claude/companions/llm-wiki-upgrade/SKILL.md +95 -0
- package/dist/skills/llm-wiki/platforms/codex/AGENTS.md +23 -0
- package/dist/skills/llm-wiki/scripts/adapter-state.sh +424 -0
- package/dist/skills/llm-wiki/scripts/build-graph-data.sh +395 -0
- package/dist/skills/llm-wiki/scripts/build-graph-html.sh +453 -0
- package/dist/skills/llm-wiki/scripts/cache.sh +352 -0
- package/dist/skills/llm-wiki/scripts/create-source-page.sh +100 -0
- package/dist/skills/llm-wiki/scripts/delete-helper.sh +68 -0
- package/dist/skills/llm-wiki/scripts/graph-analysis.js +732 -0
- package/dist/skills/llm-wiki/scripts/hook-session-start.sh +46 -0
- package/dist/skills/llm-wiki/scripts/init-wiki.sh +95 -0
- package/dist/skills/llm-wiki/scripts/lib/source-signal-eligibility.js +158 -0
- package/dist/skills/llm-wiki/scripts/lint-fix.sh +114 -0
- package/dist/skills/llm-wiki/scripts/lint-runner.sh +217 -0
- package/dist/skills/llm-wiki/scripts/runtime-context.sh +77 -0
- package/dist/skills/llm-wiki/scripts/shared-config.sh +83 -0
- package/dist/skills/llm-wiki/scripts/source-record-contract.tsv +10 -0
- package/dist/skills/llm-wiki/scripts/source-registry.sh +349 -0
- package/dist/skills/llm-wiki/scripts/source-registry.tsv +10 -0
- package/dist/skills/llm-wiki/scripts/source-signal-coverage.js +83 -0
- package/dist/skills/llm-wiki/scripts/validate-step1.sh +144 -0
- package/dist/skills/llm-wiki/scripts/wiki-compat.sh +267 -0
- package/dist/skills/llm-wiki/setup.sh +8 -0
- package/dist/skills/llm-wiki/templates/entity-template.md +30 -0
- package/dist/skills/llm-wiki/templates/graph-styles/wash/footer.html +27 -0
- package/dist/skills/llm-wiki/templates/graph-styles/wash/graph-wash-helpers.js +1326 -0
- package/dist/skills/llm-wiki/templates/graph-styles/wash/graph-wash.js +1009 -0
- package/dist/skills/llm-wiki/templates/graph-styles/wash/header.html +2002 -0
- package/dist/skills/llm-wiki/templates/index-en-template.md +51 -0
- package/dist/skills/llm-wiki/templates/index-template.md +51 -0
- package/dist/skills/llm-wiki/templates/log-en-template.md +11 -0
- package/dist/skills/llm-wiki/templates/log-template.md +11 -0
- package/dist/skills/llm-wiki/templates/overview-en-template.md +41 -0
- package/dist/skills/llm-wiki/templates/overview-template.md +41 -0
- package/dist/skills/llm-wiki/templates/purpose-en-template.md +16 -0
- package/dist/skills/llm-wiki/templates/purpose-template.md +16 -0
- package/dist/skills/llm-wiki/templates/query-template.md +19 -0
- package/dist/skills/llm-wiki/templates/schema-template.md +185 -0
- package/dist/skills/llm-wiki/templates/source-template.md +51 -0
- package/dist/skills/llm-wiki/templates/synthesis-template.md +25 -0
- package/dist/skills/llm-wiki/templates/topic-template.md +35 -0
- package/dist/skills/llm-wiki/tests/adapter-state.sh +338 -0
- package/dist/skills/llm-wiki/tests/browser/graph-density-preview.mjs +53 -0
- package/dist/skills/llm-wiki/tests/browser/graph-html-insights.mjs +41 -0
- package/dist/skills/llm-wiki/tests/browser/graph-node-slim.mjs +71 -0
- package/dist/skills/llm-wiki/tests/browser/graph-stage-4-5.mjs +717 -0
- package/dist/skills/llm-wiki/tests/expected/graph-data-empty.json +60 -0
- package/dist/skills/llm-wiki/tests/expected/graph-data-sample.json +396 -0
- package/dist/skills/llm-wiki/tests/expected/graph-interactive-basic.html +1736 -0
- package/dist/skills/llm-wiki/tests/expected/lint-output.txt +44 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/index.md +1 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/entities/Alpha.md +10 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/entities/Beta.md +7 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/entities/Delta.md +8 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/entities/Gamma.md +8 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/queries/20260422-abc.md +10 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/synthesis/Crystal.md +8 -0
- package/dist/skills/llm-wiki/tests/fixtures/coverage-sample-wiki/wiki/topics/Overview.md +9 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-empty-wiki/wiki/entities/.gitkeep +0 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/purpose.md +3 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/entities/Attention.md +7 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/entities/Decoder.md +7 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/entities/Encoder.md +7 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/entities/GPT.md +7 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/entities/Transformer.md +13 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/sources/paper.md +9 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/topics/arch.md +12 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-data-sample-wiki/wiki/topics/finetune.md +9 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-interactive-basic/wiki/graph-data.json +40 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-interactive-dense/wiki/graph-data.json +3965 -0
- package/dist/skills/llm-wiki/tests/fixtures/graph-interactive-multicomm/wiki/graph-data.json +212 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/index.md +14 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/entities/C++.md +6 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/entities/Lonely.md +4 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/entities/Other.md +8 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/entities/Real.md +7 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/sources/2026-01-01-test-source.md +15 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/sources/2026-02-01-inline-img.md +12 -0
- package/dist/skills/llm-wiki/tests/fixtures/lint-sample-wiki/wiki/topics/AIbasic.md +3 -0
- package/dist/skills/llm-wiki/tests/graph-analysis-helper.regression-1.sh +237 -0
- package/dist/skills/llm-wiki/tests/graph-browser-stage-4-5.regression-1.sh +157 -0
- package/dist/skills/llm-wiki/tests/graph-build-failures.regression-1.sh +91 -0
- package/dist/skills/llm-wiki/tests/graph-data-confidence-merge.regression-1.sh +309 -0
- package/dist/skills/llm-wiki/tests/graph-data-source-paths.regression-1.sh +49 -0
- package/dist/skills/llm-wiki/tests/graph-html-a11y.regression-1.sh +47 -0
- package/dist/skills/llm-wiki/tests/graph-html-brand-link.regression-1.sh +47 -0
- package/dist/skills/llm-wiki/tests/graph-html-density.regression-1.sh +228 -0
- package/dist/skills/llm-wiki/tests/graph-html-drawer-neighbors.regression-1.sh +47 -0
- package/dist/skills/llm-wiki/tests/graph-html-insights.regression-1.sh +80 -0
- package/dist/skills/llm-wiki/tests/graph-html-long-label.regression-1.sh +92 -0
- package/dist/skills/llm-wiki/tests/graph-html-minimap.regression-1.sh +51 -0
- package/dist/skills/llm-wiki/tests/graph-html-mobile.regression-1.sh +48 -0
- package/dist/skills/llm-wiki/tests/graph-html-oriental-atlas-contract.regression-1.sh +94 -0
- package/dist/skills/llm-wiki/tests/graph-html-oriental-design-contract.regression-1.sh +82 -0
- package/dist/skills/llm-wiki/tests/graph-html-search.regression-1.sh +52 -0
- package/dist/skills/llm-wiki/tests/graph-html-styles.regression-1.sh +66 -0
- package/dist/skills/llm-wiki/tests/graph-html-toolbar.regression-1.sh +62 -0
- package/dist/skills/llm-wiki/tests/js/graph-wash-bootstrap.test.js +110 -0
- package/dist/skills/llm-wiki/tests/js/graph-wash-helpers.test.js +296 -0
- package/dist/skills/llm-wiki/tests/js/graph-wash-learning.test.js +260 -0
- package/dist/skills/llm-wiki/tests/js/graph-wash-queue.test.js +115 -0
- package/dist/skills/llm-wiki/tests/js/graph-wash-runtime-state.test.js +282 -0
- package/dist/skills/llm-wiki/tests/js/source-signal-coverage.test.js +48 -0
- package/dist/skills/llm-wiki/tests/js/source-signal-eligibility.test.js +202 -0
- package/dist/skills/llm-wiki/tests/lib/graph-html-engine-helpers.sh +110 -0
- package/dist/skills/llm-wiki/tests/lint-output.regression-1.sh +32 -0
- package/dist/skills/llm-wiki/tests/regression.sh +1754 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/.gitkeep +0 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/SKILL.md +590 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/__init__.py +1 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/accept_changes.py +135 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/comment.py +318 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/helpers/__init__.py +0 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/helpers/merge_runs.py +199 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/pack.py +159 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/soffice.py +183 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/unpack.py +132 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/validate.py +111 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/validators/__init__.py +15 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/validators/base.py +847 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/validators/docx.py +446 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/validators/pptx.py +275 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/office/validators/redlining.py +247 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/templates/comments.xml +3 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/docx/scripts/templates/people.xml +3 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/SKILL.md +314 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/forms.md +294 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/reference.md +612 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/check_bounding_boxes.py +65 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/check_fillable_fields.py +11 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/convert_pdf_to_images.py +33 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/create_validation_image.py +37 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/extract_form_field_info.py +122 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/extract_form_structure.py +115 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/fill_fillable_fields.py +98 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/SKILL.md +232 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/editing.md +205 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/pptxgenjs.md +420 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/__init__.py +0 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/add_slide.py +195 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/clean.py +286 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/helpers/__init__.py +0 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/helpers/merge_runs.py +199 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/pack.py +159 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/soffice.py +183 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/unpack.py +132 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/validate.py +111 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/validators/__init__.py +15 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/validators/base.py +847 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/validators/docx.py +446 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/validators/pptx.py +275 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/office/validators/redlining.py +247 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/pptx/scripts/thumbnail.py +289 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/SKILL.md +292 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/helpers/__init__.py +0 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/helpers/merge_runs.py +199 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/pack.py +159 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/soffice.py +183 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/unpack.py +132 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/validate.py +111 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/validators/__init__.py +15 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/validators/base.py +847 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/validators/docx.py +446 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/validators/pptx.py +275 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/office/validators/redlining.py +247 -0
- package/dist/skills/llm-wiki/workbench/.claude/skills/xlsx/scripts/recalc.py +184 -0
- package/dist/skills/llm-wiki/workbench/AGENTS.md +110 -0
- package/dist/skills/llm-wiki/workbench/CLAUDE.md +54 -0
- package/dist/skills/llm-wiki/workbench/PRODUCT.md +1268 -0
- package/dist/skills/llm-wiki/workbench/docs/current-kb-retrieval-design.md +587 -0
- package/dist/skills/llm-wiki/workbench/docs/graph-evolution-1-design.md +210 -0
- package/dist/skills/llm-wiki/workbench/docs/stage-2-design.md +1139 -0
- package/dist/skills/llm-wiki/workbench/docs/stage-3-design.md +1269 -0
- package/dist/skills/llm-wiki/workbench/docs/stage-3.5-design.md +1164 -0
- package/dist/skills/llm-wiki/workbench/docs/stage-4-design.md +504 -0
- package/dist/skills/llm-wiki/workbench/docs/stage-4.5-design.md +195 -0
- package/dist/skills/llm-wiki/workbench/docs/superpowers/specs/2026-05-28-resizable-preview-layout-design.md +165 -0
- package/dist/skills/llm-wiki/workbench/docs/superpowers/specs/2026-05-28-settings-panel-scroll-fix.md +50 -0
- package/dist/skills/llm-wiki/workbench/server/package.json +29 -0
- package/dist/skills/llm-wiki/workbench/server/src/agent.ts +457 -0
- package/dist/skills/llm-wiki/workbench/server/src/artifacts.ts +248 -0
- package/dist/skills/llm-wiki/workbench/server/src/auth.ts +164 -0
- package/dist/skills/llm-wiki/workbench/server/src/config.ts +130 -0
- package/dist/skills/llm-wiki/workbench/server/src/conversations.test.ts +121 -0
- package/dist/skills/llm-wiki/workbench/server/src/conversations.ts +255 -0
- package/dist/skills/llm-wiki/workbench/server/src/digest/batch.ts +189 -0
- package/dist/skills/llm-wiki/workbench/server/src/digest/concurrency.test.ts +36 -0
- package/dist/skills/llm-wiki/workbench/server/src/digest/concurrency.ts +31 -0
- package/dist/skills/llm-wiki/workbench/server/src/digest/subagent.ts +91 -0
- package/dist/skills/llm-wiki/workbench/server/src/extensions/artifacts.ts +81 -0
- package/dist/skills/llm-wiki/workbench/server/src/extensions/knowledge-base.ts +263 -0
- package/dist/skills/llm-wiki/workbench/server/src/extensions/new-wiki.ts +42 -0
- package/dist/skills/llm-wiki/workbench/server/src/extensions/synthesis.ts +172 -0
- package/dist/skills/llm-wiki/workbench/server/src/graph-watcher.test.ts +196 -0
- package/dist/skills/llm-wiki/workbench/server/src/graph.test.ts +84 -0
- package/dist/skills/llm-wiki/workbench/server/src/graph.ts +379 -0
- package/dist/skills/llm-wiki/workbench/server/src/index.ts +1148 -0
- package/dist/skills/llm-wiki/workbench/server/src/knowledge-bases.test.ts +30 -0
- package/dist/skills/llm-wiki/workbench/server/src/knowledge-bases.ts +321 -0
- package/dist/skills/llm-wiki/workbench/server/src/pages.test.ts +16 -0
- package/dist/skills/llm-wiki/workbench/server/src/pages.ts +158 -0
- package/dist/skills/llm-wiki/workbench/server/src/retrieval.test.ts +151 -0
- package/dist/skills/llm-wiki/workbench/server/src/retrieval.ts +427 -0
- package/dist/skills/llm-wiki/workbench/server/src/tool-status-events.test.ts +363 -0
- package/dist/skills/llm-wiki/workbench/server/src/tool-status-events.ts +616 -0
- package/dist/skills/llm-wiki/workbench/server/src/wiki-init.test.ts +19 -0
- package/dist/skills/llm-wiki/workbench/server/src/wiki-init.ts +188 -0
- package/dist/skills/llm-wiki/workbench/server/tsconfig.json +10 -0
- package/dist/skills/llm-wiki/workbench/tsconfig.json +20 -0
- package/dist/skills/llm-wiki/workbench/web/components.json +21 -0
- package/dist/skills/llm-wiki/workbench/web/eslint.config.js +22 -0
- package/dist/skills/llm-wiki/workbench/web/index.html +13 -0
- package/dist/skills/llm-wiki/workbench/web/package.json +48 -0
- package/dist/skills/llm-wiki/workbench/web/src/App.tsx +749 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/AddExternalDialog.tsx +373 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ArtifactView.tsx +15 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/BatchDigestPanel.tsx +106 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ChatPanel.tsx +821 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/CommandMenu.tsx +65 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ExportButtons.tsx +54 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/GraphPanel.tsx +516 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/GraphReader.tsx +48 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/GraphSelection.tsx +100 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/MarkdownView.tsx +56 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/NewWikiDialog.tsx +101 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/RefMenu.tsx +40 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/RightDrawer.tsx +227 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/SettingsPanel.tsx +331 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/Sidebar.tsx +436 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ToolHistorySummary.tsx +123 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ToolStatusRunway.tsx +90 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/renderers/DownloadOnlyRenderer.tsx +88 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/renderers/HtmlRenderer.tsx +92 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ui/button.tsx +52 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ui/command.tsx +50 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ui/dialog.tsx +156 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ui/input.tsx +21 -0
- package/dist/skills/llm-wiki/workbench/web/src/components/ui/tooltip.tsx +57 -0
- package/dist/skills/llm-wiki/workbench/web/src/index.css +1737 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/api.ts +648 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/drawer-state.ts +79 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/graph-reader.ts +25 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/graph-selection-drawer.ts +35 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/graph-selection.ts +96 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/legacy-tool-status.ts +113 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/sse.ts +72 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/tool-status-format.ts +170 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/tool-status-model.ts +392 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/utils.ts +10 -0
- package/dist/skills/llm-wiki/workbench/web/src/lib/wiki-links.ts +32 -0
- package/dist/skills/llm-wiki/workbench/web/src/main.tsx +10 -0
- package/dist/skills/llm-wiki/workbench/web/test/api.test.ts +61 -0
- package/dist/skills/llm-wiki/workbench/web/test/chat-panel-tool-status.test.tsx +26 -0
- package/dist/skills/llm-wiki/workbench/web/test/graph-drawer-state.test.ts +78 -0
- package/dist/skills/llm-wiki/workbench/web/test/graph-reader-request.test.ts +32 -0
- package/dist/skills/llm-wiki/workbench/web/test/graph-reader.test.ts +62 -0
- package/dist/skills/llm-wiki/workbench/web/test/graph-selection-drawer.test.ts +56 -0
- package/dist/skills/llm-wiki/workbench/web/test/graph-selection.test.ts +83 -0
- package/dist/skills/llm-wiki/workbench/web/test/tool-history-summary.test.tsx +124 -0
- package/dist/skills/llm-wiki/workbench/web/test/tool-status-format.test.ts +107 -0
- package/dist/skills/llm-wiki/workbench/web/test/tool-status-model.test.ts +324 -0
- package/dist/skills/llm-wiki/workbench/web/test/tool-status-runway.test.ts +134 -0
- package/dist/skills/llm-wiki/workbench/web/test/wiki-links.test.ts +23 -0
- package/dist/skills/llm-wiki/workbench/web/tsconfig.app.json +30 -0
- package/dist/skills/llm-wiki/workbench/web/tsconfig.json +7 -0
- package/dist/skills/llm-wiki/workbench/web/tsconfig.node.json +24 -0
- package/dist/skills/llm-wiki/workbench/web/vite.config.ts +26 -0
- package/dist/skills/mean-reviewer/SECURITY.md +23 -0
- package/dist/skills/mean-reviewer/SKILL.md +203 -0
- package/dist/skills/mean-reviewer/examples/13446_1000_Layer_Networks_for_.pdf +0 -0
- package/dist/skills/mean-reviewer/examples/13446_mean_reviewer.md +116 -0
- package/dist/skills/mean-reviewer/examples/13446_mean_reviewer_author_rebuttal_simulated.md +282 -0
- package/dist/skills/mean-reviewer/examples/13446_mean_reviewer_reply.md +91 -0
- package/dist/skills/mean-reviewer/examples/13446_official_review.json +973 -0
- package/dist/skills/mean-reviewer/examples/ChatGPT_AC_Roleplay.jpeg +0 -0
- package/dist/skills/medical-imaging-review/SKILL.md +295 -0
- package/dist/skills/medical-imaging-review/references/CITATION_INTEGRITY.md +233 -0
- package/dist/skills/medical-imaging-review/references/DOMAINS.md +302 -0
- package/dist/skills/medical-imaging-review/references/HALLUCINATION_PATTERNS.md +211 -0
- package/dist/skills/medical-imaging-review/references/MCP_SETUP.md +216 -0
- package/dist/skills/medical-imaging-review/references/PARADIGM.md +221 -0
- package/dist/skills/medical-imaging-review/references/QUALITY_CHECKLIST.md +169 -0
- package/dist/skills/medical-imaging-review/references/TEMPLATES.md +291 -0
- package/dist/skills/medical-imaging-review/references/WORKFLOW.md +289 -0
- package/dist/skills/mermaid-diagram/SKILL.md +379 -0
- package/dist/skills/meta-apply/SKILL.md +137 -0
- package/dist/skills/meta-optimize/SKILL.md +253 -0
- package/dist/skills/monitor-experiment/SKILL.md +98 -0
- package/dist/skills/novelty-check/SKILL.md +89 -0
- package/dist/skills/openalex/SKILL.md +228 -0
- package/dist/skills/overleaf-sync/SKILL.md +220 -0
- package/dist/skills/paper-claim-audit/SKILL.md +340 -0
- package/dist/skills/paper-compile/SKILL.md +253 -0
- package/dist/skills/paper-figure/SKILL.md +279 -0
- package/dist/skills/paper-illustration/SKILL.md +690 -0
- package/dist/skills/paper-illustration-image2/SKILL.md +383 -0
- package/dist/skills/paper-illustration-image2/scripts/paper_illustration_image2.py +255 -0
- package/dist/skills/paper-plan/SKILL.md +278 -0
- package/dist/skills/paper-poster/SKILL.md +19 -0
- package/dist/skills/paper-poster-html/DESIGN_FINAL.md +176 -0
- package/dist/skills/paper-poster-html/IMPLEMENTATION_CONVENTIONS.md +161 -0
- package/dist/skills/paper-poster-html/LICENSES/posterly-MIT.txt +21 -0
- package/dist/skills/paper-poster-html/NOTICE.md +57 -0
- package/dist/skills/paper-poster-html/SKILL.md +357 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/__init__.py +0 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/canvas.py +200 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/measure.py +588 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/polish.py +498 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/preflight.py +489 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/render.py +215 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/textutil.py +16 -0
- package/dist/skills/paper-poster-html/scripts/_posterly/verify_final.py +171 -0
- package/dist/skills/paper-poster-html/scripts/asset_check.py +897 -0
- package/dist/skills/paper-poster-html/scripts/extract_pdf_figures.py +666 -0
- package/dist/skills/paper-poster-html/scripts/poster_check.py +251 -0
- package/dist/skills/paper-poster-html/scripts/preprocess_figures.py +238 -0
- package/dist/skills/paper-poster-html/scripts/render_preview.py +217 -0
- package/dist/skills/paper-poster-html/scripts/run_gates.py +556 -0
- package/dist/skills/paper-poster-html/scripts/style_check.py +1324 -0
- package/dist/skills/paper-poster-html/templates/COMPONENTS.md +462 -0
- package/dist/skills/paper-poster-html/templates/landscape_4col.html +1032 -0
- package/dist/skills/paper-poster-html/templates/landscape_hero.html +1046 -0
- package/dist/skills/paper-poster-html/templates/portrait_2col.html +947 -0
- package/dist/skills/paper-poster-html/templates/tokens/acl.json +9 -0
- package/dist/skills/paper-poster-html/templates/tokens/cvpr.json +9 -0
- package/dist/skills/paper-poster-html/templates/tokens/generic.json +9 -0
- package/dist/skills/paper-poster-html/templates/tokens/iclr.json +9 -0
- package/dist/skills/paper-poster-html/templates/tokens/icml.json +9 -0
- package/dist/skills/paper-poster-html/templates/tokens/neurips.json +9 -0
- package/dist/skills/paper-slide-deck/SKILL.md +464 -0
- package/dist/skills/paper-slide-deck/references/analysis-framework.md +392 -0
- package/dist/skills/paper-slide-deck/references/base-prompt.md +70 -0
- package/dist/skills/paper-slide-deck/references/content-rules.md +95 -0
- package/dist/skills/paper-slide-deck/references/figure-container-template.md +177 -0
- package/dist/skills/paper-slide-deck/references/modification-guide.md +85 -0
- package/dist/skills/paper-slide-deck/references/outline-template.md +437 -0
- package/dist/skills/paper-slide-deck/references/styles/academic-paper.md +109 -0
- package/dist/skills/paper-slide-deck/references/styles/blueprint.md +67 -0
- package/dist/skills/paper-slide-deck/references/styles/bold-editorial.md +70 -0
- package/dist/skills/paper-slide-deck/references/styles/chalkboard.md +68 -0
- package/dist/skills/paper-slide-deck/references/styles/corporate.md +69 -0
- package/dist/skills/paper-slide-deck/references/styles/dark-atmospheric.md +69 -0
- package/dist/skills/paper-slide-deck/references/styles/editorial-infographic.md +73 -0
- package/dist/skills/paper-slide-deck/references/styles/fantasy-animation.md +69 -0
- package/dist/skills/paper-slide-deck/references/styles/intuition-machine.md +72 -0
- package/dist/skills/paper-slide-deck/references/styles/minimal.md +64 -0
- package/dist/skills/paper-slide-deck/references/styles/notion.md +69 -0
- package/dist/skills/paper-slide-deck/references/styles/pixel-art.md +67 -0
- package/dist/skills/paper-slide-deck/references/styles/scientific.md +73 -0
- package/dist/skills/paper-slide-deck/references/styles/sketch-notes.md +66 -0
- package/dist/skills/paper-slide-deck/references/styles/vector-illustration.md +72 -0
- package/dist/skills/paper-slide-deck/references/styles/vintage.md +73 -0
- package/dist/skills/paper-slide-deck/references/styles/watercolor.md +68 -0
- package/dist/skills/paper-slide-deck/scripts/apply-template.ts +282 -0
- package/dist/skills/paper-slide-deck/scripts/detect-figures.ts +283 -0
- package/dist/skills/paper-slide-deck/scripts/extract-figure.ts +140 -0
- package/dist/skills/paper-slide-deck/scripts/generate-slides.py +182 -0
- package/dist/skills/paper-slide-deck/scripts/merge-to-pdf.ts +116 -0
- package/dist/skills/paper-slide-deck/scripts/merge-to-pptx.ts +137 -0
- package/dist/skills/paper-slide-deck/scripts/package-lock.json +899 -0
- package/dist/skills/paper-slide-deck/scripts/package.json +8 -0
- package/dist/skills/paper-slides/SKILL.md +571 -0
- package/dist/skills/paper-talk/SKILL.md +381 -0
- package/dist/skills/paper-write/SKILL.md +411 -0
- package/dist/skills/paper-write/templates/IEEEtran.bst +2409 -0
- package/dist/skills/paper-write/templates/IEEEtran.cls +6347 -0
- package/dist/skills/paper-write/templates/aaai2026.bst +1493 -0
- package/dist/skills/paper-write/templates/aaai2026.sty +315 -0
- package/dist/skills/paper-write/templates/aaai2026.tex +952 -0
- package/dist/skills/paper-write/templates/acl.sty +312 -0
- package/dist/skills/paper-write/templates/acl2026.tex +377 -0
- package/dist/skills/paper-write/templates/acl_natbib.bst +1940 -0
- package/dist/skills/paper-write/templates/acm.bst +3081 -0
- package/dist/skills/paper-write/templates/acm_mm2026.tex +204 -0
- package/dist/skills/paper-write/templates/acmart.cls +3520 -0
- package/dist/skills/paper-write/templates/cvpr.bst +1448 -0
- package/dist/skills/paper-write/templates/cvpr.sty +508 -0
- package/dist/skills/paper-write/templates/cvpr2026.tex +63 -0
- package/dist/skills/paper-write/templates/iclr2026.tex +84 -0
- package/dist/skills/paper-write/templates/iclr2026_conference.bst +1440 -0
- package/dist/skills/paper-write/templates/iclr2026_conference.sty +246 -0
- package/dist/skills/paper-write/templates/icml2025.tex +87 -0
- package/dist/skills/paper-write/templates/icml2026.sty +767 -0
- package/dist/skills/paper-write/templates/icml2026.tex +662 -0
- package/dist/skills/paper-write/templates/ieee_conference.tex +89 -0
- package/dist/skills/paper-write/templates/ieee_journal.tex +93 -0
- package/dist/skills/paper-write/templates/math_commands.tex +48 -0
- package/dist/skills/paper-write/templates/neurips2025.tex +80 -0
- package/dist/skills/paper-write/templates/neurips2026.tex +493 -0
- package/dist/skills/paper-write/templates/neurips_2026.sty +437 -0
- package/dist/skills/paper-writing/SKILL.md +632 -0
- package/dist/skills/patent-novelty-check/SKILL.md +153 -0
- package/dist/skills/patent-pipeline/SKILL.md +344 -0
- package/dist/skills/patent-review/SKILL.md +202 -0
- package/dist/skills/pixel-art/SKILL.md +139 -0
- package/dist/skills/pre-submission-reviewer/SKILL.md +247 -0
- package/dist/skills/pre-submission-reviewer/references/forbidden-patterns.md +163 -0
- package/dist/skills/pre-submission-reviewer/references/grammar-rules.md +135 -0
- package/dist/skills/pre-submission-reviewer/references/latex-rules.md +158 -0
- package/dist/skills/pre-submission-reviewer/references/logic-and-structure.md +125 -0
- package/dist/skills/pre-submission-reviewer/references/section-guides.md +169 -0
- package/dist/skills/prior-art-search/SKILL.md +146 -0
- package/dist/skills/proof-checker/SKILL.md +499 -0
- package/dist/skills/proof-writer/SKILL.md +222 -0
- package/dist/skills/qzcli/SKILL.md +316 -0
- package/dist/skills/rebuttal/SKILL.md +304 -0
- package/dist/skills/render-html/SKILL.md +299 -0
- package/dist/skills/render-html/scripts/render_html.py +905 -0
- package/dist/skills/render-html/scripts/templates/academic.html +342 -0
- package/dist/skills/render-html/scripts/templates/dashboard.html +333 -0
- package/dist/skills/research-lit/SKILL.md +353 -0
- package/dist/skills/research-paper-writing/SKILL.md +99 -0
- package/dist/skills/research-paper-writing/agents/openai.yaml +4 -0
- package/dist/skills/research-paper-writing/references/abstract.md +102 -0
- package/dist/skills/research-paper-writing/references/conclusion.md +35 -0
- package/dist/skills/research-paper-writing/references/does-my-writing-flow-source.md +45 -0
- package/dist/skills/research-paper-writing/references/examples/abstract/template-a.md +21 -0
- package/dist/skills/research-paper-writing/references/examples/abstract/template-b.md +34 -0
- package/dist/skills/research-paper-writing/references/examples/abstract/template-c.md +28 -0
- package/dist/skills/research-paper-writing/references/examples/abstract-examples.md +13 -0
- package/dist/skills/research-paper-writing/references/examples/index.md +21 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/novel-task-challenge-decomposition.md +18 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/pipeline-not-recommended-abstract-only.md +30 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/pipeline-version-1-one-contribution-multi-advantages.md +30 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/pipeline-version-2-two-contributions.md +34 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/pipeline-version-3-new-module-on-existing-pipeline.md +18 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/pipeline-version-4-observation-driven.md +16 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/technical-challenge-version-1-existing-task.md +32 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/technical-challenge-version-2-existing-task-insight-backed-by-traditional.md +33 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/technical-challenge-version-3-novel-task.md +21 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/version-1-task-then-application.md +14 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/version-2-application-first.md +10 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/version-3-general-to-specific-setting.md +14 -0
- package/dist/skills/research-paper-writing/references/examples/introduction/version-4-open-with-challenge.md +20 -0
- package/dist/skills/research-paper-writing/references/examples/introduction-examples.md +25 -0
- package/dist/skills/research-paper-writing/references/examples/method/example-of-the-three-elements.md +67 -0
- package/dist/skills/research-paper-writing/references/examples/method/method-writing-common-issues-note.md +10 -0
- package/dist/skills/research-paper-writing/references/examples/method/module-design-instant-ngp.md +55 -0
- package/dist/skills/research-paper-writing/references/examples/method/module-motivation-patterns.md +15 -0
- package/dist/skills/research-paper-writing/references/examples/method/module-triad-neural-body.md +19 -0
- package/dist/skills/research-paper-writing/references/examples/method/neural-body-annotated-figure-text.md +66 -0
- package/dist/skills/research-paper-writing/references/examples/method/overview-template.md +30 -0
- package/dist/skills/research-paper-writing/references/examples/method/pre-writing-questions.md +17 -0
- package/dist/skills/research-paper-writing/references/examples/method/section-skeleton.md +9 -0
- package/dist/skills/research-paper-writing/references/examples/method-examples.md +24 -0
- package/dist/skills/research-paper-writing/references/experiments.md +102 -0
- package/dist/skills/research-paper-writing/references/introduction.md +408 -0
- package/dist/skills/research-paper-writing/references/method.md +196 -0
- package/dist/skills/research-paper-writing/references/paper-review.md +86 -0
- package/dist/skills/research-paper-writing/references/related-work.md +41 -0
- package/dist/skills/research-pipeline/SKILL.md +257 -0
- package/dist/skills/research-proposal/SKILL.md +573 -0
- package/dist/skills/research-proposal/assets/proposal_scaffold_en.md +323 -0
- package/dist/skills/research-proposal/assets/proposal_scaffold_zh.md +346 -0
- package/dist/skills/research-proposal/references/DOMAIN_TEMPLATES.md +518 -0
- package/dist/skills/research-proposal/references/LITERATURE_WORKFLOW.md +529 -0
- package/dist/skills/research-proposal/references/QUALITY_CHECKLIST.md +325 -0
- package/dist/skills/research-proposal/references/STRUCTURE_GUIDE.md +398 -0
- package/dist/skills/research-proposal/references/WRITING_STYLE_GUIDE.md +661 -0
- package/dist/skills/research-refine/SKILL.md +716 -0
- package/dist/skills/research-refine-pipeline/SKILL.md +186 -0
- package/dist/skills/research-review/SKILL.md +119 -0
- package/dist/skills/research-wiki/SKILL.md +373 -0
- package/dist/skills/resubmit-pipeline/SKILL.md +427 -0
- package/dist/skills/result-to-claim/SKILL.md +190 -0
- package/dist/skills/run-experiment/SKILL.md +227 -0
- package/dist/skills/scientific-figure-making/SKILL.md +38 -0
- package/dist/skills/scientific-figure-making/references/api.md +152 -0
- package/dist/skills/scientific-figure-making/references/common-patterns.md +74 -0
- package/dist/skills/scientific-figure-making/references/demos.md +30 -0
- package/dist/skills/scientific-figure-making/references/design-theory.md +138 -0
- package/dist/skills/scientific-figure-making/references/tutorials.md +135 -0
- package/dist/skills/semantic-scholar/SKILL.md +219 -0
- package/dist/skills/serverless-modal/SKILL.md +324 -0
- package/dist/skills/slides-polish/SKILL.md +563 -0
- package/dist/skills/specification-writing/SKILL.md +211 -0
- package/dist/skills/strategist/SKILL.md +670 -0
- package/dist/skills/strategist/references/quality_standards.md +336 -0
- package/dist/skills/strategist/references/search_strategy.md +459 -0
- package/dist/skills/strategist/scripts/evaluate_samples.py +300 -0
- package/dist/skills/strategist/scripts/gap_analysis.py +399 -0
- package/dist/skills/system-profile/SKILL.md +103 -0
- package/dist/skills/tech-paper-template/SKILL.md +192 -0
- package/dist/skills/tech-paper-template/references/consistency-checks.md +166 -0
- package/dist/skills/tech-paper-template/references/paper-types.md +127 -0
- package/dist/skills/tech-paper-template/references/thinking-template.md +194 -0
- package/dist/skills/tech-paper-template/references/worked-examples.md +124 -0
- package/dist/skills/training-check/SKILL.md +83 -0
- package/dist/skills/vast-gpu/SKILL.md +380 -0
- package/dist/skills/vibe-research-workflow/SKILL.md +189 -0
- package/dist/skills/vibe-research-workflow/references/behavior-guidelines.md +149 -0
- package/dist/skills/vibe-research-workflow/references/tool-selection.md +144 -0
- package/dist/skills/vibe-research-workflow/references/vibe-coding.md +154 -0
- package/dist/skills/vibe-research-workflow/references/vibe-figure.md +131 -0
- package/dist/skills/vibe-research-workflow/references/vibe-writing.md +181 -0
- package/dist/skills/wiki-enrich/SKILL.md +254 -0
- package/dist/skills/writing-systems-papers/SKILL.md +184 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* llm-wiki-agent 后端入口
|
|
3
|
+
*
|
|
4
|
+
* 阶段一 step 8 完整端点:
|
|
5
|
+
* GET /api/health 心跳
|
|
6
|
+
* POST /api/echo 诊断回显
|
|
7
|
+
* POST /api/prompt 发消息(SSE 回 agent 事件流)
|
|
8
|
+
*
|
|
9
|
+
* GET /api/knowledge-bases 列出所有已知知识库
|
|
10
|
+
* POST /api/knowledge-bases/external 登记外部库
|
|
11
|
+
* DELETE /api/knowledge-bases/external 取消登记
|
|
12
|
+
*
|
|
13
|
+
* GET /api/knowledge-base 当前活跃上下文(含 kb + conversation + messages)
|
|
14
|
+
* POST /api/knowledge-base 选择 KB(自动加载/新建对话)
|
|
15
|
+
* DELETE /api/knowledge-base 清空活跃上下文
|
|
16
|
+
*
|
|
17
|
+
* GET /api/conversations?kb=<path> 列出某 KB 下所有对话
|
|
18
|
+
* POST /api/conversations 切到指定对话 body: {kbPath, conversationId}
|
|
19
|
+
* POST /api/conversations/new 在指定 KB 新建对话 body: {kbPath}
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import { serve } from "@hono/node-server";
|
|
23
|
+
import { Hono } from "hono";
|
|
24
|
+
import { streamSSE } from "hono/streaming";
|
|
25
|
+
import { execFile } from "node:child_process";
|
|
26
|
+
import { readFile } from "node:fs/promises";
|
|
27
|
+
import { promisify } from "node:util";
|
|
28
|
+
|
|
29
|
+
import type { AgentSession } from "@earendil-works/pi-coding-agent";
|
|
30
|
+
|
|
31
|
+
import {
|
|
32
|
+
artifactEvents,
|
|
33
|
+
getArtifact,
|
|
34
|
+
isValidArtifactId,
|
|
35
|
+
listArtifacts,
|
|
36
|
+
resolveArtifactFile,
|
|
37
|
+
type ArtifactCreatedEvent,
|
|
38
|
+
} from "./artifacts.js";
|
|
39
|
+
import {
|
|
40
|
+
bootstrapFromConfig,
|
|
41
|
+
clearActive,
|
|
42
|
+
createNewConversation,
|
|
43
|
+
getActive,
|
|
44
|
+
getActiveSession,
|
|
45
|
+
listAvailableModels,
|
|
46
|
+
listLoadedSkills,
|
|
47
|
+
reloadActiveResources,
|
|
48
|
+
selectConversation,
|
|
49
|
+
selectKb,
|
|
50
|
+
} from "./agent.js";
|
|
51
|
+
import { getAuthStatus, setAuthKey, testAuthConnection } from "./auth.js";
|
|
52
|
+
import { type AppConfig, loadConfig, saveConfig } from "./config.js";
|
|
53
|
+
import { listConversations, piMessagesToUIMessages } from "./conversations.js";
|
|
54
|
+
import { runBatchDigest } from "./digest/batch.js";
|
|
55
|
+
import {
|
|
56
|
+
clearPendingKnowledgeContext,
|
|
57
|
+
setPendingKnowledgeContext,
|
|
58
|
+
} from "./extensions/knowledge-base.js";
|
|
59
|
+
import {
|
|
60
|
+
readGraphData,
|
|
61
|
+
readGraphLayout,
|
|
62
|
+
resumeGraphWatcher,
|
|
63
|
+
subscribeGraphEvents,
|
|
64
|
+
stopKnowledgeBaseGraphWatcher,
|
|
65
|
+
suspendGraphWatcher,
|
|
66
|
+
triggerGraphRebuild,
|
|
67
|
+
watchKnowledgeBaseGraph,
|
|
68
|
+
writeGraphLayout,
|
|
69
|
+
} from "./graph.js";
|
|
70
|
+
import {
|
|
71
|
+
inspectPath,
|
|
72
|
+
assertRegisteredKnowledgeBase,
|
|
73
|
+
listKnowledgeBases,
|
|
74
|
+
registerExternalKnowledgeBase,
|
|
75
|
+
unregisterExternalKnowledgeBase,
|
|
76
|
+
} from "./knowledge-bases.js";
|
|
77
|
+
import { listPageRefs, readWikiPage } from "./pages.js";
|
|
78
|
+
import {
|
|
79
|
+
buildKnowledgeContextMessage,
|
|
80
|
+
contextBudgetFromWindow,
|
|
81
|
+
parseExplicitPageRefs,
|
|
82
|
+
searchKnowledgeBase,
|
|
83
|
+
shouldUseKnowledgeBase,
|
|
84
|
+
writeRetrievalLog,
|
|
85
|
+
} from "./retrieval.js";
|
|
86
|
+
import {
|
|
87
|
+
OrderedSseWriter,
|
|
88
|
+
PromptRunRegistry,
|
|
89
|
+
ToolStatusEventAdapter,
|
|
90
|
+
} from "./tool-status-events.js";
|
|
91
|
+
import { createWiki, InitConflictError, initExistingWiki } from "./wiki-init.js";
|
|
92
|
+
|
|
93
|
+
const execFileAsync = promisify(execFile);
|
|
94
|
+
const promptRuns = new PromptRunRegistry();
|
|
95
|
+
|
|
96
|
+
/** 从 session 安全取出模型 provider+id(pi 类型未导出 Model,用结构化访问) */
|
|
97
|
+
function extractModelInfo(session: AgentSession): { provider: string; id: string } | null {
|
|
98
|
+
const model = (session.state as { model?: { provider?: unknown; id?: unknown } }).model;
|
|
99
|
+
if (
|
|
100
|
+
model &&
|
|
101
|
+
typeof model.provider === "string" &&
|
|
102
|
+
typeof model.id === "string"
|
|
103
|
+
) {
|
|
104
|
+
return { provider: model.provider, id: model.id };
|
|
105
|
+
}
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function extractContextWindow(session: AgentSession): number | undefined {
|
|
110
|
+
const model = (session.state as { model?: { contextWindow?: unknown } }).model;
|
|
111
|
+
return typeof model?.contextWindow === "number" ? model.contextWindow : undefined;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function normalizeRoleModelRef(raw: unknown): AppConfig["modelRoles"] extends infer Roles
|
|
115
|
+
? Roles extends { main?: infer Ref }
|
|
116
|
+
? Ref | undefined
|
|
117
|
+
: never
|
|
118
|
+
: never {
|
|
119
|
+
if (raw === null) return null;
|
|
120
|
+
if (typeof raw !== "object" || raw === undefined) return undefined;
|
|
121
|
+
const obj = raw as Record<string, unknown>;
|
|
122
|
+
if (typeof obj.provider !== "string" || typeof obj.modelId !== "string") return undefined;
|
|
123
|
+
if (!obj.provider.trim() || !obj.modelId.trim()) return undefined;
|
|
124
|
+
return { provider: obj.provider.trim(), modelId: obj.modelId.trim() };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function sameModelRef(a: unknown, b: unknown): boolean {
|
|
128
|
+
const left = normalizeRoleModelRef(a);
|
|
129
|
+
const right = normalizeRoleModelRef(b);
|
|
130
|
+
if (left === undefined && right === undefined) return true;
|
|
131
|
+
if (left === null || right === null) return left === right;
|
|
132
|
+
if (left === undefined || right === undefined) return false;
|
|
133
|
+
return left.provider === right.provider && left.modelId === right.modelId;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function requestedKnowledgeBasePath(queryValue: string | undefined, body?: unknown): string | null {
|
|
137
|
+
if (queryValue?.trim()) return queryValue.trim();
|
|
138
|
+
if (body && typeof body === "object") {
|
|
139
|
+
const bodyPath = (body as { kbPath?: unknown }).kbPath;
|
|
140
|
+
if (typeof bodyPath === "string" && bodyPath.trim()) return bodyPath.trim();
|
|
141
|
+
}
|
|
142
|
+
return getActive()?.kb.path ?? null;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async function requestedRegisteredKnowledgeBasePath(
|
|
146
|
+
queryValue: string | undefined,
|
|
147
|
+
body?: unknown,
|
|
148
|
+
): Promise<string | null> {
|
|
149
|
+
const requestedPath = requestedKnowledgeBasePath(queryValue, body);
|
|
150
|
+
if (!requestedPath) return null;
|
|
151
|
+
return assertRegisteredKnowledgeBase(requestedPath);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function errorStatus(err: unknown, fallback: 400 | 500 = 500): 400 | 403 | 500 {
|
|
155
|
+
const statusCode = (err as { statusCode?: unknown })?.statusCode;
|
|
156
|
+
if (statusCode === 403) return 403;
|
|
157
|
+
if (statusCode === 400) return 400;
|
|
158
|
+
return fallback;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function localHostOnly(rawHost: string | undefined): string {
|
|
162
|
+
const host = rawHost?.trim() || "127.0.0.1";
|
|
163
|
+
if (host === "127.0.0.1" || host === "localhost" || host === "::1") return host;
|
|
164
|
+
console.warn(`[llm-wiki-agent/server] ignoring unsafe HOST=${host}; binding to 127.0.0.1`);
|
|
165
|
+
return "127.0.0.1";
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const app = new Hono();
|
|
169
|
+
|
|
170
|
+
app.get("/api/health", (c) => {
|
|
171
|
+
return c.json({
|
|
172
|
+
status: "ok",
|
|
173
|
+
timestamp: Date.now(),
|
|
174
|
+
service: "llm-wiki-agent/server",
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
app.get("/api/events", (c) => {
|
|
179
|
+
return streamSSE(c, async (stream) => {
|
|
180
|
+
const unsubscribe = subscribeGraphEvents((event) => {
|
|
181
|
+
void stream.writeSSE({
|
|
182
|
+
event: event.type,
|
|
183
|
+
data: JSON.stringify(event),
|
|
184
|
+
}).catch(() => {
|
|
185
|
+
stream.abort();
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
stream.onAbort(unsubscribe);
|
|
189
|
+
await stream.writeSSE({
|
|
190
|
+
event: "ready",
|
|
191
|
+
data: JSON.stringify({ ok: true, timestamp: Date.now() }),
|
|
192
|
+
});
|
|
193
|
+
await new Promise<void>((resolve) => {
|
|
194
|
+
stream.onAbort(() => resolve());
|
|
195
|
+
});
|
|
196
|
+
unsubscribe();
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
app.post("/api/echo", async (c) => {
|
|
201
|
+
let body: unknown;
|
|
202
|
+
try {
|
|
203
|
+
body = await c.req.json();
|
|
204
|
+
} catch {
|
|
205
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
206
|
+
}
|
|
207
|
+
return c.json({ ok: true, received: body });
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
// ============= 知识库列表(库的管理) =============
|
|
211
|
+
|
|
212
|
+
app.get("/api/knowledge-bases", async (c) => {
|
|
213
|
+
try {
|
|
214
|
+
const items = await listKnowledgeBases();
|
|
215
|
+
return c.json({ ok: true, items });
|
|
216
|
+
} catch (err) {
|
|
217
|
+
return c.json(
|
|
218
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
219
|
+
500,
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
app.post("/api/knowledge-bases/external", async (c) => {
|
|
225
|
+
let body: { path?: unknown };
|
|
226
|
+
try {
|
|
227
|
+
body = await c.req.json();
|
|
228
|
+
} catch {
|
|
229
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
230
|
+
}
|
|
231
|
+
if (typeof body.path !== "string" || !body.path.trim()) {
|
|
232
|
+
return c.json({ ok: false, error: "Missing or empty 'path'" }, 400);
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
const result = await registerExternalKnowledgeBase(body.path);
|
|
236
|
+
return c.json({ ok: true, ...result });
|
|
237
|
+
} catch (err) {
|
|
238
|
+
return c.json(
|
|
239
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
240
|
+
400,
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
app.post("/api/knowledge-bases/inspect", async (c) => {
|
|
246
|
+
let body: { path?: unknown };
|
|
247
|
+
try {
|
|
248
|
+
body = await c.req.json();
|
|
249
|
+
} catch {
|
|
250
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
251
|
+
}
|
|
252
|
+
if (typeof body.path !== "string" || !body.path.trim()) {
|
|
253
|
+
return c.json({ ok: false, error: "Missing or empty 'path'" }, 400);
|
|
254
|
+
}
|
|
255
|
+
try {
|
|
256
|
+
return c.json({ ok: true, result: await inspectPath(body.path) });
|
|
257
|
+
} catch (err) {
|
|
258
|
+
const statusCode = (err as { statusCode?: number }).statusCode ?? 500;
|
|
259
|
+
return c.json(
|
|
260
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
261
|
+
statusCode === 403 ? 403 : 500,
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
app.delete("/api/knowledge-bases/external", async (c) => {
|
|
267
|
+
let body: { path?: unknown };
|
|
268
|
+
try {
|
|
269
|
+
body = await c.req.json();
|
|
270
|
+
} catch {
|
|
271
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
272
|
+
}
|
|
273
|
+
if (typeof body.path !== "string" || !body.path.trim()) {
|
|
274
|
+
return c.json({ ok: false, error: "Missing or empty 'path'" }, 400);
|
|
275
|
+
}
|
|
276
|
+
const result = await unregisterExternalKnowledgeBase(body.path);
|
|
277
|
+
return c.json({ ok: true, ...result });
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
app.post("/api/knowledge-bases/new", async (c) => {
|
|
281
|
+
let body: { name?: unknown; purpose?: unknown };
|
|
282
|
+
try {
|
|
283
|
+
body = await c.req.json();
|
|
284
|
+
} catch {
|
|
285
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
286
|
+
}
|
|
287
|
+
if (typeof body.name !== "string" || typeof body.purpose !== "string") {
|
|
288
|
+
return c.json({ ok: false, error: "Missing 'name' or 'purpose'" }, 400);
|
|
289
|
+
}
|
|
290
|
+
try {
|
|
291
|
+
const result = await createWiki(body.name, body.purpose);
|
|
292
|
+
return c.json({
|
|
293
|
+
ok: true,
|
|
294
|
+
info: {
|
|
295
|
+
path: result.path,
|
|
296
|
+
name: result.name,
|
|
297
|
+
origin: "default",
|
|
298
|
+
valid: true,
|
|
299
|
+
},
|
|
300
|
+
stdout: result.stdout,
|
|
301
|
+
stderr: result.stderr,
|
|
302
|
+
});
|
|
303
|
+
} catch (err) {
|
|
304
|
+
return c.json(
|
|
305
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
306
|
+
400,
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
app.post("/api/knowledge-bases/init-existing", async (c) => {
|
|
312
|
+
let body: { path?: unknown; purpose?: unknown; overwrite?: unknown };
|
|
313
|
+
try {
|
|
314
|
+
body = await c.req.json();
|
|
315
|
+
} catch {
|
|
316
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
317
|
+
}
|
|
318
|
+
if (typeof body.path !== "string" || typeof body.purpose !== "string") {
|
|
319
|
+
return c.json({ ok: false, error: "Missing 'path' or 'purpose'" }, 400);
|
|
320
|
+
}
|
|
321
|
+
try {
|
|
322
|
+
const result = await initExistingWiki(body.path, body.purpose, body.overwrite === true);
|
|
323
|
+
return c.json({
|
|
324
|
+
ok: true,
|
|
325
|
+
info: {
|
|
326
|
+
path: result.path,
|
|
327
|
+
name: result.path.split("/").filter(Boolean).pop() ?? result.path,
|
|
328
|
+
origin: "external",
|
|
329
|
+
valid: true,
|
|
330
|
+
},
|
|
331
|
+
stdout: result.stdout,
|
|
332
|
+
stderr: result.stderr,
|
|
333
|
+
backedUpFiles: result.backedUpFiles,
|
|
334
|
+
});
|
|
335
|
+
} catch (err) {
|
|
336
|
+
if (err instanceof InitConflictError) {
|
|
337
|
+
return c.json({ ok: false, error: err.message, conflicts: err.conflicts }, 409);
|
|
338
|
+
}
|
|
339
|
+
return c.json(
|
|
340
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
341
|
+
400,
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
// ============= 活跃上下文(当前选中的 KB + 对话) =============
|
|
347
|
+
|
|
348
|
+
app.get("/api/knowledge-base", async (c) => {
|
|
349
|
+
const ctx = getActive();
|
|
350
|
+
if (!ctx) return c.json({ ok: true, active: null });
|
|
351
|
+
return c.json({
|
|
352
|
+
ok: true,
|
|
353
|
+
active: {
|
|
354
|
+
kb: ctx.kb,
|
|
355
|
+
conversation: {
|
|
356
|
+
id: ctx.conversationId,
|
|
357
|
+
messages: piMessagesToUIMessages(ctx.session.state.messages),
|
|
358
|
+
},
|
|
359
|
+
model: extractModelInfo(ctx.session),
|
|
360
|
+
},
|
|
361
|
+
});
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
app.post("/api/knowledge-base", async (c) => {
|
|
365
|
+
let body: { path?: unknown };
|
|
366
|
+
try {
|
|
367
|
+
body = await c.req.json();
|
|
368
|
+
} catch {
|
|
369
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
370
|
+
}
|
|
371
|
+
if (typeof body.path !== "string" || !body.path.trim()) {
|
|
372
|
+
return c.json({ ok: false, error: "Missing or empty 'path'" }, 400);
|
|
373
|
+
}
|
|
374
|
+
try {
|
|
375
|
+
const ctx = await selectKb(body.path);
|
|
376
|
+
watchKnowledgeBaseGraph(ctx.kb.path);
|
|
377
|
+
return c.json({
|
|
378
|
+
ok: true,
|
|
379
|
+
active: {
|
|
380
|
+
kb: ctx.kb,
|
|
381
|
+
conversation: {
|
|
382
|
+
id: ctx.conversationId,
|
|
383
|
+
isNew: ctx.isNew,
|
|
384
|
+
messages: piMessagesToUIMessages(ctx.session.state.messages),
|
|
385
|
+
},
|
|
386
|
+
model: extractModelInfo(ctx.session),
|
|
387
|
+
},
|
|
388
|
+
});
|
|
389
|
+
} catch (err) {
|
|
390
|
+
return c.json(
|
|
391
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
392
|
+
400,
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
app.delete("/api/knowledge-base", async (c) => {
|
|
398
|
+
await clearActive();
|
|
399
|
+
stopKnowledgeBaseGraphWatcher();
|
|
400
|
+
return c.json({ ok: true });
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
// ============= 图谱(指定知识库;未传时回退当前知识库) =============
|
|
404
|
+
|
|
405
|
+
app.get("/api/graph", async (c) => {
|
|
406
|
+
try {
|
|
407
|
+
const kbPath = await requestedRegisteredKnowledgeBasePath(c.req.query("kb"));
|
|
408
|
+
if (!kbPath) return c.json({ ok: false, error: "请先选择一个知识库" }, 400);
|
|
409
|
+
return c.json(await readGraphData(kbPath));
|
|
410
|
+
} catch (err) {
|
|
411
|
+
return c.json(
|
|
412
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
413
|
+
errorStatus(err),
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
app.post("/api/graph/rebuild", async (c) => {
|
|
419
|
+
try {
|
|
420
|
+
const kbPath = await requestedRegisteredKnowledgeBasePath(c.req.query("kb"));
|
|
421
|
+
if (!kbPath) return c.json({ ok: false, error: "请先选择一个知识库" }, 400);
|
|
422
|
+
return c.json(triggerGraphRebuild(kbPath));
|
|
423
|
+
} catch (err) {
|
|
424
|
+
return c.json(
|
|
425
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
426
|
+
errorStatus(err),
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
app.get("/api/graph/layout", async (c) => {
|
|
432
|
+
try {
|
|
433
|
+
const kbPath = await requestedRegisteredKnowledgeBasePath(c.req.query("kb"));
|
|
434
|
+
if (!kbPath) return c.json({ ok: false, error: "请先选择一个知识库" }, 400);
|
|
435
|
+
return c.json(await readGraphLayout(kbPath));
|
|
436
|
+
} catch (err) {
|
|
437
|
+
return c.json(
|
|
438
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
439
|
+
errorStatus(err),
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
app.put("/api/graph/layout", async (c) => {
|
|
445
|
+
let body: unknown;
|
|
446
|
+
try {
|
|
447
|
+
body = await c.req.json();
|
|
448
|
+
} catch {
|
|
449
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
450
|
+
}
|
|
451
|
+
try {
|
|
452
|
+
const kbPath = await requestedRegisteredKnowledgeBasePath(c.req.query("kb"), body);
|
|
453
|
+
if (!kbPath) return c.json({ ok: false, error: "请先选择一个知识库" }, 400);
|
|
454
|
+
return c.json(await writeGraphLayout(kbPath, body));
|
|
455
|
+
} catch (err) {
|
|
456
|
+
return c.json(
|
|
457
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
458
|
+
errorStatus(err),
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
});
|
|
462
|
+
|
|
463
|
+
// ============= Wiki 页面引用候选 =============
|
|
464
|
+
|
|
465
|
+
app.get("/api/refs", async (c) => {
|
|
466
|
+
const kbPath = c.req.query("kb");
|
|
467
|
+
if (!kbPath) return c.json({ ok: false, error: "Missing query param 'kb'" }, 400);
|
|
468
|
+
const q = c.req.query("q") ?? "";
|
|
469
|
+
const rawLimit = Number(c.req.query("limit") ?? 20);
|
|
470
|
+
const limit = Number.isFinite(rawLimit) ? rawLimit : 20;
|
|
471
|
+
try {
|
|
472
|
+
const items = await listPageRefs(kbPath, q, limit);
|
|
473
|
+
return c.json({ ok: true, items });
|
|
474
|
+
} catch (err) {
|
|
475
|
+
return c.json(
|
|
476
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
477
|
+
400,
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
app.get("/api/page", async (c) => {
|
|
483
|
+
const kbPath = c.req.query("kb");
|
|
484
|
+
const relPath = c.req.query("path");
|
|
485
|
+
if (!kbPath || !relPath) {
|
|
486
|
+
return c.json({ ok: false, error: "Missing query params 'kb' or 'path'" }, 400);
|
|
487
|
+
}
|
|
488
|
+
try {
|
|
489
|
+
const content = await readWikiPage(kbPath, relPath);
|
|
490
|
+
return c.json({ ok: true, content });
|
|
491
|
+
} catch (err) {
|
|
492
|
+
return c.json(
|
|
493
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
494
|
+
400,
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
// ============= Slash 命令列表 =============
|
|
500
|
+
|
|
501
|
+
app.get("/api/commands", async (c) => {
|
|
502
|
+
try {
|
|
503
|
+
const queryValue = c.req.query("includeUserGlobal");
|
|
504
|
+
const includeUserGlobal =
|
|
505
|
+
queryValue === "true" ||
|
|
506
|
+
(queryValue === undefined && (await loadConfig()).showUserGlobalSkills === true);
|
|
507
|
+
const builtin = [
|
|
508
|
+
{
|
|
509
|
+
slug: "/sediment",
|
|
510
|
+
name: "sediment_to_wiki",
|
|
511
|
+
description: "把当前对话结晶为 wiki/synthesis/sessions/ 下的页面",
|
|
512
|
+
source: "builtin",
|
|
513
|
+
skillPath: null,
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
slug: "/new-wiki",
|
|
517
|
+
name: "new_wiki",
|
|
518
|
+
description: "在默认目录下新建一个 llm-wiki 知识库",
|
|
519
|
+
source: "builtin",
|
|
520
|
+
skillPath: null,
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
slug: "/html",
|
|
524
|
+
name: "html",
|
|
525
|
+
description: "把当前对话导出为自包含 HTML 页面",
|
|
526
|
+
source: "builtin",
|
|
527
|
+
skillPath: null,
|
|
528
|
+
},
|
|
529
|
+
];
|
|
530
|
+
const skills = (await listLoadedSkills())
|
|
531
|
+
.filter((skill) => includeUserGlobal || skill.source !== "user-global")
|
|
532
|
+
.map((skill) => ({
|
|
533
|
+
slug: `/${skill.name}`,
|
|
534
|
+
name: skill.name,
|
|
535
|
+
description: skill.description,
|
|
536
|
+
source: skill.source,
|
|
537
|
+
skillPath: skill.skillPath,
|
|
538
|
+
}));
|
|
539
|
+
return c.json({ ok: true, items: [...builtin, ...skills] });
|
|
540
|
+
} catch (err) {
|
|
541
|
+
return c.json(
|
|
542
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
543
|
+
500,
|
|
544
|
+
);
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
app.get("/api/config", async (c) => {
|
|
549
|
+
try {
|
|
550
|
+
return c.json({ ok: true, config: await loadConfig() });
|
|
551
|
+
} catch (err) {
|
|
552
|
+
return c.json(
|
|
553
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
554
|
+
500,
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
app.post("/api/config", async (c) => {
|
|
560
|
+
let body: {
|
|
561
|
+
showUserGlobalSkills?: unknown;
|
|
562
|
+
modelRoles?: unknown;
|
|
563
|
+
uiPrefs?: unknown;
|
|
564
|
+
};
|
|
565
|
+
try {
|
|
566
|
+
body = await c.req.json();
|
|
567
|
+
} catch {
|
|
568
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
569
|
+
}
|
|
570
|
+
try {
|
|
571
|
+
const current = await loadConfig();
|
|
572
|
+
const next: AppConfig = {
|
|
573
|
+
...current,
|
|
574
|
+
...(typeof body.showUserGlobalSkills === "boolean"
|
|
575
|
+
? { showUserGlobalSkills: body.showUserGlobalSkills }
|
|
576
|
+
: {}),
|
|
577
|
+
};
|
|
578
|
+
let mainRoleChanged = false;
|
|
579
|
+
if (typeof body.modelRoles === "object" && body.modelRoles !== null) {
|
|
580
|
+
const roles = body.modelRoles as Record<string, unknown>;
|
|
581
|
+
const nextMain = normalizeRoleModelRef(roles.main);
|
|
582
|
+
const nextDigest = normalizeRoleModelRef(roles.digest);
|
|
583
|
+
mainRoleChanged = nextMain !== undefined && !sameModelRef(current.modelRoles?.main, nextMain);
|
|
584
|
+
next.modelRoles = {
|
|
585
|
+
...(current.modelRoles ?? {}),
|
|
586
|
+
...(nextMain !== undefined ? { main: nextMain } : {}),
|
|
587
|
+
...(nextDigest !== undefined ? { digest: nextDigest } : {}),
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
if (typeof body.uiPrefs === "object" && body.uiPrefs !== null) {
|
|
591
|
+
const prefs = body.uiPrefs as Record<string, unknown>;
|
|
592
|
+
next.uiPrefs = {
|
|
593
|
+
...(current.uiPrefs ?? {}),
|
|
594
|
+
...(Array.isArray(prefs.sidebarExpandedKbs)
|
|
595
|
+
? {
|
|
596
|
+
sidebarExpandedKbs: prefs.sidebarExpandedKbs.filter(
|
|
597
|
+
(value): value is string => typeof value === "string",
|
|
598
|
+
),
|
|
599
|
+
}
|
|
600
|
+
: {}),
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
await saveConfig(next);
|
|
604
|
+
if (
|
|
605
|
+
(typeof body.showUserGlobalSkills === "boolean" &&
|
|
606
|
+
body.showUserGlobalSkills !== current.showUserGlobalSkills) ||
|
|
607
|
+
mainRoleChanged
|
|
608
|
+
) {
|
|
609
|
+
await reloadActiveResources();
|
|
610
|
+
}
|
|
611
|
+
return c.json({ ok: true, config: next });
|
|
612
|
+
} catch (err) {
|
|
613
|
+
return c.json(
|
|
614
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
615
|
+
500,
|
|
616
|
+
);
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
app.get("/api/models", async (c) => {
|
|
621
|
+
try {
|
|
622
|
+
return c.json({ ok: true, items: listAvailableModels() });
|
|
623
|
+
} catch (err) {
|
|
624
|
+
return c.json(
|
|
625
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
626
|
+
500,
|
|
627
|
+
);
|
|
628
|
+
}
|
|
629
|
+
});
|
|
630
|
+
|
|
631
|
+
app.post("/api/system/choose-directory", async (c) => {
|
|
632
|
+
if (process.platform !== "darwin") {
|
|
633
|
+
return c.json({ ok: false, error: "当前系统暂不支持文件夹选择器" }, 501);
|
|
634
|
+
}
|
|
635
|
+
try {
|
|
636
|
+
const { stdout } = await execFileAsync("osascript", [
|
|
637
|
+
"-e",
|
|
638
|
+
'POSIX path of (choose folder with prompt "选择知识库文件夹")',
|
|
639
|
+
]);
|
|
640
|
+
const selectedPath = stdout.trim();
|
|
641
|
+
if (!selectedPath) return c.json({ ok: false, error: "没有选择文件夹" }, 400);
|
|
642
|
+
return c.json({ ok: true, path: selectedPath });
|
|
643
|
+
} catch (err) {
|
|
644
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
645
|
+
if (message.includes("-128") || message.toLowerCase().includes("user canceled")) {
|
|
646
|
+
return c.json({ ok: false, canceled: true });
|
|
647
|
+
}
|
|
648
|
+
return c.json({ ok: false, error: message }, 500);
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
app.post("/api/knowledge-bases/batch-digest", async (c) => {
|
|
653
|
+
let body: {
|
|
654
|
+
kbPath?: unknown;
|
|
655
|
+
filePaths?: unknown;
|
|
656
|
+
concurrency?: unknown;
|
|
657
|
+
sourceScanId?: unknown;
|
|
658
|
+
digestModel?: unknown;
|
|
659
|
+
};
|
|
660
|
+
try {
|
|
661
|
+
body = await c.req.json();
|
|
662
|
+
} catch {
|
|
663
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
664
|
+
}
|
|
665
|
+
if (typeof body.kbPath !== "string") {
|
|
666
|
+
return c.json({ ok: false, error: "Missing 'kbPath'" }, 400);
|
|
667
|
+
}
|
|
668
|
+
if (!Array.isArray(body.filePaths) || !body.filePaths.every((item) => typeof item === "string")) {
|
|
669
|
+
return c.json({ ok: false, error: "Missing or invalid 'filePaths'" }, 400);
|
|
670
|
+
}
|
|
671
|
+
const concurrency = body.concurrency === undefined ? 3 : Number(body.concurrency);
|
|
672
|
+
if (![1, 3, 5].includes(concurrency)) {
|
|
673
|
+
return c.json({ ok: false, error: "concurrency 只能是 1、3 或 5" }, 400);
|
|
674
|
+
}
|
|
675
|
+
const sourceScanId = typeof body.sourceScanId === "string" ? body.sourceScanId : undefined;
|
|
676
|
+
const digestModel =
|
|
677
|
+
typeof body.digestModel === "object" &&
|
|
678
|
+
body.digestModel !== null &&
|
|
679
|
+
typeof (body.digestModel as { provider?: unknown }).provider === "string" &&
|
|
680
|
+
typeof (body.digestModel as { modelId?: unknown }).modelId === "string"
|
|
681
|
+
? {
|
|
682
|
+
provider: (body.digestModel as { provider: string }).provider,
|
|
683
|
+
modelId: (body.digestModel as { modelId: string }).modelId,
|
|
684
|
+
}
|
|
685
|
+
: null;
|
|
686
|
+
|
|
687
|
+
return streamSSE(c, async (stream) => {
|
|
688
|
+
suspendGraphWatcher(body.kbPath as string);
|
|
689
|
+
let completed = false;
|
|
690
|
+
try {
|
|
691
|
+
await runBatchDigest(
|
|
692
|
+
{
|
|
693
|
+
kbPath: body.kbPath as string,
|
|
694
|
+
filePaths: body.filePaths as string[],
|
|
695
|
+
concurrency,
|
|
696
|
+
...(sourceScanId ? { sourceScanId } : {}),
|
|
697
|
+
...(digestModel ? { digestModel } : {}),
|
|
698
|
+
},
|
|
699
|
+
async (event) => {
|
|
700
|
+
await stream.writeSSE({
|
|
701
|
+
event: event.type,
|
|
702
|
+
data: JSON.stringify(event),
|
|
703
|
+
});
|
|
704
|
+
},
|
|
705
|
+
);
|
|
706
|
+
completed = true;
|
|
707
|
+
} catch (err) {
|
|
708
|
+
await stream.writeSSE({
|
|
709
|
+
event: "error",
|
|
710
|
+
data: JSON.stringify({ message: err instanceof Error ? err.message : String(err) }),
|
|
711
|
+
});
|
|
712
|
+
} finally {
|
|
713
|
+
resumeGraphWatcher(body.kbPath as string, { trigger: completed });
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
});
|
|
717
|
+
|
|
718
|
+
// ============= 产物 Artifacts =============
|
|
719
|
+
|
|
720
|
+
app.get("/api/artifacts", (c) => {
|
|
721
|
+
const conversationId = c.req.query("conversation");
|
|
722
|
+
return c.json({ ok: true, items: listArtifacts(conversationId) });
|
|
723
|
+
});
|
|
724
|
+
|
|
725
|
+
app.get("/api/artifacts/:id", (c) => {
|
|
726
|
+
const id = c.req.param("id");
|
|
727
|
+
if (!isValidArtifactId(id)) {
|
|
728
|
+
return c.json({ ok: false, error: "Invalid artifact id" }, 400);
|
|
729
|
+
}
|
|
730
|
+
const manifest = getArtifact(id);
|
|
731
|
+
if (!manifest) return c.json({ ok: false, error: "Artifact not found" }, 404);
|
|
732
|
+
return c.json({ ok: true, manifest });
|
|
733
|
+
});
|
|
734
|
+
|
|
735
|
+
app.get("/api/artifacts/:id/files/:filename", async (c) => {
|
|
736
|
+
const id = c.req.param("id");
|
|
737
|
+
const filename = c.req.param("filename");
|
|
738
|
+
if (!isValidArtifactId(id)) {
|
|
739
|
+
return c.json({ ok: false, error: "Invalid artifact id" }, 400);
|
|
740
|
+
}
|
|
741
|
+
try {
|
|
742
|
+
const file = resolveArtifactFile(id, filename);
|
|
743
|
+
const body = await readFile(file.path);
|
|
744
|
+
return new Response(body, {
|
|
745
|
+
headers: {
|
|
746
|
+
"Content-Type": file.mimeType,
|
|
747
|
+
"Content-Length": String(file.sizeBytes),
|
|
748
|
+
"Content-Disposition": `attachment; filename="${encodeURIComponent(filename)}"`,
|
|
749
|
+
},
|
|
750
|
+
});
|
|
751
|
+
} catch (err) {
|
|
752
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
753
|
+
const status = message.includes("不存在") || message.includes("不在 manifest") ? 404 : 400;
|
|
754
|
+
return c.json({ ok: false, error: message }, status);
|
|
755
|
+
}
|
|
756
|
+
});
|
|
757
|
+
|
|
758
|
+
// ============= 模型认证 =============
|
|
759
|
+
|
|
760
|
+
app.get("/api/auth/status", async (c) => {
|
|
761
|
+
try {
|
|
762
|
+
return c.json({ ok: true, ...(await getAuthStatus()) });
|
|
763
|
+
} catch (err) {
|
|
764
|
+
return c.json(
|
|
765
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
766
|
+
500,
|
|
767
|
+
);
|
|
768
|
+
}
|
|
769
|
+
});
|
|
770
|
+
|
|
771
|
+
app.post("/api/auth/set", async (c) => {
|
|
772
|
+
let body: { provider?: unknown; type?: unknown; key?: unknown };
|
|
773
|
+
try {
|
|
774
|
+
body = await c.req.json();
|
|
775
|
+
} catch {
|
|
776
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
777
|
+
}
|
|
778
|
+
if (body.type !== "api_key" || typeof body.provider !== "string" || typeof body.key !== "string") {
|
|
779
|
+
return c.json({ ok: false, error: "Missing provider/type/key" }, 400);
|
|
780
|
+
}
|
|
781
|
+
try {
|
|
782
|
+
await setAuthKey(body.provider, body.key);
|
|
783
|
+
return c.json({ ok: true });
|
|
784
|
+
} catch (err) {
|
|
785
|
+
return c.json(
|
|
786
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
787
|
+
400,
|
|
788
|
+
);
|
|
789
|
+
}
|
|
790
|
+
});
|
|
791
|
+
|
|
792
|
+
app.post("/api/auth/test", async (c) => {
|
|
793
|
+
let body: { provider?: unknown };
|
|
794
|
+
try {
|
|
795
|
+
body = await c.req.json();
|
|
796
|
+
} catch {
|
|
797
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
798
|
+
}
|
|
799
|
+
if (typeof body.provider !== "string") {
|
|
800
|
+
return c.json({ ok: false, error: "Missing provider" }, 400);
|
|
801
|
+
}
|
|
802
|
+
const result = await testAuthConnection(body.provider);
|
|
803
|
+
return c.json(result);
|
|
804
|
+
});
|
|
805
|
+
|
|
806
|
+
// ============= 对话列表与切换 =============
|
|
807
|
+
|
|
808
|
+
app.get("/api/conversations", async (c) => {
|
|
809
|
+
const kbPath = c.req.query("kb");
|
|
810
|
+
if (!kbPath) {
|
|
811
|
+
return c.json({ ok: false, error: "Missing query param 'kb'" }, 400);
|
|
812
|
+
}
|
|
813
|
+
try {
|
|
814
|
+
const items = await listConversations(kbPath);
|
|
815
|
+
// 新建后未发消息的活跃对话,pi 不会写盘 → list 不含 → UI 找不到。
|
|
816
|
+
// 这里前置一个合成 stub 让 UI 看得到。
|
|
817
|
+
const ctx = getActive();
|
|
818
|
+
if (
|
|
819
|
+
ctx &&
|
|
820
|
+
ctx.kb.path === kbPath &&
|
|
821
|
+
!items.some((i) => i.id === ctx.conversationId)
|
|
822
|
+
) {
|
|
823
|
+
items.unshift({
|
|
824
|
+
id: ctx.conversationId,
|
|
825
|
+
path: "",
|
|
826
|
+
firstMessage: "(新对话)",
|
|
827
|
+
modifiedAt: Date.now(),
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
return c.json({ ok: true, items });
|
|
831
|
+
} catch (err) {
|
|
832
|
+
return c.json(
|
|
833
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
834
|
+
500,
|
|
835
|
+
);
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
|
|
839
|
+
app.post("/api/conversations", async (c) => {
|
|
840
|
+
let body: { kbPath?: unknown; conversationId?: unknown };
|
|
841
|
+
try {
|
|
842
|
+
body = await c.req.json();
|
|
843
|
+
} catch {
|
|
844
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
845
|
+
}
|
|
846
|
+
if (typeof body.kbPath !== "string" || typeof body.conversationId !== "string") {
|
|
847
|
+
return c.json({ ok: false, error: "Missing 'kbPath' or 'conversationId'" }, 400);
|
|
848
|
+
}
|
|
849
|
+
try {
|
|
850
|
+
const ctx = await selectConversation(body.kbPath, body.conversationId);
|
|
851
|
+
watchKnowledgeBaseGraph(ctx.kb.path);
|
|
852
|
+
return c.json({
|
|
853
|
+
ok: true,
|
|
854
|
+
active: {
|
|
855
|
+
kb: ctx.kb,
|
|
856
|
+
conversation: {
|
|
857
|
+
id: ctx.conversationId,
|
|
858
|
+
isNew: false,
|
|
859
|
+
messages: piMessagesToUIMessages(ctx.session.state.messages),
|
|
860
|
+
},
|
|
861
|
+
model: extractModelInfo(ctx.session),
|
|
862
|
+
},
|
|
863
|
+
});
|
|
864
|
+
} catch (err) {
|
|
865
|
+
return c.json(
|
|
866
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
867
|
+
400,
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
|
|
872
|
+
app.post("/api/conversations/new", async (c) => {
|
|
873
|
+
let body: { kbPath?: unknown };
|
|
874
|
+
try {
|
|
875
|
+
body = await c.req.json();
|
|
876
|
+
} catch {
|
|
877
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
878
|
+
}
|
|
879
|
+
if (typeof body.kbPath !== "string") {
|
|
880
|
+
return c.json({ ok: false, error: "Missing 'kbPath'" }, 400);
|
|
881
|
+
}
|
|
882
|
+
try {
|
|
883
|
+
const ctx = await createNewConversation(body.kbPath);
|
|
884
|
+
watchKnowledgeBaseGraph(ctx.kb.path);
|
|
885
|
+
return c.json({
|
|
886
|
+
ok: true,
|
|
887
|
+
active: {
|
|
888
|
+
kb: ctx.kb,
|
|
889
|
+
conversation: { id: ctx.conversationId, isNew: true, messages: [] },
|
|
890
|
+
model: extractModelInfo(ctx.session),
|
|
891
|
+
},
|
|
892
|
+
});
|
|
893
|
+
} catch (err) {
|
|
894
|
+
return c.json(
|
|
895
|
+
{ ok: false, error: err instanceof Error ? err.message : String(err) },
|
|
896
|
+
400,
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
|
|
901
|
+
// ============= Prompt(agent 事件流) =============
|
|
902
|
+
|
|
903
|
+
app.post("/api/prompt", async (c) => {
|
|
904
|
+
let body: { message?: unknown };
|
|
905
|
+
try {
|
|
906
|
+
body = await c.req.json();
|
|
907
|
+
} catch {
|
|
908
|
+
return c.json({ ok: false, error: "Invalid JSON body" }, 400);
|
|
909
|
+
}
|
|
910
|
+
const message = body.message;
|
|
911
|
+
if (typeof message !== "string" || !message.trim()) {
|
|
912
|
+
return c.json({ ok: false, error: "Missing or empty 'message'" }, 400);
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
return streamSSE(c, async (stream) => {
|
|
916
|
+
let session;
|
|
917
|
+
let activeForRun;
|
|
918
|
+
try {
|
|
919
|
+
session = await getActiveSession();
|
|
920
|
+
activeForRun = getActive();
|
|
921
|
+
} catch (err) {
|
|
922
|
+
clearPendingKnowledgeContext();
|
|
923
|
+
const adapter = new ToolStatusEventAdapter({
|
|
924
|
+
runId: "unavailable",
|
|
925
|
+
messageId: "unavailable",
|
|
926
|
+
});
|
|
927
|
+
const errorEvent = adapter.failAssistant(err)[0] ?? {
|
|
928
|
+
schemaVersion: 1 as const,
|
|
929
|
+
type: "assistant_error" as const,
|
|
930
|
+
runId: "unavailable",
|
|
931
|
+
messageId: "unavailable",
|
|
932
|
+
seq: 1,
|
|
933
|
+
error: err instanceof Error ? err.message : String(err),
|
|
934
|
+
};
|
|
935
|
+
await stream.writeSSE({
|
|
936
|
+
event: errorEvent.type,
|
|
937
|
+
data: JSON.stringify({ ...errorEvent, hint: "请先在侧栏选择一个知识库" }),
|
|
938
|
+
});
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
const runId = `run-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
|
|
943
|
+
const messageId = `assistant-${runId}`;
|
|
944
|
+
const sessionId = activeForRun?.conversationId ?? "active-session";
|
|
945
|
+
if (!promptRuns.begin(sessionId, runId)) {
|
|
946
|
+
await stream.writeSSE({
|
|
947
|
+
event: "assistant_error",
|
|
948
|
+
data: JSON.stringify({
|
|
949
|
+
schemaVersion: 1,
|
|
950
|
+
runId,
|
|
951
|
+
messageId,
|
|
952
|
+
seq: 1,
|
|
953
|
+
type: "assistant_error",
|
|
954
|
+
error: "当前对话正在生成,请等待上一条回复完成。",
|
|
955
|
+
}),
|
|
956
|
+
});
|
|
957
|
+
return;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
let aborted = false;
|
|
961
|
+
let streamOpen = true;
|
|
962
|
+
let responseFinished = false;
|
|
963
|
+
const adapter = new ToolStatusEventAdapter({ runId, messageId });
|
|
964
|
+
const writer = new OrderedSseWriter(async ({ event, data }) => {
|
|
965
|
+
if (!streamOpen) return;
|
|
966
|
+
await stream.writeSSE({ event, data });
|
|
967
|
+
});
|
|
968
|
+
const unsubscribe = session.subscribe(async (event) => {
|
|
969
|
+
try {
|
|
970
|
+
for (const contractEvent of adapter.adapt(event)) {
|
|
971
|
+
await writer.writeContract(contractEvent);
|
|
972
|
+
}
|
|
973
|
+
} catch {
|
|
974
|
+
streamOpen = false;
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
const onArtifactCreated = async (event: ArtifactCreatedEvent) => {
|
|
978
|
+
if (event.conversationId !== getActive()?.conversationId) return;
|
|
979
|
+
try {
|
|
980
|
+
await writer.writeNamed("artifact_created", {
|
|
981
|
+
id: event.id,
|
|
982
|
+
kind: event.kind,
|
|
983
|
+
title: event.title,
|
|
984
|
+
});
|
|
985
|
+
} catch {
|
|
986
|
+
streamOpen = false;
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
artifactEvents.on("artifact_created", onArtifactCreated);
|
|
990
|
+
stream.onAbort(() => {
|
|
991
|
+
aborted = true;
|
|
992
|
+
streamOpen = false;
|
|
993
|
+
writer.close();
|
|
994
|
+
clearPendingKnowledgeContext();
|
|
995
|
+
if (!responseFinished) session.abort?.();
|
|
996
|
+
});
|
|
997
|
+
|
|
998
|
+
try {
|
|
999
|
+
const active = getActive();
|
|
1000
|
+
const explicitRefs = parseExplicitPageRefs(message);
|
|
1001
|
+
const shouldSearch = shouldUseKnowledgeBase(message, Boolean(active));
|
|
1002
|
+
if (active) {
|
|
1003
|
+
const baseLog = {
|
|
1004
|
+
ts: Date.now(),
|
|
1005
|
+
sessionId: active.conversationId,
|
|
1006
|
+
kbPath: active.kb.path,
|
|
1007
|
+
messagePreview: message.slice(0, 120),
|
|
1008
|
+
explicitRefs,
|
|
1009
|
+
};
|
|
1010
|
+
if (shouldSearch) {
|
|
1011
|
+
const toolCallId = `${runId}-knowledge-search`;
|
|
1012
|
+
await writer.writeContract(adapter.startTool({
|
|
1013
|
+
toolCallId,
|
|
1014
|
+
toolName: "knowledge_search",
|
|
1015
|
+
args: {
|
|
1016
|
+
query: message,
|
|
1017
|
+
path: active.kb.path,
|
|
1018
|
+
},
|
|
1019
|
+
}));
|
|
1020
|
+
await writer.writeContract(adapter.updateTool({
|
|
1021
|
+
toolCallId,
|
|
1022
|
+
toolName: "knowledge_search",
|
|
1023
|
+
args: {
|
|
1024
|
+
query: message,
|
|
1025
|
+
path: active.kb.path,
|
|
1026
|
+
},
|
|
1027
|
+
partialResult: { summary: "正在检索当前知识库" },
|
|
1028
|
+
}));
|
|
1029
|
+
try {
|
|
1030
|
+
const search = await searchKnowledgeBase(active.kb.path, message, {
|
|
1031
|
+
explicitRefs,
|
|
1032
|
+
totalBudgetChars: contextBudgetFromWindow(extractContextWindow(session)),
|
|
1033
|
+
});
|
|
1034
|
+
const knowledgeContext = buildKnowledgeContextMessage({
|
|
1035
|
+
kb: active.kb,
|
|
1036
|
+
search,
|
|
1037
|
+
});
|
|
1038
|
+
setPendingKnowledgeContext(knowledgeContext);
|
|
1039
|
+
const payload = {
|
|
1040
|
+
count: search.results.length,
|
|
1041
|
+
paths: search.results.map((result) => result.path),
|
|
1042
|
+
};
|
|
1043
|
+
await writer.writeContract(adapter.endTool({
|
|
1044
|
+
toolCallId,
|
|
1045
|
+
toolName: "knowledge_search",
|
|
1046
|
+
result: {
|
|
1047
|
+
summary:
|
|
1048
|
+
search.results.length > 0
|
|
1049
|
+
? `已检索到 ${search.results.length} 个相关页面`
|
|
1050
|
+
: "当前知识库未找到相关页面",
|
|
1051
|
+
...payload,
|
|
1052
|
+
},
|
|
1053
|
+
}));
|
|
1054
|
+
await writeRetrievalLog({
|
|
1055
|
+
...baseLog,
|
|
1056
|
+
triggered: true,
|
|
1057
|
+
results: search.results.map((result) => ({
|
|
1058
|
+
path: result.path,
|
|
1059
|
+
hitReason: result.hitReason,
|
|
1060
|
+
score: result.score,
|
|
1061
|
+
})),
|
|
1062
|
+
wrappedCharCount: message.length + knowledgeContext.length,
|
|
1063
|
+
error: null,
|
|
1064
|
+
}).catch(() => {});
|
|
1065
|
+
} catch (err) {
|
|
1066
|
+
const error = err instanceof Error ? err.stack ?? err.message : String(err);
|
|
1067
|
+
await writer.writeContract(adapter.endTool({
|
|
1068
|
+
toolCallId,
|
|
1069
|
+
toolName: "knowledge_search",
|
|
1070
|
+
result: {
|
|
1071
|
+
error: err instanceof Error ? err.message : String(err),
|
|
1072
|
+
},
|
|
1073
|
+
isError: true,
|
|
1074
|
+
}));
|
|
1075
|
+
await writeRetrievalLog({
|
|
1076
|
+
...baseLog,
|
|
1077
|
+
triggered: true,
|
|
1078
|
+
results: [],
|
|
1079
|
+
wrappedCharCount: 0,
|
|
1080
|
+
error,
|
|
1081
|
+
}).catch(() => {});
|
|
1082
|
+
}
|
|
1083
|
+
} else {
|
|
1084
|
+
await writeRetrievalLog({
|
|
1085
|
+
...baseLog,
|
|
1086
|
+
triggered: false,
|
|
1087
|
+
results: [],
|
|
1088
|
+
wrappedCharCount: 0,
|
|
1089
|
+
error: null,
|
|
1090
|
+
}).catch(() => {});
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
await session.prompt(message);
|
|
1094
|
+
responseFinished = true;
|
|
1095
|
+
for (const event of adapter.finishAssistant()) {
|
|
1096
|
+
await writer.writeContract(event);
|
|
1097
|
+
}
|
|
1098
|
+
await writer.flush();
|
|
1099
|
+
} catch (err) {
|
|
1100
|
+
if (aborted) {
|
|
1101
|
+
for (const event of adapter.cancelAssistant("client disconnected")) {
|
|
1102
|
+
await writer.writeContract(event);
|
|
1103
|
+
}
|
|
1104
|
+
} else {
|
|
1105
|
+
for (const event of adapter.failAssistant(err)) {
|
|
1106
|
+
await writer.writeContract(event);
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
await writer.flush();
|
|
1110
|
+
} finally {
|
|
1111
|
+
clearPendingKnowledgeContext();
|
|
1112
|
+
unsubscribe();
|
|
1113
|
+
artifactEvents.off("artifact_created", onArtifactCreated);
|
|
1114
|
+
promptRuns.end(sessionId, runId);
|
|
1115
|
+
writer.close();
|
|
1116
|
+
}
|
|
1117
|
+
});
|
|
1118
|
+
});
|
|
1119
|
+
|
|
1120
|
+
const PORT = Number(process.env.PORT ?? 8787);
|
|
1121
|
+
const HOST = localHostOnly(process.env.HOST);
|
|
1122
|
+
|
|
1123
|
+
// 阻塞启动直到 bootstrap 完成。首次启动约 1-2s(pi ResourceLoader + 恢复 session),
|
|
1124
|
+
// 换来前端首次 fetch 一致性。dev 模式 tsx watch 重启也会经历此延迟,可接受。
|
|
1125
|
+
await bootstrapFromConfig();
|
|
1126
|
+
const bootstrappedActive = getActive();
|
|
1127
|
+
if (bootstrappedActive) watchKnowledgeBaseGraph(bootstrappedActive.kb.path);
|
|
1128
|
+
|
|
1129
|
+
serve({ fetch: app.fetch, port: PORT, hostname: HOST }, (info) => {
|
|
1130
|
+
console.log(`[llm-wiki-agent/server] listening on http://${HOST}:${info.port}`);
|
|
1131
|
+
console.log(` GET /api/health`);
|
|
1132
|
+
console.log(` POST /api/echo`);
|
|
1133
|
+
console.log(` POST /api/prompt`);
|
|
1134
|
+
console.log(` GET /api/knowledge-bases`);
|
|
1135
|
+
console.log(` POST /api/knowledge-bases/external`);
|
|
1136
|
+
console.log(` DELETE /api/knowledge-bases/external`);
|
|
1137
|
+
console.log(` GET /api/knowledge-base`);
|
|
1138
|
+
console.log(` POST /api/knowledge-base`);
|
|
1139
|
+
console.log(` DELETE /api/knowledge-base`);
|
|
1140
|
+
console.log(` GET /api/conversations?kb=<path>`);
|
|
1141
|
+
console.log(` POST /api/conversations`);
|
|
1142
|
+
console.log(` POST /api/conversations/new`);
|
|
1143
|
+
console.log(` GET /api/artifacts?conversation=<id>`);
|
|
1144
|
+
console.log(` GET /api/artifacts/:id`);
|
|
1145
|
+
console.log(` GET /api/artifacts/:id/files/:filename`);
|
|
1146
|
+
console.log(` GET /api/config`);
|
|
1147
|
+
console.log(` POST /api/config`);
|
|
1148
|
+
});
|