Commit Graph

81 Commits

Author SHA1 Message Date
William Valentin 9a9375ef5d Fix minimal TUI submitted-line duplicate appearance 2026-02-22 17:21:22 -08:00
William Valentin 9c8e9cd546 fix(tui): narrow tool inventory query detection 2026-02-22 17:12:30 -08:00
William Valentin 44c7409a20 feat(councils): add preflight, schema-driven outputs, and artifact reporting 2026-02-22 15:56:30 -08:00
William Valentin dafe9b4d3d fix(core): harden env loading, OpenAI compatibility, and runtime recovery 2026-02-22 15:56:21 -08:00
William Valentin b09bfc8373 Unify TUI slash commands and harden tool inventory responses 2026-02-21 12:39:27 -08:00
William Valentin c6731c8e20 Improve TUI timestamp consistency and formatting 2026-02-21 09:25:14 -08:00
William Valentin baa53f91d9 refactor(security): unify elevated mode handling across surfaces 2026-02-19 11:41:53 -08:00
William Valentin 7cb647cbb8 feat(tui): add busy status indicator during processing 2026-02-19 11:34:44 -08:00
William Valentin cdba111831 fix(confirmations): guarded-action handling across webchat and tui 2026-02-18 17:43:57 -08:00
William Valentin 7e00cb6b04 fix(tui): auto-approve hook confirmations in minimal mode 2026-02-18 17:39:45 -08:00
William Valentin 67d235ebf5 feat(tui): single ctrl+c clears input, double ctrl+c exits 2026-02-18 11:38:21 -08:00
William Valentin 16af5e75fd feat: make /transfer bidirectional across telegram and tui 2026-02-18 07:55:08 -08:00
William Valentin 18da9ddf90 fix(tui): make verbose mode control raw streaming and tool output 2026-02-17 15:40:09 -08:00
William Valentin 9a2f1e2bb2 chore: checkpoint browser tooling and routing updates 2026-02-17 15:18:37 -08:00
William Valentin e3b6f9df7c feat(tui,gemini): implement verbose transfer and url image fetch 2026-02-17 10:58:14 -08:00
William Valentin fc6a79ed90 feat(tui): use configured compaction threshold for /context output 2026-02-16 18:10:54 -08:00
William Valentin 409ab04ca1 feat(tui,dashboard,docs): add context command parity and context health panel 2026-02-16 18:08:19 -08:00
William Valentin 1d16cd54e6 fix(tui): align slash command parsing and handlers 2026-02-16 12:22:40 -08:00
William Valentin fd7ad7bfb0 fix(tui): add /queue command support across tui and routing 2026-02-16 12:19:21 -08:00
William Valentin 527602fd8a feat(tui): let Esc cancel active minimal-mode response generation 2026-02-16 11:42:25 -08:00
William Valentin b7a9fc1d35 fix(tui): make Esc clear line and cancel hidden prompts in minimal mode 2026-02-16 11:38:22 -08:00
William Valentin a5e8d6c216 fix(tui): cancel prompts on raw Esc input in minimal mode 2026-02-16 11:36:14 -08:00
William Valentin 205203a458 fix(tui): detect escape key variants for prompt cancellation 2026-02-16 11:34:05 -08:00
William Valentin c34ae9b75b feat(tui): add Esc key to cancel active prompt without exiting 2026-02-16 11:31:17 -08:00
William Valentin 948d4ac6d8 chore(lint): burn down remaining warnings to zero 2026-02-15 23:14:21 -08:00
William Valentin 49b752e8b0 chore(lint): reduce warning debt across core adapters and model clients 2026-02-15 23:03:42 -08:00
William Valentin e16c0bc2c7 audit follow-up: reduce warning hotspots in automation and gateway tests 2026-02-15 22:49:45 -08:00
William Valentin 1a075e62b0 audit follow-up: burn down lint hotspots and dedupe channel gating flows 2026-02-15 22:44:04 -08:00
William Valentin 46538e71a8 chore(lint): restore zero-error eslint baseline 2026-02-15 22:25:29 -08:00
William Valentin 50dcff5ea6 chore: commit unrelated local changes 2026-02-15 21:51:22 -08:00
William Valentin 42c526bce9 Add re-auth y/N confirmation to minimal TUI login flows 2026-02-15 20:12:31 -08:00
William Valentin 99ad53a1ee Add API vs Coding Plan mode selection for Z.AI auth 2026-02-15 20:06:35 -08:00
William Valentin 8b1ed2f689 Make /model provider switch activate selected tier in minimal TUI 2026-02-15 19:53:42 -08:00
William Valentin 7e390dd777 tui: extend /login for OpenAI key and Anthropic token 2026-02-15 10:32:13 -08:00
William Valentin 7df0569a39 feat(models): add Z.AI (GLM) credential integration and setup flow
Implement first-class Z.AI credential storage and authentication:

- New auth provider: src/auth/zai.ts for Z.AI API key management
- New CLI command: flynn zai-auth to store Z.AI API keys
- New TUI command: /login zai for interactive credential entry
- Modified src/auth/index.ts to register zai provider
- Modified src/cli/index.ts to register zai-auth command
- Modified src/cli/setup/providers.ts to include Z.AI in setup wizard
- Modified src/daemon/models.ts to support zhipuai use_oauth flag
- Modified src/daemon/clientFactory.test.ts to add Z.AI tests
- Modified src/frontends/tui/commands.ts to add login command
- Modified src/frontends/tui/minimal.ts to support credential prompts

This allows users to authenticate with Z.AI (GLM models) without
embedding secrets in config files. Credentials are stored securely in
~/.config/flynn/auth.json and resolved at runtime.

Updated state.json with new feature entry documenting the integration.
2026-02-13 16:23:49 -08:00
William Valentin 955b9e28e0 feat: add OpenAI OAuth, strict model overrides, and Gmail pull mode 2026-02-13 14:55:40 -08:00
William Valentin 125af4e832 refactor(backend): use systemd for daemon management
Replace manual process management with systemctl --user commands.
Uses ollama.service and llama-server.service units for proper lifecycle
management, VRAM cleanup, and integration with system services.
2026-02-12 00:24:43 -08:00
William Valentin 1c8da30905 fix(backend): only kill processes started by TUI
Track PIDs of backends started by /backend command and only kill those
specific PIDs. Previous implementation used pkill which would kill all
Ollama/llama-server processes including those started by the user or
systemd services. Now we only terminate processes we started.
2026-02-12 00:19:26 -08:00
William Valentin 05037a917e feat(backend): auto-stop/start daemon when switching backends
- Add local_providers with ollama and llamacpp configurations
- /backend command now stops current daemon before starting new one
- Start backends as detached processes to avoid blocking TUI
- Wait 500ms for daemon to initialize before switching
2026-02-12 00:13:59 -08:00
William Valentin 6090508bad style: auto-fix ESLint issues (curly braces and formatting)
- Add curly braces to all if/else/for/while statements
- Fix indentation and trailing spaces
- Auto-fixed 372 linting errors using eslint --fix
- Remaining issues are warnings only (non-null assertions, explicit any types)
2026-02-11 10:30:24 -08:00
William Valentin 5c90640e2a fix: clear error messages for missing API keys on provider switch
Previously, switching to zhipuai/openrouter/xai via /model would throw a
confusing 'OPENAI_API_KEY missing' error from the OpenAI SDK. Now
createClientFromConfig validates API keys before constructing the client,
throwing errors that name the correct env var (e.g. ZHIPUAI_API_KEY).

Also fixes the misleading 'as anthropic' type cast in the /model handler
to validate against MODEL_PROVIDERS and use the ModelProvider type.
2026-02-10 21:32:44 -08:00
William Valentin 25482b8516 feat: sync PROVIDER_NAMES with config schema and update README docs
Extract MODEL_PROVIDERS const from config schema as single source of truth
for provider names. PROVIDER_NAMES in TUI commands now imports from schema
instead of maintaining a hardcoded list. Adds tests verifying sync.

Updates README TUI Commands section with /model hot-swap documentation,
supported providers, and runtime model switching examples.
2026-02-10 21:26:18 -08:00
William Valentin 7a69794418 fix: sync model tier between TUI and WebChat when switching models
ModelRouter now supports multiple tier-change listeners via addOnTierChange(),
SessionBridge subscribes to tier changes and propagates them to all WebChat
agents (both existing and newly created), and the fullscreen TUI now also
updates the agent's tier when switching models (matching minimal TUI behavior).
2026-02-10 20:22:40 -08:00
William Valentin 2644ed269e fix(tui): reset agent state on /reset command in fullscreen mode
Use agent.reset() instead of session.clear() when agent is available,
ensuring tool fingerprint, usage counters, and agent history are all
cleared properly alongside the session.
2026-02-10 13:27:58 -08:00
William Valentin 671ec035e9 fix(tui): show tool activity in fullscreen mode via Ink-compatible callback
Replace process.stdout.write-based onToolUse callback (which corrupts
Ink rendering) with a React state-driven approach that shows tool names,
args, and completion status in the streaming content area.
2026-02-10 13:26:47 -08:00
William Valentin e46e8740a1 fix(tui): enable tool access in fullscreen mode via NativeAgent
Fullscreen TUI was calling modelClient directly, bypassing the NativeAgent
tool loop entirely. Pass the agent through FullscreenTuiConfig → App and
use agent.process() for message handling, which enables the full tool
registry and executor.
2026-02-10 13:21:22 -08:00
William Valentin f892bbe6ca feat(tui): add ASCII art banner on startup 2026-02-10 13:11:32 -08:00
William Valentin 411c6d84a2 feat(tui): persist model tier selection and fix formatting
Persist /model tier choice to ~/.local/share/flynn/preferences.json so
it survives restarts. Decode HTML entities (e.g. ') in markdown
renderer output. Suppress noisy logger.info and punycode deprecation
warnings in TUI startup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 12:23:12 -08:00
William Valentin 4cc29f534a fix(tui): render inline markdown formatting with ANSI codes
Block-level renderer methods (paragraph, heading, blockquote, list) were
using raw token.text instead of this.parser.parseInline(tokens), causing
bold, italic, and inline code to never render. Add table renderer with
aligned columns and box-drawing separators. Remove unused marked-terminal
dependency (incompatible with marked v17).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 11:29:57 -08:00
William Valentin 64e3716ede test(tui): add /pair command parsing tests 2026-02-09 21:56:27 -08:00