@testin-official/xagent 0.3.7 → 0.3.9

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 (44) hide show
  1. package/dist/action/mcp-content.d.ts +4 -1
  2. package/dist/action/mcp-content.d.ts.map +1 -1
  3. package/dist/action/mcp-content.js +97 -25
  4. package/dist/action/mcp-content.js.map +1 -1
  5. package/dist/assets/integrations/manifest.json +3 -2
  6. package/dist/assets/integrations/xagent-skill/SKILL.md +33 -17
  7. package/dist/assets/integrations/xagent-skill/agents/openai.yaml +2 -2
  8. package/dist/assets/integrations/xagent-skill/references/evidence-lifecycle.md +23 -0
  9. package/dist/assets/integrations/xagent-skill/references/host-adapters.md +15 -6
  10. package/dist/assets/integrations/xagent-skill/references/routing.md +14 -24
  11. package/dist/assets/integrations/xagent-skill/references/setup-and-doctor.md +26 -0
  12. package/dist/assets/skills/xagent-analyze-failure/SKILL.md +18 -6
  13. package/dist/assets/skills/xagent-author-test/SKILL.md +28 -12
  14. package/dist/assets/skills/xagent-author-test/references/host-interaction-adapters.md +2 -4
  15. package/dist/assets/skills/xagent-author-test/references/interaction-modes.md +1 -2
  16. package/dist/assets/skills/xagent-cli/SKILL.md +23 -21
  17. package/dist/assets/skills/xagent-cli/references/host-modes.md +9 -17
  18. package/dist/assets/skills/xagent-explore-device/SKILL.md +24 -15
  19. package/dist/assets/skills/xagent-explore-device/agents/openai.yaml +2 -2
  20. package/dist/assets/skills/xagent-explore-device/references/tool-adapters.md +2 -2
  21. package/dist/assets/skills/xagent-repair-test/SKILL.md +16 -8
  22. package/dist/assets/skills/xagent-run-test/SKILL.md +25 -10
  23. package/dist/assets/skills/xagent-test-report/SKILL.md +21 -12
  24. package/dist/assets/skills/xagent-test-report/agents/openai.yaml +1 -1
  25. package/dist/assets/skills/xagent-test-report/references/evidence-policy.md +17 -12
  26. package/dist/cli.js +1 -1
  27. package/dist/cli.js.map +1 -1
  28. package/dist/core/version.d.ts +1 -1
  29. package/dist/core/version.js +1 -1
  30. package/dist/evidence/store.d.ts +38 -0
  31. package/dist/evidence/store.d.ts.map +1 -0
  32. package/dist/evidence/store.js +112 -0
  33. package/dist/evidence/store.js.map +1 -0
  34. package/dist/integrations/manager.d.ts +1 -1
  35. package/dist/integrations/manager.d.ts.map +1 -1
  36. package/dist/integrations/manager.js +52 -20
  37. package/dist/integrations/manager.js.map +1 -1
  38. package/dist/mcp/server.js +2 -2
  39. package/dist/mcp/server.js.map +1 -1
  40. package/dist/mcp/tools.d.ts.map +1 -1
  41. package/dist/mcp/tools.js +24 -11
  42. package/dist/mcp/tools.js.map +1 -1
  43. package/package.json +2 -2
  44. package/dist/assets/skills/xagent-cli/references/capability-routing.md +0 -36
@@ -1,2 +1,5 @@
1
- export declare function actionMcpContent(toolName: string, result: Record<string, any>): Promise<Array<Record<string, string>>>;
1
+ type McpContent = Array<Record<string, string>>;
2
+ export declare function actionMcpContent(toolName: string, result: Record<string, any>): Promise<McpContent>;
3
+ export declare function workflowMcpContent(toolName: string, result: Record<string, any>): Promise<McpContent>;
4
+ export {};
2
5
  //# sourceMappingURL=mcp-content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-content.d.ts","sourceRoot":"","sources":["../../src/action/mcp-content.ts"],"names":[],"mappings":"AAkEA,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CA8B5H"}
1
+ {"version":3,"file":"mcp-content.d.ts","sourceRoot":"","sources":["../../src/action/mcp-content.ts"],"names":[],"mappings":"AAWA,KAAK,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAsJhD,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAEzG;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAE3G"}
@@ -1,8 +1,10 @@
1
+ import { createHash } from "node:crypto";
1
2
  import { XAgentApiError } from "../core/errors.js";
3
+ import { persistObservationEvidence } from "../evidence/store.js";
2
4
  import sharp from "sharp";
3
5
  const MAX_IMAGE_BYTES = 15 * 1024 * 1024;
4
6
  const MAX_MCP_IMAGE_BYTES = 200 * 1024;
5
- const JPEG_QUALITIES = [82, 78, 74, 70, 66, 62, 58];
7
+ const JPEG_QUALITIES = [82, 70, 58];
6
8
  const IMAGE_TYPES = new Set(["image/png", "image/jpeg", "image/webp"]);
7
9
  function textFor(toolName, result) {
8
10
  const consoleUrl = result.session?.console_url;
@@ -11,7 +13,7 @@ function textFor(toolName, result) {
11
13
  }
12
14
  return JSON.stringify(result);
13
15
  }
14
- function observationFor(toolName, result) {
16
+ function actionObservationFor(toolName, result) {
15
17
  if (toolName === "xagent_device_acquire")
16
18
  return result.observation;
17
19
  if (toolName === "xagent_device_observe")
@@ -20,6 +22,53 @@ function observationFor(toolName, result) {
20
22
  return result.after_observation ?? undefined;
21
23
  return undefined;
22
24
  }
25
+ function screenKey(value, fallback) {
26
+ const explicit = String(value ?? "").trim();
27
+ if (explicit)
28
+ return explicit;
29
+ return `screen_${createHash("sha256").update(fallback, "utf8").digest("hex").slice(0, 16)}`;
30
+ }
31
+ function evidenceCandidates(toolName, result) {
32
+ const actionObservation = actionObservationFor(toolName, result);
33
+ if (actionObservation)
34
+ return [{ observation: actionObservation, result }];
35
+ if (toolName === "xagent_authoring_observe")
36
+ return [{ observation: result, result }];
37
+ if (toolName === "xagent_authoring_draft_step_execute" || toolName === "xagent_authoring_attempt_get") {
38
+ const artifacts = Array.isArray(result.artifacts) ? result.artifacts : [];
39
+ return artifacts
40
+ .filter((artifact) => artifact?.type === "screenshot" && typeof artifact.url === "string")
41
+ .map((artifact, index) => ({
42
+ result,
43
+ observation: {
44
+ ...result,
45
+ screenshot_url: artifact.url,
46
+ screen_id: screenKey(undefined, `${result.id ?? "attempt"}:${result.step_index ?? index}:${artifact.url}`),
47
+ },
48
+ }));
49
+ }
50
+ if (toolName === "xagent_run_get" || toolName === "xagent_run_wait") {
51
+ const runId = String(result.id ?? result.run_id ?? "run").trim();
52
+ const candidates = [];
53
+ for (const execution of Array.isArray(result.device_executions) ? result.device_executions : []) {
54
+ for (const step of Array.isArray(execution?.steps) ? execution.steps : []) {
55
+ if (typeof step?.screenshot_url !== "string" || !step.screenshot_url.trim())
56
+ continue;
57
+ candidates.push({
58
+ result,
59
+ observation: {
60
+ ...step,
61
+ session_id: `run:${runId}`,
62
+ device_id: execution.device_id,
63
+ screen_id: screenKey(undefined, `${runId}:${execution.id ?? execution.device_id}:${step.sequence}:${step.screenshot_url}`),
64
+ },
65
+ });
66
+ }
67
+ }
68
+ return candidates;
69
+ }
70
+ return [];
71
+ }
23
72
  function assertImageUrl(value) {
24
73
  if (typeof value !== "string")
25
74
  throw new XAgentApiError("invalid_response", "Device observation has no screenshot URL");
@@ -38,40 +87,35 @@ function assertImageUrl(value) {
38
87
  async function prepareMcpImage(bytes, mimeType) {
39
88
  if (bytes.length <= MAX_MCP_IMAGE_BYTES)
40
89
  return { bytes, mimeType };
41
- const pipeline = sharp(bytes, { failOn: "error", limitInputPixels: 100_000_000 })
42
- .rotate()
43
- .flatten({ background: "#ffffff" });
90
+ const pipeline = sharp(bytes, { failOn: "error", limitInputPixels: 100_000_000 }).rotate().flatten({ background: "#ffffff" });
91
+ const metadata = await pipeline.metadata();
44
92
  let smallest;
45
93
  for (const quality of JPEG_QUALITIES) {
46
- const candidate = await pipeline.clone().jpeg({ quality, mozjpeg: true }).toBuffer();
47
- if (!smallest || candidate.length < smallest.length)
94
+ const output = await pipeline.clone().jpeg({ quality, chromaSubsampling: "4:2:0" }).toBuffer({ resolveWithObject: true });
95
+ const candidate = { bytes: output.data, mimeType: "image/jpeg", width: output.info.width, height: output.info.height };
96
+ if (!smallest || candidate.bytes.length < smallest.bytes.length)
48
97
  smallest = candidate;
49
- if (candidate.length <= MAX_MCP_IMAGE_BYTES)
50
- return { bytes: candidate, mimeType: "image/jpeg" };
98
+ if (candidate.bytes.length <= MAX_MCP_IMAGE_BYTES)
99
+ return candidate;
51
100
  }
52
- const metadata = await pipeline.metadata();
53
101
  let longestEdge = Math.max(metadata.width ?? 0, metadata.height ?? 0);
54
102
  if (longestEdge < 1 || !smallest)
55
103
  throw new XAgentApiError("invalid_response", "Device observation screenshot dimensions are invalid");
56
104
  let candidate = smallest;
57
- while (candidate.length > MAX_MCP_IMAGE_BYTES && longestEdge > 640) {
58
- const ratio = Math.min(0.9, Math.sqrt(MAX_MCP_IMAGE_BYTES / candidate.length) * 0.95);
105
+ while (candidate.bytes.length > MAX_MCP_IMAGE_BYTES && longestEdge > 640) {
106
+ const ratio = Math.min(0.9, Math.sqrt(MAX_MCP_IMAGE_BYTES / candidate.bytes.length) * 0.95);
59
107
  longestEdge = Math.max(640, Math.floor(longestEdge * ratio));
60
- candidate = await pipeline.clone()
108
+ const output = await pipeline.clone()
61
109
  .resize({ width: longestEdge, height: longestEdge, fit: "inside", withoutEnlargement: true })
62
- .jpeg({ quality: 72, mozjpeg: true })
63
- .toBuffer();
110
+ .jpeg({ quality: 72, chromaSubsampling: "4:2:0" })
111
+ .toBuffer({ resolveWithObject: true });
112
+ candidate = { bytes: output.data, mimeType: "image/jpeg", width: output.info.width, height: output.info.height };
64
113
  }
65
- if (candidate.length > MAX_MCP_IMAGE_BYTES) {
114
+ if (candidate.bytes.length > MAX_MCP_IMAGE_BYTES)
66
115
  throw new XAgentApiError("invalid_response", "Device observation screenshot cannot be reduced to the MCP image limit");
67
- }
68
- return { bytes: candidate, mimeType: "image/jpeg" };
116
+ return candidate;
69
117
  }
70
- export async function actionMcpContent(toolName, result) {
71
- const content = [{ type: "text", text: textFor(toolName, result) }];
72
- const observation = observationFor(toolName, result);
73
- if (!observation)
74
- return content;
118
+ async function fetchImage(observation) {
75
119
  const url = assertImageUrl(observation.screenshot_url);
76
120
  let response;
77
121
  try {
@@ -109,8 +153,36 @@ export async function actionMcpContent(toolName, result) {
109
153
  }
110
154
  if (total === 0)
111
155
  throw new XAgentApiError("invalid_response", "Device observation screenshot is empty");
112
- const image = await prepareMcpImage(Buffer.concat(chunks.map((chunk) => Buffer.from(chunk))), mimeType);
113
- content.push({ type: "image", data: image.bytes.toString("base64"), mimeType: image.mimeType });
156
+ return prepareMcpImage(Buffer.concat(chunks.map((chunk) => Buffer.from(chunk))), mimeType);
157
+ }
158
+ async function contentWithEvidence(toolName, result, strict) {
159
+ const content = [{ type: "text", text: textFor(toolName, result) }];
160
+ for (const candidate of evidenceCandidates(toolName, result)) {
161
+ try {
162
+ const image = await fetchImage(candidate.observation);
163
+ try {
164
+ const storedObservation = image.width && image.height
165
+ ? { ...candidate.observation, width: image.width, height: image.height }
166
+ : candidate.observation;
167
+ await persistObservationEvidence({ sourceTool: toolName, result: candidate.result, observation: storedObservation, bytes: image.bytes, mimeType: image.mimeType });
168
+ }
169
+ catch (error) {
170
+ process.stderr.write(`${JSON.stringify({ xagent_evidence_cache: { status: "failed", cause: error instanceof Error ? error.message : String(error) } })}\n`);
171
+ }
172
+ content.push({ type: "image", data: image.bytes.toString("base64"), mimeType: image.mimeType });
173
+ }
174
+ catch (error) {
175
+ if (strict)
176
+ throw error;
177
+ process.stderr.write(`${JSON.stringify({ xagent_evidence_fetch: { status: "failed", tool: toolName, cause: error instanceof Error ? error.message : String(error) } })}\n`);
178
+ }
179
+ }
114
180
  return content;
115
181
  }
182
+ export async function actionMcpContent(toolName, result) {
183
+ return contentWithEvidence(toolName, result, true);
184
+ }
185
+ export async function workflowMcpContent(toolName, result) {
186
+ return contentWithEvidence(toolName, result, false);
187
+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CAAC;AACrD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,QAAgB,EAAE,MAA2B;IACpF,OAAO,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC"}
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "schema_version": "xagent-skill/v1",
3
3
  "skill_name": "xagent-skill",
4
- "skill_version": "0.3.5",
5
- "minimum_cli_version": "0.3.5",
4
+ "skill_version": "0.3.9",
5
+ "minimum_cli_version": "0.3.9",
6
+ "evidence_schema_version": "xagent-evidence/v1",
6
7
  "default_domain": "action",
7
8
  "mcp_protocol": "stdio",
8
9
  "route_table_hash": "sha256:5aa8f83d0093cbcb93d661e60b1d516ef377402e41619cec2fae6ffb36eb6a5e",
@@ -1,28 +1,44 @@
1
1
  ---
2
2
  name: xagent-skill
3
- description: Use XAgent to inspect or control an Android device, author and verify a YAML test, run an existing test, analyze evidence, repair an explicitly selected test, or produce a report. Install this Skill once and let it route each request to exactly one XAgent CLI/MCP workflow.
3
+ description: |
4
+ 面向用户的 XAgent 测试与移动设备入口。用于查询或操作云真机、安装应用、验证目标、编写或执行测试、分析或修复失败,以及生成带截图证据的 Markdown 测试报告。
5
+ 用户明确提到 XAgent、XAgent MCP、开发者设备、XAgent 测试或 XAgent 报告时触发。
4
6
  ---
5
7
 
6
- # XAgent
8
+ # XAgent 用户入口
7
9
 
8
- This is the single Agent Host entry for XAgent. The CLI is the cross-platform execution client and `xagent-local` MCP is the stateful Tool adapter. They use the same public API contracts and route table; this Skill must not reimplement device or test business logic.
10
+ 用户只需要说明最终目标。入口负责准备环境、选择一个明确流程,并按用户要求串联后续结果;不要让用户理解 MCP mode、Session、screen_id、幂等键或本地证据缓存。
9
11
 
10
- ## Before Any Operation
12
+ ## 准备
11
13
 
12
- 1. Check that `xagent` is installed and that its version satisfies `manifest.json`.
13
- 2. Check the configured Profile and MCP connection without printing a Token.
14
- 3. Validate the Skill manifest and route-table hash against the CLI. If a check fails, stop before any upload, device, Authoring, Run, or report side effect.
15
- 4. Present the available behavior choices. `action` is the default; never silently select another side-effect mode.
16
- 5. Select exactly one domain and load only its matching packaged/server Skill.
14
+ 按 `references/setup-and-doctor.md` 检查 Profile、凭证、CLI、Skill 和 MCP 状态。正常时直接开始;只有缺少初始化、登录、同步或重启时才说明需要用户完成的动作。
17
15
 
18
- The choices are: `action` (direct device control), `author` (write and verify a test), `run` (execute existing YAML), `analyze` (read-only evidence analysis), `repair` (authorized test repair), and `report` (evidence report). `setup` is an entry check only and is not a user business mode.
16
+ ## 选择流程
19
17
 
20
- ## Execution Boundary
18
+ - 操作设备或验证手机界面:`xagent-explore-device`
19
+ - 编写并逐步验证新测试:`xagent-author-test`
20
+ - 执行用户指定的现有测试:`xagent-run-test`
21
+ - 只读分析现有失败:`xagent-analyze-failure`
22
+ - 用户明确授权后修复测试:`xagent-repair-test`
23
+ - 从已经收集的证据生成报告:`xagent-test-report`
21
24
 
22
- - Prefer the connected MCP mode for Agent work. It keeps the device Session, current screen, renewal, and release state between Tool calls.
23
- - Use the CLI for terminal and CI workflows. Stateful CLI commands must carry the current `session_id`, latest `screen_id`, and a unique idempotency key.
24
- - Route with `xagent_workflow_options` and `xagent_workflow_route`, then verify `xagent_skill_load_local` (name, version, hash, and references) before side effects.
25
- - A routed mode may load only its mapped Skill. Changing mode requires the Host to start the corresponding isolated MCP process or restart `xagent-local`.
26
- - Never pass a Developer Token on a command line, put it in YAML, or copy it into a Skill. Personal credentials use the OS credential store; CI credentials use an explicitly named environment variable.
25
+ 意图明确时直接进入对应流程。只有不同理解会产生不同业务结果时才询问用户,不展示内部模式选择。
27
26
 
28
- Read the relevant file in `references/` only after the domain is selected. The Skill owns routing and safety gates; the routed Skill owns its workflow.
27
+ ## 用户可见执行
28
+
29
+ 设备相关流程展示关键截图和一句可见结果。失败时区分应用结果、设备控制、网络和证据问题。Action 或步骤状态 `PASSED` 只说明命令完成,业务结论必须由用户要求的可见后置条件支持。
30
+
31
+ 用户一次要求多个结果时,入口只编排必要阶段,例如:
32
+
33
+ ```text
34
+ 测试验证 → 保存证据 → 释放资源 → 生成报告
35
+ ```
36
+
37
+ 每个阶段仍由独立 Skill 负责,不把不同业务逻辑合并。报告复用测试过程中已经展示的图片,不重新占用设备、截图或执行动作。完整规则见 `references/routing.md` 和 `references/evidence-lifecycle.md`。
38
+
39
+ ## 清理和边界
40
+
41
+ - 不调用 Exec、额外 GUI 模型或隐藏降级链路。
42
+ - 不为了补齐报告重新执行有副作用的操作。
43
+ - 设备 Session、Authoring Session 和临时 APK 由创建它们的阶段负责释放。
44
+ - 不把内部响应、绝对缓存路径或证据 hash 直接展示给用户。
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: XAgent
3
- short_description: Route XAgent device and test requests through one verified CLI/MCP Skill.
4
- default_prompt: Check the XAgent CLI, MCP connection, manifest, and route before any side effect; action is the default.
3
+ short_description: Operate XAgent devices, verify tests, and produce screenshot-backed reports.
4
+ default_prompt: Understand the user's XAgent goal, run only the required workflow, show key screenshots and visible outcomes, clean up owned resources, and reuse the same evidence in any requested report.
@@ -0,0 +1,23 @@
1
+ # 所见即所得的证据生命周期
2
+
3
+ 用户看到的关键截图和报告中的截图必须来自同一次设备观察。MCP 返回的图片已经压缩到适合 Agent 交互的大小;CLI 在本地短期缓存同一份图片,Report 只复制选中的缓存文件,不再次截图。Author 的证据按 Authoring Session 归档,Run 的证据按 `run:<run_id>` 归档。
4
+
5
+ ## 证据生产
6
+
7
+ Action、Authoring 和 Run 在返回初始状态、关键后置状态、失败、阻塞或基础设施异常时记录证据。Run 返回的步骤截图可以一次归档,报告阶段只挑选最能证明结果的图片。不要把每个纯导航中间画面都放进报告。
8
+
9
+ 每条证据至少关联:测试项、设备、来源域、screen_id、截图文件、截图 hash、捕获时间和可见证明说明。
10
+
11
+ ## 证据展示
12
+
13
+ 设备动作完成后,向用户展示关键截图和一句可见结果。`PASSED` 只说明设备命令完成;业务状态必须由截图和用户目标共同判断。
14
+
15
+ ## 报告消费
16
+
17
+ Report 读取证据清单,选择:
18
+
19
+ - 建立环境的初始图;
20
+ - 每个测试项的一张最终证明图;
21
+ - 解释失败、阻塞或基础设施异常的图。
22
+
23
+ 将选中的图片复制到报告目录下的 `evidence/`,Markdown 只使用相对路径。图片不存在时保留 screen_id 并标记 `INCONCLUSIVE`,不编造图片或重新操作设备。
@@ -1,9 +1,18 @@
1
- # Host Adapters
1
+ # Agent Host 适配
2
2
 
3
- Codex, Claude, Trae, and WorkBuddy may expose different Skill reload and MCP configuration UIs. The package remains identical. The Host must:
3
+ Codex Host 使用 XAgent Skill 包。Host 负责加载入口 Skill、启动对应 MCP 进程,并把 MCP 图片原生展示给用户。
4
4
 
5
- 1. Import the directory containing the root `SKILL.md`.
6
- 2. Launch `xagent` as the stdio MCP command with the selected `--profile` and `mcp --mode`.
7
- 3. Reload the Skill/MCP catalog after an upgrade.
5
+ ## 用户体验要求
8
6
 
9
- Do not assume that a Host supports structured user-choice UI. If it does not, ask for a plain-text domain choice. `step_confirm` is an Agent Host interaction policy and is never sent to the XAgent API.
7
+ - 工具返回图片时,Host 应展示图片本身,不只显示 URL 或 Base64。
8
+ - 意图明确时不要让用户选择内部 domain。
9
+ - 只有确实存在多个业务目标且会产生不同结果时才询问用户。
10
+ - 用户要求测试报告时,在设备阶段结束并清理资源后继续本地 Report 阶段,不要求用户重新发起命令。
11
+
12
+ ## 运行要求
13
+
14
+ Host 以当前 npm 安装的 `xagent` 启动 stdio MCP,并使用明确的 Profile。MCP 进程变化、Skill 同步或 npm scope 变化后需要重启 Host。
15
+
16
+ XAgent 同步只写入自己的 `xagent-skill` 目录,不扫描或覆盖 Host 的其他配置。
17
+
18
+ `step_confirm` 和 `auto` 是 Authoring 内部交互策略,不是用户必须理解的 XAgent 产品模式。
@@ -1,32 +1,22 @@
1
- # Routing Contract
1
+ # 用户工作流边界
2
2
 
3
- The route is an immutable one-to-one mapping. Select one row before a side effect:
3
+ 入口按用户最终目标选择最小的主流程,不向用户展示内部 MCP 参数。
4
4
 
5
- | Domain | MCP mode | Routed Skill | Side effects |
6
- |---|---|---|---|
7
- | action | action | xagent-explore-device | yes |
8
- | author | author | xagent-author-test | yes |
9
- | run | run | xagent-run-test | yes |
10
- | analyze | analyze | xagent-analyze-failure | no |
11
- | repair | repair | xagent-repair-test | yes |
12
- | report | report | xagent-test-report | no |
5
+ | 用户目标 | 主 Skill | 结束时的用户结果 |
6
+ |---|---|---|
7
+ | 查询、占用、操作设备 | `xagent-explore-device` | 关键截图和可见操作结果 |
8
+ | 编写并验证测试 | `xagent-author-test` | 可继续编辑的测试和验证证据 |
9
+ | 执行已有测试 | `xagent-run-test` | Run 结果和关键步骤证据 |
10
+ | 分析已有失败 | `xagent-analyze-failure` | 失败分类和证据解释 |
11
+ | 修复已有测试 | `xagent-repair-test` | 修复后的测试和验证结果 |
12
+ | 生成报告 | `xagent-test-report` | 带相对图片链接的 Markdown 报告 |
13
13
 
14
- `setup` is reserved for read-only discovery and routing. It is not in the behavior choices.
15
-
16
- Use the CLI equivalents:
14
+ 当用户明确同时要求测试和报告时,入口只编排顺序:
17
15
 
18
16
  ```text
19
- xagent --json integrations options
20
- xagent --json integrations route action --profile PROFILE
21
- xagent --json integrations verify-skill PATH_TO_XAGENT_SKILL
17
+ Action / Author / Run → 证据整理 → 资源清理 → Report
22
18
  ```
23
19
 
24
- Use the MCP equivalents when available:
25
-
26
- ```text
27
- xagent_workflow_options
28
- xagent_workflow_route(domain="action")
29
- xagent_skill_load_local(skill="xagent-explore-device")
30
- ```
20
+ 如果用户没有要求报告,不要自动进入 Report。若用户后来单独要求报告,只能使用仍可读取的证据;缺失部分标记为 `INCONCLUSIVE`,不能重新执行设备动作补证据。
31
21
 
32
- The selected route's `domain`, `mode`, and `skill` must match exactly. A mismatch is a hard stop, not a fallback.
22
+ 不要增加 `action_report`、`run_report` 之类组合 domain。组合是入口的顺序编排,不是新的 MCP 能力。
@@ -0,0 +1,26 @@
1
+ # 初始化、自检和同步
2
+
3
+ 这些检查面向 Agent Host 内部执行,正常时用一句话完成,不向用户展示 JSON、hash 或 Session 细节。
4
+
5
+ ## 检查顺序
6
+
7
+ 1. `xagent doctor --json`:检查本地配置、默认 Profile 和凭证来源。
8
+ 2. `xagent integrations doctor --host <host> --json`:检查 Host Skill、CLI 版本、Skill 内容、路由版本和 MCP 配置候选。
9
+ 3. 需要在线鉴权或权限诊断时才调用 `xagent auth status`。
10
+
11
+ 状态解释:
12
+
13
+ | 状态 | 用户可见处理 |
14
+ |---|---|
15
+ | `OK` | 直接执行请求 |
16
+ | `NEED_INIT` | 引导用户完成一次 XAgent 初始化 |
17
+ | `NEED_AUTH` | 引导用户登录或配置指定 Profile |
18
+ | `NEED_SYNC` | 同步 XAgent 自己的 Skill 文件 |
19
+ | `NEED_UPGRADE` | 升级 CLI/Skill 后重新检查 |
20
+ | `NEED_RESTART` | 提示重启 Agent Host/MCP,然后继续 |
21
+
22
+ `xagent init` 只负责 Profile 和服务地址初始化;`integrations sync` 只负责从当前 npm 包同步 XAgent Skill。不要把两者混成一个不可逆的安装动作。
23
+
24
+ ## 同步来源
25
+
26
+ npm 包是 XAgent Skill 的唯一发布源。同步只写入 XAgent 自己的目录,不覆盖 Host 配置。同步后必须重新加载 Skill,并在 MCP 命令路径变化时重启对应 MCP。
@@ -1,13 +1,25 @@
1
1
  ---
2
2
  name: xagent-analyze-failure
3
- description: Read-only analysis of an existing XAgent Run or Authoring Attempt result. Use when the user explicitly asks to analyze, explain, or classify a failure without side effects. Do not use to run, retry, cancel, author, repair, or directly control a device.
3
+ description: Read and classify an existing XAgent Run or Authoring Attempt without side effects. Use when the user asks why a test failed, wants evidence classification, or requests a failure explanation. Do not use to run, retry, cancel, edit, repair, or control a device.
4
4
  ---
5
5
 
6
- # Analyze An XAgent Failure
6
+ # 分析 XAgent 失败
7
7
 
8
- 1. Read the explicit Run or Attempt result, or query it through CLI/MCP when the ID and permission are available.
9
- 2. Classify the outcome using [failure-classification.md](references/failure-classification.md): separate schema/configuration/authentication failures, test behavior failures, infrastructure failures, cancellation, and timeout.
10
- 3. Report the failing device, step index/action, public message, and available Artifact evidence. Do not invent an upstream cause absent from public output.
11
- 4. State whether evidence indicates a transient infrastructure condition or a test-behavior problem. Do not turn that classification into a retry, edit, or workflow change.
8
+ 本 Skill 是只读诊断流程。输入必须是用户明确给出的 Run、Attempt 或公开结果;没有明确对象时只说明缺少哪项信息,不猜测上游原因。
9
+
10
+ ## 分析步骤
11
+
12
+ 1. 读取指定 Run 或 Attempt 的公开状态、失败步骤、消息和 Artifacts。
13
+ 2. 按 `references/failure-classification.md` 区分 schema/configuration、鉴权、测试行为、设备或网络基础设施、取消和超时。
14
+ 3. 输出设备、步骤序号、动作、公开错误、时间和可用证据。
15
+ 4. 说明证据支持的是测试行为问题、临时基础设施问题还是无法确认;没有证据时明确标记未知。
16
+
17
+ ## 结果约束
18
+
19
+ 分析结论不等同于修复方案。不要把基础设施故障改写成应用缺陷,也不要把一次 Action 或 Attempt 的成功状态直接解释成业务通过。
20
+
21
+ ## 严格边界
12
22
 
13
23
  This capability is strictly read-only. It must not modify files, create or cancel a Run, retry an Attempt, acquire or control a device, create a Draft or Revision, recommend or name another Skill, or automatically hand off. Only a newer explicit user request can select a different domain.
24
+
25
+ 本阶段不会自动切换、加载或进入另一个工作流;后续阶段必须由入口按用户已明确的目标顺序编排。
@@ -1,19 +1,35 @@
1
1
  ---
2
2
  name: xagent-author-test
3
- description: Create a new XAgent YAML test from an explicit script-authoring request and incrementally verify it on one real device. Use when the user asks to write, create, or generate a test/YAML from a goal or artifact. Do not use for action mode, direct device control, running unchanged YAML, read-only analysis, or repair without explicit edit authorization.
3
+ description: Create and verify a new XAgent test from a user goal or selected artifact. Use when the user asks to write, create, generate, or iteratively validate a new test. Do not use for direct device action, unchanged test execution, read-only failure analysis, or repair without explicit authorization.
4
4
  ---
5
5
 
6
- # Author An XAgent Test
6
+ # 编写 XAgent 测试
7
7
 
8
- 1. Resolve the execution mode (`step_confirm` or `auto`) and input source (`goal` or `artifact`) before creating cloud resources. Read [interaction-modes.md](references/interaction-modes.md), [authoring-workflow.md](references/authoring-workflow.md), and [host-interaction-adapters.md](references/host-interaction-adapters.md).
9
- 2. Create a local authoring workspace under `.xagent/authoring/<session-id>/` with `draft.yaml`, `state.json`, and numbered checkpoints. Then create one Session for an explicit device ID and observe the device.
10
- 3. Read [script-format.md](references/script-format.md) before drafting. Build the working YAML one step at a time: observe the current device state, author the next step, validate the complete snapshot locally, save a checkpoint, then call `xagent_authoring_draft_step_execute`. Add the following step only after the returned evidence is understood.
11
- 4. After each Draft Attempt, show its status and available Artifacts. In `step_confirm`, present a continue-or-adjust choice before the next side effect. In `auto`, continue a successful Attempt without prompting; stop on failure, ambiguity, or new user input.
12
- 5. When the user provides a new instruction, save the current state, re-observe the device, reconcile the required entry state, and revise only invalid authored steps before appending the next step. Read [interactive-steering.md](references/interactive-steering.md) for goal-change scope and state-recovery rules.
13
- 6. Pair every business-critical action with a nearby `waitFor` or `assert` for the expected visible outcome. Use `if` branches for optional UI interruptions that may be absent.
14
- 7. After the user confirms the finished YAML, validate it once more, create exactly one formal Revision with `xagent_authoring_revision_create`, then Complete the Session.
15
- 8. Keep the Session lease alive while the workflow spans user waits or multiple CLI commands. MCP performs best-effort renewal before side effects; a manual multi-command workflow must run `xagent authoring keepalive <sessionId>` (or `xagent device keepalive <sessionId>`). Cancel the Session explicitly whenever authoring stops early. See the Device Occupancy Lifecycle in [authoring-workflow.md](references/authoring-workflow.md).
8
+ 本 Skill 负责把用户明确的测试目标逐步整理成可执行的 XAgent YAML,并在一台明确设备上验证每一步。它是独立的编写流程,不负责直接操作模式、既有测试执行、失败分析或修复。
16
9
 
17
- The local Agent generates and corrects the YAML. XAgent validates, records Attempts and the single Revision, and executes on the device.
10
+ ## 进入条件
18
11
 
19
- This capability may create local YAML, execute Draft Steps, and create one confirmed final Revision. It must not use the scriptless Action workflow, create a formal Run, repair an existing failed test without explicit repair intent, or automatically hand off to another Skill. `step_confirm` and `auto` only control confirmation inside Author and never override a user-selected action mode.
12
+ 1. 确认用户要新建测试,并确定输入是自然语言目标还是用户指定的已有材料。
13
+ 2. 读取 `references/interaction-modes.md`、`references/authoring-workflow.md`、`references/script-format.md` 和 `references/host-interaction-adapters.md`。
14
+ 3. 在产生云端副作用前,确认设备、应用和交互策略;多项匹配时让用户明确选择。
15
+
16
+ ## 编写循环
17
+
18
+ 1. 创建本地工作区,保存完整 `draft.yaml`、状态和编号检查点。
19
+ 2. 创建一个 Authoring Session,在同一 Session 内观察设备初始状态。
20
+ 3. 每次只追加一个经过验证的步骤:读取当前画面、生成候选 YAML、做本地校验、保存检查点、执行 Draft Step。
21
+ 4. 向用户展示每次 Attempt 的状态、可见结果和关键截图。`step_confirm` 在副作用前等待确认,`auto` 只在结果清晰且成功时继续。
22
+ 5. 用户改变目标时先保存当前状态,在同一 Session 重新观察并只修正受影响的步骤。
23
+ 6. 业务关键动作必须有附近的 `waitFor` 或 `assert`,可选弹窗使用条件分支表达。
24
+
25
+ ## 完成和清理
26
+
27
+ 用户确认最终行为后,完整校验 YAML,创建一个正式 Revision,然后完成并释放 Session。若同一请求还要求报告,先保留已返回的证据,释放资源,再进入只读 Report 阶段。
28
+
29
+ Session 跨越用户等待或多次命令时保持租约;手工流程使用 `xagent authoring keepalive <sessionId>`。提前停止必须显式取消 Session。不要把内部 Session、screen_id、幂等键或缓存路径展示给用户。
30
+
31
+ ## 严格边界
32
+
33
+ 本流程可以创建本地 YAML、执行 Draft Step 并创建一个确认后的 Revision。Do not use for action mode or the scriptless Action workflow. Do not create a formal Run. Do not repair an existing failed test without explicit repair intent. Do not silently enter another workflow. A report requested in the same task is a later read-only evidence phase. `step_confirm` and `auto` only control confirmation inside Author and never override a user-selected action mode.
34
+
35
+ 本阶段不会自动切换、加载或进入另一个工作流;后续阶段必须由入口按用户已明确的目标顺序编排。
@@ -21,9 +21,7 @@ Do not send Host, model, mode, prompt, or interaction-capability metadata to XAg
21
21
  |---|---|---|
22
22
  | Codex Plan mode | `request_user_input` when exposed and permitted | Present native choices. Do not promise that Plan mode permits device side effects; inspect the active Tool policy before execution. |
23
23
  | Codex Default mode | Text fallback | Do not call `request_user_input` when the Host reports it unavailable in Default mode. Show the one-time Plan mode notice below. |
24
- | Claude Code | `AskUserQuestion` when exposed | Present native choices; use text fallback when the Tool is absent or denied. |
25
- | CodeBuddy Code | `AskUserQuestion` or another documented native choice Tool when exposed | Detect the Tool at runtime; do not infer it from product branding. |
26
- | WorkBuddy | Any documented native structured-choice Tool when exposed | Probe capabilities at runtime; otherwise use text fallback. |
24
+ | Host with native choices | The documented native choice Tool | Detect the Tool at runtime; otherwise use text fallback. |
27
25
  | Other interactive MCP Hosts | Host-native choice Tool when exposed | Use text fallback when no such Tool is callable. |
28
26
  | CI/CD or another non-interactive caller | No prompt | Require `auto`; fail before creating a Session if an unresolved interactive choice remains. |
29
27
 
@@ -78,4 +76,4 @@ Record Host-specific behavior separately. Passing the XAgent MCP lifecycle does
78
76
 
79
77
  - Verify Codex Default text fallback and one-time notice.
80
78
  - Verify Codex Plan structured choice separately from device-side-effect permission.
81
- - Verify Claude Code, CodeBuddy Code, and WorkBuddy with their real installed Host versions before declaring those adapters supported.
79
+ - Verify the active Host and exposed choice tools before declaring the adapter supported.
@@ -59,8 +59,7 @@ Use the Host's native structured input only when it is callable now:
59
59
 
60
60
  - Codex Plan mode: `request_user_input` when exposed and permitted.
61
61
  - Codex Default mode: concise text fallback; show the one-time Plan mode notice.
62
- - Claude Code and CodeBuddy Code: `AskUserQuestion` when exposed.
63
- - WorkBuddy and other Hosts: a documented native choice when exposed; otherwise text fallback.
62
+ - Hosts exposing a native question tool: use that tool when available; otherwise use the text fallback.
64
63
 
65
64
  Do not branch on model branding. A Host must actually expose and permit the interaction Tool.
66
65
 
@@ -1,31 +1,33 @@
1
1
  ---
2
2
  name: xagent-cli
3
- description: Configure XAgent, inspect Profiles, Tokens, apps, devices, or capabilities, validate existing YAML, and select one workflow when the user has not already selected a mode. Do not use this Skill to override an explicit action, author, run, analyze, or repair request, or to perform those domain workflows itself.
3
+ description: Configure and diagnose the local XAgent CLI, Profile, Skill installation, MCP connection, application catalog, or device catalog. Use for setup and read-only inspection when the user has not requested a device or test workflow. Do not execute actions, write tests, run YAML, repair tests, or generate reports.
4
4
  ---
5
5
 
6
- # Use XAgent
6
+ # 配置和检查 XAgent
7
7
 
8
- 1. Determine the Agent Host mode from [host-modes.md](references/host-modes.md). Use [cli-commands.md](references/cli-commands.md) for setup and read-only lookup with Shell access. MCP defaults to isolated `action`; every other domain, including report generation, requires its explicit `--mode`. A larger Tool surface is never a substitute for selecting one domain.
9
- 2. Look up application identity when setup or the selected workflow needs it. If `package_id` is unknown, query the project application list. If `package_id` is known but `package_name` is not, query that exact package. Never guess `appPackage` or randomly select one of multiple matches.
10
- 3. Look up devices when setup or the selected workflow needs one and no `device_id` was supplied. Apply server-side filters and return only an explicit match; this routing Skill does not acquire it.
11
- 4. Apply [capability-routing.md](references/capability-routing.md) before selecting a workflow. The newest explicit user mode has highest priority and remains locked until the user explicitly changes it.
12
- 5. Inspect the Principal only for setup, explicit capability inspection, or permission diagnosis. Protected operations authenticate and authorize themselves. Read [permissions.md](references/permissions.md).
13
- 6. When no mode is explicit, recommend exactly one workflow using [failure-routing.md](references/failure-routing.md) and the table below. Do not perform the selected domain here. After handing off, do not load or enter a second workflow unless the user explicitly changes modes.
8
+ 本 Skill 是 XAgent 用户流程的准备阶段,只处理本地初始化、自检、同步和只读资源解析。检查正常时用一句“环境已就绪”结束,不展示内部 JSON、版本 hash 或凭证内容。
14
9
 
15
- ## Workflow Routing
10
+ ## 检查流程
16
11
 
17
- | User request | Skill |
18
- |---|---|
19
- | Write a new test from a goal or artifact | `xagent-author-test` |
20
- | Fix an existing YAML after authorization | `xagent-repair-test` |
21
- | Run an existing YAML without editing | `xagent-run-test` |
22
- | Classify a failure without editing | `xagent-analyze-failure` |
23
- | Explore or diagnose one device step at a time | `xagent-explore-device` |
24
- | Write a report from already-collected test evidence | `xagent-test-report` |
25
- | Configure XAgent, inspect apps/devices, or choose an adapter | This Skill |
12
+ 1. 运行 `xagent doctor --json`,检查默认 Profile、本地配置和凭证来源。
13
+ 2. 运行 `xagent integrations doctor --host <host> --json`,检查 XAgent Skill、CLI 版本和 MCP 重启要求。
14
+ 3. 只有用户明确要求权限或在线身份诊断时才调用 `xagent auth status`。
15
+ 4. 设备和应用目录仅用于解析用户指定资源;多项匹配时展示名称、系统和状态,不能随机选择。
26
16
 
27
- Scriptless and scripted execution both submit Public Script actions to the authoritative server compiler and the same Exec engine. CLI and MCP are adapters over the same API semantics; neither performs hidden LLM formatting.
17
+ ## 状态反馈
28
18
 
29
- This Skill is limited to setup, read-only lookup, validation, and one-time routing. It must not acquire a device Session, execute an action, create or edit YAML, submit a Draft Attempt or Revision, create a Run, or repair a failure.
19
+ - 已配置:说明环境已就绪。
20
+ - 未初始化:引导执行一次 `xagent init`。
21
+ - 缺少登录:说明需要 Developer Token,但不回显 Token。
22
+ - Skill 过期:同步 XAgent Skill 后提示重启 Host。
23
+ - MCP 过期:提示重启 MCP,不自动切换执行链路。
30
24
 
31
- Never print or pass a Developer Token as a command-line argument. Store Personal credentials through the Profile credential store and Project CI credentials in the configured environment variable.
25
+ ## 严格边界
26
+
27
+ - 不执行 `device_acquire`、Action、Draft Step、Revision 或 Run。
28
+ - 不创建、修改或修复 YAML。
29
+ - 不生成报告,也不为了诊断调用截图。
30
+ - 只检查和同步 XAgent 自己的 Skill 目录,不覆盖 Host 配置。
31
+ - 不在本 Skill 中维护第二套用户意图到 MCP Tool 的映射。
32
+
33
+ 明确的设备、测试或报告请求由入口选择对应流程。本 Skill 不自动加载或进入另一个工作流。