@luffysolution/omnischolar-pi 0.1.17 → 0.1.19

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.
@@ -8,13 +8,27 @@ OmniScholar can connect to OpenAI, xAI, Gemini, Vertex AI, fal.ai, DashScope/Qwe
8
8
 
9
9
  | Tool | Use |
10
10
  |---|---|
11
- | `omnischolar_image_models` | Show configured models and their usable operations |
11
+ | `omnischolar_image_models` | Discover and show models available with the current credentials |
12
12
  | `omnischolar_image_generate` | Text-to-image, image-to-image, or multi-reference generation |
13
13
  | `omnischolar_image_edit` | Edit an existing image |
14
14
  | `omnischolar_image_service` | Run supported provider status, model, or task operations |
15
15
  | `ai4scholar_figure` | Generate, edit, or vectorize through Ai4Scholar |
16
16
 
17
- Each model must explicitly declare the operation it supports. A model name appearing in a provider catalog does not by itself prove that it can generate or edit images; the corresponding operation must show `usable: true` in `omnischolar_image_models`.
17
+ Model selection uses the user's explicit model first, then catalog models with confirmed capabilities, then official-documentation-verified built-in models, then explicitly configured model contracts. If the model is omitted, the tool discovers and selects the newest usable model. Providers without a model catalog use a small verified built-in set and still allow `models` to override or extend the declarations.
18
+
19
+ Common tool parameters include `size`, `aspectRatio`, `resolution`, `background`, `outputFormat`, `quality`, `n`, `negativePrompt`, and `seed`. Read `supported_parameters` from the selected model before calling the tool; adapters map supported controls to native names and return `parameter_unsupported` before submission instead of silently dropping controls.
20
+
21
+ ### Official parameter matrix
22
+
23
+ | Provider/API | Verified parameters | Do not assume |
24
+ |---|---|---|
25
+ | OpenAI GPT Image | `size`/`resolution`, `background`, `outputFormat`, `quality`, `n` | A separate native `aspectRatio` control |
26
+ | Google Gemini API Interactions | `aspectRatio`, `resolution` (`1K`/`2K`), `outputFormat` | `size`, `background`, `quality`, `n`, `seed` |
27
+ | Vertex Gemini image | `aspectRatio`, `resolution` (`1K`/`2K`/`4K`), `outputFormat`, `n` | Transparency or arbitrary pixel `size` |
28
+ | Fal Nano Banana 2 | `aspectRatio`, `resolution`, `outputFormat`, `n`, `seed` | `background` or `quality` |
29
+ | Fal GPT Image variants | `size`/`resolution`, `background`, `outputFormat`, `quality`, `n` | Nano Banana-specific controls |
30
+ | DashScope/Qwen native image | `size`/`resolution`, `n`, `negativePrompt`, `seed` | `background`, `quality`, or transparent output |
31
+ | Atlas | Follow the selected model contract; GPT Image commonly exposes `size`, `quality`, `outputFormat` | A provider-wide parameter contract |
18
32
 
19
33
  ## Example config
20
34
 
@@ -29,7 +43,7 @@ Each model must explicitly declare the operation it supports. A model name appea
29
43
  "fal": {
30
44
  "enabled": true,
31
45
  "apiKeyEnv": "OMNISCHOLAR_FAL_API_KEY",
32
- "baseUrl": "https://fal.run",
46
+ "baseUrl": "https://queue.fal.run",
33
47
  "models": {},
34
48
  "options": {}
35
49
  },
@@ -39,16 +53,18 @@ Each model must explicitly declare the operation it supports. A model name appea
39
53
  "baseUrl": "https://your-workspace.cn-beijing.maas.aliyuncs.com/api/v1",
40
54
  "models": {},
41
55
  "options": {
42
- "workspace": "your-workspace"
56
+ "workspace": "your-workspace",
57
+ "region": "cn-beijing",
58
+ "protocol": "native"
43
59
  }
44
60
  },
45
61
  "qwen-cloud": {
46
62
  "enabled": true,
47
63
  "apiKeyEnv": "OMNISCHOLAR_QWEN_API_KEY",
48
- "baseUrl": "https://your-workspace.ap-southeast-1.maas.aliyuncs.com/api/v1",
64
+ "baseUrl": "https://dashscope.aliyuncs.com/api/v1",
49
65
  "models": {},
50
66
  "options": {
51
- "workspace": "your-workspace"
67
+ "protocol": "native"
52
68
  }
53
69
  }
54
70
  }
@@ -56,7 +72,29 @@ Each model must explicitly declare the operation it supports. A model name appea
56
72
  }
57
73
  ```
58
74
 
59
- A custom service needs an exact `baseUrl`, model ID, capability list, and generation or edit endpoint. Do not infer capabilities from the model name.
75
+ Qwen AI Platform image models use the public native DashScope endpoint `https://dashscope.aliyuncs.com/api/v1` and do not require a workspace or region. Only Bailian regional workspace deployments need `workspace`, `region`, and a matching workspace Base URL. `protocol` defaults to `native`; set it to `openai-compatible` only when that protocol is explicitly supported. The built-in set includes `qwen-image-3.0-pro`, `qwen-image-3.0`, `wan2.7-image-pro`, `wan2.7-image`, and `z-image-turbo`; the current Qwen Image 3.0 recommendation is `qwen-image-3.0-pro`, while actual entitlement remains account- and region-dependent.
76
+
77
+ Vertex AI can use a service-account JSON file:
78
+
79
+ ```json
80
+ {
81
+ "vertex": {
82
+ "enabled": true,
83
+ "credentialsFile": "F:/path/to/service-account.json",
84
+ "project": null,
85
+ "location": "global",
86
+ "models": {
87
+ "imagen-3.0-capability-001": {
88
+ "capabilities": ["text-to-image", "image-to-image", "edit"]
89
+ }
90
+ }
91
+ }
92
+ }
93
+ ```
94
+
95
+ The service-account file is used locally to obtain an OAuth token and is never written to output artifacts. If `project` is omitted, OmniScholar reads `project_id` from the JSON; `location` defaults to `global`. Model availability still depends on project permissions, location, and model publication status.
96
+
97
+ Atlas, fal, Vertex, and DashScope/Qwen expose different catalog capabilities. Atlas, fal, Vertex, and DashScope/Qwen have small built-in model sets checked against official documentation; custom services still need an exact `baseUrl`, model ID, capability list, and generation or edit endpoint. Do not infer capabilities from the model name or treat a built-in model as an entitlement guarantee.
60
98
 
61
99
  ## Generate and edit
62
100
 
@@ -67,8 +105,9 @@ Upload only images you may share with the selected service. After files are save
67
105
  ## Current provider notes
68
106
 
69
107
  - fal has been tested for queue submission, polling, data-URI results, text-to-image, and two-reference editing. If the local machine cannot resolve the fal CDN, a data-URI result can still be saved.
70
- - DashScope/Qwen currently needs a workspace-scoped endpoint or an explicit `baseUrl` supplied by the provider. China workspaces use an address such as `https://<workspace>.cn-beijing.maas.aliyuncs.com/api/v1`; international workspaces use `https://<workspace>.ap-southeast-1.maas.aliyuncs.com/api/v1`. A retired generic endpoint returns `dashscope_workspace_required`.
108
+ - DashScope/Qwen supports the Qwen AI Platform native endpoint `https://dashscope.aliyuncs.com/api/v1` and regional Bailian workspace endpoints such as `https://<workspace>.cn-beijing.maas.aliyuncs.com/api/v1`. When `workspace` and `region` are supplied, the tool can derive the regional endpoint.
71
109
  - Gemini's `apiKeyEnv` must name an environment variable that exists.
72
- - Atlas and custom services need a working endpoint and model description.
110
+ - Atlas Cloud uses `https://api.atlascloud.ai/api/v1`, submits to `model/generateImage`, and polls `model/prediction/{id}`. The built-in set includes official Nano Banana 2, GPT Image 2, and GPT Image 2.5 Flare/Sunburst IDs. Atlas image tasks are asynchronous and their `outputs` are saved locally.
111
+ - Custom services need a working endpoint and model description.
73
112
 
74
113
  Review text, structures, mechanisms, scale, and quantitative labels after generation. **AI images are illustrative drafts, not experimental data, real measurements, or scientific conclusions.**
@@ -8,13 +8,27 @@ OmniScholar 可连接 OpenAI、xAI、Gemini、Vertex AI、fal.ai、DashScope/Qwe
8
8
 
9
9
  | 工具 | 用途 |
10
10
  |---|---|
11
- | `omnischolar_image_models` | 查看已配置模型及其可用功能 |
11
+ | `omnischolar_image_models` | 发现并查看当前凭据可用模型及其功能 |
12
12
  | `omnischolar_image_generate` | 文生图、图生图或多参考图生成 |
13
13
  | `omnischolar_image_edit` | 编辑已有图片 |
14
14
  | `omnischolar_image_service` | 调用服务商已经支持的状态、模型或任务操作 |
15
15
  | `ai4scholar_figure` | 使用 Ai4Scholar 生成、编辑或矢量化图片 |
16
16
 
17
- 每个模型都必须明确声明支持的功能。模型名出现在服务商目录中,并不自动代表它可以生图或编辑;`omnischolar_image_models` 中对应功能需要显示 `usable: true`。
17
+ 模型选择顺序是:用户显式指定的模型、当前服务商目录中已确认能力的模型、经过官方文档核对的内置模型、显式配置的模型合同。省略模型时,工具会发现并选择最新的可用模型;没有模型目录的服务商使用内置的已核对模型,同时仍允许在 `models` 中显式覆盖或补充模型和能力。
18
+
19
+ 常用工具参数包括 `size`、`aspectRatio`、`resolution`、`background`、`outputFormat`、`quality`、`n`、`negativePrompt` 和 `seed`。调用前先读取模型描述中的 `supported_parameters`;工具会按服务商协议转换参数,不支持的参数组合会在提交请求前返回 `parameter_unsupported`,不会静默丢弃参数。
20
+
21
+ ### 官方参数能力矩阵
22
+
23
+ | 服务商/API | 已核对的参数 | 明确不应默认传入 |
24
+ |---|---|---|
25
+ | OpenAI GPT Image | `size`/`resolution`、`background`、`outputFormat`、`quality`、`n` | 独立 `aspectRatio` |
26
+ | Google Gemini API Interactions | `aspectRatio`、`resolution`(`1K`/`2K`)、`outputFormat` | `size`、`background`、`quality`、`n`、`seed` |
27
+ | Vertex Gemini image | `aspectRatio`、`resolution`(`1K`/`2K`/`4K`)、`outputFormat`、`n` | 透明背景、任意像素尺寸 |
28
+ | Fal Nano Banana 2 | `aspectRatio`、`resolution`、`outputFormat`、`n`、`seed` | `background`、`quality` |
29
+ | Fal GPT Image 变体 | `size`/`resolution`、`background`、`outputFormat`、`quality`、`n` | Nano Banana 专属参数 |
30
+ | DashScope/Qwen 原生图像 | `size`/`resolution`、`n`、`negativePrompt`、`seed` | `background`、`quality`、透明背景 |
31
+ | Atlas | 按模型合同;GPT Image 常见为 `size`、`quality`、`outputFormat` | 不要使用服务商级统一假设 |
18
32
 
19
33
  ## 配置示例
20
34
 
@@ -29,7 +43,7 @@ OmniScholar 可连接 OpenAI、xAI、Gemini、Vertex AI、fal.ai、DashScope/Qwe
29
43
  "fal": {
30
44
  "enabled": true,
31
45
  "apiKeyEnv": "OMNISCHOLAR_FAL_API_KEY",
32
- "baseUrl": "https://fal.run",
46
+ "baseUrl": "https://queue.fal.run",
33
47
  "models": {},
34
48
  "options": {}
35
49
  },
@@ -39,16 +53,18 @@ OmniScholar 可连接 OpenAI、xAI、Gemini、Vertex AI、fal.ai、DashScope/Qwe
39
53
  "baseUrl": "https://your-workspace.cn-beijing.maas.aliyuncs.com/api/v1",
40
54
  "models": {},
41
55
  "options": {
42
- "workspace": "your-workspace"
56
+ "workspace": "your-workspace",
57
+ "region": "cn-beijing",
58
+ "protocol": "native"
43
59
  }
44
60
  },
45
61
  "qwen-cloud": {
46
62
  "enabled": true,
47
63
  "apiKeyEnv": "OMNISCHOLAR_QWEN_API_KEY",
48
- "baseUrl": "https://your-workspace.ap-southeast-1.maas.aliyuncs.com/api/v1",
64
+ "baseUrl": "https://dashscope.aliyuncs.com/api/v1",
49
65
  "models": {},
50
66
  "options": {
51
- "workspace": "your-workspace"
67
+ "protocol": "native"
52
68
  }
53
69
  }
54
70
  }
@@ -56,7 +72,29 @@ OmniScholar 可连接 OpenAI、xAI、Gemini、Vertex AI、fal.ai、DashScope/Qwe
56
72
  }
57
73
  ```
58
74
 
59
- 自定义服务需要填写准确的 `baseUrl`、模型 ID、功能列表,以及生成或编辑接口。不要只凭模型名填写功能。
75
+ 千问 AI 平台图片模型使用公共 DashScope 原生接口 `https://dashscope.aliyuncs.com/api/v1`,不需要 workspace 或 region。只有百炼的地域 workspace 实例才需要填写 `workspace`、`region`,并使用对应的 workspace Base URL。`protocol` 默认是 `native`,只有明确配置为 `openai-compatible` 时才使用兼容端点。内置模型包括 `qwen-image-3.0-pro`、`qwen-image-3.0`、`wan2.7-image-pro`、`wan2.7-image` 和 `z-image-turbo`;其中当前 Qwen Image 3.0 推荐模型为 `qwen-image-3.0-pro`,具体生成权限仍以账号和地域为准。
76
+
77
+ Vertex AI 可使用 service-account JSON:
78
+
79
+ ```json
80
+ {
81
+ "vertex": {
82
+ "enabled": true,
83
+ "credentialsFile": "F:/path/to/service-account.json",
84
+ "project": null,
85
+ "location": "global",
86
+ "models": {
87
+ "imagen-3.0-capability-001": {
88
+ "capabilities": ["text-to-image", "image-to-image", "edit"]
89
+ }
90
+ }
91
+ }
92
+ }
93
+ ```
94
+
95
+ 服务账号文件只用于本地换取 OAuth token,不会写入输出结果。若省略 `project`,工具会从 JSON 的 `project_id` 自动读取;默认 `location` 为 `global`。模型是否可用仍取决于项目授权、区域和模型发布状态。
96
+
97
+ Atlas、fal、Vertex、DashScope/Qwen 和自定义服务的模型目录能力不同。Atlas、fal、Vertex、DashScope/Qwen 已提供少量基于官方文档核对的内置模型;自定义服务仍需要准确的 `baseUrl`、模型 ID、功能列表,以及生成或编辑接口。不要只凭模型名填写功能,也不要把内置模型视为账号已开通的保证。
60
98
 
61
99
  ## 生成与编辑
62
100
 
@@ -67,8 +105,9 @@ OmniScholar 可连接 OpenAI、xAI、Gemini、Vertex AI、fal.ai、DashScope/Qwe
67
105
  ## 当前服务说明
68
106
 
69
107
  - fal 已验证队列提交、轮询、data URI 结果、文生图和双参考图编辑。本机若无法解析 fal CDN,data URI 结果仍可保存。
70
- - DashScope/Qwen 当前需要绑定 workspace 的服务地址,或服务商明确提供的 `baseUrl`。中国区地址形如 `https://<workspace>.cn-beijing.maas.aliyuncs.com/api/v1`,国际区地址形如 `https://<workspace>.ap-southeast-1.maas.aliyuncs.com/api/v1`。旧通用地址会返回 `dashscope_workspace_required`。
108
+ - DashScope/Qwen 支持千问 AI 平台的通用原生地址 `https://dashscope.aliyuncs.com/api/v1`,也支持百炼按地域的 workspace 地址,例如 `https://<workspace>.cn-beijing.maas.aliyuncs.com/api/v1`。当填写 `workspace` 和 `region` 时,工具可以自动拼接地域地址。
71
109
  - Gemini 配置中的 `apiKeyEnv` 必须指向已存在的环境变量。
72
- - Atlas 和自定义服务必须给出可用的服务地址与模型说明。
110
+ - Atlas Cloud 使用 `https://api.atlascloud.ai/api/v1`、`model/generateImage` 提交和 `model/prediction/{id}` 轮询;默认内置 Nano Banana 2、GPT Image 2、GPT Image 2.5 Flare/Sunburst 的官方模型 ID。Atlas 的图片任务是异步的,结果中的 `outputs` 会保存到本地。
111
+ - 自定义服务必须给出可用的服务地址与模型说明。
73
112
 
74
113
  生成后仍需人工检查文字、结构、机制、比例和定量描述。**AI 图片是示意草稿,不是实验数据、真实测量或科研结论。**
@@ -9,6 +9,7 @@
9
9
  | `research_sources` | Show enabled sources and available operations |
10
10
  | `literature_search` | Search papers by year, type, or open-access status |
11
11
  | `literature_get` | Retrieve details by DOI, PMID/PMCID, arXiv ID, or source ID |
12
+ | `literature_author` | Search Semantic Scholar authors, author details, or an author's papers |
12
13
  | `literature_graph` | Find references, citations, or recommendations |
13
14
  | `journal_metrics` | Retrieve supported journal metrics |
14
15
  | `literature_fulltext` | Find lawful full-text locations or save an accessible file under the output directory |
@@ -25,7 +26,7 @@ The sources serve different purposes:
25
26
 
26
27
  Start with a small `limit`. Deduplicate by DOI when possible; otherwise compare normalized title, year, and first author. Title similarity can shortlist a paper but cannot establish that it supports a claim.
27
28
 
28
- On HTTP 429, OmniScholar returns a rate-limit result. Wait for the provider's backoff period or choose another source that supports the same operation. Do not submit the same request in a tight loop.
29
+ On HTTP 429, OmniScholar reads `Retry-After` when provided and applies bounded backoff plus optional `rateLimitPerSecond` throttling for Semantic Scholar. Do not submit the same request in a tight loop.
29
30
 
30
31
  ## Zotero
31
32
 
package/docs/RESEARCH.md CHANGED
@@ -9,6 +9,7 @@
9
9
  | `research_sources` | 查看已启用的数据源和可用功能 |
10
10
  | `literature_search` | 检索论文,可限制年份、类型和开放获取状态 |
11
11
  | `literature_get` | 按 DOI、PMID/PMCID、arXiv ID 或数据源 ID 获取详情 |
12
+ | `literature_author` | 查询 Semantic Scholar 作者、作者详情或作者论文列表 |
12
13
  | `literature_graph` | 查询参考文献、施引文献或推荐论文 |
13
14
  | `journal_metrics` | 查询已支持的期刊指标 |
14
15
  | `literature_fulltext` | 查找合法全文地址,或将允许访问的文件保存到输出目录 |
@@ -25,7 +26,7 @@
25
26
 
26
27
  检索时先用较小的 `limit`。优先按 DOI 去重;没有 DOI 时,再比较标题、年份和第一作者。标题相似只能用于筛选,不能代替正文证据。
27
28
 
28
- 遇到 HTTP 429 时,OmniScholar 会返回限流信息。等待服务商给出的时间后再试,或改用支持同一查询的数据源。不要连续提交相同请求。
29
+ 遇到 HTTP 429 时,OmniScholar 会读取 `Retry-After`(若服务商提供),并对 Semantic Scholar 使用有界退避和可选的 `rateLimitPerSecond`。仍应避免连续提交相同请求。
29
30
 
30
31
  ## Zotero
31
32
 
package/docs/TOOLS.en.md CHANGED
@@ -11,6 +11,7 @@ Tool and capability names match the values returned to agents.
11
11
  | `research_sources` | literature | `literature.sources` | none | no | none | free |
12
12
  | `literature_search` | literature | `literature.search` | none | yes | none | free |
13
13
  | `literature_get` | literature | `literature.lookup` | none | yes | none | free |
14
+ | `literature_author` | literature | `literature.lookup` | none | yes | none | free |
14
15
  | `literature_graph` | literature | `literature.references`, `literature.citations`, `literature.recommendations` | none | yes | none | free |
15
16
  | `journal_metrics` | literature | `journal.metrics` | none | yes | none | free |
16
17
  | `literature_fulltext` | literature | `fulltext.resolve`, `fulltext.fetch` | filesystem | yes | none | free |
package/docs/TOOLS.md CHANGED
@@ -11,6 +11,7 @@
11
11
  | `research_sources` | literature | `literature.sources` | none | no | none | free |
12
12
  | `literature_search` | literature | `literature.search` | none | yes | none | free |
13
13
  | `literature_get` | literature | `literature.lookup` | none | yes | none | free |
14
+ | `literature_author` | literature | `literature.lookup` | none | yes | none | free |
14
15
  | `literature_graph` | literature | `literature.references`, `literature.citations`, `literature.recommendations` | none | yes | none | free |
15
16
  | `journal_metrics` | literature | `journal.metrics` | none | yes | none | free |
16
17
  | `literature_fulltext` | literature | `fulltext.resolve`, `fulltext.fetch` | filesystem | yes | none | free |
@@ -151,8 +151,9 @@
151
151
  "enabled": true,
152
152
  "apiKey": "",
153
153
  "apiKeyEnv": null,
154
- "project": "your-project",
155
- "location": "us-central1",
154
+ "credentialsFile": null,
155
+ "project": null,
156
+ "location": "global",
156
157
  "models": {},
157
158
  "options": {}
158
159
  },
@@ -168,7 +169,7 @@
168
169
  "enabled": true,
169
170
  "apiKey": "",
170
171
  "apiKeyEnv": null,
171
- "baseUrl": "https://fal.run",
172
+ "baseUrl": "https://queue.fal.run",
172
173
  "models": {},
173
174
  "options": {}
174
175
  },
@@ -179,26 +180,33 @@
179
180
  "baseUrl": "https://your-workspace.cn-beijing.maas.aliyuncs.com/api/v1",
180
181
  "models": {},
181
182
  "options": {
182
- "workspace": "your-workspace"
183
+ "workspace": "your-workspace",
184
+ "region": "cn-beijing",
185
+ "protocol": "native"
183
186
  }
184
187
  },
185
188
  "qwen-cloud": {
186
189
  "enabled": true,
187
190
  "apiKey": "",
188
191
  "apiKeyEnv": null,
189
- "baseUrl": "https://your-workspace.ap-southeast-1.maas.aliyuncs.com/api/v1",
192
+ "baseUrl": "https://dashscope.aliyuncs.com/api/v1",
190
193
  "models": {},
191
194
  "options": {
192
- "workspace": "your-workspace"
195
+ "protocol": "native"
193
196
  }
194
197
  },
195
198
  "atlas": {
196
199
  "enabled": true,
197
200
  "apiKey": "",
198
201
  "apiKeyEnv": null,
199
- "baseUrl": "https://your-atlas-provider.example/v1",
202
+ "baseUrl": "https://api.atlascloud.ai/api/v1",
200
203
  "models": {},
201
- "options": {}
204
+ "options": {
205
+ "generationEndpoint": "model/generateImage",
206
+ "pollEndpoint": "model/prediction",
207
+ "pollIntervalSeconds": 2,
208
+ "pollTimeoutSeconds": 600
209
+ }
202
210
  },
203
211
  "custom": {
204
212
  "enabled": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luffysolution/omnischolar-pi",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "Pi MCP bridge for the OmniScholar research toolkit",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2
2
  import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
3
3
  import { Type } from "typebox";
4
- const CLIENT_INFO = { name: "omnischolar-pi", version: "0.1.17" };
4
+ const CLIENT_INFO = { name: "omnischolar-pi", version: "0.1.19" };
5
5
  export function resultText(result) {
6
6
  return result.content
7
7
  .map((item) => {