honeybook-mcp 0.3.1 → 0.3.3

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.
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "metadata": {
9
9
  "description": "HoneyBook client-portal tools for Claude Code",
10
- "version": "0.3.1"
10
+ "version": "0.3.3"
11
11
  },
12
12
  "plugins": [
13
13
  {
@@ -15,7 +15,7 @@
15
15
  "displayName": "HoneyBook",
16
16
  "source": "./",
17
17
  "description": "HoneyBook client-portal MCP for Claude — view wedding-vendor contracts and invoices via MCP",
18
- "version": "0.3.1",
18
+ "version": "0.3.3",
19
19
  "author": {
20
20
  "name": "Chris Chall"
21
21
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "honeybook",
3
3
  "displayName": "HoneyBook",
4
- "version": "0.3.1",
4
+ "version": "0.3.3",
5
5
  "description": "HoneyBook client-portal MCP for Claude — view wedding-vendor contracts and invoices via MCP",
6
6
  "author": {
7
7
  "name": "Chris Chall",
package/dist/auth.js CHANGED
@@ -56,33 +56,13 @@
56
56
  // - Persistence (sessionStore.add) is the existing side effect; tests
57
57
  // verify the captured session round-trips through sessionStore.get.
58
58
  import { bootstrap } from '@fetchproxy/bootstrap';
59
- import { classifyBridgeError } from '@fetchproxy/server';
59
+ import { bridgeErrorInfo } from '@chrischall/mcp-utils/fetchproxy';
60
+ import { parseBoolEnv } from '@chrischall/mcp-utils';
60
61
  import pkg from '../package.json' with { type: 'json' };
61
62
  import { sessionStore, normalizeOrigin } from './sessions.js';
62
- /**
63
- * Read an env var, trim, and treat blank / `${UNEXPANDED}` placeholders as
64
- * unset. Defends against MCP hosts that pass `.mcp.json` env blocks through
65
- * without variable expansion.
66
- */
67
- function readEnv(key) {
68
- const raw = process.env[key];
69
- if (typeof raw !== 'string')
70
- return undefined;
71
- const trimmed = raw.trim();
72
- if (trimmed.length === 0)
73
- return undefined;
74
- if (trimmed === 'undefined' || trimmed === 'null')
75
- return undefined;
76
- if (/^\$\{[^}]*\}$/.test(trimmed))
77
- return undefined;
78
- return trimmed;
79
- }
80
63
  /** True if the user has explicitly disabled the fetchproxy capture path. */
81
64
  function fetchproxyDisabled() {
82
- const raw = readEnv('HONEYBOOK_DISABLE_FETCHPROXY');
83
- if (raw === undefined)
84
- return false;
85
- return ['1', 'true', 'yes', 'on'].includes(raw.toLowerCase());
65
+ return parseBoolEnv('HONEYBOOK_DISABLE_FETCHPROXY');
86
66
  }
87
67
  /**
88
68
  * Capture a HoneyBook portal session by reading the user's signed-in
@@ -118,13 +98,13 @@ export async function captureSessionViaFetchproxy(opts) {
118
98
  // `jStorage` reads target it (via `storageDomain` below).
119
99
  // - `honeybook.com` is required for the `hb-api-fingerprint`
120
100
  // capture, because that header rides outgoing requests to
121
- // `https://api.honeybook.com/api/v2/*` and the extension gates
122
- // every captureHeader urlPattern host against declared domains.
101
+ // `api.honeybook.com/api/v2/*` and the extension gates
102
+ // every captureHeader `host` against declared domains.
123
103
  //
124
104
  // 0.4.1+ requires multi-domain MCPs to pick a `storageDomain` so
125
105
  // the cookie / localStorage / sessionStorage / indexedDb reads
126
106
  // know which tab to target. captureRequestHeader is independently
127
- // routed by urlPattern.
107
+ // routed by its declared { host, path? }.
128
108
  domains: ['honeybook.com', 'hbportal.co'],
129
109
  storageDomain: 'hbportal.co',
130
110
  declare: {
@@ -149,7 +129,7 @@ export async function captureSessionViaFetchproxy(opts) {
149
129
  // signal that the API requires on every subsequent request.
150
130
  // It's NOT stored in jStorage; the only place to get it is off
151
131
  // a real outgoing request.
152
- { urlPattern: 'https://api.honeybook.com/api/v2/*', headerName: 'hb-api-fingerprint' },
132
+ { host: 'api.honeybook.com', path: '/api/v2/*', headerName: 'hb-api-fingerprint' },
153
133
  ],
154
134
  },
155
135
  // 0.4.0: surface the pair code (six digits) on stderr so the user
@@ -169,9 +149,9 @@ export async function captureSessionViaFetchproxy(opts) {
169
149
  }
170
150
  catch (e) {
171
151
  // SW eviction retry exhausted — surface library's typed `.hint` instead of the generic "open magic link" message.
172
- if (classifyBridgeError(e) === 'bridge_down') {
173
- const downErr = e;
174
- throw new Error(`HoneyBook auth: fetchproxy bridge is down (extension service worker unreachable after retry). ${downErr.hint}`);
152
+ const bridgeError = bridgeErrorInfo(e);
153
+ if (bridgeError.type === 'bridge_down') {
154
+ throw new Error(`HoneyBook auth: fetchproxy bridge is down (extension service worker unreachable after retry). ${bridgeError.hint ?? ''}`.trimEnd());
175
155
  }
176
156
  const msg = e instanceof Error ? e.message : String(e);
177
157
  throw new Error(`HoneyBook auth: fetchproxy capture failed: ${msg} — ` +