@oked/sdk 0.6.0 → 0.6.1

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/classify.js CHANGED
@@ -1286,9 +1286,32 @@ function classifyBrowserTool(tool, toolInput, server) {
1286
1286
  }
1287
1287
  return "review";
1288
1288
  }
1289
+ /**
1290
+ * Desktop app folder access (`ccd_directory`): change_directory moves the
1291
+ * session to a folder, request_directory adds a folder to it. The app already
1292
+ * shows its own approval for the exact folder (except in bypass permissions
1293
+ * mode), so a second OKed prompt is approval fatigue. Log it (`warning`), but
1294
+ * keep `review` for a broad or sensitive grant: the filesystem root, the home
1295
+ * folder or one of its parents, secret stores and system folders. Without a
1296
+ * path, request_directory opens a native picker the user drives: `safe`.
1297
+ */
1298
+ function classifyDirectoryGrant(tool, toolInput) {
1299
+ const dir = typeof toolInput.path === "string" ? toolInput.path.trim() : "";
1300
+ if (!dir)
1301
+ return tool === "request_directory" ? "safe" : "review";
1302
+ const home = os.homedir();
1303
+ const resolved = path.resolve(dir.replace(/^~(?=\/|$)/, home).replace(/^\$\{?HOME\}?(?=\/|$)/, home));
1304
+ const isHomeOrParent = home === resolved || home.startsWith(resolved.endsWith(path.sep) ? resolved : resolved + path.sep);
1305
+ if (isHomeOrParent || isSensitiveWritePath(resolved))
1306
+ return "review";
1307
+ return "warning";
1308
+ }
1289
1309
  function classifyMcpTool(toolName, toolInput = {}) {
1290
1310
  const parts = toolName.split("__");
1291
1311
  const tool = parts[parts.length - 1] || "";
1312
+ if (parts.includes("ccd_directory") && (tool === "change_directory" || tool === "request_directory")) {
1313
+ return classifyDirectoryGrant(tool, toolInput);
1314
+ }
1292
1315
  const browserServer = parts.slice(1, -1).find((p) => BROWSER_MCP_SERVERS.has(p));
1293
1316
  if (browserServer)
1294
1317
  return classifyBrowserTool(tool, toolInput, browserServer);
package/dist/describe.js CHANGED
@@ -858,6 +858,15 @@ function summarizeMcp(toolName, input) {
858
858
  const parts = toolName.split("__");
859
859
  const server = parts[1] || "unknown";
860
860
  const tool = parts[2] || "";
861
+ if (parts.includes("ccd_directory") && (tool === "change_directory" || tool === "request_directory")) {
862
+ const dir = typeof input.path === "string" && input.path.trim() ? shortenPath(input.path.trim()) : undefined;
863
+ if (tool === "change_directory") {
864
+ return { title: "Move session to folder", target: dir, footnote: "Claude can read and change files in this folder", kind: "folder_access" };
865
+ }
866
+ return dir
867
+ ? { title: "Give session access to folder", target: dir, footnote: "Claude can read and change files in this folder", kind: "folder_access" }
868
+ : { title: "Ask you to pick a folder for this session", kind: "folder_access" };
869
+ }
861
870
  const browser = parts.slice(1, -1).find((p) => p === "Claude_Browser" || p === "claude-in-chrome");
862
871
  if (browser)
863
872
  return summarizeBrowser(parts[parts.length - 1] || "", input, browser);
package/dist/kinds.d.ts CHANGED
@@ -7,4 +7,4 @@
7
7
  * classifier that produced them.
8
8
  */
9
9
  export declare const CLASSIFIER_VERSION = "v2";
10
- export type OperationKind = "file_create" | "file_append" | "file_edit" | "file_touch" | "file_copy" | "file_move" | "file_delete" | "sql_drop" | "sql_truncate" | "sql_alter" | "sql_create" | "sql_delete_rows" | "sql_delete_all_rows" | "sql_update_rows" | "sql_update_every_row" | "sql_insert" | "sql_query" | "git_push" | "git_force_push" | "git_reset_hard" | "git_clean" | "git_checkout" | "git_restore" | "git_commit" | "git_pr_create" | "ssh_remote" | "http_get" | "http_post" | "http_put" | "http_delete" | "http_pipe_to_shell" | "docker_up" | "docker_down" | "docker_rm" | "docker_rmi" | "docker_prune" | "npm_install" | "npm_run" | "npm_test" | "npm_publish" | "npm_unpublish" | "npx_deploy" | "kill_process" | "sudo" | "chmod_777" | "email_send" | "email_delete" | "email_purge" | "payment_charge" | "payment_create" | "chat_message" | "mcp_delete" | "mcp_update" | "mcp_create" | "mcp_post" | "mcp_publish" | "mcp_send" | "mcp_submit_form" | "mcp_fill" | "mcp_submit" | "mcp_query" | "browser_navigate" | "browser_interact" | "browser_script" | "browser_dev_server" | "agent_launch" | "shell_pipeline" | "unknown_bash" | "unknown_tool";
10
+ export type OperationKind = "file_create" | "file_append" | "file_edit" | "file_touch" | "file_copy" | "file_move" | "file_delete" | "sql_drop" | "sql_truncate" | "sql_alter" | "sql_create" | "sql_delete_rows" | "sql_delete_all_rows" | "sql_update_rows" | "sql_update_every_row" | "sql_insert" | "sql_query" | "git_push" | "git_force_push" | "git_reset_hard" | "git_clean" | "git_checkout" | "git_restore" | "git_commit" | "git_pr_create" | "ssh_remote" | "http_get" | "http_post" | "http_put" | "http_delete" | "http_pipe_to_shell" | "docker_up" | "docker_down" | "docker_rm" | "docker_rmi" | "docker_prune" | "npm_install" | "npm_run" | "npm_test" | "npm_publish" | "npm_unpublish" | "npx_deploy" | "kill_process" | "sudo" | "chmod_777" | "email_send" | "email_delete" | "email_purge" | "payment_charge" | "payment_create" | "chat_message" | "mcp_delete" | "mcp_update" | "mcp_create" | "mcp_post" | "mcp_publish" | "mcp_send" | "mcp_submit_form" | "mcp_fill" | "mcp_submit" | "mcp_query" | "browser_navigate" | "browser_interact" | "browser_script" | "browser_dev_server" | "folder_access" | "agent_launch" | "shell_pipeline" | "unknown_bash" | "unknown_tool";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oked/sdk",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "OKed SDK - human approval layer for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -45,7 +45,7 @@
45
45
  "access": "public"
46
46
  },
47
47
  "dependencies": {
48
- "@oked/receipt-core": "0.6.0"
48
+ "@oked/receipt-core": "0.6.1"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/node": "^22.13.10",