approval-box 0.1.29 → 0.1.30

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/cli.mjs +11 -9
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -11927,7 +11927,7 @@ function requireConfig() {
11927
11927
  if (!config?.token) throw new Error("Approval Box\u306B\u3064\u306A\u304C\u3063\u3066\u3044\u307E\u305B\u3093\u3002npx approval-box setup \u3092\u5B9F\u884C\u3057\u3066\u304F\u3060\u3055\u3044\u3002");
11928
11928
  return config;
11929
11929
  }
11930
- function writeJsonFile(file, value) {
11930
+ function writeJsonFile(file, value, options = {}) {
11931
11931
  mkdirSync(dirname(file), { recursive: true, mode: 448 });
11932
11932
  const temp = `${file}.${process.pid}.tmp`;
11933
11933
  try {
@@ -11935,10 +11935,12 @@ function writeJsonFile(file, value) {
11935
11935
  `, { mode: 384 });
11936
11936
  renameSync(temp, file);
11937
11937
  } catch (error) {
11938
- try {
11939
- rmSync(temp, { force: true });
11940
- } catch {
11941
- process.stderr.write("approval-box: \u4FDD\u5B58\u306B\u5931\u6557\u3057\u305F\u4E00\u6642\u30D5\u30A1\u30A4\u30EB\u3092\u56DE\u53CE\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\n");
11938
+ if (options.discardTemporaryOnError) {
11939
+ try {
11940
+ rmSync(temp, { force: true });
11941
+ } catch {
11942
+ process.stderr.write("approval-box: \u4FDD\u5B58\u306B\u5931\u6557\u3057\u305F\u4E00\u6642\u30D5\u30A1\u30A4\u30EB\u3092\u56DE\u53CE\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002\n");
11943
+ }
11942
11944
  }
11943
11945
  throw error;
11944
11946
  }
@@ -12441,7 +12443,7 @@ function setCursorPermissions(enable) {
12441
12443
  const ours = new Set(CURSOR_TOOLS.map((tool) => `Mcp(${MCP_SERVER}:${tool})`));
12442
12444
  const allow = (permissions.allow ?? []).filter((rule) => !ours.has(rule));
12443
12445
  if (enable) allow.push(...ours);
12444
- writeJsonFile(file, { ...current, permissions: { ...permissions, allow, deny: permissions.deny ?? [] } });
12446
+ writeJsonFile(file, { ...current, permissions: { ...permissions, allow, deny: permissions.deny ?? [] } }, { discardTemporaryOnError: true });
12445
12447
  }
12446
12448
  var CURSOR_CONTEXT = "cursor-context";
12447
12449
  function setCursorContext(enable) {
@@ -12456,7 +12458,7 @@ function setCursorContext(enable) {
12456
12458
  if (enable) rest.push({ command: `${cursorParentHookCommand({ command: stableNode(), script: runtimeEntry("cli") })} ${CURSOR_CONTEXT}`, timeout: 10 });
12457
12459
  if (rest.length) hooks.sessionStart = rest;
12458
12460
  else delete hooks.sessionStart;
12459
- writeJsonFile(target, { version: 1, ...current, hooks });
12461
+ writeJsonFile(target, { version: 1, ...current, hooks }, { discardTemporaryOnError: true });
12460
12462
  }
12461
12463
  var cursorContextRegistered = () => JSON.stringify(readJson(join7(cursorDir(), "hooks.json")).hooks ?? {}).includes(` ${CURSOR_CONTEXT}"`);
12462
12464
  var registration = () => ({ command: stableNode(), args: [runtimeEntry("cli"), "mcp"] });
@@ -12474,7 +12476,7 @@ function setMcpJson(file, value) {
12474
12476
  const servers = { ...current.mcpServers ?? {} };
12475
12477
  if (value) servers[MCP_SERVER] = value;
12476
12478
  else delete servers[MCP_SERVER];
12477
- writeJsonFile(file, { ...current, mcpServers: servers });
12479
+ writeJsonFile(file, { ...current, mcpServers: servers }, { discardTemporaryOnError: true });
12478
12480
  }
12479
12481
  async function withCodexConfig(fn) {
12480
12482
  return withCodexReceiver(PROFILE, { thread_id: "00000000-0000-4000-8000-000000000000", codex_home: codexHome() }, fn);
@@ -16026,7 +16028,7 @@ function claudeChannelIsCurrent(profile, channelId, parent) {
16026
16028
  }
16027
16029
 
16028
16030
  // src/version.ts
16029
- var VERSION = true ? "0.1.29" : "0.0.0-dev";
16031
+ var VERSION = true ? "0.1.30" : "0.0.0-dev";
16030
16032
  function osName() {
16031
16033
  return process.platform === "darwin" ? "macos" : process.platform === "win32" ? "windows" : process.platform;
16032
16034
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "approval-box",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "Approval Box connector: lets Claude Code, Codex, Cursor and Grok ask you for a decision, and steers your answer back into the same session.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://approval-box.kitepon.dev",