oh-my-customcodex 0.1.1 → 0.1.5
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/cli/index.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -7,8 +7,8 @@ set -euo pipefail
|
|
|
7
7
|
# Pass through stdin (Stop hook protocol)
|
|
8
8
|
input=$(cat)
|
|
9
9
|
|
|
10
|
-
OUTCOMES_FILE="
|
|
11
|
-
PROPOSALS_FILE="
|
|
10
|
+
OUTCOMES_FILE="${CODEX_TASK_OUTCOMES_FILE:-/tmp/.codex-task-outcomes-${PPID}}"
|
|
11
|
+
PROPOSALS_FILE="${CODEX_SKILL_PROPOSALS_FILE:-/tmp/.codex-skill-proposals-${PPID}}"
|
|
12
12
|
|
|
13
13
|
# Early exit if no outcomes
|
|
14
14
|
if [ ! -f "$OUTCOMES_FILE" ] || [ ! -s "$OUTCOMES_FILE" ]; then
|
|
@@ -16,24 +16,55 @@ if [ ! -f "$OUTCOMES_FILE" ] || [ ! -s "$OUTCOMES_FILE" ]; then
|
|
|
16
16
|
exit 0
|
|
17
17
|
fi
|
|
18
18
|
|
|
19
|
-
# Count qualifying patterns (3+ successes with 80%+ rate)
|
|
20
|
-
#
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
# Count qualifying patterns (3+ successes with 80%+ rate).
|
|
20
|
+
# Parse the JSONL conservatively with awk to avoid external jq dependency
|
|
21
|
+
# and reduce batch-test flakiness around optional PATH/tool availability.
|
|
22
|
+
CANDIDATES=$(
|
|
23
|
+
awk '
|
|
24
|
+
{
|
|
25
|
+
agent = ""
|
|
26
|
+
skill = "none"
|
|
27
|
+
outcome = ""
|
|
28
|
+
|
|
29
|
+
if (match($0, /"agent_type"[[:space:]]*:[[:space:]]*"[^"]+"/)) {
|
|
30
|
+
agent = substr($0, RSTART, RLENGTH)
|
|
31
|
+
sub(/^.*"agent_type"[[:space:]]*:[[:space:]]*"/, "", agent)
|
|
32
|
+
sub(/"$/, "", agent)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (match($0, /"skill"[[:space:]]*:[[:space:]]*"[^"]+"/)) {
|
|
36
|
+
skill = substr($0, RSTART, RLENGTH)
|
|
37
|
+
sub(/^.*"skill"[[:space:]]*:[[:space:]]*"/, "", skill)
|
|
38
|
+
sub(/"$/, "", skill)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (match($0, /"outcome"[[:space:]]*:[[:space:]]*"[^"]+"/)) {
|
|
42
|
+
outcome = substr($0, RSTART, RLENGTH)
|
|
43
|
+
sub(/^.*"outcome"[[:space:]]*:[[:space:]]*"/, "", outcome)
|
|
44
|
+
sub(/"$/, "", outcome)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (agent != "" && outcome != "") {
|
|
48
|
+
key = agent "|" skill
|
|
49
|
+
total[key]++
|
|
50
|
+
if (outcome == "success") {
|
|
51
|
+
successes[key]++
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
END {
|
|
57
|
+
candidates = 0
|
|
58
|
+
for (key in total) {
|
|
59
|
+
success_count = successes[key] + 0
|
|
60
|
+
if (success_count >= 3 && (success_count / total[key]) >= 0.8) {
|
|
61
|
+
candidates++
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
print candidates + 0
|
|
65
|
+
}
|
|
66
|
+
' "$OUTCOMES_FILE" 2>/dev/null || echo "0"
|
|
67
|
+
)
|
|
37
68
|
|
|
38
69
|
if [ "$CANDIDATES" -gt 0 ] 2>/dev/null; then
|
|
39
70
|
echo "[skill-extractor] ${CANDIDATES} skill candidate(s) detected from session outcomes" >&2
|
package/templates/manifest.json
CHANGED