@artinet/cruiser 0.1.1 → 0.1.2
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 +23 -25
- 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 +16 -12
- 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 +1 -1
package/README.md
CHANGED
|
@@ -12,21 +12,19 @@
|
|
|
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 ✅ Files ⚠️ Data ⚠️ |
|
|
24
|
+
| **Mastra** | `@artinet/cruiser/mastra` | Text ✅ Files ⚠️ Data ⚠️ |
|
|
25
|
+
| **Claude Agent SDK** | `@artinet/cruiser/claude` | Text ✅ Files ⚠️ Data ⚠️ |
|
|
26
|
+
| **LangChain** | `@artinet/cruiser/langchain` | Text ✅ Files ⚠️ Data ⚠️ |
|
|
27
|
+
| **Strands (AWS)** | `@artinet/cruiser/strands` | Text ✅ Files ⚠️ Data ⚠️ |
|
|
30
28
|
|
|
31
29
|
## Installation
|
|
32
30
|
|
|
@@ -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 on 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,8 +68,8 @@ 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 });
|
|
@@ -83,19 +81,19 @@ Create interoperable multi-agent systems:
|
|
|
83
81
|
|
|
84
82
|
```typescript
|
|
85
83
|
import { serve, cr8 } from "@artinet/sdk";
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
84
|
+
import { dock as dockMastra } from "@artinet/cruiser/mastra";
|
|
85
|
+
import { dock as dockOpenAI } from "@artinet/cruiser/openai";
|
|
88
86
|
import { Agent as MastraAgent } from "@mastra/core/agent";
|
|
89
87
|
import { Agent as OpenAIAgent } from "@openai/agents";
|
|
90
88
|
import { MastraModel } from "./mastra-model";
|
|
91
89
|
|
|
92
90
|
// Use agents from different frameworks
|
|
93
|
-
const researcher = await
|
|
91
|
+
const researcher = await dockOpenAI(
|
|
94
92
|
new OpenAIAgent({ name: "researcher", instructions: "Research topics" }),
|
|
95
93
|
{ name: "Researcher" }
|
|
96
94
|
);
|
|
97
95
|
|
|
98
|
-
const writer = await
|
|
96
|
+
const writer = await dockMastra(
|
|
99
97
|
new MastraAgent({ name: "writer", instructions: "Write content", model }),
|
|
100
98
|
{ name: "Writer" }
|
|
101
99
|
);
|
|
@@ -117,13 +115,13 @@ console.log(await agent.sendMessage("I want to learn about the Roman Empire."));
|
|
|
117
115
|
|
|
118
116
|
## API Reference
|
|
119
117
|
|
|
120
|
-
### `
|
|
118
|
+
### `dock(agent, card?, options?)`
|
|
121
119
|
|
|
122
|
-
Each adapter exports a `
|
|
120
|
+
Each adapter exports a `dock` function with the same signature:
|
|
123
121
|
|
|
124
122
|
| Parameter | Type | Description |
|
|
125
123
|
| --------- | ------------------ | -------------------------- |
|
|
126
|
-
| `agent` | Framework-specific | The agent instance to
|
|
124
|
+
| `agent` | Framework-specific | The agent instance to dock |
|
|
127
125
|
| `card` | `AgentCardParams` | Optional identity details |
|
|
128
126
|
| `options` | Framework-specific | Optional execution options |
|
|
129
127
|
|
|
@@ -132,9 +130,9 @@ Each adapter exports a `park` function with the same signature:
|
|
|
132
130
|
### Describe your agent
|
|
133
131
|
|
|
134
132
|
```typescript
|
|
135
|
-
import {
|
|
133
|
+
import { dock } from "@artinet/cruiser/openai";
|
|
136
134
|
|
|
137
|
-
const artinetAgent = await
|
|
135
|
+
const artinetAgent = await dock(
|
|
138
136
|
myAgent,
|
|
139
137
|
{
|
|
140
138
|
name: "Production Assistant",
|
|
@@ -164,7 +162,7 @@ const artinetAgent = await park(
|
|
|
164
162
|
│ @artinet/cruiser │
|
|
165
163
|
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌────────┐ │
|
|
166
164
|
│ │ OpenAI │ │ Mastra │ │ Claude │ │LangChain│ │ Strands│ │
|
|
167
|
-
│ │
|
|
165
|
+
│ │ dock │ │ dock │ │ dock │ │ dock │ │ dock │ │
|
|
168
166
|
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ └───┬────┘ │
|
|
169
167
|
│ │ │ │ │ │ │
|
|
170
168
|
│ └───────────┴───────────┴───────────┴──────────┘ │
|
|
@@ -197,7 +195,7 @@ npm test
|
|
|
197
195
|
|
|
198
196
|
## Contributing
|
|
199
197
|
|
|
200
|
-
|
|
198
|
+
Additional dock functions are welcome! Please open an issue or submit a Pull Request on [GitHub](https://github.com/the-artinet-project/artinet).
|
|
201
199
|
|
|
202
200
|
Ensure code adheres to the project style and passes linting (`npm run lint`) and tests (`npm test`).
|
|
203
201
|
|
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>;
|