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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 190 additions & 0 deletions api/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2796,6 +2796,63 @@
},
"type": "array"
},
"CocoonWorkerInstance": {
"properties": {
"active_requests": {
"format": "int64",
"minimum": 0,
"type": "integer"
},
"coefficient": {
"format": "int64",
"minimum": 0,
"type": "integer"
},
"max_active_requests": {
"format": "int64",
"minimum": 0,
"type": "integer"
}
},
"required": [
"coefficient",
"active_requests",
"max_active_requests"
],
"type": "object"
},
"CocoonWorkerType": {
"properties": {
"name": {
"type": "string"
},
"workers": {
"items": {
"$ref": "#/components/schemas/CocoonWorkerInstance"
},
"type": "array"
}
},
"required": [
"name",
"workers"
],
"type": "object"
},
"CocoonWorkersResponse": {
"properties": {
"types": {
"items": {
"$ref": "#/components/schemas/CocoonWorkerType"
},
"type": "array"
}
},
"required": [
"types"
],
"type": "object"
},
"ComputePhase": {
"properties": {
"exit_code": {
Expand Down Expand Up @@ -7711,6 +7768,139 @@
},
"openapi": "3.0.0",
"paths": {
"/cocoon/query": {
"post": {
"description": "Proxy arbitrary OpenAI-style JSON to Cocoon (POST)",
"operationId": "postCocoonQuery",
"parameters": [
{
"description": "Cocoon worker model name passed to the proxy.",
"in": "query",
"name": "model",
"schema": {
"type": "string"
}
},
{
"description": "HTTP path on the Cocoon worker (e.g. /v1/chat/completions).",
"in": "query",
"name": "path",
"schema": {
"default": "/query",
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"schema": {}
}
},
"description": "Successful response"
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"properties": {
"message": {
"type": "string"
},
"type": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
}
},
"description": "Unauthorized"
},
"501": {
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
},
"description": "Not implemented"
},
"default": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/cocoon/workers": {
"get": {
"description": "Cocoon worker types (same shape as gocoon Connection.GetWorkerTypes)",
"operationId": "getCocoonWorkers",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CocoonWorkersResponse"
}
}
},
"description": "Successful response"
},
"401": {
"content": {
"application/json": {
"schema": {
"properties": {
"error": {
"properties": {
"message": {
"type": "string"
},
"type": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
}
},
"description": "Unauthorized"
},
"501": {
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
},
"description": "Not implemented"
},
"default": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/v2/accounts/_bulk": {
"post": {
"description": "Get human-friendly information about several accounts without low-level details.",
Expand Down
124 changes: 124 additions & 0 deletions api/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3078,6 +3078,90 @@ paths:
$ref: "#/components/schemas/RoundRewardsResponse"
'default':
$ref: '#/components/responses/Error'

/cocoon/workers:
get:
operationId: getCocoonWorkers
description: Cocoon worker types (same shape as gocoon Connection.GetWorkerTypes)
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/CocoonWorkersResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
message:
type: string
type:
type: string
'501':
description: Not implemented
content:
application/json:
schema:
type: object
'default':
$ref: '#/components/responses/Error'

/cocoon/query:
post:
operationId: postCocoonQuery
description: Proxy arbitrary OpenAI-style JSON to Cocoon (POST)
parameters:
- name: model
in: query
description: Cocoon worker model name passed to the proxy.
schema:
type: string
- name: path
in: query
description: HTTP path on the Cocoon worker (e.g. /v1/chat/completions).
schema:
type: string
default: "/query"
requestBody:
required: true
content:
application/json:
schema: { } # Free-form JSON value
responses:
'200':
description: Successful response
content:
application/json:
schema: { } # Free-form JSON value
'401':
description: Unauthorized
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
message:
type: string
type:
type: string
'501':
description: Not implemented
content:
application/json:
schema:
type: object
'default':
$ref: '#/components/responses/Error'
components:
parameters:
masterchainSeqno:
Expand Down Expand Up @@ -3651,6 +3735,46 @@ components:
error:
type: string
example: error description
CocoonWorkerInstance:
type: object
required:
- coefficient
- active_requests
- max_active_requests
properties:
coefficient:
type: integer
format: int64
minimum: 0
active_requests:
type: integer
format: int64
minimum: 0
max_active_requests:
type: integer
format: int64
minimum: 0
CocoonWorkerType:
type: object
required:
- name
- workers
properties:
name:
type: string
workers:
type: array
items:
$ref: '#/components/schemas/CocoonWorkerInstance'
CocoonWorkersResponse:
type: object
required:
- types
properties:
types:
type: array
items:
$ref: '#/components/schemas/CocoonWorkerType'
AccountAddress:
type: object
required:
Expand Down
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ require (
github.com/shopspring/decimal v1.4.0
github.com/sourcegraph/conc v0.3.0
github.com/stretchr/testify v1.11.1
github.com/tonkeeper/gocoon v0.0.0-20260417144551-b6d55ffca6ae
github.com/tonkeeper/scam_backoffice_rules v0.0.11
github.com/tonkeeper/tongo v1.18.4
github.com/tonkeeper/tongo v1.19.1-0.20260417135212-97ef83ef6640
go.opentelemetry.io/otel v1.43.0
go.opentelemetry.io/otel/metric v1.43.0
go.opentelemetry.io/otel/trace v1.43.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.1
golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90
golang.org/x/net v0.52.0
golang.org/x/sync v0.20.0
golang.org/x/text v0.35.0
google.golang.org/grpc v1.80.0
gopkg.in/yaml.v3 v3.0.1
Expand Down Expand Up @@ -59,10 +60,10 @@ require (
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/mod v0.34.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/tools v0.43.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect
Expand Down
Loading