honeybook-mcp 0.3.0 → 0.3.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.
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "metadata": {
9
9
  "description": "HoneyBook client-portal tools for Claude Code",
10
- "version": "0.3.0"
10
+ "version": "0.3.2"
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.0",
18
+ "version": "0.3.2",
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.0",
4
+ "version": "0.3.2",
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,30 +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 { readEnvVar } 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');
65
+ const raw = readEnvVar('HONEYBOOK_DISABLE_FETCHPROXY');
83
66
  if (raw === undefined)
84
67
  return false;
85
68
  return ['1', 'true', 'yes', 'on'].includes(raw.toLowerCase());
@@ -118,13 +101,13 @@ export async function captureSessionViaFetchproxy(opts) {
118
101
  // `jStorage` reads target it (via `storageDomain` below).
119
102
  // - `honeybook.com` is required for the `hb-api-fingerprint`
120
103
  // 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.
104
+ // `api.honeybook.com/api/v2/*` and the extension gates
105
+ // every captureHeader `host` against declared domains.
123
106
  //
124
107
  // 0.4.1+ requires multi-domain MCPs to pick a `storageDomain` so
125
108
  // the cookie / localStorage / sessionStorage / indexedDb reads
126
109
  // know which tab to target. captureRequestHeader is independently
127
- // routed by urlPattern.
110
+ // routed by its declared { host, path? }.
128
111
  domains: ['honeybook.com', 'hbportal.co'],
129
112
  storageDomain: 'hbportal.co',
130
113
  declare: {
@@ -149,7 +132,7 @@ export async function captureSessionViaFetchproxy(opts) {
149
132
  // signal that the API requires on every subsequent request.
150
133
  // It's NOT stored in jStorage; the only place to get it is off
151
134
  // a real outgoing request.
152
- { urlPattern: 'https://api.honeybook.com/api/v2/*', headerName: 'hb-api-fingerprint' },
135
+ { host: 'api.honeybook.com', path: '/api/v2/*', headerName: 'hb-api-fingerprint' },
153
136
  ],
154
137
  },
155
138
  // 0.4.0: surface the pair code (six digits) on stderr so the user
@@ -169,9 +152,9 @@ export async function captureSessionViaFetchproxy(opts) {
169
152
  }
170
153
  catch (e) {
171
154
  // 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}`);
155
+ const bridgeError = bridgeErrorInfo(e);
156
+ if (bridgeError.type === 'bridge_down') {
157
+ throw new Error(`HoneyBook auth: fetchproxy bridge is down (extension service worker unreachable after retry). ${bridgeError.hint ?? ''}`.trimEnd());
175
158
  }
176
159
  const msg = e instanceof Error ? e.message : String(e);
177
160
  throw new Error(`HoneyBook auth: fetchproxy capture failed: ${msg} — ` +