feat: Integrate GitHub Copilot SDK and LangChain for provider-independent orchestration
- Added @github/copilot-sdk and related dependencies for GitHub Copilot integration. - Implemented ChatCopilot adapter for LangChain compatibility. - Created LLM factory to return provider-specific models (OpenAI, Anthropic, Copilot). - Developed Orchestrator agent using LangGraph for intent routing and context assembly. - Enhanced IPC communication for streaming AI responses to the renderer. - Updated progress documentation with implementation details and learnings.
This commit is contained in:
@@ -6,8 +6,10 @@ import { getDb } from '../db';
|
||||
import { clients, projects, tasks, checkpoints, notes, taskComments } from '../db/schema';
|
||||
import { getStore } from '../store';
|
||||
import { saveTokenAndInit, hasActiveToken } from '../ai/provider';
|
||||
import { orchestrate } from '../ai/orchestrator';
|
||||
import type { TRPCContext } from '../ipc';
|
||||
|
||||
const t = initTRPC.create();
|
||||
const t = initTRPC.context<TRPCContext>().create();
|
||||
|
||||
const router = t.router;
|
||||
const publicProcedure = t.procedure;
|
||||
@@ -492,7 +494,18 @@ const aiRouter = router({
|
||||
projectId: z.string().optional(),
|
||||
}),
|
||||
}))
|
||||
.mutation(() => ({ response: '' })),
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
try {
|
||||
return await orchestrate({
|
||||
message: input.message,
|
||||
context: input.context,
|
||||
sender: ctx.sender,
|
||||
});
|
||||
} catch (err) {
|
||||
const msg = err instanceof Error ? err.message : 'Unknown error';
|
||||
return { response: '', error: msg };
|
||||
}
|
||||
}),
|
||||
setToken: publicProcedure
|
||||
.input(z.object({ token: z.string() }))
|
||||
.mutation(async ({ input }) => {
|
||||
|
||||
Reference in New Issue
Block a user