agentapprove 0.2.1 → 0.2.2

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 +78 -203
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -2144,122 +2144,6 @@ async function refreshHooksAfterPairing(hooksDir, token, apiUrl, deps) {
2144
2144
  return { filtersRefreshed: !(filters.failed.length || filters.terminalFailure) };
2145
2145
  }
2146
2146
 
2147
- // src/pairing-effective-config.ts
2148
- var PRIVACY_RANK = { minimal: 0, summary: 1, full: 2 };
2149
- var FAIL_RANK = { allow: 0, ask: 1, deny: 2 };
2150
- var SETTING_LABEL = {
2151
- privacyTier: "Privacy level",
2152
- retentionDays: "Data retention",
2153
- failBehavior: "If Agent Approve cannot be reached",
2154
- e2eEnabled: "End-to-end encryption"
2155
- };
2156
- function isPrivacyTier(value) {
2157
- return value === "minimal" || value === "summary" || value === "full";
2158
- }
2159
- function isFailBehavior(value) {
2160
- return value === "allow" || value === "ask" || value === "deny";
2161
- }
2162
- function describeRetention(days) {
2163
- if (days === null)
2164
- return "keep forever";
2165
- return days === 1 ? "1 day" : `${days} days`;
2166
- }
2167
- var DEFAULT_FAIL_BEHAVIOR = "ask";
2168
- var DEFAULT_PRIVACY_TIER = "full";
2169
- function parseEffectivePairingConfig(value) {
2170
- if (!value || typeof value !== "object" || Array.isArray(value))
2171
- return null;
2172
- const candidate = value;
2173
- const parsed = {};
2174
- if (isPrivacyTier(candidate.privacyTier))
2175
- parsed.privacyTier = candidate.privacyTier;
2176
- const retention = candidate.retentionDays;
2177
- if (retention === null || typeof retention === "number" && Number.isFinite(retention) && retention >= 0) {
2178
- parsed.retentionDays = retention;
2179
- }
2180
- if (isFailBehavior(candidate.failBehavior))
2181
- parsed.failBehavior = candidate.failBehavior;
2182
- if (typeof candidate.e2eEnabled === "boolean")
2183
- parsed.e2eEnabled = candidate.e2eEnabled;
2184
- return parsed;
2185
- }
2186
- function reconcilePairingConfig(picks, effective, options = {}) {
2187
- const local = {
2188
- privacyTier: picks.privacyTier,
2189
- retentionDays: picks.retentionDays,
2190
- failBehavior: picks.failBehavior,
2191
- e2eEnabled: picks.e2eEnabled
2192
- };
2193
- const accountKept = [];
2194
- const unknown = [];
2195
- const account = effective ?? {};
2196
- const accountPrivacy = account.privacyTier ?? (isPrivacyTier(options.reportedPrivacy) ? options.reportedPrivacy : undefined);
2197
- if (accountPrivacy === undefined) {
2198
- unknown.push("privacyTier");
2199
- if (PRIVACY_RANK[DEFAULT_PRIVACY_TIER] < PRIVACY_RANK[local.privacyTier])
2200
- local.privacyTier = DEFAULT_PRIVACY_TIER;
2201
- } else if (PRIVACY_RANK[accountPrivacy] < PRIVACY_RANK[picks.privacyTier]) {
2202
- local.privacyTier = accountPrivacy;
2203
- accountKept.push({ setting: "privacyTier", picked: picks.privacyTier, kept: accountPrivacy });
2204
- }
2205
- if (account.retentionDays === undefined) {
2206
- unknown.push("retentionDays");
2207
- } else if (account.retentionDays !== null && account.retentionDays < picks.retentionDays) {
2208
- local.retentionDays = account.retentionDays;
2209
- accountKept.push({
2210
- setting: "retentionDays",
2211
- picked: describeRetention(picks.retentionDays),
2212
- kept: describeRetention(account.retentionDays)
2213
- });
2214
- }
2215
- if (account.failBehavior === undefined) {
2216
- unknown.push("failBehavior");
2217
- if (FAIL_RANK[DEFAULT_FAIL_BEHAVIOR] > FAIL_RANK[local.failBehavior])
2218
- local.failBehavior = DEFAULT_FAIL_BEHAVIOR;
2219
- } else if (FAIL_RANK[account.failBehavior] > FAIL_RANK[picks.failBehavior]) {
2220
- local.failBehavior = account.failBehavior;
2221
- accountKept.push({ setting: "failBehavior", picked: picks.failBehavior, kept: account.failBehavior });
2222
- }
2223
- let encryptionRequired = false;
2224
- if (account.e2eEnabled === undefined) {
2225
- unknown.push("e2eEnabled");
2226
- if (!picks.e2eEnabled && options.localE2eOn === true)
2227
- local.e2eEnabled = true;
2228
- } else if (account.e2eEnabled && !picks.e2eEnabled) {
2229
- encryptionRequired = true;
2230
- accountKept.push({ setting: "e2eEnabled", picked: "off", kept: "on" });
2231
- }
2232
- return { local, accountKept, unknown, encryptionRequired, letAccountWin: unknown.length > 0 };
2233
- }
2234
- function formatAccountKeptWarning(reconciliation) {
2235
- const kept = reconciliation.accountKept.filter((entry) => entry.setting !== "e2eEnabled");
2236
- if (kept.length === 0)
2237
- return null;
2238
- return [
2239
- "Your Agent Approve account kept its stricter settings. This computer now uses them:",
2240
- ...kept.map((entry) => ` ${SETTING_LABEL[entry.setting]}: ${entry.kept} (you chose ${entry.picked})`),
2241
- "You can change account settings in the Agent Approve app."
2242
- ].join(`
2243
- `);
2244
- }
2245
- function formatAccountUnknownNote(reconciliation) {
2246
- if (reconciliation.unknown.length === 0)
2247
- return null;
2248
- const names = reconciliation.unknown.map((setting) => SETTING_LABEL[setting]).join(", ");
2249
- return `This pairing could not confirm your account's value for: ${names}. ` + "This computer uses the safer value for now and picks up your account settings on the next agent event.";
2250
- }
2251
- function formatEncryptionRequiredMessage(rerun) {
2252
- const again = rerun === "pair" ? 'Run "npx agentapprove pair" again and choose an encryption key instead of disabling encryption.' : 'Run "npx agentapprove" again and keep end-to-end encryption on (choose Customize if you are not asked, and do not pass --no-e2e).';
2253
- return [
2254
- "This computer is not set up yet.",
2255
- "Your Agent Approve account has end-to-end encryption turned on, and this setup chose to leave it off.",
2256
- "Pairing a computer cannot turn encryption off for the account, and the encryption key can only be created during setup, so this computer has no key to use.",
2257
- "Nothing from this pairing was saved on this computer. If it was set up before, its earlier pairing has been replaced and will not work until you set it up again.",
2258
- again
2259
- ].join(`
2260
- `);
2261
- }
2262
-
2263
2147
  // src/pair-key-plan.ts
2264
2148
  import { createHash } from "crypto";
2265
2149
  import { existsSync as existsSync3, readFileSync as readFileSync2, renameSync as renameSync2 } from "fs";
@@ -3807,8 +3691,8 @@ async function copyHookScripts(hooksDir, token, files, options) {
3807
3691
  // src/hook-manifest.generated.ts
3808
3692
  var HOOK_SCRIPT_SHA256 = {
3809
3693
  "antigravity-hook.sh": [
3810
- "1ed82442099b7216b9dd3fd6b1e9f2648b5230b528778a374ba7f1d570603d8a",
3811
- "0cfac7fdab920af8b243dc8f0cffcc5355d06cec13a71060f1e77a22487379cf"
3694
+ "1f096235ba308087ad578aabdf2217f3e4f8ba336626ef2b70188f8dd2f24ac9",
3695
+ "1ed82442099b7216b9dd3fd6b1e9f2648b5230b528778a374ba7f1d570603d8a"
3812
3696
  ],
3813
3697
  "background-filter.js": [
3814
3698
  "5850ec58a56474891627e54b4e34255a878b7d21037382296c5512ee6d250d54"
@@ -3823,8 +3707,8 @@ var HOOK_SCRIPT_SHA256 = {
3823
3707
  "8a61253504c99ecdf101b4fa8681a09489f128ef4ba6dcfb47450c881011654e"
3824
3708
  ],
3825
3709
  "claude-pre-tool.sh": [
3826
- "a4bae2a689b075762a11df659b10ca783c1c780af93277efe37a398243fbc8ed",
3827
- "5a317ed1eb620bf5751fbe50ac266295f9a9436a5b5368ff4d5f3ae1e0202f33"
3710
+ "5a317ed1eb620bf5751fbe50ac266295f9a9436a5b5368ff4d5f3ae1e0202f33",
3711
+ "a4bae2a689b075762a11df659b10ca783c1c780af93277efe37a398243fbc8ed"
3828
3712
  ],
3829
3713
  "claude-prompt.sh": [
3830
3714
  "449cffbd8efb1f04f51d67aedb817883cffd20ab99ddff4eb32acfb4d3692080"
@@ -3836,8 +3720,7 @@ var HOOK_SCRIPT_SHA256 = {
3836
3720
  "dc2d906e448d277be0f9b5e1cd1b0bddadd9d5d86f6a0012ffa6e63cb38fb906"
3837
3721
  ],
3838
3722
  "claude-stop.sh": [
3839
- "158629503c11d44d3864c6a4ea5448e5743b4cacc11f0246ef604ce5a4c27830",
3840
- "5dd2f71fb534dda5599af3bdaf44092134460ab46195254a830715d3cdf0936a"
3723
+ "158629503c11d44d3864c6a4ea5448e5743b4cacc11f0246ef604ce5a4c27830"
3841
3724
  ],
3842
3725
  "claude-subagent-start.sh": [
3843
3726
  "93738cd3c3667feae235fd08a44be6381f7e7d6291c102257ae1913917a58d17"
@@ -3852,15 +3735,14 @@ var HOOK_SCRIPT_SHA256 = {
3852
3735
  "b2d6a3352198a79780ace8303b476b37250d020d066d3be0b32719be34cb1198"
3853
3736
  ],
3854
3737
  "codex-pre-tool.sh": [
3855
- "3d1c6b7f8717f7b043d54f79af6225bebffb2baa4f0badde759182c415bcc343",
3856
- "6c44eb3f3774024d26a2d9162b9a91f1ac8c15559a164823f122aa0f423b454f"
3738
+ "6c44eb3f3774024d26a2d9162b9a91f1ac8c15559a164823f122aa0f423b454f",
3739
+ "3d1c6b7f8717f7b043d54f79af6225bebffb2baa4f0badde759182c415bcc343"
3857
3740
  ],
3858
3741
  "codex-session-start.sh": [
3859
3742
  "b14351394abeab95d047d6843e34d52e33758eef1f4f129a31efe6334858db53"
3860
3743
  ],
3861
3744
  "codex-stop.sh": [
3862
- "6c46b605b482a474205d850cec28f35ced74796beedf1f2647a1268fcfa7d45e",
3863
- "e0c3c95605c6f04004c4cb350ee7d997f471a7d07546e2e0b0fec9b9de845cd5"
3745
+ "6c46b605b482a474205d850cec28f35ced74796beedf1f2647a1268fcfa7d45e"
3864
3746
  ],
3865
3747
  "codex-subagent-start.sh": [
3866
3748
  "053caf81244b7510057c307d7dbc35f2190b0c5665dfdae252ae29e98744de4e"
@@ -3872,19 +3754,19 @@ var HOOK_SCRIPT_SHA256 = {
3872
3754
  "0e8886fa08e6c5529721f6e94907c9bad6c32e97c1f4827e2ef5270f349cce4f"
3873
3755
  ],
3874
3756
  "common.sh": [
3875
- "626da6d015a3686cc4ba9b578ec19e378f18156c5fa0b11fdd10250908ba47da",
3876
- "dba7e22eb923e22054a776eb2a5cbf958acf5b55f83d49b685eef3cac1ce30e6"
3757
+ "e9878d93113337bd49ccfbc34f57aed38f0f93dad77eebe5b981adfe10ef82f2",
3758
+ "626da6d015a3686cc4ba9b578ec19e378f18156c5fa0b11fdd10250908ba47da"
3877
3759
  ],
3878
3760
  "completion-hook.sh": [
3879
3761
  "ec94b799c35cd650b79d50f223bd57e817fed5d7e379aac5948e06f14ad7b31a"
3880
3762
  ],
3881
3763
  "cursor-approval.sh": [
3882
- "547e056485093ff9071a5c45326dfaf1320918495c54908f7413d7f6c7a9422f",
3883
- "cd831b97a0631202275d98925be1401b0b8915d4cf90783e158d05fea813cdfd"
3764
+ "66321a6409dbc77bbd9c83781b5112c4eb8e9139c62ce6e7952cb886d33ee996",
3765
+ "547e056485093ff9071a5c45326dfaf1320918495c54908f7413d7f6c7a9422f"
3884
3766
  ],
3885
3767
  "cursor-mcp-approval.sh": [
3886
- "e5638dde8b7767ff4e3c0a361dec27fe49fa63048ea06952bb602b98e8abb80d",
3887
- "801cff771a4640a77d5c07e1d0c45038333650ceb3e169cf0b8c0d1eda22add9"
3768
+ "1d54625606519a8d1f763631aee8d2e9a92aede7b9619a9882174c0bc1059bb9",
3769
+ "e5638dde8b7767ff4e3c0a361dec27fe49fa63048ea06952bb602b98e8abb80d"
3888
3770
  ],
3889
3771
  "cursor-mcp-complete.sh": [
3890
3772
  "0c7131db3e9007dc1e614cd5a132f08f4ee60030d48c0ee3fcb48074ae37c37b"
@@ -3893,8 +3775,8 @@ var HOOK_SCRIPT_SHA256 = {
3893
3775
  "44971e10d711667a659a493f062cadb4d44545c42aec0bbd24ad3821cfb27594"
3894
3776
  ],
3895
3777
  "cursor-pre-tool.sh": [
3896
- "87ed62e2d5976b1c04337b2407f73f86d039751a12a3803ca2f8db1ca3a10446",
3897
- "d5e397a1a33d300c61ef1afea4208927b3d1cfc292a67bd2b8084dbf718acc52"
3778
+ "41e804015779822adec39cf62efb0a71e055f83e56622612e6f39f0a80422906",
3779
+ "87ed62e2d5976b1c04337b2407f73f86d039751a12a3803ca2f8db1ca3a10446"
3898
3780
  ],
3899
3781
  "cursor-precompact.sh": [
3900
3782
  "33faedfd07999296911aa9080a2799938493114ad29878db025d6c42db418f83"
@@ -3915,8 +3797,7 @@ var HOOK_SCRIPT_SHA256 = {
3915
3797
  "23895ab6d2ecaa9fe278b3fb9d53b21418edd7cfac5116d53bd659d4ecbabae3"
3916
3798
  ],
3917
3799
  "cursor-stop.sh": [
3918
- "052c9de32572aeb8b5c9d27313cd20a27790a2250ce3c9aeb8e7356a755c5de3",
3919
- "9fdb148a495a80173a5c8a627cd5f22e02d824ee5cc5e955e13bb5f0dce53d82"
3800
+ "052c9de32572aeb8b5c9d27313cd20a27790a2250ce3c9aeb8e7356a755c5de3"
3920
3801
  ],
3921
3802
  "cursor-subagent-start.sh": [
3922
3803
  "b614d1619331b2a900046efdf65eb5d759fb301d2aa7a115f0b107b1b41b3eb9"
@@ -3943,8 +3824,8 @@ var HOOK_SCRIPT_SHA256 = {
3943
3824
  "b074d767fe5e211a7f6434db1d2b02c6761df73b01f8defa703691cd1d986485"
3944
3825
  ],
3945
3826
  "gemini-before-tool.sh": [
3946
- "65c12342fd73cd200c6b6934b3742390e2f2d16524f9d643889c6b1107762ca9",
3947
- "222623ee4dd6ddd592d8aa0bcf3553d1acda3a2543cf6528bb3cabb50d2cb593"
3827
+ "222623ee4dd6ddd592d8aa0bcf3553d1acda3a2543cf6528bb3cabb50d2cb593",
3828
+ "65c12342fd73cd200c6b6934b3742390e2f2d16524f9d643889c6b1107762ca9"
3948
3829
  ],
3949
3830
  "gemini-notification.sh": [
3950
3831
  "5978c5d4b689f2e87131d9950b50588a4aa74390b548a43c3ea6e607fe407e16"
@@ -3956,8 +3837,7 @@ var HOOK_SCRIPT_SHA256 = {
3956
3837
  "5d1113f25accd644c82e21bbc7efc56739f549b6b8227bd8874afc6500112b46"
3957
3838
  ],
3958
3839
  "gemini-stop.sh": [
3959
- "da82707cd945b2307efa0a137e54f3dc9a630b2d02a5056d676ad49712f8534f",
3960
- "dbf663489b778e8be2665f48ad601b99d43ae2462c43936276cb354505870ad8"
3840
+ "da82707cd945b2307efa0a137e54f3dc9a630b2d02a5056d676ad49712f8534f"
3961
3841
  ],
3962
3842
  "github-error.sh": [
3963
3843
  "e4dd8874cb837727c795a095ea5829eaa9d350ef65ab4c9fb802334558c44859"
@@ -3966,8 +3846,8 @@ var HOOK_SCRIPT_SHA256 = {
3966
3846
  "e057c5f624d7d4998ea59ef524b97b2364f860477a6aadd2512d562cdecfc6c2"
3967
3847
  ],
3968
3848
  "github-pre-tool.sh": [
3969
- "1066e08beb1ff864a8075cf9cd77ab1b64e5913f30675edd97cbb58e5fa05a7b",
3970
- "a331d5980824db7ca38a586f5f6398627b6653397eb4d5bcd19b18a293479c38"
3849
+ "a331d5980824db7ca38a586f5f6398627b6653397eb4d5bcd19b18a293479c38",
3850
+ "1066e08beb1ff864a8075cf9cd77ab1b64e5913f30675edd97cbb58e5fa05a7b"
3971
3851
  ],
3972
3852
  "github-precompact.sh": [
3973
3853
  "f34011aa926611fe8691ef24250ab22561ff6c0387d3e3527e52d44c7aac6f44"
@@ -3979,8 +3859,7 @@ var HOOK_SCRIPT_SHA256 = {
3979
3859
  "505f44ed4ca6345b8e9ff8a328198ed6141d4774a630821b984ab5cf4c3954ff"
3980
3860
  ],
3981
3861
  "github-stop.sh": [
3982
- "07f2d802700cf7ace009207aaa3f9c96e4e5943c022faa9601d9b85277e50fa4",
3983
- "3f4d12832b22be48d708eb70f1bcb00d4c437a19c898e17a0989ab29d3efe4b4"
3862
+ "07f2d802700cf7ace009207aaa3f9c96e4e5943c022faa9601d9b85277e50fa4"
3984
3863
  ],
3985
3864
  "github-subagent-start.sh": [
3986
3865
  "506e39c02806ca20e8a3605a0de3eb089d9ef98d3556ceb675a70433ea313889"
@@ -3992,16 +3871,16 @@ var HOOK_SCRIPT_SHA256 = {
3992
3871
  "67ac8e7c33991402cc2dfcaf6b3380ba50b92cf224fcb447c2bb39cbd7c7a1a8"
3993
3872
  ],
3994
3873
  "notify-hook.sh": [
3995
- "0892b3f3b71b8f7df08917ad4f38baac1655093a38f5d43238aca49b9f0554a1",
3996
- "04013b4988d2d663279f6e75838244aad16247ccec7c37df1c4b5c4413505a05"
3874
+ "a222c9f656da5c9b0c6cb9998ddb6dd07608cabacef2931d542d68b04075632b",
3875
+ "0892b3f3b71b8f7df08917ad4f38baac1655093a38f5d43238aca49b9f0554a1"
3997
3876
  ],
3998
3877
  "openhands-hook.sh": [
3999
- "ebdb17e34918e6e58e9ab70e2db9521f25b1907f9cd96d78d217074db64fc566",
4000
- "f1c09c383891d2dd0048f74ab5c71a3d1a027d2a50a75ac1dc0cdee72c9772f2"
3878
+ "28cacd77360c53fdb7b095403dfc43c7b7cf83ff718ac85f7f1a9042652bd8c0",
3879
+ "ebdb17e34918e6e58e9ab70e2db9521f25b1907f9cd96d78d217074db64fc566"
4001
3880
  ],
4002
3881
  "windsurf-hook.sh": [
4003
- "16a73925f6a2b2fb3a9e29166316519bb5f5afd05bbed0df80513b004434ebd8",
4004
- "94753235d4de704a9a0399f734912000e23f9cd15ee1e494f584a0b49ebfda24"
3882
+ "b7e85df3b6188cd1dfd6b2eb904185e41b627e077a265eaa6bb88a804323b47d",
3883
+ "16a73925f6a2b2fb3a9e29166316519bb5f5afd05bbed0df80513b004434ebd8"
4005
3884
  ]
4006
3885
  };
4007
3886
 
@@ -4042,6 +3921,32 @@ function enableHermesFollowUp(profile, run = (file, args) => runHostCommand(file
4042
3921
  ]);
4043
3922
  }
4044
3923
 
3924
+ // src/hermes-hook-timeout.ts
3925
+ var HERMES_HOST_HOOK_TIMEOUT_SECONDS = 600;
3926
+ var TIMEOUT_KEY = "plugins.hook_callback_timeout";
3927
+ function ensureHermesHookTimeout(profile, run = runHostCommand) {
3928
+ if (!/^[a-z0-9][a-z0-9_-]{0,63}$/.test(profile)) {
3929
+ throw new Error("Invalid Hermes profile name");
3930
+ }
3931
+ const prefix = profile === "default" ? [] : ["-p", profile];
3932
+ let current;
3933
+ try {
3934
+ current = JSON.parse(run("hermes", [...prefix, "config", "get", TIMEOUT_KEY, "--json"]));
3935
+ } catch (error) {
3936
+ const failure = error;
3937
+ const stderr = typeof failure?.stderr === "string" ? failure.stderr : Buffer.isBuffer(failure?.stderr) ? failure.stderr.toString("utf8") : "";
3938
+ if (failure?.status === 1 && stderr.split(/\r?\n/).some((line) => line.trim() === `Config key not set: ${TIMEOUT_KEY}`))
3939
+ return;
3940
+ if (failure?.status === 2 && stderr.includes("argument config_command: invalid choice: 'get'"))
3941
+ return;
3942
+ throw new Error(`Could not read Hermes hook timeout for profile ${profile}. Check hermes ${profile === "default" ? "" : `-p ${profile} `}config get ${TIMEOUT_KEY} --json before retrying setup.`);
3943
+ }
3944
+ const value = typeof current === "number" ? current : typeof current === "string" && current.trim() !== "" ? Number(current) : NaN;
3945
+ if (Number.isFinite(value) && (value === 0 || value >= HERMES_HOST_HOOK_TIMEOUT_SECONDS))
3946
+ return;
3947
+ run("hermes", [...prefix, "config", "set", TIMEOUT_KEY, String(HERMES_HOST_HOOK_TIMEOUT_SECONDS)]);
3948
+ }
3949
+
4045
3950
  // src/pairing-api-url.ts
4046
3951
  function looksLikeHostedAgentApproveApi(baseUrl) {
4047
3952
  try {
@@ -4123,7 +4028,7 @@ Configured on this computer: ${ready.join(", ")}. Nothing was changed.`);
4123
4028
  }
4124
4029
 
4125
4030
  // src/cli.ts
4126
- var VERSION = "0.2.1";
4031
+ var VERSION = "0.2.2";
4127
4032
  function getApiUrl() {
4128
4033
  return process.env.AGENTAPPROVE_API || "https://api.agentapprove.com";
4129
4034
  }
@@ -4162,14 +4067,14 @@ function getCommand() {
4162
4067
  }
4163
4068
  return filtered[0] || "install";
4164
4069
  }
4165
- var OPENCODE_PLUGIN_VERSION = "0.1.27";
4070
+ var OPENCODE_PLUGIN_VERSION = "0.1.28";
4166
4071
  var OPENCODE_PLUGIN_SPEC = `@agentapprove/opencode@${OPENCODE_PLUGIN_VERSION}`;
4167
- var OPENCLAW_PLUGIN_VERSION = "0.2.22";
4072
+ var OPENCLAW_PLUGIN_VERSION = "0.2.23";
4168
4073
  var OPENCLAW_PLUGIN_SPEC = `@agentapprove/openclaw@${OPENCLAW_PLUGIN_VERSION}`;
4169
- var PI_PLUGIN_VERSION = "0.1.15";
4074
+ var PI_PLUGIN_VERSION = "0.1.16";
4170
4075
  var PI_PLUGIN_SPEC = `npm:@agentapprove/pi@${PI_PLUGIN_VERSION}`;
4171
4076
  var PI_STATUS_TIMEOUT_MS = 5000;
4172
- var HERMES_PLUGIN_VERSION = "0.1.17";
4077
+ var HERMES_PLUGIN_VERSION = "0.1.18";
4173
4078
  var HERMES_PIP_DEPS = ["cryptography>=44.0,<46", "httpx>=0.27,<0.29"];
4174
4079
  var AGENTS = {
4175
4080
  "claude-code": {
@@ -5261,8 +5166,7 @@ async function waitForPairing(sessionCode, onProgress, onCancel, apiBaseUrl = AP
5261
5166
  privacy: result.privacy || "full",
5262
5167
  email: result.email || "",
5263
5168
  apiUrl: result.apiUrl || apiBaseUrl,
5264
- e2eServerKey: result.e2eServerKey,
5265
- effectiveConfig: parseEffectivePairingConfig(result.effectiveConfig)
5169
+ e2eServerKey: result.e2eServerKey
5266
5170
  };
5267
5171
  }
5268
5172
  if (result.status === "expired") {
@@ -6360,7 +6264,7 @@ function removePiPluginViaCli() {
6360
6264
  };
6361
6265
  }
6362
6266
  }
6363
- var HERMES_BUNDLE_SHA256 = "e17bf4464d2f1d20c9153596a62409a88c9e5ce79312c5313d6b9e8ea721054a";
6267
+ var HERMES_BUNDLE_SHA256 = "f0013d5a39281e9faa8ffe9ebfac0f40eb1777ef971f0cd0e55d6ebf9cf44244";
6364
6268
  var HERMES_BUNDLE_FILENAME = `agentapprove-hermes-${HERMES_PLUGIN_VERSION}.tar.gz`;
6365
6269
  var HERMES_PLUGIN_DIR = join3(homedir(), ".hermes", "plugins", "agentapprove");
6366
6270
  function findPython() {
@@ -6637,6 +6541,7 @@ function stageHermesBundle(bytes, targetDir) {
6637
6541
  }
6638
6542
  function enableHermesPluginForProfile(profile) {
6639
6543
  try {
6544
+ ensureHermesHookTimeout(profile);
6640
6545
  enableHermesFollowUp(profile);
6641
6546
  runHostCommand("hermes", [...profile === HERMES_DEFAULT_PROFILE ? [] : ["-p", profile], "plugins", "enable", "agentapprove"], { interactive: true, timeoutMs: PACKAGE_INSTALL_TIMEOUT_MS });
6642
6547
  return { success: true };
@@ -7200,7 +7105,6 @@ Monitor activity, enforce policy, and approve with a tap.`, "About");
7200
7105
  const hooksDir = join3(getAgentApproveDir(), "hooks");
7201
7106
  const selectedInstallConfig = getInitialInstallConfig(setupProfile, existingConfig);
7202
7107
  let token = null;
7203
- let pairingOutcome = null;
7204
7108
  let finalPrivacy = selectedInstallConfig.privacy;
7205
7109
  let email = "";
7206
7110
  let apiUrl = pairingApiBase;
@@ -7448,20 +7352,10 @@ Monitor activity, enforce policy, and approve with a tap.`, "About");
7448
7352
  he("Installation cancelled");
7449
7353
  process.exit(0);
7450
7354
  } else if (result) {
7451
- pairingOutcome = reconcilePairingConfig(pairingConfig, result.effectiveConfig, {
7452
- reportedPrivacy: result.privacy,
7453
- localE2eOn: existingConfig?.e2eEnabled !== false && existsSync5(existingKeyPath)
7454
- });
7455
- if (pairingOutcome.encryptionRequired) {
7456
- pairingSpinner.stop("Paired, but this computer is not set up");
7457
- v2.error(formatEncryptionRequiredMessage("install"));
7458
- he("Setup is not finished.");
7459
- process.exit(1);
7460
- }
7461
7355
  token = result.token;
7462
- finalPrivacy = pairingOutcome.local.privacyTier;
7463
- retentionDays = pairingOutcome.local.retentionDays;
7464
- failBehavior = pairingOutcome.local.failBehavior;
7356
+ if (["minimal", "summary", "full"].includes(result.privacy)) {
7357
+ finalPrivacy = result.privacy;
7358
+ }
7465
7359
  email = result.email;
7466
7360
  apiUrl = result.apiUrl || pairingApiBase;
7467
7361
  if (backupOldKeyTo) {
@@ -7490,12 +7384,6 @@ Monitor activity, enforce policy, and approve with a tap.`, "About");
7490
7384
  }
7491
7385
  const connectedMsg = email ? `Connected! Account: ${email}, Privacy: ${finalPrivacy}` : `Connected! Privacy: ${finalPrivacy}`;
7492
7386
  pairingSpinner.stop(connectedMsg);
7493
- const keptWarning = formatAccountKeptWarning(pairingOutcome);
7494
- if (keptWarning)
7495
- v2.warn(keptWarning);
7496
- const unknownNote = formatAccountUnknownNote(pairingOutcome);
7497
- if (unknownNote)
7498
- v2.info(unknownNote);
7499
7387
  } else {
7500
7388
  pairingSpinner.stop("Session expired");
7501
7389
  he("Session expired. Please try again.");
@@ -7519,8 +7407,8 @@ Monitor activity, enforce policy, and approve with a tap.`, "About");
7519
7407
  privacy: finalPrivacy,
7520
7408
  retentionDays,
7521
7409
  debugLog,
7522
- configSetAt: installPreservation.letAccountWin || pairingOutcome?.letAccountWin ? 0 : configSetAt,
7523
- e2eEnabled: pairingOutcome ? pairingOutcome.local.e2eEnabled : useE2E,
7410
+ configSetAt: installPreservation.letAccountWin ? 0 : configSetAt,
7411
+ e2eEnabled: useE2E,
7524
7412
  failBehavior,
7525
7413
  preserved: installPreservation.preserved
7526
7414
  });
@@ -7730,7 +7618,9 @@ Timestamped backups will be created.`);
7730
7618
  ` + ` 5. pip install --user cryptography httpx
7731
7619
  ` + ` (uv-managed Python: uv pip install --system --break-system-packages --python $(which python3.12) cryptography httpx)
7732
7620
  ` + ` 6. hermes config set plugins.entries.agentapprove.allow_gateway_injection true
7733
- ` + ` 7. hermes plugins enable agentapprove
7621
+ ` + ` 7. hermes config set plugins.hook_callback_timeout 600
7622
+ ` + ` (For a named profile add -p <profile> after hermes; skip if already 0/unlimited.)
7623
+ ` + ` 8. hermes plugins enable agentapprove
7734
7624
  ` + ` Then re-run: npx agentapprove`);
7735
7625
  } else if (result.error) {
7736
7626
  v2.warn(`${agent.name} was not set up.
@@ -8977,18 +8867,9 @@ async function pairCommand() {
8977
8867
  v2.error('Session expired. Run "npx agentapprove pair" to try again.');
8978
8868
  process.exit(1);
8979
8869
  }
8980
- const pairOutcome = reconcilePairingConfig(pairingConfig, result.effectiveConfig, {
8981
- reportedPrivacy: result.privacy,
8982
- localE2eOn: existingConfig?.e2eEnabled !== false && keys.some((k) => k.isCurrent)
8983
- });
8984
- if (pairOutcome.encryptionRequired) {
8985
- pairingSpinner.stop("Paired, but this computer is not set up");
8986
- v2.error(formatEncryptionRequiredMessage("pair"));
8987
- he("Pairing is not finished.");
8988
- process.exit(1);
8989
- }
8990
8870
  pairingSpinner.stop(`Paired! ${result.email ? `Account: ${result.email}` : ""}`);
8991
- ensureAgentApproveDir();
8871
+ if (keyPlan.kind === "generate")
8872
+ ensureAgentApproveDir();
8992
8873
  const keyResult = applyPairKeyPlan(keyPlan, getAgentApproveDir(), {
8993
8874
  serverKey: result.e2eServerKey,
8994
8875
  rotation: { read: readRotationConfig, write: writeRotationConfig },
@@ -9008,22 +8889,16 @@ async function pairCommand() {
9008
8889
  saveEnvConfig({
9009
8890
  apiUrl,
9010
8891
  token: result.token,
9011
- privacy: pairOutcome.local.privacyTier,
9012
- retentionDays: pairOutcome.local.retentionDays,
8892
+ privacy: existingConfig?.privacy || result.privacy || "full",
8893
+ retentionDays: existingConfig?.retentionDays ?? 30,
9013
8894
  debugLog: existingConfig?.debugLog,
9014
8895
  e2eMode: existingConfig?.e2eMode,
9015
- e2eEnabled: pairOutcome.local.e2eEnabled,
9016
- failBehavior: pairOutcome.local.failBehavior,
9017
- configSetAt: pairPreservation.letAccountWin || pairOutcome.letAccountWin ? 0 : configSetAt,
8896
+ e2eEnabled: !!e2eUserKey,
8897
+ failBehavior: existingConfig?.failBehavior || "ask",
8898
+ configSetAt: pairPreservation.letAccountWin ? 0 : configSetAt,
9018
8899
  preserved: pairPreservation.preserved
9019
8900
  });
9020
8901
  await storeTokenInKeychain(result.token);
9021
- const pairKeptWarning = formatAccountKeptWarning(pairOutcome);
9022
- if (pairKeptWarning)
9023
- v2.warn(pairKeptWarning);
9024
- const pairUnknownNote = formatAccountUnknownNote(pairOutcome);
9025
- if (pairUnknownNote)
9026
- v2.info(pairUnknownNote);
9027
8902
  const hooksDir = join3(getAgentApproveDir(), "hooks");
9028
8903
  if (existsSync5(hooksDir)) {
9029
8904
  const updateSpinner = _2();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentapprove",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "AI agent observability and control from your iPhone or Apple Watch",
5
5
  "type": "module",
6
6
  "bin": {