create-healix 1.1.5 → 1.2.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.
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # create-healix
2
+
3
+ Scaffold a [Healix](https://www.npmjs.com/package/wdio-healix-service) test-automation project in one command — a ready-to-run WebdriverIO setup wired for AI-assisted authoring and **self-healing, standalone** test suites.
4
+
5
+ ```bash
6
+ npx create-healix my-app
7
+ cd my-app
8
+ ```
9
+
10
+ ## What you get
11
+ - **WebdriverIO + Healix service** preconfigured (`wdio.web.conf.ts`).
12
+ - **`.mcp.json`** registering the [`healix-mcp`](https://www.npmjs.com/package/healix-mcp) server, so an AI agent (Claude Code, Cursor, Windsurf, …) can drive the live browser, observe the real DOM, and author specs/page objects for you.
13
+ - **Two-file page-object model** + an example spec/POM to copy.
14
+ - **Allure reporting** and a `reports/screenshots/` directory wired out of the box.
15
+ - **`CLAUDE.md`** + a SessionStart hook so the agent always loads the framework guide.
16
+
17
+ ## Options
18
+ | Flag | Effect |
19
+ |------|--------|
20
+ | `--yes`, `-y` | Accept all defaults |
21
+ | `--platforms=web,android,ios` | Target platforms (default `web`) |
22
+ | `--app-url=<url>` | Default app URL for the example spec |
23
+ | `--mcp=cursor\|claude\|windsurf` | Which MCP client to configure |
24
+ | `--skip-install` | Don't run `npm install` |
25
+
26
+ ## Run it
27
+ ```bash
28
+ npm run session:web # opens a live browser + the Healix API for the agent to drive
29
+ npm test # runs the suite standalone — no AI, no MCP
30
+ ```
31
+
32
+ The deliverable is a normal WDIO suite: it runs in CI with `npx wdio run` and **no AI in the loop**.
33
+
34
+ See [`wdio-healix-service`](https://www.npmjs.com/package/wdio-healix-service) (the framework) and [`healix-mcp`](https://www.npmjs.com/package/healix-mcp) (the agent server).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-healix",
3
- "version": "1.1.5",
3
+ "version": "1.2.0",
4
4
  "description": "Scaffold a healix WDIO project with MCP integration ready out of the box",
5
5
  "type": "module",
6
6
  "bin": {
package/src/templates.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Template generators for create-healix scaffold output.
2
2
  // Each function returns the file content as a string with all known fixes applied.
3
3
 
4
- const HEALIX_SERVICE_VERSION = '^0.2.0';
4
+ const HEALIX_SERVICE_VERSION = '^0.3.0';
5
5
 
6
6
  export function tsconfigJson() {
7
7
  return JSON.stringify(
@@ -55,6 +55,7 @@ export function packageJson(projectName) {
55
55
  '@wdio/local-runner': '^9',
56
56
  '@wdio/mocha-framework': '^9',
57
57
  '@wdio/spec-reporter': '^9',
58
+ '@wdio/allure-reporter': '^9',
58
59
  'cross-env': '^7',
59
60
  'ts-node': '^10',
60
61
  typescript: '^5',
@@ -77,10 +78,14 @@ export function wdioWebConf(apiPort = 4000) {
77
78
  framework: 'mocha',
78
79
  mochaOpts: {
79
80
  ui: 'bdd',
80
- timeout: 300000,
81
+ // Interactive/agent sessions are held open inside ONE long-lived mocha test; WDIO
82
+ // (@wdio/utils) would otherwise kill it at this timeout (default 5 min) and force a
83
+ // mid-run restart. Lift it for agent mode with a large FINITE value — NEVER 0, which
84
+ // in WDIO yields a negative (instant-firing) timeout, the opposite of mocha's "disable".
85
+ timeout: (process.env.HEALIX_AGENT === '1' || process.env.HEALIX_INTERACTIVE === 'true') ? 86400000 : 300000,
81
86
  },
82
87
 
83
- reporters: ['spec'],
88
+ reporters: ['spec', ['allure', { outputDir: 'allure-results' }]],
84
89
 
85
90
  suites: {
86
91
  smoke: ['./test/specs/smoke/**/*.spec.ts'],
@@ -116,7 +121,7 @@ export function wdioWebConf(apiPort = 4000) {
116
121
  },
117
122
  }]],
118
123
 
119
- waitforTimeout: 10000,
124
+ waitforTimeout: 5000,
120
125
  connectionRetryTimeout: 120000,
121
126
  connectionRetryCount: 3,
122
127
 
@@ -144,32 +149,31 @@ export function mcpJson(port = 4000) {
144
149
  // The re-hydration reminder text — single source, shared by the hook script and
145
150
  // kept short so it re-anchors without becoming noise.
146
151
  const REHYDRATE_REMINDER =
147
- 'HEALIX RE-HYDRATION: a context compaction just occurred. Before ANY healix_* ' +
148
- 'automation step, re-run healix_guide to reload the framework model + workflow ' +
149
- 'do not operate from memory of it. Drive the live browser only through healix_* ' +
150
- 'tools; every selector is observed, never guessed.';
152
+ 'HEALIX PROJECT: drive the live browser ONLY through the healix_* MCP tools — ' +
153
+ 'every selector is observed live, never guessed, and specs/POMs are authored via ' +
154
+ 'the scaffold tools. If the Healix guide is not currently in your context, run ' +
155
+ 'healix_guide before any scaffold/heal/run step do not operate from memory of it.';
151
156
 
152
- // Tiny script the compact hook runs. Living in a FILE (not an inline `node -e`)
153
- // avoids cross-shell quoting hell — the hook command is just `node <path>`.
157
+ // Tiny script the hook runs. Living in a FILE (not an inline `node -e`) avoids
158
+ // cross-shell quoting hell — the hook command is just `node <path>`.
154
159
  export function claudeRehydrateScript() {
155
- return `// Printed into the agent's context by the SessionStart(compact) hook.\n` +
160
+ return `// Printed into the agent's context by the SessionStart hook (startup + after compaction).\n` +
156
161
  `console.log(${JSON.stringify(REHYDRATE_REMINDER)});\n`;
157
162
  }
158
163
 
159
- // Claude Code SessionStart hook that fires AFTER a context compaction/summary and
160
- // re-injects the healix re-hydration reminder. Compaction drops tool results (where
161
- // the full healix_guide lives), so without this the agent can "forget" the workflow.
162
- // The hook's stdout is added to the agent's context on resume — deterministic, no
163
- // reliance on the model noticing the guide is gone. matcher "compact" = only after a
164
- // compaction (not every startup), so it is silent during normal work. The command is
165
- // a bare `node <relative path>` (no nested quotes) so it works in cmd, PowerShell, sh.
164
+ // Claude Code-format SessionStart hook (host-agnostic: read by any host that
165
+ // supports the .claude/settings.json convention Claude Code, Spryv, …). No
166
+ // matcher = fires on every SessionStart: it SEEDS the workflow at startup and
167
+ // RE-HYDRATES after a context compaction (when tool results, where the full
168
+ // healix_guide lives, get dropped). The hook's stdout is injected into the
169
+ // agent's context deterministic, no reliance on the model noticing the guide is
170
+ // gone. The command is a bare `node <relative path>` so it works in cmd/PowerShell/sh.
166
171
  export function claudeSettings() {
167
172
  return JSON.stringify(
168
173
  {
169
174
  hooks: {
170
175
  SessionStart: [
171
176
  {
172
- matcher: 'compact',
173
177
  hooks: [
174
178
  { type: 'command', command: 'node .claude/healix-rehydrate.mjs' },
175
179
  ],