Files
devvm/internal/cli/docblocks_test.go
d349868c31 feat(agents): one definition per coding agent, and Cursor's CLI
Every list of the coding agents now derives from internal/agents'
registry, one Def each, and Cursor's CLI (cursor-agent) is a fifth
agent.

The registry:
- each agent's login command, login formats and capture on its Def;
  one message for every agent where each had its own
- the agents' table, the README's list and the docs' history lists are
  generated from the registry (cli.DocBlocks, TestDocBlocks); scripts
  and Go tests take their lists from it too
- each agent's own code lives in a file named for it; the structure
  test lets only an agent's own files choose by its name, following
  constants named after an agent
- a VM remade by clone on/off keeps no agent's login files
  (agents.LoginFiles from every Def.Logins; Claude Code's .claude.json
  stays, as it is also history)

Cursor's CLI:
- `devvm --agents cursor`, `devvm agent login cursor`, history import
  and export of ~/.cursor/chats
- the proxy captures its login at a GET endpoint, guards a shared host
  by path, and puts the login in only where the CLI sends it, bound to
  the CLI's 57 methods
- account changes and the agent store are refused in a VM; Cursor's
  headers and trailers are scanned for tokens
- e2e: Cursor's CLI in the network section, its poll behind the fake
  company proxy

Docs: the agents' pages lead with commands, with a How it works page
for the agents.

Co-authored-by: JB <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-12 11:49:48 -07:00

36 lines
1013 B
Go

package cli
import (
"strings"
"testing"
"github.com/devvmhq/devvm/assets"
"github.com/devvmhq/devvm/internal/agents"
)
// Each generated block builds from devvm's own files, between markers that name it, and the
// agents' history names every agent's history path, Cursor's chats included.
func TestDocBlocks(t *testing.T) {
for _, b := range DocBlocks() {
text, err := b.Text(assets.FS)
if err != nil || strings.TrimSpace(text) == "" {
t.Errorf("%s on %s: %q, %v", b.Name, b.Page, text, err)
}
if !strings.Contains(b.Begin(), b.Name) || !strings.Contains(b.End(), b.Name) {
t.Errorf("%s's markers: %s %s", b.Name, b.Begin(), b.End())
}
}
history, err := historyList(assets.FS)
if err != nil {
t.Fatal(err)
}
for _, p := range agents.History() {
if !strings.Contains(history, "`~/"+p+"`") {
t.Errorf("the history list has no %s: %s", p, history)
}
}
if !strings.Contains(history, "`~/.cursor/chats`") {
t.Errorf("the history list has no Cursor chats: %s", history)
}
}