qiongli 1.13.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/package.json +1 -1
  2. package/payload/plugins/claude/qiongli/.claude-plugin/plugin.json +1 -1
  3. package/payload/plugins/claude/qiongli/.codex-plugin/plugin.json +1 -1
  4. package/payload/plugins/claude/qiongli/mcp/qiongli-literature-provider/index.mjs +94 -1
  5. package/payload/plugins/claude/qiongli/mcp/qiongli-literature-provider/search-plan.mjs +359 -0
  6. package/payload/plugins/claude/qiongli/skills/qiongli-academic-present/SKILL.md +16 -0
  7. package/payload/plugins/claude/qiongli/skills/qiongli-academic-write/SKILL.md +16 -0
  8. package/payload/plugins/claude/qiongli/skills/qiongli-build-framework/SKILL.md +16 -0
  9. package/payload/plugins/claude/qiongli/skills/qiongli-code-build/SKILL.md +16 -0
  10. package/payload/plugins/claude/qiongli/skills/qiongli-compliance-check/SKILL.md +16 -0
  11. package/payload/plugins/claude/qiongli/skills/qiongli-ethics-check/SKILL.md +16 -0
  12. package/payload/plugins/claude/qiongli/skills/qiongli-find-gap/SKILL.md +16 -0
  13. package/payload/plugins/claude/qiongli/skills/qiongli-lit-review/SKILL.md +16 -0
  14. package/payload/plugins/claude/qiongli/skills/qiongli-paper/SKILL.md +16 -0
  15. package/payload/plugins/claude/qiongli/skills/qiongli-paper-read/SKILL.md +16 -0
  16. package/payload/plugins/claude/qiongli/skills/qiongli-paper-write/SKILL.md +16 -0
  17. package/payload/plugins/claude/qiongli/skills/qiongli-proofread/SKILL.md +16 -0
  18. package/payload/plugins/claude/qiongli/skills/qiongli-rebuttal/SKILL.md +16 -0
  19. package/payload/plugins/claude/qiongli/skills/qiongli-study-design/SKILL.md +16 -0
  20. package/payload/plugins/claude/qiongli/skills/qiongli-submission-prep/SKILL.md +16 -0
  21. package/payload/plugins/claude/qiongli/skills/qiongli-synthesize/SKILL.md +16 -0
  22. package/payload/plugins/claude/qiongli/skills/qiongli-workflow/SKILL.md +41 -2
  23. package/payload/plugins/claude/qiongli/skills/qiongli-workflow/VERSION +1 -1
  24. package/payload/plugins/claude/qiongli/skills/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  25. package/payload/plugins/claude/qiongli/skills/qiongli-workflow/skills/registry.yaml +73 -73
  26. package/payload/plugins/claude/qiongli/skills/qiongli-workflow/workflows/lit-review.md +37 -8
  27. package/payload/plugins/claude/qiongli/skills/qiongli-workflow/workflows/paper-read.md +39 -8
  28. package/payload/plugins/codex/qiongli/.claude-plugin/plugin.json +1 -1
  29. package/payload/plugins/codex/qiongli/.codex-plugin/plugin.json +1 -1
  30. package/payload/plugins/codex/qiongli/mcp/qiongli-literature-provider/index.mjs +94 -1
  31. package/payload/plugins/codex/qiongli/mcp/qiongli-literature-provider/search-plan.mjs +359 -0
  32. package/payload/plugins/codex/qiongli/skills/qiongli-academic-present/SKILL.md +16 -0
  33. package/payload/plugins/codex/qiongli/skills/qiongli-academic-write/SKILL.md +16 -0
  34. package/payload/plugins/codex/qiongli/skills/qiongli-build-framework/SKILL.md +16 -0
  35. package/payload/plugins/codex/qiongli/skills/qiongli-code-build/SKILL.md +16 -0
  36. package/payload/plugins/codex/qiongli/skills/qiongli-compliance-check/SKILL.md +16 -0
  37. package/payload/plugins/codex/qiongli/skills/qiongli-ethics-check/SKILL.md +16 -0
  38. package/payload/plugins/codex/qiongli/skills/qiongli-find-gap/SKILL.md +16 -0
  39. package/payload/plugins/codex/qiongli/skills/qiongli-lit-review/SKILL.md +16 -0
  40. package/payload/plugins/codex/qiongli/skills/qiongli-paper/SKILL.md +16 -0
  41. package/payload/plugins/codex/qiongli/skills/qiongli-paper-read/SKILL.md +16 -0
  42. package/payload/plugins/codex/qiongli/skills/qiongli-paper-write/SKILL.md +16 -0
  43. package/payload/plugins/codex/qiongli/skills/qiongli-proofread/SKILL.md +16 -0
  44. package/payload/plugins/codex/qiongli/skills/qiongli-rebuttal/SKILL.md +16 -0
  45. package/payload/plugins/codex/qiongli/skills/qiongli-study-design/SKILL.md +16 -0
  46. package/payload/plugins/codex/qiongli/skills/qiongli-submission-prep/SKILL.md +16 -0
  47. package/payload/plugins/codex/qiongli/skills/qiongli-synthesize/SKILL.md +16 -0
  48. package/payload/plugins/codex/qiongli/skills/qiongli-workflow/SKILL.md +41 -2
  49. package/payload/plugins/codex/qiongli/skills/qiongli-workflow/VERSION +1 -1
  50. package/payload/plugins/codex/qiongli/skills/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  51. package/payload/plugins/codex/qiongli/skills/qiongli-workflow/skills/registry.yaml +73 -73
  52. package/payload/plugins/codex/qiongli/skills/qiongli-workflow/workflows/lit-review.md +37 -8
  53. package/payload/plugins/codex/qiongli/skills/qiongli-workflow/workflows/paper-read.md +39 -8
  54. package/payload/plugins/qiongli/.claude-plugin/plugin.json +1 -1
  55. package/payload/plugins/qiongli/.codex-plugin/plugin.json +1 -1
  56. package/payload/plugins/qiongli/mcp/qiongli-literature-provider/index.mjs +94 -1
  57. package/payload/plugins/qiongli/mcp/qiongli-literature-provider/search-plan.mjs +359 -0
  58. package/payload/plugins/qiongli/skills/qiongli-academic-present/SKILL.md +16 -0
  59. package/payload/plugins/qiongli/skills/qiongli-academic-write/SKILL.md +16 -0
  60. package/payload/plugins/qiongli/skills/qiongli-build-framework/SKILL.md +16 -0
  61. package/payload/plugins/qiongli/skills/qiongli-code-build/SKILL.md +16 -0
  62. package/payload/plugins/qiongli/skills/qiongli-compliance-check/SKILL.md +16 -0
  63. package/payload/plugins/qiongli/skills/qiongli-ethics-check/SKILL.md +16 -0
  64. package/payload/plugins/qiongli/skills/qiongli-find-gap/SKILL.md +16 -0
  65. package/payload/plugins/qiongli/skills/qiongli-lit-review/SKILL.md +16 -0
  66. package/payload/plugins/qiongli/skills/qiongli-paper/SKILL.md +16 -0
  67. package/payload/plugins/qiongli/skills/qiongli-paper-read/SKILL.md +16 -0
  68. package/payload/plugins/qiongli/skills/qiongli-paper-write/SKILL.md +16 -0
  69. package/payload/plugins/qiongli/skills/qiongli-proofread/SKILL.md +16 -0
  70. package/payload/plugins/qiongli/skills/qiongli-rebuttal/SKILL.md +16 -0
  71. package/payload/plugins/qiongli/skills/qiongli-study-design/SKILL.md +16 -0
  72. package/payload/plugins/qiongli/skills/qiongli-submission-prep/SKILL.md +16 -0
  73. package/payload/plugins/qiongli/skills/qiongli-synthesize/SKILL.md +16 -0
  74. package/payload/plugins/qiongli/skills/qiongli-workflow/SKILL.md +41 -2
  75. package/payload/plugins/qiongli/skills/qiongli-workflow/VERSION +1 -1
  76. package/payload/plugins/qiongli/skills/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  77. package/payload/plugins/qiongli/skills/qiongli-workflow/skills/registry.yaml +73 -73
  78. package/payload/plugins/qiongli/skills/qiongli-workflow/workflows/lit-review.md +37 -8
  79. package/payload/plugins/qiongli/skills/qiongli-workflow/workflows/paper-read.md +39 -8
  80. package/payload/qiongli-workflow/SKILL.md +9 -4
  81. package/payload/qiongli-workflow/VERSION +1 -1
  82. package/payload/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  83. package/payload/qiongli-workflow/skills/registry.yaml +73 -73
  84. package/payload/qiongli-workflow/workflows/lit-review.md +37 -8
  85. package/payload/qiongli-workflow/workflows/paper-read.md +39 -8
  86. package/payload/subjects/accounting/complete/qiongli-workflow/SKILL.md +41 -2
  87. package/payload/subjects/accounting/complete/qiongli-workflow/VERSION +1 -1
  88. package/payload/subjects/accounting/complete/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  89. package/payload/subjects/accounting/complete/qiongli-workflow/skills/registry.yaml +73 -73
  90. package/payload/subjects/accounting/complete/qiongli-workflow/workflows/lit-review.md +37 -8
  91. package/payload/subjects/accounting/complete/qiongli-workflow/workflows/paper-read.md +39 -8
  92. package/payload/subjects/accounting/focused/qiongli-workflow/SKILL.md +41 -2
  93. package/payload/subjects/accounting/focused/qiongli-workflow/VERSION +1 -1
  94. package/payload/subjects/accounting/focused/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  95. package/payload/subjects/accounting/focused/qiongli-workflow/skills/registry.yaml +37 -37
  96. package/payload/subjects/accounting/focused/qiongli-workflow/workflows/lit-review.md +37 -8
  97. package/payload/subjects/accounting/focused/qiongli-workflow/workflows/paper-read.md +39 -8
  98. package/payload/subjects/business/complete/qiongli-workflow/SKILL.md +41 -2
  99. package/payload/subjects/business/complete/qiongli-workflow/VERSION +1 -1
  100. package/payload/subjects/business/complete/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  101. package/payload/subjects/business/complete/qiongli-workflow/skills/registry.yaml +73 -73
  102. package/payload/subjects/business/complete/qiongli-workflow/workflows/lit-review.md +37 -8
  103. package/payload/subjects/business/complete/qiongli-workflow/workflows/paper-read.md +39 -8
  104. package/payload/subjects/business/focused/qiongli-workflow/SKILL.md +41 -2
  105. package/payload/subjects/business/focused/qiongli-workflow/VERSION +1 -1
  106. package/payload/subjects/business/focused/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  107. package/payload/subjects/business/focused/qiongli-workflow/skills/registry.yaml +37 -37
  108. package/payload/subjects/business/focused/qiongli-workflow/workflows/lit-review.md +37 -8
  109. package/payload/subjects/business/focused/qiongli-workflow/workflows/paper-read.md +39 -8
  110. package/payload/subjects/core/complete/qiongli-workflow/SKILL.md +41 -2
  111. package/payload/subjects/core/complete/qiongli-workflow/VERSION +1 -1
  112. package/payload/subjects/core/complete/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  113. package/payload/subjects/core/complete/qiongli-workflow/skills/registry.yaml +73 -73
  114. package/payload/subjects/core/complete/qiongli-workflow/workflows/lit-review.md +37 -8
  115. package/payload/subjects/core/complete/qiongli-workflow/workflows/paper-read.md +39 -8
  116. package/payload/subjects/core/focused/qiongli-workflow/SKILL.md +41 -2
  117. package/payload/subjects/core/focused/qiongli-workflow/VERSION +1 -1
  118. package/payload/subjects/core/focused/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  119. package/payload/subjects/core/focused/qiongli-workflow/skills/registry.yaml +73 -73
  120. package/payload/subjects/core/focused/qiongli-workflow/workflows/lit-review.md +37 -8
  121. package/payload/subjects/core/focused/qiongli-workflow/workflows/paper-read.md +39 -8
  122. package/payload/subjects/economics/complete/qiongli-workflow/SKILL.md +41 -2
  123. package/payload/subjects/economics/complete/qiongli-workflow/VERSION +1 -1
  124. package/payload/subjects/economics/complete/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  125. package/payload/subjects/economics/complete/qiongli-workflow/skills/registry.yaml +73 -73
  126. package/payload/subjects/economics/complete/qiongli-workflow/workflows/lit-review.md +37 -8
  127. package/payload/subjects/economics/complete/qiongli-workflow/workflows/paper-read.md +39 -8
  128. package/payload/subjects/economics/focused/qiongli-workflow/SKILL.md +41 -2
  129. package/payload/subjects/economics/focused/qiongli-workflow/VERSION +1 -1
  130. package/payload/subjects/economics/focused/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  131. package/payload/subjects/economics/focused/qiongli-workflow/skills/registry.yaml +37 -37
  132. package/payload/subjects/economics/focused/qiongli-workflow/workflows/lit-review.md +37 -8
  133. package/payload/subjects/economics/focused/qiongli-workflow/workflows/paper-read.md +39 -8
  134. package/payload/subjects/economics-accounting/complete/qiongli-workflow/SKILL.md +41 -2
  135. package/payload/subjects/economics-accounting/complete/qiongli-workflow/VERSION +1 -1
  136. package/payload/subjects/economics-accounting/complete/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  137. package/payload/subjects/economics-accounting/complete/qiongli-workflow/skills/registry.yaml +73 -73
  138. package/payload/subjects/economics-accounting/complete/qiongli-workflow/workflows/lit-review.md +37 -8
  139. package/payload/subjects/economics-accounting/complete/qiongli-workflow/workflows/paper-read.md +39 -8
  140. package/payload/subjects/economics-accounting/focused/qiongli-workflow/SKILL.md +41 -2
  141. package/payload/subjects/economics-accounting/focused/qiongli-workflow/VERSION +1 -1
  142. package/payload/subjects/economics-accounting/focused/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  143. package/payload/subjects/economics-accounting/focused/qiongli-workflow/skills/registry.yaml +37 -37
  144. package/payload/subjects/economics-accounting/focused/qiongli-workflow/workflows/lit-review.md +37 -8
  145. package/payload/subjects/economics-accounting/focused/qiongli-workflow/workflows/paper-read.md +39 -8
  146. package/payload/subjects/finance/complete/qiongli-workflow/SKILL.md +41 -2
  147. package/payload/subjects/finance/complete/qiongli-workflow/VERSION +1 -1
  148. package/payload/subjects/finance/complete/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  149. package/payload/subjects/finance/complete/qiongli-workflow/skills/registry.yaml +73 -73
  150. package/payload/subjects/finance/complete/qiongli-workflow/workflows/lit-review.md +37 -8
  151. package/payload/subjects/finance/complete/qiongli-workflow/workflows/paper-read.md +39 -8
  152. package/payload/subjects/finance/focused/qiongli-workflow/SKILL.md +41 -2
  153. package/payload/subjects/finance/focused/qiongli-workflow/VERSION +1 -1
  154. package/payload/subjects/finance/focused/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  155. package/payload/subjects/finance/focused/qiongli-workflow/skills/registry.yaml +37 -37
  156. package/payload/subjects/finance/focused/qiongli-workflow/workflows/lit-review.md +37 -8
  157. package/payload/subjects/finance/focused/qiongli-workflow/workflows/paper-read.md +39 -8
  158. package/payload/subjects/geoeconomics/complete/qiongli-workflow/SKILL.md +41 -2
  159. package/payload/subjects/geoeconomics/complete/qiongli-workflow/VERSION +1 -1
  160. package/payload/subjects/geoeconomics/complete/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  161. package/payload/subjects/geoeconomics/complete/qiongli-workflow/skills/registry.yaml +73 -73
  162. package/payload/subjects/geoeconomics/complete/qiongli-workflow/workflows/lit-review.md +37 -8
  163. package/payload/subjects/geoeconomics/complete/qiongli-workflow/workflows/paper-read.md +39 -8
  164. package/payload/subjects/geoeconomics/focused/qiongli-workflow/SKILL.md +41 -2
  165. package/payload/subjects/geoeconomics/focused/qiongli-workflow/VERSION +1 -1
  166. package/payload/subjects/geoeconomics/focused/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  167. package/payload/subjects/geoeconomics/focused/qiongli-workflow/skills/registry.yaml +37 -37
  168. package/payload/subjects/geoeconomics/focused/qiongli-workflow/workflows/lit-review.md +37 -8
  169. package/payload/subjects/geoeconomics/focused/qiongli-workflow/workflows/paper-read.md +39 -8
  170. package/payload/subjects/political-economy/complete/qiongli-workflow/SKILL.md +41 -2
  171. package/payload/subjects/political-economy/complete/qiongli-workflow/VERSION +1 -1
  172. package/payload/subjects/political-economy/complete/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  173. package/payload/subjects/political-economy/complete/qiongli-workflow/skills/registry.yaml +73 -73
  174. package/payload/subjects/political-economy/complete/qiongli-workflow/workflows/lit-review.md +37 -8
  175. package/payload/subjects/political-economy/complete/qiongli-workflow/workflows/paper-read.md +39 -8
  176. package/payload/subjects/political-economy/focused/qiongli-workflow/SKILL.md +41 -2
  177. package/payload/subjects/political-economy/focused/qiongli-workflow/VERSION +1 -1
  178. package/payload/subjects/political-economy/focused/qiongli-workflow/skills/B_literature/academic-searcher.md +22 -4
  179. package/payload/subjects/political-economy/focused/qiongli-workflow/skills/registry.yaml +37 -37
  180. package/payload/subjects/political-economy/focused/qiongli-workflow/workflows/lit-review.md +37 -8
  181. package/payload/subjects/political-economy/focused/qiongli-workflow/workflows/paper-read.md +39 -8
  182. package/python-runtime/qiongli/__init__.py +1 -1
  183. package/python-runtime/qiongli/bridges/hybrid_search_router.py +310 -0
  184. package/python-runtime/qiongli/bridges/literature_mcp_tools.py +46 -0
  185. package/python-runtime/qiongli/bridges/mcp_tool_handlers.py +2 -0
  186. package/python-runtime/qiongli/cli.py +13 -1
  187. package/python-runtime/qiongli/install_discovery.py +66 -4
  188. package/python-runtime/qiongli/local_plugin_installer.py +12 -0
  189. package/python-runtime/qiongli/subject_materializer.py +58 -1
  190. package/python-runtime/qiongli/workflow_wrapper_skills.py +146 -0
  191. package/python-runtime/scripts/build_plugin_artifacts.py +19 -0
  192. package/python-runtime/skills/B_literature/academic-searcher.md +22 -4
  193. package/python-runtime/skills/registry.yaml +73 -73
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qiongli",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
4
4
  "description": "Qiongli Python-free academic workflow asset manager.",
5
5
  "author": {
6
6
  "name": "Jiaxin Peng",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "qiongli",
3
3
  "description": "Qiongli academic research workflow for literature, manuscripts, statistics, analysis code, reproducibility, rebuttal, submission, presentation, and stage-aware grill.",
4
- "version": "1.13.0",
4
+ "version": "1.14.0",
5
5
  "author": {
6
6
  "name": "Jiaxin Peng",
7
7
  "url": "https://github.com/jxpeng98"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qiongli",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
4
4
  "description": "Qiongli academic research workflow for literature, manuscripts, statistics, analysis code, reproducibility, rebuttal, submission, presentation, and stage-aware grill.",
5
5
  "author": {
6
6
  "name": "Jiaxin Peng",
@@ -14,6 +14,7 @@ import { appendSearchWarnings, searchDiagnostics } from "./diagnostics.mjs";
14
14
  import { buildEvidence } from "./evidence.mjs";
15
15
  import { dedupeResults, rankResults } from "./normalize.mjs";
16
16
  import { buildQueryPlan, buildSearchIntent, providerLimitFor } from "./query.mjs";
17
+ import { buildHybridSearchPlan } from "./search-plan.mjs";
17
18
  import { searchArxiv } from "./providers/arxiv.mjs";
18
19
  import { searchCrossref } from "./providers/crossref.mjs";
19
20
  import { searchOpenAlex } from "./providers/openalex.mjs";
@@ -54,6 +55,89 @@ export const TOOL_DECLARATIONS = [
54
55
  properties: {}
55
56
  }
56
57
  },
58
+ {
59
+ name: "qiongli_search_plan",
60
+ description: "Plan provider MCP and platform-native literature search routing without executing platform-native search.",
61
+ inputSchema: {
62
+ type: "object",
63
+ additionalProperties: true,
64
+ properties: {
65
+ query: {
66
+ type: "string"
67
+ },
68
+ platform: {
69
+ type: "string",
70
+ description: "Host platform used to choose the default native search tool, for example codex, claude, or antigravity."
71
+ },
72
+ native_search_available: {
73
+ type: "boolean"
74
+ },
75
+ nativeSearchAvailable: {
76
+ type: "boolean"
77
+ },
78
+ native_search_tools: {
79
+ type: "array",
80
+ items: {
81
+ type: "string"
82
+ }
83
+ },
84
+ nativeSearchTools: {
85
+ type: "array",
86
+ items: {
87
+ type: "string"
88
+ }
89
+ },
90
+ query_variants: {
91
+ type: "array",
92
+ items: {
93
+ type: "string"
94
+ }
95
+ },
96
+ queryVariants: {
97
+ type: "array",
98
+ items: {
99
+ type: "string"
100
+ }
101
+ },
102
+ include_working_papers: {
103
+ type: "boolean"
104
+ },
105
+ includeWorkingPapers: {
106
+ type: "boolean"
107
+ },
108
+ fromYear: {
109
+ type: ["integer", "string"]
110
+ },
111
+ toYear: {
112
+ type: ["integer", "string"]
113
+ },
114
+ search_mode: {
115
+ type: "string"
116
+ },
117
+ searchMode: {
118
+ type: "string"
119
+ },
120
+ venue_filter: {
121
+ type: "string"
122
+ },
123
+ venueFilter: {
124
+ type: "string"
125
+ },
126
+ document_types: {
127
+ type: "array",
128
+ items: {
129
+ type: "string"
130
+ }
131
+ },
132
+ documentTypes: {
133
+ type: "array",
134
+ items: {
135
+ type: "string"
136
+ }
137
+ }
138
+ }
139
+ }
140
+ },
57
141
  {
58
142
  name: "qiongli_config_status",
59
143
  description: "Report shared Qiongli provider configuration status without exposing secrets.",
@@ -748,6 +832,11 @@ export function handleStatus(context = {}) {
748
832
  };
749
833
  }
750
834
 
835
+ export function handleSearchPlan(input = {}, context = {}) {
836
+ const status = handleStatus(context);
837
+ return buildHybridSearchPlan(input, status.capability_mode, status.providers);
838
+ }
839
+
751
840
  export function handleConfigStatus(context = {}) {
752
841
  const env = context.env ?? process.env;
753
842
  const config = resolveConfig(context);
@@ -933,6 +1022,10 @@ export async function handleToolCall(name, input = {}, context = {}) {
933
1022
  return toolResult(handleStatus(context));
934
1023
  }
935
1024
 
1025
+ if (name === "qiongli_search_plan") {
1026
+ return toolResult(handleSearchPlan(input, context));
1027
+ }
1028
+
936
1029
  if (name === "qiongli_config_status") {
937
1030
  return toolResult(handleConfigStatus(context));
938
1031
  }
@@ -976,7 +1069,7 @@ export async function startStdioServer() {
976
1069
  await startJsonRpcStdioServer({
977
1070
  serverInfo: {
978
1071
  name: "qiongli-literature-provider",
979
- version: "0.1.4"
1072
+ version: "0.1.5"
980
1073
  },
981
1074
  listTools,
982
1075
  handleToolCall
@@ -0,0 +1,359 @@
1
+ const PROVIDER_PROVENANCE_LABELS = Object.freeze([
2
+ "mcp:semantic_scholar",
3
+ "mcp:openalex",
4
+ "mcp:crossref",
5
+ "mcp:pubmed",
6
+ "mcp:arxiv"
7
+ ]);
8
+ const PROVIDER_NAMES = Object.freeze(PROVIDER_PROVENANCE_LABELS.map((label) => label.replace(/^mcp:/, "")));
9
+ const AGENT_INSTRUCTIONS = Object.freeze([
10
+ "MCP servers must not call Codex or Claude native search directly.",
11
+ "The active agent executes native_search_queries only when the platform exposes native search.",
12
+ "Do not treat native-search results as provider-reproducible records.",
13
+ "Write provider, native, and user-corpus records with distinct provenance labels."
14
+ ]);
15
+
16
+ const DEFAULT_NATIVE_TOOLS = Object.freeze({
17
+ codex: "codex_web_search",
18
+ claude: "claude_web_search",
19
+ claude_code: "claude_web_search",
20
+ claudecode: "claude_web_search",
21
+ antigravity: "antigravity_search",
22
+ platform: "platform_native_search"
23
+ });
24
+
25
+ const LIMITATIONS = Object.freeze({
26
+ emptyQuery: "Search query is empty.",
27
+ noNative: "Platform-native search was not declared available.",
28
+ noProvider: "Provider MCP search is unavailable; native results require explicit provenance labels.",
29
+ noSearch: "No provider MCP search or platform-native search is available."
30
+ });
31
+
32
+ function cleanString(value, fallback = "") {
33
+ if (value === undefined || value === null) {
34
+ return fallback;
35
+ }
36
+
37
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
38
+ return "";
39
+ }
40
+
41
+ return String(value).trim();
42
+ }
43
+
44
+ function readAlias(input, names) {
45
+ for (const name of names) {
46
+ if (input[name] !== undefined) {
47
+ return input[name];
48
+ }
49
+ }
50
+
51
+ return undefined;
52
+ }
53
+
54
+ function normalizeStringList(value) {
55
+ const values = Array.isArray(value) ? value : typeof value === "string" ? [value] : [];
56
+ const normalized = [];
57
+ const seen = new Set();
58
+
59
+ for (const item of values) {
60
+ const cleaned = cleanString(item);
61
+ if (!cleaned) {
62
+ continue;
63
+ }
64
+
65
+ const key = cleaned.toLowerCase();
66
+ if (seen.has(key)) {
67
+ continue;
68
+ }
69
+
70
+ seen.add(key);
71
+ normalized.push(cleaned);
72
+ }
73
+
74
+ return normalized;
75
+ }
76
+
77
+ function readBoolean(value) {
78
+ if (typeof value === "boolean") {
79
+ return value;
80
+ }
81
+
82
+ if (typeof value === "string") {
83
+ return ["1", "true", "yes", "y", "available"].includes(value.trim().toLowerCase());
84
+ }
85
+
86
+ return Boolean(value);
87
+ }
88
+
89
+ function normalizeProviderCapabilityMode(value) {
90
+ return cleanString(value) === "provider_connected" ? "provider_connected" : "strategy_only";
91
+ }
92
+
93
+ function normalizePlatform(value) {
94
+ const normalized = cleanString(value, "unknown").replace(/[\s-]+/g, "_");
95
+ return normalized || "unknown";
96
+ }
97
+
98
+ function defaultNativeTool(platform) {
99
+ return DEFAULT_NATIVE_TOOLS[platform.toLowerCase()] ?? DEFAULT_NATIVE_TOOLS.platform;
100
+ }
101
+
102
+ function normalizeTool(value) {
103
+ return cleanString(value).replace(/\s+/g, "_");
104
+ }
105
+
106
+ function nativeSearchTools(input, platform, nativeAvailable) {
107
+ if (!nativeAvailable) {
108
+ return [];
109
+ }
110
+
111
+ const rawTools = readAlias(input, ["native_search_tools", "nativeSearchTools"]);
112
+ const configuredTools = normalizeStringList(rawTools).map(normalizeTool).filter(Boolean);
113
+ if (configuredTools.length > 0) {
114
+ return configuredTools;
115
+ }
116
+
117
+ return [defaultNativeTool(platform)];
118
+ }
119
+
120
+ function nativeSearchAvailable(input) {
121
+ const raw = readAlias(input, ["native_search_available", "nativeSearchAvailable"]);
122
+ return readBoolean(raw ?? false);
123
+ }
124
+
125
+ function hasOwn(input, name) {
126
+ return Object.prototype.hasOwnProperty.call(input, name);
127
+ }
128
+
129
+ function firstPresent(input, names) {
130
+ for (const name of names) {
131
+ if (hasOwn(input, name) && input[name] !== null && input[name] !== undefined) {
132
+ return input[name];
133
+ }
134
+ }
135
+
136
+ return undefined;
137
+ }
138
+
139
+ function searchFilters(input) {
140
+ const filters = {};
141
+ for (const [outputKey, names] of [
142
+ ["include_working_papers", ["include_working_papers", "includeWorkingPapers"]],
143
+ ["fromYear", ["fromYear"]],
144
+ ["toYear", ["toYear"]],
145
+ ["search_mode", ["search_mode", "searchMode"]],
146
+ ["venue_filter", ["venue_filter", "venueFilter"]]
147
+ ]) {
148
+ const value = firstPresent(input, names);
149
+ if (value !== undefined) {
150
+ filters[outputKey] = value;
151
+ }
152
+ }
153
+
154
+ const documentTypes = normalizeStringList(firstPresent(input, ["document_types", "documentTypes"]));
155
+ if (documentTypes.length > 0) {
156
+ filters.document_types = documentTypes;
157
+ }
158
+
159
+ return filters;
160
+ }
161
+
162
+ function queryEntries(input, query) {
163
+ if (!query) {
164
+ return [];
165
+ }
166
+
167
+ const queries = [query, ...normalizeStringList(readAlias(input, ["query_variants", "queryVariants"]))];
168
+ const entries = [];
169
+ const seen = new Set();
170
+ for (const candidate of queries) {
171
+ const key = candidate.toLowerCase();
172
+ if (seen.has(key)) {
173
+ continue;
174
+ }
175
+ seen.add(key);
176
+ entries.push({
177
+ query_id: `Q${entries.length + 1}`,
178
+ query: candidate,
179
+ source: entries.length === 0 ? "primary" : "variant"
180
+ });
181
+ }
182
+ return entries;
183
+ }
184
+
185
+ function providerNames(providerStatus) {
186
+ if (providerStatus === null || providerStatus === undefined) {
187
+ return [...PROVIDER_NAMES];
188
+ }
189
+
190
+ return PROVIDER_NAMES.filter((provider) => {
191
+ const value = providerStatus[provider];
192
+ if (value === "configured" || value === true) {
193
+ return true;
194
+ }
195
+ return Boolean(value && typeof value === "object" && value.configured);
196
+ });
197
+ }
198
+
199
+ function buildProviderQueries(entries, filters, names, providerConnected) {
200
+ if (!providerConnected || entries.length === 0) {
201
+ return [];
202
+ }
203
+
204
+ return names.flatMap((provider) =>
205
+ entries.map((entry) => ({
206
+ provider,
207
+ query_id: entry.query_id,
208
+ query: entry.query,
209
+ source: entry.source,
210
+ filters: { ...filters },
211
+ provenance_label: `mcp:${provider}`
212
+ }))
213
+ );
214
+ }
215
+
216
+ function buildNativeQueries(entries, platform, nativeTools, filters, nativeEnabled) {
217
+ if (!nativeEnabled || entries.length === 0) {
218
+ return [];
219
+ }
220
+
221
+ return nativeTools.flatMap((tool) =>
222
+ entries.map((entry) => ({
223
+ tool,
224
+ platform,
225
+ query_id: entry.query_id,
226
+ query: entry.query,
227
+ source: entry.source,
228
+ filters: { ...filters },
229
+ provenance_label: `native:${tool}`
230
+ }))
231
+ );
232
+ }
233
+
234
+ function executionSequence(providerQueries, nativeQueries) {
235
+ const sequence = [
236
+ {
237
+ actor: "agent",
238
+ action: "call qiongli_literature_status",
239
+ tool: "qiongli_literature_status"
240
+ },
241
+ {
242
+ actor: "agent",
243
+ action: "call qiongli_search_plan",
244
+ tool: "qiongli_search_plan"
245
+ }
246
+ ];
247
+
248
+ if (providerQueries.length > 0) {
249
+ sequence.push({
250
+ actor: "agent",
251
+ action: "call qiongli_literature_search",
252
+ tool: "qiongli_literature_search",
253
+ queries: "provider_queries"
254
+ });
255
+ }
256
+
257
+ if (nativeQueries.length > 0) {
258
+ sequence.push({
259
+ actor: "agent",
260
+ action: "execute platform-native search",
261
+ queries: "native_search_queries"
262
+ });
263
+ }
264
+
265
+ sequence.push({
266
+ actor: "agent",
267
+ action: "merge/dedupe/search_log",
268
+ inputs: ["provider_queries", "native_search_queries", "user_corpus"]
269
+ });
270
+ return sequence;
271
+ }
272
+
273
+ function mergePolicy() {
274
+ return {
275
+ dedupe_keys: ["doi", "title", "year", "provider_record_id", "native_url"],
276
+ provider_records: "Prefer provider MCP metadata for reproducible bibliographic fields.",
277
+ native_records: "Keep native-search records only with native provenance labels and source URLs.",
278
+ user_corpus_records: "Keep user-corpus records separate from provider and native search records.",
279
+ search_log: "Record provider and native query execution separately before merge and dedupe."
280
+ };
281
+ }
282
+
283
+ function executionMode({ query, providerConnected, nativeAvailable }) {
284
+ if (!query) {
285
+ return "strategy_only";
286
+ }
287
+ if (providerConnected && nativeAvailable) {
288
+ return "hybrid_search";
289
+ }
290
+ if (providerConnected) {
291
+ return "provider_connected";
292
+ }
293
+ if (nativeAvailable) {
294
+ return "native_only";
295
+ }
296
+
297
+ return "strategy_only";
298
+ }
299
+
300
+ function planLimitations({ query, providerConnected, nativeAvailable, mode }) {
301
+ if (!query) {
302
+ return [LIMITATIONS.emptyQuery];
303
+ }
304
+ if (providerConnected && !nativeAvailable) {
305
+ return [LIMITATIONS.noNative];
306
+ }
307
+ if (!providerConnected && nativeAvailable) {
308
+ return [LIMITATIONS.noProvider];
309
+ }
310
+ if (mode === "strategy_only") {
311
+ return [LIMITATIONS.noSearch];
312
+ }
313
+
314
+ return [];
315
+ }
316
+
317
+ export function buildHybridSearchPlan(input = {}, providerCapabilityMode = "strategy_only", providerStatus = undefined) {
318
+ const query = cleanString(input.query);
319
+ const platform = normalizePlatform(input.platform);
320
+ const nativeAvailable = nativeSearchAvailable(input);
321
+ const tools = nativeSearchTools(input, platform, nativeAvailable);
322
+ const names = providerNames(providerStatus);
323
+ let normalizedProviderMode = normalizeProviderCapabilityMode(providerCapabilityMode);
324
+ if (providerStatus !== undefined && names.length === 0) {
325
+ normalizedProviderMode = "strategy_only";
326
+ }
327
+ const providerConnected = normalizedProviderMode === "provider_connected" && names.length > 0;
328
+ const mode = executionMode({ query, providerConnected, nativeAvailable });
329
+ const filters = searchFilters(input);
330
+ const entries = queryEntries(input, query);
331
+ const providerQueries = buildProviderQueries(entries, filters, names, ["hybrid_search", "provider_connected"].includes(mode));
332
+ const nativeQueries = buildNativeQueries(entries, platform, tools, filters, ["hybrid_search", "native_only"].includes(mode));
333
+
334
+ return {
335
+ artifact_type: "qiongli_hybrid_search_plan",
336
+ query,
337
+ platform,
338
+ search_execution_mode: mode,
339
+ provider_capability_mode: normalizedProviderMode,
340
+ native_search_available: nativeAvailable,
341
+ native_search_tools: tools,
342
+ provider_queries: providerQueries,
343
+ native_search_queries: nativeQueries,
344
+ provenance_labels: {
345
+ provider: providerConnected ? names.map((provider) => `mcp:${provider}`) : [],
346
+ native: tools.map((tool) => `native:${tool}`),
347
+ user_corpus: ["user_corpus"]
348
+ },
349
+ execution_sequence: executionSequence(providerQueries, nativeQueries),
350
+ agent_instructions: [...AGENT_INSTRUCTIONS],
351
+ merge_policy: mergePolicy(),
352
+ limitations: planLimitations({
353
+ query,
354
+ providerConnected,
355
+ nativeAvailable,
356
+ mode
357
+ })
358
+ };
359
+ }
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: qiongli-academic-present
3
+ description: Use when the user asks Qiongli for academic slides, scholarly presentation planning, Slidev, Beamer, PowerPoint, talk structure, or /academic-present routing.
4
+ ---
5
+
6
+ # Qiongli Academic Present
7
+
8
+ This Codex wrapper mirrors the cross-platform `/academic-present` workflow entrypoint.
9
+
10
+ ## Canonical Route
11
+
12
+ - Use `$qiongli` as the main Qiongli skill for trigger rules, project guidance, and subject overlays.
13
+ - Follow `../qiongli-workflow/workflows/academic-present.md` as the source of truth for task order, artifacts, and quality gates.
14
+ - Keep behavior aligned with Claude Code `/academic-present` and Antigravity workflow routing.
15
+
16
+ Do not duplicate or reinterpret workflow logic in this wrapper. If this wrapper and the canonical workflow disagree, the canonical workflow wins.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: qiongli-academic-write
3
+ description: Use when the user asks Qiongli for manuscript writing, academic writing, related work, abstract, introduction, discussion, section drafting, or /academic-write routing.
4
+ ---
5
+
6
+ # Qiongli Academic Write
7
+
8
+ This Codex wrapper mirrors the cross-platform `/academic-write` workflow entrypoint.
9
+
10
+ ## Canonical Route
11
+
12
+ - Use `$qiongli` as the main Qiongli skill for trigger rules, project guidance, and subject overlays.
13
+ - Follow `../qiongli-workflow/workflows/academic-write.md` as the source of truth for task order, artifacts, and quality gates.
14
+ - Keep behavior aligned with Claude Code `/academic-write` and Antigravity workflow routing.
15
+
16
+ Do not duplicate or reinterpret workflow logic in this wrapper. If this wrapper and the canonical workflow disagree, the canonical workflow wins.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: qiongli-build-framework
3
+ description: Use when the user asks Qiongli for conceptual framework, theory mapping, contribution framing, construct relationships, model building, or /build-framework routing.
4
+ ---
5
+
6
+ # Qiongli Build Framework
7
+
8
+ This Codex wrapper mirrors the cross-platform `/build-framework` workflow entrypoint.
9
+
10
+ ## Canonical Route
11
+
12
+ - Use `$qiongli` as the main Qiongli skill for trigger rules, project guidance, and subject overlays.
13
+ - Follow `../qiongli-workflow/workflows/build-framework.md` as the source of truth for task order, artifacts, and quality gates.
14
+ - Keep behavior aligned with Claude Code `/build-framework` and Antigravity workflow routing.
15
+
16
+ Do not duplicate or reinterpret workflow logic in this wrapper. If this wrapper and the canonical workflow disagree, the canonical workflow wins.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: qiongli-code-build
3
+ description: Use when the user asks Qiongli for academic analysis code, notebooks, reproducibility scripts, statistical pipelines, replication packages, or /code-build routing.
4
+ ---
5
+
6
+ # Qiongli Code Build
7
+
8
+ This Codex wrapper mirrors the cross-platform `/code-build` workflow entrypoint.
9
+
10
+ ## Canonical Route
11
+
12
+ - Use `$qiongli` as the main Qiongli skill for trigger rules, project guidance, and subject overlays.
13
+ - Follow `../qiongli-workflow/workflows/code-build.md` as the source of truth for task order, artifacts, and quality gates.
14
+ - Keep behavior aligned with Claude Code `/code-build` and Antigravity workflow routing.
15
+
16
+ Do not duplicate or reinterpret workflow logic in this wrapper. If this wrapper and the canonical workflow disagree, the canonical workflow wins.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: qiongli-compliance-check
3
+ description: Use when the user asks Qiongli for reporting compliance, PRISMA, CONSORT, STROBE, checklist review, citation risk, or /compliance-check routing.
4
+ ---
5
+
6
+ # Qiongli Compliance Check
7
+
8
+ This Codex wrapper mirrors the cross-platform `/compliance-check` workflow entrypoint.
9
+
10
+ ## Canonical Route
11
+
12
+ - Use `$qiongli` as the main Qiongli skill for trigger rules, project guidance, and subject overlays.
13
+ - Follow `../qiongli-workflow/workflows/compliance-check.md` as the source of truth for task order, artifacts, and quality gates.
14
+ - Keep behavior aligned with Claude Code `/compliance-check` and Antigravity workflow routing.
15
+
16
+ Do not duplicate or reinterpret workflow logic in this wrapper. If this wrapper and the canonical workflow disagree, the canonical workflow wins.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: qiongli-ethics-check
3
+ description: Use when the user asks Qiongli for ethics, IRB text, consent, deidentification, data governance, disclosure, or /ethics-check routing.
4
+ ---
5
+
6
+ # Qiongli Ethics Check
7
+
8
+ This Codex wrapper mirrors the cross-platform `/ethics-check` workflow entrypoint.
9
+
10
+ ## Canonical Route
11
+
12
+ - Use `$qiongli` as the main Qiongli skill for trigger rules, project guidance, and subject overlays.
13
+ - Follow `../qiongli-workflow/workflows/ethics-check.md` as the source of truth for task order, artifacts, and quality gates.
14
+ - Keep behavior aligned with Claude Code `/ethics-check` and Antigravity workflow routing.
15
+
16
+ Do not duplicate or reinterpret workflow logic in this wrapper. If this wrapper and the canonical workflow disagree, the canonical workflow wins.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: qiongli-find-gap
3
+ description: Use when the user asks Qiongli to find research gaps, narrow a topic, assess novelty, choose a direction, map contributions, or /find-gap routing.
4
+ ---
5
+
6
+ # Qiongli Find Gap
7
+
8
+ This Codex wrapper mirrors the cross-platform `/find-gap` workflow entrypoint.
9
+
10
+ ## Canonical Route
11
+
12
+ - Use `$qiongli` as the main Qiongli skill for trigger rules, project guidance, and subject overlays.
13
+ - Follow `../qiongli-workflow/workflows/find-gap.md` as the source of truth for task order, artifacts, and quality gates.
14
+ - Keep behavior aligned with Claude Code `/find-gap` and Antigravity workflow routing.
15
+
16
+ Do not duplicate or reinterpret workflow logic in this wrapper. If this wrapper and the canonical workflow disagree, the canonical workflow wins.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: qiongli-lit-review
3
+ description: Use when the user asks Qiongli for literature review, systematic review, PRISMA search, screening, extraction, synthesis, evidence mapping, related work, or /lit-review routing.
4
+ ---
5
+
6
+ # Qiongli Lit Review
7
+
8
+ This Codex wrapper mirrors the cross-platform `/lit-review` workflow entrypoint.
9
+
10
+ ## Canonical Route
11
+
12
+ - Use `$qiongli` as the main Qiongli skill for trigger rules, project guidance, and subject overlays.
13
+ - Follow `../qiongli-workflow/workflows/lit-review.md` as the source of truth for task order, artifacts, and quality gates.
14
+ - Keep behavior aligned with Claude Code `/lit-review` and Antigravity workflow routing.
15
+
16
+ Do not duplicate or reinterpret workflow logic in this wrapper. If this wrapper and the canonical workflow disagree, the canonical workflow wins.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: qiongli-paper
3
+ description: Use when the user asks Qiongli for end-to-end paper planning, research workflow routing, academic project setup, stage selection, or /paper routing.
4
+ ---
5
+
6
+ # Qiongli Paper
7
+
8
+ This Codex wrapper mirrors the cross-platform `/paper` workflow entrypoint.
9
+
10
+ ## Canonical Route
11
+
12
+ - Use `$qiongli` as the main Qiongli skill for trigger rules, project guidance, and subject overlays.
13
+ - Follow `../qiongli-workflow/workflows/paper.md` as the source of truth for task order, artifacts, and quality gates.
14
+ - Keep behavior aligned with Claude Code `/paper` and Antigravity workflow routing.
15
+
16
+ Do not duplicate or reinterpret workflow logic in this wrapper. If this wrapper and the canonical workflow disagree, the canonical workflow wins.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: qiongli-paper-read
3
+ description: Use when the user asks Qiongli to read a paper, PDF, DOI, article, notes, claims, methods, contribution, evidence, or /paper-read routing.
4
+ ---
5
+
6
+ # Qiongli Paper Read
7
+
8
+ This Codex wrapper mirrors the cross-platform `/paper-read` workflow entrypoint.
9
+
10
+ ## Canonical Route
11
+
12
+ - Use `$qiongli` as the main Qiongli skill for trigger rules, project guidance, and subject overlays.
13
+ - Follow `../qiongli-workflow/workflows/paper-read.md` as the source of truth for task order, artifacts, and quality gates.
14
+ - Keep behavior aligned with Claude Code `/paper-read` and Antigravity workflow routing.
15
+
16
+ Do not duplicate or reinterpret workflow logic in this wrapper. If this wrapper and the canonical workflow disagree, the canonical workflow wins.