@artinet/cruiser 0.1.1 → 0.1.3
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 +32 -32
- package/dist/claude/index.d.ts +24 -16
- package/dist/claude/index.js +18 -14
- package/dist/corsair.d.ts +52 -10
- package/dist/corsair.js +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/langchain/index.d.ts +16 -12
- package/dist/langchain/index.js +18 -13
- package/dist/langchain/utils.js +1 -1
- package/dist/mastra/index.d.ts +16 -12
- package/dist/mastra/index.js +16 -12
- package/dist/openai/index.d.ts +23 -15
- package/dist/openai/index.js +17 -13
- package/dist/strands/index.d.ts +16 -12
- package/dist/strands/index.js +16 -12
- package/dist/volt/index.d.ts +1 -1
- package/dist/volt/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -12,26 +12,24 @@
|
|
|
12
12
|
Universal adapters for multi-agent interoperability.
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
|
-
> ⚠️ **Experimental**: This library is under active development. APIs may change between versions.
|
|
16
|
-
|
|
17
15
|
## Overview
|
|
18
16
|
|
|
19
|
-
**Cruiser** provides "
|
|
17
|
+
**Cruiser** provides "dock" adapters that bridge popular AI agent frameworks to enable multi-agent communication through the [`@artinet/sdk`](https://www.npmjs.com/package/@artinet/sdk).
|
|
20
18
|
|
|
21
19
|
### Supported Frameworks
|
|
22
20
|
|
|
23
|
-
| Framework | Import Path | Status
|
|
24
|
-
| -------------------- | ---------------------------- |
|
|
25
|
-
| **OpenAI Agents** | `@artinet/cruiser/openai` | ✅
|
|
26
|
-
| **Mastra** | `@artinet/cruiser/mastra` | ✅
|
|
27
|
-
| **Claude Agent SDK** | `@artinet/cruiser/claude` | ✅
|
|
28
|
-
| **LangChain** | `@artinet/cruiser/langchain` | ✅
|
|
29
|
-
| **Strands (AWS)** | `@artinet/cruiser/strands` | ✅
|
|
21
|
+
| Framework | Import Path | Status |
|
|
22
|
+
| -------------------- | ---------------------------- | ------- |
|
|
23
|
+
| **OpenAI Agents** | `@artinet/cruiser/openai` | Text ✅ |
|
|
24
|
+
| **Mastra** | `@artinet/cruiser/mastra` | Text ✅ |
|
|
25
|
+
| **Claude Agent SDK** | `@artinet/cruiser/claude` | Text ✅ |
|
|
26
|
+
| **LangChain** | `@artinet/cruiser/langchain` | Text ✅ |
|
|
27
|
+
| **Strands (AWS)** | `@artinet/cruiser/strands` | Text ✅ |
|
|
30
28
|
|
|
31
29
|
## Installation
|
|
32
30
|
|
|
33
31
|
```bash
|
|
34
|
-
npm install @artinet/cruiser @artinet/sdk
|
|
32
|
+
npm install @artinet/cruiser @artinet/sdk @modelcontextprotocol/sdk @a2a-js/sdk
|
|
35
33
|
```
|
|
36
34
|
|
|
37
35
|
Install your preferred agent framework:
|
|
@@ -57,11 +55,11 @@ npm install @strands-agents/sdk
|
|
|
57
55
|
|
|
58
56
|
### Single Agent
|
|
59
57
|
|
|
60
|
-
Create an agent from any of the supported frameworks and
|
|
58
|
+
Create an agent from any of the supported frameworks and dock it onto artinet:
|
|
61
59
|
|
|
62
60
|
```typescript
|
|
63
61
|
import { Agent } from "@openai/agents";
|
|
64
|
-
import {
|
|
62
|
+
import { dock } from "@artinet/cruiser/openai";
|
|
65
63
|
import { serve } from "@artinet/sdk";
|
|
66
64
|
|
|
67
65
|
// 1. Create your agent
|
|
@@ -70,32 +68,34 @@ const agent = new Agent({
|
|
|
70
68
|
instructions: "You are a helpful assistant",
|
|
71
69
|
});
|
|
72
70
|
|
|
73
|
-
// 2.
|
|
74
|
-
const artinetAgent = await
|
|
71
|
+
// 2. Dock it onto artinet
|
|
72
|
+
const artinetAgent = await dock(agent, { name: "My Assistant" });
|
|
75
73
|
|
|
76
74
|
// 3. Spin it up as an A2A compatible Server
|
|
77
75
|
serve({ agent: artinetAgent, port: 3000 });
|
|
78
76
|
```
|
|
79
77
|
|
|
80
|
-
### Multi-Agent
|
|
78
|
+
### Multi-Agent Systems
|
|
79
|
+
|
|
80
|
+
> _Experimental_
|
|
81
81
|
|
|
82
82
|
Create interoperable multi-agent systems:
|
|
83
83
|
|
|
84
84
|
```typescript
|
|
85
85
|
import { serve, cr8 } from "@artinet/sdk";
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
86
|
+
import { dock as dockMastra } from "@artinet/cruiser/mastra";
|
|
87
|
+
import { dock as dockOpenAI } from "@artinet/cruiser/openai";
|
|
88
88
|
import { Agent as MastraAgent } from "@mastra/core/agent";
|
|
89
89
|
import { Agent as OpenAIAgent } from "@openai/agents";
|
|
90
90
|
import { MastraModel } from "./mastra-model";
|
|
91
91
|
|
|
92
92
|
// Use agents from different frameworks
|
|
93
|
-
const researcher = await
|
|
93
|
+
const researcher = await dockOpenAI(
|
|
94
94
|
new OpenAIAgent({ name: "researcher", instructions: "Research topics" }),
|
|
95
95
|
{ name: "Researcher" }
|
|
96
96
|
);
|
|
97
97
|
|
|
98
|
-
const writer = await
|
|
98
|
+
const writer = await dockMastra(
|
|
99
99
|
new MastraAgent({ name: "writer", instructions: "Write content", model }),
|
|
100
100
|
{ name: "Writer" }
|
|
101
101
|
);
|
|
@@ -103,12 +103,12 @@ const writer = await parkMastra(
|
|
|
103
103
|
// Chain them together
|
|
104
104
|
const agent = cr8("Orchestrator Agent")
|
|
105
105
|
// The researcher will receive the incoming user message
|
|
106
|
-
.sendMessage(researcher)
|
|
106
|
+
.sendMessage({ agent: researcher })
|
|
107
107
|
// The results are passed to the writer with additional instructions
|
|
108
|
-
.sendMessage(
|
|
109
|
-
writer,
|
|
110
|
-
"use the research results to create a publishable article"
|
|
111
|
-
).agent;
|
|
108
|
+
.sendMessage({
|
|
109
|
+
agent: writer,
|
|
110
|
+
message: "use the research results to create a publishable article",
|
|
111
|
+
}).agent;
|
|
112
112
|
|
|
113
113
|
console.log(await agent.sendMessage("I want to learn about the Roman Empire."));
|
|
114
114
|
```
|
|
@@ -117,13 +117,13 @@ console.log(await agent.sendMessage("I want to learn about the Roman Empire."));
|
|
|
117
117
|
|
|
118
118
|
## API Reference
|
|
119
119
|
|
|
120
|
-
### `
|
|
120
|
+
### `dock(agent, card?, options?)`
|
|
121
121
|
|
|
122
|
-
Each adapter exports a `
|
|
122
|
+
Each adapter exports a `dock` function with the same signature:
|
|
123
123
|
|
|
124
124
|
| Parameter | Type | Description |
|
|
125
125
|
| --------- | ------------------ | -------------------------- |
|
|
126
|
-
| `agent` | Framework-specific | The agent instance to
|
|
126
|
+
| `agent` | Framework-specific | The agent instance to dock |
|
|
127
127
|
| `card` | `AgentCardParams` | Optional identity details |
|
|
128
128
|
| `options` | Framework-specific | Optional execution options |
|
|
129
129
|
|
|
@@ -132,9 +132,9 @@ Each adapter exports a `park` function with the same signature:
|
|
|
132
132
|
### Describe your agent
|
|
133
133
|
|
|
134
134
|
```typescript
|
|
135
|
-
import {
|
|
135
|
+
import { dock } from "@artinet/cruiser/openai";
|
|
136
136
|
|
|
137
|
-
const artinetAgent = await
|
|
137
|
+
const artinetAgent = await dock(
|
|
138
138
|
myAgent,
|
|
139
139
|
{
|
|
140
140
|
name: "Production Assistant",
|
|
@@ -164,7 +164,7 @@ const artinetAgent = await park(
|
|
|
164
164
|
│ @artinet/cruiser │
|
|
165
165
|
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌────────┐ │
|
|
166
166
|
│ │ OpenAI │ │ Mastra │ │ Claude │ │LangChain│ │ Strands│ │
|
|
167
|
-
│ │
|
|
167
|
+
│ │ dock │ │ dock │ │ dock │ │ dock │ │ dock │ │
|
|
168
168
|
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ └───┬────┘ │
|
|
169
169
|
│ │ │ │ │ │ │
|
|
170
170
|
│ └───────────┴───────────┴───────────┴──────────┘ │
|
|
@@ -197,7 +197,7 @@ npm test
|
|
|
197
197
|
|
|
198
198
|
## Contributing
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
Additional dock functions are welcome! Please open an issue or submit a Pull Request on [GitHub](https://github.com/the-artinet-project/artinet).
|
|
201
201
|
|
|
202
202
|
Ensure code adheres to the project style and passes linting (`npm run lint`) and tests (`npm test`).
|
|
203
203
|
|
package/dist/claude/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module @artinet/cruiser/claude
|
|
5
5
|
* @description
|
|
6
|
-
* This adapter "
|
|
6
|
+
* This adapter "docks" {@link ClaudeAgent | Claude agents} (from `@anthropic-ai/claude-agent-sdk`) onto
|
|
7
7
|
* artinet, enabling them to participate in multi-agent workflows.
|
|
8
8
|
*
|
|
9
9
|
* 1. **Execution Model**: claude agents use the `query({ prompt })` function for execution.
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
* 4. **Simple Interface**: claude agents have a straightforward API, making this
|
|
19
19
|
* adapter relatively simple compared to other frameworks.
|
|
20
20
|
*
|
|
21
|
-
* 5. **Options Passthrough**: Unlike other
|
|
22
|
-
* to ensure that we have access to required parameters that are needed to scaffold the {@link
|
|
21
|
+
* 5. **Options Passthrough**: Unlike other docks we need to build the query request manually,
|
|
22
|
+
* to ensure that we have access to required parameters that are needed to scaffold the {@link dock}.
|
|
23
23
|
* The {@link Options} object is passed through to the claude agent SDK during execution.
|
|
24
24
|
*
|
|
25
25
|
* ## Usage
|
|
26
26
|
*
|
|
27
27
|
* ```typescript
|
|
28
28
|
* import { Options } from "@anthropic-ai/claude-agent-sdk";
|
|
29
|
-
* import {
|
|
29
|
+
* import { dock } from "@artinet/cruiser/claude";
|
|
30
30
|
* import { serve } from "@artinet/sdk";
|
|
31
31
|
*
|
|
32
32
|
* const claudeConfig: Options = {
|
|
@@ -34,27 +34,31 @@
|
|
|
34
34
|
maxTurns: 1,
|
|
35
35
|
* };
|
|
36
36
|
*
|
|
37
|
-
* const artinetAgent = await
|
|
37
|
+
* const artinetAgent = await dock(claudeConfig, { name: "Claude Coder" });
|
|
38
38
|
* serve({ agent: artinetAgent, port: 3000 });
|
|
39
39
|
* ```
|
|
40
40
|
*
|
|
41
41
|
* @see {@link https://docs.anthropic.com/en/docs/claude-agent-sdk} Claude Agent SDK Docs
|
|
42
42
|
*/
|
|
43
|
-
import { Park } from "../corsair.js";
|
|
43
|
+
import { Dock, Park } from "../corsair.js";
|
|
44
44
|
import type { Options } from "@anthropic-ai/claude-agent-sdk";
|
|
45
45
|
import { type ClaudeAgent } from "./utils.js";
|
|
46
46
|
/**
|
|
47
47
|
* Configuration options passed to the Claude Agent SDK during execution.
|
|
48
48
|
* @see {@link Options} from `@anthropic-ai/claude-agent-sdk`
|
|
49
49
|
*/
|
|
50
|
-
export type
|
|
50
|
+
export type DockOptions = Options;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* @deprecated Use {@link DockOptions} instead.
|
|
53
|
+
*/
|
|
54
|
+
export type ParkOptions = DockOptions;
|
|
55
|
+
/**
|
|
56
|
+
* Docks a Claude Agent onto artinet.
|
|
53
57
|
*
|
|
54
58
|
* Transforms a {@link ClaudeAgent} instance into an {@link sdk.Agent | artinet-compatible agent}
|
|
55
59
|
* that can be deployed on artinet and communicate with other artinet agents.
|
|
56
60
|
*
|
|
57
|
-
* @param agent - The {@link ClaudeAgent} configuration (Options) to
|
|
61
|
+
* @param agent - The {@link ClaudeAgent} configuration (Options) to dock
|
|
58
62
|
* @param card - Optional {@link sdk.A2A.AgentCardParams} configuration to customize identity and capabilities
|
|
59
63
|
* @param _options - Reserved for future use (currently unused)
|
|
60
64
|
*
|
|
@@ -62,9 +66,9 @@ export type ParkOptions = Options;
|
|
|
62
66
|
*
|
|
63
67
|
* @example Basic Usage
|
|
64
68
|
* ```typescript
|
|
65
|
-
* import {
|
|
69
|
+
* import { dock } from "@artinet/cruiser/claude";
|
|
66
70
|
*
|
|
67
|
-
* const a2agent = await
|
|
71
|
+
* const a2agent = await dock(
|
|
68
72
|
* { model: "claude-sonnet-4-20250514", maxTurns: 1 },
|
|
69
73
|
* { name: "My Claude Agent" }
|
|
70
74
|
* );
|
|
@@ -72,9 +76,9 @@ export type ParkOptions = Options;
|
|
|
72
76
|
*
|
|
73
77
|
* @example With Custom System Prompt
|
|
74
78
|
* ```typescript
|
|
75
|
-
* import {
|
|
79
|
+
* import { dock } from "@artinet/cruiser/claude";
|
|
76
80
|
*
|
|
77
|
-
* const a2agent = await
|
|
81
|
+
* const a2agent = await dock(
|
|
78
82
|
* {
|
|
79
83
|
* cwd: "./my-project",
|
|
80
84
|
* model: "claude-sonnet-4-20250514",
|
|
@@ -89,9 +93,9 @@ export type ParkOptions = Options;
|
|
|
89
93
|
*
|
|
90
94
|
* @example With Working Directory for Code Tasks
|
|
91
95
|
* ```typescript
|
|
92
|
-
* import {
|
|
96
|
+
* import { dock } from "@artinet/cruiser/claude";
|
|
93
97
|
*
|
|
94
|
-
* const a2agent = await
|
|
98
|
+
* const a2agent = await dock(
|
|
95
99
|
* {
|
|
96
100
|
* cwd: "./my-project",
|
|
97
101
|
* model: "claude-sonnet-4-20250514",
|
|
@@ -101,5 +105,9 @@ export type ParkOptions = Options;
|
|
|
101
105
|
* );
|
|
102
106
|
* ```
|
|
103
107
|
*/
|
|
104
|
-
export declare const
|
|
108
|
+
export declare const dock: Dock<ClaudeAgent, never>;
|
|
105
109
|
export type { ClaudeAgent } from "./utils.js";
|
|
110
|
+
/**
|
|
111
|
+
* @deprecated Use {@link dock} instead.
|
|
112
|
+
*/
|
|
113
|
+
export declare const park: Park<ClaudeAgent, never>;
|
package/dist/claude/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module @artinet/cruiser/claude
|
|
5
5
|
* @description
|
|
6
|
-
* This adapter "
|
|
6
|
+
* This adapter "docks" {@link ClaudeAgent | Claude agents} (from `@anthropic-ai/claude-agent-sdk`) onto
|
|
7
7
|
* artinet, enabling them to participate in multi-agent workflows.
|
|
8
8
|
*
|
|
9
9
|
* 1. **Execution Model**: claude agents use the `query({ prompt })` function for execution.
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
* 4. **Simple Interface**: claude agents have a straightforward API, making this
|
|
19
19
|
* adapter relatively simple compared to other frameworks.
|
|
20
20
|
*
|
|
21
|
-
* 5. **Options Passthrough**: Unlike other
|
|
22
|
-
* to ensure that we have access to required parameters that are needed to scaffold the {@link
|
|
21
|
+
* 5. **Options Passthrough**: Unlike other docks we need to build the query request manually,
|
|
22
|
+
* to ensure that we have access to required parameters that are needed to scaffold the {@link dock}.
|
|
23
23
|
* The {@link Options} object is passed through to the claude agent SDK during execution.
|
|
24
24
|
*
|
|
25
25
|
* ## Usage
|
|
26
26
|
*
|
|
27
27
|
* ```typescript
|
|
28
28
|
* import { Options } from "@anthropic-ai/claude-agent-sdk";
|
|
29
|
-
* import {
|
|
29
|
+
* import { dock } from "@artinet/cruiser/claude";
|
|
30
30
|
* import { serve } from "@artinet/sdk";
|
|
31
31
|
*
|
|
32
32
|
* const claudeConfig: Options = {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
maxTurns: 1,
|
|
35
35
|
* };
|
|
36
36
|
*
|
|
37
|
-
* const artinetAgent = await
|
|
37
|
+
* const artinetAgent = await dock(claudeConfig, { name: "Claude Coder" });
|
|
38
38
|
* serve({ agent: artinetAgent, port: 3000 });
|
|
39
39
|
* ```
|
|
40
40
|
*
|
|
@@ -44,12 +44,12 @@ import * as sdk from "@artinet/sdk";
|
|
|
44
44
|
import * as claude from "@anthropic-ai/claude-agent-sdk";
|
|
45
45
|
import { getAgentCard, extractA2AMessage } from "./utils.js";
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
47
|
+
* Docks a Claude Agent onto artinet.
|
|
48
48
|
*
|
|
49
49
|
* Transforms a {@link ClaudeAgent} instance into an {@link sdk.Agent | artinet-compatible agent}
|
|
50
50
|
* that can be deployed on artinet and communicate with other artinet agents.
|
|
51
51
|
*
|
|
52
|
-
* @param agent - The {@link ClaudeAgent} configuration (Options) to
|
|
52
|
+
* @param agent - The {@link ClaudeAgent} configuration (Options) to dock
|
|
53
53
|
* @param card - Optional {@link sdk.A2A.AgentCardParams} configuration to customize identity and capabilities
|
|
54
54
|
* @param _options - Reserved for future use (currently unused)
|
|
55
55
|
*
|
|
@@ -57,9 +57,9 @@ import { getAgentCard, extractA2AMessage } from "./utils.js";
|
|
|
57
57
|
*
|
|
58
58
|
* @example Basic Usage
|
|
59
59
|
* ```typescript
|
|
60
|
-
* import {
|
|
60
|
+
* import { dock } from "@artinet/cruiser/claude";
|
|
61
61
|
*
|
|
62
|
-
* const a2agent = await
|
|
62
|
+
* const a2agent = await dock(
|
|
63
63
|
* { model: "claude-sonnet-4-20250514", maxTurns: 1 },
|
|
64
64
|
* { name: "My Claude Agent" }
|
|
65
65
|
* );
|
|
@@ -67,9 +67,9 @@ import { getAgentCard, extractA2AMessage } from "./utils.js";
|
|
|
67
67
|
*
|
|
68
68
|
* @example With Custom System Prompt
|
|
69
69
|
* ```typescript
|
|
70
|
-
* import {
|
|
70
|
+
* import { dock } from "@artinet/cruiser/claude";
|
|
71
71
|
*
|
|
72
|
-
* const a2agent = await
|
|
72
|
+
* const a2agent = await dock(
|
|
73
73
|
* {
|
|
74
74
|
* cwd: "./my-project",
|
|
75
75
|
* model: "claude-sonnet-4-20250514",
|
|
@@ -84,9 +84,9 @@ import { getAgentCard, extractA2AMessage } from "./utils.js";
|
|
|
84
84
|
*
|
|
85
85
|
* @example With Working Directory for Code Tasks
|
|
86
86
|
* ```typescript
|
|
87
|
-
* import {
|
|
87
|
+
* import { dock } from "@artinet/cruiser/claude";
|
|
88
88
|
*
|
|
89
|
-
* const a2agent = await
|
|
89
|
+
* const a2agent = await dock(
|
|
90
90
|
* {
|
|
91
91
|
* cwd: "./my-project",
|
|
92
92
|
* model: "claude-sonnet-4-20250514",
|
|
@@ -96,7 +96,7 @@ import { getAgentCard, extractA2AMessage } from "./utils.js";
|
|
|
96
96
|
* );
|
|
97
97
|
* ```
|
|
98
98
|
*/
|
|
99
|
-
export const
|
|
99
|
+
export const dock = async (agent, card, _options) => {
|
|
100
100
|
const agentCard = await getAgentCard({ agent, card });
|
|
101
101
|
sdk.logger.debug(`Claude[${agentCard.name}]:[card:${JSON.stringify(agentCard)}]`);
|
|
102
102
|
return sdk.cr8(agentCard).from(async function* (context) {
|
|
@@ -179,3 +179,7 @@ export const park = async (agent, card, _options) => {
|
|
|
179
179
|
return;
|
|
180
180
|
});
|
|
181
181
|
};
|
|
182
|
+
/**
|
|
183
|
+
* @deprecated Use {@link dock} instead.
|
|
184
|
+
*/
|
|
185
|
+
export const park = dock;
|
package/dist/corsair.d.ts
CHANGED
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module @artinet/cruiser/corsair
|
|
5
5
|
* @description
|
|
6
|
-
* Defines the universal {@link
|
|
7
|
-
* The "
|
|
6
|
+
* Defines the universal {@link Dock} interface that all framework adapters must implement.
|
|
7
|
+
* The "dock" metaphor represents the process of connecting (docking) an agent from
|
|
8
8
|
* any framework onto artinet.
|
|
9
9
|
*
|
|
10
10
|
* ## Naming Convention
|
|
11
11
|
*
|
|
12
|
-
* - **
|
|
12
|
+
* - **Dock**: The adapter function that transforms a framework-specific agent
|
|
13
13
|
* into an {@link sdk.Agent | artinet-compatible agent}
|
|
14
14
|
* - **Corsair**: The module containing the core type definitions (cruiser's helm)
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```typescript
|
|
18
|
-
* import type {
|
|
18
|
+
* import type { Dock } from "@artinet/cruiser";
|
|
19
19
|
*
|
|
20
20
|
* // All adapters follow this signature
|
|
21
|
-
* const
|
|
21
|
+
* const dock: Dock<MyAgentType, MyOptionsType> = async (agent, card, options) => {
|
|
22
22
|
* // Transform agent into A2A format
|
|
23
23
|
* return artinetAgent;
|
|
24
24
|
* };
|
|
@@ -26,16 +26,58 @@
|
|
|
26
26
|
*/
|
|
27
27
|
import type * as sdk from "@artinet/sdk";
|
|
28
28
|
/**
|
|
29
|
-
* Universal
|
|
29
|
+
* Universal dock function signature for framework adapters.
|
|
30
30
|
*
|
|
31
31
|
* All Cruiser adapters implement this interface to ensure consistent behavior
|
|
32
|
-
* across different agent frameworks. The
|
|
32
|
+
* across different agent frameworks. The dock function transforms a framework-
|
|
33
33
|
* specific agent into an {@link sdk.Agent | A2A-compatible agent} that can be deployed on Artinet.
|
|
34
34
|
*
|
|
35
35
|
* @typeParam TAgent - The framework-specific agent type (e.g., {@link OpenAIAgent}, {@link MastraAgent})
|
|
36
36
|
* @typeParam TOptions - Optional configuration type for the adapter (defaults to unknown)
|
|
37
37
|
*
|
|
38
|
-
* @param agent - The framework-specific agent instance to
|
|
38
|
+
* @param agent - The framework-specific agent instance to dock
|
|
39
|
+
* @param card - Optional {@link sdk.A2A.AgentCardParams} configuration to customize the agent's identity,
|
|
40
|
+
* capabilities, and skills in the A2A network
|
|
41
|
+
* @param options - Framework-specific execution options passed through to the underlying SDK
|
|
42
|
+
*
|
|
43
|
+
* @returns A Promise resolving to an {@link sdk.Agent} ready for deployment
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* import { dock } from "@artinet/cruiser/openai";
|
|
48
|
+
* import { Agent } from "@openai/agents";
|
|
49
|
+
*
|
|
50
|
+
* // Create your framework-specific agent
|
|
51
|
+
* const openaiAgent = new Agent({
|
|
52
|
+
* name: "assistant",
|
|
53
|
+
* instructions: "You are a helpful assistant",
|
|
54
|
+
* });
|
|
55
|
+
*
|
|
56
|
+
* // Dock it into the Artinet ecosystem
|
|
57
|
+
* const artinetAgent = await dock(openaiAgent, {
|
|
58
|
+
* name: "My Assistant",
|
|
59
|
+
* description: "A helpful AI assistant for general queries",
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* // Now deploy using @artinet/sdk
|
|
63
|
+
* import { serve } from "@artinet/sdk";
|
|
64
|
+
* serve({ agent: artinetAgent, port: 3000 });
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @see {@link https://github.com/google-a2a/A2A} A2A Protocol Specification
|
|
68
|
+
*/
|
|
69
|
+
export type Dock<TAgent, TOptions = unknown> = (agent: TAgent, card?: sdk.A2A.AgentCardParams, options?: TOptions) => Promise<sdk.Agent>;
|
|
70
|
+
/**
|
|
71
|
+
* Universal dock function signature for framework adapters.
|
|
72
|
+
*
|
|
73
|
+
* All Cruiser adapters implement this interface to ensure consistent behavior
|
|
74
|
+
* across different agent frameworks. The dock function transforms a framework-
|
|
75
|
+
* specific agent into an {@link sdk.Agent | A2A-compatible agent} that can be deployed on Artinet.
|
|
76
|
+
*
|
|
77
|
+
* @typeParam TAgent - The framework-specific agent type (e.g., {@link OpenAIAgent}, {@link MastraAgent})
|
|
78
|
+
* @typeParam TOptions - Optional configuration type for the adapter (defaults to unknown)
|
|
79
|
+
*
|
|
80
|
+
* @param agent - The framework-specific agent instance to dock
|
|
39
81
|
* @param card - Optional {@link sdk.A2A.AgentCardParams} configuration to customize the agent's identity,
|
|
40
82
|
* capabilities, and skills in the A2A network
|
|
41
83
|
* @param options - Framework-specific execution options passed through to the underlying SDK
|
|
@@ -53,7 +95,7 @@ import type * as sdk from "@artinet/sdk";
|
|
|
53
95
|
* instructions: "You are a helpful assistant",
|
|
54
96
|
* });
|
|
55
97
|
*
|
|
56
|
-
* //
|
|
98
|
+
* // Dock it into the Artinet ecosystem
|
|
57
99
|
* const artinetAgent = await park(openaiAgent, {
|
|
58
100
|
* name: "My Assistant",
|
|
59
101
|
* description: "A helpful AI assistant for general queries",
|
|
@@ -66,4 +108,4 @@ import type * as sdk from "@artinet/sdk";
|
|
|
66
108
|
*
|
|
67
109
|
* @see {@link https://github.com/google-a2a/A2A} A2A Protocol Specification
|
|
68
110
|
*/
|
|
69
|
-
export type Park<TAgent, TOptions = unknown> =
|
|
111
|
+
export type Park<TAgent, TOptions = unknown> = Dock<TAgent, TOptions>;
|
package/dist/corsair.js
CHANGED
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module @artinet/cruiser/corsair
|
|
5
5
|
* @description
|
|
6
|
-
* Defines the universal {@link
|
|
7
|
-
* The "
|
|
6
|
+
* Defines the universal {@link Dock} interface that all framework adapters must implement.
|
|
7
|
+
* The "dock" metaphor represents the process of connecting (docking) an agent from
|
|
8
8
|
* any framework onto artinet.
|
|
9
9
|
*
|
|
10
10
|
* ## Naming Convention
|
|
11
11
|
*
|
|
12
|
-
* - **
|
|
12
|
+
* - **Dock**: The adapter function that transforms a framework-specific agent
|
|
13
13
|
* into an {@link sdk.Agent | artinet-compatible agent}
|
|
14
14
|
* - **Corsair**: The module containing the core type definitions (cruiser's helm)
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```typescript
|
|
18
|
-
* import type {
|
|
18
|
+
* import type { Dock } from "@artinet/cruiser";
|
|
19
19
|
*
|
|
20
20
|
* // All adapters follow this signature
|
|
21
|
-
* const
|
|
21
|
+
* const dock: Dock<MyAgentType, MyOptionsType> = async (agent, card, options) => {
|
|
22
22
|
* // Transform agent into A2A format
|
|
23
23
|
* return artinetAgent;
|
|
24
24
|
* };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @license Apache-2.0
|
|
7
7
|
*
|
|
8
8
|
* @description
|
|
9
|
-
* Cruiser provides universal adapters ("
|
|
9
|
+
* Cruiser provides universal adapters ("docks") that bridge popular AI agent
|
|
10
10
|
* frameworks to the Agent2Agent (A2A) protocol, enabling multi-agent
|
|
11
11
|
* interoperability through the {@link @artinet/sdk | Artinet SDK}.
|
|
12
12
|
*
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
* ## Quick Start
|
|
24
24
|
*
|
|
25
25
|
* ```typescript
|
|
26
|
-
* import {
|
|
26
|
+
* import { dock } from "@artinet/cruiser/openai";
|
|
27
27
|
* import { Agent } from "@openai/agents";
|
|
28
28
|
* import { serve } from "@artinet/sdk";
|
|
29
29
|
*
|
|
30
30
|
* const myAgent = new Agent({ name: "helper", instructions: "Be helpful" });
|
|
31
|
-
* const artinetAgent = await
|
|
31
|
+
* const artinetAgent = await dock(myAgent, { name: "My Helper" });
|
|
32
32
|
*
|
|
33
33
|
* serve({ agent: artinetAgent, port: 3000 });
|
|
34
34
|
* ```
|
|
35
35
|
*
|
|
36
36
|
* ## Architecture
|
|
37
37
|
*
|
|
38
|
-
* Each adapter implements the {@link
|
|
38
|
+
* Each adapter implements the {@link Dock} interface from `./corsair.ts`:
|
|
39
39
|
* - Converts framework-specific agent to {@link sdk.Agent | A2A-compliant agent}
|
|
40
40
|
* - Maps agent tools/capabilities to {@link sdk.A2A.AgentSkill | A2A skills}
|
|
41
41
|
* - Handles message format conversion between protocols
|
|
@@ -45,4 +45,4 @@
|
|
|
45
45
|
*
|
|
46
46
|
* @experimental This library is under active development. APIs may change.
|
|
47
47
|
*/
|
|
48
|
-
export type {
|
|
48
|
+
export type { Dock, Park } from "./corsair.js";
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @license Apache-2.0
|
|
7
7
|
*
|
|
8
8
|
* @description
|
|
9
|
-
* Cruiser provides universal adapters ("
|
|
9
|
+
* Cruiser provides universal adapters ("docks") that bridge popular AI agent
|
|
10
10
|
* frameworks to the Agent2Agent (A2A) protocol, enabling multi-agent
|
|
11
11
|
* interoperability through the {@link @artinet/sdk | Artinet SDK}.
|
|
12
12
|
*
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
* ## Quick Start
|
|
24
24
|
*
|
|
25
25
|
* ```typescript
|
|
26
|
-
* import {
|
|
26
|
+
* import { dock } from "@artinet/cruiser/openai";
|
|
27
27
|
* import { Agent } from "@openai/agents";
|
|
28
28
|
* import { serve } from "@artinet/sdk";
|
|
29
29
|
*
|
|
30
30
|
* const myAgent = new Agent({ name: "helper", instructions: "Be helpful" });
|
|
31
|
-
* const artinetAgent = await
|
|
31
|
+
* const artinetAgent = await dock(myAgent, { name: "My Helper" });
|
|
32
32
|
*
|
|
33
33
|
* serve({ agent: artinetAgent, port: 3000 });
|
|
34
34
|
* ```
|
|
35
35
|
*
|
|
36
36
|
* ## Architecture
|
|
37
37
|
*
|
|
38
|
-
* Each adapter implements the {@link
|
|
38
|
+
* Each adapter implements the {@link Dock} interface from `./corsair.ts`:
|
|
39
39
|
* - Converts framework-specific agent to {@link sdk.Agent | A2A-compliant agent}
|
|
40
40
|
* - Maps agent tools/capabilities to {@link sdk.A2A.AgentSkill | A2A skills}
|
|
41
41
|
* - Handles message format conversion between protocols
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module @artinet/cruiser/langchain
|
|
5
5
|
* @description
|
|
6
|
-
* This adapter "
|
|
6
|
+
* This adapter "docks" LangChain agents ({@link ReactAgent} and compatible types) onto
|
|
7
7
|
* artinet, enabling them to participate in multi-agent workflows.
|
|
8
8
|
*
|
|
9
9
|
* ## Design Decisions
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*
|
|
25
25
|
* ```typescript
|
|
26
26
|
* import { createAgent } from "langchain";
|
|
27
|
-
* import {
|
|
27
|
+
* import { dock } from "@artinet/cruiser/langchain";
|
|
28
28
|
* import { serve } from "@artinet/sdk";
|
|
29
29
|
*
|
|
30
30
|
* const langchainAgent = await createAgent({
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* tools: [searchTool, calculatorTool],
|
|
33
33
|
* });
|
|
34
34
|
*
|
|
35
|
-
* const artinetAgent = await
|
|
35
|
+
* const artinetAgent = await dock(langchainAgent, { name: "Research Assistant" });
|
|
36
36
|
* serve({ agent: artinetAgent, port: 3000 });
|
|
37
37
|
* ```
|
|
38
38
|
*
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
*/
|
|
41
41
|
import { ReactAgent } from "langchain";
|
|
42
42
|
import { RunnableConfig } from "@langchain/core/runnables";
|
|
43
|
-
import { Park } from "../corsair.js";
|
|
43
|
+
import { Dock, Park } from "../corsair.js";
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Docks a LangChain agent onto artinet.
|
|
46
46
|
*
|
|
47
47
|
* Transforms a {@link ReactAgent} (or compatible agent type) into an
|
|
48
48
|
* {@link sdk.Agent | artinet-compatible agent} that can be deployed on artinet.
|
|
49
49
|
*
|
|
50
|
-
* @param agent - The {@link ReactAgent} to
|
|
50
|
+
* @param agent - The {@link ReactAgent} to dock
|
|
51
51
|
* @param card - Optional {@link sdk.A2A.AgentCardParams} configuration to customize identity and capabilities
|
|
52
52
|
* @param options - Optional {@link RunnableConfig} for execution options
|
|
53
53
|
*
|
|
@@ -55,18 +55,18 @@ import { Park } from "../corsair.js";
|
|
|
55
55
|
*
|
|
56
56
|
* @example Basic Usage
|
|
57
57
|
* ```typescript
|
|
58
|
-
* import {
|
|
58
|
+
* import { dock } from "@artinet/cruiser/langchain";
|
|
59
59
|
* import { createAgent } from "langchain";
|
|
60
60
|
*
|
|
61
61
|
* const agent = await createAgent({ model, tools });
|
|
62
|
-
* const artinetAgent = await
|
|
62
|
+
* const artinetAgent = await dock(agent, { name: "My Agent" });
|
|
63
63
|
* ```
|
|
64
64
|
*
|
|
65
65
|
* @example With Runnable Configuration
|
|
66
66
|
* ```typescript
|
|
67
|
-
* import {
|
|
67
|
+
* import { dock } from "@artinet/cruiser/langchain";
|
|
68
68
|
*
|
|
69
|
-
* const artinetAgent = await
|
|
69
|
+
* const artinetAgent = await dock(
|
|
70
70
|
* myAgent,
|
|
71
71
|
* { name: "Configured Agent" },
|
|
72
72
|
* {
|
|
@@ -79,9 +79,9 @@ import { Park } from "../corsair.js";
|
|
|
79
79
|
*
|
|
80
80
|
* @example With Custom Agent Card
|
|
81
81
|
* ```typescript
|
|
82
|
-
* import {
|
|
82
|
+
* import { dock } from "@artinet/cruiser/langchain";
|
|
83
83
|
*
|
|
84
|
-
* const artinetAgent = await
|
|
84
|
+
* const artinetAgent = await dock(myAgent, {
|
|
85
85
|
* name: "Research Bot",
|
|
86
86
|
* description: "AI-powered research assistant",
|
|
87
87
|
* skills: [
|
|
@@ -91,4 +91,8 @@ import { Park } from "../corsair.js";
|
|
|
91
91
|
* });
|
|
92
92
|
* ```
|
|
93
93
|
*/
|
|
94
|
+
export declare const dock: Dock<ReactAgent, RunnableConfig>;
|
|
95
|
+
/**
|
|
96
|
+
* @deprecated Use {@link dock} instead.
|
|
97
|
+
*/
|
|
94
98
|
export declare const park: Park<ReactAgent, RunnableConfig>;
|