feat(providers): add Zero CLI#2765
Conversation
Greptile SummaryThis PR adds Zero CLI (
Confidence Score: 4/5Safe to merge; the change is a self-contained new provider following well-established patterns with no modifications to shared runtime code. The plugin, registry entries, icon assets, and tests are all internally consistent and mirror how recent providers like letta and mimocode were integrated. The only finding is a minor test-quality gap where a top-level non-null assertion on the registry lookup would produce a confusing error rather than a clear failure if registration ever breaks. packages/plugins/src/agents/impl/zero/index.test.ts — the non-null assertion at the module level could obscure registration failures.
|
| Filename | Overview |
|---|---|
| packages/plugins/src/agents/impl/zero/index.ts | New plugin definition; follows the standard pattern for stateless, keystroke-injection providers with npm dependency detection. |
| packages/plugins/src/agents/impl/zero/index.test.ts | Good coverage of metadata and buildCommand; the top-level non-null assertion on registry lookup means a missing registration would produce a confusing TypeError rather than a clear test failure. |
| apps/emdash-desktop/src/shared/core/agents/agent-provider-registry.ts | Zero entry added consistently with existing providers; flags, install command, and icon path align with the plugin definition. |
| packages/plugins/src/agents/registry.ts | Zero provider imported and registered correctly alongside existing providers. |
| agents/integrations/providers.md | Docs updated to 34 providers (count is correct); also retroactively adds mimocode which was already registered in code but missing from this file. |
| packages/plugins/src/agents/impl/zero/icon.ts | SVG icon asset follows the existing single-variant, light-only pattern used by other providers. |
| apps/emdash-desktop/src/assets/images/zero.svg | SVG icon asset; content matches the inline SVG in icon.ts. |
Sequence Diagram
%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant User
participant Emdash as Emdash Desktop
participant Registry as agent-provider-registry
participant Plugin as zero plugin
participant PTY as PTY session
participant Zero as zero CLI (TUI)
User->>Emdash: Start task with Zero provider
Emdash->>Registry: Lookup 'zero' provider metadata
Registry-->>Emdash: "{cli:'zero', useKeystrokeInjection:true, terminalOnly:true}"
Emdash->>Plugin: buildCommand(ctx)
Plugin-->>Emdash: "{command:'zero', args:[], env:{}}"
Emdash->>PTY: Spawn 'zero' process
PTY->>Zero: Start TUI
Zero-->>PTY: TUI ready
Emdash->>PTY: Inject keystrokes (initialPrompt)
PTY->>Zero: Keystroke delivery
Zero-->>User: Response streamed in terminal
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant User
participant Emdash as Emdash Desktop
participant Registry as agent-provider-registry
participant Plugin as zero plugin
participant PTY as PTY session
participant Zero as zero CLI (TUI)
User->>Emdash: Start task with Zero provider
Emdash->>Registry: Lookup 'zero' provider metadata
Registry-->>Emdash: "{cli:'zero', useKeystrokeInjection:true, terminalOnly:true}"
Emdash->>Plugin: buildCommand(ctx)
Plugin-->>Emdash: "{command:'zero', args:[], env:{}}"
Emdash->>PTY: Spawn 'zero' process
PTY->>Zero: Start TUI
Zero-->>PTY: TUI ready
Emdash->>PTY: Inject keystrokes (initialPrompt)
PTY->>Zero: Keystroke delivery
Zero-->>User: Response streamed in terminal
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
packages/plugins/src/agents/impl/zero/index.test.ts:12-13
If `pluginRegistry.get('zero')` returns `undefined` (e.g., due to a registration error), the top-level non-null assertion fails at module load time with a confusing `TypeError` rather than a clear Vitest assertion failure. Adding an explicit `expect(zero).toBeDefined()` at the start of the first test would make any registration problem immediately obvious.
```suggestion
it('registers install metadata and binary name', () => {
expect(zero).toBeDefined();
expect(zero.metadata.websiteUrl).toBe('https://zero.gitlawb.com/');
```
Reviews (1): Last reviewed commit: "chore(providers): refine Zero descriptio..." | Re-trigger Greptile
Description
Screenshot/Recording (if applicable)
https://cap.link/0cg0vs2aa29m63t
Checklist
messages and, when possible, the PR title