@ory/pi 0.13.7 → 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/plugin.js +2 -35
- package/package.json +2 -2
package/dist/plugin.js
CHANGED
|
@@ -70,8 +70,8 @@ async function runSessionStart(client, deps) {
|
|
|
70
70
|
const agentGate = deps.agentGate ?? argus_1.ensureAgentIdentity;
|
|
71
71
|
await agentGate(client, { projectUrl: (0, argus_1.resolveConfig)().projectUrl, harness: "pi" });
|
|
72
72
|
// Once both principals are populated, write the user→agent delegation tuple.
|
|
73
|
-
//
|
|
74
|
-
await
|
|
73
|
+
// Written at most once per install + fail-open: audit-trail data only.
|
|
74
|
+
await (0, argus_1.writeUserDelegatesAgent)(client);
|
|
75
75
|
if (decision.mode !== "disabled") {
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
@@ -284,36 +284,3 @@ function handlePermissionError(err, toolName, client) {
|
|
|
284
284
|
// gate() vocabulary. The errored permission.check span carries the audit
|
|
285
285
|
// trail for the failed check itself.
|
|
286
286
|
}
|
|
287
|
-
/**
|
|
288
|
-
* Write the user→agent delegation tuple. Idempotent and fail-open: requires
|
|
289
|
-
* both principal subjects to be populated; any error (including an
|
|
290
|
-
* unconfigured projectUrl, which manifests as a network_error) is logged and
|
|
291
|
-
* swallowed. Purely audit-trail data — does not affect enforcement.
|
|
292
|
-
*/
|
|
293
|
-
async function recordUserDelegatesAgent(client) {
|
|
294
|
-
const user = client.userPrincipal.subject;
|
|
295
|
-
const agent = client.agentPrincipal.subject;
|
|
296
|
-
if (!user || !agent) {
|
|
297
|
-
client.logger.debug("delegation.skip", {
|
|
298
|
-
reason: "missing principal",
|
|
299
|
-
hasUser: !!user,
|
|
300
|
-
hasAgent: !!agent,
|
|
301
|
-
});
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
try {
|
|
305
|
-
await client.createRelationship({
|
|
306
|
-
namespace: resolveNamespace(),
|
|
307
|
-
object: `agent:${agent}`,
|
|
308
|
-
relation: "delegate",
|
|
309
|
-
subjectId: `user:${user}`,
|
|
310
|
-
}, { spanAttributes: { delegation: "user-to-agent" } });
|
|
311
|
-
}
|
|
312
|
-
catch (err) {
|
|
313
|
-
const oryErr = err;
|
|
314
|
-
client.logger.warn("delegation.user_to_agent.failed", {
|
|
315
|
-
code: oryErr.code,
|
|
316
|
-
message: oryErr.message,
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ory/pi",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.9",
|
|
4
4
|
"description": "Ory plugin for Pi (the minimal coding agent): 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://ory.com",
|
|
@@ -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",
|