diff --git a/CHANGELOG.md b/CHANGELOG.md index a820337..626fd5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 0.6.1 + +### Features +- Handle animation on Amp cli start screen. + +## v0.6.0 + +### Features + +- Adds support for Auggie CLI. + ## v0.5.0 ### Features diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 0000000..3fbc5af --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,37 @@ +# Information for Maintainers + +## Release Process + +Before performing a release, perform a local "smoke-test". +If everything seems OK, you can proceed to do the following: + +1. Update the version string in the following places: + - `openapi.json` + - `chat/package.json` + - `lib/httpapi/server.go` +2. Add details in `CHANGELOG.md` on what changed. +3. Create a PR with the subject `chore: update version to X.Y.Z` +4. Once the above PR is approved and merged, create a new git tag `vX.Y.Z` pointing to the commit of the above PR merged to `main`:S + + ```shell + # Fetch existing tags first! + git fetch --tags + git tag -a vX.Y.Z -m 'vX.Y.Z' + ``` + +5. Push the tag: + + ```shell + git push origin tag vX.Y.Z + ``` + +6. Visit `https://github.com/coder/agentapi/releases/tag/vX.Y.Z` and "Create release from tag". + + - Select the tag you pushed previously. + - Select the previous tag and "Generate release notes". Amend as required. + - **IMPORTANT:** un-check "Set as latest release" and check "Set as a pre-release". + - Click "Publish Release". This will trigger a "Build Release Binaries" CI job. + +7. Visit `https://github.com/coder/agentapi/actions/workflows/release.yml` and monitor the status of the job that was created in the previous step. This will upload the built assets to the corresponding release. + +8. Once the updated assets are released, you can now visit `https://github.com/coder/agentapi/releases/tag/vX.Y.Z`, click "Edit" (✎), and check "Set as latest release". diff --git a/README.md b/README.md index 3f45478..6bfb02a 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ agentapi server -- goose ``` > [!NOTE] -> When using Codex, Gemini or CursorCLI, always specify the agent type explicitly (eg: `agentapi server --type=codex -- codex`), or message formatting may break. +> When using Codex, Gemini, Amp 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 b8b3110..d6411ce 100644 --- a/chat/package.json +++ b/chat/package.json @@ -1,6 +1,6 @@ { "name": "chat", - "version": "0.5.0", + "version": "0.6.1", "private": true, "scripts": { "dev": "next dev --turbopack", diff --git a/chat/src/components/message-list.tsx b/chat/src/components/message-list.tsx index 75c6ade..d675a85 100644 --- a/chat/src/components/message-list.tsx +++ b/chat/src/components/message-list.tsx @@ -127,7 +127,7 @@ export default function MessageList({ messages }: MessageListProps) { {message.role !== "user" && message.content === "" ? ( ) : ( - message.content.trim() + message.content.trimEnd() )} diff --git a/cmd/server/server.go b/cmd/server/server.go index acdbc54..33c294e 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -94,6 +94,7 @@ func runServer(ctx context.Context, logger *slog.Logger, argsToPass []string) er ProgramArgs: argsToPass[1:], TerminalWidth: termWidth, TerminalHeight: termHeight, + AgentType: agentType, }) if err != nil { return xerrors.Errorf("failed to setup process: %w", err) diff --git a/go.mod b/go.mod index b4212f0..5250f4f 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( require ( github.com/fsnotify/fsnotify v1.8.0 // indirect - github.com/go-viper/mapstructure/v2 v2.3.0 // indirect + github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/sagikazarmark/locafero v0.7.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect diff --git a/go.sum b/go.sum index afb727f..3406c1a 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/go-chi/chi/v5 v5.2.2 h1:CMwsvRVTbXVytCk1Wd72Zy1LAsAh9GxMmSNWLHCG618= github.com/go-chi/chi/v5 v5.2.2/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58= -github.com/go-viper/mapstructure/v2 v2.3.0 h1:27XbWsHIqhbdR5TIC911OfYvgSaW93HM+dX7970Q7jk= -github.com/go-viper/mapstructure/v2 v2.3.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= +github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= diff --git a/lib/httpapi/server.go b/lib/httpapi/server.go index 986d071..2d25fca 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.5.0") + humaConfig := huma.DefaultConfig("AgentAPI", "0.6.1") 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/httpapi/setup.go b/lib/httpapi/setup.go index 8328991..1620304 100644 --- a/lib/httpapi/setup.go +++ b/lib/httpapi/setup.go @@ -10,6 +10,7 @@ import ( "time" "github.com/coder/agentapi/lib/logctx" + mf "github.com/coder/agentapi/lib/msgfmt" "github.com/coder/agentapi/lib/termexec" ) @@ -18,6 +19,7 @@ type SetupProcessConfig struct { ProgramArgs []string TerminalWidth uint16 TerminalHeight uint16 + AgentType mf.AgentType } func SetupProcess(ctx context.Context, config SetupProcessConfig) (*termexec.Process, error) { @@ -36,6 +38,14 @@ func SetupProcess(ctx context.Context, config SetupProcessConfig) (*termexec.Pro os.Exit(1) } + // Hack for sourcegraph amp to stop the animation. + if config.AgentType == mf.AgentTypeAmp { + _, err = process.Write([]byte(" \b")) + if err != nil { + return nil, err + } + } + // Handle SIGINT (Ctrl+C) and send it to the process signalCh := make(chan os.Signal, 1) signal.Notify(signalCh, os.Interrupt, syscall.SIGTERM) diff --git a/openapi.json b/openapi.json index b79f9c9..d87c9b0 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.5.0" + "version": "0.6.1" }, "openapi": "3.1.0", "paths": {