@osfactory/har 0.10.0 → 0.11.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.
@@ -5,7 +5,8 @@
5
5
  # Usage: ./.har/verify.sh <agent-id> [--full]
6
6
  #
7
7
  # Quick (default): build smoke (compile-only)
8
- # Full (--full): + unit tests, lint (SwiftLint), rocketsim-flows (if installed)
8
+ # Full (--full): + unit tests, lint (SwiftLint), and every registered stage
9
+ # in stages.json verificationStages (see .har/STAGES.md)
9
10
  # Step lists are examples — not exhaustive. Adapt commands to this repo's stack.
10
11
  set -euo pipefail
11
12
 
@@ -150,8 +151,13 @@ if [ -n "$FULL" ]; then
150
151
 
151
152
  run_step "readiness" "run_readiness_if_configured \"$AGENT_ID\"" || true
152
153
 
153
- # RocketSim user-flow validation installed via: har env add-stage rocketsim
154
- run_rocketsim_flows_if_present "$SCRIPT_DIR" "$AGENT_ID" || true
154
+ # Registered verification stages from .har/stages.json (see .har/STAGES.md).
155
+ # Every stage listed in verificationStages with a registered script/command
156
+ # runs here -- stage templates and custom stages alike.
157
+ while IFS=$'\t' read -r STAGE_ID STAGE_CMD; do
158
+ [ -n "$STAGE_ID" ] || continue
159
+ run_step "$STAGE_ID" "$STAGE_CMD" || true
160
+ done < <(list_registered_verification_stage_commands "$SCRIPT_DIR" "$AGENT_ID")
155
161
  fi
156
162
 
157
163
  END_TOTAL=$(now_ms)
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env bash
2
+ # __STAGE_DESCRIPTION__
3
+ # Custom HAR stage: __STAGE_ID__ (kind: __STAGE_KIND__)
4
+ #
5
+ # Stage script contract (full reference: .har/STAGES.md):
6
+ # - stdout: a single JSON result object (status, stageId, agent_id, ...)
7
+ # - stderr: human-readable progress
8
+ # - $1: agent slot id; extra args may follow
9
+ # - artifacts: write reports/screenshots/logs under .har/artifacts/__STAGE_ID__/
10
+ # - exit code: the real status (0 = pass)
11
+ #
12
+ # Usage: ./.har/stages/__STAGE_ID__.sh <agent-id> [extra args...]
13
+ set -euo pipefail
14
+
15
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
16
+ HARNESS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
17
+ REPO_ROOT="$(cd "$HARNESS_DIR/.." && pwd)"
18
+
19
+ # shellcheck source=/dev/null
20
+ source "$HARNESS_DIR/harness.env"
21
+ # shellcheck source=/dev/null
22
+ source "$HARNESS_DIR/agent-slot.sh"
23
+
24
+ AGENT_ID="${1:?Usage: __STAGE_ID__.sh <agent-id> [extra args...]}"
25
+ validate_agent_id "$AGENT_ID"
26
+
27
+ ENV_FILE="$(resolve_agent_env_file "$AGENT_ID" "$REPO_ROOT")" || {
28
+ echo "No .env.agent.${AGENT_ID} found. Run: ./.har/launch.sh ${AGENT_ID}" >&2
29
+ exit 1
30
+ }
31
+ set -a
32
+ # shellcheck source=/dev/null
33
+ source "$ENV_FILE"
34
+ set +a
35
+
36
+ WORK_DIR="$(resolve_agent_work_dir "$ENV_FILE")"
37
+ ARTIFACTS_DIR="$HARNESS_DIR/artifacts/__STAGE_ID__"
38
+ mkdir -p "$ARTIFACTS_DIR"
39
+
40
+ echo "==> [__STAGE_ID__ agent-${AGENT_ID}] running in ${WORK_DIR}" >&2
41
+ START=$(now_ms)
42
+
43
+ # ── TODO: implement the stage ────────────────────────────────────────────────
44
+ # Run your checks from $WORK_DIR (the agent's isolated checkout); the slot's
45
+ # ports and env are loaded from $ENV_FILE. Save artifacts to $ARTIFACTS_DIR.
46
+ set +e
47
+ OUTPUT=$(cd "$WORK_DIR" && echo "TODO: implement .har/stages/__STAGE_ID__.sh" && false)
48
+ EXIT_CODE=$?
49
+ set -e
50
+
51
+ END=$(now_ms)
52
+ STATUS="fail"
53
+ [ "$EXIT_CODE" = "0" ] && STATUS="pass"
54
+ OUTPUT_JSON=$(escape_step_output "$OUTPUT")
55
+
56
+ node -e "process.stdout.write(JSON.stringify({
57
+ status: '$STATUS',
58
+ stageId: '__STAGE_ID__',
59
+ kind: '__STAGE_KIND__',
60
+ agent_id: $AGENT_ID,
61
+ total_ms: $(( END - START )),
62
+ output: $OUTPUT_JSON
63
+ }, null, 2) + '\n');"
64
+
65
+ exit "$EXIT_CODE"
@@ -40,5 +40,13 @@
40
40
  ],
41
41
  "merge": {
42
42
  "package.json": "package.fragment.json"
43
- }
43
+ },
44
+ "nextSteps": [
45
+ "npm install",
46
+ "npx playwright install",
47
+ "./.har/launch.sh 1",
48
+ "./.har/stages/browser-e2e.sh 1",
49
+ "npx playwright show-report .har/artifacts/browser-e2e/playwright-report"
50
+ ],
51
+ "docsPath": ".har/stages/PLAYWRIGHT.md"
44
52
  }
@@ -34,5 +34,6 @@
34
34
  "./.har/stages/rocketsim-flows.sh 1",
35
35
  "Open .har/artifacts/rocketsim-flows/ for screenshots and per-flow results",
36
36
  "Add new flows in flows/ — read .har/stages/ROCKETSIM.md for the authoring guide"
37
- ]
37
+ ],
38
+ "docsPath": ".har/stages/ROCKETSIM.md"
38
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osfactory/har",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "LLM-powered CLI for reproducible agent development environments",
5
5
  "keywords": [
6
6
  "har",