The "files" field in package.json only includes "dist" and "README.md",
so src/index.ts is not available in the published npm package.
This was introduced in commit 1b110a6 ("fix index") which changed
the path from the correct "./dist/index.js" to "./src/index.ts".
When assistant messages contain only tool_calls (no text/thinking), transform.ts
was setting content to null. Qoder's gateway drops these null-content assistant
messages, orphaning the following tool_result and causing upstream rejections:
- dmodel (OpenAI): 'tool must follow a message with tool_calls'
- ultimate (Anthropic): 'unexpected tool_use_id in tool_result blocks'
Analysis of 28 historical sessions showed 100% failure rate on dmodel and 75%
on ultimate for this pattern, while auto/GLM5.2 (GLM upstream) tolerated it.
Fix: inject a single-space placeholder when tool_calls are present but content
is empty, so the gateway preserves the assistant message and tool pairing stays
valid.
Also fixes pre-existing lint formatting in stream.ts and package.json.
Adds regression test for the full assistant+toolResult pairing scenario.
The custom ctx.ui.custom login menu stole focus from pi's built-in
LoginDialog, so onPrompt never received keystrokes and PAT login
silently failed with 'No API key found'. Drive login via the provided
onPrompt/onAuth/onProgress callbacks instead, and drop login-ui.ts and
the now-unused pi-tui dependency. Also clears remaining lint warnings
by removing any-casts in models/oauth/stream/transform.