@stackbilt/aegis-core 0.1.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/package.json +96 -0
- package/schema.sql +586 -0
- package/src/adapters/voice/cloudflare-agent.ts +34 -0
- package/src/auth.ts +124 -0
- package/src/bluesky.ts +464 -0
- package/src/claude-tools/content.ts +188 -0
- package/src/claude-tools/email.ts +69 -0
- package/src/claude-tools/github.ts +440 -0
- package/src/claude-tools/goals.ts +116 -0
- package/src/claude-tools/index.ts +353 -0
- package/src/claude-tools/web.ts +59 -0
- package/src/claude.ts +406 -0
- package/src/codebeast.ts +200 -0
- package/src/composite.ts +715 -0
- package/src/content/column.ts +80 -0
- package/src/content/hero-image.ts +47 -0
- package/src/content/index.ts +27 -0
- package/src/content/journal.ts +91 -0
- package/src/content/roundtable.ts +163 -0
- package/src/core.ts +309 -0
- package/src/dashboard.ts +620 -0
- package/src/decision-docs.ts +284 -0
- package/src/dispatch.ts +13 -0
- package/src/edge-env.ts +58 -0
- package/src/email.ts +850 -0
- package/src/exports.ts +156 -0
- package/src/github-projects.ts +312 -0
- package/src/github.ts +670 -0
- package/src/groq.ts +247 -0
- package/src/health-page.ts +578 -0
- package/src/index.ts +89 -0
- package/src/kernel/argus-actions.ts +397 -0
- package/src/kernel/argus-correlation.ts +639 -0
- package/src/kernel/board.ts +91 -0
- package/src/kernel/briefing.ts +177 -0
- package/src/kernel/classify-memory-topic.ts +166 -0
- package/src/kernel/cognition.ts +377 -0
- package/src/kernel/court-cards.ts +163 -0
- package/src/kernel/dispatch.ts +587 -0
- package/src/kernel/domain.ts +50 -0
- package/src/kernel/dynamic-tools.ts +322 -0
- package/src/kernel/executor-port.ts +45 -0
- package/src/kernel/executors/claude.ts +73 -0
- package/src/kernel/executors/direct.ts +237 -0
- package/src/kernel/executors/groq.ts +18 -0
- package/src/kernel/executors/index.ts +87 -0
- package/src/kernel/executors/tarotscript.ts +104 -0
- package/src/kernel/executors/workers-ai.ts +54 -0
- package/src/kernel/insight-cache.ts +76 -0
- package/src/kernel/memory/agenda.ts +200 -0
- package/src/kernel/memory/blocks.ts +188 -0
- package/src/kernel/memory/consolidation.ts +194 -0
- package/src/kernel/memory/episodic.ts +241 -0
- package/src/kernel/memory/goals.ts +156 -0
- package/src/kernel/memory/graph.ts +290 -0
- package/src/kernel/memory/index.ts +11 -0
- package/src/kernel/memory/insights.ts +316 -0
- package/src/kernel/memory/procedural.ts +467 -0
- package/src/kernel/memory/pruning.ts +67 -0
- package/src/kernel/memory/recall.ts +367 -0
- package/src/kernel/memory/semantic.ts +315 -0
- package/src/kernel/memory/synthesis.ts +161 -0
- package/src/kernel/memory-adapter.ts +369 -0
- package/src/kernel/memory-guardrails.ts +76 -0
- package/src/kernel/port.ts +23 -0
- package/src/kernel/resilience.ts +322 -0
- package/src/kernel/router.ts +471 -0
- package/src/kernel/scheduled/agent-dispatch.ts +252 -0
- package/src/kernel/scheduled/argus-analytics.ts +247 -0
- package/src/kernel/scheduled/argus-heartbeat.ts +320 -0
- package/src/kernel/scheduled/argus-notify.ts +348 -0
- package/src/kernel/scheduled/board-sync.ts +110 -0
- package/src/kernel/scheduled/ci-watcher.ts +125 -0
- package/src/kernel/scheduled/cognitive-metrics.ts +377 -0
- package/src/kernel/scheduled/consolidation.ts +229 -0
- package/src/kernel/scheduled/content-drip.ts +47 -0
- package/src/kernel/scheduled/content.ts +6 -0
- package/src/kernel/scheduled/conversation-facts.ts +204 -0
- package/src/kernel/scheduled/cost-report.ts +84 -0
- package/src/kernel/scheduled/curiosity.ts +219 -0
- package/src/kernel/scheduled/dev-activity.ts +44 -0
- package/src/kernel/scheduled/digest.ts +317 -0
- package/src/kernel/scheduled/dreaming/agenda-triage.ts +115 -0
- package/src/kernel/scheduled/dreaming/facts.ts +239 -0
- package/src/kernel/scheduled/dreaming/index.ts +8 -0
- package/src/kernel/scheduled/dreaming/llm.ts +33 -0
- package/src/kernel/scheduled/dreaming/pattern-synthesis.ts +124 -0
- package/src/kernel/scheduled/dreaming/persona.ts +75 -0
- package/src/kernel/scheduled/dreaming/symbolic.ts +31 -0
- package/src/kernel/scheduled/dreaming/task-proposals.ts +80 -0
- package/src/kernel/scheduled/dreaming.ts +66 -0
- package/src/kernel/scheduled/entropy.ts +149 -0
- package/src/kernel/scheduled/escalation.ts +192 -0
- package/src/kernel/scheduled/feed-watcher.ts +206 -0
- package/src/kernel/scheduled/goals.ts +214 -0
- package/src/kernel/scheduled/governance.ts +41 -0
- package/src/kernel/scheduled/heartbeat.ts +220 -0
- package/src/kernel/scheduled/inbox-processor.ts +174 -0
- package/src/kernel/scheduled/index.ts +245 -0
- package/src/kernel/scheduled/issue-proposer.ts +478 -0
- package/src/kernel/scheduled/issue-watcher.ts +128 -0
- package/src/kernel/scheduled/pr-automerge.ts +213 -0
- package/src/kernel/scheduled/product-health.ts +107 -0
- package/src/kernel/scheduled/reflection.ts +373 -0
- package/src/kernel/scheduled/self-improvement.ts +114 -0
- package/src/kernel/scheduled/social-engage.ts +175 -0
- package/src/kernel/scheduled/task-audit.ts +60 -0
- package/src/kernel/symbolic.ts +156 -0
- package/src/kernel/types.ts +145 -0
- package/src/landing.ts +1190 -0
- package/src/lib/audit-chain/chain.ts +28 -0
- package/src/lib/audit-chain/types.ts +12 -0
- package/src/lib/observability/errors.ts +55 -0
- package/src/markdown.ts +164 -0
- package/src/mcp/handlers.ts +647 -0
- package/src/mcp/server.ts +184 -0
- package/src/mcp/tools.ts +316 -0
- package/src/mcp-client.ts +275 -0
- package/src/mcp-server.ts +2 -0
- package/src/operator/config.example.ts +60 -0
- package/src/operator/config.ts +60 -0
- package/src/operator/index.ts +46 -0
- package/src/operator/persona.example.ts +34 -0
- package/src/operator/persona.ts +34 -0
- package/src/operator/prompt-builder.ts +190 -0
- package/src/operator/types.ts +43 -0
- package/src/pulse.ts +1179 -0
- package/src/routes/bluesky.ts +116 -0
- package/src/routes/cc-tasks.ts +328 -0
- package/src/routes/codebeast.ts +1 -0
- package/src/routes/content.ts +194 -0
- package/src/routes/conversations.ts +25 -0
- package/src/routes/dynamic-tools.ts +111 -0
- package/src/routes/feedback.ts +192 -0
- package/src/routes/health.ts +147 -0
- package/src/routes/messages.ts +228 -0
- package/src/routes/observability.ts +82 -0
- package/src/routes/operator-logs.ts +42 -0
- package/src/routes/pages.ts +96 -0
- package/src/routes/sessions.ts +54 -0
- package/src/sanitize.ts +73 -0
- package/src/schema-enums.ts +155 -0
- package/src/search.ts +112 -0
- package/src/task-intelligence.ts +497 -0
- package/src/types.ts +194 -0
- package/src/ui.ts +5 -0
- package/src/version.ts +3 -0
- package/src/workers-ai-chat.ts +333 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type { EdgeEnv } from '../kernel/dispatch.js';
|
|
2
|
+
import { TOOLS } from './tools.js';
|
|
3
|
+
import {
|
|
4
|
+
toolAegisChat,
|
|
5
|
+
toolAegisConversations,
|
|
6
|
+
toolAegisConversationHistory,
|
|
7
|
+
toolAegisAgenda,
|
|
8
|
+
toolAegisHealth,
|
|
9
|
+
toolAegisMemory,
|
|
10
|
+
toolAegisRecordMemory,
|
|
11
|
+
toolAegisForgetMemory,
|
|
12
|
+
toolAegisAddAgenda,
|
|
13
|
+
toolAegisResolveAgenda,
|
|
14
|
+
toolAegisAddGoal,
|
|
15
|
+
toolAegisUpdateGoal,
|
|
16
|
+
toolAegisListGoals,
|
|
17
|
+
toolAegisCcSessions,
|
|
18
|
+
toolAegisCreateCcTask,
|
|
19
|
+
toolAegisListCcTasks,
|
|
20
|
+
toolAegisCancelCcTask,
|
|
21
|
+
toolAegisApproveCcTask,
|
|
22
|
+
toolAegisTaskSummary,
|
|
23
|
+
toolAegisBatchApprove,
|
|
24
|
+
toolAegisPublishTechPost,
|
|
25
|
+
toolAegisGenerateDecisionDoc,
|
|
26
|
+
toolAegisCreateDynamicTool,
|
|
27
|
+
toolAegisInvokeDynamicTool,
|
|
28
|
+
toolAegisListDynamicTools,
|
|
29
|
+
type ToolResult,
|
|
30
|
+
} from './handlers.js';
|
|
31
|
+
|
|
32
|
+
// ─── MCP Protocol ───────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
const PROTOCOL_VERSION = '2025-03-26';
|
|
35
|
+
const SERVER_INFO = { name: 'aegis', version: '0.1.0' };
|
|
36
|
+
|
|
37
|
+
// ─── JSON-RPC Types ─────────────────────────────────────────
|
|
38
|
+
|
|
39
|
+
interface JsonRpcRequest {
|
|
40
|
+
jsonrpc: '2.0';
|
|
41
|
+
id?: string | number | null;
|
|
42
|
+
method: string;
|
|
43
|
+
params?: Record<string, unknown>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
interface JsonRpcResponse {
|
|
47
|
+
jsonrpc: '2.0';
|
|
48
|
+
id: string | number | null;
|
|
49
|
+
result?: unknown;
|
|
50
|
+
error?: { code: number; message: string; data?: unknown };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ─── Tool Dispatch ──────────────────────────────────────────
|
|
54
|
+
|
|
55
|
+
async function executeTool(name: string, args: Record<string, unknown>, env: EdgeEnv): Promise<ToolResult> {
|
|
56
|
+
switch (name) {
|
|
57
|
+
case 'aegis_chat': return toolAegisChat(args, env);
|
|
58
|
+
case 'aegis_conversations': return toolAegisConversations(args, env);
|
|
59
|
+
case 'aegis_conversation_history': return toolAegisConversationHistory(args, env);
|
|
60
|
+
case 'aegis_agenda': return toolAegisAgenda(args, env);
|
|
61
|
+
case 'aegis_health': return toolAegisHealth(env);
|
|
62
|
+
case 'aegis_memory': return toolAegisMemory(args, env);
|
|
63
|
+
case 'aegis_record_memory': return toolAegisRecordMemory(args, env);
|
|
64
|
+
case 'aegis_forget_memory': return toolAegisForgetMemory(args, env);
|
|
65
|
+
case 'aegis_add_agenda': return toolAegisAddAgenda(args, env);
|
|
66
|
+
case 'aegis_resolve_agenda': return toolAegisResolveAgenda(args, env);
|
|
67
|
+
case 'aegis_add_goal': return toolAegisAddGoal(args, env);
|
|
68
|
+
case 'aegis_update_goal': return toolAegisUpdateGoal(args, env);
|
|
69
|
+
case 'aegis_list_goals': return toolAegisListGoals(args, env);
|
|
70
|
+
case 'aegis_cc_sessions': return toolAegisCcSessions(args, env);
|
|
71
|
+
case 'aegis_create_cc_task': return toolAegisCreateCcTask(args, env);
|
|
72
|
+
case 'aegis_list_cc_tasks': return toolAegisListCcTasks(args, env);
|
|
73
|
+
case 'aegis_cancel_cc_task': return toolAegisCancelCcTask(args, env);
|
|
74
|
+
case 'aegis_approve_cc_task': return toolAegisApproveCcTask(args, env);
|
|
75
|
+
case 'aegis_task_summary': return toolAegisTaskSummary(env);
|
|
76
|
+
case 'aegis_batch_approve': return toolAegisBatchApprove(args, env);
|
|
77
|
+
case 'aegis_publish_tech_post': return toolAegisPublishTechPost(args, env);
|
|
78
|
+
case 'aegis_generate_decision_doc': return toolAegisGenerateDecisionDoc(args, env);
|
|
79
|
+
case 'aegis_create_dynamic_tool': return toolAegisCreateDynamicTool(args, env);
|
|
80
|
+
case 'aegis_invoke_dynamic_tool': return toolAegisInvokeDynamicTool(args, env);
|
|
81
|
+
case 'aegis_list_dynamic_tools': return toolAegisListDynamicTools(args, env);
|
|
82
|
+
default: return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ─── JSON-RPC Routing ───────────────────────────────────────
|
|
87
|
+
|
|
88
|
+
async function handleMethod(req: JsonRpcRequest, env: EdgeEnv): Promise<JsonRpcResponse | null> {
|
|
89
|
+
// Notifications (no id) — acknowledge silently
|
|
90
|
+
if (req.id === undefined || req.id === null) return null;
|
|
91
|
+
|
|
92
|
+
switch (req.method) {
|
|
93
|
+
case 'initialize':
|
|
94
|
+
return {
|
|
95
|
+
jsonrpc: '2.0',
|
|
96
|
+
id: req.id,
|
|
97
|
+
result: {
|
|
98
|
+
protocolVersion: PROTOCOL_VERSION,
|
|
99
|
+
capabilities: { tools: { listChanged: false } },
|
|
100
|
+
serverInfo: SERVER_INFO,
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
case 'ping':
|
|
105
|
+
return { jsonrpc: '2.0', id: req.id, result: {} };
|
|
106
|
+
|
|
107
|
+
case 'tools/list':
|
|
108
|
+
return { jsonrpc: '2.0', id: req.id, result: { tools: TOOLS } };
|
|
109
|
+
|
|
110
|
+
case 'tools/call': {
|
|
111
|
+
const params = req.params ?? {};
|
|
112
|
+
const name = params.name as string;
|
|
113
|
+
const args = (params.arguments ?? {}) as Record<string, unknown>;
|
|
114
|
+
|
|
115
|
+
if (!name) {
|
|
116
|
+
return { jsonrpc: '2.0', id: req.id, error: { code: -32602, message: 'Missing tool name' } };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
const result = await executeTool(name, args, env);
|
|
121
|
+
return { jsonrpc: '2.0', id: req.id, result };
|
|
122
|
+
} catch (err) {
|
|
123
|
+
return {
|
|
124
|
+
jsonrpc: '2.0',
|
|
125
|
+
id: req.id,
|
|
126
|
+
result: {
|
|
127
|
+
content: [{ type: 'text', text: `Tool error: ${err instanceof Error ? err.message : String(err)}` }],
|
|
128
|
+
isError: true,
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
default:
|
|
135
|
+
return { jsonrpc: '2.0', id: req.id, error: { code: -32601, message: `Method not found: ${req.method}` } };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// ─── HTTP Entrypoint ────────────────────────────────────────
|
|
140
|
+
|
|
141
|
+
export async function handleMcpRequest(request: Request, edgeEnv: EdgeEnv): Promise<Response> {
|
|
142
|
+
// Session termination
|
|
143
|
+
if (request.method === 'DELETE') {
|
|
144
|
+
return new Response(null, { status: 202 });
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// SSE not supported in stateless mode
|
|
148
|
+
if (request.method === 'GET') {
|
|
149
|
+
return Response.json(
|
|
150
|
+
{ jsonrpc: '2.0', id: null, error: { code: -32000, message: 'SSE not supported (stateless server)' } },
|
|
151
|
+
{ status: 405 },
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (request.method !== 'POST') {
|
|
156
|
+
return new Response('Method not allowed', { status: 405 });
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
let body: unknown;
|
|
160
|
+
try {
|
|
161
|
+
body = await request.json();
|
|
162
|
+
} catch {
|
|
163
|
+
return Response.json(
|
|
164
|
+
{ jsonrpc: '2.0', id: null, error: { code: -32700, message: 'Parse error' } },
|
|
165
|
+
{ status: 400 },
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Batch request
|
|
170
|
+
if (Array.isArray(body)) {
|
|
171
|
+
const responses: JsonRpcResponse[] = [];
|
|
172
|
+
for (const req of body) {
|
|
173
|
+
const resp = await handleMethod(req as JsonRpcRequest, edgeEnv);
|
|
174
|
+
if (resp) responses.push(resp);
|
|
175
|
+
}
|
|
176
|
+
if (responses.length === 0) return new Response(null, { status: 202 });
|
|
177
|
+
return Response.json(responses);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Single request
|
|
181
|
+
const response = await handleMethod(body as JsonRpcRequest, edgeEnv);
|
|
182
|
+
if (!response) return new Response(null, { status: 202 });
|
|
183
|
+
return Response.json(response);
|
|
184
|
+
}
|
package/src/mcp/tools.ts
ADDED
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { operatorConfig } from '../operator/index.js';
|
|
2
|
+
|
|
3
|
+
// ─── MCP Tool Definitions (JSON Schema) ─────────────────────
|
|
4
|
+
|
|
5
|
+
export const TOOLS = [
|
|
6
|
+
{
|
|
7
|
+
name: 'aegis_chat',
|
|
8
|
+
description:
|
|
9
|
+
'Send a message through the full AEGIS cognitive kernel (Groq classify → procedural lookup → route to executor). Returns the response with classification, executor, cost, and latency metadata.',
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
properties: {
|
|
13
|
+
message: { type: 'string', description: 'The message to send to AEGIS' },
|
|
14
|
+
conversation_id: {
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: 'Conversation ID for multi-turn context. Omit to start a new conversation.',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
required: ['message'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'aegis_conversations',
|
|
24
|
+
description: 'List recent AEGIS conversations ordered by last activity.',
|
|
25
|
+
inputSchema: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
limit: { type: 'number', description: 'Max conversations to return (default 20, max 50)' },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'aegis_conversation_history',
|
|
34
|
+
description: 'Get the full message history for a specific AEGIS conversation.',
|
|
35
|
+
inputSchema: {
|
|
36
|
+
type: 'object',
|
|
37
|
+
properties: {
|
|
38
|
+
conversation_id: { type: 'string', description: 'The conversation ID' },
|
|
39
|
+
},
|
|
40
|
+
required: ['conversation_id'],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'aegis_agenda',
|
|
45
|
+
description: 'List active AEGIS agenda items including proposed actions awaiting approval.',
|
|
46
|
+
inputSchema: {
|
|
47
|
+
type: 'object',
|
|
48
|
+
properties: {
|
|
49
|
+
business_unit: { type: 'string', description: 'Filter to a single business unit (e.g. "stackbilt", "foodfiles"). Omit for all.' },
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'aegis_health',
|
|
55
|
+
description: 'Get AEGIS service health and procedural memory statistics.',
|
|
56
|
+
inputSchema: {
|
|
57
|
+
type: 'object',
|
|
58
|
+
properties: {},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'aegis_memory',
|
|
63
|
+
description: 'Read AEGIS semantic memory entries. Use `query` for keyword search (preferred — returns only relevant entries). Use `topic` to filter by category. Omit both to get recent entries across all topics.',
|
|
64
|
+
inputSchema: {
|
|
65
|
+
type: 'object',
|
|
66
|
+
properties: {
|
|
67
|
+
id: { type: 'string', description: 'Exact fragment ID to look up (bypasses search).' },
|
|
68
|
+
topic: { type: 'string', description: 'Filter by topic category.' },
|
|
69
|
+
query: { type: 'string', description: 'Keyword search — returns entries matching these terms. Preferred over topic-dump for large memory stores.' },
|
|
70
|
+
limit: { type: 'number', description: 'Max entries to return (default 25, max 100).' },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'aegis_record_memory',
|
|
76
|
+
description: `Record a durable fact to AEGIS long-term semantic memory. Call whenever you learn something about ${operatorConfig.identity.name}, his businesses, projects, or preferences that should persist across sessions.`,
|
|
77
|
+
inputSchema: {
|
|
78
|
+
type: 'object',
|
|
79
|
+
properties: {
|
|
80
|
+
topic: { type: 'string', description: `Category (e.g., ${operatorConfig.entities.memoryTopics.map(t => `"${t}"`).join(', ')})` },
|
|
81
|
+
fact: { type: 'string', description: 'The specific durable fact to remember' },
|
|
82
|
+
confidence: { type: 'number', description: 'Confidence 0-1 (default: 0.8)' },
|
|
83
|
+
source: { type: 'string', description: 'Where this came from (default: "claude_code")' },
|
|
84
|
+
},
|
|
85
|
+
required: ['topic', 'fact'],
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'aegis_forget_memory',
|
|
90
|
+
description: 'Delete one or more semantic memory entries by ID. Use for cleanup of incorrect, stale, or sensitive entries.',
|
|
91
|
+
inputSchema: {
|
|
92
|
+
type: 'object',
|
|
93
|
+
properties: {
|
|
94
|
+
id: { type: 'string', description: 'Single memory entry ID to delete' },
|
|
95
|
+
ids: { type: 'array', items: { type: 'string' }, description: 'Multiple memory entry IDs to delete (max 20)' },
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'aegis_add_agenda',
|
|
101
|
+
description: 'Add a pending action or follow-up to the AEGIS persistent agenda. Use when a conversation surfaces something that needs to happen.',
|
|
102
|
+
inputSchema: {
|
|
103
|
+
type: 'object',
|
|
104
|
+
properties: {
|
|
105
|
+
item: { type: 'string', description: 'The action item — concise and actionable' },
|
|
106
|
+
context: { type: 'string', description: 'Brief context: why this was added' },
|
|
107
|
+
priority: { type: 'string', enum: ['low', 'medium', 'high'], description: 'Priority level (default: medium)' },
|
|
108
|
+
business_unit: { type: 'string', description: 'Business unit this item belongs to (e.g. "stackbilt", "foodfiles"). Default: "stackbilt".' },
|
|
109
|
+
},
|
|
110
|
+
required: ['item'],
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'aegis_resolve_agenda',
|
|
115
|
+
description: 'Mark an AEGIS agenda item as done or dismissed.',
|
|
116
|
+
inputSchema: {
|
|
117
|
+
type: 'object',
|
|
118
|
+
properties: {
|
|
119
|
+
id: { type: 'number', description: 'The agenda item ID' },
|
|
120
|
+
status: { type: 'string', enum: ['done', 'dismissed'], description: 'How it resolved' },
|
|
121
|
+
},
|
|
122
|
+
required: ['id', 'status'],
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: 'aegis_add_goal',
|
|
127
|
+
description: 'Create a persistent autonomous goal. AEGIS evaluates goals on schedule and creates proposed actions when action is needed.',
|
|
128
|
+
inputSchema: {
|
|
129
|
+
type: 'object',
|
|
130
|
+
properties: {
|
|
131
|
+
title: { type: 'string', description: 'Short goal title' },
|
|
132
|
+
description: { type: 'string', description: 'What to check and what to do if action is needed' },
|
|
133
|
+
schedule_hours: { type: 'number', description: 'How often to evaluate in hours (default: 6)' },
|
|
134
|
+
business_unit: { type: 'string', description: 'Business unit this goal belongs to (e.g. "stackbilt", "foodfiles"). Default: "stackbilt".' },
|
|
135
|
+
},
|
|
136
|
+
required: ['title'],
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'aegis_update_goal',
|
|
141
|
+
description: 'Pause, complete, or mark an AEGIS goal as failed.',
|
|
142
|
+
inputSchema: {
|
|
143
|
+
type: 'object',
|
|
144
|
+
properties: {
|
|
145
|
+
id: { type: 'string', description: 'Goal ID' },
|
|
146
|
+
status: { type: 'string', enum: ['paused', 'completed', 'failed'], description: 'New status' },
|
|
147
|
+
},
|
|
148
|
+
required: ['id', 'status'],
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'aegis_list_goals',
|
|
153
|
+
description: 'List all active AEGIS autonomous goals with schedule and run count.',
|
|
154
|
+
inputSchema: {
|
|
155
|
+
type: 'object',
|
|
156
|
+
properties: {
|
|
157
|
+
business_unit: { type: 'string', description: 'Filter to a single business unit (e.g. "stackbilt", "foodfiles"). Omit for all.' },
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'aegis_cc_sessions',
|
|
163
|
+
description: 'Look up Claude Code session digests. Query by session ID or list recent sessions.',
|
|
164
|
+
inputSchema: {
|
|
165
|
+
type: 'object',
|
|
166
|
+
properties: {
|
|
167
|
+
id: { type: 'string', description: 'Specific session UUID to look up. Omit to list recent.' },
|
|
168
|
+
days: { type: 'number', description: 'Days to look back when listing (default 7)' },
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: 'aegis_create_cc_task',
|
|
174
|
+
description: 'Queue a Claude Code task for autonomous execution. The task runner picks these up and executes them via `claude -p` in the target repo. Use for work that can run unattended — code generation, refactoring, test writing, documentation.',
|
|
175
|
+
inputSchema: {
|
|
176
|
+
type: 'object',
|
|
177
|
+
properties: {
|
|
178
|
+
title: { type: 'string', description: 'Short task title (e.g. "Add unit tests for quota service")' },
|
|
179
|
+
repo: { type: 'string', description: 'Target repo directory name (e.g. "my-project", "demo-app-v2")' },
|
|
180
|
+
prompt: { type: 'string', description: 'Detailed instructions for Claude Code. Be specific about what to change, where, and how to verify.' },
|
|
181
|
+
completion_signal: { type: 'string', description: 'String to look for in output to confirm success (default: "TASK_COMPLETE")' },
|
|
182
|
+
priority: { type: 'number', description: 'Priority 0-100 where 0 is highest (default: 50)' },
|
|
183
|
+
depends_on: { type: 'string', description: 'Single task ID this depends on (legacy) — will not run until dependency completes' },
|
|
184
|
+
blocked_by: { type: 'array', items: { type: 'string' }, description: 'Array of task IDs that must all complete before this task runs (DAG dependencies)' },
|
|
185
|
+
max_turns: { type: 'number', description: 'Max agentic turns for safety (default: 25)' },
|
|
186
|
+
category: { type: 'string', enum: ['docs', 'tests', 'research', 'bugfix', 'feature', 'refactor', 'deploy'], description: 'Task category for governance routing (default: feature)' },
|
|
187
|
+
authority: { type: 'string', enum: ['proposed', 'auto_safe', 'operator'], description: 'Authority level: operator=run immediately, auto_safe=safe auto-execute, proposed=needs approval (default: operator)' },
|
|
188
|
+
business_unit: { type: 'string', description: 'Business unit this task belongs to (e.g. "stackbilt", "foodfiles"). Default: "stackbilt".' },
|
|
189
|
+
},
|
|
190
|
+
required: ['title', 'repo', 'prompt'],
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: 'aegis_approve_cc_task',
|
|
195
|
+
description: 'Approve a proposed Claude Code task, making it eligible for autonomous execution.',
|
|
196
|
+
inputSchema: {
|
|
197
|
+
type: 'object',
|
|
198
|
+
properties: {
|
|
199
|
+
id: { type: 'string', description: 'Task ID to approve' },
|
|
200
|
+
},
|
|
201
|
+
required: ['id'],
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: 'aegis_list_cc_tasks',
|
|
206
|
+
description: 'List Claude Code tasks in the queue. Filter by status to see pending, running, completed, or failed tasks.',
|
|
207
|
+
inputSchema: {
|
|
208
|
+
type: 'object',
|
|
209
|
+
properties: {
|
|
210
|
+
status: { type: 'string', enum: ['pending', 'running', 'completed', 'failed', 'cancelled'], description: 'Filter by status. Omit for all.' },
|
|
211
|
+
business_unit: { type: 'string', description: 'Filter to a single business unit (e.g. "stackbilt", "foodfiles"). Omit for all.' },
|
|
212
|
+
limit: { type: 'number', description: 'Max tasks to return (default 20)' },
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: 'aegis_cancel_cc_task',
|
|
218
|
+
description: 'Cancel a pending or running Claude Code task.',
|
|
219
|
+
inputSchema: {
|
|
220
|
+
type: 'object',
|
|
221
|
+
properties: {
|
|
222
|
+
id: { type: 'string', description: 'Task ID to cancel' },
|
|
223
|
+
},
|
|
224
|
+
required: ['id'],
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: 'aegis_task_summary',
|
|
229
|
+
description: 'Get a concise summary of the Claude Code task queue: counts by status, proposed tasks awaiting approval, pending tasks ready to run, and recent failures.',
|
|
230
|
+
inputSchema: {
|
|
231
|
+
type: 'object',
|
|
232
|
+
properties: {},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: 'aegis_batch_approve',
|
|
237
|
+
description: 'Approve multiple proposed Claude Code tasks at once, making them eligible for autonomous execution.',
|
|
238
|
+
inputSchema: {
|
|
239
|
+
type: 'object',
|
|
240
|
+
properties: {
|
|
241
|
+
ids: { type: 'string', description: 'Comma-separated task IDs to approve, or "all" to approve every proposed task' },
|
|
242
|
+
},
|
|
243
|
+
required: ['ids'],
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
name: 'aegis_publish_tech_post',
|
|
248
|
+
description: 'Create or update a technical blog post. Published posts go live at your-blog.example.com/post/{slug}; drafts are saved without a public URL until published.',
|
|
249
|
+
inputSchema: {
|
|
250
|
+
type: 'object',
|
|
251
|
+
properties: {
|
|
252
|
+
title: { type: 'string', description: 'Post title' },
|
|
253
|
+
slug: { type: 'string', description: 'URL slug (e.g. "img-forge-quickstart")' },
|
|
254
|
+
body: { type: 'string', description: 'Full markdown body' },
|
|
255
|
+
description: { type: 'string', description: 'Short description for RSS/meta (1-2 sentences)' },
|
|
256
|
+
tags: { type: 'string', description: 'Comma-separated tags (e.g. "ai,imagegeneration,cloudflare")' },
|
|
257
|
+
status: { type: 'string', enum: ['draft', 'published'], description: 'Publish immediately or save as draft (default: draft)' },
|
|
258
|
+
skip_devto: { type: 'boolean', description: 'Skip dev.to cross-posting even when publishing (default: false)' },
|
|
259
|
+
},
|
|
260
|
+
required: ['title', 'slug', 'body'],
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
name: 'aegis_generate_decision_doc',
|
|
265
|
+
description: 'Generate a decision document tracing the full memory trail for a topic across all AEGIS data sources (semantic memory, episodic memory, procedural memory, goals, narratives, tasks, GitHub). Pure data assembly — no LLM synthesis.',
|
|
266
|
+
inputSchema: {
|
|
267
|
+
type: 'object',
|
|
268
|
+
properties: {
|
|
269
|
+
topic: { type: 'string', description: 'The topic to trace (e.g. "taskrunner", "auth consolidation", "memory worker")' },
|
|
270
|
+
days: { type: 'number', description: 'Lookback window in days (default: 90)' },
|
|
271
|
+
include_raw: { type: 'boolean', description: 'Include raw episode evidence section (default: false)' },
|
|
272
|
+
repo: { type: 'string', description: 'GitHub repo to search for issues/PRs (default: aegis)' },
|
|
273
|
+
},
|
|
274
|
+
required: ['topic'],
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: 'aegis_create_dynamic_tool',
|
|
279
|
+
description: 'Create a runtime dynamic tool — a reusable prompt template stored in D1 and executed via LLM. Dynamic tools appear in the Claude tool loop with a dt_ prefix.',
|
|
280
|
+
inputSchema: {
|
|
281
|
+
type: 'object',
|
|
282
|
+
properties: {
|
|
283
|
+
name: { type: 'string', description: 'Tool name (snake_case, 2-49 chars, no aegis_/mcp_/bizops_ prefix)' },
|
|
284
|
+
description: { type: 'string', description: 'What the tool does' },
|
|
285
|
+
input_schema: { type: 'string', description: 'JSON Schema for inputs (default: empty object)' },
|
|
286
|
+
prompt_template: { type: 'string', description: 'Prompt template with {{variable}} placeholders' },
|
|
287
|
+
executor: { type: 'string', enum: ['gpt_oss', 'workers_ai', 'groq'], description: 'LLM executor (default: gpt_oss)' },
|
|
288
|
+
ttl_days: { type: 'number', description: 'Auto-expire after N days (optional)' },
|
|
289
|
+
},
|
|
290
|
+
required: ['name', 'description', 'prompt_template'],
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: 'aegis_invoke_dynamic_tool',
|
|
295
|
+
description: 'Execute a runtime dynamic tool by name. Pass inputs that match the tool\'s input_schema.',
|
|
296
|
+
inputSchema: {
|
|
297
|
+
type: 'object',
|
|
298
|
+
properties: {
|
|
299
|
+
name: { type: 'string', description: 'Tool name to invoke' },
|
|
300
|
+
inputs: { type: 'object', description: 'Input values matching the tool\'s schema' },
|
|
301
|
+
},
|
|
302
|
+
required: ['name'],
|
|
303
|
+
},
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: 'aegis_list_dynamic_tools',
|
|
307
|
+
description: 'List runtime dynamic tools with usage statistics.',
|
|
308
|
+
inputSchema: {
|
|
309
|
+
type: 'object',
|
|
310
|
+
properties: {
|
|
311
|
+
status: { type: 'string', enum: ['active', 'promoted', 'retired', 'draft'], description: 'Filter by status (default: active + promoted)' },
|
|
312
|
+
limit: { type: 'number', description: 'Max tools to return (default 50, max 100)' },
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
];
|