agentapprove 0.1.7 → 0.1.8

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.js +22 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -5,15 +5,29 @@ var __getProtoOf = Object.getPrototypeOf;
5
5
  var __defProp = Object.defineProperty;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ function __accessProp(key) {
9
+ return this[key];
10
+ }
11
+ var __toESMCache_node;
12
+ var __toESMCache_esm;
8
13
  var __toESM = (mod, isNodeMode, target) => {
14
+ var canCache = mod != null && typeof mod === "object";
15
+ if (canCache) {
16
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
17
+ var cached = cache.get(mod);
18
+ if (cached)
19
+ return cached;
20
+ }
9
21
  target = mod != null ? __create(__getProtoOf(mod)) : {};
10
22
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
11
23
  for (let key of __getOwnPropNames(mod))
12
24
  if (!__hasOwnProp.call(to, key))
13
25
  __defProp(to, key, {
14
- get: () => mod[key],
26
+ get: __accessProp.bind(mod, key),
15
27
  enumerable: true
16
28
  });
29
+ if (canCache)
30
+ cache.set(mod, to);
17
31
  return to;
18
32
  };
19
33
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
@@ -3134,6 +3148,9 @@ async function installHooksForAgent(agentId, hooksDir, mode = "approval") {
3134
3148
  }
3135
3149
  installedHooks.push(hook.name);
3136
3150
  } else if (agentId === "cursor") {
3151
+ if (typeof config["version"] !== "number") {
3152
+ config["version"] = 1;
3153
+ }
3137
3154
  const existing = hooksConfig[hook.name];
3138
3155
  const needsStopTimeout = hook.name === "stop" || hook.name === "subagentStop";
3139
3156
  const isApproval = hook.isApprovalHook;
@@ -3224,7 +3241,9 @@ async function installHooksForAgent(agentId, hooksDir, mode = "approval") {
3224
3241
  hooksConfig[hook.name] = cleanedArray;
3225
3242
  installedHooks.push(hook.name);
3226
3243
  } else if (agentId === "copilot-cli") {
3227
- config["version"] = 1;
3244
+ if (typeof config["version"] !== "number") {
3245
+ config["version"] = 1;
3246
+ }
3228
3247
  if (!hooksConfig[hook.name]) {
3229
3248
  hooksConfig[hook.name] = [];
3230
3249
  }
@@ -3357,7 +3376,7 @@ function getManualInstructions(agentId, hooksDir) {
3357
3376
  }
3358
3377
  hooksObj[hook.name] = [entry];
3359
3378
  }
3360
- return JSON.stringify({ hooks: hooksObj }, null, 2);
3379
+ return JSON.stringify({ version: 1, hooks: hooksObj }, null, 2);
3361
3380
  } else if (agentId === "gemini-cli") {
3362
3381
  const hooksObj = {};
3363
3382
  for (const hook of agent.hooks) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentapprove",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Approve AI agent actions from your iPhone or Apple Watch",
5
5
  "type": "module",
6
6
  "bin": {