on main help sign in
feat: add generated swagger docs and serve them in the server
commit248d8b99c6f9332aa1b5a0f71b27d76011e83331 authorAyman Bagabas <ayman.bagabas@gmail.com> dateTue 17 Mar 2026, 14:27 (7 months ago) parent6dcaab1
5 files changed+9519−5
Taskfile.yaml+4−4 internal/server/server.go+1−1 internal/swagger/docs.go+3589 internal/swagger/swagger.json+3564 internal/swagger/swagger.yaml+2361
Taskfile.yaml+4−4
@@ -188,15 +188,15 @@ tasks:
188188 swag:
189189 desc: Generate OpenAPI spec from swag annotations
190190 cmds:
191− - go run github.com/swaggo/swag/cmd/swag@v1.16.6 init --generalInfo main.go --dir . --output docs --parseDependency --parseInternal --parseDepth 5
191+ - go run github.com/swaggo/swag/cmd/swag@v1.16.6 init --generalInfo main.go --dir . --output internal/swagger --packageName swagger --parseDependency --parseInternal --parseDepth 5
192192 sources:
193193 - internal/server/*.go
194194 - internal/proto/*.go
195195 - main.go
196196 generates:
197− - docs/docs.go
198− - docs/swagger.json
199− - docs/swagger.yaml
197+ - internal/swagger/docs.go
198+ - internal/swagger/swagger.json
199+ - internal/swagger/swagger.yaml
200200
201201 sqlc:
202202 desc: Generate code using SQLC
internal/server/server.go+1−1
@@ -11,7 +11,7 @@ import (
1111 "runtime"
1212 "strings"
1313
14− _ "github.com/charmbracelet/crush/docs"
14+ _ "github.com/charmbracelet/crush/internal/swagger"
1515 "github.com/charmbracelet/crush/internal/backend"
1616 "github.com/charmbracelet/crush/internal/config"
1717 httpswagger "github.com/swaggo/http-swagger/v2"
internal/swagger/docs.gonew file+3589
@@ -0,0 +1,3589 @@
1+// Package swagger Code generated by swaggo/swag. DO NOT EDIT
2+package swagger
3+
4+import "github.com/swaggo/swag"
5+
6+const docTemplate = `{
7+ "schemes": {{ marshal .Schemes }},
8+ "swagger": "2.0",
9+ "info": {
10+ "description": "{{escape .Description}}",
11+ "title": "{{.Title}}",
12+ "contact": {
13+ "name": "Charm",
14+ "url": "https://charm.sh"
15+ },
16+ "license": {
17+ "name": "MIT",
18+ "url": "https://github.com/charmbracelet/crush/blob/main/LICENSE"
19+ },
20+ "version": "{{.Version}}"
21+ },
22+ "host": "{{.Host}}",
23+ "basePath": "{{.BasePath}}",
24+ "paths": {
25+ "/config": {
26+ "get": {
27+ "produces": [
28+ "application/json"
29+ ],
30+ "tags": [
31+ "system"
32+ ],
33+ "summary": "Get server config",
34+ "responses": {
35+ "200": {
36+ "description": "OK",
37+ "schema": {
38+ "type": "object"
39+ }
40+ }
41+ }
42+ }
43+ },
44+ "/control": {
45+ "post": {
46+ "consumes": [
47+ "application/json"
48+ ],
49+ "tags": [
50+ "system"
51+ ],
52+ "summary": "Send server control command",
53+ "parameters": [
54+ {
55+ "description": "Control command (e.g. shutdown)",
56+ "name": "request",
57+ "in": "body",
58+ "required": true,
59+ "schema": {
60+ "$ref": "#/definitions/proto.ServerControl"
61+ }
62+ }
63+ ],
64+ "responses": {
65+ "200": {
66+ "description": "OK"
67+ },
68+ "400": {
69+ "description": "Bad Request",
70+ "schema": {
71+ "$ref": "#/definitions/proto.Error"
72+ }
73+ }
74+ }
75+ }
76+ },
77+ "/health": {
78+ "get": {
79+ "tags": [
80+ "system"
81+ ],
82+ "summary": "Health check",
83+ "responses": {
84+ "200": {
85+ "description": "OK"
86+ }
87+ }
88+ }
89+ },
90+ "/version": {
91+ "get": {
92+ "produces": [
93+ "application/json"
94+ ],
95+ "tags": [
96+ "system"
97+ ],
98+ "summary": "Get server version",
99+ "responses": {
100+ "200": {
101+ "description": "OK",
102+ "schema": {
103+ "$ref": "#/definitions/proto.VersionInfo"
104+ }
105+ }
106+ }
107+ }
108+ },
109+ "/workspaces": {
110+ "get": {
111+ "produces": [
112+ "application/json"
113+ ],
114+ "tags": [
115+ "workspaces"
116+ ],
117+ "summary": "List workspaces",
118+ "responses": {
119+ "200": {
120+ "description": "OK",
121+ "schema": {
122+ "type": "array",
123+ "items": {
124+ "$ref": "#/definitions/proto.Workspace"
125+ }
126+ }
127+ }
128+ }
129+ },
130+ "post": {
131+ "consumes": [
132+ "application/json"
133+ ],
134+ "produces": [
135+ "application/json"
136+ ],
137+ "tags": [
138+ "workspaces"
139+ ],
140+ "summary": "Create workspace",
141+ "parameters": [
142+ {
143+ "description": "Workspace creation params",
144+ "name": "request",
145+ "in": "body",
146+ "required": true,
147+ "schema": {
148+ "$ref": "#/definitions/proto.Workspace"
149+ }
150+ }
151+ ],
152+ "responses": {
153+ "200": {
154+ "description": "OK",
155+ "schema": {
156+ "$ref": "#/definitions/proto.Workspace"
157+ }
158+ },
159+ "400": {
160+ "description": "Bad Request",
161+ "schema": {
162+ "$ref": "#/definitions/proto.Error"
163+ }
164+ },
165+ "500": {
166+ "description": "Internal Server Error",
167+ "schema": {
168+ "$ref": "#/definitions/proto.Error"
169+ }
170+ }
171+ }
172+ }
173+ },
174+ "/workspaces/{id}": {
175+ "get": {
176+ "produces": [
177+ "application/json"
178+ ],
179+ "tags": [
180+ "workspaces"
181+ ],
182+ "summary": "Get workspace",
183+ "parameters": [
184+ {
185+ "type": "string",
186+ "description": "Workspace ID",
187+ "name": "id",
188+ "in": "path",
189+ "required": true
190+ }
191+ ],
192+ "responses": {
193+ "200": {
194+ "description": "OK",
195+ "schema": {
196+ "$ref": "#/definitions/proto.Workspace"
197+ }
198+ },
199+ "404": {
200+ "description": "Not Found",
201+ "schema": {
202+ "$ref": "#/definitions/proto.Error"
203+ }
204+ },
205+ "500": {
206+ "description": "Internal Server Error",
207+ "schema": {
208+ "$ref": "#/definitions/proto.Error"
209+ }
210+ }
211+ }
212+ },
213+ "delete": {
214+ "tags": [
215+ "workspaces"
216+ ],
217+ "summary": "Delete workspace",
218+ "parameters": [
219+ {
220+ "type": "string",
221+ "description": "Workspace ID",
222+ "name": "id",
223+ "in": "path",
224+ "required": true
225+ }
226+ ],
227+ "responses": {
228+ "200": {
229+ "description": "OK"
230+ },
231+ "404": {
232+ "description": "Not Found",
233+ "schema": {
234+ "$ref": "#/definitions/proto.Error"
235+ }
236+ }
237+ }
238+ }
239+ },
240+ "/workspaces/{id}/agent": {
241+ "get": {
242+ "produces": [
243+ "application/json"
244+ ],
245+ "tags": [
246+ "agent"
247+ ],
248+ "summary": "Get agent info",
249+ "parameters": [
250+ {
251+ "type": "string",
252+ "description": "Workspace ID",
253+ "name": "id",
254+ "in": "path",
255+ "required": true
256+ }
257+ ],
258+ "responses": {
259+ "200": {
260+ "description": "OK",
261+ "schema": {
262+ "$ref": "#/definitions/proto.AgentInfo"
263+ }
264+ },
265+ "404": {
266+ "description": "Not Found",
267+ "schema": {
268+ "$ref": "#/definitions/proto.Error"
269+ }
270+ },
271+ "500": {
272+ "description": "Internal Server Error",
273+ "schema": {
274+ "$ref": "#/definitions/proto.Error"
275+ }
276+ }
277+ }
278+ },
279+ "post": {
280+ "consumes": [
281+ "application/json"
282+ ],
283+ "tags": [
284+ "agent"
285+ ],
286+ "summary": "Send message to agent",
287+ "parameters": [
288+ {
289+ "type": "string",
290+ "description": "Workspace ID",
291+ "name": "id",
292+ "in": "path",
293+ "required": true
294+ },
295+ {
296+ "description": "Agent message",
297+ "name": "request",
298+ "in": "body",
299+ "required": true,
300+ "schema": {
301+ "$ref": "#/definitions/proto.AgentMessage"
302+ }
303+ }
304+ ],
305+ "responses": {
306+ "200": {
307+ "description": "OK"
308+ },
309+ "400": {
310+ "description": "Bad Request",
311+ "schema": {
312+ "$ref": "#/definitions/proto.Error"
313+ }
314+ },
315+ "404": {
316+ "description": "Not Found",
317+ "schema": {
318+ "$ref": "#/definitions/proto.Error"
319+ }
320+ },
321+ "500": {
322+ "description": "Internal Server Error",
323+ "schema": {
324+ "$ref": "#/definitions/proto.Error"
325+ }
326+ }
327+ }
328+ }
329+ },
330+ "/workspaces/{id}/agent/default-small-model": {
331+ "get": {
332+ "produces": [
333+ "application/json"
334+ ],
335+ "tags": [
336+ "agent"
337+ ],
338+ "summary": "Get default small model",
339+ "parameters": [
340+ {
341+ "type": "string",
342+ "description": "Workspace ID",
343+ "name": "id",
344+ "in": "path",
345+ "required": true
346+ },
347+ {
348+ "type": "string",
349+ "description": "Provider ID",
350+ "name": "provider_id",
351+ "in": "query"
352+ }
353+ ],
354+ "responses": {
355+ "200": {
356+ "description": "OK",
357+ "schema": {
358+ "type": "object"
359+ }
360+ },
361+ "404": {
362+ "description": "Not Found",
363+ "schema": {
364+ "$ref": "#/definitions/proto.Error"
365+ }
366+ },
367+ "500": {
368+ "description": "Internal Server Error",
369+ "schema": {
370+ "$ref": "#/definitions/proto.Error"
371+ }
372+ }
373+ }
374+ }
375+ },
376+ "/workspaces/{id}/agent/init": {
377+ "post": {
378+ "tags": [
379+ "agent"
380+ ],
381+ "summary": "Initialize agent",
382+ "parameters": [
383+ {
384+ "type": "string",
385+ "description": "Workspace ID",
386+ "name": "id",
387+ "in": "path",
388+ "required": true
389+ }
390+ ],
391+ "responses": {
392+ "200": {
393+ "description": "OK"
394+ },
395+ "404": {
396+ "description": "Not Found",
397+ "schema": {
398+ "$ref": "#/definitions/proto.Error"
399+ }
400+ },
401+ "500": {
402+ "description": "Internal Server Error",
403+ "schema": {
404+ "$ref": "#/definitions/proto.Error"
405+ }
406+ }
407+ }
408+ }
409+ },
410+ "/workspaces/{id}/agent/sessions/{sid}": {
411+ "get": {
412+ "produces": [
413+ "application/json"
414+ ],
415+ "tags": [
416+ "agent"
417+ ],
418+ "summary": "Get agent session",
419+ "parameters": [
420+ {
421+ "type": "string",
422+ "description": "Workspace ID",
423+ "name": "id",
424+ "in": "path",
425+ "required": true
426+ },
427+ {
428+ "type": "string",
429+ "description": "Session ID",
430+ "name": "sid",
431+ "in": "path",
432+ "required": true
433+ }
434+ ],
435+ "responses": {
436+ "200": {
437+ "description": "OK",
438+ "schema": {
439+ "$ref": "#/definitions/proto.AgentSession"
440+ }
441+ },
442+ "404": {
443+ "description": "Not Found",
444+ "schema": {
445+ "$ref": "#/definitions/proto.Error"
446+ }
447+ },
448+ "500": {
449+ "description": "Internal Server Error",
450+ "schema": {
451+ "$ref": "#/definitions/proto.Error"
452+ }
453+ }
454+ }
455+ }
456+ },
457+ "/workspaces/{id}/agent/sessions/{sid}/cancel": {
458+ "post": {
459+ "tags": [
460+ "agent"
461+ ],
462+ "summary": "Cancel agent session",
463+ "parameters": [
464+ {
465+ "type": "string",
466+ "description": "Workspace ID",
467+ "name": "id",
468+ "in": "path",
469+ "required": true
470+ },
471+ {
472+ "type": "string",
473+ "description": "Session ID",
474+ "name": "sid",
475+ "in": "path",
476+ "required": true
477+ }
478+ ],
479+ "responses": {
480+ "200": {
481+ "description": "OK"
482+ },
483+ "404": {
484+ "description": "Not Found",
485+ "schema": {
486+ "$ref": "#/definitions/proto.Error"
487+ }
488+ },
489+ "500": {
490+ "description": "Internal Server Error",
491+ "schema": {
492+ "$ref": "#/definitions/proto.Error"
493+ }
494+ }
495+ }
496+ }
497+ },
498+ "/workspaces/{id}/agent/sessions/{sid}/prompts/clear": {
499+ "post": {
500+ "tags": [
501+ "agent"
502+ ],
503+ "summary": "Clear prompt queue",
504+ "parameters": [
505+ {
506+ "type": "string",
507+ "description": "Workspace ID",
508+ "name": "id",
509+ "in": "path",
510+ "required": true
511+ },
512+ {
513+ "type": "string",
514+ "description": "Session ID",
515+ "name": "sid",
516+ "in": "path",
517+ "required": true
518+ }
519+ ],
520+ "responses": {
521+ "200": {
522+ "description": "OK"
523+ },
524+ "404": {
525+ "description": "Not Found",
526+ "schema": {
527+ "$ref": "#/definitions/proto.Error"
528+ }
529+ },
530+ "500": {
531+ "description": "Internal Server Error",
532+ "schema": {
533+ "$ref": "#/definitions/proto.Error"
534+ }
535+ }
536+ }
537+ }
538+ },
539+ "/workspaces/{id}/agent/sessions/{sid}/prompts/list": {
540+ "get": {
541+ "produces": [
542+ "application/json"
543+ ],
544+ "tags": [
545+ "agent"
546+ ],
547+ "summary": "List queued prompts",
548+ "parameters": [
549+ {
550+ "type": "string",
551+ "description": "Workspace ID",
552+ "name": "id",
553+ "in": "path",
554+ "required": true
555+ },
556+ {
557+ "type": "string",
558+ "description": "Session ID",
559+ "name": "sid",
560+ "in": "path",
561+ "required": true
562+ }
563+ ],
564+ "responses": {
565+ "200": {
566+ "description": "OK",
567+ "schema": {
568+ "type": "array",
569+ "items": {
570+ "type": "string"
571+ }
572+ }
573+ },
574+ "404": {
575+ "description": "Not Found",
576+ "schema": {
577+ "$ref": "#/definitions/proto.Error"
578+ }
579+ },
580+ "500": {
581+ "description": "Internal Server Error",
582+ "schema": {
583+ "$ref": "#/definitions/proto.Error"
584+ }
585+ }
586+ }
587+ }
588+ },
589+ "/workspaces/{id}/agent/sessions/{sid}/prompts/queued": {
590+ "get": {
591+ "produces": [
592+ "application/json"
593+ ],
594+ "tags": [
595+ "agent"
596+ ],
597+ "summary": "Get queued prompt status",
598+ "parameters": [
599+ {
600+ "type": "string",
601+ "description": "Workspace ID",
602+ "name": "id",
603+ "in": "path",
604+ "required": true
605+ },
606+ {
607+ "type": "string",
608+ "description": "Session ID",
609+ "name": "sid",
610+ "in": "path",
611+ "required": true
612+ }
613+ ],
614+ "responses": {
615+ "200": {
616+ "description": "OK",
617+ "schema": {
618+ "type": "object"
619+ }
620+ },
621+ "404": {
622+ "description": "Not Found",
623+ "schema": {
624+ "$ref": "#/definitions/proto.Error"
625+ }
626+ },
627+ "500": {
628+ "description": "Internal Server Error",
629+ "schema": {
630+ "$ref": "#/definitions/proto.Error"
631+ }
632+ }
633+ }
634+ }
635+ },
636+ "/workspaces/{id}/agent/sessions/{sid}/summarize": {
637+ "post": {
638+ "tags": [
639+ "agent"
640+ ],
641+ "summary": "Summarize session",
642+ "parameters": [
643+ {
644+ "type": "string",
645+ "description": "Workspace ID",
646+ "name": "id",
647+ "in": "path",
648+ "required": true
649+ },
650+ {
651+ "type": "string",
652+ "description": "Session ID",
653+ "name": "sid",
654+ "in": "path",
655+ "required": true
656+ }
657+ ],
658+ "responses": {
659+ "200": {
660+ "description": "OK"
661+ },
662+ "404": {
663+ "description": "Not Found",
664+ "schema": {
665+ "$ref": "#/definitions/proto.Error"
666+ }
667+ },
668+ "500": {
669+ "description": "Internal Server Error",
670+ "schema": {
671+ "$ref": "#/definitions/proto.Error"
672+ }
673+ }
674+ }
675+ }
676+ },
677+ "/workspaces/{id}/agent/update": {
678+ "post": {
679+ "tags": [
680+ "agent"
681+ ],
682+ "summary": "Update agent",
683+ "parameters": [
684+ {
685+ "type": "string",
686+ "description": "Workspace ID",
687+ "name": "id",
688+ "in": "path",
689+ "required": true
690+ }
691+ ],
692+ "responses": {
693+ "200": {
694+ "description": "OK"
695+ },
696+ "404": {
697+ "description": "Not Found",
698+ "schema": {
699+ "$ref": "#/definitions/proto.Error"
700+ }
701+ },
702+ "500": {
703+ "description": "Internal Server Error",
704+ "schema": {
705+ "$ref": "#/definitions/proto.Error"
706+ }
707+ }
708+ }
709+ }
710+ },
711+ "/workspaces/{id}/config": {
712+ "get": {
713+ "produces": [
714+ "application/json"
715+ ],
716+ "tags": [
717+ "workspaces"
718+ ],
719+ "summary": "Get workspace config",
720+ "parameters": [
721+ {
722+ "type": "string",
723+ "description": "Workspace ID",
724+ "name": "id",
725+ "in": "path",
726+ "required": true
727+ }
728+ ],
729+ "responses": {
730+ "200": {
731+ "description": "OK",
732+ "schema": {
733+ "type": "object"
734+ }
735+ },
736+ "404": {
737+ "description": "Not Found",
738+ "schema": {
739+ "$ref": "#/definitions/proto.Error"
740+ }
741+ },
742+ "500": {
743+ "description": "Internal Server Error",
744+ "schema": {
745+ "$ref": "#/definitions/proto.Error"
746+ }
747+ }
748+ }
749+ }
750+ },
751+ "/workspaces/{id}/config/compact": {
752+ "post": {
753+ "consumes": [
754+ "application/json"
755+ ],
756+ "tags": [
757+ "config"
758+ ],
759+ "summary": "Set compact mode",
760+ "parameters": [
761+ {
762+ "type": "string",
763+ "description": "Workspace ID",
764+ "name": "id",
765+ "in": "path",
766+ "required": true
767+ },
768+ {
769+ "description": "Config compact request",
770+ "name": "request",
771+ "in": "body",
772+ "required": true,
773+ "schema": {
774+ "$ref": "#/definitions/proto.ConfigCompactRequest"
775+ }
776+ }
777+ ],
778+ "responses": {
779+ "200": {
780+ "description": "OK"
781+ },
782+ "400": {
783+ "description": "Bad Request",
784+ "schema": {
785+ "$ref": "#/definitions/proto.Error"
786+ }
787+ },
788+ "404": {
789+ "description": "Not Found",
790+ "schema": {
791+ "$ref": "#/definitions/proto.Error"
792+ }
793+ },
794+ "500": {
795+ "description": "Internal Server Error",
796+ "schema": {
797+ "$ref": "#/definitions/proto.Error"
798+ }
799+ }
800+ }
801+ }
802+ },
803+ "/workspaces/{id}/config/import-copilot": {
804+ "post": {
805+ "produces": [
806+ "application/json"
807+ ],
808+ "tags": [
809+ "config"
810+ ],
811+ "summary": "Import Copilot credentials",
812+ "parameters": [
813+ {
814+ "type": "string",
815+ "description": "Workspace ID",
816+ "name": "id",
817+ "in": "path",
818+ "required": true
819+ }
820+ ],
821+ "responses": {
822+ "200": {
823+ "description": "OK",
824+ "schema": {
825+ "$ref": "#/definitions/proto.ImportCopilotResponse"
826+ }
827+ },
828+ "404": {
829+ "description": "Not Found",
830+ "schema": {
831+ "$ref": "#/definitions/proto.Error"
832+ }
833+ },
834+ "500": {
835+ "description": "Internal Server Error",
836+ "schema": {
837+ "$ref": "#/definitions/proto.Error"
838+ }
839+ }
840+ }
841+ }
842+ },
843+ "/workspaces/{id}/config/model": {
844+ "post": {
845+ "consumes": [
846+ "application/json"
847+ ],
848+ "tags": [
849+ "config"
850+ ],
851+ "summary": "Set the preferred model",
852+ "parameters": [
853+ {
854+ "type": "string",
855+ "description": "Workspace ID",
856+ "name": "id",
857+ "in": "path",
858+ "required": true
859+ },
860+ {
861+ "description": "Config model request",
862+ "name": "request",
863+ "in": "body",
864+ "required": true,
865+ "schema": {
866+ "$ref": "#/definitions/proto.ConfigModelRequest"
867+ }
868+ }
869+ ],
870+ "responses": {
871+ "200": {
872+ "description": "OK"
873+ },
874+ "400": {
875+ "description": "Bad Request",
876+ "schema": {
877+ "$ref": "#/definitions/proto.Error"
878+ }
879+ },
880+ "404": {
881+ "description": "Not Found",
882+ "schema": {
883+ "$ref": "#/definitions/proto.Error"
884+ }
885+ },
886+ "500": {
887+ "description": "Internal Server Error",
888+ "schema": {
889+ "$ref": "#/definitions/proto.Error"
890+ }
891+ }
892+ }
893+ }
894+ },
895+ "/workspaces/{id}/config/provider-key": {
896+ "post": {
897+ "consumes": [
898+ "application/json"
899+ ],
900+ "tags": [
901+ "config"
902+ ],
903+ "summary": "Set provider API key",
904+ "parameters": [
905+ {
906+ "type": "string",
907+ "description": "Workspace ID",
908+ "name": "id",
909+ "in": "path",
910+ "required": true
911+ },
912+ {
913+ "description": "Config provider key request",
914+ "name": "request",
915+ "in": "body",
916+ "required": true,
917+ "schema": {
918+ "$ref": "#/definitions/proto.ConfigProviderKeyRequest"
919+ }
920+ }
921+ ],
922+ "responses": {
923+ "200": {
924+ "description": "OK"
925+ },
926+ "400": {
927+ "description": "Bad Request",
928+ "schema": {
929+ "$ref": "#/definitions/proto.Error"
930+ }
931+ },
932+ "404": {
933+ "description": "Not Found",
934+ "schema": {
935+ "$ref": "#/definitions/proto.Error"
936+ }
937+ },
938+ "500": {
939+ "description": "Internal Server Error",
940+ "schema": {
941+ "$ref": "#/definitions/proto.Error"
942+ }
943+ }
944+ }
945+ }
946+ },
947+ "/workspaces/{id}/config/refresh-oauth": {
948+ "post": {
949+ "consumes": [
950+ "application/json"
951+ ],
952+ "tags": [
953+ "config"
954+ ],
955+ "summary": "Refresh OAuth token",
956+ "parameters": [
957+ {
958+ "type": "string",
959+ "description": "Workspace ID",
960+ "name": "id",
961+ "in": "path",
962+ "required": true
963+ },
964+ {
965+ "description": "Refresh OAuth request",
966+ "name": "request",
967+ "in": "body",
968+ "required": true,
969+ "schema": {
970+ "$ref": "#/definitions/proto.ConfigRefreshOAuthRequest"
971+ }
972+ }
973+ ],
974+ "responses": {
975+ "200": {
976+ "description": "OK"
977+ },
978+ "400": {
979+ "description": "Bad Request",
980+ "schema": {
981+ "$ref": "#/definitions/proto.Error"
982+ }
983+ },
984+ "404": {
985+ "description": "Not Found",
986+ "schema": {
987+ "$ref": "#/definitions/proto.Error"
988+ }
989+ },
990+ "500": {
991+ "description": "Internal Server Error",
992+ "schema": {
993+ "$ref": "#/definitions/proto.Error"
994+ }
995+ }
996+ }
997+ }
998+ },
999+ "/workspaces/{id}/config/remove": {
1000+ "post": {
1001+ "consumes": [
1002+ "application/json"
1003+ ],
1004+ "tags": [
1005+ "config"
1006+ ],
1007+ "summary": "Remove a config field",
1008+ "parameters": [
1009+ {
1010+ "type": "string",
1011+ "description": "Workspace ID",
1012+ "name": "id",
1013+ "in": "path",
1014+ "required": true
1015+ },
1016+ {
1017+ "description": "Config remove request",
1018+ "name": "request",
1019+ "in": "body",
1020+ "required": true,
1021+ "schema": {
1022+ "$ref": "#/definitions/proto.ConfigRemoveRequest"
1023+ }
1024+ }
1025+ ],
1026+ "responses": {
1027+ "200": {
1028+ "description": "OK"
1029+ },
1030+ "400": {
1031+ "description": "Bad Request",
1032+ "schema": {
1033+ "$ref": "#/definitions/proto.Error"
1034+ }
1035+ },
1036+ "404": {
1037+ "description": "Not Found",
1038+ "schema": {
1039+ "$ref": "#/definitions/proto.Error"
1040+ }
1041+ },
1042+ "500": {
1043+ "description": "Internal Server Error",
1044+ "schema": {
1045+ "$ref": "#/definitions/proto.Error"
1046+ }
1047+ }
1048+ }
1049+ }
1050+ },
1051+ "/workspaces/{id}/config/set": {
1052+ "post": {
1053+ "consumes": [
1054+ "application/json"
1055+ ],
1056+ "tags": [
1057+ "config"
1058+ ],
1059+ "summary": "Set a config field",
1060+ "parameters": [
1061+ {
1062+ "type": "string",
1063+ "description": "Workspace ID",
1064+ "name": "id",
1065+ "in": "path",
1066+ "required": true
1067+ },
1068+ {
1069+ "description": "Config set request",
1070+ "name": "request",
1071+ "in": "body",
1072+ "required": true,
1073+ "schema": {
1074+ "$ref": "#/definitions/proto.ConfigSetRequest"
1075+ }
1076+ }
1077+ ],
1078+ "responses": {
1079+ "200": {
1080+ "description": "OK"
1081+ },
1082+ "400": {
1083+ "description": "Bad Request",
1084+ "schema": {
1085+ "$ref": "#/definitions/proto.Error"
1086+ }
1087+ },
1088+ "404": {
1089+ "description": "Not Found",
1090+ "schema": {
1091+ "$ref": "#/definitions/proto.Error"
1092+ }
1093+ },
1094+ "500": {
1095+ "description": "Internal Server Error",
1096+ "schema": {
1097+ "$ref": "#/definitions/proto.Error"
1098+ }
1099+ }
1100+ }
1101+ }
1102+ },
1103+ "/workspaces/{id}/events": {
1104+ "get": {
1105+ "produces": [
1106+ "text/event-stream"
1107+ ],
1108+ "tags": [
1109+ "workspaces"
1110+ ],
1111+ "summary": "Stream workspace events (SSE)",
1112+ "parameters": [
1113+ {
1114+ "type": "string",
1115+ "description": "Workspace ID",
1116+ "name": "id",
1117+ "in": "path",
1118+ "required": true
1119+ }
1120+ ],
1121+ "responses": {
1122+ "200": {
1123+ "description": "OK"
1124+ },
1125+ "404": {
1126+ "description": "Not Found",
1127+ "schema": {
1128+ "$ref": "#/definitions/proto.Error"
1129+ }
1130+ },
1131+ "500": {
1132+ "description": "Internal Server Error",
1133+ "schema": {
1134+ "$ref": "#/definitions/proto.Error"
1135+ }
1136+ }
1137+ }
1138+ }
1139+ },
1140+ "/workspaces/{id}/filetracker/lastread": {
1141+ "get": {
1142+ "produces": [
1143+ "application/json"
1144+ ],
1145+ "tags": [
1146+ "filetracker"
1147+ ],
1148+ "summary": "Get last read time for file",
1149+ "parameters": [
1150+ {
1151+ "type": "string",
1152+ "description": "Workspace ID",
1153+ "name": "id",
1154+ "in": "path",
1155+ "required": true
1156+ },
1157+ {
1158+ "type": "string",
1159+ "description": "Session ID",
1160+ "name": "session_id",
1161+ "in": "query"
1162+ },
1163+ {
1164+ "type": "string",
1165+ "description": "File path",
1166+ "name": "path",
1167+ "in": "query",
1168+ "required": true
1169+ }
1170+ ],
1171+ "responses": {
1172+ "200": {
1173+ "description": "OK",
1174+ "schema": {
1175+ "type": "object"
1176+ }
1177+ },
1178+ "404": {
1179+ "description": "Not Found",
1180+ "schema": {
1181+ "$ref": "#/definitions/proto.Error"
1182+ }
1183+ },
1184+ "500": {
1185+ "description": "Internal Server Error",
1186+ "schema": {
1187+ "$ref": "#/definitions/proto.Error"
1188+ }
1189+ }
1190+ }
1191+ }
1192+ },
1193+ "/workspaces/{id}/filetracker/read": {
1194+ "post": {
1195+ "consumes": [
1196+ "application/json"
1197+ ],
1198+ "tags": [
1199+ "filetracker"
1200+ ],
1201+ "summary": "Record file read",
1202+ "parameters": [
1203+ {
1204+ "type": "string",
1205+ "description": "Workspace ID",
1206+ "name": "id",
1207+ "in": "path",
1208+ "required": true
1209+ },
1210+ {
1211+ "description": "File tracker read request",
1212+ "name": "request",
1213+ "in": "body",
1214+ "required": true,
1215+ "schema": {
1216+ "$ref": "#/definitions/proto.FileTrackerReadRequest"
1217+ }
1218+ }
1219+ ],
1220+ "responses": {
1221+ "200": {
1222+ "description": "OK"
1223+ },
1224+ "400": {
1225+ "description": "Bad Request",
1226+ "schema": {
1227+ "$ref": "#/definitions/proto.Error"
1228+ }
1229+ },
1230+ "404": {
1231+ "description": "Not Found",
1232+ "schema": {
1233+ "$ref": "#/definitions/proto.Error"
1234+ }
1235+ },
1236+ "500": {
1237+ "description": "Internal Server Error",
1238+ "schema": {
1239+ "$ref": "#/definitions/proto.Error"
1240+ }
1241+ }
1242+ }
1243+ }
1244+ },
1245+ "/workspaces/{id}/lsps": {
1246+ "get": {
1247+ "produces": [
1248+ "application/json"
1249+ ],
1250+ "tags": [
1251+ "lsp"
1252+ ],
1253+ "summary": "List LSP clients",
1254+ "parameters": [
1255+ {
1256+ "type": "string",
1257+ "description": "Workspace ID",
1258+ "name": "id",
1259+ "in": "path",
1260+ "required": true
1261+ }
1262+ ],
1263+ "responses": {
1264+ "200": {
1265+ "description": "OK",
1266+ "schema": {
1267+ "type": "object",
1268+ "additionalProperties": {
1269+ "$ref": "#/definitions/proto.LSPClientInfo"
1270+ }
1271+ }
1272+ },
1273+ "404": {
1274+ "description": "Not Found",
1275+ "schema": {
1276+ "$ref": "#/definitions/proto.Error"
1277+ }
1278+ },
1279+ "500": {
1280+ "description": "Internal Server Error",
1281+ "schema": {
1282+ "$ref": "#/definitions/proto.Error"
1283+ }
1284+ }
1285+ }
1286+ }
1287+ },
1288+ "/workspaces/{id}/lsps/start": {
1289+ "post": {
1290+ "consumes": [
1291+ "application/json"
1292+ ],
1293+ "tags": [
1294+ "lsp"
1295+ ],
1296+ "summary": "Start LSP server",
1297+ "parameters": [
1298+ {
1299+ "type": "string",
1300+ "description": "Workspace ID",
1301+ "name": "id",
1302+ "in": "path",
1303+ "required": true
1304+ },
1305+ {
1306+ "description": "LSP start request",
1307+ "name": "request",
1308+ "in": "body",
1309+ "required": true,
1310+ "schema": {
1311+ "$ref": "#/definitions/proto.LSPStartRequest"
1312+ }
1313+ }
1314+ ],
1315+ "responses": {
1316+ "200": {
1317+ "description": "OK"
1318+ },
1319+ "400": {
1320+ "description": "Bad Request",
1321+ "schema": {
1322+ "$ref": "#/definitions/proto.Error"
1323+ }
1324+ },
1325+ "404": {
1326+ "description": "Not Found",
1327+ "schema": {
1328+ "$ref": "#/definitions/proto.Error"
1329+ }
1330+ },
1331+ "500": {
1332+ "description": "Internal Server Error",
1333+ "schema": {
1334+ "$ref": "#/definitions/proto.Error"
1335+ }
1336+ }
1337+ }
1338+ }
1339+ },
1340+ "/workspaces/{id}/lsps/stop": {
1341+ "post": {
1342+ "tags": [
1343+ "lsp"
1344+ ],
1345+ "summary": "Stop all LSP servers",
1346+ "parameters": [
1347+ {
1348+ "type": "string",
1349+ "description": "Workspace ID",
1350+ "name": "id",
1351+ "in": "path",
1352+ "required": true
1353+ }
1354+ ],
1355+ "responses": {
1356+ "200": {
1357+ "description": "OK"
1358+ },
1359+ "404": {
1360+ "description": "Not Found",
1361+ "schema": {
1362+ "$ref": "#/definitions/proto.Error"
1363+ }
1364+ },
1365+ "500": {
1366+ "description": "Internal Server Error",
1367+ "schema": {
1368+ "$ref": "#/definitions/proto.Error"
1369+ }
1370+ }
1371+ }
1372+ }
1373+ },
1374+ "/workspaces/{id}/lsps/{lsp}/diagnostics": {
1375+ "get": {
1376+ "produces": [
1377+ "application/json"
1378+ ],
1379+ "tags": [
1380+ "lsp"
1381+ ],
1382+ "summary": "Get LSP diagnostics",
1383+ "parameters": [
1384+ {
1385+ "type": "string",
1386+ "description": "Workspace ID",
1387+ "name": "id",
1388+ "in": "path",
1389+ "required": true
1390+ },
1391+ {
1392+ "type": "string",
1393+ "description": "LSP client name",
1394+ "name": "lsp",
1395+ "in": "path",
1396+ "required": true
1397+ }
1398+ ],
1399+ "responses": {
1400+ "200": {
1401+ "description": "OK",
1402+ "schema": {
1403+ "type": "object"
1404+ }
1405+ },
1406+ "404": {
1407+ "description": "Not Found",
1408+ "schema": {
1409+ "$ref": "#/definitions/proto.Error"
1410+ }
1411+ },
1412+ "500": {
1413+ "description": "Internal Server Error",
1414+ "schema": {
1415+ "$ref": "#/definitions/proto.Error"
1416+ }
1417+ }
1418+ }
1419+ }
1420+ },
1421+ "/workspaces/{id}/mcp/get-prompt": {
1422+ "post": {
1423+ "consumes": [
1424+ "application/json"
1425+ ],
1426+ "produces": [
1427+ "application/json"
1428+ ],
1429+ "tags": [
1430+ "mcp"
1431+ ],
1432+ "summary": "Get MCP prompt",
1433+ "parameters": [
1434+ {
1435+ "type": "string",
1436+ "description": "Workspace ID",
1437+ "name": "id",
1438+ "in": "path",
1439+ "required": true
1440+ },
1441+ {
1442+ "description": "MCP get prompt request",
1443+ "name": "request",
1444+ "in": "body",
1445+ "required": true,
1446+ "schema": {
1447+ "$ref": "#/definitions/proto.MCPGetPromptRequest"
1448+ }
1449+ }
1450+ ],
1451+ "responses": {
1452+ "200": {
1453+ "description": "OK",
1454+ "schema": {
1455+ "$ref": "#/definitions/proto.MCPGetPromptResponse"
1456+ }
1457+ },
1458+ "400": {
1459+ "description": "Bad Request",
1460+ "schema": {
1461+ "$ref": "#/definitions/proto.Error"
1462+ }
1463+ },
1464+ "404": {
1465+ "description": "Not Found",
1466+ "schema": {
1467+ "$ref": "#/definitions/proto.Error"
1468+ }
1469+ },
1470+ "500": {
1471+ "description": "Internal Server Error",
1472+ "schema": {
1473+ "$ref": "#/definitions/proto.Error"
1474+ }
1475+ }
1476+ }
1477+ }
1478+ },
1479+ "/workspaces/{id}/mcp/read-resource": {
1480+ "post": {
1481+ "consumes": [
1482+ "application/json"
1483+ ],
1484+ "produces": [
1485+ "application/json"
1486+ ],
1487+ "tags": [
1488+ "mcp"
1489+ ],
1490+ "summary": "Read MCP resource",
1491+ "parameters": [
1492+ {
1493+ "type": "string",
1494+ "description": "Workspace ID",
1495+ "name": "id",
1496+ "in": "path",
1497+ "required": true
1498+ },
1499+ {
1500+ "description": "MCP read resource request",
1501+ "name": "request",
1502+ "in": "body",
1503+ "required": true,
1504+ "schema": {
1505+ "$ref": "#/definitions/proto.MCPReadResourceRequest"
1506+ }
1507+ }
1508+ ],
1509+ "responses": {
1510+ "200": {
1511+ "description": "OK",
1512+ "schema": {
1513+ "type": "object"
1514+ }
1515+ },
1516+ "400": {
1517+ "description": "Bad Request",
1518+ "schema": {
1519+ "$ref": "#/definitions/proto.Error"
1520+ }
1521+ },
1522+ "404": {
1523+ "description": "Not Found",
1524+ "schema": {
1525+ "$ref": "#/definitions/proto.Error"
1526+ }
1527+ },
1528+ "500": {
1529+ "description": "Internal Server Error",
1530+ "schema": {
1531+ "$ref": "#/definitions/proto.Error"
1532+ }
1533+ }
1534+ }
1535+ }
1536+ },
1537+ "/workspaces/{id}/mcp/refresh-prompts": {
1538+ "post": {
1539+ "consumes": [
1540+ "application/json"
1541+ ],
1542+ "tags": [
1543+ "mcp"
1544+ ],
1545+ "summary": "Refresh MCP prompts",
1546+ "parameters": [
1547+ {
1548+ "type": "string",
1549+ "description": "Workspace ID",
1550+ "name": "id",
1551+ "in": "path",
1552+ "required": true
1553+ },
1554+ {
1555+ "description": "MCP name request",
1556+ "name": "request",
1557+ "in": "body",
1558+ "required": true,
1559+ "schema": {
1560+ "$ref": "#/definitions/proto.MCPNameRequest"
1561+ }
1562+ }
1563+ ],
1564+ "responses": {
1565+ "200": {
1566+ "description": "OK"
1567+ },
1568+ "400": {
1569+ "description": "Bad Request",
1570+ "schema": {
1571+ "$ref": "#/definitions/proto.Error"
1572+ }
1573+ },
1574+ "404": {
1575+ "description": "Not Found",
1576+ "schema": {
1577+ "$ref": "#/definitions/proto.Error"
1578+ }
1579+ },
1580+ "500": {
1581+ "description": "Internal Server Error",
1582+ "schema": {
1583+ "$ref": "#/definitions/proto.Error"
1584+ }
1585+ }
1586+ }
1587+ }
1588+ },
1589+ "/workspaces/{id}/mcp/refresh-resources": {
1590+ "post": {
1591+ "consumes": [
1592+ "application/json"
1593+ ],
1594+ "tags": [
1595+ "mcp"
1596+ ],
1597+ "summary": "Refresh MCP resources",
1598+ "parameters": [
1599+ {
1600+ "type": "string",
1601+ "description": "Workspace ID",
1602+ "name": "id",
1603+ "in": "path",
1604+ "required": true
1605+ },
1606+ {
1607+ "description": "MCP name request",
1608+ "name": "request",
1609+ "in": "body",
1610+ "required": true,
1611+ "schema": {
1612+ "$ref": "#/definitions/proto.MCPNameRequest"
1613+ }
1614+ }
1615+ ],
1616+ "responses": {
1617+ "200": {
1618+ "description": "OK"
1619+ },
1620+ "400": {
1621+ "description": "Bad Request",
1622+ "schema": {
1623+ "$ref": "#/definitions/proto.Error"
1624+ }
1625+ },
1626+ "404": {
1627+ "description": "Not Found",
1628+ "schema": {
1629+ "$ref": "#/definitions/proto.Error"
1630+ }
1631+ },
1632+ "500": {
1633+ "description": "Internal Server Error",
1634+ "schema": {
1635+ "$ref": "#/definitions/proto.Error"
1636+ }
1637+ }
1638+ }
1639+ }
1640+ },
1641+ "/workspaces/{id}/mcp/refresh-tools": {
1642+ "post": {
1643+ "consumes": [
1644+ "application/json"
1645+ ],
1646+ "tags": [
1647+ "mcp"
1648+ ],
1649+ "summary": "Refresh MCP tools",
1650+ "parameters": [
1651+ {
1652+ "type": "string",
1653+ "description": "Workspace ID",
1654+ "name": "id",
1655+ "in": "path",
1656+ "required": true
1657+ },
1658+ {
1659+ "description": "MCP name request",
1660+ "name": "request",
1661+ "in": "body",
1662+ "required": true,
1663+ "schema": {
1664+ "$ref": "#/definitions/proto.MCPNameRequest"
1665+ }
1666+ }
1667+ ],
1668+ "responses": {
1669+ "200": {
1670+ "description": "OK"
1671+ },
1672+ "400": {
1673+ "description": "Bad Request",
1674+ "schema": {
1675+ "$ref": "#/definitions/proto.Error"
1676+ }
1677+ },
1678+ "404": {
1679+ "description": "Not Found",
1680+ "schema": {
1681+ "$ref": "#/definitions/proto.Error"
1682+ }
1683+ },
1684+ "500": {
1685+ "description": "Internal Server Error",
1686+ "schema": {
1687+ "$ref": "#/definitions/proto.Error"
1688+ }
1689+ }
1690+ }
1691+ }
1692+ },
1693+ "/workspaces/{id}/mcp/states": {
1694+ "get": {
1695+ "produces": [
1696+ "application/json"
1697+ ],
1698+ "tags": [
1699+ "mcp"
1700+ ],
1701+ "summary": "Get MCP client states",
1702+ "parameters": [
1703+ {
1704+ "type": "string",
1705+ "description": "Workspace ID",
1706+ "name": "id",
1707+ "in": "path",
1708+ "required": true
1709+ }
1710+ ],
1711+ "responses": {
1712+ "200": {
1713+ "description": "OK",
1714+ "schema": {
1715+ "type": "object",
1716+ "additionalProperties": {
1717+ "$ref": "#/definitions/proto.MCPClientInfo"
1718+ }
1719+ }
1720+ },
1721+ "404": {
1722+ "description": "Not Found",
1723+ "schema": {
1724+ "$ref": "#/definitions/proto.Error"
1725+ }
1726+ },
1727+ "500": {
1728+ "description": "Internal Server Error",
1729+ "schema": {
1730+ "$ref": "#/definitions/proto.Error"
1731+ }
1732+ }
1733+ }
1734+ }
1735+ },
1736+ "/workspaces/{id}/messages/user": {
1737+ "get": {
1738+ "produces": [
1739+ "application/json"
1740+ ],
1741+ "tags": [
1742+ "workspaces"
1743+ ],
1744+ "summary": "Get all user messages for workspace",
1745+ "parameters": [
1746+ {
1747+ "type": "string",
1748+ "description": "Workspace ID",
1749+ "name": "id",
1750+ "in": "path",
1751+ "required": true
1752+ }
1753+ ],
1754+ "responses": {
1755+ "200": {
1756+ "description": "OK",
1757+ "schema": {
1758+ "type": "array",
1759+ "items": {
1760+ "$ref": "#/definitions/github_com_charmbracelet_crush_internal_proto.Message"
1761+ }
1762+ }
1763+ },
1764+ "404": {
1765+ "description": "Not Found",
1766+ "schema": {
1767+ "$ref": "#/definitions/proto.Error"
1768+ }
1769+ },
1770+ "500": {
1771+ "description": "Internal Server Error",
1772+ "schema": {
1773+ "$ref": "#/definitions/proto.Error"
1774+ }
1775+ }
1776+ }
1777+ }
1778+ },
1779+ "/workspaces/{id}/permissions/grant": {
1780+ "post": {
1781+ "consumes": [
1782+ "application/json"
1783+ ],
1784+ "tags": [
1785+ "permissions"
1786+ ],
1787+ "summary": "Grant permission",
1788+ "parameters": [
1789+ {
1790+ "type": "string",
1791+ "description": "Workspace ID",
1792+ "name": "id",
1793+ "in": "path",
1794+ "required": true
1795+ },
1796+ {
1797+ "description": "Permission grant",
1798+ "name": "request",
1799+ "in": "body",
1800+ "required": true,
1801+ "schema": {
1802+ "$ref": "#/definitions/proto.PermissionGrant"
1803+ }
1804+ }
1805+ ],
1806+ "responses": {
1807+ "200": {
1808+ "description": "OK"
1809+ },
1810+ "400": {
1811+ "description": "Bad Request",
1812+ "schema": {
1813+ "$ref": "#/definitions/proto.Error"
1814+ }
1815+ },
1816+ "404": {
1817+ "description": "Not Found",
1818+ "schema": {
1819+ "$ref": "#/definitions/proto.Error"
1820+ }
1821+ },
1822+ "500": {
1823+ "description": "Internal Server Error",
1824+ "schema": {
1825+ "$ref": "#/definitions/proto.Error"
1826+ }
1827+ }
1828+ }
1829+ }
1830+ },
1831+ "/workspaces/{id}/permissions/skip": {
1832+ "get": {
1833+ "produces": [
1834+ "application/json"
1835+ ],
1836+ "tags": [
1837+ "permissions"
1838+ ],
1839+ "summary": "Get skip permissions status",
1840+ "parameters": [
1841+ {
1842+ "type": "string",
1843+ "description": "Workspace ID",
1844+ "name": "id",
1845+ "in": "path",
1846+ "required": true
1847+ }
1848+ ],
1849+ "responses": {
1850+ "200": {
1851+ "description": "OK",
1852+ "schema": {
1853+ "$ref": "#/definitions/proto.PermissionSkipRequest"
1854+ }
1855+ },
1856+ "404": {
1857+ "description": "Not Found",
1858+ "schema": {
1859+ "$ref": "#/definitions/proto.Error"
1860+ }
1861+ },
1862+ "500": {
1863+ "description": "Internal Server Error",
1864+ "schema": {
1865+ "$ref": "#/definitions/proto.Error"
1866+ }
1867+ }
1868+ }
1869+ },
1870+ "post": {
1871+ "consumes": [
1872+ "application/json"
1873+ ],
1874+ "tags": [
1875+ "permissions"
1876+ ],
1877+ "summary": "Set skip permissions",
1878+ "parameters": [
1879+ {
1880+ "type": "string",
1881+ "description": "Workspace ID",
1882+ "name": "id",
1883+ "in": "path",
1884+ "required": true
1885+ },
1886+ {
1887+ "description": "Permission skip request",
1888+ "name": "request",
1889+ "in": "body",
1890+ "required": true,
1891+ "schema": {
1892+ "$ref": "#/definitions/proto.PermissionSkipRequest"
1893+ }
1894+ }
1895+ ],
1896+ "responses": {
1897+ "200": {
1898+ "description": "OK"
1899+ },
1900+ "400": {
1901+ "description": "Bad Request",
1902+ "schema": {
1903+ "$ref": "#/definitions/proto.Error"
1904+ }
1905+ },
1906+ "404": {
1907+ "description": "Not Found",
1908+ "schema": {
1909+ "$ref": "#/definitions/proto.Error"
1910+ }
1911+ },
1912+ "500": {
1913+ "description": "Internal Server Error",
1914+ "schema": {
1915+ "$ref": "#/definitions/proto.Error"
1916+ }
1917+ }
1918+ }
1919+ }
1920+ },
1921+ "/workspaces/{id}/project/init": {
1922+ "post": {
1923+ "tags": [
1924+ "project"
1925+ ],
1926+ "summary": "Mark project as initialized",
1927+ "parameters": [
1928+ {
1929+ "type": "string",
1930+ "description": "Workspace ID",
1931+ "name": "id",
1932+ "in": "path",
1933+ "required": true
1934+ }
1935+ ],
1936+ "responses": {
1937+ "200": {
1938+ "description": "OK"
1939+ },
1940+ "404": {
1941+ "description": "Not Found",
1942+ "schema": {
1943+ "$ref": "#/definitions/proto.Error"
1944+ }
1945+ },
1946+ "500": {
1947+ "description": "Internal Server Error",
1948+ "schema": {
1949+ "$ref": "#/definitions/proto.Error"
1950+ }
1951+ }
1952+ }
1953+ }
1954+ },
1955+ "/workspaces/{id}/project/init-prompt": {
1956+ "get": {
1957+ "produces": [
1958+ "application/json"
1959+ ],
1960+ "tags": [
1961+ "project"
1962+ ],
1963+ "summary": "Get project initialization prompt",
1964+ "parameters": [
1965+ {
1966+ "type": "string",
1967+ "description": "Workspace ID",
1968+ "name": "id",
1969+ "in": "path",
1970+ "required": true
1971+ }
1972+ ],
1973+ "responses": {
1974+ "200": {
1975+ "description": "OK",
1976+ "schema": {
1977+ "$ref": "#/definitions/proto.ProjectInitPromptResponse"
1978+ }
1979+ },
1980+ "404": {
1981+ "description": "Not Found",
1982+ "schema": {
1983+ "$ref": "#/definitions/proto.Error"
1984+ }
1985+ },
1986+ "500": {
1987+ "description": "Internal Server Error",
1988+ "schema": {
1989+ "$ref": "#/definitions/proto.Error"
1990+ }
1991+ }
1992+ }
1993+ }
1994+ },
1995+ "/workspaces/{id}/project/needs-init": {
1996+ "get": {
1997+ "produces": [
1998+ "application/json"
1999+ ],
2000+ "tags": [
2001+ "project"
2002+ ],
2003+ "summary": "Check if project needs initialization",
2004+ "parameters": [
2005+ {
2006+ "type": "string",
2007+ "description": "Workspace ID",
2008+ "name": "id",
2009+ "in": "path",
2010+ "required": true
2011+ }
2012+ ],
2013+ "responses": {
2014+ "200": {
2015+ "description": "OK",
2016+ "schema": {
2017+ "$ref": "#/definitions/proto.ProjectNeedsInitResponse"
2018+ }
2019+ },
2020+ "404": {
2021+ "description": "Not Found",
2022+ "schema": {
2023+ "$ref": "#/definitions/proto.Error"
2024+ }
2025+ },
2026+ "500": {
2027+ "description": "Internal Server Error",
2028+ "schema": {
2029+ "$ref": "#/definitions/proto.Error"
2030+ }
2031+ }
2032+ }
2033+ }
2034+ },
2035+ "/workspaces/{id}/providers": {
2036+ "get": {
2037+ "produces": [
2038+ "application/json"
2039+ ],
2040+ "tags": [
2041+ "workspaces"
2042+ ],
2043+ "summary": "Get workspace providers",
2044+ "parameters": [
2045+ {
2046+ "type": "string",
2047+ "description": "Workspace ID",
2048+ "name": "id",
2049+ "in": "path",
2050+ "required": true
2051+ }
2052+ ],
2053+ "responses": {
2054+ "200": {
2055+ "description": "OK",
2056+ "schema": {
2057+ "type": "object"
2058+ }
2059+ },
2060+ "404": {
2061+ "description": "Not Found",
2062+ "schema": {
2063+ "$ref": "#/definitions/proto.Error"
2064+ }
2065+ },
2066+ "500": {
2067+ "description": "Internal Server Error",
2068+ "schema": {
2069+ "$ref": "#/definitions/proto.Error"
2070+ }
2071+ }
2072+ }
2073+ }
2074+ },
2075+ "/workspaces/{id}/sessions": {
2076+ "get": {
2077+ "produces": [
2078+ "application/json"
2079+ ],
2080+ "tags": [
2081+ "sessions"
2082+ ],
2083+ "summary": "List sessions",
2084+ "parameters": [
2085+ {
2086+ "type": "string",
2087+ "description": "Workspace ID",
2088+ "name": "id",
2089+ "in": "path",
2090+ "required": true
2091+ }
2092+ ],
2093+ "responses": {
2094+ "200": {
2095+ "description": "OK",
2096+ "schema": {
2097+ "type": "array",
2098+ "items": {
2099+ "$ref": "#/definitions/proto.Session"
2100+ }
2101+ }
2102+ },
2103+ "404": {
2104+ "description": "Not Found",
2105+ "schema": {
2106+ "$ref": "#/definitions/proto.Error"
2107+ }
2108+ },
2109+ "500": {
2110+ "description": "Internal Server Error",
2111+ "schema": {
2112+ "$ref": "#/definitions/proto.Error"
2113+ }
2114+ }
2115+ }
2116+ },
2117+ "post": {
2118+ "consumes": [
2119+ "application/json"
2120+ ],
2121+ "produces": [
2122+ "application/json"
2123+ ],
2124+ "tags": [
2125+ "sessions"
2126+ ],
2127+ "summary": "Create session",
2128+ "parameters": [
2129+ {
2130+ "type": "string",
2131+ "description": "Workspace ID",
2132+ "name": "id",
2133+ "in": "path",
2134+ "required": true
2135+ },
2136+ {
2137+ "description": "Session creation params (title)",
2138+ "name": "request",
2139+ "in": "body",
2140+ "required": true,
2141+ "schema": {
2142+ "$ref": "#/definitions/proto.Session"
2143+ }
2144+ }
2145+ ],
2146+ "responses": {
2147+ "200": {
2148+ "description": "OK",
2149+ "schema": {
2150+ "$ref": "#/definitions/proto.Session"
2151+ }
2152+ },
2153+ "400": {
2154+ "description": "Bad Request",
2155+ "schema": {
2156+ "$ref": "#/definitions/proto.Error"
2157+ }
2158+ },
2159+ "404": {
2160+ "description": "Not Found",
2161+ "schema": {
2162+ "$ref": "#/definitions/proto.Error"
2163+ }
2164+ },
2165+ "500": {
2166+ "description": "Internal Server Error",
2167+ "schema": {
2168+ "$ref": "#/definitions/proto.Error"
2169+ }
2170+ }
2171+ }
2172+ }
2173+ },
2174+ "/workspaces/{id}/sessions/{sid}": {
2175+ "get": {
2176+ "produces": [
2177+ "application/json"
2178+ ],
2179+ "tags": [
2180+ "sessions"
2181+ ],
2182+ "summary": "Get session",
2183+ "parameters": [
2184+ {
2185+ "type": "string",
2186+ "description": "Workspace ID",
2187+ "name": "id",
2188+ "in": "path",
2189+ "required": true
2190+ },
2191+ {
2192+ "type": "string",
2193+ "description": "Session ID",
2194+ "name": "sid",
2195+ "in": "path",
2196+ "required": true
2197+ }
2198+ ],
2199+ "responses": {
2200+ "200": {
2201+ "description": "OK",
2202+ "schema": {
2203+ "$ref": "#/definitions/proto.Session"
2204+ }
2205+ },
2206+ "404": {
2207+ "description": "Not Found",
2208+ "schema": {
2209+ "$ref": "#/definitions/proto.Error"
2210+ }
2211+ },
2212+ "500": {
2213+ "description": "Internal Server Error",
2214+ "schema": {
2215+ "$ref": "#/definitions/proto.Error"
2216+ }
2217+ }
2218+ }
2219+ },
2220+ "put": {
2221+ "consumes": [
2222+ "application/json"
2223+ ],
2224+ "produces": [
2225+ "application/json"
2226+ ],
2227+ "tags": [
2228+ "sessions"
2229+ ],
2230+ "summary": "Update session",
2231+ "parameters": [
2232+ {
2233+ "type": "string",
2234+ "description": "Workspace ID",
2235+ "name": "id",
2236+ "in": "path",
2237+ "required": true
2238+ },
2239+ {
2240+ "type": "string",
2241+ "description": "Session ID",
2242+ "name": "sid",
2243+ "in": "path",
2244+ "required": true
2245+ },
2246+ {
2247+ "description": "Updated session",
2248+ "name": "request",
2249+ "in": "body",
2250+ "required": true,
2251+ "schema": {
2252+ "$ref": "#/definitions/proto.Session"
2253+ }
2254+ }
2255+ ],
2256+ "responses": {
2257+ "200": {
2258+ "description": "OK",
2259+ "schema": {
2260+ "$ref": "#/definitions/proto.Session"
2261+ }
2262+ },
2263+ "400": {
2264+ "description": "Bad Request",
2265+ "schema": {
2266+ "$ref": "#/definitions/proto.Error"
2267+ }
2268+ },
2269+ "404": {
2270+ "description": "Not Found",
2271+ "schema": {
2272+ "$ref": "#/definitions/proto.Error"
2273+ }
2274+ },
2275+ "500": {
2276+ "description": "Internal Server Error",
2277+ "schema": {
2278+ "$ref": "#/definitions/proto.Error"
2279+ }
2280+ }
2281+ }
2282+ },
2283+ "delete": {
2284+ "tags": [
2285+ "sessions"
2286+ ],
2287+ "summary": "Delete session",
2288+ "parameters": [
2289+ {
2290+ "type": "string",
2291+ "description": "Workspace ID",
2292+ "name": "id",
2293+ "in": "path",
2294+ "required": true
2295+ },
2296+ {
2297+ "type": "string",
2298+ "description": "Session ID",
2299+ "name": "sid",
2300+ "in": "path",
2301+ "required": true
2302+ }
2303+ ],
2304+ "responses": {
2305+ "200": {
2306+ "description": "OK"
2307+ },
2308+ "404": {
2309+ "description": "Not Found",
2310+ "schema": {
2311+ "$ref": "#/definitions/proto.Error"
2312+ }
2313+ },
2314+ "500": {
2315+ "description": "Internal Server Error",
2316+ "schema": {
2317+ "$ref": "#/definitions/proto.Error"
2318+ }
2319+ }
2320+ }
2321+ }
2322+ },
2323+ "/workspaces/{id}/sessions/{sid}/filetracker/files": {
2324+ "get": {
2325+ "produces": [
2326+ "application/json"
2327+ ],
2328+ "tags": [
2329+ "filetracker"
2330+ ],
2331+ "summary": "List tracked files for session",
2332+ "parameters": [
2333+ {
2334+ "type": "string",
2335+ "description": "Workspace ID",
2336+ "name": "id",
2337+ "in": "path",
2338+ "required": true
2339+ },
2340+ {
2341+ "type": "string",
2342+ "description": "Session ID",
2343+ "name": "sid",
2344+ "in": "path",
2345+ "required": true
2346+ }
2347+ ],
2348+ "responses": {
2349+ "200": {
2350+ "description": "OK",
2351+ "schema": {
2352+ "type": "array",
2353+ "items": {
2354+ "type": "string"
2355+ }
2356+ }
2357+ },
2358+ "404": {
2359+ "description": "Not Found",
2360+ "schema": {
2361+ "$ref": "#/definitions/proto.Error"
2362+ }
2363+ },
2364+ "500": {
2365+ "description": "Internal Server Error",
2366+ "schema": {
2367+ "$ref": "#/definitions/proto.Error"
2368+ }
2369+ }
2370+ }
2371+ }
2372+ },
2373+ "/workspaces/{id}/sessions/{sid}/history": {
2374+ "get": {
2375+ "produces": [
2376+ "application/json"
2377+ ],
2378+ "tags": [
2379+ "sessions"
2380+ ],
2381+ "summary": "Get session history",
2382+ "parameters": [
2383+ {
2384+ "type": "string",
2385+ "description": "Workspace ID",
2386+ "name": "id",
2387+ "in": "path",
2388+ "required": true
2389+ },
2390+ {
2391+ "type": "string",
2392+ "description": "Session ID",
2393+ "name": "sid",
2394+ "in": "path",
2395+ "required": true
2396+ }
2397+ ],
2398+ "responses": {
2399+ "200": {
2400+ "description": "OK",
2401+ "schema": {
2402+ "type": "array",
2403+ "items": {
2404+ "$ref": "#/definitions/proto.File"
2405+ }
2406+ }
2407+ },
2408+ "404": {
2409+ "description": "Not Found",
2410+ "schema": {
2411+ "$ref": "#/definitions/proto.Error"
2412+ }
2413+ },
2414+ "500": {
2415+ "description": "Internal Server Error",
2416+ "schema": {
2417+ "$ref": "#/definitions/proto.Error"
2418+ }
2419+ }
2420+ }
2421+ }
2422+ },
2423+ "/workspaces/{id}/sessions/{sid}/messages": {
2424+ "get": {
2425+ "produces": [
2426+ "application/json"
2427+ ],
2428+ "tags": [
2429+ "sessions"
2430+ ],
2431+ "summary": "Get session messages",
2432+ "parameters": [
2433+ {
2434+ "type": "string",
2435+ "description": "Workspace ID",
2436+ "name": "id",
2437+ "in": "path",
2438+ "required": true
2439+ },
2440+ {
2441+ "type": "string",
2442+ "description": "Session ID",
2443+ "name": "sid",
2444+ "in": "path",
2445+ "required": true
2446+ }
2447+ ],
2448+ "responses": {
2449+ "200": {
2450+ "description": "OK",
2451+ "schema": {
2452+ "type": "array",
2453+ "items": {
2454+ "$ref": "#/definitions/github_com_charmbracelet_crush_internal_proto.Message"
2455+ }
2456+ }
2457+ },
2458+ "404": {
2459+ "description": "Not Found",
2460+ "schema": {
2461+ "$ref": "#/definitions/proto.Error"
2462+ }
2463+ },
2464+ "500": {
2465+ "description": "Internal Server Error",
2466+ "schema": {
2467+ "$ref": "#/definitions/proto.Error"
2468+ }
2469+ }
2470+ }
2471+ }
2472+ },
2473+ "/workspaces/{id}/sessions/{sid}/messages/user": {
2474+ "get": {
2475+ "produces": [
2476+ "application/json"
2477+ ],
2478+ "tags": [
2479+ "sessions"
2480+ ],
2481+ "summary": "Get user messages for session",
2482+ "parameters": [
2483+ {
2484+ "type": "string",
2485+ "description": "Workspace ID",
2486+ "name": "id",
2487+ "in": "path",
2488+ "required": true
2489+ },
2490+ {
2491+ "type": "string",
2492+ "description": "Session ID",
2493+ "name": "sid",
2494+ "in": "path",
2495+ "required": true
2496+ }
2497+ ],
2498+ "responses": {
2499+ "200": {
2500+ "description": "OK",
2501+ "schema": {
2502+ "type": "array",
2503+ "items": {
2504+ "$ref": "#/definitions/github_com_charmbracelet_crush_internal_proto.Message"
2505+ }
2506+ }
2507+ },
2508+ "404": {
2509+ "description": "Not Found",
2510+ "schema": {
2511+ "$ref": "#/definitions/proto.Error"
2512+ }
2513+ },
2514+ "500": {
2515+ "description": "Internal Server Error",
2516+ "schema": {
2517+ "$ref": "#/definitions/proto.Error"
2518+ }
2519+ }
2520+ }
2521+ }
2522+ }
2523+ },
2524+ "definitions": {
2525+ "catwalk.Model": {
2526+ "type": "object",
2527+ "properties": {
2528+ "can_reason": {
2529+ "type": "boolean"
2530+ },
2531+ "context_window": {
2532+ "type": "integer"
2533+ },
2534+ "cost_per_1m_in": {
2535+ "type": "number"
2536+ },
2537+ "cost_per_1m_in_cached": {
2538+ "type": "number"
2539+ },
2540+ "cost_per_1m_out": {
2541+ "type": "number"
2542+ },
2543+ "cost_per_1m_out_cached": {
2544+ "type": "number"
2545+ },
2546+ "default_max_tokens": {
2547+ "type": "integer"
2548+ },
2549+ "default_reasoning_effort": {
2550+ "type": "string"
2551+ },
2552+ "id": {
2553+ "type": "string"
2554+ },
2555+ "name": {
2556+ "type": "string"
2557+ },
2558+ "options": {
2559+ "$ref": "#/definitions/catwalk.ModelOptions"
2560+ },
2561+ "reasoning_levels": {
2562+ "type": "array",
2563+ "items": {
2564+ "type": "string"
2565+ }
2566+ },
2567+ "supports_attachments": {
2568+ "type": "boolean"
2569+ }
2570+ }
2571+ },
2572+ "catwalk.ModelOptions": {
2573+ "type": "object",
2574+ "properties": {
2575+ "frequency_penalty": {
2576+ "type": "number"
2577+ },
2578+ "presence_penalty": {
2579+ "type": "number"
2580+ },
2581+ "provider_options": {
2582+ "type": "object",
2583+ "additionalProperties": {}
2584+ },
2585+ "temperature": {
2586+ "type": "number"
2587+ },
2588+ "top_k": {
2589+ "type": "integer"
2590+ },
2591+ "top_p": {
2592+ "type": "number"
2593+ }
2594+ }
2595+ },
2596+ "config.Attribution": {
2597+ "type": "object",
2598+ "properties": {
2599+ "co_authored_by": {
2600+ "type": "boolean"
2601+ },
2602+ "generated_with": {
2603+ "type": "boolean"
2604+ },
2605+ "trailer_style": {
2606+ "$ref": "#/definitions/config.TrailerStyle"
2607+ }
2608+ }
2609+ },
2610+ "config.Completions": {
2611+ "type": "object",
2612+ "properties": {
2613+ "max_depth": {
2614+ "type": "integer"
2615+ },
2616+ "max_items": {
2617+ "type": "integer"
2618+ }
2619+ }
2620+ },
2621+ "config.LSPConfig": {
2622+ "type": "object",
2623+ "properties": {
2624+ "args": {
2625+ "type": "array",
2626+ "items": {
2627+ "type": "string"
2628+ }
2629+ },
2630+ "command": {
2631+ "type": "string"
2632+ },
2633+ "disabled": {
2634+ "type": "boolean"
2635+ },
2636+ "env": {
2637+ "type": "object",
2638+ "additionalProperties": {
2639+ "type": "string"
2640+ }
2641+ },
2642+ "filetypes": {
2643+ "type": "array",
2644+ "items": {
2645+ "type": "string"
2646+ }
2647+ },
2648+ "init_options": {
2649+ "type": "object",
2650+ "additionalProperties": {}
2651+ },
2652+ "options": {
2653+ "type": "object",
2654+ "additionalProperties": {}
2655+ },
2656+ "root_markers": {
2657+ "type": "array",
2658+ "items": {
2659+ "type": "string"
2660+ }
2661+ },
2662+ "timeout": {
2663+ "type": "integer"
2664+ }
2665+ }
2666+ },
2667+ "config.LSPs": {
2668+ "type": "object",
2669+ "additionalProperties": {
2670+ "$ref": "#/definitions/config.LSPConfig"
2671+ }
2672+ },
2673+ "config.MCPConfig": {
2674+ "type": "object",
2675+ "properties": {
2676+ "args": {
2677+ "type": "array",
2678+ "items": {
2679+ "type": "string"
2680+ }
2681+ },
2682+ "command": {
2683+ "type": "string"
2684+ },
2685+ "disabled": {
2686+ "type": "boolean"
2687+ },
2688+ "disabled_tools": {
2689+ "type": "array",
2690+ "items": {
2691+ "type": "string"
2692+ }
2693+ },
2694+ "env": {
2695+ "type": "object",
2696+ "additionalProperties": {
2697+ "type": "string"
2698+ }
2699+ },
2700+ "headers": {
2701+ "description": "TODO: maybe make it possible to get the value from the env",
2702+ "type": "object",
2703+ "additionalProperties": {
2704+ "type": "string"
2705+ }
2706+ },
2707+ "timeout": {
2708+ "type": "integer"
2709+ },
2710+ "type": {
2711+ "$ref": "#/definitions/config.MCPType"
2712+ },
2713+ "url": {
2714+ "type": "string"
2715+ }
2716+ }
2717+ },
2718+ "config.MCPType": {
2719+ "type": "string",
2720+ "enum": [
2721+ "stdio",
2722+ "sse",
2723+ "http"
2724+ ],
2725+ "x-enum-varnames": [
2726+ "MCPStdio",
2727+ "MCPSSE",
2728+ "MCPHttp"
2729+ ]
2730+ },
2731+ "config.MCPs": {
2732+ "type": "object",
2733+ "additionalProperties": {
2734+ "$ref": "#/definitions/config.MCPConfig"
2735+ }
2736+ },
2737+ "config.Permissions": {
2738+ "type": "object",
2739+ "properties": {
2740+ "allowed_tools": {
2741+ "type": "array",
2742+ "items": {
2743+ "type": "string"
2744+ }
2745+ }
2746+ }
2747+ },
2748+ "config.Scope": {
2749+ "type": "integer",
2750+ "enum": [
2751+ 0,
2752+ 1
2753+ ],
2754+ "x-enum-varnames": [
2755+ "ScopeGlobal",
2756+ "ScopeWorkspace"
2757+ ]
2758+ },
2759+ "config.SelectedModel": {
2760+ "type": "object",
2761+ "properties": {
2762+ "frequency_penalty": {
2763+ "type": "number"
2764+ },
2765+ "max_tokens": {
2766+ "description": "Overrides the default model configuration.",
2767+ "type": "integer"
2768+ },
2769+ "model": {
2770+ "description": "The model id as used by the provider API.\nRequired.",
2771+ "type": "string"
2772+ },
2773+ "presence_penalty": {
2774+ "type": "number"
2775+ },
2776+ "provider": {
2777+ "description": "The model provider, same as the key/id used in the providers config.\nRequired.",
2778+ "type": "string"
2779+ },
2780+ "provider_options": {
2781+ "description": "Override provider specific options.",
2782+ "type": "object",
2783+ "additionalProperties": {}
2784+ },
2785+ "reasoning_effort": {
2786+ "description": "Only used by models that use the openai provider and need this set.",
2787+ "type": "string"
2788+ },
2789+ "temperature": {
2790+ "type": "number"
2791+ },
2792+ "think": {
2793+ "description": "Used by anthropic models that can reason to indicate if the model should think.",
2794+ "type": "boolean"
2795+ },
2796+ "top_k": {
2797+ "type": "integer"
2798+ },
2799+ "top_p": {
2800+ "type": "number"
2801+ }
2802+ }
2803+ },
2804+ "config.SelectedModelType": {
2805+ "type": "string",
2806+ "enum": [
2807+ "large",
2808+ "small"
2809+ ],
2810+ "x-enum-varnames": [
2811+ "SelectedModelTypeLarge",
2812+ "SelectedModelTypeSmall"
2813+ ]
2814+ },
2815+ "config.TUIOptions": {
2816+ "type": "object",
2817+ "properties": {
2818+ "compact_mode": {
2819+ "type": "boolean"
2820+ },
2821+ "completions": {
2822+ "$ref": "#/definitions/config.Completions"
2823+ },
2824+ "diff_mode": {
2825+ "type": "string"
2826+ },
2827+ "transparent": {
2828+ "type": "boolean"
2829+ }
2830+ }
2831+ },
2832+ "config.ToolGrep": {
2833+ "type": "object",
2834+ "properties": {
2835+ "timeout": {
2836+ "$ref": "#/definitions/time.Duration"
2837+ }
2838+ }
2839+ },
2840+ "config.ToolLs": {
2841+ "type": "object",
2842+ "properties": {
2843+ "max_depth": {
2844+ "type": "integer"
2845+ },
2846+ "max_items": {
2847+ "type": "integer"
2848+ }
2849+ }
2850+ },
2851+ "config.Tools": {
2852+ "type": "object",
2853+ "properties": {
2854+ "grep": {
2855+ "$ref": "#/definitions/config.ToolGrep"
2856+ },
2857+ "ls": {
2858+ "$ref": "#/definitions/config.ToolLs"
2859+ }
2860+ }
2861+ },
2862+ "config.TrailerStyle": {
2863+ "type": "string",
2864+ "enum": [
2865+ "none",
2866+ "co-authored-by",
2867+ "assisted-by"
2868+ ],
2869+ "x-enum-varnames": [
2870+ "TrailerStyleNone",
2871+ "TrailerStyleCoAuthoredBy",
2872+ "TrailerStyleAssistedBy"
2873+ ]
2874+ },
2875+ "csync.Map-string-config_ProviderConfig": {
2876+ "type": "object"
2877+ },
2878+ "github_com_charmbracelet_crush_internal_config.Config": {
2879+ "type": "object",
2880+ "properties": {
2881+ "$schema": {
2882+ "type": "string"
2883+ },
2884+ "lsp": {
2885+ "$ref": "#/definitions/config.LSPs"
2886+ },
2887+ "mcp": {
2888+ "$ref": "#/definitions/config.MCPs"
2889+ },
2890+ "models": {
2891+ "description": "We currently only support large/small as values here.",
2892+ "type": "object",
2893+ "additionalProperties": {
2894+ "$ref": "#/definitions/config.SelectedModel"
2895+ }
2896+ },
2897+ "options": {
2898+ "$ref": "#/definitions/github_com_charmbracelet_crush_internal_config.Options"
2899+ },
2900+ "permissions": {
2901+ "$ref": "#/definitions/config.Permissions"
2902+ },
2903+ "providers": {
2904+ "description": "The providers that are configured",
2905+ "allOf": [
2906+ {
2907+ "$ref": "#/definitions/csync.Map-string-config_ProviderConfig"
2908+ }
2909+ ]
2910+ },
2911+ "recent_models": {
2912+ "description": "Recently used models stored in the data directory config.",
2913+ "type": "object",
2914+ "additionalProperties": {
2915+ "type": "array",
2916+ "items": {
2917+ "$ref": "#/definitions/config.SelectedModel"
2918+ }
2919+ }
2920+ },
2921+ "tools": {
2922+ "$ref": "#/definitions/config.Tools"
2923+ }
2924+ }
2925+ },
2926+ "github_com_charmbracelet_crush_internal_config.Options": {
2927+ "type": "object",
2928+ "properties": {
2929+ "attribution": {
2930+ "$ref": "#/definitions/config.Attribution"
2931+ },
2932+ "auto_lsp": {
2933+ "type": "boolean"
2934+ },
2935+ "context_paths": {
2936+ "type": "array",
2937+ "items": {
2938+ "type": "string"
2939+ }
2940+ },
2941+ "data_directory": {
2942+ "description": "Relative to the cwd",
2943+ "type": "string"
2944+ },
2945+ "debug": {
2946+ "type": "boolean"
2947+ },
2948+ "debug_lsp": {
2949+ "type": "boolean"
2950+ },
2951+ "disable_auto_summarize": {
2952+ "type": "boolean"
2953+ },
2954+ "disable_default_providers": {
2955+ "type": "boolean"
2956+ },
2957+ "disable_metrics": {
2958+ "type": "boolean"
2959+ },
2960+ "disable_notifications": {
2961+ "type": "boolean"
2962+ },
2963+ "disable_provider_auto_update": {
2964+ "type": "boolean"
2965+ },
2966+ "disabled_tools": {
2967+ "type": "array",
2968+ "items": {
2969+ "type": "string"
2970+ }
2971+ },
2972+ "initialize_as": {
2973+ "type": "string"
2974+ },
2975+ "progress": {
2976+ "type": "boolean"
2977+ },
2978+ "skills_paths": {
2979+ "type": "array",
2980+ "items": {
2981+ "type": "string"
2982+ }
2983+ },
2984+ "tui": {
2985+ "$ref": "#/definitions/config.TUIOptions"
2986+ }
2987+ }
2988+ },
2989+ "github_com_charmbracelet_crush_internal_proto.Message": {
2990+ "type": "object",
2991+ "properties": {
2992+ "created_at": {
2993+ "type": "integer"
2994+ },
2995+ "id": {
2996+ "type": "string"
2997+ },
2998+ "model": {
2999+ "type": "string"
3000+ },
3001+ "parts": {
3002+ "type": "array",
3003+ "items": {}
3004+ },
3005+ "provider": {
3006+ "type": "string"
3007+ },
3008+ "role": {
3009+ "$ref": "#/definitions/proto.MessageRole"
3010+ },
3011+ "session_id": {
3012+ "type": "string"
3013+ },
3014+ "updated_at": {
3015+ "type": "integer"
3016+ }
3017+ }
3018+ },
3019+ "lsp.ServerState": {
3020+ "type": "integer",
3021+ "enum": [
3022+ 0,
3023+ 1,
3024+ 2,
3025+ 3,
3026+ 4,
3027+ 5
3028+ ],
3029+ "x-enum-varnames": [
3030+ "StateUnstarted",
3031+ "StateStarting",
3032+ "StateReady",
3033+ "StateError",
3034+ "StateStopped",
3035+ "StateDisabled"
3036+ ]
3037+ },
3038+ "proto.AgentInfo": {
3039+ "type": "object",
3040+ "properties": {
3041+ "is_busy": {
3042+ "type": "boolean"
3043+ },
3044+ "is_ready": {
3045+ "type": "boolean"
3046+ },
3047+ "model": {
3048+ "$ref": "#/definitions/catwalk.Model"
3049+ },
3050+ "model_cfg": {
3051+ "$ref": "#/definitions/config.SelectedModel"
3052+ }
3053+ }
3054+ },
3055+ "proto.AgentMessage": {
3056+ "type": "object",
3057+ "properties": {
3058+ "attachments": {
3059+ "type": "array",
3060+ "items": {
3061+ "$ref": "#/definitions/proto.Attachment"
3062+ }
3063+ },
3064+ "prompt": {
3065+ "type": "string"
3066+ },
3067+ "session_id": {
3068+ "type": "string"
3069+ }
3070+ }
3071+ },
3072+ "proto.AgentSession": {
3073+ "type": "object",
3074+ "properties": {
3075+ "completion_tokens": {
3076+ "type": "integer"
3077+ },
3078+ "cost": {
3079+ "type": "number"
3080+ },
3081+ "created_at": {
3082+ "type": "integer"
3083+ },
3084+ "id": {
3085+ "type": "string"
3086+ },
3087+ "is_busy": {
3088+ "type": "boolean"
3089+ },
3090+ "message_count": {
3091+ "type": "integer"
3092+ },
3093+ "parent_session_id": {
3094+ "type": "string"
3095+ },
3096+ "prompt_tokens": {
3097+ "type": "integer"
3098+ },
3099+ "summary_message_id": {
3100+ "type": "string"
3101+ },
3102+ "title": {
3103+ "type": "string"
3104+ },
3105+ "updated_at": {
3106+ "type": "integer"
3107+ }
3108+ }
3109+ },
3110+ "proto.Attachment": {
3111+ "type": "object",
3112+ "properties": {
3113+ "content": {
3114+ "type": "array",
3115+ "items": {
3116+ "type": "integer"
3117+ }
3118+ },
3119+ "file_name": {
3120+ "type": "string"
3121+ },
3122+ "file_path": {
3123+ "type": "string"
3124+ },
3125+ "mime_type": {
3126+ "type": "string"
3127+ }
3128+ }
3129+ },
3130+ "proto.ConfigCompactRequest": {
3131+ "type": "object",
3132+ "properties": {
3133+ "enabled": {
3134+ "type": "boolean"
3135+ },
3136+ "scope": {
3137+ "$ref": "#/definitions/config.Scope"
3138+ }
3139+ }
3140+ },
3141+ "proto.ConfigModelRequest": {
3142+ "type": "object",
3143+ "properties": {
3144+ "model": {
3145+ "$ref": "#/definitions/config.SelectedModel"
3146+ },
3147+ "model_type": {
3148+ "$ref": "#/definitions/config.SelectedModelType"
3149+ },
3150+ "scope": {
3151+ "$ref": "#/definitions/config.Scope"
3152+ }
3153+ }
3154+ },
3155+ "proto.ConfigProviderKeyRequest": {
3156+ "type": "object",
3157+ "properties": {
3158+ "api_key": {},
3159+ "provider_id": {
3160+ "type": "string"
3161+ },
3162+ "scope": {
3163+ "$ref": "#/definitions/config.Scope"
3164+ }
3165+ }
3166+ },
3167+ "proto.ConfigRefreshOAuthRequest": {
3168+ "type": "object",
3169+ "properties": {
3170+ "provider_id": {
3171+ "type": "string"
3172+ },
3173+ "scope": {
3174+ "$ref": "#/definitions/config.Scope"
3175+ }
3176+ }
3177+ },
3178+ "proto.ConfigRemoveRequest": {
3179+ "type": "object",
3180+ "properties": {
3181+ "key": {
3182+ "type": "string"
3183+ },
3184+ "scope": {
3185+ "$ref": "#/definitions/config.Scope"
3186+ }
3187+ }
3188+ },
3189+ "proto.ConfigSetRequest": {
3190+ "type": "object",
3191+ "properties": {
3192+ "key": {
3193+ "type": "string"
3194+ },
3195+ "scope": {
3196+ "$ref": "#/definitions/config.Scope"
3197+ },
3198+ "value": {}
3199+ }
3200+ },
3201+ "proto.Error": {
3202+ "type": "object",
3203+ "properties": {
3204+ "message": {
3205+ "type": "string"
3206+ }
3207+ }
3208+ },
3209+ "proto.File": {
3210+ "type": "object",
3211+ "properties": {
3212+ "content": {
3213+ "type": "string"
3214+ },
3215+ "created_at": {
3216+ "type": "integer"
3217+ },
3218+ "id": {
3219+ "type": "string"
3220+ },
3221+ "path": {
3222+ "type": "string"
3223+ },
3224+ "session_id": {
3225+ "type": "string"
3226+ },
3227+ "updated_at": {
3228+ "type": "integer"
3229+ },
3230+ "version": {
3231+ "type": "integer"
3232+ }
3233+ }
3234+ },
3235+ "proto.FileTrackerReadRequest": {
3236+ "type": "object",
3237+ "properties": {
3238+ "path": {
3239+ "type": "string"
3240+ },
3241+ "session_id": {
3242+ "type": "string"
3243+ }
3244+ }
3245+ },
3246+ "proto.ImportCopilotResponse": {
3247+ "type": "object",
3248+ "properties": {
3249+ "success": {
3250+ "type": "boolean"
3251+ },
3252+ "token": {}
3253+ }
3254+ },
3255+ "proto.LSPClientInfo": {
3256+ "type": "object",
3257+ "properties": {
3258+ "connected_at": {
3259+ "type": "string"
3260+ },
3261+ "diagnostic_count": {
3262+ "type": "integer"
3263+ },
3264+ "error": {},
3265+ "name": {
3266+ "type": "string"
3267+ },
3268+ "state": {
3269+ "$ref": "#/definitions/lsp.ServerState"
3270+ }
3271+ }
3272+ },
3273+ "proto.LSPStartRequest": {
3274+ "type": "object",
3275+ "properties": {
3276+ "path": {
3277+ "type": "string"
3278+ }
3279+ }
3280+ },
3281+ "proto.MCPClientInfo": {
3282+ "type": "object",
3283+ "properties": {
3284+ "connected_at": {
3285+ "type": "string"
3286+ },
3287+ "error": {},
3288+ "name": {
3289+ "type": "string"
3290+ },
3291+ "prompt_count": {
3292+ "type": "integer"
3293+ },
3294+ "resource_count": {
3295+ "type": "integer"
3296+ },
3297+ "state": {
3298+ "$ref": "#/definitions/proto.MCPState"
3299+ },
3300+ "tool_count": {
3301+ "type": "integer"
3302+ }
3303+ }
3304+ },
3305+ "proto.MCPGetPromptRequest": {
3306+ "type": "object",
3307+ "properties": {
3308+ "args": {
3309+ "type": "object",
3310+ "additionalProperties": {
3311+ "type": "string"
3312+ }
3313+ },
3314+ "client_id": {
3315+ "type": "string"
3316+ },
3317+ "prompt_id": {
3318+ "type": "string"
3319+ }
3320+ }
3321+ },
3322+ "proto.MCPGetPromptResponse": {
3323+ "type": "object",
3324+ "properties": {
3325+ "prompt": {
3326+ "type": "string"
3327+ }
3328+ }
3329+ },
3330+ "proto.MCPNameRequest": {
3331+ "type": "object",
3332+ "properties": {
3333+ "name": {
3334+ "type": "string"
3335+ }
3336+ }
3337+ },
3338+ "proto.MCPReadResourceRequest": {
3339+ "type": "object",
3340+ "properties": {
3341+ "name": {
3342+ "type": "string"
3343+ },
3344+ "uri": {
3345+ "type": "string"
3346+ }
3347+ }
3348+ },
3349+ "proto.MCPState": {
3350+ "type": "integer",
3351+ "enum": [
3352+ 0,
3353+ 1,
3354+ 2,
3355+ 3
3356+ ],
3357+ "x-enum-varnames": [
3358+ "MCPStateDisabled",
3359+ "MCPStateStarting",
3360+ "MCPStateConnected",
3361+ "MCPStateError"
3362+ ]
3363+ },
3364+ "proto.MessageRole": {
3365+ "type": "string",
3366+ "enum": [
3367+ "assistant",
3368+ "user",
3369+ "system",
3370+ "tool"
3371+ ],
3372+ "x-enum-varnames": [
3373+ "Assistant",
3374+ "User",
3375+ "System",
3376+ "Tool"
3377+ ]
3378+ },
3379+ "proto.PermissionAction": {
3380+ "type": "string",
3381+ "enum": [
3382+ "allow",
3383+ "allow_session",
3384+ "deny"
3385+ ],
3386+ "x-enum-varnames": [
3387+ "PermissionAllow",
3388+ "PermissionAllowForSession",
3389+ "PermissionDeny"
3390+ ]
3391+ },
3392+ "proto.PermissionGrant": {
3393+ "type": "object",
3394+ "properties": {
3395+ "action": {
3396+ "$ref": "#/definitions/proto.PermissionAction"
3397+ },
3398+ "permission": {
3399+ "$ref": "#/definitions/proto.PermissionRequest"
3400+ }
3401+ }
3402+ },
3403+ "proto.PermissionRequest": {
3404+ "type": "object",
3405+ "properties": {
3406+ "action": {
3407+ "type": "string"
3408+ },
3409+ "description": {
3410+ "type": "string"
3411+ },
3412+ "id": {
3413+ "type": "string"
3414+ },
3415+ "params": {},
3416+ "path": {
3417+ "type": "string"
3418+ },
3419+ "session_id": {
3420+ "type": "string"
3421+ },
3422+ "tool_call_id": {
3423+ "type": "string"
3424+ },
3425+ "tool_name": {
3426+ "type": "string"
3427+ }
3428+ }
3429+ },
3430+ "proto.PermissionSkipRequest": {
3431+ "type": "object",
3432+ "properties": {
3433+ "skip": {
3434+ "type": "boolean"
3435+ }
3436+ }
3437+ },
3438+ "proto.ProjectInitPromptResponse": {
3439+ "type": "object",
3440+ "properties": {
3441+ "prompt": {
3442+ "type": "string"
3443+ }
3444+ }
3445+ },
3446+ "proto.ProjectNeedsInitResponse": {
3447+ "type": "object",
3448+ "properties": {
3449+ "needs_init": {
3450+ "type": "boolean"
3451+ }
3452+ }
3453+ },
3454+ "proto.ServerControl": {
3455+ "type": "object",
3456+ "properties": {
3457+ "command": {
3458+ "type": "string"
3459+ }
3460+ }
3461+ },
3462+ "proto.Session": {
3463+ "type": "object",
3464+ "properties": {
3465+ "completion_tokens": {
3466+ "type": "integer"
3467+ },
3468+ "cost": {
3469+ "type": "number"
3470+ },
3471+ "created_at": {
3472+ "type": "integer"
3473+ },
3474+ "id": {
3475+ "type": "string"
3476+ },
3477+ "message_count": {
3478+ "type": "integer"
3479+ },
3480+ "parent_session_id": {
3481+ "type": "string"
3482+ },
3483+ "prompt_tokens": {
3484+ "type": "integer"
3485+ },
3486+ "summary_message_id": {
3487+ "type": "string"
3488+ },
3489+ "title": {
3490+ "type": "string"
3491+ },
3492+ "updated_at": {
3493+ "type": "integer"
3494+ }
3495+ }
3496+ },
3497+ "proto.VersionInfo": {
3498+ "type": "object",
3499+ "properties": {
3500+ "commit": {
3501+ "type": "string"
3502+ },
3503+ "go_version": {
3504+ "type": "string"
3505+ },
3506+ "platform": {
3507+ "type": "string"
3508+ },
3509+ "version": {
3510+ "type": "string"
3511+ }
3512+ }
3513+ },
3514+ "proto.Workspace": {
3515+ "type": "object",
3516+ "properties": {
3517+ "config": {
3518+ "$ref": "#/definitions/github_com_charmbracelet_crush_internal_config.Config"
3519+ },
3520+ "data_dir": {
3521+ "type": "string"
3522+ },
3523+ "debug": {
3524+ "type": "boolean"
3525+ },
3526+ "env": {
3527+ "type": "array",
3528+ "items": {
3529+ "type": "string"
3530+ }
3531+ },
3532+ "id": {
3533+ "type": "string"
3534+ },
3535+ "path": {
3536+ "type": "string"
3537+ },
3538+ "version": {
3539+ "type": "string"
3540+ },
3541+ "yolo": {
3542+ "type": "boolean"
3543+ }
3544+ }
3545+ },
3546+ "time.Duration": {
3547+ "type": "integer",
3548+ "format": "int64",
3549+ "enum": [
3550+ -9223372036854775808,
3551+ 9223372036854775807,
3552+ 1,
3553+ 1000,
3554+ 1000000,
3555+ 1000000000,
3556+ 60000000000,
3557+ 3600000000000
3558+ ],
3559+ "x-enum-varnames": [
3560+ "minDuration",
3561+ "maxDuration",
3562+ "Nanosecond",
3563+ "Microsecond",
3564+ "Millisecond",
3565+ "Second",
3566+ "Minute",
3567+ "Hour"
3568+ ]
3569+ }
3570+ }
3571+}`
3572+
3573+// SwaggerInfo holds exported Swagger Info so clients can modify it
3574+var SwaggerInfo = &swag.Spec{
3575+ Version: "1.0",
3576+ Host: "",
3577+ BasePath: "/v1",
3578+ Schemes: []string{},
3579+ Title: "Crush API",
3580+ Description: "Crush is a terminal-based AI coding assistant. This API is served over a Unix socket (or Windows named pipe) and provides programmatic access to workspaces, sessions, agents, LSP, MCP, and more.",
3581+ InfoInstanceName: "swagger",
3582+ SwaggerTemplate: docTemplate,
3583+ LeftDelim: "{{",
3584+ RightDelim: "}}",
3585+}
3586+
3587+func init() {
3588+ swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
3589+}
internal/swagger/swagger.jsonnew file+3564
@@ -0,0 +1,3564 @@
1+{
2+ "swagger": "2.0",
3+ "info": {
4+ "description": "Crush is a terminal-based AI coding assistant. This API is served over a Unix socket (or Windows named pipe) and provides programmatic access to workspaces, sessions, agents, LSP, MCP, and more.",
5+ "title": "Crush API",
6+ "contact": {
7+ "name": "Charm",
8+ "url": "https://charm.sh"
9+ },
10+ "license": {
11+ "name": "MIT",
12+ "url": "https://github.com/charmbracelet/crush/blob/main/LICENSE"
13+ },
14+ "version": "1.0"
15+ },
16+ "basePath": "/v1",
17+ "paths": {
18+ "/config": {
19+ "get": {
20+ "produces": [
21+ "application/json"
22+ ],
23+ "tags": [
24+ "system"
25+ ],
26+ "summary": "Get server config",
27+ "responses": {
28+ "200": {
29+ "description": "OK",
30+ "schema": {
31+ "type": "object"
32+ }
33+ }
34+ }
35+ }
36+ },
37+ "/control": {
38+ "post": {
39+ "consumes": [
40+ "application/json"
41+ ],
42+ "tags": [
43+ "system"
44+ ],
45+ "summary": "Send server control command",
46+ "parameters": [
47+ {
48+ "description": "Control command (e.g. shutdown)",
49+ "name": "request",
50+ "in": "body",
51+ "required": true,
52+ "schema": {
53+ "$ref": "#/definitions/proto.ServerControl"
54+ }
55+ }
56+ ],
57+ "responses": {
58+ "200": {
59+ "description": "OK"
60+ },
61+ "400": {
62+ "description": "Bad Request",
63+ "schema": {
64+ "$ref": "#/definitions/proto.Error"
65+ }
66+ }
67+ }
68+ }
69+ },
70+ "/health": {
71+ "get": {
72+ "tags": [
73+ "system"
74+ ],
75+ "summary": "Health check",
76+ "responses": {
77+ "200": {
78+ "description": "OK"
79+ }
80+ }
81+ }
82+ },
83+ "/version": {
84+ "get": {
85+ "produces": [
86+ "application/json"
87+ ],
88+ "tags": [
89+ "system"
90+ ],
91+ "summary": "Get server version",
92+ "responses": {
93+ "200": {
94+ "description": "OK",
95+ "schema": {
96+ "$ref": "#/definitions/proto.VersionInfo"
97+ }
98+ }
99+ }
100+ }
101+ },
102+ "/workspaces": {
103+ "get": {
104+ "produces": [
105+ "application/json"
106+ ],
107+ "tags": [
108+ "workspaces"
109+ ],
110+ "summary": "List workspaces",
111+ "responses": {
112+ "200": {
113+ "description": "OK",
114+ "schema": {
115+ "type": "array",
116+ "items": {
117+ "$ref": "#/definitions/proto.Workspace"
118+ }
119+ }
120+ }
121+ }
122+ },
123+ "post": {
124+ "consumes": [
125+ "application/json"
126+ ],
127+ "produces": [
128+ "application/json"
129+ ],
130+ "tags": [
131+ "workspaces"
132+ ],
133+ "summary": "Create workspace",
134+ "parameters": [
135+ {
136+ "description": "Workspace creation params",
137+ "name": "request",
138+ "in": "body",
139+ "required": true,
140+ "schema": {
141+ "$ref": "#/definitions/proto.Workspace"
142+ }
143+ }
144+ ],
145+ "responses": {
146+ "200": {
147+ "description": "OK",
148+ "schema": {
149+ "$ref": "#/definitions/proto.Workspace"
150+ }
151+ },
152+ "400": {
153+ "description": "Bad Request",
154+ "schema": {
155+ "$ref": "#/definitions/proto.Error"
156+ }
157+ },
158+ "500": {
159+ "description": "Internal Server Error",
160+ "schema": {
161+ "$ref": "#/definitions/proto.Error"
162+ }
163+ }
164+ }
165+ }
166+ },
167+ "/workspaces/{id}": {
168+ "get": {
169+ "produces": [
170+ "application/json"
171+ ],
172+ "tags": [
173+ "workspaces"
174+ ],
175+ "summary": "Get workspace",
176+ "parameters": [
177+ {
178+ "type": "string",
179+ "description": "Workspace ID",
180+ "name": "id",
181+ "in": "path",
182+ "required": true
183+ }
184+ ],
185+ "responses": {
186+ "200": {
187+ "description": "OK",
188+ "schema": {
189+ "$ref": "#/definitions/proto.Workspace"
190+ }
191+ },
192+ "404": {
193+ "description": "Not Found",
194+ "schema": {
195+ "$ref": "#/definitions/proto.Error"
196+ }
197+ },
198+ "500": {
199+ "description": "Internal Server Error",
200+ "schema": {
201+ "$ref": "#/definitions/proto.Error"
202+ }
203+ }
204+ }
205+ },
206+ "delete": {
207+ "tags": [
208+ "workspaces"
209+ ],
210+ "summary": "Delete workspace",
211+ "parameters": [
212+ {
213+ "type": "string",
214+ "description": "Workspace ID",
215+ "name": "id",
216+ "in": "path",
217+ "required": true
218+ }
219+ ],
220+ "responses": {
221+ "200": {
222+ "description": "OK"
223+ },
224+ "404": {
225+ "description": "Not Found",
226+ "schema": {
227+ "$ref": "#/definitions/proto.Error"
228+ }
229+ }
230+ }
231+ }
232+ },
233+ "/workspaces/{id}/agent": {
234+ "get": {
235+ "produces": [
236+ "application/json"
237+ ],
238+ "tags": [
239+ "agent"
240+ ],
241+ "summary": "Get agent info",
242+ "parameters": [
243+ {
244+ "type": "string",
245+ "description": "Workspace ID",
246+ "name": "id",
247+ "in": "path",
248+ "required": true
249+ }
250+ ],
251+ "responses": {
252+ "200": {
253+ "description": "OK",
254+ "schema": {
255+ "$ref": "#/definitions/proto.AgentInfo"
256+ }
257+ },
258+ "404": {
259+ "description": "Not Found",
260+ "schema": {
261+ "$ref": "#/definitions/proto.Error"
262+ }
263+ },
264+ "500": {
265+ "description": "Internal Server Error",
266+ "schema": {
267+ "$ref": "#/definitions/proto.Error"
268+ }
269+ }
270+ }
271+ },
272+ "post": {
273+ "consumes": [
274+ "application/json"
275+ ],
276+ "tags": [
277+ "agent"
278+ ],
279+ "summary": "Send message to agent",
280+ "parameters": [
281+ {
282+ "type": "string",
283+ "description": "Workspace ID",
284+ "name": "id",
285+ "in": "path",
286+ "required": true
287+ },
288+ {
289+ "description": "Agent message",
290+ "name": "request",
291+ "in": "body",
292+ "required": true,
293+ "schema": {
294+ "$ref": "#/definitions/proto.AgentMessage"
295+ }
296+ }
297+ ],
298+ "responses": {
299+ "200": {
300+ "description": "OK"
301+ },
302+ "400": {
303+ "description": "Bad Request",
304+ "schema": {
305+ "$ref": "#/definitions/proto.Error"
306+ }
307+ },
308+ "404": {
309+ "description": "Not Found",
310+ "schema": {
311+ "$ref": "#/definitions/proto.Error"
312+ }
313+ },
314+ "500": {
315+ "description": "Internal Server Error",
316+ "schema": {
317+ "$ref": "#/definitions/proto.Error"
318+ }
319+ }
320+ }
321+ }
322+ },
323+ "/workspaces/{id}/agent/default-small-model": {
324+ "get": {
325+ "produces": [
326+ "application/json"
327+ ],
328+ "tags": [
329+ "agent"
330+ ],
331+ "summary": "Get default small model",
332+ "parameters": [
333+ {
334+ "type": "string",
335+ "description": "Workspace ID",
336+ "name": "id",
337+ "in": "path",
338+ "required": true
339+ },
340+ {
341+ "type": "string",
342+ "description": "Provider ID",
343+ "name": "provider_id",
344+ "in": "query"
345+ }
346+ ],
347+ "responses": {
348+ "200": {
349+ "description": "OK",
350+ "schema": {
351+ "type": "object"
352+ }
353+ },
354+ "404": {
355+ "description": "Not Found",
356+ "schema": {
357+ "$ref": "#/definitions/proto.Error"
358+ }
359+ },
360+ "500": {
361+ "description": "Internal Server Error",
362+ "schema": {
363+ "$ref": "#/definitions/proto.Error"
364+ }
365+ }
366+ }
367+ }
368+ },
369+ "/workspaces/{id}/agent/init": {
370+ "post": {
371+ "tags": [
372+ "agent"
373+ ],
374+ "summary": "Initialize agent",
375+ "parameters": [
376+ {
377+ "type": "string",
378+ "description": "Workspace ID",
379+ "name": "id",
380+ "in": "path",
381+ "required": true
382+ }
383+ ],
384+ "responses": {
385+ "200": {
386+ "description": "OK"
387+ },
388+ "404": {
389+ "description": "Not Found",
390+ "schema": {
391+ "$ref": "#/definitions/proto.Error"
392+ }
393+ },
394+ "500": {
395+ "description": "Internal Server Error",
396+ "schema": {
397+ "$ref": "#/definitions/proto.Error"
398+ }
399+ }
400+ }
401+ }
402+ },
403+ "/workspaces/{id}/agent/sessions/{sid}": {
404+ "get": {
405+ "produces": [
406+ "application/json"
407+ ],
408+ "tags": [
409+ "agent"
410+ ],
411+ "summary": "Get agent session",
412+ "parameters": [
413+ {
414+ "type": "string",
415+ "description": "Workspace ID",
416+ "name": "id",
417+ "in": "path",
418+ "required": true
419+ },
420+ {
421+ "type": "string",
422+ "description": "Session ID",
423+ "name": "sid",
424+ "in": "path",
425+ "required": true
426+ }
427+ ],
428+ "responses": {
429+ "200": {
430+ "description": "OK",
431+ "schema": {
432+ "$ref": "#/definitions/proto.AgentSession"
433+ }
434+ },
435+ "404": {
436+ "description": "Not Found",
437+ "schema": {
438+ "$ref": "#/definitions/proto.Error"
439+ }
440+ },
441+ "500": {
442+ "description": "Internal Server Error",
443+ "schema": {
444+ "$ref": "#/definitions/proto.Error"
445+ }
446+ }
447+ }
448+ }
449+ },
450+ "/workspaces/{id}/agent/sessions/{sid}/cancel": {
451+ "post": {
452+ "tags": [
453+ "agent"
454+ ],
455+ "summary": "Cancel agent session",
456+ "parameters": [
457+ {
458+ "type": "string",
459+ "description": "Workspace ID",
460+ "name": "id",
461+ "in": "path",
462+ "required": true
463+ },
464+ {
465+ "type": "string",
466+ "description": "Session ID",
467+ "name": "sid",
468+ "in": "path",
469+ "required": true
470+ }
471+ ],
472+ "responses": {
473+ "200": {
474+ "description": "OK"
475+ },
476+ "404": {
477+ "description": "Not Found",
478+ "schema": {
479+ "$ref": "#/definitions/proto.Error"
480+ }
481+ },
482+ "500": {
483+ "description": "Internal Server Error",
484+ "schema": {
485+ "$ref": "#/definitions/proto.Error"
486+ }
487+ }
488+ }
489+ }
490+ },
491+ "/workspaces/{id}/agent/sessions/{sid}/prompts/clear": {
492+ "post": {
493+ "tags": [
494+ "agent"
495+ ],
496+ "summary": "Clear prompt queue",
497+ "parameters": [
498+ {
499+ "type": "string",
500+ "description": "Workspace ID",
501+ "name": "id",
502+ "in": "path",
503+ "required": true
504+ },
505+ {
506+ "type": "string",
507+ "description": "Session ID",
508+ "name": "sid",
509+ "in": "path",
510+ "required": true
511+ }
512+ ],
513+ "responses": {
514+ "200": {
515+ "description": "OK"
516+ },
517+ "404": {
518+ "description": "Not Found",
519+ "schema": {
520+ "$ref": "#/definitions/proto.Error"
521+ }
522+ },
523+ "500": {
524+ "description": "Internal Server Error",
525+ "schema": {
526+ "$ref": "#/definitions/proto.Error"
527+ }
528+ }
529+ }
530+ }
531+ },
532+ "/workspaces/{id}/agent/sessions/{sid}/prompts/list": {
533+ "get": {
534+ "produces": [
535+ "application/json"
536+ ],
537+ "tags": [
538+ "agent"
539+ ],
540+ "summary": "List queued prompts",
541+ "parameters": [
542+ {
543+ "type": "string",
544+ "description": "Workspace ID",
545+ "name": "id",
546+ "in": "path",
547+ "required": true
548+ },
549+ {
550+ "type": "string",
551+ "description": "Session ID",
552+ "name": "sid",
553+ "in": "path",
554+ "required": true
555+ }
556+ ],
557+ "responses": {
558+ "200": {
559+ "description": "OK",
560+ "schema": {
561+ "type": "array",
562+ "items": {
563+ "type": "string"
564+ }
565+ }
566+ },
567+ "404": {
568+ "description": "Not Found",
569+ "schema": {
570+ "$ref": "#/definitions/proto.Error"
571+ }
572+ },
573+ "500": {
574+ "description": "Internal Server Error",
575+ "schema": {
576+ "$ref": "#/definitions/proto.Error"
577+ }
578+ }
579+ }
580+ }
581+ },
582+ "/workspaces/{id}/agent/sessions/{sid}/prompts/queued": {
583+ "get": {
584+ "produces": [
585+ "application/json"
586+ ],
587+ "tags": [
588+ "agent"
589+ ],
590+ "summary": "Get queued prompt status",
591+ "parameters": [
592+ {
593+ "type": "string",
594+ "description": "Workspace ID",
595+ "name": "id",
596+ "in": "path",
597+ "required": true
598+ },
599+ {
600+ "type": "string",
601+ "description": "Session ID",
602+ "name": "sid",
603+ "in": "path",
604+ "required": true
605+ }
606+ ],
607+ "responses": {
608+ "200": {
609+ "description": "OK",
610+ "schema": {
611+ "type": "object"
612+ }
613+ },
614+ "404": {
615+ "description": "Not Found",
616+ "schema": {
617+ "$ref": "#/definitions/proto.Error"
618+ }
619+ },
620+ "500": {
621+ "description": "Internal Server Error",
622+ "schema": {
623+ "$ref": "#/definitions/proto.Error"
624+ }
625+ }
626+ }
627+ }
628+ },
629+ "/workspaces/{id}/agent/sessions/{sid}/summarize": {
630+ "post": {
631+ "tags": [
632+ "agent"
633+ ],
634+ "summary": "Summarize session",
635+ "parameters": [
636+ {
637+ "type": "string",
638+ "description": "Workspace ID",
639+ "name": "id",
640+ "in": "path",
641+ "required": true
642+ },
643+ {
644+ "type": "string",
645+ "description": "Session ID",
646+ "name": "sid",
647+ "in": "path",
648+ "required": true
649+ }
650+ ],
651+ "responses": {
652+ "200": {
653+ "description": "OK"
654+ },
655+ "404": {
656+ "description": "Not Found",
657+ "schema": {
658+ "$ref": "#/definitions/proto.Error"
659+ }
660+ },
661+ "500": {
662+ "description": "Internal Server Error",
663+ "schema": {
664+ "$ref": "#/definitions/proto.Error"
665+ }
666+ }
667+ }
668+ }
669+ },
670+ "/workspaces/{id}/agent/update": {
671+ "post": {
672+ "tags": [
673+ "agent"
674+ ],
675+ "summary": "Update agent",
676+ "parameters": [
677+ {
678+ "type": "string",
679+ "description": "Workspace ID",
680+ "name": "id",
681+ "in": "path",
682+ "required": true
683+ }
684+ ],
685+ "responses": {
686+ "200": {
687+ "description": "OK"
688+ },
689+ "404": {
690+ "description": "Not Found",
691+ "schema": {
692+ "$ref": "#/definitions/proto.Error"
693+ }
694+ },
695+ "500": {
696+ "description": "Internal Server Error",
697+ "schema": {
698+ "$ref": "#/definitions/proto.Error"
699+ }
700+ }
701+ }
702+ }
703+ },
704+ "/workspaces/{id}/config": {
705+ "get": {
706+ "produces": [
707+ "application/json"
708+ ],
709+ "tags": [
710+ "workspaces"
711+ ],
712+ "summary": "Get workspace config",
713+ "parameters": [
714+ {
715+ "type": "string",
716+ "description": "Workspace ID",
717+ "name": "id",
718+ "in": "path",
719+ "required": true
720+ }
721+ ],
722+ "responses": {
723+ "200": {
724+ "description": "OK",
725+ "schema": {
726+ "type": "object"
727+ }
728+ },
729+ "404": {
730+ "description": "Not Found",
731+ "schema": {
732+ "$ref": "#/definitions/proto.Error"
733+ }
734+ },
735+ "500": {
736+ "description": "Internal Server Error",
737+ "schema": {
738+ "$ref": "#/definitions/proto.Error"
739+ }
740+ }
741+ }
742+ }
743+ },
744+ "/workspaces/{id}/config/compact": {
745+ "post": {
746+ "consumes": [
747+ "application/json"
748+ ],
749+ "tags": [
750+ "config"
751+ ],
752+ "summary": "Set compact mode",
753+ "parameters": [
754+ {
755+ "type": "string",
756+ "description": "Workspace ID",
757+ "name": "id",
758+ "in": "path",
759+ "required": true
760+ },
761+ {
762+ "description": "Config compact request",
763+ "name": "request",
764+ "in": "body",
765+ "required": true,
766+ "schema": {
767+ "$ref": "#/definitions/proto.ConfigCompactRequest"
768+ }
769+ }
770+ ],
771+ "responses": {
772+ "200": {
773+ "description": "OK"
774+ },
775+ "400": {
776+ "description": "Bad Request",
777+ "schema": {
778+ "$ref": "#/definitions/proto.Error"
779+ }
780+ },
781+ "404": {
782+ "description": "Not Found",
783+ "schema": {
784+ "$ref": "#/definitions/proto.Error"
785+ }
786+ },
787+ "500": {
788+ "description": "Internal Server Error",
789+ "schema": {
790+ "$ref": "#/definitions/proto.Error"
791+ }
792+ }
793+ }
794+ }
795+ },
796+ "/workspaces/{id}/config/import-copilot": {
797+ "post": {
798+ "produces": [
799+ "application/json"
800+ ],
801+ "tags": [
802+ "config"
803+ ],
804+ "summary": "Import Copilot credentials",
805+ "parameters": [
806+ {
807+ "type": "string",
808+ "description": "Workspace ID",
809+ "name": "id",
810+ "in": "path",
811+ "required": true
812+ }
813+ ],
814+ "responses": {
815+ "200": {
816+ "description": "OK",
817+ "schema": {
818+ "$ref": "#/definitions/proto.ImportCopilotResponse"
819+ }
820+ },
821+ "404": {
822+ "description": "Not Found",
823+ "schema": {
824+ "$ref": "#/definitions/proto.Error"
825+ }
826+ },
827+ "500": {
828+ "description": "Internal Server Error",
829+ "schema": {
830+ "$ref": "#/definitions/proto.Error"
831+ }
832+ }
833+ }
834+ }
835+ },
836+ "/workspaces/{id}/config/model": {
837+ "post": {
838+ "consumes": [
839+ "application/json"
840+ ],
841+ "tags": [
842+ "config"
843+ ],
844+ "summary": "Set the preferred model",
845+ "parameters": [
846+ {
847+ "type": "string",
848+ "description": "Workspace ID",
849+ "name": "id",
850+ "in": "path",
851+ "required": true
852+ },
853+ {
854+ "description": "Config model request",
855+ "name": "request",
856+ "in": "body",
857+ "required": true,
858+ "schema": {
859+ "$ref": "#/definitions/proto.ConfigModelRequest"
860+ }
861+ }
862+ ],
863+ "responses": {
864+ "200": {
865+ "description": "OK"
866+ },
867+ "400": {
868+ "description": "Bad Request",
869+ "schema": {
870+ "$ref": "#/definitions/proto.Error"
871+ }
872+ },
873+ "404": {
874+ "description": "Not Found",
875+ "schema": {
876+ "$ref": "#/definitions/proto.Error"
877+ }
878+ },
879+ "500": {
880+ "description": "Internal Server Error",
881+ "schema": {
882+ "$ref": "#/definitions/proto.Error"
883+ }
884+ }
885+ }
886+ }
887+ },
888+ "/workspaces/{id}/config/provider-key": {
889+ "post": {
890+ "consumes": [
891+ "application/json"
892+ ],
893+ "tags": [
894+ "config"
895+ ],
896+ "summary": "Set provider API key",
897+ "parameters": [
898+ {
899+ "type": "string",
900+ "description": "Workspace ID",
901+ "name": "id",
902+ "in": "path",
903+ "required": true
904+ },
905+ {
906+ "description": "Config provider key request",
907+ "name": "request",
908+ "in": "body",
909+ "required": true,
910+ "schema": {
911+ "$ref": "#/definitions/proto.ConfigProviderKeyRequest"
912+ }
913+ }
914+ ],
915+ "responses": {
916+ "200": {
917+ "description": "OK"
918+ },
919+ "400": {
920+ "description": "Bad Request",
921+ "schema": {
922+ "$ref": "#/definitions/proto.Error"
923+ }
924+ },
925+ "404": {
926+ "description": "Not Found",
927+ "schema": {
928+ "$ref": "#/definitions/proto.Error"
929+ }
930+ },
931+ "500": {
932+ "description": "Internal Server Error",
933+ "schema": {
934+ "$ref": "#/definitions/proto.Error"
935+ }
936+ }
937+ }
938+ }
939+ },
940+ "/workspaces/{id}/config/refresh-oauth": {
941+ "post": {
942+ "consumes": [
943+ "application/json"
944+ ],
945+ "tags": [
946+ "config"
947+ ],
948+ "summary": "Refresh OAuth token",
949+ "parameters": [
950+ {
951+ "type": "string",
952+ "description": "Workspace ID",
953+ "name": "id",
954+ "in": "path",
955+ "required": true
956+ },
957+ {
958+ "description": "Refresh OAuth request",
959+ "name": "request",
960+ "in": "body",
961+ "required": true,
962+ "schema": {
963+ "$ref": "#/definitions/proto.ConfigRefreshOAuthRequest"
964+ }
965+ }
966+ ],
967+ "responses": {
968+ "200": {
969+ "description": "OK"
970+ },
971+ "400": {
972+ "description": "Bad Request",
973+ "schema": {
974+ "$ref": "#/definitions/proto.Error"
975+ }
976+ },
977+ "404": {
978+ "description": "Not Found",
979+ "schema": {
980+ "$ref": "#/definitions/proto.Error"
981+ }
982+ },
983+ "500": {
984+ "description": "Internal Server Error",
985+ "schema": {
986+ "$ref": "#/definitions/proto.Error"
987+ }
988+ }
989+ }
990+ }
991+ },
992+ "/workspaces/{id}/config/remove": {
993+ "post": {
994+ "consumes": [
995+ "application/json"
996+ ],
997+ "tags": [
998+ "config"
999+ ],
1000+ "summary": "Remove a config field",
1001+ "parameters": [
1002+ {
1003+ "type": "string",
1004+ "description": "Workspace ID",
1005+ "name": "id",
1006+ "in": "path",
1007+ "required": true
1008+ },
1009+ {
1010+ "description": "Config remove request",
1011+ "name": "request",
1012+ "in": "body",
1013+ "required": true,
1014+ "schema": {
1015+ "$ref": "#/definitions/proto.ConfigRemoveRequest"
1016+ }
1017+ }
1018+ ],
1019+ "responses": {
1020+ "200": {
1021+ "description": "OK"
1022+ },
1023+ "400": {
1024+ "description": "Bad Request",
1025+ "schema": {
1026+ "$ref": "#/definitions/proto.Error"
1027+ }
1028+ },
1029+ "404": {
1030+ "description": "Not Found",
1031+ "schema": {
1032+ "$ref": "#/definitions/proto.Error"
1033+ }
1034+ },
1035+ "500": {
1036+ "description": "Internal Server Error",
1037+ "schema": {
1038+ "$ref": "#/definitions/proto.Error"
1039+ }
1040+ }
1041+ }
1042+ }
1043+ },
1044+ "/workspaces/{id}/config/set": {
1045+ "post": {
1046+ "consumes": [
1047+ "application/json"
1048+ ],
1049+ "tags": [
1050+ "config"
1051+ ],
1052+ "summary": "Set a config field",
1053+ "parameters": [
1054+ {
1055+ "type": "string",
1056+ "description": "Workspace ID",
1057+ "name": "id",
1058+ "in": "path",
1059+ "required": true
1060+ },
1061+ {
1062+ "description": "Config set request",
1063+ "name": "request",
1064+ "in": "body",
1065+ "required": true,
1066+ "schema": {
1067+ "$ref": "#/definitions/proto.ConfigSetRequest"
1068+ }
1069+ }
1070+ ],
1071+ "responses": {
1072+ "200": {
1073+ "description": "OK"
1074+ },
1075+ "400": {
1076+ "description": "Bad Request",
1077+ "schema": {
1078+ "$ref": "#/definitions/proto.Error"
1079+ }
1080+ },
1081+ "404": {
1082+ "description": "Not Found",
1083+ "schema": {
1084+ "$ref": "#/definitions/proto.Error"
1085+ }
1086+ },
1087+ "500": {
1088+ "description": "Internal Server Error",
1089+ "schema": {
1090+ "$ref": "#/definitions/proto.Error"
1091+ }
1092+ }
1093+ }
1094+ }
1095+ },
1096+ "/workspaces/{id}/events": {
1097+ "get": {
1098+ "produces": [
1099+ "text/event-stream"
1100+ ],
1101+ "tags": [
1102+ "workspaces"
1103+ ],
1104+ "summary": "Stream workspace events (SSE)",
1105+ "parameters": [
1106+ {
1107+ "type": "string",
1108+ "description": "Workspace ID",
1109+ "name": "id",
1110+ "in": "path",
1111+ "required": true
1112+ }
1113+ ],
1114+ "responses": {
1115+ "200": {
1116+ "description": "OK"
1117+ },
1118+ "404": {
1119+ "description": "Not Found",
1120+ "schema": {
1121+ "$ref": "#/definitions/proto.Error"
1122+ }
1123+ },
1124+ "500": {
1125+ "description": "Internal Server Error",
1126+ "schema": {
1127+ "$ref": "#/definitions/proto.Error"
1128+ }
1129+ }
1130+ }
1131+ }
1132+ },
1133+ "/workspaces/{id}/filetracker/lastread": {
1134+ "get": {
1135+ "produces": [
1136+ "application/json"
1137+ ],
1138+ "tags": [
1139+ "filetracker"
1140+ ],
1141+ "summary": "Get last read time for file",
1142+ "parameters": [
1143+ {
1144+ "type": "string",
1145+ "description": "Workspace ID",
1146+ "name": "id",
1147+ "in": "path",
1148+ "required": true
1149+ },
1150+ {
1151+ "type": "string",
1152+ "description": "Session ID",
1153+ "name": "session_id",
1154+ "in": "query"
1155+ },
1156+ {
1157+ "type": "string",
1158+ "description": "File path",
1159+ "name": "path",
1160+ "in": "query",
1161+ "required": true
1162+ }
1163+ ],
1164+ "responses": {
1165+ "200": {
1166+ "description": "OK",
1167+ "schema": {
1168+ "type": "object"
1169+ }
1170+ },
1171+ "404": {
1172+ "description": "Not Found",
1173+ "schema": {
1174+ "$ref": "#/definitions/proto.Error"
1175+ }
1176+ },
1177+ "500": {
1178+ "description": "Internal Server Error",
1179+ "schema": {
1180+ "$ref": "#/definitions/proto.Error"
1181+ }
1182+ }
1183+ }
1184+ }
1185+ },
1186+ "/workspaces/{id}/filetracker/read": {
1187+ "post": {
1188+ "consumes": [
1189+ "application/json"
1190+ ],
1191+ "tags": [
1192+ "filetracker"
1193+ ],
1194+ "summary": "Record file read",
1195+ "parameters": [
1196+ {
1197+ "type": "string",
1198+ "description": "Workspace ID",
1199+ "name": "id",
1200+ "in": "path",
1201+ "required": true
1202+ },
1203+ {
1204+ "description": "File tracker read request",
1205+ "name": "request",
1206+ "in": "body",
1207+ "required": true,
1208+ "schema": {
1209+ "$ref": "#/definitions/proto.FileTrackerReadRequest"
1210+ }
1211+ }
1212+ ],
1213+ "responses": {
1214+ "200": {
1215+ "description": "OK"
1216+ },
1217+ "400": {
1218+ "description": "Bad Request",
1219+ "schema": {
1220+ "$ref": "#/definitions/proto.Error"
1221+ }
1222+ },
1223+ "404": {
1224+ "description": "Not Found",
1225+ "schema": {
1226+ "$ref": "#/definitions/proto.Error"
1227+ }
1228+ },
1229+ "500": {
1230+ "description": "Internal Server Error",
1231+ "schema": {
1232+ "$ref": "#/definitions/proto.Error"
1233+ }
1234+ }
1235+ }
1236+ }
1237+ },
1238+ "/workspaces/{id}/lsps": {
1239+ "get": {
1240+ "produces": [
1241+ "application/json"
1242+ ],
1243+ "tags": [
1244+ "lsp"
1245+ ],
1246+ "summary": "List LSP clients",
1247+ "parameters": [
1248+ {
1249+ "type": "string",
1250+ "description": "Workspace ID",
1251+ "name": "id",
1252+ "in": "path",
1253+ "required": true
1254+ }
1255+ ],
1256+ "responses": {
1257+ "200": {
1258+ "description": "OK",
1259+ "schema": {
1260+ "type": "object",
1261+ "additionalProperties": {
1262+ "$ref": "#/definitions/proto.LSPClientInfo"
1263+ }
1264+ }
1265+ },
1266+ "404": {
1267+ "description": "Not Found",
1268+ "schema": {
1269+ "$ref": "#/definitions/proto.Error"
1270+ }
1271+ },
1272+ "500": {
1273+ "description": "Internal Server Error",
1274+ "schema": {
1275+ "$ref": "#/definitions/proto.Error"
1276+ }
1277+ }
1278+ }
1279+ }
1280+ },
1281+ "/workspaces/{id}/lsps/start": {
1282+ "post": {
1283+ "consumes": [
1284+ "application/json"
1285+ ],
1286+ "tags": [
1287+ "lsp"
1288+ ],
1289+ "summary": "Start LSP server",
1290+ "parameters": [
1291+ {
1292+ "type": "string",
1293+ "description": "Workspace ID",
1294+ "name": "id",
1295+ "in": "path",
1296+ "required": true
1297+ },
1298+ {
1299+ "description": "LSP start request",
1300+ "name": "request",
1301+ "in": "body",
1302+ "required": true,
1303+ "schema": {
1304+ "$ref": "#/definitions/proto.LSPStartRequest"
1305+ }
1306+ }
1307+ ],
1308+ "responses": {
1309+ "200": {
1310+ "description": "OK"
1311+ },
1312+ "400": {
1313+ "description": "Bad Request",
1314+ "schema": {
1315+ "$ref": "#/definitions/proto.Error"
1316+ }
1317+ },
1318+ "404": {
1319+ "description": "Not Found",
1320+ "schema": {
1321+ "$ref": "#/definitions/proto.Error"
1322+ }
1323+ },
1324+ "500": {
1325+ "description": "Internal Server Error",
1326+ "schema": {
1327+ "$ref": "#/definitions/proto.Error"
1328+ }
1329+ }
1330+ }
1331+ }
1332+ },
1333+ "/workspaces/{id}/lsps/stop": {
1334+ "post": {
1335+ "tags": [
1336+ "lsp"
1337+ ],
1338+ "summary": "Stop all LSP servers",
1339+ "parameters": [
1340+ {
1341+ "type": "string",
1342+ "description": "Workspace ID",
1343+ "name": "id",
1344+ "in": "path",
1345+ "required": true
1346+ }
1347+ ],
1348+ "responses": {
1349+ "200": {
1350+ "description": "OK"
1351+ },
1352+ "404": {
1353+ "description": "Not Found",
1354+ "schema": {
1355+ "$ref": "#/definitions/proto.Error"
1356+ }
1357+ },
1358+ "500": {
1359+ "description": "Internal Server Error",
1360+ "schema": {
1361+ "$ref": "#/definitions/proto.Error"
1362+ }
1363+ }
1364+ }
1365+ }
1366+ },
1367+ "/workspaces/{id}/lsps/{lsp}/diagnostics": {
1368+ "get": {
1369+ "produces": [
1370+ "application/json"
1371+ ],
1372+ "tags": [
1373+ "lsp"
1374+ ],
1375+ "summary": "Get LSP diagnostics",
1376+ "parameters": [
1377+ {
1378+ "type": "string",
1379+ "description": "Workspace ID",
1380+ "name": "id",
1381+ "in": "path",
1382+ "required": true
1383+ },
1384+ {
1385+ "type": "string",
1386+ "description": "LSP client name",
1387+ "name": "lsp",
1388+ "in": "path",
1389+ "required": true
1390+ }
1391+ ],
1392+ "responses": {
1393+ "200": {
1394+ "description": "OK",
1395+ "schema": {
1396+ "type": "object"
1397+ }
1398+ },
1399+ "404": {
1400+ "description": "Not Found",
1401+ "schema": {
1402+ "$ref": "#/definitions/proto.Error"
1403+ }
1404+ },
1405+ "500": {
1406+ "description": "Internal Server Error",
1407+ "schema": {
1408+ "$ref": "#/definitions/proto.Error"
1409+ }
1410+ }
1411+ }
1412+ }
1413+ },
1414+ "/workspaces/{id}/mcp/get-prompt": {
1415+ "post": {
1416+ "consumes": [
1417+ "application/json"
1418+ ],
1419+ "produces": [
1420+ "application/json"
1421+ ],
1422+ "tags": [
1423+ "mcp"
1424+ ],
1425+ "summary": "Get MCP prompt",
1426+ "parameters": [
1427+ {
1428+ "type": "string",
1429+ "description": "Workspace ID",
1430+ "name": "id",
1431+ "in": "path",
1432+ "required": true
1433+ },
1434+ {
1435+ "description": "MCP get prompt request",
1436+ "name": "request",
1437+ "in": "body",
1438+ "required": true,
1439+ "schema": {
1440+ "$ref": "#/definitions/proto.MCPGetPromptRequest"
1441+ }
1442+ }
1443+ ],
1444+ "responses": {
1445+ "200": {
1446+ "description": "OK",
1447+ "schema": {
1448+ "$ref": "#/definitions/proto.MCPGetPromptResponse"
1449+ }
1450+ },
1451+ "400": {
1452+ "description": "Bad Request",
1453+ "schema": {
1454+ "$ref": "#/definitions/proto.Error"
1455+ }
1456+ },
1457+ "404": {
1458+ "description": "Not Found",
1459+ "schema": {
1460+ "$ref": "#/definitions/proto.Error"
1461+ }
1462+ },
1463+ "500": {
1464+ "description": "Internal Server Error",
1465+ "schema": {
1466+ "$ref": "#/definitions/proto.Error"
1467+ }
1468+ }
1469+ }
1470+ }
1471+ },
1472+ "/workspaces/{id}/mcp/read-resource": {
1473+ "post": {
1474+ "consumes": [
1475+ "application/json"
1476+ ],
1477+ "produces": [
1478+ "application/json"
1479+ ],
1480+ "tags": [
1481+ "mcp"
1482+ ],
1483+ "summary": "Read MCP resource",
1484+ "parameters": [
1485+ {
1486+ "type": "string",
1487+ "description": "Workspace ID",
1488+ "name": "id",
1489+ "in": "path",
1490+ "required": true
1491+ },
1492+ {
1493+ "description": "MCP read resource request",
1494+ "name": "request",
1495+ "in": "body",
1496+ "required": true,
1497+ "schema": {
1498+ "$ref": "#/definitions/proto.MCPReadResourceRequest"
1499+ }
1500+ }
1501+ ],
1502+ "responses": {
1503+ "200": {
1504+ "description": "OK",
1505+ "schema": {
1506+ "type": "object"
1507+ }
1508+ },
1509+ "400": {
1510+ "description": "Bad Request",
1511+ "schema": {
1512+ "$ref": "#/definitions/proto.Error"
1513+ }
1514+ },
1515+ "404": {
1516+ "description": "Not Found",
1517+ "schema": {
1518+ "$ref": "#/definitions/proto.Error"
1519+ }
1520+ },
1521+ "500": {
1522+ "description": "Internal Server Error",
1523+ "schema": {
1524+ "$ref": "#/definitions/proto.Error"
1525+ }
1526+ }
1527+ }
1528+ }
1529+ },
1530+ "/workspaces/{id}/mcp/refresh-prompts": {
1531+ "post": {
1532+ "consumes": [
1533+ "application/json"
1534+ ],
1535+ "tags": [
1536+ "mcp"
1537+ ],
1538+ "summary": "Refresh MCP prompts",
1539+ "parameters": [
1540+ {
1541+ "type": "string",
1542+ "description": "Workspace ID",
1543+ "name": "id",
1544+ "in": "path",
1545+ "required": true
1546+ },
1547+ {
1548+ "description": "MCP name request",
1549+ "name": "request",
1550+ "in": "body",
1551+ "required": true,
1552+ "schema": {
1553+ "$ref": "#/definitions/proto.MCPNameRequest"
1554+ }
1555+ }
1556+ ],
1557+ "responses": {
1558+ "200": {
1559+ "description": "OK"
1560+ },
1561+ "400": {
1562+ "description": "Bad Request",
1563+ "schema": {
1564+ "$ref": "#/definitions/proto.Error"
1565+ }
1566+ },
1567+ "404": {
1568+ "description": "Not Found",
1569+ "schema": {
1570+ "$ref": "#/definitions/proto.Error"
1571+ }
1572+ },
1573+ "500": {
1574+ "description": "Internal Server Error",
1575+ "schema": {
1576+ "$ref": "#/definitions/proto.Error"
1577+ }
1578+ }
1579+ }
1580+ }
1581+ },
1582+ "/workspaces/{id}/mcp/refresh-resources": {
1583+ "post": {
1584+ "consumes": [
1585+ "application/json"
1586+ ],
1587+ "tags": [
1588+ "mcp"
1589+ ],
1590+ "summary": "Refresh MCP resources",
1591+ "parameters": [
1592+ {
1593+ "type": "string",
1594+ "description": "Workspace ID",
1595+ "name": "id",
1596+ "in": "path",
1597+ "required": true
1598+ },
1599+ {
1600+ "description": "MCP name request",
1601+ "name": "request",
1602+ "in": "body",
1603+ "required": true,
1604+ "schema": {
1605+ "$ref": "#/definitions/proto.MCPNameRequest"
1606+ }
1607+ }
1608+ ],
1609+ "responses": {
1610+ "200": {
1611+ "description": "OK"
1612+ },
1613+ "400": {
1614+ "description": "Bad Request",
1615+ "schema": {
1616+ "$ref": "#/definitions/proto.Error"
1617+ }
1618+ },
1619+ "404": {
1620+ "description": "Not Found",
1621+ "schema": {
1622+ "$ref": "#/definitions/proto.Error"
1623+ }
1624+ },
1625+ "500": {
1626+ "description": "Internal Server Error",
1627+ "schema": {
1628+ "$ref": "#/definitions/proto.Error"
1629+ }
1630+ }
1631+ }
1632+ }
1633+ },
1634+ "/workspaces/{id}/mcp/refresh-tools": {
1635+ "post": {
1636+ "consumes": [
1637+ "application/json"
1638+ ],
1639+ "tags": [
1640+ "mcp"
1641+ ],
1642+ "summary": "Refresh MCP tools",
1643+ "parameters": [
1644+ {
1645+ "type": "string",
1646+ "description": "Workspace ID",
1647+ "name": "id",
1648+ "in": "path",
1649+ "required": true
1650+ },
1651+ {
1652+ "description": "MCP name request",
1653+ "name": "request",
1654+ "in": "body",
1655+ "required": true,
1656+ "schema": {
1657+ "$ref": "#/definitions/proto.MCPNameRequest"
1658+ }
1659+ }
1660+ ],
1661+ "responses": {
1662+ "200": {
1663+ "description": "OK"
1664+ },
1665+ "400": {
1666+ "description": "Bad Request",
1667+ "schema": {
1668+ "$ref": "#/definitions/proto.Error"
1669+ }
1670+ },
1671+ "404": {
1672+ "description": "Not Found",
1673+ "schema": {
1674+ "$ref": "#/definitions/proto.Error"
1675+ }
1676+ },
1677+ "500": {
1678+ "description": "Internal Server Error",
1679+ "schema": {
1680+ "$ref": "#/definitions/proto.Error"
1681+ }
1682+ }
1683+ }
1684+ }
1685+ },
1686+ "/workspaces/{id}/mcp/states": {
1687+ "get": {
1688+ "produces": [
1689+ "application/json"
1690+ ],
1691+ "tags": [
1692+ "mcp"
1693+ ],
1694+ "summary": "Get MCP client states",
1695+ "parameters": [
1696+ {
1697+ "type": "string",
1698+ "description": "Workspace ID",
1699+ "name": "id",
1700+ "in": "path",
1701+ "required": true
1702+ }
1703+ ],
1704+ "responses": {
1705+ "200": {
1706+ "description": "OK",
1707+ "schema": {
1708+ "type": "object",
1709+ "additionalProperties": {
1710+ "$ref": "#/definitions/proto.MCPClientInfo"
1711+ }
1712+ }
1713+ },
1714+ "404": {
1715+ "description": "Not Found",
1716+ "schema": {
1717+ "$ref": "#/definitions/proto.Error"
1718+ }
1719+ },
1720+ "500": {
1721+ "description": "Internal Server Error",
1722+ "schema": {
1723+ "$ref": "#/definitions/proto.Error"
1724+ }
1725+ }
1726+ }
1727+ }
1728+ },
1729+ "/workspaces/{id}/messages/user": {
1730+ "get": {
1731+ "produces": [
1732+ "application/json"
1733+ ],
1734+ "tags": [
1735+ "workspaces"
1736+ ],
1737+ "summary": "Get all user messages for workspace",
1738+ "parameters": [
1739+ {
1740+ "type": "string",
1741+ "description": "Workspace ID",
1742+ "name": "id",
1743+ "in": "path",
1744+ "required": true
1745+ }
1746+ ],
1747+ "responses": {
1748+ "200": {
1749+ "description": "OK",
1750+ "schema": {
1751+ "type": "array",
1752+ "items": {
1753+ "$ref": "#/definitions/github_com_charmbracelet_crush_internal_proto.Message"
1754+ }
1755+ }
1756+ },
1757+ "404": {
1758+ "description": "Not Found",
1759+ "schema": {
1760+ "$ref": "#/definitions/proto.Error"
1761+ }
1762+ },
1763+ "500": {
1764+ "description": "Internal Server Error",
1765+ "schema": {
1766+ "$ref": "#/definitions/proto.Error"
1767+ }
1768+ }
1769+ }
1770+ }
1771+ },
1772+ "/workspaces/{id}/permissions/grant": {
1773+ "post": {
1774+ "consumes": [
1775+ "application/json"
1776+ ],
1777+ "tags": [
1778+ "permissions"
1779+ ],
1780+ "summary": "Grant permission",
1781+ "parameters": [
1782+ {
1783+ "type": "string",
1784+ "description": "Workspace ID",
1785+ "name": "id",
1786+ "in": "path",
1787+ "required": true
1788+ },
1789+ {
1790+ "description": "Permission grant",
1791+ "name": "request",
1792+ "in": "body",
1793+ "required": true,
1794+ "schema": {
1795+ "$ref": "#/definitions/proto.PermissionGrant"
1796+ }
1797+ }
1798+ ],
1799+ "responses": {
1800+ "200": {
1801+ "description": "OK"
1802+ },
1803+ "400": {
1804+ "description": "Bad Request",
1805+ "schema": {
1806+ "$ref": "#/definitions/proto.Error"
1807+ }
1808+ },
1809+ "404": {
1810+ "description": "Not Found",
1811+ "schema": {
1812+ "$ref": "#/definitions/proto.Error"
1813+ }
1814+ },
1815+ "500": {
1816+ "description": "Internal Server Error",
1817+ "schema": {
1818+ "$ref": "#/definitions/proto.Error"
1819+ }
1820+ }
1821+ }
1822+ }
1823+ },
1824+ "/workspaces/{id}/permissions/skip": {
1825+ "get": {
1826+ "produces": [
1827+ "application/json"
1828+ ],
1829+ "tags": [
1830+ "permissions"
1831+ ],
1832+ "summary": "Get skip permissions status",
1833+ "parameters": [
1834+ {
1835+ "type": "string",
1836+ "description": "Workspace ID",
1837+ "name": "id",
1838+ "in": "path",
1839+ "required": true
1840+ }
1841+ ],
1842+ "responses": {
1843+ "200": {
1844+ "description": "OK",
1845+ "schema": {
1846+ "$ref": "#/definitions/proto.PermissionSkipRequest"
1847+ }
1848+ },
1849+ "404": {
1850+ "description": "Not Found",
1851+ "schema": {
1852+ "$ref": "#/definitions/proto.Error"
1853+ }
1854+ },
1855+ "500": {
1856+ "description": "Internal Server Error",
1857+ "schema": {
1858+ "$ref": "#/definitions/proto.Error"
1859+ }
1860+ }
1861+ }
1862+ },
1863+ "post": {
1864+ "consumes": [
1865+ "application/json"
1866+ ],
1867+ "tags": [
1868+ "permissions"
1869+ ],
1870+ "summary": "Set skip permissions",
1871+ "parameters": [
1872+ {
1873+ "type": "string",
1874+ "description": "Workspace ID",
1875+ "name": "id",
1876+ "in": "path",
1877+ "required": true
1878+ },
1879+ {
1880+ "description": "Permission skip request",
1881+ "name": "request",
1882+ "in": "body",
1883+ "required": true,
1884+ "schema": {
1885+ "$ref": "#/definitions/proto.PermissionSkipRequest"
1886+ }
1887+ }
1888+ ],
1889+ "responses": {
1890+ "200": {
1891+ "description": "OK"
1892+ },
1893+ "400": {
1894+ "description": "Bad Request",
1895+ "schema": {
1896+ "$ref": "#/definitions/proto.Error"
1897+ }
1898+ },
1899+ "404": {
1900+ "description": "Not Found",
1901+ "schema": {
1902+ "$ref": "#/definitions/proto.Error"
1903+ }
1904+ },
1905+ "500": {
1906+ "description": "Internal Server Error",
1907+ "schema": {
1908+ "$ref": "#/definitions/proto.Error"
1909+ }
1910+ }
1911+ }
1912+ }
1913+ },
1914+ "/workspaces/{id}/project/init": {
1915+ "post": {
1916+ "tags": [
1917+ "project"
1918+ ],
1919+ "summary": "Mark project as initialized",
1920+ "parameters": [
1921+ {
1922+ "type": "string",
1923+ "description": "Workspace ID",
1924+ "name": "id",
1925+ "in": "path",
1926+ "required": true
1927+ }
1928+ ],
1929+ "responses": {
1930+ "200": {
1931+ "description": "OK"
1932+ },
1933+ "404": {
1934+ "description": "Not Found",
1935+ "schema": {
1936+ "$ref": "#/definitions/proto.Error"
1937+ }
1938+ },
1939+ "500": {
1940+ "description": "Internal Server Error",
1941+ "schema": {
1942+ "$ref": "#/definitions/proto.Error"
1943+ }
1944+ }
1945+ }
1946+ }
1947+ },
1948+ "/workspaces/{id}/project/init-prompt": {
1949+ "get": {
1950+ "produces": [
1951+ "application/json"
1952+ ],
1953+ "tags": [
1954+ "project"
1955+ ],
1956+ "summary": "Get project initialization prompt",
1957+ "parameters": [
1958+ {
1959+ "type": "string",
1960+ "description": "Workspace ID",
1961+ "name": "id",
1962+ "in": "path",
1963+ "required": true
1964+ }
1965+ ],
1966+ "responses": {
1967+ "200": {
1968+ "description": "OK",
1969+ "schema": {
1970+ "$ref": "#/definitions/proto.ProjectInitPromptResponse"
1971+ }
1972+ },
1973+ "404": {
1974+ "description": "Not Found",
1975+ "schema": {
1976+ "$ref": "#/definitions/proto.Error"
1977+ }
1978+ },
1979+ "500": {
1980+ "description": "Internal Server Error",
1981+ "schema": {
1982+ "$ref": "#/definitions/proto.Error"
1983+ }
1984+ }
1985+ }
1986+ }
1987+ },
1988+ "/workspaces/{id}/project/needs-init": {
1989+ "get": {
1990+ "produces": [
1991+ "application/json"
1992+ ],
1993+ "tags": [
1994+ "project"
1995+ ],
1996+ "summary": "Check if project needs initialization",
1997+ "parameters": [
1998+ {
1999+ "type": "string",
2000+ "description": "Workspace ID",
2001+ "name": "id",
2002+ "in": "path",
2003+ "required": true
2004+ }
2005+ ],
2006+ "responses": {
2007+ "200": {
2008+ "description": "OK",
2009+ "schema": {
2010+ "$ref": "#/definitions/proto.ProjectNeedsInitResponse"
2011+ }
2012+ },
2013+ "404": {
2014+ "description": "Not Found",
2015+ "schema": {
2016+ "$ref": "#/definitions/proto.Error"
2017+ }
2018+ },
2019+ "500": {
2020+ "description": "Internal Server Error",
2021+ "schema": {
2022+ "$ref": "#/definitions/proto.Error"
2023+ }
2024+ }
2025+ }
2026+ }
2027+ },
2028+ "/workspaces/{id}/providers": {
2029+ "get": {
2030+ "produces": [
2031+ "application/json"
2032+ ],
2033+ "tags": [
2034+ "workspaces"
2035+ ],
2036+ "summary": "Get workspace providers",
2037+ "parameters": [
2038+ {
2039+ "type": "string",
2040+ "description": "Workspace ID",
2041+ "name": "id",
2042+ "in": "path",
2043+ "required": true
2044+ }
2045+ ],
2046+ "responses": {
2047+ "200": {
2048+ "description": "OK",
2049+ "schema": {
2050+ "type": "object"
2051+ }
2052+ },
2053+ "404": {
2054+ "description": "Not Found",
2055+ "schema": {
2056+ "$ref": "#/definitions/proto.Error"
2057+ }
2058+ },
2059+ "500": {
2060+ "description": "Internal Server Error",
2061+ "schema": {
2062+ "$ref": "#/definitions/proto.Error"
2063+ }
2064+ }
2065+ }
2066+ }
2067+ },
2068+ "/workspaces/{id}/sessions": {
2069+ "get": {
2070+ "produces": [
2071+ "application/json"
2072+ ],
2073+ "tags": [
2074+ "sessions"
2075+ ],
2076+ "summary": "List sessions",
2077+ "parameters": [
2078+ {
2079+ "type": "string",
2080+ "description": "Workspace ID",
2081+ "name": "id",
2082+ "in": "path",
2083+ "required": true
2084+ }
2085+ ],
2086+ "responses": {
2087+ "200": {
2088+ "description": "OK",
2089+ "schema": {
2090+ "type": "array",
2091+ "items": {
2092+ "$ref": "#/definitions/proto.Session"
2093+ }
2094+ }
2095+ },
2096+ "404": {
2097+ "description": "Not Found",
2098+ "schema": {
2099+ "$ref": "#/definitions/proto.Error"
2100+ }
2101+ },
2102+ "500": {
2103+ "description": "Internal Server Error",
2104+ "schema": {
2105+ "$ref": "#/definitions/proto.Error"
2106+ }
2107+ }
2108+ }
2109+ },
2110+ "post": {
2111+ "consumes": [
2112+ "application/json"
2113+ ],
2114+ "produces": [
2115+ "application/json"
2116+ ],
2117+ "tags": [
2118+ "sessions"
2119+ ],
2120+ "summary": "Create session",
2121+ "parameters": [
2122+ {
2123+ "type": "string",
2124+ "description": "Workspace ID",
2125+ "name": "id",
2126+ "in": "path",
2127+ "required": true
2128+ },
2129+ {
2130+ "description": "Session creation params (title)",
2131+ "name": "request",
2132+ "in": "body",
2133+ "required": true,
2134+ "schema": {
2135+ "$ref": "#/definitions/proto.Session"
2136+ }
2137+ }
2138+ ],
2139+ "responses": {
2140+ "200": {
2141+ "description": "OK",
2142+ "schema": {
2143+ "$ref": "#/definitions/proto.Session"
2144+ }
2145+ },
2146+ "400": {
2147+ "description": "Bad Request",
2148+ "schema": {
2149+ "$ref": "#/definitions/proto.Error"
2150+ }
2151+ },
2152+ "404": {
2153+ "description": "Not Found",
2154+ "schema": {
2155+ "$ref": "#/definitions/proto.Error"
2156+ }
2157+ },
2158+ "500": {
2159+ "description": "Internal Server Error",
2160+ "schema": {
2161+ "$ref": "#/definitions/proto.Error"
2162+ }
2163+ }
2164+ }
2165+ }
2166+ },
2167+ "/workspaces/{id}/sessions/{sid}": {
2168+ "get": {
2169+ "produces": [
2170+ "application/json"
2171+ ],
2172+ "tags": [
2173+ "sessions"
2174+ ],
2175+ "summary": "Get session",
2176+ "parameters": [
2177+ {
2178+ "type": "string",
2179+ "description": "Workspace ID",
2180+ "name": "id",
2181+ "in": "path",
2182+ "required": true
2183+ },
2184+ {
2185+ "type": "string",
2186+ "description": "Session ID",
2187+ "name": "sid",
2188+ "in": "path",
2189+ "required": true
2190+ }
2191+ ],
2192+ "responses": {
2193+ "200": {
2194+ "description": "OK",
2195+ "schema": {
2196+ "$ref": "#/definitions/proto.Session"
2197+ }
2198+ },
2199+ "404": {
2200+ "description": "Not Found",
2201+ "schema": {
2202+ "$ref": "#/definitions/proto.Error"
2203+ }
2204+ },
2205+ "500": {
2206+ "description": "Internal Server Error",
2207+ "schema": {
2208+ "$ref": "#/definitions/proto.Error"
2209+ }
2210+ }
2211+ }
2212+ },
2213+ "put": {
2214+ "consumes": [
2215+ "application/json"
2216+ ],
2217+ "produces": [
2218+ "application/json"
2219+ ],
2220+ "tags": [
2221+ "sessions"
2222+ ],
2223+ "summary": "Update session",
2224+ "parameters": [
2225+ {
2226+ "type": "string",
2227+ "description": "Workspace ID",
2228+ "name": "id",
2229+ "in": "path",
2230+ "required": true
2231+ },
2232+ {
2233+ "type": "string",
2234+ "description": "Session ID",
2235+ "name": "sid",
2236+ "in": "path",
2237+ "required": true
2238+ },
2239+ {
2240+ "description": "Updated session",
2241+ "name": "request",
2242+ "in": "body",
2243+ "required": true,
2244+ "schema": {
2245+ "$ref": "#/definitions/proto.Session"
2246+ }
2247+ }
2248+ ],
2249+ "responses": {
2250+ "200": {
2251+ "description": "OK",
2252+ "schema": {
2253+ "$ref": "#/definitions/proto.Session"
2254+ }
2255+ },
2256+ "400": {
2257+ "description": "Bad Request",
2258+ "schema": {
2259+ "$ref": "#/definitions/proto.Error"
2260+ }
2261+ },
2262+ "404": {
2263+ "description": "Not Found",
2264+ "schema": {
2265+ "$ref": "#/definitions/proto.Error"
2266+ }
2267+ },
2268+ "500": {
2269+ "description": "Internal Server Error",
2270+ "schema": {
2271+ "$ref": "#/definitions/proto.Error"
2272+ }
2273+ }
2274+ }
2275+ },
2276+ "delete": {
2277+ "tags": [
2278+ "sessions"
2279+ ],
2280+ "summary": "Delete session",
2281+ "parameters": [
2282+ {
2283+ "type": "string",
2284+ "description": "Workspace ID",
2285+ "name": "id",
2286+ "in": "path",
2287+ "required": true
2288+ },
2289+ {
2290+ "type": "string",
2291+ "description": "Session ID",
2292+ "name": "sid",
2293+ "in": "path",
2294+ "required": true
2295+ }
2296+ ],
2297+ "responses": {
2298+ "200": {
2299+ "description": "OK"
2300+ },
2301+ "404": {
2302+ "description": "Not Found",
2303+ "schema": {
2304+ "$ref": "#/definitions/proto.Error"
2305+ }
2306+ },
2307+ "500": {
2308+ "description": "Internal Server Error",
2309+ "schema": {
2310+ "$ref": "#/definitions/proto.Error"
2311+ }
2312+ }
2313+ }
2314+ }
2315+ },
2316+ "/workspaces/{id}/sessions/{sid}/filetracker/files": {
2317+ "get": {
2318+ "produces": [
2319+ "application/json"
2320+ ],
2321+ "tags": [
2322+ "filetracker"
2323+ ],
2324+ "summary": "List tracked files for session",
2325+ "parameters": [
2326+ {
2327+ "type": "string",
2328+ "description": "Workspace ID",
2329+ "name": "id",
2330+ "in": "path",
2331+ "required": true
2332+ },
2333+ {
2334+ "type": "string",
2335+ "description": "Session ID",
2336+ "name": "sid",
2337+ "in": "path",
2338+ "required": true
2339+ }
2340+ ],
2341+ "responses": {
2342+ "200": {
2343+ "description": "OK",
2344+ "schema": {
2345+ "type": "array",
2346+ "items": {
2347+ "type": "string"
2348+ }
2349+ }
2350+ },
2351+ "404": {
2352+ "description": "Not Found",
2353+ "schema": {
2354+ "$ref": "#/definitions/proto.Error"
2355+ }
2356+ },
2357+ "500": {
2358+ "description": "Internal Server Error",
2359+ "schema": {
2360+ "$ref": "#/definitions/proto.Error"
2361+ }
2362+ }
2363+ }
2364+ }
2365+ },
2366+ "/workspaces/{id}/sessions/{sid}/history": {
2367+ "get": {
2368+ "produces": [
2369+ "application/json"
2370+ ],
2371+ "tags": [
2372+ "sessions"
2373+ ],
2374+ "summary": "Get session history",
2375+ "parameters": [
2376+ {
2377+ "type": "string",
2378+ "description": "Workspace ID",
2379+ "name": "id",
2380+ "in": "path",
2381+ "required": true
2382+ },
2383+ {
2384+ "type": "string",
2385+ "description": "Session ID",
2386+ "name": "sid",
2387+ "in": "path",
2388+ "required": true
2389+ }
2390+ ],
2391+ "responses": {
2392+ "200": {
2393+ "description": "OK",
2394+ "schema": {
2395+ "type": "array",
2396+ "items": {
2397+ "$ref": "#/definitions/proto.File"
2398+ }
2399+ }
2400+ },
2401+ "404": {
2402+ "description": "Not Found",
2403+ "schema": {
2404+ "$ref": "#/definitions/proto.Error"
2405+ }
2406+ },
2407+ "500": {
2408+ "description": "Internal Server Error",
2409+ "schema": {
2410+ "$ref": "#/definitions/proto.Error"
2411+ }
2412+ }
2413+ }
2414+ }
2415+ },
2416+ "/workspaces/{id}/sessions/{sid}/messages": {
2417+ "get": {
2418+ "produces": [
2419+ "application/json"
2420+ ],
2421+ "tags": [
2422+ "sessions"
2423+ ],
2424+ "summary": "Get session messages",
2425+ "parameters": [
2426+ {
2427+ "type": "string",
2428+ "description": "Workspace ID",
2429+ "name": "id",
2430+ "in": "path",
2431+ "required": true
2432+ },
2433+ {
2434+ "type": "string",
2435+ "description": "Session ID",
2436+ "name": "sid",
2437+ "in": "path",
2438+ "required": true
2439+ }
2440+ ],
2441+ "responses": {
2442+ "200": {
2443+ "description": "OK",
2444+ "schema": {
2445+ "type": "array",
2446+ "items": {
2447+ "$ref": "#/definitions/github_com_charmbracelet_crush_internal_proto.Message"
2448+ }
2449+ }
2450+ },
2451+ "404": {
2452+ "description": "Not Found",
2453+ "schema": {
2454+ "$ref": "#/definitions/proto.Error"
2455+ }
2456+ },
2457+ "500": {
2458+ "description": "Internal Server Error",
2459+ "schema": {
2460+ "$ref": "#/definitions/proto.Error"
2461+ }
2462+ }
2463+ }
2464+ }
2465+ },
2466+ "/workspaces/{id}/sessions/{sid}/messages/user": {
2467+ "get": {
2468+ "produces": [
2469+ "application/json"
2470+ ],
2471+ "tags": [
2472+ "sessions"
2473+ ],
2474+ "summary": "Get user messages for session",
2475+ "parameters": [
2476+ {
2477+ "type": "string",
2478+ "description": "Workspace ID",
2479+ "name": "id",
2480+ "in": "path",
2481+ "required": true
2482+ },
2483+ {
2484+ "type": "string",
2485+ "description": "Session ID",
2486+ "name": "sid",
2487+ "in": "path",
2488+ "required": true
2489+ }
2490+ ],
2491+ "responses": {
2492+ "200": {
2493+ "description": "OK",
2494+ "schema": {
2495+ "type": "array",
2496+ "items": {
2497+ "$ref": "#/definitions/github_com_charmbracelet_crush_internal_proto.Message"
2498+ }
2499+ }
2500+ },
2501+ "404": {
2502+ "description": "Not Found",
2503+ "schema": {
2504+ "$ref": "#/definitions/proto.Error"
2505+ }
2506+ },
2507+ "500": {
2508+ "description": "Internal Server Error",
2509+ "schema": {
2510+ "$ref": "#/definitions/proto.Error"
2511+ }
2512+ }
2513+ }
2514+ }
2515+ }
2516+ },
2517+ "definitions": {
2518+ "catwalk.Model": {
2519+ "type": "object",
2520+ "properties": {
2521+ "can_reason": {
2522+ "type": "boolean"
2523+ },
2524+ "context_window": {
2525+ "type": "integer"
2526+ },
2527+ "cost_per_1m_in": {
2528+ "type": "number"
2529+ },
2530+ "cost_per_1m_in_cached": {
2531+ "type": "number"
2532+ },
2533+ "cost_per_1m_out": {
2534+ "type": "number"
2535+ },
2536+ "cost_per_1m_out_cached": {
2537+ "type": "number"
2538+ },
2539+ "default_max_tokens": {
2540+ "type": "integer"
2541+ },
2542+ "default_reasoning_effort": {
2543+ "type": "string"
2544+ },
2545+ "id": {
2546+ "type": "string"
2547+ },
2548+ "name": {
2549+ "type": "string"
2550+ },
2551+ "options": {
2552+ "$ref": "#/definitions/catwalk.ModelOptions"
2553+ },
2554+ "reasoning_levels": {
2555+ "type": "array",
2556+ "items": {
2557+ "type": "string"
2558+ }
2559+ },
2560+ "supports_attachments": {
2561+ "type": "boolean"
2562+ }
2563+ }
2564+ },
2565+ "catwalk.ModelOptions": {
2566+ "type": "object",
2567+ "properties": {
2568+ "frequency_penalty": {
2569+ "type": "number"
2570+ },
2571+ "presence_penalty": {
2572+ "type": "number"
2573+ },
2574+ "provider_options": {
2575+ "type": "object",
2576+ "additionalProperties": {}
2577+ },
2578+ "temperature": {
2579+ "type": "number"
2580+ },
2581+ "top_k": {
2582+ "type": "integer"
2583+ },
2584+ "top_p": {
2585+ "type": "number"
2586+ }
2587+ }
2588+ },
2589+ "config.Attribution": {
2590+ "type": "object",
2591+ "properties": {
2592+ "co_authored_by": {
2593+ "type": "boolean"
2594+ },
2595+ "generated_with": {
2596+ "type": "boolean"
2597+ },
2598+ "trailer_style": {
2599+ "$ref": "#/definitions/config.TrailerStyle"
2600+ }
2601+ }
2602+ },
2603+ "config.Completions": {
2604+ "type": "object",
2605+ "properties": {
2606+ "max_depth": {
2607+ "type": "integer"
2608+ },
2609+ "max_items": {
2610+ "type": "integer"
2611+ }
2612+ }
2613+ },
2614+ "config.LSPConfig": {
2615+ "type": "object",
2616+ "properties": {
2617+ "args": {
2618+ "type": "array",
2619+ "items": {
2620+ "type": "string"
2621+ }
2622+ },
2623+ "command": {
2624+ "type": "string"
2625+ },
2626+ "disabled": {
2627+ "type": "boolean"
2628+ },
2629+ "env": {
2630+ "type": "object",
2631+ "additionalProperties": {
2632+ "type": "string"
2633+ }
2634+ },
2635+ "filetypes": {
2636+ "type": "array",
2637+ "items": {
2638+ "type": "string"
2639+ }
2640+ },
2641+ "init_options": {
2642+ "type": "object",
2643+ "additionalProperties": {}
2644+ },
2645+ "options": {
2646+ "type": "object",
2647+ "additionalProperties": {}
2648+ },
2649+ "root_markers": {
2650+ "type": "array",
2651+ "items": {
2652+ "type": "string"
2653+ }
2654+ },
2655+ "timeout": {
2656+ "type": "integer"
2657+ }
2658+ }
2659+ },
2660+ "config.LSPs": {
2661+ "type": "object",
2662+ "additionalProperties": {
2663+ "$ref": "#/definitions/config.LSPConfig"
2664+ }
2665+ },
2666+ "config.MCPConfig": {
2667+ "type": "object",
2668+ "properties": {
2669+ "args": {
2670+ "type": "array",
2671+ "items": {
2672+ "type": "string"
2673+ }
2674+ },
2675+ "command": {
2676+ "type": "string"
2677+ },
2678+ "disabled": {
2679+ "type": "boolean"
2680+ },
2681+ "disabled_tools": {
2682+ "type": "array",
2683+ "items": {
2684+ "type": "string"
2685+ }
2686+ },
2687+ "env": {
2688+ "type": "object",
2689+ "additionalProperties": {
2690+ "type": "string"
2691+ }
2692+ },
2693+ "headers": {
2694+ "description": "TODO: maybe make it possible to get the value from the env",
2695+ "type": "object",
2696+ "additionalProperties": {
2697+ "type": "string"
2698+ }
2699+ },
2700+ "timeout": {
2701+ "type": "integer"
2702+ },
2703+ "type": {
2704+ "$ref": "#/definitions/config.MCPType"
2705+ },
2706+ "url": {
2707+ "type": "string"
2708+ }
2709+ }
2710+ },
2711+ "config.MCPType": {
2712+ "type": "string",
2713+ "enum": [
2714+ "stdio",
2715+ "sse",
2716+ "http"
2717+ ],
2718+ "x-enum-varnames": [
2719+ "MCPStdio",
2720+ "MCPSSE",
2721+ "MCPHttp"
2722+ ]
2723+ },
2724+ "config.MCPs": {
2725+ "type": "object",
2726+ "additionalProperties": {
2727+ "$ref": "#/definitions/config.MCPConfig"
2728+ }
2729+ },
2730+ "config.Permissions": {
2731+ "type": "object",
2732+ "properties": {
2733+ "allowed_tools": {
2734+ "type": "array",
2735+ "items": {
2736+ "type": "string"
2737+ }
2738+ }
2739+ }
2740+ },
2741+ "config.Scope": {
2742+ "type": "integer",
2743+ "enum": [
2744+ 0,
2745+ 1
2746+ ],
2747+ "x-enum-varnames": [
2748+ "ScopeGlobal",
2749+ "ScopeWorkspace"
2750+ ]
2751+ },
2752+ "config.SelectedModel": {
2753+ "type": "object",
2754+ "properties": {
2755+ "frequency_penalty": {
2756+ "type": "number"
2757+ },
2758+ "max_tokens": {
2759+ "description": "Overrides the default model configuration.",
2760+ "type": "integer"
2761+ },
2762+ "model": {
2763+ "description": "The model id as used by the provider API.\nRequired.",
2764+ "type": "string"
2765+ },
2766+ "presence_penalty": {
2767+ "type": "number"
2768+ },
2769+ "provider": {
2770+ "description": "The model provider, same as the key/id used in the providers config.\nRequired.",
2771+ "type": "string"
2772+ },
2773+ "provider_options": {
2774+ "description": "Override provider specific options.",
2775+ "type": "object",
2776+ "additionalProperties": {}
2777+ },
2778+ "reasoning_effort": {
2779+ "description": "Only used by models that use the openai provider and need this set.",
2780+ "type": "string"
2781+ },
2782+ "temperature": {
2783+ "type": "number"
2784+ },
2785+ "think": {
2786+ "description": "Used by anthropic models that can reason to indicate if the model should think.",
2787+ "type": "boolean"
2788+ },
2789+ "top_k": {
2790+ "type": "integer"
2791+ },
2792+ "top_p": {
2793+ "type": "number"
2794+ }
2795+ }
2796+ },
2797+ "config.SelectedModelType": {
2798+ "type": "string",
2799+ "enum": [
2800+ "large",
2801+ "small"
2802+ ],
2803+ "x-enum-varnames": [
2804+ "SelectedModelTypeLarge",
2805+ "SelectedModelTypeSmall"
2806+ ]
2807+ },
2808+ "config.TUIOptions": {
2809+ "type": "object",
2810+ "properties": {
2811+ "compact_mode": {
2812+ "type": "boolean"
2813+ },
2814+ "completions": {
2815+ "$ref": "#/definitions/config.Completions"
2816+ },
2817+ "diff_mode": {
2818+ "type": "string"
2819+ },
2820+ "transparent": {
2821+ "type": "boolean"
2822+ }
2823+ }
2824+ },
2825+ "config.ToolGrep": {
2826+ "type": "object",
2827+ "properties": {
2828+ "timeout": {
2829+ "$ref": "#/definitions/time.Duration"
2830+ }
2831+ }
2832+ },
2833+ "config.ToolLs": {
2834+ "type": "object",
2835+ "properties": {
2836+ "max_depth": {
2837+ "type": "integer"
2838+ },
2839+ "max_items": {
2840+ "type": "integer"
2841+ }
2842+ }
2843+ },
2844+ "config.Tools": {
2845+ "type": "object",
2846+ "properties": {
2847+ "grep": {
2848+ "$ref": "#/definitions/config.ToolGrep"
2849+ },
2850+ "ls": {
2851+ "$ref": "#/definitions/config.ToolLs"
2852+ }
2853+ }
2854+ },
2855+ "config.TrailerStyle": {
2856+ "type": "string",
2857+ "enum": [
2858+ "none",
2859+ "co-authored-by",
2860+ "assisted-by"
2861+ ],
2862+ "x-enum-varnames": [
2863+ "TrailerStyleNone",
2864+ "TrailerStyleCoAuthoredBy",
2865+ "TrailerStyleAssistedBy"
2866+ ]
2867+ },
2868+ "csync.Map-string-config_ProviderConfig": {
2869+ "type": "object"
2870+ },
2871+ "github_com_charmbracelet_crush_internal_config.Config": {
2872+ "type": "object",
2873+ "properties": {
2874+ "$schema": {
2875+ "type": "string"
2876+ },
2877+ "lsp": {
2878+ "$ref": "#/definitions/config.LSPs"
2879+ },
2880+ "mcp": {
2881+ "$ref": "#/definitions/config.MCPs"
2882+ },
2883+ "models": {
2884+ "description": "We currently only support large/small as values here.",
2885+ "type": "object",
2886+ "additionalProperties": {
2887+ "$ref": "#/definitions/config.SelectedModel"
2888+ }
2889+ },
2890+ "options": {
2891+ "$ref": "#/definitions/github_com_charmbracelet_crush_internal_config.Options"
2892+ },
2893+ "permissions": {
2894+ "$ref": "#/definitions/config.Permissions"
2895+ },
2896+ "providers": {
2897+ "description": "The providers that are configured",
2898+ "allOf": [
2899+ {
2900+ "$ref": "#/definitions/csync.Map-string-config_ProviderConfig"
2901+ }
2902+ ]
2903+ },
2904+ "recent_models": {
2905+ "description": "Recently used models stored in the data directory config.",
2906+ "type": "object",
2907+ "additionalProperties": {
2908+ "type": "array",
2909+ "items": {
2910+ "$ref": "#/definitions/config.SelectedModel"
2911+ }
2912+ }
2913+ },
2914+ "tools": {
2915+ "$ref": "#/definitions/config.Tools"
2916+ }
2917+ }
2918+ },
2919+ "github_com_charmbracelet_crush_internal_config.Options": {
2920+ "type": "object",
2921+ "properties": {
2922+ "attribution": {
2923+ "$ref": "#/definitions/config.Attribution"
2924+ },
2925+ "auto_lsp": {
2926+ "type": "boolean"
2927+ },
2928+ "context_paths": {
2929+ "type": "array",
2930+ "items": {
2931+ "type": "string"
2932+ }
2933+ },
2934+ "data_directory": {
2935+ "description": "Relative to the cwd",
2936+ "type": "string"
2937+ },
2938+ "debug": {
2939+ "type": "boolean"
2940+ },
2941+ "debug_lsp": {
2942+ "type": "boolean"
2943+ },
2944+ "disable_auto_summarize": {
2945+ "type": "boolean"
2946+ },
2947+ "disable_default_providers": {
2948+ "type": "boolean"
2949+ },
2950+ "disable_metrics": {
2951+ "type": "boolean"
2952+ },
2953+ "disable_notifications": {
2954+ "type": "boolean"
2955+ },
2956+ "disable_provider_auto_update": {
2957+ "type": "boolean"
2958+ },
2959+ "disabled_tools": {
2960+ "type": "array",
2961+ "items": {
2962+ "type": "string"
2963+ }
2964+ },
2965+ "initialize_as": {
2966+ "type": "string"
2967+ },
2968+ "progress": {
2969+ "type": "boolean"
2970+ },
2971+ "skills_paths": {
2972+ "type": "array",
2973+ "items": {
2974+ "type": "string"
2975+ }
2976+ },
2977+ "tui": {
2978+ "$ref": "#/definitions/config.TUIOptions"
2979+ }
2980+ }
2981+ },
2982+ "github_com_charmbracelet_crush_internal_proto.Message": {
2983+ "type": "object",
2984+ "properties": {
2985+ "created_at": {
2986+ "type": "integer"
2987+ },
2988+ "id": {
2989+ "type": "string"
2990+ },
2991+ "model": {
2992+ "type": "string"
2993+ },
2994+ "parts": {
2995+ "type": "array",
2996+ "items": {}
2997+ },
2998+ "provider": {
2999+ "type": "string"
3000+ },
3001+ "role": {
3002+ "$ref": "#/definitions/proto.MessageRole"
3003+ },
3004+ "session_id": {
3005+ "type": "string"
3006+ },
3007+ "updated_at": {
3008+ "type": "integer"
3009+ }
3010+ }
3011+ },
3012+ "lsp.ServerState": {
3013+ "type": "integer",
3014+ "enum": [
3015+ 0,
3016+ 1,
3017+ 2,
3018+ 3,
3019+ 4,
3020+ 5
3021+ ],
3022+ "x-enum-varnames": [
3023+ "StateUnstarted",
3024+ "StateStarting",
3025+ "StateReady",
3026+ "StateError",
3027+ "StateStopped",
3028+ "StateDisabled"
3029+ ]
3030+ },
3031+ "proto.AgentInfo": {
3032+ "type": "object",
3033+ "properties": {
3034+ "is_busy": {
3035+ "type": "boolean"
3036+ },
3037+ "is_ready": {
3038+ "type": "boolean"
3039+ },
3040+ "model": {
3041+ "$ref": "#/definitions/catwalk.Model"
3042+ },
3043+ "model_cfg": {
3044+ "$ref": "#/definitions/config.SelectedModel"
3045+ }
3046+ }
3047+ },
3048+ "proto.AgentMessage": {
3049+ "type": "object",
3050+ "properties": {
3051+ "attachments": {
3052+ "type": "array",
3053+ "items": {
3054+ "$ref": "#/definitions/proto.Attachment"
3055+ }
3056+ },
3057+ "prompt": {
3058+ "type": "string"
3059+ },
3060+ "session_id": {
3061+ "type": "string"
3062+ }
3063+ }
3064+ },
3065+ "proto.AgentSession": {
3066+ "type": "object",
3067+ "properties": {
3068+ "completion_tokens": {
3069+ "type": "integer"
3070+ },
3071+ "cost": {
3072+ "type": "number"
3073+ },
3074+ "created_at": {
3075+ "type": "integer"
3076+ },
3077+ "id": {
3078+ "type": "string"
3079+ },
3080+ "is_busy": {
3081+ "type": "boolean"
3082+ },
3083+ "message_count": {
3084+ "type": "integer"
3085+ },
3086+ "parent_session_id": {
3087+ "type": "string"
3088+ },
3089+ "prompt_tokens": {
3090+ "type": "integer"
3091+ },
3092+ "summary_message_id": {
3093+ "type": "string"
3094+ },
3095+ "title": {
3096+ "type": "string"
3097+ },
3098+ "updated_at": {
3099+ "type": "integer"
3100+ }
3101+ }
3102+ },
3103+ "proto.Attachment": {
3104+ "type": "object",
3105+ "properties": {
3106+ "content": {
3107+ "type": "array",
3108+ "items": {
3109+ "type": "integer"
3110+ }
3111+ },
3112+ "file_name": {
3113+ "type": "string"
3114+ },
3115+ "file_path": {
3116+ "type": "string"
3117+ },
3118+ "mime_type": {
3119+ "type": "string"
3120+ }
3121+ }
3122+ },
3123+ "proto.ConfigCompactRequest": {
3124+ "type": "object",
3125+ "properties": {
3126+ "enabled": {
3127+ "type": "boolean"
3128+ },
3129+ "scope": {
3130+ "$ref": "#/definitions/config.Scope"
3131+ }
3132+ }
3133+ },
3134+ "proto.ConfigModelRequest": {
3135+ "type": "object",
3136+ "properties": {
3137+ "model": {
3138+ "$ref": "#/definitions/config.SelectedModel"
3139+ },
3140+ "model_type": {
3141+ "$ref": "#/definitions/config.SelectedModelType"
3142+ },
3143+ "scope": {
3144+ "$ref": "#/definitions/config.Scope"
3145+ }
3146+ }
3147+ },
3148+ "proto.ConfigProviderKeyRequest": {
3149+ "type": "object",
3150+ "properties": {
3151+ "api_key": {},
3152+ "provider_id": {
3153+ "type": "string"
3154+ },
3155+ "scope": {
3156+ "$ref": "#/definitions/config.Scope"
3157+ }
3158+ }
3159+ },
3160+ "proto.ConfigRefreshOAuthRequest": {
3161+ "type": "object",
3162+ "properties": {
3163+ "provider_id": {
3164+ "type": "string"
3165+ },
3166+ "scope": {
3167+ "$ref": "#/definitions/config.Scope"
3168+ }
3169+ }
3170+ },
3171+ "proto.ConfigRemoveRequest": {
3172+ "type": "object",
3173+ "properties": {
3174+ "key": {
3175+ "type": "string"
3176+ },
3177+ "scope": {
3178+ "$ref": "#/definitions/config.Scope"
3179+ }
3180+ }
3181+ },
3182+ "proto.ConfigSetRequest": {
3183+ "type": "object",
3184+ "properties": {
3185+ "key": {
3186+ "type": "string"
3187+ },
3188+ "scope": {
3189+ "$ref": "#/definitions/config.Scope"
3190+ },
3191+ "value": {}
3192+ }
3193+ },
3194+ "proto.Error": {
3195+ "type": "object",
3196+ "properties": {
3197+ "message": {
3198+ "type": "string"
3199+ }
3200+ }
3201+ },
3202+ "proto.File": {
3203+ "type": "object",
3204+ "properties": {
3205+ "content": {
3206+ "type": "string"
3207+ },
3208+ "created_at": {
3209+ "type": "integer"
3210+ },
3211+ "id": {
3212+ "type": "string"
3213+ },
3214+ "path": {
3215+ "type": "string"
3216+ },
3217+ "session_id": {
3218+ "type": "string"
3219+ },
3220+ "updated_at": {
3221+ "type": "integer"
3222+ },
3223+ "version": {
3224+ "type": "integer"
3225+ }
3226+ }
3227+ },
3228+ "proto.FileTrackerReadRequest": {
3229+ "type": "object",
3230+ "properties": {
3231+ "path": {
3232+ "type": "string"
3233+ },
3234+ "session_id": {
3235+ "type": "string"
3236+ }
3237+ }
3238+ },
3239+ "proto.ImportCopilotResponse": {
3240+ "type": "object",
3241+ "properties": {
3242+ "success": {
3243+ "type": "boolean"
3244+ },
3245+ "token": {}
3246+ }
3247+ },
3248+ "proto.LSPClientInfo": {
3249+ "type": "object",
3250+ "properties": {
3251+ "connected_at": {
3252+ "type": "string"
3253+ },
3254+ "diagnostic_count": {
3255+ "type": "integer"
3256+ },
3257+ "error": {},
3258+ "name": {
3259+ "type": "string"
3260+ },
3261+ "state": {
3262+ "$ref": "#/definitions/lsp.ServerState"
3263+ }
3264+ }
3265+ },
3266+ "proto.LSPStartRequest": {
3267+ "type": "object",
3268+ "properties": {
3269+ "path": {
3270+ "type": "string"
3271+ }
3272+ }
3273+ },
3274+ "proto.MCPClientInfo": {
3275+ "type": "object",
3276+ "properties": {
3277+ "connected_at": {
3278+ "type": "string"
3279+ },
3280+ "error": {},
3281+ "name": {
3282+ "type": "string"
3283+ },
3284+ "prompt_count": {
3285+ "type": "integer"
3286+ },
3287+ "resource_count": {
3288+ "type": "integer"
3289+ },
3290+ "state": {
3291+ "$ref": "#/definitions/proto.MCPState"
3292+ },
3293+ "tool_count": {
3294+ "type": "integer"
3295+ }
3296+ }
3297+ },
3298+ "proto.MCPGetPromptRequest": {
3299+ "type": "object",
3300+ "properties": {
3301+ "args": {
3302+ "type": "object",
3303+ "additionalProperties": {
3304+ "type": "string"
3305+ }
3306+ },
3307+ "client_id": {
3308+ "type": "string"
3309+ },
3310+ "prompt_id": {
3311+ "type": "string"
3312+ }
3313+ }
3314+ },
3315+ "proto.MCPGetPromptResponse": {
3316+ "type": "object",
3317+ "properties": {
3318+ "prompt": {
3319+ "type": "string"
3320+ }
3321+ }
3322+ },
3323+ "proto.MCPNameRequest": {
3324+ "type": "object",
3325+ "properties": {
3326+ "name": {
3327+ "type": "string"
3328+ }
3329+ }
3330+ },
3331+ "proto.MCPReadResourceRequest": {
3332+ "type": "object",
3333+ "properties": {
3334+ "name": {
3335+ "type": "string"
3336+ },
3337+ "uri": {
3338+ "type": "string"
3339+ }
3340+ }
3341+ },
3342+ "proto.MCPState": {
3343+ "type": "integer",
3344+ "enum": [
3345+ 0,
3346+ 1,
3347+ 2,
3348+ 3
3349+ ],
3350+ "x-enum-varnames": [
3351+ "MCPStateDisabled",
3352+ "MCPStateStarting",
3353+ "MCPStateConnected",
3354+ "MCPStateError"
3355+ ]
3356+ },
3357+ "proto.MessageRole": {
3358+ "type": "string",
3359+ "enum": [
3360+ "assistant",
3361+ "user",
3362+ "system",
3363+ "tool"
3364+ ],
3365+ "x-enum-varnames": [
3366+ "Assistant",
3367+ "User",
3368+ "System",
3369+ "Tool"
3370+ ]
3371+ },
3372+ "proto.PermissionAction": {
3373+ "type": "string",
3374+ "enum": [
3375+ "allow",
3376+ "allow_session",
3377+ "deny"
3378+ ],
3379+ "x-enum-varnames": [
3380+ "PermissionAllow",
3381+ "PermissionAllowForSession",
3382+ "PermissionDeny"
3383+ ]
3384+ },
3385+ "proto.PermissionGrant": {
3386+ "type": "object",
3387+ "properties": {
3388+ "action": {
3389+ "$ref": "#/definitions/proto.PermissionAction"
3390+ },
3391+ "permission": {
3392+ "$ref": "#/definitions/proto.PermissionRequest"
3393+ }
3394+ }
3395+ },
3396+ "proto.PermissionRequest": {
3397+ "type": "object",
3398+ "properties": {
3399+ "action": {
3400+ "type": "string"
3401+ },
3402+ "description": {
3403+ "type": "string"
3404+ },
3405+ "id": {
3406+ "type": "string"
3407+ },
3408+ "params": {},
3409+ "path": {
3410+ "type": "string"
3411+ },
3412+ "session_id": {
3413+ "type": "string"
3414+ },
3415+ "tool_call_id": {
3416+ "type": "string"
3417+ },
3418+ "tool_name": {
3419+ "type": "string"
3420+ }
3421+ }
3422+ },
3423+ "proto.PermissionSkipRequest": {
3424+ "type": "object",
3425+ "properties": {
3426+ "skip": {
3427+ "type": "boolean"
3428+ }
3429+ }
3430+ },
3431+ "proto.ProjectInitPromptResponse": {
3432+ "type": "object",
3433+ "properties": {
3434+ "prompt": {
3435+ "type": "string"
3436+ }
3437+ }
3438+ },
3439+ "proto.ProjectNeedsInitResponse": {
3440+ "type": "object",
3441+ "properties": {
3442+ "needs_init": {
3443+ "type": "boolean"
3444+ }
3445+ }
3446+ },
3447+ "proto.ServerControl": {
3448+ "type": "object",
3449+ "properties": {
3450+ "command": {
3451+ "type": "string"
3452+ }
3453+ }
3454+ },
3455+ "proto.Session": {
3456+ "type": "object",
3457+ "properties": {
3458+ "completion_tokens": {
3459+ "type": "integer"
3460+ },
3461+ "cost": {
3462+ "type": "number"
3463+ },
3464+ "created_at": {
3465+ "type": "integer"
3466+ },
3467+ "id": {
3468+ "type": "string"
3469+ },
3470+ "message_count": {
3471+ "type": "integer"
3472+ },
3473+ "parent_session_id": {
3474+ "type": "string"
3475+ },
3476+ "prompt_tokens": {
3477+ "type": "integer"
3478+ },
3479+ "summary_message_id": {
3480+ "type": "string"
3481+ },
3482+ "title": {
3483+ "type": "string"
3484+ },
3485+ "updated_at": {
3486+ "type": "integer"
3487+ }
3488+ }
3489+ },
3490+ "proto.VersionInfo": {
3491+ "type": "object",
3492+ "properties": {
3493+ "commit": {
3494+ "type": "string"
3495+ },
3496+ "go_version": {
3497+ "type": "string"
3498+ },
3499+ "platform": {
3500+ "type": "string"
3501+ },
3502+ "version": {
3503+ "type": "string"
3504+ }
3505+ }
3506+ },
3507+ "proto.Workspace": {
3508+ "type": "object",
3509+ "properties": {
3510+ "config": {
3511+ "$ref": "#/definitions/github_com_charmbracelet_crush_internal_config.Config"
3512+ },
3513+ "data_dir": {
3514+ "type": "string"
3515+ },
3516+ "debug": {
3517+ "type": "boolean"
3518+ },
3519+ "env": {
3520+ "type": "array",
3521+ "items": {
3522+ "type": "string"
3523+ }
3524+ },
3525+ "id": {
3526+ "type": "string"
3527+ },
3528+ "path": {
3529+ "type": "string"
3530+ },
3531+ "version": {
3532+ "type": "string"
3533+ },
3534+ "yolo": {
3535+ "type": "boolean"
3536+ }
3537+ }
3538+ },
3539+ "time.Duration": {
3540+ "type": "integer",
3541+ "format": "int64",
3542+ "enum": [
3543+ -9223372036854775808,
3544+ 9223372036854775807,
3545+ 1,
3546+ 1000,
3547+ 1000000,
3548+ 1000000000,
3549+ 60000000000,
3550+ 3600000000000
3551+ ],
3552+ "x-enum-varnames": [
3553+ "minDuration",
3554+ "maxDuration",
3555+ "Nanosecond",
3556+ "Microsecond",
3557+ "Millisecond",
3558+ "Second",
3559+ "Minute",
3560+ "Hour"
3561+ ]
3562+ }
3563+ }
3564+}
internal/swagger/swagger.yamlnew file+2361
@@ -0,0 +1,2361 @@
1+basePath: /v1
2+definitions:
3+ catwalk.Model:
4+ properties:
5+ can_reason:
6+ type: boolean
7+ context_window:
8+ type: integer
9+ cost_per_1m_in:
10+ type: number
11+ cost_per_1m_in_cached:
12+ type: number
13+ cost_per_1m_out:
14+ type: number
15+ cost_per_1m_out_cached:
16+ type: number
17+ default_max_tokens:
18+ type: integer
19+ default_reasoning_effort:
20+ type: string
21+ id:
22+ type: string
23+ name:
24+ type: string
25+ options:
26+ $ref: '#/definitions/catwalk.ModelOptions'
27+ reasoning_levels:
28+ items:
29+ type: string
30+ type: array
31+ supports_attachments:
32+ type: boolean
33+ type: object
34+ catwalk.ModelOptions:
35+ properties:
36+ frequency_penalty:
37+ type: number
38+ presence_penalty:
39+ type: number
40+ provider_options:
41+ additionalProperties: {}
42+ type: object
43+ temperature:
44+ type: number
45+ top_k:
46+ type: integer
47+ top_p:
48+ type: number
49+ type: object
50+ config.Attribution:
51+ properties:
52+ co_authored_by:
53+ type: boolean
54+ generated_with:
55+ type: boolean
56+ trailer_style:
57+ $ref: '#/definitions/config.TrailerStyle'
58+ type: object
59+ config.Completions:
60+ properties:
61+ max_depth:
62+ type: integer
63+ max_items:
64+ type: integer
65+ type: object
66+ config.LSPConfig:
67+ properties:
68+ args:
69+ items:
70+ type: string
71+ type: array
72+ command:
73+ type: string
74+ disabled:
75+ type: boolean
76+ env:
77+ additionalProperties:
78+ type: string
79+ type: object
80+ filetypes:
81+ items:
82+ type: string
83+ type: array
84+ init_options:
85+ additionalProperties: {}
86+ type: object
87+ options:
88+ additionalProperties: {}
89+ type: object
90+ root_markers:
91+ items:
92+ type: string
93+ type: array
94+ timeout:
95+ type: integer
96+ type: object
97+ config.LSPs:
98+ additionalProperties:
99+ $ref: '#/definitions/config.LSPConfig'
100+ type: object
101+ config.MCPConfig:
102+ properties:
103+ args:
104+ items:
105+ type: string
106+ type: array
107+ command:
108+ type: string
109+ disabled:
110+ type: boolean
111+ disabled_tools:
112+ items:
113+ type: string
114+ type: array
115+ env:
116+ additionalProperties:
117+ type: string
118+ type: object
119+ headers:
120+ additionalProperties:
121+ type: string
122+ description: 'TODO: maybe make it possible to get the value from the env'
123+ type: object
124+ timeout:
125+ type: integer
126+ type:
127+ $ref: '#/definitions/config.MCPType'
128+ url:
129+ type: string
130+ type: object
131+ config.MCPType:
132+ enum:
133+ - stdio
134+ - sse
135+ - http
136+ type: string
137+ x-enum-varnames:
138+ - MCPStdio
139+ - MCPSSE
140+ - MCPHttp
141+ config.MCPs:
142+ additionalProperties:
143+ $ref: '#/definitions/config.MCPConfig'
144+ type: object
145+ config.Permissions:
146+ properties:
147+ allowed_tools:
148+ items:
149+ type: string
150+ type: array
151+ type: object
152+ config.Scope:
153+ enum:
154+ - 0
155+ - 1
156+ type: integer
157+ x-enum-varnames:
158+ - ScopeGlobal
159+ - ScopeWorkspace
160+ config.SelectedModel:
161+ properties:
162+ frequency_penalty:
163+ type: number
164+ max_tokens:
165+ description: Overrides the default model configuration.
166+ type: integer
167+ model:
168+ description: |-
169+ The model id as used by the provider API.
170+ Required.
171+ type: string
172+ presence_penalty:
173+ type: number
174+ provider:
175+ description: |-
176+ The model provider, same as the key/id used in the providers config.
177+ Required.
178+ type: string
179+ provider_options:
180+ additionalProperties: {}
181+ description: Override provider specific options.
182+ type: object
183+ reasoning_effort:
184+ description: Only used by models that use the openai provider and need this
185+ set.
186+ type: string
187+ temperature:
188+ type: number
189+ think:
190+ description: Used by anthropic models that can reason to indicate if the model
191+ should think.
192+ type: boolean
193+ top_k:
194+ type: integer
195+ top_p:
196+ type: number
197+ type: object
198+ config.SelectedModelType:
199+ enum:
200+ - large
201+ - small
202+ type: string
203+ x-enum-varnames:
204+ - SelectedModelTypeLarge
205+ - SelectedModelTypeSmall
206+ config.TUIOptions:
207+ properties:
208+ compact_mode:
209+ type: boolean
210+ completions:
211+ $ref: '#/definitions/config.Completions'
212+ diff_mode:
213+ type: string
214+ transparent:
215+ type: boolean
216+ type: object
217+ config.ToolGrep:
218+ properties:
219+ timeout:
220+ $ref: '#/definitions/time.Duration'
221+ type: object
222+ config.ToolLs:
223+ properties:
224+ max_depth:
225+ type: integer
226+ max_items:
227+ type: integer
228+ type: object
229+ config.Tools:
230+ properties:
231+ grep:
232+ $ref: '#/definitions/config.ToolGrep'
233+ ls:
234+ $ref: '#/definitions/config.ToolLs'
235+ type: object
236+ config.TrailerStyle:
237+ enum:
238+ - none
239+ - co-authored-by
240+ - assisted-by
241+ type: string
242+ x-enum-varnames:
243+ - TrailerStyleNone
244+ - TrailerStyleCoAuthoredBy
245+ - TrailerStyleAssistedBy
246+ csync.Map-string-config_ProviderConfig:
247+ type: object
248+ github_com_charmbracelet_crush_internal_config.Config:
249+ properties:
250+ $schema:
251+ type: string
252+ lsp:
253+ $ref: '#/definitions/config.LSPs'
254+ mcp:
255+ $ref: '#/definitions/config.MCPs'
256+ models:
257+ additionalProperties:
258+ $ref: '#/definitions/config.SelectedModel'
259+ description: We currently only support large/small as values here.
260+ type: object
261+ options:
262+ $ref: '#/definitions/github_com_charmbracelet_crush_internal_config.Options'
263+ permissions:
264+ $ref: '#/definitions/config.Permissions'
265+ providers:
266+ allOf:
267+ - $ref: '#/definitions/csync.Map-string-config_ProviderConfig'
268+ description: The providers that are configured
269+ recent_models:
270+ additionalProperties:
271+ items:
272+ $ref: '#/definitions/config.SelectedModel'
273+ type: array
274+ description: Recently used models stored in the data directory config.
275+ type: object
276+ tools:
277+ $ref: '#/definitions/config.Tools'
278+ type: object
279+ github_com_charmbracelet_crush_internal_config.Options:
280+ properties:
281+ attribution:
282+ $ref: '#/definitions/config.Attribution'
283+ auto_lsp:
284+ type: boolean
285+ context_paths:
286+ items:
287+ type: string
288+ type: array
289+ data_directory:
290+ description: Relative to the cwd
291+ type: string
292+ debug:
293+ type: boolean
294+ debug_lsp:
295+ type: boolean
296+ disable_auto_summarize:
297+ type: boolean
298+ disable_default_providers:
299+ type: boolean
300+ disable_metrics:
301+ type: boolean
302+ disable_notifications:
303+ type: boolean
304+ disable_provider_auto_update:
305+ type: boolean
306+ disabled_tools:
307+ items:
308+ type: string
309+ type: array
310+ initialize_as:
311+ type: string
312+ progress:
313+ type: boolean
314+ skills_paths:
315+ items:
316+ type: string
317+ type: array
318+ tui:
319+ $ref: '#/definitions/config.TUIOptions'
320+ type: object
321+ github_com_charmbracelet_crush_internal_proto.Message:
322+ properties:
323+ created_at:
324+ type: integer
325+ id:
326+ type: string
327+ model:
328+ type: string
329+ parts:
330+ items: {}
331+ type: array
332+ provider:
333+ type: string
334+ role:
335+ $ref: '#/definitions/proto.MessageRole'
336+ session_id:
337+ type: string
338+ updated_at:
339+ type: integer
340+ type: object
341+ lsp.ServerState:
342+ enum:
343+ - 0
344+ - 1
345+ - 2
346+ - 3
347+ - 4
348+ - 5
349+ type: integer
350+ x-enum-varnames:
351+ - StateUnstarted
352+ - StateStarting
353+ - StateReady
354+ - StateError
355+ - StateStopped
356+ - StateDisabled
357+ proto.AgentInfo:
358+ properties:
359+ is_busy:
360+ type: boolean
361+ is_ready:
362+ type: boolean
363+ model:
364+ $ref: '#/definitions/catwalk.Model'
365+ model_cfg:
366+ $ref: '#/definitions/config.SelectedModel'
367+ type: object
368+ proto.AgentMessage:
369+ properties:
370+ attachments:
371+ items:
372+ $ref: '#/definitions/proto.Attachment'
373+ type: array
374+ prompt:
375+ type: string
376+ session_id:
377+ type: string
378+ type: object
379+ proto.AgentSession:
380+ properties:
381+ completion_tokens:
382+ type: integer
383+ cost:
384+ type: number
385+ created_at:
386+ type: integer
387+ id:
388+ type: string
389+ is_busy:
390+ type: boolean
391+ message_count:
392+ type: integer
393+ parent_session_id:
394+ type: string
395+ prompt_tokens:
396+ type: integer
397+ summary_message_id:
398+ type: string
399+ title:
400+ type: string
401+ updated_at:
402+ type: integer
403+ type: object
404+ proto.Attachment:
405+ properties:
406+ content:
407+ items:
408+ type: integer
409+ type: array
410+ file_name:
411+ type: string
412+ file_path:
413+ type: string
414+ mime_type:
415+ type: string
416+ type: object
417+ proto.ConfigCompactRequest:
418+ properties:
419+ enabled:
420+ type: boolean
421+ scope:
422+ $ref: '#/definitions/config.Scope'
423+ type: object
424+ proto.ConfigModelRequest:
425+ properties:
426+ model:
427+ $ref: '#/definitions/config.SelectedModel'
428+ model_type:
429+ $ref: '#/definitions/config.SelectedModelType'
430+ scope:
431+ $ref: '#/definitions/config.Scope'
432+ type: object
433+ proto.ConfigProviderKeyRequest:
434+ properties:
435+ api_key: {}
436+ provider_id:
437+ type: string
438+ scope:
439+ $ref: '#/definitions/config.Scope'
440+ type: object
441+ proto.ConfigRefreshOAuthRequest:
442+ properties:
443+ provider_id:
444+ type: string
445+ scope:
446+ $ref: '#/definitions/config.Scope'
447+ type: object
448+ proto.ConfigRemoveRequest:
449+ properties:
450+ key:
451+ type: string
452+ scope:
453+ $ref: '#/definitions/config.Scope'
454+ type: object
455+ proto.ConfigSetRequest:
456+ properties:
457+ key:
458+ type: string
459+ scope:
460+ $ref: '#/definitions/config.Scope'
461+ value: {}
462+ type: object
463+ proto.Error:
464+ properties:
465+ message:
466+ type: string
467+ type: object
468+ proto.File:
469+ properties:
470+ content:
471+ type: string
472+ created_at:
473+ type: integer
474+ id:
475+ type: string
476+ path:
477+ type: string
478+ session_id:
479+ type: string
480+ updated_at:
481+ type: integer
482+ version:
483+ type: integer
484+ type: object
485+ proto.FileTrackerReadRequest:
486+ properties:
487+ path:
488+ type: string
489+ session_id:
490+ type: string
491+ type: object
492+ proto.ImportCopilotResponse:
493+ properties:
494+ success:
495+ type: boolean
496+ token: {}
497+ type: object
498+ proto.LSPClientInfo:
499+ properties:
500+ connected_at:
501+ type: string
502+ diagnostic_count:
503+ type: integer
504+ error: {}
505+ name:
506+ type: string
507+ state:
508+ $ref: '#/definitions/lsp.ServerState'
509+ type: object
510+ proto.LSPStartRequest:
511+ properties:
512+ path:
513+ type: string
514+ type: object
515+ proto.MCPClientInfo:
516+ properties:
517+ connected_at:
518+ type: string
519+ error: {}
520+ name:
521+ type: string
522+ prompt_count:
523+ type: integer
524+ resource_count:
525+ type: integer
526+ state:
527+ $ref: '#/definitions/proto.MCPState'
528+ tool_count:
529+ type: integer
530+ type: object
531+ proto.MCPGetPromptRequest:
532+ properties:
533+ args:
534+ additionalProperties:
535+ type: string
536+ type: object
537+ client_id:
538+ type: string
539+ prompt_id:
540+ type: string
541+ type: object
542+ proto.MCPGetPromptResponse:
543+ properties:
544+ prompt:
545+ type: string
546+ type: object
547+ proto.MCPNameRequest:
548+ properties:
549+ name:
550+ type: string
551+ type: object
552+ proto.MCPReadResourceRequest:
553+ properties:
554+ name:
555+ type: string
556+ uri:
557+ type: string
558+ type: object
559+ proto.MCPState:
560+ enum:
561+ - 0
562+ - 1
563+ - 2
564+ - 3
565+ type: integer
566+ x-enum-varnames:
567+ - MCPStateDisabled
568+ - MCPStateStarting
569+ - MCPStateConnected
570+ - MCPStateError
571+ proto.MessageRole:
572+ enum:
573+ - assistant
574+ - user
575+ - system
576+ - tool
577+ type: string
578+ x-enum-varnames:
579+ - Assistant
580+ - User
581+ - System
582+ - Tool
583+ proto.PermissionAction:
584+ enum:
585+ - allow
586+ - allow_session
587+ - deny
588+ type: string
589+ x-enum-varnames:
590+ - PermissionAllow
591+ - PermissionAllowForSession
592+ - PermissionDeny
593+ proto.PermissionGrant:
594+ properties:
595+ action:
596+ $ref: '#/definitions/proto.PermissionAction'
597+ permission:
598+ $ref: '#/definitions/proto.PermissionRequest'
599+ type: object
600+ proto.PermissionRequest:
601+ properties:
602+ action:
603+ type: string
604+ description:
605+ type: string
606+ id:
607+ type: string
608+ params: {}
609+ path:
610+ type: string
611+ session_id:
612+ type: string
613+ tool_call_id:
614+ type: string
615+ tool_name:
616+ type: string
617+ type: object
618+ proto.PermissionSkipRequest:
619+ properties:
620+ skip:
621+ type: boolean
622+ type: object
623+ proto.ProjectInitPromptResponse:
624+ properties:
625+ prompt:
626+ type: string
627+ type: object
628+ proto.ProjectNeedsInitResponse:
629+ properties:
630+ needs_init:
631+ type: boolean
632+ type: object
633+ proto.ServerControl:
634+ properties:
635+ command:
636+ type: string
637+ type: object
638+ proto.Session:
639+ properties:
640+ completion_tokens:
641+ type: integer
642+ cost:
643+ type: number
644+ created_at:
645+ type: integer
646+ id:
647+ type: string
648+ message_count:
649+ type: integer
650+ parent_session_id:
651+ type: string
652+ prompt_tokens:
653+ type: integer
654+ summary_message_id:
655+ type: string
656+ title:
657+ type: string
658+ updated_at:
659+ type: integer
660+ type: object
661+ proto.VersionInfo:
662+ properties:
663+ commit:
664+ type: string
665+ go_version:
666+ type: string
667+ platform:
668+ type: string
669+ version:
670+ type: string
671+ type: object
672+ proto.Workspace:
673+ properties:
674+ config:
675+ $ref: '#/definitions/github_com_charmbracelet_crush_internal_config.Config'
676+ data_dir:
677+ type: string
678+ debug:
679+ type: boolean
680+ env:
681+ items:
682+ type: string
683+ type: array
684+ id:
685+ type: string
686+ path:
687+ type: string
688+ version:
689+ type: string
690+ yolo:
691+ type: boolean
692+ type: object
693+ time.Duration:
694+ enum:
695+ - -9223372036854775808
696+ - 9223372036854775807
697+ - 1
698+ - 1000
699+ - 1000000
700+ - 1000000000
701+ - 60000000000
702+ - 3600000000000
703+ format: int64
704+ type: integer
705+ x-enum-varnames:
706+ - minDuration
707+ - maxDuration
708+ - Nanosecond
709+ - Microsecond
710+ - Millisecond
711+ - Second
712+ - Minute
713+ - Hour
714+info:
715+ contact:
716+ name: Charm
717+ url: https://charm.sh
718+ description: Crush is a terminal-based AI coding assistant. This API is served over
719+ a Unix socket (or Windows named pipe) and provides programmatic access to workspaces,
720+ sessions, agents, LSP, MCP, and more.
721+ license:
722+ name: MIT
723+ url: https://github.com/charmbracelet/crush/blob/main/LICENSE
724+ title: Crush API
725+ version: "1.0"
726+paths:
727+ /config:
728+ get:
729+ produces:
730+ - application/json
731+ responses:
732+ "200":
733+ description: OK
734+ schema:
735+ type: object
736+ summary: Get server config
737+ tags:
738+ - system
739+ /control:
740+ post:
741+ consumes:
742+ - application/json
743+ parameters:
744+ - description: Control command (e.g. shutdown)
745+ in: body
746+ name: request
747+ required: true
748+ schema:
749+ $ref: '#/definitions/proto.ServerControl'
750+ responses:
751+ "200":
752+ description: OK
753+ "400":
754+ description: Bad Request
755+ schema:
756+ $ref: '#/definitions/proto.Error'
757+ summary: Send server control command
758+ tags:
759+ - system
760+ /health:
761+ get:
762+ responses:
763+ "200":
764+ description: OK
765+ summary: Health check
766+ tags:
767+ - system
768+ /version:
769+ get:
770+ produces:
771+ - application/json
772+ responses:
773+ "200":
774+ description: OK
775+ schema:
776+ $ref: '#/definitions/proto.VersionInfo'
777+ summary: Get server version
778+ tags:
779+ - system
780+ /workspaces:
781+ get:
782+ produces:
783+ - application/json
784+ responses:
785+ "200":
786+ description: OK
787+ schema:
788+ items:
789+ $ref: '#/definitions/proto.Workspace'
790+ type: array
791+ summary: List workspaces
792+ tags:
793+ - workspaces
794+ post:
795+ consumes:
796+ - application/json
797+ parameters:
798+ - description: Workspace creation params
799+ in: body
800+ name: request
801+ required: true
802+ schema:
803+ $ref: '#/definitions/proto.Workspace'
804+ produces:
805+ - application/json
806+ responses:
807+ "200":
808+ description: OK
809+ schema:
810+ $ref: '#/definitions/proto.Workspace'
811+ "400":
812+ description: Bad Request
813+ schema:
814+ $ref: '#/definitions/proto.Error'
815+ "500":
816+ description: Internal Server Error
817+ schema:
818+ $ref: '#/definitions/proto.Error'
819+ summary: Create workspace
820+ tags:
821+ - workspaces
822+ /workspaces/{id}:
823+ delete:
824+ parameters:
825+ - description: Workspace ID
826+ in: path
827+ name: id
828+ required: true
829+ type: string
830+ responses:
831+ "200":
832+ description: OK
833+ "404":
834+ description: Not Found
835+ schema:
836+ $ref: '#/definitions/proto.Error'
837+ summary: Delete workspace
838+ tags:
839+ - workspaces
840+ get:
841+ parameters:
842+ - description: Workspace ID
843+ in: path
844+ name: id
845+ required: true
846+ type: string
847+ produces:
848+ - application/json
849+ responses:
850+ "200":
851+ description: OK
852+ schema:
853+ $ref: '#/definitions/proto.Workspace'
854+ "404":
855+ description: Not Found
856+ schema:
857+ $ref: '#/definitions/proto.Error'
858+ "500":
859+ description: Internal Server Error
860+ schema:
861+ $ref: '#/definitions/proto.Error'
862+ summary: Get workspace
863+ tags:
864+ - workspaces
865+ /workspaces/{id}/agent:
866+ get:
867+ parameters:
868+ - description: Workspace ID
869+ in: path
870+ name: id
871+ required: true
872+ type: string
873+ produces:
874+ - application/json
875+ responses:
876+ "200":
877+ description: OK
878+ schema:
879+ $ref: '#/definitions/proto.AgentInfo'
880+ "404":
881+ description: Not Found
882+ schema:
883+ $ref: '#/definitions/proto.Error'
884+ "500":
885+ description: Internal Server Error
886+ schema:
887+ $ref: '#/definitions/proto.Error'
888+ summary: Get agent info
889+ tags:
890+ - agent
891+ post:
892+ consumes:
893+ - application/json
894+ parameters:
895+ - description: Workspace ID
896+ in: path
897+ name: id
898+ required: true
899+ type: string
900+ - description: Agent message
901+ in: body
902+ name: request
903+ required: true
904+ schema:
905+ $ref: '#/definitions/proto.AgentMessage'
906+ responses:
907+ "200":
908+ description: OK
909+ "400":
910+ description: Bad Request
911+ schema:
912+ $ref: '#/definitions/proto.Error'
913+ "404":
914+ description: Not Found
915+ schema:
916+ $ref: '#/definitions/proto.Error'
917+ "500":
918+ description: Internal Server Error
919+ schema:
920+ $ref: '#/definitions/proto.Error'
921+ summary: Send message to agent
922+ tags:
923+ - agent
924+ /workspaces/{id}/agent/default-small-model:
925+ get:
926+ parameters:
927+ - description: Workspace ID
928+ in: path
929+ name: id
930+ required: true
931+ type: string
932+ - description: Provider ID
933+ in: query
934+ name: provider_id
935+ type: string
936+ produces:
937+ - application/json
938+ responses:
939+ "200":
940+ description: OK
941+ schema:
942+ type: object
943+ "404":
944+ description: Not Found
945+ schema:
946+ $ref: '#/definitions/proto.Error'
947+ "500":
948+ description: Internal Server Error
949+ schema:
950+ $ref: '#/definitions/proto.Error'
951+ summary: Get default small model
952+ tags:
953+ - agent
954+ /workspaces/{id}/agent/init:
955+ post:
956+ parameters:
957+ - description: Workspace ID
958+ in: path
959+ name: id
960+ required: true
961+ type: string
962+ responses:
963+ "200":
964+ description: OK
965+ "404":
966+ description: Not Found
967+ schema:
968+ $ref: '#/definitions/proto.Error'
969+ "500":
970+ description: Internal Server Error
971+ schema:
972+ $ref: '#/definitions/proto.Error'
973+ summary: Initialize agent
974+ tags:
975+ - agent
976+ /workspaces/{id}/agent/sessions/{sid}:
977+ get:
978+ parameters:
979+ - description: Workspace ID
980+ in: path
981+ name: id
982+ required: true
983+ type: string
984+ - description: Session ID
985+ in: path
986+ name: sid
987+ required: true
988+ type: string
989+ produces:
990+ - application/json
991+ responses:
992+ "200":
993+ description: OK
994+ schema:
995+ $ref: '#/definitions/proto.AgentSession'
996+ "404":
997+ description: Not Found
998+ schema:
999+ $ref: '#/definitions/proto.Error'
1000+ "500":
1001+ description: Internal Server Error
1002+ schema:
1003+ $ref: '#/definitions/proto.Error'
1004+ summary: Get agent session
1005+ tags:
1006+ - agent
1007+ /workspaces/{id}/agent/sessions/{sid}/cancel:
1008+ post:
1009+ parameters:
1010+ - description: Workspace ID
1011+ in: path
1012+ name: id
1013+ required: true
1014+ type: string
1015+ - description: Session ID
1016+ in: path
1017+ name: sid
1018+ required: true
1019+ type: string
1020+ responses:
1021+ "200":
1022+ description: OK
1023+ "404":
1024+ description: Not Found
1025+ schema:
1026+ $ref: '#/definitions/proto.Error'
1027+ "500":
1028+ description: Internal Server Error
1029+ schema:
1030+ $ref: '#/definitions/proto.Error'
1031+ summary: Cancel agent session
1032+ tags:
1033+ - agent
1034+ /workspaces/{id}/agent/sessions/{sid}/prompts/clear:
1035+ post:
1036+ parameters:
1037+ - description: Workspace ID
1038+ in: path
1039+ name: id
1040+ required: true
1041+ type: string
1042+ - description: Session ID
1043+ in: path
1044+ name: sid
1045+ required: true
1046+ type: string
1047+ responses:
1048+ "200":
1049+ description: OK
1050+ "404":
1051+ description: Not Found
1052+ schema:
1053+ $ref: '#/definitions/proto.Error'
1054+ "500":
1055+ description: Internal Server Error
1056+ schema:
1057+ $ref: '#/definitions/proto.Error'
1058+ summary: Clear prompt queue
1059+ tags:
1060+ - agent
1061+ /workspaces/{id}/agent/sessions/{sid}/prompts/list:
1062+ get:
1063+ parameters:
1064+ - description: Workspace ID
1065+ in: path
1066+ name: id
1067+ required: true
1068+ type: string
1069+ - description: Session ID
1070+ in: path
1071+ name: sid
1072+ required: true
1073+ type: string
1074+ produces:
1075+ - application/json
1076+ responses:
1077+ "200":
1078+ description: OK
1079+ schema:
1080+ items:
1081+ type: string
1082+ type: array
1083+ "404":
1084+ description: Not Found
1085+ schema:
1086+ $ref: '#/definitions/proto.Error'
1087+ "500":
1088+ description: Internal Server Error
1089+ schema:
1090+ $ref: '#/definitions/proto.Error'
1091+ summary: List queued prompts
1092+ tags:
1093+ - agent
1094+ /workspaces/{id}/agent/sessions/{sid}/prompts/queued:
1095+ get:
1096+ parameters:
1097+ - description: Workspace ID
1098+ in: path
1099+ name: id
1100+ required: true
1101+ type: string
1102+ - description: Session ID
1103+ in: path
1104+ name: sid
1105+ required: true
1106+ type: string
1107+ produces:
1108+ - application/json
1109+ responses:
1110+ "200":
1111+ description: OK
1112+ schema:
1113+ type: object
1114+ "404":
1115+ description: Not Found
1116+ schema:
1117+ $ref: '#/definitions/proto.Error'
1118+ "500":
1119+ description: Internal Server Error
1120+ schema:
1121+ $ref: '#/definitions/proto.Error'
1122+ summary: Get queued prompt status
1123+ tags:
1124+ - agent
1125+ /workspaces/{id}/agent/sessions/{sid}/summarize:
1126+ post:
1127+ parameters:
1128+ - description: Workspace ID
1129+ in: path
1130+ name: id
1131+ required: true
1132+ type: string
1133+ - description: Session ID
1134+ in: path
1135+ name: sid
1136+ required: true
1137+ type: string
1138+ responses:
1139+ "200":
1140+ description: OK
1141+ "404":
1142+ description: Not Found
1143+ schema:
1144+ $ref: '#/definitions/proto.Error'
1145+ "500":
1146+ description: Internal Server Error
1147+ schema:
1148+ $ref: '#/definitions/proto.Error'
1149+ summary: Summarize session
1150+ tags:
1151+ - agent
1152+ /workspaces/{id}/agent/update:
1153+ post:
1154+ parameters:
1155+ - description: Workspace ID
1156+ in: path
1157+ name: id
1158+ required: true
1159+ type: string
1160+ responses:
1161+ "200":
1162+ description: OK
1163+ "404":
1164+ description: Not Found
1165+ schema:
1166+ $ref: '#/definitions/proto.Error'
1167+ "500":
1168+ description: Internal Server Error
1169+ schema:
1170+ $ref: '#/definitions/proto.Error'
1171+ summary: Update agent
1172+ tags:
1173+ - agent
1174+ /workspaces/{id}/config:
1175+ get:
1176+ parameters:
1177+ - description: Workspace ID
1178+ in: path
1179+ name: id
1180+ required: true
1181+ type: string
1182+ produces:
1183+ - application/json
1184+ responses:
1185+ "200":
1186+ description: OK
1187+ schema:
1188+ type: object
1189+ "404":
1190+ description: Not Found
1191+ schema:
1192+ $ref: '#/definitions/proto.Error'
1193+ "500":
1194+ description: Internal Server Error
1195+ schema:
1196+ $ref: '#/definitions/proto.Error'
1197+ summary: Get workspace config
1198+ tags:
1199+ - workspaces
1200+ /workspaces/{id}/config/compact:
1201+ post:
1202+ consumes:
1203+ - application/json
1204+ parameters:
1205+ - description: Workspace ID
1206+ in: path
1207+ name: id
1208+ required: true
1209+ type: string
1210+ - description: Config compact request
1211+ in: body
1212+ name: request
1213+ required: true
1214+ schema:
1215+ $ref: '#/definitions/proto.ConfigCompactRequest'
1216+ responses:
1217+ "200":
1218+ description: OK
1219+ "400":
1220+ description: Bad Request
1221+ schema:
1222+ $ref: '#/definitions/proto.Error'
1223+ "404":
1224+ description: Not Found
1225+ schema:
1226+ $ref: '#/definitions/proto.Error'
1227+ "500":
1228+ description: Internal Server Error
1229+ schema:
1230+ $ref: '#/definitions/proto.Error'
1231+ summary: Set compact mode
1232+ tags:
1233+ - config
1234+ /workspaces/{id}/config/import-copilot:
1235+ post:
1236+ parameters:
1237+ - description: Workspace ID
1238+ in: path
1239+ name: id
1240+ required: true
1241+ type: string
1242+ produces:
1243+ - application/json
1244+ responses:
1245+ "200":
1246+ description: OK
1247+ schema:
1248+ $ref: '#/definitions/proto.ImportCopilotResponse'
1249+ "404":
1250+ description: Not Found
1251+ schema:
1252+ $ref: '#/definitions/proto.Error'
1253+ "500":
1254+ description: Internal Server Error
1255+ schema:
1256+ $ref: '#/definitions/proto.Error'
1257+ summary: Import Copilot credentials
1258+ tags:
1259+ - config
1260+ /workspaces/{id}/config/model:
1261+ post:
1262+ consumes:
1263+ - application/json
1264+ parameters:
1265+ - description: Workspace ID
1266+ in: path
1267+ name: id
1268+ required: true
1269+ type: string
1270+ - description: Config model request
1271+ in: body
1272+ name: request
1273+ required: true
1274+ schema:
1275+ $ref: '#/definitions/proto.ConfigModelRequest'
1276+ responses:
1277+ "200":
1278+ description: OK
1279+ "400":
1280+ description: Bad Request
1281+ schema:
1282+ $ref: '#/definitions/proto.Error'
1283+ "404":
1284+ description: Not Found
1285+ schema:
1286+ $ref: '#/definitions/proto.Error'
1287+ "500":
1288+ description: Internal Server Error
1289+ schema:
1290+ $ref: '#/definitions/proto.Error'
1291+ summary: Set the preferred model
1292+ tags:
1293+ - config
1294+ /workspaces/{id}/config/provider-key:
1295+ post:
1296+ consumes:
1297+ - application/json
1298+ parameters:
1299+ - description: Workspace ID
1300+ in: path
1301+ name: id
1302+ required: true
1303+ type: string
1304+ - description: Config provider key request
1305+ in: body
1306+ name: request
1307+ required: true
1308+ schema:
1309+ $ref: '#/definitions/proto.ConfigProviderKeyRequest'
1310+ responses:
1311+ "200":
1312+ description: OK
1313+ "400":
1314+ description: Bad Request
1315+ schema:
1316+ $ref: '#/definitions/proto.Error'
1317+ "404":
1318+ description: Not Found
1319+ schema:
1320+ $ref: '#/definitions/proto.Error'
1321+ "500":
1322+ description: Internal Server Error
1323+ schema:
1324+ $ref: '#/definitions/proto.Error'
1325+ summary: Set provider API key
1326+ tags:
1327+ - config
1328+ /workspaces/{id}/config/refresh-oauth:
1329+ post:
1330+ consumes:
1331+ - application/json
1332+ parameters:
1333+ - description: Workspace ID
1334+ in: path
1335+ name: id
1336+ required: true
1337+ type: string
1338+ - description: Refresh OAuth request
1339+ in: body
1340+ name: request
1341+ required: true
1342+ schema:
1343+ $ref: '#/definitions/proto.ConfigRefreshOAuthRequest'
1344+ responses:
1345+ "200":
1346+ description: OK
1347+ "400":
1348+ description: Bad Request
1349+ schema:
1350+ $ref: '#/definitions/proto.Error'
1351+ "404":
1352+ description: Not Found
1353+ schema:
1354+ $ref: '#/definitions/proto.Error'
1355+ "500":
1356+ description: Internal Server Error
1357+ schema:
1358+ $ref: '#/definitions/proto.Error'
1359+ summary: Refresh OAuth token
1360+ tags:
1361+ - config
1362+ /workspaces/{id}/config/remove:
1363+ post:
1364+ consumes:
1365+ - application/json
1366+ parameters:
1367+ - description: Workspace ID
1368+ in: path
1369+ name: id
1370+ required: true
1371+ type: string
1372+ - description: Config remove request
1373+ in: body
1374+ name: request
1375+ required: true
1376+ schema:
1377+ $ref: '#/definitions/proto.ConfigRemoveRequest'
1378+ responses:
1379+ "200":
1380+ description: OK
1381+ "400":
1382+ description: Bad Request
1383+ schema:
1384+ $ref: '#/definitions/proto.Error'
1385+ "404":
1386+ description: Not Found
1387+ schema:
1388+ $ref: '#/definitions/proto.Error'
1389+ "500":
1390+ description: Internal Server Error
1391+ schema:
1392+ $ref: '#/definitions/proto.Error'
1393+ summary: Remove a config field
1394+ tags:
1395+ - config
1396+ /workspaces/{id}/config/set:
1397+ post:
1398+ consumes:
1399+ - application/json
1400+ parameters:
1401+ - description: Workspace ID
1402+ in: path
1403+ name: id
1404+ required: true
1405+ type: string
1406+ - description: Config set request
1407+ in: body
1408+ name: request
1409+ required: true
1410+ schema:
1411+ $ref: '#/definitions/proto.ConfigSetRequest'
1412+ responses:
1413+ "200":
1414+ description: OK
1415+ "400":
1416+ description: Bad Request
1417+ schema:
1418+ $ref: '#/definitions/proto.Error'
1419+ "404":
1420+ description: Not Found
1421+ schema:
1422+ $ref: '#/definitions/proto.Error'
1423+ "500":
1424+ description: Internal Server Error
1425+ schema:
1426+ $ref: '#/definitions/proto.Error'
1427+ summary: Set a config field
1428+ tags:
1429+ - config
1430+ /workspaces/{id}/events:
1431+ get:
1432+ parameters:
1433+ - description: Workspace ID
1434+ in: path
1435+ name: id
1436+ required: true
1437+ type: string
1438+ produces:
1439+ - text/event-stream
1440+ responses:
1441+ "200":
1442+ description: OK
1443+ "404":
1444+ description: Not Found
1445+ schema:
1446+ $ref: '#/definitions/proto.Error'
1447+ "500":
1448+ description: Internal Server Error
1449+ schema:
1450+ $ref: '#/definitions/proto.Error'
1451+ summary: Stream workspace events (SSE)
1452+ tags:
1453+ - workspaces
1454+ /workspaces/{id}/filetracker/lastread:
1455+ get:
1456+ parameters:
1457+ - description: Workspace ID
1458+ in: path
1459+ name: id
1460+ required: true
1461+ type: string
1462+ - description: Session ID
1463+ in: query
1464+ name: session_id
1465+ type: string
1466+ - description: File path
1467+ in: query
1468+ name: path
1469+ required: true
1470+ type: string
1471+ produces:
1472+ - application/json
1473+ responses:
1474+ "200":
1475+ description: OK
1476+ schema:
1477+ type: object
1478+ "404":
1479+ description: Not Found
1480+ schema:
1481+ $ref: '#/definitions/proto.Error'
1482+ "500":
1483+ description: Internal Server Error
1484+ schema:
1485+ $ref: '#/definitions/proto.Error'
1486+ summary: Get last read time for file
1487+ tags:
1488+ - filetracker
1489+ /workspaces/{id}/filetracker/read:
1490+ post:
1491+ consumes:
1492+ - application/json
1493+ parameters:
1494+ - description: Workspace ID
1495+ in: path
1496+ name: id
1497+ required: true
1498+ type: string
1499+ - description: File tracker read request
1500+ in: body
1501+ name: request
1502+ required: true
1503+ schema:
1504+ $ref: '#/definitions/proto.FileTrackerReadRequest'
1505+ responses:
1506+ "200":
1507+ description: OK
1508+ "400":
1509+ description: Bad Request
1510+ schema:
1511+ $ref: '#/definitions/proto.Error'
1512+ "404":
1513+ description: Not Found
1514+ schema:
1515+ $ref: '#/definitions/proto.Error'
1516+ "500":
1517+ description: Internal Server Error
1518+ schema:
1519+ $ref: '#/definitions/proto.Error'
1520+ summary: Record file read
1521+ tags:
1522+ - filetracker
1523+ /workspaces/{id}/lsps:
1524+ get:
1525+ parameters:
1526+ - description: Workspace ID
1527+ in: path
1528+ name: id
1529+ required: true
1530+ type: string
1531+ produces:
1532+ - application/json
1533+ responses:
1534+ "200":
1535+ description: OK
1536+ schema:
1537+ additionalProperties:
1538+ $ref: '#/definitions/proto.LSPClientInfo'
1539+ type: object
1540+ "404":
1541+ description: Not Found
1542+ schema:
1543+ $ref: '#/definitions/proto.Error'
1544+ "500":
1545+ description: Internal Server Error
1546+ schema:
1547+ $ref: '#/definitions/proto.Error'
1548+ summary: List LSP clients
1549+ tags:
1550+ - lsp
1551+ /workspaces/{id}/lsps/{lsp}/diagnostics:
1552+ get:
1553+ parameters:
1554+ - description: Workspace ID
1555+ in: path
1556+ name: id
1557+ required: true
1558+ type: string
1559+ - description: LSP client name
1560+ in: path
1561+ name: lsp
1562+ required: true
1563+ type: string
1564+ produces:
1565+ - application/json
1566+ responses:
1567+ "200":
1568+ description: OK
1569+ schema:
1570+ type: object
1571+ "404":
1572+ description: Not Found
1573+ schema:
1574+ $ref: '#/definitions/proto.Error'
1575+ "500":
1576+ description: Internal Server Error
1577+ schema:
1578+ $ref: '#/definitions/proto.Error'
1579+ summary: Get LSP diagnostics
1580+ tags:
1581+ - lsp
1582+ /workspaces/{id}/lsps/start:
1583+ post:
1584+ consumes:
1585+ - application/json
1586+ parameters:
1587+ - description: Workspace ID
1588+ in: path
1589+ name: id
1590+ required: true
1591+ type: string
1592+ - description: LSP start request
1593+ in: body
1594+ name: request
1595+ required: true
1596+ schema:
1597+ $ref: '#/definitions/proto.LSPStartRequest'
1598+ responses:
1599+ "200":
1600+ description: OK
1601+ "400":
1602+ description: Bad Request
1603+ schema:
1604+ $ref: '#/definitions/proto.Error'
1605+ "404":
1606+ description: Not Found
1607+ schema:
1608+ $ref: '#/definitions/proto.Error'
1609+ "500":
1610+ description: Internal Server Error
1611+ schema:
1612+ $ref: '#/definitions/proto.Error'
1613+ summary: Start LSP server
1614+ tags:
1615+ - lsp
1616+ /workspaces/{id}/lsps/stop:
1617+ post:
1618+ parameters:
1619+ - description: Workspace ID
1620+ in: path
1621+ name: id
1622+ required: true
1623+ type: string
1624+ responses:
1625+ "200":
1626+ description: OK
1627+ "404":
1628+ description: Not Found
1629+ schema:
1630+ $ref: '#/definitions/proto.Error'
1631+ "500":
1632+ description: Internal Server Error
1633+ schema:
1634+ $ref: '#/definitions/proto.Error'
1635+ summary: Stop all LSP servers
1636+ tags:
1637+ - lsp
1638+ /workspaces/{id}/mcp/get-prompt:
1639+ post:
1640+ consumes:
1641+ - application/json
1642+ parameters:
1643+ - description: Workspace ID
1644+ in: path
1645+ name: id
1646+ required: true
1647+ type: string
1648+ - description: MCP get prompt request
1649+ in: body
1650+ name: request
1651+ required: true
1652+ schema:
1653+ $ref: '#/definitions/proto.MCPGetPromptRequest'
1654+ produces:
1655+ - application/json
1656+ responses:
1657+ "200":
1658+ description: OK
1659+ schema:
1660+ $ref: '#/definitions/proto.MCPGetPromptResponse'
1661+ "400":
1662+ description: Bad Request
1663+ schema:
1664+ $ref: '#/definitions/proto.Error'
1665+ "404":
1666+ description: Not Found
1667+ schema:
1668+ $ref: '#/definitions/proto.Error'
1669+ "500":
1670+ description: Internal Server Error
1671+ schema:
1672+ $ref: '#/definitions/proto.Error'
1673+ summary: Get MCP prompt
1674+ tags:
1675+ - mcp
1676+ /workspaces/{id}/mcp/read-resource:
1677+ post:
1678+ consumes:
1679+ - application/json
1680+ parameters:
1681+ - description: Workspace ID
1682+ in: path
1683+ name: id
1684+ required: true
1685+ type: string
1686+ - description: MCP read resource request
1687+ in: body
1688+ name: request
1689+ required: true
1690+ schema:
1691+ $ref: '#/definitions/proto.MCPReadResourceRequest'
1692+ produces:
1693+ - application/json
1694+ responses:
1695+ "200":
1696+ description: OK
1697+ schema:
1698+ type: object
1699+ "400":
1700+ description: Bad Request
1701+ schema:
1702+ $ref: '#/definitions/proto.Error'
1703+ "404":
1704+ description: Not Found
1705+ schema:
1706+ $ref: '#/definitions/proto.Error'
1707+ "500":
1708+ description: Internal Server Error
1709+ schema:
1710+ $ref: '#/definitions/proto.Error'
1711+ summary: Read MCP resource
1712+ tags:
1713+ - mcp
1714+ /workspaces/{id}/mcp/refresh-prompts:
1715+ post:
1716+ consumes:
1717+ - application/json
1718+ parameters:
1719+ - description: Workspace ID
1720+ in: path
1721+ name: id
1722+ required: true
1723+ type: string
1724+ - description: MCP name request
1725+ in: body
1726+ name: request
1727+ required: true
1728+ schema:
1729+ $ref: '#/definitions/proto.MCPNameRequest'
1730+ responses:
1731+ "200":
1732+ description: OK
1733+ "400":
1734+ description: Bad Request
1735+ schema:
1736+ $ref: '#/definitions/proto.Error'
1737+ "404":
1738+ description: Not Found
1739+ schema:
1740+ $ref: '#/definitions/proto.Error'
1741+ "500":
1742+ description: Internal Server Error
1743+ schema:
1744+ $ref: '#/definitions/proto.Error'
1745+ summary: Refresh MCP prompts
1746+ tags:
1747+ - mcp
1748+ /workspaces/{id}/mcp/refresh-resources:
1749+ post:
1750+ consumes:
1751+ - application/json
1752+ parameters:
1753+ - description: Workspace ID
1754+ in: path
1755+ name: id
1756+ required: true
1757+ type: string
1758+ - description: MCP name request
1759+ in: body
1760+ name: request
1761+ required: true
1762+ schema:
1763+ $ref: '#/definitions/proto.MCPNameRequest'
1764+ responses:
1765+ "200":
1766+ description: OK
1767+ "400":
1768+ description: Bad Request
1769+ schema:
1770+ $ref: '#/definitions/proto.Error'
1771+ "404":
1772+ description: Not Found
1773+ schema:
1774+ $ref: '#/definitions/proto.Error'
1775+ "500":
1776+ description: Internal Server Error
1777+ schema:
1778+ $ref: '#/definitions/proto.Error'
1779+ summary: Refresh MCP resources
1780+ tags:
1781+ - mcp
1782+ /workspaces/{id}/mcp/refresh-tools:
1783+ post:
1784+ consumes:
1785+ - application/json
1786+ parameters:
1787+ - description: Workspace ID
1788+ in: path
1789+ name: id
1790+ required: true
1791+ type: string
1792+ - description: MCP name request
1793+ in: body
1794+ name: request
1795+ required: true
1796+ schema:
1797+ $ref: '#/definitions/proto.MCPNameRequest'
1798+ responses:
1799+ "200":
1800+ description: OK
1801+ "400":
1802+ description: Bad Request
1803+ schema:
1804+ $ref: '#/definitions/proto.Error'
1805+ "404":
1806+ description: Not Found
1807+ schema:
1808+ $ref: '#/definitions/proto.Error'
1809+ "500":
1810+ description: Internal Server Error
1811+ schema:
1812+ $ref: '#/definitions/proto.Error'
1813+ summary: Refresh MCP tools
1814+ tags:
1815+ - mcp
1816+ /workspaces/{id}/mcp/states:
1817+ get:
1818+ parameters:
1819+ - description: Workspace ID
1820+ in: path
1821+ name: id
1822+ required: true
1823+ type: string
1824+ produces:
1825+ - application/json
1826+ responses:
1827+ "200":
1828+ description: OK
1829+ schema:
1830+ additionalProperties:
1831+ $ref: '#/definitions/proto.MCPClientInfo'
1832+ type: object
1833+ "404":
1834+ description: Not Found
1835+ schema:
1836+ $ref: '#/definitions/proto.Error'
1837+ "500":
1838+ description: Internal Server Error
1839+ schema:
1840+ $ref: '#/definitions/proto.Error'
1841+ summary: Get MCP client states
1842+ tags:
1843+ - mcp
1844+ /workspaces/{id}/messages/user:
1845+ get:
1846+ parameters:
1847+ - description: Workspace ID
1848+ in: path
1849+ name: id
1850+ required: true
1851+ type: string
1852+ produces:
1853+ - application/json
1854+ responses:
1855+ "200":
1856+ description: OK
1857+ schema:
1858+ items:
1859+ $ref: '#/definitions/github_com_charmbracelet_crush_internal_proto.Message'
1860+ type: array
1861+ "404":
1862+ description: Not Found
1863+ schema:
1864+ $ref: '#/definitions/proto.Error'
1865+ "500":
1866+ description: Internal Server Error
1867+ schema:
1868+ $ref: '#/definitions/proto.Error'
1869+ summary: Get all user messages for workspace
1870+ tags:
1871+ - workspaces
1872+ /workspaces/{id}/permissions/grant:
1873+ post:
1874+ consumes:
1875+ - application/json
1876+ parameters:
1877+ - description: Workspace ID
1878+ in: path
1879+ name: id
1880+ required: true
1881+ type: string
1882+ - description: Permission grant
1883+ in: body
1884+ name: request
1885+ required: true
1886+ schema:
1887+ $ref: '#/definitions/proto.PermissionGrant'
1888+ responses:
1889+ "200":
1890+ description: OK
1891+ "400":
1892+ description: Bad Request
1893+ schema:
1894+ $ref: '#/definitions/proto.Error'
1895+ "404":
1896+ description: Not Found
1897+ schema:
1898+ $ref: '#/definitions/proto.Error'
1899+ "500":
1900+ description: Internal Server Error
1901+ schema:
1902+ $ref: '#/definitions/proto.Error'
1903+ summary: Grant permission
1904+ tags:
1905+ - permissions
1906+ /workspaces/{id}/permissions/skip:
1907+ get:
1908+ parameters:
1909+ - description: Workspace ID
1910+ in: path
1911+ name: id
1912+ required: true
1913+ type: string
1914+ produces:
1915+ - application/json
1916+ responses:
1917+ "200":
1918+ description: OK
1919+ schema:
1920+ $ref: '#/definitions/proto.PermissionSkipRequest'
1921+ "404":
1922+ description: Not Found
1923+ schema:
1924+ $ref: '#/definitions/proto.Error'
1925+ "500":
1926+ description: Internal Server Error
1927+ schema:
1928+ $ref: '#/definitions/proto.Error'
1929+ summary: Get skip permissions status
1930+ tags:
1931+ - permissions
1932+ post:
1933+ consumes:
1934+ - application/json
1935+ parameters:
1936+ - description: Workspace ID
1937+ in: path
1938+ name: id
1939+ required: true
1940+ type: string
1941+ - description: Permission skip request
1942+ in: body
1943+ name: request
1944+ required: true
1945+ schema:
1946+ $ref: '#/definitions/proto.PermissionSkipRequest'
1947+ responses:
1948+ "200":
1949+ description: OK
1950+ "400":
1951+ description: Bad Request
1952+ schema:
1953+ $ref: '#/definitions/proto.Error'
1954+ "404":
1955+ description: Not Found
1956+ schema:
1957+ $ref: '#/definitions/proto.Error'
1958+ "500":
1959+ description: Internal Server Error
1960+ schema:
1961+ $ref: '#/definitions/proto.Error'
1962+ summary: Set skip permissions
1963+ tags:
1964+ - permissions
1965+ /workspaces/{id}/project/init:
1966+ post:
1967+ parameters:
1968+ - description: Workspace ID
1969+ in: path
1970+ name: id
1971+ required: true
1972+ type: string
1973+ responses:
1974+ "200":
1975+ description: OK
1976+ "404":
1977+ description: Not Found
1978+ schema:
1979+ $ref: '#/definitions/proto.Error'
1980+ "500":
1981+ description: Internal Server Error
1982+ schema:
1983+ $ref: '#/definitions/proto.Error'
1984+ summary: Mark project as initialized
1985+ tags:
1986+ - project
1987+ /workspaces/{id}/project/init-prompt:
1988+ get:
1989+ parameters:
1990+ - description: Workspace ID
1991+ in: path
1992+ name: id
1993+ required: true
1994+ type: string
1995+ produces:
1996+ - application/json
1997+ responses:
1998+ "200":
1999+ description: OK
2000+ schema:
2001+ $ref: '#/definitions/proto.ProjectInitPromptResponse'
2002+ "404":
2003+ description: Not Found
2004+ schema:
2005+ $ref: '#/definitions/proto.Error'
2006+ "500":
2007+ description: Internal Server Error
2008+ schema:
2009+ $ref: '#/definitions/proto.Error'
2010+ summary: Get project initialization prompt
2011+ tags:
2012+ - project
2013+ /workspaces/{id}/project/needs-init:
2014+ get:
2015+ parameters:
2016+ - description: Workspace ID
2017+ in: path
2018+ name: id
2019+ required: true
2020+ type: string
2021+ produces:
2022+ - application/json
2023+ responses:
2024+ "200":
2025+ description: OK
2026+ schema:
2027+ $ref: '#/definitions/proto.ProjectNeedsInitResponse'
2028+ "404":
2029+ description: Not Found
2030+ schema:
2031+ $ref: '#/definitions/proto.Error'
2032+ "500":
2033+ description: Internal Server Error
2034+ schema:
2035+ $ref: '#/definitions/proto.Error'
2036+ summary: Check if project needs initialization
2037+ tags:
2038+ - project
2039+ /workspaces/{id}/providers:
2040+ get:
2041+ parameters:
2042+ - description: Workspace ID
2043+ in: path
2044+ name: id
2045+ required: true
2046+ type: string
2047+ produces:
2048+ - application/json
2049+ responses:
2050+ "200":
2051+ description: OK
2052+ schema:
2053+ type: object
2054+ "404":
2055+ description: Not Found
2056+ schema:
2057+ $ref: '#/definitions/proto.Error'
2058+ "500":
2059+ description: Internal Server Error
2060+ schema:
2061+ $ref: '#/definitions/proto.Error'
2062+ summary: Get workspace providers
2063+ tags:
2064+ - workspaces
2065+ /workspaces/{id}/sessions:
2066+ get:
2067+ parameters:
2068+ - description: Workspace ID
2069+ in: path
2070+ name: id
2071+ required: true
2072+ type: string
2073+ produces:
2074+ - application/json
2075+ responses:
2076+ "200":
2077+ description: OK
2078+ schema:
2079+ items:
2080+ $ref: '#/definitions/proto.Session'
2081+ type: array
2082+ "404":
2083+ description: Not Found
2084+ schema:
2085+ $ref: '#/definitions/proto.Error'
2086+ "500":
2087+ description: Internal Server Error
2088+ schema:
2089+ $ref: '#/definitions/proto.Error'
2090+ summary: List sessions
2091+ tags:
2092+ - sessions
2093+ post:
2094+ consumes:
2095+ - application/json
2096+ parameters:
2097+ - description: Workspace ID
2098+ in: path
2099+ name: id
2100+ required: true
2101+ type: string
2102+ - description: Session creation params (title)
2103+ in: body
2104+ name: request
2105+ required: true
2106+ schema:
2107+ $ref: '#/definitions/proto.Session'
2108+ produces:
2109+ - application/json
2110+ responses:
2111+ "200":
2112+ description: OK
2113+ schema:
2114+ $ref: '#/definitions/proto.Session'
2115+ "400":
2116+ description: Bad Request
2117+ schema:
2118+ $ref: '#/definitions/proto.Error'
2119+ "404":
2120+ description: Not Found
2121+ schema:
2122+ $ref: '#/definitions/proto.Error'
2123+ "500":
2124+ description: Internal Server Error
2125+ schema:
2126+ $ref: '#/definitions/proto.Error'
2127+ summary: Create session
2128+ tags:
2129+ - sessions
2130+ /workspaces/{id}/sessions/{sid}:
2131+ delete:
2132+ parameters:
2133+ - description: Workspace ID
2134+ in: path
2135+ name: id
2136+ required: true
2137+ type: string
2138+ - description: Session ID
2139+ in: path
2140+ name: sid
2141+ required: true
2142+ type: string
2143+ responses:
2144+ "200":
2145+ description: OK
2146+ "404":
2147+ description: Not Found
2148+ schema:
2149+ $ref: '#/definitions/proto.Error'
2150+ "500":
2151+ description: Internal Server Error
2152+ schema:
2153+ $ref: '#/definitions/proto.Error'
2154+ summary: Delete session
2155+ tags:
2156+ - sessions
2157+ get:
2158+ parameters:
2159+ - description: Workspace ID
2160+ in: path
2161+ name: id
2162+ required: true
2163+ type: string
2164+ - description: Session ID
2165+ in: path
2166+ name: sid
2167+ required: true
2168+ type: string
2169+ produces:
2170+ - application/json
2171+ responses:
2172+ "200":
2173+ description: OK
2174+ schema:
2175+ $ref: '#/definitions/proto.Session'
2176+ "404":
2177+ description: Not Found
2178+ schema:
2179+ $ref: '#/definitions/proto.Error'
2180+ "500":
2181+ description: Internal Server Error
2182+ schema:
2183+ $ref: '#/definitions/proto.Error'
2184+ summary: Get session
2185+ tags:
2186+ - sessions
2187+ put:
2188+ consumes:
2189+ - application/json
2190+ parameters:
2191+ - description: Workspace ID
2192+ in: path
2193+ name: id
2194+ required: true
2195+ type: string
2196+ - description: Session ID
2197+ in: path
2198+ name: sid
2199+ required: true
2200+ type: string
2201+ - description: Updated session
2202+ in: body
2203+ name: request
2204+ required: true
2205+ schema:
2206+ $ref: '#/definitions/proto.Session'
2207+ produces:
2208+ - application/json
2209+ responses:
2210+ "200":
2211+ description: OK
2212+ schema:
2213+ $ref: '#/definitions/proto.Session'
2214+ "400":
2215+ description: Bad Request
2216+ schema:
2217+ $ref: '#/definitions/proto.Error'
2218+ "404":
2219+ description: Not Found
2220+ schema:
2221+ $ref: '#/definitions/proto.Error'
2222+ "500":
2223+ description: Internal Server Error
2224+ schema:
2225+ $ref: '#/definitions/proto.Error'
2226+ summary: Update session
2227+ tags:
2228+ - sessions
2229+ /workspaces/{id}/sessions/{sid}/filetracker/files:
2230+ get:
2231+ parameters:
2232+ - description: Workspace ID
2233+ in: path
2234+ name: id
2235+ required: true
2236+ type: string
2237+ - description: Session ID
2238+ in: path
2239+ name: sid
2240+ required: true
2241+ type: string
2242+ produces:
2243+ - application/json
2244+ responses:
2245+ "200":
2246+ description: OK
2247+ schema:
2248+ items:
2249+ type: string
2250+ type: array
2251+ "404":
2252+ description: Not Found
2253+ schema:
2254+ $ref: '#/definitions/proto.Error'
2255+ "500":
2256+ description: Internal Server Error
2257+ schema:
2258+ $ref: '#/definitions/proto.Error'
2259+ summary: List tracked files for session
2260+ tags:
2261+ - filetracker
2262+ /workspaces/{id}/sessions/{sid}/history:
2263+ get:
2264+ parameters:
2265+ - description: Workspace ID
2266+ in: path
2267+ name: id
2268+ required: true
2269+ type: string
2270+ - description: Session ID
2271+ in: path
2272+ name: sid
2273+ required: true
2274+ type: string
2275+ produces:
2276+ - application/json
2277+ responses:
2278+ "200":
2279+ description: OK
2280+ schema:
2281+ items:
2282+ $ref: '#/definitions/proto.File'
2283+ type: array
2284+ "404":
2285+ description: Not Found
2286+ schema:
2287+ $ref: '#/definitions/proto.Error'
2288+ "500":
2289+ description: Internal Server Error
2290+ schema:
2291+ $ref: '#/definitions/proto.Error'
2292+ summary: Get session history
2293+ tags:
2294+ - sessions
2295+ /workspaces/{id}/sessions/{sid}/messages:
2296+ get:
2297+ parameters:
2298+ - description: Workspace ID
2299+ in: path
2300+ name: id
2301+ required: true
2302+ type: string
2303+ - description: Session ID
2304+ in: path
2305+ name: sid
2306+ required: true
2307+ type: string
2308+ produces:
2309+ - application/json
2310+ responses:
2311+ "200":
2312+ description: OK
2313+ schema:
2314+ items:
2315+ $ref: '#/definitions/github_com_charmbracelet_crush_internal_proto.Message'
2316+ type: array
2317+ "404":
2318+ description: Not Found
2319+ schema:
2320+ $ref: '#/definitions/proto.Error'
2321+ "500":
2322+ description: Internal Server Error
2323+ schema:
2324+ $ref: '#/definitions/proto.Error'
2325+ summary: Get session messages
2326+ tags:
2327+ - sessions
2328+ /workspaces/{id}/sessions/{sid}/messages/user:
2329+ get:
2330+ parameters:
2331+ - description: Workspace ID
2332+ in: path
2333+ name: id
2334+ required: true
2335+ type: string
2336+ - description: Session ID
2337+ in: path
2338+ name: sid
2339+ required: true
2340+ type: string
2341+ produces:
2342+ - application/json
2343+ responses:
2344+ "200":
2345+ description: OK
2346+ schema:
2347+ items:
2348+ $ref: '#/definitions/github_com_charmbracelet_crush_internal_proto.Message'
2349+ type: array
2350+ "404":
2351+ description: Not Found
2352+ schema:
2353+ $ref: '#/definitions/proto.Error'
2354+ "500":
2355+ description: Internal Server Error
2356+ schema:
2357+ $ref: '#/definitions/proto.Error'
2358+ summary: Get user messages for session
2359+ tags:
2360+ - sessions
2361+swagger: "2.0"