@junghanacs/entwurf 0.21.0 → 0.22.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/AGENTS.md +2 -2
- package/BASELINE.md +3 -1
- package/CHANGELOG.md +278 -0
- package/DELIVERY.md +156 -26
- package/README.md +64 -13
- package/VERIFY.md +67 -11
- package/docs/external-mcp-host.md +16 -6
- package/docs/setup-clean-host.md +63 -22
- package/mcp/entwurf-bridge/dist/mcp/entwurf-bridge/src/index.js +40 -16
- package/mcp/entwurf-bridge/dist/pi-extensions/lib/codex-caller-seat.js +174 -0
- package/mcp/entwurf-bridge/dist/pi-extensions/lib/codex-fresh-preflight.js +194 -1
- package/mcp/entwurf-bridge/dist/pi-extensions/lib/entwurf-v2-runner.js +3 -2
- package/mcp/entwurf-bridge/dist/pi-extensions/lib/entwurf-v2-send.js +8 -4
- package/mcp/entwurf-bridge/dist/pi-extensions/lib/mux-fresh-call.js +160 -25
- package/mcp/entwurf-bridge/dist/scripts/codex-socket-path.js +30 -0
- package/mcp/entwurf-bridge/src/index.ts +50 -16
- package/mcp/entwurf-bridge/tsconfig.build.json +9 -0
- package/package.json +2 -2
- package/pi-extensions/entwurf-control.ts +4 -4
- package/pi-extensions/lib/codex-caller-seat.ts +204 -0
- package/pi-extensions/lib/codex-fresh-preflight.ts +218 -1
- package/pi-extensions/lib/entwurf-v2-runner.ts +3 -2
- package/pi-extensions/lib/entwurf-v2-send.ts +16 -11
- package/pi-extensions/lib/mux-fresh-call.ts +196 -37
- package/run.sh +127 -3
- package/scripts/check-codex-app-server-launch.ts +445 -0
- package/scripts/check-entwurf-v2-production.ts +42 -1
- package/scripts/check-entwurf-v2-send.ts +26 -7
- package/scripts/check-gate-qualification.ts +4 -2
- package/scripts/check-mux-launch-tmux.ts +331 -35
- package/scripts/codex-app-server-launch.sh +275 -0
- package/scripts/codex-socket-path.ts +33 -0
- package/scripts/codex-terminal-title-config.py +500 -0
- package/scripts/codex_toml_io.py +121 -0
- package/scripts/lib/codex-fresh-live-protocol.ts +11 -3
- package/scripts/lib/codex-fresh-source-receipts.ts +29 -2
- package/scripts/mutants/codex-app-server-launch.json +157 -0
- package/scripts/mutants/codex-caller-seat.json +336 -0
- package/scripts/mutants/codex-native.json +3 -3
- package/scripts/mutants/mux-fresh-call.json +86 -14
- package/scripts/mutants/v2-surface.json +22 -0
- package/scripts/smoke-codex-config-state.sh +192 -3
- package/scripts/smoke-codex-fresh-live.ts +277 -37
- package/scripts/smoke-entwurf-chain-live.ts +50 -0
- package/scripts/smoke-setup-verdict.sh +13 -11
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# codex-app-server-launch.sh — the managed Codex app-server launch,
|
|
3
|
+
# `entwurf codex-app-server` (#95, the operator-UX half).
|
|
4
|
+
#
|
|
5
|
+
# WHY THIS EXISTS. Every Codex rail in this repo — native-push delivery, visible fresh,
|
|
6
|
+
# the loaded-thread probe — needs one thing the operator has to start themselves:
|
|
7
|
+
#
|
|
8
|
+
# codex app-server --listen "unix://$CODEX_HOME/app-server-control/app-server-control.sock"
|
|
9
|
+
#
|
|
10
|
+
# That string is correct and nobody types it. It appeared in three documents and in the
|
|
11
|
+
# text of a refusal, which means the first time most operators meet it is AFTER something
|
|
12
|
+
# has already failed. This leaf owns the SPELLING of that command and nothing else.
|
|
13
|
+
#
|
|
14
|
+
# WHAT IT IS NOT — and this is the whole boundary. It is not a supervisor, a daemon, a
|
|
15
|
+
# restarter, a health loop or a pid file. It does not fork. It `exec`s in the caller's own
|
|
16
|
+
# terminal, so the server's cwd, tty, pid and exit status are the vendor's, and Ctrl-C is
|
|
17
|
+
# the operator's. Entwurf still does not own the app-server's lifecycle (AGENTS Hard Rule
|
|
18
|
+
# 16, NEXT CARRIED step 2): a missing app-server still REJECTS at fresh-call preflight
|
|
19
|
+
# rather than being started behind anyone's back. What changed is only that the refusal can
|
|
20
|
+
# now name a command a person can actually type.
|
|
21
|
+
#
|
|
22
|
+
# THE SOCKET PATH IS SPELLED ONCE, SOMEWHERE ELSE. `resolveCodexDefaultSocketPath`
|
|
23
|
+
# (pi-extensions/lib/native-push/codex-ws-client.ts) is where the product computes this path,
|
|
24
|
+
# and it is the leaf every OTHER Codex surface reads. A bash leaf cannot import it, so this one
|
|
25
|
+
# ASKS — `run.sh codex-socket-path`, through `run_ts`. It was written the other way first, with
|
|
26
|
+
# a bash transcription and a gate comparing the two over an environment matrix; they agreed on
|
|
27
|
+
# every ASCII input and diverged on a BOM-only CODEX_HOME and on path normalization. See
|
|
28
|
+
# scripts/codex-socket-path.ts for that measurement. A transcription can only be tested on the
|
|
29
|
+
# inputs somebody thought of, which is why there is no longer one to test.
|
|
30
|
+
#
|
|
31
|
+
# THE TMUX LINE IS A FACT, NOT A REFUSAL. The MCP bridge is a CHILD of this server and
|
|
32
|
+
# inherits its `TMUX`, so the tmux server this process sits in is the one caller-seat
|
|
33
|
+
# lookups will read (docs/mux-launch-rail.md §Codex). Running outside tmux is a legitimate
|
|
34
|
+
# operator choice with a consequence, so it is reported as a consequence. Refusing it here
|
|
35
|
+
# would make this leaf an authority over the operator's terminal, which it is not.
|
|
36
|
+
set -euo pipefail
|
|
37
|
+
|
|
38
|
+
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
39
|
+
REPO_DIR="$(cd "$HERE/.." && pwd)"
|
|
40
|
+
|
|
41
|
+
# The vendor command this leaf manages. A CONSTANT, deliberately not overridable: an env
|
|
42
|
+
# seam here would be a production switch for "which binary is the Codex CLI", and anything
|
|
43
|
+
# that can redirect an exec is an authority, not a test convenience. The gate proves the
|
|
44
|
+
# real contract instead — it puts its fake vendor on a sandbox PATH under this exact name.
|
|
45
|
+
VENDOR_CMD="codex"
|
|
46
|
+
|
|
47
|
+
fail() { printf 'FAIL: %s\n' "$*" >&2; exit 1; }
|
|
48
|
+
note() { printf '[entwurf] %s\n' "$*" >&2; }
|
|
49
|
+
|
|
50
|
+
# --- recursion fence -------------------------------------------------------
|
|
51
|
+
# A `codex` earlier on PATH that itself calls `entwurf codex-app-server` would spin
|
|
52
|
+
# forever, and the symptom would be a hung terminal rather than an error. The sentinel is
|
|
53
|
+
# invocation-local, so seeing it already set means we are inside our own exec chain.
|
|
54
|
+
if [ -n "${ENTWURF_CODEX_APP_SERVER_ACTIVE:-}" ]; then
|
|
55
|
+
fail "recursive managed launch detected (ENTWURF_CODEX_APP_SERVER_ACTIVE is already set).
|
|
56
|
+
Something on PATH named '$VENDOR_CMD' resolves back to this launcher. Fix PATH so
|
|
57
|
+
'$VENDOR_CMD' is the OpenAI Codex CLI, or run the vendor binary by its full path."
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
# --- the socket path: ASKED, never re-derived -------------------------------
|
|
61
|
+
# This leaf does no path arithmetic at all, and that is the correction rather than the style.
|
|
62
|
+
# Its first version mirrored `resolveCodexHome` in bash — `${CODEX_HOME:-$HOME/.codex}` plus a
|
|
63
|
+
# POSIX `[:space:]` trim — with a gate comparing the two spellings over four ASCII-normal
|
|
64
|
+
# inputs they happened to agree on. `[측정 2026-09-16, independent review]` they disagree
|
|
65
|
+
# elsewhere: with `CODEX_HOME=$'\ufeff'` the TS leaf trims (JS trim strips U+FEFF) and falls
|
|
66
|
+
# back to `$HOME/.codex`, while the bash trim kept the byte and produced
|
|
67
|
+
# `<BOM>/app-server-control/app-server-control.sock`; `path.join` likewise normalizes a
|
|
68
|
+
# trailing slash or a `..` segment where the bash concatenation did not. Each of those starts a
|
|
69
|
+
# server at an address delivery and preflight never look at.
|
|
70
|
+
#
|
|
71
|
+
# So the second spelling is gone instead of widened — a transcription can only ever be tested
|
|
72
|
+
# on the inputs somebody thought of. `run.sh codex-socket-path` prints what
|
|
73
|
+
# `resolveCodexDefaultSocketPath` computes for THIS environment, through `run_ts` (compiled twin
|
|
74
|
+
# when installed, strip-types in a clone). An empty or failed answer is a hard refusal: there is
|
|
75
|
+
# no fallback spelling left to guess with, and that is the point.
|
|
76
|
+
if ! SOCK="$(bash "$REPO_DIR/run.sh" codex-socket-path)"; then
|
|
77
|
+
fail "could not resolve the Codex control-socket path.
|
|
78
|
+
'$REPO_DIR/run.sh codex-socket-path' failed; that leaf is the only spelling of this address,
|
|
79
|
+
and this launcher will not invent a second one. Its output above says why."
|
|
80
|
+
fi
|
|
81
|
+
[ -n "$SOCK" ] \
|
|
82
|
+
|| fail "the Codex control-socket resolver returned an empty path — neither CODEX_HOME nor
|
|
83
|
+
HOME names a usable Codex home. Set CODEX_HOME."
|
|
84
|
+
|
|
85
|
+
# Asking one authority for the address does not make the ANSWER safe to act on, and this is the
|
|
86
|
+
# one place that acts on it: `mkdir -p` creates a directory at it and the vendor binds it. The
|
|
87
|
+
# resolver faithfully returns whatever `CODEX_HOME` holds — it neither requires an absolute path
|
|
88
|
+
# nor rejects control characters, because the surfaces that merely READ it (preflight's lstat,
|
|
89
|
+
# the delivery probe) fail closed on their own. A RELATIVE address is a different file for every
|
|
90
|
+
# process that resolves it, and the bridge that will look for this socket is the app-server's MCP
|
|
91
|
+
# child with its own cwd — so the one thing a launch cannot do is bind a path whose meaning
|
|
92
|
+
# depends on where it was typed. Control characters are refused with it: a newline in an address
|
|
93
|
+
# is not a path this repo will create on an operator's behalf. Both refuse BEFORE any write.
|
|
94
|
+
case "$SOCK" in
|
|
95
|
+
/*) ;;
|
|
96
|
+
*) fail "codex-app-server-socket-path-not-absolute: the resolver returned
|
|
97
|
+
'$SOCK'
|
|
98
|
+
A relative control-socket address resolves to a different file for every process that reads it,
|
|
99
|
+
and the bridge that looks for this socket runs with its own working directory. Set CODEX_HOME to
|
|
100
|
+
an absolute path." ;;
|
|
101
|
+
esac
|
|
102
|
+
case "$SOCK" in
|
|
103
|
+
*[[:cntrl:]]*) fail "codex-app-server-socket-path-untrusted: the resolved control-socket address
|
|
104
|
+
carries a control character (CODEX_HOME almost certainly does). Refusing to create or bind it." ;;
|
|
105
|
+
esac
|
|
106
|
+
|
|
107
|
+
# --- operator argv: forwarded, never reinterpreted -------------------------
|
|
108
|
+
# Everything the operator passes is appended after the injected pair and crosses
|
|
109
|
+
# byte-identical. The single exception is a second `--listen`: injecting ours beside theirs
|
|
110
|
+
# would hand the vendor two listen addresses and let one of them win silently, and a silent
|
|
111
|
+
# winner is exactly the false success this repo refuses. `--opt=value` and `--opt value` are
|
|
112
|
+
# the same option, so the head is what is compared.
|
|
113
|
+
for tok in "$@"; do
|
|
114
|
+
if [ "${tok%%=*}" = "--listen" ]; then
|
|
115
|
+
fail "codex-app-server-listen-override: this verb exists to spell ONE --listen address
|
|
116
|
+
(unix://$SOCK), and you passed your own. Run the vendor directly if you mean a
|
|
117
|
+
different address: $VENDOR_CMD app-server --listen <your-address>"
|
|
118
|
+
fi
|
|
119
|
+
done
|
|
120
|
+
|
|
121
|
+
# --- resolve the vendor executable -----------------------------------------
|
|
122
|
+
# `type -P` returns the PATH hit only — never a shell function, alias or builtin — so what
|
|
123
|
+
# is exec'd is a real external file. `exec command codex` is deliberately NOT used: it would
|
|
124
|
+
# re-enter shell lookup at exec time and could pick up something other than the file
|
|
125
|
+
# validated here.
|
|
126
|
+
codex_bin="$(type -P "$VENDOR_CMD" 2>/dev/null || true)"
|
|
127
|
+
[ -n "$codex_bin" ] \
|
|
128
|
+
|| fail "no '$VENDOR_CMD' executable found on PATH.
|
|
129
|
+
The managed launch runs the OpenAI Codex CLI; install it, or put it on PATH."
|
|
130
|
+
[ -f "$codex_bin" ] && [ -x "$codex_bin" ] \
|
|
131
|
+
|| fail "'$codex_bin' is not an executable regular file — refusing to exec it."
|
|
132
|
+
|
|
133
|
+
# Self-exec fence, the second half of the recursion guard: resolve symlinks and refuse
|
|
134
|
+
# anything that is one of our own entrypoints even if the sentinel was stripped. POSIX walk,
|
|
135
|
+
# same shape as scripts/copilot-launch.sh — BSD readlink has no -f.
|
|
136
|
+
resolve_path() {
|
|
137
|
+
local SOURCE="$1" DIR TARGET
|
|
138
|
+
while [ -L "$SOURCE" ]; do
|
|
139
|
+
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
|
|
140
|
+
TARGET="$(readlink "$SOURCE")"
|
|
141
|
+
case "$TARGET" in
|
|
142
|
+
/*) SOURCE="$TARGET" ;;
|
|
143
|
+
*) SOURCE="$DIR/$TARGET" ;;
|
|
144
|
+
esac
|
|
145
|
+
done
|
|
146
|
+
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
|
|
147
|
+
printf '%s/%s\n' "$DIR" "$(basename "$SOURCE")"
|
|
148
|
+
}
|
|
149
|
+
resolved_bin="$(resolve_path "$codex_bin")"
|
|
150
|
+
for own in "$HERE/codex-app-server-launch.sh" "$REPO_DIR/run.sh"; do
|
|
151
|
+
own_resolved="$(resolve_path "$own")"
|
|
152
|
+
[ "$resolved_bin" = "$own_resolved" ] \
|
|
153
|
+
&& fail "'$VENDOR_CMD' on PATH resolves to entwurf's own '$own_resolved' — that is a launch loop, not the vendor CLI."
|
|
154
|
+
done
|
|
155
|
+
|
|
156
|
+
# --- is somebody already listening there? ----------------------------------
|
|
157
|
+
# Three outcomes, and they are NOT the same repair. A live socket means a second server
|
|
158
|
+
# would either lose the bind race or silently replace the endpoint every citizen's record
|
|
159
|
+
# already points at — refuse and name the holder. An indeterminate path (symlink, not a
|
|
160
|
+
# socket, owned by another uid) is the classification `checkCodexSocketFile` already uses in
|
|
161
|
+
# the product, and a launcher that guessed past it would be clobbering something it cannot
|
|
162
|
+
# identify. A dead socket file is the ordinary leftover of a Ctrl-C, and the vendor replaces
|
|
163
|
+
# it — that one is a fact line, not a refusal.
|
|
164
|
+
probe="$(python3 - "$SOCK" <<'PY'
|
|
165
|
+
import os, socket, stat, sys
|
|
166
|
+
|
|
167
|
+
path = sys.argv[1]
|
|
168
|
+
try:
|
|
169
|
+
st = os.lstat(path)
|
|
170
|
+
except FileNotFoundError:
|
|
171
|
+
print("absent")
|
|
172
|
+
raise SystemExit(0)
|
|
173
|
+
except OSError as exc:
|
|
174
|
+
print(f"indeterminate\t{exc.strerror or exc}")
|
|
175
|
+
raise SystemExit(0)
|
|
176
|
+
|
|
177
|
+
if stat.S_ISLNK(st.st_mode):
|
|
178
|
+
print("indeterminate\tthe path is a symlink")
|
|
179
|
+
raise SystemExit(0)
|
|
180
|
+
if not stat.S_ISSOCK(st.st_mode):
|
|
181
|
+
print("indeterminate\tthe path exists and is not a socket")
|
|
182
|
+
raise SystemExit(0)
|
|
183
|
+
if st.st_uid != os.getuid():
|
|
184
|
+
print(f"indeterminate\tthe socket is owned by uid {st.st_uid}, not {os.getuid()}")
|
|
185
|
+
raise SystemExit(0)
|
|
186
|
+
|
|
187
|
+
probe = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
188
|
+
probe.settimeout(2)
|
|
189
|
+
try:
|
|
190
|
+
probe.connect(path)
|
|
191
|
+
except (ConnectionRefusedError, FileNotFoundError):
|
|
192
|
+
print("stale")
|
|
193
|
+
except OSError as exc:
|
|
194
|
+
print(f"indeterminate\t{exc.strerror or exc}")
|
|
195
|
+
else:
|
|
196
|
+
print("live")
|
|
197
|
+
finally:
|
|
198
|
+
probe.close()
|
|
199
|
+
PY
|
|
200
|
+
)" || fail "could not classify the control socket at $SOCK (python3 is required by this launcher)."
|
|
201
|
+
|
|
202
|
+
probe_status="${probe%% *}"
|
|
203
|
+
probe_reason="${probe#* }"
|
|
204
|
+
case "$probe_status" in
|
|
205
|
+
live)
|
|
206
|
+
# Show what the host actually says, and say so when it says nothing. The owner is read
|
|
207
|
+
# out of /proc rather than inferred from the socket: a socket file names no pid, so the
|
|
208
|
+
# only honest answer when no cmdline matches is that no match was found.
|
|
209
|
+
owner=""
|
|
210
|
+
if [ -d /proc ]; then
|
|
211
|
+
for cl in /proc/[0-9]*/cmdline; do
|
|
212
|
+
[ -r "$cl" ] || continue
|
|
213
|
+
if tr '\0' ' ' < "$cl" 2>/dev/null | grep -qF "$SOCK"; then
|
|
214
|
+
owner="${owner} pid $(basename "$(dirname "$cl")"): $(tr '\0' ' ' < "$cl")
|
|
215
|
+
"
|
|
216
|
+
fi
|
|
217
|
+
done
|
|
218
|
+
fi
|
|
219
|
+
[ -n "$owner" ] || owner=" (no process on this host spells that socket in its cmdline — read, not inferred)
|
|
220
|
+
"
|
|
221
|
+
fail "codex-app-server-already-listening: a live app-server is answering on
|
|
222
|
+
unix://$SOCK
|
|
223
|
+
Entwurf never replaces one. What /proc reports about it:
|
|
224
|
+
$owner Use that server, or stop it first."
|
|
225
|
+
;;
|
|
226
|
+
indeterminate)
|
|
227
|
+
fail "codex-app-server-socket-indeterminate: $probe_reason
|
|
228
|
+
Path: $SOCK
|
|
229
|
+
This is the same classification the delivery rail's socket check uses, and a launcher that
|
|
230
|
+
guessed past it would be clobbering something it cannot identify. Inspect that path."
|
|
231
|
+
;;
|
|
232
|
+
stale)
|
|
233
|
+
note "a dead control socket is already at $SOCK (nothing is listening); the vendor replaces it."
|
|
234
|
+
;;
|
|
235
|
+
absent)
|
|
236
|
+
: # nothing is there; the ordinary first launch
|
|
237
|
+
;;
|
|
238
|
+
*)
|
|
239
|
+
# Hard Rule 15. Every branch above is a decision about whether this launch would
|
|
240
|
+
# CLOBBER a running server, so an unrecognised classification is the one case where
|
|
241
|
+
# proceeding is unsafe — and a probe that exits 0 while printing something nobody wrote
|
|
242
|
+
# would otherwise fall straight through to the exec.
|
|
243
|
+
fail "codex-app-server-socket-probe-unrecognised: the socket classifier answered
|
|
244
|
+
'$probe_status', which is not one of live/stale/indeterminate/absent. Refusing to launch on a
|
|
245
|
+
reading nothing understands."
|
|
246
|
+
;;
|
|
247
|
+
esac
|
|
248
|
+
|
|
249
|
+
# --- the control directory the address lives in ----------------------------
|
|
250
|
+
# The same `mkdir -p` the three documents told the operator to run by hand. It is inside
|
|
251
|
+
# their own CODEX_HOME, and without it a first launch fails on a directory rather than on
|
|
252
|
+
# anything meaningful.
|
|
253
|
+
mkdir -p "$(dirname "$SOCK")" \
|
|
254
|
+
|| fail "could not create $(dirname "$SOCK") — the control socket has nowhere to live."
|
|
255
|
+
|
|
256
|
+
# --- the tmux fact, stated once --------------------------------------------
|
|
257
|
+
note "this app-server's tmux seat: ${TMUX:-(none — not inside tmux)}"
|
|
258
|
+
note "the bridge is this server's MCP child and inherits that TMUX, so caller-seat lookups read THAT tmux server's panes."
|
|
259
|
+
note "entwurf neither supervises nor restarts this process — Ctrl-C is yours."
|
|
260
|
+
|
|
261
|
+
export ENTWURF_CODEX_APP_SERVER_ACTIVE=1
|
|
262
|
+
|
|
263
|
+
# --- foreign identity carriers, removed before exec ------------------------
|
|
264
|
+
# The MCP bridge trusts a COMPLETE `PI_SESSION_ID` + `PI_AGENT_ID` pair ahead of a native
|
|
265
|
+
# sender marker when it resolves who is speaking. Inside the pi process that planted them
|
|
266
|
+
# from record birth that is correct. Here they would be somebody else's identity inherited by
|
|
267
|
+
# the app-server and by EVERY bridge child it spawns — start the server from a pi citizen's
|
|
268
|
+
# bash and each Codex thread's MCP child could speak under the parent pi garden id.
|
|
269
|
+
#
|
|
270
|
+
# Both go, together: clearing one only changes the wording of a later failure while leaving a
|
|
271
|
+
# carrier for a partial reader. Nothing is substituted — a Codex thread's identity comes from
|
|
272
|
+
# its own trusted birth hook, which is where the record authority already lives.
|
|
273
|
+
unset PI_SESSION_ID PI_AGENT_ID
|
|
274
|
+
|
|
275
|
+
exec "$codex_bin" app-server --listen "unix://$SOCK" "$@"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* codex-socket-path — print the Codex app-server default control-socket path for THIS
|
|
3
|
+
* environment, and nothing else.
|
|
4
|
+
*
|
|
5
|
+
* WHY A LEAF EXISTS FOR ONE LINE. `entwurf codex-app-server` is a bash launcher, and bash
|
|
6
|
+
* cannot import `resolveCodexDefaultSocketPath`. Its first version re-derived the path
|
|
7
|
+
* instead — `${CODEX_HOME:-$HOME/.codex}` plus a POSIX `[:space:]` trim — and a gate compared
|
|
8
|
+
* the two spellings over four ASCII-normal inputs, which they agreed on.
|
|
9
|
+
*
|
|
10
|
+
* They did not agree everywhere. `[측정 2026-09-16]` with `CODEX_HOME=$''` the TS leaf
|
|
11
|
+
* trims (JS `String.prototype.trim` strips U+FEFF) and falls back to `$HOME/.codex`, while the
|
|
12
|
+
* bash trim keeps the byte and yields `<BOM>/app-server-control/app-server-control.sock`. Same
|
|
13
|
+
* for `path.join`'s normalization of a trailing slash or a `..` segment. Every one of those is
|
|
14
|
+
* a managed launch starting a server at an address delivery and preflight never look at — a
|
|
15
|
+
* false success of exactly the kind this repo refuses.
|
|
16
|
+
*
|
|
17
|
+
* So the second spelling is gone rather than widened. There is ONE implementation of this
|
|
18
|
+
* address, this leaf prints it, and the launcher asks. Matching a transcription against its
|
|
19
|
+
* original can only ever test the inputs somebody thought of.
|
|
20
|
+
*
|
|
21
|
+
* Reads `process.env` directly: the resolver's contract is the ambient environment of whoever
|
|
22
|
+
* is about to launch, and an argv seam here would be a way to redirect the address.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { resolveCodexDefaultSocketPath } from "../pi-extensions/lib/native-push/codex-ws-client.ts";
|
|
26
|
+
|
|
27
|
+
if (process.argv.length > 2) {
|
|
28
|
+
console.error("usage: codex-socket-path (no arguments; the environment is the input)");
|
|
29
|
+
process.exit(2);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// No trailing newline: the caller substitutes this straight into an address.
|
|
33
|
+
process.stdout.write(resolveCodexDefaultSocketPath(process.env));
|