Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6ddda58
feat(ai): integrate Model Context Protocol (MCP) server, tools, and t…
oksbwn Sep 13, 2026
2fa6f3b
style(mcp): add theme-aware CSS design system for MCP Settings and To…
oksbwn Sep 13, 2026
ef9c8bd
fix(mcp): handle IPC response object structure in MCPToolsPage listTo…
oksbwn Sep 13, 2026
6b5ba9c
fix(menu): remove MCP Tools & Capabilities from AI menu, keeping unde…
oksbwn Sep 13, 2026
ed3238a
refactor(mcp): repurpose AI health into MCP diagnostics
oksbwn Sep 14, 2026
ad7cfe6
Random Files
oksbwn Sep 14, 2026
4eeda16
feat(mcp): align diagnostics UI and add copy feature
oksbwn Sep 14, 2026
a8e7a1c
fix(mcp): add session registration and telemetry table migration
oksbwn Sep 14, 2026
ad21220
fix(mcp): resolve SSE transport crash and revamp tools UI
oksbwn Sep 14, 2026
927c011
docs(mcp): add developer mcp architecture guide and update applicatio…
oksbwn Sep 14, 2026
8162997
docs: update VitePress sidebar, architecture, and MCP links
oksbwn Sep 14, 2026
00d2abb
feat(mcp): expand tool suites, write toggle, telemetry flight log, le…
oksbwn Sep 14, 2026
6679499
docs(mcp): document 50 MCP tools across 10 capability suites and upda…
oksbwn Sep 14, 2026
73038cb
feat(mcp): expand tool registry to 50 tools and fix AI capability bin…
oksbwn Sep 14, 2026
0f0a156
feat(mcp): expand toolset to 123 tools and add write-mode gating
oksbwn Sep 14, 2026
22b33d7
feat(mcp): add dedicated excalidraw diagram suite
oksbwn Sep 14, 2026
6aa70b7
feat(mcp): harden path resolution, add workspace tools
oksbwn Sep 14, 2026
70e7744
fix: remove unused variables to satisfy max-warnings 0
oksbwn Sep 14, 2026
5869f34
fix(docs): escape markdown links in notes.get_links description
oksbwn Sep 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 1 addition & 80 deletions ai/core/AIService.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,12 @@ class AIService {

try {
log.info('Initializing AI Service...');
// Dynamic require of index.js bootstrap to initialize the agent
const { initializeAISystem } = require('../index.js');
const result = await initializeAISystem(appDataDir, workspaceRoot, llmProvider, embeddingConfig);
const { getAIAgent } = require('../index.js');
this.agent = getAIAgent();

const AIFlow = require('./AIFlow');
this.aiFlow = new AIFlow(this.agent);
this.agent.aiFlow = this.aiFlow;

log.info('AI Service & AIFlow Orchestrator successfully initialized');
log.info('AI Service successfully initialized (embeddings + graph ready)');
return result;
} catch (error) {
log.error('Failed to initialize AI Service:', error.message);
Expand Down Expand Up @@ -120,14 +115,12 @@ class AIService {
const { shutdownAISystem } = require('../index.js');
shutdownAISystem();
this.agent = null;
this.aiFlow = null;
}

shutdown() {
const { shutdownAISystem } = require('../index.js');
shutdownAISystem();
this.agent = null;
this.aiFlow = null;
log.info('AI Service shut down');
}

Expand Down Expand Up @@ -227,78 +220,6 @@ class AIService {
}
}

async chat(message, context = {}) {
if (!this.enabled || !this.agent) {
throw new Error('AI is currently disabled or uninitialized.');
}
if (!this.aiFlow) {
const AIFlow = require('./AIFlow');
this.aiFlow = new AIFlow(this.agent);
this.agent.aiFlow = this.aiFlow;
}
return this.aiFlow.execute(message, context);
}

/**
* Main chat query streaming wrapper
*/
async stream(message, context = {}, onChunk, abortSignal) {
if (!this.enabled || !this.agent) {
throw new Error('AI is currently disabled or uninitialized.');
}
if (!this.aiFlow) {
const AIFlow = require('./AIFlow');
this.aiFlow = new AIFlow(this.agent);
this.agent.aiFlow = this.aiFlow;
}
return this.aiFlow.stream(message, context, onChunk, abortSignal);
}

// --- Facade API Methods for Subsystem Modules ---

getGraphStatus() {
return this.agent?.graphDb ? this.agent.graphDb.getStatus() : null;
}

getGraphData() {
return this.agent?.graphDb ? this.agent.graphDb.getAll() : null;
}

clearGraphData() {
if (this.agent?.graphDb) {
this.agent.graphDb.clearAllData();
}
}

async buildGraph(onProgress) {
return this.agent ? this.agent.buildRelationshipGraph(onProgress) : { success: false, error: 'Agent not initialized' };
}

getEmbeddingStats() {
return this.agent?.embeddingDb ? this.agent.embeddingDb.getStats() : null;
}

clearEmbeddingData() {
if (this.agent?.embeddingDb) {
this.agent.embeddingDb.clearAllData();
}
}

async generateEmbeddings(forceRefresh = false) {
return this.agent ? this.agent.generateEmbeddings(forceRefresh) : { success: false, error: 'Agent not initialized' };
}

detectPatterns() {
return this.agent ? this.agent.detectPatterns() : { success: false, error: 'Agent not initialized' };
}

getConversationStore() {
return this.agent?.conversationStore || null;
}

getPersonaManager() {
return this.agent?.personaManager || null;
}
}

const aiServiceInstance = new AIService();
Expand Down
32 changes: 1 addition & 31 deletions ai/core/Agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,39 +117,9 @@ class Agent {
}
}

/**
* Process a query via AIFlow orchestrator
*/
async query(userQuery, context = {}) {
if (!this.isInitialized) {
throw new Error('Agent not initialized');
}

if (this.aiFlow) {
return this.aiFlow.execute(userQuery, context);
}
// query() and stream() removed — chat moved to MCP layer

const AIFlow = require('./AIFlow');
this.aiFlow = new AIFlow(this);
return this.aiFlow.execute(userQuery, context);
}

/**
* Process a query with streaming output via AIFlow orchestrator
*/
async stream(userQuery, context = {}, onChunk, abortSignal) {
if (!this.isInitialized) {
throw new Error('Agent not initialized');
}

if (this.aiFlow) {
return this.aiFlow.stream(userQuery, context, onChunk, abortSignal);
}

const AIFlow = require('./AIFlow');
this.aiFlow = new AIFlow(this);
return this.aiFlow.stream(userQuery, context, onChunk, abortSignal);
}

/**
* Generate embeddings for workspace
Expand Down
Loading
Loading