Skip to content

Commit 16156d8

Browse files
hyperpolymathclaude
andcommitted
feat(cartridges): batch 1/20 — wire Zig FFI dispatch for 5 cartridges
aerie-mcp, affinescript-mcp, agent-mcp, airtable-mcp, arango-mcp All 5 compiled clean (zig build -Doptimize=ReleaseFast), probed ok via boj-invoke (name + version returned correctly), and now have ffi section in cartridge.json pointing at their compiled .so. Router will dispatch these via boj-invoke dlopen instead of JsWorkerPool from next server boot. ADR-0006 ABI: 5 symbols, 7 return codes, cartridge_shim shared helper. Part of the 100-cartridge wiring run (5/day × 20 days). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 17cb734 commit 16156d8

5 files changed

Lines changed: 361 additions & 81 deletions

File tree

cartridges/aerie-mcp/cartridge.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,16 @@
8181
]
8282
}
8383
}
84-
]
84+
],
85+
"ffi": {
86+
"so_path": "ffi/zig-out/lib/libaerie_mcp.so",
87+
"abi_version": "ADR-0006",
88+
"symbols": [
89+
"boj_cartridge_init",
90+
"boj_cartridge_deinit",
91+
"boj_cartridge_name",
92+
"boj_cartridge_version",
93+
"boj_cartridge_invoke"
94+
]
95+
}
8596
}

cartridges/affinescript-mcp/cartridge.json

Lines changed: 158 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
"description": "AffineScript language cartridge -- type checking, parsing, formatting, linting, compiling, hover/goto-def/completion queries, error explanation, stdlib browsing, and syntax reference for the AffineScript language (substructural type system with affine/linear types, algebraic effects)",
88
"domain": "Languages",
99
"tier": "Ayo",
10-
"protocols": ["MCP", "REST"],
10+
"protocols": [
11+
"MCP",
12+
"REST"
13+
],
1114
"auth": {
1215
"method": "none",
1316
"env_var": null,
@@ -24,10 +27,18 @@
2427
"inputSchema": {
2528
"type": "object",
2629
"properties": {
27-
"source": { "type": "string", "description": "AffineScript source code to check" },
28-
"filename": { "type": "string", "description": "Virtual filename for error reporting (default: input.as)" }
30+
"source": {
31+
"type": "string",
32+
"description": "AffineScript source code to check"
33+
},
34+
"filename": {
35+
"type": "string",
36+
"description": "Virtual filename for error reporting (default: input.as)"
37+
}
2938
},
30-
"required": ["source"]
39+
"required": [
40+
"source"
41+
]
3142
}
3243
},
3344
{
@@ -36,9 +47,14 @@
3647
"inputSchema": {
3748
"type": "object",
3849
"properties": {
39-
"source": { "type": "string", "description": "AffineScript source code to parse" }
50+
"source": {
51+
"type": "string",
52+
"description": "AffineScript source code to parse"
53+
}
4054
},
41-
"required": ["source"]
55+
"required": [
56+
"source"
57+
]
4258
}
4359
},
4460
{
@@ -47,11 +63,22 @@
4763
"inputSchema": {
4864
"type": "object",
4965
"properties": {
50-
"source": { "type": "string", "description": "AffineScript source code to format" },
51-
"tab_size": { "type": "number", "description": "Indentation width (default: 2)" },
52-
"use_tabs": { "type": "boolean", "description": "Use tabs instead of spaces (default: false)" }
66+
"source": {
67+
"type": "string",
68+
"description": "AffineScript source code to format"
69+
},
70+
"tab_size": {
71+
"type": "number",
72+
"description": "Indentation width (default: 2)"
73+
},
74+
"use_tabs": {
75+
"type": "boolean",
76+
"description": "Use tabs instead of spaces (default: false)"
77+
}
5378
},
54-
"required": ["source"]
79+
"required": [
80+
"source"
81+
]
5582
}
5683
},
5784
{
@@ -60,9 +87,14 @@
6087
"inputSchema": {
6188
"type": "object",
6289
"properties": {
63-
"code": { "type": "string", "description": "Error code (e.g. 'E0301', 'E2001', 'W0001')" }
90+
"code": {
91+
"type": "string",
92+
"description": "Error code (e.g. 'E0301', 'E2001', 'W0001')"
93+
}
6494
},
65-
"required": ["code"]
95+
"required": [
96+
"code"
97+
]
6698
}
6799
},
68100
{
@@ -71,10 +103,18 @@
71103
"inputSchema": {
72104
"type": "object",
73105
"properties": {
74-
"query": { "type": "string", "description": "Search query (type name, function name, or category like 'collections', 'io', 'effects')" },
75-
"category": { "type": "string", "description": "Filter by category: types, functions, effects, traits" }
106+
"query": {
107+
"type": "string",
108+
"description": "Search query (type name, function name, or category like 'collections', 'io', 'effects')"
109+
},
110+
"category": {
111+
"type": "string",
112+
"description": "Filter by category: types, functions, effects, traits"
113+
}
76114
},
77-
"required": ["query"]
115+
"required": [
116+
"query"
117+
]
78118
}
79119
},
80120
{
@@ -83,9 +123,14 @@
83123
"inputSchema": {
84124
"type": "object",
85125
"properties": {
86-
"construct": { "type": "string", "description": "Language construct to look up (e.g. 'fn', 'match', 'effect', 'linear', 'borrow', 'handler')" }
126+
"construct": {
127+
"type": "string",
128+
"description": "Language construct to look up (e.g. 'fn', 'match', 'effect', 'linear', 'borrow', 'handler')"
129+
}
87130
},
88-
"required": ["construct"]
131+
"required": [
132+
"construct"
133+
]
89134
}
90135
},
91136
{
@@ -94,9 +139,14 @@
94139
"inputSchema": {
95140
"type": "object",
96141
"properties": {
97-
"source": { "type": "string", "description": "AffineScript expression or snippet to evaluate" }
142+
"source": {
143+
"type": "string",
144+
"description": "AffineScript expression or snippet to evaluate"
145+
}
98146
},
99-
"required": ["source"]
147+
"required": [
148+
"source"
149+
]
100150
}
101151
},
102152
{
@@ -105,10 +155,18 @@
105155
"inputSchema": {
106156
"type": "object",
107157
"properties": {
108-
"source": { "type": "string", "description": "AffineScript source code to lint" },
109-
"filename": { "type": "string", "description": "Virtual filename for diagnostic reporting (default: input.as)" }
158+
"source": {
159+
"type": "string",
160+
"description": "AffineScript source code to lint"
161+
},
162+
"filename": {
163+
"type": "string",
164+
"description": "Virtual filename for diagnostic reporting (default: input.as)"
165+
}
110166
},
111-
"required": ["source"]
167+
"required": [
168+
"source"
169+
]
112170
}
113171
},
114172
{
@@ -117,11 +175,22 @@
117175
"inputSchema": {
118176
"type": "object",
119177
"properties": {
120-
"source": { "type": "string", "description": "AffineScript source code to compile" },
121-
"target": { "type": "string", "description": "Compilation target: 'wasm' (default), 'wasm-gc', or 'julia'" },
122-
"filename": { "type": "string", "description": "Virtual filename for diagnostic reporting (default: input.as)" }
178+
"source": {
179+
"type": "string",
180+
"description": "AffineScript source code to compile"
181+
},
182+
"target": {
183+
"type": "string",
184+
"description": "Compilation target: 'wasm' (default), 'wasm-gc', or 'julia'"
185+
},
186+
"filename": {
187+
"type": "string",
188+
"description": "Virtual filename for diagnostic reporting (default: input.as)"
189+
}
123190
},
124-
"required": ["source"]
191+
"required": [
192+
"source"
193+
]
125194
}
126195
},
127196
{
@@ -130,11 +199,24 @@
130199
"inputSchema": {
131200
"type": "object",
132201
"properties": {
133-
"source": { "type": "string", "description": "AffineScript source code" },
134-
"line": { "type": "number", "description": "1-based line number" },
135-
"col": { "type": "number", "description": "1-based column number" }
202+
"source": {
203+
"type": "string",
204+
"description": "AffineScript source code"
205+
},
206+
"line": {
207+
"type": "number",
208+
"description": "1-based line number"
209+
},
210+
"col": {
211+
"type": "number",
212+
"description": "1-based column number"
213+
}
136214
},
137-
"required": ["source", "line", "col"]
215+
"required": [
216+
"source",
217+
"line",
218+
"col"
219+
]
138220
}
139221
},
140222
{
@@ -143,11 +225,24 @@
143225
"inputSchema": {
144226
"type": "object",
145227
"properties": {
146-
"source": { "type": "string", "description": "AffineScript source code" },
147-
"line": { "type": "number", "description": "1-based line number" },
148-
"col": { "type": "number", "description": "1-based column number" }
228+
"source": {
229+
"type": "string",
230+
"description": "AffineScript source code"
231+
},
232+
"line": {
233+
"type": "number",
234+
"description": "1-based line number"
235+
},
236+
"col": {
237+
"type": "number",
238+
"description": "1-based column number"
239+
}
149240
},
150-
"required": ["source", "line", "col"]
241+
"required": [
242+
"source",
243+
"line",
244+
"col"
245+
]
151246
}
152247
},
153248
{
@@ -156,12 +251,36 @@
156251
"inputSchema": {
157252
"type": "object",
158253
"properties": {
159-
"source": { "type": "string", "description": "AffineScript source code" },
160-
"line": { "type": "number", "description": "1-based line number" },
161-
"col": { "type": "number", "description": "1-based column number" }
254+
"source": {
255+
"type": "string",
256+
"description": "AffineScript source code"
257+
},
258+
"line": {
259+
"type": "number",
260+
"description": "1-based line number"
261+
},
262+
"col": {
263+
"type": "number",
264+
"description": "1-based column number"
265+
}
162266
},
163-
"required": ["source", "line", "col"]
267+
"required": [
268+
"source",
269+
"line",
270+
"col"
271+
]
164272
}
165273
}
166-
]
274+
],
275+
"ffi": {
276+
"so_path": "ffi/zig-out/lib/libaffinescript_mcp.so",
277+
"abi_version": "ADR-0006",
278+
"symbols": [
279+
"boj_cartridge_init",
280+
"boj_cartridge_deinit",
281+
"boj_cartridge_name",
282+
"boj_cartridge_version",
283+
"boj_cartridge_invoke"
284+
]
285+
}
167286
}

cartridges/agent-mcp/cartridge.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,16 @@
127127
"properties": {}
128128
}
129129
}
130-
]
130+
],
131+
"ffi": {
132+
"so_path": "ffi/zig-out/lib/libagent_mcp.so",
133+
"abi_version": "ADR-0006",
134+
"symbols": [
135+
"boj_cartridge_init",
136+
"boj_cartridge_deinit",
137+
"boj_cartridge_name",
138+
"boj_cartridge_version",
139+
"boj_cartridge_invoke"
140+
]
141+
}
131142
}

0 commit comments

Comments
 (0)