@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 WikiLinkSchema=e.object({targetPageId:e.string(),relation:e.enum(["reference","parent","child","related"])});export const WikiPageSchema=e.object({id:e.string(),title:e.string(),path:e.string(),type:e.enum(["entity","concept","general"]),content:e.string(),tags:e.array(e.string()),links:e.array(WikiLinkSchema),lastModified:e.string()});export const WikiEntityRelationSchema=e.object({targetEntityId:e.string(),relationType:e.string(),properties:e.record(e.any()).optional()});export const WikiEntitySchema=e.object({id:e.string(),name:e.string(),type:e.string(),properties:e.record(e.any()),relations:e.array(WikiEntityRelationSchema)});export const WikiConceptSchema=e.object({id:e.string(),name:e.string(),definition:e.string(),examples:e.array(e.string()),relatedEntities:e.array(e.string()),relatedConcepts:e.array(e.string())});export const WikiConfigSchema=e.object({id:e.string(),name:e.string(),description:e.string(),type:e.enum(["industry","domain","project"]),schemaPath:e.string(),pages:e.array(WikiPageSchema),entities:e.array(WikiEntitySchema),concepts:e.array(WikiConceptSchema)});export const WikiImportConfigSchema=e.object({source:e.enum(["file","url"]),format:e.enum(["pdf","word","markdown","json"]),path:e.string(),autoParse:e.boolean(),targetWikiId:e.string()});export const WikiExportConfigSchema=e.object({format:e.enum(["markdown","json","html"]),includeSchema:e.boolean(),includeLinks:e.boolean(),outputPath:e.string()});export const WikiIndexEntrySchema=e.object({pageId:e.string(),pageTitle:e.string(),pageType:e.enum(["entity","concept","general"]),keywords:e.array(e.string()),entities:e.array(e.string()),concepts:e.array(e.string()),lastIndexed:e.string(),contentHash:e.string(),embeddingVector:e.array(e.number()).optional(),relevanceScore:e.number().optional()});export const WikiIndexConfigSchema=e.object({wikiId:e.string(),indexType:e.enum(["keyword","vector","hybrid"]),entries:e.array(WikiIndexEntrySchema),totalEntries:e.number(),lastFullIndex:e.string(),indexVersion:e.string(),embeddingModel:e.string().optional(),embeddingDimension:e.number().optional()});export const KnowledgeGraphNodeSchema=e.object({id:e.string(),type:e.enum(["entity","concept","page","external"]),name:e.string(),label:e.string(),properties:e.record(e.any()),pageId:e.string().optional()});export const KnowledgeGraphEdgeSchema=e.object({id:e.string(),sourceNodeId:e.string(),targetNodeId:e.string(),relationType:e.string(),properties:e.record(e.any()).optional(),weight:e.number().default(1)});export const KnowledgeGraphSchema=e.object({wikiId:e.string(),nodes:e.array(KnowledgeGraphNodeSchema),edges:e.array(KnowledgeGraphEdgeSchema),nodeTypes:e.array(e.string()),relationTypes:e.array(e.string()),lastUpdated:e.string(),statistics:e.object({totalNodes:e.number(),totalEdges:e.number(),nodesByType:e.record(e.number()),edgesByRelation:e.record(e.number()),avgConnectionsPerNode:e.number()})});export const WikiQueryRequestSchema=e.object({wikiId:e.string(),queryType:e.enum(["entity","concept","full_text","semantic","hybrid","overview"]),query:e.string(),filters:e.object({pageType:e.enum(["entity","concept","general"]).optional(),tags:e.array(e.string()).optional(),dateRange:e.object({start:e.string().optional(),end:e.string().optional()}).optional()}).optional(),limit:e.number().default(10),offset:e.number().default(0),includeContent:e.boolean().default(!1),includeRelated:e.boolean().default(!1)});export const WikiQueryResultSchema=e.object({wikiId:e.string(),queryType:e.string(),query:e.string(),results:e.array(e.object({pageId:e.string(),pageTitle:e.string(),pageType:e.enum(["entity","concept","general"]),content:e.string().optional(),relevanceScore:e.number(),relatedPages:e.array(e.object({pageId:e.string(),relationType:e.string()})).optional(),metadata:e.record(e.any()).optional()})),total:e.number(),queryTime:e.number()});export const WikiMetadataSchema=e.object({id:e.string(),name:e.string(),displayName:e.string(),description:e.string(),category:e.enum(["industry","domain","project"]),wikiType:e.enum(["general","air_traffic","weather","radar","drone"]),tags:e.array(e.string()),author:e.string(),version:e.string(),createdAt:e.string(),updatedAt:e.string(),status:e.enum(["draft","published","deprecated"]),pagesCount:e.number(),entitiesCount:e.number(),conceptsCount:e.number(),indexEnabled:e.boolean().default(!1),indexType:e.enum(["keyword","vector","hybrid"]).optional()});export const WikiSearchResultSchema=e.object({pageId:e.string(),pageTitle:e.string(),pageType:e.string(),snippet:e.string(),content:e.string(),relevanceScore:e.number()});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { NativeSkillConfig } from './skill.js';
|
|
2
|
+
import type { MCPConfig } from './mcp.js';
|
|
3
|
+
import type { HermesModelConfig, HermesAgentConfig } from './hermes.js';
|
|
4
|
+
export interface AgentConfig {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
type: 'main' | 'sub';
|
|
9
|
+
skills: NativeSkillConfig[];
|
|
10
|
+
mcps: MCPConfig[];
|
|
11
|
+
modelConfig?: HermesModelConfig;
|
|
12
|
+
agentConfig?: HermesAgentConfig;
|
|
13
|
+
triggers?: AgentTrigger[];
|
|
14
|
+
outputs?: AgentOutputConfig[];
|
|
15
|
+
}
|
|
16
|
+
export interface AgentTrigger {
|
|
17
|
+
type: 'event' | 'message' | 'schedule' | 'condition';
|
|
18
|
+
source: string;
|
|
19
|
+
condition?: string;
|
|
20
|
+
targetAgentId?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface AgentOutputConfig {
|
|
23
|
+
type: 'websocket' | 'api' | 'skill';
|
|
24
|
+
destination: string;
|
|
25
|
+
format: 'text' | 'json' | 'cesium_command';
|
|
26
|
+
}
|
|
27
|
+
export interface AgentOrchestrationConfig {
|
|
28
|
+
mainAgent: AgentConfig;
|
|
29
|
+
subAgents: AgentConfig[];
|
|
30
|
+
triggers: OrchestrationTrigger[];
|
|
31
|
+
routing: MessageRoutingConfig[];
|
|
32
|
+
}
|
|
33
|
+
export interface OrchestrationTrigger {
|
|
34
|
+
id: string;
|
|
35
|
+
sourceAgentId: string;
|
|
36
|
+
targetAgentId: string;
|
|
37
|
+
eventType: string;
|
|
38
|
+
condition?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface MessageRoutingConfig {
|
|
41
|
+
fromAgentId: string;
|
|
42
|
+
toAgentId: string;
|
|
43
|
+
messageType: string;
|
|
44
|
+
transform?: string;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 聊天框 `@文件` 引用类型。
|
|
3
|
+
*
|
|
4
|
+
* 与「@子智能体」「@工作流」并列的第三类 @ 提及:把实例可见的文件 / 知识库页面
|
|
5
|
+
* 作为上下文带进对话。两个来源:
|
|
6
|
+
* - `data`:实例容器 data 目录(INSTANCE_DATA_FILES_ROOT,部署态挂载 ./data:/app/data)下的文档文件。
|
|
7
|
+
* - `wiki`:知识库页面(经 wiki 服务列举)。
|
|
8
|
+
*/
|
|
9
|
+
export type AtFileSource = 'data' | 'wiki';
|
|
10
|
+
/** `@` 菜单候选项 / `GET /api/at-files` 列举结果的单项。 */
|
|
11
|
+
export interface AtFileItem {
|
|
12
|
+
/** 稳定唯一 id(前端列表 key 与去重用)。 */
|
|
13
|
+
id: string;
|
|
14
|
+
/** 展示名(文件名或 wiki 页面标题)。 */
|
|
15
|
+
name: string;
|
|
16
|
+
/** 来源:data=实例 data 目录文件;wiki=知识库页面。 */
|
|
17
|
+
source: AtFileSource;
|
|
18
|
+
/** data 源:相对 data 根的 POSIX 路径。 */
|
|
19
|
+
path?: string;
|
|
20
|
+
/** wiki 源:知识库 id。 */
|
|
21
|
+
wikiId?: string;
|
|
22
|
+
/** wiki 源:页面 id。 */
|
|
23
|
+
pageId?: string;
|
|
24
|
+
/** 字节大小(data 源)。 */
|
|
25
|
+
size?: number;
|
|
26
|
+
/** 可选简述(wiki 摘要 / 目录路径等)。 */
|
|
27
|
+
description?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 发送聊天时随请求下行的 `@文件` 引用 —— 后端据此读取内容、截断后作为证据上下文注入本轮。
|
|
31
|
+
*/
|
|
32
|
+
export interface AtFileRef {
|
|
33
|
+
source: AtFileSource;
|
|
34
|
+
/** data 源:相对 data 根的路径。 */
|
|
35
|
+
path?: string;
|
|
36
|
+
/** wiki 源:知识库 id。 */
|
|
37
|
+
wikiId?: string;
|
|
38
|
+
/** wiki 源:页面 id。 */
|
|
39
|
+
pageId?: string;
|
|
40
|
+
/** 展示名(用于注入标题与日志)。 */
|
|
41
|
+
name?: string;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export interface CesiumCommand {
|
|
2
|
+
type: CesiumCommandType;
|
|
3
|
+
id?: string;
|
|
4
|
+
timestamp?: string;
|
|
5
|
+
parameters?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export type CesiumCommandType = 'add_marker' | 'add_billboard' | 'add_camera' | 'batch_add_entities' | 'remove_marker' | 'update_marker' | 'update_camera' | 'draw_trajectory' | 'remove_trajectory' | 'draw_region' | 'remove_region' | 'highlight_region' | 'set_view' | 'fly_to' | 'set_basemap' | 'clear_all' | 'add_layer' | 'remove_layer' | 'animate' | 'load_3dtiles' | 'load_3dtiles_city' | 'add_model' | 'remove_model' | 'replace_city_model_in_polygon' | 'lac_compute_polyline_3d' | 'lac_render_grid_cells' | 'lac_render_grid_tiles' | 'lac_render_route_polyline' | 'lac_render_route_protection_zone' | 'lac_render_start_end_point' | 'lac_set_layer_visible' | 'lac_remove_start_end_point' | 'lac_remove_layer';
|
|
8
|
+
export interface CesiumMarker {
|
|
9
|
+
id: string;
|
|
10
|
+
position: CesiumPosition;
|
|
11
|
+
label?: string;
|
|
12
|
+
icon?: string;
|
|
13
|
+
color?: string;
|
|
14
|
+
scale?: number;
|
|
15
|
+
description?: string;
|
|
16
|
+
properties?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface CesiumBillboard {
|
|
19
|
+
id: string;
|
|
20
|
+
position: CesiumPosition;
|
|
21
|
+
label?: string;
|
|
22
|
+
image?: string;
|
|
23
|
+
color?: string;
|
|
24
|
+
scale?: number;
|
|
25
|
+
width?: number;
|
|
26
|
+
heightPx?: number;
|
|
27
|
+
properties?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
export interface CesiumCamera {
|
|
30
|
+
id: string;
|
|
31
|
+
position: CesiumPosition;
|
|
32
|
+
name?: string;
|
|
33
|
+
label?: string;
|
|
34
|
+
title?: string;
|
|
35
|
+
image?: string;
|
|
36
|
+
panelImage?: string;
|
|
37
|
+
panelDescription?: string;
|
|
38
|
+
panelWidth?: number;
|
|
39
|
+
panelHeight?: number;
|
|
40
|
+
panelBackgroundColor?: string;
|
|
41
|
+
panelBorderColor?: string;
|
|
42
|
+
panelTitleColor?: string;
|
|
43
|
+
panelTextColor?: string;
|
|
44
|
+
color?: string;
|
|
45
|
+
scale?: number;
|
|
46
|
+
width?: number;
|
|
47
|
+
heightPx?: number;
|
|
48
|
+
heightReference?: 'NONE' | 'CLAMP_TO_GROUND' | 'RELATIVE_TO_GROUND';
|
|
49
|
+
showPanel?: boolean;
|
|
50
|
+
properties?: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
export interface CesiumTrajectory {
|
|
53
|
+
id: string;
|
|
54
|
+
points: CesiumPosition[];
|
|
55
|
+
color?: string;
|
|
56
|
+
width?: number;
|
|
57
|
+
label?: string;
|
|
58
|
+
properties?: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
export interface CesiumRegion {
|
|
61
|
+
id: string;
|
|
62
|
+
points: CesiumPosition[];
|
|
63
|
+
fillColor?: string;
|
|
64
|
+
strokeColor?: string;
|
|
65
|
+
strokeWidth?: number;
|
|
66
|
+
label?: string;
|
|
67
|
+
properties?: Record<string, unknown>;
|
|
68
|
+
}
|
|
69
|
+
export interface CesiumPosition {
|
|
70
|
+
longitude: number;
|
|
71
|
+
latitude: number;
|
|
72
|
+
altitude?: number;
|
|
73
|
+
}
|
|
74
|
+
export interface CesiumView {
|
|
75
|
+
position: CesiumPosition;
|
|
76
|
+
heading?: number;
|
|
77
|
+
pitch?: number;
|
|
78
|
+
roll?: number;
|
|
79
|
+
zoom?: number;
|
|
80
|
+
}
|
|
81
|
+
export interface CesiumAnimation {
|
|
82
|
+
type: 'fly_to' | 'zoom_to' | 'rotate';
|
|
83
|
+
target: CesiumPosition | CesiumView;
|
|
84
|
+
duration?: number;
|
|
85
|
+
easing?: 'linear' | 'ease_in' | 'ease_out' | 'ease_in_out';
|
|
86
|
+
}
|
|
87
|
+
export interface CesiumLayer {
|
|
88
|
+
id: string;
|
|
89
|
+
type: 'imagery' | 'terrain' | '3dtiles' | 'vector';
|
|
90
|
+
url: string;
|
|
91
|
+
name?: string;
|
|
92
|
+
opacity?: number;
|
|
93
|
+
show?: boolean;
|
|
94
|
+
}
|
|
95
|
+
export interface CesiumControlInterface {
|
|
96
|
+
addMarker(marker: CesiumMarker): void;
|
|
97
|
+
addBillboard(billboard: CesiumBillboard): void;
|
|
98
|
+
removeMarker(id: string): void;
|
|
99
|
+
updateMarker(id: string, updates: Partial<CesiumMarker>): void;
|
|
100
|
+
drawTrajectory(trajectory: CesiumTrajectory): void;
|
|
101
|
+
removeTrajectory(id: string): void;
|
|
102
|
+
drawRegion(region: CesiumRegion): void;
|
|
103
|
+
removeRegion(id: string): void;
|
|
104
|
+
highlightRegion(id: string): void;
|
|
105
|
+
setView(view: CesiumView): void;
|
|
106
|
+
clearAll(): void;
|
|
107
|
+
addLayer(layer: CesiumLayer): void;
|
|
108
|
+
removeLayer(id: string): void;
|
|
109
|
+
animate(animation: CesiumAnimation): void;
|
|
110
|
+
}
|
|
111
|
+
export interface CesiumCommandResult {
|
|
112
|
+
success: boolean;
|
|
113
|
+
commandId: string;
|
|
114
|
+
data?: unknown;
|
|
115
|
+
error?: string;
|
|
116
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export interface HermesConfig {
|
|
2
|
+
model: HermesModelConfig;
|
|
3
|
+
agent: HermesAgentConfig;
|
|
4
|
+
terminal: HermesTerminalConfig;
|
|
5
|
+
compression: HermesCompressionConfig;
|
|
6
|
+
display: HermesDisplayConfig;
|
|
7
|
+
stt: HermesSTTConfig;
|
|
8
|
+
tts: HermesTTSConfig;
|
|
9
|
+
memory: HermesMemoryConfig;
|
|
10
|
+
security: HermesSecurityConfig;
|
|
11
|
+
delegation: HermesDelegationConfig;
|
|
12
|
+
smartRouting: HermesSmartRoutingConfig;
|
|
13
|
+
checkpoints: HermesCheckpointsConfig;
|
|
14
|
+
}
|
|
15
|
+
export interface HermesModelConfig {
|
|
16
|
+
model: string;
|
|
17
|
+
provider: 'openrouter' | 'anthropic' | 'openai' | 'local' | 'custom';
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
apiKey?: string;
|
|
20
|
+
contextLength?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface HermesAgentConfig {
|
|
23
|
+
maxTurns: number;
|
|
24
|
+
systemPrompt?: string;
|
|
25
|
+
tools?: HermesTool[];
|
|
26
|
+
}
|
|
27
|
+
export interface HermesTool {
|
|
28
|
+
name: string;
|
|
29
|
+
description: string;
|
|
30
|
+
inputSchema: HermesToolSchema;
|
|
31
|
+
}
|
|
32
|
+
export interface HermesToolSchema {
|
|
33
|
+
type: 'object';
|
|
34
|
+
properties: Record<string, HermesToolProperty>;
|
|
35
|
+
required?: string[];
|
|
36
|
+
additionalProperties?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface HermesToolProperty {
|
|
39
|
+
type: 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array';
|
|
40
|
+
description?: string;
|
|
41
|
+
enum?: string[];
|
|
42
|
+
}
|
|
43
|
+
export interface HermesTerminalConfig {
|
|
44
|
+
backend: 'local' | 'docker' | 'ssh' | 'modal';
|
|
45
|
+
cwd?: string;
|
|
46
|
+
timeout?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface HermesCompressionConfig {
|
|
49
|
+
enabled: boolean;
|
|
50
|
+
threshold: number;
|
|
51
|
+
targetRatio: number;
|
|
52
|
+
}
|
|
53
|
+
export interface HermesDisplayConfig {
|
|
54
|
+
skin?: string;
|
|
55
|
+
toolProgress?: 'minimal' | 'detailed';
|
|
56
|
+
showReasoning?: boolean;
|
|
57
|
+
showCost?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface HermesSTTConfig {
|
|
60
|
+
enabled: boolean;
|
|
61
|
+
provider?: 'local' | 'groq' | 'openai' | 'mistral';
|
|
62
|
+
language?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface HermesTTSConfig {
|
|
65
|
+
enabled?: boolean;
|
|
66
|
+
provider?: 'edge' | 'elevenlabs' | 'openai' | 'local';
|
|
67
|
+
voice?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface HermesMemoryConfig {
|
|
70
|
+
memoryEnabled: boolean;
|
|
71
|
+
userProfileEnabled: boolean;
|
|
72
|
+
provider?: string;
|
|
73
|
+
path?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface HermesSecurityConfig {
|
|
76
|
+
tirithEnabled: boolean;
|
|
77
|
+
websiteBlocklist?: string[];
|
|
78
|
+
allowedCommands?: string[];
|
|
79
|
+
}
|
|
80
|
+
export interface HermesDelegationConfig {
|
|
81
|
+
model?: string;
|
|
82
|
+
provider?: string;
|
|
83
|
+
maxIterations?: number;
|
|
84
|
+
reasoningEffort?: 'low' | 'medium' | 'high';
|
|
85
|
+
}
|
|
86
|
+
export interface HermesSmartRoutingConfig {
|
|
87
|
+
enabled: boolean;
|
|
88
|
+
cheapModel?: string;
|
|
89
|
+
cheapProvider?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface HermesCheckpointsConfig {
|
|
92
|
+
enabled: boolean;
|
|
93
|
+
maxSnapshots: number;
|
|
94
|
+
path?: string;
|
|
95
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
export interface MCPConfig {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
type: 'data_source' | 'external_service' | 'notification';
|
|
6
|
+
protocol: 'stdio' | 'http' | 'streamable_http' | 'sse';
|
|
7
|
+
endpoint?: string;
|
|
8
|
+
command?: string;
|
|
9
|
+
args?: string[];
|
|
10
|
+
env?: Record<string, string>;
|
|
11
|
+
capabilities: MCPCapability[];
|
|
12
|
+
}
|
|
13
|
+
export interface MCPCapability {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
inputSchema: MCPSchema;
|
|
17
|
+
outputSchema?: MCPSchema;
|
|
18
|
+
}
|
|
19
|
+
export interface MCPSchema {
|
|
20
|
+
type: 'object' | 'array' | 'string' | 'number' | 'boolean';
|
|
21
|
+
properties?: Record<string, MCPProperty>;
|
|
22
|
+
required?: string[];
|
|
23
|
+
items?: MCPSchema;
|
|
24
|
+
}
|
|
25
|
+
export interface MCPProperty {
|
|
26
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
27
|
+
description?: string;
|
|
28
|
+
enum?: string[];
|
|
29
|
+
default?: unknown;
|
|
30
|
+
}
|
|
31
|
+
export interface RadarMCPConfig extends MCPConfig {
|
|
32
|
+
type: 'data_source';
|
|
33
|
+
protocol: 'http' | 'streamable_http';
|
|
34
|
+
radarConfig: {
|
|
35
|
+
ipAddress: string;
|
|
36
|
+
port: number;
|
|
37
|
+
protocol: 'udp' | 'tcp';
|
|
38
|
+
dataFormat: 'json' | 'binary';
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface WeatherMCPConfig extends MCPConfig {
|
|
42
|
+
type: 'external_service';
|
|
43
|
+
protocol: 'http' | 'streamable_http';
|
|
44
|
+
weatherConfig: {
|
|
45
|
+
apiEndpoint: string;
|
|
46
|
+
apiKey: string;
|
|
47
|
+
updateInterval: number;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export type MCPTransport = 'stdio' | 'streamable_http' | 'sse';
|
|
51
|
+
export type MCPRuntimeStatus = 'draft' | 'ready' | 'connected' | 'error';
|
|
52
|
+
export type MCPParameterResolverType = 'geo_code';
|
|
53
|
+
export type GeoCodeSource = 'domestic' | 'overseas' | 'auto';
|
|
54
|
+
export type GeoCodeOutput = 'code' | 'city_code' | 'area_code';
|
|
55
|
+
export interface MCPParameterResolverConfig {
|
|
56
|
+
resolver: MCPParameterResolverType;
|
|
57
|
+
source?: GeoCodeSource;
|
|
58
|
+
output?: GeoCodeOutput;
|
|
59
|
+
fallbackToOriginal?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export type MCPToolParameterResolvers = Record<string, Record<string, MCPParameterResolverConfig>>;
|
|
62
|
+
export type MCPToolVisualizationGeometry = 'auto' | 'marker' | 'trajectory' | 'region';
|
|
63
|
+
export type MCPToolVisualizationAltitudeMode = 'source' | 'default' | 'floor';
|
|
64
|
+
export interface MCPToolVisualizationAltitudeConfig {
|
|
65
|
+
mode?: MCPToolVisualizationAltitudeMode;
|
|
66
|
+
defaultMeters?: number;
|
|
67
|
+
minMeters?: number;
|
|
68
|
+
}
|
|
69
|
+
export interface MCPToolVisualizationConfig {
|
|
70
|
+
enabled?: boolean;
|
|
71
|
+
geometry?: MCPToolVisualizationGeometry;
|
|
72
|
+
coordinatePaths?: string[];
|
|
73
|
+
wktPaths?: string[];
|
|
74
|
+
altitude?: MCPToolVisualizationAltitudeConfig;
|
|
75
|
+
clampToGround?: boolean;
|
|
76
|
+
}
|
|
77
|
+
export type MCPToolVisualizations = Record<string, MCPToolVisualizationConfig>;
|
|
78
|
+
export interface MCPDiscoveredTool {
|
|
79
|
+
mcpId: string;
|
|
80
|
+
originalName: string;
|
|
81
|
+
exposedName: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
inputSchema: {
|
|
84
|
+
type: 'object';
|
|
85
|
+
properties?: Record<string, object>;
|
|
86
|
+
required?: string[];
|
|
87
|
+
additionalProperties?: boolean;
|
|
88
|
+
};
|
|
89
|
+
outputSchema?: unknown;
|
|
90
|
+
visualization?: MCPToolVisualizationConfig;
|
|
91
|
+
enabled: boolean;
|
|
92
|
+
riskLevel: 'safe' | 'read' | 'write' | 'dangerous';
|
|
93
|
+
}
|
|
94
|
+
export interface MCPServerRuntimeConfig {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
transport: MCPTransport;
|
|
99
|
+
command?: string;
|
|
100
|
+
args?: string[];
|
|
101
|
+
cwd?: string;
|
|
102
|
+
endpoint?: string;
|
|
103
|
+
env?: Record<string, string>;
|
|
104
|
+
headers?: Record<string, string>;
|
|
105
|
+
timeoutMs: number;
|
|
106
|
+
enabled: boolean;
|
|
107
|
+
publishStatus?: MCPPublishStatus;
|
|
108
|
+
status?: MCPRuntimeStatus;
|
|
109
|
+
discoveredTools?: MCPDiscoveredTool[];
|
|
110
|
+
parameterResolvers?: MCPToolParameterResolvers;
|
|
111
|
+
toolVisualizations?: MCPToolVisualizations;
|
|
112
|
+
lastTestAt?: string;
|
|
113
|
+
lastDiscoveredAt?: string;
|
|
114
|
+
lastError?: string;
|
|
115
|
+
}
|
|
116
|
+
export interface MCPConnectionTestResult {
|
|
117
|
+
success: boolean;
|
|
118
|
+
message: string;
|
|
119
|
+
timestamp: string;
|
|
120
|
+
responseTimeMs?: number;
|
|
121
|
+
toolsCount?: number;
|
|
122
|
+
error?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface MCPToolExecutionResult {
|
|
125
|
+
mcpId: string;
|
|
126
|
+
toolName: string;
|
|
127
|
+
success: boolean;
|
|
128
|
+
data?: Record<string, unknown>;
|
|
129
|
+
error?: string;
|
|
130
|
+
executionTime: number;
|
|
131
|
+
}
|
|
132
|
+
export type MCPSourceType = 'external_mcp' | 'http_adapter';
|
|
133
|
+
export type MCPPublishStatus = 'draft' | 'published' | 'unpublished';
|
|
134
|
+
export type MCPRuntimeScope = 'capability_store' | 'profile';
|
|
135
|
+
export interface MCPPublishedEndpoints {
|
|
136
|
+
streamableHttp?: string;
|
|
137
|
+
}
|
|
138
|
+
export type HttpToolMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
139
|
+
export type HttpToolParameterLocation = 'path' | 'query' | 'header' | 'body';
|
|
140
|
+
export type HttpToolContentType = 'json' | 'form' | 'text';
|
|
141
|
+
export interface HttpToolParameterMapping {
|
|
142
|
+
location: HttpToolParameterLocation;
|
|
143
|
+
name?: string;
|
|
144
|
+
}
|
|
145
|
+
export interface HttpToolAuthConfig {
|
|
146
|
+
type: 'none' | 'bearer' | 'basic' | 'api_key';
|
|
147
|
+
token?: string;
|
|
148
|
+
username?: string;
|
|
149
|
+
password?: string;
|
|
150
|
+
headerName?: string;
|
|
151
|
+
queryName?: string;
|
|
152
|
+
}
|
|
153
|
+
export interface HttpToolRequestConfig {
|
|
154
|
+
method: HttpToolMethod;
|
|
155
|
+
url?: string;
|
|
156
|
+
baseUrl?: string;
|
|
157
|
+
path?: string;
|
|
158
|
+
headers?: Record<string, string>;
|
|
159
|
+
auth?: HttpToolAuthConfig;
|
|
160
|
+
contentType?: HttpToolContentType;
|
|
161
|
+
parameters?: Record<string, HttpToolParameterMapping>;
|
|
162
|
+
}
|
|
163
|
+
export interface HttpToolResponseConfig {
|
|
164
|
+
dataPath?: string;
|
|
165
|
+
contentType?: 'auto' | 'json' | 'text';
|
|
166
|
+
}
|
|
167
|
+
export interface HttpToolDebugResult {
|
|
168
|
+
success: boolean;
|
|
169
|
+
status?: number;
|
|
170
|
+
executionTime: number;
|
|
171
|
+
request?: {
|
|
172
|
+
method: string;
|
|
173
|
+
url: string;
|
|
174
|
+
headers: Record<string, string>;
|
|
175
|
+
body?: unknown;
|
|
176
|
+
};
|
|
177
|
+
response?: {
|
|
178
|
+
status: number;
|
|
179
|
+
headers: Record<string, string>;
|
|
180
|
+
body?: unknown;
|
|
181
|
+
};
|
|
182
|
+
error?: string;
|
|
183
|
+
testedAt: string;
|
|
184
|
+
}
|
|
185
|
+
export interface HttpToolDefinition {
|
|
186
|
+
id: string;
|
|
187
|
+
name: string;
|
|
188
|
+
description?: string;
|
|
189
|
+
enabled: boolean;
|
|
190
|
+
riskLevel: 'safe' | 'read' | 'write' | 'dangerous';
|
|
191
|
+
inputSchema: MCPDiscoveredTool['inputSchema'];
|
|
192
|
+
request: HttpToolRequestConfig;
|
|
193
|
+
response?: HttpToolResponseConfig;
|
|
194
|
+
timeoutMs?: number;
|
|
195
|
+
retry?: {
|
|
196
|
+
maxRetries?: number;
|
|
197
|
+
retryDelayMs?: number;
|
|
198
|
+
};
|
|
199
|
+
lastDebugResult?: HttpToolDebugResult;
|
|
200
|
+
createdAt: string;
|
|
201
|
+
updatedAt: string;
|
|
202
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface SkillInput {
|
|
2
|
+
name: string;
|
|
3
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
4
|
+
required: boolean;
|
|
5
|
+
description?: string;
|
|
6
|
+
defaultValue?: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface SkillOutput {
|
|
9
|
+
name: string;
|
|
10
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'cesium_command';
|
|
11
|
+
description?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface NativeSkillConfig {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
type: 'native';
|
|
18
|
+
version: string;
|
|
19
|
+
author?: string;
|
|
20
|
+
license?: string;
|
|
21
|
+
category: string;
|
|
22
|
+
directory: string;
|
|
23
|
+
platforms?: string[];
|
|
24
|
+
tags?: string[];
|
|
25
|
+
requiresToolsets?: string[];
|
|
26
|
+
requiredEnvVars?: string[];
|
|
27
|
+
hasScripts: boolean;
|
|
28
|
+
hasReferences: boolean;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CesiumCommandType } from './cesium';
|
|
2
|
+
export type SlashCommandExecuteMode = 'direct' | 'agent' | 'auto';
|
|
3
|
+
export type SlashCommandCategory = 'earth' | 'skill' | 'workflow' | 'mcp';
|
|
4
|
+
export interface SlashCommandParam {
|
|
5
|
+
name: string;
|
|
6
|
+
type: 'string' | 'number';
|
|
7
|
+
required: boolean;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SlashCommandItem {
|
|
11
|
+
command: string;
|
|
12
|
+
label: string;
|
|
13
|
+
description: string;
|
|
14
|
+
category: SlashCommandCategory;
|
|
15
|
+
executeMode?: SlashCommandExecuteMode;
|
|
16
|
+
parameters?: SlashCommandParam[];
|
|
17
|
+
cesiumCommandType?: CesiumCommandType;
|
|
18
|
+
skillId?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Hermes 工具名(如 `skill_xxx` / `mcp_server_tool`)。当存在时,选中该命令 =
|
|
21
|
+
* 「强制本轮启用该工具」:随聊天请求下行 forceToolName,后端把工具面收窄到它。
|
|
22
|
+
*/
|
|
23
|
+
toolName?: string;
|
|
24
|
+
/** MCP 来源:所属 MCP 服务器 id(category='mcp' 时填)。 */
|
|
25
|
+
mcpId?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|