@artinet/cruiser 0.1.6 → 0.1.7
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/README.md +49 -45
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,6 +25,7 @@ Universal adapters for multi-agent interoperability.
|
|
|
25
25
|
| **Claude Agent SDK** | `@artinet/cruiser/claude` | Text ✅ |
|
|
26
26
|
| **LangChain** | `@artinet/cruiser/langchain` | Text ✅ |
|
|
27
27
|
| **Strands (AWS)** | `@artinet/cruiser/strands` | Text ✅ |
|
|
28
|
+
| **OpenClaw** | `@artinet/cruiser/openclaw` | Text ✅ |
|
|
28
29
|
|
|
29
30
|
## Installation
|
|
30
31
|
|
|
@@ -49,6 +50,11 @@ npm install langchain @langchain/core
|
|
|
49
50
|
|
|
50
51
|
# Strands (AWS)
|
|
51
52
|
npm install @strands-agents/sdk
|
|
53
|
+
|
|
54
|
+
# OpenClaw
|
|
55
|
+
# openclaw runs as a gateway service/CLI
|
|
56
|
+
# see: https://github.com/openclaw/openclaw
|
|
57
|
+
# Cruiser's OpenClaw dock uses the standard Gateway WebSocket protocol.
|
|
52
58
|
```
|
|
53
59
|
|
|
54
60
|
## Quick Start
|
|
@@ -58,18 +64,18 @@ npm install @strands-agents/sdk
|
|
|
58
64
|
Create an agent from any of the supported frameworks and dock it onto artinet:
|
|
59
65
|
|
|
60
66
|
```typescript
|
|
61
|
-
import { Agent } from
|
|
62
|
-
import { dock } from
|
|
63
|
-
import { serve } from
|
|
67
|
+
import { Agent } from '@openai/agents';
|
|
68
|
+
import { dock } from '@artinet/cruiser/openai';
|
|
69
|
+
import { serve } from '@artinet/sdk';
|
|
64
70
|
|
|
65
71
|
// 1. Create your agent
|
|
66
72
|
const agent = new Agent({
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
name: 'assistant',
|
|
74
|
+
instructions: 'You are a helpful assistant',
|
|
69
75
|
});
|
|
70
76
|
|
|
71
77
|
// 2. Dock it onto artinet
|
|
72
|
-
const artinetAgent = await dock(agent, { name:
|
|
78
|
+
const artinetAgent = await dock(agent, { name: 'My Assistant' });
|
|
73
79
|
|
|
74
80
|
// 3. Spin it up as an A2A compatible Server
|
|
75
81
|
serve({ agent: artinetAgent, port: 3000 });
|
|
@@ -82,35 +88,33 @@ serve({ agent: artinetAgent, port: 3000 });
|
|
|
82
88
|
Create interoperable multi-agent systems:
|
|
83
89
|
|
|
84
90
|
```typescript
|
|
85
|
-
import { serve, cr8 } from
|
|
86
|
-
import { dock as dockMastra } from
|
|
87
|
-
import { dock as dockOpenAI } from
|
|
88
|
-
import { Agent as MastraAgent } from
|
|
89
|
-
import { Agent as OpenAIAgent } from
|
|
90
|
-
import { MastraModel } from
|
|
91
|
+
import { serve, cr8 } from '@artinet/sdk';
|
|
92
|
+
import { dock as dockMastra } from '@artinet/cruiser/mastra';
|
|
93
|
+
import { dock as dockOpenAI } from '@artinet/cruiser/openai';
|
|
94
|
+
import { Agent as MastraAgent } from '@mastra/core/agent';
|
|
95
|
+
import { Agent as OpenAIAgent } from '@openai/agents';
|
|
96
|
+
import { MastraModel } from './mastra-model';
|
|
91
97
|
|
|
92
98
|
// Use agents from different frameworks
|
|
93
|
-
const researcher = await dockOpenAI(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
);
|
|
99
|
+
const researcher = await dockOpenAI(new OpenAIAgent({ name: 'researcher', instructions: 'Research topics' }), {
|
|
100
|
+
name: 'Researcher',
|
|
101
|
+
});
|
|
97
102
|
|
|
98
|
-
const writer = await dockMastra(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
);
|
|
103
|
+
const writer = await dockMastra(new MastraAgent({ name: 'writer', instructions: 'Write content', model }), {
|
|
104
|
+
name: 'Writer',
|
|
105
|
+
});
|
|
102
106
|
|
|
103
107
|
// Chain them together
|
|
104
|
-
const agent = cr8(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
console.log(await agent.sendMessage(
|
|
108
|
+
const agent = cr8('Orchestrator Agent')
|
|
109
|
+
// The researcher will receive the incoming user message
|
|
110
|
+
.sendMessage({ agent: researcher })
|
|
111
|
+
// The results are passed to the writer with additional instructions
|
|
112
|
+
.sendMessage({
|
|
113
|
+
agent: writer,
|
|
114
|
+
message: 'use the research results to create a publishable article',
|
|
115
|
+
}).agent;
|
|
116
|
+
|
|
117
|
+
console.log(await agent.sendMessage('I want to learn about the Roman Empire.'));
|
|
114
118
|
```
|
|
115
119
|
|
|
116
120
|
- For more information on how to chain agent requests see the [artinet-sdk](https://github.com/the-artinet-project/artinet-sdk/blob/main/docs/create.md#agent-orchestration)
|
|
@@ -132,23 +136,23 @@ Each adapter exports a `dock` function with the same signature:
|
|
|
132
136
|
### Describe your agent
|
|
133
137
|
|
|
134
138
|
```typescript
|
|
135
|
-
import { dock } from
|
|
139
|
+
import { dock } from '@artinet/cruiser/openai';
|
|
136
140
|
|
|
137
141
|
const artinetAgent = await dock(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
142
|
+
myAgent,
|
|
143
|
+
{
|
|
144
|
+
name: 'Production Assistant',
|
|
145
|
+
description: 'Enterprise-grade AI assistant',
|
|
146
|
+
skills: [
|
|
147
|
+
{ id: 'search', name: 'Web Search', description: 'Search the internet' },
|
|
148
|
+
{ id: 'code', name: 'Code Generation', description: 'Write code' },
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
// Most adapters allow for framework specific options to be passed
|
|
153
|
+
maxTurns: 10,
|
|
154
|
+
signal: abortController.signal,
|
|
155
|
+
},
|
|
152
156
|
);
|
|
153
157
|
```
|
|
154
158
|
|