@liujitcn/kratos-uni-app-system 0.0.1

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.
@@ -0,0 +1,98 @@
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_message.proto
6
+
7
+ /* eslint-disable */
8
+ import type { AiAttachment, AiMessage, AiSession } from "./ai_session";
9
+
10
+ /** AI 助手消息更新请求 */
11
+ export interface UpdateAiMessageRequest {
12
+ /** 会话ID */
13
+ session_id: string;
14
+ /** 消息ID */
15
+ message_id: string;
16
+ /** 更新后的消息内容 */
17
+ content: string;
18
+ }
19
+
20
+ /** AI 助手消息发送响应 */
21
+ export interface SendAiMessageResponse {
22
+ /** 新增消息列表 */
23
+ messages: AiMessage[];
24
+ /** 最新会话信息 */
25
+ session: AiSession | undefined;
26
+ }
27
+
28
+ /** AI 助手消息删除请求 */
29
+ export interface DeleteAiMessageRequest {
30
+ /** 会话ID */
31
+ session_id: string;
32
+ /** 消息ID */
33
+ message_id: string;
34
+ }
35
+
36
+ /** AI 助手消息删除响应 */
37
+ export interface DeleteAiMessageResponse {
38
+ }
39
+
40
+ /** AI 助手消息发送请求 */
41
+ export interface SendAiMessageRequest {
42
+ /** 会话ID */
43
+ session_id: string;
44
+ /** 消息内容 */
45
+ content: string;
46
+ /** 附件列表 */
47
+ attachments: AiAttachment[];
48
+ /** 助手动作 */
49
+ action: AiAction | undefined;
50
+ }
51
+
52
+ /** AI 助手失败消息重试请求 */
53
+ export interface RetryAiUserMessageRequest {
54
+ /** 会话ID */
55
+ session_id: string;
56
+ /** 失败消息ID */
57
+ message_id: string;
58
+ }
59
+
60
+ /** AI 助手输出重新生成请求 */
61
+ export interface RegenerateAiMessageRequest {
62
+ /** 会话ID */
63
+ session_id: string;
64
+ /** 消息ID */
65
+ message_id: string;
66
+ }
67
+
68
+ /** AI 助手动作 */
69
+ export interface AiAction {
70
+ /** 流程标识 */
71
+ flow: string;
72
+ /** 流程步骤 */
73
+ step: string;
74
+ /** 动作类型 */
75
+ type: string;
76
+ /** 动作负载JSON */
77
+ payload_json: string;
78
+ /** 动作来源消息ID */
79
+ source_message_id: string;
80
+ /** 动作唯一ID */
81
+ action_id: string;
82
+ /** 流程状态版本 */
83
+ flow_version: number;
84
+ }
85
+
86
+ /** Base AI 助手消息服务 */
87
+ export interface AiMessageService {
88
+ /** 更新 AI 助手消息并重新生成输出 */
89
+ UpdateAiMessage(request: UpdateAiMessageRequest): Promise<SendAiMessageResponse>;
90
+ /** 删除 AI 助手消息 */
91
+ DeleteAiMessage(request: DeleteAiMessageRequest): Promise<DeleteAiMessageResponse>;
92
+ /** 发送 AI 助手消息 */
93
+ SendAiMessage(request: SendAiMessageRequest): Promise<SendAiMessageResponse>;
94
+ /** 重试失败的 AI 助手消息 */
95
+ RetryAiUserMessage(request: RetryAiUserMessageRequest): Promise<SendAiMessageResponse>;
96
+ /** 重新生成 AI 助手输出 */
97
+ RegenerateAiMessage(request: RegenerateAiMessageRequest): Promise<SendAiMessageResponse>;
98
+ }
@@ -0,0 +1,214 @@
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_session.proto
6
+
7
+ /* eslint-disable */
8
+ import type { AiMessageStatus, Terminal } from "../../common/v1/enum";
9
+ import type { Timestamp } from "../../google/protobuf/timestamp";
10
+ import type { AiToolCall } from "./ai_tool";
11
+
12
+ /** AI 助手消息列表查询条件 */
13
+ export interface ListAiMessageRequest {
14
+ /** 会话ID */
15
+ session_id: string;
16
+ }
17
+
18
+ /** AI 助手消息列表响应 */
19
+ export interface ListAiMessageResponse {
20
+ /** 消息列表 */
21
+ messages: AiMessage[];
22
+ }
23
+
24
+ /** AI 助手会话列表查询条件 */
25
+ export interface ListAiSessionRequest {
26
+ /** 终端类型:枚举【Terminal】 */
27
+ terminal: Terminal;
28
+ }
29
+
30
+ /** AI 助手会话列表响应 */
31
+ export interface ListAiSessionResponse {
32
+ /** 会话列表 */
33
+ sessions: AiSession[];
34
+ }
35
+
36
+ /** AI 助手会话创建请求 */
37
+ export interface CreateAiSessionRequest {
38
+ /** 会话标题 */
39
+ title: string;
40
+ /** 终端类型:枚举【Terminal】 */
41
+ terminal: Terminal;
42
+ }
43
+
44
+ /** AI 助手会话创建响应 */
45
+ export interface CreateAiSessionResponse {
46
+ /** 会话信息 */
47
+ session: AiSession | undefined;
48
+ }
49
+
50
+ /** AI 助手分支会话创建请求 */
51
+ export interface CreateAiSessionBranchRequest {
52
+ /** 来源会话ID */
53
+ source_session_id: string;
54
+ /** 分支锚点消息ID */
55
+ anchor_message_id: string;
56
+ /** 分支会话标题 */
57
+ title: string;
58
+ /** 终端类型:枚举【Terminal】 */
59
+ terminal: Terminal;
60
+ }
61
+
62
+ /** AI 助手分支会话创建响应 */
63
+ export interface CreateAiSessionBranchResponse {
64
+ /** 新会话信息 */
65
+ session:
66
+ | AiSession
67
+ | undefined;
68
+ /** 新会话消息列表 */
69
+ messages: AiMessage[];
70
+ }
71
+
72
+ /** AI 助手会话更新请求 */
73
+ export interface UpdateAiSessionRequest {
74
+ /** 会话ID */
75
+ id: string;
76
+ /** 会话标题 */
77
+ title: string;
78
+ }
79
+
80
+ /** AI 助手会话更新响应 */
81
+ export interface UpdateAiSessionResponse {
82
+ /** 会话信息 */
83
+ session: AiSession | undefined;
84
+ }
85
+
86
+ /** AI 助手会话删除请求 */
87
+ export interface DeleteAiSessionRequest {
88
+ /** 会话ID */
89
+ id: string;
90
+ }
91
+
92
+ /** AI 助手会话删除响应 */
93
+ export interface DeleteAiSessionResponse {
94
+ }
95
+
96
+ /** AI 助手会话 */
97
+ export interface AiSession {
98
+ /** 会话ID */
99
+ id: string;
100
+ /** 会话标题 */
101
+ title: string;
102
+ /** 会话摘要 */
103
+ summary: string;
104
+ /** 更新时间 */
105
+ updated_at:
106
+ | Timestamp
107
+ | undefined;
108
+ /** 终端类型:枚举【Terminal】 */
109
+ terminal: Terminal;
110
+ }
111
+
112
+ /** AI 助手消息 */
113
+ export interface AiMessage {
114
+ /** 消息ID */
115
+ id: string;
116
+ /** 输入内容 */
117
+ input_content:
118
+ | AiInputContent
119
+ | undefined;
120
+ /** 输出内容 */
121
+ output_content:
122
+ | AiOutputContent
123
+ | undefined;
124
+ /** 附件列表 */
125
+ attachments: AiAttachment[];
126
+ /** 创建时间 */
127
+ created_at:
128
+ | Timestamp
129
+ | undefined;
130
+ /** 消息生成状态:枚举【AiMessageStatus】 */
131
+ status: AiMessageStatus;
132
+ /** Token 统计 */
133
+ token:
134
+ | AiToken
135
+ | undefined;
136
+ /** 本次消息使用的工具调用记录 */
137
+ tools: AiToolCall[];
138
+ /** 首 Token 耗时毫秒 */
139
+ first_token_ms: number;
140
+ /** 总耗时毫秒 */
141
+ duration_ms: number;
142
+ }
143
+
144
+ /** AI 助手输入内容 */
145
+ export interface AiInputContent {
146
+ /** 内容类型 */
147
+ kind: string;
148
+ /** 内容正文 */
149
+ content: string;
150
+ }
151
+
152
+ /** AI 助手输出内容 */
153
+ export interface AiOutputContent {
154
+ /** 内容类型 */
155
+ kind: string;
156
+ /** 内容正文 */
157
+ content: string;
158
+ /** 回复来源:llm/fallback */
159
+ reply_source: string;
160
+ /** 回复使用的模型名称 */
161
+ model: string;
162
+ /** 是否为降级回复 */
163
+ fallback: boolean;
164
+ /** 降级原因 */
165
+ fallback_reason: string;
166
+ /** 流程标识 */
167
+ flow: string;
168
+ /** 流程步骤 */
169
+ step: string;
170
+ /** 移动端结构化内容JSON */
171
+ blocks_json: string;
172
+ }
173
+
174
+ /** AI 助手 Token 统计 */
175
+ export interface AiToken {
176
+ /** 输入 Token 数 */
177
+ input: number;
178
+ /** 输出 Token 数 */
179
+ output: number;
180
+ /** 缓存 Token 数 */
181
+ cache: number;
182
+ /** 总 Token 数 */
183
+ total: number;
184
+ }
185
+
186
+ /** AI 助手附件 */
187
+ export interface AiAttachment {
188
+ /** 附件ID */
189
+ id: string;
190
+ /** 附件名称 */
191
+ name: string;
192
+ /** 附件大小 */
193
+ size: number;
194
+ /** 附件地址 */
195
+ url: string;
196
+ /** 附件 MIME 类型 */
197
+ mime_type: string;
198
+ }
199
+
200
+ /** Base AI 助手会话服务 */
201
+ export interface AiSessionService {
202
+ /** 查询 AI 助手消息列表 */
203
+ ListAiMessage(request: ListAiMessageRequest): Promise<ListAiMessageResponse>;
204
+ /** 查询 AI 助手会话列表 */
205
+ ListAiSession(request: ListAiSessionRequest): Promise<ListAiSessionResponse>;
206
+ /** 创建 AI 助手会话 */
207
+ CreateAiSession(request: CreateAiSessionRequest): Promise<CreateAiSessionResponse>;
208
+ /** 从指定消息创建 AI 助手分支会话 */
209
+ CreateAiSessionBranch(request: CreateAiSessionBranchRequest): Promise<CreateAiSessionBranchResponse>;
210
+ /** 更新 AI 助手会话 */
211
+ UpdateAiSession(request: UpdateAiSessionRequest): Promise<UpdateAiSessionResponse>;
212
+ /** 删除 AI 助手会话 */
213
+ DeleteAiSession(request: DeleteAiSessionRequest): Promise<DeleteAiSessionResponse>;
214
+ }
@@ -0,0 +1,74 @@
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_tool.proto
6
+
7
+ /* eslint-disable */
8
+ import type { Terminal } from "../../common/v1/enum";
9
+
10
+ /** AI 助手快捷入口列表查询条件 */
11
+ export interface ListAiShortcutRequest {
12
+ /** 终端类型:枚举【Terminal】 */
13
+ terminal: Terminal;
14
+ }
15
+
16
+ /** AI 助手快捷入口列表响应 */
17
+ export interface ListAiShortcutResponse {
18
+ /** 快捷入口列表 */
19
+ shortcuts: AiShortcut[];
20
+ }
21
+
22
+ /** AI 助手快捷入口 */
23
+ export interface AiShortcut {
24
+ /** 快捷入口标识 */
25
+ key: string;
26
+ /** 展示标题 */
27
+ title: string;
28
+ /** 发送给助手的提示词 */
29
+ prompt: string;
30
+ /** 快捷入口动作 */
31
+ action:
32
+ | AiShortcutAction
33
+ | undefined;
34
+ /** 依赖工具列表 */
35
+ required_tools: string[];
36
+ /** 排序值 */
37
+ sort: number;
38
+ /** 分组名称 */
39
+ group: string;
40
+ }
41
+
42
+ /** AI 助手快捷入口动作 */
43
+ export interface AiShortcutAction {
44
+ /** 流程标识 */
45
+ flow: string;
46
+ /** 流程步骤 */
47
+ step: string;
48
+ /** 动作类型 */
49
+ type: string;
50
+ /** 动作负载JSON */
51
+ payload_json: string;
52
+ }
53
+
54
+ /** AI 助手工具调用记录 */
55
+ export interface AiToolCall {
56
+ /** 工具类型:function/server */
57
+ type: string;
58
+ /** 工具名称 */
59
+ name: string;
60
+ /** 工具展示名称 */
61
+ title: string;
62
+ /** 工具调用状态 */
63
+ status: string;
64
+ /** 工具原始入参JSON */
65
+ input: string;
66
+ /** 工具原始出参JSON */
67
+ output: string;
68
+ }
69
+
70
+ /** Base AI 助手工具服务 */
71
+ export interface AiToolService {
72
+ /** 查询 AI 助手快捷入口列表 */
73
+ ListAiShortcut(request: ListAiShortcutRequest): Promise<ListAiShortcutResponse>;
74
+ }
@@ -0,0 +1,71 @@
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: common/v1/enum.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ /** 状态 */
10
+ export enum Status {
11
+ UNKNOWN = 0,
12
+ /** ENABLE - 启用 */
13
+ ENABLE = 1,
14
+ /** DISABLE - 禁用 */
15
+ DISABLE = 2,
16
+ }
17
+
18
+ /** 系统配置位置 */
19
+ export enum BaseConfigSite {
20
+ UNKNOWN_BCS = 0,
21
+ /** SYSTEM - 系统内使用 */
22
+ SYSTEM = 1,
23
+ /** ADMIN - 管理端 */
24
+ ADMIN = 2,
25
+ /** APP - 移动端 */
26
+ APP = 3,
27
+ }
28
+
29
+ /** 密码加密场景枚举 */
30
+ export enum PasswordCryptoScene {
31
+ /** UNKNOWN_PCS - 未指定密码加密场景 */
32
+ UNKNOWN_PCS = 0,
33
+ /** LOGIN - 登录密码加密场景 */
34
+ LOGIN = 1,
35
+ /** CREATE_BASE_USER - 新增后台用户密码加密场景 */
36
+ CREATE_BASE_USER = 2,
37
+ /** RESET_BASE_USER_PASSWORD - 重置后台用户密码加密场景 */
38
+ RESET_BASE_USER_PASSWORD = 3,
39
+ /** UPDATE_USER_PASSWORD - 个人修改密码加密场景 */
40
+ UPDATE_USER_PASSWORD = 4,
41
+ }
42
+
43
+ /** AI 助手消息状态 */
44
+ export enum AiMessageStatus {
45
+ /** UNKNOWN_AAMS - 未知AI助手消息状态 */
46
+ UNKNOWN_AAMS = 0,
47
+ /** GENERATING_AAMS - 生成中 */
48
+ GENERATING_AAMS = 1,
49
+ /** SUCCESS_AAMS - 成功 */
50
+ SUCCESS_AAMS = 2,
51
+ /** FAILED_AAMS - 失败 */
52
+ FAILED_AAMS = 3,
53
+ }
54
+
55
+ /** 支付通知资源类型 */
56
+ export enum ResourceType {
57
+ /** TRANSACTION - 支付 */
58
+ TRANSACTION = 0,
59
+ /** REFUND - 退款 */
60
+ REFUND = 1,
61
+ }
62
+
63
+ /** 终端类型 */
64
+ export enum Terminal {
65
+ /** TERMINAL_UNSPECIFIED - 未知终端 */
66
+ TERMINAL_UNSPECIFIED = 0,
67
+ /** TERMINAL_APP - 移动端 */
68
+ TERMINAL_APP = 1,
69
+ /** TERMINAL_ADMIN - 管理端 */
70
+ TERMINAL_ADMIN = 2,
71
+ }
@@ -0,0 +1,115 @@
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: google/protobuf/timestamp.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ /**
10
+ * A Timestamp represents a point in time independent of any time zone or local
11
+ * calendar, encoded as a count of seconds and fractions of seconds at
12
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
13
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
14
+ * Gregorian calendar backwards to year one.
15
+ *
16
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
17
+ * second table is needed for interpretation, using a [24-hour linear
18
+ * smear](https://developers.google.com/time/smear).
19
+ *
20
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
21
+ * restricting to that range, we ensure that we can convert to and from [RFC
22
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
23
+ *
24
+ * # Examples
25
+ *
26
+ * Example 1: Compute Timestamp from POSIX `time()`.
27
+ *
28
+ * Timestamp timestamp;
29
+ * timestamp.set_seconds(time(NULL));
30
+ * timestamp.set_nanos(0);
31
+ *
32
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
33
+ *
34
+ * struct timeval tv;
35
+ * gettimeofday(&tv, NULL);
36
+ *
37
+ * Timestamp timestamp;
38
+ * timestamp.set_seconds(tv.tv_sec);
39
+ * timestamp.set_nanos(tv.tv_usec * 1000);
40
+ *
41
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
42
+ *
43
+ * FILETIME ft;
44
+ * GetSystemTimeAsFileTime(&ft);
45
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
46
+ *
47
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
48
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
49
+ * Timestamp timestamp;
50
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
51
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
52
+ *
53
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
54
+ *
55
+ * long millis = System.currentTimeMillis();
56
+ *
57
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
58
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
59
+ *
60
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
61
+ *
62
+ * Instant now = Instant.now();
63
+ *
64
+ * Timestamp timestamp =
65
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
66
+ * .setNanos(now.getNano()).build();
67
+ *
68
+ * Example 6: Compute Timestamp from current time in Python.
69
+ *
70
+ * timestamp = Timestamp()
71
+ * timestamp.GetCurrentTime()
72
+ *
73
+ * # JSON Mapping
74
+ *
75
+ * In JSON format, the Timestamp type is encoded as a string in the
76
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
77
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
78
+ * where {year} is always expressed using four digits while {month}, {day},
79
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
80
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
81
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
82
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
83
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
84
+ * able to accept both UTC and other timezones (as indicated by an offset).
85
+ *
86
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
87
+ * 01:30 UTC on January 15, 2017.
88
+ *
89
+ * In JavaScript, one can convert a Date object to this format using the
90
+ * standard
91
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
92
+ * method. In Python, a standard `datetime.datetime` object can be converted
93
+ * to this format using
94
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
95
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
96
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
97
+ * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
98
+ * ) to obtain a formatter capable of generating timestamps in this format.
99
+ */
100
+ export interface Timestamp {
101
+ /**
102
+ * Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
103
+ * be between -315576000000 and 315576000000 inclusive (which corresponds to
104
+ * 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
105
+ */
106
+ seconds: number;
107
+ /**
108
+ * Non-negative fractions of a second at nanosecond resolution. This field is
109
+ * the nanosecond portion of the duration, not an alternative to seconds.
110
+ * Negative second values with fractions must still have non-negative nanos
111
+ * values that count forward in time. Must be between 0 and 999,999,999
112
+ * inclusive.
113
+ */
114
+ nanos: number;
115
+ }