@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
@@ -0,0 +1,22 @@
1
+ /** AI知识库选项查询请求。 */
2
+ export interface ListAiKnowledgeOptionsRequest {
3
+ }
4
+ /** AI知识库选项查询响应。 */
5
+ export interface ListAiKnowledgeOptionsResponse {
6
+ /** 知识库选项列表 */
7
+ options: AiKnowledgeOption[];
8
+ }
9
+ /** AI知识库选项。 */
10
+ export interface AiKnowledgeOption {
11
+ /** 知识库ID */
12
+ id: number;
13
+ /** 知识库名称 */
14
+ name: string;
15
+ /** 已就绪文档数,不含处理失败 */
16
+ doc_count: number;
17
+ }
18
+ /** AI 知识库选项查询服务。 */
19
+ export interface AiKnowledgeService {
20
+ /** 查询可用的AI知识库选项。 */
21
+ ListAiKnowledgeOptions(request: ListAiKnowledgeOptionsRequest): Promise<ListAiKnowledgeOptionsResponse>;
22
+ }
@@ -39,6 +39,8 @@ export interface SendAiMessageRequest {
39
39
  provider_id: number;
40
40
  /** 所选模型名称 */
41
41
  model_name: string;
42
+ /** 所选知识库ID列表 */
43
+ knowledge_base_ids: number[];
42
44
  }
43
45
  /** AI 助手失败消息重试请求 */
44
46
  export interface RetryAiUserMessageRequest {
@@ -1,22 +1,5 @@
1
- import type { PasswordCrypto } from "../../common/v1/types";
1
+ import type { SecretCrypto } from "../../common/v1/types";
2
2
  import type { Empty } from "../../google/protobuf/empty";
3
- /** 密码加密场景枚举。 */
4
- export declare enum PasswordCryptoScene {
5
- /** PASSWORD_CRYPTO_SCENE_UNSPECIFIED - 未指定密码加密场景。 */
6
- PASSWORD_CRYPTO_SCENE_UNSPECIFIED = 0,
7
- /** PASSWORD_CRYPTO_SCENE_LOGIN - 登录密码加密场景。 */
8
- PASSWORD_CRYPTO_SCENE_LOGIN = 1,
9
- /** PASSWORD_CRYPTO_SCENE_CREATE_BASE_USER - 新增后台用户密码加密场景。 */
10
- PASSWORD_CRYPTO_SCENE_CREATE_BASE_USER = 2,
11
- /** PASSWORD_CRYPTO_SCENE_RESET_BASE_USER_PASSWORD - 重置后台用户密码加密场景。 */
12
- PASSWORD_CRYPTO_SCENE_RESET_BASE_USER_PASSWORD = 3,
13
- /** PASSWORD_CRYPTO_SCENE_UPDATE_USER_PASSWORD - 个人修改密码加密场景。 */
14
- PASSWORD_CRYPTO_SCENE_UPDATE_USER_PASSWORD = 4,
15
- /** PASSWORD_CRYPTO_SCENE_MFA - 多因素认证敏感操作场景。 */
16
- PASSWORD_CRYPTO_SCENE_MFA = 5,
17
- /** PASSWORD_CRYPTO_SCENE_CONFIGURE_PASSWORD_POLICY - 密码策略初始化密码配置场景。 */
18
- PASSWORD_CRYPTO_SCENE_CONFIGURE_PASSWORD_POLICY = 6
19
- }
20
3
  /**
21
4
  * LoginStatus 表示登录请求当前所处的认证阶段。
22
5
  * 只有 AUTHENTICATED 或 PASSWORD_CHANGE_REQUIRED 才会携带正式访问令牌,MFA 状态必须继续完成挑战。
@@ -38,11 +21,6 @@ export interface CaptchaRequest {
38
21
  /** 验证码类型,random 表示随机选择当前支持的验证码类型 */
39
22
  type: string;
40
23
  }
41
- /** 密码临时公钥获取条件 */
42
- export interface PasswordPublicKeyRequest {
43
- /** 使用场景 */
44
- scene: PasswordCryptoScene;
45
- }
46
24
  /** 登出请求条件 */
47
25
  export interface LogoutRequest {
48
26
  }
@@ -69,19 +47,6 @@ export interface VerifyCaptchaResponse {
69
47
  /** 有效时间,单位秒 */
70
48
  expires_in: number;
71
49
  }
72
- /** 密码临时公钥响应 */
73
- export interface PasswordPublicKeyResponse {
74
- /** 临时密钥ID */
75
- key_id: string;
76
- /** 临时公钥 */
77
- public_key: string;
78
- /** 加密算法 */
79
- algorithm: string;
80
- /** 随机值 */
81
- nonce: string;
82
- /** 有效时间,单位秒 */
83
- expires_in: number;
84
- }
85
50
  /** 刷新令牌请求参数 */
86
51
  export interface RefreshTokenRequest {
87
52
  /** 更新令牌;未填写时由服务端从HttpOnly Cookie读取。 */
@@ -105,7 +70,7 @@ export interface LoginRequest {
105
70
  /** 用户名,必选项。 */
106
71
  user_name: string;
107
72
  /** 用户的密码,必选项。 */
108
- password: PasswordCrypto | undefined;
73
+ password: SecretCrypto | undefined;
109
74
  /** 验证码 */
110
75
  captcha_code: string;
111
76
  /** 验证码Id */
@@ -142,8 +107,6 @@ export interface LoginService {
142
107
  Captcha(request: CaptchaRequest): Promise<CaptchaResponse>;
143
108
  /** 验证码预校验 */
144
109
  VerifyCaptcha(request: VerifyCaptchaRequest): Promise<VerifyCaptchaResponse>;
145
- /** 获取密码临时公钥 */
146
- PasswordPublicKey(request: PasswordPublicKeyRequest): Promise<PasswordPublicKeyResponse>;
147
110
  /** 登出 */
148
111
  Logout(request: LogoutRequest): Promise<Empty>;
149
112
  /** 刷新认证令牌 */
@@ -1,4 +1,4 @@
1
- import type { PasswordCrypto } from "../../common/v1/types";
1
+ import type { SecretCrypto } from "../../common/v1/types";
2
2
  import type { Empty } from "../../google/protobuf/empty";
3
3
  import type { LoginStatus } from "./login";
4
4
  /** 个人中心三方账号绑定列表查询条件 */
@@ -59,7 +59,7 @@ export interface BindOauthSessionRequest {
59
59
  /** 用户名 */
60
60
  user_name: string;
61
61
  /** 用户密码 */
62
- password: PasswordCrypto | undefined;
62
+ password: SecretCrypto | undefined;
63
63
  /** 验证码 */
64
64
  captcha_code: string;
65
65
  /** 验证码Id */
@@ -43,8 +43,8 @@ export interface BytesValues {
43
43
  /** 值列表。 */
44
44
  value: Uint8Array[];
45
45
  }
46
- /** 密码密文。 */
47
- export interface PasswordCrypto {
46
+ /** 敏感字段密文,密码与各类密钥字段统一使用。 */
47
+ export interface SecretCrypto {
48
48
  /** 临时密钥ID */
49
49
  key_id: string;
50
50
  /** 随机值 */
@@ -55,6 +55,6 @@ export interface PasswordCrypto {
55
55
  encrypted_key: string;
56
56
  /** 初始化向量 */
57
57
  iv: string;
58
- /** 密码加密数据 */
59
- ciphertext: string;
58
+ /** 传输时为密文,服务端解密后回填明文 */
59
+ text: string;
60
60
  }
@@ -1,5 +1,23 @@
1
1
  import type { Status } from "../../../common/v1/enum";
2
+ import type { SecretCrypto } from "../../../common/v1/types";
2
3
  import type { Empty } from "../../../google/protobuf/empty";
4
+ /** AI模型分类枚举。 */
5
+ export declare enum AiModelCategory {
6
+ /** AI_MODEL_CATEGORY_UNSPECIFIED - 未指定AI模型分类。 */
7
+ AI_MODEL_CATEGORY_UNSPECIFIED = 0,
8
+ /** AI_MODEL_CATEGORY_CHAT - 对话模型。 */
9
+ AI_MODEL_CATEGORY_CHAT = 1,
10
+ /** AI_MODEL_CATEGORY_EMBEDDING - 向量模型。 */
11
+ AI_MODEL_CATEGORY_EMBEDDING = 2,
12
+ /** AI_MODEL_CATEGORY_RERANK - 重排序模型。 */
13
+ AI_MODEL_CATEGORY_RERANK = 3,
14
+ /** AI_MODEL_CATEGORY_IMAGE - 图片模型。 */
15
+ AI_MODEL_CATEGORY_IMAGE = 4,
16
+ /** AI_MODEL_CATEGORY_VIDEO - 视频模型。 */
17
+ AI_MODEL_CATEGORY_VIDEO = 5,
18
+ /** AI_MODEL_CATEGORY_AUDIO - 音频模型。 */
19
+ AI_MODEL_CATEGORY_AUDIO = 6
20
+ }
3
21
  /** AI供应商分页查询条件。 */
4
22
  export interface PageAiProviderRequest {
5
23
  /** 供应商名称 */
@@ -31,12 +49,10 @@ export interface AiProviderForm {
31
49
  name: string;
32
50
  /** 模型API基础地址 */
33
51
  base_url: string;
34
- /** 模型API密钥;更新时留空表示保留现有密钥 */
35
- api_key: string;
52
+ /** 模型API密钥密文,更新时不传表示保留现有密钥 */
53
+ api_key: SecretCrypto | undefined;
36
54
  /** 是否已保存模型密钥 */
37
55
  api_key_configured: boolean;
38
- /** 多模型JSON数组 */
39
- models_json: string;
40
56
  /** 排序值 */
41
57
  sort: number;
42
58
  /** Provider稳定标识 */
@@ -45,6 +61,27 @@ export interface AiProviderForm {
45
61
  config: {
46
62
  [key: string]: any;
47
63
  } | undefined;
64
+ /** 供应商下的AI模型列表 */
65
+ models: AiProviderModelForm[];
66
+ /** 状态 */
67
+ status: Status;
68
+ }
69
+ /** AI供应商模型维护表单;provider_id由所属供应商表单隐式给定。 */
70
+ export interface AiProviderModelForm {
71
+ /** 模型ID;新增时为0 */
72
+ id: number;
73
+ /** 模型名称,供应商API标识 */
74
+ model_name: string;
75
+ /** 显示名称 */
76
+ display_name: string;
77
+ /** 模型分类:枚举【AiModelCategory】 */
78
+ category: AiModelCategory;
79
+ /** 分类个性化配置JSON对象 */
80
+ config: {
81
+ [key: string]: any;
82
+ } | undefined;
83
+ /** 排序值 */
84
+ sort: number;
48
85
  /** 状态 */
49
86
  status: Status;
50
87
  }
@@ -58,7 +95,7 @@ export interface UpdateAiProviderRequest {
58
95
  /** AI供应商表单 */
59
96
  ai_provider: AiProviderForm | undefined;
60
97
  }
61
- /** 测试AI供应商全部模型请求。 */
98
+ /** 测试AI供应商模型请求。 */
62
99
  export interface TestAiProviderModelsRequest {
63
100
  /** 待测试的AI供应商草稿 */
64
101
  ai_provider: AiProviderForm | undefined;
@@ -79,6 +116,23 @@ export interface TestAiProviderModelsResponse {
79
116
  /** 模型测试结果 */
80
117
  results: AiProviderModelTestResult[];
81
118
  }
119
+ /** 查询AI供应商选项请求。 */
120
+ export interface ListAiProviderOptionsRequest {
121
+ }
122
+ /** 查询AI供应商选项响应。 */
123
+ export interface ListAiProviderOptionsResponse {
124
+ /** 已启用的AI供应商列表 */
125
+ options: AiProviderOption[];
126
+ }
127
+ /** AI供应商选项。 */
128
+ export interface AiProviderOption {
129
+ /** 供应商ID */
130
+ id: number;
131
+ /** 供应商名称 */
132
+ name: string;
133
+ /** Provider稳定标识 */
134
+ provider: string;
135
+ }
82
136
  /** 删除AI供应商请求。 */
83
137
  export interface DeleteAiProviderRequest {
84
138
  /** 供应商ID */
@@ -101,12 +155,12 @@ export interface AiProvider {
101
155
  base_url: string;
102
156
  /** 是否已保存模型密钥 */
103
157
  api_key_configured: boolean;
104
- /** 模型名称列表 */
105
- model_names: string[];
106
158
  /** 排序值 */
107
159
  sort: number;
108
160
  /** Provider稳定标识 */
109
161
  provider: string;
162
+ /** 供应商下的模型名称列表 */
163
+ model_names: string[];
110
164
  /** 状态 */
111
165
  status: Status;
112
166
  /** 创建时间 */
@@ -118,6 +172,11 @@ export interface AiProvider {
118
172
  export interface AiProviderService {
119
173
  /** 分页查询AI供应商。 */
120
174
  PageAiProvider(request: PageAiProviderRequest): Promise<PageAiProviderResponse>;
175
+ /**
176
+ * 查询已启用的AI供应商选项。
177
+ * 字面路径必须先于 /{id} 声明:gorilla mux 按注册顺序匹配,否则会被 {id} 路由抢占。
178
+ */
179
+ ListAiProviderOptions(request: ListAiProviderOptionsRequest): Promise<ListAiProviderOptionsResponse>;
121
180
  /** 查询AI供应商表单。 */
122
181
  GetAiProvider(request: GetAiProviderRequest): Promise<AiProviderForm>;
123
182
  /** 创建AI供应商。 */
@@ -0,0 +1,73 @@
1
+ /** 智能问数状态枚举。 */
2
+ export declare enum AiQueryStatus {
3
+ /** AI_QUERY_STATUS_UNSPECIFIED - 未指定智能问数状态。 */
4
+ AI_QUERY_STATUS_UNSPECIFIED = 0,
5
+ /** AI_QUERY_STATUS_SUCCESS - 成功。 */
6
+ AI_QUERY_STATUS_SUCCESS = 1,
7
+ /** AI_QUERY_STATUS_FAILED - 失败。 */
8
+ AI_QUERY_STATUS_FAILED = 2
9
+ }
10
+ /** 智能问数分页查询条件。 */
11
+ export interface PageAiQueryRequest {
12
+ /** 问题内容 */
13
+ question: string;
14
+ /** 问数状态:枚举【AiQueryStatus】 */
15
+ status?: AiQueryStatus | undefined;
16
+ /** 当前页码 */
17
+ page_num: number;
18
+ /** 每页行数 */
19
+ page_size: number;
20
+ }
21
+ /** 智能问数分页响应。 */
22
+ export interface PageAiQueryResponse {
23
+ /** 智能问数记录列表 */
24
+ queries: AiQueryRecord[];
25
+ /** 总数 */
26
+ total: number;
27
+ }
28
+ /** 查询智能问数记录请求。 */
29
+ export interface GetAiQueryRequest {
30
+ /** 记录ID */
31
+ id: number;
32
+ }
33
+ /** 智能问数结果快照行。 */
34
+ export interface AiQueryResultRow {
35
+ /** 行数据 */
36
+ values: string[];
37
+ }
38
+ /** 智能问数记录。 */
39
+ export interface AiQueryRecord {
40
+ /** 记录ID */
41
+ id: number;
42
+ /** 租户ID */
43
+ tenant_id: number;
44
+ /** 用户ID */
45
+ user_id: number;
46
+ /** 用户账号 */
47
+ user_name: string;
48
+ /** 自然语言问题 */
49
+ question: string;
50
+ /** 生成的只读SQL */
51
+ sql: string;
52
+ /** 问数状态:枚举【AiQueryStatus】 */
53
+ status: AiQueryStatus;
54
+ /** 结果行数 */
55
+ row_count: number;
56
+ /** SQL执行耗时毫秒 */
57
+ elapsed_ms: number;
58
+ /** 失败原因 */
59
+ error_msg: string;
60
+ /** 结果快照列名,仅详情返回 */
61
+ result_columns: string[];
62
+ /** 结果快照数据行,仅详情返回 */
63
+ result_rows: AiQueryResultRow[];
64
+ /** 创建时间 */
65
+ created_at: string;
66
+ }
67
+ /** 智能问数记录管理服务。 */
68
+ export interface AiQueryService {
69
+ /** 分页查询智能问数记录。 */
70
+ PageAiQuery(request: PageAiQueryRequest): Promise<PageAiQueryResponse>;
71
+ /** 查询智能问数记录详情。 */
72
+ GetAiQuery(request: GetAiQueryRequest): Promise<AiQueryRecord>;
73
+ }
@@ -0,0 +1,114 @@
1
+ import type { AiMessageStatus } from "../../../base/v1/ai_session";
2
+ import type { Terminal } from "../../../base/v1/ai_tool";
3
+ /** AI会话分页查询条件。 */
4
+ export interface PageAiSessionRequest {
5
+ /** 会话标题 */
6
+ title: string;
7
+ /** 终端类型:枚举【Terminal】 */
8
+ terminal?: Terminal | undefined;
9
+ /** 当前页码 */
10
+ page_num: number;
11
+ /** 每页行数 */
12
+ page_size: number;
13
+ }
14
+ /** AI会话分页响应。 */
15
+ export interface PageAiSessionResponse {
16
+ /** 会话列表 */
17
+ sessions: AiSessionRecord[];
18
+ /** 总数 */
19
+ total: number;
20
+ }
21
+ /** AI会话分页记录。 */
22
+ export interface AiSessionRecord {
23
+ /** 会话ID */
24
+ id: number;
25
+ /** 所属用户ID */
26
+ user_id: number;
27
+ /** 用户账号 */
28
+ user_name: string;
29
+ /** 用户昵称 */
30
+ nick_name: string;
31
+ /** 会话标题 */
32
+ title: string;
33
+ /** 会话摘要 */
34
+ summary: string;
35
+ /** 终端类型:枚举【Terminal】 */
36
+ terminal: Terminal;
37
+ /** 消息轮次数 */
38
+ message_count: number;
39
+ /** 累计输入Token数 */
40
+ input_tokens: number;
41
+ /** 累计输出Token数 */
42
+ output_tokens: number;
43
+ /** 累计缓存Token数 */
44
+ cache_tokens: number;
45
+ /** 累计总Token数 */
46
+ total_tokens: number;
47
+ /** 创建时间 */
48
+ created_at: string;
49
+ /** 更新时间 */
50
+ updated_at: string;
51
+ }
52
+ /** 分页查询AI会话消息请求。 */
53
+ export interface PageAiSessionMessageRequest {
54
+ /** 会话ID */
55
+ id: number;
56
+ /** 当前页码 */
57
+ page_num: number;
58
+ /** 每页行数 */
59
+ page_size: number;
60
+ }
61
+ /** 分页查询AI会话消息响应。 */
62
+ export interface PageAiSessionMessageResponse {
63
+ /** 消息列表 */
64
+ messages: AiSessionMessageRecord[];
65
+ /** 总数 */
66
+ total: number;
67
+ }
68
+ /** AI会话消息记录。 */
69
+ export interface AiSessionMessageRecord {
70
+ /** 消息ID */
71
+ id: number;
72
+ /** 用户输入内容 */
73
+ input_content: string;
74
+ /** AI回复内容 */
75
+ output_content: string;
76
+ /** 回复使用的模型名称 */
77
+ model: string;
78
+ /** 消息生成状态:枚举【AiMessageStatus】 */
79
+ status: AiMessageStatus;
80
+ /** 输入Token数 */
81
+ input_tokens: number;
82
+ /** 输出Token数 */
83
+ output_tokens: number;
84
+ /** 缓存Token数 */
85
+ cache_tokens: number;
86
+ /** 总Token数 */
87
+ total_tokens: number;
88
+ /** 首Token耗时毫秒 */
89
+ first_token_ms: number;
90
+ /** 总耗时毫秒 */
91
+ duration_ms: number;
92
+ /** 附件列表 */
93
+ attachments: AiSessionMessageAttachment[];
94
+ /** 创建时间 */
95
+ created_at: string;
96
+ }
97
+ /** AI会话消息附件。 */
98
+ export interface AiSessionMessageAttachment {
99
+ /** 附件名称 */
100
+ name: string;
101
+ /** 附件大小 */
102
+ size: number;
103
+ /** 附件地址 */
104
+ url: string;
105
+ /** 附件 MIME 类型 */
106
+ mime_type: string;
107
+ }
108
+ /** AI会话管理服务。 */
109
+ export interface AiSessionService {
110
+ /** 分页查询AI会话。 */
111
+ PageAiSession(request: PageAiSessionRequest): Promise<PageAiSessionResponse>;
112
+ /** 分页查询AI会话消息。 */
113
+ PageAiSessionMessage(request: PageAiSessionMessageRequest): Promise<PageAiSessionMessageResponse>;
114
+ }
@@ -1,4 +1,4 @@
1
- import type { PasswordCrypto, StringValues } from "../../../common/v1/types";
1
+ import type { SecretCrypto, StringValues } from "../../../common/v1/types";
2
2
  import type { Empty } from "../../../google/protobuf/empty";
3
3
  import type { BaseUserIDType } from "../../common/v1/common";
4
4
  import type { BaseMenuType } from "./common";
@@ -151,9 +151,9 @@ export interface RouteParams {
151
151
  /** 用户密码表单 */
152
152
  export interface UserPasswordForm {
153
153
  /** 原密码 */
154
- old_pwd: PasswordCrypto | undefined;
154
+ old_pwd: SecretCrypto | undefined;
155
155
  /** 新密码 */
156
- new_pwd: PasswordCrypto | undefined;
156
+ new_pwd: SecretCrypto | undefined;
157
157
  }
158
158
  /** 用户手机号表单 */
159
159
  export interface UserPhoneForm {
@@ -1,5 +1,6 @@
1
1
  import type { BaseConfigSite } from "../../../base/v1/config";
2
2
  import type { Status } from "../../../common/v1/enum";
3
+ import type { SecretCrypto } from "../../../common/v1/types";
3
4
  import type { Empty } from "../../../google/protobuf/empty";
4
5
  import type { BaseI18n } from "./base_i18n";
5
6
  /** 系统配置类型。 */
@@ -60,8 +61,8 @@ export interface BaseConfigForm {
60
61
  type: BaseConfigType;
61
62
  /** 配置key */
62
63
  key: string;
63
- /** 配置value */
64
- value: string;
64
+ /** 配置value,前端统一加密提交,服务端统一解密 */
65
+ value?: SecretCrypto | undefined;
65
66
  /** 配置名称多语言翻 */
66
67
  name_i18ns: BaseI18n[];
67
68
  /** 配置value文本/富文本配置值的多语言翻译 */
@@ -106,7 +107,7 @@ export interface BaseConfig {
106
107
  type: BaseConfigType;
107
108
  /** 配置key */
108
109
  key: string;
109
- /** 配置value */
110
+ /** 配置value,敏感配置恒为空 */
110
111
  value: string;
111
112
  /** 状态:枚举【Status】 */
112
113
  status: Status;
@@ -1,5 +1,5 @@
1
1
  import type { Status } from "../../../common/v1/enum";
2
- import type { PasswordCrypto } from "../../../common/v1/types";
2
+ import type { SecretCrypto } from "../../../common/v1/types";
3
3
  import type { Empty } from "../../../google/protobuf/empty";
4
4
  /** 登录策略作用域类型。 */
5
5
  export declare enum BaseLoginPolicyScopeType {
@@ -112,7 +112,7 @@ export interface BaseLoginPolicyForm {
112
112
  /** 密码至少满足的字符类别数量,字符类别包括小写、大写、数字和符号 */
113
113
  password_min_complexity_classes?: number | undefined;
114
114
  /** 初始化密码,新增用户未提交密码时使用 */
115
- initial_password: PasswordCrypto | undefined;
115
+ initial_password: SecretCrypto | undefined;
116
116
  }
117
117
  /** 登录策略列表项。 */
118
118
  export interface BaseLoginPolicy {
@@ -1,5 +1,6 @@
1
1
  import type { SelectOptionResponse } from "../../../common/v1/common";
2
2
  import type { Status } from "../../../common/v1/enum";
3
+ import type { SecretCrypto } from "../../../common/v1/types";
3
4
  import type { Empty } from "../../../google/protobuf/empty";
4
5
  /** 消息发送 Provider 选项查询条件。 */
5
6
  export interface OptionBaseMessageProviderRequest {
@@ -65,8 +66,8 @@ export interface BaseMessageProviderForm {
65
66
  icon: string;
66
67
  /** 通用凭证标识 */
67
68
  client_id: string;
68
- /** 通用凭证密钥,更新时留空表示不修改 */
69
- client_secret: string;
69
+ /** 通用凭证密钥密文,更新时不传表示不修改 */
70
+ client_secret: SecretCrypto | undefined;
70
71
  /** 是否已配置通用凭证密钥 */
71
72
  secret_configured: boolean;
72
73
  /** Provider扩展配置JSON对象 */
@@ -1,4 +1,5 @@
1
1
  import type { Status } from "../../../common/v1/enum";
2
+ import type { SecretCrypto } from "../../../common/v1/types";
2
3
  import type { Empty } from "../../../google/protobuf/empty";
3
4
  import type { BaseI18n } from "./base_i18n";
4
5
  /** OAuth登录方式分页查询条件。 */
@@ -62,8 +63,8 @@ export interface BaseOauthProviderForm {
62
63
  icon: string;
63
64
  /** 第三方应用标识 */
64
65
  client_id: string;
65
- /** 第三方应用密钥,更新时留空表示不修改 */
66
- client_secret: string;
66
+ /** 第三方应用密钥密文,更新时不传表示不修改 */
67
+ client_secret: SecretCrypto | undefined;
67
68
  /** 是否已配置第三方应用密钥 */
68
69
  secret_configured: boolean;
69
70
  /** OAuth回调地址 */
@@ -1,7 +1,7 @@
1
1
  import type { AnalyticsTimeType } from "../../../common/v1/analytics";
2
2
  import type { SelectOptionResponse } from "../../../common/v1/common";
3
3
  import type { Status } from "../../../common/v1/enum";
4
- import type { PasswordCrypto } from "../../../common/v1/types";
4
+ import type { SecretCrypto } from "../../../common/v1/types";
5
5
  import type { Empty } from "../../../google/protobuf/empty";
6
6
  import type { Timestamp } from "../../../google/protobuf/timestamp";
7
7
  import type { BaseUserIDType, BaseUserPasswordChangeStatus } from "../../common/v1/common";
@@ -164,7 +164,7 @@ export interface BaseUserForm {
164
164
  /** 性别 */
165
165
  gender: BaseUserGender;
166
166
  /** 密码 */
167
- pwd: PasswordCrypto | undefined;
167
+ pwd: SecretCrypto | undefined;
168
168
  /** 用户状态 */
169
169
  status: Status;
170
170
  /** 备注名 */
@@ -175,7 +175,7 @@ export interface ResetBaseUserPasswordRequest {
175
175
  /** 用户ID */
176
176
  id: number;
177
177
  /** 密码 */
178
- pwd: PasswordCrypto | undefined;
178
+ pwd: SecretCrypto | undefined;
179
179
  }
180
180
  /** 基础用户应用端角色设置参数 */
181
181
  export interface SetBaseUserAppRoleRequest {
@@ -1,5 +1,6 @@
1
1
  import { type AiSession } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_session";
2
2
  import type { AiProviderModelOption } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_provider";
3
+ import type { AiKnowledgeOption } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_knowledge";
3
4
  import type { AiShortcut } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_tool";
4
5
  import type { ChatMessageAction, ChatMessageEditPayload, ChatMessageItem, SubmitPayload } from "../types";
5
6
  type __VLS_Props = {
@@ -19,17 +20,22 @@ type __VLS_Props = {
19
20
  providerId: number;
20
21
  /** 当前选择的模型名称。 */
21
22
  modelName: string;
23
+ /** 当前可供选择的知识库。 */
24
+ knowledgeOptions: AiKnowledgeOption[];
25
+ /** 当前选择的知识库编号列表。 */
26
+ knowledgeIds: number[];
22
27
  };
23
- declare var __VLS_103: {
28
+ declare var __VLS_104: {
24
29
  message: ChatMessageItem;
25
30
  activeFlowMessageId: string;
26
31
  };
27
32
  type __VLS_Slots = {} & {
28
- 'flow-blocks'?: (props: typeof __VLS_103) => any;
33
+ 'flow-blocks'?: (props: typeof __VLS_104) => any;
29
34
  };
30
35
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
31
36
  submit: (payload: SubmitPayload) => any;
32
37
  modelChange: (providerId: number, modelName: string) => any;
38
+ knowledgeChange: (knowledgeIds: number[]) => any;
33
39
  messageAction: (payload: {
34
40
  action: ChatMessageAction;
35
41
  item: ChatMessageItem;
@@ -38,6 +44,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
38
44
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
39
45
  onSubmit?: ((payload: SubmitPayload) => any) | undefined;
40
46
  onModelChange?: ((providerId: number, modelName: string) => any) | undefined;
47
+ onKnowledgeChange?: ((knowledgeIds: number[]) => any) | undefined;
41
48
  onMessageAction?: ((payload: {
42
49
  action: ChatMessageAction;
43
50
  item: ChatMessageItem;
@@ -1,4 +1,5 @@
1
1
  import type { AiProviderModelOption } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_provider";
2
+ import type { AiKnowledgeOption } from "@liujitcn/kratos-admin-system/rpc/base/v1/ai_knowledge";
2
3
  import type { SubmitPayload } from "../types";
3
4
  type __VLS_Props = {
4
5
  /** 消息发送加载状态。 */
@@ -9,13 +10,19 @@ type __VLS_Props = {
9
10
  providerId: number;
10
11
  /** 当前选择的模型名称。 */
11
12
  modelName: string;
13
+ /** 当前可供选择的知识库。 */
14
+ knowledgeOptions: AiKnowledgeOption[];
15
+ /** 当前选择的知识库编号列表。 */
16
+ knowledgeIds: number[];
12
17
  };
13
18
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
19
  submit: (payload: SubmitPayload) => any;
15
20
  "model-change": (providerId: number, modelName: string) => any;
21
+ "knowledge-change": (knowledgeIds: number[]) => any;
16
22
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
23
  onSubmit?: ((payload: SubmitPayload) => any) | undefined;
18
24
  "onModel-change"?: ((providerId: number, modelName: string) => any) | undefined;
25
+ "onKnowledge-change"?: ((knowledgeIds: number[]) => any) | undefined;
19
26
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
27
  declare const _default: typeof __VLS_export;
21
28
  export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;