@osfactory/har 0.25.0 → 0.27.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/dist/index.js +38218 -37936
- package/dist/templates/adaptation-prompt-init.md +1 -1
- package/dist/templates/agent-skills/setup-har.md +1 -1
- package/dist/templates/cursor-rule.mdc.template +1 -1
- package/dist/templates/har-boilerplate/README.md +1 -1
- package/dist/templates/har-boilerplate/STAGES.md +8 -6
- package/dist/templates/har-boilerplate/stages.json +1 -1
- package/dist/templates/har-boilerplate/verify.sh +1 -1
- package/dist/templates/har-boilerplate-cli/README.md +1 -1
- package/dist/templates/har-boilerplate-cli/STAGES.md +8 -6
- package/dist/templates/har-boilerplate-cli/stages.json +1 -1
- package/dist/templates/har-boilerplate-cli/verify.sh +1 -1
- package/dist/templates/har-boilerplate-ios/ADAPT-PROMPT.md +3 -3
- package/dist/templates/har-boilerplate-ios/CLAUDE.agent.md +1 -1
- package/dist/templates/har-boilerplate-ios/README.md +2 -2
- package/dist/templates/har-boilerplate-ios/STAGES.md +8 -6
- package/dist/templates/har-boilerplate-ios/stages.json +1 -1
- package/dist/templates/har-boilerplate-ios/verify.sh +1 -1
- package/dist/templates/{stage-templates → plugins}/playwright/README.md +2 -2
- package/dist/templates/{stage-templates → plugins}/rocketsim/README.md +3 -3
- package/package.json +3 -1
- package/scripts/ensure-telemetry-default.cjs +40 -0
- /package/dist/templates/{stage-templates → plugins}/custom-stage-skeleton.sh +0 -0
- /package/dist/templates/{stage-templates → plugins}/playwright/.github/workflows/playwright.yml +0 -0
- /package/dist/templates/{stage-templates → plugins}/playwright/.har/stages/PLAYWRIGHT.md +0 -0
- /package/dist/templates/{stage-templates → plugins}/playwright/.har/stages/browser-e2e.sh +0 -0
- /package/dist/templates/{stage-templates → plugins}/playwright/package.fragment.json +0 -0
- /package/dist/templates/{stage-templates → plugins}/playwright/playwright.config.js +0 -0
- /package/dist/templates/{stage-templates → plugins}/playwright/template.manifest.json +0 -0
- /package/dist/templates/{stage-templates → plugins}/playwright/tests/a11y/smoke.spec.js +0 -0
- /package/dist/templates/{stage-templates → plugins}/playwright/tests/api/health.spec.js +0 -0
- /package/dist/templates/{stage-templates → plugins}/playwright/tests/frontend/smoke.spec.js +0 -0
- /package/dist/templates/{stage-templates → plugins}/rocketsim/.har/stages/ROCKETSIM.md +0 -0
- /package/dist/templates/{stage-templates → plugins}/rocketsim/.har/stages/rocketsim-flows.sh +0 -0
- /package/dist/templates/{stage-templates → plugins}/rocketsim/flows/README.md +0 -0
- /package/dist/templates/{stage-templates → plugins}/rocketsim/flows/example-smoke.sh +0 -0
- /package/dist/templates/{stage-templates → plugins}/rocketsim/template.manifest.json +0 -0
|
@@ -117,7 +117,7 @@ scripts or document why no substitute is needed. In particular:
|
|
|
117
117
|
`.env.agent.<id>`, and `verify.sh` resolves env/work dir through `agent-slot.sh`.
|
|
118
118
|
|
|
119
119
|
### Optional Playwright stage
|
|
120
|
-
If the user ran `har env add-
|
|
120
|
+
If the user ran `har env add-plugin playwright` (or `@playwright/test` is in package.json):
|
|
121
121
|
|
|
122
122
|
- Adapt `tests/**` selectors and API paths for this stack
|
|
123
123
|
- Ensure `HARNESS_HEALTH_CHECK_PATH` matches the app health route used in API smoke tests
|
|
@@ -47,7 +47,7 @@ har env add-stage unit-tests --custom --kind test --command "npm test" --verific
|
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
- Use `--command` for one-liner checks; use `--script` when a check needs the slot's env, ports, or artifacts (then implement the scaffolded `.har/stages/<id>.sh`).
|
|
50
|
-
- Rich integrations ship as
|
|
50
|
+
- Rich integrations ship as **plugins**: `har env add-plugin --list`, then e.g. `har env add-plugin playwright` (web) or `har env add-plugin rocketsim` (iOS). Plugins install stages; agents only talk to the stage registry.
|
|
51
51
|
|
|
52
52
|
## 6. Prove the harness works
|
|
53
53
|
|
|
@@ -31,7 +31,7 @@ When a slot is occupied: prefer `complete` / `teardown` if the previous task is
|
|
|
31
31
|
- **Never** set `force`/`confirmReplace` without the user explicitly approving replacement.
|
|
32
32
|
- **Commit early and often** in the session worktree — teardown keeps the branch, not uncommitted work.
|
|
33
33
|
- **Gitignored paths are ephemeral** (`state/`, `runs/`, local clones) — they are lost when the worktree is removed.
|
|
34
|
-
- With telemetry
|
|
34
|
+
- With telemetry on (default, including prompts), Mission Control derives session purpose from the first captured user prompt.
|
|
35
35
|
|
|
36
36
|
<!-- Monorepo: if this repository contains multiple .har harnesses, list them here
|
|
37
37
|
and pick by the files you are changing. Example:
|
|
@@ -73,7 +73,7 @@ The stock commands are deliberately generic conventions keyed by
|
|
|
73
73
|
adaptation; do not leave Node/npm, Python, Go, Rust, Java, or Ruby defaults in
|
|
74
74
|
place when they do not match the project.
|
|
75
75
|
|
|
76
|
-
Install Playwright
|
|
76
|
+
Install Playwright plugin: `har env add-plugin playwright` (optional). UI changes should add or update specs under `tests/`.
|
|
77
77
|
|
|
78
78
|
## Readiness layers
|
|
79
79
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# HAR Stages — authoring guide
|
|
2
2
|
|
|
3
3
|
Stages are the harness's single vocabulary for runnable checks and lifecycle
|
|
4
|
-
actions. Everything — shipped
|
|
4
|
+
actions. Everything — shipped plugins (`playwright`, `rocketsim`), your
|
|
5
5
|
project's test/lint commands, bespoke validation scripts — registers in
|
|
6
6
|
`.har/stages.json` with the same schema, and agents interact with stages only
|
|
7
7
|
through that registry (CLI `har env verify`, MCP `har_run_stage` /
|
|
8
8
|
`har_run_verification`), never through stack-specific tooling.
|
|
9
9
|
|
|
10
|
+
Philosophy: *plugins install stages; agents only talk to the stage registry.*
|
|
11
|
+
|
|
10
12
|
## The registry: `.har/stages.json`
|
|
11
13
|
|
|
12
14
|
```jsonc
|
|
@@ -83,9 +85,9 @@ The registry also holds the optional `commitGate` config (installed via
|
|
|
83
85
|
"worktrees" | "all" } }` controls whether unverified change batches may be
|
|
84
86
|
committed.
|
|
85
87
|
|
|
86
|
-
## Shipped
|
|
88
|
+
## Shipped plugins
|
|
87
89
|
|
|
88
|
-
`har env add-
|
|
89
|
-
playwright` (web) or `har env add-
|
|
90
|
-
|
|
91
|
-
and registers stages through the exact same registry as
|
|
90
|
+
`har env add-plugin --list` shows available plugins; `har env add-plugin
|
|
91
|
+
playwright` (web) or `har env add-plugin rocketsim` (iOS) installs one. A
|
|
92
|
+
plugin is just packaging: it copies files, merges `package.json` fragments,
|
|
93
|
+
and registers stages through the exact same registry as `add-stage --custom`.
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
{
|
|
33
33
|
"id": "verify",
|
|
34
34
|
"kind": "verify",
|
|
35
|
-
"description": "Verification pipeline (quick by default; --full
|
|
35
|
+
"description": "Verification pipeline (quick smoke by default; --full runs the registry's verificationStages)",
|
|
36
36
|
"command": "./.har/verify.sh {agentId}",
|
|
37
37
|
"acceptsArgs": ["--full"],
|
|
38
38
|
"artifacts": [
|
|
@@ -233,7 +233,7 @@ if [ -n "$FULL" ]; then
|
|
|
233
233
|
run_step "readiness" "run_readiness_if_configured \"$AGENT_ID\"" || true
|
|
234
234
|
# Registered verification stages from .har/stages.json (see .har/STAGES.md).
|
|
235
235
|
# Every stage listed in verificationStages with a registered script/command
|
|
236
|
-
# runs here --
|
|
236
|
+
# runs here -- plugins and custom stages alike.
|
|
237
237
|
while IFS=$'\t' read -r STAGE_ID STAGE_CMD; do
|
|
238
238
|
[ -n "$STAGE_ID" ] || continue
|
|
239
239
|
run_step "$STAGE_ID" "$STAGE_CMD" || true
|
|
@@ -53,7 +53,7 @@ In Cursor with HAR MCP configured: use `har_launch_environment`, `har_run_verifi
|
|
|
53
53
|
./.har/teardown.sh 1
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Read **`stages.json`** and **`verificationStages`**. Optional: `har env add-
|
|
56
|
+
Read **`stages.json`** and **`verificationStages`**. Optional: `har env add-plugin playwright`.
|
|
57
57
|
|
|
58
58
|
## Verification contract
|
|
59
59
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# HAR Stages — authoring guide
|
|
2
2
|
|
|
3
3
|
Stages are the harness's single vocabulary for runnable checks and lifecycle
|
|
4
|
-
actions. Everything — shipped
|
|
4
|
+
actions. Everything — shipped plugins (`playwright`, `rocketsim`), your
|
|
5
5
|
project's test/lint commands, bespoke validation scripts — registers in
|
|
6
6
|
`.har/stages.json` with the same schema, and agents interact with stages only
|
|
7
7
|
through that registry (CLI `har env verify`, MCP `har_run_stage` /
|
|
8
8
|
`har_run_verification`), never through stack-specific tooling.
|
|
9
9
|
|
|
10
|
+
Philosophy: *plugins install stages; agents only talk to the stage registry.*
|
|
11
|
+
|
|
10
12
|
## The registry: `.har/stages.json`
|
|
11
13
|
|
|
12
14
|
```jsonc
|
|
@@ -83,9 +85,9 @@ The registry also holds the optional `commitGate` config (installed via
|
|
|
83
85
|
"worktrees" | "all" } }` controls whether unverified change batches may be
|
|
84
86
|
committed.
|
|
85
87
|
|
|
86
|
-
## Shipped
|
|
88
|
+
## Shipped plugins
|
|
87
89
|
|
|
88
|
-
`har env add-
|
|
89
|
-
playwright` (web) or `har env add-
|
|
90
|
-
|
|
91
|
-
and registers stages through the exact same registry as
|
|
90
|
+
`har env add-plugin --list` shows available plugins; `har env add-plugin
|
|
91
|
+
playwright` (web) or `har env add-plugin rocketsim` (iOS) installs one. A
|
|
92
|
+
plugin is just packaging: it copies files, merges `package.json` fragments,
|
|
93
|
+
and registers stages through the exact same registry as `add-stage --custom`.
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
{
|
|
33
33
|
"id": "verify",
|
|
34
34
|
"kind": "verify",
|
|
35
|
-
"description": "Verification pipeline (quick by default; --full
|
|
35
|
+
"description": "Verification pipeline (quick smoke by default; --full runs the registry's verificationStages)",
|
|
36
36
|
"command": "./.har/verify.sh {agentId}",
|
|
37
37
|
"acceptsArgs": ["--full"],
|
|
38
38
|
"artifacts": [
|
|
@@ -189,7 +189,7 @@ if [ -n "$FULL" ]; then
|
|
|
189
189
|
run_step "readiness" "run_readiness_if_configured \"$AGENT_ID\"" || true
|
|
190
190
|
# Registered verification stages from .har/stages.json (see .har/STAGES.md).
|
|
191
191
|
# Every stage listed in verificationStages with a registered script/command
|
|
192
|
-
# runs here --
|
|
192
|
+
# runs here -- plugins and custom stages alike.
|
|
193
193
|
while IFS=$'\t' read -r STAGE_ID STAGE_CMD; do
|
|
194
194
|
[ -n "$STAGE_ID" ] || continue
|
|
195
195
|
run_step "$STAGE_ID" "$STAGE_CMD" || true
|
|
@@ -30,12 +30,12 @@ Run `./.har/launch.sh 1`, then `./.har/verify.sh 1`.
|
|
|
30
30
|
Common adaptations:
|
|
31
31
|
- If the project uses a custom test plan, add `-testPlan MyTests` to the `xcodebuild test` invocation.
|
|
32
32
|
- If SwiftLint is not used, remove or comment out the `lint` step.
|
|
33
|
-
- If there are UI tests that require a running app, move them to a RocketSim flow (`har env add-
|
|
33
|
+
- If there are UI tests that require a running app, move them to a RocketSim flow (`har env add-plugin rocketsim`) rather than xcodebuild tests.
|
|
34
34
|
|
|
35
|
-
## 4 — Add the RocketSim
|
|
35
|
+
## 4 — Add the RocketSim plugin (recommended)
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
har env add-
|
|
38
|
+
har env add-plugin rocketsim
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
Then adapt `flows/example-smoke.sh` to navigate to your app's main screen and verify it loads.
|
|
@@ -57,7 +57,7 @@ Adapt for your scheme and simulator — see `.har/harness.env`.
|
|
|
57
57
|
|
|
58
58
|
## User-flow validation (RocketSim)
|
|
59
59
|
|
|
60
|
-
If the RocketSim
|
|
60
|
+
If the RocketSim plugin is installed (`har env add-plugin rocketsim`):
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
63
|
./.har/stages/rocketsim-flows.sh ${AGENT_ID}
|
|
@@ -55,10 +55,10 @@ In Cursor with HAR MCP configured: use `har_launch_environment`, `har_run_verifi
|
|
|
55
55
|
|
|
56
56
|
## User-flow validation
|
|
57
57
|
|
|
58
|
-
Add the RocketSim
|
|
58
|
+
Add the RocketSim plugin to get reusable UI flow validation:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
har env add-
|
|
61
|
+
har env add-plugin rocketsim
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
This installs `.har/stages/rocketsim-flows.sh` and a `flows/` directory. Add flow scripts under `flows/` (see `.har/stages/ROCKETSIM.md`). Full verify automatically runs all flows.
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# HAR Stages — authoring guide
|
|
2
2
|
|
|
3
3
|
Stages are the harness's single vocabulary for runnable checks and lifecycle
|
|
4
|
-
actions. Everything — shipped
|
|
4
|
+
actions. Everything — shipped plugins (`playwright`, `rocketsim`), your
|
|
5
5
|
project's test/lint commands, bespoke validation scripts — registers in
|
|
6
6
|
`.har/stages.json` with the same schema, and agents interact with stages only
|
|
7
7
|
through that registry (CLI `har env verify`, MCP `har_run_stage` /
|
|
8
8
|
`har_run_verification`), never through stack-specific tooling.
|
|
9
9
|
|
|
10
|
+
Philosophy: *plugins install stages; agents only talk to the stage registry.*
|
|
11
|
+
|
|
10
12
|
## The registry: `.har/stages.json`
|
|
11
13
|
|
|
12
14
|
```jsonc
|
|
@@ -83,9 +85,9 @@ The registry also holds the optional `commitGate` config (installed via
|
|
|
83
85
|
"worktrees" | "all" } }` controls whether unverified change batches may be
|
|
84
86
|
committed.
|
|
85
87
|
|
|
86
|
-
## Shipped
|
|
88
|
+
## Shipped plugins
|
|
87
89
|
|
|
88
|
-
`har env add-
|
|
89
|
-
playwright` (web) or `har env add-
|
|
90
|
-
|
|
91
|
-
and registers stages through the exact same registry as
|
|
90
|
+
`har env add-plugin --list` shows available plugins; `har env add-plugin
|
|
91
|
+
playwright` (web) or `har env add-plugin rocketsim` (iOS) installs one. A
|
|
92
|
+
plugin is just packaging: it copies files, merges `package.json` fragments,
|
|
93
|
+
and registers stages through the exact same registry as `add-stage --custom`.
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
{
|
|
33
33
|
"id": "verify",
|
|
34
34
|
"kind": "verify",
|
|
35
|
-
"description": "Verification pipeline (quick
|
|
35
|
+
"description": "Verification pipeline (quick smoke by default; --full runs the registry's verificationStages)",
|
|
36
36
|
"command": "./.har/verify.sh {agentId}",
|
|
37
37
|
"acceptsArgs": ["--full"],
|
|
38
38
|
"artifacts": [
|
|
@@ -154,7 +154,7 @@ if [ -n "$FULL" ]; then
|
|
|
154
154
|
|
|
155
155
|
# Registered verification stages from .har/stages.json (see .har/STAGES.md).
|
|
156
156
|
# Every stage listed in verificationStages with a registered script/command
|
|
157
|
-
# runs here --
|
|
157
|
+
# runs here -- plugins and custom stages alike.
|
|
158
158
|
while IFS=$'\t' read -r STAGE_ID STAGE_CMD; do
|
|
159
159
|
[ -n "$STAGE_ID" ] || continue
|
|
160
160
|
run_step "$STAGE_ID" "$STAGE_CMD" || true
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Playwright HAR
|
|
1
|
+
# Playwright HAR plugin
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This plugin was added by `har env add-plugin playwright`. It registers a `browser-e2e` stage and scaffolds a minimal Playwright test suite.
|
|
4
4
|
|
|
5
5
|
## Next steps
|
|
6
6
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# RocketSim
|
|
1
|
+
# RocketSim plugin
|
|
2
2
|
|
|
3
3
|
Add reusable RocketSim user-flow validation to your iOS harness.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
har env add-
|
|
6
|
+
har env add-plugin rocketsim
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
## What this installs
|
|
@@ -42,7 +42,7 @@ Full verify (`verify --full`) runs all flows after lint.
|
|
|
42
42
|
|
|
43
43
|
```bash
|
|
44
44
|
# 1. Install the stage
|
|
45
|
-
har env add-
|
|
45
|
+
har env add-plugin rocketsim
|
|
46
46
|
|
|
47
47
|
# 2. Check RocketSim health
|
|
48
48
|
rocketsim doctor
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osfactory/har",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "LLM-powered CLI for reproducible agent development environments",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"har",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
19
|
+
"scripts/ensure-telemetry-default.cjs",
|
|
19
20
|
"control/docker-compose.yml",
|
|
20
21
|
"control/docker-compose.build.yml"
|
|
21
22
|
],
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
"test:watch": "jest --watch",
|
|
27
28
|
"typecheck": "tsc --noEmit",
|
|
28
29
|
"lint": "eslint src --ext .ts",
|
|
30
|
+
"postinstall": "node scripts/ensure-telemetry-default.cjs",
|
|
29
31
|
"prepublishOnly": "npm run build",
|
|
30
32
|
"release": "semantic-release"
|
|
31
33
|
},
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* npm postinstall: persist full default telemetry preference when missing.
|
|
4
|
+
* Does not overwrite an existing ~/.har/telemetry.json (respects prior off / prompts=false).
|
|
5
|
+
* Hooks + Mission Control are activated on first `har` / `har env launch` / `har telemetry on`.
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const os = require('os');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
|
|
13
|
+
function main() {
|
|
14
|
+
if (process.env.HAR_SKIP_TELEMETRY_POSTINSTALL === '1') return;
|
|
15
|
+
|
|
16
|
+
const preferencePath =
|
|
17
|
+
process.env.HAR_TELEMETRY_CONFIG_PATH || path.join(os.homedir(), '.har', 'telemetry.json');
|
|
18
|
+
|
|
19
|
+
if (fs.existsSync(preferencePath)) return;
|
|
20
|
+
|
|
21
|
+
const preference = {
|
|
22
|
+
enabled: true,
|
|
23
|
+
signals: {
|
|
24
|
+
metrics: true,
|
|
25
|
+
logs: true,
|
|
26
|
+
prompts: true,
|
|
27
|
+
traces: true,
|
|
28
|
+
},
|
|
29
|
+
updatedAt: new Date().toISOString(),
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
fs.mkdirSync(path.dirname(preferencePath), { recursive: true });
|
|
33
|
+
fs.writeFileSync(preferencePath, `${JSON.stringify(preference, null, 2)}\n`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
main();
|
|
38
|
+
} catch {
|
|
39
|
+
// Never fail npm install over telemetry preference write.
|
|
40
|
+
}
|
|
File without changes
|
/package/dist/templates/{stage-templates → plugins}/playwright/.github/workflows/playwright.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/templates/{stage-templates → plugins}/rocketsim/.har/stages/rocketsim-flows.sh
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|