@agentforge-ai/cli 0.5.1 → 0.5.2
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/dist/default/agentforge.config.ts +78 -0
- package/dist/default/convex/agents.ts +8 -8
- package/dist/default/convex/heartbeat.ts +2 -2
- package/dist/default/convex/mastraIntegration.ts +1 -1
- package/dist/default/convex/vault.ts +3 -0
- package/dist/default/package.json +1 -0
- package/dist/default/tsconfig.json +1 -0
- package/dist/index.js +691 -84
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/templates/default/agentforge.config.ts +78 -0
- package/templates/default/convex/agents.ts +8 -8
- package/templates/default/convex/heartbeat.ts +2 -2
- package/templates/default/convex/mastraIntegration.ts +1 -1
- package/templates/default/convex/vault.ts +3 -0
- package/templates/default/package.json +1 -0
- package/templates/default/tsconfig.json +1 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example AgentForge Configuration File
|
|
3
|
+
*
|
|
4
|
+
* This file defines your agents and their configurations.
|
|
5
|
+
* The CLI uses this to deploy to AgentForge Cloud.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
name: 'my-agent-project',
|
|
10
|
+
version: '1.0.0',
|
|
11
|
+
|
|
12
|
+
agents: [
|
|
13
|
+
{
|
|
14
|
+
id: 'support-agent',
|
|
15
|
+
name: 'Customer Support Agent',
|
|
16
|
+
model: 'gpt-4o',
|
|
17
|
+
instructions: `You are a helpful customer support agent.
|
|
18
|
+
|
|
19
|
+
Be polite, professional, and try to resolve customer issues quickly.
|
|
20
|
+
If you don't know the answer, escalate to a human agent.`,
|
|
21
|
+
tools: [
|
|
22
|
+
{
|
|
23
|
+
name: 'searchKnowledgeBase',
|
|
24
|
+
description: 'Search the knowledge base for articles',
|
|
25
|
+
parameters: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
query: { type: 'string' },
|
|
29
|
+
},
|
|
30
|
+
required: ['query'],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'createTicket',
|
|
35
|
+
description: 'Create a support ticket',
|
|
36
|
+
parameters: {
|
|
37
|
+
type: 'object',
|
|
38
|
+
properties: {
|
|
39
|
+
subject: { type: 'string' },
|
|
40
|
+
description: { type: 'string' },
|
|
41
|
+
priority: { type: 'string', enum: ['low', 'medium', 'high'] },
|
|
42
|
+
},
|
|
43
|
+
required: ['subject', 'description'],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'code-assistant',
|
|
50
|
+
name: 'Code Assistant',
|
|
51
|
+
model: 'anthropic/claude-3-opus',
|
|
52
|
+
instructions: `You are an expert programming assistant.
|
|
53
|
+
|
|
54
|
+
Help users write clean, efficient, and well-documented code.
|
|
55
|
+
Explain your reasoning and provide examples when helpful.`,
|
|
56
|
+
tools: [
|
|
57
|
+
{
|
|
58
|
+
name: 'runCode',
|
|
59
|
+
description: 'Execute code in a sandboxed environment',
|
|
60
|
+
parameters: {
|
|
61
|
+
type: 'object',
|
|
62
|
+
properties: {
|
|
63
|
+
language: { type: 'string', enum: ['javascript', 'python', 'typescript'] },
|
|
64
|
+
code: { type: 'string' },
|
|
65
|
+
},
|
|
66
|
+
required: ['language', 'code'],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
|
|
73
|
+
// Optional: Environment variables available to all agents
|
|
74
|
+
env: {
|
|
75
|
+
SUPPORT_EMAIL: 'support@example.com',
|
|
76
|
+
COMPANY_NAME: 'Acme Inc',
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -159,7 +159,7 @@ export const run = action({
|
|
|
159
159
|
threadId: v.optional(v.id("threads")),
|
|
160
160
|
userId: v.optional(v.string()),
|
|
161
161
|
},
|
|
162
|
-
handler: async (ctx, args) => {
|
|
162
|
+
handler: async (ctx, args): Promise<{ threadId: string; message: string; agentId: string }> => {
|
|
163
163
|
// Get agent configuration
|
|
164
164
|
const agent = await ctx.runQuery(api.agents.get, { id: args.agentId });
|
|
165
165
|
|
|
@@ -186,19 +186,19 @@ export const run = action({
|
|
|
186
186
|
// TODO: Integrate with Mastra to run the agent
|
|
187
187
|
// This will be implemented in the Mastra integration phase
|
|
188
188
|
// For now, return a placeholder response
|
|
189
|
-
const
|
|
190
|
-
threadId,
|
|
191
|
-
message: "Agent execution will be implemented with Mastra integration",
|
|
192
|
-
agentId: args.agentId,
|
|
193
|
-
};
|
|
189
|
+
const responseMessage = "Agent execution will be implemented with Mastra integration";
|
|
194
190
|
|
|
195
191
|
// Add assistant message placeholder
|
|
196
192
|
await ctx.runMutation(api.messages.add, {
|
|
197
193
|
threadId,
|
|
198
194
|
role: "assistant",
|
|
199
|
-
content:
|
|
195
|
+
content: responseMessage,
|
|
200
196
|
});
|
|
201
197
|
|
|
202
|
-
return
|
|
198
|
+
return {
|
|
199
|
+
threadId: threadId as string,
|
|
200
|
+
message: responseMessage,
|
|
201
|
+
agentId: args.agentId,
|
|
202
|
+
};
|
|
203
203
|
},
|
|
204
204
|
});
|
|
@@ -310,12 +310,12 @@ export const processCheck = action({
|
|
|
310
310
|
agentId: v.string(),
|
|
311
311
|
threadId: v.optional(v.id("threads")),
|
|
312
312
|
},
|
|
313
|
-
handler: async (ctx, args) => {
|
|
313
|
+
handler: async (ctx, args): Promise<{ success: boolean; message?: string; pendingTasks?: number; status?: string }> => {
|
|
314
314
|
// Get heartbeat
|
|
315
315
|
const heartbeat = await ctx.runQuery(api.heartbeat.get, {
|
|
316
316
|
agentId: args.agentId,
|
|
317
317
|
threadId: args.threadId,
|
|
318
|
-
});
|
|
318
|
+
}) as { status: string; pendingTasks: string[]; currentTask?: string } | null;
|
|
319
319
|
|
|
320
320
|
if (!heartbeat) {
|
|
321
321
|
return { success: false, message: "Heartbeat not found" };
|
|
@@ -80,7 +80,7 @@ export const executeAgent = action({
|
|
|
80
80
|
// Build context from message history
|
|
81
81
|
const context = messages
|
|
82
82
|
.slice(-10) // Last 10 messages for context
|
|
83
|
-
.map((m) => `${m.role}: ${m.content}`)
|
|
83
|
+
.map((m: { role: string; content: string }) => `${m.role}: ${m.content}`)
|
|
84
84
|
.join("\n");
|
|
85
85
|
|
|
86
86
|
// Execute agent
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { v } from "convex/values";
|
|
2
2
|
import { mutation, query, internalMutation } from "./_generated/server";
|
|
3
3
|
|
|
4
|
+
// Convex supports process.env but doesn't ship Node types by default
|
|
5
|
+
declare const process: { env: Record<string, string | undefined> };
|
|
6
|
+
|
|
4
7
|
// ============================================================
|
|
5
8
|
// SECURE VAULT - Encrypted secrets management
|
|
6
9
|
// ============================================================
|