@lov3kaizen/agentsea-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/LICENSE +21 -0
- package/README.md +108 -0
- package/dist/index.d.mts +1346 -0
- package/dist/index.d.ts +1346 -0
- package/dist/index.js +6167 -0
- package/dist/index.mjs +6066 -0
- package/package.json +98 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 lovekaizen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# @agentsea/core
|
|
2
|
+
|
|
3
|
+
**Unite and orchestrate AI agents** - Framework-agnostic core library for building agentic AI applications in Node.js.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@agentsea/core)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Multi-Provider Support - Anthropic Claude, OpenAI GPT, Google Gemini
|
|
12
|
+
- Local & Open Source Models - Ollama, LM Studio, LocalAI, Text Generation WebUI, vLLM
|
|
13
|
+
- Voice Support (TTS/STT) - OpenAI Whisper, ElevenLabs, Piper TTS
|
|
14
|
+
- MCP Protocol - First-class Model Context Protocol integration
|
|
15
|
+
- ACP Protocol - Agentic Commerce Protocol for e-commerce integration
|
|
16
|
+
- Multi-Agent Workflows - Sequential, parallel, and supervisor orchestration
|
|
17
|
+
- Conversation Schemas - Structured conversational experiences with validation
|
|
18
|
+
- Advanced Memory - Buffer, Redis, and summary-based memory stores
|
|
19
|
+
- Built-in Tools - 8 production-ready tools + custom tool support
|
|
20
|
+
- Full Observability - Logging, metrics, and distributed tracing
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install @agentsea/core
|
|
26
|
+
# or
|
|
27
|
+
pnpm add @agentsea/core
|
|
28
|
+
# or
|
|
29
|
+
yarn add @agentsea/core
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Quick Start
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import {
|
|
36
|
+
Agent,
|
|
37
|
+
AnthropicProvider,
|
|
38
|
+
ToolRegistry,
|
|
39
|
+
BufferMemory,
|
|
40
|
+
calculatorTool,
|
|
41
|
+
} from '@agentsea/core';
|
|
42
|
+
|
|
43
|
+
// Create agent
|
|
44
|
+
const agent = new Agent(
|
|
45
|
+
{
|
|
46
|
+
name: 'assistant',
|
|
47
|
+
model: 'claude-sonnet-4-20250514',
|
|
48
|
+
provider: 'anthropic',
|
|
49
|
+
systemPrompt: 'You are a helpful assistant.',
|
|
50
|
+
tools: [calculatorTool],
|
|
51
|
+
},
|
|
52
|
+
new AnthropicProvider(process.env.ANTHROPIC_API_KEY),
|
|
53
|
+
new ToolRegistry(),
|
|
54
|
+
new BufferMemory(50),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
// Execute
|
|
58
|
+
const response = await agent.execute('What is 42 * 58?', {
|
|
59
|
+
conversationId: 'user-123',
|
|
60
|
+
sessionData: {},
|
|
61
|
+
history: [],
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
console.log(response.content);
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Multi-Provider Support
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
import {
|
|
71
|
+
GeminiProvider,
|
|
72
|
+
OpenAIProvider,
|
|
73
|
+
AnthropicProvider,
|
|
74
|
+
OllamaProvider,
|
|
75
|
+
} from '@agentsea/core';
|
|
76
|
+
|
|
77
|
+
// Use any provider
|
|
78
|
+
const geminiAgent = new Agent(config, new GeminiProvider(apiKey), toolRegistry);
|
|
79
|
+
const openaiAgent = new Agent(config, new OpenAIProvider(apiKey), toolRegistry);
|
|
80
|
+
const claudeAgent = new Agent(
|
|
81
|
+
config,
|
|
82
|
+
new AnthropicProvider(apiKey),
|
|
83
|
+
toolRegistry,
|
|
84
|
+
);
|
|
85
|
+
const ollamaAgent = new Agent(config, new OllamaProvider(), toolRegistry);
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Documentation
|
|
89
|
+
|
|
90
|
+
Full documentation available at [agentsea.dev](https://agentsea.dev)
|
|
91
|
+
|
|
92
|
+
- [Quick Start](https://agentsea.dev/docs/quick-start)
|
|
93
|
+
- [Agents](https://agentsea.dev/docs/agents)
|
|
94
|
+
- [Tools](https://agentsea.dev/docs/tools)
|
|
95
|
+
- [Workflows](https://agentsea.dev/docs/workflows)
|
|
96
|
+
- [Memory](https://agentsea.dev/docs/memory)
|
|
97
|
+
- [MCP Integration](https://agentsea.dev/docs/mcp-overview)
|
|
98
|
+
- [API Reference](https://agentsea.dev/api)
|
|
99
|
+
|
|
100
|
+
## Related Packages
|
|
101
|
+
|
|
102
|
+
- [@agentsea/cli](https://www.npmjs.com/package/@agentsea/cli) - Command-line interface
|
|
103
|
+
- [@agentsea/nestjs](https://www.npmjs.com/package/@agentsea/nestjs) - NestJS integration
|
|
104
|
+
- [@agentsea/react](https://www.npmjs.com/package/@agentsea/react) - React components
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
MIT License - see [LICENSE](../../LICENSE) for details
|