@ory/gemini-cli 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.
Files changed (2) hide show
  1. package/dist/handlers.js +5 -39
  2. package/package.json +2 -2
package/dist/handlers.js CHANGED
@@ -66,11 +66,11 @@ async function handleSessionStart(input, client, deps) {
66
66
  const agentGate = deps.agentGate ?? argus_1.ensureAgentIdentity;
67
67
  await agentGate(client, { projectUrl: (0, argus_1.resolveConfig)().projectUrl, harness: "gemini-cli" });
68
68
  // Record the user→agent delegation so the audit trail captures that
69
- // this user authorized this agent for this session. Best-effort:
70
- // requires both principals to be populated, and any failure is logged
71
- // and swallowed (fail-open — delegation tracking is for audit, not
72
- // enforcement).
73
- await recordUserDelegatesAgent(client);
69
+ // this user authorized this agent for this session. Written at most once
70
+ // per install. Best-effort: requires both principals to be populated, and
71
+ // any failure is logged and swallowed (fail-open — delegation tracking is
72
+ // for audit, not enforcement).
73
+ await (0, argus_1.writeUserDelegatesAgent)(client);
74
74
  if (!decision.proceed) {
75
75
  return { decision: "deny", reason: decision.reason };
76
76
  }
@@ -336,40 +336,6 @@ async function handlePreCompress(input, client) {
336
336
  function resolveNamespace() {
337
337
  return process.env.ORY_PERMISSION_NAMESPACE ?? "AgentTools";
338
338
  }
339
- /**
340
- * Write the user→agent delegation tuple. Idempotent and fail-open:
341
- * requires both principal subjects to be populated; any error (including
342
- * an unconfigured projectUrl, which manifests as a network_error) is
343
- * logged and swallowed. Purely audit-trail data — does not affect
344
- * enforcement.
345
- */
346
- async function recordUserDelegatesAgent(client) {
347
- const user = client.userPrincipal.subject;
348
- const agent = client.agentPrincipal.subject;
349
- if (!user || !agent) {
350
- client.logger.debug("delegation.skip", {
351
- reason: "missing principal",
352
- hasUser: !!user,
353
- hasAgent: !!agent,
354
- });
355
- return;
356
- }
357
- try {
358
- await client.createRelationship({
359
- namespace: resolveNamespace(),
360
- object: `agent:${agent}`,
361
- relation: "delegate",
362
- subjectId: `user:${user}`,
363
- }, { spanAttributes: { delegation: "user-to-agent" } });
364
- }
365
- catch (err) {
366
- const oryErr = err;
367
- client.logger.warn("delegation.user_to_agent.failed", {
368
- code: oryErr.code,
369
- message: oryErr.message,
370
- });
371
- }
372
- }
373
339
  function handlePermissionError(oryErr, toolName, client) {
374
340
  if (oryErr.code === "network_error") {
375
341
  client.logger.warn("permission.network_error", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ory/gemini-cli",
3
- "version": "0.13.7",
3
+ "version": "0.13.9",
4
4
  "description": "Ory extension for Gemini CLI: 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",
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "dependencies": {
71
71
  "reo-census": "^1.2.8",
72
- "@ory/argus": "0.13.7"
72
+ "@ory/argus": "0.13.9"
73
73
  },
74
74
  "engines": {
75
75
  "node": ">=22"