viatris-exam-cli 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -148,18 +148,18 @@ viatris-exam questions version "$QUESTION_ID" --input version.json
148
148
  ```bash
149
149
  viatris-exam medical-search search "阿托伐他汀 适应症" \
150
150
  --file-type drug \
151
- --limit 4 \
151
+ --limit 20 \
152
152
  --max-length 1200
153
153
  ```
154
154
 
155
155
  也可提交完整 JSON:
156
156
 
157
157
  ```bash
158
- printf '%s' '{"query":"阿托伐他汀 适应症","limit":4}' |
158
+ printf '%s' '{"query":"阿托伐他汀 适应症","limit":20}' |
159
159
  viatris-exam medical-search search
160
160
  ```
161
161
 
162
- 响应中的 `rawJson` 已是结构化对象,可直接读取 `rawJson.documents`,无需再次 `JSON.parse`。
162
+ `limit` 允许 1-20,省略时默认为 20。响应中的 `rawJson` 已是结构化对象,可直接读取 `rawJson.documents`,无需再次 `JSON.parse`。
163
163
 
164
164
  ## 错误格式
165
165
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viatris-exam-cli",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Agent-friendly CLI for the Viatris exam OpenAPI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: viatris-exam-cli
3
3
  description: Operate the Viatris exam OpenAPI through its agent-friendly CLI. Use for products, knowledge nodes or documents, generation tasks, exam records, scoring, exams, questions, or medical search.
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  ---
6
6
 
7
7
  # Viatris Exam CLI
@@ -24,6 +24,7 @@ Use the repository-local CLI for every supported API operation. Do not call the
24
24
  - Parse failed `stderr` as JSON and branch on both exit code and `error.type`.
25
25
  - Preserve `externalRef` when retrying question submission. It is the idempotency key.
26
26
  - For product-wide generation tasks, create one or more questions for every entry in `knowledgeContexts` and include its `knowledgeNodeId`.
27
+ - Apply every returned generation rule. Product-scoped rules identify applicable product codes through `products`; global rules return an empty `products` array.
27
28
  - Prefer scoring rule V2 for generated questions and scoring results. Use stable point and deduction-rule IDs.
28
29
  - Treat product IDs as hidden containers, not knowledge-tree levels. Fixed dimensions are business L1; generated nodes are L2-L4.
29
30
  - Do not automatically retry POST, PUT, PATCH, or DELETE commands. Inspect the returned error and determine whether the server accepted the request.
@@ -173,6 +173,8 @@ node src/cli.js gen-tasks get "$TASK_ID" --compact
173
173
 
174
174
  For a leaf-node task, `knowledgeContext` is the mandatory target context. For a product-wide task, `dimension` is `all`, `knowledgeContext` is null, and `knowledgeContexts` contains every leaf context. Generate `questionsPerNode` questions for every listed context and follow all returned `rules`.
175
175
 
176
+ Each rule has `scope` and `products`. For `scope: "product"`, `products` contains one or more applicable product codes. For `scope: "global"`, `products` is an empty array. Do not read the removed single-value `product` field.
177
+
176
178
  Submit generated questions:
177
179
 
178
180
  ```bash
@@ -327,7 +329,7 @@ Search medical evidence:
327
329
  ```bash
328
330
  node src/cli.js medical-search search "阿托伐他汀 适应症" \
329
331
  --file-type drug \
330
- --limit 4 \
332
+ --limit 20 \
331
333
  --max-length 1200 \
332
334
  --compact
333
335
  ```
@@ -335,11 +337,11 @@ node src/cli.js medical-search search "阿托伐他汀 适应症" \
335
337
  Or use JSON:
336
338
 
337
339
  ```bash
338
- printf '%s' '{"query":"阿托伐他汀 适应症","limit":4}' |
340
+ printf '%s' '{"query":"阿托伐他汀 适应症","limit":20}' |
339
341
  node src/cli.js medical-search search --compact
340
342
  ```
341
343
 
342
- Do not combine query flags with JSON input.
344
+ Do not combine query flags with JSON input. `limit` accepts 1-20 and defaults to 20 when omitted. `maxLength` defaults to 1200.
343
345
 
344
346
  The response `rawJson` is already a structured object. Read `rawJson.documents` directly; do not call `JSON.parse`. Each result contains `rank`, `doc_info`, optional `medical_info`, and the upstream `logid`.
345
347
 
Binary file
package/src/help.js CHANGED
@@ -39,6 +39,9 @@ Input:
39
39
  --json <object> Pass a JSON object inline.
40
40
  Piped stdin Used automatically by commands that require JSON.
41
41
 
42
+ Medical search:
43
+ --limit defaults to 20 when omitted; valid range is 1..20.
44
+
42
45
  Global options:
43
46
  --base-url <url> Override the selected environment URL.
44
47
  --key-header <name> Override VIATRIS_API_KEY_HEADER (default: X-API-Key).
package/src/metadata.js CHANGED
@@ -1,4 +1,4 @@
1
- export const VERSION = "1.4.0";
1
+ export const VERSION = "1.4.1";
2
2
  export const DEFAULT_TIMEOUT_MS = 30_000;
3
3
  export const DEFAULT_RETRIES = 2;
4
4
 
@@ -182,7 +182,7 @@ export const COMMANDS = Object.freeze([
182
182
  path: "/openapi/medical-search",
183
183
  options: {
184
184
  "--file-type": "string",
185
- "--limit": "integer:1..20",
185
+ "--limit": "integer:1..20 (default:20)",
186
186
  "--max-length": "integer:100..5000",
187
187
  },
188
188
  input: "query flags or a JSON object",