@agent-earth/shared 0.0.4
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.
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -0
- package/dist/schemas/agent-system.schema.d.ts +11661 -0
- package/dist/schemas/agent-system.schema.js +1 -0
- package/dist/schemas/agent.schema.d.ts +901 -0
- package/dist/schemas/agent.schema.js +1 -0
- package/dist/schemas/cesium.schema.d.ts +517 -0
- package/dist/schemas/cesium.schema.js +1 -0
- package/dist/schemas/index.d.ts +10 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/mcp.schema.d.ts +1791 -0
- package/dist/schemas/mcp.schema.js +1 -0
- package/dist/schemas/service-config.schema.d.ts +1302 -0
- package/dist/schemas/service-config.schema.js +1 -0
- package/dist/schemas/skill.schema.d.ts +392 -0
- package/dist/schemas/skill.schema.js +1 -0
- package/dist/schemas/store.schema.d.ts +1242 -0
- package/dist/schemas/store.schema.js +1 -0
- package/dist/schemas/user.schema.d.ts +541 -0
- package/dist/schemas/user.schema.js +1 -0
- package/dist/schemas/websocket.schema.d.ts +1186 -0
- package/dist/schemas/websocket.schema.js +1 -0
- package/dist/schemas/wiki.schema.d.ts +865 -0
- package/dist/schemas/wiki.schema.js +1 -0
- package/dist/types/agent.d.ts +45 -0
- package/dist/types/agent.js +1 -0
- package/dist/types/at-file.d.ts +42 -0
- package/dist/types/at-file.js +1 -0
- package/dist/types/cesium.d.ts +116 -0
- package/dist/types/cesium.js +1 -0
- package/dist/types/hermes.d.ts +95 -0
- package/dist/types/hermes.js +1 -0
- package/dist/types/mcp.d.ts +202 -0
- package/dist/types/mcp.js +1 -0
- package/dist/types/skill.d.ts +29 -0
- package/dist/types/skill.js +1 -0
- package/dist/types/slash-command.d.ts +26 -0
- package/dist/types/slash-command.js +1 -0
- package/dist/types/websocket.d.ts +301 -0
- package/dist/types/websocket.js +1 -0
- package/dist/types/wiki.d.ts +66 -0
- package/dist/types/wiki.js +1 -0
- package/package.json +33 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"zod";export const StoreItemBaseSchema=e.object({id:e.string(),name:e.string(),description:e.string(),author:e.string(),version:e.string(),tags:e.array(e.string()),rating:e.number().min(0).max(5).default(0),downloads:e.number().default(0),createdAt:e.string(),updatedAt:e.string(),verified:e.boolean().default(!1)});export const AgentStoreItemSchema=StoreItemBaseSchema.extend({type:e.literal("agent"),category:e.enum(["industry","domain","general"]),agentConfig:e.any(),skillsIncluded:e.array(e.string()),mcpsIncluded:e.array(e.string()),wikiIncluded:e.boolean(),previewImage:e.string().optional(),demoUrl:e.string().optional()});export const SkillStoreItemSchema=StoreItemBaseSchema.extend({type:e.literal("skill"),category:e.enum(["business","control","query","utility"]),skillType:e.enum(["builtin","custom","generated"]),sourceUrl:e.string().optional(),skillConfig:e.any(),dependencies:e.array(e.string()).optional()});export const MCPStoreItemSchema=StoreItemBaseSchema.extend({type:e.literal("mcp"),category:e.enum(["data_source","external_service","notification","ai_service"]),protocol:e.enum(["stdio","http","streamable_http","sse"]),templateConfig:e.any(),setupGuide:e.string().optional(),authRequired:e.boolean().default(!1)});export const WikiStoreItemSchema=StoreItemBaseSchema.extend({type:e.literal("wiki"),category:e.enum(["industry","domain","project"]),wikiType:e.enum(["general","air_traffic","weather","radar","drone"]),pagesCount:e.number().default(0),entitiesCount:e.number().default(0),conceptsCount:e.number().default(0),samplePages:e.array(e.string()).optional()});export const TemplateStoreItemSchema=StoreItemBaseSchema.extend({type:e.literal("template"),category:e.enum(["full_solution","starter","demo"]),agentsIncluded:e.array(e.string()),skillsIncluded:e.array(e.string()),mcpsIncluded:e.array(e.string()),wikiIncluded:e.string().optional(),instanceConfig:e.any(),deploymentGuide:e.string().optional()});export const StoreItemSchema=e.discriminatedUnion("type",[AgentStoreItemSchema,SkillStoreItemSchema,MCPStoreItemSchema,WikiStoreItemSchema,TemplateStoreItemSchema]);export const StoreSearchParamsSchema=e.object({type:e.enum(["agent","skill","mcp","wiki","template","all"]).optional(),category:e.string().optional(),tags:e.array(e.string()).optional(),query:e.string().optional(),sortBy:e.enum(["downloads","rating","updated","created"]).optional(),sortOrder:e.enum(["asc","desc"]).optional(),limit:e.number().min(1).max(100).default(20),offset:e.number().min(0).default(0)});export const StoreSearchResultSchema=e.object({items:e.array(StoreItemSchema),total:e.number(),limit:e.number(),offset:e.number(),hasMore:e.boolean()});export const UserAssetSchema=e.object({id:e.string(),userId:e.string(),itemType:e.enum(["agent","skill","mcp","wiki","template"]),itemId:e.string(),acquiredAt:e.string(),acquisitionType:e.enum(["download","purchase","create"]),usageCount:e.number().default(0),lastUsedAt:e.string().optional(),notes:e.string().optional()});export const UserAssetsListSchema=e.object({assets:e.array(UserAssetSchema),total:e.number()});
|
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const PermissionSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
description: z.ZodString;
|
|
6
|
+
resource: z.ZodEnum<["agent", "skill", "mcp", "wiki", "template", "instance", "store", "platform", "user", "audit"]>;
|
|
7
|
+
actions: z.ZodArray<z.ZodEnum<["create", "read", "update", "delete", "execute", "export", "import", "manage", "review"]>, "many">;
|
|
8
|
+
conditions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
actions: ("read" | "create" | "update" | "delete" | "execute" | "export" | "import" | "manage" | "review")[];
|
|
14
|
+
resource: "skill" | "mcp" | "wiki" | "agent" | "store" | "template" | "instance" | "platform" | "user" | "audit";
|
|
15
|
+
conditions?: Record<string, any> | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
description: string;
|
|
20
|
+
actions: ("read" | "create" | "update" | "delete" | "execute" | "export" | "import" | "manage" | "review")[];
|
|
21
|
+
resource: "skill" | "mcp" | "wiki" | "agent" | "store" | "template" | "instance" | "platform" | "user" | "audit";
|
|
22
|
+
conditions?: Record<string, any> | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const RoleSchema: z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
description: z.ZodString;
|
|
28
|
+
type: z.ZodEnum<["system", "custom"]>;
|
|
29
|
+
permissions: z.ZodArray<z.ZodString, "many">;
|
|
30
|
+
inheritsFrom: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
31
|
+
createdAt: z.ZodString;
|
|
32
|
+
updatedAt: z.ZodString;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
id: string;
|
|
35
|
+
type: "custom" | "system";
|
|
36
|
+
name: string;
|
|
37
|
+
description: string;
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
permissions: string[];
|
|
41
|
+
inheritsFrom?: string[] | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
id: string;
|
|
44
|
+
type: "custom" | "system";
|
|
45
|
+
name: string;
|
|
46
|
+
description: string;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
permissions: string[];
|
|
50
|
+
inheritsFrom?: string[] | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const UserSchema: z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
username: z.ZodString;
|
|
55
|
+
email: z.ZodString;
|
|
56
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
57
|
+
avatarUrl: z.ZodOptional<z.ZodString>;
|
|
58
|
+
roles: z.ZodArray<z.ZodString, "many">;
|
|
59
|
+
permissions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
60
|
+
status: z.ZodEnum<["active", "inactive", "suspended", "pending"]>;
|
|
61
|
+
createdAt: z.ZodString;
|
|
62
|
+
updatedAt: z.ZodString;
|
|
63
|
+
lastLoginAt: z.ZodOptional<z.ZodString>;
|
|
64
|
+
preferences: z.ZodOptional<z.ZodObject<{
|
|
65
|
+
language: z.ZodDefault<z.ZodEnum<["zh", "en"]>>;
|
|
66
|
+
theme: z.ZodDefault<z.ZodEnum<["light", "dark", "auto"]>>;
|
|
67
|
+
timezone: z.ZodDefault<z.ZodString>;
|
|
68
|
+
editorTheme: z.ZodOptional<z.ZodString>;
|
|
69
|
+
fontSize: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
language: "zh" | "en";
|
|
72
|
+
theme: "auto" | "light" | "dark";
|
|
73
|
+
timezone: string;
|
|
74
|
+
editorTheme?: string | undefined;
|
|
75
|
+
fontSize?: number | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
language?: "zh" | "en" | undefined;
|
|
78
|
+
theme?: "auto" | "light" | "dark" | undefined;
|
|
79
|
+
timezone?: string | undefined;
|
|
80
|
+
editorTheme?: string | undefined;
|
|
81
|
+
fontSize?: number | undefined;
|
|
82
|
+
}>>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
status: "active" | "inactive" | "suspended" | "pending";
|
|
85
|
+
username: string;
|
|
86
|
+
id: string;
|
|
87
|
+
createdAt: string;
|
|
88
|
+
updatedAt: string;
|
|
89
|
+
email: string;
|
|
90
|
+
roles: string[];
|
|
91
|
+
displayName?: string | undefined;
|
|
92
|
+
permissions?: string[] | undefined;
|
|
93
|
+
avatarUrl?: string | undefined;
|
|
94
|
+
lastLoginAt?: string | undefined;
|
|
95
|
+
preferences?: {
|
|
96
|
+
language: "zh" | "en";
|
|
97
|
+
theme: "auto" | "light" | "dark";
|
|
98
|
+
timezone: string;
|
|
99
|
+
editorTheme?: string | undefined;
|
|
100
|
+
fontSize?: number | undefined;
|
|
101
|
+
} | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
status: "active" | "inactive" | "suspended" | "pending";
|
|
104
|
+
username: string;
|
|
105
|
+
id: string;
|
|
106
|
+
createdAt: string;
|
|
107
|
+
updatedAt: string;
|
|
108
|
+
email: string;
|
|
109
|
+
roles: string[];
|
|
110
|
+
displayName?: string | undefined;
|
|
111
|
+
permissions?: string[] | undefined;
|
|
112
|
+
avatarUrl?: string | undefined;
|
|
113
|
+
lastLoginAt?: string | undefined;
|
|
114
|
+
preferences?: {
|
|
115
|
+
language?: "zh" | "en" | undefined;
|
|
116
|
+
theme?: "auto" | "light" | "dark" | undefined;
|
|
117
|
+
timezone?: string | undefined;
|
|
118
|
+
editorTheme?: string | undefined;
|
|
119
|
+
fontSize?: number | undefined;
|
|
120
|
+
} | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
export declare const APIKeySchema: z.ZodObject<{
|
|
123
|
+
id: z.ZodString;
|
|
124
|
+
userId: z.ZodString;
|
|
125
|
+
name: z.ZodString;
|
|
126
|
+
key: z.ZodString;
|
|
127
|
+
prefix: z.ZodString;
|
|
128
|
+
permissions: z.ZodArray<z.ZodString, "many">;
|
|
129
|
+
expiresAt: z.ZodOptional<z.ZodString>;
|
|
130
|
+
createdAt: z.ZodString;
|
|
131
|
+
lastUsedAt: z.ZodOptional<z.ZodString>;
|
|
132
|
+
usageCount: z.ZodDefault<z.ZodNumber>;
|
|
133
|
+
rateLimit: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
status: z.ZodDefault<z.ZodEnum<["active", "expired", "revoked"]>>;
|
|
135
|
+
}, "strip", z.ZodTypeAny, {
|
|
136
|
+
status: "active" | "expired" | "revoked";
|
|
137
|
+
id: string;
|
|
138
|
+
name: string;
|
|
139
|
+
createdAt: string;
|
|
140
|
+
userId: string;
|
|
141
|
+
usageCount: number;
|
|
142
|
+
permissions: string[];
|
|
143
|
+
key: string;
|
|
144
|
+
prefix: string;
|
|
145
|
+
lastUsedAt?: string | undefined;
|
|
146
|
+
expiresAt?: string | undefined;
|
|
147
|
+
rateLimit?: number | undefined;
|
|
148
|
+
}, {
|
|
149
|
+
id: string;
|
|
150
|
+
name: string;
|
|
151
|
+
createdAt: string;
|
|
152
|
+
userId: string;
|
|
153
|
+
permissions: string[];
|
|
154
|
+
key: string;
|
|
155
|
+
prefix: string;
|
|
156
|
+
status?: "active" | "expired" | "revoked" | undefined;
|
|
157
|
+
usageCount?: number | undefined;
|
|
158
|
+
lastUsedAt?: string | undefined;
|
|
159
|
+
expiresAt?: string | undefined;
|
|
160
|
+
rateLimit?: number | undefined;
|
|
161
|
+
}>;
|
|
162
|
+
export declare const AuditLogEntrySchema: z.ZodObject<{
|
|
163
|
+
id: z.ZodString;
|
|
164
|
+
userId: z.ZodString;
|
|
165
|
+
username: z.ZodString;
|
|
166
|
+
action: z.ZodEnum<["create", "read", "update", "delete", "execute", "export", "import", "login", "logout", "access_denied"]>;
|
|
167
|
+
resource: z.ZodString;
|
|
168
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
169
|
+
resourceType: z.ZodEnum<["agent", "skill", "mcp", "wiki", "template", "instance", "store", "user", "api_key", "platform"]>;
|
|
170
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
171
|
+
ipAddress: z.ZodOptional<z.ZodString>;
|
|
172
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
173
|
+
timestamp: z.ZodString;
|
|
174
|
+
status: z.ZodEnum<["success", "failure", "denied"]>;
|
|
175
|
+
errorMessage: z.ZodOptional<z.ZodString>;
|
|
176
|
+
}, "strip", z.ZodTypeAny, {
|
|
177
|
+
status: "success" | "failure" | "denied";
|
|
178
|
+
username: string;
|
|
179
|
+
id: string;
|
|
180
|
+
timestamp: string;
|
|
181
|
+
userId: string;
|
|
182
|
+
resource: string;
|
|
183
|
+
action: "read" | "create" | "update" | "delete" | "execute" | "export" | "import" | "login" | "logout" | "access_denied";
|
|
184
|
+
resourceType: "api_key" | "skill" | "mcp" | "wiki" | "agent" | "store" | "template" | "instance" | "platform" | "user";
|
|
185
|
+
ipAddress?: string | undefined;
|
|
186
|
+
details?: Record<string, any> | undefined;
|
|
187
|
+
resourceId?: string | undefined;
|
|
188
|
+
userAgent?: string | undefined;
|
|
189
|
+
errorMessage?: string | undefined;
|
|
190
|
+
}, {
|
|
191
|
+
status: "success" | "failure" | "denied";
|
|
192
|
+
username: string;
|
|
193
|
+
id: string;
|
|
194
|
+
timestamp: string;
|
|
195
|
+
userId: string;
|
|
196
|
+
resource: string;
|
|
197
|
+
action: "read" | "create" | "update" | "delete" | "execute" | "export" | "import" | "login" | "logout" | "access_denied";
|
|
198
|
+
resourceType: "api_key" | "skill" | "mcp" | "wiki" | "agent" | "store" | "template" | "instance" | "platform" | "user";
|
|
199
|
+
ipAddress?: string | undefined;
|
|
200
|
+
details?: Record<string, any> | undefined;
|
|
201
|
+
resourceId?: string | undefined;
|
|
202
|
+
userAgent?: string | undefined;
|
|
203
|
+
errorMessage?: string | undefined;
|
|
204
|
+
}>;
|
|
205
|
+
export declare const AuditLogQuerySchema: z.ZodObject<{
|
|
206
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
207
|
+
action: z.ZodOptional<z.ZodString>;
|
|
208
|
+
resourceType: z.ZodOptional<z.ZodString>;
|
|
209
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
210
|
+
status: z.ZodOptional<z.ZodEnum<["success", "failure", "denied"]>>;
|
|
211
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
212
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
213
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
214
|
+
offset: z.ZodDefault<z.ZodNumber>;
|
|
215
|
+
sortBy: z.ZodDefault<z.ZodEnum<["timestamp", "userId", "action"]>>;
|
|
216
|
+
sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
limit: number;
|
|
219
|
+
offset: number;
|
|
220
|
+
sortBy: "timestamp" | "userId" | "action";
|
|
221
|
+
sortOrder: "asc" | "desc";
|
|
222
|
+
status?: "success" | "failure" | "denied" | undefined;
|
|
223
|
+
userId?: string | undefined;
|
|
224
|
+
action?: string | undefined;
|
|
225
|
+
resourceId?: string | undefined;
|
|
226
|
+
resourceType?: string | undefined;
|
|
227
|
+
startDate?: string | undefined;
|
|
228
|
+
endDate?: string | undefined;
|
|
229
|
+
}, {
|
|
230
|
+
status?: "success" | "failure" | "denied" | undefined;
|
|
231
|
+
limit?: number | undefined;
|
|
232
|
+
offset?: number | undefined;
|
|
233
|
+
userId?: string | undefined;
|
|
234
|
+
sortBy?: "timestamp" | "userId" | "action" | undefined;
|
|
235
|
+
sortOrder?: "asc" | "desc" | undefined;
|
|
236
|
+
action?: string | undefined;
|
|
237
|
+
resourceId?: string | undefined;
|
|
238
|
+
resourceType?: string | undefined;
|
|
239
|
+
startDate?: string | undefined;
|
|
240
|
+
endDate?: string | undefined;
|
|
241
|
+
}>;
|
|
242
|
+
export declare const AuditLogResultSchema: z.ZodObject<{
|
|
243
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
244
|
+
id: z.ZodString;
|
|
245
|
+
userId: z.ZodString;
|
|
246
|
+
username: z.ZodString;
|
|
247
|
+
action: z.ZodEnum<["create", "read", "update", "delete", "execute", "export", "import", "login", "logout", "access_denied"]>;
|
|
248
|
+
resource: z.ZodString;
|
|
249
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
250
|
+
resourceType: z.ZodEnum<["agent", "skill", "mcp", "wiki", "template", "instance", "store", "user", "api_key", "platform"]>;
|
|
251
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
252
|
+
ipAddress: z.ZodOptional<z.ZodString>;
|
|
253
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
254
|
+
timestamp: z.ZodString;
|
|
255
|
+
status: z.ZodEnum<["success", "failure", "denied"]>;
|
|
256
|
+
errorMessage: z.ZodOptional<z.ZodString>;
|
|
257
|
+
}, "strip", z.ZodTypeAny, {
|
|
258
|
+
status: "success" | "failure" | "denied";
|
|
259
|
+
username: string;
|
|
260
|
+
id: string;
|
|
261
|
+
timestamp: string;
|
|
262
|
+
userId: string;
|
|
263
|
+
resource: string;
|
|
264
|
+
action: "read" | "create" | "update" | "delete" | "execute" | "export" | "import" | "login" | "logout" | "access_denied";
|
|
265
|
+
resourceType: "api_key" | "skill" | "mcp" | "wiki" | "agent" | "store" | "template" | "instance" | "platform" | "user";
|
|
266
|
+
ipAddress?: string | undefined;
|
|
267
|
+
details?: Record<string, any> | undefined;
|
|
268
|
+
resourceId?: string | undefined;
|
|
269
|
+
userAgent?: string | undefined;
|
|
270
|
+
errorMessage?: string | undefined;
|
|
271
|
+
}, {
|
|
272
|
+
status: "success" | "failure" | "denied";
|
|
273
|
+
username: string;
|
|
274
|
+
id: string;
|
|
275
|
+
timestamp: string;
|
|
276
|
+
userId: string;
|
|
277
|
+
resource: string;
|
|
278
|
+
action: "read" | "create" | "update" | "delete" | "execute" | "export" | "import" | "login" | "logout" | "access_denied";
|
|
279
|
+
resourceType: "api_key" | "skill" | "mcp" | "wiki" | "agent" | "store" | "template" | "instance" | "platform" | "user";
|
|
280
|
+
ipAddress?: string | undefined;
|
|
281
|
+
details?: Record<string, any> | undefined;
|
|
282
|
+
resourceId?: string | undefined;
|
|
283
|
+
userAgent?: string | undefined;
|
|
284
|
+
errorMessage?: string | undefined;
|
|
285
|
+
}>, "many">;
|
|
286
|
+
total: z.ZodNumber;
|
|
287
|
+
limit: z.ZodNumber;
|
|
288
|
+
offset: z.ZodNumber;
|
|
289
|
+
hasMore: z.ZodBoolean;
|
|
290
|
+
}, "strip", z.ZodTypeAny, {
|
|
291
|
+
entries: {
|
|
292
|
+
status: "success" | "failure" | "denied";
|
|
293
|
+
username: string;
|
|
294
|
+
id: string;
|
|
295
|
+
timestamp: string;
|
|
296
|
+
userId: string;
|
|
297
|
+
resource: string;
|
|
298
|
+
action: "read" | "create" | "update" | "delete" | "execute" | "export" | "import" | "login" | "logout" | "access_denied";
|
|
299
|
+
resourceType: "api_key" | "skill" | "mcp" | "wiki" | "agent" | "store" | "template" | "instance" | "platform" | "user";
|
|
300
|
+
ipAddress?: string | undefined;
|
|
301
|
+
details?: Record<string, any> | undefined;
|
|
302
|
+
resourceId?: string | undefined;
|
|
303
|
+
userAgent?: string | undefined;
|
|
304
|
+
errorMessage?: string | undefined;
|
|
305
|
+
}[];
|
|
306
|
+
limit: number;
|
|
307
|
+
offset: number;
|
|
308
|
+
total: number;
|
|
309
|
+
hasMore: boolean;
|
|
310
|
+
}, {
|
|
311
|
+
entries: {
|
|
312
|
+
status: "success" | "failure" | "denied";
|
|
313
|
+
username: string;
|
|
314
|
+
id: string;
|
|
315
|
+
timestamp: string;
|
|
316
|
+
userId: string;
|
|
317
|
+
resource: string;
|
|
318
|
+
action: "read" | "create" | "update" | "delete" | "execute" | "export" | "import" | "login" | "logout" | "access_denied";
|
|
319
|
+
resourceType: "api_key" | "skill" | "mcp" | "wiki" | "agent" | "store" | "template" | "instance" | "platform" | "user";
|
|
320
|
+
ipAddress?: string | undefined;
|
|
321
|
+
details?: Record<string, any> | undefined;
|
|
322
|
+
resourceId?: string | undefined;
|
|
323
|
+
userAgent?: string | undefined;
|
|
324
|
+
errorMessage?: string | undefined;
|
|
325
|
+
}[];
|
|
326
|
+
limit: number;
|
|
327
|
+
offset: number;
|
|
328
|
+
total: number;
|
|
329
|
+
hasMore: boolean;
|
|
330
|
+
}>;
|
|
331
|
+
export declare const UserSessionSchema: z.ZodObject<{
|
|
332
|
+
id: z.ZodString;
|
|
333
|
+
userId: z.ZodString;
|
|
334
|
+
token: z.ZodString;
|
|
335
|
+
refreshToken: z.ZodString;
|
|
336
|
+
expiresAt: z.ZodString;
|
|
337
|
+
createdAt: z.ZodString;
|
|
338
|
+
ipAddress: z.ZodOptional<z.ZodString>;
|
|
339
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
340
|
+
status: z.ZodEnum<["active", "expired", "revoked"]>;
|
|
341
|
+
}, "strip", z.ZodTypeAny, {
|
|
342
|
+
status: "active" | "expired" | "revoked";
|
|
343
|
+
id: string;
|
|
344
|
+
createdAt: string;
|
|
345
|
+
token: string;
|
|
346
|
+
userId: string;
|
|
347
|
+
expiresAt: string;
|
|
348
|
+
refreshToken: string;
|
|
349
|
+
ipAddress?: string | undefined;
|
|
350
|
+
userAgent?: string | undefined;
|
|
351
|
+
}, {
|
|
352
|
+
status: "active" | "expired" | "revoked";
|
|
353
|
+
id: string;
|
|
354
|
+
createdAt: string;
|
|
355
|
+
token: string;
|
|
356
|
+
userId: string;
|
|
357
|
+
expiresAt: string;
|
|
358
|
+
refreshToken: string;
|
|
359
|
+
ipAddress?: string | undefined;
|
|
360
|
+
userAgent?: string | undefined;
|
|
361
|
+
}>;
|
|
362
|
+
export declare const AssetReviewSchema: z.ZodObject<{
|
|
363
|
+
id: z.ZodString;
|
|
364
|
+
assetType: z.ZodEnum<["agent", "skill", "mcp", "wiki", "template"]>;
|
|
365
|
+
assetId: z.ZodString;
|
|
366
|
+
assetName: z.ZodString;
|
|
367
|
+
submitterId: z.ZodString;
|
|
368
|
+
submitterName: z.ZodString;
|
|
369
|
+
submittedAt: z.ZodString;
|
|
370
|
+
reviewerId: z.ZodOptional<z.ZodString>;
|
|
371
|
+
reviewerName: z.ZodOptional<z.ZodString>;
|
|
372
|
+
status: z.ZodEnum<["pending", "approved", "rejected", "revision_needed"]>;
|
|
373
|
+
reviewNotes: z.ZodOptional<z.ZodString>;
|
|
374
|
+
reviewedAt: z.ZodOptional<z.ZodString>;
|
|
375
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
376
|
+
field: z.ZodString;
|
|
377
|
+
issue: z.ZodString;
|
|
378
|
+
severity: z.ZodEnum<["critical", "major", "minor"]>;
|
|
379
|
+
}, "strip", z.ZodTypeAny, {
|
|
380
|
+
field: string;
|
|
381
|
+
issue: string;
|
|
382
|
+
severity: "critical" | "major" | "minor";
|
|
383
|
+
}, {
|
|
384
|
+
field: string;
|
|
385
|
+
issue: string;
|
|
386
|
+
severity: "critical" | "major" | "minor";
|
|
387
|
+
}>, "many">>;
|
|
388
|
+
}, "strip", z.ZodTypeAny, {
|
|
389
|
+
status: "pending" | "approved" | "rejected" | "revision_needed";
|
|
390
|
+
id: string;
|
|
391
|
+
assetType: "skill" | "mcp" | "wiki" | "agent" | "template";
|
|
392
|
+
assetId: string;
|
|
393
|
+
assetName: string;
|
|
394
|
+
submitterId: string;
|
|
395
|
+
submitterName: string;
|
|
396
|
+
submittedAt: string;
|
|
397
|
+
issues?: {
|
|
398
|
+
field: string;
|
|
399
|
+
issue: string;
|
|
400
|
+
severity: "critical" | "major" | "minor";
|
|
401
|
+
}[] | undefined;
|
|
402
|
+
reviewerId?: string | undefined;
|
|
403
|
+
reviewerName?: string | undefined;
|
|
404
|
+
reviewNotes?: string | undefined;
|
|
405
|
+
reviewedAt?: string | undefined;
|
|
406
|
+
}, {
|
|
407
|
+
status: "pending" | "approved" | "rejected" | "revision_needed";
|
|
408
|
+
id: string;
|
|
409
|
+
assetType: "skill" | "mcp" | "wiki" | "agent" | "template";
|
|
410
|
+
assetId: string;
|
|
411
|
+
assetName: string;
|
|
412
|
+
submitterId: string;
|
|
413
|
+
submitterName: string;
|
|
414
|
+
submittedAt: string;
|
|
415
|
+
issues?: {
|
|
416
|
+
field: string;
|
|
417
|
+
issue: string;
|
|
418
|
+
severity: "critical" | "major" | "minor";
|
|
419
|
+
}[] | undefined;
|
|
420
|
+
reviewerId?: string | undefined;
|
|
421
|
+
reviewerName?: string | undefined;
|
|
422
|
+
reviewNotes?: string | undefined;
|
|
423
|
+
reviewedAt?: string | undefined;
|
|
424
|
+
}>;
|
|
425
|
+
export declare const AssetReviewListSchema: z.ZodObject<{
|
|
426
|
+
reviews: z.ZodArray<z.ZodObject<{
|
|
427
|
+
id: z.ZodString;
|
|
428
|
+
assetType: z.ZodEnum<["agent", "skill", "mcp", "wiki", "template"]>;
|
|
429
|
+
assetId: z.ZodString;
|
|
430
|
+
assetName: z.ZodString;
|
|
431
|
+
submitterId: z.ZodString;
|
|
432
|
+
submitterName: z.ZodString;
|
|
433
|
+
submittedAt: z.ZodString;
|
|
434
|
+
reviewerId: z.ZodOptional<z.ZodString>;
|
|
435
|
+
reviewerName: z.ZodOptional<z.ZodString>;
|
|
436
|
+
status: z.ZodEnum<["pending", "approved", "rejected", "revision_needed"]>;
|
|
437
|
+
reviewNotes: z.ZodOptional<z.ZodString>;
|
|
438
|
+
reviewedAt: z.ZodOptional<z.ZodString>;
|
|
439
|
+
issues: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
440
|
+
field: z.ZodString;
|
|
441
|
+
issue: z.ZodString;
|
|
442
|
+
severity: z.ZodEnum<["critical", "major", "minor"]>;
|
|
443
|
+
}, "strip", z.ZodTypeAny, {
|
|
444
|
+
field: string;
|
|
445
|
+
issue: string;
|
|
446
|
+
severity: "critical" | "major" | "minor";
|
|
447
|
+
}, {
|
|
448
|
+
field: string;
|
|
449
|
+
issue: string;
|
|
450
|
+
severity: "critical" | "major" | "minor";
|
|
451
|
+
}>, "many">>;
|
|
452
|
+
}, "strip", z.ZodTypeAny, {
|
|
453
|
+
status: "pending" | "approved" | "rejected" | "revision_needed";
|
|
454
|
+
id: string;
|
|
455
|
+
assetType: "skill" | "mcp" | "wiki" | "agent" | "template";
|
|
456
|
+
assetId: string;
|
|
457
|
+
assetName: string;
|
|
458
|
+
submitterId: string;
|
|
459
|
+
submitterName: string;
|
|
460
|
+
submittedAt: string;
|
|
461
|
+
issues?: {
|
|
462
|
+
field: string;
|
|
463
|
+
issue: string;
|
|
464
|
+
severity: "critical" | "major" | "minor";
|
|
465
|
+
}[] | undefined;
|
|
466
|
+
reviewerId?: string | undefined;
|
|
467
|
+
reviewerName?: string | undefined;
|
|
468
|
+
reviewNotes?: string | undefined;
|
|
469
|
+
reviewedAt?: string | undefined;
|
|
470
|
+
}, {
|
|
471
|
+
status: "pending" | "approved" | "rejected" | "revision_needed";
|
|
472
|
+
id: string;
|
|
473
|
+
assetType: "skill" | "mcp" | "wiki" | "agent" | "template";
|
|
474
|
+
assetId: string;
|
|
475
|
+
assetName: string;
|
|
476
|
+
submitterId: string;
|
|
477
|
+
submitterName: string;
|
|
478
|
+
submittedAt: string;
|
|
479
|
+
issues?: {
|
|
480
|
+
field: string;
|
|
481
|
+
issue: string;
|
|
482
|
+
severity: "critical" | "major" | "minor";
|
|
483
|
+
}[] | undefined;
|
|
484
|
+
reviewerId?: string | undefined;
|
|
485
|
+
reviewerName?: string | undefined;
|
|
486
|
+
reviewNotes?: string | undefined;
|
|
487
|
+
reviewedAt?: string | undefined;
|
|
488
|
+
}>, "many">;
|
|
489
|
+
total: z.ZodNumber;
|
|
490
|
+
pendingCount: z.ZodNumber;
|
|
491
|
+
approvedCount: z.ZodNumber;
|
|
492
|
+
rejectedCount: z.ZodNumber;
|
|
493
|
+
}, "strip", z.ZodTypeAny, {
|
|
494
|
+
total: number;
|
|
495
|
+
reviews: {
|
|
496
|
+
status: "pending" | "approved" | "rejected" | "revision_needed";
|
|
497
|
+
id: string;
|
|
498
|
+
assetType: "skill" | "mcp" | "wiki" | "agent" | "template";
|
|
499
|
+
assetId: string;
|
|
500
|
+
assetName: string;
|
|
501
|
+
submitterId: string;
|
|
502
|
+
submitterName: string;
|
|
503
|
+
submittedAt: string;
|
|
504
|
+
issues?: {
|
|
505
|
+
field: string;
|
|
506
|
+
issue: string;
|
|
507
|
+
severity: "critical" | "major" | "minor";
|
|
508
|
+
}[] | undefined;
|
|
509
|
+
reviewerId?: string | undefined;
|
|
510
|
+
reviewerName?: string | undefined;
|
|
511
|
+
reviewNotes?: string | undefined;
|
|
512
|
+
reviewedAt?: string | undefined;
|
|
513
|
+
}[];
|
|
514
|
+
pendingCount: number;
|
|
515
|
+
approvedCount: number;
|
|
516
|
+
rejectedCount: number;
|
|
517
|
+
}, {
|
|
518
|
+
total: number;
|
|
519
|
+
reviews: {
|
|
520
|
+
status: "pending" | "approved" | "rejected" | "revision_needed";
|
|
521
|
+
id: string;
|
|
522
|
+
assetType: "skill" | "mcp" | "wiki" | "agent" | "template";
|
|
523
|
+
assetId: string;
|
|
524
|
+
assetName: string;
|
|
525
|
+
submitterId: string;
|
|
526
|
+
submitterName: string;
|
|
527
|
+
submittedAt: string;
|
|
528
|
+
issues?: {
|
|
529
|
+
field: string;
|
|
530
|
+
issue: string;
|
|
531
|
+
severity: "critical" | "major" | "minor";
|
|
532
|
+
}[] | undefined;
|
|
533
|
+
reviewerId?: string | undefined;
|
|
534
|
+
reviewerName?: string | undefined;
|
|
535
|
+
reviewNotes?: string | undefined;
|
|
536
|
+
reviewedAt?: string | undefined;
|
|
537
|
+
}[];
|
|
538
|
+
pendingCount: number;
|
|
539
|
+
approvedCount: number;
|
|
540
|
+
rejectedCount: number;
|
|
541
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"zod";export const PermissionSchema=e.object({id:e.string(),name:e.string(),description:e.string(),resource:e.enum(["agent","skill","mcp","wiki","template","instance","store","platform","user","audit"]),actions:e.array(e.enum(["create","read","update","delete","execute","export","import","manage","review"])),conditions:e.record(e.any()).optional()});export const RoleSchema=e.object({id:e.string(),name:e.string(),description:e.string(),type:e.enum(["system","custom"]),permissions:e.array(e.string()),inheritsFrom:e.array(e.string()).optional(),createdAt:e.string(),updatedAt:e.string()});export const UserSchema=e.object({id:e.string(),username:e.string(),email:e.string().email(),displayName:e.string().optional(),avatarUrl:e.string().optional(),roles:e.array(e.string()),permissions:e.array(e.string()).optional(),status:e.enum(["active","inactive","suspended","pending"]),createdAt:e.string(),updatedAt:e.string(),lastLoginAt:e.string().optional(),preferences:e.object({language:e.enum(["zh","en"]).default("zh"),theme:e.enum(["light","dark","auto"]).default("light"),timezone:e.string().default("Asia/Shanghai"),editorTheme:e.string().optional(),fontSize:e.number().optional()}).optional()});export const APIKeySchema=e.object({id:e.string(),userId:e.string(),name:e.string(),key:e.string(),prefix:e.string(),permissions:e.array(e.string()),expiresAt:e.string().optional(),createdAt:e.string(),lastUsedAt:e.string().optional(),usageCount:e.number().default(0),rateLimit:e.number().optional(),status:e.enum(["active","expired","revoked"]).default("active")});export const AuditLogEntrySchema=e.object({id:e.string(),userId:e.string(),username:e.string(),action:e.enum(["create","read","update","delete","execute","export","import","login","logout","access_denied"]),resource:e.string(),resourceId:e.string().optional(),resourceType:e.enum(["agent","skill","mcp","wiki","template","instance","store","user","api_key","platform"]),details:e.record(e.any()).optional(),ipAddress:e.string().optional(),userAgent:e.string().optional(),timestamp:e.string(),status:e.enum(["success","failure","denied"]),errorMessage:e.string().optional()});export const AuditLogQuerySchema=e.object({userId:e.string().optional(),action:e.string().optional(),resourceType:e.string().optional(),resourceId:e.string().optional(),status:e.enum(["success","failure","denied"]).optional(),startDate:e.string().optional(),endDate:e.string().optional(),limit:e.number().min(1).max(1e3).default(100),offset:e.number().min(0).default(0),sortBy:e.enum(["timestamp","userId","action"]).default("timestamp"),sortOrder:e.enum(["asc","desc"]).default("desc")});export const AuditLogResultSchema=e.object({entries:e.array(AuditLogEntrySchema),total:e.number(),limit:e.number(),offset:e.number(),hasMore:e.boolean()});export const UserSessionSchema=e.object({id:e.string(),userId:e.string(),token:e.string(),refreshToken:e.string(),expiresAt:e.string(),createdAt:e.string(),ipAddress:e.string().optional(),userAgent:e.string().optional(),status:e.enum(["active","expired","revoked"])});export const AssetReviewSchema=e.object({id:e.string(),assetType:e.enum(["agent","skill","mcp","wiki","template"]),assetId:e.string(),assetName:e.string(),submitterId:e.string(),submitterName:e.string(),submittedAt:e.string(),reviewerId:e.string().optional(),reviewerName:e.string().optional(),status:e.enum(["pending","approved","rejected","revision_needed"]),reviewNotes:e.string().optional(),reviewedAt:e.string().optional(),issues:e.array(e.object({field:e.string(),issue:e.string(),severity:e.enum(["critical","major","minor"])})).optional()});export const AssetReviewListSchema=e.object({reviews:e.array(AssetReviewSchema),total:e.number(),pendingCount:e.number(),approvedCount:e.number(),rejectedCount:e.number()});
|