opencode-acp 1.18.2-pr.466.203 → 1.18.2-pr.466.206

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/index.js CHANGED
@@ -8439,6 +8439,16 @@ var resolveEffectiveCompressPermission = (basePermission, hostPermissions, agent
8439
8439
  var hasExplicitToolPermission = (permissionConfig, tool6) => {
8440
8440
  return permissionConfig ? Object.prototype.hasOwnProperty.call(permissionConfig, tool6) : false;
8441
8441
  };
8442
+ var anyRuleResolves = (permissionConfig, tool6) => {
8443
+ if (hasExplicitToolPermission(permissionConfig, tool6)) {
8444
+ return true;
8445
+ }
8446
+ const match = findLastMatchingRule(
8447
+ getPermissionRules([permissionConfig]),
8448
+ (rule) => wildcardMatch(tool6, rule.permission)
8449
+ );
8450
+ return match !== void 0;
8451
+ };
8442
8452
  var applyAcpToolPermissions = (permissionConfig, compressPermission2) => {
8443
8453
  if (permissionConfig && hasExplicitToolPermission(permissionConfig, "compress")) {
8444
8454
  return permissionConfig;
@@ -8447,7 +8457,7 @@ var applyAcpToolPermissions = (permissionConfig, compressPermission2) => {
8447
8457
  ...permissionConfig ?? {},
8448
8458
  compress: compressPermission2
8449
8459
  };
8450
- if (!hasExplicitToolPermission(permissionConfig, "acp_status")) {
8460
+ if (!anyRuleResolves(permissionConfig, "acp_status")) {
8451
8461
  next.acp_status = "allow";
8452
8462
  }
8453
8463
  return next;
@@ -11099,7 +11109,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
11099
11109
  import { join as join4 } from "path";
11100
11110
  import { existsSync as existsSync4 } from "fs";
11101
11111
  import { homedir as homedir3 } from "os";
11102
- var LOG_VERSION = true ? "1.18.2-pr.466.203" : "dev";
11112
+ var LOG_VERSION = true ? "1.18.2-pr.466.206" : "dev";
11103
11113
  var LEVEL_RANK = {
11104
11114
  debug: 10,
11105
11115
  info: 20,
@@ -13786,7 +13796,7 @@ var server = (async (ctx) => {
13786
13796
  }
13787
13797
  const logger = new Logger(config.debug, config.debug ? "debug" : config.logLevel);
13788
13798
  logger.info("ACP plugin initialized", {
13789
- version: true ? "1.18.2-pr.466.203" : "dev",
13799
+ version: true ? "1.18.2-pr.466.206" : "dev",
13790
13800
  workspace: ctx.directory,
13791
13801
  logLevel: logger.level,
13792
13802
  debug: config.debug,