@a5c-ai/babysitter-codex 0.1.6-staging.ee25a34f → 0.1.6-staging.f48a64a2
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.
|
@@ -4,12 +4,34 @@ set -euo pipefail
|
|
|
4
4
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
5
|
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
6
6
|
STATE_DIR="${BABYSITTER_STATE_DIR:-${PWD}/.a5c}"
|
|
7
|
+
LOG_DIR="${BABYSITTER_LOG_DIR:-$PLUGIN_ROOT/.a5c/logs}"
|
|
8
|
+
LOG_FILE="$LOG_DIR/babysitter-session-start-hook.log"
|
|
7
9
|
|
|
8
10
|
export CODEX_PLUGIN_ROOT="${CODEX_PLUGIN_ROOT:-${PLUGIN_ROOT}}"
|
|
9
11
|
export BABYSITTER_STATE_DIR="${STATE_DIR}"
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
mkdir -p "$LOG_DIR" 2>/dev/null
|
|
14
|
+
{
|
|
15
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) Hook script invoked"
|
|
16
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) PLUGIN_ROOT=$PLUGIN_ROOT"
|
|
17
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) STATE_DIR=$STATE_DIR"
|
|
18
|
+
} >> "$LOG_FILE" 2>/dev/null
|
|
19
|
+
|
|
20
|
+
INPUT_FILE=$(mktemp 2>/dev/null || echo "/tmp/codex-session-start-hook-$$.json")
|
|
21
|
+
cat > "$INPUT_FILE"
|
|
22
|
+
|
|
23
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) Hook input received ($(wc -c < "$INPUT_FILE") bytes)" >> "$LOG_FILE" 2>/dev/null
|
|
24
|
+
|
|
25
|
+
RESULT=$(babysitter hook:run \
|
|
12
26
|
--hook-type session-start \
|
|
13
27
|
--harness codex \
|
|
14
28
|
--plugin-root "${CODEX_PLUGIN_ROOT}" \
|
|
15
|
-
--state-dir "${BABYSITTER_STATE_DIR}"
|
|
29
|
+
--state-dir "${BABYSITTER_STATE_DIR}" \
|
|
30
|
+
< "$INPUT_FILE" 2>"$LOG_DIR/babysitter-session-start-hook-stderr.log")
|
|
31
|
+
EXIT_CODE=$?
|
|
32
|
+
|
|
33
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) CLI exit code=$EXIT_CODE" >> "$LOG_FILE" 2>/dev/null
|
|
34
|
+
|
|
35
|
+
rm -f "$INPUT_FILE" 2>/dev/null
|
|
36
|
+
printf '%s\n' "$RESULT"
|
|
37
|
+
exit $EXIT_CODE
|
|
@@ -4,12 +4,34 @@ set -euo pipefail
|
|
|
4
4
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
5
|
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
6
6
|
STATE_DIR="${BABYSITTER_STATE_DIR:-${PWD}/.a5c}"
|
|
7
|
+
LOG_DIR="${BABYSITTER_LOG_DIR:-$PLUGIN_ROOT/.a5c/logs}"
|
|
8
|
+
LOG_FILE="$LOG_DIR/babysitter-stop-hook.log"
|
|
7
9
|
|
|
8
10
|
export CODEX_PLUGIN_ROOT="${CODEX_PLUGIN_ROOT:-${PLUGIN_ROOT}}"
|
|
9
11
|
export BABYSITTER_STATE_DIR="${STATE_DIR}"
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
mkdir -p "$LOG_DIR" 2>/dev/null
|
|
14
|
+
{
|
|
15
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) Hook script invoked"
|
|
16
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) PLUGIN_ROOT=$PLUGIN_ROOT"
|
|
17
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) STATE_DIR=$STATE_DIR"
|
|
18
|
+
} >> "$LOG_FILE" 2>/dev/null
|
|
19
|
+
|
|
20
|
+
INPUT_FILE=$(mktemp 2>/dev/null || echo "/tmp/codex-stop-hook-$$.json")
|
|
21
|
+
cat > "$INPUT_FILE"
|
|
22
|
+
|
|
23
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) Hook input received ($(wc -c < "$INPUT_FILE") bytes)" >> "$LOG_FILE" 2>/dev/null
|
|
24
|
+
|
|
25
|
+
RESULT=$(babysitter hook:run \
|
|
12
26
|
--hook-type stop \
|
|
13
27
|
--harness codex \
|
|
14
28
|
--plugin-root "${CODEX_PLUGIN_ROOT}" \
|
|
15
|
-
--state-dir "${BABYSITTER_STATE_DIR}"
|
|
29
|
+
--state-dir "${BABYSITTER_STATE_DIR}" \
|
|
30
|
+
< "$INPUT_FILE" 2>"$LOG_DIR/babysitter-stop-hook-stderr.log")
|
|
31
|
+
EXIT_CODE=$?
|
|
32
|
+
|
|
33
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) CLI exit code=$EXIT_CODE" >> "$LOG_FILE" 2>/dev/null
|
|
34
|
+
|
|
35
|
+
rm -f "$INPUT_FILE" 2>/dev/null
|
|
36
|
+
printf '%s\n' "$RESULT"
|
|
37
|
+
exit $EXIT_CODE
|
|
@@ -4,12 +4,36 @@ set -euo pipefail
|
|
|
4
4
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
5
5
|
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
6
6
|
STATE_DIR="${BABYSITTER_STATE_DIR:-${PWD}/.a5c}"
|
|
7
|
+
LOG_DIR="${BABYSITTER_LOG_DIR:-$PLUGIN_ROOT/.a5c/logs}"
|
|
8
|
+
LOG_FILE="$LOG_DIR/babysitter-user-prompt-submit-hook.log"
|
|
7
9
|
|
|
8
10
|
export CODEX_PLUGIN_ROOT="${CODEX_PLUGIN_ROOT:-${PLUGIN_ROOT}}"
|
|
9
11
|
export BABYSITTER_STATE_DIR="${STATE_DIR}"
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
mkdir -p "$LOG_DIR" 2>/dev/null
|
|
14
|
+
{
|
|
15
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) Hook script invoked"
|
|
16
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) PLUGIN_ROOT=$PLUGIN_ROOT"
|
|
17
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) STATE_DIR=$STATE_DIR"
|
|
18
|
+
} >> "$LOG_FILE" 2>/dev/null
|
|
19
|
+
|
|
20
|
+
INPUT_FILE=$(mktemp 2>/dev/null || echo "/tmp/codex-user-prompt-submit-hook-$$.json")
|
|
21
|
+
cat > "$INPUT_FILE"
|
|
22
|
+
|
|
23
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) Hook input received ($(wc -c < "$INPUT_FILE") bytes)" >> "$LOG_FILE" 2>/dev/null
|
|
24
|
+
|
|
25
|
+
RESULT=$(babysitter hook:run \
|
|
12
26
|
--hook-type user-prompt-submit \
|
|
13
27
|
--harness codex \
|
|
14
28
|
--plugin-root "${CODEX_PLUGIN_ROOT}" \
|
|
15
|
-
--state-dir "${BABYSITTER_STATE_DIR}"
|
|
29
|
+
--state-dir "${BABYSITTER_STATE_DIR}" \
|
|
30
|
+
< "$INPUT_FILE" 2>"$LOG_DIR/babysitter-user-prompt-submit-hook-stderr.log")
|
|
31
|
+
EXIT_CODE=$?
|
|
32
|
+
|
|
33
|
+
echo "[INFO] $(date -u +%Y-%m-%dT%H:%M:%SZ) CLI exit code=$EXIT_CODE" >> "$LOG_FILE" 2>/dev/null
|
|
34
|
+
|
|
35
|
+
rm -f "$INPUT_FILE" 2>/dev/null
|
|
36
|
+
if [ -n "$RESULT" ]; then
|
|
37
|
+
printf '%s\n' "$RESULT"
|
|
38
|
+
fi
|
|
39
|
+
exit $EXIT_CODE
|
|
@@ -198,6 +198,7 @@ $CLI run:create \
|
|
|
198
198
|
--inputs <file> \
|
|
199
199
|
--prompt "$PROMPT" \
|
|
200
200
|
--harness codex \
|
|
201
|
+
--state-dir .a5c \
|
|
201
202
|
--plugin-root "${CODEX_PLUGIN_ROOT}" \
|
|
202
203
|
--json
|
|
203
204
|
```
|
|
@@ -208,6 +209,7 @@ Required flags:
|
|
|
208
209
|
- `--entry <absolute-path>#<export>` - process JS file plus named export
|
|
209
210
|
- `--prompt "$PROMPT"` - the user's initial request
|
|
210
211
|
- `--harness codex` - activates Codex session binding
|
|
212
|
+
- `--state-dir .a5c` - required for honest workspace-local Codex session state
|
|
211
213
|
- `--plugin-root "${CODEX_PLUGIN_ROOT}"` - plugin root used for session/state
|
|
212
214
|
resolution
|
|
213
215
|
|
|
@@ -223,6 +225,10 @@ explicitly. The Codex adapter auto-resolves the session/thread id from
|
|
|
223
225
|
`--session-id` in out-of-band recovery flows where no ambient Codex session
|
|
224
226
|
identity exists.
|
|
225
227
|
|
|
228
|
+
In normal Codex usage, `run:create` must bind the session into the active
|
|
229
|
+
workspace `.a5c`, not the global `~/.a5c`, so the Stop hook can find the same
|
|
230
|
+
session state file in later turns.
|
|
231
|
+
|
|
226
232
|
For resuming existing runs in a manual recovery flow:
|
|
227
233
|
|
|
228
234
|
```bash
|
|
@@ -296,8 +302,9 @@ Workflow:
|
|
|
296
302
|
|
|
297
303
|
### 7. Stop after every phase after run-session association
|
|
298
304
|
|
|
299
|
-
After `run:create` or any posted effect result,
|
|
300
|
-
Codex hook loop. Do not run multiple `run:iterate` steps
|
|
305
|
+
After `run:create` or any posted effect result, end the current assistant turn
|
|
306
|
+
and yield back to the Codex hook loop. Do not run multiple `run:iterate` steps
|
|
307
|
+
in the same turn.
|
|
301
308
|
|
|
302
309
|
### 8. Completion proof
|
|
303
310
|
|
package/SKILL.md
CHANGED
|
@@ -198,6 +198,7 @@ $CLI run:create \
|
|
|
198
198
|
--inputs <file> \
|
|
199
199
|
--prompt "$PROMPT" \
|
|
200
200
|
--harness codex \
|
|
201
|
+
--state-dir .a5c \
|
|
201
202
|
--plugin-root "${CODEX_PLUGIN_ROOT}" \
|
|
202
203
|
--json
|
|
203
204
|
```
|
|
@@ -208,6 +209,7 @@ Required flags:
|
|
|
208
209
|
- `--entry <absolute-path>#<export>` - process JS file plus named export
|
|
209
210
|
- `--prompt "$PROMPT"` - the user's initial request
|
|
210
211
|
- `--harness codex` - activates Codex session binding
|
|
212
|
+
- `--state-dir .a5c` - required for honest workspace-local Codex session state
|
|
211
213
|
- `--plugin-root "${CODEX_PLUGIN_ROOT}"` - plugin root used for session/state
|
|
212
214
|
resolution
|
|
213
215
|
|
|
@@ -223,6 +225,10 @@ explicitly. The Codex adapter auto-resolves the session/thread id from
|
|
|
223
225
|
`--session-id` in out-of-band recovery flows where no ambient Codex session
|
|
224
226
|
identity exists.
|
|
225
227
|
|
|
228
|
+
In normal Codex usage, `run:create` must bind the session into the active
|
|
229
|
+
workspace `.a5c`, not the global `~/.a5c`, so the Stop hook can find the same
|
|
230
|
+
session state file in later turns.
|
|
231
|
+
|
|
226
232
|
For resuming existing runs in a manual recovery flow:
|
|
227
233
|
|
|
228
234
|
```bash
|
|
@@ -296,8 +302,9 @@ Workflow:
|
|
|
296
302
|
|
|
297
303
|
### 7. Stop after every phase after run-session association
|
|
298
304
|
|
|
299
|
-
After `run:create` or any posted effect result,
|
|
300
|
-
Codex hook loop. Do not run multiple `run:iterate` steps
|
|
305
|
+
After `run:create` or any posted effect result, end the current assistant turn
|
|
306
|
+
and yield back to the Codex hook loop. Do not run multiple `run:iterate` steps
|
|
307
|
+
in the same turn.
|
|
301
308
|
|
|
302
309
|
### 8. Completion proof
|
|
303
310
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a5c-ai/babysitter-codex",
|
|
3
|
-
"version": "0.1.6-staging.
|
|
3
|
+
"version": "0.1.6-staging.f48a64a2",
|
|
4
4
|
"description": "Babysitter Codex skill bundle and integration package for OpenAI Codex CLI with SDK-managed process-library bootstrapping, 15 orchestration modes, and BOM-safe SKILL installation",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "node test/integration.test.js && node test/packaged-install.test.js",
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
},
|
|
40
40
|
"homepage": "https://github.com/a5c-ai/babysitter/tree/main/plugins/babysitter-codex#readme",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@a5c-ai/babysitter-sdk": "0.0.183-staging.
|
|
42
|
+
"@a5c-ai/babysitter-sdk": "0.0.183-staging.f48a64a2"
|
|
43
43
|
}
|
|
44
44
|
}
|