@artinet/fleet 0.1.0-alpha.1

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.
Files changed (60) hide show
  1. package/README.md +257 -0
  2. package/dist/src/default.d.ts +696 -0
  3. package/dist/src/default.js +17 -0
  4. package/dist/src/index.d.ts +6 -0
  5. package/dist/src/index.js +6 -0
  6. package/dist/src/routes/create/index.d.ts +1317 -0
  7. package/dist/src/routes/create/index.js +3 -0
  8. package/dist/src/routes/index.d.ts +2 -0
  9. package/dist/src/routes/index.js +2 -0
  10. package/dist/src/routes/request/implementation/index.d.ts +4 -0
  11. package/dist/src/routes/request/implementation/index.js +4 -0
  12. package/dist/src/routes/request/implementation/invoke.d.ts +8 -0
  13. package/dist/src/routes/request/implementation/invoke.js +150 -0
  14. package/dist/src/routes/request/implementation/load.d.ts +2 -0
  15. package/dist/src/routes/request/implementation/load.js +50 -0
  16. package/dist/src/routes/request/implementation/request.d.ts +2 -0
  17. package/dist/src/routes/request/implementation/request.js +28 -0
  18. package/dist/src/routes/request/implementation/test-invoke.d.ts +3 -0
  19. package/dist/src/routes/request/implementation/test-invoke.js +42 -0
  20. package/dist/src/routes/request/index.d.ts +4 -0
  21. package/dist/src/routes/request/index.js +4 -0
  22. package/dist/src/routes/request/interceptors/fetch-agent.d.ts +2 -0
  23. package/dist/src/routes/request/interceptors/fetch-agent.js +26 -0
  24. package/dist/src/routes/request/interceptors/get-agents.d.ts +2 -0
  25. package/dist/src/routes/request/interceptors/get-agents.js +38 -0
  26. package/dist/src/routes/request/interceptors/index.d.ts +2 -0
  27. package/dist/src/routes/request/interceptors/index.js +2 -0
  28. package/dist/src/routes/request/request.d.ts +8 -0
  29. package/dist/src/routes/request/request.js +16 -0
  30. package/dist/src/routes/request/types/definitions.d.ts +733 -0
  31. package/dist/src/routes/request/types/definitions.js +11 -0
  32. package/dist/src/routes/request/types/index.d.ts +1 -0
  33. package/dist/src/routes/request/types/index.js +1 -0
  34. package/dist/src/server/express/agent-request.d.ts +26 -0
  35. package/dist/src/server/express/agent-request.js +44 -0
  36. package/dist/src/server/express/deploy-request.d.ts +14 -0
  37. package/dist/src/server/express/deploy-request.js +19 -0
  38. package/dist/src/server/express/fleet.d.ts +3 -0
  39. package/dist/src/server/express/fleet.js +2 -0
  40. package/dist/src/server/express/index.d.ts +4 -0
  41. package/dist/src/server/express/index.js +4 -0
  42. package/dist/src/server/express/rpc.d.ts +12 -0
  43. package/dist/src/server/express/rpc.js +38 -0
  44. package/dist/src/server/express/server.d.ts +26 -0
  45. package/dist/src/server/express/server.js +115 -0
  46. package/dist/src/server/express/test-request.d.ts +14 -0
  47. package/dist/src/server/express/test-request.js +47 -0
  48. package/dist/src/server/express/utils.d.ts +5 -0
  49. package/dist/src/server/express/utils.js +11 -0
  50. package/dist/src/server/index.d.ts +1 -0
  51. package/dist/src/server/index.js +1 -0
  52. package/dist/src/settings.d.ts +14 -0
  53. package/dist/src/settings.js +1 -0
  54. package/dist/src/ship.d.ts +2 -0
  55. package/dist/src/ship.js +15 -0
  56. package/dist/src/storage.d.ts +5 -0
  57. package/dist/src/storage.js +8 -0
  58. package/dist/src/types.d.ts +14 -0
  59. package/dist/src/types.js +1 -0
  60. package/package.json +90 -0
package/README.md ADDED
@@ -0,0 +1,257 @@
1
+ [![Website](https://img.shields.io/badge/website-artinet.io-black)](https://artinet.io/)
2
+ [![npm version](https://img.shields.io/npm/v/@artinet/fleet.svg?logoColor=black)](https://www.npmjs.com/package/@artinet/fleet)
3
+ [![Apache License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
4
+ [![Discord](https://dcbadge.limes.pink/api/server/DaxzSchmmX?style=flat)](https://discord.gg/DaxzSchmmX)
5
+ [![Known Vulnerabilities](https://snyk.io/test/npm/@artinet/fleet/badge.svg)](https://snyk.io/test/npm/@artinet/fleet)
6
+
7
+ # @artinet/fleet
8
+
9
+ Deploy AI agents on any infrastructure.
10
+
11
+ Fleet is a lightweight server framework for hosting [A2A Protocol](https://github.com/google-a2a/A2A) agents with built-in orchestration, tool integration (MCP), and Agent2Agent communication.
12
+
13
+ > 🚧 **More servers coming soon** — Hono, Bun, and standalone adapters are on the roadmap.
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install @artinet/fleet express openai @modelcontextprotocol/sdk
19
+ ```
20
+
21
+ **Requirements:** Node.js ≥ 18.9.1
22
+
23
+ ## Quick Start
24
+
25
+ ### 1. Launch a Fleet
26
+
27
+ Set an `OPENAI_API_KEY` in you environment variables, then start your Server.
28
+
29
+ ```typescript
30
+ import { fleet } from "@artinet/fleet/express";
31
+
32
+ const { app } = fleet().launch(3000);
33
+ ```
34
+
35
+ That's it. You now have:
36
+
37
+ - `POST /deploy` — Deploy agents
38
+ - `POST /test` — Test agent deployments
39
+ - `GET /agentId/:id/.well-known/agent-card.json` — Agent metadata
40
+ - `POST /agentId/:id` — JSON-RPC agent interaction
41
+
42
+ ### 2. Deploy an Agent
43
+
44
+ **Prelaunch**:
45
+
46
+ ```typescript
47
+ import { fleet } from "@artinet/fleet/express";
48
+
49
+ const myFleet = await fleet().ship([
50
+ {
51
+ config: {
52
+ uri: "my-agent",
53
+ ...
54
+ },
55
+ },
56
+ ]);
57
+
58
+ myFleet.launch(3000);
59
+ ```
60
+
61
+ **Ship**:
62
+
63
+ ```typescript
64
+ import { ship } from "@artinet/fleet";
65
+
66
+ await ship("http://localhost:3000", {
67
+ config: {
68
+ uri: "my-agent",
69
+ ...
70
+ },
71
+ });
72
+ ```
73
+
74
+ **Curl**:
75
+
76
+ ```bash
77
+ curl -X POST http://localhost:3000/deploy \
78
+ -H "Content-Type: application/json" \
79
+ -d '{
80
+ "config": {
81
+ "name": "My Agent",
82
+ "uri": "my-agent",
83
+ "description": "A helpful assistant",
84
+ "modelId": "gpt-4",
85
+ "instructions": "You are a helpful assistant.",
86
+ "version": "1.0.0",
87
+ "skills": [],
88
+ "capabilities" : {},
89
+ "defaultInputModes": ["text"],
90
+ "defaultOutputModes": ["text"],
91
+ "services": [{
92
+ "type": "mcp",
93
+ "uri": "everything-server-1",
94
+ "info": {
95
+ "uri": "everything-server-1",
96
+ "implementation": {
97
+ "version": "0.0.1",
98
+ "name": "everything"
99
+ }
100
+ },
101
+ "arguments": {
102
+ "command": "npx",
103
+ "args": [
104
+ "-y",
105
+ "@modelcontextprotocol/server-everything@2025.11.25"
106
+ ]
107
+ }
108
+ }]
109
+ }
110
+ }'
111
+ ```
112
+
113
+ > 🚧 Coming Soon: Support for Remote MCP Servers.
114
+
115
+ ### 3. Talk to Your Agent
116
+
117
+ via curl:
118
+
119
+ ```bash
120
+ curl -X POST http://localhost:3000/agentId/my-agent \
121
+ -H "Content-Type: application/json" \
122
+ -d '{
123
+ "jsonrpc": "2.0",
124
+ "id": 1,
125
+ "method": "message/send",
126
+ "params": {
127
+ "message": {
128
+ "messageId": "hello-id",
129
+ "kind": "message",
130
+ "role": "user",
131
+ "parts": [{ "kind": "text", "text": "Hello!" }]
132
+ }
133
+ }
134
+ }'
135
+ ```
136
+
137
+ or via the [sdk](https://github.com/the-artinet-project/artinet-sdk):
138
+
139
+ ```typescript
140
+ import { A2AClient } from "@artinet/sdk";
141
+
142
+ const client = new A2AClient("http://localhost:3000/agentId/my-agent");
143
+
144
+ // Send a message
145
+ const response = await client.sendMessage("Hello!");
146
+
147
+ console.log(response);
148
+
149
+ // Or stream the response
150
+ for await (const update of client.sendStreamingMessage("Tell me a story")) {
151
+ console.log(update);
152
+ }
153
+ ```
154
+
155
+ <!-- ## Custom Handlers
156
+
157
+ ```typescript
158
+ import { fleet, InMemoryStore } from "@artinet/fleet/express";
159
+
160
+ const storage = new InMemoryStore();
161
+
162
+ const app = fleet(
163
+ {
164
+ storage,
165
+
166
+ // Custom agent retrieval
167
+ get: async (request, context) => {
168
+ const agent = await storage.get(context.agentId);
169
+ // ... return response
170
+ },
171
+
172
+ // Custom deployment logic
173
+ set: async (request, context) => {
174
+ await storage.set(request.config.uri, request.config);
175
+ return { agentId: request.config.uri, success: true };
176
+ },
177
+ },
178
+ {
179
+ // Optional auth middleware
180
+ auth: async (req, res, next) => {
181
+ if (validateToken(req.headers.authorization)) {
182
+ next();
183
+ } else {
184
+ res.status(401).json({ error: "Unauthorized" });
185
+ }
186
+ },
187
+ }
188
+ );
189
+
190
+ app.listen(3000);
191
+ ``` -->
192
+
193
+ ## Configuration
194
+
195
+ | Option | Type | Default | Description |
196
+ | ---------------------- | ------------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------- |
197
+ | `storage` | `IDataStore` | `InMemoryStore` | Agent storage backend (storage adapters coming soon) |
198
+ | `basePath` | `string` | `"/"` | Base path for all routes |
199
+ | `agentPath` | `string` | `"/agentId"` | Agent interaction path |
200
+ | `deploymentPath` | `string` | `"/deploy"` | Deployment endpoint |
201
+ | `testPath` | `string` | `"/test"` | Test endpoint |
202
+ | `inferenceProviderUrl` | `string` | `undefined` | An OpenAI API compatible endpoint |
203
+ | `load` | `function` | `loadAgent` | Returns an A2A Protocol compliant agent wrapped in the [`@artinet/sdk`](<(https://github.com/the-artinet-project/artinet-sdk)>) |
204
+
205
+ ## API Reference
206
+
207
+ ### Endpoints
208
+
209
+ | Method | Path | Description |
210
+ | ------ | ------------------------------------------ | -------------------- |
211
+ | POST | `/deploy` | Deploy a new agent |
212
+ | POST | `/test` | Test an agent |
213
+ | GET | `/agentId/:id/.well-known/agent-card.json` | Get agent card |
214
+ | POST | `/agentId/:id` | JSON-RPC interaction |
215
+
216
+ ### JSON-RPC Methods
217
+
218
+ | Method | Description |
219
+ | ---------------- | ----------------------------- |
220
+ | `message/send` | Send a message, get response |
221
+ | `message/stream` | Send a message, stream events |
222
+ | `task/get` | Get task status |
223
+ | `task/cancel` | Cancel a running task |
224
+ | `resubscribe` | stream events |
225
+
226
+ ## Architecture
227
+
228
+ ```
229
+
230
+ @artinet/fleet
231
+ ├── /express # Express adapter (current)
232
+ ├── /hono # Coming soon
233
+ └── /bun # Coming soon
234
+
235
+ Depends on:
236
+ ├── @artinet/armada # Core business logic
237
+ ├── @artinet/sdk # A2A protocol client/server
238
+ ├── orc8 # Agent orchestration
239
+ ├── agent-def # Standardized Agent Definitions
240
+ ├── openai # OpenAI API Client
241
+ └── @mcp # @modelcontextprotocol/sdk
242
+
243
+ ```
244
+
245
+ ## Testing
246
+
247
+ ```bash
248
+ npm test
249
+ ```
250
+
251
+ ## License
252
+
253
+ Apache-2.0
254
+
255
+ ## Contributing
256
+
257
+ Contributions welcome! Please open an issue or PR on [GitHub](https://github.com/the-artinet-project/fleet).