@helixlife-ai/xiantao 0.1.12 → 0.1.14

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
@@ -36,10 +36,13 @@ This starts a menu-driven path for choosing a tool, selecting demo data or a loc
36
36
  ```bash
37
37
  xt tool prepare violin_flat --file ./data.xlsx --profile opencode --json
38
38
  xt tool exec violin_flat --file ./data.xlsx --profile opencode --json
39
+ xt tool exec violin_flat --file ./data.xlsx --profile opencode --json --download ./violin.pdf
39
40
  ```
40
41
 
41
42
  For machine callers, use `xt tool prepare` to fetch the upload-dependent final schema, then `xt tool exec` to submit. Keep `--json`, pass an explicit profile with `--profile`, and avoid interactive-only flows.
42
43
 
44
+ For agent workflows, do not use `xt tool run`. Treat `xt tool run` as the human-first path and `xt tool exec` as the machine path.
45
+
43
46
  `xt login --json` now returns the authorization link immediately and defaults to `authorized: false` until the browser step completes. Use `xt login --json --wait` when you explicitly want the command to block until authorization is confirmed. `xt status` is a probe-style check and returns `authorized: true` or `authorized: false` together with a reason such as `missing_token` or `expired_token`.
44
47
 
45
48
  ## Command Groups
@@ -71,7 +74,9 @@ For machine callers, use `xt tool prepare` to fetch the upload-dependent final s
71
74
 
72
75
  For the common Xiantao tool product, `tool search`, `tool inspect`, `tool run`, `tool resolve`, and `tool menu` default `toolProductUuid` to `c0b6febb-52dd-4525-970a-61bbe9e263ff`. You can override it with `--toolProductUuid`, `XIANTAO_TOOL_PRODUCT_UUID`, or `~/.config/xtz/config.json` under `xiantao.toolProductUuid`.
73
76
 
74
- `xt tool search <keyword>` searches remote tool menus by tool id, title, path, and route. `xt tool inspect <tool_id>` prints resolved metadata together with the dynamic `args_main` schema used by the tool. `xt tool run <tool_id>` runs a Xiantao bioinformatics tool. `xt tool resolve <tool_id>` remains available as the low-level UUID and route lookup. `--demo` reuses the demo file metadata returned by `tool fetch-all`; otherwise `tool run` uploads the local file first and therefore also needs token auth. Run `xt login` first to authorize the stored token. When a tool exposes multiple downloadable results, `--download <path>` uses the output file extension to select the matching artifact.
77
+ The CLI also loads a project-root `.env` file on startup. You can set `XIANTAO_BASE_URL=https://agent.helixlife.cn` there to switch the API base URL without prefixing each command manually.
78
+
79
+ `xt tool search <keyword>` searches remote tool menus by tool id, title, path, and route. `xt tool inspect <tool_id>` prints resolved metadata together with the dynamic `args_main` schema used by the tool. `xt tool run <tool_id>` runs a Xiantao bioinformatics tool in the human-first path. `xt tool exec <tool_id>` is the agent-safe submit command and also supports `--download <path>` when a local artifact is needed. `xt tool resolve <tool_id>` remains available as the low-level UUID and route lookup. `--demo` reuses the demo file metadata returned by `tool fetch-all`; otherwise `tool run` uploads the local file first and therefore also needs token auth. Run `xt login` first to authorize the stored token. When a tool exposes multiple downloadable results, `--download <path>` uses the output file extension to select the matching artifact.
75
80
 
76
81
  `xt tool run <tool_id> ... --interactive` prompts for dynamic `args_main` values before the final submit, prints reusable `--set` flags, and supports `<` for the previous item plus `/skip` for the current section.
77
82
 
package/bin/dev.js CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import {execute} from '@oclif/core'
4
+ import {loadProjectEnv} from './load-env.js'
4
5
 
6
+ loadProjectEnv()
5
7
  await execute({development: true, dir: import.meta.url})
@@ -0,0 +1,12 @@
1
+ import path from 'node:path'
2
+ import {loadEnvFile} from 'node:process'
3
+
4
+ export function loadProjectEnv() {
5
+ try {
6
+ loadEnvFile(path.join(process.cwd(), '.env'))
7
+ } catch (error) {
8
+ if (error?.code !== 'ENOENT') {
9
+ throw error
10
+ }
11
+ }
12
+ }
package/bin/run.js CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import {execute} from '@oclif/core'
4
+ import {loadProjectEnv} from './load-env.js'
4
5
 
6
+ loadProjectEnv()
5
7
  await execute({dir: import.meta.url})
@@ -6,7 +6,7 @@ import { plotOverrideFlags } from '../../lib/plot-options.js';
6
6
  import { ToolRunCommandBase } from '../plot/run.js';
7
7
  export default class ToolExec extends ToolRunCommandBase {
8
8
  static description = 'Execute a Xiantao bioinformatics tool in agent mode';
9
- static usage = 'tool exec <tool> (--file <value> | --demo) --json';
9
+ static usage = 'tool exec <tool> (--file <value> | --demo) --json [--download <path>]';
10
10
  static args = {
11
11
  tool: Args.string({
12
12
  description: 'Tool id, e.g. violin_flat',
@@ -24,7 +24,7 @@ export default class ToolExec extends ToolRunCommandBase {
24
24
  description: 'Use the module demo data returned by fetch-all instead of uploading a local file',
25
25
  }),
26
26
  download: Flags.string({
27
- hidden: true,
27
+ description: 'Download the generated file or preferred analysis result to this local path after submission',
28
28
  }),
29
29
  file: Flags.string({
30
30
  description: 'Path to the local xlsx file',
@@ -71,7 +71,6 @@ export default class ToolExec extends ToolRunCommandBase {
71
71
  }
72
72
  const result = await this.executeToolRun(args.tool, filePath, {
73
73
  ...flags,
74
- download: undefined,
75
74
  interactive: false,
76
75
  });
77
76
  const profile = await this.getProfile(flags.profile);
@@ -1,10 +1,11 @@
1
1
  export const DEFAULT_AGENT = 'opencode';
2
2
  export const XTZ_CONFIG_PATH = '.config/xtz/config.json';
3
3
  export const XTZ_UPDATE_CHECK_PATH = '.config/xtz/update-check.json';
4
- export const AUTH_URL_ENDPOINT = 'https://agent.helixlife.net/api/v1/agent/skills/auth-url';
5
- export const XIANTAO_BIO_API_ENDPOINT = 'https://agent.helixlife.net/api/v1/agent/bio-api';
6
- export const XIANTAO_TOOL_MENUS_ENDPOINT = 'https://agent.helixlife.net/api/v1/agent/tool/menus';
4
+ export const XIANTAO_BASE_URL = (process.env.XIANTAO_BASE_URL?.trim() || 'https://agent.helixlife.net').replace(/\/+$/, '');
5
+ export const AUTH_URL_ENDPOINT = `${XIANTAO_BASE_URL}/api/v1/agent/skills/auth-url`;
6
+ export const XIANTAO_BIO_API_ENDPOINT = `${XIANTAO_BASE_URL}/api/v1/agent/bio-api`;
7
+ export const XIANTAO_TOOL_MENUS_ENDPOINT = `${XIANTAO_BASE_URL}/api/v1/agent/tool/menus`;
7
8
  export const DEFAULT_XIANTAO_TOOL_PRODUCT_UUID = 'c0b6febb-52dd-4525-970a-61bbe9e263ff';
8
- export const CHECK_TOKEN_ENDPOINT = 'https://agent.helixlife.net/api/v1/agent/skills/check-token';
9
- export const UPLOAD_CONFIG_ENDPOINT = 'https://agent.helixlife.net/api/v1/agent/upload/config?type=bio&oss_type=bio';
10
- export const BIO_API_ENDPOINT = 'https://agent.helixlife.net/api/v1/agent/bio-api';
9
+ export const CHECK_TOKEN_ENDPOINT = `${XIANTAO_BASE_URL}/api/v1/agent/skills/check-token`;
10
+ export const UPLOAD_CONFIG_ENDPOINT = `${XIANTAO_BASE_URL}/api/v1/agent/upload/config?type=bio&oss_type=bio`;
11
+ export const BIO_API_ENDPOINT = `${XIANTAO_BASE_URL}/api/v1/agent/bio-api`;
@@ -1,4 +1,4 @@
1
- import { XIANTAO_BIO_API_ENDPOINT, XIANTAO_TOOL_MENUS_ENDPOINT } from './constants.js';
1
+ import { XIANTAO_BASE_URL, XIANTAO_BIO_API_ENDPOINT, XIANTAO_TOOL_MENUS_ENDPOINT } from './constants.js';
2
2
  import { XtzError } from './errors.js';
3
3
  import { requestJson } from './http.js';
4
4
  export async function fetchToolMenu(auth, menuUuid, toolProductUuid) {
@@ -156,9 +156,9 @@ function encodeMenuFilter(filter) {
156
156
  export function buildXiantaoHeaders(auth, hasJsonBody = false) {
157
157
  const headers = {
158
158
  Authorization: `Bearer ${auth.token}`,
159
- origin: 'https://agent.helixlife.net',
159
+ origin: XIANTAO_BASE_URL,
160
160
  platform: 'pc',
161
- referer: 'https://agent.helixlife.net',
161
+ referer: XIANTAO_BASE_URL,
162
162
  source: 'PC',
163
163
  };
164
164
  if (hasJsonBody) {
package/dist/xtz-help.js CHANGED
@@ -35,11 +35,11 @@ export default class XtzHelp extends Help {
35
35
  id: 'tool:inspect',
36
36
  },
37
37
  {
38
- description: 'Run a tool in human-first mode',
38
+ description: 'Run a tool in human-first mode; avoid this in agent workflows',
39
39
  id: 'tool:run',
40
40
  },
41
41
  {
42
- description: 'Execute a tool in agent mode with JSON envelope output',
42
+ description: 'Execute a tool in agent mode with JSON envelope output; supports --download',
43
43
  id: 'tool:exec',
44
44
  },
45
45
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helixlife-ai/xiantao",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "CLI for Xiantao bioinformatics tools",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",