matvenus-cli 0.1.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 (47) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/LICENSE +201 -0
  3. package/README.md +408 -0
  4. package/bin/cli.js +3 -0
  5. package/dist/client.d.ts +13 -0
  6. package/dist/client.js +62 -0
  7. package/dist/commands/alphafold_protein_folding.d.ts +2 -0
  8. package/dist/commands/alphafold_protein_folding.js +262 -0
  9. package/dist/commands/cancel_tool_result.d.ts +2 -0
  10. package/dist/commands/cancel_tool_result.js +388 -0
  11. package/dist/commands/diffdock_protein_ligand_docking.d.ts +2 -0
  12. package/dist/commands/diffdock_protein_ligand_docking.js +252 -0
  13. package/dist/commands/esmfold_protein_folding.d.ts +2 -0
  14. package/dist/commands/esmfold_protein_folding.js +219 -0
  15. package/dist/commands/get_tool_result.d.ts +2 -0
  16. package/dist/commands/get_tool_result.js +388 -0
  17. package/dist/commands/gromacs_analysis.d.ts +2 -0
  18. package/dist/commands/gromacs_analysis.js +212 -0
  19. package/dist/commands/gromacs_md.d.ts +2 -0
  20. package/dist/commands/gromacs_md.js +236 -0
  21. package/dist/commands/index.d.ts +2 -0
  22. package/dist/commands/index.js +39 -0
  23. package/dist/commands/predict_functional_residue.d.ts +2 -0
  24. package/dist/commands/predict_functional_residue.js +234 -0
  25. package/dist/commands/predict_protein_properties.d.ts +2 -0
  26. package/dist/commands/predict_protein_properties.js +228 -0
  27. package/dist/commands/proteinmpnn_sequence_design.d.ts +2 -0
  28. package/dist/commands/proteinmpnn_sequence_design.js +271 -0
  29. package/dist/commands/rfdiffusion_protein_design.d.ts +2 -0
  30. package/dist/commands/rfdiffusion_protein_design.js +333 -0
  31. package/dist/commands/upload_file_base_64.d.ts +2 -0
  32. package/dist/commands/upload_file_base_64.js +212 -0
  33. package/dist/commands/venusg_protein_function_prediction.d.ts +2 -0
  34. package/dist/commands/venusg_protein_function_prediction.js +234 -0
  35. package/dist/commands/venusmine_protein_mining.d.ts +2 -0
  36. package/dist/commands/venusmine_protein_mining.js +212 -0
  37. package/dist/commands/venusprime_multipoint_prediction.d.ts +2 -0
  38. package/dist/commands/venusprime_multipoint_prediction.js +322 -0
  39. package/dist/commands/venusrem_mutation_prediction.d.ts +2 -0
  40. package/dist/commands/venusrem_mutation_prediction.js +260 -0
  41. package/dist/commands/venusx_functional_residue_prediction.d.ts +2 -0
  42. package/dist/commands/venusx_functional_residue_prediction.js +234 -0
  43. package/dist/index.d.ts +2 -0
  44. package/dist/index.js +125 -0
  45. package/dist/types.d.ts +12 -0
  46. package/dist/types.js +6 -0
  47. package/package.json +41 -0
@@ -0,0 +1,388 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.register = register;
4
+ const client_1 = require("../client");
5
+ function register(program, baseUrl) {
6
+ program
7
+ .command('cancel-tool-result')
8
+ .description('Cancel Tool Result')
9
+ .requiredOption('--tool-call-id <value>', 'tool_call_id')
10
+ .option('--base-url <url>', 'Override base URL')
11
+ .option('--output <format>', 'Output format: json, table', 'json')
12
+ .option('--schema', 'Show API schema and exit')
13
+ .action(async (options) => {
14
+ if (options.schema) {
15
+ console.log(JSON.stringify({
16
+ "method": "post",
17
+ "operationId": "cancel_tool_result",
18
+ "summary": "Cancel Tool Result",
19
+ "description": "取消处于 pending 或 running 状态的工具任务。\n如果工具包含 Slurm 任务,会先取消 Slurm 任务再更新状态。\n通过 API Key 鉴权。",
20
+ "tags": [
21
+ "tools-results"
22
+ ],
23
+ "parameters": [
24
+ {
25
+ "name": "tool_call_id",
26
+ "in": "path",
27
+ "required": true,
28
+ "schema": {
29
+ "type": "string",
30
+ "title": "Tool Call Id"
31
+ },
32
+ "type": "string"
33
+ }
34
+ ],
35
+ "responses": [
36
+ {
37
+ "statusCode": "200",
38
+ "description": "Successful Response",
39
+ "contentType": "application/json",
40
+ "schema": {
41
+ "properties": {
42
+ "id": {
43
+ "type": "string",
44
+ "title": "Id",
45
+ "description": "工具结果ID"
46
+ },
47
+ "session_id": {
48
+ "anyOf": [
49
+ {
50
+ "type": "string"
51
+ },
52
+ {
53
+ "type": "null"
54
+ }
55
+ ],
56
+ "title": "Session Id",
57
+ "description": "会话ID"
58
+ },
59
+ "tool_call_id": {
60
+ "type": "string",
61
+ "title": "Tool Call Id",
62
+ "description": "工具调用ID"
63
+ },
64
+ "tool_result": {
65
+ "anyOf": [
66
+ {},
67
+ {
68
+ "type": "null"
69
+ }
70
+ ],
71
+ "title": "Tool Result",
72
+ "description": "工具执行结果"
73
+ },
74
+ "tool_name": {
75
+ "anyOf": [
76
+ {
77
+ "type": "string"
78
+ },
79
+ {
80
+ "type": "null"
81
+ }
82
+ ],
83
+ "title": "Tool Name",
84
+ "description": "工具名称"
85
+ },
86
+ "tool_name_desc": {
87
+ "anyOf": [
88
+ {
89
+ "type": "string"
90
+ },
91
+ {
92
+ "type": "null"
93
+ }
94
+ ],
95
+ "title": "Tool Name Desc",
96
+ "description": "显示工具名称"
97
+ },
98
+ "tool_type": {
99
+ "anyOf": [
100
+ {
101
+ "type": "string"
102
+ },
103
+ {
104
+ "type": "null"
105
+ }
106
+ ],
107
+ "title": "Tool Type",
108
+ "description": "工具类型"
109
+ },
110
+ "tool_args": {
111
+ "anyOf": [
112
+ {
113
+ "additionalProperties": true,
114
+ "type": "object"
115
+ },
116
+ {
117
+ "type": "null"
118
+ }
119
+ ],
120
+ "title": "Tool Args",
121
+ "description": "工具参数"
122
+ },
123
+ "status": {
124
+ "description": "执行状态:pending(排队中), running(运行中), success(成功), error(错误)",
125
+ "type": "string",
126
+ "enum": [
127
+ "pending",
128
+ "running",
129
+ "success",
130
+ "error"
131
+ ],
132
+ "title": "ToolResultStatus"
133
+ },
134
+ "error_message": {
135
+ "anyOf": [
136
+ {
137
+ "type": "string"
138
+ },
139
+ {
140
+ "type": "null"
141
+ }
142
+ ],
143
+ "title": "Error Message",
144
+ "description": "错误信息"
145
+ },
146
+ "started_at": {
147
+ "type": "string",
148
+ "format": "date-time",
149
+ "title": "Started At",
150
+ "description": "开始时间"
151
+ },
152
+ "completed_at": {
153
+ "anyOf": [
154
+ {
155
+ "type": "string",
156
+ "format": "date-time"
157
+ },
158
+ {
159
+ "type": "null"
160
+ }
161
+ ],
162
+ "title": "Completed At",
163
+ "description": "完成时间"
164
+ },
165
+ "slurm_tasks": {
166
+ "items": {
167
+ "properties": {
168
+ "id": {
169
+ "type": "string",
170
+ "title": "Id",
171
+ "description": "任务ID"
172
+ },
173
+ "slurm_job_id": {
174
+ "type": "string",
175
+ "title": "Slurm Job Id",
176
+ "description": "Slurm作业ID"
177
+ },
178
+ "status": {
179
+ "type": "string",
180
+ "title": "Status",
181
+ "description": "任务状态"
182
+ },
183
+ "task_type": {
184
+ "anyOf": [
185
+ {
186
+ "type": "string"
187
+ },
188
+ {
189
+ "type": "null"
190
+ }
191
+ ],
192
+ "title": "Task Type",
193
+ "description": "任务类型"
194
+ },
195
+ "resource_type": {
196
+ "anyOf": [
197
+ {
198
+ "type": "string"
199
+ },
200
+ {
201
+ "type": "null"
202
+ }
203
+ ],
204
+ "title": "Resource Type",
205
+ "description": "资源类型: GPU/CPU"
206
+ },
207
+ "run_time": {
208
+ "anyOf": [
209
+ {
210
+ "type": "integer"
211
+ },
212
+ {
213
+ "type": "null"
214
+ }
215
+ ],
216
+ "title": "Run Time",
217
+ "description": "运行时长(秒)"
218
+ },
219
+ "credits_cost": {
220
+ "anyOf": [
221
+ {
222
+ "type": "number"
223
+ },
224
+ {
225
+ "type": "null"
226
+ }
227
+ ],
228
+ "title": "Credits Cost",
229
+ "description": "该任务积分消耗"
230
+ },
231
+ "started_at": {
232
+ "anyOf": [
233
+ {
234
+ "type": "string",
235
+ "format": "date-time"
236
+ },
237
+ {
238
+ "type": "null"
239
+ }
240
+ ],
241
+ "title": "Started At",
242
+ "description": "开始时间"
243
+ },
244
+ "completed_at": {
245
+ "anyOf": [
246
+ {
247
+ "type": "string",
248
+ "format": "date-time"
249
+ },
250
+ {
251
+ "type": "null"
252
+ }
253
+ ],
254
+ "title": "Completed At",
255
+ "description": "完成时间"
256
+ },
257
+ "error_message": {
258
+ "anyOf": [
259
+ {
260
+ "type": "string"
261
+ },
262
+ {
263
+ "type": "null"
264
+ }
265
+ ],
266
+ "title": "Error Message",
267
+ "description": "错误信息"
268
+ }
269
+ },
270
+ "type": "object",
271
+ "required": [
272
+ "id",
273
+ "slurm_job_id",
274
+ "status"
275
+ ],
276
+ "title": "SlurmTaskInfo",
277
+ "description": "Slurm任务信息(嵌入ToolResult响应)"
278
+ },
279
+ "type": "array",
280
+ "title": "Slurm Tasks",
281
+ "description": "关联的Slurm任务列表"
282
+ }
283
+ },
284
+ "type": "object",
285
+ "required": [
286
+ "id",
287
+ "tool_call_id",
288
+ "status",
289
+ "started_at"
290
+ ],
291
+ "title": "ToolResultResponse",
292
+ "description": "工具结果响应模型"
293
+ },
294
+ "isBinary": false
295
+ },
296
+ {
297
+ "statusCode": "422",
298
+ "description": "Validation Error",
299
+ "contentType": "application/json",
300
+ "schema": {
301
+ "properties": {
302
+ "detail": {
303
+ "items": {
304
+ "properties": {
305
+ "loc": {
306
+ "items": {
307
+ "anyOf": [
308
+ {
309
+ "type": "string"
310
+ },
311
+ {
312
+ "type": "integer"
313
+ }
314
+ ]
315
+ },
316
+ "type": "array",
317
+ "title": "Location"
318
+ },
319
+ "msg": {
320
+ "type": "string",
321
+ "title": "Message"
322
+ },
323
+ "type": {
324
+ "type": "string",
325
+ "title": "Error Type"
326
+ }
327
+ },
328
+ "type": "object",
329
+ "required": [
330
+ "loc",
331
+ "msg",
332
+ "type"
333
+ ],
334
+ "title": "ValidationError"
335
+ },
336
+ "type": "array",
337
+ "title": "Detail"
338
+ }
339
+ },
340
+ "type": "object",
341
+ "title": "HTTPValidationError"
342
+ },
343
+ "isBinary": false
344
+ }
345
+ ],
346
+ "security": [
347
+ "HTTPBearer"
348
+ ]
349
+ }, null, 2));
350
+ return;
351
+ }
352
+ try {
353
+ const currentBaseUrl = options.baseUrl || baseUrl;
354
+ const config = { baseUrl: currentBaseUrl };
355
+ const pathParams = {
356
+ ['tool_call_id']: options.toolCallId,
357
+ };
358
+ const path = (0, client_1.buildPath)('/api/tools/results/{tool_call_id}/cancel', pathParams);
359
+ const url = path;
360
+ const response = await (0, client_1.request)(config, {
361
+ method: 'post',
362
+ path: url,
363
+ headers: undefined,
364
+ body: undefined,
365
+ isBinary: false,
366
+ });
367
+ const data = response;
368
+ if (options.output === 'json') {
369
+ console.log(JSON.stringify(data, null, 2));
370
+ }
371
+ else {
372
+ console.log(data);
373
+ }
374
+ }
375
+ catch (error) {
376
+ if (error.status) {
377
+ console.error('API Error:', error.status, error.message);
378
+ if (error.data) {
379
+ console.error(JSON.stringify(error.data, null, 2));
380
+ }
381
+ }
382
+ else {
383
+ console.error('Error:', error.message);
384
+ }
385
+ process.exit(1);
386
+ }
387
+ });
388
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function register(program: Command, baseUrl: string): void;
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.register = register;
4
+ const client_1 = require("../client");
5
+ function register(program, baseUrl) {
6
+ program
7
+ .command('diffdock-protein-ligand-docking')
8
+ .description('Diffdock Docking')
9
+ .option('--body <json>', 'Request body as JSON string', (value) => value)
10
+ .option('--base-url <url>', 'Override base URL')
11
+ .option('--output <format>', 'Output format: json, table', 'json')
12
+ .option('--schema', 'Show API schema and exit')
13
+ .action(async (options) => {
14
+ if (options.schema) {
15
+ console.log(JSON.stringify({
16
+ "method": "post",
17
+ "operationId": "diffdock_protein_ligand_docking",
18
+ "summary": "Diffdock Docking",
19
+ "tags": [
20
+ "tools-predict"
21
+ ],
22
+ "parameters": [],
23
+ "requestBody": {
24
+ "required": true,
25
+ "contentType": "application/json",
26
+ "schema": {
27
+ "properties": {
28
+ "protein_path": {
29
+ "anyOf": [
30
+ {
31
+ "type": "string"
32
+ },
33
+ {
34
+ "type": "null"
35
+ }
36
+ ],
37
+ "title": "Protein Path",
38
+ "description": "OSS URL to protein PDB file"
39
+ },
40
+ "protein_sequence": {
41
+ "anyOf": [
42
+ {
43
+ "type": "string"
44
+ },
45
+ {
46
+ "type": "null"
47
+ }
48
+ ],
49
+ "title": "Protein Sequence",
50
+ "description": "Protein sequence (will be folded using ESMFold if protein_path not provided)"
51
+ },
52
+ "ligand": {
53
+ "anyOf": [
54
+ {
55
+ "type": "string"
56
+ },
57
+ {
58
+ "type": "null"
59
+ }
60
+ ],
61
+ "title": "Ligand",
62
+ "description": "Ligand SMILES string or OSS URL to ligand file (.sdf, .mol2, etc.)"
63
+ },
64
+ "protein_ligand_csv": {
65
+ "anyOf": [
66
+ {
67
+ "type": "string"
68
+ },
69
+ {
70
+ "type": "null"
71
+ }
72
+ ],
73
+ "title": "Protein Ligand Csv",
74
+ "description": "OSS URL to CSV file containing multiple protein-ligand pairs with columns: complex_name, protein_path, ligand_description, protein_sequence"
75
+ },
76
+ "num_poses": {
77
+ "type": "integer",
78
+ "title": "Num Poses",
79
+ "description": "Number of poses to generate per complex (default: 10)",
80
+ "default": 10
81
+ }
82
+ },
83
+ "type": "object",
84
+ "title": "DiffDockInput",
85
+ "description": "Input for DiffDock protein-ligand docking prediction"
86
+ },
87
+ "isBinary": false
88
+ },
89
+ "responses": [
90
+ {
91
+ "statusCode": "200",
92
+ "description": "Successful Response",
93
+ "contentType": "application/json",
94
+ "schema": {
95
+ "properties": {
96
+ "tool_call_id": {
97
+ "type": "string",
98
+ "title": "Tool Call Id",
99
+ "description": "系统生成的调用唯一ID"
100
+ },
101
+ "status": {
102
+ "description": "调用状态: running, success, error 等",
103
+ "type": "string",
104
+ "enum": [
105
+ "pending",
106
+ "running",
107
+ "success",
108
+ "error"
109
+ ],
110
+ "title": "ToolResultStatus"
111
+ },
112
+ "result": {
113
+ "anyOf": [
114
+ {},
115
+ {
116
+ "type": "null"
117
+ }
118
+ ],
119
+ "title": "Result",
120
+ "description": "如果即时成功,这里是工具的返回结果字典"
121
+ },
122
+ "error_message": {
123
+ "anyOf": [
124
+ {
125
+ "type": "string"
126
+ },
127
+ {
128
+ "type": "null"
129
+ }
130
+ ],
131
+ "title": "Error Message",
132
+ "description": "如果有错误,提供错误信息"
133
+ },
134
+ "credits_cost": {
135
+ "anyOf": [
136
+ {
137
+ "type": "number"
138
+ },
139
+ {
140
+ "type": "null"
141
+ }
142
+ ],
143
+ "title": "Credits Cost",
144
+ "description": "消费积分"
145
+ },
146
+ "tool_name": {
147
+ "type": "string",
148
+ "title": "Tool Name",
149
+ "description": "执行的工具名"
150
+ }
151
+ },
152
+ "type": "object",
153
+ "required": [
154
+ "tool_call_id",
155
+ "status",
156
+ "tool_name"
157
+ ],
158
+ "title": "ToolInvokeResponse"
159
+ },
160
+ "isBinary": false
161
+ },
162
+ {
163
+ "statusCode": "422",
164
+ "description": "Validation Error",
165
+ "contentType": "application/json",
166
+ "schema": {
167
+ "properties": {
168
+ "detail": {
169
+ "items": {
170
+ "properties": {
171
+ "loc": {
172
+ "items": {
173
+ "anyOf": [
174
+ {
175
+ "type": "string"
176
+ },
177
+ {
178
+ "type": "integer"
179
+ }
180
+ ]
181
+ },
182
+ "type": "array",
183
+ "title": "Location"
184
+ },
185
+ "msg": {
186
+ "type": "string",
187
+ "title": "Message"
188
+ },
189
+ "type": {
190
+ "type": "string",
191
+ "title": "Error Type"
192
+ }
193
+ },
194
+ "type": "object",
195
+ "required": [
196
+ "loc",
197
+ "msg",
198
+ "type"
199
+ ],
200
+ "title": "ValidationError"
201
+ },
202
+ "type": "array",
203
+ "title": "Detail"
204
+ }
205
+ },
206
+ "type": "object",
207
+ "title": "HTTPValidationError"
208
+ },
209
+ "isBinary": false
210
+ }
211
+ ],
212
+ "security": [
213
+ "HTTPBearer"
214
+ ]
215
+ }, null, 2));
216
+ return;
217
+ }
218
+ try {
219
+ const currentBaseUrl = options.baseUrl || baseUrl;
220
+ const config = { baseUrl: currentBaseUrl };
221
+ const path = '/api/tools/predict/diffdock';
222
+ const url = path;
223
+ const body = options.body ? JSON.parse(options.body) : undefined;
224
+ const response = await (0, client_1.request)(config, {
225
+ method: 'post',
226
+ path: url,
227
+ headers: undefined,
228
+ body: body,
229
+ isBinary: false,
230
+ });
231
+ const data = response;
232
+ if (options.output === 'json') {
233
+ console.log(JSON.stringify(data, null, 2));
234
+ }
235
+ else {
236
+ console.log(data);
237
+ }
238
+ }
239
+ catch (error) {
240
+ if (error.status) {
241
+ console.error('API Error:', error.status, error.message);
242
+ if (error.data) {
243
+ console.error(JSON.stringify(error.data, null, 2));
244
+ }
245
+ }
246
+ else {
247
+ console.error('Error:', error.message);
248
+ }
249
+ process.exit(1);
250
+ }
251
+ });
252
+ }
@@ -0,0 +1,2 @@
1
+ import { Command } from 'commander';
2
+ export declare function register(program: Command, baseUrl: string): void;