diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e14873..a820337 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v0.5.0 + +### Features + +- Adds support for Cursor CLI. + ## v0.4.1 ### Fixes diff --git a/README.md b/README.md index e5a81a9..b64c92f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # AgentAPI -Control [Claude Code](https://github.com/anthropics/claude-code), [Goose](https://github.com/block/goose), [Aider](https://github.com/Aider-AI/aider), [Gemini](https://github.com/google-gemini/gemini-cli), [Sourcegraph Amp](https://github.com/sourcegraph/amp-cli) and [Codex](https://github.com/openai/codex) with an HTTP API. +Control [Claude Code](https://github.com/anthropics/claude-code), [Goose](https://github.com/block/goose), [Aider](https://github.com/Aider-AI/aider), [Gemini](https://github.com/google-gemini/gemini-cli), [Sourcegraph Amp](https://github.com/sourcegraph/amp-cli), [Codex](https://github.com/openai/codex), and [Cursor CLI](https://cursor.com/en/cli) with an HTTP API. ![agentapi-chat](https://github.com/user-attachments/assets/57032c9f-4146-4b66-b219-09e38ab7690d) @@ -65,7 +65,7 @@ agentapi server -- goose ``` > [!NOTE] -> When using Codex, always specify the agent type explicitly (`agentapi server --type=codex -- codex`), or message formatting may break. +> When using Codex, Gemini or CursorCLI, always specify the agent type explicitly (eg: `agentapi server --type=codex -- codex`), or message formatting may break. An OpenAPI schema is available in [openapi.json](openapi.json). diff --git a/chat/package.json b/chat/package.json index c62474b..b8b3110 100644 --- a/chat/package.json +++ b/chat/package.json @@ -1,6 +1,6 @@ { "name": "chat", - "version": "0.4.1", + "version": "0.5.0", "private": true, "scripts": { "dev": "next dev --turbopack", diff --git a/cmd/server/server.go b/cmd/server/server.go index 93c0541..454030c 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -23,24 +23,28 @@ import ( type AgentType = msgfmt.AgentType const ( - AgentTypeClaude AgentType = msgfmt.AgentTypeClaude - AgentTypeGoose AgentType = msgfmt.AgentTypeGoose - AgentTypeAider AgentType = msgfmt.AgentTypeAider - AgentTypeCodex AgentType = msgfmt.AgentTypeCodex - AgentTypeGemini AgentType = msgfmt.AgentTypeGemini - AgentTypeAmp AgentType = msgfmt.AgentTypeAmp - AgentTypeCustom AgentType = msgfmt.AgentTypeCustom + AgentTypeClaude AgentType = msgfmt.AgentTypeClaude + AgentTypeGoose AgentType = msgfmt.AgentTypeGoose + AgentTypeAider AgentType = msgfmt.AgentTypeAider + AgentTypeCodex AgentType = msgfmt.AgentTypeCodex + AgentTypeGemini AgentType = msgfmt.AgentTypeGemini + AgentTypeAmp AgentType = msgfmt.AgentTypeAmp + AgentTypeCursorAgent AgentType = msgfmt.AgentTypeCursorAgent + AgentTypeCursor AgentType = msgfmt.AgentTypeCursor + AgentTypeCustom AgentType = msgfmt.AgentTypeCustom ) // exhaustiveness of this map is checked by the exhaustive linter var agentTypeMap = map[AgentType]bool{ - AgentTypeClaude: true, - AgentTypeGoose: true, - AgentTypeAider: true, - AgentTypeCodex: true, - AgentTypeGemini: true, - AgentTypeAmp: true, - AgentTypeCustom: true, + AgentTypeClaude: true, + AgentTypeGoose: true, + AgentTypeAider: true, + AgentTypeCodex: true, + AgentTypeGemini: true, + AgentTypeAmp: true, + AgentTypeCursorAgent: true, + AgentTypeCursor: true, + AgentTypeCustom: true, } func parseAgentType(firstArg string, agentTypeVar string) (AgentType, error) { diff --git a/cmd/server/server_test.go b/cmd/server/server_test.go index c09ffb8..92d75f2 100644 --- a/cmd/server/server_test.go +++ b/cmd/server/server_test.go @@ -47,6 +47,16 @@ func TestParseAgentType(t *testing.T) { agentTypeVar: "", want: AgentTypeGemini, }, + { + firstArg: "cursor-agent", + agentTypeVar: "", + want: AgentTypeCursorAgent, + }, + { + firstArg: "cursor", + agentTypeVar: "", + want: AgentTypeCursor, + }, { firstArg: "amp", agentTypeVar: "", @@ -82,6 +92,16 @@ func TestParseAgentType(t *testing.T) { agentTypeVar: "gemini", want: AgentTypeGemini, }, + { + firstArg: "claude", + agentTypeVar: "cursor-agent", + want: AgentTypeCursorAgent, + }, + { + firstArg: "claude", + agentTypeVar: "cursor", + want: AgentTypeCursor, + }, { firstArg: "aider", agentTypeVar: "claude", diff --git a/lib/httpapi/server.go b/lib/httpapi/server.go index 46e1c93..986d071 100644 --- a/lib/httpapi/server.go +++ b/lib/httpapi/server.go @@ -188,7 +188,7 @@ func NewServer(ctx context.Context, config ServerConfig) (*Server, error) { }) router.Use(corsMiddleware.Handler) - humaConfig := huma.DefaultConfig("AgentAPI", "0.4.1") + humaConfig := huma.DefaultConfig("AgentAPI", "0.5.0") humaConfig.Info.Description = "HTTP API for Claude Code, Goose, and Aider.\n\nhttps://github.com/coder/agentapi" api := humachi.New(router, humaConfig) formatMessage := func(message string, userInput string) string { diff --git a/lib/msgfmt/msgfmt.go b/lib/msgfmt/msgfmt.go index ca57dec..a4b830a 100644 --- a/lib/msgfmt/msgfmt.go +++ b/lib/msgfmt/msgfmt.go @@ -140,6 +140,24 @@ func findUserInputEndIdx(userInputStartIdx int, msg []rune, userInput []rune) in return msgIdx } +// skipTrailingInputBoxLine checks if the next line contains all the given markers +// and returns the incremented index if found. In case of Gemini and Cursor, the user +// input is echoed back in a box. This function searches for the markers passed by the +// caller and returns (currentIdx+1, true) if the next line contains all of them, +// otherwise returns (currentIdx, false). +func skipTrailingInputBoxLine(lines []string, currentIdx int, markers ...string) (idx int, found bool) { + if currentIdx+1 >= len(lines) { + return currentIdx, false + } + line := lines[currentIdx+1] + for _, m := range markers { + if !strings.Contains(line, m) { + return currentIdx, false + } + } + return currentIdx + 1, true +} + // RemoveUserInput removes the user input from the message. // Goose, Aider, and Claude Code echo back the user's input to // make it visible in the terminal. This function makes a best effort @@ -149,7 +167,7 @@ func findUserInputEndIdx(userInputStartIdx int, msg []rune, userInput []rune) in // For instance, if there are any leading or trailing lines with only whitespace, // and each line of the input in msgRaw is preceded by a character like `>`, // these lines will not be removed. -func RemoveUserInput(msgRaw string, userInputRaw string) string { +func RemoveUserInput(msgRaw string, userInputRaw string, agentType AgentType) string { if userInputRaw == "" { return msgRaw } @@ -169,9 +187,15 @@ func RemoveUserInput(msgRaw string, userInputRaw string) string { // that doesn't contain the echoed user input. lastUserInputLineIdx := msgRuneLineLocations[userInputEndIdx] - // In case of Gemini, the user input echoed back is wrapped in a rounded box, so we remove it. - if lastUserInputLineIdx+1 < len(msgLines) && strings.Contains(msgLines[lastUserInputLineIdx+1], "╯") && strings.Contains(msgLines[lastUserInputLineIdx+1], "╰") { - lastUserInputLineIdx += 1 + // Skip Gemini/Cursor trailing input box line + if agentType == AgentTypeGemini { + if idx, found := skipTrailingInputBoxLine(msgLines, lastUserInputLineIdx, "╯", "╰"); found { + lastUserInputLineIdx = idx + } + } else if agentType == AgentTypeCursorAgent || agentType == AgentTypeCursor { + if idx, found := skipTrailingInputBoxLine(msgLines, lastUserInputLineIdx, "┘", "└"); found { + lastUserInputLineIdx = idx + } } return strings.Join(msgLines[lastUserInputLineIdx+1:], "\n") @@ -201,24 +225,26 @@ func trimEmptyLines(message string) string { type AgentType string const ( - AgentTypeClaude AgentType = "claude" - AgentTypeGoose AgentType = "goose" - AgentTypeAider AgentType = "aider" - AgentTypeCodex AgentType = "codex" - AgentTypeGemini AgentType = "gemini" - AgentTypeAmp AgentType = "amp" - AgentTypeCustom AgentType = "custom" + AgentTypeClaude AgentType = "claude" + AgentTypeGoose AgentType = "goose" + AgentTypeAider AgentType = "aider" + AgentTypeCodex AgentType = "codex" + AgentTypeGemini AgentType = "gemini" + AgentTypeAmp AgentType = "amp" + AgentTypeCursorAgent AgentType = "cursor-agent" + AgentTypeCursor AgentType = "cursor" + AgentTypeCustom AgentType = "custom" ) -func formatGenericMessage(message string, userInput string) string { - message = RemoveUserInput(message, userInput) +func formatGenericMessage(message string, userInput string, agentType AgentType) string { + message = RemoveUserInput(message, userInput, agentType) message = removeMessageBox(message) message = trimEmptyLines(message) return message } func formatCodexMessage(message string, userInput string) string { - message = RemoveUserInput(message, userInput) + message = RemoveUserInput(message, userInput, AgentTypeCodex) message = removeCodexInputBox(message) message = trimEmptyLines(message) return message @@ -227,19 +253,23 @@ func formatCodexMessage(message string, userInput string) string { func FormatAgentMessage(agentType AgentType, message string, userInput string) string { switch agentType { case AgentTypeClaude: - return formatGenericMessage(message, userInput) + return formatGenericMessage(message, userInput, agentType) case AgentTypeGoose: - return formatGenericMessage(message, userInput) + return formatGenericMessage(message, userInput, agentType) case AgentTypeAider: - return formatGenericMessage(message, userInput) + return formatGenericMessage(message, userInput, agentType) case AgentTypeCodex: return formatCodexMessage(message, userInput) case AgentTypeGemini: - return formatGenericMessage(message, userInput) + return formatGenericMessage(message, userInput, agentType) case AgentTypeAmp: - return formatGenericMessage(message, userInput) + return formatGenericMessage(message, userInput, agentType) + case AgentTypeCursorAgent: + return formatGenericMessage(message, userInput, agentType) + case AgentTypeCursor: + return formatGenericMessage(message, userInput, agentType) case AgentTypeCustom: - return formatGenericMessage(message, userInput) + return formatGenericMessage(message, userInput, agentType) default: return message } diff --git a/lib/msgfmt/msgfmt_test.go b/lib/msgfmt/msgfmt_test.go index 837ff52..404371e 100644 --- a/lib/msgfmt/msgfmt_test.go +++ b/lib/msgfmt/msgfmt_test.go @@ -188,7 +188,7 @@ func TestRemoveUserInput(t *testing.T) { assert.NoError(t, err) expected, err := testdataDir.ReadFile(path.Join(dir, c.Name(), "expected.txt")) assert.NoError(t, err) - assert.Equal(t, string(expected), RemoveUserInput(string(msg), string(userInput))) + assert.Equal(t, string(expected), RemoveUserInput(string(msg), string(userInput), AgentTypeCustom)) }) } } diff --git a/lib/msgfmt/testdata/format/cursor/confirmation_box/expected.txt b/lib/msgfmt/testdata/format/cursor/confirmation_box/expected.txt new file mode 100644 index 0000000..2e4162f --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/confirmation_box/expected.txt @@ -0,0 +1,19 @@ + I'll check the repository's root, name, remotes, and current branch. + + + + + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ $ git rev-parse --show-toplevel in . │ + │ $ basename "$(git rev-parse --show-toplevel)" in . │ + │ $ git remote -v in . │ + │ $ git rev-parse --abbrev-ref HEAD in . │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ Run this command? │ + │ Not in allowlist: git │ + │ → Run (y) (enter) │ + │ Reject (esc or p) │ + │ Add Shell(git) to allowlist? (tab) │ + │ Auto-run all commands (shift+tab) │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ \ No newline at end of file diff --git a/lib/msgfmt/testdata/format/cursor/confirmation_box/msg.txt b/lib/msgfmt/testdata/format/cursor/confirmation_box/msg.txt new file mode 100644 index 0000000..1df8d24 --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/confirmation_box/msg.txt @@ -0,0 +1,26 @@ + Cursor Agent + ~/Documents/work/agentapi · feat-cursor-cli + + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ Which repo is this ? │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + + I'll check the repository's root, name, remotes, and current branch. + + + + + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ $ git rev-parse --show-toplevel in . │ + │ $ basename "$(git rev-parse --show-toplevel)" in . │ + │ $ git remote -v in . │ + │ $ git rev-parse --abbrev-ref HEAD in . │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ Run this command? │ + │ Not in allowlist: git │ + │ → Run (y) (enter) │ + │ Reject (esc or p) │ + │ Add Shell(git) to allowlist? (tab) │ + │ Auto-run all commands (shift+tab) │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ \ No newline at end of file diff --git a/lib/msgfmt/testdata/format/cursor/confirmation_box/user.txt b/lib/msgfmt/testdata/format/cursor/confirmation_box/user.txt new file mode 100644 index 0000000..c7d3776 --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/confirmation_box/user.txt @@ -0,0 +1 @@ +Which repo is this ? \ No newline at end of file diff --git a/lib/msgfmt/testdata/format/cursor/first_message/expected.txt b/lib/msgfmt/testdata/format/cursor/first_message/expected.txt new file mode 100644 index 0000000..ed79526 --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/first_message/expected.txt @@ -0,0 +1,11 @@ + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ ⬢ Welcome to Cursor Agent Beta │ + │ │ + │ Cursor Agent CLI is in beta. Security safeguards are still evolving. It can read, modify, and delete files, and execute shell commands you approve. Use at your own risk and only in trusted environments. │ + │ │ + │ Please read about our security at https://cursor.com/security. │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + + + Cursor Agent + ~/Documents/work/agentapi · feat-cursor-cli \ No newline at end of file diff --git a/lib/msgfmt/testdata/format/cursor/first_message/msg.txt b/lib/msgfmt/testdata/format/cursor/first_message/msg.txt new file mode 100644 index 0000000..c560cda --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/first_message/msg.txt @@ -0,0 +1,19 @@ + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ ⬢ Welcome to Cursor Agent Beta │ + │ │ + │ Cursor Agent CLI is in beta. Security safeguards are still evolving. It can read, modify, and delete files, and execute shell commands you approve. Use at your own risk and only in trusted environments. │ + │ │ + │ Please read about our security at https://cursor.com/security. │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + + + Cursor Agent + ~/Documents/work/agentapi · feat-cursor-cli + + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ → Plan, search, build anything │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + + OpenAI GPT-5 + / for commands · @ for files + diff --git a/lib/msgfmt/testdata/format/cursor/first_message/user.txt b/lib/msgfmt/testdata/format/cursor/first_message/user.txt new file mode 100644 index 0000000..e69de29 diff --git a/lib/msgfmt/testdata/format/cursor/multi-line-input/expected.txt b/lib/msgfmt/testdata/format/cursor/multi-line-input/expected.txt new file mode 100644 index 0000000..727c753 --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/multi-line-input/expected.txt @@ -0,0 +1,24 @@ + I’m going to search the codebase for the function name and related identifiers to locate the file containing that snippet. + + ⬢ Searched 4 searches + … 1 earlier item hidden + Searched "removeCodexInputBox" in . + Searched "RemoveUserInput\(" in . + Searched "trimEmptyLines\(" in . + + Scanning relevant Go files to confirm the exact location and provide a precise citation. + + ⬢ Read lib/msgfmt/msgfmt.go + + It’s in lib/msgfmt/msgfmt.go. + + lib/msgfmt/msgfmt.go lines 235-240 + + 235 │ func formatCodexMessage(message string, userInput string) string { + 236 │ message = RemoveUserInput(message, userInput) + 237 │ message = removeCodexInputBox(message) + 238 │ message = trimEmptyLines(message) + 239 │ return message + 240 │ } + + • Found in lib/msgfmt/msgfmt.go (lines 235–240). \ No newline at end of file diff --git a/lib/msgfmt/testdata/format/cursor/multi-line-input/msg.txt b/lib/msgfmt/testdata/format/cursor/multi-line-input/msg.txt new file mode 100644 index 0000000..5cc4417 --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/multi-line-input/msg.txt @@ -0,0 +1,48 @@ + Cursor Agent + ~/Documents/work/agentapi · feat-cursor-cli + + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ Which file has this snippet │ + │ func formatCodexMessage(message string, userInput string) string { │ + │ message = RemoveUserInput(message, userInput) │ + │ message = removeCodexInputBox(message) │ + │ message = trimEmptyLines(message) │ + │ return message │ + │ } │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + + I’m going to search the codebase for the function name and related identifiers to locate the file containing that snippet. + + ⬢ Searched 4 searches + … 1 earlier item hidden + Searched "removeCodexInputBox" in . + Searched "RemoveUserInput\(" in . + Searched "trimEmptyLines\(" in . + + Scanning relevant Go files to confirm the exact location and provide a precise citation. + + ⬢ Read lib/msgfmt/msgfmt.go + + It’s in lib/msgfmt/msgfmt.go. + + lib/msgfmt/msgfmt.go lines 235-240 + + 235 │ func formatCodexMessage(message string, userInput string) string { + 236 │ message = RemoveUserInput(message, userInput) + 237 │ message = removeCodexInputBox(message) + 238 │ message = trimEmptyLines(message) + 239 │ return message + 240 │ } + + • Found in lib/msgfmt/msgfmt.go (lines 235–240). + + + + + + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ → Add a follow-up │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + + OpenAI GPT-5 + / for commands · @ for files diff --git a/lib/msgfmt/testdata/format/cursor/multi-line-input/user.txt b/lib/msgfmt/testdata/format/cursor/multi-line-input/user.txt new file mode 100644 index 0000000..e85fa2a --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/multi-line-input/user.txt @@ -0,0 +1,7 @@ +Which file has this snippet +func formatCodexMessage(message string, userInput string) string { + message = RemoveUserInput(message, userInput) + message = removeCodexInputBox(message) + message = trimEmptyLines(message) + return message +} \ No newline at end of file diff --git a/lib/msgfmt/testdata/format/cursor/second_message/expected.txt b/lib/msgfmt/testdata/format/cursor/second_message/expected.txt new file mode 100644 index 0000000..c166795 --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/second_message/expected.txt @@ -0,0 +1,9 @@ + I’m going to check the current repository for untracked files and count them. + + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ $ git ls-files --others --exclude-standard | wc -l 16ms in current dir │ + │ │ + │ 17 │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + + 17 \ No newline at end of file diff --git a/lib/msgfmt/testdata/format/cursor/second_message/msg.txt b/lib/msgfmt/testdata/format/cursor/second_message/msg.txt new file mode 100644 index 0000000..1e76f20 --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/second_message/msg.txt @@ -0,0 +1,27 @@ + Cursor Agent + ~/Documents/work/agentapi · feat-cursor-cli + + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ How many untracked files are there? │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + + I’m going to check the current repository for untracked files and count them. + + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ $ git ls-files --others --exclude-standard | wc -l 16ms in current dir │ + │ │ + │ 17 │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + + 17 + + + + + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ → Add a follow-up │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + ▶︎ Auto-run all commands (shift+tab to turn off) + + OpenAI GPT-5 + / for commands · @ for files diff --git a/lib/msgfmt/testdata/format/cursor/second_message/user.txt b/lib/msgfmt/testdata/format/cursor/second_message/user.txt new file mode 100644 index 0000000..f739c91 --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/second_message/user.txt @@ -0,0 +1 @@ +How many untracked files are there? \ No newline at end of file diff --git a/lib/msgfmt/testdata/format/cursor/thinking/expected.txt b/lib/msgfmt/testdata/format/cursor/thinking/expected.txt new file mode 100644 index 0000000..c0c75aa --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/thinking/expected.txt @@ -0,0 +1 @@ + ⬡ Thinking. 172 tokens \ No newline at end of file diff --git a/lib/msgfmt/testdata/format/cursor/thinking/msg.txt b/lib/msgfmt/testdata/format/cursor/thinking/msg.txt new file mode 100644 index 0000000..0975dfb --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/thinking/msg.txt @@ -0,0 +1,17 @@ + Cursor Agent + ~/Documents/work/agentapi · feat-cursor-cli + + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ Which repo is this ? │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + + + + + ⬡ Thinking. 172 tokens + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐ + │ → Add a follow-up ctrl+c to stop │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + + OpenAI GPT-5 + / for commands · @ for files \ No newline at end of file diff --git a/lib/msgfmt/testdata/format/cursor/thinking/user.txt b/lib/msgfmt/testdata/format/cursor/thinking/user.txt new file mode 100644 index 0000000..c7d3776 --- /dev/null +++ b/lib/msgfmt/testdata/format/cursor/thinking/user.txt @@ -0,0 +1 @@ +Which repo is this ? \ No newline at end of file diff --git a/openapi.json b/openapi.json index e9193f5..b79f9c9 100644 --- a/openapi.json +++ b/openapi.json @@ -307,7 +307,7 @@ "info": { "description": "HTTP API for Claude Code, Goose, and Aider.\n\nhttps://github.com/coder/agentapi", "title": "AgentAPI", - "version": "0.4.1" + "version": "0.5.0" }, "openapi": "3.1.0", "paths": {