brainsmatics 1.1.72 → 1.1.74
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/component/3d/aichat/LoginModal.d.ts +11 -0
- package/dist/component/3d/aichat/SkillsModal.d.ts +14 -0
- package/dist/component/3d/aichat/UserMenu.d.ts +11 -0
- package/dist/component/3d/aichat/authService.d.ts +147 -0
- package/dist/component/3d/aichat/index.d.ts +37 -7
- package/dist/{deflate-ae38f069.mjs → deflate-a0a4cea7.mjs} +1 -1
- package/dist/{deflate-f621601c.js → deflate-cd88f1bf.js} +1 -1
- package/dist/{index-1ec632c6.mjs → index-78d7ddc3.mjs} +53043 -51034
- package/dist/{index-e70246f5.js → index-c46f4822.js} +431 -424
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{lerc-682e9e0f.mjs → lerc-a3c4820e.mjs} +1 -1
- package/dist/{lerc-5b191bca.js → lerc-aac3bbe6.js} +1 -1
- package/package.json +1 -1
- package/vite.config.js +22 -1
- package/.qwen/settings.json +0 -40
- package/.qwen/settings.json.orig +0 -7
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 技能管理模态框
|
|
3
|
+
*/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { SkillInfo } from './authService';
|
|
6
|
+
interface SkillsModalProps {
|
|
7
|
+
visible: boolean;
|
|
8
|
+
skills: SkillInfo[];
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
onSkillsUpdated?: () => void;
|
|
12
|
+
}
|
|
13
|
+
declare const SkillsModal: React.FC<SkillsModalProps>;
|
|
14
|
+
export default SkillsModal;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 认证服务 - 处理登录、注登出、技能管理
|
|
3
|
+
*/
|
|
4
|
+
export interface UserInfo {
|
|
5
|
+
id: string;
|
|
6
|
+
username: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
avatar?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SkillInfo {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
version?: string;
|
|
15
|
+
created_at?: string;
|
|
16
|
+
updated_at?: string;
|
|
17
|
+
status?: 'active' | 'inactive';
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
export interface SkillEditRequest {
|
|
21
|
+
skill_md_content: string;
|
|
22
|
+
version?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SkillMetadataValidationError {
|
|
26
|
+
field: string;
|
|
27
|
+
error: string;
|
|
28
|
+
}
|
|
29
|
+
export interface SkillMetadataValidationResponse {
|
|
30
|
+
success: boolean;
|
|
31
|
+
message: string;
|
|
32
|
+
metadata: Record<string, unknown> | null;
|
|
33
|
+
errors: SkillMetadataValidationError[];
|
|
34
|
+
}
|
|
35
|
+
export interface SkillNameConflict {
|
|
36
|
+
type: 'builtin' | 'user_skill' | string;
|
|
37
|
+
reason: string;
|
|
38
|
+
name?: string | null;
|
|
39
|
+
}
|
|
40
|
+
export interface SkillNameCheckResponse {
|
|
41
|
+
success: boolean;
|
|
42
|
+
message: string;
|
|
43
|
+
available: boolean;
|
|
44
|
+
original_name: string;
|
|
45
|
+
sanitized_name: string;
|
|
46
|
+
conflicts: SkillNameConflict[];
|
|
47
|
+
}
|
|
48
|
+
export interface SkillDraftResponse {
|
|
49
|
+
success: boolean;
|
|
50
|
+
message: string;
|
|
51
|
+
has_draft: boolean;
|
|
52
|
+
draft_id?: string | null;
|
|
53
|
+
skill_name?: string | null;
|
|
54
|
+
skill_md_content?: string | null;
|
|
55
|
+
version?: string | null;
|
|
56
|
+
description?: string | null;
|
|
57
|
+
saved_at?: string | null;
|
|
58
|
+
saved_seconds_ago?: number | null;
|
|
59
|
+
}
|
|
60
|
+
export interface SkillDetailResponse {
|
|
61
|
+
name: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
version?: string;
|
|
64
|
+
skill_md_content: string;
|
|
65
|
+
tags?: string[];
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* 检查登录状态
|
|
70
|
+
*/
|
|
71
|
+
export declare function checkAuthStatus(): Promise<UserInfo | null>;
|
|
72
|
+
/**
|
|
73
|
+
* 登录
|
|
74
|
+
*/
|
|
75
|
+
export declare function login(email: string, password: string): Promise<UserInfo | null>;
|
|
76
|
+
/**
|
|
77
|
+
* 登出
|
|
78
|
+
*/
|
|
79
|
+
export declare function logout(): Promise<boolean>;
|
|
80
|
+
/**
|
|
81
|
+
* 获取所有技能列表
|
|
82
|
+
*/
|
|
83
|
+
export declare function getSkillList(): Promise<SkillInfo[]>;
|
|
84
|
+
/**
|
|
85
|
+
* 获取用于 @ 提示的技能列表:
|
|
86
|
+
* 1) 优先用户私有技能(/api/skills)
|
|
87
|
+
* 2) 若为空则回退到全量工具 schema(/api/skills/schemas/tools)
|
|
88
|
+
*/
|
|
89
|
+
export declare function getSkillSuggestionList(): Promise<SkillInfo[]>;
|
|
90
|
+
/**
|
|
91
|
+
* 获取单个技能详情
|
|
92
|
+
*/
|
|
93
|
+
export declare function getSkillDetail(skillId: string): Promise<SkillInfo | null>;
|
|
94
|
+
/**
|
|
95
|
+
* 更新技能
|
|
96
|
+
*/
|
|
97
|
+
export declare function updateSkill(skillId: string, updates: Partial<SkillInfo>): Promise<SkillInfo | null>;
|
|
98
|
+
/**
|
|
99
|
+
* 删除技能
|
|
100
|
+
*/
|
|
101
|
+
export declare function deleteSkill(skillId: string): Promise<boolean>;
|
|
102
|
+
export interface SessionInfo {
|
|
103
|
+
id: string;
|
|
104
|
+
title: string;
|
|
105
|
+
message_count: number;
|
|
106
|
+
last_message: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* 获取当前用户的所有会话列表
|
|
110
|
+
*/
|
|
111
|
+
export declare function getSessions(): Promise<SessionInfo[]>;
|
|
112
|
+
/**
|
|
113
|
+
* 上传技能文件
|
|
114
|
+
*/
|
|
115
|
+
export declare function uploadSkill(file: File): Promise<{
|
|
116
|
+
success: boolean;
|
|
117
|
+
skill_name?: string;
|
|
118
|
+
message?: string;
|
|
119
|
+
}>;
|
|
120
|
+
/**
|
|
121
|
+
* 技能编辑:获取 SKILL.md 详情
|
|
122
|
+
*/
|
|
123
|
+
export declare function getSkillDetailByName(name: string): Promise<SkillDetailResponse>;
|
|
124
|
+
/**
|
|
125
|
+
* 技能编辑:校验 SKILL.md front matter
|
|
126
|
+
*/
|
|
127
|
+
export declare function validateSkillMetadata(name: string, skillMdContent: string): Promise<SkillMetadataValidationResponse>;
|
|
128
|
+
/**
|
|
129
|
+
* 技能编辑:检查技能名是否冲突
|
|
130
|
+
*/
|
|
131
|
+
export declare function checkSkillName(name: string): Promise<SkillNameCheckResponse>;
|
|
132
|
+
/**
|
|
133
|
+
* 技能编辑:保存草稿
|
|
134
|
+
*/
|
|
135
|
+
export declare function saveSkillDraft(name: string, payload: SkillEditRequest): Promise<SkillDraftResponse>;
|
|
136
|
+
/**
|
|
137
|
+
* 技能编辑:读取草稿
|
|
138
|
+
*/
|
|
139
|
+
export declare function getSkillDraft(name: string): Promise<SkillDraftResponse>;
|
|
140
|
+
/**
|
|
141
|
+
* 技能编辑:删除草稿
|
|
142
|
+
*/
|
|
143
|
+
export declare function deleteSkillDraft(name: string): Promise<SkillDraftResponse>;
|
|
144
|
+
/**
|
|
145
|
+
* 技能编辑:提交最终修改
|
|
146
|
+
*/
|
|
147
|
+
export declare function submitSkillEdit(name: string, payload: SkillEditRequest): Promise<SkillDetailResponse>;
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './index.module.css';
|
|
3
|
+
interface Message {
|
|
4
|
+
key: number;
|
|
5
|
+
role: 'system' | 'user' | 'assistant';
|
|
6
|
+
content: string;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
messageId?: string;
|
|
9
|
+
feedbackRating?: 'like' | 'dislike';
|
|
10
|
+
feedbackSubmitting?: boolean;
|
|
11
|
+
standardBrainRegions?: StandardBrainRegion[];
|
|
12
|
+
functionalCircuitData?: FunctionalCircuitData;
|
|
13
|
+
dataTypeButtons?: Record<string, DataTypeButton>;
|
|
14
|
+
toolCalls?: ToolCall[];
|
|
15
|
+
}
|
|
3
16
|
interface ToolCall {
|
|
4
17
|
name: string;
|
|
5
18
|
status: 'loading' | 'success' | 'error';
|
|
@@ -16,6 +29,28 @@ interface ChartConfig {
|
|
|
16
29
|
region_names?: string[];
|
|
17
30
|
sankey_data?: any;
|
|
18
31
|
}
|
|
32
|
+
interface StandardBrainRegion {
|
|
33
|
+
region_id: number;
|
|
34
|
+
name: string;
|
|
35
|
+
abbreviation: string;
|
|
36
|
+
aliases: string;
|
|
37
|
+
}
|
|
38
|
+
interface FunctionalCircuitData {
|
|
39
|
+
swc_tree?: any[];
|
|
40
|
+
Synapse?: any[];
|
|
41
|
+
ViralTracing?: any[];
|
|
42
|
+
MRI?: any[];
|
|
43
|
+
GeneExpression?: any[];
|
|
44
|
+
Electrophysiology?: any[];
|
|
45
|
+
Optogenetics?: any[];
|
|
46
|
+
}
|
|
47
|
+
interface DataTypeButton {
|
|
48
|
+
id: string;
|
|
49
|
+
title: string;
|
|
50
|
+
isLoading: boolean;
|
|
51
|
+
isActive: boolean;
|
|
52
|
+
hasData: boolean;
|
|
53
|
+
}
|
|
19
54
|
type WorkflowType = 'router' | 'linear';
|
|
20
55
|
interface LangGraphSendParams {
|
|
21
56
|
message: string;
|
|
@@ -25,16 +60,11 @@ interface LangGraphSendParams {
|
|
|
25
60
|
onStart?: () => void;
|
|
26
61
|
onText?: (delta: string) => void;
|
|
27
62
|
onTool?: (tool: ToolCall) => void;
|
|
28
|
-
onDone?: () => void;
|
|
63
|
+
onDone?: (messageId?: string) => void;
|
|
29
64
|
onError?: (error: string) => void;
|
|
30
65
|
}
|
|
31
66
|
export declare function sendLangGraphQuery(params: LangGraphSendParams): Promise<void>;
|
|
32
|
-
|
|
33
|
-
r: 'user' | 'assistant';
|
|
34
|
-
c: string;
|
|
35
|
-
toolCalls?: ToolCall[];
|
|
36
|
-
}
|
|
37
|
-
export declare function loadLangGraphHistory(sessionId: string): Promise<SessionMessage[]>;
|
|
67
|
+
export declare function loadLangGraphHistory(sessionId: string): Promise<Message[]>;
|
|
38
68
|
export declare function deleteLangGraphSession(sessionId: string): Promise<void>;
|
|
39
69
|
export declare function uploadLangGraphSkill(file: File): Promise<{
|
|
40
70
|
success: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-c46f4822.js"),t=require("./basedecoder-0503cc54.js");require("react");require("react-dom");class d extends t.BaseDecoder{decodeBlock(e){return r.inflate_1(new Uint8Array(e)).buffer}}exports.default=d;
|