Files
mesh/testdata/chat_paths.json
T
waozi bbf655ddae Let a feedback report carry several developer replies
A developer reply replaced the report's single reply, so a second reply
overwrote the first and apps that had shown the first never showed the
second. A reply sent with its own 64-character reply_id is now added
beside the report's earlier replies in a new table, and retrying the same
reply_id and text adds nothing, while reusing a reply_id for other text is
refused. A reply without reply_id keeps its single-reply behavior.

Lumi's reply list returns every reply once, oldest first, each under its
own ID (the report's ID for the single reply), so released Inner Breeze
versions show every reply in order without an app update. Report lists show
each report's latest reply, replies leave with their report, and
scripts/feedback.py takes --reply-id.
2026-10-17 18:24:09 -03:00

346 lines
11 KiB
JSON

{
"/api/v1/chat/completions": {
"post": {
"summary": "Account-limited online app conversation",
"description": "Requires a Daochi bearer token and X-Daochi-User. The node keeps the provider key private, bounds context and output, and enforces persistent daily account and node limits. Each model request, including tool continuations and failed provider attempts, uses one allowance unit. Tools execute only in the client harness. A disabled or unavailable provider returns 503; exhausted allowances return 429.",
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"messages"
],
"properties": {
"messages": {
"type": "array",
"minItems": 1,
"maxItems": 20,
"items": {
"type": "object"
}
},
"context": {
"type": "object"
},
"tools": {
"type": "array",
"maxItems": 64,
"items": {
"type": "object"
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "Assistant message or tool calls, and remaining allowance"
},
"400": {
"description": "Malformed or oversized context"
},
"401": {
"description": "Account authentication required"
},
"429": {
"description": "Daily allowance exhausted"
},
"503": {
"description": "Online chat unavailable"
}
}
}
},
"/api/v1/feedback": {
"post": {
"summary": "Deliver an account's app feedback",
"description": "Idempotent by account and 64-character report ID. Up to 20 reports per account per UTC day. Feedback contains only the authored report and bounded app diagnostics, and is private to its account and node operator.",
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"id",
"app_id",
"title",
"message"
],
"properties": {
"id": {
"type": "string",
"minLength": 64,
"maxLength": 64
},
"app_id": {
"const": "inbe"
},
"title": {
"type": "string",
"maxLength": 160
},
"message": {
"type": "string",
"maxLength": 4096
},
"context": {
"type": "string",
"maxLength": 2048
}
}
}
}
}
},
"responses": {
"200": {
"description": "Saved report ID"
},
"400": {
"description": "Invalid feedback"
},
"401": {
"description": "Account authentication required"
},
"429": {
"description": "Daily report allowance exhausted"
},
"503": {
"description": "Feedback service unavailable"
}
}
},
"get": {
"summary": "Read the account's reports and developer replies",
"security": [
{
"bearerAuth": []
}
],
"responses": {
"200": {
"description": "Up to 100 reports with replies"
},
"401": {
"description": "Account authentication required"
},
"503": {
"description": "Feedback service unavailable"
}
}
}
},
"/api/v1/admin/feedback": {
"get": {
"summary": "Private developer feedback inbox",
"description": "Requires X-Daochi-Admin with the feedback token or the existing admin token. Disabled when neither is configured.",
"responses": {
"200": {
"description": "Up to 100 newest reports"
},
"401": {
"description": "Operator authentication required"
},
"403": {
"description": "Remote operator access disabled"
}
}
}
},
"/api/v1/admin/feedback/reply": {
"post": {
"summary": "Reply to an app feedback report",
"description": "Requires X-Daochi-Admin and the account_id returned by the private inbox. Replies target exactly one account's report. Without reply_id, the reply is the report's single reply and replaces an earlier one. With a 64-character hexadecimal reply_id, it is added beside the report's earlier replies; retrying the same reply_id and reply changes nothing, and reusing a reply_id for another reply returns 409. The reporting account can read replies through GET /api/v1/feedback. Use replies=1 and a numeric offset to retrieve at most two replies per page, oldest first and without report diagnostics; each reply carries its own id (the report's ID for the single reply).",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"account_id",
"id",
"reply"
],
"properties": {
"id": {
"type": "string",
"minLength": 64,
"maxLength": 64
},
"reply": {
"type": "string",
"maxLength": 4096
},
"account_id": {
"type": "string",
"minLength": 64,
"maxLength": 64
},
"reply_id": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Report replied to"
},
"400": {
"description": "Invalid reply"
},
"401": {
"description": "Operator authentication required"
},
"404": {
"description": "Report not found"
},
"409": {
"description": "Reply ID already used for another reply"
}
}
}
},
"/api/v1/chat/spelling": {
"post": {
"summary": "Account-limited spelling correction",
"description": "Requires a Daochi bearer token and X-Daochi-User. Corrects only misspelled words in one text of up to 8192 bytes and returns the whole text with its surrounding blank space unchanged. The text is not stored. Each request uses one unit of the same daily account and node allowance as online chat. A disabled or unavailable provider returns 503; exhausted allowances return 429.",
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"text"
],
"properties": {
"text": {
"type": "string",
"maxLength": 8192
}
}
}
}
}
},
"responses": {
"200": {
"description": "Corrected text and remaining allowance"
},
"400": {
"description": "Empty or oversized text"
},
"401": {
"description": "Account authentication required"
},
"429": {
"description": "Daily allowance exhausted"
},
"503": {
"description": "Online chat unavailable"
}
}
}
},
"/api/v1/chat/habit-icons": {
"post": {
"summary": "Account-limited habit icon choice",
"description": "Requires a Daochi bearer token and X-Daochi-User. Chooses, for each habit in order, one of the offered icon names that obviously fits it, or an empty string when none clearly fits. Offer 1 to 64 distinct icon names of 1 to 32 lowercase letters, digits or underscores, and 1 to 32 habits with a non-blank name of up to 64 bytes and an optional description of up to 256 bytes. Habits and answers are not stored. Each request uses one unit of the same daily account and node allowance as online chat. A disabled or unavailable provider or an unusable model answer returns 503; exhausted allowances return 429.",
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"icons",
"habits"
],
"properties": {
"icons": {
"type": "array",
"minItems": 1,
"maxItems": 64,
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^[a-z0-9_]{1,32}$"
}
},
"habits": {
"type": "array",
"minItems": 1,
"maxItems": 32,
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"maxLength": 64
},
"description": {
"type": "string",
"maxLength": 256
}
}
}
}
}
}
}
}
},
"responses": {
"200": {
"description": "One icon name or empty string per habit, in order, and remaining allowance"
},
"400": {
"description": "Invalid icon names or habits"
},
"401": {
"description": "Account authentication required"
},
"429": {
"description": "Daily allowance exhausted"
},
"503": {
"description": "Online chat unavailable or invalid model response"
}
}
}
}
}