@cloudbase/agent-examples-agents-server 0.0.6 → 0.0.8
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/CHANGELOG.md +32 -0
- package/dist/index.mjs +123 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +30 -24
- package/dist/index.d.mts +0 -5
- package/dist/index.js +0 -184
- package/dist/index.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @cloudbase/agent-examples-agents-server
|
|
2
2
|
|
|
3
|
+
## 1.0.1-alpha.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- alpha release 0.1.2-alpha.1
|
|
8
|
+
- Update all public packages to version 0.1.2-alpha.1
|
|
9
|
+
- Trigger automated alpha release workflow
|
|
10
|
+
- Includes latest features and improvements
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @cloudbase/agent-agents@1.0.1-alpha.4
|
|
14
|
+
- @cloudbase/agent-server@1.0.1-alpha.4
|
|
15
|
+
- @cloudbase/agent-adapter-openai-agent-sdk@1.0.1-alpha.4
|
|
16
|
+
- @cloudbase/agent-adapter-llamaindex@1.0.1-alpha.4
|
|
17
|
+
- @cloudbase/agent-adapter-mastra@1.0.1-alpha.4
|
|
18
|
+
- @cloudbase/agent-adapter-langchain@1.0.1-alpha.4
|
|
19
|
+
- @cloudbase/agent-adapter-langgraph@1.0.1-alpha.4
|
|
20
|
+
- @cloudbase/agent-examples-langgraph-human-in-the-loop@1.0.1-alpha.4
|
|
21
|
+
- @cloudbase/agent-examples-langgraph-agentic-chat@1.0.1-alpha.4
|
|
22
|
+
- @cloudbase/agent-examples-mastra-agentic-chat@1.0.1-alpha.4
|
|
23
|
+
- @cloudbase/agent-examples-langchain-agentic-chat@1.0.1-alpha.4
|
|
24
|
+
- @cloudbase/agent-examples-claude-agent-human-in-the-loop@1.0.1-alpha.4
|
|
25
|
+
- @cloudbase/agent-examples-claude-agent-agentic-chat@1.0.1-alpha.4
|
|
26
|
+
- @cloudbase/agent-examples-agkit-agents-human-in-the-loop@1.0.1-alpha.4
|
|
27
|
+
- @cloudbase/agent-examples-agkit-agents-multi-agent@1.0.1-alpha.4
|
|
28
|
+
- @cloudbase/agent-examples-agkit-agents-mcp-knowledge-retrieval@1.0.1-alpha.4
|
|
29
|
+
- @cloudbase/agent-examples-agkit-agents-agentic-chat@1.0.1-alpha.4
|
|
30
|
+
- @cloudbase/agent-examples-agkit-agents-manga-creator@1.0.1-alpha.4
|
|
31
|
+
- @cloudbase/agent-react-coding-agent@1.0.1-alpha.4
|
|
32
|
+
- @cloudbase/agent-examples-openai-agent-sdk-agentic-chat@1.0.1-alpha.4
|
|
33
|
+
- @cloudbase/agent-examples-llamaindex-ts-multi-agent@1.0.1-alpha.4
|
|
34
|
+
|
|
3
35
|
## 0.0.11-alpha.3
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
package/dist/index.mjs
CHANGED
|
@@ -25,6 +25,11 @@ import { InMemoryMemory } from "@cloudbase/agent-agents";
|
|
|
25
25
|
import { createMangaCreatorAgent } from "@cloudbase/agent-examples-agkit-agents-manga-creator";
|
|
26
26
|
import { createAgent as createClaudeAgenticChatAgent } from "@cloudbase/agent-examples-claude-agent-agentic-chat";
|
|
27
27
|
import { createAgent as createClaudeHumanInTheLoopAgent } from "@cloudbase/agent-examples-claude-agent-human-in-the-loop";
|
|
28
|
+
import { ReactCodingAgent } from "@cloudbase/agent-react-coding-agent";
|
|
29
|
+
import { MySQLMemory, OpenAIProvider } from "@cloudbase/agent-agents";
|
|
30
|
+
import path from "path";
|
|
31
|
+
import { Agent } from "@cloudbase/agent-agents";
|
|
32
|
+
import fs from "fs";
|
|
28
33
|
dotenv.config({ path: ".env" });
|
|
29
34
|
if (process.env.http_proxy) {
|
|
30
35
|
undici.setGlobalDispatcher(new undici.ProxyAgent(process.env.http_proxy));
|
|
@@ -113,8 +118,126 @@ async function createApp() {
|
|
|
113
118
|
return {
|
|
114
119
|
agent: createMangaCreatorAgent()
|
|
115
120
|
};
|
|
121
|
+
},
|
|
122
|
+
agkit_ai_coding: async () => {
|
|
123
|
+
class CodingAgent extends Agent {
|
|
124
|
+
constructor(data) {
|
|
125
|
+
super(data);
|
|
126
|
+
}
|
|
127
|
+
async run(input, state, options) {
|
|
128
|
+
const conversationId = state?.conversationId || options.conversationId;
|
|
129
|
+
if (!conversationId) {
|
|
130
|
+
throw new Error("Conversation ID is required");
|
|
131
|
+
}
|
|
132
|
+
const baseProjectPath = process.env.BASE_PROJECT_PATH ? path.resolve(process.env.BASE_PROJECT_PATH) : path.join(__dirname, "projects");
|
|
133
|
+
let memory2 = void 0;
|
|
134
|
+
if (process.env.MYSQL_HOST) {
|
|
135
|
+
memory2 = MySQLMemory.create({
|
|
136
|
+
connection: {
|
|
137
|
+
host: process.env.MYSQL_HOST,
|
|
138
|
+
port: parseInt(process.env.MYSQL_PORT || "3306"),
|
|
139
|
+
username: process.env.MYSQL_USER || "root",
|
|
140
|
+
password: process.env.MYSQL_PASSWORD || "password",
|
|
141
|
+
database: process.env.MYSQL_DATABASE || "test"
|
|
142
|
+
},
|
|
143
|
+
sessionId: conversationId
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
const agent = new ReactCodingAgent({
|
|
147
|
+
name: "ai-coding-agent",
|
|
148
|
+
model: new OpenAIProvider({
|
|
149
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
150
|
+
defaultModel: process.env.OPENAI_MODEL || "gpt-4o-mini",
|
|
151
|
+
baseURL: process.env.OPENAI_BASE_URL
|
|
152
|
+
}),
|
|
153
|
+
instructions: `${ReactCodingAgent.getSystemPrompt()}
|
|
154
|
+
|
|
155
|
+
<important>\u9879\u76EE\u4FEE\u6539\u5B8C\u6210\u4E4B\u540E\uFF0C**\u4E00\u5B9A** \u4F7F\u7528 "npm run build" \u6765\u68C0\u67E5\u9879\u76EE\u662F\u5426\u6B63\u5E38\u3002build \u6210\u529F\u540E\u53EF\u4EE5\u901A\u8FC7 "http://localhost:${process.env.PORT || 3e3}/ai_coding/preview/${conversationId}" \u7684\u8DEF\u5F84\u8BBF\u95EE\u5E94\u7528\uFF08\u670D\u52A1\u9ED8\u8BA4\u5DF2\u542F\u52A8\uFF0C\u65E0\u9700\u91CD\u590D\u542F\u52A8\uFF09\u3002\u7ED9\u51FA\u7528\u6237\u8BBF\u95EE\u6307\u5F15\u3002</important>
|
|
156
|
+
|
|
157
|
+
\u5F53\u524D\u9879\u76EE\u5DE5\u4F5C\u7A7A\u95F4\u4E3A ${path.join(baseProjectPath, conversationId)}`,
|
|
158
|
+
baseProjectPath,
|
|
159
|
+
projectName: conversationId,
|
|
160
|
+
autoInstallDependencies: false,
|
|
161
|
+
memory: memory2
|
|
162
|
+
});
|
|
163
|
+
await agent.initialize();
|
|
164
|
+
if (!fs.existsSync(path.join(baseProjectPath, conversationId))) {
|
|
165
|
+
await agent.createReactProject({
|
|
166
|
+
typescript: true,
|
|
167
|
+
shadcn: {
|
|
168
|
+
style: "default",
|
|
169
|
+
baseColor: "slate",
|
|
170
|
+
cssVariables: true
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
return agent.run(input, state, options);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
agent: new CodingAgent({
|
|
179
|
+
name: "ai-coding-agent",
|
|
180
|
+
model: new OpenAIProvider({
|
|
181
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
182
|
+
defaultModel: process.env.OPENAI_MODEL || "gpt-4o-mini",
|
|
183
|
+
baseURL: process.env.OPENAI_BASE_URL
|
|
184
|
+
})
|
|
185
|
+
}),
|
|
186
|
+
cleanup: () => {
|
|
187
|
+
console.log(`Cleaning up AI Coding Agent`);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
116
190
|
}
|
|
117
191
|
};
|
|
192
|
+
app.use("/ai_coding/preview/:conversationId", (req, res) => {
|
|
193
|
+
const conversationId = req.params.conversationId;
|
|
194
|
+
const baseRoute = `/ai_coding/preview/${conversationId}`;
|
|
195
|
+
let requestedPath = req.originalUrl.replace(baseRoute, "").replace(/^\//g, "");
|
|
196
|
+
requestedPath = requestedPath.split("?")[0];
|
|
197
|
+
console.log(`[Static File] Conversation ID: ${conversationId}`);
|
|
198
|
+
console.log(`[Static File] Original URL: ${req.originalUrl}`);
|
|
199
|
+
console.log(`[Static File] Requested Path: ${requestedPath}`);
|
|
200
|
+
const baseProjectPath = process.env.BASE_PROJECT_PATH ? path.resolve(process.env.BASE_PROJECT_PATH) : path.join(__dirname, "projects");
|
|
201
|
+
const distPath = path.join(baseProjectPath, conversationId, "dist");
|
|
202
|
+
console.log(`[Static File] Dist Path: ${distPath}`);
|
|
203
|
+
let filePath;
|
|
204
|
+
if (!requestedPath || requestedPath.endsWith("/")) {
|
|
205
|
+
filePath = path.join(distPath, "index.html");
|
|
206
|
+
} else {
|
|
207
|
+
filePath = path.join(distPath, requestedPath);
|
|
208
|
+
}
|
|
209
|
+
console.log(`[Static File] Resolved File Path: ${filePath}`);
|
|
210
|
+
const normalizedFilePath = path.normalize(filePath);
|
|
211
|
+
const normalizedDistPath = path.normalize(distPath);
|
|
212
|
+
if (!normalizedFilePath.startsWith(normalizedDistPath)) {
|
|
213
|
+
console.log(
|
|
214
|
+
`[Static File] Security check failed: ${normalizedFilePath} not within ${normalizedDistPath}`
|
|
215
|
+
);
|
|
216
|
+
return res.status(403).send("Forbidden");
|
|
217
|
+
}
|
|
218
|
+
if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) {
|
|
219
|
+
console.log(`[Static File] Serving file: ${filePath}`);
|
|
220
|
+
if (filePath.endsWith(".js")) {
|
|
221
|
+
res.setHeader("Content-Type", "application/javascript");
|
|
222
|
+
} else if (filePath.endsWith(".css")) {
|
|
223
|
+
res.setHeader("Content-Type", "text/css");
|
|
224
|
+
} else if (filePath.endsWith(".html")) {
|
|
225
|
+
res.setHeader("Content-Type", "text/html");
|
|
226
|
+
} else if (filePath.endsWith(".json")) {
|
|
227
|
+
res.setHeader("Content-Type", "application/json");
|
|
228
|
+
}
|
|
229
|
+
return res.sendFile(path.resolve(filePath));
|
|
230
|
+
}
|
|
231
|
+
console.log(`[Static File] File not found: ${filePath}`);
|
|
232
|
+
const indexPath = path.join(distPath, "index.html");
|
|
233
|
+
if (fs.existsSync(indexPath) && fs.statSync(indexPath).isFile()) {
|
|
234
|
+
console.log(`[Static File] Serving fallback index.html: ${indexPath}`);
|
|
235
|
+
res.setHeader("Content-Type", "text/html");
|
|
236
|
+
return res.sendFile(path.resolve(indexPath));
|
|
237
|
+
}
|
|
238
|
+
console.log(`[Static File] Index.html not found: ${indexPath}`);
|
|
239
|
+
res.status(404).send("Not Found");
|
|
240
|
+
});
|
|
118
241
|
Object.entries(AGENTS).forEach(([key, agent]) => {
|
|
119
242
|
createExpressRoutes({
|
|
120
243
|
basePath: `/${key}/`,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/server.ts"],"sourcesContent":["import * as process from \"node:process\";\nexport { default as server } from \"./server.js\";\n\nimport createApp from \"./server.js\";\n\n\nconst port = process.env.PORT || 9000;\nasync function startServer() {\n const app = await createApp();\n\n return new Promise<Awaited<ReturnType<typeof createApp>>>((resolve, reject) => {\n app.listen(port, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve(app);\n }\n });\n });\n}\n\nstartServer().then(() => {\n console.log(\"Server running on port \" + port);\n}).catch(console.error);\n","import cors from \"cors\";\nimport dotenv from \"dotenv\";\nimport { LanggraphAgent } from \"@cloudbase/agent-adapter-langgraph\";\nimport { createExpressRoutes } from \"@cloudbase/agent-server\";\nimport { LlamaIndexAgent } from \"@cloudbase/agent-adapter-llamaindex\";\nimport { MastraAgent } from \"@cloudbase/agent-adapter-mastra\";\nimport express from \"express\";\nimport * as undici from \"undici\";\nimport { agenticChatGraph } from \"@cloudbase/agent-examples-langgraph-agentic-chat\";\nimport { humanInTheLoopGraph } from \"@cloudbase/agent-examples-langgraph-human-in-the-loop\";\nimport { createAgenticChatAgent } from \"@cloudbase/agent-examples-agkit-agents-agentic-chat\";\nimport { createHumanInTheLoopAgent } from \"@cloudbase/agent-examples-agkit-agents-human-in-the-loop\";\nimport { createWebReadingMultiAgent } from \"@cloudbase/agent-examples-llamaindex-ts-multi-agent\";\nimport { createAgenticChatAgent as createMastraAgenticChatAgent } from \"@cloudbase/agent-examples-mastra-agentic-chat\";\nimport { createMCPKnowledgeRetrievalAgent } from \"@cloudbase/agent-examples-agkit-agents-mcp-knowledge-retrieval\";\nimport { createMultiAgentOrchestrator } from \"@cloudbase/agent-examples-agkit-agents-multi-agent\";\nimport { createAgent as createLangchainAgenticChatAgent } from \"@cloudbase/agent-examples-langchain-agentic-chat\";\nimport { createOpenAIAgenticChatAgent } from \"@cloudbase/agent-examples-openai-agent-sdk-agentic-chat\";\nimport { OpenAIAgent } from \"@cloudbase/agent-adapter-openai-agent-sdk\";\nimport { InMemoryMemory } from \"@cloudbase/agent-agents\";\nimport { createMangaCreatorAgent } from \"@cloudbase/agent-examples-agkit-agents-manga-creator\";\nimport { createAgent as createClaudeAgenticChatAgent } from \"@cloudbase/agent-examples-claude-agent-agentic-chat\";\nimport { createAgent as createClaudeHumanInTheLoopAgent } from \"@cloudbase/agent-examples-claude-agent-human-in-the-loop\";\n\n// Load environment variables FIRST\ndotenv.config({ path: \".env\" });\nif (process.env.http_proxy) {\n undici.setGlobalDispatcher(new undici.ProxyAgent(process.env.http_proxy));\n}\nconst memory = new InMemoryMemory();\nasync function createApp(): Promise<express.Express> {\n const app: express.Express = express();\n\n app.use(cors());\n\n const AGENTS = {\n agentic_chat: () => {\n return {\n agent: new LanggraphAgent({\n description: \"An agent to showcase agentic chat ability.\",\n compiledWorkflow: agenticChatGraph,\n }),\n };\n },\n\n human_in_the_loop: () => {\n return {\n agent: new LanggraphAgent({\n description: \"An agent to showcase human in the loop ability.\",\n compiledWorkflow: humanInTheLoopGraph,\n }),\n };\n },\n\n agkit_agentic_chat: () => {\n return {\n agent: createAgenticChatAgent(),\n };\n },\n\n agkit_human_in_the_loop: () => {\n return {\n agent: createHumanInTheLoopAgent(),\n };\n },\n\n agkit_mcp_knowledge_retrieval: async () => {\n const { agent, cleanup } = await createMCPKnowledgeRetrievalAgent();\n return {\n agent,\n cleanup,\n };\n },\n llamaindex_multi_agent: () => {\n return {\n agent: new LlamaIndexAgent({\n workflowFactory: createWebReadingMultiAgent,\n }),\n };\n },\n mastra_agentic_chat: () => {\n return {\n agent: new MastraAgent({\n runnableFactory: createMastraAgenticChatAgent,\n }),\n };\n },\n\n agkit_multi_agent: () => {\n return {\n agent: createMultiAgentOrchestrator(),\n };\n },\n langchain_agentic_chat: () => {\n return {\n agent: createLangchainAgenticChatAgent(),\n };\n },\n\n claude_agent_agentic_chat: () => {\n return {\n agent: createClaudeAgenticChatAgent(),\n };\n },\n claude_agent_human_in_the_loop: () => {\n return {\n agent: createClaudeHumanInTheLoopAgent(),\n };\n },\n openai_agentic_chat: () => {\n return {\n agent: new OpenAIAgent({\n ...createOpenAIAgenticChatAgent(),\n memory,\n }),\n };\n },\n agkit_manga_creator: () => {\n return {\n agent: createMangaCreatorAgent(),\n };\n },\n };\n\n Object.entries(AGENTS).forEach(([key, agent]) => {\n createExpressRoutes({\n basePath: `/${key}/`,\n createAgent: agent,\n express: app,\n });\n });\n\n return app;\n}\n\nexport default createApp;\n"],"mappings":";AAAA,YAAYA,cAAa;;;ACAzB,OAAO,UAAU;AACjB,OAAO,YAAY;AACnB,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,OAAO,aAAa;AACpB,YAAY,YAAY;AACxB,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAS,iCAAiC;AAC1C,SAAS,kCAAkC;AAC3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AK,MAAM;AACvB,UAAQ,IAAI,4BAA4B,IAAI;AAC9C,CAAC,EAAE,MAAM,QAAQ,KAAK;","names":["process"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/server.ts"],"sourcesContent":["import * as process from \"node:process\";\nexport { default as server } from \"./server.js\";\n\nimport createApp from \"./server.js\";\n\n\nconst port = process.env.PORT || 9000;\nasync function startServer() {\n const app = await createApp();\n\n return new Promise<Awaited<ReturnType<typeof createApp>>>((resolve, reject) => {\n app.listen(port, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve(app);\n }\n });\n });\n}\n\nstartServer().then(() => {\n console.log(\"Server running on port \" + port);\n}).catch(console.error);\n","import cors from \"cors\";\nimport dotenv from \"dotenv\";\nimport { LanggraphAgent } from \"@cloudbase/agent-adapter-langgraph\";\nimport { createExpressRoutes } from \"@cloudbase/agent-server\";\nimport { LlamaIndexAgent } from \"@cloudbase/agent-adapter-llamaindex\";\nimport { MastraAgent } from \"@cloudbase/agent-adapter-mastra\";\nimport express from \"express\";\nimport * as undici from \"undici\";\nimport { agenticChatGraph } from \"@cloudbase/agent-examples-langgraph-agentic-chat\";\nimport { humanInTheLoopGraph } from \"@cloudbase/agent-examples-langgraph-human-in-the-loop\";\nimport { createAgenticChatAgent } from \"@cloudbase/agent-examples-agkit-agents-agentic-chat\";\nimport { createHumanInTheLoopAgent } from \"@cloudbase/agent-examples-agkit-agents-human-in-the-loop\";\nimport { createWebReadingMultiAgent } from \"@cloudbase/agent-examples-llamaindex-ts-multi-agent\";\nimport { createAgenticChatAgent as createMastraAgenticChatAgent } from \"@cloudbase/agent-examples-mastra-agentic-chat\";\nimport { createMCPKnowledgeRetrievalAgent } from \"@cloudbase/agent-examples-agkit-agents-mcp-knowledge-retrieval\";\nimport { createMultiAgentOrchestrator } from \"@cloudbase/agent-examples-agkit-agents-multi-agent\";\nimport { createAgent as createLangchainAgenticChatAgent } from \"@cloudbase/agent-examples-langchain-agentic-chat\";\nimport { createOpenAIAgenticChatAgent } from \"@cloudbase/agent-examples-openai-agent-sdk-agentic-chat\";\nimport { OpenAIAgent } from \"@cloudbase/agent-adapter-openai-agent-sdk\";\nimport { InMemoryMemory } from \"@cloudbase/agent-agents\";\nimport { createMangaCreatorAgent } from \"@cloudbase/agent-examples-agkit-agents-manga-creator\";\nimport { createAgent as createClaudeAgenticChatAgent } from \"@cloudbase/agent-examples-claude-agent-agentic-chat\";\nimport { createAgent as createClaudeHumanInTheLoopAgent } from \"@cloudbase/agent-examples-claude-agent-human-in-the-loop\";\nimport { ReactCodingAgent } from \"@cloudbase/agent-react-coding-agent\";\nimport { MySQLMemory, OpenAIProvider } from \"@cloudbase/agent-agents\";\nimport path from \"path\";\nimport { Agent } from \"@cloudbase/agent-agents\";\nimport fs from \"fs\";\n// Load environment variables FIRST\ndotenv.config({ path: \".env\" });\nif (process.env.http_proxy) {\n undici.setGlobalDispatcher(new undici.ProxyAgent(process.env.http_proxy));\n}\nconst memory = new InMemoryMemory();\n\nasync function createApp(): Promise<express.Express> {\n const app: express.Express = express();\n\n app.use(cors());\n\n const AGENTS = {\n agentic_chat: () => {\n return {\n agent: new LanggraphAgent({\n description: \"An agent to showcase agentic chat ability.\",\n compiledWorkflow: agenticChatGraph,\n }),\n };\n },\n\n human_in_the_loop: () => {\n return {\n agent: new LanggraphAgent({\n description: \"An agent to showcase human in the loop ability.\",\n compiledWorkflow: humanInTheLoopGraph,\n }),\n };\n },\n\n agkit_agentic_chat: () => {\n return {\n agent: createAgenticChatAgent(),\n };\n },\n\n agkit_human_in_the_loop: () => {\n return {\n agent: createHumanInTheLoopAgent(),\n };\n },\n\n agkit_mcp_knowledge_retrieval: async () => {\n const { agent, cleanup } = await createMCPKnowledgeRetrievalAgent();\n return {\n agent,\n cleanup,\n };\n },\n llamaindex_multi_agent: () => {\n return {\n agent: new LlamaIndexAgent({\n workflowFactory: createWebReadingMultiAgent,\n }),\n };\n },\n mastra_agentic_chat: () => {\n return {\n agent: new MastraAgent({\n runnableFactory: createMastraAgenticChatAgent,\n }),\n };\n },\n\n agkit_multi_agent: () => {\n return {\n agent: createMultiAgentOrchestrator(),\n };\n },\n langchain_agentic_chat: () => {\n return {\n agent: createLangchainAgenticChatAgent(),\n };\n },\n\n claude_agent_agentic_chat: () => {\n return {\n agent: createClaudeAgenticChatAgent(),\n };\n },\n claude_agent_human_in_the_loop: () => {\n return {\n agent: createClaudeHumanInTheLoopAgent(),\n };\n },\n openai_agentic_chat: () => {\n return {\n agent: new OpenAIAgent({\n ...createOpenAIAgenticChatAgent(),\n memory,\n }),\n };\n },\n agkit_manga_creator: () => {\n return {\n agent: createMangaCreatorAgent(),\n };\n },\n agkit_ai_coding: async () => {\n class CodingAgent extends Agent {\n constructor(data: any) {\n super(data);\n }\n\n async run(input: string | any[], state?: any, options?: any) {\n const conversationId =\n state?.conversationId || options.conversationId;\n if (!conversationId) {\n throw new Error(\"Conversation ID is required\");\n }\n\n // Get configuration from environment\n const baseProjectPath = process.env.BASE_PROJECT_PATH\n ? path.resolve(process.env.BASE_PROJECT_PATH)\n : path.join(__dirname, \"projects\");\n\n // Initialize memory if MySQL is configured\n let memory = undefined;\n if (process.env.MYSQL_HOST) {\n memory = MySQLMemory.create({\n connection: {\n host: process.env.MYSQL_HOST,\n port: parseInt(process.env.MYSQL_PORT || \"3306\"),\n username: process.env.MYSQL_USER || \"root\",\n password: process.env.MYSQL_PASSWORD || \"password\",\n database: process.env.MYSQL_DATABASE || \"test\",\n },\n sessionId: conversationId,\n });\n }\n\n // Create agent instance\n const agent = new ReactCodingAgent({\n name: \"ai-coding-agent\",\n model: new OpenAIProvider({\n apiKey: process.env.OPENAI_API_KEY!,\n defaultModel: process.env.OPENAI_MODEL || \"gpt-4o-mini\",\n baseURL: process.env.OPENAI_BASE_URL,\n }),\n instructions: `${ReactCodingAgent.getSystemPrompt()}\\n\\n<important>项目修改完成之后,**一定** 使用 \"npm run build\" 来检查项目是否正常。build 成功后可以通过 \"http://localhost:${process.env.PORT || 3000}/ai_coding/preview/${conversationId}\" 的路径访问应用(服务默认已启动,无需重复启动)。给出用户访问指引。</important>\\n\\n当前项目工作空间为 ${path.join(baseProjectPath, conversationId)}`,\n baseProjectPath,\n projectName: conversationId,\n autoInstallDependencies: false,\n memory,\n });\n\n // Initialize agent\n await agent.initialize();\n\n if (!fs.existsSync(path.join(baseProjectPath, conversationId))) {\n await agent.createReactProject({\n typescript: true,\n shadcn: {\n style: \"default\",\n baseColor: \"slate\",\n cssVariables: true,\n },\n });\n }\n\n return agent.run(input, state, options);\n }\n }\n\n // Generate unique session ID for this conversation\n\n return {\n agent: new CodingAgent({\n name: \"ai-coding-agent\",\n model: new OpenAIProvider({\n apiKey: process.env.OPENAI_API_KEY!,\n defaultModel: process.env.OPENAI_MODEL || \"gpt-4o-mini\",\n baseURL: process.env.OPENAI_BASE_URL,\n }),\n }),\n cleanup: () => {\n console.log(`Cleaning up AI Coding Agent`);\n },\n };\n },\n };\n\n // Static file serving for AI Coding projects\n app.use(\"/ai_coding/preview/:conversationId\", (req, res) => {\n const conversationId = req.params.conversationId;\n\n // Get the requested file path after the conversationId\n // req.originalUrl contains the full URL path\n const baseRoute = `/ai_coding/preview/${conversationId}`;\n let requestedPath = req.originalUrl\n .replace(baseRoute, \"\")\n .replace(/^\\//g, \"\");\n\n // Remove query parameters if any\n requestedPath = requestedPath.split(\"?\")[0];\n\n console.log(`[Static File] Conversation ID: ${conversationId}`);\n console.log(`[Static File] Original URL: ${req.originalUrl}`);\n console.log(`[Static File] Requested Path: ${requestedPath}`);\n\n // Get base project path from environment or use default\n const baseProjectPath = process.env.BASE_PROJECT_PATH\n ? path.resolve(process.env.BASE_PROJECT_PATH)\n : path.join(__dirname, \"projects\");\n\n const distPath = path.join(baseProjectPath, conversationId, \"dist\");\n console.log(`[Static File] Dist Path: ${distPath}`);\n\n // If no specific file is requested (empty path or ends with /), serve index.html\n let filePath: string;\n if (!requestedPath || requestedPath.endsWith(\"/\")) {\n filePath = path.join(distPath, \"index.html\");\n } else {\n filePath = path.join(distPath, requestedPath);\n }\n\n console.log(`[Static File] Resolved File Path: ${filePath}`);\n\n // Security check: ensure the resolved path is within the dist directory\n const normalizedFilePath = path.normalize(filePath);\n const normalizedDistPath = path.normalize(distPath);\n if (!normalizedFilePath.startsWith(normalizedDistPath)) {\n console.log(\n `[Static File] Security check failed: ${normalizedFilePath} not within ${normalizedDistPath}`\n );\n return res.status(403).send(\"Forbidden\");\n }\n\n // Check if the requested file exists\n if (fs.existsSync(filePath) && fs.statSync(filePath).isFile()) {\n console.log(`[Static File] Serving file: ${filePath}`);\n\n // Set proper content type\n if (filePath.endsWith(\".js\")) {\n res.setHeader(\"Content-Type\", \"application/javascript\");\n } else if (filePath.endsWith(\".css\")) {\n res.setHeader(\"Content-Type\", \"text/css\");\n } else if (filePath.endsWith(\".html\")) {\n res.setHeader(\"Content-Type\", \"text/html\");\n } else if (filePath.endsWith(\".json\")) {\n res.setHeader(\"Content-Type\", \"application/json\");\n }\n\n return res.sendFile(path.resolve(filePath));\n }\n\n console.log(`[Static File] File not found: ${filePath}`);\n\n // If file not found, try to serve index.html as fallback (for SPA routing)\n const indexPath = path.join(distPath, \"index.html\");\n if (fs.existsSync(indexPath) && fs.statSync(indexPath).isFile()) {\n console.log(`[Static File] Serving fallback index.html: ${indexPath}`);\n res.setHeader(\"Content-Type\", \"text/html\");\n return res.sendFile(path.resolve(indexPath));\n }\n\n // If index.html also doesn't exist, return 404\n console.log(`[Static File] Index.html not found: ${indexPath}`);\n res.status(404).send(\"Not Found\");\n });\n\n Object.entries(AGENTS).forEach(([key, agent]) => {\n createExpressRoutes({\n basePath: `/${key}/`,\n createAgent: agent,\n express: app,\n });\n });\n\n return app;\n}\n\nexport default createApp;\n"],"mappings":";AAAA,YAAYA,cAAa;;;ACAzB,OAAO,UAAU;AACjB,OAAO,YAAY;AACnB,SAAS,sBAAsB;AAC/B,SAAS,2BAA2B;AACpC,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAC5B,OAAO,a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Ae,aAAI,QAAQ;AACjC,eAAe,cAAc;AAC3B,QAAM,MAAM,MAAM,eAAU;AAE5B,SAAO,IAAI,QAA+C,CAAC,SAAS,WAAW;AAC7E,QAAI,OAAO,MAAM,CAAC,QAAQ;AACxB,UAAI,KAAK;AACP,eAAO,GAAG;AAAA,MACZ,OAAO;AACL,gBAAQ,GAAG;AAAA,MACb;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;AAEA,YAAY,EAAE,KAAK,MAAM;AACvB,UAAQ,IAAI,4BAA4B,IAAI;AAC9C,CAAC,EAAE,MAAM,QAAQ,KAAK;","names":["process","memory"]}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/agent-examples-agents-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/",
|
|
7
7
|
"README.md",
|
|
8
8
|
"CHANGELOG.md"
|
|
9
9
|
],
|
|
10
|
-
"
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "dist/index.mjs",
|
|
11
12
|
"keywords": [],
|
|
12
13
|
"author": "",
|
|
13
14
|
"license": "ISC",
|
|
@@ -23,31 +24,36 @@
|
|
|
23
24
|
"express": "^5.1.0",
|
|
24
25
|
"proxy-agent": "^6.5.0",
|
|
25
26
|
"undici": "^7.16.0",
|
|
26
|
-
"@cloudbase/agent-
|
|
27
|
-
"@cloudbase/agent-adapter-
|
|
28
|
-
"@cloudbase/agent-adapter-
|
|
29
|
-
"@cloudbase/agent-adapter-
|
|
30
|
-
"@cloudbase/agent-adapter-openai-agent-sdk": "^0.0.
|
|
31
|
-
"@cloudbase/agent-agents": "^0.0.
|
|
32
|
-
"@cloudbase/agent-examples-agkit-agents-
|
|
33
|
-
"@cloudbase/agent-
|
|
34
|
-
"@cloudbase/agent-examples-
|
|
35
|
-
"@cloudbase/agent-examples-
|
|
36
|
-
"@cloudbase/agent-examples-
|
|
37
|
-
"@cloudbase/agent-examples-
|
|
38
|
-
"@cloudbase/agent-examples-claude-agent-human-in-the-loop": "^0.0.
|
|
39
|
-
"@cloudbase/agent-examples-
|
|
40
|
-
"@cloudbase/agent-examples-
|
|
41
|
-
"@cloudbase/agent-examples-
|
|
42
|
-
"@cloudbase/agent-examples-
|
|
43
|
-
"@cloudbase/agent-
|
|
44
|
-
"@cloudbase/agent-
|
|
45
|
-
"@cloudbase/agent-
|
|
27
|
+
"@cloudbase/agent-agents": "^0.0.8",
|
|
28
|
+
"@cloudbase/agent-adapter-mastra": "^0.0.8",
|
|
29
|
+
"@cloudbase/agent-adapter-langchain": "^0.0.8",
|
|
30
|
+
"@cloudbase/agent-adapter-langgraph": "^0.0.8",
|
|
31
|
+
"@cloudbase/agent-adapter-openai-agent-sdk": "^0.0.8",
|
|
32
|
+
"@cloudbase/agent-examples-agkit-agents-mcp-knowledge-retrieval": "^0.0.8",
|
|
33
|
+
"@cloudbase/agent-examples-agkit-agents-manga-creator": "^0.0.8",
|
|
34
|
+
"@cloudbase/agent-adapter-llamaindex": "^0.0.8",
|
|
35
|
+
"@cloudbase/agent-examples-langgraph-agentic-chat": "^0.0.8",
|
|
36
|
+
"@cloudbase/agent-examples-langchain-agentic-chat": "^0.0.8",
|
|
37
|
+
"@cloudbase/agent-examples-claude-agent-agentic-chat": "^0.0.8",
|
|
38
|
+
"@cloudbase/agent-examples-agkit-agents-human-in-the-loop": "^0.0.8",
|
|
39
|
+
"@cloudbase/agent-examples-claude-agent-human-in-the-loop": "^0.0.8",
|
|
40
|
+
"@cloudbase/agent-examples-langgraph-human-in-the-loop": "^0.0.8",
|
|
41
|
+
"@cloudbase/agent-examples-llamaindex-ts-multi-agent": "^0.0.8",
|
|
42
|
+
"@cloudbase/agent-examples-mastra-agentic-chat": "^0.0.8",
|
|
43
|
+
"@cloudbase/agent-examples-openai-agent-sdk-agentic-chat": "^0.0.8",
|
|
44
|
+
"@cloudbase/agent-react-coding-agent": "^0.0.8",
|
|
45
|
+
"@cloudbase/agent-examples-agkit-agents-multi-agent": "^0.0.8",
|
|
46
|
+
"@cloudbase/agent-server": "^0.0.8",
|
|
47
|
+
"@cloudbase/agent-examples-agkit-agents-agentic-chat": "^0.0.8"
|
|
46
48
|
},
|
|
47
49
|
"scripts": {
|
|
48
50
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
49
51
|
"build": "tsup --config tsup.config.ts",
|
|
50
|
-
"start": "node dist/index.
|
|
51
|
-
"
|
|
52
|
+
"start": "node dist/index.mjs",
|
|
53
|
+
"start:tsx": "tsx src/index.ts",
|
|
54
|
+
"start:simple": "tsx src/simple-server.ts",
|
|
55
|
+
"dev": "npm run build && npm run start",
|
|
56
|
+
"dev:tsx": "tsx src/index.ts",
|
|
57
|
+
"dev:simple": "tsx src/simple-server.ts"
|
|
52
58
|
}
|
|
53
59
|
}
|
package/dist/index.d.mts
DELETED
package/dist/index.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var index_exports = {};
|
|
32
|
-
__export(index_exports, {
|
|
33
|
-
server: () => server_default
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(index_exports);
|
|
36
|
-
var process2 = __toESM(require("process"));
|
|
37
|
-
|
|
38
|
-
// src/server.ts
|
|
39
|
-
var import_cors = __toESM(require("cors"));
|
|
40
|
-
var import_dotenv = __toESM(require("dotenv"));
|
|
41
|
-
var import_agent_adapter_langgraph = require("@cloudbase/agent-adapter-langgraph");
|
|
42
|
-
var import_agent_server = require("@cloudbase/agent-server");
|
|
43
|
-
var import_agent_adapter_llamaindex = require("@cloudbase/agent-adapter-llamaindex");
|
|
44
|
-
var import_agent_adapter_mastra = require("@cloudbase/agent-adapter-mastra");
|
|
45
|
-
var import_express = __toESM(require("express"));
|
|
46
|
-
var undici = __toESM(require("undici"));
|
|
47
|
-
var import_agent_examples_langgraph_agentic_chat = require("@cloudbase/agent-examples-langgraph-agentic-chat");
|
|
48
|
-
var import_agent_examples_langgraph_human_in_the_loop = require("@cloudbase/agent-examples-langgraph-human-in-the-loop");
|
|
49
|
-
var import_agent_examples_agkit_agents_agentic_chat = require("@cloudbase/agent-examples-agkit-agents-agentic-chat");
|
|
50
|
-
var import_agent_examples_agkit_agents_human_in_the_loop = require("@cloudbase/agent-examples-agkit-agents-human-in-the-loop");
|
|
51
|
-
var import_agent_examples_llamaindex_ts_multi_agent = require("@cloudbase/agent-examples-llamaindex-ts-multi-agent");
|
|
52
|
-
var import_agent_examples_mastra_agentic_chat = require("@cloudbase/agent-examples-mastra-agentic-chat");
|
|
53
|
-
var import_agent_examples_agkit_agents_mcp_knowledge_retrieval = require("@cloudbase/agent-examples-agkit-agents-mcp-knowledge-retrieval");
|
|
54
|
-
var import_agent_examples_agkit_agents_multi_agent = require("@cloudbase/agent-examples-agkit-agents-multi-agent");
|
|
55
|
-
var import_agent_examples_langchain_agentic_chat = require("@cloudbase/agent-examples-langchain-agentic-chat");
|
|
56
|
-
var import_agent_examples_openai_agent_sdk_agentic_chat = require("@cloudbase/agent-examples-openai-agent-sdk-agentic-chat");
|
|
57
|
-
var import_agent_adapter_openai_agent_sdk = require("@cloudbase/agent-adapter-openai-agent-sdk");
|
|
58
|
-
var import_agent_agents = require("@cloudbase/agent-agents");
|
|
59
|
-
var import_agent_examples_agkit_agents_manga_creator = require("@cloudbase/agent-examples-agkit-agents-manga-creator");
|
|
60
|
-
var import_agent_examples_claude_agent_agentic_chat = require("@cloudbase/agent-examples-claude-agent-agentic-chat");
|
|
61
|
-
var import_agent_examples_claude_agent_human_in_the_loop = require("@cloudbase/agent-examples-claude-agent-human-in-the-loop");
|
|
62
|
-
import_dotenv.default.config({ path: ".env" });
|
|
63
|
-
if (process.env.http_proxy) {
|
|
64
|
-
undici.setGlobalDispatcher(new undici.ProxyAgent(process.env.http_proxy));
|
|
65
|
-
}
|
|
66
|
-
var memory = new import_agent_agents.InMemoryMemory();
|
|
67
|
-
async function createApp() {
|
|
68
|
-
const app = (0, import_express.default)();
|
|
69
|
-
app.use((0, import_cors.default)());
|
|
70
|
-
const AGENTS = {
|
|
71
|
-
agentic_chat: () => {
|
|
72
|
-
return {
|
|
73
|
-
agent: new import_agent_adapter_langgraph.LanggraphAgent({
|
|
74
|
-
description: "An agent to showcase agentic chat ability.",
|
|
75
|
-
compiledWorkflow: import_agent_examples_langgraph_agentic_chat.agenticChatGraph
|
|
76
|
-
})
|
|
77
|
-
};
|
|
78
|
-
},
|
|
79
|
-
human_in_the_loop: () => {
|
|
80
|
-
return {
|
|
81
|
-
agent: new import_agent_adapter_langgraph.LanggraphAgent({
|
|
82
|
-
description: "An agent to showcase human in the loop ability.",
|
|
83
|
-
compiledWorkflow: import_agent_examples_langgraph_human_in_the_loop.humanInTheLoopGraph
|
|
84
|
-
})
|
|
85
|
-
};
|
|
86
|
-
},
|
|
87
|
-
agkit_agentic_chat: () => {
|
|
88
|
-
return {
|
|
89
|
-
agent: (0, import_agent_examples_agkit_agents_agentic_chat.createAgenticChatAgent)()
|
|
90
|
-
};
|
|
91
|
-
},
|
|
92
|
-
agkit_human_in_the_loop: () => {
|
|
93
|
-
return {
|
|
94
|
-
agent: (0, import_agent_examples_agkit_agents_human_in_the_loop.createHumanInTheLoopAgent)()
|
|
95
|
-
};
|
|
96
|
-
},
|
|
97
|
-
agkit_mcp_knowledge_retrieval: async () => {
|
|
98
|
-
const { agent, cleanup } = await (0, import_agent_examples_agkit_agents_mcp_knowledge_retrieval.createMCPKnowledgeRetrievalAgent)();
|
|
99
|
-
return {
|
|
100
|
-
agent,
|
|
101
|
-
cleanup
|
|
102
|
-
};
|
|
103
|
-
},
|
|
104
|
-
llamaindex_multi_agent: () => {
|
|
105
|
-
return {
|
|
106
|
-
agent: new import_agent_adapter_llamaindex.LlamaIndexAgent({
|
|
107
|
-
workflowFactory: import_agent_examples_llamaindex_ts_multi_agent.createWebReadingMultiAgent
|
|
108
|
-
})
|
|
109
|
-
};
|
|
110
|
-
},
|
|
111
|
-
mastra_agentic_chat: () => {
|
|
112
|
-
return {
|
|
113
|
-
agent: new import_agent_adapter_mastra.MastraAgent({
|
|
114
|
-
runnableFactory: import_agent_examples_mastra_agentic_chat.createAgenticChatAgent
|
|
115
|
-
})
|
|
116
|
-
};
|
|
117
|
-
},
|
|
118
|
-
agkit_multi_agent: () => {
|
|
119
|
-
return {
|
|
120
|
-
agent: (0, import_agent_examples_agkit_agents_multi_agent.createMultiAgentOrchestrator)()
|
|
121
|
-
};
|
|
122
|
-
},
|
|
123
|
-
langchain_agentic_chat: () => {
|
|
124
|
-
return {
|
|
125
|
-
agent: (0, import_agent_examples_langchain_agentic_chat.createAgent)()
|
|
126
|
-
};
|
|
127
|
-
},
|
|
128
|
-
claude_agent_agentic_chat: () => {
|
|
129
|
-
return {
|
|
130
|
-
agent: (0, import_agent_examples_claude_agent_agentic_chat.createAgent)()
|
|
131
|
-
};
|
|
132
|
-
},
|
|
133
|
-
claude_agent_human_in_the_loop: () => {
|
|
134
|
-
return {
|
|
135
|
-
agent: (0, import_agent_examples_claude_agent_human_in_the_loop.createAgent)()
|
|
136
|
-
};
|
|
137
|
-
},
|
|
138
|
-
openai_agentic_chat: () => {
|
|
139
|
-
return {
|
|
140
|
-
agent: new import_agent_adapter_openai_agent_sdk.OpenAIAgent({
|
|
141
|
-
...(0, import_agent_examples_openai_agent_sdk_agentic_chat.createOpenAIAgenticChatAgent)(),
|
|
142
|
-
memory
|
|
143
|
-
})
|
|
144
|
-
};
|
|
145
|
-
},
|
|
146
|
-
agkit_manga_creator: () => {
|
|
147
|
-
return {
|
|
148
|
-
agent: (0, import_agent_examples_agkit_agents_manga_creator.createMangaCreatorAgent)()
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
Object.entries(AGENTS).forEach(([key, agent]) => {
|
|
153
|
-
(0, import_agent_server.createExpressRoutes)({
|
|
154
|
-
basePath: `/${key}/`,
|
|
155
|
-
createAgent: agent,
|
|
156
|
-
express: app
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
return app;
|
|
160
|
-
}
|
|
161
|
-
var server_default = createApp;
|
|
162
|
-
|
|
163
|
-
// src/index.ts
|
|
164
|
-
var port = process2.env.PORT || 9e3;
|
|
165
|
-
async function startServer() {
|
|
166
|
-
const app = await server_default();
|
|
167
|
-
return new Promise((resolve, reject) => {
|
|
168
|
-
app.listen(port, (err) => {
|
|
169
|
-
if (err) {
|
|
170
|
-
reject(err);
|
|
171
|
-
} else {
|
|
172
|
-
resolve(app);
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
startServer().then(() => {
|
|
178
|
-
console.log("Server running on port " + port);
|
|
179
|
-
}).catch(console.error);
|
|
180
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
181
|
-
0 && (module.exports = {
|
|
182
|
-
server
|
|
183
|
-
});
|
|
184
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/server.ts"],"sourcesContent":["import * as process from \"node:process\";\nexport { default as server } from \"./server.js\";\n\nimport createApp from \"./server.js\";\n\n\nconst port = process.env.PORT || 9000;\nasync function startServer() {\n const app = await createApp();\n\n return new Promise<Awaited<ReturnType<typeof createApp>>>((resolve, reject) => {\n app.listen(port, (err) => {\n if (err) {\n reject(err);\n } else {\n resolve(app);\n }\n });\n });\n}\n\nstartServer().then(() => {\n console.log(\"Server running on port \" + port);\n}).catch(console.error);\n","import cors from \"cors\";\nimport dotenv from \"dotenv\";\nimport { LanggraphAgent } from \"@cloudbase/agent-adapter-langgraph\";\nimport { createExpressRoutes } from \"@cloudbase/agent-server\";\nimport { LlamaIndexAgent } from \"@cloudbase/agent-adapter-llamaindex\";\nimport { MastraAgent } from \"@cloudbase/agent-adapter-mastra\";\nimport express from \"express\";\nimport * as undici from \"undici\";\nimport { agenticChatGraph } from \"@cloudbase/agent-examples-langgraph-agentic-chat\";\nimport { humanInTheLoopGraph } from \"@cloudbase/agent-examples-langgraph-human-in-the-loop\";\nimport { createAgenticChatAgent } from \"@cloudbase/agent-examples-agkit-agents-agentic-chat\";\nimport { createHumanInTheLoopAgent } from \"@cloudbase/agent-examples-agkit-agents-human-in-the-loop\";\nimport { createWebReadingMultiAgent } from \"@cloudbase/agent-examples-llamaindex-ts-multi-agent\";\nimport { createAgenticChatAgent as createMastraAgenticChatAgent } from \"@cloudbase/agent-examples-mastra-agentic-chat\";\nimport { createMCPKnowledgeRetrievalAgent } from \"@cloudbase/agent-examples-agkit-agents-mcp-knowledge-retrieval\";\nimport { createMultiAgentOrchestrator } from \"@cloudbase/agent-examples-agkit-agents-multi-agent\";\nimport { createAgent as createLangchainAgenticChatAgent } from \"@cloudbase/agent-examples-langchain-agentic-chat\";\nimport { createOpenAIAgenticChatAgent } from \"@cloudbase/agent-examples-openai-agent-sdk-agentic-chat\";\nimport { OpenAIAgent } from \"@cloudbase/agent-adapter-openai-agent-sdk\";\nimport { InMemoryMemory } from \"@cloudbase/agent-agents\";\nimport { createMangaCreatorAgent } from \"@cloudbase/agent-examples-agkit-agents-manga-creator\";\nimport { createAgent as createClaudeAgenticChatAgent } from \"@cloudbase/agent-examples-claude-agent-agentic-chat\";\nimport { createAgent as createClaudeHumanInTheLoopAgent } from \"@cloudbase/agent-examples-claude-agent-human-in-the-loop\";\n\n// Load environment variables FIRST\ndotenv.config({ path: \".env\" });\nif (process.env.http_proxy) {\n undici.setGlobalDispatcher(new undici.ProxyAgent(process.env.http_proxy));\n}\nconst memory = new InMemoryMemory();\nasync function createApp(): Promise<express.Express> {\n const app: express.Express = express();\n\n app.use(cors());\n\n const AGENTS = {\n agentic_chat: () => {\n return {\n agent: new LanggraphAgent({\n description: \"An agent to showcase agentic chat ability.\",\n compiledWorkflow: agenticChatGraph,\n }),\n };\n },\n\n human_in_the_loop: () => {\n return {\n agent: new LanggraphAgent({\n description: \"An agent to showcase human in the loop ability.\",\n compiledWorkflow: humanInTheLoopGraph,\n }),\n };\n },\n\n agkit_agentic_chat: () => {\n return {\n agent: createAgenticChatAgent(),\n };\n },\n\n agkit_human_in_the_loop: () => {\n return {\n agent: createHumanInTheLoopAgent(),\n };\n },\n\n agkit_mcp_knowledge_retrieval: async () => {\n const { agent, cleanup } = await createMCPKnowledgeRetrievalAgent();\n return {\n agent,\n cleanup,\n };\n },\n llamaindex_multi_agent: () => {\n return {\n agent: new LlamaIndexAgent({\n workflowFactory: createWebReadingMultiAgent,\n }),\n };\n },\n mastra_agentic_chat: () => {\n return {\n agent: new MastraAgent({\n runnableFactory: createMastraAgenticChatAgent,\n }),\n };\n },\n\n agkit_multi_agent: () => {\n return {\n agent: createMultiAgentOrchestrator(),\n };\n },\n langchain_agentic_chat: () => {\n return {\n agent: createLangchainAgenticChatAgent(),\n };\n },\n\n claude_agent_agentic_chat: () => {\n return {\n agent: createClaudeAgenticChatAgent(),\n };\n },\n claude_agent_human_in_the_loop: () => {\n return {\n agent: createClaudeHumanInTheLoopAgent(),\n };\n },\n openai_agentic_chat: () => {\n return {\n agent: new OpenAIAgent({\n ...createOpenAIAgenticChatAgent(),\n memory,\n }),\n };\n },\n agkit_manga_creator: () => {\n return {\n agent: createMangaCreatorAgent(),\n };\n },\n };\n\n Object.entries(AGENTS).forEach(([key, agent]) => {\n createExpressRoutes({\n basePath: `/${key}/`,\n createAgent: agent,\n express: app,\n });\n });\n\n return app;\n}\n\nexport default createApp;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,WAAyB;;;ACAzB,kBAAiB;AACjB,oBAAmB;AACnB,qCAA+B;AAC/B,0BAAoC;AACpC,sCAAgC;AAChC,kCAA4B;AAC5B,qBAAoB;AACpB,aAAwB;AACxB,mDAAiC;AACjC,wDAAoC;AACpC,sDAAuC;AACvC,2DAA0C;AAC1C,sDAA2C;AAC3C,gDAAuE;AACvE,iEAAiD;AACjD,qDAA6C;AAC7C,mDAA+D;AAC/D,0DAA6C;AAC7C,4CAA4B;AAC5B,0BAA+B;AAC/B,uDAAwC;AACxC,sDAA4D;AAC5D,2DAA+D;AAG/D,cAAAC,QAAO,OAAO,EAAE,MAAM,OAAO,C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AA,QACL,WAAO,6CAAAC,aAAgC;AAAA,MACzC;AAAA,IACF;AAAA,IAEA,2BAA2B,MAAM;AAC/B,aAAO;AAAA,QACL,WAAO,gDAAAC,aAA6B;AAAA,MACtC;AAAA,IACF;AAAA,IACA,gCAAgC,MAAM;AACpC,aAAO;AAAA,QACL,WAAO,qDAAAC,aAAgC;AAAA,MACzC;AAAA,IACF;AAAA,IACA,qBAAqB,MAAM;AACzB,aAAO;AAAA,QACL,OAAO,IAAI,kDAAY;AAAA,UACrB,OAAG,kFAA6B;AAAA,UAChC;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,IACA,qBAAqB,MAAM;AACzB,aAAO;AAAA,QACL,WAAO,0EAAwB;AAAA,MACjC;AAAA,IACF;AAAA,EACF;AAEA,SAAO,QAAQ,MAAM,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC/C,iDAAoB;AAAA,MAClB,UAAU,IAAI,GAAG;AAAA,MACjB,aAAa;AAAA,MACb,SAAS;AAAA,IACX,CAAC;AAAA,EACH,CAAC;AAED,SAAO;AACT;AAEA,IAAO,iBAAQ;;;ADjIf,IAAM,OAAe,aAAI,QAAQ;AACjC,eAAe,cAAc;AAC3B,QAAM,MAAM,MAAM,eAAU;AAE5B,SAAO,IAAI,QAA+C,CAAC,SAAS,WAAW;AAC7E,QAAI,OAAO,MAAM,CAAC,QAAQ;AACxB,UAAI,KAAK;AACP,eAAO,GAAG;AAAA,MACZ,OAAO;AACL,gBAAQ,GAAG;AAAA,MACb;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;AAEA,YAAY,EAAE,KAAK,MAAM;AACvB,UAAQ,IAAI,4BAA4B,IAAI;AAC9C,CAAC,EAAE,MAAM,QAAQ,KAAK;","names":["process","dotenv","express","cors","createMastraAgenticChatAgent","createLangchainAgenticChatAgent","createClaudeAgenticChatAgent","createClaudeHumanInTheLoopAgent"]}
|