feat: Master Orchestrator — persistent chat with full project context and awareness tools
Made-with: Cursor
This commit is contained in:
27
dist/server.js
vendored
27
dist/server.js
vendored
@@ -45,6 +45,7 @@ const child_process_1 = require("child_process");
|
||||
const job_store_1 = require("./job-store");
|
||||
const agent_runner_1 = require("./agent-runner");
|
||||
const agents_1 = require("./agents");
|
||||
const orchestrator_1 = require("./orchestrator");
|
||||
const app = (0, express_1.default)();
|
||||
app.use((0, cors_1.default)());
|
||||
// Raw body capture for webhook HMAC — must come before express.json()
|
||||
@@ -155,6 +156,32 @@ app.get('/api/jobs/:id', (req, res) => {
|
||||
}
|
||||
res.json(job);
|
||||
});
|
||||
// ---------------------------------------------------------------------------
|
||||
// Orchestrator — persistent chat with full project context
|
||||
// ---------------------------------------------------------------------------
|
||||
app.post('/orchestrator/chat', async (req, res) => {
|
||||
const { message, session_id } = req.body;
|
||||
if (!message) {
|
||||
res.status(400).json({ error: '"message" is required' });
|
||||
return;
|
||||
}
|
||||
const sessionId = session_id || `session_${Date.now()}`;
|
||||
const ctx = buildContext();
|
||||
try {
|
||||
const result = await (0, orchestrator_1.orchestratorChat)(sessionId, message, ctx);
|
||||
res.json(result);
|
||||
}
|
||||
catch (err) {
|
||||
res.status(500).json({ error: err instanceof Error ? err.message : String(err) });
|
||||
}
|
||||
});
|
||||
app.get('/orchestrator/sessions', (_req, res) => {
|
||||
res.json((0, orchestrator_1.listSessions)());
|
||||
});
|
||||
app.delete('/orchestrator/sessions/:id', (req, res) => {
|
||||
(0, orchestrator_1.clearSession)(req.params.id);
|
||||
res.json({ cleared: req.params.id });
|
||||
});
|
||||
// List recent jobs
|
||||
app.get('/api/jobs', (req, res) => {
|
||||
const limit = parseInt(req.query.limit || '20', 10);
|
||||
|
||||
Reference in New Issue
Block a user