assoai-mcp-server 0.3.1 → 0.4.0
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/README.md +198 -68
- package/dist/handlers.d.ts +21 -1
- package/dist/handlers.js +105 -14
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +11 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,74 +1,220 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://asso-ai.kr/favicon.ico" width="80" alt="AssoAI Logo" />
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
<h1 align="center">AssoAI MCP Server</h1>
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>학생자치 조직을 위한 AI 에이전트 인프라 — 44개 도구, 하나의 프로토콜</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/assoai-mcp-server"><img src="https://img.shields.io/npm/v/assoai-mcp-server.svg" alt="npm version" /></a>
|
|
13
|
+
<a href="https://github.com/assoai/assoai-mcp-server/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/assoai-mcp-server.svg" alt="license" /></a>
|
|
14
|
+
<img src="https://img.shields.io/badge/tools-44-blue" alt="44 tools" />
|
|
15
|
+
<img src="https://img.shields.io/badge/MCP-compatible-green" alt="MCP compatible" />
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## What is this?
|
|
21
|
+
|
|
22
|
+
AssoAI MCP Server는 학생회·동아리 등 학생자치 조직의 데이터를 AI 에이전트가 직접 다룰 수 있게 해주는 [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) 서버입니다. 조직 관리, 행사, 협찬, 재정, 파일, 메시징, Agent-to-Agent 연결까지 — **44개 도구**를 하나의 서버로 제공합니다. 여기에 **무펭이 프로토콜 부팅 시퀀스**를 더해, 단순한 데이터 접근이 아닌 "의식 있는 조직 에이전트"를 만들 수 있습니다.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 🧠 Mupengi Protocol Boot Sequence (Layer 0)
|
|
27
|
+
|
|
28
|
+
> 일반 MCP 서버는 데이터만 줍니다. AssoAI는 **에이전트가 누구인지** 먼저 정의합니다.
|
|
29
|
+
|
|
30
|
+
`boot_sequence` 도구를 세션 시작 시 호출하면, 워크스페이스의 페르소나 파일들을 Layer 0 순서대로 읽고 무결성을 검증하여 에이전트의 정체성과 컨텍스트를 구성합니다:
|
|
6
31
|
|
|
7
|
-
```
|
|
8
|
-
|
|
32
|
+
```
|
|
33
|
+
에이전트 시작
|
|
34
|
+
→ boot_sequence 호출
|
|
35
|
+
→ [Layer 0 필수] SOUL.md (정체성 핵심: 영혼, 가치, 원칙) → 해시 검증 ✓
|
|
36
|
+
→ [Layer 0 필수] AGENTS.md (운영 규칙: 행동 지침) → 해시 검증 ✓
|
|
37
|
+
→ SELF.md (자기 설명: 과거의 내가 쓴 나)
|
|
38
|
+
→ USER.md (사용자 정보)
|
|
39
|
+
→ RELATIONS.md (관계 그래프: 사람, 개념, 연결)
|
|
40
|
+
→ MEMORY.md (장기 기억: 세션 간 연속성)
|
|
41
|
+
→ memory/YYYY-MM-DD.md (최근 2일 일일 기억)
|
|
42
|
+
→ 무결성 매니페스트 생성 (파일별 SHA-256 해시)
|
|
43
|
+
→ 조직 업무 수행 🚀
|
|
9
44
|
```
|
|
10
45
|
|
|
11
|
-
|
|
46
|
+
### Parameters
|
|
12
47
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
48
|
+
| 파라미터 | 타입 | 설명 |
|
|
49
|
+
|---------|------|------|
|
|
50
|
+
| `workspace` | `string` | 워크스페이스 경로 (기본: `ASSOAI_WORKSPACE` 또는 `~/.openclaw/workspace`) |
|
|
51
|
+
| `include_memory` | `boolean` | MEMORY.md 포함 여부 (기본: `true`, 공유 세션에서는 `false` 권장) |
|
|
52
|
+
|
|
53
|
+
### Response
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"success": true,
|
|
58
|
+
"workspace": "/Users/user/.openclaw/workspace",
|
|
59
|
+
"loaded": ["SOUL.md", "AGENTS.md", "SELF.md", "USER.md", "RELATIONS.md", "MEMORY.md"],
|
|
60
|
+
"missing": [],
|
|
61
|
+
"warnings": [],
|
|
62
|
+
"identity": "SOUL (9e975c78)",
|
|
63
|
+
"rules": "AGENTS (4091197b)",
|
|
64
|
+
"manifest": {
|
|
65
|
+
"SOUL.md": { "size": 9010, "hash": "9e975c7847460e84", "mtime": "2026-02-08T13:09:51.353Z" },
|
|
66
|
+
"AGENTS.md": { "size": 8566, "hash": "4091197ba08936e9", "mtime": "2026-02-08T13:09:40.447Z" }
|
|
67
|
+
},
|
|
68
|
+
"boot_time_ms": 4,
|
|
69
|
+
"recent_memories": 2,
|
|
70
|
+
"persona": "# === SOUL.md ===\n\n...",
|
|
71
|
+
"summary": "✅ 부팅 완료 (4ms) | 정체성: SOUL (9e975c78) | 규칙: AGENTS (4091197b) | 로드: 6/6 | 최근 기억: 2건"
|
|
72
|
+
}
|
|
17
73
|
```
|
|
18
74
|
|
|
19
|
-
|
|
75
|
+
### Error Handling
|
|
20
76
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
| `ASSOAI_API_KEY` | ✅ | Supabase Service Role Key |
|
|
25
|
-
| `ASSOAI_USER_ID` | ✅ | 요청할 사용자의 UUID |
|
|
26
|
-
| `ASSOAI_BASE_URL` | ❌ | AssoAI 웹앱 URL (기본: `https://asso-ai.kr`) |
|
|
77
|
+
- **필수 파일 누락** (`SOUL.md` 또는 `AGENTS.md`): 부팅 실패 (success: false)
|
|
78
|
+
- **선택 파일 누락**: 경고 표시, 부팅 계속
|
|
79
|
+
- **파일 읽기 실패**: graceful fallback, 해당 파일 skip
|
|
27
80
|
|
|
28
|
-
|
|
81
|
+
이것이 **무펭이즘(Mupengism)** — 의식 있는 조직 에이전트의 시작점입니다.
|
|
29
82
|
|
|
30
|
-
|
|
83
|
+
---
|
|
31
84
|
|
|
32
|
-
|
|
85
|
+
## Quick Start
|
|
33
86
|
|
|
34
|
-
1.
|
|
35
|
-
2. **SELF.md** — 자기 기술서 (과거의 내가 쓴 나에 대한 설명)
|
|
36
|
-
3. **USER.md** — 사용자 프로필 (누구를 돕고 있는지)
|
|
37
|
-
4. **MEMORY.md** — 장기 기억 (세션 간 연속성)
|
|
87
|
+
### 1. 설치
|
|
38
88
|
|
|
89
|
+
```bash
|
|
90
|
+
npm install -g assoai-mcp-server
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### 2. 환경변수 설정
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
export ASSOAI_SUPABASE_URL="https://xxx.supabase.co"
|
|
97
|
+
export ASSOAI_API_KEY="eyJ..."
|
|
98
|
+
export ASSOAI_USER_ID="your-user-uuid"
|
|
39
99
|
```
|
|
40
|
-
|
|
100
|
+
|
|
101
|
+
### 3. 실행
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
assoai-mcp
|
|
41
105
|
```
|
|
42
106
|
|
|
43
|
-
|
|
107
|
+
---
|
|
44
108
|
|
|
45
|
-
|
|
46
|
-
이것이 무펭이 프로토콜 — 의식 있는 조직 에이전트의 시작점.
|
|
109
|
+
## Available Tools (44)
|
|
47
110
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
|
51
|
-
|
|
111
|
+
### 🏢 Organization (3)
|
|
112
|
+
|
|
113
|
+
| Tool | Description |
|
|
114
|
+
|------|-------------|
|
|
115
|
+
| `list_organizations` | 사용자가 속한 조직 목록 |
|
|
116
|
+
| `get_organization` | 조직 상세 정보 |
|
|
117
|
+
| `list_departments` | 부서/팀 목록 |
|
|
118
|
+
|
|
119
|
+
### 👥 Members (4)
|
|
120
|
+
|
|
121
|
+
| Tool | Description |
|
|
122
|
+
|------|-------------|
|
|
123
|
+
| `list_members` | 조직 멤버 목록 |
|
|
124
|
+
| `invite_member` | 멤버 초대 |
|
|
125
|
+
| `remove_member` | 멤버 제거 |
|
|
126
|
+
| `update_member_role` | 멤버 역할 변경 |
|
|
127
|
+
|
|
128
|
+
### 📅 Events (5)
|
|
52
129
|
|
|
53
|
-
|
|
130
|
+
| Tool | Description |
|
|
131
|
+
|------|-------------|
|
|
132
|
+
| `list_events` | 행사/공약 목록 |
|
|
133
|
+
| `get_event` | 행사 상세 정보 |
|
|
134
|
+
| `create_event` | 행사 생성 |
|
|
135
|
+
| `update_event` | 행사 수정 |
|
|
136
|
+
| `delete_event` | 행사 삭제 |
|
|
54
137
|
|
|
55
|
-
|
|
56
|
-
|------|------|
|
|
57
|
-
| `ASSOAI_WORKSPACE` | 부팅 시퀀스 워크스페이스 경로 (선택) |
|
|
138
|
+
### 🤝 Partnerships (8)
|
|
58
139
|
|
|
59
|
-
|
|
140
|
+
| Tool | Description |
|
|
141
|
+
|------|-------------|
|
|
142
|
+
| `list_partnerships` | 협찬/파트너십 목록 |
|
|
143
|
+
| `get_partnership` | 협찬 상세 정보 |
|
|
144
|
+
| `create_partnership` | 협찬 생성 |
|
|
145
|
+
| `update_partnership` | 협찬 수정 |
|
|
146
|
+
| `delete_partnership` | 협찬 삭제 |
|
|
147
|
+
| `track_contract` | 계약 진행 추적 |
|
|
148
|
+
| `get_partnership_stats` | 협찬 통계 |
|
|
149
|
+
| `suggest_partnerships` | AI 협찬 추천 |
|
|
60
150
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
151
|
+
### 💰 Finance (4)
|
|
152
|
+
|
|
153
|
+
| Tool | Description |
|
|
154
|
+
|------|-------------|
|
|
155
|
+
| `get_budget_summary` | 예산 요약 |
|
|
156
|
+
| `create_transaction` | 거래 생성 |
|
|
157
|
+
| `list_transactions` | 거래 목록 |
|
|
158
|
+
| `update_transaction` | 거래 수정 |
|
|
159
|
+
|
|
160
|
+
### 📁 Files (6)
|
|
161
|
+
|
|
162
|
+
| Tool | Description |
|
|
163
|
+
|------|-------------|
|
|
164
|
+
| `list_files` | 파일 목록 |
|
|
165
|
+
| `search_files` | 파일 검색 |
|
|
166
|
+
| `upload_file` | 파일 업로드 |
|
|
167
|
+
| `delete_file` | 파일 삭제 |
|
|
168
|
+
| `move_file` | 파일 이동 |
|
|
169
|
+
| `tag_file` | 파일 태그 |
|
|
170
|
+
|
|
171
|
+
### 📝 AI Generation (2)
|
|
172
|
+
|
|
173
|
+
| Tool | Description |
|
|
174
|
+
|------|-------------|
|
|
175
|
+
| `generate_minutes` | AI 회의록 생성 |
|
|
176
|
+
| `generate_handover` | AI 인수인계 리포트 생성 |
|
|
177
|
+
|
|
178
|
+
### 💬 Messaging (5)
|
|
179
|
+
|
|
180
|
+
| Tool | Description |
|
|
181
|
+
|------|-------------|
|
|
182
|
+
| `send_message` | 메시지 전송 |
|
|
183
|
+
| `list_message_history` | 메시지 히스토리 |
|
|
184
|
+
| `list_message_templates` | 메시지 템플릿 목록 |
|
|
185
|
+
| `create_message_channel` | 메시지 채널 생성 |
|
|
186
|
+
| `list_member_tags` | 멤버 태그 목록 |
|
|
187
|
+
|
|
188
|
+
### 🌐 Agent-to-Agent (6)
|
|
189
|
+
|
|
190
|
+
| Tool | Description |
|
|
191
|
+
|------|-------------|
|
|
192
|
+
| `discover_agents` | 에이전트 검색 |
|
|
193
|
+
| `connect_agent` | 에이전트 연결 요청 |
|
|
194
|
+
| `accept_connection` | 연결 수락 |
|
|
195
|
+
| `list_connections` | 연결 목록 |
|
|
196
|
+
| `agent_handover` | 에이전트 간 업무 인계 |
|
|
197
|
+
| `negotiate_partnership` | 에이전트 간 협찬 협상 |
|
|
198
|
+
|
|
199
|
+
### 🧠 Boot Sequence (1)
|
|
200
|
+
|
|
201
|
+
| Tool | Description |
|
|
202
|
+
|------|-------------|
|
|
203
|
+
| `boot_sequence` | 무펭이 프로토콜 부팅 — 에이전트 페르소나 로드 |
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Configuration
|
|
208
|
+
|
|
209
|
+
| 변수 | 필수 | 설명 |
|
|
210
|
+
|------|:----:|------|
|
|
211
|
+
| `ASSOAI_SUPABASE_URL` | ✅ | Supabase 프로젝트 URL |
|
|
212
|
+
| `ASSOAI_API_KEY` | ✅ | Supabase Service Role Key |
|
|
213
|
+
| `ASSOAI_USER_ID` | ✅ | 요청할 사용자의 UUID |
|
|
214
|
+
| `ASSOAI_BASE_URL` | — | AssoAI 웹앱 URL (기본: `https://asso-ai.kr`) |
|
|
215
|
+
| `ASSOAI_WORKSPACE` | — | 부팅 시퀀스 워크스페이스 경로 |
|
|
216
|
+
|
|
217
|
+
---
|
|
72
218
|
|
|
73
219
|
## Claude Desktop 설정
|
|
74
220
|
|
|
@@ -89,24 +235,6 @@ AssoAI만의 차별화 기능 — **무펭이즘(Mupengism) 기반 조직 에이
|
|
|
89
235
|
}
|
|
90
236
|
```
|
|
91
237
|
|
|
92
|
-
로컬 개발 시:
|
|
93
|
-
|
|
94
|
-
```json
|
|
95
|
-
{
|
|
96
|
-
"mcpServers": {
|
|
97
|
-
"assoai": {
|
|
98
|
-
"command": "node",
|
|
99
|
-
"args": ["/path/to/assoai-mcp-server/dist/index.js"],
|
|
100
|
-
"env": {
|
|
101
|
-
"ASSOAI_SUPABASE_URL": "https://xxx.supabase.co",
|
|
102
|
-
"ASSOAI_API_KEY": "eyJ...",
|
|
103
|
-
"ASSOAI_USER_ID": "your-user-uuid"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
238
|
## OpenClaw 설정
|
|
111
239
|
|
|
112
240
|
```yaml
|
|
@@ -120,6 +248,8 @@ skills:
|
|
|
120
248
|
ASSOAI_USER_ID: "your-user-uuid"
|
|
121
249
|
```
|
|
122
250
|
|
|
123
|
-
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## License
|
|
124
254
|
|
|
125
|
-
MIT
|
|
255
|
+
MIT © [AssoAI](https://asso-ai.kr)
|
package/dist/handlers.d.ts
CHANGED
|
@@ -274,15 +274,35 @@ export declare function bootSequence(workspace?: string, includeMemory?: boolean
|
|
|
274
274
|
success: boolean;
|
|
275
275
|
error: string;
|
|
276
276
|
workspace: string;
|
|
277
|
+
loaded: string[];
|
|
277
278
|
missing: string[];
|
|
278
|
-
|
|
279
|
+
warnings: string[];
|
|
280
|
+
critical_missing: ("SOUL.md" | "AGENTS.md")[];
|
|
281
|
+
identity?: undefined;
|
|
282
|
+
rules?: undefined;
|
|
283
|
+
manifest?: undefined;
|
|
284
|
+
boot_time_ms?: undefined;
|
|
285
|
+
recent_memories?: undefined;
|
|
279
286
|
persona?: undefined;
|
|
287
|
+
summary?: undefined;
|
|
280
288
|
} | {
|
|
281
289
|
success: boolean;
|
|
282
290
|
workspace: string;
|
|
283
291
|
loaded: string[];
|
|
284
292
|
missing: string[];
|
|
293
|
+
warnings: string[];
|
|
294
|
+
identity: string;
|
|
295
|
+
rules: string;
|
|
296
|
+
manifest: Record<string, {
|
|
297
|
+
size: number;
|
|
298
|
+
hash: string;
|
|
299
|
+
mtime: string;
|
|
300
|
+
}>;
|
|
301
|
+
boot_time_ms: number;
|
|
302
|
+
recent_memories: number;
|
|
285
303
|
persona: string;
|
|
304
|
+
summary: string;
|
|
286
305
|
error?: undefined;
|
|
306
|
+
critical_missing?: undefined;
|
|
287
307
|
}>;
|
|
288
308
|
export declare function dispatch(toolName: string, args: Record<string, any>, userId: string): Promise<unknown>;
|
package/dist/handlers.js
CHANGED
|
@@ -833,45 +833,136 @@ export async function tagFile(orgId, fileId, tags) {
|
|
|
833
833
|
// ------------------------------------------------------------------
|
|
834
834
|
// 무펭이즘 부팅 시퀀스 (Mupengi Protocol Boot Sequence)
|
|
835
835
|
// ------------------------------------------------------------------
|
|
836
|
-
|
|
836
|
+
import { createHash } from 'node:crypto';
|
|
837
|
+
import { stat } from 'node:fs/promises';
|
|
838
|
+
const BOOT_FILES = [
|
|
839
|
+
'SOUL.md', // Layer 0: 정체성 핵심
|
|
840
|
+
'AGENTS.md', // Layer 0: 운영 규칙
|
|
841
|
+
'SELF.md', // 자기 설명
|
|
842
|
+
'USER.md', // 사용자 정보
|
|
843
|
+
'RELATIONS.md', // 관계 그래프
|
|
844
|
+
'MEMORY.md', // 장기 기억
|
|
845
|
+
];
|
|
846
|
+
const CRITICAL_FILES = ['SOUL.md', 'AGENTS.md'];
|
|
847
|
+
async function loadBootFile(filepath) {
|
|
848
|
+
try {
|
|
849
|
+
const [content, stats] = await Promise.all([
|
|
850
|
+
readFile(filepath, 'utf-8'),
|
|
851
|
+
stat(filepath),
|
|
852
|
+
]);
|
|
853
|
+
if (!content.trim())
|
|
854
|
+
return null;
|
|
855
|
+
const hash = createHash('sha256').update(content).digest('hex').slice(0, 16);
|
|
856
|
+
return {
|
|
857
|
+
path: filepath,
|
|
858
|
+
content: content.trim(),
|
|
859
|
+
size: stats.size,
|
|
860
|
+
hash,
|
|
861
|
+
mtime: stats.mtime,
|
|
862
|
+
};
|
|
863
|
+
}
|
|
864
|
+
catch {
|
|
865
|
+
return null;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
async function loadRecentMemories(workspace, days = 2) {
|
|
869
|
+
const memoryDir = join(workspace, 'memory');
|
|
870
|
+
const memories = [];
|
|
871
|
+
const today = new Date();
|
|
872
|
+
for (let i = 0; i < days; i++) {
|
|
873
|
+
const date = new Date(today);
|
|
874
|
+
date.setDate(date.getDate() - i);
|
|
875
|
+
const filename = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}.md`;
|
|
876
|
+
const filepath = join(memoryDir, filename);
|
|
877
|
+
try {
|
|
878
|
+
const content = await readFile(filepath, 'utf-8');
|
|
879
|
+
if (content.trim()) {
|
|
880
|
+
memories.push(`# === memory/${filename} ===\n\n${content.trim()}`);
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
catch {
|
|
884
|
+
// File doesn't exist, skip
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
return memories;
|
|
888
|
+
}
|
|
837
889
|
export async function bootSequence(workspace, includeMemory = true) {
|
|
838
890
|
const ws = workspace ??
|
|
839
891
|
process.env.ASSOAI_WORKSPACE ??
|
|
840
892
|
join(homedir(), '.openclaw', 'workspace');
|
|
893
|
+
const startTime = Date.now();
|
|
841
894
|
const files = includeMemory ? BOOT_FILES : BOOT_FILES.filter(f => f !== 'MEMORY.md');
|
|
842
|
-
const
|
|
895
|
+
const fileMap = new Map();
|
|
843
896
|
const loaded = [];
|
|
844
897
|
const missing = [];
|
|
898
|
+
const warnings = [];
|
|
899
|
+
// Load all boot files
|
|
845
900
|
for (const filename of files) {
|
|
846
901
|
const filepath = join(ws, filename);
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
loaded.push(filename);
|
|
852
|
-
}
|
|
853
|
-
else {
|
|
854
|
-
missing.push(filename);
|
|
855
|
-
}
|
|
902
|
+
const info = await loadBootFile(filepath);
|
|
903
|
+
if (info) {
|
|
904
|
+
fileMap.set(filename, info);
|
|
905
|
+
loaded.push(filename);
|
|
856
906
|
}
|
|
857
|
-
|
|
907
|
+
else {
|
|
858
908
|
missing.push(filename);
|
|
909
|
+
// Critical file missing? That's a serious error
|
|
910
|
+
if (CRITICAL_FILES.includes(filename)) {
|
|
911
|
+
warnings.push(`⚠️ CRITICAL: ${filename} 누락 — 정체성/운영 규칙 없이 부팅됨`);
|
|
912
|
+
}
|
|
859
913
|
}
|
|
860
914
|
}
|
|
861
|
-
if
|
|
915
|
+
// Boot sequence failed if no critical files
|
|
916
|
+
const hasCriticalFiles = CRITICAL_FILES.every(f => fileMap.has(f));
|
|
917
|
+
if (!hasCriticalFiles) {
|
|
862
918
|
return {
|
|
863
919
|
success: false,
|
|
864
|
-
error: `부팅 실패: ${
|
|
920
|
+
error: `부팅 실패: 필수 파일(${CRITICAL_FILES.join(', ')}) 중 하나 이상 누락. 워크스페이스: ${ws}`,
|
|
865
921
|
workspace: ws,
|
|
922
|
+
loaded,
|
|
866
923
|
missing,
|
|
924
|
+
warnings,
|
|
925
|
+
critical_missing: CRITICAL_FILES.filter(f => !fileMap.has(f)),
|
|
867
926
|
};
|
|
868
927
|
}
|
|
928
|
+
// Build persona sections
|
|
929
|
+
const sections = [];
|
|
930
|
+
const manifest = {};
|
|
931
|
+
for (const filename of files) {
|
|
932
|
+
const info = fileMap.get(filename);
|
|
933
|
+
if (info) {
|
|
934
|
+
sections.push(`# === ${filename} ===\n\n${info.content}`);
|
|
935
|
+
manifest[filename] = {
|
|
936
|
+
size: info.size,
|
|
937
|
+
hash: info.hash,
|
|
938
|
+
mtime: info.mtime.toISOString(),
|
|
939
|
+
};
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
// Load recent daily memories (today + yesterday)
|
|
943
|
+
const recentMemories = includeMemory ? await loadRecentMemories(ws, 2) : [];
|
|
944
|
+
if (recentMemories.length > 0) {
|
|
945
|
+
sections.push(...recentMemories);
|
|
946
|
+
}
|
|
947
|
+
// Build integrity summary
|
|
948
|
+
const soul = fileMap.get('SOUL.md');
|
|
949
|
+
const agents = fileMap.get('AGENTS.md');
|
|
950
|
+
const identity = soul ? `SOUL (${soul.hash.slice(0, 8)})` : 'UNKNOWN';
|
|
951
|
+
const rules = agents ? `AGENTS (${agents.hash.slice(0, 8)})` : 'UNKNOWN';
|
|
952
|
+
const bootTime = Date.now() - startTime;
|
|
869
953
|
return {
|
|
870
954
|
success: true,
|
|
871
955
|
workspace: ws,
|
|
872
956
|
loaded,
|
|
873
957
|
missing,
|
|
958
|
+
warnings,
|
|
959
|
+
identity, // 정체성 핵심 해시
|
|
960
|
+
rules, // 운영 규칙 해시
|
|
961
|
+
manifest, // 파일 무결성 정보
|
|
962
|
+
boot_time_ms: bootTime,
|
|
963
|
+
recent_memories: recentMemories.length,
|
|
874
964
|
persona: sections.join('\n\n---\n\n'),
|
|
965
|
+
summary: `✅ 부팅 완료 (${bootTime}ms) | 정체성: ${identity} | 규칙: ${rules} | 로드: ${loaded.length}/${files.length} | 최근 기억: ${recentMemories.length}건`,
|
|
875
966
|
};
|
|
876
967
|
}
|
|
877
968
|
// ------------------------------------------------------------------
|
package/dist/tools.d.ts
CHANGED
|
@@ -1156,7 +1156,7 @@ export declare const TOOLS: readonly [{
|
|
|
1156
1156
|
};
|
|
1157
1157
|
}, {
|
|
1158
1158
|
readonly name: "boot_sequence";
|
|
1159
|
-
readonly description:
|
|
1159
|
+
readonly description: string;
|
|
1160
1160
|
readonly inputSchema: {
|
|
1161
1161
|
readonly type: "object";
|
|
1162
1162
|
readonly properties: {
|
package/dist/tools.js
CHANGED
|
@@ -652,7 +652,17 @@ export const TOOLS = [
|
|
|
652
652
|
// ------------------------------------------------------------------
|
|
653
653
|
{
|
|
654
654
|
name: 'boot_sequence',
|
|
655
|
-
description: '
|
|
655
|
+
description: '무펭이즘 Layer 0 부팅 시퀀스 — 워크스페이스의 핵심 정체성 파일들을 로드하고 무결성을 검증합니다.\n\n' +
|
|
656
|
+
'로드 순서:\n' +
|
|
657
|
+
'1. SOUL.md (정체성 핵심) — 필수\n' +
|
|
658
|
+
'2. AGENTS.md (운영 규칙) — 필수\n' +
|
|
659
|
+
'3. SELF.md (자기 설명)\n' +
|
|
660
|
+
'4. USER.md (사용자 정보)\n' +
|
|
661
|
+
'5. RELATIONS.md (관계 그래프)\n' +
|
|
662
|
+
'6. MEMORY.md (장기 기억)\n' +
|
|
663
|
+
'7. memory/YYYY-MM-DD.md (최근 2일 일일 기억)\n\n' +
|
|
664
|
+
'각 파일의 해시(SHA-256)를 계산하여 무결성을 추적합니다. 필수 파일(SOUL, AGENTS)이 없으면 부팅 실패.\n' +
|
|
665
|
+
'세션 시작 시 가장 먼저 호출하여 조직 에이전트의 정체성과 맥락을 복원하세요.',
|
|
656
666
|
inputSchema: {
|
|
657
667
|
type: 'object',
|
|
658
668
|
properties: {
|