Commit Graph

938 Commits

Author SHA1 Message Date
William Valentin 184dc2c688 Add companion reconnect state recovery and handoff helper 2026-02-26 17:01:16 -08:00
William Valentin e9873ad22b Document browser reliability layer and roadmap progress 2026-02-26 14:06:53 -08:00
William Valentin 7c904ef0fd Add browser workflow reliability primitives and guardrails 2026-02-26 14:06:46 -08:00
William Valentin 3cc9e16ef5 feat(subagents): complete queue, budgets, audit, and inspection controls 2026-02-26 13:28:10 -08:00
William Valentin b679261683 feat(subagents): add idle ttl cleanup and summary tool 2026-02-26 13:12:53 -08:00
William Valentin 2171346116 feat(subagents): add multi-turn subagent session runtime 2026-02-26 13:07:34 -08:00
William Valentin e887c3c964 docs(plans): add personal assistant productization roadmap 2026-02-26 12:45:06 -08:00
William Valentin adcef2249b docs: improve local backend reliability and documentation
- Switch local endpoints from localhost to 127.0.0.1 to avoid IPv6 resolution issues\n- Add recommended Ollama user systemd service example with keep-alive and CUDA support
2026-02-26 12:19:28 -08:00
William Valentin d07e05d4cc fix(config): change no_tools_mode default to false for pi_embedded
The previous default of true was overly restrictive. false is the correct
default — tool-like prompts fall through to native handling only when
explicitly enabled.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 11:52:43 -08:00
William Valentin a00451a690 fix(auth): cancel OAuth callback server when flow is aborted
Add AbortSignal support to startCallbackServer and loginAnthropicOAuth
so that pressing Ctrl+C during the browser OAuth flow immediately closes
the HTTP server and 5-minute timer instead of leaving the process hung.

Wire up an AbortController in the TUI browser OAuth path so the cancel
callback aborts the signal on Ctrl+C.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 11:51:27 -08:00
William Valentin dfc7fbe3b9 fix(cli): add curly braces to single-line if statements in resolveAuthMode 2026-02-26 11:34:47 -08:00
William Valentin ed66dc98d3 feat(cli): add --browser flag to anthropic-auth command 2026-02-26 11:33:23 -08:00
William Valentin 0c500855c5 feat(tui): replace Anthropic token paste with browser OAuth flow 2026-02-26 11:31:19 -08:00
William Valentin 7b9e1e6cba fix(auth): correct ternary indentation in openBrowser 2026-02-26 11:28:29 -08:00
William Valentin 57f08e7005 feat(auth): implement Anthropic OAuth PKCE browser flow
Add openBrowser, exchangeCodeForToken, and loginAnthropicOAuth to
src/auth/anthropic.ts, completing the full PKCE OAuth flow. Includes
5 new tests covering happy path, state mismatch, 403 subscription
error, 500 error, and missing access_token cases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 10:52:28 -08:00
William Valentin 82f09422d6 feat(auth): add PKCE helpers and OAuth callback server for Anthropic
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 10:32:13 -08:00
William Valentin 6e63e00b84 docs: Anthropic OAuth browser flow implementation plan 2026-02-26 10:30:22 -08:00
William Valentin 8d41d14266 docs: design Anthropic OAuth browser flow (PKCE + local callback server) 2026-02-26 10:26:15 -08:00
William Valentin c34b387ffe feat(tui): add tab completions for /login mode subcommand
Implement tab completion for /login <provider> mode <value> syntax,
allowing users to easily switch auth modes (api_key, oauth, auto) with
keyboard navigation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 09:44:59 -08:00
William Valentin 7004a1a805 fix(tui): only offer auth_mode prompt after successful credential storage
Introduce a `credentialStored` flag in all 4 credential paths (OpenAI
API key, OpenAI OAuth, Anthropic auth token, Anthropic API key). The
auth_mode prompt is now gated on `credentialStored`, so a failed store
call no longer falls through to prompt the user for an auth mode that
was never set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 09:40:58 -08:00
William Valentin 7d0c59b16f feat(tui): implement /login <provider> mode <value> auth mode switching
Export AUTH_MODE_PROVIDERS and applyAuthModeToConfig from minimal.ts.
Wire mode fast-path into handleLoginCommand so /login anthropic mode oauth
persists auth_mode to config without entering the credential flow.
After successful credential entry for anthropic/openai, prompt to set
auth_mode immediately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 09:35:50 -08:00
William Valentin c456d34bf1 feat(tui): thread configPath and currentConfig into MinimalTuiConfig 2026-02-26 09:31:48 -08:00
William Valentin 7726b6d42a feat(tui): extend /login parser to accept mode subcommand
Add support for `/login <provider> mode <api_key|oauth|auto>` syntax to allow
switching authentication mode per provider in the TUI. The Command union type
now includes an optional mode field, and parseCommand handles regex matching
for the "mode" subcommand pattern while maintaining backward compatibility.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 09:28:47 -08:00
William Valentin 01e4e43a88 docs(state): bump test count after prompt injection test 2026-02-25 18:29:56 -08:00
William Valentin c226a340b5 test(memory): cover getSystemPrompt session context 2026-02-25 18:06:33 -08:00
William Valentin 17f53e57d0 feat(memory): build session context for getSystemPrompt 2026-02-25 16:58:52 -08:00
William Valentin 0a354a597a docs(memory): document session-start memory and config defaults 2026-02-25 13:02:30 -08:00
William Valentin a76bc94b4d feat(memory): wire user_namespace and working memory config to orchestrator 2026-02-25 12:59:06 -08:00
William Valentin c658660a91 feat(memory): inject session context and write working memory after compaction 2026-02-25 12:58:01 -08:00
William Valentin 2d3ac30d3c feat(memory): thread summary and PA prompt through compaction result 2026-02-25 12:55:31 -08:00
William Valentin dc933243f2 feat(memory): add parameterized compaction prompt builder 2026-02-25 12:54:57 -08:00
William Valentin 8412e3b096 feat(memory): add working memory read/write with TTL expiry 2026-02-25 12:54:39 -08:00
William Valentin 64ebc636c1 feat(memory): add user_namespace and working memory config fields 2026-02-25 12:53:58 -08:00
William Valentin ed53d6d215 docs(memory): revise pi personal assistant memory plan after code review
Key changes from review:
- Use separate _sessionContext field instead of mutating _systemPromptBase
- Parameterize compaction prompt via buildCompactionPrompt() instead of duplicating
- Fix flaky TTL=0 test to use hardcoded past expiry date
- Route memory extraction to {userNamespace}/facts when namespace is set
- Document future considerations (config refactor, concurrent writes, token counting)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 12:50:24 -08:00
William Valentin 40828d424f docs(memory): add pi personal assistant memory implementation plan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 12:29:44 -08:00
William Valentin cc70c3e524 docs(design): Pi-inspired personal assistant memory design
Two-tier memory model (working memory + long-term store) with a unified
user namespace across all channels. Addresses four gaps: cross-session
forgetting, compaction context loss, no proactive recall, and channel
fragmentation.

Key design decisions:
- user/working namespace written on every compaction (TTL-based expiry)
- user/profile + user/patterns as shared identity across channels
- Session-start injection before first turn (one-time, idempotent)
- Opt-in via memory.user_namespace config; default is unchanged behavior

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 12:23:49 -08:00
William Valentin b5b4cb0a84 docs(state): fix feature gap scorecard and add missing phase entries
The scorecard claimed 128/128 (100%) which was never accurate — the
2026-02-06 gap analysis listed 16 MISSING features that remain
deferred. Updated to ~114/130 (~88%) with explicit list of deferred
items: channel adapters (Matrix/Zalo/LINE/Feishu/Mattermost), providers
(MiniMax/Moonshot/Vercel AI/OAuth), native companion apps, ClawHub,
Bonjour/mDNS, skill safety scanner, and elevated mode.

Also added missing progress entries for Phase 3 (companion/canvas/voice
deepening), Phase 4 (rollout/operator readiness), and the post-phase
test fixes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 12:02:07 -08:00
William Valentin b39010d602 fix(tests): resolve 4 post-phase test failures
- platformClients.integration: iOS/Android push tests lacked
  setStatus() call before listNodes(), so platform filter excluded
  nodes. Added publishHeartbeat() to set platform on connection state.
- server.test: agent.send now emits run_state events before done (Phase
  1). Added sendAndWaitForDone() helper and updated test to find done
  event rather than assuming index 0.
- handlers.test: updated agent.send/cancel assertions to use find()
  and pass send arg to agent.cancel, consistent with run_state events.
- httpBody: req.destroy() closed socket before 413 response could be
  sent. Removed socket destruction from body reader; 413 responses now
  send Connection: close so Node closes the connection cleanly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 11:55:14 -08:00
William Valentin 787dd61a6d docs(rollout): add phase 4 readiness plan 2026-02-25 11:23:47 -08:00
William Valentin eec54ace9d test(voice): cover tts fallback 2026-02-25 11:21:49 -08:00
William Valentin e3e98058b0 feat(canvas): persist artifacts and surface UI 2026-02-25 11:18:53 -08:00
William Valentin ac60fa5be3 feat(companion): add reconnect resilience 2026-02-25 11:12:21 -08:00
William Valentin 7b170cff4d Phase 2 reactions v2 priority and cooldown 2026-02-25 10:36:56 -08:00
William Valentin e4ee6acce8 Phase 1 run-control semantics and run_state events 2026-02-25 10:22:44 -08:00
William Valentin ae21681958 docs(observability): seed phase-0 baseline probe artifacts 2026-02-25 09:42:48 -08:00
William Valentin 8b5266c66c docs(observability): document phase-0 telemetry and baseline workflow 2026-02-25 09:22:56 -08:00
William Valentin 0b8f7c7299 feat(audit): add phase-0 baseline summary tooling
Diagrams reviewed: docs/architecture/AGENT_DIAGRAM.md, docs/architecture/GATEWAY_SESSIONS_AND_QUEUE.md, docs/api/PROTOCOL.md (no changes required).
2026-02-25 09:14:38 -08:00
William Valentin 2311826092 feat(metrics): add phase-0 baseline counters
Diagrams reviewed: docs/architecture/AGENT_DIAGRAM.md, docs/architecture/GATEWAY_SESSIONS_AND_QUEUE.md, docs/api/PROTOCOL.md (no changes required).
2026-02-25 09:05:31 -08:00
William Valentin 6bcdb13bf4 feat(observability): emit run and reaction baseline audit events
Diagrams reviewed: docs/architecture/AGENT_DIAGRAM.md, docs/architecture/GATEWAY_SESSIONS_AND_QUEUE.md, docs/api/PROTOCOL.md (no changes required).
2026-02-25 08:54:19 -08:00
William Valentin 23b813a92f feat(audit): add phase0 run/reaction baseline audit events 2026-02-25 00:12:31 -08:00