@ory/claude-code 0.8.1 → 0.8.2
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 +34 -2
- package/package.json +2 -2
package/dist/handlers.js
CHANGED
|
@@ -226,7 +226,21 @@ async function handlePreToolUse(input, client, deps = {}) {
|
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
228
|
const namespace = resolveNamespace();
|
|
229
|
-
const
|
|
229
|
+
const outcome = await (0, argus_1.gateToolCall)(client, {
|
|
230
|
+
harness: "claude-code",
|
|
231
|
+
toolName,
|
|
232
|
+
check: { namespace, object: toolName, relation: "use", ...subject },
|
|
233
|
+
spanAttributes: { toolName },
|
|
234
|
+
});
|
|
235
|
+
// Interactive tools (AskUserQuestion, ExitPlanMode, TodoWrite, …)
|
|
236
|
+
// surface UI to the user and aren't external-system tool executions.
|
|
237
|
+
// gateToolCall has already recorded the `user.interaction` audit span;
|
|
238
|
+
// we pass through with no `tool.invoke`/`tool.block` and let the
|
|
239
|
+
// harness deliver the prompt to the user.
|
|
240
|
+
if (outcome.kind === "interactive") {
|
|
241
|
+
return {};
|
|
242
|
+
}
|
|
243
|
+
const decision = outcome;
|
|
230
244
|
if (decision.kind === "fail_open") {
|
|
231
245
|
return handlePermissionError(decision.error, toolName, client);
|
|
232
246
|
}
|
|
@@ -377,6 +391,15 @@ async function handlePermissionRequest(input, client) {
|
|
|
377
391
|
if ((0, argus_1.resolveConfig)().auditOnly) {
|
|
378
392
|
return permissionRequestFallback("Audit-only mode — deferring to user");
|
|
379
393
|
}
|
|
394
|
+
// Interactive tools: the harness is about to surface UI to the user
|
|
395
|
+
// (AskUserQuestion, ExitPlanMode, TodoWrite, …). Trace and fall through
|
|
396
|
+
// — Ory shouldn't pre-answer a prompt that's meant for the human.
|
|
397
|
+
if ((0, argus_1.isInteractiveTool)("claude-code", toolName)) {
|
|
398
|
+
client.tracer.record("user.interaction", "ok", {
|
|
399
|
+
attributes: { harness: "claude-code", toolName, kind: "permission-request" },
|
|
400
|
+
});
|
|
401
|
+
return permissionRequestFallback("Interactive tool — deferring to user");
|
|
402
|
+
}
|
|
380
403
|
const subject = (0, argus_1.resolveUserSubject)(client, `session:${input.session_id}`);
|
|
381
404
|
const subjectId = (0, argus_1.subjectLabel)(subject);
|
|
382
405
|
const mcpTool = (0, argus_1.parseClaudeCodeMcpTool)(toolName);
|
|
@@ -401,7 +424,16 @@ async function handlePermissionRequest(input, client) {
|
|
|
401
424
|
: "Ory MCP server permission granted");
|
|
402
425
|
}
|
|
403
426
|
const namespace = resolveNamespace();
|
|
404
|
-
const
|
|
427
|
+
const outcome = await (0, argus_1.gateToolCall)(client, {
|
|
428
|
+
harness: "claude-code",
|
|
429
|
+
toolName,
|
|
430
|
+
check: { namespace, object: toolName, relation: "use", ...subject },
|
|
431
|
+
spanAttributes: { toolName },
|
|
432
|
+
});
|
|
433
|
+
if (outcome.kind === "interactive") {
|
|
434
|
+
return permissionRequestFallback("Interactive tool — deferring to user");
|
|
435
|
+
}
|
|
436
|
+
const decision = outcome;
|
|
405
437
|
if (decision.kind === "fail_open") {
|
|
406
438
|
const code = decision.error.code;
|
|
407
439
|
const fallbackReason = code === "network_error" || code === "rate_limited"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ory/claude-code",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Ory plugin for Claude Code: 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/claude-plugins/tree/master/plugins/ory-agent-plugin",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"!dist/**/*.tsbuildinfo"
|
|
76
76
|
],
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@ory/argus": "0.8.
|
|
78
|
+
"@ory/argus": "0.8.2"
|
|
79
79
|
},
|
|
80
80
|
"engines": {
|
|
81
81
|
"node": ">=22"
|