Skip to content

Media native modules

This page documents the non-cli.js JavaScript shims retained from the Bun standalone payload, plus the native addon boundary they reference. The .node binaries are part of the shipped executable payload, but they are no longer retained in the final repository layout.

Source anchors

Semantic aliasSourceApproximate locationString or symbolMeaning
ImageProcessorShimclaude-code-pkg/image-processor.jsline ~11require("/$bunfs/root/image-processor.node")CommonJS wrapper loads image native addon from the original Bun payload path.
AudioCaptureShimclaude-code-pkg/audio-capture.jsline ~11require("/$bunfs/root/audio-capture.node")CommonJS wrapper loads audio native addon from the original Bun payload path.
AudioNapiLoadedLogcli.jsline ~7745, byte 0xb5dd23audio-capture-napi loadedMain runtime attempts to load the audio N-API addon for voice capture.
VoiceTranscriptInjectioncli.jsline ~9514, byte 0xc8ce2cInjecting transcriptVoice transcription result is injected back into the prompt input.
NativeElfClassificationshell file outputsession validationELF 64-bit LSB shared object, x86-64, ... strippedBoth .node modules are stripped Linux x86-64 shared objects.
NativeNapiRegistrationshell nm -D --defined-only outputsession validationnapi_register_module_v1Both native addons expose the N-API module registration symbol.
NativeNapiImportsshell nm -D outputsession validationU napi_create_*, U napi_call_*, U napi_get_*Dynamic imports confirm Node-API/N-API interaction, not readable implementation internals.

Module inventory

ModuleBytesSHA-256Role
image-processor.js1,97691adae12a122ebe5b60fa631ab73fb3a09314deddc9f372113ada67a0ffd9e91JS shim requiring image-processor.node.
audio-capture.js1,974744d40b4aeb92c2305144aba48374a3490fea3d2d7526a6820ec7f49b9e1a27bJS shim requiring audio-capture.node.
image-processor.node1,464,76037bec7de530676e3dfe963d34a824b49191595809a8072348a2ef4571f1e5f4dOriginal stripped N-API image module; not retained.
audio-capture.node492,1847e89edf4dde9b69b6c55a310788ad999e2d0dd469d8a31c529cf28f3ea5e929cOriginal stripped N-API audio module; not retained.

Interpretation

The two retained JavaScript files are straightforward Bun CommonJS shims. They do not implement media logic directly; each immediately requires its matching .node shared object from the original Bun payload. Because the native modules are stripped and no longer retained, this repository treats them as binary support modules rather than readable implementation targets.

The likely runtime boundary is media input support: the names indicate image processing and audio capture. The audio path is now source-confirmed in cli.js: voice mode loads the native capture addon when available, falls back to OS recorders, streams audio for transcription, and injects the final transcript into the prompt input. See Audio capture and voice mode for that runtime path.

Native binary triage status

The current binary inspection is enough to classify the modules but not to reconstruct their internals.

CheckResultInterpretation
file image-processor.node / file audio-capture.nodeELF 64-bit LSB shared object, x86-64, dynamically linked, strippedThe modules are Linux shared objects without normal symbolic debug names.
nm -D --defined-onlynapi_register_module_v1 in both modulesThe public dynamic export is the Node-API registration function.
nm -D importsNumerous napi_* imports such as napi_create_function, napi_create_object, napi_call_threadsafe_functionRuntime interaction is through N-API; function/class names inside the addon are not exposed by these imports.

Future native reverse engineering would require re-extracting the native .node files temporarily from the package, then using runtime observation or binary tooling rather than treating the .node files as JavaScript-adjacent source. Useful next questions are which N-API exports are registered, which OS audio/image libraries are linked, and how failures propagate back to the JavaScript shims.

Caveats

  • No native-symbol reverse engineering was performed for the stripped .node files.
  • The voice-mode JavaScript boundary is documented separately, but native device-capture internals remain a research opportunity.

Created and maintained by Yingting Huang.