feat(system): add admin password reset with session revocation

Let system administrators reset another user's local password from the settings UI, revoke all active sessions, and record the action in the audit log.
This commit is contained in:
wizardchen
2026-07-13 20:05:08 +08:00
committed by lyingbug
parent 8554c422dc
commit 8ec65941a5
17 changed files with 1340 additions and 59 deletions
+272 -18
View File
@@ -11148,31 +11148,21 @@ const docTemplate = `{
}
}
},
"/system/admin/settings": {
"/system/admin/runtime/queues": {
"get": {
"description": "Return every row in the system_settings table (system-scope,\nnot tenant-scope). SystemAdmin only.",
"description": "返回各 asynq 队列的实时深度(pending/active/scheduled/retry 等)与 worker 并发配置,仅系统管理员可见",
"produces": [
"application/json"
],
"tags": [
"System Admin"
"系统管理"
],
"summary": "List all system settings",
"summary": "获取解析任务队列运行时状态",
"responses": {
"200": {
"description": "list of settings",
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SystemSetting"
}
}
},
"403": {
"description": "Forbidden: not a system admin",
"schema": {
"type": "object",
"additionalProperties": true
"$ref": "#/definitions/internal_handler.RuntimeQueuesResponse"
}
}
}
@@ -11341,6 +11331,62 @@ const docTemplate = `{
}
}
},
"/system/admin/users/reset-password": {
"post": {
"description": "Replace another user's local password and revoke all of their existing sessions (SystemAdmin only).\nA system administrator cannot reset their own password through this endpoint; self-service password change still requires the old password.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"System Admin"
],
"summary": "Reset another user's password",
"parameters": [
{
"description": "Password reset request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_handler.ResetUserPasswordRequest"
}
}
],
"responses": {
"200": {
"description": "Password reset successfully",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request, weak password, or self reset",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "Forbidden: not a system admin",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "User not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/system/docreader/reconnect": {
"post": {
"consumes": [
@@ -13737,6 +13783,7 @@ const docTemplate = `{
2002,
2003,
2004,
2005,
2100,
2101,
2102,
@@ -13761,6 +13808,7 @@ const docTemplate = `{
"ErrTenantInactive",
"ErrTenantNameRequired",
"ErrTenantInvalidStatus",
"ErrTenantCreationDisabled",
"ErrAgentMissingThinkingModel",
"ErrAgentMissingAllowedTools",
"ErrAgentInvalidMaxIterations",
@@ -13865,6 +13913,26 @@ const docTemplate = `{
}
}
},
"github_com_Tencent_WeKnora_internal_models_limiter.RuntimeStat": {
"type": "object",
"properties": {
"active": {
"type": "integer"
},
"limit": {
"type": "integer"
},
"model_id": {
"type": "string"
},
"name": {
"type": "string"
},
"waiting": {
"type": "integer"
}
}
},
"github_com_Tencent_WeKnora_internal_types.APIPrincipalMode": {
"type": "string",
"enum": [
@@ -13953,7 +14021,8 @@ const docTemplate = `{
"opensearch.reindex_executed",
"system.setting_changed",
"system.admin_promoted",
"system.admin_revoked"
"system.admin_revoked",
"system.user_password_reset"
],
"x-enum-varnames": [
"AuditActionMemberAdded",
@@ -13974,7 +14043,8 @@ const docTemplate = `{
"AuditActionOpenSearchReindexExecuted",
"AuditActionSystemSettingChanged",
"AuditActionSystemAdminPromoted",
"AuditActionSystemAdminRevoked"
"AuditActionSystemAdminRevoked",
"AuditActionSystemUserPasswordReset"
]
},
"github_com_Tencent_WeKnora_internal_types.AuditLog": {
@@ -14123,6 +14193,10 @@ const docTemplate = `{
"description": "Strategy selects the adaptive chunking tier. Empty / \"legacy\" preserves\nthe historical recursive splitter; \"auto\" lets a profiler pick between\nheading-aware, heuristic and recursive tiers; \"heading\" / \"heuristic\" /\n\"recursive\" pin the tier explicitly.",
"type": "string"
},
"table_metadata_instructions": {
"description": "TableMetadataInstructions contains optional business guidance used when\ngenerating searchable summaries for CSV/Excel tables. The system-owned\noutput contract remains fixed; these instructions only add domain context.",
"type": "string"
},
"token_limit": {
"description": "TokenLimit caps chunk size in approximate tokens. 0 = use ChunkSize\nas a character count.",
"type": "integer"
@@ -14629,6 +14703,10 @@ const docTemplate = `{
"github_com_Tencent_WeKnora_internal_types.ExtractConfig": {
"type": "object",
"properties": {
"custom_instructions": {
"description": "CustomInstructions adds domain-specific extraction guidance while the\nsystem keeps ownership of the structured graph output protocol.",
"type": "string"
},
"enabled": {
"type": "boolean"
},
@@ -16693,6 +16771,10 @@ const docTemplate = `{
"github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": {
"type": "object",
"properties": {
"custom_instructions": {
"description": "CustomInstructions describes the intended audience or question style.\nIt is appended to the stable system question-generation template.",
"type": "string"
},
"enabled": {
"type": "boolean"
},
@@ -16702,6 +16784,63 @@ const docTemplate = `{
}
}
},
"github_com_Tencent_WeKnora_internal_types.QueueStat": {
"type": "object",
"properties": {
"active": {
"type": "integer"
},
"archived": {
"type": "integer"
},
"completed": {
"type": "integer"
},
"failed": {
"type": "integer"
},
"latency_ms": {
"description": "LatencyMs is the age of the oldest pending task, in milliseconds.",
"type": "integer"
},
"memory_usage_bytes": {
"description": "MemoryUsageBytes is the approximate Redis memory the queue occupies.",
"type": "integer"
},
"name": {
"type": "string"
},
"paused": {
"description": "Paused reports whether the queue is paused (tasks not consumed).",
"type": "boolean"
},
"pending": {
"type": "integer"
},
"pool": {
"description": "Pool is the independent worker pool that drains this queue.",
"type": "string"
},
"processed": {
"description": "Processed / Failed are today's counters (reset daily).",
"type": "integer"
},
"retry": {
"type": "integer"
},
"scheduled": {
"type": "integer"
},
"size": {
"description": "Size is the total number of tasks in the queue (pending + active +\nscheduled + retry + aggregating + archived).",
"type": "integer"
},
"weight": {
"description": "Weight is the queue's scheduling weight inside its pool.",
"type": "integer"
}
}
},
"github_com_Tencent_WeKnora_internal_types.RegisterRequest": {
"type": "object",
"required": [
@@ -17943,6 +18082,14 @@ const docTemplate = `{
"description": "Base URL",
"type": "string"
},
"custom_instructions": {
"description": "CustomInstructions adds KB-specific image interpretation guidance without\nreplacing the system-owned OCR and Markdown output contract.",
"type": "string"
},
"description_language": {
"description": "DescriptionLanguage controls the language used for generated image\ncaptions. Empty means follow the document/request language.",
"type": "string"
},
"enabled": {
"type": "boolean"
},
@@ -18127,6 +18274,10 @@ const docTemplate = `{
"github_com_Tencent_WeKnora_internal_types.WikiConfig": {
"type": "object",
"properties": {
"content_instructions": {
"description": "ContentInstructions controls tone, structure and emphasis for generated\nsummary/entity/index prose. Citation and merge rules remain system-owned.",
"type": "string"
},
"extraction_granularity": {
"description": "ExtractionGranularity controls how many candidate slugs Pass 0 extracts\nper document. Empty / unknown value is treated as WikiExtractionStandard.",
"allOf": [
@@ -18135,6 +18286,10 @@ const docTemplate = `{
}
]
},
"extraction_instructions": {
"description": "ExtractionInstructions tells candidate extraction which domain concepts\nto emphasize without replacing the stable JSON/citation protocol.",
"type": "string"
},
"ingest_batch_size": {
"description": "IngestBatchSize controls how many pending ops a single batch claims and\nprocesses before scheduling a follow-up. 0 falls back to the hard-coded\ndefault (5). Larger batches amortize per-batch setup and let more docs\nshare the batch-internal Map/Reduce fan-out; smaller batches spread a\nKB's backlog across more concurrent batches (finer scheduling grain).",
"type": "integer"
@@ -19283,6 +19438,9 @@ const docTemplate = `{
"description": "Strategy / TokenLimit / Languages use pointer types so the\nhandler can distinguish \"field absent in payload\" (no change)\nfrom \"field present with empty/zero value\" (clear / disable).\nWithout that distinction, users could set strategy=\"auto\" once\nbut never reset it back to legacy / unset.",
"type": "string"
},
"tableMetadataInstructions": {
"type": "string"
},
"tokenLimit": {
"type": "integer"
}
@@ -19308,6 +19466,9 @@ const docTemplate = `{
"description": "知识图谱配置",
"type": "object",
"properties": {
"customInstructions": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
@@ -19338,6 +19499,9 @@ const docTemplate = `{
"description": "问题生成配置",
"type": "object",
"properties": {
"customInstructions": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
@@ -19659,6 +19823,21 @@ const docTemplate = `{
}
}
},
"internal_handler.ResetUserPasswordRequest": {
"type": "object",
"required": [
"email",
"new_password"
],
"properties": {
"email": {
"type": "string"
},
"new_password": {
"type": "string"
}
}
},
"internal_handler.RevokeSystemAdminRequest": {
"type": "object",
"required": [
@@ -19670,6 +19849,81 @@ const docTemplate = `{
}
}
},
"internal_handler.RuntimeQueuesResponse": {
"type": "object",
"properties": {
"available": {
"type": "boolean"
},
"model_limiter_available": {
"type": "boolean"
},
"models": {
"type": "array",
"items": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_limiter.RuntimeStat"
}
},
"parse_concurrency": {
"description": "compatibility alias for upstream_concurrency",
"type": "integer"
},
"pools": {
"type": "array",
"items": {
"$ref": "#/definitions/internal_handler.RuntimeWorkerPool"
}
},
"queues": {
"type": "array",
"items": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QueueStat"
}
},
"timestamp": {
"type": "integer"
},
"upstream_concurrency": {
"type": "integer"
},
"wiki_concurrency": {
"description": "compatibility field",
"type": "integer"
}
}
},
"internal_handler.RuntimeWorkerPool": {
"description": "Return every row in the system_settings table (system-scope, not tenant-scope). SystemAdmin only.",
"type": "object",
"properties": {
"active": {
"description": "live workers assigned to this pool",
"type": "integer"
},
"cluster_capacity": {
"description": "sum of live server concurrency",
"type": "integer"
},
"concurrency": {
"description": "configured per instance",
"type": "integer"
},
"instances": {
"description": "live asynq server heartbeats",
"type": "integer"
},
"name": {
"type": "string"
},
"queue_count": {
"type": "integer"
},
"utilization": {
"description": "Active / ClusterCapacity",
"type": "number"
}
}
},
"internal_handler.SearchMessagesRequest": {
"type": "object",
"required": [
+272 -18
View File
@@ -11141,31 +11141,21 @@
}
}
},
"/system/admin/settings": {
"/system/admin/runtime/queues": {
"get": {
"description": "Return every row in the system_settings table (system-scope,\nnot tenant-scope). SystemAdmin only.",
"description": "返回各 asynq 队列的实时深度(pending/active/scheduled/retry 等)与 worker 并发配置,仅系统管理员可见",
"produces": [
"application/json"
],
"tags": [
"System Admin"
"系统管理"
],
"summary": "List all system settings",
"summary": "获取解析任务队列运行时状态",
"responses": {
"200": {
"description": "list of settings",
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.SystemSetting"
}
}
},
"403": {
"description": "Forbidden: not a system admin",
"schema": {
"type": "object",
"additionalProperties": true
"$ref": "#/definitions/internal_handler.RuntimeQueuesResponse"
}
}
}
@@ -11334,6 +11324,62 @@
}
}
},
"/system/admin/users/reset-password": {
"post": {
"description": "Replace another user's local password and revoke all of their existing sessions (SystemAdmin only).\nA system administrator cannot reset their own password through this endpoint; self-service password change still requires the old password.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"System Admin"
],
"summary": "Reset another user's password",
"parameters": [
{
"description": "Password reset request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/internal_handler.ResetUserPasswordRequest"
}
}
],
"responses": {
"200": {
"description": "Password reset successfully",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"400": {
"description": "Invalid request, weak password, or self reset",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"403": {
"description": "Forbidden: not a system admin",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"404": {
"description": "User not found",
"schema": {
"type": "object",
"additionalProperties": true
}
}
}
}
},
"/system/docreader/reconnect": {
"post": {
"consumes": [
@@ -13730,6 +13776,7 @@
2002,
2003,
2004,
2005,
2100,
2101,
2102,
@@ -13754,6 +13801,7 @@
"ErrTenantInactive",
"ErrTenantNameRequired",
"ErrTenantInvalidStatus",
"ErrTenantCreationDisabled",
"ErrAgentMissingThinkingModel",
"ErrAgentMissingAllowedTools",
"ErrAgentInvalidMaxIterations",
@@ -13858,6 +13906,26 @@
}
}
},
"github_com_Tencent_WeKnora_internal_models_limiter.RuntimeStat": {
"type": "object",
"properties": {
"active": {
"type": "integer"
},
"limit": {
"type": "integer"
},
"model_id": {
"type": "string"
},
"name": {
"type": "string"
},
"waiting": {
"type": "integer"
}
}
},
"github_com_Tencent_WeKnora_internal_types.APIPrincipalMode": {
"type": "string",
"enum": [
@@ -13946,7 +14014,8 @@
"opensearch.reindex_executed",
"system.setting_changed",
"system.admin_promoted",
"system.admin_revoked"
"system.admin_revoked",
"system.user_password_reset"
],
"x-enum-varnames": [
"AuditActionMemberAdded",
@@ -13967,7 +14036,8 @@
"AuditActionOpenSearchReindexExecuted",
"AuditActionSystemSettingChanged",
"AuditActionSystemAdminPromoted",
"AuditActionSystemAdminRevoked"
"AuditActionSystemAdminRevoked",
"AuditActionSystemUserPasswordReset"
]
},
"github_com_Tencent_WeKnora_internal_types.AuditLog": {
@@ -14116,6 +14186,10 @@
"description": "Strategy selects the adaptive chunking tier. Empty / \"legacy\" preserves\nthe historical recursive splitter; \"auto\" lets a profiler pick between\nheading-aware, heuristic and recursive tiers; \"heading\" / \"heuristic\" /\n\"recursive\" pin the tier explicitly.",
"type": "string"
},
"table_metadata_instructions": {
"description": "TableMetadataInstructions contains optional business guidance used when\ngenerating searchable summaries for CSV/Excel tables. The system-owned\noutput contract remains fixed; these instructions only add domain context.",
"type": "string"
},
"token_limit": {
"description": "TokenLimit caps chunk size in approximate tokens. 0 = use ChunkSize\nas a character count.",
"type": "integer"
@@ -14622,6 +14696,10 @@
"github_com_Tencent_WeKnora_internal_types.ExtractConfig": {
"type": "object",
"properties": {
"custom_instructions": {
"description": "CustomInstructions adds domain-specific extraction guidance while the\nsystem keeps ownership of the structured graph output protocol.",
"type": "string"
},
"enabled": {
"type": "boolean"
},
@@ -16686,6 +16764,10 @@
"github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig": {
"type": "object",
"properties": {
"custom_instructions": {
"description": "CustomInstructions describes the intended audience or question style.\nIt is appended to the stable system question-generation template.",
"type": "string"
},
"enabled": {
"type": "boolean"
},
@@ -16695,6 +16777,63 @@
}
}
},
"github_com_Tencent_WeKnora_internal_types.QueueStat": {
"type": "object",
"properties": {
"active": {
"type": "integer"
},
"archived": {
"type": "integer"
},
"completed": {
"type": "integer"
},
"failed": {
"type": "integer"
},
"latency_ms": {
"description": "LatencyMs is the age of the oldest pending task, in milliseconds.",
"type": "integer"
},
"memory_usage_bytes": {
"description": "MemoryUsageBytes is the approximate Redis memory the queue occupies.",
"type": "integer"
},
"name": {
"type": "string"
},
"paused": {
"description": "Paused reports whether the queue is paused (tasks not consumed).",
"type": "boolean"
},
"pending": {
"type": "integer"
},
"pool": {
"description": "Pool is the independent worker pool that drains this queue.",
"type": "string"
},
"processed": {
"description": "Processed / Failed are today's counters (reset daily).",
"type": "integer"
},
"retry": {
"type": "integer"
},
"scheduled": {
"type": "integer"
},
"size": {
"description": "Size is the total number of tasks in the queue (pending + active +\nscheduled + retry + aggregating + archived).",
"type": "integer"
},
"weight": {
"description": "Weight is the queue's scheduling weight inside its pool.",
"type": "integer"
}
}
},
"github_com_Tencent_WeKnora_internal_types.RegisterRequest": {
"type": "object",
"required": [
@@ -17936,6 +18075,14 @@
"description": "Base URL",
"type": "string"
},
"custom_instructions": {
"description": "CustomInstructions adds KB-specific image interpretation guidance without\nreplacing the system-owned OCR and Markdown output contract.",
"type": "string"
},
"description_language": {
"description": "DescriptionLanguage controls the language used for generated image\ncaptions. Empty means follow the document/request language.",
"type": "string"
},
"enabled": {
"type": "boolean"
},
@@ -18120,6 +18267,10 @@
"github_com_Tencent_WeKnora_internal_types.WikiConfig": {
"type": "object",
"properties": {
"content_instructions": {
"description": "ContentInstructions controls tone, structure and emphasis for generated\nsummary/entity/index prose. Citation and merge rules remain system-owned.",
"type": "string"
},
"extraction_granularity": {
"description": "ExtractionGranularity controls how many candidate slugs Pass 0 extracts\nper document. Empty / unknown value is treated as WikiExtractionStandard.",
"allOf": [
@@ -18128,6 +18279,10 @@
}
]
},
"extraction_instructions": {
"description": "ExtractionInstructions tells candidate extraction which domain concepts\nto emphasize without replacing the stable JSON/citation protocol.",
"type": "string"
},
"ingest_batch_size": {
"description": "IngestBatchSize controls how many pending ops a single batch claims and\nprocesses before scheduling a follow-up. 0 falls back to the hard-coded\ndefault (5). Larger batches amortize per-batch setup and let more docs\nshare the batch-internal Map/Reduce fan-out; smaller batches spread a\nKB's backlog across more concurrent batches (finer scheduling grain).",
"type": "integer"
@@ -19276,6 +19431,9 @@
"description": "Strategy / TokenLimit / Languages use pointer types so the\nhandler can distinguish \"field absent in payload\" (no change)\nfrom \"field present with empty/zero value\" (clear / disable).\nWithout that distinction, users could set strategy=\"auto\" once\nbut never reset it back to legacy / unset.",
"type": "string"
},
"tableMetadataInstructions": {
"type": "string"
},
"tokenLimit": {
"type": "integer"
}
@@ -19301,6 +19459,9 @@
"description": "知识图谱配置",
"type": "object",
"properties": {
"customInstructions": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
@@ -19331,6 +19492,9 @@
"description": "问题生成配置",
"type": "object",
"properties": {
"customInstructions": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
@@ -19652,6 +19816,21 @@
}
}
},
"internal_handler.ResetUserPasswordRequest": {
"type": "object",
"required": [
"email",
"new_password"
],
"properties": {
"email": {
"type": "string"
},
"new_password": {
"type": "string"
}
}
},
"internal_handler.RevokeSystemAdminRequest": {
"type": "object",
"required": [
@@ -19663,6 +19842,81 @@
}
}
},
"internal_handler.RuntimeQueuesResponse": {
"type": "object",
"properties": {
"available": {
"type": "boolean"
},
"model_limiter_available": {
"type": "boolean"
},
"models": {
"type": "array",
"items": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_models_limiter.RuntimeStat"
}
},
"parse_concurrency": {
"description": "compatibility alias for upstream_concurrency",
"type": "integer"
},
"pools": {
"type": "array",
"items": {
"$ref": "#/definitions/internal_handler.RuntimeWorkerPool"
}
},
"queues": {
"type": "array",
"items": {
"$ref": "#/definitions/github_com_Tencent_WeKnora_internal_types.QueueStat"
}
},
"timestamp": {
"type": "integer"
},
"upstream_concurrency": {
"type": "integer"
},
"wiki_concurrency": {
"description": "compatibility field",
"type": "integer"
}
}
},
"internal_handler.RuntimeWorkerPool": {
"description": "Return every row in the system_settings table (system-scope, not tenant-scope). SystemAdmin only.",
"type": "object",
"properties": {
"active": {
"description": "live workers assigned to this pool",
"type": "integer"
},
"cluster_capacity": {
"description": "sum of live server concurrency",
"type": "integer"
},
"concurrency": {
"description": "configured per instance",
"type": "integer"
},
"instances": {
"description": "live asynq server heartbeats",
"type": "integer"
},
"name": {
"type": "string"
},
"queue_count": {
"type": "integer"
},
"utilization": {
"description": "Active / ClusterCapacity",
"type": "number"
}
}
},
"internal_handler.SearchMessagesRequest": {
"type": "object",
"required": [
+210 -15
View File
@@ -109,6 +109,7 @@ definitions:
- 2002
- 2003
- 2004
- 2005
- 2100
- 2101
- 2102
@@ -133,6 +134,7 @@ definitions:
- ErrTenantInactive
- ErrTenantNameRequired
- ErrTenantInvalidStatus
- ErrTenantCreationDisabled
- ErrAgentMissingThinkingModel
- ErrAgentMissingAllowedTools
- ErrAgentInvalidMaxIterations
@@ -205,6 +207,19 @@ definitions:
tier:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_infrastructure_chunker.StrategyTier'
type: object
github_com_Tencent_WeKnora_internal_models_limiter.RuntimeStat:
properties:
active:
type: integer
limit:
type: integer
model_id:
type: string
name:
type: string
waiting:
type: integer
type: object
github_com_Tencent_WeKnora_internal_types.APIPrincipalMode:
enum:
- tenant
@@ -278,6 +293,7 @@ definitions:
- system.setting_changed
- system.admin_promoted
- system.admin_revoked
- system.user_password_reset
type: string
x-enum-varnames:
- AuditActionMemberAdded
@@ -299,6 +315,7 @@ definitions:
- AuditActionSystemSettingChanged
- AuditActionSystemAdminPromoted
- AuditActionSystemAdminRevoked
- AuditActionSystemUserPasswordReset
github_com_Tencent_WeKnora_internal_types.AuditLog:
properties:
action:
@@ -419,6 +436,12 @@ definitions:
heading-aware, heuristic and recursive tiers; "heading" / "heuristic" /
"recursive" pin the tier explicitly.
type: string
table_metadata_instructions:
description: |-
TableMetadataInstructions contains optional business guidance used when
generating searchable summaries for CSV/Excel tables. The system-owned
output contract remains fixed; these instructions only add domain context.
type: string
token_limit:
description: |-
TokenLimit caps chunk size in approximate tokens. 0 = use ChunkSize
@@ -872,6 +895,11 @@ definitions:
type: object
github_com_Tencent_WeKnora_internal_types.ExtractConfig:
properties:
custom_instructions:
description: |-
CustomInstructions adds domain-specific extraction guidance while the
system keeps ownership of the structured graph output protocol.
type: string
enabled:
type: boolean
nodes:
@@ -2407,6 +2435,11 @@ definitions:
type: object
github_com_Tencent_WeKnora_internal_types.QuestionGenerationConfig:
properties:
custom_instructions:
description: |-
CustomInstructions describes the intended audience or question style.
It is appended to the stable system question-generation template.
type: string
enabled:
type: boolean
question_count:
@@ -2414,6 +2447,48 @@ definitions:
10)'
type: integer
type: object
github_com_Tencent_WeKnora_internal_types.QueueStat:
properties:
active:
type: integer
archived:
type: integer
completed:
type: integer
failed:
type: integer
latency_ms:
description: LatencyMs is the age of the oldest pending task, in milliseconds.
type: integer
memory_usage_bytes:
description: MemoryUsageBytes is the approximate Redis memory the queue occupies.
type: integer
name:
type: string
paused:
description: Paused reports whether the queue is paused (tasks not consumed).
type: boolean
pending:
type: integer
pool:
description: Pool is the independent worker pool that drains this queue.
type: string
processed:
description: Processed / Failed are today's counters (reset daily).
type: integer
retry:
type: integer
scheduled:
type: integer
size:
description: |-
Size is the total number of tasks in the queue (pending + active +
scheduled + retry + aggregating + archived).
type: integer
weight:
description: Weight is the queue's scheduling weight inside its pool.
type: integer
type: object
github_com_Tencent_WeKnora_internal_types.RegisterRequest:
properties:
email:
@@ -3345,6 +3420,16 @@ definitions:
base_url:
description: Base URL
type: string
custom_instructions:
description: |-
CustomInstructions adds KB-specific image interpretation guidance without
replacing the system-owned OCR and Markdown output contract.
type: string
description_language:
description: |-
DescriptionLanguage controls the language used for generated image
captions. Empty means follow the document/request language.
type: string
enabled:
type: boolean
interface_type:
@@ -3484,12 +3569,22 @@ definitions:
- WebSearchProviderTypeKeenable
github_com_Tencent_WeKnora_internal_types.WikiConfig:
properties:
content_instructions:
description: |-
ContentInstructions controls tone, structure and emphasis for generated
summary/entity/index prose. Citation and merge rules remain system-owned.
type: string
extraction_granularity:
allOf:
- $ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.WikiExtractionGranularity'
description: |-
ExtractionGranularity controls how many candidate slugs Pass 0 extracts
per document. Empty / unknown value is treated as WikiExtractionStandard.
extraction_instructions:
description: |-
ExtractionInstructions tells candidate extraction which domain concepts
to emphasize without replacing the stable JSON/citation protocol.
type: string
ingest_batch_size:
description: |-
IngestBatchSize controls how many pending ops a single batch claims and
@@ -4344,6 +4439,8 @@ definitions:
Without that distinction, users could set strategy="auto" once
but never reset it back to legacy / unset.
type: string
tableMetadataInstructions:
type: string
tokenLimit:
type: integer
type: object
@@ -4361,6 +4458,8 @@ definitions:
nodeExtract:
description: 知识图谱配置
properties:
customInstructions:
type: string
enabled:
type: boolean
nodes:
@@ -4381,6 +4480,8 @@ definitions:
questionGeneration:
description: 问题生成配置
properties:
customInstructions:
type: string
enabled:
type: boolean
questionCount:
@@ -4615,6 +4716,16 @@ definitions:
required:
- modelName
type: object
internal_handler.ResetUserPasswordRequest:
properties:
email:
type: string
new_password:
type: string
required:
- email
- new_password
type: object
internal_handler.RevokeSystemAdminRequest:
properties:
user_id:
@@ -4622,6 +4733,59 @@ definitions:
required:
- user_id
type: object
internal_handler.RuntimeQueuesResponse:
properties:
available:
type: boolean
model_limiter_available:
type: boolean
models:
items:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_models_limiter.RuntimeStat'
type: array
parse_concurrency:
description: compatibility alias for upstream_concurrency
type: integer
pools:
items:
$ref: '#/definitions/internal_handler.RuntimeWorkerPool'
type: array
queues:
items:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.QueueStat'
type: array
timestamp:
type: integer
upstream_concurrency:
type: integer
wiki_concurrency:
description: compatibility field
type: integer
type: object
internal_handler.RuntimeWorkerPool:
description: Return every row in the system_settings table (system-scope, not
tenant-scope). SystemAdmin only.
properties:
active:
description: live workers assigned to this pool
type: integer
cluster_capacity:
description: sum of live server concurrency
type: integer
concurrency:
description: configured per instance
type: integer
instances:
description: live asynq server heartbeats
type: integer
name:
type: string
queue_count:
type: integer
utilization:
description: Active / ClusterCapacity
type: number
type: object
internal_handler.SearchMessagesRequest:
properties:
limit:
@@ -12261,28 +12425,19 @@ paths:
summary: Revoke system administrator privileges from a user
tags:
- System Admin
/system/admin/settings:
/system/admin/runtime/queues:
get:
description: |-
Return every row in the system_settings table (system-scope,
not tenant-scope). SystemAdmin only.
description: 返回各 asynq 队列的实时深度(pending/active/scheduled/retry 等)与 worker 并发配置,仅系统管理员可见
produces:
- application/json
responses:
"200":
description: list of settings
description: OK
schema:
items:
$ref: '#/definitions/github_com_Tencent_WeKnora_internal_types.SystemSetting'
type: array
"403":
description: 'Forbidden: not a system admin'
schema:
additionalProperties: true
type: object
summary: List all system settings
$ref: '#/definitions/internal_handler.RuntimeQueuesResponse'
summary: 获取解析任务队列运行时状态
tags:
- System Admin
- 系统管理
/system/admin/settings/{key}:
delete:
description: |-
@@ -12410,6 +12565,46 @@ paths:
summary: Apply the default storage quota to every existing tenant
tags:
- System Admin
/system/admin/users/reset-password:
post:
consumes:
- application/json
description: |-
Replace another user's local password and revoke all of their existing sessions (SystemAdmin only).
A system administrator cannot reset their own password through this endpoint; self-service password change still requires the old password.
parameters:
- description: Password reset request
in: body
name: request
required: true
schema:
$ref: '#/definitions/internal_handler.ResetUserPasswordRequest'
produces:
- application/json
responses:
"200":
description: Password reset successfully
schema:
additionalProperties: true
type: object
"400":
description: Invalid request, weak password, or self reset
schema:
additionalProperties: true
type: object
"403":
description: 'Forbidden: not a system admin'
schema:
additionalProperties: true
type: object
"404":
description: User not found
schema:
additionalProperties: true
type: object
summary: Reset another user's password
tags:
- System Admin
/system/docreader/reconnect:
post:
consumes: