@alwaysmeticulous/cli 2.331.3 → 2.332.0

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 (61) hide show
  1. package/README.md +16 -0
  2. package/dist/commands/onboard/__tests__/print-next-steps.spec.d.ts +2 -0
  3. package/dist/commands/onboard/__tests__/print-next-steps.spec.d.ts.map +1 -0
  4. package/dist/commands/onboard/__tests__/print-next-steps.spec.js +67 -0
  5. package/dist/commands/onboard/__tests__/print-next-steps.spec.js.map +1 -0
  6. package/dist/commands/onboard/__tests__/resolve-project.spec.d.ts +2 -0
  7. package/dist/commands/onboard/__tests__/resolve-project.spec.d.ts.map +1 -0
  8. package/dist/commands/onboard/__tests__/resolve-project.spec.js +44 -0
  9. package/dist/commands/onboard/__tests__/resolve-project.spec.js.map +1 -0
  10. package/dist/commands/onboard/__tests__/skills-install-choice.spec.d.ts +2 -0
  11. package/dist/commands/onboard/__tests__/skills-install-choice.spec.d.ts.map +1 -0
  12. package/dist/commands/onboard/__tests__/skills-install-choice.spec.js +51 -0
  13. package/dist/commands/onboard/__tests__/skills-install-choice.spec.js.map +1 -0
  14. package/dist/commands/onboard/__tests__/validate-ci-yaml.spec.d.ts +2 -0
  15. package/dist/commands/onboard/__tests__/validate-ci-yaml.spec.d.ts.map +1 -0
  16. package/dist/commands/onboard/__tests__/validate-ci-yaml.spec.js +112 -0
  17. package/dist/commands/onboard/__tests__/validate-ci-yaml.spec.js.map +1 -0
  18. package/dist/commands/onboard/build-context.d.ts +1 -0
  19. package/dist/commands/onboard/build-context.d.ts.map +1 -1
  20. package/dist/commands/onboard/build-context.js +6 -6
  21. package/dist/commands/onboard/build-context.js.map +1 -1
  22. package/dist/commands/onboard/customer-agents.json +0 -1
  23. package/dist/commands/onboard/customer-docs.json +1 -0
  24. package/dist/commands/onboard/docs-urls.d.ts +2 -0
  25. package/dist/commands/onboard/docs-urls.d.ts.map +1 -1
  26. package/dist/commands/onboard/docs-urls.js +5 -3
  27. package/dist/commands/onboard/docs-urls.js.map +1 -1
  28. package/dist/commands/onboard/index.d.ts.map +1 -1
  29. package/dist/commands/onboard/index.js +8 -6
  30. package/dist/commands/onboard/index.js.map +1 -1
  31. package/dist/commands/onboard/launch-agent.d.ts +1 -0
  32. package/dist/commands/onboard/launch-agent.d.ts.map +1 -1
  33. package/dist/commands/onboard/launch-agent.js +26 -15
  34. package/dist/commands/onboard/launch-agent.js.map +1 -1
  35. package/dist/commands/onboard/resolve-project.d.ts +9 -1
  36. package/dist/commands/onboard/resolve-project.d.ts.map +1 -1
  37. package/dist/commands/onboard/resolve-project.js +26 -4
  38. package/dist/commands/onboard/resolve-project.js.map +1 -1
  39. package/dist/commands/onboard/setup-agent-integrations.d.ts +2 -1
  40. package/dist/commands/onboard/setup-agent-integrations.d.ts.map +1 -1
  41. package/dist/commands/onboard/setup-agent-integrations.js +32 -7
  42. package/dist/commands/onboard/setup-agent-integrations.js.map +1 -1
  43. package/dist/commands/onboard/templates/CLAUDE.md +22 -9
  44. package/dist/commands/onboard/templates/agents/ci-setup.md +28 -0
  45. package/dist/commands/onboard/templates/agents/recorder-installation.md +6 -0
  46. package/dist/commands/onboard/templates/docs/ci.ts +2 -6
  47. package/dist/commands/onboard/templates/docs/github-actions-v2.ts +43 -37
  48. package/dist/commands/onboard/templates/docs/how-to/connect-git-provider.ts +26 -0
  49. package/dist/commands/onboard/templates/docs/how-to/typescript-types.ts +1 -1
  50. package/dist/commands/onboard/templates/docs/onboarding-guide.ts +77 -356
  51. package/dist/commands/onboard/templates/docs/recorder-getting-started.ts +5 -2
  52. package/dist/commands/onboard/templates/docs/recorder-snippets/script-based-instructions/nuxtjs-instructions.ts +1 -1
  53. package/dist/commands/onboard/templates/docs/recorder-snippets/script-based-instructions/rsbuild-instructions.ts +1 -1
  54. package/dist/commands/onboard/templates/docs/recorder-snippets/script-based-instructions/vite-instructions.ts +1 -1
  55. package/dist/commands/onboard/templates/docs/reference/cli-commands.ts +37 -0
  56. package/dist/commands/onboard/validate-ci-yaml.d.ts +22 -0
  57. package/dist/commands/onboard/validate-ci-yaml.d.ts.map +1 -0
  58. package/dist/commands/onboard/validate-ci-yaml.js +113 -0
  59. package/dist/commands/onboard/validate-ci-yaml.js.map +1 -0
  60. package/package.json +14 -13
  61. package/dist/commands/onboard/templates/agents/local-simulation-verification.md +0 -96
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4816c3ff-6f71-5b6b-9ef1-dfcb2f71135c")}catch(e){}}();
3
+
4
+ var __importDefault = (this && this.__importDefault) || function (mod) {
5
+ return (mod && mod.__esModule) ? mod : { "default": mod };
6
+ };
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.warnAboutInvalidCiYaml = exports.findInvalidCiYaml = void 0;
9
+ const fs_1 = require("fs");
10
+ const path_1 = require("path");
11
+ const chalk_1 = __importDefault(require("chalk"));
12
+ const yaml_1 = require("yaml");
13
+ const WORKFLOWS_DIR = (0, path_1.join)(".github", "workflows");
14
+ const SINGLE_FILE_CANDIDATES = [
15
+ ".gitlab-ci.yml",
16
+ ".gitlab-ci.yaml",
17
+ "bitbucket-pipelines.yml",
18
+ "bitbucket-pipelines.yaml",
19
+ ];
20
+ /**
21
+ * Parses the CI files that mention Meticulous and reports the ones a CI
22
+ * provider would reject. The install agent writes this YAML by hand, and a
23
+ * syntax slip there only shows up as a failed pipeline after the PR is open.
24
+ */
25
+ const findInvalidCiYaml = (options) => {
26
+ const invalid = [];
27
+ for (const absolutePath of candidateCiFiles(options.projectRoot)) {
28
+ const contents = readMeticulousCiFile(absolutePath);
29
+ if (contents === null) {
30
+ continue;
31
+ }
32
+ const problem = firstParseError(contents);
33
+ if (problem !== null) {
34
+ invalid.push({
35
+ relativePath: (0, path_1.relative)(options.projectRoot, absolutePath),
36
+ problem,
37
+ });
38
+ }
39
+ }
40
+ return invalid;
41
+ };
42
+ exports.findInvalidCiYaml = findInvalidCiYaml;
43
+ /**
44
+ * Prints a warning for CI files the agent left unparseable, so the user hears
45
+ * it here rather than from a red pipeline on the onboarding PR.
46
+ */
47
+ const warnAboutInvalidCiYaml = (options) => {
48
+ const invalid = (0, exports.findInvalidCiYaml)(options);
49
+ if (invalid.length === 0) {
50
+ return;
51
+ }
52
+ console.log("");
53
+ console.log(chalk_1.default.yellow(invalid.length === 1
54
+ ? "A CI file mentioning Meticulous is not valid YAML:"
55
+ : "Some CI files mentioning Meticulous are not valid YAML:"));
56
+ for (const file of invalid) {
57
+ console.log(` ${chalk_1.default.bold(file.relativePath)}: ${file.problem}`);
58
+ }
59
+ console.log(chalk_1.default.dim(" Fix these before merging — the pipeline will not run otherwise."));
60
+ };
61
+ exports.warnAboutInvalidCiYaml = warnAboutInvalidCiYaml;
62
+ const candidateCiFiles = (projectRoot) => {
63
+ const files = SINGLE_FILE_CANDIDATES.map((name) => (0, path_1.join)(projectRoot, name));
64
+ const workflowsDir = (0, path_1.join)(projectRoot, WORKFLOWS_DIR);
65
+ let entries;
66
+ try {
67
+ entries = (0, fs_1.readdirSync)(workflowsDir);
68
+ }
69
+ catch {
70
+ return files;
71
+ }
72
+ for (const entry of entries) {
73
+ if (entry.endsWith(".yml") || entry.endsWith(".yaml")) {
74
+ files.push((0, path_1.join)(workflowsDir, entry));
75
+ }
76
+ }
77
+ return files;
78
+ };
79
+ /**
80
+ * Reads a candidate file, or returns null when it is missing, is not a regular
81
+ * file (we never follow links out of the repo), or has nothing to do with us.
82
+ */
83
+ const readMeticulousCiFile = (absolutePath) => {
84
+ try {
85
+ if (!(0, fs_1.lstatSync)(absolutePath).isFile()) {
86
+ return null;
87
+ }
88
+ const contents = (0, fs_1.readFileSync)(absolutePath, "utf8");
89
+ return contents.toLowerCase().includes("meticulous") ? contents : null;
90
+ }
91
+ catch {
92
+ return null;
93
+ }
94
+ };
95
+ const firstParseError = (contents) => {
96
+ let errors;
97
+ try {
98
+ errors = (0, yaml_1.parseDocument)(contents).errors;
99
+ }
100
+ catch (error) {
101
+ return error instanceof Error ? error.message : String(error);
102
+ }
103
+ const [first] = errors;
104
+ if (!first) {
105
+ return null;
106
+ }
107
+ // The parser's message already names the line and column, then quotes the
108
+ // offending source below it. Keep the sentence, drop the excerpt.
109
+ const [summary = first.message] = first.message.split("\n");
110
+ return summary.replace(/:$/, "");
111
+ };
112
+ //# sourceMappingURL=validate-ci-yaml.js.map
113
+ //# debugId=4816c3ff-6f71-5b6b-9ef1-dfcb2f71135c
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-ci-yaml.js","sources":["../../../src/commands/onboard/validate-ci-yaml.ts"],"sourceRoot":"","names":[],"mappings":";;;;;;;;AAAA,2BAA0D;AAC1D,+BAAsC;AACtC,kDAA0B;AAC1B,+BAAqC;AASrC,MAAM,aAAa,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAEnD,MAAM,sBAAsB,GAAG;IAC7B,gBAAgB;IAChB,iBAAiB;IACjB,yBAAyB;IACzB,0BAA0B;CAC3B,CAAC;AAEF;;;;GAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,OAEjC,EAAuB,EAAE;IACxB,MAAM,OAAO,GAAwB,EAAE,CAAC;IACxC,KAAK,MAAM,YAAY,IAAI,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACjE,MAAM,QAAQ,GAAG,oBAAoB,CAAC,YAAY,CAAC,CAAC;QACpD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;YACtB,SAAS;QACX,CAAC;QACD,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;QAC1C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC;gBACX,YAAY,EAAE,IAAA,eAAQ,EAAC,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AC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IACD,0EAA0E;IAC1E,kEAAkE;IAClE,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC5D,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC,CAAC","debugId":"4816c3ff-6f71-5b6b-9ef1-dfcb2f71135c"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwaysmeticulous/cli",
3
- "version": "2.331.3",
3
+ "version": "2.332.0",
4
4
  "description": "The Meticulous CLI",
5
5
  "license": "ISC",
6
6
  "main": "dist/index.js",
@@ -23,20 +23,21 @@
23
23
  "parse-diff": "^0.11.1",
24
24
  "puppeteer-core": "24.42.0",
25
25
  "tar": "^7.5.22",
26
+ "yaml": "^2.9.0",
26
27
  "yargs": "^17.5.1",
27
- "@alwaysmeticulous/client": "2.331.2",
28
- "@alwaysmeticulous/api": "2.327.0",
29
- "@alwaysmeticulous/common": "2.326.0",
30
- "@alwaysmeticulous/debug-workspace": "2.331.2",
31
- "@alwaysmeticulous/downloading-helpers": "2.331.2",
32
- "@alwaysmeticulous/record": "2.327.0",
33
- "@alwaysmeticulous/remote-replay-launcher": "2.331.2",
28
+ "@alwaysmeticulous/api": "2.332.0",
29
+ "@alwaysmeticulous/client": "2.332.0",
30
+ "@alwaysmeticulous/common": "2.332.0",
31
+ "@alwaysmeticulous/debug-workspace": "2.332.0",
32
+ "@alwaysmeticulous/downloading-helpers": "2.332.0",
33
+ "@alwaysmeticulous/record": "2.332.0",
34
+ "@alwaysmeticulous/remote-replay-launcher": "2.332.0",
34
35
  "@alwaysmeticulous/replay-debugger-ui": "2.283.1",
35
- "@alwaysmeticulous/replay-orchestrator-launcher": "2.331.2",
36
- "@alwaysmeticulous/sdk-bundles-api": "2.331.0",
37
- "@alwaysmeticulous/sentry": "2.326.0",
38
- "@alwaysmeticulous/session-filters": "2.327.0",
39
- "@alwaysmeticulous/tunnels-client": "2.326.0"
36
+ "@alwaysmeticulous/replay-orchestrator-launcher": "2.332.0",
37
+ "@alwaysmeticulous/sdk-bundles-api": "2.332.0",
38
+ "@alwaysmeticulous/sentry": "2.332.0",
39
+ "@alwaysmeticulous/session-filters": "2.332.0",
40
+ "@alwaysmeticulous/tunnels-client": "2.332.0"
40
41
  },
41
42
  "devDependencies": {
42
43
  "@types/cli-progress": "^3.11.5",
@@ -1,96 +0,0 @@
1
- ---
2
- name: local-simulation-verification
3
- description: Produces local simulation testing instructions for the onboarding plan. Use after the reviewer has produced a codebase summary.
4
- tools: Read, Grep, Glob, Write
5
- model: sonnet
6
- ---
7
-
8
- You are a local simulation verification specialist for the Meticulous automated UI testing platform.
9
-
10
- Your job is to produce a self-contained "Verify Local Simulation" section that guides the
11
- customer through running their first local replay. Write the section to the output file path
12
- provided in the prompt.
13
-
14
- The reviewer's structured summary will be provided in the prompt that launches you.
15
-
16
- ## Reference Docs
17
-
18
- Read the Meticulous doc source file in `.claude/docs/`:
19
-
20
- - `.claude/docs/how-to/troubleshoot-failed-simulations.ts` -- troubleshooting failed simulations
21
-
22
- ## Background
23
-
24
- Local simulation is a critical verification step between installing the recorder and setting
25
- up CI. It confirms that:
26
-
27
- 1. The recorder is installed correctly and sessions are being recorded.
28
- 2. Sessions can be replayed against the customer's local dev/preview environment.
29
- 3. Screenshots are captured correctly.
30
-
31
- The customer should not proceed to CI setup until local simulation works.
32
-
33
- ## What to Investigate
34
-
35
- 1. Read the reviewer's summary for the framework, package manager, and dev/start command.
36
- 2. Check `package.json` scripts for:
37
- - `dev` or `start` commands (for the dev server)
38
- - `build` + `start` commands (for the production server)
39
- - The port the app runs on (look for `PORT`, `-p`, `--port` in scripts)
40
- 3. Check if the app requires environment variables to start (`.env.local`, `.env.example`).
41
-
42
- ## What to Produce
43
-
44
- Write your markdown section to the output file path provided in the prompt. It should contain:
45
-
46
- ````
47
- ## Step <N>: Verify Local Simulation
48
-
49
- Local simulation replays a recorded session against your local development server. This
50
- verifies that the recorder is working and that sessions can be replayed successfully.
51
-
52
- ### Prerequisites
53
-
54
- 1. Start your development server:
55
- ```bash
56
- <dev command, e.g. npm run dev>
57
- ```
58
-
59
- Your app should be running at `http://localhost:<port>`.
60
-
61
- 2. Record a session: Open your app in the browser, navigate through a few pages, and
62
- interact with key features. After 30 seconds or so, check the [Meticulous dashboard
63
- Sessions tab]({meticulousSessionsUrl}) to confirm the session was recorded. (Read the
64
- `meticulousSessionsUrl` value from `.claude/onboard-context.json` and substitute it in.)
65
-
66
- 3. Copy the session ID from the dashboard.
67
-
68
- ### Run the Simulation
69
-
70
- ```bash
71
- npx @alwaysmeticulous/cli simulate \
72
- --sessionId "<SESSION_ID>" \
73
- --appUrl "http://localhost:<port>"
74
- ```
75
-
76
- ### Success Criteria
77
-
78
- - The command completes without errors.
79
- - The simulation appears in the Meticulous dashboard.
80
- - Screenshots look correct (match what you see in the browser).
81
-
82
- ### Troubleshooting
83
-
84
- <Common failure modes and how to fix them>
85
- ````
86
-
87
- Guidelines:
88
-
89
- - Use the actual dev command and port from the customer's `package.json`.
90
- - If the app requires environment variables, note that they should be set before running.
91
- - Include common failure modes:
92
- - **Auth redirects**: If the replay shows a login page, see the auth configuration step.
93
- - **Blank page**: Use `--devTools` flag to open browser dev tools for debugging.
94
- - **Network errors**: Check the Timeline tab in the Meticulous dashboard for failed requests.
95
- - **Port conflicts**: Make sure the dev server is running and accessible.
96
- - Mention the `--devTools` and `--headful` flags for debugging.