@osfactory/har 0.1.1 → 0.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/dist/index.js +621 -4662
- package/dist/templates/har-boilerplate/agent-slot.sh +10 -0
- package/dist/templates/har-boilerplate/verify.sh +8 -12
- package/dist/templates/har-boilerplate-cli/agent-slot.sh +10 -0
- package/dist/templates/har-boilerplate-cli/verify.sh +5 -7
- package/dist/templates/har-boilerplate-ios/agent-slot.sh +10 -0
- package/dist/templates/har-boilerplate-ios/verify.sh +5 -7
- package/package.json +7 -7
|
@@ -259,6 +259,16 @@ resolve_agent_work_dir() {
|
|
|
259
259
|
echo "$work_dir"
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
+
# Portable millisecond clock (GNU date %N is unavailable on macOS/BSD).
|
|
263
|
+
now_ms() {
|
|
264
|
+
node -e 'process.stdout.write(String(Date.now()))' 2>/dev/null || echo 0
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
# JSON-escape step output; truncate to 50 lines in node (avoids SIGPIPE under pipefail).
|
|
268
|
+
escape_step_output() {
|
|
269
|
+
printf '%s' "$1" | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const s=d.trim().split('\n').slice(0,50).join('\n');process.stdout.write(JSON.stringify(s))})" 2>/dev/null || echo '""'
|
|
270
|
+
}
|
|
271
|
+
|
|
262
272
|
# Run browser-e2e on verify --full when the Playwright stage template is installed.
|
|
263
273
|
run_browser_e2e_if_present() {
|
|
264
274
|
local script_dir="$1"
|
|
@@ -40,7 +40,7 @@ API_PORT="${API_PORT:-$(( HARNESS_API_BASE_PORT + AGENT_ID * 10 ))}"
|
|
|
40
40
|
echo "==> Verifying agent ${AGENT_ID} (work dir: ${WORK_DIR})..." >&2
|
|
41
41
|
|
|
42
42
|
OVERALL_PASS=true
|
|
43
|
-
START_TOTAL=$(
|
|
43
|
+
START_TOTAL=$(now_ms)
|
|
44
44
|
RESULTS_JSON="[]"
|
|
45
45
|
|
|
46
46
|
run_step() {
|
|
@@ -49,14 +49,14 @@ run_step() {
|
|
|
49
49
|
local start end elapsed exit_code output
|
|
50
50
|
|
|
51
51
|
printf " → %-40s" "$name..." >&2
|
|
52
|
-
start=$(
|
|
52
|
+
start=$(now_ms)
|
|
53
53
|
|
|
54
54
|
set +e
|
|
55
55
|
output=$(cd "$WORK_DIR" && set -a && . "$ENV_FILE" && set +a && eval "$cmd" 2>&1)
|
|
56
56
|
exit_code=$?
|
|
57
57
|
set -e
|
|
58
58
|
|
|
59
|
-
end=$(
|
|
59
|
+
end=$(now_ms)
|
|
60
60
|
elapsed=$(( end - start ))
|
|
61
61
|
|
|
62
62
|
local pass_bool step_output_escaped
|
|
@@ -70,9 +70,7 @@ run_step() {
|
|
|
70
70
|
OVERALL_PASS=false
|
|
71
71
|
fi
|
|
72
72
|
|
|
73
|
-
step_output_escaped=$(
|
|
74
|
-
node -e "let d=''; process.stdin.on('data',c=>d+=c); process.stdin.on('end',()=>process.stdout.write(JSON.stringify(d.trim())))" \
|
|
75
|
-
2>/dev/null || echo '""')
|
|
73
|
+
step_output_escaped=$(escape_step_output "$output")
|
|
76
74
|
|
|
77
75
|
RESULTS_JSON=$(echo "$RESULTS_JSON" | node -e "
|
|
78
76
|
const fs = require('fs');
|
|
@@ -92,14 +90,14 @@ run_http_step() {
|
|
|
92
90
|
local start end elapsed exit_code output
|
|
93
91
|
|
|
94
92
|
printf " → %-40s" "$name..." >&2
|
|
95
|
-
start=$(
|
|
93
|
+
start=$(now_ms)
|
|
96
94
|
|
|
97
95
|
set +e
|
|
98
96
|
output=$(curl -sf "$url" 2>&1)
|
|
99
97
|
exit_code=$?
|
|
100
98
|
set -e
|
|
101
99
|
|
|
102
|
-
end=$(
|
|
100
|
+
end=$(now_ms)
|
|
103
101
|
elapsed=$(( end - start ))
|
|
104
102
|
|
|
105
103
|
local pass_bool step_output_escaped
|
|
@@ -112,9 +110,7 @@ run_http_step() {
|
|
|
112
110
|
OVERALL_PASS=false
|
|
113
111
|
fi
|
|
114
112
|
|
|
115
|
-
step_output_escaped=$(
|
|
116
|
-
node -e "let d=''; process.stdin.on('data',c=>d+=c); process.stdin.on('end',()=>process.stdout.write(JSON.stringify(d.trim())))" \
|
|
117
|
-
2>/dev/null || echo '""')
|
|
113
|
+
step_output_escaped=$(escape_step_output "$output")
|
|
118
114
|
|
|
119
115
|
RESULTS_JSON=$(echo "$RESULTS_JSON" | node -e "
|
|
120
116
|
const fs = require('fs');
|
|
@@ -143,7 +139,7 @@ fi
|
|
|
143
139
|
|
|
144
140
|
# ── Output results ────────────────────────────────────────────────────────────
|
|
145
141
|
|
|
146
|
-
END_TOTAL=$(
|
|
142
|
+
END_TOTAL=$(now_ms)
|
|
147
143
|
TOTAL_MS=$(( END_TOTAL - START_TOTAL ))
|
|
148
144
|
|
|
149
145
|
node -e "
|
|
@@ -259,6 +259,16 @@ resolve_agent_work_dir() {
|
|
|
259
259
|
echo "$work_dir"
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
+
# Portable millisecond clock (GNU date %N is unavailable on macOS/BSD).
|
|
263
|
+
now_ms() {
|
|
264
|
+
node -e 'process.stdout.write(String(Date.now()))' 2>/dev/null || echo 0
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
# JSON-escape step output; truncate to 50 lines in node (avoids SIGPIPE under pipefail).
|
|
268
|
+
escape_step_output() {
|
|
269
|
+
printf '%s' "$1" | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const s=d.trim().split('\n').slice(0,50).join('\n');process.stdout.write(JSON.stringify(s))})" 2>/dev/null || echo '""'
|
|
270
|
+
}
|
|
271
|
+
|
|
262
272
|
# Run browser-e2e on verify --full when the Playwright stage template is installed.
|
|
263
273
|
run_browser_e2e_if_present() {
|
|
264
274
|
local script_dir="$1"
|
|
@@ -37,7 +37,7 @@ WORK_DIR="$(resolve_agent_work_dir "$ENV_FILE")"
|
|
|
37
37
|
echo "==> Verifying agent ${AGENT_ID} in ${WORK_DIR}..." >&2
|
|
38
38
|
|
|
39
39
|
OVERALL_PASS=true
|
|
40
|
-
START_TOTAL=$(
|
|
40
|
+
START_TOTAL=$(now_ms)
|
|
41
41
|
RESULTS_JSON="[]"
|
|
42
42
|
|
|
43
43
|
run_step() {
|
|
@@ -46,14 +46,14 @@ run_step() {
|
|
|
46
46
|
local start end elapsed exit_code output
|
|
47
47
|
|
|
48
48
|
printf " → %-40s" "$name..." >&2
|
|
49
|
-
start=$(
|
|
49
|
+
start=$(now_ms)
|
|
50
50
|
|
|
51
51
|
set +e
|
|
52
52
|
output=$(cd "$WORK_DIR" && eval "$cmd" 2>&1)
|
|
53
53
|
exit_code=$?
|
|
54
54
|
set -e
|
|
55
55
|
|
|
56
|
-
end=$(
|
|
56
|
+
end=$(now_ms)
|
|
57
57
|
elapsed=$(( end - start ))
|
|
58
58
|
|
|
59
59
|
local pass_bool step_output_escaped
|
|
@@ -67,9 +67,7 @@ run_step() {
|
|
|
67
67
|
OVERALL_PASS=false
|
|
68
68
|
fi
|
|
69
69
|
|
|
70
|
-
step_output_escaped=$(
|
|
71
|
-
node -e "let d=''; process.stdin.on('data',c=>d+=c); process.stdin.on('end',()=>process.stdout.write(JSON.stringify(d.trim())))" \
|
|
72
|
-
2>/dev/null || echo '""')
|
|
70
|
+
step_output_escaped=$(escape_step_output "$output")
|
|
73
71
|
|
|
74
72
|
RESULTS_JSON=$(echo "$RESULTS_JSON" | node -e "
|
|
75
73
|
const fs = require('fs');
|
|
@@ -93,7 +91,7 @@ if [ -n "$FULL" ]; then
|
|
|
93
91
|
run_step "browser-e2e" "run_browser_e2e_if_present \"$SCRIPT_DIR\" \"$AGENT_ID\"" || true
|
|
94
92
|
fi
|
|
95
93
|
|
|
96
|
-
END_TOTAL=$(
|
|
94
|
+
END_TOTAL=$(now_ms)
|
|
97
95
|
TOTAL_MS=$(( END_TOTAL - START_TOTAL ))
|
|
98
96
|
|
|
99
97
|
node -e "
|
|
@@ -259,6 +259,16 @@ resolve_agent_work_dir() {
|
|
|
259
259
|
echo "$work_dir"
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
+
# Portable millisecond clock (GNU date %N is unavailable on macOS/BSD).
|
|
263
|
+
now_ms() {
|
|
264
|
+
node -e 'process.stdout.write(String(Date.now()))' 2>/dev/null || echo 0
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
# JSON-escape step output; truncate to 50 lines in node (avoids SIGPIPE under pipefail).
|
|
268
|
+
escape_step_output() {
|
|
269
|
+
printf '%s' "$1" | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{const s=d.trim().split('\n').slice(0,50).join('\n');process.stdout.write(JSON.stringify(s))})" 2>/dev/null || echo '""'
|
|
270
|
+
}
|
|
271
|
+
|
|
262
272
|
# Run browser-e2e on verify --full when the Playwright stage template is installed.
|
|
263
273
|
run_browser_e2e_if_present() {
|
|
264
274
|
local script_dir="$1"
|
|
@@ -62,7 +62,7 @@ XC_DESTINATION="${HARNESS_IOS_DESTINATION:-platform=iOS Simulator,name=iPhone 16
|
|
|
62
62
|
XC_DERIVED="${WORK_DIR}/build/DerivedData"
|
|
63
63
|
|
|
64
64
|
OVERALL_PASS=true
|
|
65
|
-
START_TOTAL=$(
|
|
65
|
+
START_TOTAL=$(now_ms)
|
|
66
66
|
RESULTS_JSON="[]"
|
|
67
67
|
|
|
68
68
|
run_step() {
|
|
@@ -71,14 +71,14 @@ run_step() {
|
|
|
71
71
|
local start end elapsed exit_code output
|
|
72
72
|
|
|
73
73
|
printf " → %-40s" "$name..." >&2
|
|
74
|
-
start=$(
|
|
74
|
+
start=$(now_ms)
|
|
75
75
|
|
|
76
76
|
set +e
|
|
77
77
|
output=$(cd "$WORK_DIR" && eval "$cmd" 2>&1)
|
|
78
78
|
exit_code=$?
|
|
79
79
|
set -e
|
|
80
80
|
|
|
81
|
-
end=$(
|
|
81
|
+
end=$(now_ms)
|
|
82
82
|
elapsed=$(( end - start ))
|
|
83
83
|
|
|
84
84
|
local pass_bool step_output_escaped
|
|
@@ -92,9 +92,7 @@ run_step() {
|
|
|
92
92
|
OVERALL_PASS=false
|
|
93
93
|
fi
|
|
94
94
|
|
|
95
|
-
step_output_escaped=$(
|
|
96
|
-
node -e "let d=''; process.stdin.on('data',c=>d+=c); process.stdin.on('end',()=>process.stdout.write(JSON.stringify(d.trim())))" \
|
|
97
|
-
2>/dev/null || echo '""')
|
|
95
|
+
step_output_escaped=$(escape_step_output "$output")
|
|
98
96
|
|
|
99
97
|
RESULTS_JSON=$(echo "$RESULTS_JSON" | node -e "
|
|
100
98
|
const fs = require('fs');
|
|
@@ -145,7 +143,7 @@ if [ -n "$FULL" ]; then
|
|
|
145
143
|
run_rocketsim_flows_if_present "$SCRIPT_DIR" "$AGENT_ID" || true
|
|
146
144
|
fi
|
|
147
145
|
|
|
148
|
-
END_TOTAL=$(
|
|
146
|
+
END_TOTAL=$(now_ms)
|
|
149
147
|
TOTAL_MS=$(( END_TOTAL - START_TOTAL ))
|
|
150
148
|
|
|
151
149
|
node -e "
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osfactory/har",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "LLM-powered CLI for reproducible agent development environments",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"har",
|
|
@@ -40,6 +40,11 @@
|
|
|
40
40
|
"zod": "^3.23.8"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
44
|
+
"@semantic-release/exec": "^6.0.3",
|
|
45
|
+
"@semantic-release/git": "^10.0.1",
|
|
46
|
+
"@semantic-release/github": "^11.0.1",
|
|
47
|
+
"@semantic-release/npm": "^13.1.5",
|
|
43
48
|
"@types/inquirer": "^9.0.7",
|
|
44
49
|
"@types/jest": "^29.5.12",
|
|
45
50
|
"@types/js-yaml": "^4.0.9",
|
|
@@ -49,11 +54,6 @@
|
|
|
49
54
|
"@typescript-eslint/parser": "^8.62.0",
|
|
50
55
|
"esbuild": "^0.23.0",
|
|
51
56
|
"eslint": "^8.57.1",
|
|
52
|
-
"@semantic-release/changelog": "^6.0.3",
|
|
53
|
-
"@semantic-release/exec": "^6.0.3",
|
|
54
|
-
"@semantic-release/git": "^10.0.1",
|
|
55
|
-
"@semantic-release/github": "^11.0.1",
|
|
56
|
-
"@semantic-release/npm": "^12.0.1",
|
|
57
57
|
"jest": "^29.7.0",
|
|
58
58
|
"semantic-release": "^24.2.3",
|
|
59
59
|
"ts-jest": "^29.2.4",
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"license": "AGPL-3.0-only",
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public",
|
|
76
|
-
"registry": "https://registry.npmjs.org"
|
|
76
|
+
"registry": "https://registry.npmjs.org/"
|
|
77
77
|
}
|
|
78
78
|
}
|