Phase3/jerry term: JerryTerm CLI MVP v0.1.0#12
Open
SarkarShubhdeep wants to merge 15 commits into
Open
Conversation
Add packages/jerry-term/ as a publishable tsup-bundled CLI with: - Bundled @mieweb/jerry-agent-runtime via noExternal config - Minimal --version entry point for acceptance verification - React/Ink dependencies pre-installed for later slices Verified: build produces dist/ with createLocalRuntime inlined, typecheck passes, npm link + jerry-term --version works. Co-authored-by: Cursor <cursoragent@cursor.com>
Add JerryBridge abstraction wrapping agent-runtime for CLI consumption: - BridgeEventEmitter for UI subscription (turn-start, turn-end, runtime-switched) - JerryBridge class with dynamic runtime switching via switchRuntime() - Active-turn protection: queues switch requests during runTurn() - 15 unit tests covering all acceptance criteria Also updates branching strategy to use per-slice branches for independent PRs. Co-authored-by: Cursor <cursoragent@cursor.com>
Land all jerry-term slices on phase3/jerry-term and open a single PR against development when the phase is complete, instead of per-slice PRs. Co-authored-by: Cursor <cursoragent@cursor.com>
Add Ollama, ActivityWatch, Footnote, and MCP health adapters with a parallel runner, formatter, and unit tests. Externalize the MCP SDK for local diagnostics. Co-authored-by: Cursor <cursoragent@cursor.com>
Add readline REPL with slash commands and config loading, wire health into the CLI, and enable local summarize_activity via ActivityWatch HTTP with stubs for worker-only tools. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace Ink with OpenTUI React for the interactive terminal UI to enable proper fixed-viewport layout with native scrollable transcript. Key changes: - Stack: @opentui/core + @opentui/react replacing ink, ink-text-input - React upgraded to 19.x (required by OpenTUI reconciler) - Runtime: Bun required for interactive UI; Node.js via --no-ui fallback - Layout: Fixed header/input/status chrome with scrollbox for transcript - Dynamic import for UI to allow --no-ui mode to work with Node.js UI components now rendered inline in App.tsx using OpenTUI primitives: - box, text, scrollbox, input elements - useKeyboard hook replacing Ink useInput - useBridge and useRepl hooks unchanged (standard React hooks) The --no-ui readline REPL remains fully functional under Node.js. Co-authored-by: Cursor <cursoragent@cursor.com>
…bility UI Restore local summarize_activity by calling AW /events without a trailing slash and aborting timed-out fetches. Add /aw-tail to peek recent events. Land Slice 6 observability panels and layout hardening attempts. Open issue (unsolved): sticky alternate-screen viewport — host terminal scrollback can still steal the wheel and the transcript scrollbox may not scroll reliably. Tracked in docs/plans/phase-3.md. Co-authored-by: Cursor <cursoragent@cursor.com>
- Document /runtime command with available runtimes display - Add examples showing runtime status and model override syntax - Document /config persistence behavior and additional options - Clarify that config changes are auto-persisted to config file Co-authored-by: Cursor <cursoragent@cursor.com>
Wire OpenTUI onInput so slash mode opens on first keystroke, intercept keys with preventDefault, and run the selected command on Enter (Tab still completes into the input). The / selector problem is solved. Co-authored-by: Cursor <cursoragent@cursor.com>
Ship slice 6.5/6.6: credential vault, live Ozwell /v1/models with recommended-first collapsed Other list, /model + tree picker, and bridge apply/persist for Ozwell and BYO. Detect empty Ozwell streams and mark remaining model-compat verification in phase-3.md. Co-authored-by: Cursor <cursoragent@cursor.com>
…ig state fixes Add native Anthropic backend with live model listing for BYO Cloud, fix critical config state bugs, and improve API key management with validation and auto-fallback. **New Features:** - Add native Anthropic backend (@ai-sdk/anthropic) with support for Claude models - Add live model listing for OpenAI and Anthropic with graceful error handling - Implement API key validation before saving (prevents invalid keys from being stored) - Add API key masking for security (sk-pr****abcd format) - Rename /runtime command to "/runtime & LLMs" for clarity **Bug Fixes:** - Fix config state clobber bug: unify config state between App.tsx and useRepl (removed duplicate useState) - Fix API key not reaching runtime: termConfigToProfile now falls back to credentials vault - Fix clearKey not persisting: saveTermConfig now writes exact state instead of merging from file - Fix invalid state after clearKey: automatically switch to local runtime when clearing active provider **Config & Key Management:** - /config clearKey now persists deletions across sessions - Clearing active provider's key auto-switches to local/ollama (prevents "no API key" errors) - Keys are validated via API before saving (rejects invalid keys immediately) - Display only OpenAI and Anthropic in BYO picker (Moonshot/custom deferred) **Testing:** - Add 6 new tests for termConfigToProfile vault fallback - Add 5 tests for API key validation - Add test for clearKey persistence and auto-fallback - All 240 tests passing Closes issues with API key state management and Anthropic integration. Co-authored-by: Cursor <cursoragent@cursor.com>
Phase A - Green gate (all quality gates passing): - Remove unused symbols (LastModelMap, test vars) fixing DTS build - Fix RuntimePicker.tsx type errors (guard undefined runtime, remove invalid props) - Add JERRY_TERM_CONFIG env override for hermetic tests - Update test assertions to include anthropic runtime - Verify build/typecheck/test green, dist/index.d.ts emits correctly Phase B - CLI argument parser: - Create src/cli.ts with full argument parsing - Support -v/--version, -h/--help, -r/--runtime, --model, -H/--health, --verbose, --no-ui, --config - Implement one-shot mode: jerry-term "message" runs headless and exits - Refactor index.ts to delegate to CLI module Phase C - Documentation: - Complete README with four runtimes, vault, masked keys, tree picker - Add docs/jerry-term.md user guide - Create CHANGELOG.md for 0.1.0 release (Slices 5-6.6.1) - Add v0.1.0-title.png screenshot - Link jerry-term docs from root README Phase D - Publish workflow: - Add .github/workflows/publish-jerry-term.yml (manual trigger, org NPM_TOKEN) - Verify package.json publish fields - Test npm publish --dry-run (passes) - Test npm pack and CLI smoke tests (--version, --help, --health) - Verify Bun compatibility Phase E - Final QA: - Correct phase-3.md green-gate documentation - Mark all green-gate items complete - Final verification: build + typecheck + test all pass (240/240) All 11 Slice 7 tasks completed. Package ready for PR and owner publish. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Create separate RELEASE_NOTES_v0.1.0.md with full feature list, known limitations, and roadmap - Create TESTING_INSTRUCTIONS_v0.1.0.md with comprehensive testing guide - Create streamlined pr-draft-jerry-term.md that links to the detailed docs - Update docs/jerry-term.md to correctly reflect three runtime backends (local, ozwell, byo-cloud) - Clarify that BYO-Cloud supports multiple providers, not just OpenAI-compatible ones The PR draft is now focused and clean, with detailed information properly organized into separate documents. Co-authored-by: Cursor <cursoragent@cursor.com>
- Add jsx/jsxImportSource to tsconfig.base.json for tsx file checking - Fix eslint ignore patterns for nested dist/ and bin/ directories - Add missing welcome/index.ts module for jerry-term - Fix various lint errors: prefer-const, no-unused-vars, no-case-declarations Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 3: jerry-term Interactive Terminal CLI
Summary
This PR delivers jerry-term v0.1.0, a standalone interactive terminal CLI for Jerry AI agent with a rich OpenTUI-based interface. jerry-term provides a complete, installable package (
npm i -g jerry-term) that bundles all Jerry functionality without requiring the worker to be running.What's New
Three Runtime Backends
All backends use the same tool loop (ActivityWatch, search, etc.) with runtime-switchable model endpoints.
📋 For detailed feature list and known limitations, see RELEASE_NOTES_v0.1.0.md
Quality Assurance
Green Gates ✅
pnpm build— Passes,dist/index.d.tsemits correctlypnpm typecheck— Passes, 0 errorspnpm test— Passes, 240/240 tests (100%)Publish Readiness ✅
npm publish --dry-run— Succeeds (209.8 kB tarball, 12 files)npm pack— Verified tarball contents--version,--help,--healthall workingnpm i -g ./jerry-term-*.tgzworksDocumentation ✅
docs/jerry-term.md.github/workflows/publish-jerry-term.ymlTesting Instructions
📋 See TESTING_INSTRUCTIONS_v0.1.0.md for comprehensive step-by-step testing instructions.
📝 See RELEASE_NOTES_v0.1.0.md for complete feature list, known limitations, and roadmap.
Security Considerations
API Key Storage
~/.config/jerry-term/config.json0600(user read/write only)sk-pr****abcdDeployment
Pre-Publish Checklist (Owner)
developmentdevelopmenttomain.github/workflows/publish-jerry-term.yml(manual workflow dispatch)npm i -g jerry-termworks on clean machinePost-Publish
npm i -g jerry-terminstructions