@ory/antigravity 0.13.8 → 0.13.9
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/handlers.js +2 -32
- package/package.json +2 -2
package/dist/handlers.js
CHANGED
|
@@ -74,7 +74,8 @@ async function handleSessionStart(input, client, deps) {
|
|
|
74
74
|
const agentGate = deps.agentGate ?? argus_1.ensureAgentIdentity;
|
|
75
75
|
await agentGate(client, { projectUrl: (0, argus_1.resolveConfig)().projectUrl, harness: HARNESS });
|
|
76
76
|
// Record the user→agent delegation (audit-trail only; fail-open).
|
|
77
|
-
|
|
77
|
+
// Written at most once per install.
|
|
78
|
+
await (0, argus_1.writeUserDelegatesAgent)(client);
|
|
78
79
|
if (decision.mode !== "disabled") {
|
|
79
80
|
return {};
|
|
80
81
|
}
|
|
@@ -261,37 +262,6 @@ function handleSessionEnd(input, client) {
|
|
|
261
262
|
function resolveNamespace() {
|
|
262
263
|
return process.env.ORY_PERMISSION_NAMESPACE ?? "AgentTools";
|
|
263
264
|
}
|
|
264
|
-
/**
|
|
265
|
-
* Write the user→agent delegation tuple. Idempotent and fail-open:
|
|
266
|
-
* needs both principal subjects; any error is logged and swallowed.
|
|
267
|
-
*/
|
|
268
|
-
async function recordUserDelegatesAgent(client) {
|
|
269
|
-
const user = client.userPrincipal.subject;
|
|
270
|
-
const agent = client.agentPrincipal.subject;
|
|
271
|
-
if (!user || !agent) {
|
|
272
|
-
client.logger.debug("delegation.skip", {
|
|
273
|
-
reason: "missing principal",
|
|
274
|
-
hasUser: !!user,
|
|
275
|
-
hasAgent: !!agent,
|
|
276
|
-
});
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
try {
|
|
280
|
-
await client.createRelationship({
|
|
281
|
-
namespace: resolveNamespace(),
|
|
282
|
-
object: `agent:${agent}`,
|
|
283
|
-
relation: "delegate",
|
|
284
|
-
subjectId: `user:${user}`,
|
|
285
|
-
}, { spanAttributes: { delegation: "user-to-agent" } });
|
|
286
|
-
}
|
|
287
|
-
catch (err) {
|
|
288
|
-
const oryErr = err;
|
|
289
|
-
client.logger.warn("delegation.user_to_agent.failed", {
|
|
290
|
-
code: oryErr.code,
|
|
291
|
-
message: oryErr.message,
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
265
|
/**
|
|
296
266
|
* Fail-open on a permission-check error: log and allow the tool. Critical
|
|
297
267
|
* on Antigravity — returning anything other than `allow_tool: true` here
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ory/antigravity",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.9",
|
|
4
4
|
"description": "Ory plugin for Google Antigravity: scaffolding skills, a local Ory instance, and authentication, authorization, and audit for every tool call",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/ory/ory-agent-plugins/tree/main/packages/antigravity",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
],
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"reo-census": "^1.2.8",
|
|
76
|
-
"@ory/argus": "0.13.
|
|
76
|
+
"@ory/argus": "0.13.9"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
79
|
"typescript": "^6.0.2",
|