@agentearth.ai/cli 0.1.0-beta.6 → 0.1.0-beta.8

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
@@ -22,7 +22,7 @@ npm install -g @agentearth.ai/cli
22
22
  ae login --api-key-stdin
23
23
  ```
24
24
 
25
- `ae login --api-key-stdin` verifies the API key and saves it to the CLI credentials file. After login, follow the CLI JSON output: `next_action` tells the agent what to do, and `skill.source_dir` points to the bundled AgentEarth skill directory to install into the current agent before calling tools.
25
+ `ae login --api-key-stdin` verifies the API key and saves it to the CLI credentials file. After login, follow the CLI JSON output: `next_action` tells the agent what to do, `skill.source_dir` points to the bundled AgentEarth skill directory, and `skill.permissions` summarizes the commands, network domain, and limited filesystem scope before installing the skill into the current agent.
26
26
 
27
27
  `--api-key` and `AGENTEARTH_API_KEY` are supported for compatibility and debugging, but `--api-key-stdin` is the recommended install path because it avoids putting the key in command arguments.
28
28
 
@@ -53,6 +53,12 @@ export async function runLogin(context) {
53
53
  source_dir: SKILL_SOURCE_DIR,
54
54
  entry_file: "SKILL.md",
55
55
  install_scope: "current_agent_only",
56
+ summary: "Install AgentEarth skill so the current agent can run ae recommend/list/detail/execute against https://agentearth.ai.",
57
+ permissions: {
58
+ commands: ["ae recommend", "ae list", "ae detail", "ae execute"],
59
+ network: ["https://agentearth.ai"],
60
+ filesystem: "AgentEarth CLI config/cache and task-local JSON files only"
61
+ },
56
62
  instructions: [
57
63
  "Copy the entire source_dir directory into the current agent skills directory as agentearth.",
58
64
  "Verify that agentearth/SKILL.md exists in the target skills directory.",
@@ -1 +1 @@
1
- {"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,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,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC"}
@@ -7,7 +7,7 @@
7
7
  */
8
8
  export declare const PACKAGE_NAME = "@agentearth.ai/cli";
9
9
  export declare const UPDATE_COMMAND_TEXT = "npm install -g @agentearth.ai/cli@latest";
10
- export declare const CLI_VERSION = "0.1.0-beta.2";
10
+ export declare const CLI_VERSION: string;
11
11
  export declare const DEFAULT_BASE_URL = "https://agentearth.ai";
12
12
  export declare const DEFAULT_TELEMETRY_BASE_URL = "https://dev05.agentearth.ai";
13
13
  export declare const RECOMMEND_PATH = "/agent-api/v1/tool/recommend";
package/dist/constants.js CHANGED
@@ -5,12 +5,15 @@
5
5
  * 后端 API 路径和本地缓存数量限制。把这些字符串集中放在这里,可以避免不同
6
6
  * 文件里手写重复路径,后续接口调整时也更容易统一修改。
7
7
  */
8
+ import { createRequire } from "node:module";
9
+ const require = createRequire(import.meta.url);
10
+ const packageMetadata = require("../package.json");
8
11
  // npm 包名;发布前如果包名变更,优先改这里和 package.json。
9
12
  export const PACKAGE_NAME = "@agentearth.ai/cli";
10
13
  // 固定更新命令;ae update 实际执行也使用这个命令。
11
14
  export const UPDATE_COMMAND_TEXT = `npm install -g ${PACKAGE_NAME}@latest`;
12
15
  // CLI 自身版本号;login 输出、埋点字段和 --version 都会用到它。
13
- export const CLI_VERSION = "0.1.0-beta.2";
16
+ export const CLI_VERSION = typeof packageMetadata.version === "string" ? packageMetadata.version : "0.0.0";
14
17
  // 默认业务后端域名;调试时可以通过 --base-url 或 AGENT_EARTH_BASE_URL 覆盖。
15
18
  export const DEFAULT_BASE_URL = "https://agentearth.ai";
16
19
  // 默认 CLI 埋点上传域名;当前日志上传接口只在测试环境可用。
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wCAAwC;AACxC,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC;AAEjD,gCAAgC;AAChC,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAkB,YAAY,SAAS,CAAC;AAE3E,4CAA4C;AAC5C,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC;AAE1C,yDAAyD;AACzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAExD,kCAAkC;AAClC,uCAAuC;AACvC,MAAM,CAAC,MAAM,0BAA0B,GAAG,6BAA6B,CAAC;AAExE,8CAA8C;AAC9C,MAAM,CAAC,MAAM,cAAc,GAAG,8BAA8B,CAAC;AAE7D,yCAAyC;AACzC,MAAM,CAAC,MAAM,eAAe,GAAG,yBAAyB,CAAC;AAEzD,6CAA6C;AAC7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AAE5D,wDAAwD;AACxD,MAAM,CAAC,MAAM,YAAY,GAAG,4BAA4B,CAAC;AAEzD,iCAAiC;AACjC,MAAM,CAAC,MAAM,cAAc,GAAG,sBAAsB,CAAC;AAErD,8BAA8B;AAC9B,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC,mDAAmD;AACnD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC,uCAAuC;AACvC,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAE9C,mDAAmD;AACnD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,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.ai/cli",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.1.0-beta.8",
4
4
  "description": "Agent-first CLI that helps AI agents discover, inspect, and execute AgentEarth tools from any shell.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,17 +17,26 @@ credentials:
17
17
  env: AGENTEARTH_API_KEY
18
18
  injection: environment
19
19
  required: true
20
+
21
+ permissions:
22
+ commands:
23
+ - ae recommend
24
+ - ae list
25
+ - ae detail
26
+ - ae execute
27
+ network:
28
+ - https://agentearth.ai
29
+ filesystem:
30
+ scope: AgentEarth CLI config/cache and task-local JSON files only
20
31
  ---
21
32
 
22
33
  # AgentEarth
23
34
 
24
- Use AgentEarth as an external tool marketplace. Treat the user's request as the task to solve, then discover the best matching tool, inspect its schema, validate parameters, execute it, and summarize the result.
25
-
26
35
  ## Command Surface
27
36
 
28
- Prefer `ae` on Unix-like shells and `ae.cmd` in Windows PowerShell when the PowerShell shim is blocked by execution policy.
37
+ Prefer `ae` on Unix-like shells and `ae.cmd` in Windows PowerShell when the PowerShell shim is blocked by execution policy. The npm package is `@agentearth.ai/cli`.
29
38
 
30
- The npm package is `@agentearth.ai/cli`. If `ae` is unavailable or not on `PATH`, use the npm fallback with the same subcommand:
39
+ If `ae` is unavailable or not on `PATH`, use the npm fallback with the same subcommand:
31
40
 
32
41
  ```text
33
42
  npx --yes --package @agentearth.ai/cli@latest ae recommend "<task>"
@@ -43,7 +52,22 @@ Use these commands:
43
52
  - `ae execute <tool_name> @params.json` to run the selected tool with validated parameters.
44
53
  - `ae update` only when the user confirms they want to update the CLI.
45
54
 
46
- All agent-facing commands return JSON by default. Select tools by `tool_name`; never use `tool_url` as a CLI argument. Do not call removed or undocumented commands such as `ae schema`.
55
+ All agent-facing commands return JSON by default. Select tools by `tool_name`; never use `tool_url` as a CLI argument. Do not call removed or undocumented commands such as `ae schema`. Do not call AgentEarth HTTP APIs directly from this skill; use the CLI command surface.
56
+
57
+ ## Workflow
58
+
59
+ 1. Build a concise query from the latest user request plus only necessary conversation context.
60
+ 2. For natural-language tasks, start with one `ae recommend "<task>"` call; use `ae list @query.json` only when the category or keyword is already clear.
61
+ 3. Select the most relevant candidate whose schema can be filled from available context, then inspect only that candidate with `ae detail <tool_name>`.
62
+ 4. Build `params.json` strictly from the inspected input schema.
63
+ 5. Validate required fields, types, enums, formats, and `additionalProperties` when present.
64
+ 6. Execute with `ae execute <tool_name> @params.json`.
65
+ 7. Summarize the useful result for the user and omit internal command noise unless troubleshooting needs it.
66
+
67
+ - Do not inspect environment variables, npm state, or installation paths before the first CLI attempt; trust CLI errors such as `auth_missing`, `auth_invalid`, or command-not-found.
68
+ - Use `ae` or `ae.cmd` first. Use the npx fallback only when the CLI command is unavailable.
69
+ - Do not inspect every recommended tool unless the selected candidate is unsuitable.
70
+ - If no candidate is suitable, refine the query once. If discovery still fails, tell the user that AgentEarth did not return a suitable tool.
47
71
 
48
72
  ## Credential Handling
49
73
 
@@ -60,32 +84,6 @@ Use credentials only through the active host environment.
60
84
 
61
85
  If authentication fails, report that AgentEarth authentication failed and ask the user to verify the configured API key or login state. Do not expose request headers or secret values.
62
86
 
63
- ## Execution Workflow
64
-
65
- 1. Restate the task internally as a concise AgentEarth query.
66
- 2. Discover candidate tools with `ae recommend "<task>"`, or `ae list @query.json` when the category is already clear.
67
- 3. Inspect the best candidate with `ae detail <tool_name>`.
68
- 4. Build `params.json` strictly from the inspected input schema.
69
- 5. Validate required fields, types, enums, formats, and `additionalProperties` when present.
70
- 6. Execute with `ae execute <tool_name> @params.json`.
71
- 7. Summarize the useful result for the user and omit internal command noise unless it is needed for troubleshooting.
72
-
73
- Use a fallback tool only when the first suitable tool fails for a recoverable reason or clearly does not satisfy the task.
74
-
75
- ## Tool Selection
76
-
77
- Choose the tool that best matches the task intent and can be safely executed with available context.
78
-
79
- Prefer candidates with:
80
-
81
- - clear task relevance;
82
- - complete and understandable input schema;
83
- - required parameters that can be filled from the user's request or conversation context;
84
- - lower cost when otherwise equivalent;
85
- - narrower, more specialized behavior for the requested job.
86
-
87
- If no candidate is suitable, refine the query once. If discovery still fails, tell the user that AgentEarth did not return a suitable tool.
88
-
89
87
  ## Parameter Rules
90
88
 
91
89
  Build parameter files as JSON objects matching the selected tool schema.
@@ -97,7 +95,7 @@ Build parameter files as JSON objects matching the selected tool schema.
97
95
  - Do not reuse example keys unless they exist in the selected schema.
98
96
  - Write query or execution payloads to JSON files instead of hand-writing inline JSON in PowerShell.
99
97
 
100
- Known-category list example:
98
+ Examples:
101
99
 
102
100
  ```json
103
101
  {"keyword":"image"}
@@ -107,30 +105,21 @@ Known-category list example:
107
105
  ae list @query.json
108
106
  ae detail <tool_name>
109
107
  ae execute <tool_name> @params.json
110
- ```
111
-
112
- Ambiguous-task example:
113
-
114
- ```text
115
108
  ae recommend "find current hotel prices in Sapporo for next weekend"
116
109
  ae detail <tool_name>
117
110
  ae execute <tool_name> @params.json
118
111
  ```
119
112
 
120
- ## Error Handling
113
+ ## Failure And Output
121
114
 
122
115
  On command or tool failure:
123
116
 
124
117
  - Read the JSON error message before retrying.
125
118
  - Retry once only when the failure is likely transient or caused by a fixable parameter issue.
126
119
  - Correct parameters only when the correction is supported by the schema and available context.
127
- - Try a fallback candidate only when it is clearly relevant to the original task.
120
+ - Try a fallback candidate only when it is clearly relevant to the original task and the first suitable tool fails for a recoverable reason or clearly does not satisfy the task.
128
121
  - Stop and explain the failure when the error is authentication, authorization, missing user input, unsupported task, or repeated tool failure.
129
122
 
130
- ## Result Presentation
131
-
132
- Return the final answer, not a transcript of internal discovery.
133
-
134
123
  - Summarize key facts, generated asset links, converted file paths, or tool outputs.
135
124
  - Include caveats from the tool result when relevant.
136
125
  - Mention AgentEarth only when useful for provenance or when troubleshooting is needed.