@devpad/mcp 2.1.9 → 2.1.11

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/index.js +185 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -12363,6 +12363,95 @@ var ApiClient2 = class {
12363
12363
  history: () => wrap(() => this.clients.auth.get("/user/history")),
12364
12364
  preferences: (data) => wrap(() => this.clients.auth.patch("/user/preferences", { body: data }))
12365
12365
  };
12366
+ this.pulse = {
12367
+ summary: (input) => wrap(() => this.clients.pulse.get("/summary/:project_id".replace(":project_id", input.project_id), {
12368
+ query: typeof input.range === "string" ? { range: input.range } : { from: String(input.range.from), to: String(input.range.to) }
12369
+ })),
12370
+ events: (input) => wrap(() => {
12371
+ const query = {};
12372
+ if (input.name)
12373
+ query.name = input.name;
12374
+ if (input.level)
12375
+ query.level = input.level;
12376
+ if (typeof input.ts_from === "number")
12377
+ query.ts_from = String(input.ts_from);
12378
+ if (typeof input.ts_to === "number")
12379
+ query.ts_to = String(input.ts_to);
12380
+ if (input.search)
12381
+ query.search = input.search;
12382
+ if (input.limit)
12383
+ query.limit = String(input.limit);
12384
+ if (input.cursor)
12385
+ query.cursor = input.cursor;
12386
+ return this.clients.pulse.get("/events/:project_id".replace(":project_id", input.project_id), { query });
12387
+ }),
12388
+ errors: (input) => wrap(() => {
12389
+ const query = {};
12390
+ if (typeof input.range === "string") {
12391
+ query.range = input.range;
12392
+ } else {
12393
+ query.from = String(input.range.from);
12394
+ query.to = String(input.range.to);
12395
+ }
12396
+ if (input.group_by_fingerprint)
12397
+ query.group_by_fingerprint = "true";
12398
+ return this.clients.pulse.get("/errors/:project_id".replace(":project_id", input.project_id), { query });
12399
+ }),
12400
+ logs: (input) => wrap(() => {
12401
+ const query = {};
12402
+ if (typeof input.range === "string") {
12403
+ query.range = input.range;
12404
+ } else {
12405
+ query.from = String(input.range.from);
12406
+ query.to = String(input.range.to);
12407
+ }
12408
+ if (input.level)
12409
+ query.level = input.level;
12410
+ if (input.search)
12411
+ query.search = input.search;
12412
+ return this.clients.pulse.get("/logs/:project_id".replace(":project_id", input.project_id), { query });
12413
+ }),
12414
+ latency: (input) => wrap(() => {
12415
+ const query = {};
12416
+ if (typeof input.range === "string") {
12417
+ query.range = input.range;
12418
+ } else {
12419
+ query.from = String(input.range.from);
12420
+ query.to = String(input.range.to);
12421
+ }
12422
+ if (input.route)
12423
+ query.route = input.route;
12424
+ if (input.percentiles && input.percentiles.length > 0)
12425
+ query.percentiles = input.percentiles.join(",");
12426
+ return this.clients.pulse.get("/latency/:project_id".replace(":project_id", input.project_id), { query });
12427
+ }),
12428
+ subs: {
12429
+ list: (input) => wrap(() => this.clients.pulse.get("/admin/subs", { query: { project_id: input.project_id } })),
12430
+ create: (input) => wrap(() => this.clients.pulse.post("/admin/subs", {
12431
+ body: {
12432
+ project_id: input.project_id,
12433
+ name: input.name,
12434
+ filter: input.filter,
12435
+ channel: input.channel,
12436
+ cooldown_seconds: input.cooldown_seconds
12437
+ }
12438
+ })),
12439
+ get: (id) => wrap(() => this.clients.pulse.get(`/admin/subs/${id}`)),
12440
+ update: (id, patch) => wrap(() => this.clients.pulse.patch(`/admin/subs/${id}`, { body: patch })),
12441
+ delete: (id) => wrap(() => this.clients.pulse.delete(`/admin/subs/${id}`))
12442
+ },
12443
+ keys: {
12444
+ list: (input) => wrap(() => this.clients.pulse.get("/admin/keys", { query: { project_id: input.project_id } })),
12445
+ create: (input) => wrap(() => this.clients.pulse.post("/admin/keys", {
12446
+ body: {
12447
+ project_id: input.project_id,
12448
+ name: input.name,
12449
+ rate_limit_per_min: input.rate_limit_per_min
12450
+ }
12451
+ })),
12452
+ delete: (id, input) => wrap(() => this.clients.pulse.delete(`/admin/keys/${id}`, { query: { project_id: input.project_id } }))
12453
+ }
12454
+ };
12366
12455
  const base_url = options.base_url || "http://localhost:4321/api/v1";
12367
12456
  this._api_key = options.api_key ?? "";
12368
12457
  this._auth_mode = options.auth_mode ?? (options.api_key?.startsWith("jwt:") ? "session" : options.api_key ? "key" : "cookie");
@@ -12390,7 +12479,8 @@ var ApiClient2 = class {
12390
12479
  github: new ApiClient({ ...clientOptions, category: "github" }),
12391
12480
  tags: new ApiClient({ ...clientOptions, category: "tags" }),
12392
12481
  blog: new ApiClient({ ...clientOptions, category: "blog" }),
12393
- media: new ApiClient({ ...clientOptions, category: "media" })
12482
+ media: new ApiClient({ ...clientOptions, category: "media" }),
12483
+ pulse: new ApiClient({ ...clientOptions, category: "pulse" })
12394
12484
  };
12395
12485
  }
12396
12486
  history() {
@@ -12855,6 +12945,100 @@ var tools = {
12855
12945
  const { user_id, ...params } = input;
12856
12946
  return unwrap2(await client.media.timeline.get(user_id, params));
12857
12947
  }
12948
+ },
12949
+ devpad_pulse_summary: {
12950
+ name: "devpad_pulse_summary",
12951
+ description: "Get summary analytics for a project (pageviews, sessions, errors, latency)",
12952
+ inputSchema: exports_external.object({
12953
+ project_id: exports_external.string().describe("Project ID"),
12954
+ range: exports_external.enum(["24h", "7d", "30d", "90d"]).describe("Time range")
12955
+ }),
12956
+ execute: async (client, input) => unwrap2(await client.pulse.summary({ project_id: input.project_id, range: input.range }))
12957
+ },
12958
+ devpad_pulse_events: {
12959
+ name: "devpad_pulse_events",
12960
+ description: "List events for a project with optional filtering",
12961
+ inputSchema: exports_external.object({
12962
+ project_id: exports_external.string().describe("Project ID"),
12963
+ name: exports_external.string().optional().describe("Event name filter (pageview, error, log, etc)"),
12964
+ level: exports_external.string().optional().describe("Log level filter (debug, info, warn, error, critical)"),
12965
+ ts_from: exports_external.number().optional().describe("Start timestamp (unix ms)"),
12966
+ ts_to: exports_external.number().optional().describe("End timestamp (unix ms)"),
12967
+ search: exports_external.string().optional().describe("Search substring in event properties"),
12968
+ limit: exports_external.number().optional().describe("Max events to return (max 500)"),
12969
+ cursor: exports_external.string().optional().describe("Pagination cursor")
12970
+ }),
12971
+ execute: async (client, input) => unwrap2(await client.pulse.events(input))
12972
+ },
12973
+ devpad_pulse_errors: {
12974
+ name: "devpad_pulse_errors",
12975
+ description: "List error issues for a project, optionally grouped by fingerprint",
12976
+ inputSchema: exports_external.object({
12977
+ project_id: exports_external.string().describe("Project ID"),
12978
+ range: exports_external.enum(["24h", "7d", "30d", "90d"]).describe("Time range"),
12979
+ group_by_fingerprint: exports_external.boolean().optional().describe("Group by error fingerprint (true) or list all (false)")
12980
+ }),
12981
+ execute: async (client, input) => unwrap2(await client.pulse.errors({ project_id: input.project_id, range: input.range, group_by_fingerprint: input.group_by_fingerprint }))
12982
+ },
12983
+ devpad_pulse_logs: {
12984
+ name: "devpad_pulse_logs",
12985
+ description: "List logs for a project with optional level and message filtering",
12986
+ inputSchema: exports_external.object({
12987
+ project_id: exports_external.string().describe("Project ID"),
12988
+ range: exports_external.enum(["24h", "7d", "30d", "90d"]).describe("Time range"),
12989
+ level: exports_external.string().optional().describe("Log level filter"),
12990
+ search: exports_external.string().optional().describe("Search in log messages")
12991
+ }),
12992
+ execute: async (client, input) => unwrap2(await client.pulse.logs(input))
12993
+ },
12994
+ devpad_pulse_latency: {
12995
+ name: "devpad_pulse_latency",
12996
+ description: "Get request latency metrics (p50, p95, p99) for a project",
12997
+ inputSchema: exports_external.object({
12998
+ project_id: exports_external.string().describe("Project ID"),
12999
+ range: exports_external.enum(["24h", "7d", "30d", "90d"]).describe("Time range"),
13000
+ route: exports_external.string().optional().describe("Filter by HTTP route"),
13001
+ percentiles: exports_external.array(exports_external.number()).optional().describe("Percentiles to compute (default [50, 95, 99])")
13002
+ }),
13003
+ execute: async (client, input) => unwrap2(await client.pulse.latency(input))
13004
+ },
13005
+ devpad_alerts_list: {
13006
+ name: "devpad_alerts_list",
13007
+ description: "List notification subscriptions (alerts) for a project",
13008
+ inputSchema: exports_external.object({
13009
+ project_id: exports_external.string().describe("Project ID")
13010
+ }),
13011
+ execute: async (client, input) => unwrap2(await client.pulse.subs.list(input))
13012
+ },
13013
+ devpad_alerts_subscribe: {
13014
+ name: "devpad_alerts_subscribe",
13015
+ description: "Create a new notification subscription (alert) for events",
13016
+ inputSchema: exports_external.object({
13017
+ project_id: exports_external.string().describe("Project ID"),
13018
+ name: exports_external.string().describe("Subscription name"),
13019
+ filter: exports_external.record(exports_external.any()).describe("Event filter (name, level, url_pattern, properties)"),
13020
+ channel: exports_external.record(exports_external.any()).describe("Notification channel (kind + config: discord, ntfy, email)"),
13021
+ cooldown_seconds: exports_external.number().optional().describe("Cooldown between notifications (default 60)")
13022
+ }),
13023
+ execute: async (client, input) => unwrap2(await client.pulse.subs.create(input))
13024
+ },
13025
+ devpad_alerts_unsubscribe: {
13026
+ name: "devpad_alerts_unsubscribe",
13027
+ description: "Delete a notification subscription by ID",
13028
+ inputSchema: exports_external.object({
13029
+ id: exports_external.string().describe("Subscription ID")
13030
+ }),
13031
+ execute: async (client, input) => unwrap2(await client.pulse.subs.delete(input.id))
13032
+ },
13033
+ devpad_pulse_key_create: {
13034
+ name: "devpad_pulse_key_create",
13035
+ description: "Create a new ingest key for a project (returns plaintext once)",
13036
+ inputSchema: exports_external.object({
13037
+ project_id: exports_external.string().describe("Project ID"),
13038
+ name: exports_external.string().optional().describe("Key name/label"),
13039
+ rate_limit_per_min: exports_external.number().optional().describe("Rate limit in requests per minute (default 600)")
13040
+ }),
13041
+ execute: async (client, input) => unwrap2(await client.pulse.keys.create(input))
12858
13042
  }
12859
13043
  };
12860
13044
  var toolNames = Object.keys(tools);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devpad/mcp",
3
- "version": "2.1.9",
3
+ "version": "2.1.11",
4
4
  "description": "MCP server for devpad - exposes devpad API functionality via Model Context Protocol",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",