The open source coding agent.
TypeScript
regen client
Dax Raadbb6fc2a1fdcd
diff --git a/pkg/client/gen/openapi.json b/pkg/client/gen/openapi.jsonindex 3a14a46436d..478eb02aeac 100644--- a/pkg/client/gen/openapi.json+++ b/pkg/client/gen/openapi.json@@ -95,6 +95,64 @@}}},+ "/session_list": {+ "post": {+ "responses": {+ "200": {+ "description": "List of sessions",+ "content": {+ "application/json": {+ "schema": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "id": {+ "type": "string",+ "pattern": "^ses"+ },+ "shareID": {+ "type": "string"+ },+ "title": {+ "type": "string"+ },+ "tokens": {+ "type": "object",+ "properties": {+ "input": {+ "type": "number"+ },+ "output": {+ "type": "number"+ },+ "reasoning": {+ "type": "number"+ }+ },+ "required": [+ "input",+ "output",+ "reasoning"+ ]+ }+ },+ "required": [+ "id",+ "title",+ "tokens"+ ]+ }+ }+ }+ }+ }+ },+ "operationId": "postSession_list",+ "parameters": [],+ "description": "List all sessions"+ }+ },"/session_chat": {"post": {"responses": {},diff --git a/pkg/client/generated-client.go b/pkg/client/generated-client.goindex e93e83afe8f..46fb6020563 100644--- a/pkg/client/generated-client.go+++ b/pkg/client/generated-client.go@@ -132,6 +132,9 @@ type ClientInterface interface {// PostSessionCreate requestPostSessionCreate(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)+ // PostSessionList request+ PostSessionList(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)+// PostSessionMessagesWithBody request with any bodyPostSessionMessagesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)@@ -179,6 +182,18 @@ func (c *Client) PostSessionCreate(ctx context.Context, reqEditors ...RequestEdireturn c.Client.Do(req)}+func (c *Client) PostSessionList(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {+ req, err := NewPostSessionListRequest(c.Server)+ if err != nil {+ return nil, err+ }+ req = req.WithContext(ctx)+ if err := c.applyEditors(ctx, req, reqEditors); err != nil {+ return nil, err+ }+ return c.Client.Do(req)+}+func (c *Client) PostSessionMessagesWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {req, err := NewPostSessionMessagesRequestWithBody(c.Server, contentType, body)if err != nil {@@ -294,6 +309,33 @@ func NewPostSessionCreateRequest(server string) (*http.Request, error) {return req, nil}+// NewPostSessionListRequest generates requests for PostSessionList+func NewPostSessionListRequest(server string) (*http.Request, error) {+ var err error++ serverURL, err := url.Parse(server)+ if err != nil {+ return nil, err+ }++ operationPath := fmt.Sprintf("/session_list")+ if operationPath[0] == '/' {+ operationPath = "." + operationPath+ }++ queryURL, err := serverURL.Parse(operationPath)+ if err != nil {+ return nil, err+ }++ req, err := http.NewRequest("POST", queryURL.String(), nil)+ if err != nil {+ return nil, err+ }++ return req, nil+}+// NewPostSessionMessagesRequest calls the generic PostSessionMessages builder with application/json bodyfunc NewPostSessionMessagesRequest(server string, body PostSessionMessagesJSONRequestBody) (*http.Request, error) {var bodyReader io.Reader@@ -425,6 +467,9 @@ type ClientWithResponsesInterface interface {// PostSessionCreateWithResponse requestPostSessionCreateWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostSessionCreateResponse, error)+ // PostSessionListWithResponse request+ PostSessionListWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostSessionListResponse, error)+// PostSessionMessagesWithBodyWithResponse request with any bodyPostSessionMessagesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionMessagesResponse, error)@@ -479,6 +524,37 @@ func (r PostSessionCreateResponse) StatusCode() int {return 0}+type PostSessionListResponse struct {+ Body []byte+ HTTPResponse *http.Response+ JSON200 *[]struct {+ Id string `json:"id"`+ ShareID *string `json:"shareID,omitempty"`+ Title string `json:"title"`+ Tokens struct {+ Input float32 `json:"input"`+ Output float32 `json:"output"`+ Reasoning float32 `json:"reasoning"`+ } `json:"tokens"`+ }+}++// Status returns HTTPResponse.Status+func (r PostSessionListResponse) Status() string {+ if r.HTTPResponse != nil {+ return r.HTTPResponse.Status+ }+ return http.StatusText(0)+}++// StatusCode returns HTTPResponse.StatusCode+func (r PostSessionListResponse) StatusCode() int {+ if r.HTTPResponse != nil {+ return r.HTTPResponse.StatusCode+ }+ return 0+}+type PostSessionMessagesResponse struct {Body []byteHTTPResponse *http.Response@@ -549,6 +625,15 @@ func (c *ClientWithResponses) PostSessionCreateWithResponse(ctx context.Context,return ParsePostSessionCreateResponse(rsp)}+// PostSessionListWithResponse request returning *PostSessionListResponse+func (c *ClientWithResponses) PostSessionListWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostSessionListResponse, error) {+ rsp, err := c.PostSessionList(ctx, reqEditors...)+ if err != nil {+ return nil, err+ }+ return ParsePostSessionListResponse(rsp)+}+// PostSessionMessagesWithBodyWithResponse request with arbitrary body returning *PostSessionMessagesResponsefunc (c *ClientWithResponses) PostSessionMessagesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostSessionMessagesResponse, error) {rsp, err := c.PostSessionMessagesWithBody(ctx, contentType, body, reqEditors...)@@ -625,6 +710,41 @@ func ParsePostSessionCreateResponse(rsp *http.Response) (*PostSessionCreateResporeturn response, nil}+// ParsePostSessionListResponse parses an HTTP response from a PostSessionListWithResponse call+func ParsePostSessionListResponse(rsp *http.Response) (*PostSessionListResponse, error) {+ bodyBytes, err := io.ReadAll(rsp.Body)+ defer func() { _ = rsp.Body.Close() }()+ if err != nil {+ return nil, err+ }++ response := &PostSessionListResponse{+ Body: bodyBytes,+ HTTPResponse: rsp,+ }++ switch {+ case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:+ var dest []struct {+ Id string `json:"id"`+ ShareID *string `json:"shareID,omitempty"`+ Title string `json:"title"`+ Tokens struct {+ Input float32 `json:"input"`+ Output float32 `json:"output"`+ Reasoning float32 `json:"reasoning"`+ } `json:"tokens"`+ }+ if err := json.Unmarshal(bodyBytes, &dest); err != nil {+ return nil, err+ }+ response.JSON200 = &dest++ }++ return response, nil+}+// ParsePostSessionMessagesResponse parses an HTTP response from a PostSessionMessagesWithResponse callfunc ParsePostSessionMessagesResponse(rsp *http.Response) (*PostSessionMessagesResponse, error) {bodyBytes, err := io.ReadAll(rsp.Body)