kemdicode-mcp 1.15.6 → 1.17.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 +253 -37
- package/dist/ai/execute.d.ts.map +1 -1
- package/dist/ai/execute.js +5 -1
- package/dist/ai/execute.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/recursive/tool-invoker.d.ts.map +1 -1
- package/dist/recursive/tool-invoker.js +76 -28
- package/dist/recursive/tool-invoker.js.map +1 -1
- package/dist/recursive/types.d.ts +1 -0
- package/dist/recursive/types.d.ts.map +1 -1
- package/dist/recursive/types.js.map +1 -1
- package/dist/server/http-server.d.ts.map +1 -1
- package/dist/server/http-server.js +47 -1
- package/dist/server/http-server.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/session-server.d.ts +35 -0
- package/dist/server/session-server.d.ts.map +1 -1
- package/dist/server/session-server.js +73 -0
- package/dist/server/session-server.js.map +1 -1
- package/dist/tools/agents/agent-alert.tool.js +1 -1
- package/dist/tools/agents/agent-alert.tool.js.map +1 -1
- package/dist/tools/agents/agent-history.tool.js +1 -1
- package/dist/tools/agents/agent-history.tool.js.map +1 -1
- package/dist/tools/agents/agent-inject.tool.js +3 -3
- package/dist/tools/agents/agent-inject.tool.js.map +1 -1
- package/dist/tools/agents/agent-list.tool.d.ts.map +1 -1
- package/dist/tools/agents/agent-list.tool.js +1 -1
- package/dist/tools/agents/agent-list.tool.js.map +1 -1
- package/dist/tools/agents/agent-register.tool.d.ts.map +1 -1
- package/dist/tools/agents/agent-register.tool.js +1 -1
- package/dist/tools/agents/agent-register.tool.js.map +1 -1
- package/dist/tools/agents/agent-summary.tool.d.ts.map +1 -1
- package/dist/tools/agents/agent-summary.tool.js +1 -1
- package/dist/tools/agents/agent-summary.tool.js.map +1 -1
- package/dist/tools/agents/agent-watch.tool.js +1 -1
- package/dist/tools/agents/agent-watch.tool.js.map +1 -1
- package/dist/tools/agents/monitor.tool.js +1 -1
- package/dist/tools/agents/monitor.tool.js.map +1 -1
- package/dist/tools/agents/queue-message.tool.js +1 -1
- package/dist/tools/agents/queue-message.tool.js.map +1 -1
- package/dist/tools/ask-ai.tool.js +1 -1
- package/dist/tools/ask-ai.tool.js.map +1 -1
- package/dist/tools/batch.tool.d.ts.map +1 -1
- package/dist/tools/batch.tool.js +4 -17
- package/dist/tools/batch.tool.js.map +1 -1
- package/dist/tools/brainstorm.tool.js +5 -5
- package/dist/tools/brainstorm.tool.js.map +1 -1
- package/dist/tools/code/code-outline.tool.js +4 -4
- package/dist/tools/code/code-outline.tool.js.map +1 -1
- package/dist/tools/code/find-definition.tool.js +5 -5
- package/dist/tools/code/find-definition.tool.js.map +1 -1
- package/dist/tools/code/find-references.tool.js +7 -7
- package/dist/tools/code/find-references.tool.js.map +1 -1
- package/dist/tools/code/find-symbols.tool.js +4 -4
- package/dist/tools/code/find-symbols.tool.js.map +1 -1
- package/dist/tools/code/insert-after-symbol.tool.d.ts.map +1 -1
- package/dist/tools/code/insert-after-symbol.tool.js +6 -5
- package/dist/tools/code/insert-after-symbol.tool.js.map +1 -1
- package/dist/tools/code/insert-before-symbol.tool.d.ts.map +1 -1
- package/dist/tools/code/insert-before-symbol.tool.js +6 -5
- package/dist/tools/code/insert-before-symbol.tool.js.map +1 -1
- package/dist/tools/code/rename-symbol.tool.d.ts.map +1 -1
- package/dist/tools/code/rename-symbol.tool.js +5 -4
- package/dist/tools/code/rename-symbol.tool.js.map +1 -1
- package/dist/tools/code/semantic-search.tool.js +6 -6
- package/dist/tools/code/semantic-search.tool.js.map +1 -1
- package/dist/tools/context/feedback.tool.js +1 -1
- package/dist/tools/context/feedback.tool.js.map +1 -1
- package/dist/tools/context/get-shared-context.tool.js +3 -3
- package/dist/tools/context/get-shared-context.tool.js.map +1 -1
- package/dist/tools/context/shared-thoughts.tool.js +4 -4
- package/dist/tools/context/shared-thoughts.tool.js.map +1 -1
- package/dist/tools/edit/delete-lines.tool.d.ts.map +1 -1
- package/dist/tools/edit/delete-lines.tool.js +8 -6
- package/dist/tools/edit/delete-lines.tool.js.map +1 -1
- package/dist/tools/edit/edit-shared.d.ts +1 -0
- package/dist/tools/edit/edit-shared.d.ts.map +1 -1
- package/dist/tools/edit/edit-shared.js +1 -0
- package/dist/tools/edit/edit-shared.js.map +1 -1
- package/dist/tools/edit/insert-at-line.tool.d.ts.map +1 -1
- package/dist/tools/edit/insert-at-line.tool.js +6 -5
- package/dist/tools/edit/insert-at-line.tool.js.map +1 -1
- package/dist/tools/edit/replace-content.tool.d.ts.map +1 -1
- package/dist/tools/edit/replace-content.tool.js +9 -8
- package/dist/tools/edit/replace-content.tool.js.map +1 -1
- package/dist/tools/edit/replace-lines.tool.d.ts.map +1 -1
- package/dist/tools/edit/replace-lines.tool.js +7 -6
- package/dist/tools/edit/replace-lines.tool.js.map +1 -1
- package/dist/tools/file/file-diff.tool.d.ts.map +1 -1
- package/dist/tools/file/file-diff.tool.js +10 -8
- package/dist/tools/file/file-diff.tool.js.map +1 -1
- package/dist/tools/file/file-read.tool.d.ts.map +1 -1
- package/dist/tools/file/file-read.tool.js +7 -6
- package/dist/tools/file/file-read.tool.js.map +1 -1
- package/dist/tools/file/file-search.tool.js +16 -15
- package/dist/tools/file/file-search.tool.js.map +1 -1
- package/dist/tools/file/file-tree.tool.d.ts.map +1 -1
- package/dist/tools/file/file-tree.tool.js +18 -18
- package/dist/tools/file/file-tree.tool.js.map +1 -1
- package/dist/tools/file/file-write.tool.d.ts.map +1 -1
- package/dist/tools/file/file-write.tool.js +9 -8
- package/dist/tools/file/file-write.tool.js.map +1 -1
- package/dist/tools/git/git-blame.tool.js +13 -13
- package/dist/tools/git/git-blame.tool.js.map +1 -1
- package/dist/tools/git/git-branch.tool.js +13 -13
- package/dist/tools/git/git-branch.tool.js.map +1 -1
- package/dist/tools/git/git-diff.tool.d.ts.map +1 -1
- package/dist/tools/git/git-diff.tool.js +12 -12
- package/dist/tools/git/git-diff.tool.js.map +1 -1
- package/dist/tools/git/git-log.tool.d.ts.map +1 -1
- package/dist/tools/git/git-log.tool.js +16 -16
- package/dist/tools/git/git-log.tool.js.map +1 -1
- package/dist/tools/git/git-status.tool.d.ts.map +1 -1
- package/dist/tools/git/git-status.tool.js +6 -6
- package/dist/tools/git/git-status.tool.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kanban/board-create.tool.js +6 -6
- package/dist/tools/kanban/board-create.tool.js.map +1 -1
- package/dist/tools/kanban/board-invite.tool.js +6 -6
- package/dist/tools/kanban/board-invite.tool.js.map +1 -1
- package/dist/tools/kanban/board-list.tool.js +4 -4
- package/dist/tools/kanban/board-list.tool.js.map +1 -1
- package/dist/tools/kanban/board-members.tool.js +4 -4
- package/dist/tools/kanban/board-members.tool.js.map +1 -1
- package/dist/tools/kanban/board-share.tool.js +5 -5
- package/dist/tools/kanban/board-share.tool.js.map +1 -1
- package/dist/tools/kanban/board-status.tool.js +1 -1
- package/dist/tools/kanban/board-status.tool.js.map +1 -1
- package/dist/tools/kanban/task-assign.tool.d.ts.map +1 -1
- package/dist/tools/kanban/task-assign.tool.js +5 -5
- package/dist/tools/kanban/task-assign.tool.js.map +1 -1
- package/dist/tools/kanban/task-claim.tool.js +3 -3
- package/dist/tools/kanban/task-claim.tool.js.map +1 -1
- package/dist/tools/kanban/task-create.tool.d.ts.map +1 -1
- package/dist/tools/kanban/task-create.tool.js +10 -10
- package/dist/tools/kanban/task-create.tool.js.map +1 -1
- package/dist/tools/kanban/task-list.tool.js +6 -6
- package/dist/tools/kanban/task-list.tool.js.map +1 -1
- package/dist/tools/kanban/task-push-multi.tool.js +10 -10
- package/dist/tools/kanban/task-push-multi.tool.js.map +1 -1
- package/dist/tools/kanban/task-update.tool.d.ts.map +1 -1
- package/dist/tools/kanban/task-update.tool.js +14 -14
- package/dist/tools/kanban/task-update.tool.js.map +1 -1
- package/dist/tools/kanban/workspace-create.tool.js +4 -4
- package/dist/tools/kanban/workspace-create.tool.js.map +1 -1
- package/dist/tools/kanban/workspace-join.tool.js +3 -3
- package/dist/tools/kanban/workspace-join.tool.js.map +1 -1
- package/dist/tools/kanban/workspace-leave.tool.js +3 -3
- package/dist/tools/kanban/workspace-leave.tool.js.map +1 -1
- package/dist/tools/kanban/workspace-list.tool.js +3 -3
- package/dist/tools/kanban/workspace-list.tool.js.map +1 -1
- package/dist/tools/loci/graph-find-path.tool.d.ts.map +1 -1
- package/dist/tools/loci/graph-find-path.tool.js +4 -5
- package/dist/tools/loci/graph-find-path.tool.js.map +1 -1
- package/dist/tools/loci/graph-query.tool.js +5 -5
- package/dist/tools/loci/graph-query.tool.js.map +1 -1
- package/dist/tools/loci/loci-recall.tool.d.ts.map +1 -1
- package/dist/tools/loci/loci-recall.tool.js +3 -4
- package/dist/tools/loci/loci-recall.tool.js.map +1 -1
- package/dist/tools/loci/sequence-recommend.tool.d.ts.map +1 -1
- package/dist/tools/loci/sequence-recommend.tool.js +3 -4
- package/dist/tools/loci/sequence-recommend.tool.js.map +1 -1
- package/dist/tools/memory/checkpoint-restore.tool.d.ts +20 -0
- package/dist/tools/memory/checkpoint-restore.tool.d.ts.map +1 -0
- package/dist/tools/memory/checkpoint-restore.tool.js +94 -0
- package/dist/tools/memory/checkpoint-restore.tool.js.map +1 -0
- package/dist/tools/memory/checkpoint-save.tool.d.ts +20 -0
- package/dist/tools/memory/checkpoint-save.tool.d.ts.map +1 -0
- package/dist/tools/memory/checkpoint-save.tool.js +140 -0
- package/dist/tools/memory/checkpoint-save.tool.js.map +1 -0
- package/dist/tools/memory/delete-memory.tool.js +2 -2
- package/dist/tools/memory/delete-memory.tool.js.map +1 -1
- package/dist/tools/memory/edit-memory.tool.js +6 -6
- package/dist/tools/memory/edit-memory.tool.js.map +1 -1
- package/dist/tools/memory/index.d.ts +2 -0
- package/dist/tools/memory/index.d.ts.map +1 -1
- package/dist/tools/memory/index.js +2 -0
- package/dist/tools/memory/index.js.map +1 -1
- package/dist/tools/memory/list-memories.tool.js +4 -4
- package/dist/tools/memory/list-memories.tool.js.map +1 -1
- package/dist/tools/memory/read-memory.tool.js +2 -2
- package/dist/tools/memory/read-memory.tool.js.map +1 -1
- package/dist/tools/memory/write-memory.tool.js +4 -4
- package/dist/tools/memory/write-memory.tool.js.map +1 -1
- package/dist/tools/mpc/mpc-distribute.tool.d.ts.map +1 -1
- package/dist/tools/mpc/mpc-distribute.tool.js +4 -5
- package/dist/tools/mpc/mpc-distribute.tool.js.map +1 -1
- package/dist/tools/mpc/mpc-reconstruct.tool.d.ts.map +1 -1
- package/dist/tools/mpc/mpc-reconstruct.tool.js +3 -4
- package/dist/tools/mpc/mpc-reconstruct.tool.js.map +1 -1
- package/dist/tools/mpc/mpc-split.tool.d.ts.map +1 -1
- package/dist/tools/mpc/mpc-split.tool.js +10 -11
- package/dist/tools/mpc/mpc-split.tool.js.map +1 -1
- package/dist/tools/mpc/mpc-status.tool.js +4 -4
- package/dist/tools/mpc/mpc-status.tool.js.map +1 -1
- package/dist/tools/multi-llm/consensus-prompt.tool.d.ts.map +1 -1
- package/dist/tools/multi-llm/consensus-prompt.tool.js +9 -11
- package/dist/tools/multi-llm/consensus-prompt.tool.js.map +1 -1
- package/dist/tools/multi-llm/multi-prompt.tool.d.ts.map +1 -1
- package/dist/tools/multi-llm/multi-prompt.tool.js +4 -6
- package/dist/tools/multi-llm/multi-prompt.tool.js.map +1 -1
- package/dist/tools/project/check-types.tool.js +5 -5
- package/dist/tools/project/check-types.tool.js.map +1 -1
- package/dist/tools/project/project-info.tool.d.ts.map +1 -1
- package/dist/tools/project/project-info.tool.js +4 -4
- package/dist/tools/project/project-info.tool.js.map +1 -1
- package/dist/tools/project/run-lint.tool.js +5 -5
- package/dist/tools/project/run-lint.tool.js.map +1 -1
- package/dist/tools/project/run-script.tool.js +6 -6
- package/dist/tools/project/run-script.tool.js.map +1 -1
- package/dist/tools/project/run-tests.tool.js +5 -5
- package/dist/tools/project/run-tests.tool.js.map +1 -1
- package/dist/tools/recursive/invocation-log.tool.js +3 -3
- package/dist/tools/recursive/invocation-log.tool.js.map +1 -1
- package/dist/tools/recursive/invoke-batch.tool.js +5 -5
- package/dist/tools/recursive/invoke-batch.tool.js.map +1 -1
- package/dist/tools/recursive/invoke-tool.tool.js +6 -6
- package/dist/tools/recursive/invoke-tool.tool.js.map +1 -1
- package/dist/tools/registry.d.ts +5 -15
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +32 -7
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/rl/rl-dopamine-log.tool.js +4 -4
- package/dist/tools/rl/rl-dopamine-log.tool.js.map +1 -1
- package/dist/tools/rl/rl-reward-stats.tool.js +4 -4
- package/dist/tools/rl/rl-reward-stats.tool.js.map +1 -1
- package/dist/tools/session/session-create.tool.d.ts.map +1 -1
- package/dist/tools/session/session-create.tool.js +7 -7
- package/dist/tools/session/session-create.tool.js.map +1 -1
- package/dist/tools/session/session-delete.tool.d.ts.map +1 -1
- package/dist/tools/session/session-delete.tool.js +3 -3
- package/dist/tools/session/session-delete.tool.js.map +1 -1
- package/dist/tools/session/session-info.tool.d.ts.map +1 -1
- package/dist/tools/session/session-info.tool.js +2 -2
- package/dist/tools/session/session-info.tool.js.map +1 -1
- package/dist/tools/session/session-list.tool.js +1 -1
- package/dist/tools/session/session-list.tool.js.map +1 -1
- package/dist/tools/session/session-switch.tool.d.ts.map +1 -1
- package/dist/tools/session/session-switch.tool.js +4 -4
- package/dist/tools/session/session-switch.tool.js.map +1 -1
- package/dist/tools/specialized/analyze-deps.tool.js +2 -2
- package/dist/tools/specialized/analyze-deps.tool.js.map +1 -1
- package/dist/tools/specialized/auto-fix-agent.tool.d.ts.map +1 -1
- package/dist/tools/specialized/auto-fix-agent.tool.js +5 -5
- package/dist/tools/specialized/auto-fix-agent.tool.js.map +1 -1
- package/dist/tools/specialized/auto-fix.tool.d.ts.map +1 -1
- package/dist/tools/specialized/auto-fix.tool.js +4 -4
- package/dist/tools/specialized/auto-fix.tool.js.map +1 -1
- package/dist/tools/specialized/code-review.tool.js +4 -4
- package/dist/tools/specialized/code-review.tool.js.map +1 -1
- package/dist/tools/specialized/explain-code.tool.js +2 -2
- package/dist/tools/specialized/explain-code.tool.js.map +1 -1
- package/dist/tools/specialized/fix-bug.tool.js +3 -3
- package/dist/tools/specialized/fix-bug.tool.js.map +1 -1
- package/dist/tools/specialized/refactor.tool.js +2 -2
- package/dist/tools/specialized/refactor.tool.js.map +1 -1
- package/dist/tools/specialized/write-tests.tool.js +2 -2
- package/dist/tools/specialized/write-tests.tool.js.map +1 -1
- package/dist/tools/system/ai-config.tool.d.ts.map +1 -1
- package/dist/tools/system/ai-config.tool.js +7 -7
- package/dist/tools/system/ai-config.tool.js.map +1 -1
- package/dist/tools/system/ai-models.tool.d.ts.map +1 -1
- package/dist/tools/system/ai-models.tool.js +34 -8
- package/dist/tools/system/ai-models.tool.js.map +1 -1
- package/dist/tools/system/config.tool.js +1 -1
- package/dist/tools/system/config.tool.js.map +1 -1
- package/dist/tools/system/env-info.tool.d.ts.map +1 -1
- package/dist/tools/system/env-info.tool.js +13 -8
- package/dist/tools/system/env-info.tool.js.map +1 -1
- package/dist/tools/system/memory-usage.tool.js +3 -3
- package/dist/tools/system/memory-usage.tool.js.map +1 -1
- package/dist/tools/system/process-list.tool.js +9 -9
- package/dist/tools/system/process-list.tool.js.map +1 -1
- package/dist/tools/system/shell-exec.tool.d.ts.map +1 -1
- package/dist/tools/system/shell-exec.tool.js +73 -44
- package/dist/tools/system/shell-exec.tool.js.map +1 -1
- package/dist/tools/timeout-test.tool.js +2 -2
- package/dist/tools/timeout-test.tool.js.map +1 -1
- package/dist/utils/git-utils.d.ts.map +1 -1
- package/dist/utils/git-utils.js +5 -5
- package/dist/utils/git-utils.js.map +1 -1
- package/dist/utils/security.d.ts.map +1 -1
- package/dist/utils/security.js +20 -9
- package/dist/utils/security.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<h3 align="center">Model Context Protocol Server for AI-Powered Development</h3>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
|
|
8
|
+
103 tools • 7 LLM providers • multi-agent orchestration • kanban • project memory
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://www.npmjs.com/package/kemdicode-mcp"><img src="https://img.shields.io/badge/npm-kemdicode--mcp-CB3837?style=flat-square&logo=npm&logoColor=white" alt="npm" /></a>
|
|
13
|
-
<a href="https://github.com/kemdi-pl/kemdicode-mcp/releases"><img src="https://img.shields.io/badge/version-1.
|
|
13
|
+
<a href="https://github.com/kemdi-pl/kemdicode-mcp/releases"><img src="https://img.shields.io/badge/version-1.17.0-blue?style=flat-square" alt="Version" /></a>
|
|
14
14
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-GPL--3.0-green?style=flat-square" alt="License" /></a>
|
|
15
15
|
</p>
|
|
16
16
|
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
<details>
|
|
29
29
|
<summary><strong>Table of Contents</strong></summary>
|
|
30
30
|
|
|
31
|
+
- [What's New in 1.17.0](#whats-new-in-1170)
|
|
32
|
+
- [Usage Examples](#usage-examples)
|
|
31
33
|
- [Highlights](#highlights)
|
|
32
34
|
- [Compatibility](#compatibility)
|
|
33
35
|
- [Quick Start](#quick-start)
|
|
@@ -48,11 +50,76 @@
|
|
|
48
50
|
|
|
49
51
|
---
|
|
50
52
|
|
|
53
|
+
## What's New in 1.17.0
|
|
54
|
+
|
|
55
|
+
- **Checkpoint Save/Restore** — new tools `checkpoint-save` and `checkpoint-restore` for temporary state snapshots in Redis (7-day TTL). Save progress mid-task and restore later.
|
|
56
|
+
- **Session Resume** — new `/resume` HTTP endpoint returns the last active session with tool history, enabling post-compaction recovery. SSE connections receive a `resume` event on reconnect.
|
|
57
|
+
- **Runtime Tool Broadcast** — dynamically registered tools now trigger `notifications/tools/list_changed` to all connected MCP clients, so IDEs see new tools without reconnecting.
|
|
58
|
+
- **Session CWD Injection** — file tools automatically inherit the session's working directory for correct relative path resolution in multi-session setups.
|
|
59
|
+
- **Session Cleanup** — proper cleanup of activity tracking and server references on session close, preventing memory leaks in long-running servers.
|
|
60
|
+
- **Compact Tool Descriptions** — reduced tool description sizes across all 103 tools to slow down context compaction in long sessions.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Usage Examples
|
|
65
|
+
|
|
66
|
+
### Using kemdiCode MCP tools from your AI agent prompt
|
|
67
|
+
|
|
68
|
+
You don't call these tools directly — your AI agent (Claude Code, Cursor, etc.) invokes them when you describe what you need. Here are real prompts and what happens behind the scenes:
|
|
69
|
+
|
|
70
|
+
**Code review before committing:**
|
|
71
|
+
```
|
|
72
|
+
You: "Review the auth module for security issues"
|
|
73
|
+
→ Agent calls: code-review --files "@src/auth/**/*.ts" --focus "security"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Fix a bug with AI assistance:**
|
|
77
|
+
```
|
|
78
|
+
You: "There's a race condition in the queue processor, find and fix it"
|
|
79
|
+
→ Agent calls: fix-bug --description "race condition in queue processor" --files "@src/queue/"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Save progress and restore later:**
|
|
83
|
+
```
|
|
84
|
+
You: "Save a checkpoint of the current refactoring state"
|
|
85
|
+
→ Agent calls: checkpoint-save --name "auth-refactor-v2" --content "<state>" --tags '["refactor","auth"]'
|
|
86
|
+
|
|
87
|
+
You: "Restore the auth refactoring checkpoint"
|
|
88
|
+
→ Agent calls: checkpoint-restore --name "auth-refactor-v2"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Multi-model comparison for architecture decisions:**
|
|
92
|
+
```
|
|
93
|
+
You: "Ask 3 models whether we should use event sourcing or CRUD for the order service"
|
|
94
|
+
→ Agent calls: consensus-prompt \
|
|
95
|
+
--prompt "Event sourcing vs CRUD for an order management service with 10k orders/day" \
|
|
96
|
+
--boardModels '["o:gpt-5","a:claude-sonnet-4-5","g:gemini-3-pro"]' \
|
|
97
|
+
--ceoModel "a:claude-opus-4-5:4k"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Project memory for persistent context:**
|
|
101
|
+
```
|
|
102
|
+
You: "Remember that we use JWT with RS256 for auth in this project"
|
|
103
|
+
→ Agent calls: write-memory --name "auth-strategy" --content "JWT with RS256, keys in /etc/keys/" --tags '["auth","architecture"]'
|
|
104
|
+
|
|
105
|
+
You: "What was our auth strategy?"
|
|
106
|
+
→ Agent calls: read-memory --name "auth-strategy"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Multi-agent task distribution:**
|
|
110
|
+
```
|
|
111
|
+
You: "Set up 3 agents: backend, frontend, QA. Backend works on the API, frontend on React components"
|
|
112
|
+
→ Agent calls: agent-register → task-create → task-push-multi
|
|
113
|
+
→ Agents coordinate via shared-thoughts and queue-message
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
51
118
|
## Highlights
|
|
52
119
|
|
|
53
120
|
| Capability | Description |
|
|
54
121
|
|:-----------|:------------|
|
|
55
|
-
| **
|
|
122
|
+
| **103 MCP Tools** | Code review, refactoring, testing, git, file management, AST editing, memory, checkpoints, kanban |
|
|
56
123
|
| **7 LLM Providers** | Native SDKs for OpenAI (GPT-5), Anthropic (Claude 4.5), Gemini (Gemini 3) + OpenAI-compatible for Groq, DeepSeek, Ollama, OpenRouter |
|
|
57
124
|
| **Multi-Agent** | Agents connect via HTTP, share context through Redis Pub/Sub, coordinate via kanban boards |
|
|
58
125
|
| **Parallel Multi-Model** | Send one prompt to N models simultaneously; CEO-and-Board consensus pattern |
|
|
@@ -271,7 +338,7 @@ ai-config --action test
|
|
|
271
338
|
|
|
272
339
|
## Tool Reference
|
|
273
340
|
|
|
274
|
-
> **
|
|
341
|
+
> **103 tools** across 20 categories.
|
|
275
342
|
|
|
276
343
|
| Category | # | Tools |
|
|
277
344
|
|:---------|:-:|:------|
|
|
@@ -281,7 +348,7 @@ ai-config --action test
|
|
|
281
348
|
| **Line Editing** | 4 | `insert-at-line` `delete-lines` `replace-lines` `replace-content` |
|
|
282
349
|
| **Symbol Editing** | 3 | `insert-before-symbol` `insert-after-symbol` `rename-symbol` |
|
|
283
350
|
| **Code Modification** | 5 | `fix-bug` `refactor` `auto-fix` `auto-fix-agent` `write-tests` |
|
|
284
|
-
| **Project Memory** |
|
|
351
|
+
| **Project Memory** | 7 | `write-memory` `read-memory` `list-memories` `edit-memory` `delete-memory` `checkpoint-save` `checkpoint-restore` |
|
|
285
352
|
| **Git** | 5 | `git-status` `git-diff` `git-log` `git-blame` `git-branch` |
|
|
286
353
|
| **File Operations** | 5 | `file-read` `file-write` `file-search` `file-tree` `file-diff` |
|
|
287
354
|
| **Project** | 5 | `project-info` `run-script` `run-tests` `run-lint` `check-types` |
|
|
@@ -300,44 +367,193 @@ ai-config --action test
|
|
|
300
367
|
|
|
301
368
|
## Architecture
|
|
302
369
|
|
|
370
|
+
### System Overview
|
|
371
|
+
|
|
372
|
+
```
|
|
373
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
374
|
+
│ IDE / AI Agent Layer │
|
|
375
|
+
│ │
|
|
376
|
+
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌───────────┐ │
|
|
377
|
+
│ │ Claude Code │ │ Cursor │ │ KiroCode │ │ RooCode │ │
|
|
378
|
+
│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ └─────┬─────┘ │
|
|
379
|
+
│ │ │ │ │ │
|
|
380
|
+
└──────────┼─────────────────┼─────────────────┼─────────────────┼─────────┘
|
|
381
|
+
│ SSE + JSON-RPC (MCP Protocol) │ │
|
|
382
|
+
└─────────────────┼─────────────────┘ │
|
|
383
|
+
▼ │
|
|
384
|
+
┌────────────────────────────────────────────────────────────────┐│
|
|
385
|
+
│ kemdiCode MCP Server (HTTP :3100) ││
|
|
386
|
+
│ ┌───────────────────────────────────────────────────────────┐ ││
|
|
387
|
+
│ │ Session Manager │◄┘│
|
|
388
|
+
│ │ • Per-client sessions with CWD isolation │ │
|
|
389
|
+
│ │ • Activity tracking (last tool, args, timestamp) │ │
|
|
390
|
+
│ │ • /resume endpoint for post-compaction recovery │ │
|
|
391
|
+
│ │ • SSE keep-alive + resume events on reconnect │ │
|
|
392
|
+
│ └───────────────────────┬───────────────────────────────────┘ │
|
|
393
|
+
│ ▼ │
|
|
394
|
+
│ ┌───────────────────────────────────────────────────────────┐ │
|
|
395
|
+
│ │ Tool Registry (103 tools) │ │
|
|
396
|
+
│ │ │ │
|
|
397
|
+
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │ │
|
|
398
|
+
│ │ │Code │ │File & │ │Git │ │Multi-Agent │ │ │
|
|
399
|
+
│ │ │Analysis │ │Editing │ │Operations│ │Coordination │ │ │
|
|
400
|
+
│ │ │(8 tools) │ │(12 tools)│ │(5 tools) │ │(13 tools) │ │ │
|
|
401
|
+
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────────┘ │ │
|
|
402
|
+
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │ │
|
|
403
|
+
│ │ │AI Agents │ │Kanban │ │Project │ │Memory & │ │ │
|
|
404
|
+
│ │ │& LLM │ │& Boards │ │Management│ │Checkpoints │ │ │
|
|
405
|
+
│ │ │(6 tools) │ │(16 tools)│ │(5 tools) │ │(7 tools) │ │ │
|
|
406
|
+
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────────┘ │ │
|
|
407
|
+
│ │ • Runtime registration with tools/list_changed broadcast │ │
|
|
408
|
+
│ │ • Zod schema validation + auto JSON Schema generation │ │
|
|
409
|
+
│ └───────────────────────┬───────────────────────────────────┘ │
|
|
410
|
+
│ ▼ │
|
|
411
|
+
│ ┌───────────────────────────────────────────────────────────┐ │
|
|
412
|
+
│ │ Provider Registry (7 providers) │ │
|
|
413
|
+
│ │ │ │
|
|
414
|
+
│ │ ┌─────────┐ ┌──────────┐ ┌────────┐ ┌────────────────┐ │ │
|
|
415
|
+
│ │ │ OpenAI │ │Anthropic │ │ Gemini │ │ OpenAI-compat │ │ │
|
|
416
|
+
│ │ │ (native)│ │ (native) │ │(native)│ │ Groq DeepSeek │ │ │
|
|
417
|
+
│ │ │ │ │ │ │ │ │ Ollama OpenRtr │ │ │
|
|
418
|
+
│ │ └─────────┘ └──────────┘ └────────┘ └────────────────┘ │ │
|
|
419
|
+
│ │ • Lazy init on first use • Hot-reload without restart │ │
|
|
420
|
+
│ │ • Unified thinking tokens: effort / budget / budget │ │
|
|
421
|
+
│ │ • Model spec syntax: provider:model:thinking │ │
|
|
422
|
+
│ └───────────────────────────────────────────────────────────┘ │
|
|
423
|
+
│ │
|
|
424
|
+
│ ┌───────────────────────────────────────────────────────────┐ │
|
|
425
|
+
│ │ Tree-sitter AST Engine │ │
|
|
426
|
+
│ │ • WASM parsers for 19 languages │ │
|
|
427
|
+
│ │ • Symbol navigation, rename, insert before/after │ │
|
|
428
|
+
│ │ • Indentation detection + context-aware editing │ │
|
|
429
|
+
│ └───────────────────────────────────────────────────────────┘ │
|
|
430
|
+
│ │
|
|
431
|
+
│ ┌───────────────────────────────────────────────────────────┐ │
|
|
432
|
+
│ │ Runtime Abstraction Layer │ │
|
|
433
|
+
│ │ • Auto-detects Bun vs Node.js at startup │ │
|
|
434
|
+
│ │ • Unified HTTP server (Bun.serve / node:http) │ │
|
|
435
|
+
│ │ • Unified process spawning (Bun.spawn / child_process) │ │
|
|
436
|
+
│ └───────────────────────────────────────────────────────────┘ │
|
|
437
|
+
└────────────────────────────┬────────────────────────────────────┘
|
|
438
|
+
│
|
|
439
|
+
▼
|
|
440
|
+
┌────────────────────────────────────────────────────────────────┐
|
|
441
|
+
│ Redis (DB 2) │
|
|
442
|
+
│ │
|
|
443
|
+
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────┐ │
|
|
444
|
+
│ │ Context │ │ Agents │ │ Kanban │ │
|
|
445
|
+
│ │ mcp:context: │ │ mcp:agents: │ │ mcp:kanban: │ │
|
|
446
|
+
│ │ mcp:memory: │ │ mcp:queue: │ │ workspace:<id> │ │
|
|
447
|
+
│ │ mcp:checkpoint│ │ mcp:messages:│ │ board:<id> │ │
|
|
448
|
+
│ └──────────────┘ └──────────────┘ │ task:<id> │ │
|
|
449
|
+
│ └──────────────────────┘ │
|
|
450
|
+
│ ┌─────────────────────────────────────────────────────────┐ │
|
|
451
|
+
│ │ Pub/Sub Channels │ │
|
|
452
|
+
│ │ mcp:channel:broadcast mcp:channel:inject:<agentId> │ │
|
|
453
|
+
│ │ mcp:channel:alerts mcp:channel:thoughts │ │
|
|
454
|
+
│ └─────────────────────────────────────────────────────────┘ │
|
|
455
|
+
└────────────────────────────────────────────────────────────────┘
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### Request Lifecycle
|
|
459
|
+
|
|
303
460
|
```
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
461
|
+
Client (IDE) kemdiCode MCP Redis / LLM
|
|
462
|
+
│ │ │
|
|
463
|
+
│── GET /sse ──────────────────►│ │
|
|
464
|
+
│◄── SSE: endpoint + resume ───│ create session, track activity │
|
|
465
|
+
│ │ │
|
|
466
|
+
│── POST /message ────────────►│ │
|
|
467
|
+
│ { tool: "code-review" } │ │
|
|
468
|
+
│ │── validate (Zod) ────────────►│
|
|
469
|
+
│ │── execute tool ──────────────►│
|
|
470
|
+
│ │ ├─ share result to Redis │
|
|
471
|
+
│ │ └─ record session activity │
|
|
472
|
+
│◄── SSE: result ─────────────│ │
|
|
473
|
+
│ │ │
|
|
474
|
+
│── POST /message ────────────►│ │
|
|
475
|
+
│ { tool: "ask-ai" } │── route to provider ────────►│
|
|
476
|
+
│ │◄── LLM response ────────────│
|
|
477
|
+
│◄── SSE: result ─────────────│ │
|
|
321
478
|
```
|
|
322
479
|
|
|
480
|
+
### Source Tree
|
|
481
|
+
|
|
323
482
|
```
|
|
324
483
|
src/
|
|
325
|
-
├── index.ts
|
|
484
|
+
├── index.ts # Entry point, CLI args, server bootstrap
|
|
485
|
+
├── constants.ts # Error messages, timeouts, limits
|
|
486
|
+
├── server/
|
|
487
|
+
│ ├── http-server.ts # HTTP routes: /sse, /message, /resume, /stream
|
|
488
|
+
│ ├── session-server.ts # MCP Server per session, CWD injection, activity tracking
|
|
489
|
+
│ ├── types.ts # ServerConfig, VERSION
|
|
490
|
+
│ └── index.ts # Public API exports
|
|
326
491
|
├── ai/
|
|
327
|
-
│ ├── client.ts
|
|
328
|
-
│ ├──
|
|
329
|
-
│ ├──
|
|
330
|
-
│ ├──
|
|
331
|
-
│
|
|
332
|
-
|
|
333
|
-
├──
|
|
334
|
-
├──
|
|
335
|
-
├──
|
|
336
|
-
├──
|
|
337
|
-
├──
|
|
338
|
-
|
|
339
|
-
├──
|
|
340
|
-
|
|
492
|
+
│ ├── client.ts # Completion router (multi-provider + fallback)
|
|
493
|
+
│ ├── execute.ts # High-level AI execution with agent prompts
|
|
494
|
+
│ ├── agents.ts # Agent configs: plan, build, explore
|
|
495
|
+
│ ├── model-spec.ts # Parser for provider:model:thinking syntax
|
|
496
|
+
│ ├── file-context.ts # File attachment → prompt injection
|
|
497
|
+
│ └── providers/
|
|
498
|
+
│ ├── types.ts # LLMProvider interface, ProviderId, ThinkingConfig
|
|
499
|
+
│ ├── registry.ts # Provider registry with lazy initialization
|
|
500
|
+
│ ├── openai.provider.ts # OpenAI (reasoning_effort)
|
|
501
|
+
│ ├── anthropic.provider.ts # Anthropic (thinking budget)
|
|
502
|
+
│ ├── gemini.provider.ts # Google GenAI (thinking budget)
|
|
503
|
+
│ └── openai-compat.provider.ts # Groq, DeepSeek, Ollama, OpenRouter
|
|
504
|
+
├── runtime/
|
|
505
|
+
│ ├── index.ts # isBun / isNode detection
|
|
506
|
+
│ ├── http.ts # Bun.serve ↔ node:http
|
|
507
|
+
│ ├── process.ts # Bun.spawn ↔ child_process
|
|
508
|
+
│ └── crypto.ts # Crypto utilities
|
|
509
|
+
├── context/
|
|
510
|
+
│ ├── agent-monitor.ts # Redis Pub/Sub for agent lifecycle
|
|
511
|
+
│ ├── storage.ts # Redis-based shared context (DB 2)
|
|
512
|
+
│ ├── feedback-loop.ts # Learning from iteration results
|
|
513
|
+
│ └── iteration-tracker.ts # Track fix attempts per issue
|
|
514
|
+
├── kanban/
|
|
515
|
+
│ ├── kanban-store.ts # Task CRUD with Redis persistence
|
|
516
|
+
│ ├── workspace-store.ts # Workspace operations
|
|
517
|
+
│ ├── board-store.ts # Board management
|
|
518
|
+
│ ├── membership-store.ts # Role-based access (owner/admin/member/viewer)
|
|
519
|
+
│ └── migration.ts # Lazy migration to multi-board schema
|
|
520
|
+
├── recursive/
|
|
521
|
+
│ └── tool-invoker.ts # Safe tool calls: max depth 2, rate-limited
|
|
522
|
+
├── tree-sitter/
|
|
523
|
+
│ ├── parser-manager.ts # WASM parser lifecycle (19 languages)
|
|
524
|
+
│ └── types.ts # Language mappings, symbol types
|
|
525
|
+
├── session/
|
|
526
|
+
│ ├── manager.ts # Session create/destroy lifecycle
|
|
527
|
+
│ └── cwd-resolver.ts # Project path resolution priority
|
|
528
|
+
├── tools/ # 20 categories, 103 tools
|
|
529
|
+
│ ├── registry.ts # UnifiedTool interface, Zod → JSON Schema, broadcast
|
|
530
|
+
│ ├── index.ts # Tool registration
|
|
531
|
+
│ ├── agents/ # 9 tools: register, watch, alert, inject, monitor...
|
|
532
|
+
│ ├── code/ # 8 tools: find-definition, rename-symbol, outline...
|
|
533
|
+
│ ├── context/ # 4 tools: shared-thoughts, feedback, shared-context
|
|
534
|
+
│ ├── edit/ # 4 tools: insert-at-line, delete/replace-lines
|
|
535
|
+
│ ├── file/ # 5 tools: read, write, search, tree, diff
|
|
536
|
+
│ ├── git/ # 5 tools: status, diff, log, blame, branch
|
|
537
|
+
│ ├── kanban/ # 16 tools: tasks, boards, workspaces
|
|
538
|
+
│ ├── memory/ # 7 tools: CRUD + checkpoint-save/restore
|
|
539
|
+
│ ├── multi-llm/ # 2 tools: multi-prompt, consensus-prompt
|
|
540
|
+
│ ├── project/ # 5 tools: info, scripts, tests, lint, types
|
|
541
|
+
│ ├── recursive/ # 3 tools: invoke-tool, invoke-batch, log
|
|
542
|
+
│ ├── specialized/ # 8 tools: code-review, fix-bug, refactor, write-tests
|
|
543
|
+
│ ├── session/ # 5 tools: CRUD + switch
|
|
544
|
+
│ ├── system/ # 10 tools: shell, env, memory, ai-config, ping
|
|
545
|
+
│ ├── loci/ # 4 tools: graph-query, find-path, recall, recommend
|
|
546
|
+
│ ├── mpc/ # 4 tools: split, distribute, reconstruct, status
|
|
547
|
+
│ └── rl/ # 2 tools: reward-stats, dopamine-log
|
|
548
|
+
└── utils/
|
|
549
|
+
├── commandExecutor.ts # Process spawning with timeout + kill
|
|
550
|
+
├── file-utils.ts # Read/write with encoding detection
|
|
551
|
+
├── edit-utils.ts # Line-based editing helpers
|
|
552
|
+
├── git-utils.ts # Git command builders
|
|
553
|
+
├── cache.ts # In-memory TTL cache
|
|
554
|
+
├── validation.ts # Rate limiting, input sanitization
|
|
555
|
+
├── errors.ts # Typed error classes
|
|
556
|
+
└── logger.ts # Structured logging
|
|
341
557
|
```
|
|
342
558
|
|
|
343
559
|
---
|
package/dist/ai/execute.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/ai/execute.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{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wBAAgB,mBAAmB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAM5D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAKhE;AAGD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/ai/execute.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* @license GPL-3.0
|
|
6
6
|
*/
|
|
7
7
|
import { complete, getClientConfig } from './client.js';
|
|
8
|
+
import { hasProviderPrefix } from './model-spec.js';
|
|
8
9
|
import { buildAgentMessages, getAgentTemperature, getAgentMaxTokens, } from './agents.js';
|
|
9
10
|
import { loadFileContexts, formatFileContextForPrompt } from './file-context.js';
|
|
10
11
|
// Simple in-memory session storage for conversation history
|
|
@@ -14,7 +15,10 @@ const sessionHistory = new Map();
|
|
|
14
15
|
*/
|
|
15
16
|
async function prepareAndExecute(options) {
|
|
16
17
|
const config = getClientConfig();
|
|
17
|
-
|
|
18
|
+
// Allow provider-prefixed models (e.g. "anthropic:claude-...") to work without
|
|
19
|
+
// initAIClient(). The multi-provider path in complete() does not require the
|
|
20
|
+
// OpenAI SDK client.
|
|
21
|
+
if (!config && !(options.model && hasProviderPrefix(options.model))) {
|
|
18
22
|
throw new Error('AI client not initialized. Call initAIClient() first.');
|
|
19
23
|
}
|
|
20
24
|
const startTime = Date.now();
|
package/dist/ai/execute.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../src/ai/execute.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,GAElB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAoDj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,KAAK,EAAE,CAAC;IACzB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAkB;IACtD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,cAAc,CAAC,IAAI,CAAC;AAC7B,CAAC;AAED,6DAA6D;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,kBAAkB,CAAC;AAS1B,OAAO,EAAW,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,kBAAkB,CAAC;AAS1B,OAAO,EAAW,KAAK,YAAY,EAA0D,MAAM,mBAAmB,CAAC;AAIvH,OAAO,EACL,OAAO,EACP,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;GAGG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAQ9C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,YAAY,CAG/E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,YAAY,CAGhD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,YAAY,CAM/C"}
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,8 @@ import { config } from './config/index.js';
|
|
|
49
49
|
import { initContext, initAgentMonitor, getSessionId } from './context/index.js';
|
|
50
50
|
import { initAIClient } from './ai/index.js';
|
|
51
51
|
import { registerBuiltinProviders, setProviderConfig } from './ai/providers/registry.js';
|
|
52
|
-
import { VERSION, startHttpServer, stopHttpServer } from './server/index.js';
|
|
52
|
+
import { VERSION, startHttpServer, stopHttpServer, broadcastNotification } from './server/index.js';
|
|
53
|
+
import { initToolsBroadcast } from './tools/registry.js';
|
|
53
54
|
// Re-export for backwards compatibility
|
|
54
55
|
export { VERSION, SSEEventType, } from './server/index.js';
|
|
55
56
|
export { sendSSEEvent, sendProgress, startProgress, stopProgress, updateProgressOutput, getProgressState, setProgressSSEResponse, deleteProgressState, } from './server/index.js';
|
|
@@ -199,6 +200,8 @@ async function main() {
|
|
|
199
200
|
process.on('SIGINT', () => shutdown('SIGINT'));
|
|
200
201
|
// Start HTTP server
|
|
201
202
|
await startHttpServer(serverConfig.host, serverConfig.port);
|
|
203
|
+
// Enable runtime tool registration notifications
|
|
204
|
+
initToolsBroadcast(() => broadcastNotification('notifications/tools/list_changed'));
|
|
202
205
|
}
|
|
203
206
|
main().catch((error) => {
|
|
204
207
|
Logger.error('Fatal:', error);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],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AC,CAAC,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;YAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,eAAe,CAAC,CAAC;QAChC,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE/C,oBAAoB;IACpB,MAAM,eAAe,CAAC,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAE5D,iDAAiD;IACjD,kBAAkB,CAAC,GAAG,EAAE,CAAC,qBAAqB,CAAC,kCAAkC,CAAC,CAAC,CAAC;AACtF,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC9B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-invoker.d.ts","sourceRoot":"","sources":["../../src/recursive/tool-invoker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAcH,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EAOlB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-invoker.d.ts","sourceRoot":"","sources":["../../src/recursive/tool-invoker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAcH,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EAOlB,MAAM,YAAY,CAAC;AA0CpB;;GAEG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,qBAAqB,EAC9B,MAAM,GAAE,gBAAiC,GACxC,OAAO,CAAC,iBAAiB,CAAC,CAiF5B;AAED;;GAEG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,qBAAqB,EAC9B,MAAM,GAAE,gBAAiC,GACxC,OAAO,CAAC,oBAAoB,CAAC,CAiK/B;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,qBAAqB,EAAE,EACjC,MAAM,GAAE,gBAAiC,EACzC,QAAQ,GAAE,OAAc,GACvB,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAajC;AA8BD;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,MAAW,GACjB,OAAO,CACR,KAAK,CAAC;IACJ,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC,CACH,CAWA;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAE3E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAElD"}
|
|
@@ -30,12 +30,27 @@ import { DEFAULT_POLICY, RECURSIVE_KEYS, INVOCATION_TTL, RATE_LIMIT_WINDOW, MAX_
|
|
|
30
30
|
/** Current invocation context (per-request) */
|
|
31
31
|
const contextStack = new Map();
|
|
32
32
|
const getRedis = getSharedRedis;
|
|
33
|
+
/**
|
|
34
|
+
* Try to get Redis client, returning null if unavailable.
|
|
35
|
+
*/
|
|
36
|
+
async function tryGetRedis() {
|
|
37
|
+
try {
|
|
38
|
+
return await getRedis();
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
33
44
|
/**
|
|
34
45
|
* Read and normalize rate limit entry from Redis.
|
|
35
46
|
* Resets the window if expired.
|
|
47
|
+
* Returns default entry if Redis is unavailable.
|
|
36
48
|
*/
|
|
37
49
|
async function getRateLimitEntry(agentId) {
|
|
38
|
-
const client = await
|
|
50
|
+
const client = await tryGetRedis();
|
|
51
|
+
if (!client) {
|
|
52
|
+
return { count: 0, windowStart: Date.now() };
|
|
53
|
+
}
|
|
39
54
|
const rateLimitKey = RECURSIVE_KEYS.rateLimit(agentId);
|
|
40
55
|
const data = await client.get(rateLimitKey);
|
|
41
56
|
let entry = { count: 0, windowStart: Date.now() };
|
|
@@ -142,13 +157,22 @@ export async function invokeTool(request, policy = DEFAULT_POLICY) {
|
|
|
142
157
|
// For now, we'll allow but log a warning
|
|
143
158
|
Logger.warn(`invoke-tool: ${request.toolName} requires approval, proceeding anyway`);
|
|
144
159
|
}
|
|
145
|
-
const client = await
|
|
160
|
+
const client = await tryGetRedis();
|
|
161
|
+
let redisAvailable = !!client;
|
|
146
162
|
try {
|
|
147
|
-
// Update rate limit
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
163
|
+
// Update rate limit (skip if Redis unavailable)
|
|
164
|
+
if (client) {
|
|
165
|
+
try {
|
|
166
|
+
const rateEntry = await getRateLimitEntry(request.agentId);
|
|
167
|
+
rateEntry.count++;
|
|
168
|
+
const rateLimitKey = RECURSIVE_KEYS.rateLimit(request.agentId);
|
|
169
|
+
await client.setex(rateLimitKey, 120, JSON.stringify(rateEntry));
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
redisAvailable = false;
|
|
173
|
+
Logger.warn('invoke-tool: Redis rate limit update failed, continuing without persistence');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
152
176
|
// Set up context
|
|
153
177
|
const parentContext = contextStack.get(request.agentId);
|
|
154
178
|
const context = {
|
|
@@ -158,13 +182,20 @@ export async function invokeTool(request, policy = DEFAULT_POLICY) {
|
|
|
158
182
|
startTime,
|
|
159
183
|
};
|
|
160
184
|
contextStack.set(request.agentId, context);
|
|
161
|
-
// Store invocation data
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
185
|
+
// Store invocation data (skip if Redis unavailable)
|
|
186
|
+
if (client && redisAvailable) {
|
|
187
|
+
try {
|
|
188
|
+
await client.setex(RECURSIVE_KEYS.invocation(invocationId), INVOCATION_TTL, JSON.stringify({
|
|
189
|
+
...request,
|
|
190
|
+
invocationId,
|
|
191
|
+
depth: context.currentDepth,
|
|
192
|
+
startTime,
|
|
193
|
+
}));
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
Logger.warn('invoke-tool: Redis invocation storage failed, continuing without persistence');
|
|
197
|
+
}
|
|
198
|
+
}
|
|
168
199
|
// Get and execute tool
|
|
169
200
|
const tool = getToolByName(request.toolName);
|
|
170
201
|
if (!tool) {
|
|
@@ -172,7 +203,7 @@ export async function invokeTool(request, policy = DEFAULT_POLICY) {
|
|
|
172
203
|
}
|
|
173
204
|
const result = await executeTool(request.toolName, request.args);
|
|
174
205
|
const duration = Date.now() - startTime;
|
|
175
|
-
// Log invocation
|
|
206
|
+
// Log invocation (best-effort)
|
|
176
207
|
await logInvocation(request.agentId, {
|
|
177
208
|
invocationId,
|
|
178
209
|
toolName: request.toolName,
|
|
@@ -198,27 +229,36 @@ export async function invokeTool(request, policy = DEFAULT_POLICY) {
|
|
|
198
229
|
// Result is not JSON (e.g., ping returns plain text)
|
|
199
230
|
parsedResult = result;
|
|
200
231
|
}
|
|
201
|
-
|
|
232
|
+
const invocationResult = {
|
|
202
233
|
invocationId,
|
|
203
234
|
success: true,
|
|
204
235
|
result: parsedResult,
|
|
205
236
|
duration,
|
|
206
237
|
depth: context.currentDepth,
|
|
207
238
|
};
|
|
239
|
+
if (!redisAvailable) {
|
|
240
|
+
invocationResult.warning = 'Redis unavailable - rate limiting and logging degraded';
|
|
241
|
+
}
|
|
242
|
+
return invocationResult;
|
|
208
243
|
}
|
|
209
244
|
catch (error) {
|
|
210
245
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
211
246
|
const duration = Date.now() - startTime;
|
|
212
|
-
// Log failed invocation
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
247
|
+
// Log failed invocation (best-effort, do not throw)
|
|
248
|
+
try {
|
|
249
|
+
await logInvocation(request.agentId, {
|
|
250
|
+
invocationId,
|
|
251
|
+
toolName: request.toolName,
|
|
252
|
+
success: false,
|
|
253
|
+
error: errorMessage,
|
|
254
|
+
duration,
|
|
255
|
+
depth: safety.currentDepth || 0,
|
|
256
|
+
timestamp: startTime,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
catch {
|
|
260
|
+
Logger.warn('invoke-tool: Failed to log invocation error to Redis');
|
|
261
|
+
}
|
|
222
262
|
// Restore context
|
|
223
263
|
const parentContext = contextStack.get(request.agentId);
|
|
224
264
|
if (parentContext && parentContext.currentDepth > 0) {
|
|
@@ -263,7 +303,11 @@ export async function invokeBatch(requests, policy = DEFAULT_POLICY, parallel =
|
|
|
263
303
|
* Log an invocation
|
|
264
304
|
*/
|
|
265
305
|
async function logInvocation(agentId, entry) {
|
|
266
|
-
const client = await
|
|
306
|
+
const client = await tryGetRedis();
|
|
307
|
+
if (!client) {
|
|
308
|
+
Logger.debug('invoke-tool: Redis unavailable, skipping invocation log');
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
267
311
|
const logKey = RECURSIVE_KEYS.log(agentId);
|
|
268
312
|
await client.lpush(logKey, JSON.stringify(entry));
|
|
269
313
|
await client.ltrim(logKey, 0, MAX_LOG_ENTRIES - 1);
|
|
@@ -273,7 +317,11 @@ async function logInvocation(agentId, entry) {
|
|
|
273
317
|
* Get invocation log for an agent
|
|
274
318
|
*/
|
|
275
319
|
export async function getInvocationLog(agentId, limit = 20) {
|
|
276
|
-
const client = await
|
|
320
|
+
const client = await tryGetRedis();
|
|
321
|
+
if (!client) {
|
|
322
|
+
Logger.debug('invoke-tool: Redis unavailable, returning empty invocation log');
|
|
323
|
+
return [];
|
|
324
|
+
}
|
|
277
325
|
const logKey = RECURSIVE_KEYS.log(agentId);
|
|
278
326
|
const entries = await client.lrange(logKey, 0, limit - 1);
|
|
279
327
|
return entries.map((e) => JSON.parse(e));
|