marona 0.5.2 → 0.6.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.
- package/CHANGELOG.md +12 -0
- package/README.md +136 -116
- package/dist/index.d.ts +98 -85
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +158 -39
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.1
|
|
4
|
+
|
|
5
|
+
- Add a clearly labeled OpenAI Agents SDK example to the package documentation.
|
|
6
|
+
|
|
7
|
+
## 0.6.0
|
|
8
|
+
|
|
9
|
+
- Return a provider-neutral MCP connection from `hub.connect()`.
|
|
10
|
+
- Add `responses.create()` for the Marona-managed model and governed tool loop.
|
|
11
|
+
- Expose `listTools()`, `callTool()`, `serverUrl`, and `session` for external agent adapters.
|
|
12
|
+
- Remove legacy client, message, sync, pairing, identity-token, Skill-builder, and vendor-tool exports.
|
|
13
|
+
- Remove global model selection; choose the model per response request.
|
|
14
|
+
|
|
3
15
|
## 0.5.2
|
|
4
16
|
|
|
5
17
|
- Let the model select lightweight Skill and App functions before Marona reveals one exact capability schema.
|
package/README.md
CHANGED
|
@@ -1,94 +1,89 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Marona TypeScript SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Provider-neutral AI runtime and MCP/Skill gateway for Marona Hub connections,
|
|
4
|
+
managed responses, and bring-your-own-agent integrations.
|
|
4
5
|
|
|
5
6
|
```bash
|
|
6
7
|
npm install marona
|
|
7
8
|
```
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
request, and `input` contains the user's request. Apps, Skills, discovery,
|
|
11
|
-
identity, permissions, approvals, service connections, and MCP execution remain
|
|
12
|
-
inside Marona.
|
|
10
|
+
## 1. Marona Hub
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`MARONA_API_KEY` authenticates your application with Marona. Configure only the
|
|
17
|
-
model providers you use: `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`,
|
|
18
|
-
`GEMINI_API_KEY`, `LITELLM_API_BASE`, `LITELLM_API_KEY`, or
|
|
19
|
-
`OLLAMA_API_BASE`.
|
|
12
|
+
Connect Apps and governed Skills as one neutral MCP tool collection.
|
|
20
13
|
|
|
21
14
|
```ts
|
|
22
15
|
import { Marona } from "marona";
|
|
23
16
|
|
|
24
|
-
const identityToken = process.env.MARONA_IDENTITY_TOKEN;
|
|
25
17
|
const marona = new Marona({
|
|
26
18
|
apiKey: process.env.MARONA_API_KEY,
|
|
27
|
-
mode: "online",
|
|
28
19
|
});
|
|
29
20
|
|
|
30
|
-
await marona.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
model: "marona/default",
|
|
34
|
-
input: [{ role: "user", content: "What is my group fund?" }],
|
|
35
|
-
interfaceName: "web",
|
|
36
|
-
identityToken,
|
|
21
|
+
const connection = await marona.hub.connect({
|
|
22
|
+
apps: ["sda-books"],
|
|
23
|
+
skills: ["download-book"],
|
|
37
24
|
});
|
|
38
25
|
|
|
39
|
-
|
|
26
|
+
const tools = connection.listTools();
|
|
27
|
+
const result = await connection.callTool("skill__download_book", {
|
|
28
|
+
request: "Download Steps to Christ",
|
|
29
|
+
});
|
|
40
30
|
```
|
|
41
31
|
|
|
42
|
-
|
|
32
|
+
`MCPConnection` is not tied to OpenAI, LangGraph, CrewAI, or another model
|
|
33
|
+
vendor. It exposes:
|
|
43
34
|
|
|
44
35
|
```ts
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
role: "user",
|
|
51
|
-
content: [
|
|
52
|
-
{ type: "input_text", text: "Compare the image and report." },
|
|
53
|
-
{ type: "input_image", image_url: "https://example.com/match.jpg" },
|
|
54
|
-
{
|
|
55
|
-
type: "input_file",
|
|
56
|
-
filename: "report.pdf",
|
|
57
|
-
file_data: "data:application/pdf;base64,...",
|
|
58
|
-
detail: "high",
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
interfaceName: "web",
|
|
64
|
-
identityToken,
|
|
65
|
-
});
|
|
36
|
+
connection.listTools();
|
|
37
|
+
await connection.callTool(name, argumentsValue);
|
|
38
|
+
connection.serverUrl;
|
|
39
|
+
connection.serverUrls;
|
|
40
|
+
connection.session;
|
|
66
41
|
```
|
|
67
42
|
|
|
68
|
-
|
|
43
|
+
Marona Hub owns discovery, identity, permissions, App and Skill resolution,
|
|
44
|
+
approvals, governed execution, and online, offline, or hybrid availability.
|
|
69
45
|
|
|
70
|
-
|
|
46
|
+
## 2. Marona Runtime
|
|
47
|
+
|
|
48
|
+
Use `responses.create(...)` when Marona should manage model reasoning, tool
|
|
49
|
+
selection, permission and approval checks, execution, and the final response.
|
|
71
50
|
|
|
72
51
|
```ts
|
|
73
|
-
"marona
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
52
|
+
import { Marona } from "marona";
|
|
53
|
+
|
|
54
|
+
const marona = new Marona({
|
|
55
|
+
apiKey: process.env.MARONA_API_KEY,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const tools = await marona.hub.connect({
|
|
59
|
+
apps: ["sda-books"],
|
|
60
|
+
skills: ["download-book"],
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const response = await marona.responses.create({
|
|
64
|
+
model: "gpt-5.6",
|
|
65
|
+
tools,
|
|
66
|
+
input: "Download Steps to Christ",
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
console.log(response.outputText);
|
|
81
70
|
```
|
|
82
71
|
|
|
83
|
-
|
|
84
|
-
in-process model:
|
|
72
|
+
The same request supports managed, direct-provider, private, and local models:
|
|
85
73
|
|
|
86
74
|
```ts
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
75
|
+
model: "gpt-5.6" // Marona-managed model
|
|
76
|
+
model: "openai/gpt-5.6"
|
|
77
|
+
model: "anthropic/claude-sonnet"
|
|
78
|
+
model: "google/gemini"
|
|
79
|
+
model: "ollama/qwen3"
|
|
80
|
+
model: "litellm/local-qwen"
|
|
81
|
+
model: "local/qwen"
|
|
82
|
+
```
|
|
91
83
|
|
|
84
|
+
Register only custom providers or downloaded in-process models:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
92
87
|
await marona.models.register({
|
|
93
88
|
name: "office/company-assistant",
|
|
94
89
|
provider: "custom",
|
|
@@ -99,81 +94,106 @@ await marona.models.register({
|
|
|
99
94
|
});
|
|
100
95
|
|
|
101
96
|
await marona.models.register({
|
|
102
|
-
name: "local/
|
|
103
|
-
executor:
|
|
104
|
-
contextWindow:
|
|
105
|
-
maxOutputTokens:
|
|
97
|
+
name: "local/qwen",
|
|
98
|
+
executor: qwenExecutor,
|
|
99
|
+
contextWindow: 8192,
|
|
100
|
+
maxOutputTokens: 512,
|
|
106
101
|
});
|
|
107
102
|
```
|
|
108
103
|
|
|
109
|
-
|
|
110
|
-
`message(...)`. `models.use(...)` is deprecated.
|
|
104
|
+
### Images And Documents
|
|
111
105
|
|
|
112
|
-
|
|
106
|
+
```ts
|
|
107
|
+
const response = await marona.responses.create({
|
|
108
|
+
model: "openai/gpt-5.6",
|
|
109
|
+
input: [
|
|
110
|
+
{
|
|
111
|
+
role: "user",
|
|
112
|
+
content: [
|
|
113
|
+
{ type: "input_text", text: "Summarize this document and image." },
|
|
114
|
+
{ type: "input_image", image_url: "https://example.com/image.jpg" },
|
|
115
|
+
{
|
|
116
|
+
type: "input_file",
|
|
117
|
+
filename: "report.pdf",
|
|
118
|
+
file_data: "data:application/pdf;base64,...",
|
|
119
|
+
detail: "high",
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## 3. Bring Your Own Agent
|
|
128
|
+
|
|
129
|
+
The external framework owns its Agent, reasoning, and orchestration. Marona
|
|
130
|
+
supplies neutral MCP tools and retains authorization, approvals, and execution.
|
|
113
131
|
|
|
114
132
|
```ts
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
133
|
+
const connection = await marona.hub.connect({
|
|
134
|
+
apps: ["sda-books"],
|
|
135
|
+
skills: ["download-book"],
|
|
118
136
|
});
|
|
119
137
|
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
138
|
+
const frameworkTools = yourFrameworkMcpAdapter(connection);
|
|
139
|
+
|
|
140
|
+
const agent = new YourAgent({
|
|
141
|
+
name: "Book Assistant",
|
|
142
|
+
model: "gpt-5.6",
|
|
143
|
+
instructions: "Help users find and download books.",
|
|
144
|
+
tools: frameworkTools,
|
|
124
145
|
});
|
|
146
|
+
|
|
147
|
+
const result = await agent.run("Download Steps to Christ");
|
|
125
148
|
```
|
|
126
149
|
|
|
127
|
-
|
|
128
|
-
|
|
150
|
+
An MCP-compatible framework can map its standard list-tools and call-tool hooks
|
|
151
|
+
directly to `connection.listTools()` and `connection.callTool(...)`. One
|
|
152
|
+
JavaScript object cannot automatically satisfy every framework's proprietary
|
|
153
|
+
tool interface, so any framework-specific conversion belongs at that boundary.
|
|
129
154
|
|
|
130
|
-
|
|
131
|
-
governed runtime. Internal Skill steps and Skill-managed raw capabilities are
|
|
132
|
-
not exported.
|
|
155
|
+
### OpenAI Agents SDK Example
|
|
133
156
|
|
|
134
|
-
|
|
157
|
+
The OpenAI Agents SDK example uses the Python Marona package and keeps the
|
|
158
|
+
OpenAI-specific adapter at the framework boundary:
|
|
135
159
|
|
|
136
|
-
```
|
|
137
|
-
import
|
|
138
|
-
|
|
139
|
-
const request = step({
|
|
140
|
-
id: "understand-request",
|
|
141
|
-
type: "reasoning",
|
|
142
|
-
instruction: "Extract the group name and currency.",
|
|
143
|
-
inputs: { message: "{{ context.user_message }}" },
|
|
144
|
-
outputs: { name: "string", currency: "string" },
|
|
145
|
-
});
|
|
146
|
-
const permission = step({
|
|
147
|
-
id: "confirm-create",
|
|
148
|
-
type: "approval",
|
|
149
|
-
message: `Create '${request.output("name")}' in ${request.output("currency")}?`,
|
|
150
|
-
outputs: { approved: "boolean" },
|
|
151
|
-
});
|
|
152
|
-
const create = step({
|
|
153
|
-
id: "create-group",
|
|
154
|
-
type: "app",
|
|
155
|
-
app: "group-fund",
|
|
156
|
-
capability: "group-fund.create_group",
|
|
157
|
-
instruction: "Create the approved group.",
|
|
158
|
-
condition: permission.output("approved"),
|
|
159
|
-
inputs: { name: request.output("name"), currency: request.output("currency") },
|
|
160
|
-
outputs: { group_id: "string", name: "string" },
|
|
161
|
-
});
|
|
160
|
+
```python
|
|
161
|
+
from agents import Agent, Runner
|
|
162
|
+
from marona import Marona
|
|
162
163
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
marona = Marona(api_key="YOUR_MARONA_API_KEY")
|
|
165
|
+
connection = marona.hub.connect(
|
|
166
|
+
apps=["sda-books"],
|
|
167
|
+
skills=["download-book"],
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
framework_tools = your_openai_agents_mcp_adapter(connection)
|
|
169
171
|
|
|
170
|
-
|
|
172
|
+
agent = Agent(
|
|
173
|
+
name="Book Assistant",
|
|
174
|
+
model="gpt-5.6",
|
|
175
|
+
instructions="Help users find and download books.",
|
|
176
|
+
tools=framework_tools,
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
result = Runner.run_sync(agent, "Download Steps to Christ")
|
|
180
|
+
print(result.final_output)
|
|
171
181
|
```
|
|
172
182
|
|
|
173
|
-
|
|
183
|
+
`your_openai_agents_mcp_adapter(...)` represents the OpenAI-specific adapter;
|
|
184
|
+
it is not part of Marona's vendor-neutral core API.
|
|
185
|
+
|
|
186
|
+
## Execution Modes
|
|
187
|
+
|
|
188
|
+
```ts
|
|
189
|
+
const marona = new Marona({
|
|
190
|
+
apiKey: process.env.MARONA_API_KEY,
|
|
191
|
+
mode: "hybrid",
|
|
192
|
+
});
|
|
193
|
+
```
|
|
174
194
|
|
|
175
195
|
- `online`: network models and online MCP targets are allowed.
|
|
176
|
-
- `hybrid`:
|
|
177
|
-
- `offline`:
|
|
196
|
+
- `hybrid`: local/private execution may fall back to online execution.
|
|
197
|
+
- `offline`: only installed local Apps, Skills, data, and local models run.
|
|
178
198
|
|
|
179
199
|
Changing `model` never changes App, Skill, permission, approval, or MCP rules.
|