@liujitcn/kratos-admin-system 0.0.65 → 0.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +5 -3
  2. package/dist/package/declarations/src/api/base/v1/ai_knowledge.d.ts +7 -0
  3. package/dist/package/declarations/src/api/system/admin/v1/ai_provider.d.ts +3 -1
  4. package/dist/package/declarations/src/api/system/admin/v1/ai_query.d.ts +10 -0
  5. package/dist/package/declarations/src/api/system/admin/v1/ai_session.d.ts +9 -0
  6. package/dist/package/declarations/src/locales/generated.d.ts +1805 -1553
  7. package/dist/package/declarations/src/rpc/base/v1/ai_knowledge.d.ts +22 -0
  8. package/dist/package/declarations/src/rpc/base/v1/ai_message.d.ts +2 -0
  9. package/dist/package/declarations/src/rpc/base/v1/login.d.ts +2 -39
  10. package/dist/package/declarations/src/rpc/base/v1/oauth.d.ts +2 -2
  11. package/dist/package/declarations/src/rpc/common/v1/types.d.ts +4 -4
  12. package/dist/package/declarations/src/rpc/system/admin/v1/ai_provider.d.ts +66 -7
  13. package/dist/package/declarations/src/rpc/system/admin/v1/ai_query.d.ts +73 -0
  14. package/dist/package/declarations/src/rpc/system/admin/v1/ai_session.d.ts +114 -0
  15. package/dist/package/declarations/src/rpc/system/admin/v1/auth.d.ts +3 -3
  16. package/dist/package/declarations/src/rpc/system/admin/v1/base_config.d.ts +4 -3
  17. package/dist/package/declarations/src/rpc/system/admin/v1/base_login_policy.d.ts +2 -2
  18. package/dist/package/declarations/src/rpc/system/admin/v1/base_message_provider.d.ts +3 -2
  19. package/dist/package/declarations/src/rpc/system/admin/v1/base_oauth_provider.d.ts +3 -2
  20. package/dist/package/declarations/src/rpc/system/admin/v1/base_user.d.ts +3 -3
  21. package/dist/package/declarations/src/views/ai/chat/components/ChatPanel.vue.d.ts +9 -2
  22. package/dist/package/declarations/src/views/ai/chat/components/XSender.vue.d.ts +7 -0
  23. package/dist/package/declarations/src/views/ai/query/index.vue.d.ts +3 -0
  24. package/dist/package/declarations/src/views/ai/session/index.vue.d.ts +3 -0
  25. package/dist/package/src/api/base/v1/ai_knowledge.ts +22 -0
  26. package/dist/package/src/api/system/admin/v1/ai_provider.ts +7 -0
  27. package/dist/package/src/api/system/admin/v1/ai_query.ts +25 -0
  28. package/dist/package/src/api/system/admin/v1/ai_session.ts +25 -0
  29. package/dist/package/src/components/account/ChangePasswordForm.vue +7 -5
  30. package/dist/package/src/components/tenant-project/TenantProjectSelect.vue +21 -4
  31. package/dist/package/src/locales/README.md +1 -1
  32. package/dist/package/src/locales/en-US.json +355 -292
  33. package/dist/package/src/locales/ja-JP.json +352 -289
  34. package/dist/package/src/locales/zh-CN.json +352 -289
  35. package/dist/package/src/locales/zh-TW.json +352 -289
  36. package/dist/package/src/module.ts +8 -0
  37. package/dist/package/src/rpc/base/v1/ai_knowledge.ts +33 -0
  38. package/dist/package/src/rpc/base/v1/ai_message.ts +2 -0
  39. package/dist/package/src/rpc/base/v1/login.ts +2 -42
  40. package/dist/package/src/rpc/base/v1/oauth.ts +2 -2
  41. package/dist/package/src/rpc/common/v1/types.ts +4 -4
  42. package/dist/package/src/rpc/system/admin/v1/ai_provider.ts +73 -7
  43. package/dist/package/src/rpc/system/admin/v1/ai_query.ts +89 -0
  44. package/dist/package/src/rpc/system/admin/v1/ai_session.ts +131 -0
  45. package/dist/package/src/rpc/system/admin/v1/auth.ts +3 -3
  46. package/dist/package/src/rpc/system/admin/v1/base_config.ts +6 -3
  47. package/dist/package/src/rpc/system/admin/v1/base_login_policy.ts +2 -2
  48. package/dist/package/src/rpc/system/admin/v1/base_message_provider.ts +5 -2
  49. package/dist/package/src/rpc/system/admin/v1/base_oauth_provider.ts +5 -2
  50. package/dist/package/src/rpc/system/admin/v1/base_user.ts +3 -3
  51. package/dist/package/src/views/ai/chat/components/ChatPanel.vue +18 -0
  52. package/dist/package/src/views/ai/chat/components/XSender.vue +102 -0
  53. package/dist/package/src/views/ai/chat/index.vue +22 -2
  54. package/dist/package/src/views/ai/query/index.vue +222 -0
  55. package/dist/package/src/views/ai/session/index.vue +422 -0
  56. package/dist/package/src/views/base/ai-provider/index.vue +216 -169
  57. package/dist/package/src/views/base/config/index.vue +9 -9
  58. package/dist/package/src/views/base/login-policy/index.vue +2 -2
  59. package/dist/package/src/views/base/message-provider/index.vue +7 -5
  60. package/dist/package/src/views/base/oauth-provider/index.vue +10 -7
  61. package/dist/package/src/views/base/tenant-project-grant/index.vue +9 -4
  62. package/dist/package/src/views/base/user/index.vue +3 -3
  63. package/dist/package/src/views/profile/components/security.vue +4 -5
  64. package/dist/package/src/views/tool/code-gen/config.ts +2 -0
  65. package/package.json +2 -2
@@ -6,6 +6,14 @@ import Notification from "./components/notification/Notification.vue";
6
6
 
7
7
  // 语言包由同步脚本生成并注册,供 System 页面、组件和代码生成页面使用。
8
8
  import { LOCALE_MESSAGES } from "./locales/generated";
9
+ import { registerSecretRevealHandler } from "@liujitcn/kratos-admin-core/security";
10
+ import { defSecretCryptoService } from "@liujitcn/kratos-admin-core/api/base/v1/secret_crypto";
11
+
12
+ // 注册密钥明文查看实现,供 ProForm secret 字段的眼睛按需拉取。
13
+ registerSecretRevealHandler(async (resource, id, field) => {
14
+ const res = await defSecretCryptoService.RevealSecretField({ resource, id, field });
15
+ return res.text;
16
+ });
9
17
 
10
18
  const viewModules = import.meta.glob<{ default: Component }>("./views/**/*.vue");
11
19
 
@@ -0,0 +1,33 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc unknown
5
+ // source: base/v1/ai_knowledge.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ /** AI知识库选项查询请求。 */
10
+ export interface ListAiKnowledgeOptionsRequest {
11
+ }
12
+
13
+ /** AI知识库选项查询响应。 */
14
+ export interface ListAiKnowledgeOptionsResponse {
15
+ /** 知识库选项列表 */
16
+ options: AiKnowledgeOption[];
17
+ }
18
+
19
+ /** AI知识库选项。 */
20
+ export interface AiKnowledgeOption {
21
+ /** 知识库ID */
22
+ id: number;
23
+ /** 知识库名称 */
24
+ name: string;
25
+ /** 已就绪文档数,不含处理失败 */
26
+ doc_count: number;
27
+ }
28
+
29
+ /** AI 知识库选项查询服务。 */
30
+ export interface AiKnowledgeService {
31
+ /** 查询可用的AI知识库选项。 */
32
+ ListAiKnowledgeOptions(request: ListAiKnowledgeOptionsRequest): Promise<ListAiKnowledgeOptionsResponse>;
33
+ }
@@ -53,6 +53,8 @@ export interface SendAiMessageRequest {
53
53
  provider_id: number;
54
54
  /** 所选模型名称 */
55
55
  model_name: string;
56
+ /** 所选知识库ID列表 */
57
+ knowledge_base_ids: number[];
56
58
  }
57
59
 
58
60
  /** AI 助手失败消息重试请求 */
@@ -5,27 +5,9 @@
5
5
  // source: base/v1/login.proto
6
6
 
7
7
  /* eslint-disable */
8
- import type { PasswordCrypto } from "../../common/v1/types";
8
+ import type { SecretCrypto } from "../../common/v1/types";
9
9
  import type { Empty } from "../../google/protobuf/empty";
10
10
 
11
- /** 密码加密场景枚举。 */
12
- export enum PasswordCryptoScene {
13
- /** PASSWORD_CRYPTO_SCENE_UNSPECIFIED - 未指定密码加密场景。 */
14
- PASSWORD_CRYPTO_SCENE_UNSPECIFIED = 0,
15
- /** PASSWORD_CRYPTO_SCENE_LOGIN - 登录密码加密场景。 */
16
- PASSWORD_CRYPTO_SCENE_LOGIN = 1,
17
- /** PASSWORD_CRYPTO_SCENE_CREATE_BASE_USER - 新增后台用户密码加密场景。 */
18
- PASSWORD_CRYPTO_SCENE_CREATE_BASE_USER = 2,
19
- /** PASSWORD_CRYPTO_SCENE_RESET_BASE_USER_PASSWORD - 重置后台用户密码加密场景。 */
20
- PASSWORD_CRYPTO_SCENE_RESET_BASE_USER_PASSWORD = 3,
21
- /** PASSWORD_CRYPTO_SCENE_UPDATE_USER_PASSWORD - 个人修改密码加密场景。 */
22
- PASSWORD_CRYPTO_SCENE_UPDATE_USER_PASSWORD = 4,
23
- /** PASSWORD_CRYPTO_SCENE_MFA - 多因素认证敏感操作场景。 */
24
- PASSWORD_CRYPTO_SCENE_MFA = 5,
25
- /** PASSWORD_CRYPTO_SCENE_CONFIGURE_PASSWORD_POLICY - 密码策略初始化密码配置场景。 */
26
- PASSWORD_CRYPTO_SCENE_CONFIGURE_PASSWORD_POLICY = 6,
27
- }
28
-
29
11
  /**
30
12
  * LoginStatus 表示登录请求当前所处的认证阶段。
31
13
  * 只有 AUTHENTICATED 或 PASSWORD_CHANGE_REQUIRED 才会携带正式访问令牌,MFA 状态必须继续完成挑战。
@@ -49,12 +31,6 @@ export interface CaptchaRequest {
49
31
  type: string;
50
32
  }
51
33
 
52
- /** 密码临时公钥获取条件 */
53
- export interface PasswordPublicKeyRequest {
54
- /** 使用场景 */
55
- scene: PasswordCryptoScene;
56
- }
57
-
58
34
  /** 登出请求条件 */
59
35
  export interface LogoutRequest {
60
36
  }
@@ -85,20 +61,6 @@ export interface VerifyCaptchaResponse {
85
61
  expires_in: number;
86
62
  }
87
63
 
88
- /** 密码临时公钥响应 */
89
- export interface PasswordPublicKeyResponse {
90
- /** 临时密钥ID */
91
- key_id: string;
92
- /** 临时公钥 */
93
- public_key: string;
94
- /** 加密算法 */
95
- algorithm: string;
96
- /** 随机值 */
97
- nonce: string;
98
- /** 有效时间,单位秒 */
99
- expires_in: number;
100
- }
101
-
102
64
  /** 刷新令牌请求参数 */
103
65
  export interface RefreshTokenRequest {
104
66
  /** 更新令牌;未填写时由服务端从HttpOnly Cookie读取。 */
@@ -125,7 +87,7 @@ export interface LoginRequest {
125
87
  user_name: string;
126
88
  /** 用户的密码,必选项。 */
127
89
  password:
128
- | PasswordCrypto
90
+ | SecretCrypto
129
91
  | undefined;
130
92
  /** 验证码 */
131
93
  captcha_code: string;
@@ -165,8 +127,6 @@ export interface LoginService {
165
127
  Captcha(request: CaptchaRequest): Promise<CaptchaResponse>;
166
128
  /** 验证码预校验 */
167
129
  VerifyCaptcha(request: VerifyCaptchaRequest): Promise<VerifyCaptchaResponse>;
168
- /** 获取密码临时公钥 */
169
- PasswordPublicKey(request: PasswordPublicKeyRequest): Promise<PasswordPublicKeyResponse>;
170
130
  /** 登出 */
171
131
  Logout(request: LogoutRequest): Promise<Empty>;
172
132
  /** 刷新认证令牌 */
@@ -5,7 +5,7 @@
5
5
  // source: base/v1/oauth.proto
6
6
 
7
7
  /* eslint-disable */
8
- import type { PasswordCrypto } from "../../common/v1/types";
8
+ import type { SecretCrypto } from "../../common/v1/types";
9
9
  import type { Empty } from "../../google/protobuf/empty";
10
10
  import type { LoginStatus } from "./login";
11
11
 
@@ -77,7 +77,7 @@ export interface BindOauthSessionRequest {
77
77
  user_name: string;
78
78
  /** 用户密码 */
79
79
  password:
80
- | PasswordCrypto
80
+ | SecretCrypto
81
81
  | undefined;
82
82
  /** 验证码 */
83
83
  captcha_code: string;
@@ -60,8 +60,8 @@ export interface BytesValues {
60
60
  value: Uint8Array[];
61
61
  }
62
62
 
63
- /** 密码密文。 */
64
- export interface PasswordCrypto {
63
+ /** 敏感字段密文,密码与各类密钥字段统一使用。 */
64
+ export interface SecretCrypto {
65
65
  /** 临时密钥ID */
66
66
  key_id: string;
67
67
  /** 随机值 */
@@ -72,6 +72,6 @@ export interface PasswordCrypto {
72
72
  encrypted_key: string;
73
73
  /** 初始化向量 */
74
74
  iv: string;
75
- /** 密码加密数据 */
76
- ciphertext: string;
75
+ /** 传输时为密文,服务端解密后回填明文 */
76
+ text: string;
77
77
  }
@@ -6,8 +6,27 @@
6
6
 
7
7
  /* eslint-disable */
8
8
  import type { Status } from "../../../common/v1/enum";
9
+ import type { SecretCrypto } from "../../../common/v1/types";
9
10
  import type { Empty } from "../../../google/protobuf/empty";
10
11
 
12
+ /** AI模型分类枚举。 */
13
+ export enum AiModelCategory {
14
+ /** AI_MODEL_CATEGORY_UNSPECIFIED - 未指定AI模型分类。 */
15
+ AI_MODEL_CATEGORY_UNSPECIFIED = 0,
16
+ /** AI_MODEL_CATEGORY_CHAT - 对话模型。 */
17
+ AI_MODEL_CATEGORY_CHAT = 1,
18
+ /** AI_MODEL_CATEGORY_EMBEDDING - 向量模型。 */
19
+ AI_MODEL_CATEGORY_EMBEDDING = 2,
20
+ /** AI_MODEL_CATEGORY_RERANK - 重排序模型。 */
21
+ AI_MODEL_CATEGORY_RERANK = 3,
22
+ /** AI_MODEL_CATEGORY_IMAGE - 图片模型。 */
23
+ AI_MODEL_CATEGORY_IMAGE = 4,
24
+ /** AI_MODEL_CATEGORY_VIDEO - 视频模型。 */
25
+ AI_MODEL_CATEGORY_VIDEO = 5,
26
+ /** AI_MODEL_CATEGORY_AUDIO - 音频模型。 */
27
+ AI_MODEL_CATEGORY_AUDIO = 6,
28
+ }
29
+
11
30
  /** AI供应商分页查询条件。 */
12
31
  export interface PageAiProviderRequest {
13
32
  /** 供应商名称 */
@@ -44,12 +63,12 @@ export interface AiProviderForm {
44
63
  name: string;
45
64
  /** 模型API基础地址 */
46
65
  base_url: string;
47
- /** 模型API密钥;更新时留空表示保留现有密钥 */
48
- api_key: string;
66
+ /** 模型API密钥密文,更新时不传表示保留现有密钥 */
67
+ api_key:
68
+ | SecretCrypto
69
+ | undefined;
49
70
  /** 是否已保存模型密钥 */
50
71
  api_key_configured: boolean;
51
- /** 多模型JSON数组 */
52
- models_json: string;
53
72
  /** 排序值 */
54
73
  sort: number;
55
74
  /** Provider稳定标识 */
@@ -58,6 +77,28 @@ export interface AiProviderForm {
58
77
  config:
59
78
  | { [key: string]: any }
60
79
  | undefined;
80
+ /** 供应商下的AI模型列表 */
81
+ models: AiProviderModelForm[];
82
+ /** 状态 */
83
+ status: Status;
84
+ }
85
+
86
+ /** AI供应商模型维护表单;provider_id由所属供应商表单隐式给定。 */
87
+ export interface AiProviderModelForm {
88
+ /** 模型ID;新增时为0 */
89
+ id: number;
90
+ /** 模型名称,供应商API标识 */
91
+ model_name: string;
92
+ /** 显示名称 */
93
+ display_name: string;
94
+ /** 模型分类:枚举【AiModelCategory】 */
95
+ category: AiModelCategory;
96
+ /** 分类个性化配置JSON对象 */
97
+ config:
98
+ | { [key: string]: any }
99
+ | undefined;
100
+ /** 排序值 */
101
+ sort: number;
61
102
  /** 状态 */
62
103
  status: Status;
63
104
  }
@@ -74,7 +115,7 @@ export interface UpdateAiProviderRequest {
74
115
  ai_provider: AiProviderForm | undefined;
75
116
  }
76
117
 
77
- /** 测试AI供应商全部模型请求。 */
118
+ /** 测试AI供应商模型请求。 */
78
119
  export interface TestAiProviderModelsRequest {
79
120
  /** 待测试的AI供应商草稿 */
80
121
  ai_provider: AiProviderForm | undefined;
@@ -98,6 +139,26 @@ export interface TestAiProviderModelsResponse {
98
139
  results: AiProviderModelTestResult[];
99
140
  }
100
141
 
142
+ /** 查询AI供应商选项请求。 */
143
+ export interface ListAiProviderOptionsRequest {
144
+ }
145
+
146
+ /** 查询AI供应商选项响应。 */
147
+ export interface ListAiProviderOptionsResponse {
148
+ /** 已启用的AI供应商列表 */
149
+ options: AiProviderOption[];
150
+ }
151
+
152
+ /** AI供应商选项。 */
153
+ export interface AiProviderOption {
154
+ /** 供应商ID */
155
+ id: number;
156
+ /** 供应商名称 */
157
+ name: string;
158
+ /** Provider稳定标识 */
159
+ provider: string;
160
+ }
161
+
101
162
  /** 删除AI供应商请求。 */
102
163
  export interface DeleteAiProviderRequest {
103
164
  /** 供应商ID */
@@ -122,12 +183,12 @@ export interface AiProvider {
122
183
  base_url: string;
123
184
  /** 是否已保存模型密钥 */
124
185
  api_key_configured: boolean;
125
- /** 模型名称列表 */
126
- model_names: string[];
127
186
  /** 排序值 */
128
187
  sort: number;
129
188
  /** Provider稳定标识 */
130
189
  provider: string;
190
+ /** 供应商下的模型名称列表 */
191
+ model_names: string[];
131
192
  /** 状态 */
132
193
  status: Status;
133
194
  /** 创建时间 */
@@ -140,6 +201,11 @@ export interface AiProvider {
140
201
  export interface AiProviderService {
141
202
  /** 分页查询AI供应商。 */
142
203
  PageAiProvider(request: PageAiProviderRequest): Promise<PageAiProviderResponse>;
204
+ /**
205
+ * 查询已启用的AI供应商选项。
206
+ * 字面路径必须先于 /{id} 声明:gorilla mux 按注册顺序匹配,否则会被 {id} 路由抢占。
207
+ */
208
+ ListAiProviderOptions(request: ListAiProviderOptionsRequest): Promise<ListAiProviderOptionsResponse>;
143
209
  /** 查询AI供应商表单。 */
144
210
  GetAiProvider(request: GetAiProviderRequest): Promise<AiProviderForm>;
145
211
  /** 创建AI供应商。 */
@@ -0,0 +1,89 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc unknown
5
+ // source: system/admin/v1/ai_query.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ /** 智能问数状态枚举。 */
10
+ export enum AiQueryStatus {
11
+ /** AI_QUERY_STATUS_UNSPECIFIED - 未指定智能问数状态。 */
12
+ AI_QUERY_STATUS_UNSPECIFIED = 0,
13
+ /** AI_QUERY_STATUS_SUCCESS - 成功。 */
14
+ AI_QUERY_STATUS_SUCCESS = 1,
15
+ /** AI_QUERY_STATUS_FAILED - 失败。 */
16
+ AI_QUERY_STATUS_FAILED = 2,
17
+ }
18
+
19
+ /** 智能问数分页查询条件。 */
20
+ export interface PageAiQueryRequest {
21
+ /** 问题内容 */
22
+ question: string;
23
+ /** 问数状态:枚举【AiQueryStatus】 */
24
+ status?:
25
+ | AiQueryStatus
26
+ | undefined;
27
+ /** 当前页码 */
28
+ page_num: number;
29
+ /** 每页行数 */
30
+ page_size: number;
31
+ }
32
+
33
+ /** 智能问数分页响应。 */
34
+ export interface PageAiQueryResponse {
35
+ /** 智能问数记录列表 */
36
+ queries: AiQueryRecord[];
37
+ /** 总数 */
38
+ total: number;
39
+ }
40
+
41
+ /** 查询智能问数记录请求。 */
42
+ export interface GetAiQueryRequest {
43
+ /** 记录ID */
44
+ id: number;
45
+ }
46
+
47
+ /** 智能问数结果快照行。 */
48
+ export interface AiQueryResultRow {
49
+ /** 行数据 */
50
+ values: string[];
51
+ }
52
+
53
+ /** 智能问数记录。 */
54
+ export interface AiQueryRecord {
55
+ /** 记录ID */
56
+ id: number;
57
+ /** 租户ID */
58
+ tenant_id: number;
59
+ /** 用户ID */
60
+ user_id: number;
61
+ /** 用户账号 */
62
+ user_name: string;
63
+ /** 自然语言问题 */
64
+ question: string;
65
+ /** 生成的只读SQL */
66
+ sql: string;
67
+ /** 问数状态:枚举【AiQueryStatus】 */
68
+ status: AiQueryStatus;
69
+ /** 结果行数 */
70
+ row_count: number;
71
+ /** SQL执行耗时毫秒 */
72
+ elapsed_ms: number;
73
+ /** 失败原因 */
74
+ error_msg: string;
75
+ /** 结果快照列名,仅详情返回 */
76
+ result_columns: string[];
77
+ /** 结果快照数据行,仅详情返回 */
78
+ result_rows: AiQueryResultRow[];
79
+ /** 创建时间 */
80
+ created_at: string;
81
+ }
82
+
83
+ /** 智能问数记录管理服务。 */
84
+ export interface AiQueryService {
85
+ /** 分页查询智能问数记录。 */
86
+ PageAiQuery(request: PageAiQueryRequest): Promise<PageAiQueryResponse>;
87
+ /** 查询智能问数记录详情。 */
88
+ GetAiQuery(request: GetAiQueryRequest): Promise<AiQueryRecord>;
89
+ }
@@ -0,0 +1,131 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc unknown
5
+ // source: system/admin/v1/ai_session.proto
6
+
7
+ /* eslint-disable */
8
+ import type { AiMessageStatus } from "../../../base/v1/ai_session";
9
+ import type { Terminal } from "../../../base/v1/ai_tool";
10
+
11
+ /** AI会话分页查询条件。 */
12
+ export interface PageAiSessionRequest {
13
+ /** 会话标题 */
14
+ title: string;
15
+ /** 终端类型:枚举【Terminal】 */
16
+ terminal?:
17
+ | Terminal
18
+ | undefined;
19
+ /** 当前页码 */
20
+ page_num: number;
21
+ /** 每页行数 */
22
+ page_size: number;
23
+ }
24
+
25
+ /** AI会话分页响应。 */
26
+ export interface PageAiSessionResponse {
27
+ /** 会话列表 */
28
+ sessions: AiSessionRecord[];
29
+ /** 总数 */
30
+ total: number;
31
+ }
32
+
33
+ /** AI会话分页记录。 */
34
+ export interface AiSessionRecord {
35
+ /** 会话ID */
36
+ id: number;
37
+ /** 所属用户ID */
38
+ user_id: number;
39
+ /** 用户账号 */
40
+ user_name: string;
41
+ /** 用户昵称 */
42
+ nick_name: string;
43
+ /** 会话标题 */
44
+ title: string;
45
+ /** 会话摘要 */
46
+ summary: string;
47
+ /** 终端类型:枚举【Terminal】 */
48
+ terminal: Terminal;
49
+ /** 消息轮次数 */
50
+ message_count: number;
51
+ /** 累计输入Token数 */
52
+ input_tokens: number;
53
+ /** 累计输出Token数 */
54
+ output_tokens: number;
55
+ /** 累计缓存Token数 */
56
+ cache_tokens: number;
57
+ /** 累计总Token数 */
58
+ total_tokens: number;
59
+ /** 创建时间 */
60
+ created_at: string;
61
+ /** 更新时间 */
62
+ updated_at: string;
63
+ }
64
+
65
+ /** 分页查询AI会话消息请求。 */
66
+ export interface PageAiSessionMessageRequest {
67
+ /** 会话ID */
68
+ id: number;
69
+ /** 当前页码 */
70
+ page_num: number;
71
+ /** 每页行数 */
72
+ page_size: number;
73
+ }
74
+
75
+ /** 分页查询AI会话消息响应。 */
76
+ export interface PageAiSessionMessageResponse {
77
+ /** 消息列表 */
78
+ messages: AiSessionMessageRecord[];
79
+ /** 总数 */
80
+ total: number;
81
+ }
82
+
83
+ /** AI会话消息记录。 */
84
+ export interface AiSessionMessageRecord {
85
+ /** 消息ID */
86
+ id: number;
87
+ /** 用户输入内容 */
88
+ input_content: string;
89
+ /** AI回复内容 */
90
+ output_content: string;
91
+ /** 回复使用的模型名称 */
92
+ model: string;
93
+ /** 消息生成状态:枚举【AiMessageStatus】 */
94
+ status: AiMessageStatus;
95
+ /** 输入Token数 */
96
+ input_tokens: number;
97
+ /** 输出Token数 */
98
+ output_tokens: number;
99
+ /** 缓存Token数 */
100
+ cache_tokens: number;
101
+ /** 总Token数 */
102
+ total_tokens: number;
103
+ /** 首Token耗时毫秒 */
104
+ first_token_ms: number;
105
+ /** 总耗时毫秒 */
106
+ duration_ms: number;
107
+ /** 附件列表 */
108
+ attachments: AiSessionMessageAttachment[];
109
+ /** 创建时间 */
110
+ created_at: string;
111
+ }
112
+
113
+ /** AI会话消息附件。 */
114
+ export interface AiSessionMessageAttachment {
115
+ /** 附件名称 */
116
+ name: string;
117
+ /** 附件大小 */
118
+ size: number;
119
+ /** 附件地址 */
120
+ url: string;
121
+ /** 附件 MIME 类型 */
122
+ mime_type: string;
123
+ }
124
+
125
+ /** AI会话管理服务。 */
126
+ export interface AiSessionService {
127
+ /** 分页查询AI会话。 */
128
+ PageAiSession(request: PageAiSessionRequest): Promise<PageAiSessionResponse>;
129
+ /** 分页查询AI会话消息。 */
130
+ PageAiSessionMessage(request: PageAiSessionMessageRequest): Promise<PageAiSessionMessageResponse>;
131
+ }
@@ -5,7 +5,7 @@
5
5
  // source: system/admin/v1/auth.proto
6
6
 
7
7
  /* eslint-disable */
8
- import type { PasswordCrypto, StringValues } from "../../../common/v1/types";
8
+ import type { SecretCrypto, StringValues } from "../../../common/v1/types";
9
9
  import type { Empty } from "../../../google/protobuf/empty";
10
10
  import type { BaseUserIDType } from "../../common/v1/common";
11
11
  import type { BaseMenuType } from "./common";
@@ -202,10 +202,10 @@ export interface RouteParams {
202
202
  export interface UserPasswordForm {
203
203
  /** 原密码 */
204
204
  old_pwd:
205
- | PasswordCrypto
205
+ | SecretCrypto
206
206
  | undefined;
207
207
  /** 新密码 */
208
- new_pwd: PasswordCrypto | undefined;
208
+ new_pwd: SecretCrypto | undefined;
209
209
  }
210
210
 
211
211
  /** 用户手机号表单 */
@@ -7,6 +7,7 @@
7
7
  /* eslint-disable */
8
8
  import type { BaseConfigSite } from "../../../base/v1/config";
9
9
  import type { Status } from "../../../common/v1/enum";
10
+ import type { SecretCrypto } from "../../../common/v1/types";
10
11
  import type { Empty } from "../../../google/protobuf/empty";
11
12
  import type { BaseI18n } from "./base_i18n";
12
13
 
@@ -82,8 +83,10 @@ export interface BaseConfigForm {
82
83
  type: BaseConfigType;
83
84
  /** 配置key */
84
85
  key: string;
85
- /** 配置value */
86
- value: string;
86
+ /** 配置value,前端统一加密提交,服务端统一解密 */
87
+ value?:
88
+ | SecretCrypto
89
+ | undefined;
87
90
  /** 配置名称多语言翻 */
88
91
  name_i18ns: BaseI18n[];
89
92
  /** 配置value文本/富文本配置值的多语言翻译 */
@@ -134,7 +137,7 @@ export interface BaseConfig {
134
137
  type: BaseConfigType;
135
138
  /** 配置key */
136
139
  key: string;
137
- /** 配置value */
140
+ /** 配置value,敏感配置恒为空 */
138
141
  value: string;
139
142
  /** 状态:枚举【Status】 */
140
143
  status: Status;
@@ -6,7 +6,7 @@
6
6
 
7
7
  /* eslint-disable */
8
8
  import type { Status } from "../../../common/v1/enum";
9
- import type { PasswordCrypto } from "../../../common/v1/types";
9
+ import type { SecretCrypto } from "../../../common/v1/types";
10
10
  import type { Empty } from "../../../google/protobuf/empty";
11
11
 
12
12
  /** 登录策略作用域类型。 */
@@ -144,7 +144,7 @@ export interface BaseLoginPolicyForm {
144
144
  | number
145
145
  | undefined;
146
146
  /** 初始化密码,新增用户未提交密码时使用 */
147
- initial_password: PasswordCrypto | undefined;
147
+ initial_password: SecretCrypto | undefined;
148
148
  }
149
149
 
150
150
  /** 登录策略列表项。 */
@@ -7,6 +7,7 @@
7
7
  /* eslint-disable */
8
8
  import type { SelectOptionResponse } from "../../../common/v1/common";
9
9
  import type { Status } from "../../../common/v1/enum";
10
+ import type { SecretCrypto } from "../../../common/v1/types";
10
11
  import type { Empty } from "../../../google/protobuf/empty";
11
12
 
12
13
  /** 消息发送 Provider 选项查询条件。 */
@@ -87,8 +88,10 @@ export interface BaseMessageProviderForm {
87
88
  icon: string;
88
89
  /** 通用凭证标识 */
89
90
  client_id: string;
90
- /** 通用凭证密钥,更新时留空表示不修改 */
91
- client_secret: string;
91
+ /** 通用凭证密钥密文,更新时不传表示不修改 */
92
+ client_secret:
93
+ | SecretCrypto
94
+ | undefined;
92
95
  /** 是否已配置通用凭证密钥 */
93
96
  secret_configured: boolean;
94
97
  /** Provider扩展配置JSON对象 */
@@ -6,6 +6,7 @@
6
6
 
7
7
  /* eslint-disable */
8
8
  import type { Status } from "../../../common/v1/enum";
9
+ import type { SecretCrypto } from "../../../common/v1/types";
9
10
  import type { Empty } from "../../../google/protobuf/empty";
10
11
  import type { BaseI18n } from "./base_i18n";
11
12
 
@@ -83,8 +84,10 @@ export interface BaseOauthProviderForm {
83
84
  icon: string;
84
85
  /** 第三方应用标识 */
85
86
  client_id: string;
86
- /** 第三方应用密钥,更新时留空表示不修改 */
87
- client_secret: string;
87
+ /** 第三方应用密钥密文,更新时不传表示不修改 */
88
+ client_secret:
89
+ | SecretCrypto
90
+ | undefined;
88
91
  /** 是否已配置第三方应用密钥 */
89
92
  secret_configured: boolean;
90
93
  /** OAuth回调地址 */
@@ -8,7 +8,7 @@
8
8
  import type { AnalyticsTimeType } from "../../../common/v1/analytics";
9
9
  import type { SelectOptionResponse } from "../../../common/v1/common";
10
10
  import type { Status } from "../../../common/v1/enum";
11
- import type { PasswordCrypto } from "../../../common/v1/types";
11
+ import type { SecretCrypto } from "../../../common/v1/types";
12
12
  import type { Empty } from "../../../google/protobuf/empty";
13
13
  import type { Timestamp } from "../../../google/protobuf/timestamp";
14
14
  import type { BaseUserIDType, BaseUserPasswordChangeStatus } from "../../common/v1/common";
@@ -193,7 +193,7 @@ export interface BaseUserForm {
193
193
  gender: BaseUserGender;
194
194
  /** 密码 */
195
195
  pwd:
196
- | PasswordCrypto
196
+ | SecretCrypto
197
197
  | undefined;
198
198
  /** 用户状态 */
199
199
  status: Status;
@@ -206,7 +206,7 @@ export interface ResetBaseUserPasswordRequest {
206
206
  /** 用户ID */
207
207
  id: number;
208
208
  /** 密码 */
209
- pwd: PasswordCrypto | undefined;
209
+ pwd: SecretCrypto | undefined;
210
210
  }
211
211
 
212
212
  /** 基础用户应用端角色设置参数 */