@mechasm/cli 0.1.3 → 0.1.4

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/AGENT_GUIDE.md CHANGED
@@ -22,8 +22,21 @@ mechasm runs status RUN_ID --project PROJECT_ID --json
22
22
 
23
23
  Log streaming alone does not report pass/fail through its exit code. Do not infer success from a closed stream or an individual log line. For scripts that only need the final result, `--wait` on create/edit/run or `runs wait` waits silently and returns the final result without displaying live logs. With `--json`, it returns one final JSON result.
24
24
 
25
+ Let Mechasm's healer work while the run is active. Failed actions, unexpected pages and recovery attempts can be corrected automatically. Wait for the overall run to reach `passed` or `failed`; do not cancel because a few minutes passed or one step failed. Stop when the user requests it, or when you deliberately need to change the prompt before continuing. `runs status` includes `terminal`, the current `progress` phase/start time when available, and safe failure details with a suggested next step. Missing progress is not proof the run is stuck.
26
+
27
+ Before reporting the outcome, review the logs and available evidence against the user's intended result:
28
+
29
+ ```sh
30
+ mechasm runs trace RUN_ID --project PROJECT_ID --out run-trace.zip
31
+ mechasm runs video RUN_ID --project PROJECT_ID --out run.webm
32
+ ```
33
+
34
+ Check artifact availability in `runs status`; uploads can finish after the run result. Inspect trace screenshots/page snapshots, actions and errors, using video as supporting evidence. Verify that the expected behavior really happened; do not treat an existing file as proof of success. If evidence is unavailable or cannot be opened, report that limit.
35
+
36
+ If evidence shows a genuine failure of the user's requirement, accept and report the failure. If your prompt introduced an unsupported assumption or was ambiguous, clarify it without weakening the user's requirement, then use `tests edit --prompt-file FILE` and inspect the new run. Ask the user if their intended result is unclear. Do not repeatedly rerun or remove assertions just to get a pass. A manually stopped run proves cancellation, not what the natural result would have been.
37
+
25
38
  Use explicit project, test, and run IDs. Do not assume a default project. Use `--json` for scripts; stdout contains JSON and errors go to stderr. Log following emits JSON lines. Save run IDs and log cursors in workflow state. Resume logs with `--after CURSOR` after reconnecting.
26
39
 
27
40
  Exit code `5` from a status/get/wait command or a test command using `--wait` means the run failed or was stopped. Code `2` means invalid arguments, `3` authentication failed, and `4` permission was denied. The optional npm update notice runs only in interactive non-JSON sessions; CI skips it.
28
41
 
29
- See [CLI documentation](https://mechasm.ai/docs/mechasm-cli/getting-started) for full command details.
42
+ See [CLI documentation](https://mechasm.ai/docs/mechasm-cli/getting-started) and [agent workflows](https://mechasm.ai/docs/mechasm-cli/agent-workflows) for full command details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mechasm/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Mechasm command line client",
5
5
  "homepage": "https://mechasm.ai/docs/mechasm-cli/getting-started",
6
6
  "license": "SEE LICENSE IN LICENSE",
package/src/cli.js CHANGED
@@ -181,7 +181,10 @@ function output(value, json) {
181
181
  console.log(`Signed in${identity ? ` as ${identity}` : ''}${value.deviceName ? ` (${value.deviceName})` : ''}.`);
182
182
  }
183
183
  else if (Array.isArray(value?.projects)) {
184
- if (!value.projects.length) console.log('No projects available.');
184
+ if (!value.projects.length) {
185
+ console.log(value.message || 'No projects available to this device.');
186
+ if (value.suggestedNextStep) console.log(value.suggestedNextStep);
187
+ }
185
188
  else for (const project of value.projects) console.log(`${project.id} ${project.name} ${project.url}`);
186
189
  } else if (Array.isArray(value?.tests)) {
187
190
  if (!value.tests.length) console.log('No tests found.');