@helixlife-ai/xiantao 0.1.13 → 0.1.15
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 +2 -0
- package/bin/dev.js +2 -0
- package/bin/load-env.js +12 -0
- package/bin/run.js +2 -0
- package/dist/commands/plot/fetch-all.js +1 -1
- package/dist/commands/plot/menu.js +1 -1
- package/dist/commands/plot/menus.js +1 -1
- package/dist/commands/plot/resolve.js +1 -1
- package/dist/commands/plot/run.js +1 -1
- package/dist/commands/tool/exec.js +1 -1
- package/dist/commands/tool/inspect.js +1 -1
- package/dist/commands/tool/prepare.js +1 -1
- package/dist/commands/tool/search.js +1 -1
- package/dist/lib/constants.js +7 -6
- package/dist/lib/xiantao.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -74,6 +74,8 @@ For agent workflows, do not use `xt tool run`. Treat `xt tool run` as the human-
|
|
|
74
74
|
|
|
75
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`.
|
|
76
76
|
|
|
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
|
+
|
|
77
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.
|
|
78
80
|
|
|
79
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.
|
package/bin/dev.js
CHANGED
package/bin/load-env.js
ADDED
package/bin/run.js
CHANGED
|
@@ -15,7 +15,7 @@ export default class PlotFetchAll extends XtzCommand {
|
|
|
15
15
|
static flags = {
|
|
16
16
|
...globalFlags,
|
|
17
17
|
token: Flags.string({
|
|
18
|
-
description: 'Bearer token for agent.helixlife.
|
|
18
|
+
description: 'Bearer token for agent.helixlife.cn xiantao APIs; falls back to the stored agent token',
|
|
19
19
|
}),
|
|
20
20
|
uuid: Flags.string({
|
|
21
21
|
description: 'Tool UUID used in the public.args.fetch-all payload',
|
|
@@ -15,7 +15,7 @@ export default class PlotMenu extends XtzCommand {
|
|
|
15
15
|
static flags = {
|
|
16
16
|
...globalFlags,
|
|
17
17
|
token: Flags.string({
|
|
18
|
-
description: 'Bearer token for agent.helixlife.
|
|
18
|
+
description: 'Bearer token for agent.helixlife.cn xiantao APIs; falls back to the stored agent token',
|
|
19
19
|
}),
|
|
20
20
|
toolProductUuid: Flags.string({
|
|
21
21
|
description: 'tool_product_uuid used in the menu filter payload; defaults to the main Xiantao product UUID',
|
|
@@ -9,7 +9,7 @@ export default class PlotMenus extends XtzCommand {
|
|
|
9
9
|
static flags = {
|
|
10
10
|
...globalFlags,
|
|
11
11
|
token: Flags.string({
|
|
12
|
-
description: 'Bearer token for agent.helixlife.
|
|
12
|
+
description: 'Bearer token for agent.helixlife.cn xiantao APIs; falls back to the stored agent token',
|
|
13
13
|
}),
|
|
14
14
|
toolProductUuid: Flags.string({
|
|
15
15
|
description: 'tool_product_uuid used in the menu filter payload; defaults to the main Xiantao product UUID',
|
|
@@ -15,7 +15,7 @@ export default class PlotResolve extends XtzCommand {
|
|
|
15
15
|
static flags = {
|
|
16
16
|
...globalFlags,
|
|
17
17
|
token: Flags.string({
|
|
18
|
-
description: 'Bearer token for agent.helixlife.
|
|
18
|
+
description: 'Bearer token for agent.helixlife.cn xiantao APIs; falls back to the stored agent token',
|
|
19
19
|
}),
|
|
20
20
|
toolProductUuid: Flags.string({
|
|
21
21
|
description: 'tool_product_uuid from the /products/apply/:uuid URL; defaults to the main Xiantao product UUID',
|
|
@@ -408,7 +408,7 @@ export default class PlotRun extends ToolRunCommandBase {
|
|
|
408
408
|
description: 'Tool route like app1.violin_flat in generic mode',
|
|
409
409
|
}),
|
|
410
410
|
token: Flags.string({
|
|
411
|
-
description: 'Bearer token for agent.helixlife.
|
|
411
|
+
description: 'Bearer token for agent.helixlife.cn xiantao APIs; falls back to the stored agent token',
|
|
412
412
|
}),
|
|
413
413
|
toolProductUuid: Flags.string({
|
|
414
414
|
description: 'tool_product_uuid used to auto-resolve module UUID and route in generic mode; defaults to the main Xiantao product UUID',
|
|
@@ -40,7 +40,7 @@ export default class ToolExec extends ToolRunCommandBase {
|
|
|
40
40
|
description: 'Tool route like app1.violin_flat in generic mode',
|
|
41
41
|
}),
|
|
42
42
|
token: Flags.string({
|
|
43
|
-
description: 'Bearer token for agent.helixlife.
|
|
43
|
+
description: 'Bearer token for agent.helixlife.cn xiantao APIs; falls back to the stored agent token',
|
|
44
44
|
}),
|
|
45
45
|
toolProductUuid: Flags.string({
|
|
46
46
|
description: 'tool_product_uuid used to auto-resolve module UUID and route in generic mode; defaults to the main Xiantao product UUID',
|
|
@@ -17,7 +17,7 @@ export default class ToolInspect extends XtzCommand {
|
|
|
17
17
|
static flags = {
|
|
18
18
|
...globalFlags,
|
|
19
19
|
token: Flags.string({
|
|
20
|
-
description: 'Bearer token for agent.helixlife.
|
|
20
|
+
description: 'Bearer token for agent.helixlife.cn xiantao APIs; falls back to the stored agent token',
|
|
21
21
|
}),
|
|
22
22
|
toolProductUuid: Flags.string({
|
|
23
23
|
description: 'tool_product_uuid used in the menu filter payload; defaults to the main Xiantao product UUID',
|
|
@@ -38,7 +38,7 @@ export default class ToolPrepare extends ToolRunCommandBase {
|
|
|
38
38
|
description: 'Tool route like app1.violin_flat in generic mode',
|
|
39
39
|
}),
|
|
40
40
|
token: Flags.string({
|
|
41
|
-
description: 'Bearer token for agent.helixlife.
|
|
41
|
+
description: 'Bearer token for agent.helixlife.cn xiantao APIs; falls back to the stored agent token',
|
|
42
42
|
}),
|
|
43
43
|
toolProductUuid: Flags.string({
|
|
44
44
|
description: 'tool_product_uuid used to auto-resolve module UUID and route in generic mode; defaults to the main Xiantao product UUID',
|
|
@@ -15,7 +15,7 @@ export default class ToolSearch extends XtzCommand {
|
|
|
15
15
|
static flags = {
|
|
16
16
|
...globalFlags,
|
|
17
17
|
token: Flags.string({
|
|
18
|
-
description: 'Bearer token for agent.helixlife.
|
|
18
|
+
description: 'Bearer token for agent.helixlife.cn xiantao APIs; falls back to the stored agent token',
|
|
19
19
|
}),
|
|
20
20
|
toolProductUuid: Flags.string({
|
|
21
21
|
description: 'tool_product_uuid used in the menu filter payload; defaults to the main Xiantao product UUID',
|
package/dist/lib/constants.js
CHANGED
|
@@ -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
|
|
5
|
-
export const
|
|
6
|
-
export const
|
|
4
|
+
export const XIANTAO_BASE_URL = (process.env.XIANTAO_BASE_URL?.trim() || 'https://agent.helixlife.cn').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 =
|
|
9
|
-
export const UPLOAD_CONFIG_ENDPOINT =
|
|
10
|
-
export const BIO_API_ENDPOINT =
|
|
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`;
|
package/dist/lib/xiantao.js
CHANGED
|
@@ -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:
|
|
159
|
+
origin: XIANTAO_BASE_URL,
|
|
160
160
|
platform: 'pc',
|
|
161
|
-
referer:
|
|
161
|
+
referer: XIANTAO_BASE_URL,
|
|
162
162
|
source: 'PC',
|
|
163
163
|
};
|
|
164
164
|
if (hasJsonBody) {
|