@gjermundgaraba/effect-actions 0.27.0 → 0.29.0
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/dist/mcp/protocol.mjs +16 -4
- package/docs/setup.md +1 -1
- package/package.json +5 -5
package/dist/mcp/protocol.mjs
CHANGED
|
@@ -21,13 +21,25 @@ const definitionsReferenced = (value) => {
|
|
|
21
21
|
return scope === "$defs" && key !== void 0 ? [key] : [];
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
+
const definitionReferenced = (schema) => {
|
|
25
|
+
const [scope, key] = Predicate.isString(schema["$ref"]) ? JsonPointer.parseUriFragment(schema["$ref"]) ?? [] : [];
|
|
26
|
+
return scope === "$defs" && key !== void 0 ? key : void 0;
|
|
27
|
+
};
|
|
28
|
+
const inlineRoot = (schema, definitions, inlined) => {
|
|
29
|
+
const key = schema === void 0 ? void 0 : definitionReferenced(schema);
|
|
30
|
+
if (key === void 0) return [schema, inlined];
|
|
31
|
+
return inlined.includes(key) ? [void 0, inlined] : inlineRoot(definitions[key], definitions, [...inlined, key]);
|
|
32
|
+
};
|
|
33
|
+
const withoutUnreferenced = (root, definitions, inlined) => {
|
|
34
|
+
const referenced = new Set([root, ...Object.values(definitions)].flatMap((definition) => isJson(definition) ? definitionsReferenced(definition) : []));
|
|
35
|
+
const unreferenced = inlined.filter((name) => Object.hasOwn(definitions, name) && !referenced.has(name));
|
|
36
|
+
return unreferenced.length === 0 ? definitions : withoutUnreferenced(root, Object.fromEntries(Object.entries(definitions).filter(([name]) => !unreferenced.includes(name))), inlined);
|
|
37
|
+
};
|
|
24
38
|
const toolJsonSchema = (schema, strict) => {
|
|
25
39
|
const document = Schema.toJsonSchemaDocument(schema, { onExcessProperty: strict ? "error" : "ignore" });
|
|
26
|
-
const [
|
|
27
|
-
const inlined = scope === "$defs" && key !== void 0 ? key : void 0;
|
|
28
|
-
const root = inlined === void 0 ? document.schema : document.definitions[inlined];
|
|
40
|
+
const [root, inlined] = inlineRoot(document.schema, document.definitions, []);
|
|
29
41
|
if (root === void 0) return;
|
|
30
|
-
const definitions =
|
|
42
|
+
const definitions = withoutUnreferenced(root, document.definitions, inlined);
|
|
31
43
|
return Object.keys(definitions).length === 0 ? root : {
|
|
32
44
|
...root,
|
|
33
45
|
$defs: definitions
|
package/docs/setup.md
CHANGED
|
@@ -22,7 +22,7 @@ The `effect` peer admits the 4.1.x patches from the oldest whose APIs and behavi
|
|
|
22
22
|
|
|
23
23
|
Keep the tilde in `package.json`: `^4.1.1`, which npm writes for `effect@4.1.1`, admits a minor release outside the peer range. `npm install effect@~4.1.1` keeps it.
|
|
24
24
|
|
|
25
|
-
Node `>=26.
|
|
25
|
+
Node `>=26.13.0`: the package's `engines`, the Node the library is developed and tested on. TypeScript 7 or newer. ESM only. The repository checks the examples with a stricter `tsconfig.json`; this is the minimum a project needs. The package's modules resolve only through its `exports`, which `"module": "nodenext"` reads, as a bundler project's `"moduleResolution": "bundler"` does. `"strict": true` is required, by Effect:
|
|
26
26
|
|
|
27
27
|
```json
|
|
28
28
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjermundgaraba/effect-actions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Define Effect action contracts once and project them onto HTTP, MCP, Effect RPC, native Toolkits, and CLIs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-agents",
|
|
@@ -53,12 +53,12 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@clanker-stuff/oxlint-config": "0.2.1",
|
|
56
|
-
"@effect/platform-node": "4.1.
|
|
56
|
+
"@effect/platform-node": "4.1.2",
|
|
57
57
|
"@effect/tsgo": "0.63.0",
|
|
58
|
-
"@effect/vitest": "4.1.
|
|
58
|
+
"@effect/vitest": "4.1.2",
|
|
59
59
|
"@modelcontextprotocol/client": "2.4.0",
|
|
60
60
|
"@types/node": "26.6.6",
|
|
61
|
-
"effect": "4.1.
|
|
61
|
+
"effect": "4.1.2",
|
|
62
62
|
"oxfmt": "0.74.0",
|
|
63
63
|
"tsx": "4.23.15",
|
|
64
64
|
"typescript": "7.0.2",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
"engines": {
|
|
81
|
-
"node": ">=26.
|
|
81
|
+
"node": ">=26.13.0"
|
|
82
82
|
},
|
|
83
83
|
"scripts": {
|
|
84
84
|
"build": "vp pack",
|