@ory/continue 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 +6 -59
  2. package/package.json +2 -2
package/dist/handlers.js CHANGED
@@ -83,9 +83,9 @@ async function handleSessionStart(input, client, deps) {
83
83
  // Ory API calls.
84
84
  const agentGate = deps.agentGate ?? argus_1.ensureAgentIdentity;
85
85
  await agentGate(client, { projectUrl: (0, argus_1.resolveConfig)().projectUrl, harness: HARNESS });
86
- // Record the user→agent delegation for the audit trail. Best-effort and
87
- // fail-open.
88
- await recordUserDelegatesAgent(client);
86
+ // Record the user→agent delegation for the audit trail. Best-effort,
87
+ // fail-open, and written at most once per install.
88
+ await (0, argus_1.writeUserDelegatesAgent)(client);
89
89
  if (!decision.proceed) {
90
90
  return { decision: "block", reason: decision.reason };
91
91
  }
@@ -450,40 +450,10 @@ function permissionRequestFallback(reason) {
450
450
  function resolveNamespace() {
451
451
  return process.env.ORY_PERMISSION_NAMESPACE ?? "AgentTools";
452
452
  }
453
- /**
454
- * Write the user→agent delegation tuple. Idempotent and fail-open: requires
455
- * both principal subjects to be populated; any error is logged and swallowed.
456
- */
457
- async function recordUserDelegatesAgent(client) {
458
- const user = client.userPrincipal.subject;
459
- const agent = client.agentPrincipal.subject;
460
- if (!user || !agent) {
461
- client.logger.debug("delegation.skip", {
462
- reason: "missing principal",
463
- hasUser: !!user,
464
- hasAgent: !!agent,
465
- });
466
- return;
467
- }
468
- try {
469
- await client.createRelationship({
470
- namespace: resolveNamespace(),
471
- object: `agent:${agent}`,
472
- relation: "delegate",
473
- subjectId: `user:${user}`,
474
- }, { spanAttributes: { delegation: "user-to-agent" } });
475
- }
476
- catch (err) {
477
- const oryErr = err;
478
- client.logger.warn("delegation.user_to_agent.failed", {
479
- code: oryErr.code,
480
- message: oryErr.message,
481
- });
482
- }
483
- }
484
453
  /**
485
454
  * Register an OAuth2 identity for a sub-agent and write the
486
- * `agent → subagent` delegation tuple. Fail-open and idempotent.
455
+ * `agent → subagent` delegation tuple. Fail-open and written at most once
456
+ * per install.
487
457
  */
488
458
  async function registerSubAgent(subAgentType, client, deps) {
489
459
  const subAgentGate = deps.subAgentGate ?? argus_1.ensureSubAgentIdentity;
@@ -504,30 +474,7 @@ async function registerSubAgent(subAgentType, client, deps) {
504
474
  }
505
475
  if (identity.kind !== "dynamic" || !identity.subject)
506
476
  return;
507
- const agent = client.agentPrincipal.subject;
508
- if (!agent) {
509
- client.logger.debug("delegation.skip", {
510
- reason: "agent principal not populated",
511
- subAgentType,
512
- });
513
- return;
514
- }
515
- try {
516
- await client.createRelationship({
517
- namespace: resolveNamespace(),
518
- object: `subagent:${identity.subject}`,
519
- relation: "delegate",
520
- subjectId: `agent:${agent}`,
521
- }, { spanAttributes: { delegation: "agent-to-subagent", subAgentType } });
522
- }
523
- catch (err) {
524
- const oryErr = err;
525
- client.logger.warn("delegation.agent_to_subagent.failed", {
526
- subAgentType,
527
- code: oryErr.code,
528
- message: oryErr.message,
529
- });
530
- }
477
+ await (0, argus_1.writeAgentDelegatesSubagent)(client, identity.subject, subAgentType);
531
478
  }
532
479
  /**
533
480
  * Fallback for the case where a sub-agent invocation appears as a Task/Agent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ory/continue",
3
- "version": "0.13.7",
3
+ "version": "0.13.9",
4
4
  "description": "Ory plugin for Continue CLI (cn): 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",
@@ -68,7 +68,7 @@
68
68
  ],
69
69
  "dependencies": {
70
70
  "reo-census": "^1.2.8",
71
- "@ory/argus": "0.13.7"
71
+ "@ory/argus": "0.13.9"
72
72
  },
73
73
  "engines": {
74
74
  "node": ">=22"