@engramprotocol/mcp-server 0.9.0 → 0.9.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.
- package/LICENSE +21 -0
- package/README.md +73 -34
- package/dist/cli.js +11 -9
- package/dist/cli.js.map +1 -1
- package/dist/http-client.d.ts +7 -7
- package/dist/http-client.js +7 -7
- package/dist/server.d.ts +6 -6
- package/dist/tools/_helpers.d.ts +6 -6
- package/dist/tools/_helpers.js +6 -6
- package/dist/tools/boot.d.ts.map +1 -1
- package/dist/tools/boot.js +6 -9
- package/dist/tools/boot.js.map +1 -1
- package/dist/tools/decide.d.ts +13 -0
- package/dist/tools/decide.d.ts.map +1 -0
- package/dist/tools/decide.js +59 -0
- package/dist/tools/decide.js.map +1 -0
- package/dist/tools/entity.d.ts +6 -2
- package/dist/tools/entity.d.ts.map +1 -1
- package/dist/tools/entity.js +22 -25
- package/dist/tools/entity.js.map +1 -1
- package/dist/tools/get.d.ts.map +1 -1
- package/dist/tools/get.js +4 -7
- package/dist/tools/get.js.map +1 -1
- package/dist/tools/index.d.ts +19 -4
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +41 -17
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/list.d.ts.map +1 -1
- package/dist/tools/list.js +4 -5
- package/dist/tools/list.js.map +1 -1
- package/dist/tools/note.d.ts +15 -0
- package/dist/tools/note.d.ts.map +1 -0
- package/dist/tools/note.js +47 -0
- package/dist/tools/note.js.map +1 -0
- package/dist/tools/projects.d.ts +9 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +63 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/recall.d.ts.map +1 -1
- package/dist/tools/recall.js +5 -6
- package/dist/tools/recall.js.map +1 -1
- package/dist/tools/set-status.d.ts +13 -0
- package/dist/tools/set-status.d.ts.map +1 -0
- package/dist/tools/set-status.js +48 -0
- package/dist/tools/set-status.js.map +1 -0
- package/dist/tools/show.d.ts +11 -0
- package/dist/tools/show.d.ts.map +1 -0
- package/dist/tools/show.js +25 -0
- package/dist/tools/show.js.map +1 -0
- package/dist/tools/stats.d.ts +11 -0
- package/dist/tools/stats.d.ts.map +1 -0
- package/dist/tools/stats.js +21 -0
- package/dist/tools/stats.js.map +1 -0
- package/dist/tools/track-task.d.ts +10 -0
- package/dist/tools/track-task.d.ts.map +1 -0
- package/dist/tools/track-task.js +56 -0
- package/dist/tools/track-task.js.map +1 -0
- package/dist/tools/update.d.ts.map +1 -1
- package/dist/tools/update.js +4 -5
- package/dist/tools/update.js.map +1 -1
- package/package.json +12 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dominik Tilman / Epistemic Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @engramprotocol/mcp-server
|
|
2
2
|
|
|
3
|
-
MCP
|
|
3
|
+
MCP wrapper around the EML HTTP API. Exposes the Engram Protocol as MCP tools for Claude Code (and other MCP clients) — stdio transport, Bearer token auth against `api.engramprotocol.io`.
|
|
4
4
|
|
|
5
5
|
## Install + Run
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ MCP-Wrapper für die EML HTTP-API. Macht das Engram Protocol als MCP-Tools für
|
|
|
8
8
|
npx @engramprotocol/mcp-server --url <api-url> --token <bearer>
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
or via env vars:
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
EML_API_URL=https://api.engramprotocol.io \
|
|
@@ -16,57 +16,96 @@ EML_API_TOKEN=eml_<prefix><secret> \
|
|
|
16
16
|
npx @engramprotocol/mcp-server
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
## Claude Code
|
|
19
|
+
## Claude Code config
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
The recommended way is via `claude mcp add`:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
claude mcp add engramprotocol \
|
|
25
|
+
--env EML_API_URL=https://api.engramprotocol.io \
|
|
26
|
+
--env EML_API_TOKEN=eml_<prefix><secret> \
|
|
27
|
+
-- npx -y @engramprotocol/mcp-server
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or directly in `~/.claude/settings.json` (or your client's MCP config path):
|
|
22
31
|
|
|
23
32
|
```json
|
|
24
33
|
{
|
|
25
34
|
"mcpServers": {
|
|
26
|
-
"
|
|
35
|
+
"engramprotocol": {
|
|
27
36
|
"command": "npx",
|
|
28
|
-
"args": [
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
37
|
+
"args": ["-y", "@engramprotocol/mcp-server"],
|
|
38
|
+
"env": {
|
|
39
|
+
"EML_API_URL": "https://api.engramprotocol.io",
|
|
40
|
+
"EML_API_TOKEN": "eml_<prefix><secret>"
|
|
41
|
+
}
|
|
33
42
|
}
|
|
34
43
|
}
|
|
35
44
|
}
|
|
36
45
|
```
|
|
37
46
|
|
|
38
|
-
|
|
47
|
+
Request api token via email: parsley_22bonds@icloud.com
|
|
48
|
+
|
|
49
|
+
## Tools (v0.9.1)
|
|
50
|
+
|
|
51
|
+
All tools have an `eml_` prefix. Total: **17 tools**.
|
|
52
|
+
|
|
53
|
+
### Boot / Recall
|
|
54
|
+
|
|
55
|
+
| Tool | HTTP endpoint | Use case |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `eml_boot` | `POST /boot` | Identity + status + open tasks at session start |
|
|
58
|
+
| `eml_recall` | `POST /recall` | Topic search (FTS5 + recency) |
|
|
39
59
|
|
|
40
|
-
|
|
60
|
+
### Write (typed)
|
|
61
|
+
|
|
62
|
+
| Tool | HTTP endpoint | Use case |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `eml_decide` | `POST /context` (type=decision) | Record a deliberate, documented decision |
|
|
65
|
+
| `eml_set_status` | `POST /context` (type=status) | Set current status for a scope (auto-supersedes old active status) |
|
|
66
|
+
| `eml_track_task` | `POST /context` (type=task) | Plan/track a task with priority + due date |
|
|
67
|
+
| `eml_note` | `POST /context` (kind-discriminated) | Sammelfach for rule/profile/event/reference/log |
|
|
68
|
+
|
|
69
|
+
### Read / Find
|
|
70
|
+
|
|
71
|
+
| Tool | HTTP endpoint | Use case |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| `eml_show` | `GET /brain-state?scope=` | Curated snapshot for any scope |
|
|
74
|
+
| `eml_list` | `GET /list[/mode]` | Filter-based engram list |
|
|
75
|
+
| `eml_get` | `GET /engram/:id` | Single engram + relations |
|
|
76
|
+
| `eml_projects` | `GET /projects` | List projects (filter: status) |
|
|
77
|
+
| `eml_entities` | `GET /entities` | List entities (filter: kind) |
|
|
78
|
+
|
|
79
|
+
### Self-awareness / Edit
|
|
80
|
+
|
|
81
|
+
| Tool | HTTP endpoint | Use case |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| `eml_stats` | `GET /stats` | Brain stats (counts per type/scope, container counts) |
|
|
84
|
+
| `eml_update` | `POST /update` | Patch engram (status/properties/etc.) |
|
|
41
85
|
|
|
42
|
-
|
|
86
|
+
### Container CRUD
|
|
43
87
|
|
|
44
|
-
| Tool | HTTP
|
|
88
|
+
| Tool | HTTP endpoint | Use case |
|
|
45
89
|
|---|---|---|
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `eml_list` | `GET /list[/mode]` | Filter-basierte Liste |
|
|
51
|
-
| `eml_get` | `GET /engram/:id` | Einzelnes Engram + Relations |
|
|
52
|
-
| `eml_relate` | `POST /relate` | Typed Relation zwischen 2 Engrams |
|
|
53
|
-
| `eml_update` | `POST /update` | Patch (status/properties/etc.) |
|
|
54
|
-
| `eml_confirm_review` | `POST /engram/:id/confirm-review` | review_due_at-Reset (Brain-Hygiene) |
|
|
55
|
-
| `eml_entity_create` | `POST /entity` | Entity-Registrierung (Pflicht vor `entity.<id>`-scope) |
|
|
56
|
-
| `eml_entity_list` | `GET /entities` | |
|
|
57
|
-
| `eml_entity_get` | `GET /entity/:id` | |
|
|
58
|
-
| `eml_entity_update` | `PUT /entity/:id` | |
|
|
90
|
+
| `eml_project_create` | `POST /project` | Register a project (required before `scope=project.<id>`) |
|
|
91
|
+
| `eml_project_update` | `PUT /project/:id` | Patch project fields |
|
|
92
|
+
| `eml_entity_create` | `POST /entity` | Register an entity (required before `scope=entity.<id>`) |
|
|
93
|
+
| `eml_entity_update` | `PUT /entity/:id` | Patch entity fields |
|
|
59
94
|
|
|
60
|
-
|
|
95
|
+
### Intentionally not exposed (v0.9.1)
|
|
61
96
|
|
|
62
|
-
|
|
97
|
+
- `eml_relate` — available via HTTP API directly
|
|
98
|
+
- `eml_confirm_review` — deferred to brain-hygiene cluster (post-v0.9.1)
|
|
99
|
+
- Epistemic-mode write tools (observation/hypothesis/assessment/prediction/pattern) — available via HTTP API
|
|
100
|
+
- `eml_session_get` — deferred to v0.9.2 (cross-session awareness)
|
|
101
|
+
- `eml_*_delete` — by design not in the agent action space; cleanup is operator-only
|
|
63
102
|
|
|
64
|
-
|
|
103
|
+
## Error handling
|
|
65
104
|
|
|
66
|
-
|
|
105
|
+
Backend errors (e.g. 401 invalid token, 400 invalid scope) are returned as `isError: true` with a clear message — not as MCP protocol errors. The LLM can self-correct.
|
|
67
106
|
|
|
68
|
-
|
|
107
|
+
Protocol errors (malformed JSON-RPC, unknown tool name) are handled by the SDK.
|
|
69
108
|
|
|
70
|
-
##
|
|
109
|
+
## License
|
|
71
110
|
|
|
72
|
-
|
|
111
|
+
MIT — see [LICENSE](./LICENSE).
|
package/dist/cli.js
CHANGED
|
@@ -26,25 +26,27 @@ function parseArgs(argv) {
|
|
|
26
26
|
return out;
|
|
27
27
|
}
|
|
28
28
|
function printHelpAndExit(code) {
|
|
29
|
-
const msg = `eml-mcp-server — MCP
|
|
29
|
+
const msg = `eml-mcp-server — MCP wrapper for the EML HTTP API
|
|
30
30
|
|
|
31
31
|
Usage:
|
|
32
32
|
eml-mcp-server --url <api-url> --token <bearer> [--name <client-name>]
|
|
33
33
|
|
|
34
34
|
Args:
|
|
35
|
-
--url EML_API_URL EML
|
|
36
|
-
--token EML_API_TOKEN Bearer
|
|
37
|
-
--name EML_CLIENT_NAME Client
|
|
35
|
+
--url EML_API_URL EML API URL (e.g. http://localhost:3117)
|
|
36
|
+
--token EML_API_TOKEN Bearer token (eml_<prefix><secret>)
|
|
37
|
+
--name EML_CLIENT_NAME Client name in server logs (default: eml-mcp-server)
|
|
38
38
|
--help
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
Example — Claude Code MCP config:
|
|
41
41
|
{
|
|
42
42
|
"mcpServers": {
|
|
43
|
-
"
|
|
43
|
+
"engramprotocol": {
|
|
44
44
|
"command": "npx",
|
|
45
|
-
"args": ["@engramprotocol/mcp-server",
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
"args": ["-y", "@engramprotocol/mcp-server"],
|
|
46
|
+
"env": {
|
|
47
|
+
"EML_API_URL": "https://api.engramprotocol.io",
|
|
48
|
+
"EML_API_TOKEN": "eml_..."
|
|
49
|
+
}
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAEA,qCAAyC;AAuBzC,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,GAAG,GAAY,EAAE,CAAA;IACvB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;YAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;YAAC,SAAQ;QAAC,CAAC;QAC/D,IAAI,CAAC,KAAK,OAAO,EAAI,CAAC;YAAC,GAAG,CAAC,GAAG,GAAK,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;YAAC,SAAQ;QAAC,CAAC;QACxD,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;YAAC,SAAQ;QAAC,CAAC;QACxD,IAAI,CAAC,KAAK,QAAQ,EAAG,CAAC;YAAC,GAAG,CAAC,IAAI,GAAI,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;YAAC,SAAQ;QAAC,CAAC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
-
*
|
|
5
|
-
*
|
|
6
|
-
* SDK + zod +
|
|
4
|
+
* Deliberately lives without an `@engramprotocol/core` dependency — the MCP
|
|
5
|
+
* server ships as a small npm package (`@engramprotocol/mcp-server`) that
|
|
6
|
+
* only needs the SDK + zod + this file.
|
|
7
7
|
*
|
|
8
|
-
* Error
|
|
9
|
-
*
|
|
10
|
-
* "Error
|
|
8
|
+
* Error handling: all failures throw `EmlApiError`. Tools catch it in the
|
|
9
|
+
* handler and map to an `isError: true` result (see v0.9-PROPOSAL §6.4
|
|
10
|
+
* "Error handling — two channels").
|
|
11
11
|
*/
|
|
12
12
|
export interface HttpClientOptions {
|
|
13
13
|
url: string;
|
package/dist/http-client.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Thin fetch
|
|
3
|
+
* Thin fetch wrapper for the EML HTTP API (v0.9-PROPOSAL §6.2).
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* SDK + zod +
|
|
5
|
+
* Deliberately lives without an `@engramprotocol/core` dependency — the MCP
|
|
6
|
+
* server ships as a small npm package (`@engramprotocol/mcp-server`) that
|
|
7
|
+
* only needs the SDK + zod + this file.
|
|
8
8
|
*
|
|
9
|
-
* Error
|
|
10
|
-
*
|
|
11
|
-
* "Error
|
|
9
|
+
* Error handling: all failures throw `EmlApiError`. Tools catch it in the
|
|
10
|
+
* handler and map to an `isError: true` result (see v0.9-PROPOSAL §6.4
|
|
11
|
+
* "Error handling — two channels").
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.HttpClient = exports.EmlApiError = void 0;
|
package/dist/server.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* MCP
|
|
2
|
+
* MCP server setup (v0.9-PROPOSAL §6).
|
|
3
3
|
*
|
|
4
|
-
* Single-
|
|
5
|
-
*
|
|
4
|
+
* Single-mode HTTP client (no embedded SQLite). Self-host uses the same
|
|
5
|
+
* invocation, just with `--url http://localhost:3117`.
|
|
6
6
|
*
|
|
7
|
-
* Stdio
|
|
8
|
-
* Capabilities:
|
|
9
|
-
*
|
|
7
|
+
* Stdio transport: local process spawned by Claude Code's MCP config.
|
|
8
|
+
* Capabilities: tools only (static, listChanged=false). Resources/prompts
|
|
9
|
+
* are v0.9.x polish.
|
|
10
10
|
*/
|
|
11
11
|
export interface McpServerOptions {
|
|
12
12
|
url: string;
|
package/dist/tools/_helpers.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tool
|
|
2
|
+
* Tool handler wrapper (v0.9-PROPOSAL §6.4 "Error handling — two channels").
|
|
3
3
|
*
|
|
4
|
-
* - Backend
|
|
5
|
-
* (
|
|
6
|
-
* - Protocol
|
|
4
|
+
* - Backend errors (e.g. 401/500) → `isError: true` with a message for the
|
|
5
|
+
* LLM (ideally phrased so the model can self-correct).
|
|
6
|
+
* - Protocol errors (malformed request, unknown tool) are left to the SDK.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* The CallToolResult type comes from the SDK; we just return the plain object —
|
|
9
|
+
* no type assertion needed (registerTool handles that).
|
|
10
10
|
*/
|
|
11
11
|
export declare function callTool<T>(fn: () => Promise<T>): Promise<{
|
|
12
12
|
content: Array<{
|
package/dist/tools/_helpers.js
CHANGED
|
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.callTool = callTool;
|
|
4
4
|
const http_client_1 = require("../http-client");
|
|
5
5
|
/**
|
|
6
|
-
* Tool
|
|
6
|
+
* Tool handler wrapper (v0.9-PROPOSAL §6.4 "Error handling — two channels").
|
|
7
7
|
*
|
|
8
|
-
* - Backend
|
|
9
|
-
* (
|
|
10
|
-
* - Protocol
|
|
8
|
+
* - Backend errors (e.g. 401/500) → `isError: true` with a message for the
|
|
9
|
+
* LLM (ideally phrased so the model can self-correct).
|
|
10
|
+
* - Protocol errors (malformed request, unknown tool) are left to the SDK.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* The CallToolResult type comes from the SDK; we just return the plain object —
|
|
13
|
+
* no type assertion needed (registerTool handles that).
|
|
14
14
|
*/
|
|
15
15
|
async function callTool(fn) {
|
|
16
16
|
try {
|
package/dist/tools/boot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../src/tools/boot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../src/tools/boot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAkB1E"}
|
package/dist/tools/boot.js
CHANGED
|
@@ -6,16 +6,13 @@ const _helpers_1 = require("./_helpers");
|
|
|
6
6
|
function registerBootTool(server, http) {
|
|
7
7
|
server.registerTool('eml_boot', {
|
|
8
8
|
title: 'Boot Brain',
|
|
9
|
-
description: '
|
|
10
|
-
'
|
|
11
|
-
'
|
|
9
|
+
description: 'Loads the brain boot view: identity (profile/rule), current status, ' +
|
|
10
|
+
'open tasks, recent logs, brain-hygiene reviews. Call at session start ' +
|
|
11
|
+
'to load context — the returned markdown is suitable for direct ' +
|
|
12
|
+
'injection into the context window.',
|
|
12
13
|
inputSchema: {
|
|
13
|
-
agent: zod_1.z.string().optional().describe('Agent
|
|
14
|
-
caller: zod_1.z.string().optional().describe('Wer den Boot triggert (default: gleicher Wert wie agent).'),
|
|
14
|
+
agent: zod_1.z.string().optional().describe('Agent ID (e.g. "motti", "default"). If omitted, the server uses the brain name as default.'),
|
|
15
15
|
},
|
|
16
|
-
}, async (args) => (0, _helpers_1.callTool)(() => http.post('/boot', {
|
|
17
|
-
agent: args.agent,
|
|
18
|
-
caller: args.caller ?? args.agent,
|
|
19
|
-
})));
|
|
16
|
+
}, async (args) => (0, _helpers_1.callTool)(() => http.post('/boot', { agent: args.agent })));
|
|
20
17
|
}
|
|
21
18
|
//# sourceMappingURL=boot.js.map
|
package/dist/tools/boot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../src/tools/boot.ts"],"names":[],"mappings":";;AAKA,
|
|
1
|
+
{"version":3,"file":"boot.js","sourceRoot":"","sources":["../../src/tools/boot.ts"],"names":[],"mappings":";;AAKA,4CAkBC;AAvBD,6BAAuB;AAGvB,yCAAqC;AAErC,SAAgB,gBAAgB,CAAC,MAAiB,EAAE,IAAgB;IAClE,MAAM,CAAC,YAAY,CACjB,UAAU,EACV;QACE,KAAK,EAAE,YAAY;QACnB,WAAW,EACT,sEAAsE;YACtE,wEAAwE;YACxE,iEAAiE;YACjE,oCAAoC;QACtC,WAAW,EAAE;YACX,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACnC,4FAA4F,CAC7F;SACF;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,mBAAQ,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAC1E,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { HttpClient } from '../http-client';
|
|
3
|
+
/**
|
|
4
|
+
* v0.9 Cluster 4 step 3: typed write tool for decision engrams.
|
|
5
|
+
*
|
|
6
|
+
* Properties (decision_type/rationale/alternatives/expires_at/review_due_at)
|
|
7
|
+
* are exposed as top-level tool params, packed into a `properties` object
|
|
8
|
+
* by the tool, and posted to /context.
|
|
9
|
+
*
|
|
10
|
+
* review_due_at: server default is 60d if unset (brain hygiene).
|
|
11
|
+
*/
|
|
12
|
+
export declare function registerDecideTool(server: McpServer, http: HttpClient): void;
|
|
13
|
+
//# sourceMappingURL=decide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decide.d.ts","sourceRoot":"","sources":["../../src/tools/decide.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAOhD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAwC5E"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerDecideTool = registerDecideTool;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const _helpers_1 = require("./_helpers");
|
|
6
|
+
const DECISION_TYPES = ['strategic', 'architectural', 'operational', 'roadmap'];
|
|
7
|
+
const SIGNIFICANCE = ['critical', 'high', 'normal', 'low', 'trivial'];
|
|
8
|
+
const STATUSES = ['planned', 'active', 'superseded', 'invalidated', 'expired', 'resolved'];
|
|
9
|
+
/**
|
|
10
|
+
* v0.9 Cluster 4 step 3: typed write tool for decision engrams.
|
|
11
|
+
*
|
|
12
|
+
* Properties (decision_type/rationale/alternatives/expires_at/review_due_at)
|
|
13
|
+
* are exposed as top-level tool params, packed into a `properties` object
|
|
14
|
+
* by the tool, and posted to /context.
|
|
15
|
+
*
|
|
16
|
+
* review_due_at: server default is 60d if unset (brain hygiene).
|
|
17
|
+
*/
|
|
18
|
+
function registerDecideTool(server, http) {
|
|
19
|
+
server.registerTool('eml_decide', {
|
|
20
|
+
title: 'Record Decision',
|
|
21
|
+
description: 'Records a deliberate, documented decision. Trigger: explicit ' +
|
|
22
|
+
'"we decide X", "Decision: Y" — NOT for speculation or open ' +
|
|
23
|
+
'questions. Decisions are the backbone of brain memory.',
|
|
24
|
+
inputSchema: {
|
|
25
|
+
content: zod_1.z.string().describe('The decision itself (1-3 sentences, what was decided).'),
|
|
26
|
+
scope: zod_1.z.string().describe('global | project.<id> | entity.<id> | agent.<id> | user.<id>'),
|
|
27
|
+
subject: zod_1.z.string().optional().describe('Slug for the decision (for later recall).'),
|
|
28
|
+
decision_type: zod_1.z.enum(DECISION_TYPES).optional(),
|
|
29
|
+
rationale: zod_1.z.string().optional().describe('Why this was decided.'),
|
|
30
|
+
alternatives: zod_1.z.array(zod_1.z.string()).optional().describe('Rejected alternatives.'),
|
|
31
|
+
expires_at: zod_1.z.string().optional().describe('ISO date: hard lifecycle, obsolete from then on.'),
|
|
32
|
+
review_due_at: zod_1.z.string().optional().describe('ISO date: next review (server default 60d).'),
|
|
33
|
+
significance: zod_1.z.enum(SIGNIFICANCE).optional(),
|
|
34
|
+
status: zod_1.z.enum(STATUSES).optional().describe('Default "active".'),
|
|
35
|
+
},
|
|
36
|
+
}, async (args) => (0, _helpers_1.callTool)(() => {
|
|
37
|
+
const properties = {};
|
|
38
|
+
if (args.decision_type !== undefined)
|
|
39
|
+
properties.decision_type = args.decision_type;
|
|
40
|
+
if (args.rationale !== undefined)
|
|
41
|
+
properties.rationale = args.rationale;
|
|
42
|
+
if (args.alternatives !== undefined)
|
|
43
|
+
properties.alternatives = args.alternatives;
|
|
44
|
+
if (args.expires_at !== undefined)
|
|
45
|
+
properties.expires_at = args.expires_at;
|
|
46
|
+
if (args.review_due_at !== undefined)
|
|
47
|
+
properties.review_due_at = args.review_due_at;
|
|
48
|
+
return http.post('/context', {
|
|
49
|
+
content: args.content,
|
|
50
|
+
type: 'decision',
|
|
51
|
+
scope: args.scope,
|
|
52
|
+
subject: args.subject,
|
|
53
|
+
status: args.status,
|
|
54
|
+
significance: args.significance,
|
|
55
|
+
properties: Object.keys(properties).length > 0 ? properties : undefined,
|
|
56
|
+
});
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=decide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decide.js","sourceRoot":"","sources":["../../src/tools/decide.ts"],"names":[],"mappings":";;AAkBA,gDAwCC;AA1DD,6BAAuB;AAGvB,yCAAqC;AAErC,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,CAAU,CAAA;AACxF,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAU,CAAA;AAC9E,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAU,CAAA;AAEnG;;;;;;;;GAQG;AACH,SAAgB,kBAAkB,CAAC,MAAiB,EAAE,IAAgB;IACpE,MAAM,CAAC,YAAY,CACjB,YAAY,EACZ;QACE,KAAK,EAAE,iBAAiB;QACxB,WAAW,EACT,+DAA+D;YAC/D,6DAA6D;YAC7D,wDAAwD;QAC1D,WAAW,EAAE;YACX,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;YACtF,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8DAA8D,CAAC;YAC1F,OAAO,EAAE,OAAC,CAAC,MA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AU,CAAA;QAC1E,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS;YAAE,UAAU,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAA;QACnF,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;SACxE,CAAC,CAAA;IACJ,CAAC,CAAC,CACH,CAAA;AACH,CAAC"}
|
package/dist/tools/entity.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import type { HttpClient } from '../http-client';
|
|
3
|
+
/**
|
|
4
|
+
* v0.9 Cluster 4 step 3: list all entities, optionally filtered by kind.
|
|
5
|
+
* Replaces the earlier `eml_entity_list` with clearer naming + symmetry to
|
|
6
|
+
* `eml_projects` (container inventory).
|
|
7
|
+
*/
|
|
8
|
+
export declare function registerEntitiesTool(server: McpServer, http: HttpClient): void;
|
|
3
9
|
export declare function registerEntityCreateTool(server: McpServer, http: HttpClient): void;
|
|
4
|
-
export declare function registerEntityListTool(server: McpServer, http: HttpClient): void;
|
|
5
|
-
export declare function registerEntityGetTool(server: McpServer, http: HttpClient): void;
|
|
6
10
|
export declare function registerEntityUpdateTool(server: McpServer, http: HttpClient): void;
|
|
7
11
|
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../src/tools/entity.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAKhD
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../src/tools/entity.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAKhD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAe9E;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAkBlF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAkBlF"}
|
package/dist/tools/entity.js
CHANGED
|
@@ -1,48 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerEntitiesTool = registerEntitiesTool;
|
|
3
4
|
exports.registerEntityCreateTool = registerEntityCreateTool;
|
|
4
|
-
exports.registerEntityListTool = registerEntityListTool;
|
|
5
|
-
exports.registerEntityGetTool = registerEntityGetTool;
|
|
6
5
|
exports.registerEntityUpdateTool = registerEntityUpdateTool;
|
|
7
6
|
const zod_1 = require("zod");
|
|
8
7
|
const _helpers_1 = require("./_helpers");
|
|
9
8
|
const ENTITY_KINDS = ['person', 'org', 'asset', 'subject'];
|
|
9
|
+
/**
|
|
10
|
+
* v0.9 Cluster 4 step 3: list all entities, optionally filtered by kind.
|
|
11
|
+
* Replaces the earlier `eml_entity_list` with clearer naming + symmetry to
|
|
12
|
+
* `eml_projects` (container inventory).
|
|
13
|
+
*/
|
|
14
|
+
function registerEntitiesTool(server, http) {
|
|
15
|
+
server.registerTool('eml_entities', {
|
|
16
|
+
title: 'List Entities',
|
|
17
|
+
description: 'Lists all entities in the brain (external persons / organisations / ' +
|
|
18
|
+
'assets / subjects), optionally filtered by kind. For "which external ' +
|
|
19
|
+
'persons / orgs are in the brain?".',
|
|
20
|
+
inputSchema: {
|
|
21
|
+
kind: zod_1.z.enum(ENTITY_KINDS).optional().describe('Default: all.'),
|
|
22
|
+
},
|
|
23
|
+
}, async (args) => (0, _helpers_1.callTool)(() => http.get('/entities', args.kind ? { kind: args.kind } : undefined)));
|
|
24
|
+
}
|
|
10
25
|
function registerEntityCreateTool(server, http) {
|
|
11
26
|
server.registerTool('eml_entity_create', {
|
|
12
27
|
title: 'Create Entity',
|
|
13
|
-
description: '
|
|
14
|
-
'
|
|
15
|
-
'scope-
|
|
28
|
+
description: 'Registers an entity (external person / organisation / asset / subject). ' +
|
|
29
|
+
'Required BEFORE the first engram with scope=entity.<id> — otherwise ' +
|
|
30
|
+
'the scope-existence check fails.',
|
|
16
31
|
inputSchema: {
|
|
17
|
-
id: zod_1.z.string().describe('Slug-style ID,
|
|
32
|
+
id: zod_1.z.string().describe('Slug-style ID, e.g. "lasse" or "anthropic".'),
|
|
18
33
|
name: zod_1.z.string(),
|
|
19
34
|
kind: zod_1.z.enum(ENTITY_KINDS),
|
|
20
35
|
description: zod_1.z.string().optional(),
|
|
21
36
|
},
|
|
22
37
|
}, async (args) => (0, _helpers_1.callTool)(() => http.post('/entity', args)));
|
|
23
38
|
}
|
|
24
|
-
function registerEntityListTool(server, http) {
|
|
25
|
-
server.registerTool('eml_entity_list', {
|
|
26
|
-
title: 'List Entities',
|
|
27
|
-
description: 'Listet alle Entities, optional gefiltert nach kind.',
|
|
28
|
-
inputSchema: {
|
|
29
|
-
kind: zod_1.z.enum(ENTITY_KINDS).optional(),
|
|
30
|
-
},
|
|
31
|
-
}, async (args) => (0, _helpers_1.callTool)(() => http.get('/entities', args.kind ? { kind: args.kind } : undefined)));
|
|
32
|
-
}
|
|
33
|
-
function registerEntityGetTool(server, http) {
|
|
34
|
-
server.registerTool('eml_entity_get', {
|
|
35
|
-
title: 'Get Entity',
|
|
36
|
-
description: 'Holt eine Entity per ID.',
|
|
37
|
-
inputSchema: {
|
|
38
|
-
id: zod_1.z.string(),
|
|
39
|
-
},
|
|
40
|
-
}, async (args) => (0, _helpers_1.callTool)(() => http.get(`/entity/${args.id}`)));
|
|
41
|
-
}
|
|
42
39
|
function registerEntityUpdateTool(server, http) {
|
|
43
40
|
server.registerTool('eml_entity_update', {
|
|
44
41
|
title: 'Update Entity',
|
|
45
|
-
description: 'Patch
|
|
42
|
+
description: 'Patch entity fields (name/kind/description).',
|
|
46
43
|
inputSchema: {
|
|
47
44
|
id: zod_1.z.string(),
|
|
48
45
|
name: zod_1.z.string().optional(),
|
package/dist/tools/entity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../src/tools/entity.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"entity.js","sourceRoot":"","sources":["../../src/tools/entity.ts"],"names":[],"mappings":";;AAYA,oDAeC;AAED,4DAkBC;AAED,4DAkBC;AAnED,6BAAuB;AAGvB,yCAAqC;AAErC,MAAM,YAAY,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,CAAU,CAAA;AAEnE;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,MAAiB,EAAE,IAAgB;IACtE,MAAM,CAAC,YAAY,CACjB,cAAc,EACd;QACE,KAAK,EAAE,eAAe;QACtB,WAAW,EACT,sEAAsE;YACtE,uEAAuE;YACvE,oCAAoC;QACtC,WAAW,EAAE;YACX,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;SAChE;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,mBAAQ,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CAAC,IAAA,mBAAQ,EAAC,GAAG,EAAE;QAC5B,MAAM,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,GAAG,IAAI,CAAA;QAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,EAAE,KAAK,CAAC,CAAA;IACzC,CAAC,CAAC,CACH,CAAA;AACH,CAAC"}
|
package/dist/tools/get.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/tools/get.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../src/tools/get.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,GAAG,IAAI,CAuBzE"}
|
package/dist/tools/get.js
CHANGED
|
@@ -6,21 +6,18 @@ const _helpers_1 = require("./_helpers");
|
|
|
6
6
|
function registerGetTool(server, http) {
|
|
7
7
|
server.registerTool('eml_get', {
|
|
8
8
|
title: 'Get Engram',
|
|
9
|
-
description: '
|
|
10
|
-
'(/epistemic/:id, /context/:id)
|
|
9
|
+
description: 'Fetch a single engram by ID, optionally with relations. Mode-specific ' +
|
|
10
|
+
'paths (/epistemic/:id, /context/:id) enforce mode-consistent lookups.',
|
|
11
11
|
inputSchema: {
|
|
12
|
-
id: zod_1.z.string().describe('Engram
|
|
13
|
-
mode: zod_1.z.enum(['epistemic', 'context']).optional().describe('
|
|
12
|
+
id: zod_1.z.string().describe('Engram ID (UUID).'),
|
|
13
|
+
mode: zod_1.z.enum(['epistemic', 'context']).optional().describe('When set: lookup via mode-specific endpoint (404 on mode mismatch).'),
|
|
14
14
|
with_relations: zod_1.z.boolean().optional().describe('Default true.'),
|
|
15
|
-
caller: zod_1.z.string().optional(),
|
|
16
15
|
},
|
|
17
16
|
}, async (args) => (0, _helpers_1.callTool)(() => {
|
|
18
17
|
const path = args.mode ? `/${args.mode}/${args.id}` : `/engram/${args.id}`;
|
|
19
18
|
const params = {};
|
|
20
19
|
if (args.with_relations !== undefined)
|
|
21
20
|
params.with_relations = String(args.with_relations);
|
|
22
|
-
if (args.caller)
|
|
23
|
-
params.caller = args.caller;
|
|
24
21
|
return http.get(path, params);
|
|
25
22
|
}));
|
|
26
23
|
}
|
package/dist/tools/get.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../src/tools/get.ts"],"names":[],"mappings":";;AAKA,
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../src/tools/get.ts"],"names":[],"mappings":";;AAKA,0CAuBC;AA5BD,6BAAuB;AAGvB,yCAAqC;AAErC,SAAgB,eAAe,CAAC,MAAiB,EAAE,IAAgB;IACjE,MAAM,CAAC,YAAY,CACjB,SAAS,EACT;QACE,KAAK,EAAE,YAAY;QACnB,WAAW,EACT,wEAAwE;YACxE,uEAAuE;QACzE,WAAW,EAAE;YACX,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;YAC5C,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACxD,qEAAqE,CACtE;YACD,cAAc,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;SACjE;KACF,EACD,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,mBAAQ,EAAC,GAAG,EAAE;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,EAAE,EAAE,CAAA;QAC1E,MAAM,MAAM,GAAgD,EAAE,CAAA;QAC9D,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS;YAAE,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QAC1F,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IAC/B,CAAC,CAAC,CACH,CAAA;AACH,CAAC"}
|