hermes-agent/apps/desktop/scripts
ethernet d408e6b6c3 refactor(e2e): extract shared mock inference server
The OpenAI-compatible mock server used by the desktop E2E suite
(apps/desktop/e2e/mock-server.ts) was hand-duplicated into
apps/desktop/scripts/dev-mock.mjs for local dev, which had already
drifted (dev-mock.mjs lacked scripted tool-call turns and had its own
copy of the SSE framing).

Extract the dependency-free core (models list, chat completions,
streaming/non-streaming, canned reply, prompt capture) into
scripts/mock-inference-server.mjs, runnable standalone via Node
(no npm install needed — only node:http/fs) or importable as a module.
It exposes an onCompletionRequest hook so callers can layer scripted
multi-turn tool-call sequences on top without forking the core.

apps/desktop/e2e/mock-server.ts now wraps the shared module, keeping
only the desktop-specific scripted turns (interim messages, sidebar
states, queue-stop, correction-switch, verification-stop, blocking
clarify) and all existing exports. apps/desktop/scripts/dev-mock.mjs
now imports the shared module directly instead of carrying its own
copy.

This makes the mock server reusable outside apps/desktop, e.g. from
tests/install/install-update-e2e.sh for a real CLI chat round-trip.
2026-08-05 00:49:56 -04:00
..
perf
.gitignore
after-pack.mjs
assert-dist-built.mjs
assert-dist-built.test.mjs
assert-root-install.mjs
before-build.mjs
before-pack.mjs
before-pack.test.mjs
bundle-electron-main.mjs
click-session.mjs
dev-mock.mjs refactor(e2e): extract shared mock inference server 2026-08-05 00:49:56 -04:00
dev-no-hmr.mjs
diag-code-live.mjs
diag-drag-churn.mjs
diag-drag-trace.mjs
diag-jump.mjs
diag-key-latency.mjs
diag-live-state.mjs
diag-overlay-ab.mjs
diag-overlay-churn.mjs
diag-overlay-full.mjs
diag-overlay-sweep.mjs
diag-real-loop.mjs
diag-ro-storm.mjs
diag-scroll-reset.mjs
diag-sidebar-dom.mjs
diag-switch-autopsy.mjs
diag-switch-trace.mjs
eval.mjs
gen-share-codes.ts
live-drive.mjs
notarize-artifact.mjs
notarize.mjs
patch-electron-builder-mac-binary.mjs
probe-command-palette.mjs
probe-model-picker.mjs
probe-renderer.mjs
probe-thread.mjs
profile-model-picker.mjs
profile-typing-lag.md
rebuild-native.mjs
reload-renderer.mjs
reload.mjs
run-electron-builder.mjs
set-exe-identity.mjs
stage-native-deps.mjs
stage-native-deps.test.mjs
test-desktop.mjs
utils.mjs
write-build-stamp.mjs
write-build-stamp.test.mjs