Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
charm.land/bubbles/v2 v2.2.1
charm.land/bubbletea/v2 v2.0.9
charm.land/lipgloss/v2 v2.0.6
github.com/basecamp/basecamp-sdk/go v0.19.0
github.com/basecamp/basecamp-sdk/go v0.21.0
github.com/basecamp/cli v0.2.2-0.20260828230226-767413fc712d
github.com/basecamp/mcp v0.0.0-20260828100356-2d6f44b51e9d
github.com/basecamp/surfguard/go v0.1.0
Expand Down Expand Up @@ -41,6 +41,7 @@ require (
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/basecamp/actioncable-go v1.2.0 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/catppuccin/go v0.3.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
Expand All @@ -55,7 +56,6 @@ require (
github.com/charmbracelet/x/windows v0.2.2 // indirect
github.com/clipperhouse/displaywidth v0.11.0 // indirect
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
github.com/coder/websocket v1.8.15 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20241213102144-19d51d7fe467 // indirect
github.com/danieljoos/wincred v1.2.3 // indirect
github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ github.com/aymanbagabas/go-udiff v0.4.1 h1:OEIrQ8maEeDBXQDoGCbbTTXYJMYRCRO1fnodZ
github.com/aymanbagabas/go-udiff v0.4.1/go.mod h1:0L9PGwj20lrtmEMeyw4WKJ/TMyDtvAoK9bf2u/mNo3w=
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/basecamp/basecamp-sdk/go v0.19.0 h1:byygVVbJnWCZsyBNeAlztlUAV23ytLEhPx98WakNy+c=
github.com/basecamp/basecamp-sdk/go v0.19.0/go.mod h1:kIBDYwPMMD59PadNGxpH0YTQuI+blFPZ8MelGI0RK5Q=
github.com/basecamp/actioncable-go v1.2.0 h1:t0MxlfMTcmaGXZ5ztgKRs7ZiY1MwXtBRwSSSAh1ofVg=
github.com/basecamp/actioncable-go v1.2.0/go.mod h1:ezaV5z1GXQAsqyejqTs6wCFl2D8Wj+COLQkHc/kwoRs=
github.com/basecamp/basecamp-sdk/go v0.21.0 h1:yWBD7tJRmyLzxC8yppYC4sXJ9XSWfsdDPU5fyUjVYKA=
github.com/basecamp/basecamp-sdk/go v0.21.0/go.mod h1:BczT5BZq4rf9LFc2DjXUZoxu7/f4tWIZjFxIV2CttDI=
github.com/basecamp/cli v0.2.2-0.20260828230226-767413fc712d h1:jAzDrCCzDpIwhbFT1xVVs0z2xpXoDEkomHfKB2bUUp8=
github.com/basecamp/cli v0.2.2-0.20260828230226-767413fc712d/go.mod h1:iTBTaWvsPEFIcZfkxQHEfISyJ6sZ7036K6bNx0RY3EE=
github.com/basecamp/mcp v0.0.0-20260828100356-2d6f44b51e9d h1:zEQVGq1x1nhKMZ2TudFAcSJ32CHT8richI1vQakIKz4=
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func newTemplatesLibraryCmd() *cobra.Command {
app.Config.AccountID,
)

library, err := app.Account().Templates().GetLibrary(cmd.Context())
library, err := app.Account().Templates().GetLibraryTodolists(cmd.Context())
if err != nil {
return convertSDKError(err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/commands/templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func decodeTemplateEnvelope(t *testing.T, buf *bytes.Buffer) struct {
func TestTemplatesLibraryUsesSDKLibraryEndpoint(t *testing.T) {
app, transport := setupRecordingTestApp(t, stubRoute{
method: http.MethodGet,
path: "/99999/template_library.json",
path: "/99999/template_library/todolists.json",
status: http.StatusOK,
body: templateLibraryJSON,
})
Expand All @@ -81,7 +81,7 @@ func TestTemplatesLibraryUsesSDKLibraryEndpoint(t *testing.T) {

request := transport.last(t)
assert.Equal(t, http.MethodGet, request.Method)
assert.Equal(t, "/99999/template_library.json", request.Path)
assert.Equal(t, "/99999/template_library/todolists.json", request.Path)
envelope := decodeTemplateEnvelope(t, buf)
assert.Equal(t, "1 active to-do list templates", envelope.Summary)
require.Len(t, envelope.Breadcrumbs, 1)
Expand All @@ -91,7 +91,7 @@ func TestTemplatesLibraryUsesSDKLibraryEndpoint(t *testing.T) {
func TestTemplatesLibraryHumanOutputShowsCopyableID(t *testing.T) {
app, _ := setupRecordingTestApp(t, stubRoute{
method: http.MethodGet,
path: "/99999/template_library.json",
path: "/99999/template_library/todolists.json",
status: http.StatusOK,
body: templateLibraryJSON,
})
Expand Down
4 changes: 2 additions & 2 deletions internal/mcpserver/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestCatalogExcludesUnservedOperations(t *testing.T) {
assert.False(t, excluded[op.ID], "operation %q should be excluded from the vendored model", op.ID)
}
}
assert.Equal(t, 261, model, "served model operation count")
assert.Equal(t, 274, model, "served model operation count")
assert.Equal(t, 1, composite, "served composite operation count")
}

Expand Down Expand Up @@ -212,7 +212,7 @@ func TestCatalogPaginatedActionsTakePage(t *testing.T) {
assert.Equal(t, 1, pages, "operation %q must declare exactly one page query parameter", op.ID)
}
}
assert.Equal(t, 61, link, "Link-style paginated operation count")
assert.Equal(t, 62, link, "Link-style paginated operation count")
}

// TestCatalogCursorPaginatedActionsTakeNoPage pins the other half. A
Expand Down
8 changes: 4 additions & 4 deletions internal/mcpserver/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var DomainSpecs = []catalog.DomainSpec{
},
{
Key: "todos",
Tags: []string{"Todos"},
Blurb: "Todos, todolists, todolist groups, and todosets — plus each todolist's hill chart.",
Tags: []string{"Todos", "Subtasks"},
Blurb: "Todos, todolists, todolist groups, and todosets — plus each todolist's hill chart, and the subtasks on to-dos and cards.",
},
{
Key: "cards",
Expand Down Expand Up @@ -66,8 +66,8 @@ var DomainSpecs = []catalog.DomainSpec{
},
{
Key: "automation",
Tags: []string{"Automation", "Checkins"},
Blurb: "Automatic check-ins (questionnaires, questions, answers, reminders), project templates, webhooks, lineup markers, dock tools, recording lifecycle (archive/trash), change events, and search.",
Tags: []string{"Checkins", "Templates", "Webhooks", "Lineup", "Dock", "Recordings", "Search"},
Blurb: "Automatic check-ins (questionnaires, questions, answers, reminders), project templates and the template library, webhooks, lineup markers, dock tools, recording lifecycle (archive/trash), change events, and search.",
},
{
Key: "reports",
Expand Down
21 changes: 13 additions & 8 deletions internal/mcpserver/feed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ func TestFeedTellsTheTwo400sApart(t *testing.T) {
name: "a reason this code does not know is not guessed at through the sentence",
action: "poll_events",
body: `{"error":"Unrecognized position. Resume with since=now.","reason":"invalid_cursor_epoch"}`,
want: "bad_request",
// A reason the contract doesn't name makes the body malformed
// (SDK v0.21.0): refused, not classified.
want: "request_failed",
},
}
for _, tc := range cases {
Expand Down Expand Up @@ -557,9 +559,10 @@ func TestFeedGoneWithoutAnEpochIsNotAStalePosition(t *testing.T) {
text, isError := callFeed(t, session, "poll_events", map[string]any{"position": "stale"})
require.True(t, isError, text)

// The SDK (v0.21.0) calls a 410 without its epoch malformed, and reports
// it without a status to act on.
detail := feedErrorOf(t, text)
assert.Equal(t, "request_failed", detail["type"])
assert.Equal(t, float64(http.StatusGone), detail["http_status"])
assert.NotContains(t, detail, "data", "no epoch, so no recovery is claimed")
}

Expand Down Expand Up @@ -657,11 +660,14 @@ func TestFeedDoesNotReadARemedyOutOfAForeign400(t *testing.T) {

text, isError := callFeed(t, session, "poll_events", map[string]any{"position": "aBcD"})
require.True(t, isError, text)
assert.Equal(t, "bad_request", feedErrorOf(t, text)["type"])
// Without the feed's own `error` member the SDK (v0.21.0) calls the 400
// malformed: refused, not classified.
assert.Equal(t, "request_failed", feedErrorOf(t, text)["type"])
}

// The refusals the SDK leaves untyped land somewhere honest: their status, no
// recovery claimed, and no recovery data invented.
// The refusals the SDK leaves untyped land somewhere honest: no recovery
// claimed, and no recovery data invented. The SDK (v0.21.0) calls these
// bodies malformed and reports them without a status.
func TestFeedUntypedRefusalsClaimNoRecovery(t *testing.T) {
cases := []struct {
name string
Expand All @@ -682,19 +688,18 @@ func TestFeedUntypedRefusalsClaimNoRecovery(t *testing.T) {

detail := feedErrorOf(t, text)
assert.Equal(t, "request_failed", detail["type"])
assert.Equal(t, float64(tc.status), detail["http_status"])
assert.NotContains(t, detail, "data", "no recovery was offered, so none is claimed")
})
}
t.Run("a 409 on the inbox with both digests is a filter mismatch there too", func(t *testing.T) {
session := feedSession(t, http.StatusConflict,
`{"error":"filters changed","position_digest":"abc123","filters_digest":"def456"}`, nil)
`{"error":"filters changed","position_digest":"0123456789abcdef","filters_digest":"fedcba9876543210"}`, nil)

text, isError := callFeed(t, session, "poll_inbox", map[string]any{"position": "aBcD"})
require.True(t, isError, text)
detail := feedErrorOf(t, text)
assert.Equal(t, "filter_mismatch", detail["type"])
assert.Equal(t, map[string]any{"position_digest": "abc123", "filters_digest": "def456"}, detail["data"])
assert.Equal(t, map[string]any{"position_digest": "0123456789abcdef", "filters_digest": "fedcba9876543210"}, detail["data"])
})
}

Expand Down
4 changes: 2 additions & 2 deletions internal/mcpserver/model/PROVENANCE.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"source": "github.com/basecamp/basecamp-sdk",
"commit": "6abe227204a465ced72969f10e32d3a06e77bcc1",
"ref": "go/v0.19.0",
"commit": "2e4395950e18aaf4bbf6e2e10511ad6b66f95524",
"ref": "go/v0.21.0",
"files": ["behavior-model.json", "openapi.json"],
"synced_by": "scripts/sync-mcp-model.sh",
"patches": "binary-upload operations dropped because the toolkit refuses their non-JSON bodies (EXCLUDED_OPERATIONS) and the stream-ticket mint dropped by policy (POLICY_EXCLUDED_OPERATIONS); no tag patches applied (PATCHED_TAGS is empty — the export tags every operation) — see the sync script"
Expand Down
Loading
Loading