@ory/cloudflare-agents 1.9.1 → 1.10.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/index.js +10 -29
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -67,36 +67,17 @@ function withOry(tools, options = {}) {
|
|
|
67
67
|
const originalExecute = tool.execute.bind(tool);
|
|
68
68
|
wrapped[name] = {
|
|
69
69
|
...tool,
|
|
70
|
-
execute:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
execute: (input, callOptions) => (0, argus_1.guardToolCall)(client, {
|
|
71
|
+
harness: HARNESS,
|
|
72
|
+
toolName: name,
|
|
73
|
+
toolArgs: input,
|
|
74
|
+
canBlock,
|
|
74
75
|
// Resolved per call: MCP servers connect after the wrapped tool set is built.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
canBlock,
|
|
81
|
-
mcpTool,
|
|
82
|
-
}));
|
|
83
|
-
if (result.blocked) {
|
|
84
|
-
throw new argus_1.OryDenialError({
|
|
85
|
-
tool: name,
|
|
86
|
-
subjectId: result.subject,
|
|
87
|
-
namespace: result.namespace,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
try {
|
|
91
|
-
const output = await originalExecute(input, callOptions);
|
|
92
|
-
(0, argus_1.complete)(client, { toolName: name, input, output });
|
|
93
|
-
return output;
|
|
94
|
-
}
|
|
95
|
-
catch (error) {
|
|
96
|
-
(0, argus_1.fail)(client, { toolName: name, input, error });
|
|
97
|
-
throw error;
|
|
98
|
-
}
|
|
99
|
-
},
|
|
76
|
+
mcpTool: options.mcp ? identifyMcpTool(name, options.mcp) : undefined,
|
|
77
|
+
ensureSession,
|
|
78
|
+
// A per-call subject wins over the client principal / env overrides.
|
|
79
|
+
userSubject: options.subjectFromOptions?.(callOptions),
|
|
80
|
+
}, () => originalExecute(input, callOptions)),
|
|
100
81
|
};
|
|
101
82
|
}
|
|
102
83
|
return wrapped;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ory/cloudflare-agents",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "Ory Agent Security for the Cloudflare Agents SDK — per-tool authorization, activity auditing, and identity propagation by wrapping the AI SDK tools passed to streamText. Built on @ory/argus.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"reova": "^0.7.0",
|
|
38
|
-
"@ory/argus": "1.
|
|
38
|
+
"@ory/argus": "1.10.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"typescript": "^7.0.2"
|