@briefgate/mcp 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +329 -0
- package/dist/client.d.ts +128 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +138 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +188 -0
- package/dist/index.js.map +1 -0
- package/dist/tools.d.ts +616 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +591 -0
- package/dist/tools.js.map +1 -0
- package/dist/webhook.d.ts +54 -0
- package/dist/webhook.d.ts.map +1 -0
- package/dist/webhook.js +94 -0
- package/dist/webhook.js.map +1 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Radim Sekera
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
# @briefgate/mcp
|
|
2
|
+
|
|
3
|
+
**Stop your coding agent stalling on client logos, copy and credentials.**
|
|
4
|
+
|
|
5
|
+
BriefGate is the first client intake tool built for AI agents. Your agent declares what it needs (`define_intake`), BriefGate generates a branded portal and chases the client automatically with email reminders, and your agent retrieves fully typed assets (`get_intake_results`) and keeps building.
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
Agent: define_intake(items=[logo, copy, wp_admin])
|
|
9
|
+
BriefGate: → sends invite email → chases client every few days
|
|
10
|
+
Client: fills in the portal (mobile-friendly, no login required)
|
|
11
|
+
Agent: get_intake_results() → { logo: "https://signed-url/logo.svg", wp_admin: "s3cr3t" }
|
|
12
|
+
Agent: keeps building the website ✅
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quickstart — Claude Code
|
|
16
|
+
|
|
17
|
+
**1. Get an API key** at [briefgate.dev](https://briefgate.dev) (free tier available, no card required):
|
|
18
|
+
|
|
19
|
+
**2. Register the MCP server:**
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
claude mcp add briefgate \
|
|
23
|
+
-e BRIEFGATE_API_KEY=bg_live_... \
|
|
24
|
+
-- npx @briefgate/mcp
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Or add manually to `~/.claude/settings.json`:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"mcpServers": {
|
|
32
|
+
"briefgate": {
|
|
33
|
+
"command": "npx",
|
|
34
|
+
"args": ["@briefgate/mcp"],
|
|
35
|
+
"env": {
|
|
36
|
+
"BRIEFGATE_API_KEY": "bg_live_..."
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**3. Verify it loaded** — run `/mcp` in Claude Code and look for `briefgate` with 7 tools.
|
|
44
|
+
|
|
45
|
+
## Quickstart — Cursor / Codex / other MCP clients
|
|
46
|
+
|
|
47
|
+
Add to your MCP config (usually `.cursor/mcp.json` or similar):
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"mcpServers": {
|
|
52
|
+
"briefgate": {
|
|
53
|
+
"command": "npx",
|
|
54
|
+
"args": ["-y", "@briefgate/mcp"],
|
|
55
|
+
"env": {
|
|
56
|
+
"BRIEFGATE_API_KEY": "bg_live_..."
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Environment variables
|
|
64
|
+
|
|
65
|
+
| Variable | Required | Default | Description |
|
|
66
|
+
|---|---|---|---|
|
|
67
|
+
| `BRIEFGATE_API_KEY` | Yes | — | API key (`bg_live_...` or `bg_test_...`). Obtain from the BriefGate dashboard. |
|
|
68
|
+
| `BRIEFGATE_BASE_URL` | No | `https://api.briefgate.dev` | Override for self-hosted or staging. |
|
|
69
|
+
| `BRIEFGATE_MCP_HTTP` | No | — | Set to `1` to start Streamable HTTP instead of stdio. |
|
|
70
|
+
| `BRIEFGATE_MCP_PORT` | No | `3000` | Port for HTTP mode. |
|
|
71
|
+
|
|
72
|
+
## HTTP (Streamable HTTP) mode
|
|
73
|
+
|
|
74
|
+
For remote or multi-session deployments, start the server in HTTP mode:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
BRIEFGATE_API_KEY=bg_live_... npx @briefgate/mcp --http --port 3000
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The server binds to `127.0.0.1` only and includes DNS-rebinding protection. For production deployment behind a reverse proxy, see the [self-hosting docs](https://briefgate.dev/docs/self-host).
|
|
81
|
+
|
|
82
|
+
## Tools
|
|
83
|
+
|
|
84
|
+
### `define_intake`
|
|
85
|
+
|
|
86
|
+
Create a new client intake — a branded portal where the client submits the assets you need. BriefGate sends the invite email and chases the client automatically until everything is collected.
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
project_name: "Website for Kramolíšová Finance"
|
|
90
|
+
client: { email: "klient@firma.cz", name: "Michaela K.", language: "cs" }
|
|
91
|
+
due_date: "2026-08-15"
|
|
92
|
+
branding: { accent_color: "#1B2A4A", sender_name: "Radim" }
|
|
93
|
+
chase_schedule: "default" // default | gentle | aggressive | off
|
|
94
|
+
items:
|
|
95
|
+
- { key: "logo", type: "image", label: "Company logo",
|
|
96
|
+
constraints: { formats: ["svg","png"], min_width: 512 } }
|
|
97
|
+
- { key: "hero_copy", type: "longtext", label: "Homepage headline",
|
|
98
|
+
constraints: { max_chars: 400 } }
|
|
99
|
+
- { key: "brand_colors", type: "color_list", label: "Brand colors", required: false }
|
|
100
|
+
- { key: "ga4_id", type: "text", label: "Google Analytics ID",
|
|
101
|
+
pattern: "^G-[A-Z0-9]+$", required: false }
|
|
102
|
+
- { key: "wp_admin", type: "secret", label: "WordPress admin credentials" }
|
|
103
|
+
- { key: "photos", type: "file_list", label: "Photos (5–10 images)",
|
|
104
|
+
constraints: { formats: ["jpg","png","heic"], min_count: 5, max_count: 15 } }
|
|
105
|
+
- { key: "opening_hours", type: "structured", label: "Opening hours",
|
|
106
|
+
schema: { type: "object", properties: { mon_fri: { type: "string" }, sat: { type: "string" } } } }
|
|
107
|
+
- { key: "has_existing_site", type: "boolean", label: "Does the client have an existing website?" }
|
|
108
|
+
- { key: "website_url", type: "url", label: "Current website URL", required: false }
|
|
109
|
+
- { key: "service_tier", type: "select", label: "Service package",
|
|
110
|
+
options: [{ value: "basic", label: "Basic" }, { value: "pro", label: "Pro" }] }
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Item key rules:** must be `snake_case` (e.g. `logo`, `hero_copy`, `ga4_id`). Keys become property names in `get_intake_results` — no uppercase, no spaces, no hyphens.
|
|
114
|
+
|
|
115
|
+
Returns `{ intake_id, portal_url, status }`. Save `intake_id` for all follow-up calls.
|
|
116
|
+
|
|
117
|
+
### `get_intake_status`
|
|
118
|
+
|
|
119
|
+
Check which items are submitted, pending, or need revision. Includes the history of automated chase emails and when the client last opened the portal.
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
intake_id: "in_8f3k"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Returns per-item status and a full chase history.
|
|
126
|
+
|
|
127
|
+
### `get_intake_results`
|
|
128
|
+
|
|
129
|
+
Retrieve typed submitted values. Files are signed URLs (valid 24 hours). **Secrets are one-time** — decrypted and returned on the first call only; store them before moving on.
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
intake_id: "in_8f3k"
|
|
133
|
+
only_new: true // only items new since last call
|
|
134
|
+
include_pending: false // omit unsubmitted items
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Returns `{ results: { logo: "https://signed...", hero_copy: "text...", wp_admin: "s3cr3t" }, meta: { ... } }`.
|
|
138
|
+
|
|
139
|
+
### `request_revision`
|
|
140
|
+
|
|
141
|
+
Ask the client to resubmit an item with a note explaining what is wrong.
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
intake_id: "in_8f3k"
|
|
145
|
+
item_key: "logo"
|
|
146
|
+
note: "Logo is blurry — we need at least 512 px wide in SVG or PNG with a transparent background"
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Returns `{ status: "revision_requested", item_key }`.
|
|
150
|
+
|
|
151
|
+
### `send_chase`
|
|
152
|
+
|
|
153
|
+
Send a manual reminder outside the automatic schedule. Use when a deadline is approaching or email attempts have failed.
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
intake_id: "in_8f3k"
|
|
157
|
+
channel: "sms" // "email" (default) | "sms"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Returns `{ sent: true }`.
|
|
161
|
+
|
|
162
|
+
### `list_intakes`
|
|
163
|
+
|
|
164
|
+
List all intakes across projects, optionally filtered by status or client email.
|
|
165
|
+
|
|
166
|
+
```
|
|
167
|
+
status: "in_progress" // draft | sent | in_progress | completed | archived
|
|
168
|
+
client_email: "klient@firma.cz"
|
|
169
|
+
limit: 20
|
|
170
|
+
offset: 0
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Returns `{ intakes: [...], total }`.
|
|
174
|
+
|
|
175
|
+
### `add_items`
|
|
176
|
+
|
|
177
|
+
Add new items to an already-sent intake — for example a favicon you forgot, or additional credentials needed mid-project.
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
intake_id: "in_8f3k"
|
|
181
|
+
items:
|
|
182
|
+
- { key: "favicon", type: "image", label: "Favicon (32×32 PNG or ICO)" }
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Returns the updated intake.
|
|
186
|
+
|
|
187
|
+
## End-to-end example
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
# System prompt excerpt
|
|
191
|
+
You are a web development agent. When you need client assets:
|
|
192
|
+
|
|
193
|
+
1. Call define_intake with all assets needed for this project.
|
|
194
|
+
Use type=secret for passwords/credentials.
|
|
195
|
+
The chase engine runs automatically — do not poll more often than once per day.
|
|
196
|
+
|
|
197
|
+
2. When the intake.completed webhook arrives (or after checking get_intake_status),
|
|
198
|
+
call get_intake_results. Download file URLs within 24 hours.
|
|
199
|
+
Store secrets immediately — they are one-time.
|
|
200
|
+
|
|
201
|
+
3. If a submitted asset does not meet requirements (blurry logo, broken URL),
|
|
202
|
+
call request_revision with a clear note for the client.
|
|
203
|
+
|
|
204
|
+
4. If the client is unresponsive after 9 days, call send_chase with channel="sms"
|
|
205
|
+
(only if a phone number was collected).
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Verifying webhooks
|
|
209
|
+
|
|
210
|
+
BriefGate signs every webhook with HMAC-SHA256 to prevent forgery and replay attacks. The `@briefgate/mcp` package exports a ready-made helper:
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
import { verifyWebhookSignature, parseWebhookEvent } from "@briefgate/mcp/webhook";
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
The signature lives in the `X-BriefGate-Signature` header as `t=<unix>,v1=<hex>`:
|
|
217
|
+
|
|
218
|
+
### Fastify (recommended)
|
|
219
|
+
|
|
220
|
+
```typescript
|
|
221
|
+
import Fastify from "fastify";
|
|
222
|
+
import { verifyWebhookSignature, parseWebhookEvent } from "@briefgate/mcp/webhook";
|
|
223
|
+
|
|
224
|
+
const app = Fastify();
|
|
225
|
+
|
|
226
|
+
// Parse body as raw string — JSON-parsing before verification breaks the HMAC.
|
|
227
|
+
app.addContentTypeParser("application/json", { parseAs: "string" }, (req, body, done) => {
|
|
228
|
+
done(null, body);
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
app.post("/briefgate/webhook", (request, reply) => {
|
|
232
|
+
const rawBody = request.body as string;
|
|
233
|
+
|
|
234
|
+
const ok = verifyWebhookSignature(
|
|
235
|
+
process.env.BRIEFGATE_WEBHOOK_SECRET!,
|
|
236
|
+
request.headers["x-briefgate-signature"] as string,
|
|
237
|
+
rawBody,
|
|
238
|
+
// { toleranceSec: 300 } ← default; increase for slow networks
|
|
239
|
+
);
|
|
240
|
+
|
|
241
|
+
if (!ok) {
|
|
242
|
+
return reply.status(401).send({ error: "Invalid signature" });
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const event = parseWebhookEvent(rawBody);
|
|
246
|
+
console.log("BriefGate event:", event.event, event.intake_id);
|
|
247
|
+
reply.send({ ok: true });
|
|
248
|
+
});
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Express
|
|
252
|
+
|
|
253
|
+
```typescript
|
|
254
|
+
import express from "express";
|
|
255
|
+
import { verifyWebhookSignature, parseWebhookEvent } from "@briefgate/mcp/webhook";
|
|
256
|
+
|
|
257
|
+
const app = express();
|
|
258
|
+
|
|
259
|
+
// raw body parser — must come before express.json()
|
|
260
|
+
app.post(
|
|
261
|
+
"/briefgate/webhook",
|
|
262
|
+
express.raw({ type: "application/json" }),
|
|
263
|
+
(req, res) => {
|
|
264
|
+
const rawBody = Buffer.isBuffer(req.body)
|
|
265
|
+
? req.body.toString("utf8")
|
|
266
|
+
: String(req.body);
|
|
267
|
+
|
|
268
|
+
const ok = verifyWebhookSignature(
|
|
269
|
+
process.env.BRIEFGATE_WEBHOOK_SECRET!,
|
|
270
|
+
req.headers["x-briefgate-signature"] as string,
|
|
271
|
+
rawBody,
|
|
272
|
+
);
|
|
273
|
+
|
|
274
|
+
if (!ok) return res.status(401).json({ error: "Invalid signature" });
|
|
275
|
+
|
|
276
|
+
const event = parseWebhookEvent(rawBody);
|
|
277
|
+
console.log("BriefGate event:", event.event, event.intake_id);
|
|
278
|
+
res.sendStatus(200);
|
|
279
|
+
},
|
|
280
|
+
);
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Webhook events
|
|
284
|
+
|
|
285
|
+
| Event | When | Key fields |
|
|
286
|
+
|---|---|---|
|
|
287
|
+
| `item.submitted` | Client submits an item | `item_key`, `item_status` |
|
|
288
|
+
| `intake.completed` | All required items approved | — |
|
|
289
|
+
| `client.viewed` | Client opens the portal | `client_email` |
|
|
290
|
+
| `chase.bounced` | Reminder email/SMS bounced | `channel`, `reason` |
|
|
291
|
+
| `intake.stalled` | 3 reminders sent, no response | `attempts` |
|
|
292
|
+
|
|
293
|
+
## Pricing
|
|
294
|
+
|
|
295
|
+
| | Free | Solo — $29/mo | Agency — $79/mo |
|
|
296
|
+
|---|---|---|---|
|
|
297
|
+
| Active intakes | 1 | 15 | 60 |
|
|
298
|
+
| Items per intake | 10 | unlimited | unlimited |
|
|
299
|
+
| Storage | 1 GB | 25 GB | 100 GB |
|
|
300
|
+
| Branding | "powered by" | custom logo + colors | + custom sending domain |
|
|
301
|
+
| Chase | email, default | email, all schedules | + SMS credits |
|
|
302
|
+
| Secrets vault | — | yes | yes |
|
|
303
|
+
| Webhooks + REST + MCP | yes | yes | yes |
|
|
304
|
+
|
|
305
|
+
Full pricing at `GET https://api.briefgate.dev/pricing.json` (no auth required — agents can read it directly).
|
|
306
|
+
|
|
307
|
+
## Self-hosting
|
|
308
|
+
|
|
309
|
+
BriefGate cloud is hosted in the EU (Hetzner, Cloudflare R2 EU jurisdiction). A self-hosted option is available on request — see [briefgate.dev/docs/self-host](https://briefgate.dev/docs/self-host).
|
|
310
|
+
|
|
311
|
+
## Contributing
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
cd mcp
|
|
315
|
+
npm install
|
|
316
|
+
npm run typecheck # TypeScript check
|
|
317
|
+
npm run lint # ESLint
|
|
318
|
+
npm run test # Vitest
|
|
319
|
+
npm run check # all three
|
|
320
|
+
npm run build # compile to dist/
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
## License
|
|
324
|
+
|
|
325
|
+
MIT — use freely in commercial projects.
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
Made by [Radim Sekera](https://briefgate.dev). Related project: [impri.dev](https://impri.dev) — human-in-the-loop approval inbox for AI agents.
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export interface BriefGateConfig {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
}
|
|
5
|
+
export type ItemType = 'text' | 'longtext' | 'file' | 'file_list' | 'image' | 'color_list' | 'select' | 'boolean' | 'url' | 'secret' | 'structured';
|
|
6
|
+
export type ItemStatus = 'pending' | 'submitted' | 'needs_revision' | 'approved';
|
|
7
|
+
export type IntakeStatus = 'draft' | 'sent' | 'in_progress' | 'completed' | 'archived';
|
|
8
|
+
export type ChaseSchedule = 'default' | 'gentle' | 'aggressive' | 'off';
|
|
9
|
+
export interface ItemOption {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ItemConstraints {
|
|
14
|
+
formats?: string[];
|
|
15
|
+
min_width?: number;
|
|
16
|
+
min_height?: number;
|
|
17
|
+
max_width?: number;
|
|
18
|
+
max_height?: number;
|
|
19
|
+
max_bytes?: number;
|
|
20
|
+
min_chars?: number;
|
|
21
|
+
max_chars?: number;
|
|
22
|
+
min_count?: number;
|
|
23
|
+
max_count?: number;
|
|
24
|
+
transparent_background?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface ItemDefinition {
|
|
27
|
+
key: string;
|
|
28
|
+
type: ItemType;
|
|
29
|
+
label: string;
|
|
30
|
+
help?: string;
|
|
31
|
+
required?: boolean;
|
|
32
|
+
constraints?: ItemConstraints;
|
|
33
|
+
schema?: Record<string, unknown>;
|
|
34
|
+
options?: ItemOption[];
|
|
35
|
+
pattern?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface IntakeCreated {
|
|
38
|
+
intake_id: string;
|
|
39
|
+
portal_url: string;
|
|
40
|
+
status: IntakeStatus;
|
|
41
|
+
items: Array<{
|
|
42
|
+
key: string;
|
|
43
|
+
status: ItemStatus;
|
|
44
|
+
}>;
|
|
45
|
+
}
|
|
46
|
+
export interface IntakeStatusResult {
|
|
47
|
+
intake_id: string;
|
|
48
|
+
status: IntakeStatus;
|
|
49
|
+
progress: {
|
|
50
|
+
submitted: number;
|
|
51
|
+
total: number;
|
|
52
|
+
};
|
|
53
|
+
items: Array<{
|
|
54
|
+
key: string;
|
|
55
|
+
status: ItemStatus;
|
|
56
|
+
submitted_at?: string;
|
|
57
|
+
label: string;
|
|
58
|
+
}>;
|
|
59
|
+
chases: Array<{
|
|
60
|
+
channel: string;
|
|
61
|
+
sent_at: string;
|
|
62
|
+
status: string;
|
|
63
|
+
attempt_no: number;
|
|
64
|
+
}>;
|
|
65
|
+
client_last_seen?: string;
|
|
66
|
+
due_date?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface IntakeResults {
|
|
69
|
+
intake_id: string;
|
|
70
|
+
status: IntakeStatus;
|
|
71
|
+
results: Record<string, unknown>;
|
|
72
|
+
meta: Record<string, {
|
|
73
|
+
type: ItemType;
|
|
74
|
+
status: ItemStatus;
|
|
75
|
+
submitted_at?: string;
|
|
76
|
+
}>;
|
|
77
|
+
}
|
|
78
|
+
export interface IntakeListItem {
|
|
79
|
+
intake_id: string;
|
|
80
|
+
project_name: string;
|
|
81
|
+
client_email: string;
|
|
82
|
+
status: IntakeStatus;
|
|
83
|
+
created_at: string;
|
|
84
|
+
due_date?: string;
|
|
85
|
+
portal_url: string;
|
|
86
|
+
}
|
|
87
|
+
export interface IntakeList {
|
|
88
|
+
intakes: IntakeListItem[];
|
|
89
|
+
total: number;
|
|
90
|
+
}
|
|
91
|
+
export interface UsageResult {
|
|
92
|
+
plan: string;
|
|
93
|
+
active_intakes: {
|
|
94
|
+
used: number;
|
|
95
|
+
limit: number | null;
|
|
96
|
+
};
|
|
97
|
+
storage_bytes: {
|
|
98
|
+
used: number;
|
|
99
|
+
limit: number | null;
|
|
100
|
+
};
|
|
101
|
+
requests_this_hour: {
|
|
102
|
+
used: number;
|
|
103
|
+
limit: number;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export declare function apiRequest<T>(config: BriefGateConfig, method: string, path: string, body?: unknown, extraHeaders?: Record<string, string>): Promise<T>;
|
|
107
|
+
export declare function createIntake(config: BriefGateConfig, payload: unknown, idempotencyKey: string): Promise<IntakeCreated>;
|
|
108
|
+
export declare function listIntakes(config: BriefGateConfig, params: {
|
|
109
|
+
status?: string;
|
|
110
|
+
client_email?: string;
|
|
111
|
+
limit?: number;
|
|
112
|
+
offset?: number;
|
|
113
|
+
}): Promise<IntakeList>;
|
|
114
|
+
export declare function getIntakeStatus(config: BriefGateConfig, intakeId: string): Promise<IntakeStatusResult>;
|
|
115
|
+
export declare function getIntakeResults(config: BriefGateConfig, intakeId: string, params: {
|
|
116
|
+
only_new?: boolean;
|
|
117
|
+
include_pending?: boolean;
|
|
118
|
+
}): Promise<IntakeResults>;
|
|
119
|
+
export declare function addItems(config: BriefGateConfig, intakeId: string, items: ItemDefinition[]): Promise<IntakeCreated>;
|
|
120
|
+
export declare function requestRevision(config: BriefGateConfig, intakeId: string, itemKey: string, note: string): Promise<{
|
|
121
|
+
status: string;
|
|
122
|
+
item_key: string;
|
|
123
|
+
}>;
|
|
124
|
+
export declare function sendChase(config: BriefGateConfig, intakeId: string, channel?: 'email' | 'sms'): Promise<{
|
|
125
|
+
sent: true;
|
|
126
|
+
}>;
|
|
127
|
+
export declare function getUsage(config: BriefGateConfig): Promise<UsageResult>;
|
|
128
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAID,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,UAAU,GACV,MAAM,GACN,WAAW,GACX,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,SAAS,GACT,KAAK,GACL,QAAQ,GACR,YAAY,CAAC;AAEjB,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,gBAAgB,GAAG,UAAU,CAAC;AACjF,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,CAAC;AACvF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAC;AAExE,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;I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EAAE,MAAM,CAAA;CAAE,CAAC,CAO/C;AAED,wBAAsB,SAAS,CAC7B,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,OAAO,GAAG,KAAK,GACxB,OAAO,CAAC;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAIzB;AAED,wBAAsB,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,CAE5E"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// REST client, shared types, and agent-friendly error mapping.
|
|
2
|
+
// No business logic lives here — each function is a thin wrapper over one
|
|
3
|
+
// REST endpoint so that tools.ts stays readable and tests can stub fetch.
|
|
4
|
+
// Abort fetch after this many ms so an unresponsive server never stalls the agent.
|
|
5
|
+
const FETCH_TIMEOUT_MS = 30_000;
|
|
6
|
+
// ─── Core fetch wrapper ───────────────────────────────────────────────────────
|
|
7
|
+
export async function apiRequest(config, method, path, body, extraHeaders) {
|
|
8
|
+
const url = `${config.baseUrl}/v1${path}`;
|
|
9
|
+
const controller = new AbortController();
|
|
10
|
+
const timeoutId = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
|
|
11
|
+
const init = {
|
|
12
|
+
method,
|
|
13
|
+
signal: controller.signal,
|
|
14
|
+
headers: {
|
|
15
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
16
|
+
'Content-Type': 'application/json',
|
|
17
|
+
Accept: 'application/json',
|
|
18
|
+
...extraHeaders,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
if (body !== undefined) {
|
|
22
|
+
init.body = JSON.stringify(body);
|
|
23
|
+
}
|
|
24
|
+
let res;
|
|
25
|
+
try {
|
|
26
|
+
res = await fetch(url, init);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
if (err instanceof Error && err.name === 'AbortError') {
|
|
30
|
+
throw new Error(`BriefGate API request timed out after ${FETCH_TIMEOUT_MS / 1000}s — the service may be temporarily unreachable. Try again shortly.`);
|
|
31
|
+
}
|
|
32
|
+
// Network errors (ECONNREFUSED, DNS failure, etc.) — expose cause without leaking config.
|
|
33
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
34
|
+
throw new Error(`BriefGate API unreachable: ${detail}. Check your network connection or BRIEFGATE_BASE_URL.`);
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
clearTimeout(timeoutId);
|
|
38
|
+
}
|
|
39
|
+
if (!res.ok) {
|
|
40
|
+
return throwApiError(res);
|
|
41
|
+
}
|
|
42
|
+
if (res.status === 204) {
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
// Guard against a proxy/CDN returning HTML (e.g. on a 502 that was re-wrapped as 200).
|
|
46
|
+
try {
|
|
47
|
+
return (await res.json());
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
throw new Error(`BriefGate API returned an unexpected non-JSON response (status ${res.status}). This may indicate a proxy or network issue — try again shortly.`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async function throwApiError(res) {
|
|
54
|
+
let message = '';
|
|
55
|
+
let retryAfter = '';
|
|
56
|
+
try {
|
|
57
|
+
const body = (await res.json());
|
|
58
|
+
message = body.message ?? body.error ?? '';
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
message = res.statusText;
|
|
62
|
+
}
|
|
63
|
+
retryAfter = res.headers.get('Retry-After') ?? '';
|
|
64
|
+
switch (res.status) {
|
|
65
|
+
case 401:
|
|
66
|
+
throw new Error('Authentication failed — verify your BRIEFGATE_API_KEY is correct and has not been revoked.');
|
|
67
|
+
case 402:
|
|
68
|
+
throw new Error(`Plan limit reached: ${message || 'quota exceeded'} — upgrade your plan or reduce scope.`);
|
|
69
|
+
case 403:
|
|
70
|
+
throw new Error('Access denied — this API key does not have the required scope for this operation.');
|
|
71
|
+
case 404:
|
|
72
|
+
throw new Error('Resource not found — verify the intake_id is correct and belongs to this API key.');
|
|
73
|
+
case 409:
|
|
74
|
+
throw new Error('Conflict — an intake with this idempotency key already exists; check list_intakes to find it.');
|
|
75
|
+
case 410:
|
|
76
|
+
throw new Error('Gone — this intake has been deleted and all its files purged.');
|
|
77
|
+
case 413:
|
|
78
|
+
throw new Error('Payload too large — reduce the number of items or check file size limits.');
|
|
79
|
+
case 422:
|
|
80
|
+
throw new Error(`Invalid request: ${message || 'check the parameters and try again.'}`);
|
|
81
|
+
case 429: {
|
|
82
|
+
const after = retryAfter ? `${retryAfter}s` : 'a moment';
|
|
83
|
+
throw new Error(`Rate limited — retry after ${after}. Use webhooks instead of polling to stay within limits.`);
|
|
84
|
+
}
|
|
85
|
+
case 500:
|
|
86
|
+
case 502:
|
|
87
|
+
case 503:
|
|
88
|
+
throw new Error(`BriefGate API error ${res.status}: ${message || 'internal server error — try again shortly.'}`);
|
|
89
|
+
default:
|
|
90
|
+
throw new Error(`BriefGate API error ${res.status}: ${message || res.statusText}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// ─── Typed endpoint wrappers ──────────────────────────────────────────────────
|
|
94
|
+
export async function createIntake(config, payload, idempotencyKey) {
|
|
95
|
+
return apiRequest(config, 'POST', '/intakes', payload, {
|
|
96
|
+
'Idempotency-Key': idempotencyKey,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
export async function listIntakes(config, params) {
|
|
100
|
+
const qs = new URLSearchParams();
|
|
101
|
+
if (params.status)
|
|
102
|
+
qs.set('status', params.status);
|
|
103
|
+
if (params.client_email)
|
|
104
|
+
qs.set('client_email', params.client_email);
|
|
105
|
+
if (params.limit !== undefined)
|
|
106
|
+
qs.set('limit', String(params.limit));
|
|
107
|
+
if (params.offset !== undefined)
|
|
108
|
+
qs.set('offset', String(params.offset));
|
|
109
|
+
const query = qs.toString() ? `?${qs.toString()}` : '';
|
|
110
|
+
return apiRequest(config, 'GET', `/intakes${query}`);
|
|
111
|
+
}
|
|
112
|
+
export async function getIntakeStatus(config, intakeId) {
|
|
113
|
+
return apiRequest(config, 'GET', `/intakes/${intakeId}/status`);
|
|
114
|
+
}
|
|
115
|
+
export async function getIntakeResults(config, intakeId, params) {
|
|
116
|
+
const qs = new URLSearchParams();
|
|
117
|
+
if (params.only_new)
|
|
118
|
+
qs.set('only_new', 'true');
|
|
119
|
+
if (params.include_pending)
|
|
120
|
+
qs.set('include_pending', 'true');
|
|
121
|
+
const query = qs.toString() ? `?${qs.toString()}` : '';
|
|
122
|
+
return apiRequest(config, 'GET', `/intakes/${intakeId}/results${query}`);
|
|
123
|
+
}
|
|
124
|
+
export async function addItems(config, intakeId, items) {
|
|
125
|
+
return apiRequest(config, 'POST', `/intakes/${intakeId}/items`, { items });
|
|
126
|
+
}
|
|
127
|
+
export async function requestRevision(config, intakeId, itemKey, note) {
|
|
128
|
+
return apiRequest(config, 'POST', `/intakes/${intakeId}/revision`, { item_key: itemKey, note });
|
|
129
|
+
}
|
|
130
|
+
export async function sendChase(config, intakeId, channel) {
|
|
131
|
+
return apiRequest(config, 'POST', `/intakes/${intakeId}/chase`, {
|
|
132
|
+
...(channel !== undefined && { channel }),
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
export async function getUsage(config) {
|
|
136
|
+
return apiRequest(config, 'GET', '/usage');
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,0EAA0E;AAC1E,0EAA0E;AAwH1E,mFAAmF;AACnF,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEhC,iFAAiF;AAEjF,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAuB,EACvB,MAAc,EACd,IAAY,EACZ,IAAc,EACd,YAAqC;IAErC,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,OAAO,MAAM,IAAI,EAAE,CAAC;IAC1C,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