Files
Memoh/docs/docs.go
T
2026-01-20 00:04:23 +07:00

947 lines
30 KiB
Go

// Package docs Code generated by swaggo/swag. DO NOT EDIT
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/auth/login": {
"post": {
"description": "Validate user credentials and issue a JWT",
"tags": [
"auth"
],
"summary": "Login",
"parameters": [
{
"description": "Login request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.LoginRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.LoginResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/fs/apply_patch": {
"post": {
"description": "Apply a unified diff patch to a file under the user data mount",
"tags": [
"fs"
],
"summary": "Apply unified diff patch",
"parameters": [
{
"description": "Patch payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.ApplyPatchRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/fs/commit": {
"post": {
"description": "Create a new version snapshot for the user container",
"tags": [
"fs"
],
"summary": "Commit a filesystem snapshot",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.CommitResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/fs/diff": {
"get": {
"description": "Produce a unified diff between a version snapshot and current data",
"tags": [
"fs"
],
"summary": "Diff against a version snapshot",
"parameters": [
{
"type": "string",
"description": "Path under data mount",
"name": "path",
"in": "query"
},
{
"type": "integer",
"description": "Version number",
"name": "version",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.DiffResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/fs/list": {
"get": {
"description": "List files under the user data mount",
"tags": [
"fs"
],
"summary": "List directory contents",
"parameters": [
{
"type": "string",
"description": "Path under data mount",
"name": "path",
"in": "query"
},
{
"type": "boolean",
"description": "Recursive listing",
"name": "recursive",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.ListResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/fs/read": {
"get": {
"description": "Read a file under the user data mount",
"tags": [
"fs"
],
"summary": "Read file content",
"parameters": [
{
"type": "string",
"description": "Path under data mount",
"name": "path",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.ReadResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/fs/write_atomic": {
"put": {
"description": "Atomically replace a file under the user data mount",
"tags": [
"fs"
],
"summary": "Write file atomically",
"parameters": [
{
"description": "Write payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.WriteAtomicRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/memory/add": {
"post": {
"description": "Add memory for a user via memory",
"tags": [
"memory"
],
"summary": "Add memory",
"parameters": [
{
"description": "Add request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/memory.AddRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.SearchResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/memory/memories": {
"get": {
"description": "List memories for a user via memory",
"tags": [
"memory"
],
"summary": "List memories",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "user_id",
"in": "query"
},
{
"type": "string",
"description": "Agent ID",
"name": "agent_id",
"in": "query"
},
{
"type": "string",
"description": "Run ID",
"name": "run_id",
"in": "query"
},
{
"type": "integer",
"description": "Limit",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.SearchResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete all memories for a user via memory",
"tags": [
"memory"
],
"summary": "Delete memories",
"parameters": [
{
"description": "Delete all request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/memory.DeleteAllRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.DeleteResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/memory/memories/{memoryId}": {
"get": {
"description": "Get a memory by ID via memory",
"tags": [
"memory"
],
"summary": "Get memory",
"parameters": [
{
"type": "string",
"description": "Memory ID",
"name": "memoryId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.MemoryItem"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete a memory by ID via memory",
"tags": [
"memory"
],
"summary": "Delete memory",
"parameters": [
{
"type": "string",
"description": "Memory ID",
"name": "memoryId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.DeleteResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/memory/search": {
"post": {
"description": "Search memories for a user via memory",
"tags": [
"memory"
],
"summary": "Search memories",
"parameters": [
{
"description": "Search request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/memory.SearchRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.SearchResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/memory/update": {
"post": {
"description": "Update a memory by ID via memory",
"tags": [
"memory"
],
"summary": "Update memory",
"parameters": [
{
"description": "Update request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/memory.UpdateRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.MemoryItem"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
}
},
"definitions": {
"handlers.ApplyPatchRequest": {
"type": "object",
"properties": {
"patch": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"handlers.CommitResponse": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"snapshot_id": {
"type": "string"
},
"version": {
"type": "integer"
}
}
},
"handlers.DiffResponse": {
"type": "object",
"properties": {
"diff": {
"type": "string"
},
"path": {
"type": "string"
},
"version": {
"type": "integer"
}
}
},
"handlers.ErrorResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"handlers.FileEntry": {
"type": "object",
"properties": {
"is_dir": {
"type": "boolean"
},
"mod_time": {
"type": "string"
},
"mode": {
"type": "integer"
},
"path": {
"type": "string"
},
"size": {
"type": "integer"
}
}
},
"handlers.ListResponse": {
"type": "object",
"properties": {
"entries": {
"type": "array",
"items": {
"$ref": "#/definitions/handlers.FileEntry"
}
},
"path": {
"type": "string"
}
}
},
"handlers.LoginRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"handlers.LoginResponse": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"expires_at": {
"type": "string"
},
"token_type": {
"type": "string"
},
"user_id": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"handlers.ReadResponse": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"encoding": {
"type": "string"
},
"mod_time": {
"type": "string"
},
"mode": {
"type": "integer"
},
"path": {
"type": "string"
},
"size": {
"type": "integer"
}
}
},
"handlers.WriteAtomicRequest": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"encoding": {
"type": "string"
},
"mode": {
"type": "integer"
},
"mtime": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"memory.AddRequest": {
"type": "object",
"properties": {
"agent_id": {
"type": "string"
},
"filters": {
"type": "object",
"additionalProperties": true
},
"infer": {
"type": "boolean"
},
"message": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"$ref": "#/definitions/memory.Message"
}
},
"metadata": {
"type": "object",
"additionalProperties": true
},
"run_id": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"memory.DeleteAllRequest": {
"type": "object",
"properties": {
"agent_id": {
"type": "string"
},
"run_id": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"memory.DeleteResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"memory.MemoryItem": {
"type": "object",
"properties": {
"agentId": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"hash": {
"type": "string"
},
"id": {
"type": "string"
},
"memory": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": true
},
"runId": {
"type": "string"
},
"score": {
"type": "number"
},
"updatedAt": {
"type": "string"
},
"userId": {
"type": "string"
}
}
},
"memory.Message": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"role": {
"type": "string"
}
}
},
"memory.SearchRequest": {
"type": "object",
"properties": {
"agent_id": {
"type": "string"
},
"filters": {
"type": "object",
"additionalProperties": true
},
"limit": {
"type": "integer"
},
"query": {
"type": "string"
},
"run_id": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"memory.SearchResponse": {
"type": "object",
"properties": {
"relations": {
"type": "array",
"items": {}
},
"results": {
"type": "array",
"items": {
"$ref": "#/definitions/memory.MemoryItem"
}
}
}
},
"memory.UpdateRequest": {
"type": "object",
"properties": {
"memory": {
"type": "string"
},
"memory_id": {
"type": "string"
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "",
BasePath: "/",
Schemes: []string{"http"},
Title: "Memoh Go API",
Description: "User-scoped filesystem API for containerd-backed data.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}