opencode-acp 1.18.1-pr.416.176 → 1.18.1-pr.416.178

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
@@ -9657,7 +9657,7 @@ async function resolveSafeToFileTarget(targetPath, options) {
9657
9657
  } catch {
9658
9658
  }
9659
9659
  }
9660
- const physicallyAllowed = realAllowedDirs.every((dir) => !containsOrIs(join4(dir), physicalPath) === false) && realAllowedDirs.some((dir) => containsOrIs(join4(dir), physicalPath));
9660
+ const physicallyAllowed = realAllowedDirs.some((dir) => containsOrIs(dir, physicalPath));
9661
9661
  if (!physicallyAllowed) {
9662
9662
  return {
9663
9663
  ok: false,
@@ -9916,18 +9916,22 @@ function createDecompressTool(factoryCtx) {
9916
9916
  }
9917
9917
  const blockMessages = rawMessages.filter((m) => msgIdSet.has(extractMessageId(m)));
9918
9918
  const lines2 = blockMessages.map(extractMessageText2);
9919
- const fileContent = lines2.length > 0 ? lines2.join("\n\n---\n\n") : targets[0]?.blocks[0]?.summary ?? "(no content available)";
9920
9919
  const fsp2 = await import("fs/promises");
9921
9920
  const { constants } = await import("fs");
9921
+ const fileContent = lines2.length > 0 ? lines2.join("\n\n---\n\n") : targets[0]?.blocks[0]?.summary ?? "(no content available)";
9922
9922
  const flags = constants.O_WRONLY | constants.O_CREAT | constants.O_TRUNC | (process.platform === "win32" ? 0 : constants.O_NOFOLLOW);
9923
- const handle = await fsp2.open(safe.filePath, flags, 384);
9924
9923
  try {
9925
- await handle.writeFile(fileContent, "utf-8");
9926
- } finally {
9927
- await handle.close();
9924
+ const handle = await fsp2.open(safe.filePath, flags, 384);
9925
+ try {
9926
+ await handle.write(Buffer.from(fileContent, "utf-8"));
9927
+ } finally {
9928
+ await handle.close();
9929
+ }
9930
+ } catch (err) {
9931
+ return `Error: toFile write failed: ${err.message}`;
9928
9932
  }
9929
9933
  const displayIds2 = targets.map((t) => `b${t.displayId}`).join(", ");
9930
- return `Block(s) ${displayIds2} content (${blockMessages.length} messages, ${fileContent.length} chars) written to ${targetPath}. Block(s) stay compressed \u2014 context unchanged. Use read tool to access specific parts.`;
9934
+ return `Block(s) ${displayIds2} content (${blockMessages.length} messages, ${fileContent.length} chars) written to ${safe.filePath}. Block(s) stay compressed \u2014 context unchanged. Use read tool to access specific parts.`;
9931
9935
  }
9932
9936
  const activeMessagesBefore = snapshotActiveMessages(messagesState);
9933
9937
  const activeBlockIdsBefore = new Set(messagesState.activeBlockIds);
@@ -10670,7 +10674,7 @@ import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
10670
10674
  import { join as join5 } from "path";
10671
10675
  import { existsSync as existsSync4 } from "fs";
10672
10676
  import { homedir as homedir4 } from "os";
10673
- var LOG_VERSION = true ? "1.18.1-pr.416.176" : "dev";
10677
+ var LOG_VERSION = true ? "1.18.1-pr.416.178" : "dev";
10674
10678
  var LEVEL_RANK = {
10675
10679
  debug: 10,
10676
10680
  info: 20,
@@ -13354,7 +13358,7 @@ var server = (async (ctx) => {
13354
13358
  }
13355
13359
  const logger = new Logger(config.debug, config.debug ? "debug" : config.logLevel);
13356
13360
  logger.info("ACP plugin initialized", {
13357
- version: true ? "1.18.1-pr.416.176" : "dev",
13361
+ version: true ? "1.18.1-pr.416.178" : "dev",
13358
13362
  workspace: ctx.directory,
13359
13363
  logLevel: logger.level,
13360
13364
  debug: config.debug,